@slidev/cli 0.28.9 → 0.29.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -22,7 +22,7 @@ Presentation <b>slide</b>s for <b>dev</b>elopers 🧑‍💻👩‍💻👨‍
22
22
  <a href="https://twitter.com/antfu7/status/1389604687502995457">Video Preview</a> | <a href="https://sli.dev">Documentation</a>
23
23
  </p>
24
24
 
25
- <p align="center">
25
+ <div align="center">
26
26
  <table>
27
27
  <tbody>
28
28
  <td align="center">
@@ -33,7 +33,7 @@ Status: <b>Public Beta 🎉</b><br>
33
33
  </td>
34
34
  </tbody>
35
35
  </table>
36
- </p>
36
+ </div>
37
37
 
38
38
  ## Features
39
39
 
@@ -1,16 +1,16 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
3
 
4
- var _chunk7DP4LAWNjs = require('./chunk-7DP4LAWN.js');
4
+ var _chunk7F2QYO53js = require('./chunk-7F2QYO53.js');
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _chunkQT3EQ43Ajs = require('./chunk-QT3EQ43A.js');
10
+ var _chunk7QXPSYEZjs = require('./chunk-7QXPSYEZ.js');
11
11
 
12
12
  // node/build.ts
13
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
13
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
14
14
  var _path = require('path');
15
15
  var _http = require('http'); var _http2 = _interopRequireDefault(_http);
16
16
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
@@ -18,12 +18,12 @@ var _vite = require('vite');
18
18
  var _connect = require('connect'); var _connect2 = _interopRequireDefault(_connect);
19
19
 
20
20
  // ../../node_modules/.pnpm/sirv@2.0.2/node_modules/sirv/build.mjs
21
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
21
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
22
22
  var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
23
23
 
24
24
 
25
25
  // ../../node_modules/.pnpm/totalist@3.0.0/node_modules/totalist/sync/index.mjs
26
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
26
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
27
27
 
28
28
 
29
29
  function totalist(dir, callback, pre = "") {
@@ -38,7 +38,7 @@ function totalist(dir, callback, pre = "") {
38
38
  }
39
39
 
40
40
  // ../../node_modules/.pnpm/@polka+url@1.0.0-next.20/node_modules/@polka/url/build.mjs
41
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
41
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
42
42
  var _querystring = require('querystring'); var qs = _interopRequireWildcard(_querystring);
43
43
  function parse2(req) {
44
44
  let raw = req.url;
@@ -62,7 +62,7 @@ function parse2(req) {
62
62
  }
63
63
 
64
64
  // ../../node_modules/.pnpm/mrmime@1.0.0/node_modules/mrmime/index.mjs
65
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
65
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
66
66
  var mimes = {
67
67
  "ez": "application/andrew-inset",
68
68
  "aw": "application/applixware",
@@ -527,7 +527,7 @@ function is404(req, res) {
527
527
  }
528
528
  function send(req, res, file, stats, headers) {
529
529
  let code = 200, tmp, opts = {};
530
- headers = _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, headers);
530
+ headers = _chunk7QXPSYEZjs.__spreadValues.call(void 0, {}, headers);
531
531
  for (let key in headers) {
532
532
  tmp = res.getHeader(key);
533
533
  if (tmp)
@@ -655,12 +655,12 @@ async function build(options, viteConfig = {}) {
655
655
  let originalIndexHTML;
656
656
  if (_fsextra2.default.existsSync(indexPath))
657
657
  originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
658
- await _fsextra2.default.writeFile(indexPath, await _chunk7DP4LAWNjs.getIndexHtml.call(void 0, options), "utf-8");
658
+ await _fsextra2.default.writeFile(indexPath, await _chunk7F2QYO53js.getIndexHtml.call(void 0, options), "utf-8");
659
659
  let config = void 0;
660
660
  try {
661
661
  const inlineConfig = _vite.mergeConfig.call(void 0, viteConfig, {
662
662
  plugins: [
663
- await _chunk7DP4LAWNjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
663
+ await _chunk7F2QYO53js.ViteSlidevPlugin.call(void 0, options, pluginOptions),
664
664
  {
665
665
  name: "resolve-config",
666
666
  configResolved(_config) {
@@ -710,7 +710,7 @@ async function build(options, viteConfig = {}) {
710
710
  await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
711
711
  `, "utf-8");
712
712
  if ([true, "true", "auto"].includes(options.data.config.download)) {
713
- const { exportSlides } = await Promise.resolve().then(() => _chunkQT3EQ43Ajs.__toModule.call(void 0, _chunkQT3EQ43Ajs.__require.call(void 0, "./export-OMYGNP7W.js")));
713
+ const { exportSlides } = await Promise.resolve().then(() => _chunk7QXPSYEZjs.__toModule.call(void 0, _chunk7QXPSYEZjs.__require.call(void 0, "./export-7OOFII75.js")));
714
714
  const port = 12445;
715
715
  const app = _connect2.default.call(void 0, );
716
716
  const server = _http2.default.createServer(app);
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ViteSlidevPlugin,
3
3
  getIndexHtml
4
- } from "./chunk-GVUUNY2S.mjs";
4
+ } from "./chunk-UEIFQWPY.mjs";
5
5
  import {
6
6
  __require,
7
7
  __spreadValues,
8
8
  __toModule,
9
9
  init_esm_shims
10
- } from "./chunk-4OPORETI.mjs";
10
+ } from "./chunk-VYBQLH2X.mjs";
11
11
 
12
12
  // node/build.ts
13
13
  init_esm_shims();
@@ -710,7 +710,7 @@ async function build(options, viteConfig = {}) {
710
710
  await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
711
711
  `, "utf-8");
712
712
  if ([true, "true", "auto"].includes(options.data.config.download)) {
713
- const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-64ZO3O77.mjs")));
713
+ const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-GXF6EY3F.mjs")));
714
714
  const port = 12445;
715
715
  const app = connect();
716
716
  const server = http.createServer(app);
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk7DP4LAWNjs = require('./chunk-7DP4LAWN.js');
3
+ var _chunk7F2QYO53js = require('./chunk-7F2QYO53.js');
4
4
 
5
5
 
6
- var _chunkQT3EQ43Ajs = require('./chunk-QT3EQ43A.js');
6
+ var _chunk7QXPSYEZjs = require('./chunk-7QXPSYEZ.js');
7
7
 
8
8
  // node/server.ts
9
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
9
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
10
10
  var _path = require('path');
11
11
  var _vite = require('vite');
12
12
  async function createServer(options, viteConfig = {}, serverOptions = {}) {
@@ -20,7 +20,7 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
20
20
  ]
21
21
  },
22
22
  plugins: [
23
- await _chunk7DP4LAWNjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
23
+ await _chunk7F2QYO53js.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
24
24
  ]
25
25
  }));
26
26
  return server;
@@ -10,13 +10,13 @@
10
10
 
11
11
 
12
12
 
13
- var _chunkQT3EQ43Ajs = require('./chunk-QT3EQ43A.js');
13
+ var _chunk7QXPSYEZjs = require('./chunk-7QXPSYEZ.js');
14
14
 
15
15
  // ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
16
- var require_fast_deep_equal = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
16
+ var require_fast_deep_equal = _chunk7QXPSYEZjs.__commonJS.call(void 0, {
17
17
  "../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
18
18
  "use strict";
19
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
19
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
20
20
  module.exports = function equal2(a, b) {
21
21
  if (a === b)
22
22
  return true;
@@ -59,7 +59,7 @@ var require_fast_deep_equal = _chunkQT3EQ43Ajs.__commonJS.call(void 0, {
59
59
  });
60
60
 
61
61
  // node/common.ts
62
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
62
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
63
63
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
64
64
  var _path = require('path');
65
65
  var _utils = require('@antfu/utils');
@@ -87,13 +87,13 @@ ${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) |
87
87
  body += '\n<script async src="https://platform.twitter.com/widgets.js"><\/script>';
88
88
  if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
89
89
  head += `
90
- <link rel="stylesheet" href="${_chunkQT3EQ43Ajs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
91
- main = main.replace("__ENTRY__", _chunkQT3EQ43Ajs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
90
+ <link rel="stylesheet" href="${_chunk7QXPSYEZjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
91
+ main = main.replace("__ENTRY__", _chunk7QXPSYEZjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
92
92
  return main;
93
93
  }
94
94
 
95
95
  // node/plugins/windicss.ts
96
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
96
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
97
97
 
98
98
 
99
99
 
@@ -101,13 +101,13 @@ var _vitepluginwindicss = require('vite-plugin-windicss'); var _vitepluginwindic
101
101
  var _jiti = require('jiti'); var _jiti2 = _interopRequireDefault(_jiti);
102
102
 
103
103
  // node/plugins/setupNode.ts
104
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
104
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
105
105
 
106
106
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
107
107
 
108
108
 
109
109
  function deepMerge(a, b, rootPath = "") {
110
- a = _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, a);
110
+ a = _chunk7QXPSYEZjs.__spreadValues.call(void 0, {}, a);
111
111
  Object.keys(b).forEach((key) => {
112
112
  if (_utils.isObject.call(void 0, a[key]))
113
113
  a[key] = deepMerge(a[key], b[key], rootPath ? `${rootPath}.${key}` : key);
@@ -145,7 +145,7 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
145
145
  if (config.default)
146
146
  config = config.default;
147
147
  config = await loadSetups(roots, "windicss.ts", {}, config, true);
148
- return _vitepluginwindicss2.default.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
148
+ return _vitepluginwindicss2.default.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
149
149
  configFiles: [configFile],
150
150
  config,
151
151
  onConfigResolved(config2) {
@@ -167,15 +167,15 @@ async function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, d
167
167
  config2.scanOptions.include.push(`${i}/layouts/*.{vue,ts}`);
168
168
  });
169
169
  config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
170
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkQT3EQ43Ajs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
171
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkQT3EQ43Ajs.resolveImportPath.call(void 0, "katex/package.json", true)));
172
- config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkQT3EQ43Ajs.resolveImportPath.call(void 0, "prettier/package.json", true)));
170
+ config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk7QXPSYEZjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
171
+ config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk7QXPSYEZjs.resolveImportPath.call(void 0, "katex/package.json", true)));
172
+ config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunk7QXPSYEZjs.resolveImportPath.call(void 0, "prettier/package.json", true)));
173
173
  }
174
174
  }, windiOptions));
175
175
  }
176
176
 
177
177
  // node/plugins/preset.ts
178
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
178
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
179
179
  var _pluginvue = require('@vitejs/plugin-vue'); var _pluginvue2 = _interopRequireDefault(_pluginvue);
180
180
  var _vite = require('unplugin-icons/vite'); var _vite2 = _interopRequireDefault(_vite);
181
181
  var _resolver = require('unplugin-icons/resolver'); var _resolver2 = _interopRequireDefault(_resolver);
@@ -185,7 +185,7 @@ var _vitepluginvueserverref = require('vite-plugin-vue-server-ref'); var _vitepl
185
185
 
186
186
 
187
187
  // node/drawings.ts
188
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
188
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
189
189
 
190
190
 
191
191
  var _fastglob = require('fast-glob'); var _fastglob2 = _interopRequireDefault(_fastglob);
@@ -231,7 +231,7 @@ ${value}
231
231
  }
232
232
 
233
233
  // node/plugins/extendConfig.ts
234
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
234
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
235
235
 
236
236
  var _vite5 = require('vite');
237
237
  var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
@@ -242,29 +242,29 @@ var dependencies = {
242
242
  "@antfu/utils": "^0.5.0",
243
243
  "@slidev/parser": "workspace:*",
244
244
  "@slidev/types": "workspace:*",
245
- "@vueuse/core": "^7.6.2",
245
+ "@vueuse/core": "^8.1.2",
246
246
  "@vueuse/head": "^0.7.5",
247
- "@vueuse/motion": "^2.0.0-beta.9",
247
+ "@vueuse/motion": "^2.0.0-beta.12",
248
248
  codemirror: "^5.65.2",
249
- drauu: "^0.2.1",
249
+ drauu: "^0.3.0",
250
250
  "file-saver": "^2.0.5",
251
251
  "js-base64": "^3.7.2",
252
252
  "js-yaml": "^4.1.0",
253
- katex: "^0.15.2",
253
+ katex: "^0.15.3",
254
254
  mermaid: "^8.14.0",
255
- "monaco-editor": "^0.32.1",
255
+ "monaco-editor": "^0.33.0",
256
256
  nanoid: "^3.3.1",
257
- prettier: "^2.5.1",
257
+ prettier: "^2.6.0",
258
258
  recordrtc: "^5.6.2",
259
259
  resolve: "^1.22.0",
260
- "vite-plugin-windicss": "^1.7.1",
260
+ "vite-plugin-windicss": "^1.8.3",
261
261
  vue: "^3.2.31",
262
- "vue-router": "^4.0.12",
263
- windicss: "^3.4.4"
262
+ "vue-router": "^4.0.14",
263
+ windicss: "^3.5.1"
264
264
  };
265
265
 
266
266
  // node/vite/searchRoot.ts
267
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
267
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
268
268
 
269
269
 
270
270
  var ROOT_FILES = [
@@ -324,7 +324,7 @@ function createConfigPlugin(options) {
324
324
  define: getDefine(options),
325
325
  resolve: {
326
326
  alias: {
327
- "@slidev/client/": `${_chunkQT3EQ43Ajs.toAtFS.call(void 0, options.clientRoot)}/`
327
+ "@slidev/client/": `${_chunk7QXPSYEZjs.toAtFS.call(void 0, options.clientRoot)}/`
328
328
  }
329
329
  },
330
330
  optimizeDeps: {
@@ -351,7 +351,7 @@ function createConfigPlugin(options) {
351
351
  allow: _utils.uniq.call(void 0, [
352
352
  searchForWorkspaceRoot(options.userRoot),
353
353
  searchForWorkspaceRoot(options.cliRoot),
354
- ..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkQT3EQ43Ajs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkQT3EQ43Ajs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
354
+ ..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunk7QXPSYEZjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunk7QXPSYEZjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
355
355
  ])
356
356
  }
357
357
  }
@@ -360,7 +360,7 @@ function createConfigPlugin(options) {
360
360
  injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
361
361
  injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
362
362
  injection.root = options.cliRoot;
363
- injection.resolve.alias.vue = `${_chunkQT3EQ43Ajs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
363
+ injection.resolve.alias.vue = `${_chunk7QXPSYEZjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
364
364
  }
365
365
  return _vite5.mergeConfig.call(void 0, config, injection);
366
366
  },
@@ -381,7 +381,7 @@ function createConfigPlugin(options) {
381
381
  }
382
382
  function getDefine(options) {
383
383
  return {
384
- __SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkQT3EQ43Ajs.toAtFS.call(void 0, options.clientRoot)),
384
+ __SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunk7QXPSYEZjs.toAtFS.call(void 0, options.clientRoot)),
385
385
  __SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
386
386
  __SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
387
387
  __SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
@@ -390,8 +390,8 @@ function getDefine(options) {
390
390
  }
391
391
 
392
392
  // node/plugins/loaders.ts
393
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
394
- var import_fast_deep_equal = _chunkQT3EQ43Ajs.__toModule.call(void 0, require_fast_deep_equal());
393
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
394
+ var import_fast_deep_equal = _chunk7QXPSYEZjs.__toModule.call(void 0, require_fast_deep_equal());
395
395
 
396
396
 
397
397
 
@@ -423,7 +423,7 @@ md.use(_markdownitlinkattributes2.default, {
423
423
  }
424
424
  });
425
425
  function prepareSlideInfo(data) {
426
- return _chunkQT3EQ43Ajs.__spreadProps.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, data), {
426
+ return _chunk7QXPSYEZjs.__spreadProps.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {}, data), {
427
427
  notesHTML: md.render((data == null ? void 0 : data.note) || "")
428
428
  });
429
429
  }
@@ -512,7 +512,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
512
512
  const file = `${slidePrefix}${i + 1}.md`;
513
513
  try {
514
514
  const md2 = await transformMarkdown(MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
515
- return await VuePlugin.handleHotUpdate(_chunkQT3EQ43Ajs.__spreadProps.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, ctx), {
515
+ return await VuePlugin.handleHotUpdate(_chunk7QXPSYEZjs.__spreadProps.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {}, ctx), {
516
516
  modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
517
517
  file,
518
518
  read() {
@@ -554,6 +554,8 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
554
554
  return generateGlobalComponents("top");
555
555
  if (id === "/@slidev/global-components/bottom")
556
556
  return generateGlobalComponents("bottom");
557
+ if (id === "/@slidev/custom-nav-controls")
558
+ return generateCustomNavControls();
557
559
  if (id.startsWith(slidePrefix)) {
558
560
  const remaning = id.slice(slidePrefix.length);
559
561
  const match = remaning.match(regexIdQuery);
@@ -601,13 +603,13 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
601
603
  async function transformMarkdown(code, pageNo, data2) {
602
604
  var _a, _b;
603
605
  const layouts = await getLayouts();
604
- const frontmatter = _chunkQT3EQ43Ajs.__spreadValues.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
606
+ const frontmatter = _chunk7QXPSYEZjs.__spreadValues.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {}, ((_a = data2.headmatter) == null ? void 0 : _a.defaults) || {}), ((_b = data2.slides[pageNo]) == null ? void 0 : _b.frontmatter) || {});
605
607
  const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
606
608
  if (!layouts[layoutName])
607
609
  throw new Error(`Unknown layout "${layoutName}"`);
608
610
  delete frontmatter.title;
609
611
  const imports = [
610
- `import InjectedLayout from "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, layouts[layoutName])}"`,
612
+ `import InjectedLayout from "${_chunk7QXPSYEZjs.toAtFS.call(void 0, layouts[layoutName])}"`,
611
613
  `const frontmatter = ${JSON.stringify(frontmatter)}`
612
614
  ];
613
615
  code = code.replace(/(<script setup.*>)/g, `$1
@@ -653,9 +655,9 @@ ${code.slice(injectB)}`;
653
655
  }
654
656
  async function generateUserStyles() {
655
657
  const imports = [
656
- `import "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
657
- `import "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
658
- `import "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
658
+ `import "${_chunk7QXPSYEZjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
659
+ `import "${_chunk7QXPSYEZjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
660
+ `import "${_chunk7QXPSYEZjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`
659
661
  ];
660
662
  const roots2 = _utils.uniq.call(void 0, [
661
663
  ...themeRoots,
@@ -671,13 +673,13 @@ ${code.slice(injectB)}`;
671
673
  ];
672
674
  for (const style of styles) {
673
675
  if (_fsextra.existsSync.call(void 0, style)) {
674
- imports.push(`import "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, style)}"`);
676
+ imports.push(`import "${_chunk7QXPSYEZjs.toAtFS.call(void 0, style)}"`);
675
677
  continue;
676
678
  }
677
679
  }
678
680
  }
679
681
  if (data.features.katex)
680
- imports.push(`import "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, _chunkQT3EQ43Ajs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
682
+ imports.push(`import "${_chunk7QXPSYEZjs.toAtFS.call(void 0, _chunk7QXPSYEZjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
681
683
  return imports.join("\n");
682
684
  }
683
685
  async function generateMonacoTypes() {
@@ -686,7 +688,7 @@ ${code.slice(injectB)}`;
686
688
  async function generateLayouts() {
687
689
  const imports = [];
688
690
  const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
689
- imports.push(`import __layout_${k} from "${_chunkQT3EQ43Ajs.toAtFS.call(void 0, v)}"`);
691
+ imports.push(`import __layout_${k} from "${_chunk7QXPSYEZjs.toAtFS.call(void 0, v)}"`);
690
692
  return [k, `__layout_${k}`];
691
693
  });
692
694
  return [
@@ -734,10 +736,10 @@ ${routes.join(",\n")}
734
736
  return [...imports, routesStr].join("\n");
735
737
  }
736
738
  function generateConfigs() {
737
- const config = _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, data.config);
739
+ const config = _chunk7QXPSYEZjs.__spreadValues.call(void 0, {}, data.config);
738
740
  if (_utils.isString.call(void 0, config.title)) {
739
741
  const tokens = md.parseInline(config.title, {});
740
- config.title = _chunkQT3EQ43Ajs.stringifyMarkdownTokens.call(void 0, tokens);
742
+ config.title = _chunk7QXPSYEZjs.stringifyMarkdownTokens.call(void 0, tokens);
741
743
  }
742
744
  if (_utils.isString.call(void 0, config.info))
743
745
  config.info = md.render(config.info);
@@ -758,7 +760,26 @@ ${routes.join(",\n")}
758
760
  ];
759
761
  }
760
762
  }).filter((i) => _fsextra2.default.existsSync(i));
761
- const imports = components.map((i, idx) => `import __n${idx} from '${_chunkQT3EQ43Ajs.toAtFS.call(void 0, i)}'`).join("\n");
763
+ const imports = components.map((i, idx) => `import __n${idx} from '${_chunk7QXPSYEZjs.toAtFS.call(void 0, i)}'`).join("\n");
764
+ const render = components.map((i, idx) => `h(__n${idx})`).join(",");
765
+ return `
766
+ ${imports}
767
+ import { h } from 'vue'
768
+ export default {
769
+ render() {
770
+ return [${render}]
771
+ }
772
+ }
773
+ `;
774
+ }
775
+ async function generateCustomNavControls() {
776
+ const components = roots.flatMap((root) => {
777
+ return [
778
+ _path.join.call(void 0, root, "custom-nav-controls.vue"),
779
+ _path.join.call(void 0, root, "CustomNavControls.vue")
780
+ ];
781
+ }).filter((i) => _fsextra2.default.existsSync(i));
782
+ const imports = components.map((i, idx) => `import __n${idx} from '${_chunk7QXPSYEZjs.toAtFS.call(void 0, i)}'`).join("\n");
762
783
  const render = components.map((i, idx) => `h(__n${idx})`).join(",");
763
784
  return `
764
785
  ${imports}
@@ -773,7 +794,7 @@ export default {
773
794
  }
774
795
 
775
796
  // node/plugins/monacoTransform.ts
776
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
797
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
777
798
 
778
799
 
779
800
 
@@ -807,7 +828,7 @@ function createMonacoTypesLoader() {
807
828
  }
808
829
 
809
830
  // node/plugins/setupClient.ts
810
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
831
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
811
832
 
812
833
 
813
834
 
@@ -829,7 +850,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
829
850
  setups.forEach((path, idx) => {
830
851
  if (!_fs.existsSync.call(void 0, path))
831
852
  return;
832
- imports.push(`import __n${idx} from '${_chunkQT3EQ43Ajs.toAtFS.call(void 0, path)}'`);
853
+ imports.push(`import __n${idx} from '${_chunk7QXPSYEZjs.toAtFS.call(void 0, path)}'`);
833
854
  let fn = `__n${idx}`;
834
855
  let awaitFn = `await __n${idx}`;
835
856
  if (/\binjection_return\b/g.test(code)) {
@@ -857,7 +878,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
857
878
  }
858
879
 
859
880
  // node/plugins/markdown.ts
860
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
881
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
861
882
  var _vitepluginmd = require('vite-plugin-md'); var _vitepluginmd2 = _interopRequireDefault(_vitepluginmd);
862
883
  var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
863
884
 
@@ -867,7 +888,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
867
888
  var _plantumlencoder = require('plantuml-encoder');
868
889
 
869
890
  // node/plugins/markdown-it-katex.ts
870
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
891
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
871
892
  var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
872
893
  function isValidDelim(state, pos) {
873
894
  const max = state.posMax;
@@ -1014,7 +1035,7 @@ function math_plugin(md2, options) {
1014
1035
  }
1015
1036
 
1016
1037
  // node/plugins/markdown-it-prism.ts
1017
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
1038
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
1018
1039
  var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
1019
1040
  var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
1020
1041
  var DEFAULTS = {
@@ -1037,7 +1058,7 @@ function loadPrismLang(lang) {
1037
1058
  }
1038
1059
  function loadPrismPlugin(name) {
1039
1060
  try {
1040
- _chunkQT3EQ43Ajs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
1061
+ _chunk7QXPSYEZjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
1041
1062
  } catch (e) {
1042
1063
  throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
1043
1064
  }
@@ -1077,7 +1098,7 @@ function markdownItPrism(markdownit, useroptions) {
1077
1098
  }
1078
1099
 
1079
1100
  // node/plugins/markdown-it-shiki.ts
1080
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
1101
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
1081
1102
  function getThemeName(theme) {
1082
1103
  if (typeof theme === "string")
1083
1104
  return theme;
@@ -1099,7 +1120,7 @@ function resolveShikiOptions(options) {
1099
1120
  themes.push(options.theme);
1100
1121
  }
1101
1122
  }
1102
- return _chunkQT3EQ43Ajs.__spreadProps.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {}, options), {
1123
+ return _chunk7QXPSYEZjs.__spreadProps.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {}, options), {
1103
1124
  themes,
1104
1125
  darkModeThemes: darkModeThemes ? {
1105
1126
  dark: getThemeName(darkModeThemes.dark),
@@ -1137,7 +1158,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1137
1158
  const setups = [];
1138
1159
  const entryPath = _utils.slash.call(void 0, entry);
1139
1160
  if (config.highlighter === "shiki") {
1140
- const { getHighlighter } = await Promise.resolve().then(() => _chunkQT3EQ43Ajs.__toModule.call(void 0, _chunkQT3EQ43Ajs.__require.call(void 0, "shiki")));
1161
+ const { getHighlighter } = await Promise.resolve().then(() => _chunk7QXPSYEZjs.__toModule.call(void 0, _chunk7QXPSYEZjs.__require.call(void 0, "shiki")));
1141
1162
  const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
1142
1163
  const { langs, themes } = resolveShikiOptions(shikiOptions);
1143
1164
  shikiOptions.highlighter = await getHighlighter({ themes, langs });
@@ -1146,11 +1167,11 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
1146
1167
  setups.push((md2) => md2.use(markdownItPrism));
1147
1168
  }
1148
1169
  const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
1149
- return _vitepluginmd2.default.call(void 0, _chunkQT3EQ43Ajs.__spreadProps.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
1170
+ return _vitepluginmd2.default.call(void 0, _chunk7QXPSYEZjs.__spreadProps.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
1150
1171
  wrapperClasses: "",
1151
1172
  headEnabled: false,
1152
1173
  frontmatter: false,
1153
- markdownItOptions: _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
1174
+ markdownItOptions: _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
1154
1175
  quotes: `""''`,
1155
1176
  html: true,
1156
1177
  xhtmlOut: true,
@@ -1287,7 +1308,7 @@ function escapeVueInCode(md2) {
1287
1308
  }
1288
1309
 
1289
1310
  // node/plugins/patchTransform.ts
1290
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
1311
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
1291
1312
 
1292
1313
  function createFixPlugins(options) {
1293
1314
  const define = _utils.objectEntries.call(void 0, getDefine(options));
@@ -1342,7 +1363,8 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1342
1363
  vue: vueOptions = {},
1343
1364
  components: componentsOptions = {},
1344
1365
  icons: iconsOptions = {},
1345
- remoteAssets: remoteAssetsOptions = {}
1366
+ remoteAssets: remoteAssetsOptions = {},
1367
+ serverRef: serverRefOptions = {}
1346
1368
  } = pluginOptions;
1347
1369
  const {
1348
1370
  mode,
@@ -1350,10 +1372,10 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1350
1372
  clientRoot,
1351
1373
  data: { config }
1352
1374
  } = options;
1353
- const VuePlugin = _pluginvue2.default.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
1375
+ const VuePlugin = _pluginvue2.default.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
1354
1376
  include: [/\.vue$/, /\.md$/],
1355
1377
  exclude: [],
1356
- template: _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
1378
+ template: _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
1357
1379
  compilerOptions: {
1358
1380
  isCustomElement(tag) {
1359
1381
  return customElements.has(tag);
@@ -1368,7 +1390,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1368
1390
  MarkdownPlugin,
1369
1391
  VuePlugin,
1370
1392
  createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
1371
- _vite4.default.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
1393
+ _vite4.default.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
1372
1394
  extensions: ["vue", "md", "ts"],
1373
1395
  dirs: [
1374
1396
  `${clientRoot}/builtin`,
@@ -1386,11 +1408,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1386
1408
  })
1387
1409
  ]
1388
1410
  }, componentsOptions)),
1389
- _vite2.default.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
1411
+ _vite2.default.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
1390
1412
  defaultClass: "slidev-icon",
1391
1413
  autoInstall: true
1392
1414
  }, iconsOptions)),
1393
- config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunkQT3EQ43Ajs.__spreadValues.call(void 0, {
1415
+ config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
1394
1416
  rules: [
1395
1417
  ..._vitepluginremoteassets.DefaultRules,
1396
1418
  {
@@ -1403,15 +1425,16 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1403
1425
  }, remoteAssetsOptions)) : null,
1404
1426
  _vitepluginvueserverref2.default.call(void 0, {
1405
1427
  debug: process.env.NODE_ENV === "development",
1406
- state: {
1428
+ state: _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
1407
1429
  sync: false,
1408
1430
  nav: {
1409
1431
  page: 0,
1410
1432
  clicks: 0
1411
1433
  },
1412
1434
  drawings: drawingData
1413
- },
1414
- onChanged(key, data, patch) {
1435
+ }, serverRefOptions.state),
1436
+ onChanged(key, data, patch, timestamp) {
1437
+ serverRefOptions.onChanged && serverRefOptions.onChanged(key, data, patch, timestamp);
1415
1438
  if (!options.data.config.drawings.persist)
1416
1439
  return;
1417
1440
  if (key === "drawings")
@@ -52,9 +52,9 @@ var __toModule = (module) => {
52
52
  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);
53
53
  };
54
54
 
55
- // ../../node_modules/.pnpm/tsup@5.11.13_typescript@4.5.5/node_modules/tsup/assets/cjs_shims.js
55
+ // ../../node_modules/.pnpm/tsup@5.11.13_typescript@4.6.2/node_modules/tsup/assets/cjs_shims.js
56
56
  var init_cjs_shims = __esm({
57
- "../../node_modules/.pnpm/tsup@5.11.13_typescript@4.5.5/node_modules/tsup/assets/cjs_shims.js"() {
57
+ "../../node_modules/.pnpm/tsup@5.11.13_typescript@4.6.2/node_modules/tsup/assets/cjs_shims.js"() {
58
58
  }
59
59
  });
60
60