@slidev/cli 0.25.4 → 0.25.8

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.
@@ -9,12 +9,12 @@
9
9
 
10
10
 
11
11
 
12
- var _chunkZKLT77C5js = require('./chunk-ZKLT77C5.js');
12
+ var _chunkQIDQYQEGjs = require('./chunk-QIDQYQEG.js');
13
13
 
14
14
  // ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
15
- var require_fast_deep_equal = _chunkZKLT77C5js.__commonJS.call(void 0, {
15
+ var require_fast_deep_equal = _chunkQIDQYQEGjs.__commonJS.call(void 0, {
16
16
  "../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
17
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
17
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
18
18
  "use strict";
19
19
  module.exports = function equal2(a, b) {
20
20
  if (a === b)
@@ -58,7 +58,7 @@ var require_fast_deep_equal = _chunkZKLT77C5js.__commonJS.call(void 0, {
58
58
  });
59
59
 
60
60
  // node/common.ts
61
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
61
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
62
62
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
63
63
  var _path = require('path');
64
64
  var _utils = require('@antfu/utils');
@@ -85,13 +85,13 @@ ${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) |
85
85
  body += '\n<script async src="https://platform.twitter.com/widgets.js"><\/script>';
86
86
  if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
87
87
  head += `
88
- <link rel="stylesheet" href="${_chunkZKLT77C5js.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
89
- main = main.replace("__ENTRY__", _chunkZKLT77C5js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
88
+ <link rel="stylesheet" href="${_chunkQIDQYQEGjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
89
+ main = main.replace("__ENTRY__", _chunkQIDQYQEGjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
90
90
  return main;
91
91
  }
92
92
 
93
93
  // node/plugins/windicss.ts
94
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
94
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
95
95
 
96
96
 
97
97
 
@@ -99,13 +99,13 @@ var _vitepluginwindicss = require('vite-plugin-windicss'); var _vitepluginwindic
99
99
  var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
100
100
 
101
101
  // node/plugins/setupNode.ts
102
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
102
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
103
103
 
104
104
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
105
105
 
106
106
 
107
107
  function deepMerge(a, b, rootPath = "") {
108
- a = _chunkZKLT77C5js.__spreadValues.call(void 0, {}, a);
108
+ a = _chunkQIDQYQEGjs.__spreadValues.call(void 0, {}, a);
109
109
  Object.keys(b).forEach((key) => {
110
110
  if (_utils.isObject.call(void 0, a[key]))
111
111
  a[key] = deepMerge(a[key], b[key], rootPath ? `${rootPath}.${key}` : key);
@@ -143,7 +143,7 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
143
143
  if (config.default)
144
144
  config = config.default;
145
145
  config = await loadSetups(roots, "windicss.ts", {}, config, true);
146
- return _vitepluginwindicss2.default.call(void 0, _chunkZKLT77C5js.__spreadValues.call(void 0, {
146
+ return _vitepluginwindicss2.default.call(void 0, _chunkQIDQYQEGjs.__spreadValues.call(void 0, {
147
147
  configFiles: [configFile],
148
148
  config,
149
149
  onConfigResolved(config2) {
@@ -165,15 +165,15 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
165
165
  config2.scanOptions.include.push(`${i}/layouts/*.{vue,ts}`);
166
166
  });
167
167
  config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
168
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkZKLT77C5js.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
169
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkZKLT77C5js.resolveImportPath.call(void 0, "katex/package.json", true)));
170
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkZKLT77C5js.resolveImportPath.call(void 0, "prettier/package.json", true)));
168
+ config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkQIDQYQEGjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
169
+ config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkQIDQYQEGjs.resolveImportPath.call(void 0, "katex/package.json", true)));
170
+ config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkQIDQYQEGjs.resolveImportPath.call(void 0, "prettier/package.json", true)));
171
171
  }
172
172
  }, windiOptions));
173
173
  }
174
174
 
175
175
  // node/plugins/preset.ts
176
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
176
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
177
177
  var _pluginvue = require('@vitejs/plugin-vue'); var _pluginvue2 = _interopRequireDefault(_pluginvue);
178
178
  var _vite = require('unplugin-icons/vite'); var _vite2 = _interopRequireDefault(_vite);
179
179
  var _resolver = require('unplugin-icons/resolver'); var _resolver2 = _interopRequireDefault(_resolver);
@@ -183,7 +183,7 @@ var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepl
183
183
 
184
184
 
185
185
  // node/drawings.ts
186
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
186
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
187
187
 
188
188
 
189
189
  var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
@@ -229,7 +229,7 @@ ${value}
229
229
  }
230
230
 
231
231
  // node/plugins/extendConfig.ts
232
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
232
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
233
233
 
234
234
  var _vite5 = require('vite');
235
235
  var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
@@ -241,29 +241,29 @@ var dependencies = {
241
241
  "@antfu/utils": "^0.3.0",
242
242
  "@slidev/parser": "workspace:*",
243
243
  "@slidev/types": "workspace:*",
244
- "@vueuse/core": "^6.4.0",
244
+ "@vueuse/core": "^6.5.3",
245
245
  "@vueuse/head": "^0.6.0",
246
246
  "@vueuse/motion": "^1.6.0",
247
- codemirror: "^5.62.3",
247
+ codemirror: "^5.63.0",
248
248
  drauu: "^0.2.0",
249
249
  "file-saver": "^2.0.5",
250
- "js-base64": "^3.7.1",
250
+ "js-base64": "^3.7.2",
251
251
  "js-yaml": "^4.1.0",
252
252
  katex: "^0.13.18",
253
- mermaid: "^8.12.1",
254
- "monaco-editor": "^0.27.0",
255
- nanoid: "^3.1.25",
253
+ mermaid: "^8.13.0",
254
+ "monaco-editor": "^0.28.1",
255
+ nanoid: "^3.1.28",
256
256
  prettier: "^2.4.1",
257
257
  recordrtc: "^5.6.2",
258
258
  resolve: "^1.20.0",
259
- "vite-plugin-windicss": "^1.4.3",
260
- vue: "^3.2.12",
259
+ "vite-plugin-windicss": "^1.4.7",
260
+ vue: "^3.2.19",
261
261
  "vue-router": "^4.0.11",
262
262
  windicss: "^3.1.7"
263
263
  };
264
264
 
265
265
  // node/vite/searchRoot.ts
266
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
266
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
267
267
 
268
268
 
269
269
  var ROOT_FILES = [
@@ -323,7 +323,7 @@ function createConfigPlugin(options) {
323
323
  define: getDefine(options),
324
324
  resolve: {
325
325
  alias: {
326
- "@slidev/client/": `${_chunkZKLT77C5js.toAtFS.call(void 0, options.clientRoot)}/`
326
+ "@slidev/client/": `${_chunkQIDQYQEGjs.toAtFS.call(void 0, options.clientRoot)}/`
327
327
  }
328
328
  },
329
329
  optimizeDeps: {
@@ -357,7 +357,7 @@ function createConfigPlugin(options) {
357
357
  if (_isinstalledglobally2.default) {
358
358
  injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
359
359
  injection.root = options.cliRoot;
360
- injection.resolve.alias.vue = `${_chunkZKLT77C5js.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
360
+ injection.resolve.alias.vue = `${_chunkQIDQYQEGjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
361
361
  }
362
362
  return _vite5.mergeConfig.call(void 0, config, injection);
363
363
  },
@@ -378,7 +378,7 @@ function createConfigPlugin(options) {
378
378
  }
379
379
  function getDefine(options) {
380
380
  return {
381
- __SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkZKLT77C5js.toAtFS.call(void 0, options.clientRoot)),
381
+ __SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkQIDQYQEGjs.toAtFS.call(void 0, options.clientRoot)),
382
382
  __SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
383
383
  __SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
384
384
  __SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
@@ -387,8 +387,8 @@ function getDefine(options) {
387
387
  }
388
388
 
389
389
  // node/plugins/loaders.ts
390
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
391
- var import_fast_deep_equal = _chunkZKLT77C5js.__toModule.call(void 0, require_fast_deep_equal());
390
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
391
+ var import_fast_deep_equal = _chunkQIDQYQEGjs.__toModule.call(void 0, require_fast_deep_equal());
392
392
 
393
393
 
394
394
 
@@ -425,7 +425,7 @@ md.use(_markdownitlinkattributes2.default, {
425
425
  }
426
426
  });
427
427
  function prepareSlideInfo(data) {
428
- return _chunkZKLT77C5js.__spreadProps.call(void 0, _chunkZKLT77C5js.__spreadValues.call(void 0, {}, data), {
428
+ return _chunkQIDQYQEGjs.__spreadProps.call(void 0, _chunkQIDQYQEGjs.__spreadValues.call(void 0, {}, data), {
429
429
  notesHTML: md.render((data == null ? void 0 : data.note) || "")
430
430
  });
431
431
  }
@@ -464,6 +464,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
464
464
  await _fs3.save.call(void 0, data, entry);
465
465
  }
466
466
  res.statusCode = 200;
467
+ res.write(JSON.stringify(prepareSlideInfo(slide)));
467
468
  return res.end();
468
469
  }
469
470
  next();
@@ -492,11 +493,9 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
492
493
  }
493
494
  const length = Math.max(data.slides.length, newData.slides.length);
494
495
  for (let i = 0; i < length; i++) {
495
- if (hmrPages.has(i))
496
- continue;
497
496
  const a = data.slides[i];
498
497
  const b = newData.slides[i];
499
- if ((a == null ? void 0 : a.content.trim()) === (b == null ? void 0 : b.content.trim()) && (0, import_fast_deep_equal.default)(a.frontmatter, b.frontmatter))
498
+ if ((a == null ? void 0 : a.content.trim()) === (b == null ? void 0 : b.content.trim()) && (a == null ? void 0 : a.note) === (b == null ? void 0 : b.note) && (0, import_fast_deep_equal.default)(a.frontmatter, b.frontmatter))
500
499
  continue;
501
500
  ctx.server.ws.send({
502
501
  type: "custom",
@@ -515,7 +514,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
515
514
  const file = `${slidePrefix}${i + 1}.md`;
516
515
  try {
517
516
  const md2 = await transformMarkdown(MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
518
- return await VuePlugin.handleHotUpdate(_chunkZKLT77C5js.__spreadProps.call(void 0, _chunkZKLT77C5js.__spreadValues.call(void 0, {}, ctx), {
517
+ return await VuePlugin.handleHotUpdate(_chunkQIDQYQEGjs.__spreadProps.call(void 0, _chunkQIDQYQEGjs.__spreadValues.call(void 0, {}, ctx), {
519
518
  modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
520
519
  file,
521
520
  read() {
@@ -597,13 +596,13 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
597
596
  async function transformMarkdown(code, pageNo, data2) {
598
597
  var _a, _b;
599
598
  const layouts = await getLayouts();
600
- const frontmatter = _chunkZKLT77C5js.__spreadValues.call(void 0, _chunkZKLT77C5js.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
599
+ const frontmatter = _chunkQIDQYQEGjs.__spreadValues.call(void 0, _chunkQIDQYQEGjs.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
601
600
  const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
602
601
  if (!layouts[layoutName])
603
602
  throw new Error(`Unknown layout "${layoutName}"`);
604
603
  delete frontmatter.title;
605
604
  const imports = [
606
- `import InjectedLayout from "${_chunkZKLT77C5js.toAtFS.call(void 0, layouts[layoutName])}"`,
605
+ `import InjectedLayout from "${_chunkQIDQYQEGjs.toAtFS.call(void 0, layouts[layoutName])}"`,
607
606
  `const frontmatter = ${JSON.stringify(frontmatter)}`
608
607
  ];
609
608
  code = code.replace(/(<script setup.*>)/g, `$1
@@ -649,9 +648,9 @@ ${code.slice(injectB)}`;
649
648
  }
650
649
  async function generateUserStyles() {
651
650
  const imports = [
652
- `import "${_chunkZKLT77C5js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
653
- `import "${_chunkZKLT77C5js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
654
- `import "${_chunkZKLT77C5js.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
651
+ `import "${_chunkQIDQYQEGjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
652
+ `import "${_chunkQIDQYQEGjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
653
+ `import "${_chunkQIDQYQEGjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
655
654
  ];
656
655
  const roots2 = _utils.uniq.call(void 0, [
657
656
  ...themeRoots,
@@ -667,13 +666,13 @@ ${code.slice(injectB)}`;
667
666
  ];
668
667
  for (const style of styles) {
669
668
  if (_fsextra.existsSync.call(void 0, style)) {
670
- imports.push(`import "${_chunkZKLT77C5js.toAtFS.call(void 0, style)}"`);
669
+ imports.push(`import "${_chunkQIDQYQEGjs.toAtFS.call(void 0, style)}"`);
671
670
  continue;
672
671
  }
673
672
  }
674
673
  }
675
674
  if (data.features.katex)
676
- imports.push(`import "${_chunkZKLT77C5js.toAtFS.call(void 0, _chunkZKLT77C5js.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
675
+ imports.push(`import "${_chunkQIDQYQEGjs.toAtFS.call(void 0, _chunkQIDQYQEGjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
677
676
  return imports.join("\n");
678
677
  }
679
678
  async function generateMonacoTypes() {
@@ -682,7 +681,7 @@ ${code.slice(injectB)}`;
682
681
  async function generateLayouts() {
683
682
  const imports = [];
684
683
  const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
685
- imports.push(`import __layout_${k} from "${_chunkZKLT77C5js.toAtFS.call(void 0, v)}"`);
684
+ imports.push(`import __layout_${k} from "${_chunkQIDQYQEGjs.toAtFS.call(void 0, v)}"`);
686
685
  return [k, `__layout_${k}`];
687
686
  });
688
687
  return [
@@ -728,10 +727,10 @@ ${routes.join(",\n")}
728
727
  return [...imports, routesStr].join("\n");
729
728
  }
730
729
  function generateConfigs() {
731
- const config = _chunkZKLT77C5js.__spreadValues.call(void 0, {}, data.config);
730
+ const config = _chunkQIDQYQEGjs.__spreadValues.call(void 0, {}, data.config);
732
731
  if (_utils.isString.call(void 0, config.title)) {
733
732
  const tokens = md.parseInline(config.title, {});
734
- config.title = _chunkZKLT77C5js.stringifyMarkdownTokens.call(void 0, tokens);
733
+ config.title = _chunkQIDQYQEGjs.stringifyMarkdownTokens.call(void 0, tokens);
735
734
  }
736
735
  if (_utils.isString.call(void 0, config.info))
737
736
  config.info = md.render(config.info);
@@ -752,7 +751,7 @@ ${routes.join(",\n")}
752
751
  ];
753
752
  }
754
753
  }).filter((i) => _fsextra2.default.existsSync(i));
755
- const imports = components.map((i, idx) => `import __n${idx} from '${_chunkZKLT77C5js.toAtFS.call(void 0, i)}'`).join("\n");
754
+ const imports = components.map((i, idx) => `import __n${idx} from '${_chunkQIDQYQEGjs.toAtFS.call(void 0, i)}'`).join("\n");
756
755
  const render = components.map((i, idx) => `h(__n${idx})`).join(",");
757
756
  return `
758
757
  ${imports}
@@ -767,7 +766,7 @@ export default {
767
766
  }
768
767
 
769
768
  // node/plugins/monacoTransform.ts
770
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
769
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
771
770
 
772
771
 
773
772
 
@@ -801,7 +800,7 @@ function createMonacoTypesLoader() {
801
800
  }
802
801
 
803
802
  // node/plugins/setupClient.ts
804
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
803
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
805
804
 
806
805
 
807
806
 
@@ -823,7 +822,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
823
822
  setups.forEach((path, idx) => {
824
823
  if (!_fs.existsSync.call(void 0, path))
825
824
  return;
826
- imports.push(`import __n${idx} from '${_chunkZKLT77C5js.toAtFS.call(void 0, path)}'`);
825
+ imports.push(`import __n${idx} from '${_chunkQIDQYQEGjs.toAtFS.call(void 0, path)}'`);
827
826
  let fn = `__n${idx}`;
828
827
  let awaitFn = `await __n${idx}`;
829
828
  if (/\binjection_return\b/g.test(code)) {
@@ -851,7 +850,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
851
850
  }
852
851
 
853
852
  // node/plugins/markdown.ts
854
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
853
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
855
854
  var _vitepluginmd = require('vite-plugin-md'); var _vitepluginmd2 = _interopRequireDefault(_vitepluginmd);
856
855
  var _jsbase64 = require('js-base64'); var _jsbase642 = _interopRequireDefault(_jsbase64);
857
856
 
@@ -860,7 +859,7 @@ var _markdownitfootnote = require('markdown-it-footnote'); var _markdownitfootno
860
859
  var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
861
860
 
862
861
  // node/plugins/markdown-it-katex.ts
863
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
862
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
864
863
  var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
865
864
  function isValidDelim(state, pos) {
866
865
  const max = state.posMax;
@@ -1007,7 +1006,7 @@ function math_plugin(md2, options) {
1007
1006
  }
1008
1007
 
1009
1008
  // node/plugins/markdown-it-prism.ts
1010
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
1009
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
1011
1010
  var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
1012
1011
  var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
1013
1012
  var DEFAULTS = {
@@ -1030,7 +1029,7 @@ function loadPrismLang(lang) {
1030
1029
  }
1031
1030
  function loadPrismPlugin(name) {
1032
1031
  try {
1033
- _chunkZKLT77C5js.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
1032
+ _chunkQIDQYQEGjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
1034
1033
  } catch (e) {
1035
1034
  throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
1036
1035
  }
@@ -1070,7 +1069,7 @@ function markdownItPrism(markdownit, useroptions) {
1070
1069
  }
1071
1070
 
1072
1071
  // node/plugins/markdown-it-shiki.ts
1073
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
1072
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
1074
1073
  function getThemeName(theme) {
1075
1074
  if (typeof theme === "string")
1076
1075
  return theme;
@@ -1092,7 +1091,7 @@ function resolveShikiOptions(options) {
1092
1091
  themes.push(options.theme);
1093
1092
  }
1094
1093
  }
1095
- return _chunkZKLT77C5js.__spreadProps.call(void 0, _chunkZKLT77C5js.__spreadValues.call(void 0, {}, options), {
1094
+ return _chunkQIDQYQEGjs.__spreadProps.call(void 0, _chunkQIDQYQEGjs.__spreadValues.call(void 0, {}, options), {
1096
1095
  themes,
1097
1096
  darkModeThemes: darkModeThemes ? {
1098
1097
  dark: getThemeName(darkModeThemes.dark),
@@ -1130,7 +1129,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1130
1129
  const setups = [];
1131
1130
  const entryPath = _utils.slash.call(void 0, entry);
1132
1131
  if (config.highlighter === "shiki") {
1133
- const { getHighlighter } = await Promise.resolve().then(() => _chunkZKLT77C5js.__toModule.call(void 0, _chunkZKLT77C5js.__require.call(void 0, "shiki")));
1132
+ const { getHighlighter } = await Promise.resolve().then(() => _chunkQIDQYQEGjs.__toModule.call(void 0, _chunkQIDQYQEGjs.__require.call(void 0, "shiki")));
1134
1133
  const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
1135
1134
  const { langs, themes } = resolveShikiOptions(shikiOptions);
1136
1135
  shikiOptions.highlighter = await getHighlighter({ themes, langs });
@@ -1139,11 +1138,11 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1139
1138
  setups.push((md2) => md2.use(markdownItPrism));
1140
1139
  }
1141
1140
  const KatexOptions2 = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
1142
- return _vitepluginmd2.default.call(void 0, _chunkZKLT77C5js.__spreadProps.call(void 0, _chunkZKLT77C5js.__spreadValues.call(void 0, {
1141
+ return _vitepluginmd2.default.call(void 0, _chunkQIDQYQEGjs.__spreadProps.call(void 0, _chunkQIDQYQEGjs.__spreadValues.call(void 0, {
1143
1142
  wrapperClasses: "",
1144
1143
  headEnabled: false,
1145
1144
  frontmatter: false,
1146
- markdownItOptions: _chunkZKLT77C5js.__spreadValues.call(void 0, {
1145
+ markdownItOptions: _chunkQIDQYQEGjs.__spreadValues.call(void 0, {
1147
1146
  quotes: `""''`,
1148
1147
  html: true,
1149
1148
  xhtmlOut: true,
@@ -1272,7 +1271,7 @@ function escapeVueInCode(md2) {
1272
1271
  }
1273
1272
 
1274
1273
  // node/plugins/patchTransform.ts
1275
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
1274
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
1276
1275
 
1277
1276
  function createFixPlugins(options) {
1278
1277
  const define = _utils.objectEntries.call(void 0, getDefine(options));
@@ -1326,10 +1325,10 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1326
1325
  clientRoot,
1327
1326
  data: { config }
1328
1327
  } = options;
1329
- const VuePlugin = _pluginvue2.default.call(void 0, _chunkZKLT77C5js.__spreadValues.call(void 0, {
1328
+ const VuePlugin = _pluginvue2.default.call(void 0, _chunkQIDQYQEGjs.__spreadValues.call(void 0, {
1330
1329
  include: [/\.vue$/, /\.md$/],
1331
1330
  exclude: [],
1332
- template: _chunkZKLT77C5js.__spreadValues.call(void 0, {
1331
+ template: _chunkQIDQYQEGjs.__spreadValues.call(void 0, {
1333
1332
  compilerOptions: {
1334
1333
  isCustomElement(tag) {
1335
1334
  return customElements.has(tag);
@@ -1344,7 +1343,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1344
1343
  MarkdownPlugin,
1345
1344
  VuePlugin,
1346
1345
  createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
1347
- _vite4.default.call(void 0, _chunkZKLT77C5js.__spreadValues.call(void 0, {
1346
+ _vite4.default.call(void 0, _chunkQIDQYQEGjs.__spreadValues.call(void 0, {
1348
1347
  extensions: ["vue", "md", "ts"],
1349
1348
  dirs: [
1350
1349
  `${clientRoot}/builtin`,
@@ -1362,10 +1361,10 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1362
1361
  })
1363
1362
  ]
1364
1363
  }, componentsOptions)),
1365
- _vite2.default.call(void 0, _chunkZKLT77C5js.__spreadValues.call(void 0, {
1364
+ _vite2.default.call(void 0, _chunkQIDQYQEGjs.__spreadValues.call(void 0, {
1366
1365
  defaultClass: "slidev-icon"
1367
1366
  }, iconsOptions)),
1368
- config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunkZKLT77C5js.__spreadValues.call(void 0, {
1367
+ config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunkQIDQYQEGjs.__spreadValues.call(void 0, {
1369
1368
  rules: [
1370
1369
  ..._vitepluginremoteassets.DefaultRules,
1371
1370
  {
@@ -10094,7 +10094,7 @@ var require_semver2 = __commonJS({
10094
10094
  });
10095
10095
 
10096
10096
  // package.json
10097
- var version = "0.25.4";
10097
+ var version = "0.25.8";
10098
10098
 
10099
10099
  // node/themes.ts
10100
10100
  var import_ni = __toModule(require_dist());
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkCFZMPLS7js = require('./chunk-CFZMPLS7.js');
3
+ var _chunk5X4UZOIBjs = require('./chunk-5X4UZOIB.js');
4
4
 
5
5
 
6
- var _chunkZKLT77C5js = require('./chunk-ZKLT77C5.js');
6
+ var _chunkQIDQYQEGjs = require('./chunk-QIDQYQEG.js');
7
7
 
8
8
  // node/server.ts
9
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
9
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
10
10
  var _vite = require('vite');
11
11
  async function createServer(options, viteConfig = {}, serverOptions = {}) {
12
12
  const rawConfig = await _vite.resolveConfig.call(void 0, {}, "serve");
@@ -14,7 +14,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
14
14
  process.env.EDITOR = process.env.EDITOR || "code";
15
15
  const server = await _vite.createServer.call(void 0, _vite.mergeConfig.call(void 0, viteConfig, {
16
16
  plugins: [
17
- await _chunkCFZMPLS7js.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
17
+ await _chunk5X4UZOIBjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
18
18
  ]
19
19
  }));
20
20
  return server;
@@ -43,10 +43,10 @@ var __toModule = (module) => {
43
43
  return __reExport(__markAsModule(__defProp(module != null ? __create(__getProtoOf(module)) : {}, "default", module && module.__esModule && "default" in module ? { get: () => module.default, enumerable: true } : { value: module, enumerable: true })), module);
44
44
  };
45
45
 
46
- // ../../node_modules/.pnpm/tsup@5.1.0_typescript@4.4.3/node_modules/tsup/assets/cjs_shims.js
46
+ // ../../node_modules/.pnpm/tsup@5.2.0_typescript@4.4.3/node_modules/tsup/assets/cjs_shims.js
47
47
  var importMetaUrlShim;
48
48
  var init_cjs_shims = __esm({
49
- "../../node_modules/.pnpm/tsup@5.1.0_typescript@4.4.3/node_modules/tsup/assets/cjs_shims.js"() {
49
+ "../../node_modules/.pnpm/tsup@5.2.0_typescript@4.4.3/node_modules/tsup/assets/cjs_shims.js"() {
50
50
  importMetaUrlShim = typeof document === "undefined" ? new (__require("url")).URL("file:" + __filename).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
51
51
  }
52
52
  });
@@ -233,23 +233,23 @@ var dependencies = {
233
233
  "@antfu/utils": "^0.3.0",
234
234
  "@slidev/parser": "workspace:*",
235
235
  "@slidev/types": "workspace:*",
236
- "@vueuse/core": "^6.4.0",
236
+ "@vueuse/core": "^6.5.3",
237
237
  "@vueuse/head": "^0.6.0",
238
238
  "@vueuse/motion": "^1.6.0",
239
- codemirror: "^5.62.3",
239
+ codemirror: "^5.63.0",
240
240
  drauu: "^0.2.0",
241
241
  "file-saver": "^2.0.5",
242
- "js-base64": "^3.7.1",
242
+ "js-base64": "^3.7.2",
243
243
  "js-yaml": "^4.1.0",
244
244
  katex: "^0.13.18",
245
- mermaid: "^8.12.1",
246
- "monaco-editor": "^0.27.0",
247
- nanoid: "^3.1.25",
245
+ mermaid: "^8.13.0",
246
+ "monaco-editor": "^0.28.1",
247
+ nanoid: "^3.1.28",
248
248
  prettier: "^2.4.1",
249
249
  recordrtc: "^5.6.2",
250
250
  resolve: "^1.20.0",
251
- "vite-plugin-windicss": "^1.4.3",
252
- vue: "^3.2.12",
251
+ "vite-plugin-windicss": "^1.4.7",
252
+ vue: "^3.2.19",
253
253
  "vue-router": "^4.0.11",
254
254
  windicss: "^3.1.7"
255
255
  };
@@ -454,6 +454,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
454
454
  await save(data, entry);
455
455
  }
456
456
  res.statusCode = 200;
457
+ res.write(JSON.stringify(prepareSlideInfo(slide)));
457
458
  return res.end();
458
459
  }
459
460
  next();
@@ -482,11 +483,9 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
482
483
  }
483
484
  const length = Math.max(data.slides.length, newData.slides.length);
484
485
  for (let i = 0; i < length; i++) {
485
- if (hmrPages.has(i))
486
- continue;
487
486
  const a = data.slides[i];
488
487
  const b = newData.slides[i];
489
- if ((a == null ? void 0 : a.content.trim()) === (b == null ? void 0 : b.content.trim()) && (0, import_fast_deep_equal.default)(a.frontmatter, b.frontmatter))
488
+ if ((a == null ? void 0 : a.content.trim()) === (b == null ? void 0 : b.content.trim()) && (a == null ? void 0 : a.note) === (b == null ? void 0 : b.note) && (0, import_fast_deep_equal.default)(a.frontmatter, b.frontmatter))
490
489
  continue;
491
490
  ctx.server.ws.send({
492
491
  type: "custom",
package/dist/cli.js CHANGED
@@ -1,25 +1,25 @@
1
1
  "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkLLNTKIXIjs = require('./chunk-LLNTKIXI.js');
3
+ var _chunkDMF3GKR2js = require('./chunk-DMF3GKR2.js');
4
4
 
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _chunkMTRD2VQLjs = require('./chunk-MTRD2VQL.js');
10
+ var _chunk2XXXTIHTjs = require('./chunk-2XXXTIHT.js');
11
11
 
12
12
 
13
- var _chunkCFZMPLS7js = require('./chunk-CFZMPLS7.js');
13
+ var _chunk5X4UZOIBjs = require('./chunk-5X4UZOIB.js');
14
14
 
15
15
 
16
16
 
17
17
 
18
- var _chunkZKLT77C5js = require('./chunk-ZKLT77C5.js');
18
+ var _chunkQIDQYQEGjs = require('./chunk-QIDQYQEG.js');
19
19
 
20
20
  // node/cli.ts
21
- _chunkZKLT77C5js.init_cjs_shims.call(void 0, );
22
- var import_fast_deep_equal = _chunkZKLT77C5js.__toModule.call(void 0, _chunkCFZMPLS7js.require_fast_deep_equal.call(void 0, ));
21
+ _chunkQIDQYQEGjs.init_cjs_shims.call(void 0, );
22
+ var import_fast_deep_equal = _chunkQIDQYQEGjs.__toModule.call(void 0, _chunk5X4UZOIBjs.require_fast_deep_equal.call(void 0, ));
23
23
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
24
24
  var _net = require('net'); var _net2 = _interopRequireDefault(_net);
25
25
  var _os = require('os'); var _os2 = _interopRequireDefault(_os);
@@ -42,7 +42,7 @@ var CONFIG_RESTART_FIELDS = [
42
42
  "routerMode",
43
43
  "fonts"
44
44
  ];
45
- var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkMTRD2VQLjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
45
+ var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunk2XXXTIHTjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
46
46
  cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
47
47
  alias: "p",
48
48
  type: "number",
@@ -86,9 +86,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
86
86
  async function initServer() {
87
87
  if (server)
88
88
  await server.close();
89
- const options = await _chunkMTRD2VQLjs.resolveOptions.call(void 0, { entry, theme }, "dev");
89
+ const options = await _chunk2XXXTIHTjs.resolveOptions.call(void 0, { entry, theme }, "dev");
90
90
  port = userPort || await findFreePort(3030);
91
- server = await _chunkLLNTKIXIjs.createServer.call(void 0, options, {
91
+ server = await _chunkDMF3GKR2js.createServer.call(void 0, options, {
92
92
  server: {
93
93
  port,
94
94
  strictPort: true,
@@ -99,7 +99,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
99
99
  logLevel: log
100
100
  }, {
101
101
  onDataReload(newData, data) {
102
- if (!theme && _chunkMTRD2VQLjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkMTRD2VQLjs.resolveThemeName.call(void 0, data.config.theme)) {
102
+ if (!theme && _chunk2XXXTIHTjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunk2XXXTIHTjs.resolveThemeName.call(void 0, data.config.theme)) {
103
103
  console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
104
104
  initServer();
105
105
  } else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
@@ -169,8 +169,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
169
169
  type: "boolean",
170
170
  describe: "allow download as PDF"
171
171
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
172
- const { build } = await Promise.resolve().then(() => _chunkZKLT77C5js.__toModule.call(void 0, _chunkZKLT77C5js.__require.call(void 0, "./build-VR5PBG3G.js")));
173
- const options = await _chunkMTRD2VQLjs.resolveOptions.call(void 0, { entry, theme }, "build");
172
+ const { build } = await Promise.resolve().then(() => _chunkQIDQYQEGjs.__toModule.call(void 0, _chunkQIDQYQEGjs.__require.call(void 0, "./build-XEV6LBWL.js")));
173
+ const options = await _chunk2XXXTIHTjs.resolveOptions.call(void 0, { entry, theme }, "build");
174
174
  if (download && !options.data.config.download)
175
175
  options.data.config.download = download;
176
176
  printInfo(options);
@@ -193,16 +193,16 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
193
193
  default: "theme"
194
194
  }), async ({ entry, dir, theme: themeInput }) => {
195
195
  const data = await _fs.load.call(void 0, entry);
196
- const theme = _chunkMTRD2VQLjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
196
+ const theme = _chunk2XXXTIHTjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
197
197
  if (theme === "none") {
198
198
  console.error('Can not eject theme "none"');
199
199
  process.exit(1);
200
200
  }
201
- if (_chunkMTRD2VQLjs.isPath.call(void 0, theme)) {
201
+ if (_chunk2XXXTIHTjs.isPath.call(void 0, theme)) {
202
202
  console.error("Theme is already ejected");
203
203
  process.exit(1);
204
204
  }
205
- const roots = _chunkMTRD2VQLjs.getThemeRoots.call(void 0, theme, entry);
205
+ const roots = _chunk2XXXTIHTjs.getThemeRoots.call(void 0, theme, entry);
206
206
  if (!roots.length) {
207
207
  console.error(`Does not found theme "${theme}"`);
208
208
  process.exit(1);
@@ -257,10 +257,10 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
257
257
  }) => {
258
258
  output = output || `${_path2.default.basename(entry, ".md")}-export`;
259
259
  process.env.NODE_ENV = "production";
260
- const { exportSlides } = await Promise.resolve().then(() => _chunkZKLT77C5js.__toModule.call(void 0, _chunkZKLT77C5js.__require.call(void 0, "./export-OIO7TDG7.js")));
260
+ const { exportSlides } = await Promise.resolve().then(() => _chunkQIDQYQEGjs.__toModule.call(void 0, _chunkQIDQYQEGjs.__require.call(void 0, "./export-TB2WWC2X.js")));
261
261
  const port = await findFreePort(12445);
262
- const options = await _chunkMTRD2VQLjs.resolveOptions.call(void 0, { entry, theme }, "build");
263
- const server = await _chunkLLNTKIXIjs.createServer.call(void 0, options, {
262
+ const options = await _chunk2XXXTIHTjs.resolveOptions.call(void 0, { entry, theme }, "build");
263
+ const server = await _chunkDMF3GKR2js.createServer.call(void 0, options, {
264
264
  server: { port },
265
265
  logLevel: "error",
266
266
  clearScreen: false
@@ -304,7 +304,7 @@ function printInfo(options, port, remote) {
304
304
  console.log();
305
305
  console.log();
306
306
  console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
307
- console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkMTRD2VQLjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
307
+ console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunk2XXXTIHTjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
308
308
  console.log();
309
309
  console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
310
310
  console.log(_kolorist.dim.call(void 0, " entry ") + _kolorist.dim.call(void 0, _path2.default.dirname(options.entry) + _path2.default.sep) + _path2.default.basename(options.entry));