@slidev/cli 0.49.16 → 0.49.18

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
@@ -36,20 +36,21 @@ Presentation <b>slide</b>s for <b>dev</b>elopers 🧑‍💻👩‍💻👨‍
36
36
 
37
37
  ## Features
38
38
 
39
- - 📝 [**Markdown-based**](https://sli.dev/guide/syntax.html) - use your favorite editors and workflow
40
- - 🧑‍💻 [**Developer Friendly**](https://sli.dev/guide/syntax.html#code-blocks) - built-in syntax highlighting, live coding, etc.
41
- - 🎨 [**Themable**](https://sli.dev/themes/gallery.html) - theme can be shared and used with npm packages.
42
- - 🌈 [**Stylish**](https://sli.dev/guide/syntax.html#embedded-styles) - on-demand utilities via [UnoCSS](https://github.com/unocss/unocss).
43
- - 🤹 [**Interactive**](https://sli.dev/custom/directory-structure.html#components) - embedding Vue components seamlessly.
44
- - 🎙 [**Presenter Mode**](https://sli.dev/guide/presenter-mode.html) - use another window, or even your phone to control your slides.
45
- - 🧮 [**LaTeX**](https://sli.dev/guide/syntax.html#latex) - built-in LaTeX math equations support.
46
- - 📰 [**Diagrams**](https://sli.dev/guide/syntax.html#diagrams) - creates diagrams with textual descriptions
47
- - 🌟 [**Icons**](https://sli.dev/guide/syntax.html#icons) - access to icons from any iconset directly.
48
- - 💻 [**Editors**](https://sli.dev/guide/editors.html) - integrated editor, or [extension for VS Code](https://github.com/slidevjs/slidev-vscode)
49
- - 🎥 [**Recording**](https://sli.dev/guide/recording.html) - built-in recording and camera view.
50
- - 📤 [**Portable**](https://sli.dev/guide/exporting.html) - export into PDF, PNGs, or even a hostable SPA.
51
- - ⚡️ [**Fast**](https://vitejs.dev) - instant reloading powered by [Vite](https://vitejs.dev).
52
- - 🛠 [**Hackable**](https://sli.dev/custom/config-vite.html) - using Vite plugins, Vue components, or any npm packages.
39
+ - 📝 [**Markdown-based**](https://sli.dev/guide/syntax) - foucus on content and use your favorite editor
40
+ - 🧑‍💻 [**Developer Friendly**](https://sli.dev/guide/syntax#code-blocks) - built-in code highlighting, live coding, etc.
41
+ - 🎨 [**Themable**](https://sli.dev/resources/theme-gallery) - theme can be shared and used with npm packages
42
+ - 🌈 [**Stylish**](https://sli.dev/guide/syntax#embedded-styles) - on-demand utilities via [UnoCSS](https://github.com/unocss/unocss).
43
+ - 🤹 [**Interactive**](https://sli.dev/custom/directory-structure#components) - embedding Vue components seamlessly
44
+ - 🎙 [**Presenter Mode**](https://sli.dev/guide/ui#presenter-mode) - use another window, or even your phone to control your slides
45
+ - 🎨 [**Drawing**](https://sli.dev/features/drawing) - draw and annotate on your slides
46
+ - 🧮 [**LaTeX**](https://sli.dev/features/latex) - built-in LaTeX math equations support
47
+ - 📰 [**Diagrams**](https://sli.dev/guide/syntax#diagrams) - creates diagrams using textual descriptions with [Mermaid.js](https://mermaid.js.org/)
48
+ - 🌟 [**Icons**](https://sli.dev/features/icons) - access to icons from any icon set directly
49
+ - 💻 [**Editor**](https://sli.dev/guide/index#editor) - integrated editor, or the [VSCode extension](https://sli.dev/features/vscode-extension)
50
+ - 🎥 [**Recording**](https://sli.dev/features/recording) - built-in recording and camera view
51
+ - 📤 [**Portable**](https://sli.dev/guide/exporting) - export into PDF, PNGs, or PPTX
52
+ - ⚡️ [**Fast**](https://vitejs.dev) - instant reloading powered by [Vite](https://vitejs.dev)
53
+ - 🛠 [**Hackable**](https://sli.dev/custom/) - using Vite plugins, Vue components, or any npm packages
53
54
 
54
55
  ## Getting Started
55
56
 
package/bin/slidev.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict'
3
- import ('../dist/cli.mjs')
3
+ import ('../dist/cli.js')
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  getIndexHtml,
3
3
  resolveViteConfigs
4
- } from "./chunk-75T3CMVM.mjs";
5
- import "./chunk-27Q2X57X.mjs";
4
+ } from "./chunk-LY5CYMWF.js";
5
+ import "./chunk-6DS3IPOB.js";
6
+ import "./chunk-2BABGNMX.js";
7
+ import "./chunk-JSBRDJBE.js";
6
8
 
7
9
  // node/commands/build.ts
8
10
  import { resolve } from "node:path";
@@ -51,7 +53,7 @@ async function build(options, viteConfig = {}, args) {
51
53
  await fs.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
52
54
  `, "utf-8");
53
55
  if ([true, "true", "auto"].includes(options.data.config.download)) {
54
- const { exportSlides, getExportOptions } = await import("./export-ZRMOIVNM.mjs");
56
+ const { exportSlides, getExportOptions } = await import("./export-TPYQNCSS.js");
55
57
  const port = 12445;
56
58
  const app = connect();
57
59
  const server = http.createServer(app);
@@ -1,29 +1,3 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __commonJS = (cb, mod) => function __require() {
8
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
- // If the importer is in node compatibility mode or this is not an ESM
20
- // file that has been converted to a CommonJS file using a Babel-
21
- // compatible transform (i.e. "__esModule" has not been set), then set
22
- // "default" to the CommonJS "module.exports" for node compatibility.
23
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
- mod
25
- ));
26
-
27
1
  // node/resolver.ts
28
2
  import { dirname, join, relative, resolve } from "node:path";
29
3
  import * as fs from "node:fs";
@@ -94,7 +68,7 @@ async function resolveEntry(entryRaw) {
94
68
  else
95
69
  process.exit(0);
96
70
  }
97
- return entry;
71
+ return slash(entry);
98
72
  }
99
73
  function createResolver(type, officials) {
100
74
  async function promptForInstallation(pkgName) {
@@ -206,8 +180,6 @@ async function getRoots(entry) {
206
180
  }
207
181
 
208
182
  export {
209
- __commonJS,
210
- __toESM,
211
183
  isInstalledGlobally,
212
184
  resolveImportUrl,
213
185
  toAtFS,
@@ -0,0 +1,31 @@
1
+ // node/syntax/transform/utils.ts
2
+ function normalizeRangeStr(rangeStr = "") {
3
+ return !rangeStr.trim() ? [] : rangeStr.trim().split(/\|/g).map((i) => i.trim());
4
+ }
5
+ function getCodeBlocks(md) {
6
+ const codeblocks = Array.from(md.matchAll(/^```[\s\S]*?^```/gm)).map((m) => {
7
+ const start = m.index;
8
+ const end = m.index + m[0].length;
9
+ const startLine = md.slice(0, start).match(/\n/g)?.length || 0;
10
+ const endLine = md.slice(0, end).match(/\n/g)?.length || 0;
11
+ return [start, end, startLine, endLine];
12
+ });
13
+ return {
14
+ codeblocks,
15
+ isInsideCodeblocks(idx) {
16
+ return codeblocks.some(([s, e]) => s <= idx && idx <= e);
17
+ },
18
+ isLineInsideCodeblocks(line) {
19
+ return codeblocks.some(([, , s, e]) => s <= line && line <= e);
20
+ }
21
+ };
22
+ }
23
+ function escapeVueInCode(md) {
24
+ return md.replace(/\{\{/g, "&lbrace;&lbrace;");
25
+ }
26
+
27
+ export {
28
+ normalizeRangeStr,
29
+ getCodeBlocks,
30
+ escapeVueInCode
31
+ };
@@ -0,0 +1,30 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ // If the importer is in node compatibility mode or this is not an ESM
20
+ // file that has been converted to a CommonJS file using a Babel-
21
+ // compatible transform (i.e. "__esModule" has not been set), then set
22
+ // "default" to the CommonJS "module.exports" for node compatibility.
23
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24
+ mod
25
+ ));
26
+
27
+ export {
28
+ __commonJS,
29
+ __toESM
30
+ };