@slidev/cli 0.27.18 → 0.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkDVHCB7TLjs = require('./chunk-DVHCB7TL.js');
3
+ var _chunkINYQJTKAjs = require('./chunk-INYQJTKA.js');
4
4
 
5
5
 
6
- var _chunk7EYE5BOQjs = require('./chunk-7EYE5BOQ.js');
6
+ var _chunkBYTWGCY3js = require('./chunk-BYTWGCY3.js');
7
7
 
8
8
  // node/server.ts
9
- _chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
9
+ _chunkBYTWGCY3js.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 _chunkDVHCB7TLjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
23
+ await _chunkINYQJTKAjs.ViteSlidevPlugin.call(void 0, options, pluginOptions, serverOptions)
24
24
  ]
25
25
  }));
26
26
  return server;
package/dist/cli.js CHANGED
@@ -1,43 +1,36 @@
1
- "use strict"; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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 _chunk3QMXOBKWjs = require('./chunk-3QMXOBKW.js');
3
+ var _chunkZ64T7ZBUjs = require('./chunk-Z64T7ZBU.js');
4
4
 
5
5
 
6
6
 
7
7
 
8
8
 
9
9
 
10
- var _chunkI4X2EWTIjs = require('./chunk-I4X2EWTI.js');
11
10
 
11
+ var _chunk7PMB3SQ5js = require('./chunk-7PMB3SQ5.js');
12
12
 
13
- var _chunkDVHCB7TLjs = require('./chunk-DVHCB7TL.js');
14
13
 
14
+ var _chunkINYQJTKAjs = require('./chunk-INYQJTKA.js');
15
15
 
16
16
 
17
17
 
18
- var _chunk7EYE5BOQjs = require('./chunk-7EYE5BOQ.js');
18
+
19
+ var _chunkBYTWGCY3js = require('./chunk-BYTWGCY3.js');
19
20
 
20
21
  // node/cli.ts
21
- _chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
22
- var import_fast_deep_equal = _chunk7EYE5BOQjs.__toModule.call(void 0, _chunkDVHCB7TLjs.require_fast_deep_equal.call(void 0, ));
22
+ _chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
23
+ var import_fast_deep_equal = _chunkBYTWGCY3js.__toModule.call(void 0, _chunkINYQJTKAjs.require_fast_deep_equal.call(void 0, ));
23
24
  var _path = require('path'); var _path2 = _interopRequireDefault(_path);
24
25
  var _net = require('net'); var _net2 = _interopRequireDefault(_net);
25
26
  var _os = require('os'); var _os2 = _interopRequireDefault(_os);
26
27
  var _child_process = require('child_process');
27
-
28
-
29
- var _readline = require('readline');
28
+ var _readline = require('readline'); var readline = _interopRequireWildcard(_readline);
30
29
  var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
31
30
  var _open = require('open'); var _open2 = _interopRequireDefault(_open);
32
31
  var _yargs = require('yargs'); var _yargs2 = _interopRequireDefault(_yargs);
33
32
  var _prompts = require('prompts'); var _prompts2 = _interopRequireDefault(_prompts);
34
33
  var _kolorist = require('kolorist');
35
-
36
-
37
-
38
-
39
-
40
- var _fs = require('@slidev/parser/fs');
41
34
  var _isinstalledglobally = require('is-installed-globally'); var _isinstalledglobally2 = _interopRequireDefault(_isinstalledglobally);
42
35
  var CONFIG_RESTART_FIELDS = [
43
36
  "highlighter",
@@ -45,7 +38,7 @@ var CONFIG_RESTART_FIELDS = [
45
38
  "routerMode",
46
39
  "fonts"
47
40
  ];
48
- var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunkI4X2EWTIjs.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
41
+ var cli = _yargs2.default.scriptName("slidev").usage("$0 [args]").version(_chunk7PMB3SQ5js.version).strict().showHelpOnFail(false).alias("h", "help").alias("v", "version");
49
42
  cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOptions(args).option("port", {
50
43
  alias: "p",
51
44
  type: "number",
@@ -89,9 +82,9 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
89
82
  async function initServer() {
90
83
  if (server)
91
84
  await server.close();
92
- const options = await _chunkI4X2EWTIjs.resolveOptions.call(void 0, { entry, theme }, "dev");
85
+ const options = await _chunk7PMB3SQ5js.resolveOptions.call(void 0, { entry, theme }, "dev");
93
86
  port = userPort || await findFreePort(3030);
94
- server = await _chunk3QMXOBKWjs.createServer.call(void 0, options, {
87
+ server = await _chunkZ64T7ZBUjs.createServer.call(void 0, options, {
95
88
  server: {
96
89
  port,
97
90
  strictPort: true,
@@ -102,7 +95,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
102
95
  logLevel: log
103
96
  }, {
104
97
  onDataReload(newData, data) {
105
- if (!theme && _chunkI4X2EWTIjs.resolveThemeName.call(void 0, newData.config.theme) !== _chunkI4X2EWTIjs.resolveThemeName.call(void 0, data.config.theme)) {
98
+ if (!theme && _chunk7PMB3SQ5js.resolveThemeName.call(void 0, newData.config.theme) !== _chunk7PMB3SQ5js.resolveThemeName.call(void 0, data.config.theme)) {
106
99
  console.log(_kolorist.yellow.call(void 0, "\n restarting on theme change\n"));
107
100
  initServer();
108
101
  } else if (CONFIG_RESTART_FIELDS.some((i) => !(0, import_fast_deep_equal.default)(newData.config[i], data.config[i]))) {
@@ -140,7 +133,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
140
133
  function bindShortcut() {
141
134
  process.stdin.resume();
142
135
  process.stdin.setEncoding("utf8");
143
- _readline.emitKeypressEvents.call(void 0, process.stdin);
136
+ readline.emitKeypressEvents(process.stdin);
144
137
  if (process.stdin.isTTY)
145
138
  process.stdin.setRawMode(true);
146
139
  process.stdin.on("keypress", (str, key) => {
@@ -178,8 +171,8 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
178
171
  type: "boolean",
179
172
  describe: "allow download as PDF"
180
173
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
181
- const { build } = await Promise.resolve().then(() => _chunk7EYE5BOQjs.__toModule.call(void 0, _chunk7EYE5BOQjs.__require.call(void 0, "./build-IDWUSCWC.js")));
182
- const options = await _chunkI4X2EWTIjs.resolveOptions.call(void 0, { entry, theme }, "build");
174
+ const { build } = await Promise.resolve().then(() => _chunkBYTWGCY3js.__toModule.call(void 0, _chunkBYTWGCY3js.__require.call(void 0, "./build-MEO3777W.js")));
175
+ const options = await _chunk7PMB3SQ5js.resolveOptions.call(void 0, { entry, theme }, "build");
183
176
  if (download && !options.data.config.download)
184
177
  options.data.config.download = download;
185
178
  printInfo(options);
@@ -192,26 +185,26 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
192
185
  });
193
186
  });
194
187
  cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
195
- const data = await _fs.load.call(void 0, entry);
196
- _fs.prettify.call(void 0, data);
197
- await _fs.save.call(void 0, data);
188
+ const data = await _chunk7PMB3SQ5js.fs_exports.load(entry);
189
+ _chunk7PMB3SQ5js.fs_exports.prettify(data);
190
+ await _chunk7PMB3SQ5js.fs_exports.save(data);
198
191
  });
199
192
  cli.command("theme [subcommand]", "Theme related operations", (command) => {
200
193
  return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
201
194
  type: "string",
202
195
  default: "theme"
203
196
  }), async ({ entry, dir, theme: themeInput }) => {
204
- const data = await _fs.load.call(void 0, entry);
205
- const theme = _chunkI4X2EWTIjs.resolveThemeName.call(void 0, themeInput || data.config.theme);
197
+ const data = await _chunk7PMB3SQ5js.fs_exports.load(entry);
198
+ const theme = _chunk7PMB3SQ5js.resolveThemeName.call(void 0, themeInput || data.config.theme);
206
199
  if (theme === "none") {
207
200
  console.error('Can not eject theme "none"');
208
201
  process.exit(1);
209
202
  }
210
- if (_chunkI4X2EWTIjs.isPath.call(void 0, theme)) {
203
+ if (_chunk7PMB3SQ5js.isPath.call(void 0, theme)) {
211
204
  console.error("Theme is already ejected");
212
205
  process.exit(1);
213
206
  }
214
- const roots = _chunkI4X2EWTIjs.getThemeRoots.call(void 0, theme, entry);
207
+ const roots = _chunk7PMB3SQ5js.getThemeRoots.call(void 0, theme, entry);
215
208
  if (!roots.length) {
216
209
  console.error(`Does not found theme "${theme}"`);
217
210
  process.exit(1);
@@ -223,7 +216,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
223
216
  const dirPath = `./${dir}`;
224
217
  data.slides[0].frontmatter.theme = dirPath;
225
218
  data.slides[0].raw = null;
226
- await _fs.save.call(void 0, data);
219
+ await _chunk7PMB3SQ5js.fs_exports.save(data);
227
220
  console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
228
221
  });
229
222
  }, () => {
@@ -266,16 +259,16 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
266
259
  }) => {
267
260
  output = output || `${_path2.default.basename(entry, ".md")}-export`;
268
261
  process.env.NODE_ENV = "production";
269
- const { exportSlides } = await Promise.resolve().then(() => _chunk7EYE5BOQjs.__toModule.call(void 0, _chunk7EYE5BOQjs.__require.call(void 0, "./export-YPXOSS5M.js")));
262
+ const { exportSlides } = await Promise.resolve().then(() => _chunkBYTWGCY3js.__toModule.call(void 0, _chunkBYTWGCY3js.__require.call(void 0, "./export-MW3OOGZI.js")));
270
263
  const port = await findFreePort(12445);
271
- const options = await _chunkI4X2EWTIjs.resolveOptions.call(void 0, { entry, theme }, "build");
272
- const server = await _chunk3QMXOBKWjs.createServer.call(void 0, options, {
264
+ const options = await _chunk7PMB3SQ5js.resolveOptions.call(void 0, { entry, theme }, "build");
265
+ const server = await _chunkZ64T7ZBUjs.createServer.call(void 0, options, {
273
266
  server: { port },
274
267
  clearScreen: false
275
268
  });
276
269
  await server.listen(port);
277
270
  printInfo(options);
278
- _fs.filterDisabled.call(void 0, options.data);
271
+ _chunk7PMB3SQ5js.fs_exports.filterDisabled(options.data);
279
272
  const width = 1920;
280
273
  const height = Math.round(width / options.data.config.aspectRatio);
281
274
  output = await exportSlides({
@@ -312,7 +305,7 @@ function printInfo(options, port, remote) {
312
305
  console.log();
313
306
  console.log();
314
307
  console.log(` ${_kolorist.cyan.call(void 0, "\u25CF") + _kolorist.blue.call(void 0, "\u25A0") + _kolorist.yellow.call(void 0, "\u25B2")}`);
315
- console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunkI4X2EWTIjs.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
308
+ console.log(`${_kolorist.bold.call(void 0, " Slidev")} ${_kolorist.blue.call(void 0, `v${_chunk7PMB3SQ5js.version}`)} ${_isinstalledglobally2.default ? _kolorist.yellow.call(void 0, "(global)") : ""}`);
316
309
  console.log();
317
310
  console.log(_kolorist.dim.call(void 0, " theme ") + (options.theme ? _kolorist.green.call(void 0, options.theme) : _kolorist.gray.call(void 0, "none")));
318
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,41 +1,37 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-6HK3HED2.mjs";
3
+ } from "./chunk-RLNIZC66.mjs";
4
4
  import {
5
+ fs_exports,
5
6
  getThemeRoots,
6
7
  isPath,
7
8
  resolveOptions,
8
9
  resolveThemeName,
9
10
  version
10
- } from "./chunk-4A5D2CTX.mjs";
11
+ } from "./chunk-36I7664S.mjs";
11
12
  import {
12
13
  require_fast_deep_equal
13
- } from "./chunk-L7QFSRQN.mjs";
14
+ } from "./chunk-2E3KKOOJ.mjs";
14
15
  import {
16
+ __dirname,
15
17
  __require,
16
- __toModule
17
- } from "./chunk-QQD2JVXL.mjs";
18
+ __toModule,
19
+ init_esm_shims
20
+ } from "./chunk-OXQUV4ZP.mjs";
18
21
 
19
22
  // node/cli.ts
23
+ init_esm_shims();
20
24
  var import_fast_deep_equal = __toModule(require_fast_deep_equal());
21
25
  import path from "path";
22
26
  import net from "net";
23
27
  import os from "os";
24
28
  import { exec } from "child_process";
25
- import {
26
- emitKeypressEvents
27
- } from "readline";
29
+ import * as readline from "readline";
28
30
  import fs from "fs-extra";
29
31
  import openBrowser from "open";
30
32
  import yargs from "yargs";
31
33
  import prompts from "prompts";
32
34
  import { blue, bold, cyan, dim, gray, green, underline, yellow } from "kolorist";
33
- import {
34
- filterDisabled,
35
- load,
36
- prettify,
37
- save
38
- } from "@slidev/parser/fs";
39
35
  import isInstalledGlobally from "is-installed-globally";
40
36
  var CONFIG_RESTART_FIELDS = [
41
37
  "highlighter",
@@ -138,7 +134,7 @@ cli.command("* [entry]", "Start a local server for Slidev", (args) => commonOpti
138
134
  function bindShortcut() {
139
135
  process.stdin.resume();
140
136
  process.stdin.setEncoding("utf8");
141
- emitKeypressEvents(process.stdin);
137
+ readline.emitKeypressEvents(process.stdin);
142
138
  if (process.stdin.isTTY)
143
139
  process.stdin.setRawMode(true);
144
140
  process.stdin.on("keypress", (str, key) => {
@@ -176,7 +172,7 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
176
172
  type: "boolean",
177
173
  describe: "allow download as PDF"
178
174
  }).strict().help(), async ({ entry, theme, watch, base, download, out }) => {
179
- const { build } = await Promise.resolve().then(() => __toModule(__require("./build-G4KCH5XF.mjs")));
175
+ const { build } = await Promise.resolve().then(() => __toModule(__require("./build-JQIGPONC.mjs")));
180
176
  const options = await resolveOptions({ entry, theme }, "build");
181
177
  if (download && !options.data.config.download)
182
178
  options.data.config.download = download;
@@ -190,16 +186,16 @@ cli.command("build [entry]", "Build hostable SPA", (args) => commonOptions(args)
190
186
  });
191
187
  });
192
188
  cli.command("format [entry]", "Format the markdown file", (args) => commonOptions(args).strict().help(), async ({ entry }) => {
193
- const data = await load(entry);
194
- prettify(data);
195
- await save(data);
189
+ const data = await fs_exports.load(entry);
190
+ fs_exports.prettify(data);
191
+ await fs_exports.save(data);
196
192
  });
197
193
  cli.command("theme [subcommand]", "Theme related operations", (command) => {
198
194
  return command.command("eject", "Eject current theme into local file system", (args) => commonOptions(args).option("dir", {
199
195
  type: "string",
200
196
  default: "theme"
201
197
  }), async ({ entry, dir, theme: themeInput }) => {
202
- const data = await load(entry);
198
+ const data = await fs_exports.load(entry);
203
199
  const theme = resolveThemeName(themeInput || data.config.theme);
204
200
  if (theme === "none") {
205
201
  console.error('Can not eject theme "none"');
@@ -221,7 +217,7 @@ cli.command("theme [subcommand]", "Theme related operations", (command) => {
221
217
  const dirPath = `./${dir}`;
222
218
  data.slides[0].frontmatter.theme = dirPath;
223
219
  data.slides[0].raw = null;
224
- await save(data);
220
+ await fs_exports.save(data);
225
221
  console.log(`Theme "${theme}" ejected successfully to "${dirPath}"`);
226
222
  });
227
223
  }, () => {
@@ -264,7 +260,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
264
260
  }) => {
265
261
  output = output || `${path.basename(entry, ".md")}-export`;
266
262
  process.env.NODE_ENV = "production";
267
- const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-4IC3K3DC.mjs")));
263
+ const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-33JV3JOZ.mjs")));
268
264
  const port = await findFreePort(12445);
269
265
  const options = await resolveOptions({ entry, theme }, "build");
270
266
  const server = await createServer(options, {
@@ -273,7 +269,7 @@ cli.command("export [entry]", "Export slides to PDF", (args) => commonOptions(ar
273
269
  });
274
270
  await server.listen(port);
275
271
  printInfo(options);
276
- filterDisabled(options.data);
272
+ fs_exports.filterDisabled(options.data);
277
273
  const width = 1920;
278
274
  const height = Math.round(width / options.data.config.aspectRatio);
279
275
  output = await exportSlides({
@@ -1,12 +1,14 @@
1
1
  import {
2
2
  packageExists
3
- } from "./chunk-4A5D2CTX.mjs";
3
+ } from "./chunk-36I7664S.mjs";
4
4
  import {
5
5
  __require,
6
- __toModule
7
- } from "./chunk-QQD2JVXL.mjs";
6
+ __toModule,
7
+ init_esm_shims
8
+ } from "./chunk-OXQUV4ZP.mjs";
8
9
 
9
10
  // node/export.ts
11
+ init_esm_shims();
10
12
  import path from "path";
11
13
  import fs from "fs-extra";
12
14
  import { PDFDocument } from "pdf-lib";
@@ -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 _chunkI4X2EWTIjs = require('./chunk-I4X2EWTI.js');
3
+ var _chunk7PMB3SQ5js = require('./chunk-7PMB3SQ5.js');
4
4
 
5
5
 
6
6
 
7
7
 
8
- var _chunk7EYE5BOQjs = require('./chunk-7EYE5BOQ.js');
8
+ var _chunkBYTWGCY3js = require('./chunk-BYTWGCY3.js');
9
9
 
10
10
  // node/export.ts
11
- _chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
11
+ _chunkBYTWGCY3js.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 (!_chunkI4X2EWTIjs.packageExists.call(void 0, "playwright-chromium"))
65
+ if (!_chunk7PMB3SQ5js.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 playwright-chromium`");
67
- const { chromium } = await Promise.resolve().then(() => _chunk7EYE5BOQjs.__toModule.call(void 0, _chunk7EYE5BOQjs.__require.call(void 0, "playwright-chromium")));
67
+ const { chromium } = await Promise.resolve().then(() => _chunkBYTWGCY3js.__toModule.call(void 0, _chunkBYTWGCY3js.__require.call(void 0, "playwright-chromium")));
68
68
  const browser = await chromium.launch();
69
69
  const context = await browser.newContext({
70
70
  viewport: {
package/dist/index.d.ts CHANGED
@@ -5,11 +5,9 @@ import Markdown from 'vite-plugin-md';
5
5
  import WindiCSS from 'vite-plugin-windicss';
6
6
  import RemoteAssets from 'vite-plugin-remote-assets';
7
7
  import { ArgumentsType } from '@antfu/utils';
8
- import { SlidevMarkdown } from '@slidev/types';
8
+ import { SlidevMarkdown, SlidevThemeMeta, SlidevConfig, FontOptions, ResolvedFontOptions, SlideInfoBase, SlidevFeatureFlags, SlideInfoWithPath } from '@slidev/types';
9
9
  import * as vite from 'vite';
10
10
  import { InlineConfig, Plugin } from 'vite';
11
- import * as fs from '@slidev/parser/fs';
12
- export { fs as parser };
13
11
 
14
12
  interface SlidevEntryOptions {
15
13
  /**
@@ -78,4 +76,70 @@ declare function ViteSlidevPlugin(options: ResolvedSlidevOptions, pluginOptions:
78
76
 
79
77
  declare function createWindiCSSPlugin({ themeRoots, clientRoot, userRoot, roots, data }: ResolvedSlidevOptions, { windicss: windiOptions }: SlidevPluginOptions): Promise<vite.Plugin[]>;
80
78
 
81
- export { ResolvedSlidevOptions, SlidevEntryOptions, SlidevPluginOptions, SlidevServerOptions, ViteSlidevPlugin, createServer, createWindiCSSPlugin, getCLIRoot, getClientRoot, getThemeRoots, getUserRoot, isPath, resolveOptions };
79
+ /**
80
+ * 1,3-5,8 => [1, 3, 4, 5, 8]
81
+ */
82
+ declare function parseRangeString(total: number, rangeStr?: string): number[];
83
+ /**
84
+ * Accepts `16/9` `1:1` `3x4`
85
+ */
86
+ declare function parseAspectRatio(str: string | number): number;
87
+
88
+ declare function resolveConfig(headmatter: any, themeMeta?: SlidevThemeMeta): SlidevConfig;
89
+ declare function resolveFonts(fonts?: FontOptions): ResolvedFontOptions;
90
+
91
+ declare function stringify(data: SlidevMarkdown): string;
92
+ declare function filterDisabled(data: SlidevMarkdown): SlidevMarkdown;
93
+ declare function stringifySlide(data: SlideInfoBase, idx?: number): string;
94
+ declare function prettifySlide(data: SlideInfoBase): SlideInfoBase;
95
+ declare function prettify(data: SlidevMarkdown): SlidevMarkdown;
96
+ declare function detectFeatures(code: string): SlidevFeatureFlags;
97
+ declare function parseSlide(raw: string): SlideInfoBase;
98
+ declare function parse(markdown: string, filepath?: string, themeMeta?: SlidevThemeMeta): SlidevMarkdown;
99
+ declare function mergeFeatureFlags(a: SlidevFeatureFlags, b: SlidevFeatureFlags): SlidevFeatureFlags;
100
+ declare function scanMonacoModules(md: string): string[];
101
+
102
+ declare function load(filepath: string, themeMeta?: SlidevThemeMeta, content?: string): Promise<SlidevMarkdown>;
103
+ declare function save(data: SlidevMarkdown, filepath?: string): Promise<void>;
104
+ declare function saveExternalSlide(slide: SlideInfoWithPath): Promise<void>;
105
+
106
+ declare const fs_load: typeof load;
107
+ declare const fs_save: typeof save;
108
+ declare const fs_saveExternalSlide: typeof saveExternalSlide;
109
+ declare const fs_parseRangeString: typeof parseRangeString;
110
+ declare const fs_parseAspectRatio: typeof parseAspectRatio;
111
+ declare const fs_resolveConfig: typeof resolveConfig;
112
+ declare const fs_resolveFonts: typeof resolveFonts;
113
+ declare const fs_stringify: typeof stringify;
114
+ declare const fs_filterDisabled: typeof filterDisabled;
115
+ declare const fs_stringifySlide: typeof stringifySlide;
116
+ declare const fs_prettifySlide: typeof prettifySlide;
117
+ declare const fs_prettify: typeof prettify;
118
+ declare const fs_detectFeatures: typeof detectFeatures;
119
+ declare const fs_parseSlide: typeof parseSlide;
120
+ declare const fs_parse: typeof parse;
121
+ declare const fs_mergeFeatureFlags: typeof mergeFeatureFlags;
122
+ declare const fs_scanMonacoModules: typeof scanMonacoModules;
123
+ declare namespace fs {
124
+ export {
125
+ fs_load as load,
126
+ fs_save as save,
127
+ fs_saveExternalSlide as saveExternalSlide,
128
+ fs_parseRangeString as parseRangeString,
129
+ fs_parseAspectRatio as parseAspectRatio,
130
+ fs_resolveConfig as resolveConfig,
131
+ fs_resolveFonts as resolveFonts,
132
+ fs_stringify as stringify,
133
+ fs_filterDisabled as filterDisabled,
134
+ fs_stringifySlide as stringifySlide,
135
+ fs_prettifySlide as prettifySlide,
136
+ fs_prettify as prettify,
137
+ fs_detectFeatures as detectFeatures,
138
+ fs_parseSlide as parseSlide,
139
+ fs_parse as parse,
140
+ fs_mergeFeatureFlags as mergeFeatureFlags,
141
+ fs_scanMonacoModules as scanMonacoModules,
142
+ };
143
+ }
144
+
145
+ export { ResolvedSlidevOptions, SlidevEntryOptions, SlidevPluginOptions, SlidevServerOptions, ViteSlidevPlugin, createServer, createWindiCSSPlugin, getCLIRoot, getClientRoot, getThemeRoots, getUserRoot, isPath, fs as parser, resolveOptions };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
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; } }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk3QMXOBKWjs = require('./chunk-3QMXOBKW.js');
3
+ var _chunkZ64T7ZBUjs = require('./chunk-Z64T7ZBU.js');
4
4
 
5
5
 
6
6
 
@@ -8,23 +8,21 @@ var _chunk3QMXOBKWjs = require('./chunk-3QMXOBKW.js');
8
8
 
9
9
 
10
10
 
11
- var _chunkI4X2EWTIjs = require('./chunk-I4X2EWTI.js');
12
11
 
12
+ var _chunk7PMB3SQ5js = require('./chunk-7PMB3SQ5.js');
13
13
 
14
14
 
15
- var _chunkDVHCB7TLjs = require('./chunk-DVHCB7TL.js');
16
15
 
16
+ var _chunkINYQJTKAjs = require('./chunk-INYQJTKA.js');
17
17
 
18
- var _chunk7EYE5BOQjs = require('./chunk-7EYE5BOQ.js');
18
+
19
+ var _chunkBYTWGCY3js = require('./chunk-BYTWGCY3.js');
19
20
 
20
21
  // node/index.ts
21
- _chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
22
+ _chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
22
23
 
23
24
  // node/declare.ts
24
- _chunk7EYE5BOQjs.init_cjs_shims.call(void 0, );
25
-
26
- // node/index.ts
27
- var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs);
25
+ _chunkBYTWGCY3js.init_cjs_shims.call(void 0, );
28
26
 
29
27
 
30
28
 
@@ -36,4 +34,4 @@ var _fs = require('@slidev/parser/fs'); var parser = _interopRequireWildcard(_fs
36
34
 
37
35
 
38
36
 
39
- exports.ViteSlidevPlugin = _chunkDVHCB7TLjs.ViteSlidevPlugin; exports.createServer = _chunk3QMXOBKWjs.createServer; exports.createWindiCSSPlugin = _chunkDVHCB7TLjs.createWindiCSSPlugin; exports.getCLIRoot = _chunkI4X2EWTIjs.getCLIRoot; exports.getClientRoot = _chunkI4X2EWTIjs.getClientRoot; exports.getThemeRoots = _chunkI4X2EWTIjs.getThemeRoots; exports.getUserRoot = _chunkI4X2EWTIjs.getUserRoot; exports.isPath = _chunkI4X2EWTIjs.isPath; exports.parser = parser; exports.resolveOptions = _chunkI4X2EWTIjs.resolveOptions;
37
+ exports.ViteSlidevPlugin = _chunkINYQJTKAjs.ViteSlidevPlugin; exports.createServer = _chunkZ64T7ZBUjs.createServer; exports.createWindiCSSPlugin = _chunkINYQJTKAjs.createWindiCSSPlugin; exports.getCLIRoot = _chunk7PMB3SQ5js.getCLIRoot; exports.getClientRoot = _chunk7PMB3SQ5js.getClientRoot; exports.getThemeRoots = _chunk7PMB3SQ5js.getThemeRoots; exports.getUserRoot = _chunk7PMB3SQ5js.getUserRoot; exports.isPath = _chunk7PMB3SQ5js.isPath; exports.parser = _chunk7PMB3SQ5js.fs_exports; exports.resolveOptions = _chunk7PMB3SQ5js.resolveOptions;
package/dist/index.mjs CHANGED
@@ -1,22 +1,28 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-6HK3HED2.mjs";
3
+ } from "./chunk-RLNIZC66.mjs";
4
4
  import {
5
+ fs_exports,
5
6
  getCLIRoot,
6
7
  getClientRoot,
7
8
  getThemeRoots,
8
9
  getUserRoot,
9
10
  isPath,
10
11
  resolveOptions
11
- } from "./chunk-4A5D2CTX.mjs";
12
+ } from "./chunk-36I7664S.mjs";
12
13
  import {
13
14
  ViteSlidevPlugin,
14
15
  createWindiCSSPlugin
15
- } from "./chunk-L7QFSRQN.mjs";
16
- import "./chunk-QQD2JVXL.mjs";
16
+ } from "./chunk-2E3KKOOJ.mjs";
17
+ import {
18
+ init_esm_shims
19
+ } from "./chunk-OXQUV4ZP.mjs";
17
20
 
18
21
  // node/index.ts
19
- import * as parser from "@slidev/parser/fs";
22
+ init_esm_shims();
23
+
24
+ // node/declare.ts
25
+ init_esm_shims();
20
26
  export {
21
27
  ViteSlidevPlugin,
22
28
  createServer,
@@ -26,6 +32,6 @@ export {
26
32
  getThemeRoots,
27
33
  getUserRoot,
28
34
  isPath,
29
- parser,
35
+ fs_exports as parser,
30
36
  resolveOptions
31
37
  };