@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.
- package/README.md +2 -2
- package/dist/{build-QV3SLG6A.mjs → build-NHXJRHBN.mjs} +3 -3
- package/dist/{build-E6BBKMUU.js → build-VM52TR6Q.js} +11 -11
- package/dist/{chunk-YBR5SIF5.js → chunk-5BL2KALH.js} +4 -4
- package/dist/{chunk-ADOJPBM5.js → chunk-7F2QYO53.js} +91 -67
- package/dist/{chunk-QT3EQ43A.js → chunk-7QXPSYEZ.js} +2 -2
- package/dist/{chunk-CU4J7EH2.mjs → chunk-G22DGVU7.mjs} +2 -2
- package/dist/{chunk-ZUBAOX5T.js → chunk-OOHN7CTS.js} +119 -119
- package/dist/{chunk-UM6ZQCRB.mjs → chunk-UEIFQWPY.mjs} +38 -14
- package/dist/{chunk-4OPORETI.mjs → chunk-VYBQLH2X.mjs} +2 -2
- package/dist/{chunk-Q4KPSLXX.mjs → chunk-WMQA2JLO.mjs} +2 -2
- package/dist/cli.js +25 -25
- package/dist/cli.mjs +6 -6
- package/dist/{export-75HYECKB.js → export-GML5GDLW.js} +5 -5
- package/dist/{export-QCGE4YB6.mjs → export-OVSG7H7S.mjs} +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -7
- package/dist/index.mjs +4 -4
- package/package.json +28 -28
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
|
-
<
|
|
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
|
-
</
|
|
36
|
+
</div>
|
|
37
37
|
|
|
38
38
|
## Features
|
|
39
39
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
getIndexHtml
|
|
4
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
713
|
+
const { exportSlides } = await Promise.resolve().then(() => __toModule(__require("./export-OVSG7H7S.mjs")));
|
|
714
714
|
const port = 12445;
|
|
715
715
|
const app = connect();
|
|
716
716
|
const server = http.createServer(app);
|
|
@@ -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
|
|
4
|
+
var _chunk7F2QYO53js = require('./chunk-7F2QYO53.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk7QXPSYEZjs = require('./chunk-7QXPSYEZ.js');
|
|
11
11
|
|
|
12
12
|
// node/build.ts
|
|
13
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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
|
|
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
|
|
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(() =>
|
|
713
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunk7QXPSYEZjs.__toModule.call(void 0, _chunk7QXPSYEZjs.__require.call(void 0, "./export-GML5GDLW.js")));
|
|
714
714
|
const port = 12445;
|
|
715
715
|
const app = _connect2.default.call(void 0, );
|
|
716
716
|
const server = _http2.default.createServer(app);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk7F2QYO53js = require('./chunk-7F2QYO53.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk7QXPSYEZjs = require('./chunk-7QXPSYEZ.js');
|
|
7
7
|
|
|
8
8
|
// node/server.ts
|
|
9
|
-
|
|
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
|
|
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
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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="${
|
|
91
|
-
main = main.replace("__ENTRY__",
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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,
|
|
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,
|
|
171
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
172
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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": "^
|
|
245
|
+
"@vueuse/core": "^8.1.2",
|
|
246
246
|
"@vueuse/head": "^0.7.5",
|
|
247
|
-
"@vueuse/motion": "^2.0.0-beta.
|
|
247
|
+
"@vueuse/motion": "^2.0.0-beta.12",
|
|
248
248
|
codemirror: "^5.65.2",
|
|
249
|
-
drauu: "^0.
|
|
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.
|
|
253
|
+
katex: "^0.15.3",
|
|
254
254
|
mermaid: "^8.14.0",
|
|
255
|
-
"monaco-editor": "^0.
|
|
255
|
+
"monaco-editor": "^0.33.0",
|
|
256
256
|
nanoid: "^3.3.1",
|
|
257
|
-
prettier: "^2.
|
|
257
|
+
prettier: "^2.6.0",
|
|
258
258
|
recordrtc: "^5.6.2",
|
|
259
259
|
resolve: "^1.22.0",
|
|
260
|
-
"vite-plugin-windicss": "^1.
|
|
260
|
+
"vite-plugin-windicss": "^1.8.3",
|
|
261
261
|
vue: "^3.2.31",
|
|
262
|
-
"vue-router": "^4.0.
|
|
263
|
-
windicss: "^3.
|
|
262
|
+
"vue-router": "^4.0.14",
|
|
263
|
+
windicss: "^3.5.1"
|
|
264
264
|
};
|
|
265
265
|
|
|
266
266
|
// node/vite/searchRoot.ts
|
|
267
|
-
|
|
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/": `${
|
|
327
|
+
"@slidev/client/": `${_chunk7QXPSYEZjs.toAtFS.call(void 0, options.clientRoot)}/`
|
|
328
328
|
}
|
|
329
329
|
},
|
|
330
330
|
optimizeDeps: {
|
|
@@ -340,6 +340,7 @@ function createConfigPlugin(options) {
|
|
|
340
340
|
"prettier/esm/parser-html",
|
|
341
341
|
"prettier/esm/parser-typescript",
|
|
342
342
|
"mermaid/dist/mermaid.min",
|
|
343
|
+
"mermaid/dist/mermaid",
|
|
343
344
|
"vite-plugin-vue-server-ref/client"
|
|
344
345
|
],
|
|
345
346
|
exclude: EXCLUDE
|
|
@@ -350,7 +351,7 @@ function createConfigPlugin(options) {
|
|
|
350
351
|
allow: _utils.uniq.call(void 0, [
|
|
351
352
|
searchForWorkspaceRoot(options.userRoot),
|
|
352
353
|
searchForWorkspaceRoot(options.cliRoot),
|
|
353
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
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"))] : []
|
|
354
355
|
])
|
|
355
356
|
}
|
|
356
357
|
}
|
|
@@ -359,7 +360,7 @@ function createConfigPlugin(options) {
|
|
|
359
360
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
360
361
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
361
362
|
injection.root = options.cliRoot;
|
|
362
|
-
injection.resolve.alias.vue = `${
|
|
363
|
+
injection.resolve.alias.vue = `${_chunk7QXPSYEZjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
363
364
|
}
|
|
364
365
|
return _vite5.mergeConfig.call(void 0, config, injection);
|
|
365
366
|
},
|
|
@@ -380,7 +381,7 @@ function createConfigPlugin(options) {
|
|
|
380
381
|
}
|
|
381
382
|
function getDefine(options) {
|
|
382
383
|
return {
|
|
383
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
384
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunk7QXPSYEZjs.toAtFS.call(void 0, options.clientRoot)),
|
|
384
385
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
385
386
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
386
387
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -389,8 +390,8 @@ function getDefine(options) {
|
|
|
389
390
|
}
|
|
390
391
|
|
|
391
392
|
// node/plugins/loaders.ts
|
|
392
|
-
|
|
393
|
-
var import_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());
|
|
394
395
|
|
|
395
396
|
|
|
396
397
|
|
|
@@ -422,7 +423,7 @@ md.use(_markdownitlinkattributes2.default, {
|
|
|
422
423
|
}
|
|
423
424
|
});
|
|
424
425
|
function prepareSlideInfo(data) {
|
|
425
|
-
return
|
|
426
|
+
return _chunk7QXPSYEZjs.__spreadProps.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {}, data), {
|
|
426
427
|
notesHTML: md.render((data == null ? void 0 : data.note) || "")
|
|
427
428
|
});
|
|
428
429
|
}
|
|
@@ -511,7 +512,7 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
511
512
|
const file = `${slidePrefix}${i + 1}.md`;
|
|
512
513
|
try {
|
|
513
514
|
const md2 = await transformMarkdown(MarkdownPlugin.transform((_a2 = newData.slides[i]) == null ? void 0 : _a2.content, file), i, newData);
|
|
514
|
-
return await VuePlugin.handleHotUpdate(
|
|
515
|
+
return await VuePlugin.handleHotUpdate(_chunk7QXPSYEZjs.__spreadProps.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {}, ctx), {
|
|
515
516
|
modules: Array.from(ctx.server.moduleGraph.getModulesByFile(file) || []),
|
|
516
517
|
file,
|
|
517
518
|
read() {
|
|
@@ -553,6 +554,8 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
553
554
|
return generateGlobalComponents("top");
|
|
554
555
|
if (id === "/@slidev/global-components/bottom")
|
|
555
556
|
return generateGlobalComponents("bottom");
|
|
557
|
+
if (id === "/@slidev/custom-nav-controls")
|
|
558
|
+
return generateCustomNavControls();
|
|
556
559
|
if (id.startsWith(slidePrefix)) {
|
|
557
560
|
const remaning = id.slice(slidePrefix.length);
|
|
558
561
|
const match = remaning.match(regexIdQuery);
|
|
@@ -600,13 +603,13 @@ function createSlidesLoader({ data, entry, clientRoot, themeRoots, userRoot, roo
|
|
|
600
603
|
async function transformMarkdown(code, pageNo, data2) {
|
|
601
604
|
var _a, _b;
|
|
602
605
|
const layouts = await getLayouts();
|
|
603
|
-
const 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) || {});
|
|
604
607
|
const layoutName = (frontmatter == null ? void 0 : frontmatter.layout) || (pageNo === 0 ? "cover" : "default");
|
|
605
608
|
if (!layouts[layoutName])
|
|
606
609
|
throw new Error(`Unknown layout "${layoutName}"`);
|
|
607
610
|
delete frontmatter.title;
|
|
608
611
|
const imports = [
|
|
609
|
-
`import InjectedLayout from "${
|
|
612
|
+
`import InjectedLayout from "${_chunk7QXPSYEZjs.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
610
613
|
`const frontmatter = ${JSON.stringify(frontmatter)}`
|
|
611
614
|
];
|
|
612
615
|
code = code.replace(/(<script setup.*>)/g, `$1
|
|
@@ -652,9 +655,9 @@ ${code.slice(injectB)}`;
|
|
|
652
655
|
}
|
|
653
656
|
async function generateUserStyles() {
|
|
654
657
|
const imports = [
|
|
655
|
-
`import "${
|
|
656
|
-
`import "${
|
|
657
|
-
`import "${
|
|
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"))}"`
|
|
658
661
|
];
|
|
659
662
|
const roots2 = _utils.uniq.call(void 0, [
|
|
660
663
|
...themeRoots,
|
|
@@ -670,13 +673,13 @@ ${code.slice(injectB)}`;
|
|
|
670
673
|
];
|
|
671
674
|
for (const style of styles) {
|
|
672
675
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
673
|
-
imports.push(`import "${
|
|
676
|
+
imports.push(`import "${_chunk7QXPSYEZjs.toAtFS.call(void 0, style)}"`);
|
|
674
677
|
continue;
|
|
675
678
|
}
|
|
676
679
|
}
|
|
677
680
|
}
|
|
678
681
|
if (data.features.katex)
|
|
679
|
-
imports.push(`import "${
|
|
682
|
+
imports.push(`import "${_chunk7QXPSYEZjs.toAtFS.call(void 0, _chunk7QXPSYEZjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
680
683
|
return imports.join("\n");
|
|
681
684
|
}
|
|
682
685
|
async function generateMonacoTypes() {
|
|
@@ -685,7 +688,7 @@ ${code.slice(injectB)}`;
|
|
|
685
688
|
async function generateLayouts() {
|
|
686
689
|
const imports = [];
|
|
687
690
|
const layouts = _utils.objectMap.call(void 0, await getLayouts(), (k, v) => {
|
|
688
|
-
imports.push(`import __layout_${k} from "${
|
|
691
|
+
imports.push(`import __layout_${k} from "${_chunk7QXPSYEZjs.toAtFS.call(void 0, v)}"`);
|
|
689
692
|
return [k, `__layout_${k}`];
|
|
690
693
|
});
|
|
691
694
|
return [
|
|
@@ -733,10 +736,10 @@ ${routes.join(",\n")}
|
|
|
733
736
|
return [...imports, routesStr].join("\n");
|
|
734
737
|
}
|
|
735
738
|
function generateConfigs() {
|
|
736
|
-
const config =
|
|
739
|
+
const config = _chunk7QXPSYEZjs.__spreadValues.call(void 0, {}, data.config);
|
|
737
740
|
if (_utils.isString.call(void 0, config.title)) {
|
|
738
741
|
const tokens = md.parseInline(config.title, {});
|
|
739
|
-
config.title =
|
|
742
|
+
config.title = _chunk7QXPSYEZjs.stringifyMarkdownTokens.call(void 0, tokens);
|
|
740
743
|
}
|
|
741
744
|
if (_utils.isString.call(void 0, config.info))
|
|
742
745
|
config.info = md.render(config.info);
|
|
@@ -757,7 +760,26 @@ ${routes.join(",\n")}
|
|
|
757
760
|
];
|
|
758
761
|
}
|
|
759
762
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
760
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
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");
|
|
761
783
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
762
784
|
return `
|
|
763
785
|
${imports}
|
|
@@ -772,7 +794,7 @@ export default {
|
|
|
772
794
|
}
|
|
773
795
|
|
|
774
796
|
// node/plugins/monacoTransform.ts
|
|
775
|
-
|
|
797
|
+
_chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
|
|
776
798
|
|
|
777
799
|
|
|
778
800
|
|
|
@@ -806,7 +828,7 @@ function createMonacoTypesLoader() {
|
|
|
806
828
|
}
|
|
807
829
|
|
|
808
830
|
// node/plugins/setupClient.ts
|
|
809
|
-
|
|
831
|
+
_chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
|
|
810
832
|
|
|
811
833
|
|
|
812
834
|
|
|
@@ -828,7 +850,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
828
850
|
setups.forEach((path, idx) => {
|
|
829
851
|
if (!_fs.existsSync.call(void 0, path))
|
|
830
852
|
return;
|
|
831
|
-
imports.push(`import __n${idx} from '${
|
|
853
|
+
imports.push(`import __n${idx} from '${_chunk7QXPSYEZjs.toAtFS.call(void 0, path)}'`);
|
|
832
854
|
let fn = `__n${idx}`;
|
|
833
855
|
let awaitFn = `await __n${idx}`;
|
|
834
856
|
if (/\binjection_return\b/g.test(code)) {
|
|
@@ -856,7 +878,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, userRoot }) {
|
|
|
856
878
|
}
|
|
857
879
|
|
|
858
880
|
// node/plugins/markdown.ts
|
|
859
|
-
|
|
881
|
+
_chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
|
|
860
882
|
var _vitepluginmd = require('vite-plugin-md'); var _vitepluginmd2 = _interopRequireDefault(_vitepluginmd);
|
|
861
883
|
var _jsbase64 = require('js-base64'); var base64 = _interopRequireWildcard(_jsbase64);
|
|
862
884
|
|
|
@@ -866,7 +888,7 @@ var _shiki = require('shiki'); var Shiki = _interopRequireWildcard(_shiki);
|
|
|
866
888
|
var _plantumlencoder = require('plantuml-encoder');
|
|
867
889
|
|
|
868
890
|
// node/plugins/markdown-it-katex.ts
|
|
869
|
-
|
|
891
|
+
_chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
|
|
870
892
|
var _katex = require('katex'); var _katex2 = _interopRequireDefault(_katex);
|
|
871
893
|
function isValidDelim(state, pos) {
|
|
872
894
|
const max = state.posMax;
|
|
@@ -1013,7 +1035,7 @@ function math_plugin(md2, options) {
|
|
|
1013
1035
|
}
|
|
1014
1036
|
|
|
1015
1037
|
// node/plugins/markdown-it-prism.ts
|
|
1016
|
-
|
|
1038
|
+
_chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
|
|
1017
1039
|
var _prismjs = require('prismjs'); var _prismjs2 = _interopRequireDefault(_prismjs);
|
|
1018
1040
|
var _ = require('prismjs/components/'); var _2 = _interopRequireDefault(_);
|
|
1019
1041
|
var DEFAULTS = {
|
|
@@ -1036,7 +1058,7 @@ function loadPrismLang(lang) {
|
|
|
1036
1058
|
}
|
|
1037
1059
|
function loadPrismPlugin(name) {
|
|
1038
1060
|
try {
|
|
1039
|
-
|
|
1061
|
+
_chunk7QXPSYEZjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1040
1062
|
} catch (e) {
|
|
1041
1063
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1042
1064
|
}
|
|
@@ -1076,7 +1098,7 @@ function markdownItPrism(markdownit, useroptions) {
|
|
|
1076
1098
|
}
|
|
1077
1099
|
|
|
1078
1100
|
// node/plugins/markdown-it-shiki.ts
|
|
1079
|
-
|
|
1101
|
+
_chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
|
|
1080
1102
|
function getThemeName(theme) {
|
|
1081
1103
|
if (typeof theme === "string")
|
|
1082
1104
|
return theme;
|
|
@@ -1098,7 +1120,7 @@ function resolveShikiOptions(options) {
|
|
|
1098
1120
|
themes.push(options.theme);
|
|
1099
1121
|
}
|
|
1100
1122
|
}
|
|
1101
|
-
return
|
|
1123
|
+
return _chunk7QXPSYEZjs.__spreadProps.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {}, options), {
|
|
1102
1124
|
themes,
|
|
1103
1125
|
darkModeThemes: darkModeThemes ? {
|
|
1104
1126
|
dark: getThemeName(darkModeThemes.dark),
|
|
@@ -1136,7 +1158,7 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1136
1158
|
const setups = [];
|
|
1137
1159
|
const entryPath = _utils.slash.call(void 0, entry);
|
|
1138
1160
|
if (config.highlighter === "shiki") {
|
|
1139
|
-
const { getHighlighter } = await Promise.resolve().then(() =>
|
|
1161
|
+
const { getHighlighter } = await Promise.resolve().then(() => _chunk7QXPSYEZjs.__toModule.call(void 0, _chunk7QXPSYEZjs.__require.call(void 0, "shiki")));
|
|
1140
1162
|
const shikiOptions = await loadSetups(roots, "shiki.ts", Shiki, DEFAULT_SHIKI_OPTIONS, false);
|
|
1141
1163
|
const { langs, themes } = resolveShikiOptions(shikiOptions);
|
|
1142
1164
|
shikiOptions.highlighter = await getHighlighter({ themes, langs });
|
|
@@ -1145,11 +1167,11 @@ async function createMarkdownPlugin({ data: { config }, roots, mode, entry }, {
|
|
|
1145
1167
|
setups.push((md2) => md2.use(markdownItPrism));
|
|
1146
1168
|
}
|
|
1147
1169
|
const KatexOptions = await loadSetups(roots, "katex.ts", {}, { strict: false }, false);
|
|
1148
|
-
return _vitepluginmd2.default.call(void 0,
|
|
1170
|
+
return _vitepluginmd2.default.call(void 0, _chunk7QXPSYEZjs.__spreadProps.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
|
|
1149
1171
|
wrapperClasses: "",
|
|
1150
1172
|
headEnabled: false,
|
|
1151
1173
|
frontmatter: false,
|
|
1152
|
-
markdownItOptions:
|
|
1174
|
+
markdownItOptions: _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
|
|
1153
1175
|
quotes: `""''`,
|
|
1154
1176
|
html: true,
|
|
1155
1177
|
xhtmlOut: true,
|
|
@@ -1286,7 +1308,7 @@ function escapeVueInCode(md2) {
|
|
|
1286
1308
|
}
|
|
1287
1309
|
|
|
1288
1310
|
// node/plugins/patchTransform.ts
|
|
1289
|
-
|
|
1311
|
+
_chunk7QXPSYEZjs.init_cjs_shims.call(void 0, );
|
|
1290
1312
|
|
|
1291
1313
|
function createFixPlugins(options) {
|
|
1292
1314
|
const define = _utils.objectEntries.call(void 0, getDefine(options));
|
|
@@ -1341,7 +1363,8 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1341
1363
|
vue: vueOptions = {},
|
|
1342
1364
|
components: componentsOptions = {},
|
|
1343
1365
|
icons: iconsOptions = {},
|
|
1344
|
-
remoteAssets: remoteAssetsOptions = {}
|
|
1366
|
+
remoteAssets: remoteAssetsOptions = {},
|
|
1367
|
+
serverRef: serverRefOptions = {}
|
|
1345
1368
|
} = pluginOptions;
|
|
1346
1369
|
const {
|
|
1347
1370
|
mode,
|
|
@@ -1349,10 +1372,10 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1349
1372
|
clientRoot,
|
|
1350
1373
|
data: { config }
|
|
1351
1374
|
} = options;
|
|
1352
|
-
const VuePlugin = _pluginvue2.default.call(void 0,
|
|
1375
|
+
const VuePlugin = _pluginvue2.default.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
|
|
1353
1376
|
include: [/\.vue$/, /\.md$/],
|
|
1354
1377
|
exclude: [],
|
|
1355
|
-
template:
|
|
1378
|
+
template: _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
|
|
1356
1379
|
compilerOptions: {
|
|
1357
1380
|
isCustomElement(tag) {
|
|
1358
1381
|
return customElements.has(tag);
|
|
@@ -1367,7 +1390,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1367
1390
|
MarkdownPlugin,
|
|
1368
1391
|
VuePlugin,
|
|
1369
1392
|
createSlidesLoader(options, pluginOptions, serverOptions, VuePlugin, MarkdownPlugin),
|
|
1370
|
-
_vite4.default.call(void 0,
|
|
1393
|
+
_vite4.default.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
|
|
1371
1394
|
extensions: ["vue", "md", "ts"],
|
|
1372
1395
|
dirs: [
|
|
1373
1396
|
`${clientRoot}/builtin`,
|
|
@@ -1385,11 +1408,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1385
1408
|
})
|
|
1386
1409
|
]
|
|
1387
1410
|
}, componentsOptions)),
|
|
1388
|
-
_vite2.default.call(void 0,
|
|
1411
|
+
_vite2.default.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
|
|
1389
1412
|
defaultClass: "slidev-icon",
|
|
1390
1413
|
autoInstall: true
|
|
1391
1414
|
}, iconsOptions)),
|
|
1392
|
-
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0,
|
|
1415
|
+
config.remoteAssets === true || config.remoteAssets === mode ? _vitepluginremoteassets2.default.call(void 0, _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
|
|
1393
1416
|
rules: [
|
|
1394
1417
|
..._vitepluginremoteassets.DefaultRules,
|
|
1395
1418
|
{
|
|
@@ -1402,15 +1425,16 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1402
1425
|
}, remoteAssetsOptions)) : null,
|
|
1403
1426
|
_vitepluginvueserverref2.default.call(void 0, {
|
|
1404
1427
|
debug: process.env.NODE_ENV === "development",
|
|
1405
|
-
state: {
|
|
1428
|
+
state: _chunk7QXPSYEZjs.__spreadValues.call(void 0, {
|
|
1406
1429
|
sync: false,
|
|
1407
1430
|
nav: {
|
|
1408
1431
|
page: 0,
|
|
1409
1432
|
clicks: 0
|
|
1410
1433
|
},
|
|
1411
1434
|
drawings: drawingData
|
|
1412
|
-
},
|
|
1413
|
-
onChanged(key, data, patch) {
|
|
1435
|
+
}, serverRefOptions.state),
|
|
1436
|
+
onChanged(key, data, patch, timestamp) {
|
|
1437
|
+
serverRefOptions.onChanged && serverRefOptions.onChanged(key, data, patch, timestamp);
|
|
1414
1438
|
if (!options.data.config.drawings.persist)
|
|
1415
1439
|
return;
|
|
1416
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.
|
|
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.
|
|
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
|
|