@slidev/cli 0.28.8 → 0.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ import {
11
11
  resolveImportPath,
12
12
  stringifyMarkdownTokens,
13
13
  toAtFS
14
- } from "./chunk-4OPORETI.mjs";
14
+ } from "./chunk-VYBQLH2X.mjs";
15
15
 
16
16
  // ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
17
17
  var require_fast_deep_equal = __commonJS({
@@ -243,25 +243,25 @@ var dependencies = {
243
243
  "@antfu/utils": "^0.5.0",
244
244
  "@slidev/parser": "workspace:*",
245
245
  "@slidev/types": "workspace:*",
246
- "@vueuse/core": "^7.6.2",
246
+ "@vueuse/core": "^8.1.2",
247
247
  "@vueuse/head": "^0.7.5",
248
- "@vueuse/motion": "^2.0.0-beta.9",
248
+ "@vueuse/motion": "^2.0.0-beta.12",
249
249
  codemirror: "^5.65.2",
250
- drauu: "^0.2.1",
250
+ drauu: "^0.3.0",
251
251
  "file-saver": "^2.0.5",
252
252
  "js-base64": "^3.7.2",
253
253
  "js-yaml": "^4.1.0",
254
- katex: "^0.15.2",
254
+ katex: "^0.15.3",
255
255
  mermaid: "^8.14.0",
256
- "monaco-editor": "^0.32.1",
256
+ "monaco-editor": "^0.33.0",
257
257
  nanoid: "^3.3.1",
258
- prettier: "^2.5.1",
258
+ prettier: "^2.6.0",
259
259
  recordrtc: "^5.6.2",
260
260
  resolve: "^1.22.0",
261
- "vite-plugin-windicss": "^1.7.1",
261
+ "vite-plugin-windicss": "^1.8.3",
262
262
  vue: "^3.2.31",
263
- "vue-router": "^4.0.12",
264
- windicss: "^3.4.4"
263
+ "vue-router": "^4.0.14",
264
+ windicss: "^3.5.1"
265
265
  };
266
266
 
267
267
  // node/vite/searchRoot.ts
@@ -341,6 +341,7 @@ function createConfigPlugin(options) {
341
341
  "prettier/esm/parser-html",
342
342
  "prettier/esm/parser-typescript",
343
343
  "mermaid/dist/mermaid.min",
344
+ "mermaid/dist/mermaid",
344
345
  "vite-plugin-vue-server-ref/client"
345
346
  ],
346
347
  exclude: EXCLUDE
@@ -554,6 +555,8 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
554
555
  return generateGlobalComponents("top");
555
556
  if (id === "/@slidev/global-components/bottom")
556
557
  return generateGlobalComponents("bottom");
558
+ if (id === "/@slidev/custom-nav-controls")
559
+ return generateCustomNavControls();
557
560
  if (id.startsWith(slidePrefix)) {
558
561
  const remaning = id.slice(slidePrefix.length);
559
562
  const match = remaning.match(regexIdQuery);
@@ -768,6 +771,25 @@ export default {
768
771
  return [${render}]
769
772
  }
770
773
  }
774
+ `;
775
+ }
776
+ async function generateCustomNavControls() {
777
+ const components = roots.flatMap((root) => {
778
+ return [
779
+ join5(root, "custom-nav-controls.vue"),
780
+ join5(root, "CustomNavControls.vue")
781
+ ];
782
+ }).filter((i) => fs4.existsSync(i));
783
+ const imports = components.map((i, idx) => `import __n${idx} from '${toAtFS(i)}'`).join("\n");
784
+ const render = components.map((i, idx) => `h(__n${idx})`).join(",");
785
+ return `
786
+ ${imports}
787
+ import { h } from 'vue'
788
+ export default {
789
+ render() {
790
+ return [${render}]
791
+ }
792
+ }
771
793
  `;
772
794
  }
773
795
  }
@@ -1342,7 +1364,8 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1342
1364
  vue: vueOptions = {},
1343
1365
  components: componentsOptions = {},
1344
1366
  icons: iconsOptions = {},
1345
- remoteAssets: remoteAssetsOptions = {}
1367
+ remoteAssets: remoteAssetsOptions = {},
1368
+ serverRef: serverRefOptions = {}
1346
1369
  } = pluginOptions;
1347
1370
  const {
1348
1371
  mode,
@@ -1403,15 +1426,16 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
1403
1426
  }, remoteAssetsOptions)) : null,
1404
1427
  ServerRef({
1405
1428
  debug: process.env.NODE_ENV === "development",
1406
- state: {
1429
+ state: __spreadValues({
1407
1430
  sync: false,
1408
1431
  nav: {
1409
1432
  page: 0,
1410
1433
  clicks: 0
1411
1434
  },
1412
1435
  drawings: drawingData
1413
- },
1414
- onChanged(key, data, patch) {
1436
+ }, serverRefOptions.state),
1437
+ onChanged(key, data, patch, timestamp) {
1438
+ serverRefOptions.onChanged && serverRefOptions.onChanged(key, data, patch, timestamp);
1415
1439
  if (!options.data.config.drawings.persist)
1416
1440
  return;
1417
1441
  if (key === "drawings")
@@ -52,12 +52,12 @@ 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/esm_shims.js
55
+ // ../../node_modules/.pnpm/tsup@5.11.13_typescript@4.6.2/node_modules/tsup/assets/esm_shims.js
56
56
  import { fileURLToPath } from "url";
57
57
  import path from "path";
58
58
  var getFilename, getDirname, __dirname, __filename;
59
59
  var init_esm_shims = __esm({
60
- "../../node_modules/.pnpm/tsup@5.11.13_typescript@4.5.5/node_modules/tsup/assets/esm_shims.js"() {
60
+ "../../node_modules/.pnpm/tsup@5.11.13_typescript@4.6.2/node_modules/tsup/assets/esm_shims.js"() {
61
61
  getFilename = () => fileURLToPath(import.meta.url);
62
62
  getDirname = () => path.dirname(getFilename());
63
63
  __dirname = /* @__PURE__ */ getDirname();
@@ -8,7 +8,7 @@ import {
8
8
  __toModule,
9
9
  init_esm_shims,
10
10
  resolveImportPath
11
- } from "./chunk-4OPORETI.mjs";
11
+ } from "./chunk-VYBQLH2X.mjs";
12
12
 
13
13
  // ../../node_modules/.pnpm/semver@7.3.5/node_modules/semver/internal/constants.js
14
14
  var require_constants = __commonJS({
@@ -5372,7 +5372,7 @@ async function saveExternalSlide(slide) {
5372
5372
  init_esm_shims();
5373
5373
 
5374
5374
  // package.json
5375
- var version = "0.28.8";
5375
+ var version = "0.29.0";
5376
5376
 
5377
5377
  // node/themes.ts
5378
5378
  init_esm_shims();
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict"; 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
- var _chunkYBR5SIF5js = require('./chunk-YBR5SIF5.js');
3
+ var _chunk5BL2KALHjs = require('./chunk-5BL2KALH.js');
4
4
 
5
5
 
6
6
 
@@ -8,19 +8,19 @@ var _chunkYBR5SIF5js = require('./chunk-YBR5SIF5.js');
8
8
 
9
9
 
10
10
 
11
- var _chunkZUBAOX5Tjs = require('./chunk-ZUBAOX5T.js');
11
+ var _chunkOOHN7CTSjs = require('./chunk-OOHN7CTS.js');
12
12
 
13
13
 
14
- var _chunkADOJPBM5js = require('./chunk-ADOJPBM5.js');
14
+ var _chunk7F2QYO53js = require('./chunk-7F2QYO53.js');
15
15
 
16
16
 
17
17
 
18
18
 
19
- var _chunkQT3EQ43Ajs = require('./chunk-QT3EQ43A.js');
19
+ var _chunk7QXPSYEZjs = require('./chunk-7QXPSYEZ.js');
20
20
 
21
21
  // node/cli.ts
22
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
23
- var import_fast_deep_equal = _chunkQT3EQ43Ajs.__toModule.call(void 0, _chunkADOJPBM5js.require_fast_deep_equal.call(void 0, ));
22
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
23
+ var import_fast_deep_equal = _chunk7QXPSYEZjs.__toModule.call(void 0, _chunk7F2QYO53js.require_fast_deep_equal.call(void 0, ));
24
24
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
25
25
  var _net = require('net'); var _net2 = _interopRequireDefault(_net);
26
26
  var _os = require('os'); var _os2 = _interopRequireDefault(_os);
@@ -38,7 +38,7 @@ var CONFIG_RESTART_FIELDS = [
38
38
  "routerMode",
39
39
  "fonts"
40
40
  ];
41
- var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkZUBAOX5Tjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
41
+ var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkOOHN7CTSjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
42
42
  cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
43
43
  alias: "p",
44
44
  type: "number",
@@ -82,9 +82,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
82
82
  async function initServer() {
83
83
  if (server)
84
84
  await server.close();
85
- const options = await _chunkZUBAOX5Tjs.resolveOptions.call(void 0, { entry, theme }, "dev");
85
+ const options = await _chunkOOHN7CTSjs.resolveOptions.call(void 0, { entry, theme }, "dev");
86
86
  port = userPort || await findFreePort(3030);
87
- server = await _chunkYBR5SIF5js.createServer.call(void 0, options, {
87
+ server = await _chunk5BL2KALHjs.createServer.call(void 0, options, {
88
88
  server: {
89
89
  port,
90
90
  strictPort: true,
@@ -95,7 +95,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
95
95
  logLevel: log
96
96
  }, {
97
97
  onDataReload(newData, data) {
98
- if (!theme && _chunkZUBAOX5Tjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkZUBAOX5Tjs.resolveThemeName.call(void 0, data.config.theme)) {
98
+ if (!theme && _chunkOOHN7CTSjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkOOHN7CTSjs.resolveThemeName.call(void 0, data.config.theme)) {
99
99
  console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
100
100
  initServer();
101
101
  } else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
@@ -171,8 +171,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
171
171
  type: "boolean",
172
172
  describe: "allow download as PDF"
173
173
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
174
- const { build } = await Promise.resolve().then(() => _chunkQT3EQ43Ajs.__toModule.call(void 0, _chunkQT3EQ43Ajs.__require.call(void 0, "./build-E6BBKMUU.js")));
175
- const options = await _chunkZUBAOX5Tjs.resolveOptions.call(void 0, { entry, theme }, "build");
174
+ const { build } = await Promise.resolve().then(() => _chunk7QXPSYEZjs.__toModule.call(void 0, _chunk7QXPSYEZjs.__require.call(void 0, "./build-VM52TR6Q.js")));
175
+ const options = await _chunkOOHN7CTSjs.resolveOptions.call(void 0, { entry, theme }, "build");
176
176
  if (download && !options.data.config.download)
177
177
  options.data.config.download = download;
178
178
  printInfo(options);
@@ -185,26 +185,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
185
185
  });
186
186
  });
187
187
  cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
188
- const data = await _chunkZUBAOX5Tjs.fs_exports.load(entry);
189
- _chunkZUBAOX5Tjs.fs_exports.prettify(data);
190
- await _chunkZUBAOX5Tjs.fs_exports.save(data);
188
+ const data = await _chunkOOHN7CTSjs.fs_exports.load(entry);
189
+ _chunkOOHN7CTSjs.fs_exports.prettify(data);
190
+ await _chunkOOHN7CTSjs.fs_exports.save(data);
191
191
  });
192
192
  cli.command("theme [subcommand]", "Theme related operations", (command) => {
193
193
  return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
194
194
  type: "string",
195
195
  default: "theme"
196
196
  }), async ({ entry, dir, theme: themeInput }) => {
197
- const data = await _chunkZUBAOX5Tjs.fs_exports.load(entry);
198
- const theme = _chunkZUBAOX5Tjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
197
+ const data = await _chunkOOHN7CTSjs.fs_exports.load(entry);
198
+ const theme = _chunkOOHN7CTSjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
199
199
  if (theme === "none") {
200
200
  console.error('Can not eject theme "none"');
201
201
  process.exit(1);
202
202
  }
203
- if (_chunkZUBAOX5Tjs.isPath.call(void 0, theme)) {
203
+ if (_chunkOOHN7CTSjs.isPath.call(void 0, theme)) {
204
204
  console.error("Theme is already ejected");
205
205
  process.exit(1);
206
206
  }
207
- const roots = _chunkZUBAOX5Tjs.getThemeRoots.call(void 0, theme, entry);
207
+ const roots = _chunkOOHN7CTSjs.getThemeRoots.call(void 0, theme, entry);
208
208
  if (!roots.length) {
209
209
  console.error(`Does not found theme "${theme}"`);
210
210
  process.exit(1);
@@ -216,7 +216,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
216
216
  const dirPath = `./${dir}`;
217
217
  data.slides[0].frontmatter.theme = dirPath;
218
218
  data.slides[0].raw = null;
219
- await _chunkZUBAOX5Tjs.fs_exports.save(data);
219
+ await _chunkOOHN7CTSjs.fs_exports.save(data);
220
220
  console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
221
221
  });
222
222
  }, () => {
@@ -259,16 +259,16 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
259
259
  }) => {
260
260
  output = output || `${_path2.default.basename(entry, ".md")}-export`;
261
261
  process.env.NODE_ENV = "production";
262
- const { exportSlides } = await Promise.resolve().then(() => _chunkQT3EQ43Ajs.__toModule.call(void 0, _chunkQT3EQ43Ajs.__require.call(void 0, "./export-75HYECKB.js")));
262
+ const { exportSlides } = await Promise.resolve().then(() => _chunk7QXPSYEZjs.__toModule.call(void 0, _chunk7QXPSYEZjs.__require.call(void 0, "./export-GML5GDLW.js")));
263
263
  const port = await findFreePort(12445);
264
- const options = await _chunkZUBAOX5Tjs.resolveOptions.call(void 0, { entry, theme }, "build");
265
- const server = await _chunkYBR5SIF5js.createServer.call(void 0, options, {
264
+ const options = await _chunkOOHN7CTSjs.resolveOptions.call(void 0, { entry, theme }, "build");
265
+ const server = await _chunk5BL2KALHjs.createServer.call(void 0, options, {
266
266
  server: { port },
267
267
  clearScreen: false
268
268
  });
269
269
  await server.listen(port);
270
270
  printInfo(options);
271
- _chunkZUBAOX5Tjs.fs_exports.filterDisabled(options.data);
271
+ _chunkOOHN7CTSjs.fs_exports.filterDisabled(options.data);
272
272
  const width = 1920;
273
273
  const height = Math.round(width / options.data.config.aspectRatio);
274
274
  output = await exportSlides({
@@ -305,7 +305,7 @@ function printInfo(options, port, remote) {
305
305
  console.log();
306
306
  console.log();
307
307
  console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
308
- console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkZUBAOX5Tjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
308
+ console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkOOHN7CTSjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
309
309
  console.log();
310
310
  console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
311
311
  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));
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-CU4J7EH2.mjs";
3
+ } from "./chunk-G22DGVU7.mjs";
4
4
  import {
5
5
  fs_exports,
6
6
  getThemeRoots,
@@ -8,16 +8,16 @@ import {
8
8
  resolveOptions,
9
9
  resolveThemeName,
10
10
  version
11
- } from "./chunk-Q4KPSLXX.mjs";
11
+ } from "./chunk-WMQA2JLO.mjs";
12
12
  import {
13
13
  require_fast_deep_equal
14
- } from "./chunk-UM6ZQCRB.mjs";
14
+ } from "./chunk-UEIFQWPY.mjs";
15
15
  import {
16
16
  __dirname,
17
17
  __require,
18
18
  __toModule,
19
19
  init_esm_shims
20
- } from "./chunk-4OPORETI.mjs";
20
+ } from "./chunk-VYBQLH2X.mjs";
21
21
 
22
22
  // node/cli.ts
23
23
  init_esm_shims();
@@ -172,7 +172,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
172
172
  type: "boolean",
173
173
  describe: "allow download as PDF"
174
174
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
175
- const { build } = await Promise.resolve().then(() => __toModule(__require("./build-QV3SLG6A.mjs")));
175
+ const { build } = await Promise.resolve().then(() => __toModule(__require("./build-NHXJRHBN.mjs")));
176
176
  const options = await resolveOptions({ entry, theme }, "build");
177
177
  if (download && !options.data.config.download)
178
178
  options.data.config.download = download;
@@ -260,7 +260,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
260
260
  }) => {
261
261
  output = output || `${path.basename(entry, ".md")}-export`;
262
262
  process.env.NODE_ENV = "production";
263
- const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-QCGE4YB6.mjs")));
263
+ const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-OVSG7H7S.mjs")));
264
264
  const port = await findFreePort(12445);
265
265
  const options = await resolveOptions({ entry, theme }, "build");
266
266
  const server = await createServer(options, {
@@ -1,14 +1,14 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2
2
 
3
- var _chunkZUBAOX5Tjs = require('./chunk-ZUBAOX5T.js');
3
+ var _chunkOOHN7CTSjs = require('./chunk-OOHN7CTS.js');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunkQT3EQ43Ajs = require('./chunk-QT3EQ43A.js');
8
+ var _chunk7QXPSYEZjs = require('./chunk-7QXPSYEZ.js');
9
9
 
10
10
  // node/export.ts
11
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
11
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
12
12
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
13
13
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
14
14
  var _pdflib = require('pdf-lib');
@@ -62,9 +62,9 @@ async function exportSlides({
62
62
  height = 1080,
63
63
  withClicks = false
64
64
  }) {
65
- if (!_chunkZUBAOX5Tjs.packageExists.call(void 0, "playwright-chromium"))
65
+ if (!_chunkOOHN7CTSjs.packageExists.call(void 0, "playwright-chromium"))
66
66
  throw new Error("The exporting for Slidev is powered by Playwright, please installed it via `npm i -D playwright-chromium`");
67
- const { chromium } = await Promise.resolve().then(() => _chunkQT3EQ43Ajs.__toModule.call(void 0, _chunkQT3EQ43Ajs.__require.call(void 0, "playwright-chromium")));
67
+ const { chromium } = await Promise.resolve().then(() => _chunk7QXPSYEZjs.__toModule.call(void 0, _chunk7QXPSYEZjs.__require.call(void 0, "playwright-chromium")));
68
68
  const browser = await chromium.launch();
69
69
  const context = await browser.newContext({
70
70
  viewport: {
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  packageExists
3
- } from "./chunk-Q4KPSLXX.mjs";
3
+ } from "./chunk-WMQA2JLO.mjs";
4
4
  import {
5
5
  __require,
6
6
  __toModule,
7
7
  init_esm_shims
8
- } from "./chunk-4OPORETI.mjs";
8
+ } from "./chunk-VYBQLH2X.mjs";
9
9
 
10
10
  // node/export.ts
11
11
  init_esm_shims();
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import Components from 'unplugin-vue-components/vite';
4
4
  import Markdown from 'vite-plugin-md';
5
5
  import WindiCSS from 'vite-plugin-windicss';
6
6
  import RemoteAssets from 'vite-plugin-remote-assets';
7
+ import ServerRef from 'vite-plugin-vue-server-ref';
7
8
  import { ArgumentsType } from '@antfu/utils';
8
9
  import { SlidevMarkdown, SlidevThemeMeta, SlidevConfig, FontOptions, ResolvedFontOptions, SlideInfoBase, SlidevFeatureFlags, SlideInfoWithPath } from '@slidev/types';
9
10
  import * as vite from 'vite';
@@ -45,6 +46,7 @@ interface SlidevPluginOptions extends SlidevEntryOptions {
45
46
  windicss?: ArgumentsType<typeof WindiCSS>[0];
46
47
  icons?: ArgumentsType<typeof Icons>[0];
47
48
  remoteAssets?: ArgumentsType<typeof RemoteAssets>[0];
49
+ serverRef?: ArgumentsType<typeof ServerRef>[0];
48
50
  }
49
51
  interface SlidevServerOptions {
50
52
  onDataReload?: (newData: SlidevMarkdown, data: SlidevMarkdown) => void;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkYBR5SIF5js = require('./chunk-YBR5SIF5.js');
3
+ var _chunk5BL2KALHjs = require('./chunk-5BL2KALH.js');
4
4
 
5
5
 
6
6
 
@@ -9,20 +9,20 @@ var _chunkYBR5SIF5js = require('./chunk-YBR5SIF5.js');
9
9
 
10
10
 
11
11
 
12
- var _chunkZUBAOX5Tjs = require('./chunk-ZUBAOX5T.js');
12
+ var _chunkOOHN7CTSjs = require('./chunk-OOHN7CTS.js');
13
13
 
14
14
 
15
15
 
16
- var _chunkADOJPBM5js = require('./chunk-ADOJPBM5.js');
16
+ var _chunk7F2QYO53js = require('./chunk-7F2QYO53.js');
17
17
 
18
18
 
19
- var _chunkQT3EQ43Ajs = require('./chunk-QT3EQ43A.js');
19
+ var _chunk7QXPSYEZjs = require('./chunk-7QXPSYEZ.js');
20
20
 
21
21
  // node/index.ts
22
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
22
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
23
23
 
24
24
  // node/declare.ts
25
- _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
25
+ _chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
26
26
 
27
27
 
28
28
 
@@ -34,4 +34,4 @@ _chunkQT3EQ43Ajs.init_cjs_shims.call(void 0, );
34
34
 
35
35
 
36
36
 
37
- exports.ViteSlidevPlugin = _chunkADOJPBM5js.ViteSlidevPlugin; exports.createServer = _chunkYBR5SIF5js.createServer; exports.createWindiCSSPlugin = _chunkADOJPBM5js.createWindiCSSPlugin; exports.getCLIRoot = _chunkZUBAOX5Tjs.getCLIRoot; exports.getClientRoot = _chunkZUBAOX5Tjs.getClientRoot; exports.getThemeRoots = _chunkZUBAOX5Tjs.getThemeRoots; exports.getUserRoot = _chunkZUBAOX5Tjs.getUserRoot; exports.isPath = _chunkZUBAOX5Tjs.isPath; exports.parser = _chunkZUBAOX5Tjs.fs_exports; exports.resolveOptions = _chunkZUBAOX5Tjs.resolveOptions;
37
+ exports.ViteSlidevPlugin = _chunk7F2QYO53js.ViteSlidevPlugin; exports.createServer = _chunk5BL2KALHjs.createServer; exports.createWindiCSSPlugin = _chunk7F2QYO53js.createWindiCSSPlugin; exports.getCLIRoot = _chunkOOHN7CTSjs.getCLIRoot; exports.getClientRoot = _chunkOOHN7CTSjs.getClientRoot; exports.getThemeRoots = _chunkOOHN7CTSjs.getThemeRoots; exports.getUserRoot = _chunkOOHN7CTSjs.getUserRoot; exports.isPath = _chunkOOHN7CTSjs.isPath; exports.parser = _chunkOOHN7CTSjs.fs_exports; exports.resolveOptions = _chunkOOHN7CTSjs.resolveOptions;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-CU4J7EH2.mjs";
3
+ } from "./chunk-G22DGVU7.mjs";
4
4
  import {
5
5
  fs_exports,
6
6
  getCLIRoot,
@@ -9,14 +9,14 @@ import {
9
9
  getUserRoot,
10
10
  isPath,
11
11
  resolveOptions
12
- } from "./chunk-Q4KPSLXX.mjs";
12
+ } from "./chunk-WMQA2JLO.mjs";
13
13
  import {
14
14
  ViteSlidevPlugin,
15
15
  createWindiCSSPlugin
16
- } from "./chunk-UM6ZQCRB.mjs";
16
+ } from "./chunk-UEIFQWPY.mjs";
17
17
  import {
18
18
  init_esm_shims
19
- } from "./chunk-4OPORETI.mjs";
19
+ } from "./chunk-VYBQLH2X.mjs";
20
20
 
21
21
  // node/index.ts
22
22
  init_esm_shims();
package/package.json CHANGED
@@ -1,22 +1,19 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.28.8",
3
+ "version": "0.29.0",
4
4
  "description": "Presentation slides for developers",
5
5
  "homepage": "https://sli.dev",
6
6
  "bugs": "https://github.com/slidevjs/slidev/issues",
7
7
  "license": "MIT",
8
+ "author": "antfu <anthonyfu117@hotmail.com>",
8
9
  "repository": {
9
10
  "type": "git",
10
11
  "url": "https://github.com/slidevjs/slidev"
11
12
  },
12
13
  "funding": "https://github.com/sponsors/antfu",
13
- "author": "antfu <anthonyfu117@hotmail.com>",
14
- "files": [
15
- "bin",
16
- "client",
17
- "dist",
18
- "template.md"
19
- ],
14
+ "main": "dist/index.js",
15
+ "module": "dist/index.mjs",
16
+ "types": "dist/index.d.ts",
20
17
  "exports": {
21
18
  ".": {
22
19
  "import": "./dist/index.mjs",
@@ -24,9 +21,12 @@
24
21
  },
25
22
  "./*": "./*"
26
23
  },
27
- "main": "dist/index.js",
28
- "module": "dist/index.mjs",
29
- "types": "dist/index.d.ts",
24
+ "files": [
25
+ "bin",
26
+ "client",
27
+ "dist",
28
+ "template.md"
29
+ ],
30
30
  "bin": {
31
31
  "slidev": "./bin/slidev.js"
32
32
  },
@@ -40,17 +40,17 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@antfu/utils": "^0.5.0",
43
- "@iconify-json/carbon": "^1.1.1",
44
- "@iconify-json/ph": "^1.1.0",
45
- "@slidev/client": "0.28.8",
46
- "@slidev/parser": "0.28.8",
47
- "@slidev/types": "0.28.8",
48
- "@vitejs/plugin-vue": "^2.2.2",
43
+ "@iconify-json/carbon": "^1.1.2",
44
+ "@iconify-json/ph": "^1.1.1",
45
+ "@slidev/client": "0.29.0",
46
+ "@slidev/parser": "0.29.0",
47
+ "@slidev/types": "0.29.0",
48
+ "@vitejs/plugin-vue": "^2.2.4",
49
49
  "@vue/compiler-sfc": "^3.2.31",
50
50
  "cli-progress": "^3.10.0",
51
51
  "codemirror": "^5.65.2",
52
52
  "connect": "^3.7.0",
53
- "debug": "^4.3.3",
53
+ "debug": "^4.3.4",
54
54
  "fast-glob": "^3.2.11",
55
55
  "fs-extra": "^10.0.1",
56
56
  "global-dirs": "^3.0.0",
@@ -58,12 +58,12 @@
58
58
  "is-installed-globally": "^0.4.0",
59
59
  "jiti": "^1.13.0",
60
60
  "js-base64": "^3.7.2",
61
- "katex": "^0.15.2",
61
+ "katex": "^0.15.3",
62
62
  "kolorist": "^1.5.1",
63
63
  "markdown-it": "^12.3.2",
64
64
  "markdown-it-footnote": "^3.0.3",
65
65
  "markdown-it-link-attributes": "^4.0.0",
66
- "monaco-editor": "^0.32.1",
66
+ "monaco-editor": "^0.33.0",
67
67
  "nanoid": "^3.3.1",
68
68
  "open": "^8.4.0",
69
69
  "pdf-lib": "^1.17.1",
@@ -74,16 +74,16 @@
74
74
  "resolve-from": "^5.0.0",
75
75
  "resolve-global": "^1.0.0",
76
76
  "shiki": "^0.10.1",
77
- "unplugin-icons": "^0.13.2",
78
- "unplugin-vue-components": "^0.17.21",
79
- "vite": "^2.8.4",
80
- "vite-plugin-md": "^0.11.8",
77
+ "unplugin-icons": "^0.14.0",
78
+ "unplugin-vue-components": "^0.18.3",
79
+ "vite": "^2.8.6",
80
+ "vite-plugin-md": "^0.12.0",
81
81
  "vite-plugin-remote-assets": "^0.2.2",
82
82
  "vite-plugin-vue-server-ref": "^0.2.4",
83
- "vite-plugin-windicss": "^1.7.1",
83
+ "vite-plugin-windicss": "^1.8.3",
84
84
  "vue": "^3.2.31",
85
- "windicss": "^3.4.4",
86
- "yargs": "^17.3.1"
85
+ "windicss": "^3.5.1",
86
+ "yargs": "^17.4.0"
87
87
  },
88
88
  "devDependencies": {
89
89
  "@types/plantuml-encoder": "^1.4.0",
@@ -99,5 +99,5 @@
99
99
  "dev": "nr build --watch",
100
100
  "start": "esno node/cli.ts"
101
101
  },
102
- "readme": "<br>\n<p align=\"center\">\n<a href=\"https://sli.dev\" target=\"_blank\">\n<img src=\"https://sli.dev/logo-title.png\" alt=\"Slidev\" height=\"250\" width=\"250\"/>\n</a>\n</p>\n\n<p align=\"center\">\nPresentation <b>slide</b>s for <b>dev</b>elopers 🧑‍💻👩‍💻👨‍💻\n</p>\n\n<p align=\"center\">\n<a href=\"https://www.npmjs.com/package/@slidev/cli\" target=\"__blank\"><img src=\"https://img.shields.io/npm/v/@slidev/cli?color=2B90B6&label=\" alt=\"NPM version\"></a>\n<a href=\"https://www.npmjs.com/package/@slidev/cli\" target=\"__blank\"><img alt=\"NPM Downloads\" src=\"https://img.shields.io/npm/dm/@slidev/cli?color=349dbe&label=\"></a>\n<a href=\"https://sli.dev/\" target=\"__blank\"><img src=\"https://img.shields.io/static/v1?label=&message=docs%20%26%20demos&color=45b8cd\" alt=\"Docs & Demos\"></a>\n<a href=\"https://sli.dev/themes/gallery.html\" target=\"__blank\"><img src=\"https://img.shields.io/static/v1?label=&message=themes&color=4ec5d4\" alt=\"Themes\"></a>\n<br>\n<a href=\"https://github.com/slidevjs/slidev\" target=\"__blank\"><img alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/slidevjs/slidev?style=social\"></a>\n</p>\n\n<p align=\"center\">\n <a href=\"https://twitter.com/antfu7/status/1389604687502995457\">Video Preview</a> | <a href=\"https://sli.dev\">Documentation</a>\n</p>\n\n<p align=\"center\">\n<table>\n<tbody>\n<td align=\"center\">\n<img width=\"2000\" height=\"0\"><br>\nStatus: <b>Public Beta 🎉</b><br>\n<sub>Made possible by my <a href=\"https://github.com/sponsors/antfu\">Sponsor Program 💖</a></sub><br>\n<img width=\"2000\" height=\"0\">\n</td>\n</tbody>\n</table>\n</p>\n\n## Features\n\n- 📝 [**Markdown-based**](https://sli.dev/guide/syntax.html) - use your favorite editors and workflow\n- 🧑‍💻 [**Developer Friendly**](https://sli.dev/guide/syntax.html#code-blocks) - built-in syntax highlighting, live coding, etc.\n- 🎨 [**Themable**](https://sli.dev/themes/gallery.html) - theme can be shared and used with npm packages.\n- 🌈 [**Stylish**](https://sli.dev/guide/syntax.html#embedded-styles) - [Windi CSS](https://windicss.org/) on-demand utilities, easy-to-use embedded stylesheets.\n- 🤹 [**Interactive**](https://sli.dev/custom/directory-structure.html#components) - embedding Vue components seamlessly.\n- 🎙 [**Presenter Mode**](https://sli.dev/guide/presenter-mode.html) - use another window, or even your phone to control your slides.\n- 🧮 [**LaTeX**](https://sli.dev/guide/syntax.html#latex) - built-in LaTeX math equations support.\n- 📰 [**Diagrams**](https://sli.dev/guide/syntax.html#diagrams) - creates diagrams with textual descriptions\n- 🌟 [**Icons**](https://sli.dev/guide/syntax.html#icons) - access to icons from any iconset directly.\n- 💻 [**Editors**](https://sli.dev/guide/editors.html) - integrated editor, or [extension for VS Code](https://github.com/slidevjs/slidev-vscode)\n- 🎥 [**Recording**](https://sli.dev/guide/recording.html) - built-in recording and camera view.\n- 📤 [**Portable**](https://sli.dev/guide/exporting.html) - export into PDF, PNGs, or even a hostable SPA.\n- ⚡️ [**Fast**](https://vitejs.dev) - instant reloading powered by [Vite](https://vitejs.dev).\n- 🛠 [**Hackable**](https://sli.dev/custom/config-vite.html) - using Vite plugins, Vue components, or any npm packages.\n\n## Getting Started\n\n### Try it Online ⚡️\n\n[sli.dev/new](https://sli.dev/new)\n\n[![](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://sli.dev/new)\n\n### Init Project Locally\n\nInstall [Node.js >=14](https://nodejs.org/) and run the following command:\n\n```bash\nnpm init slidev\n```\n\nDocumentations:\n**[English](https://sli.dev)** | [中文文档](https://cn.sli.dev) | [Français](https://fr.sli.dev) | [Español](https://es.sli.dev) | [Русский](https://ru.sli.dev) | [Português-BR](https://br.sli.dev)\n\nDiscord: [chat.sli.dev](https://chat.sli.dev)\n\nFor a full example, you can check the [demo](https://github.com/slidevjs/slidev/blob/main/demo) folder, which is also the source file for [my previous talk](https://antfu.me/posts/composable-vue-vueday-2021).\n\n## Tech Stack\n\n- [Vite](https://vitejs.dev) - An extremely fast frontend tooling\n- [Vue 3](https://v3.vuejs.org/) powered [Markdown](https://daringfireball.net/projects/markdown/syntax) - Focus on the content while having the power of HTML and Vue components whenever needed\n- [Windi CSS](https://github.com/windicss/windicss) - On-demand utility-first CSS framework, style your slides at ease\n- [Prism](https://github.com/PrismJS/prism), [Shiki](https://github.com/shikijs/shiki), [Monaco Editor](https://github.com/Microsoft/monaco-editor) - First-class code snippets support with live coding capability\n- [RecordRTC](https://recordrtc.org) - Built-in recording and camera view\n- [VueUse](https://vueuse.org) family - [`@vueuse/core`](https://github.com/vueuse/vueuse), [`@vueuse/head`](https://github.com/vueuse/head), [`@vueuse/motion`](https://github.com/vueuse/motion), etc.\n- [Iconify](https://iconify.design/) - Iconsets collection.\n- [Drauu](https://github.com/antfu/drauu) - Drawing and annotations support\n- [KaTeX](https://katex.org/) - LaTeX math rendering.\n- [Mermaid](https://mermaid-js.github.io/mermaid) - Textual Diagrams.\n\n## Sponsors\n\nThis project is made possible by all the sponsors supporting my work:\n\n<p align=\"center\">\n <a href=\"https://github.com/sponsors/antfu\">\n <img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>\n </a>\n</p>\n\n## License\n\nMIT License © 2021 [Anthony Fu](https://github.com/antfu)\n"
102
+ "readme": "<br>\n<p align=\"center\">\n<a href=\"https://sli.dev\" target=\"_blank\">\n<img src=\"https://sli.dev/logo-title.png\" alt=\"Slidev\" height=\"250\" width=\"250\"/>\n</a>\n</p>\n\n<p align=\"center\">\nPresentation <b>slide</b>s for <b>dev</b>elopers 🧑‍💻👩‍💻👨‍💻\n</p>\n\n<p align=\"center\">\n<a href=\"https://www.npmjs.com/package/@slidev/cli\" target=\"__blank\"><img src=\"https://img.shields.io/npm/v/@slidev/cli?color=2B90B6&label=\" alt=\"NPM version\"></a>\n<a href=\"https://www.npmjs.com/package/@slidev/cli\" target=\"__blank\"><img alt=\"NPM Downloads\" src=\"https://img.shields.io/npm/dm/@slidev/cli?color=349dbe&label=\"></a>\n<a href=\"https://sli.dev/\" target=\"__blank\"><img src=\"https://img.shields.io/static/v1?label=&message=docs%20%26%20demos&color=45b8cd\" alt=\"Docs & Demos\"></a>\n<a href=\"https://sli.dev/themes/gallery.html\" target=\"__blank\"><img src=\"https://img.shields.io/static/v1?label=&message=themes&color=4ec5d4\" alt=\"Themes\"></a>\n<br>\n<a href=\"https://github.com/slidevjs/slidev\" target=\"__blank\"><img alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/slidevjs/slidev?style=social\"></a>\n</p>\n\n<p align=\"center\">\n <a href=\"https://twitter.com/antfu7/status/1389604687502995457\">Video Preview</a> | <a href=\"https://sli.dev\">Documentation</a>\n</p>\n\n<div align=\"center\">\n<table>\n<tbody>\n<td align=\"center\">\n<img width=\"2000\" height=\"0\"><br>\nStatus: <b>Public Beta 🎉</b><br>\n<sub>Made possible by my <a href=\"https://github.com/sponsors/antfu\">Sponsor Program 💖</a></sub><br>\n<img width=\"2000\" height=\"0\">\n</td>\n</tbody>\n</table>\n</div>\n\n## Features\n\n- 📝 [**Markdown-based**](https://sli.dev/guide/syntax.html) - use your favorite editors and workflow\n- 🧑‍💻 [**Developer Friendly**](https://sli.dev/guide/syntax.html#code-blocks) - built-in syntax highlighting, live coding, etc.\n- 🎨 [**Themable**](https://sli.dev/themes/gallery.html) - theme can be shared and used with npm packages.\n- 🌈 [**Stylish**](https://sli.dev/guide/syntax.html#embedded-styles) - [Windi CSS](https://windicss.org/) on-demand utilities, easy-to-use embedded stylesheets.\n- 🤹 [**Interactive**](https://sli.dev/custom/directory-structure.html#components) - embedding Vue components seamlessly.\n- 🎙 [**Presenter Mode**](https://sli.dev/guide/presenter-mode.html) - use another window, or even your phone to control your slides.\n- 🧮 [**LaTeX**](https://sli.dev/guide/syntax.html#latex) - built-in LaTeX math equations support.\n- 📰 [**Diagrams**](https://sli.dev/guide/syntax.html#diagrams) - creates diagrams with textual descriptions\n- 🌟 [**Icons**](https://sli.dev/guide/syntax.html#icons) - access to icons from any iconset directly.\n- 💻 [**Editors**](https://sli.dev/guide/editors.html) - integrated editor, or [extension for VS Code](https://github.com/slidevjs/slidev-vscode)\n- 🎥 [**Recording**](https://sli.dev/guide/recording.html) - built-in recording and camera view.\n- 📤 [**Portable**](https://sli.dev/guide/exporting.html) - export into PDF, PNGs, or even a hostable SPA.\n- ⚡️ [**Fast**](https://vitejs.dev) - instant reloading powered by [Vite](https://vitejs.dev).\n- 🛠 [**Hackable**](https://sli.dev/custom/config-vite.html) - using Vite plugins, Vue components, or any npm packages.\n\n## Getting Started\n\n### Try it Online ⚡️\n\n[sli.dev/new](https://sli.dev/new)\n\n[![](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://sli.dev/new)\n\n### Init Project Locally\n\nInstall [Node.js >=14](https://nodejs.org/) and run the following command:\n\n```bash\nnpm init slidev\n```\n\nDocumentations:\n**[English](https://sli.dev)** | [中文文档](https://cn.sli.dev) | [Français](https://fr.sli.dev) | [Español](https://es.sli.dev) | [Русский](https://ru.sli.dev) | [Português-BR](https://br.sli.dev)\n\nDiscord: [chat.sli.dev](https://chat.sli.dev)\n\nFor a full example, you can check the [demo](https://github.com/slidevjs/slidev/blob/main/demo) folder, which is also the source file for [my previous talk](https://antfu.me/posts/composable-vue-vueday-2021).\n\n## Tech Stack\n\n- [Vite](https://vitejs.dev) - An extremely fast frontend tooling\n- [Vue 3](https://v3.vuejs.org/) powered [Markdown](https://daringfireball.net/projects/markdown/syntax) - Focus on the content while having the power of HTML and Vue components whenever needed\n- [Windi CSS](https://github.com/windicss/windicss) - On-demand utility-first CSS framework, style your slides at ease\n- [Prism](https://github.com/PrismJS/prism), [Shiki](https://github.com/shikijs/shiki), [Monaco Editor](https://github.com/Microsoft/monaco-editor) - First-class code snippets support with live coding capability\n- [RecordRTC](https://recordrtc.org) - Built-in recording and camera view\n- [VueUse](https://vueuse.org) family - [`@vueuse/core`](https://github.com/vueuse/vueuse), [`@vueuse/head`](https://github.com/vueuse/head), [`@vueuse/motion`](https://github.com/vueuse/motion), etc.\n- [Iconify](https://iconify.design/) - Iconsets collection.\n- [Drauu](https://github.com/antfu/drauu) - Drawing and annotations support\n- [KaTeX](https://katex.org/) - LaTeX math rendering.\n- [Mermaid](https://mermaid-js.github.io/mermaid) - Textual Diagrams.\n\n## Sponsors\n\nThis project is made possible by all the sponsors supporting my work:\n\n<p align=\"center\">\n <a href=\"https://github.com/sponsors/antfu\">\n <img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>\n </a>\n</p>\n\n## License\n\nMIT License © 2021 [Anthony Fu](https://github.com/antfu)\n"
103
103
  }