@slidev/cli 0.33.1 → 0.34.2

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,15 +8,13 @@
8
8
 
9
9
 
10
10
 
11
-
12
-
13
- var _chunkIP7ZGKHIjs = require('./chunk-IP7ZGKHI.js');
11
+ var _chunkSQLX75IOjs = require('./chunk-SQLX75IO.js');
14
12
 
15
13
  // ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
16
- var require_fast_deep_equal = _chunkIP7ZGKHIjs.__commonJS.call(void 0, {
14
+ var require_fast_deep_equal = _chunkSQLX75IOjs.__commonJS.call(void 0, {
17
15
  "../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
18
16
  "use strict";
19
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
17
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
20
18
  module.exports = function equal2(a, b) {
21
19
  if (a === b)
22
20
  return true;
@@ -59,7 +57,7 @@ var require_fast_deep_equal = _chunkIP7ZGKHIjs.__commonJS.call(void 0, {
59
57
  });
60
58
 
61
59
  // node/common.ts
62
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
60
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
63
61
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
64
62
  var _path = require('path');
65
63
  var _utils = require('@antfu/utils');
@@ -88,8 +86,8 @@ ${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) |
88
86
  body += '\n<script async src="https://platform.twitter.com/widgets.js"><\/script>';
89
87
  if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
90
88
  head += `
91
- <link rel="stylesheet" href="${_chunkIP7ZGKHIjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
92
- main = main.replace("__ENTRY__", _chunkIP7ZGKHIjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
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);
93
91
  return main;
94
92
  }
95
93
  async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config, command) {
@@ -113,21 +111,20 @@ async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config,
113
111
  }
114
112
 
115
113
  // node/plugins/windicss.ts
116
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
114
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
117
115
 
118
116
 
119
117
 
120
- var _vitepluginwindicss = require('vite-plugin-windicss'); var _vitepluginwindicss2 = _interopRequireDefault(_vitepluginwindicss);
121
118
  var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
122
119
 
123
120
  // node/plugins/setupNode.ts
124
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
121
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
125
122
 
126
123
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
127
124
 
128
125
 
129
126
  function deepMerge(a, b, rootPath = "") {
130
- a = _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, a);
127
+ a = { ...a };
131
128
  Object.keys(b).forEach((key) => {
132
129
  if (_utils.isObject.call(void 0, a[key]))
133
130
  a[key] = deepMerge(a[key], b[key], rootPath ? `${rootPath}.${key}` : key);
@@ -155,8 +152,9 @@ async function loadSetups(roots, name, arg, initial, merge = true) {
155
152
 
156
153
  // node/plugins/windicss.ts
157
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")));
158
156
  const configFiles = _utils.uniq.call(void 0, [
159
- ..._vitepluginwindicss.defaultConfigureFiles.map((i) => _path.resolve.call(void 0, userRoot, i)),
157
+ ...defaultConfigureFiles.map((i) => _path.resolve.call(void 0, userRoot, i)),
160
158
  ...themeRoots.map((i) => `${i}/windi.config.ts`),
161
159
  ...addonRoots.map((i) => `${i}/windi.config.ts`),
162
160
  _path.resolve.call(void 0, clientRoot, "windi.config.ts")
@@ -166,7 +164,7 @@ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRo
166
164
  if (config.default)
167
165
  config = config.default;
168
166
  config = await loadSetups(roots, "windicss.ts", {}, config, true);
169
- return _vitepluginwindicss2.default.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
167
+ return WindiCSS({
170
168
  configFiles: [configFile],
171
169
  config,
172
170
  onConfigResolved(config2) {
@@ -192,15 +190,17 @@ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRo
192
190
  config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
193
191
  });
194
192
  config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
195
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkIP7ZGKHIjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
196
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkIP7ZGKHIjs.resolveImportPath.call(void 0, "katex/package.json", true)));
197
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkIP7ZGKHIjs.resolveImportPath.call(void 0, "prettier/package.json", true)));
198
- }
199
- }, windiOptions));
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
+ });
200
199
  }
201
200
 
202
201
  // node/plugins/preset.ts
203
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
202
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
203
+
204
204
  var _pluginvue = require('@vitejs/plugin-vue'); var _pluginvue2 = _interopRequireDefault(_pluginvue);
205
205
  var _vite3 = require('unplugin-icons/vite'); var _vite4 = _interopRequireDefault(_vite3);
206
206
  var _resolver = require('unplugin-icons/resolver'); var _resolver2 = _interopRequireDefault(_resolver);
@@ -210,7 +210,7 @@ var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepl
210
210
 
211
211
 
212
212
  // node/drawings.ts
213
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
213
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
214
214
 
215
215
 
216
216
  var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
@@ -256,7 +256,7 @@ ${value}
256
256
  }
257
257
 
258
258
  // node/plugins/extendConfig.ts
259
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
259
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
260
260
 
261
261
 
262
262
  var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
@@ -267,7 +267,8 @@ var dependencies = {
267
267
  "@antfu/utils": "^0.5.2",
268
268
  "@slidev/parser": "workspace:*",
269
269
  "@slidev/types": "workspace:*",
270
- "@vueuse/core": "^8.7.4",
270
+ "@unocss/reset": "^0.42.0",
271
+ "@vueuse/core": "^8.7.5",
271
272
  "@vueuse/head": "^0.7.6",
272
273
  "@vueuse/motion": "^2.0.0-beta.18",
273
274
  codemirror: "^5.65.5",
@@ -277,21 +278,22 @@ var dependencies = {
277
278
  "js-base64": "^3.7.2",
278
279
  "js-yaml": "^4.1.0",
279
280
  katex: "^0.16.0",
280
- mermaid: "^9.1.2",
281
+ mermaid: "^9.1.3",
281
282
  "monaco-editor": "^0.33.0",
282
283
  nanoid: "^4.0.0",
283
284
  prettier: "^2.7.1",
284
285
  recordrtc: "^5.6.2",
285
286
  resolve: "^1.22.1",
286
- "vite-plugin-windicss": "^1.8.4",
287
- vue: "^3.2.36",
287
+ unocss: "^0.42.0",
288
+ "vite-plugin-windicss": "^1.8.6",
289
+ vue: "^3.2.37",
288
290
  "vue-router": "^4.0.16",
289
291
  "vue-starport": "^0.3.0",
290
- windicss: "^3.5.4"
292
+ windicss: "^3.5.5"
291
293
  };
292
294
 
293
295
  // node/vite/searchRoot.ts
294
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
296
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
295
297
 
296
298
 
297
299
  var ROOT_FILES = [
@@ -339,6 +341,8 @@ var EXCLUDE = [
339
341
  "@slidev/types",
340
342
  "@vueuse/core",
341
343
  "@vueuse/shared",
344
+ "@unocss/reset",
345
+ "unocss",
342
346
  "mermaid",
343
347
  "vite-plugin-windicss",
344
348
  "vue-demi"
@@ -346,12 +350,12 @@ var EXCLUDE = [
346
350
  function createConfigPlugin(options) {
347
351
  return {
348
352
  name: "slidev:config",
349
- config(config) {
353
+ async config(config) {
350
354
  const injection = {
351
355
  define: getDefine(options),
352
356
  resolve: {
353
357
  alias: {
354
- "@slidev/client/": `${_chunkIP7ZGKHIjs.toAtFS.call(void 0, options.clientRoot)}/`
358
+ "@slidev/client/": `${_chunkSQLX75IOjs.toAtFS.call(void 0, options.clientRoot)}/`
355
359
  }
356
360
  },
357
361
  optimizeDeps: {
@@ -372,13 +376,20 @@ function createConfigPlugin(options) {
372
376
  ],
373
377
  exclude: EXCLUDE
374
378
  },
379
+ css: options.data.config.css === "unocss" ? {
380
+ postcss: {
381
+ plugins: [
382
+ await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "postcss-nested"))).then((r) => r.default())
383
+ ]
384
+ }
385
+ } : {},
375
386
  server: {
376
387
  fs: {
377
388
  strict: true,
378
389
  allow: _utils.uniq.call(void 0, [
379
390
  searchForWorkspaceRoot(options.userRoot),
380
391
  searchForWorkspaceRoot(options.cliRoot),
381
- ..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkIP7ZGKHIjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkIP7ZGKHIjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
392
+ ..._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"))] : []
382
393
  ])
383
394
  }
384
395
  }
@@ -387,7 +398,7 @@ function createConfigPlugin(options) {
387
398
  injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
388
399
  injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
389
400
  injection.root = options.cliRoot;
390
- injection.resolve.alias.vue = `${_chunkIP7ZGKHIjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
401
+ injection.resolve.alias.vue = `${_chunkSQLX75IOjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
391
402
  }
392
403
  return _vite.mergeConfig.call(void 0, config, injection);
393
404
  },
@@ -408,7 +419,7 @@ function createConfigPlugin(options) {
408
419
  }
409
420
  function getDefine(options) {
410
421
  return {
411
- __SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkIP7ZGKHIjs.toAtFS.call(void 0, options.clientRoot)),
422
+ __SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkSQLX75IOjs.toAtFS.call(void 0, options.clientRoot)),
412
423
  __SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
413
424
  __SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
414
425
  __SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
@@ -418,8 +429,8 @@ function getDefine(options) {
418
429
  }
419
430
 
420
431
  // node/plugins/loaders.ts
421
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
422
- var import_fast_deep_equal = _chunkIP7ZGKHIjs.__toESM.call(void 0, require_fast_deep_equal());
432
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
433
+ var import_fast_deep_equal = _chunkSQLX75IOjs.__toESM.call(void 0, require_fast_deep_equal());
423
434
 
424
435
 
425
436
 
@@ -430,13 +441,13 @@ var _fs3 = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_f
430
441
  var regexId = /^\/\@slidev\/slide\/(\d+)\.(md|json)(?:\?import)?$/;
431
442
  var regexIdQuery = /(\d+?)\.(md|json)$/;
432
443
  function getBodyJson(req) {
433
- return new Promise((resolve5, reject) => {
444
+ return new Promise((resolve6, reject) => {
434
445
  let body = "";
435
446
  req.on("data", (chunk) => body += chunk);
436
447
  req.on("error", reject);
437
448
  req.on("end", () => {
438
449
  try {
439
- resolve5(JSON.parse(body) || {});
450
+ resolve6(JSON.parse(body) || {});
440
451
  } catch (e) {
441
452
  reject(e);
442
453
  }
@@ -451,9 +462,10 @@ md.use(_markdownitlinkattributes2.default, {
451
462
  }
452
463
  });
453
464
  function prepareSlideInfo(data) {
454
- return _chunkIP7ZGKHIjs.__spreadProps.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, data), {
465
+ return {
466
+ ...data,
455
467
  notesHTML: md.render((data == null ? void 0 : data.note) || "")
456
- });
468
+ };
457
469
  }
458
470
  function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, userRoot, roots, remote }, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin) {
459
471
  const slidePrefix = "/@slidev/slides/";
@@ -542,13 +554,14 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
542
554
  const file = `${slidePrefix}${i + 1}.md`;
543
555
  try {
544
556
  const md2 = await transformMarkdown(await MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
545
- return await VuePlugin.handleHotUpdate(_chunkIP7ZGKHIjs.__spreadProps.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, ctx), {
557
+ return await VuePlugin.handleHotUpdate({
558
+ ...ctx,
546
559
  modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
547
560
  file,
548
561
  read() {
549
562
  return md2;
550
563
  }
551
- }));
564
+ });
552
565
  } catch (e3) {
553
566
  }
554
567
  }))).flatMap((i) => i || []);
@@ -591,7 +604,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
591
604
  code: data.slides.map(({ title }, i) => {
592
605
  return `<template ${i === 0 ? "v-if" : "v-else-if"}="+no === ${i + 1}">${title}</template>`;
593
606
  }).join(""),
594
- map: {}
607
+ map: { mappings: "" }
595
608
  };
596
609
  }
597
610
  if (id.startsWith(slidePrefix)) {
@@ -603,13 +616,13 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
603
616
  if (type === "md") {
604
617
  return {
605
618
  code: (_a = data.slides[pageNo]) == null ? void 0 : _a.content,
606
- map: {}
619
+ map: { mappings: "" }
607
620
  };
608
621
  }
609
622
  }
610
623
  return {
611
624
  code: "",
612
- map: {}
625
+ map: { mappings: "" }
613
626
  };
614
627
  }
615
628
  }
@@ -659,14 +672,17 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, addonRoots, u
659
672
  async function transformMarkdown(code, pageNo, data2) {
660
673
  var _a, _b;
661
674
  const layouts = await getLayouts();
662
- const frontmatter = _chunkIP7ZGKHIjs.__spreadValues.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
675
+ const frontmatter = {
676
+ ...((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {},
677
+ ...((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {}
678
+ };
663
679
  const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
664
680
  if (!layouts[layoutName])
665
681
  throw new Error(`Unknown layout "${layoutName}"`);
666
682
  delete frontmatter.title;
667
683
  const imports = [
668
684
  'import { inject as vueInject } from "vue"',
669
- `import InjectedLayout from "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, layouts[layoutName])}"`,
685
+ `import InjectedLayout from "${_chunkSQLX75IOjs.toAtFS.call(void 0, layouts[layoutName])}"`,
670
686
  'import { injectionSlidevContext } from "@slidev/client/constants"',
671
687
  `const frontmatter = ${JSON.stringify(frontmatter)}`,
672
688
  "const $slidev = vueInject(injectionSlidevContext)"
@@ -770,9 +786,9 @@ defineProps<{ no: number | string }>()`);
770
786
  }
771
787
  async function generateUserStyles() {
772
788
  const imports = [
773
- `import "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
774
- `import "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
775
- `import "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
789
+ `import "${_chunkSQLX75IOjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
790
+ `import "${_chunkSQLX75IOjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
791
+ `import "${_chunkSQLX75IOjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
776
792
  ];
777
793
  const roots2 = _utils.uniq.call(void 0, [
778
794
  ...themeRoots,
@@ -789,13 +805,20 @@ defineProps<{ no: number | string }>()`);
789
805
  ];
790
806
  for (const style of styles) {
791
807
  if (_fsextra.existsSync.call(void 0, style)) {
792
- imports.push(`import "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, style)}"`);
808
+ imports.push(`import "${_chunkSQLX75IOjs.toAtFS.call(void 0, style)}"`);
793
809
  continue;
794
810
  }
795
811
  }
796
812
  }
797
813
  if (data.features.katex)
798
- imports.push(`import "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, _chunkIP7ZGKHIjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
814
+ imports.push(`import "${_chunkSQLX75IOjs.toAtFS.call(void 0, _chunkSQLX75IOjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
815
+ if (data.config.css === "unocss") {
816
+ imports.unshift('import "@unocss/reset/tailwind.css"', 'import "uno:preflights.css"', 'import "uno:typography.css"', 'import "uno:shortcuts.css"');
817
+ imports.push('import "uno.css"');
818
+ } else {
819
+ imports.unshift('import "virtual:windi-components.css"', 'import "virtual:windi-base.css"');
820
+ imports.push('import "virtual:windi-utilities.css"', 'import "virtual:windi-devtools"');
821
+ }
799
822
  return imports.join("\n");
800
823
  }
801
824
  async function generateMonacoTypes() {
@@ -804,7 +827,7 @@ defineProps<{ no: number | string }>()`);
804
827
  async function generateLayouts() {
805
828
  const imports = [];
806
829
  const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
807
- imports.push(`import __layout_${k} from "${_chunkIP7ZGKHIjs.toAtFS.call(void 0, v)}"`);
830
+ imports.push(`import __layout_${k} from "${_chunkSQLX75IOjs.toAtFS.call(void 0, v)}"`);
808
831
  return [k, `__layout_${k}`];
809
832
  });
810
833
  return [
@@ -826,11 +849,12 @@ ${Object.entries(layouts).map(([k, v]) => `"${k}": ${v}`).join(",\n")}
826
849
  return void 0;
827
850
  imports.push(`import n${no} from '${slidePrefix}${idx + 1}.md'`);
828
851
  const additions = {
829
- slide: _chunkIP7ZGKHIjs.__spreadProps.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, prepareSlideInfo(i)), {
852
+ slide: {
853
+ ...prepareSlideInfo(i),
830
854
  filepath: ((_b = i.source) == null ? void 0 : _b.filepath) || entry,
831
855
  id: idx,
832
856
  no
833
- }),
857
+ },
834
858
  __clicksElements: [],
835
859
  __preloaded: false
836
860
  };
@@ -848,10 +872,10 @@ ${routes.join(",\n")}
848
872
  return [...imports, routesStr].join("\n");
849
873
  }
850
874
  function generateConfigs() {
851
- const config = _chunkIP7ZGKHIjs.__spreadProps.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, data.config), { remote });
875
+ const config = { ...data.config, remote };
852
876
  if (_utils.isString.call(void 0, config.title)) {
853
877
  const tokens = md.parseInline(config.title, {});
854
- config.title = _chunkIP7ZGKHIjs.stringifyMarkdownTokens.call(void 0, tokens);
878
+ config.title = _chunkSQLX75IOjs.stringifyMarkdownTokens.call(void 0, tokens);
855
879
  }
856
880
  if (_utils.isString.call(void 0, config.info))
857
881
  config.info = md.render(config.info);
@@ -872,7 +896,7 @@ ${routes.join(",\n")}
872
896
  ];
873
897
  }
874
898
  }).filter((i) => _fsextra2.default.existsSync(i));
875
- const imports = components.map((i, idx) => `import __n${idx} from '${_chunkIP7ZGKHIjs.toAtFS.call(void 0, i)}'`).join("\n");
899
+ const imports = components.map((i, idx) => `import __n${idx} from '${_chunkSQLX75IOjs.toAtFS.call(void 0, i)}'`).join("\n");
876
900
  const render = components.map((i, idx) => `h(__n${idx})`).join(",");
877
901
  return `
878
902
  ${imports}
@@ -891,7 +915,7 @@ export default {
891
915
  _path.join.call(void 0, root, "CustomNavControls.vue")
892
916
  ];
893
917
  }).filter((i) => _fsextra2.default.existsSync(i));
894
- const imports = components.map((i, idx) => `import __n${idx} from '${_chunkIP7ZGKHIjs.toAtFS.call(void 0, i)}'`).join("\n");
918
+ const imports = components.map((i, idx) => `import __n${idx} from '${_chunkSQLX75IOjs.toAtFS.call(void 0, i)}'`).join("\n");
895
919
  const render = components.map((i, idx) => `h(__n${idx})`).join(",");
896
920
  return `
897
921
  ${imports}
@@ -906,7 +930,7 @@ export default {
906
930
  }
907
931
 
908
932
  // node/plugins/monacoTransform.ts
909
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
933
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
910
934
 
911
935
 
912
936
 
@@ -940,7 +964,7 @@ function createMonacoTypesLoader() {
940
964
  }
941
965
 
942
966
  // node/plugins/setupClient.ts
943
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
967
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
944
968
 
945
969
 
946
970
 
@@ -963,7 +987,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
963
987
  setups.forEach((path, idx) => {
964
988
  if (!_fs.existsSync.call(void 0, path))
965
989
  return;
966
- imports.push(`import __n${idx} from '${_chunkIP7ZGKHIjs.toAtFS.call(void 0, path)}'`);
990
+ imports.push(`import __n${idx} from '${_chunkSQLX75IOjs.toAtFS.call(void 0, path)}'`);
967
991
  let fn = `__n${idx}`;
968
992
  let awaitFn = `await __n${idx}`;
969
993
  if (/\binjection_return\b/g.test(code)) {
@@ -991,7 +1015,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
991
1015
  }
992
1016
 
993
1017
  // node/plugins/markdown.ts
994
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
1018
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
995
1019
  var _vitepluginvuemarkdown = require('vite-plugin-vue-markdown'); var _vitepluginvuemarkdown2 = _interopRequireDefault(_vitepluginvuemarkdown);
996
1020
  var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
997
1021
 
@@ -1001,7 +1025,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
1001
1025
  var _plantumlencoder = require('plantuml-encoder');
1002
1026
 
1003
1027
  // node/plugins/markdown-it-katex.ts
1004
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
1028
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
1005
1029
  var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
1006
1030
  function isValidDelim(state, pos) {
1007
1031
  const max = state.posMax;
@@ -1148,7 +1172,7 @@ function math_plugin(md2, options) {
1148
1172
  }
1149
1173
 
1150
1174
  // node/plugins/markdown-it-prism.ts
1151
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
1175
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
1152
1176
  var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
1153
1177
  var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
1154
1178
  var DEFAULTS = {
@@ -1171,7 +1195,7 @@ function loadPrismLang(lang) {
1171
1195
  }
1172
1196
  function loadPrismPlugin(name) {
1173
1197
  try {
1174
- _chunkIP7ZGKHIjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
1198
+ _chunkSQLX75IOjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
1175
1199
  } catch (e) {
1176
1200
  throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
1177
1201
  }
@@ -1211,7 +1235,7 @@ function markdownItPrism(markdownit, useroptions) {
1211
1235
  }
1212
1236
 
1213
1237
  // node/plugins/markdown-it-shiki.ts
1214
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
1238
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
1215
1239
  function getThemeName(theme) {
1216
1240
  if (typeof theme === "string")
1217
1241
  return theme;
@@ -1233,13 +1257,14 @@ function resolveShikiOptions(options) {
1233
1257
  themes.push(options.theme);
1234
1258
  }
1235
1259
  }
1236
- return _chunkIP7ZGKHIjs.__spreadProps.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {}, options), {
1260
+ return {
1261
+ ...options,
1237
1262
  themes,
1238
1263
  darkModeThemes: darkModeThemes ? {
1239
1264
  dark: getThemeName(darkModeThemes.dark),
1240
1265
  light: getThemeName(darkModeThemes.light)
1241
1266
  } : void 0
1242
- });
1267
+ };
1243
1268
  }
1244
1269
  function trimEndNewLine(code) {
1245
1270
  return code.replace(/\n$/, "");
@@ -1250,11 +1275,11 @@ var MarkdownItShiki = (markdownit, options = {}) => {
1250
1275
  markdownit.options.highlight = (code, lang) => {
1251
1276
  if (darkModeThemes) {
1252
1277
  const trimmed = trimEndNewLine(code);
1253
- const dark = _highlighter.codeToHtml(trimmed, lang || "text", darkModeThemes.dark).replace('<pre class="shiki"', '<pre class="slidev-code shiki shiki-dark"');
1254
- const light = _highlighter.codeToHtml(trimmed, lang || "text", darkModeThemes.light).replace('<pre class="shiki"', '<pre class="slidev-code shiki shiki-light"');
1278
+ const dark = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.dark }).replace('<pre class="shiki"', '<pre class="slidev-code shiki shiki-dark"');
1279
+ const light = _highlighter.codeToHtml(trimmed, { lang: lang || "text", theme: darkModeThemes.light }).replace('<pre class="shiki"', '<pre class="slidev-code shiki shiki-light"');
1255
1280
  return escapeVueInCode(`<pre class="shiki-container">${dark}${light}</pre>`);
1256
1281
  } else {
1257
- return escapeVueInCode(_highlighter.codeToHtml(code, lang || "text").replace('<pre class="shiki"', '<pre class="slidev-code shiki"'));
1282
+ return escapeVueInCode(_highlighter.codeToHtml(code, { lang: lang || "text" }).replace('<pre class="shiki"', '<pre class="slidev-code shiki"'));
1258
1283
  }
1259
1284
  };
1260
1285
  };
@@ -1271,7 +1296,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1271
1296
  const setups = [];
1272
1297
  const entryPath = _utils.slash.call(void 0, entry);
1273
1298
  if (config.highlighter === "shiki") {
1274
- const { getHighlighter } = await Promise.resolve().then(() => _chunkIP7ZGKHIjs.__toESM.call(void 0, _chunkIP7ZGKHIjs.__require.call(void 0, "shiki")));
1299
+ const { getHighlighter } = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "shiki")));
1275
1300
  const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
1276
1301
  const { langs, themes } = resolveShikiOptions(shikiOptions);
1277
1302
  shikiOptions.highlighter = await getHighlighter({ themes, langs });
@@ -1280,17 +1305,18 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1280
1305
  setups.push((md2) => md2.use(markdownItPrism));
1281
1306
  }
1282
1307
  const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
1283
- return _vitepluginvuemarkdown2.default.call(void 0, _chunkIP7ZGKHIjs.__spreadProps.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
1308
+ return _vitepluginvuemarkdown2.default.call(void 0, {
1284
1309
  wrapperClasses: "",
1285
1310
  headEnabled: false,
1286
1311
  frontmatter: false,
1287
- markdownItOptions: _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
1312
+ markdownItOptions: {
1288
1313
  quotes: `""''`,
1289
1314
  html: true,
1290
1315
  xhtmlOut: true,
1291
- linkify: true
1292
- }, mdOptions == null ? void 0 : mdOptions.markdownItOptions)
1293
- }, mdOptions), {
1316
+ linkify: true,
1317
+ ...mdOptions == null ? void 0 : mdOptions.markdownItOptions
1318
+ },
1319
+ ...mdOptions,
1294
1320
  markdownItSetup(md2) {
1295
1321
  var _a;
1296
1322
  md2.use(_markdownitlinkattributes2.default, {
@@ -1318,7 +1344,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1318
1344
  return code;
1319
1345
  }
1320
1346
  }
1321
- }));
1347
+ });
1322
1348
  }
1323
1349
  function transformMarkdownMonaco(md2) {
1324
1350
  md2 = md2.replace(/^```(\w+?)\s*{monaco}\s*?({.*?})?\s*?\n([\s\S]+?)^```/mg, (full, lang = "ts", options = "{}", code) => {
@@ -1351,18 +1377,18 @@ function transformSlotSugar(md2) {
1351
1377
  return lines.join("\n");
1352
1378
  }
1353
1379
  function transformHighlighter(md2) {
1354
- return md2.replace(/^```(\w+?)\s*{([\d\w*,\|-]+)}\s*?({.*?})?\s*?\n([\s\S]+?)^```/mg, (full, lang = "", rangeStr, options = "", code) => {
1380
+ return md2.replace(/^```(\w+?)(?:\s*{([\d\w*,\|-]+)}\s*?({.*?})?\s*?)?\n([\s\S]+?)^```/mg, (full, lang = "", rangeStr = "", options = "", code) => {
1355
1381
  const ranges = rangeStr.split(/\|/g).map((i) => i.trim());
1356
1382
  code = code.trimEnd();
1357
1383
  options = options.trim() || "{}";
1358
1384
  return `
1359
- <CodeHighlightController v-bind="${options}" :ranges='${JSON.stringify(ranges)}'>
1385
+ <CodeBlockWrapper v-bind="${options}" :ranges='${JSON.stringify(ranges)}'>
1360
1386
 
1361
1387
  \`\`\`${lang}
1362
1388
  ${code}
1363
1389
  \`\`\`
1364
1390
 
1365
- </CodeHighlightController>`;
1391
+ </CodeBlockWrapper>`;
1366
1392
  });
1367
1393
  }
1368
1394
  function getCodeBlocks(md2) {
@@ -1420,7 +1446,7 @@ function escapeVueInCode(md2) {
1420
1446
  }
1421
1447
 
1422
1448
  // node/plugins/patchTransform.ts
1423
- _chunkIP7ZGKHIjs.init_cjs_shims.call(void 0, );
1449
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
1424
1450
 
1425
1451
  function createFixPlugins(options) {
1426
1452
  const define = _utils.objectEntries.call(void 0, getDefine(options));
@@ -1440,6 +1466,36 @@ function createFixPlugins(options) {
1440
1466
  ];
1441
1467
  }
1442
1468
 
1469
+ // node/plugins/unocss.ts
1470
+ _chunkSQLX75IOjs.init_cjs_shims.call(void 0, );
1471
+
1472
+
1473
+
1474
+
1475
+ async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, data }, { unocss: unoOptions }) {
1476
+ var _a, _b, _c, _d;
1477
+ const UnoCSS = await Promise.resolve().then(() => _chunkSQLX75IOjs.__toESM.call(void 0, _chunkSQLX75IOjs.__require.call(void 0, "unocss/vite"))).then((r) => r.default);
1478
+ const configFiles = _utils.uniq.call(void 0, [
1479
+ ...themeRoots.map((i) => `${i}/uno.config.ts`),
1480
+ ...addonRoots.map((i) => `${i}/uno.config.ts`),
1481
+ _path.resolve.call(void 0, clientRoot, "uno.config.ts")
1482
+ ]);
1483
+ const configFile = configFiles.find((i) => _fs.existsSync.call(void 0, i));
1484
+ let config = _jiti2.default.call(void 0, __filename)(configFile);
1485
+ if ("default" in config)
1486
+ config = config.default;
1487
+ config = await loadSetups(roots, "unocss.ts", {}, config, true);
1488
+ config.theme || (config.theme = {});
1489
+ (_a = config.theme).fontFamily || (_a.fontFamily = {});
1490
+ (_b = config.theme.fontFamily).sans || (_b.sans = data.config.fonts.sans.join(","));
1491
+ (_c = config.theme.fontFamily).mono || (_c.mono = data.config.fonts.mono.join(","));
1492
+ (_d = config.theme.fontFamily).serif || (_d.serif = data.config.fonts.serif.join(","));
1493
+ return UnoCSS({
1494
+ configFile: false,
1495
+ ..._utils.deepMerge.call(void 0, config, unoOptions || {})
1496
+ });
1497
+ }
1498
+
1443
1499
  // node/plugins/preset.ts
1444
1500
  var customElements = /* @__PURE__ */ new Set([
1445
1501
  "annotation",
@@ -1485,31 +1541,33 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1485
1541
  clientRoot,
1486
1542
  data: { config }
1487
1543
  } = options;
1488
- const VuePlugin = _pluginvue2.default.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
1544
+ const VuePlugin = _pluginvue2.default.call(void 0, {
1489
1545
  include: [/\.vue$/, /\.md$/],
1490
1546
  exclude: [],
1491
- template: _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
1547
+ template: {
1492
1548
  compilerOptions: {
1493
1549
  isCustomElement(tag) {
1494
1550
  return customElements.has(tag);
1495
1551
  }
1496
- }
1497
- }, vueOptions == null ? void 0 : vueOptions.template)
1498
- }, vueOptions));
1552
+ },
1553
+ ...vueOptions == null ? void 0 : vueOptions.template
1554
+ },
1555
+ ...vueOptions
1556
+ });
1499
1557
  const MarkdownPlugin = await createMarkdownPlugin(options, pluginOptions);
1500
1558
  const drawingData = await loadDrawings(options);
1501
1559
  return [
1502
- await createWindiCSSPlugin(options, pluginOptions),
1560
+ config.css === "unocss" ? await createUnocssPlugin(options, pluginOptions) : await createWindiCSSPlugin(options, pluginOptions),
1503
1561
  MarkdownPlugin,
1504
1562
  VuePlugin,
1505
1563
  createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
1506
- _vite6.default.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
1564
+ _vite6.default.call(void 0, {
1507
1565
  extensions: ["vue", "md", "ts"],
1508
1566
  dirs: [
1509
- `${clientRoot}/builtin`,
1510
- `${clientRoot}/components`,
1511
- ...themeRoots.map((i) => `${i}/components`),
1512
- ...addonRoots.map((i) => `${i}/components`),
1567
+ _path.join.call(void 0, clientRoot, "builtin"),
1568
+ _path.join.call(void 0, clientRoot, "components"),
1569
+ ...themeRoots.map((i) => _path.join.call(void 0, i, "components")),
1570
+ ...addonRoots.map((i) => _path.join.call(void 0, i, "components")),
1513
1571
  "src/components",
1514
1572
  "components"
1515
1573
  ],
@@ -1520,13 +1578,15 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1520
1578
  prefix: "",
1521
1579
  customCollections: Object.keys(iconsOptions.customCollections || [])
1522
1580
  })
1523
- ]
1524
- }, componentsOptions)),
1525
- _vite4.default.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
1581
+ ],
1582
+ ...componentsOptions
1583
+ }),
1584
+ _vite4.default.call(void 0, {
1526
1585
  defaultClass: "slidev-icon",
1527
- autoInstall: true
1528
- }, iconsOptions)),
1529
- config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
1586
+ autoInstall: true,
1587
+ ...iconsOptions
1588
+ }),
1589
+ config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, {
1530
1590
  rules: [
1531
1591
  ..._vitepluginremoteassets.DefaultRules,
1532
1592
  {
@@ -1535,18 +1595,20 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1535
1595
  }
1536
1596
  ],
1537
1597
  resolveMode: (id) => id.endsWith("index.html") ? "relative" : "@fs",
1538
- awaitDownload: mode === "build"
1539
- }, remoteAssetsOptions)) : null,
1598
+ awaitDownload: mode === "build",
1599
+ ...remoteAssetsOptions
1600
+ }) : null,
1540
1601
  _vitepluginvueserverref2.default.call(void 0, {
1541
1602
  debug: process.env.NODE_ENV === "development",
1542
- state: _chunkIP7ZGKHIjs.__spreadValues.call(void 0, {
1603
+ state: {
1543
1604
  sync: false,
1544
1605
  nav: {
1545
1606
  page: 0,
1546
1607
  clicks: 0
1547
1608
  },
1548
- drawings: drawingData
1549
- }, serverRefOptions.state),
1609
+ drawings: drawingData,
1610
+ ...serverRefOptions.state
1611
+ },
1550
1612
  onChanged(key, data, patch, timestamp) {
1551
1613
  serverRefOptions.onChanged && serverRefOptions.onChanged(key, data, patch, timestamp);
1552
1614
  if (!options.data.config.drawings.persist)