@slidev/cli 0.40.2 → 0.40.3
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/dist/{build-BGUF7J7N.mjs → build-5AAIMY5U.mjs} +5 -3
- package/dist/{build-L4S5TZG4.js → build-XITW5QXZ.js} +9 -7
- package/dist/{chunk-QU6XIJOB.js → chunk-6NWTPU4J.js} +46 -38
- package/dist/{chunk-VLEV37KF.mjs → chunk-CTG3GV2W.mjs} +4 -0
- package/dist/{chunk-UJ5GHVII.js → chunk-GE7W2DBE.js} +4 -0
- package/dist/{chunk-ZAT6O5HR.mjs → chunk-JA6SMOG4.mjs} +22 -14
- package/dist/{chunk-EZ2J7PMK.mjs → chunk-N5CUSDFJ.mjs} +63 -15
- package/dist/{chunk-RRNUXVEA.js → chunk-Z62L2OLL.js} +141 -93
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +36 -33
- package/dist/cli.mjs +14 -11
- package/dist/{export-BRPXINGP.js → export-DLPDCYMZ.js} +4 -3
- package/dist/{export-BAZ4BSV6.mjs → export-J6WWCAPJ.mjs} +2 -1
- package/dist/index.js +4 -4
- package/dist/index.mjs +3 -3
- package/package.json +12 -12
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
getIndexHtml,
|
|
4
4
|
mergeViteConfigs
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-JA6SMOG4.mjs";
|
|
6
|
+
import "./chunk-CTG3GV2W.mjs";
|
|
7
7
|
|
|
8
8
|
// node/build.ts
|
|
9
9
|
import { join as join3, resolve as resolve3 } from "path";
|
|
@@ -684,6 +684,8 @@ async function build(options, viteConfig = {}, args) {
|
|
|
684
684
|
base: `${config.base}iframes/monaco/`,
|
|
685
685
|
build: {
|
|
686
686
|
outDir: resolve3(config.build.outDir, "iframes/monaco"),
|
|
687
|
+
// fix for monaco workers
|
|
688
|
+
// https://github.com/vitejs/vite/issues/1927#issuecomment-805803918
|
|
687
689
|
rollupOptions: {
|
|
688
690
|
output: {
|
|
689
691
|
manualChunks: {
|
|
@@ -715,7 +717,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
715
717
|
await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
716
718
|
`, "utf-8");
|
|
717
719
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
718
|
-
const { exportSlides, getExportOptions } = await import("./export-
|
|
720
|
+
const { exportSlides, getExportOptions } = await import("./export-J6WWCAPJ.mjs");
|
|
719
721
|
const port = 12445;
|
|
720
722
|
const app = connect();
|
|
721
723
|
const server = http.createServer(app);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunk6NWTPU4Jjs = require('./chunk-6NWTPU4J.js');
|
|
6
|
+
require('./chunk-GE7W2DBE.js');
|
|
7
7
|
|
|
8
8
|
// node/build.ts
|
|
9
9
|
var _path = require('path');
|
|
@@ -646,16 +646,16 @@ async function build(options, viteConfig = {}, args) {
|
|
|
646
646
|
let originalIndexHTML;
|
|
647
647
|
if (_fsextra2.default.existsSync(indexPath))
|
|
648
648
|
originalIndexHTML = await _fsextra2.default.readFile(indexPath, "utf-8");
|
|
649
|
-
await _fsextra2.default.writeFile(indexPath, await
|
|
649
|
+
await _fsextra2.default.writeFile(indexPath, await _chunk6NWTPU4Jjs.getIndexHtml.call(void 0, options), "utf-8");
|
|
650
650
|
let config = void 0;
|
|
651
651
|
try {
|
|
652
|
-
const inlineConfig = await
|
|
652
|
+
const inlineConfig = await _chunk6NWTPU4Jjs.mergeViteConfigs.call(void 0,
|
|
653
653
|
options,
|
|
654
654
|
viteConfig,
|
|
655
655
|
{
|
|
656
656
|
root: options.userRoot,
|
|
657
657
|
plugins: [
|
|
658
|
-
await
|
|
658
|
+
await _chunk6NWTPU4Jjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
|
|
659
659
|
{
|
|
660
660
|
name: "resolve-config",
|
|
661
661
|
configResolved(_config) {
|
|
@@ -676,7 +676,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
676
676
|
} else {
|
|
677
677
|
console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
|
|
678
678
|
await _vite.build.call(void 0,
|
|
679
|
-
await
|
|
679
|
+
await _chunk6NWTPU4Jjs.mergeViteConfigs.call(void 0,
|
|
680
680
|
options,
|
|
681
681
|
inlineConfig,
|
|
682
682
|
{
|
|
@@ -684,6 +684,8 @@ async function build(options, viteConfig = {}, args) {
|
|
|
684
684
|
base: `${config.base}iframes/monaco/`,
|
|
685
685
|
build: {
|
|
686
686
|
outDir: _path.resolve.call(void 0, config.build.outDir, "iframes/monaco"),
|
|
687
|
+
// fix for monaco workers
|
|
688
|
+
// https://github.com/vitejs/vite/issues/1927#issuecomment-805803918
|
|
687
689
|
rollupOptions: {
|
|
688
690
|
output: {
|
|
689
691
|
manualChunks: {
|
|
@@ -715,7 +717,7 @@ async function build(options, viteConfig = {}, args) {
|
|
|
715
717
|
await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
716
718
|
`, "utf-8");
|
|
717
719
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
718
|
-
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-
|
|
720
|
+
const { exportSlides, getExportOptions } = await Promise.resolve().then(() => require("./export-DLPDCYMZ.js"));
|
|
719
721
|
const port = 12445;
|
|
720
722
|
const app = _connect2.default.call(void 0, );
|
|
721
723
|
const server = _http2.default.createServer(app);
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkGE7W2DBEjs = require('./chunk-GE7W2DBE.js');
|
|
11
11
|
|
|
12
12
|
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
13
|
-
var require_fast_deep_equal =
|
|
13
|
+
var require_fast_deep_equal = _chunkGE7W2DBEjs.__commonJS.call(void 0, {
|
|
14
14
|
"../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js"(exports, module) {
|
|
15
15
|
"use strict";
|
|
16
16
|
module.exports = function equal2(a, b) {
|
|
@@ -81,11 +81,11 @@ ${(((_a = index.match(/<head>([\s\S]*?)<\/head>/im)) == null ? void 0 : _a[1]) |
|
|
|
81
81
|
${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) || "").trim()}`;
|
|
82
82
|
}
|
|
83
83
|
if (data.features.tweet)
|
|
84
|
-
body += '\n<script async src="https://platform.twitter.com/widgets.js"
|
|
84
|
+
body += '\n<script async src="https://platform.twitter.com/widgets.js"></script>';
|
|
85
85
|
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
86
86
|
head += `
|
|
87
|
-
<link rel="stylesheet" href="${
|
|
88
|
-
main = main.replace("__ENTRY__",
|
|
87
|
+
<link rel="stylesheet" href="${_chunkGE7W2DBEjs.generateGoogleFontsUrl.call(void 0, data.config.fonts)}" type="text/css">`;
|
|
88
|
+
main = main.replace("__ENTRY__", _chunkGE7W2DBEjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
|
|
89
89
|
return main;
|
|
90
90
|
}
|
|
91
91
|
async function mergeViteConfigs({ addonRoots, themeRoots }, viteConfig, config, command) {
|
|
@@ -186,9 +186,9 @@ async function createWindiCSSPlugin({ themeRoots, addonRoots, clientRoot, userRo
|
|
|
186
186
|
config2.scanOptions.include.push(`${i}/layouts/**/*.{vue,ts}`);
|
|
187
187
|
});
|
|
188
188
|
config2.scanOptions.include.push(`!${_utils.slash.call(void 0, _path.resolve.call(void 0, userRoot, "node_modules"))}`);
|
|
189
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
190
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
191
|
-
config2.scanOptions.exclude.push(_path.dirname.call(void 0,
|
|
189
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveImportPath.call(void 0, "monaco-editor/package.json", true)));
|
|
190
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveImportPath.call(void 0, "katex/package.json", true)));
|
|
191
|
+
config2.scanOptions.exclude.push(_path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveImportPath.call(void 0, "prettier/package.json", true)));
|
|
192
192
|
},
|
|
193
193
|
...windiOptions
|
|
194
194
|
}
|
|
@@ -271,20 +271,20 @@ var dependencies = {
|
|
|
271
271
|
"@slidev/types": "workspace:*",
|
|
272
272
|
"@unocss/reset": "^0.49.4",
|
|
273
273
|
"@vueuse/core": "^9.12.0",
|
|
274
|
-
"@vueuse/head": "^1.0.
|
|
274
|
+
"@vueuse/head": "^1.0.25",
|
|
275
275
|
"@vueuse/math": "^9.12.0",
|
|
276
276
|
"@vueuse/motion": "^2.0.0-beta.27",
|
|
277
277
|
codemirror: "^5.65.5",
|
|
278
278
|
defu: "^6.1.2",
|
|
279
279
|
drauu: "^0.3.2",
|
|
280
280
|
"file-saver": "^2.0.5",
|
|
281
|
-
"js-base64": "^3.7.
|
|
281
|
+
"js-base64": "^3.7.5",
|
|
282
282
|
"js-yaml": "^4.1.0",
|
|
283
283
|
katex: "^0.16.4",
|
|
284
284
|
mermaid: "^9.3.0",
|
|
285
285
|
"monaco-editor": "^0.33.0",
|
|
286
|
-
nanoid: "^4.0.
|
|
287
|
-
prettier: "^2.8.
|
|
286
|
+
nanoid: "^4.0.1",
|
|
287
|
+
prettier: "^2.8.4",
|
|
288
288
|
recordrtc: "^5.6.2",
|
|
289
289
|
resolve: "^1.22.1",
|
|
290
290
|
unocss: "^0.49.4",
|
|
@@ -299,7 +299,14 @@ var dependencies = {
|
|
|
299
299
|
|
|
300
300
|
|
|
301
301
|
var ROOT_FILES = [
|
|
302
|
+
// '.git',
|
|
303
|
+
// https://pnpm.js.org/workspaces/
|
|
302
304
|
"pnpm-workspace.yaml"
|
|
305
|
+
// https://rushjs.io/pages/advanced/config_files/
|
|
306
|
+
// 'rush.json',
|
|
307
|
+
// https://nx.dev/latest/react/getting-started/nx-setup
|
|
308
|
+
// 'workspace.json',
|
|
309
|
+
// 'nx.json'
|
|
303
310
|
];
|
|
304
311
|
function hasWorkspacePackageJSON(root) {
|
|
305
312
|
const path = _path.join.call(void 0, root, "package.json");
|
|
@@ -361,7 +368,7 @@ function createConfigPlugin(options) {
|
|
|
361
368
|
define: getDefine(options),
|
|
362
369
|
resolve: {
|
|
363
370
|
alias: {
|
|
364
|
-
"@slidev/client/": `${
|
|
371
|
+
"@slidev/client/": `${_chunkGE7W2DBEjs.toAtFS.call(void 0, options.clientRoot)}/`
|
|
365
372
|
},
|
|
366
373
|
dedupe: ["vue"]
|
|
367
374
|
},
|
|
@@ -396,7 +403,7 @@ function createConfigPlugin(options) {
|
|
|
396
403
|
allow: _utils.uniq.call(void 0, [
|
|
397
404
|
searchForWorkspaceRoot(options.userRoot),
|
|
398
405
|
searchForWorkspaceRoot(options.cliRoot),
|
|
399
|
-
..._isinstalledglobally2.default ? [_path.dirname.call(void 0,
|
|
406
|
+
..._isinstalledglobally2.default ? [_path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveGlobalImportPath.call(void 0, "@slidev/client/package.json")), _path.dirname.call(void 0, _chunkGE7W2DBEjs.resolveGlobalImportPath.call(void 0, "katex/package.json"))] : []
|
|
400
407
|
])
|
|
401
408
|
}
|
|
402
409
|
}
|
|
@@ -405,7 +412,7 @@ function createConfigPlugin(options) {
|
|
|
405
412
|
injection.cacheDir = _path.join.call(void 0, options.cliRoot, "node_modules/.vite");
|
|
406
413
|
injection.publicDir = _path.join.call(void 0, options.userRoot, "public");
|
|
407
414
|
injection.root = options.cliRoot;
|
|
408
|
-
injection.resolve.alias.vue = `${
|
|
415
|
+
injection.resolve.alias.vue = `${_chunkGE7W2DBEjs.resolveImportPath.call(void 0, "vue/dist/vue.esm-browser.js", true)}`;
|
|
409
416
|
}
|
|
410
417
|
return _vite.mergeConfig.call(void 0, config, injection);
|
|
411
418
|
},
|
|
@@ -427,7 +434,7 @@ function createConfigPlugin(options) {
|
|
|
427
434
|
function getDefine(options) {
|
|
428
435
|
return {
|
|
429
436
|
__DEV__: options.mode === "dev" ? "true" : "false",
|
|
430
|
-
__SLIDEV_CLIENT_ROOT__: JSON.stringify(
|
|
437
|
+
__SLIDEV_CLIENT_ROOT__: JSON.stringify(_chunkGE7W2DBEjs.toAtFS.call(void 0, options.clientRoot)),
|
|
431
438
|
__SLIDEV_HASH_ROUTE__: JSON.stringify(options.data.config.routerMode === "hash"),
|
|
432
439
|
__SLIDEV_FEATURE_DRAWINGS__: JSON.stringify(options.data.config.drawings.enabled === true || options.data.config.drawings.enabled === options.mode),
|
|
433
440
|
__SLIDEV_FEATURE_DRAWINGS_PERSIST__: JSON.stringify(!!options.data.config.drawings.persist === true),
|
|
@@ -438,7 +445,7 @@ function getDefine(options) {
|
|
|
438
445
|
}
|
|
439
446
|
|
|
440
447
|
// node/plugins/loaders.ts
|
|
441
|
-
var import_fast_deep_equal =
|
|
448
|
+
var import_fast_deep_equal = _chunkGE7W2DBEjs.__toESM.call(void 0, require_fast_deep_equal());
|
|
442
449
|
|
|
443
450
|
|
|
444
451
|
|
|
@@ -706,7 +713,7 @@ ${title}
|
|
|
706
713
|
delete frontmatter.title;
|
|
707
714
|
const imports = [
|
|
708
715
|
'import { inject as vueInject } from "vue"',
|
|
709
|
-
`import InjectedLayout from "${
|
|
716
|
+
`import InjectedLayout from "${_chunkGE7W2DBEjs.toAtFS.call(void 0, layouts[layoutName])}"`,
|
|
710
717
|
'import { injectionSlidevContext } from "@slidev/client/constants"',
|
|
711
718
|
`const frontmatter = ${JSON.stringify(frontmatter)}`,
|
|
712
719
|
"const $slidev = vueInject(injectionSlidevContext)"
|
|
@@ -744,7 +751,7 @@ ${imports.join("\n")}
|
|
|
744
751
|
if (matchExport) {
|
|
745
752
|
const exportIndex = (matchExport.index || 0) + matchExport[0].length;
|
|
746
753
|
let component = code.slice(exportIndex);
|
|
747
|
-
component = component.slice(0, component.indexOf("
|
|
754
|
+
component = component.slice(0, component.indexOf("</script>"));
|
|
748
755
|
const scriptIndex = (matchScript.index || 0) + matchScript[0].length;
|
|
749
756
|
const provideImport = '\nimport { injectionSlidevContext } from "@slidev/client/constants"\n';
|
|
750
757
|
code = `${code.slice(0, scriptIndex)}${provideImport}${code.slice(scriptIndex)}`;
|
|
@@ -774,7 +781,7 @@ ${code.slice(injectIndex)}`;
|
|
|
774
781
|
}
|
|
775
782
|
return `<script setup>
|
|
776
783
|
${imports.join("\n")}
|
|
777
|
-
|
|
784
|
+
</script>
|
|
778
785
|
${code}`;
|
|
779
786
|
}
|
|
780
787
|
function transformTitles(code) {
|
|
@@ -811,10 +818,10 @@ defineProps<{ no: number | string }>()`);
|
|
|
811
818
|
}
|
|
812
819
|
async function generateUserStyles() {
|
|
813
820
|
const imports = [
|
|
814
|
-
`import "${
|
|
815
|
-
`import "${
|
|
816
|
-
`import "${
|
|
817
|
-
`import "${
|
|
821
|
+
`import "${_chunkGE7W2DBEjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/vars.css"))}"`,
|
|
822
|
+
`import "${_chunkGE7W2DBEjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/index.css"))}"`,
|
|
823
|
+
`import "${_chunkGE7W2DBEjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/code.css"))}"`,
|
|
824
|
+
`import "${_chunkGE7W2DBEjs.toAtFS.call(void 0, _path.join.call(void 0, clientRoot, "styles/transitions.css"))}"`
|
|
818
825
|
];
|
|
819
826
|
const roots2 = _utils.uniq.call(void 0, [
|
|
820
827
|
...themeRoots,
|
|
@@ -831,13 +838,13 @@ defineProps<{ no: number | string }>()`);
|
|
|
831
838
|
];
|
|
832
839
|
for (const style of styles) {
|
|
833
840
|
if (_fsextra.existsSync.call(void 0, style)) {
|
|
834
|
-
imports.push(`import "${
|
|
841
|
+
imports.push(`import "${_chunkGE7W2DBEjs.toAtFS.call(void 0, style)}"`);
|
|
835
842
|
continue;
|
|
836
843
|
}
|
|
837
844
|
}
|
|
838
845
|
}
|
|
839
846
|
if (data.features.katex)
|
|
840
|
-
imports.push(`import "${
|
|
847
|
+
imports.push(`import "${_chunkGE7W2DBEjs.toAtFS.call(void 0, _chunkGE7W2DBEjs.resolveImportPath.call(void 0, "katex/dist/katex.min.css", true))}"`);
|
|
841
848
|
if (data.config.css === "unocss") {
|
|
842
849
|
imports.unshift(
|
|
843
850
|
'import "@unocss/reset/tailwind.css"',
|
|
@@ -851,10 +858,9 @@ defineProps<{ no: number | string }>()`);
|
|
|
851
858
|
'import "virtual:windi-components.css"',
|
|
852
859
|
'import "virtual:windi-base.css"'
|
|
853
860
|
);
|
|
854
|
-
imports.push(
|
|
855
|
-
|
|
856
|
-
'import "virtual:windi-devtools"'
|
|
857
|
-
);
|
|
861
|
+
imports.push('import "virtual:windi-utilities.css"');
|
|
862
|
+
if (process.env.NODE_ENV !== "production")
|
|
863
|
+
imports.push('import "virtual:windi-devtools"');
|
|
858
864
|
}
|
|
859
865
|
return imports.join("\n");
|
|
860
866
|
}
|
|
@@ -866,7 +872,7 @@ defineProps<{ no: number | string }>()`);
|
|
|
866
872
|
const layouts = _utils.objectMap.call(void 0,
|
|
867
873
|
await getLayouts(),
|
|
868
874
|
(k, v) => {
|
|
869
|
-
imports.push(`import __layout_${k} from "${
|
|
875
|
+
imports.push(`import __layout_${k} from "${_chunkGE7W2DBEjs.toAtFS.call(void 0, v)}"`);
|
|
870
876
|
return [k, `__layout_${k}`];
|
|
871
877
|
}
|
|
872
878
|
);
|
|
@@ -915,7 +921,7 @@ ${routes.join(",\n")}
|
|
|
915
921
|
const config = { ...data.config, remote };
|
|
916
922
|
if (_utils.isString.call(void 0, config.title)) {
|
|
917
923
|
const tokens = md.parseInline(config.title, {});
|
|
918
|
-
config.title =
|
|
924
|
+
config.title = _chunkGE7W2DBEjs.stringifyMarkdownTokens.call(void 0, tokens);
|
|
919
925
|
}
|
|
920
926
|
if (_utils.isString.call(void 0, config.info))
|
|
921
927
|
config.info = md.render(config.info);
|
|
@@ -936,7 +942,7 @@ ${routes.join(",\n")}
|
|
|
936
942
|
];
|
|
937
943
|
}
|
|
938
944
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
939
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
945
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkGE7W2DBEjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
940
946
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
941
947
|
return `
|
|
942
948
|
${imports}
|
|
@@ -955,7 +961,7 @@ export default {
|
|
|
955
961
|
_path.join.call(void 0, root, "CustomNavControls.vue")
|
|
956
962
|
];
|
|
957
963
|
}).filter((i) => _fsextra2.default.existsSync(i));
|
|
958
|
-
const imports = components.map((i, idx) => `import __n${idx} from '${
|
|
964
|
+
const imports = components.map((i, idx) => `import __n${idx} from '${_chunkGE7W2DBEjs.toAtFS.call(void 0, i)}'`).join("\n");
|
|
959
965
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
960
966
|
return `
|
|
961
967
|
${imports}
|
|
@@ -1028,7 +1034,7 @@ function createClientSetupPlugin({ clientRoot, themeRoots, addonRoots, userRoot
|
|
|
1028
1034
|
setups.forEach((path, idx) => {
|
|
1029
1035
|
if (!_fs.existsSync.call(void 0, path))
|
|
1030
1036
|
return;
|
|
1031
|
-
imports.push(`import __n${idx} from '${
|
|
1037
|
+
imports.push(`import __n${idx} from '${_chunkGE7W2DBEjs.toAtFS.call(void 0, path)}'`);
|
|
1032
1038
|
let fn = `:AWAIT:__n${idx}`;
|
|
1033
1039
|
if (/\binjection_return\b/g.test(code))
|
|
1034
1040
|
fn = `injection_return = ${fn}`;
|
|
@@ -1076,7 +1082,8 @@ function isValidDelim(state, pos) {
|
|
|
1076
1082
|
let can_close = true;
|
|
1077
1083
|
const prevChar = pos > 0 ? state.src.charCodeAt(pos - 1) : -1;
|
|
1078
1084
|
const nextChar = pos + 1 <= max ? state.src.charCodeAt(pos + 1) : -1;
|
|
1079
|
-
if (prevChar === 32 || prevChar === 9 ||
|
|
1085
|
+
if (prevChar === 32 || prevChar === 9 || /* \t */
|
|
1086
|
+
nextChar >= 48 && nextChar <= 57)
|
|
1080
1087
|
can_close = false;
|
|
1081
1088
|
if (nextChar === 32 || nextChar === 9)
|
|
1082
1089
|
can_open = false;
|
|
@@ -1237,7 +1244,7 @@ function loadPrismLang(lang) {
|
|
|
1237
1244
|
}
|
|
1238
1245
|
function loadPrismPlugin(name) {
|
|
1239
1246
|
try {
|
|
1240
|
-
|
|
1247
|
+
_chunkGE7W2DBEjs.__require.call(void 0, `prismjs/plugins/${name}/prism-${name}`);
|
|
1241
1248
|
} catch (e) {
|
|
1242
1249
|
throw new Error(`Cannot load Prism plugin "${name}". Please check the spelling.`);
|
|
1243
1250
|
}
|
|
@@ -1553,6 +1560,7 @@ async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, u
|
|
|
1553
1560
|
|
|
1554
1561
|
// node/plugins/preset.ts
|
|
1555
1562
|
var customElements = /* @__PURE__ */ new Set([
|
|
1563
|
+
// katex
|
|
1556
1564
|
"annotation",
|
|
1557
1565
|
"math",
|
|
1558
1566
|
"menclose",
|
|
@@ -1683,7 +1691,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1683
1691
|
dev: true,
|
|
1684
1692
|
build: true
|
|
1685
1693
|
}) : null,
|
|
1686
|
-
config.css === "unocss" ? await createUnocssPlugin(options, pluginOptions) : await createWindiCSSPlugin(options, pluginOptions)
|
|
1694
|
+
config.css === "none" ? null : config.css === "unocss" ? await createUnocssPlugin(options, pluginOptions) : await createWindiCSSPlugin(options, pluginOptions)
|
|
1687
1695
|
].flat().filter(_utils.notNullish);
|
|
1688
1696
|
}
|
|
1689
1697
|
|
|
@@ -23,6 +23,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
23
|
return to;
|
|
24
24
|
};
|
|
25
25
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
27
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
28
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
30
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
31
|
mod
|
|
28
32
|
));
|
|
@@ -23,6 +23,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
23
|
return to;
|
|
24
24
|
};
|
|
25
25
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
26
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
27
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
28
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
29
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
30
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
31
|
mod
|
|
28
32
|
));
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
resolveImportPath,
|
|
8
8
|
stringifyMarkdownTokens,
|
|
9
9
|
toAtFS
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CTG3GV2W.mjs";
|
|
11
11
|
|
|
12
12
|
// ../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js
|
|
13
13
|
var require_fast_deep_equal = __commonJS({
|
|
@@ -81,7 +81,7 @@ ${(((_a = index.match(/<head>([\s\S]*?)<\/head>/im)) == null ? void 0 : _a[1]) |
|
|
|
81
81
|
${(((_b = index.match(/<body>([\s\S]*?)<\/body>/im)) == null ? void 0 : _b[1]) || "").trim()}`;
|
|
82
82
|
}
|
|
83
83
|
if (data.features.tweet)
|
|
84
|
-
body += '\n<script async src="https://platform.twitter.com/widgets.js"
|
|
84
|
+
body += '\n<script async src="https://platform.twitter.com/widgets.js"></script>';
|
|
85
85
|
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
86
86
|
head += `
|
|
87
87
|
<link rel="stylesheet" href="${generateGoogleFontsUrl(data.config.fonts)}" type="text/css">`;
|
|
@@ -271,20 +271,20 @@ var dependencies = {
|
|
|
271
271
|
"@slidev/types": "workspace:*",
|
|
272
272
|
"@unocss/reset": "^0.49.4",
|
|
273
273
|
"@vueuse/core": "^9.12.0",
|
|
274
|
-
"@vueuse/head": "^1.0.
|
|
274
|
+
"@vueuse/head": "^1.0.25",
|
|
275
275
|
"@vueuse/math": "^9.12.0",
|
|
276
276
|
"@vueuse/motion": "^2.0.0-beta.27",
|
|
277
277
|
codemirror: "^5.65.5",
|
|
278
278
|
defu: "^6.1.2",
|
|
279
279
|
drauu: "^0.3.2",
|
|
280
280
|
"file-saver": "^2.0.5",
|
|
281
|
-
"js-base64": "^3.7.
|
|
281
|
+
"js-base64": "^3.7.5",
|
|
282
282
|
"js-yaml": "^4.1.0",
|
|
283
283
|
katex: "^0.16.4",
|
|
284
284
|
mermaid: "^9.3.0",
|
|
285
285
|
"monaco-editor": "^0.33.0",
|
|
286
|
-
nanoid: "^4.0.
|
|
287
|
-
prettier: "^2.8.
|
|
286
|
+
nanoid: "^4.0.1",
|
|
287
|
+
prettier: "^2.8.4",
|
|
288
288
|
recordrtc: "^5.6.2",
|
|
289
289
|
resolve: "^1.22.1",
|
|
290
290
|
unocss: "^0.49.4",
|
|
@@ -299,7 +299,14 @@ var dependencies = {
|
|
|
299
299
|
import fs3 from "fs";
|
|
300
300
|
import { dirname as dirname3, join as join3 } from "path";
|
|
301
301
|
var ROOT_FILES = [
|
|
302
|
+
// '.git',
|
|
303
|
+
// https://pnpm.js.org/workspaces/
|
|
302
304
|
"pnpm-workspace.yaml"
|
|
305
|
+
// https://rushjs.io/pages/advanced/config_files/
|
|
306
|
+
// 'rush.json',
|
|
307
|
+
// https://nx.dev/latest/react/getting-started/nx-setup
|
|
308
|
+
// 'workspace.json',
|
|
309
|
+
// 'nx.json'
|
|
303
310
|
];
|
|
304
311
|
function hasWorkspacePackageJSON(root) {
|
|
305
312
|
const path = join3(root, "package.json");
|
|
@@ -744,7 +751,7 @@ ${imports.join("\n")}
|
|
|
744
751
|
if (matchExport) {
|
|
745
752
|
const exportIndex = (matchExport.index || 0) + matchExport[0].length;
|
|
746
753
|
let component = code.slice(exportIndex);
|
|
747
|
-
component = component.slice(0, component.indexOf("
|
|
754
|
+
component = component.slice(0, component.indexOf("</script>"));
|
|
748
755
|
const scriptIndex = (matchScript.index || 0) + matchScript[0].length;
|
|
749
756
|
const provideImport = '\nimport { injectionSlidevContext } from "@slidev/client/constants"\n';
|
|
750
757
|
code = `${code.slice(0, scriptIndex)}${provideImport}${code.slice(scriptIndex)}`;
|
|
@@ -774,7 +781,7 @@ ${code.slice(injectIndex)}`;
|
|
|
774
781
|
}
|
|
775
782
|
return `<script setup>
|
|
776
783
|
${imports.join("\n")}
|
|
777
|
-
|
|
784
|
+
</script>
|
|
778
785
|
${code}`;
|
|
779
786
|
}
|
|
780
787
|
function transformTitles(code) {
|
|
@@ -851,10 +858,9 @@ defineProps<{ no: number | string }>()`);
|
|
|
851
858
|
'import "virtual:windi-components.css"',
|
|
852
859
|
'import "virtual:windi-base.css"'
|
|
853
860
|
);
|
|
854
|
-
imports.push(
|
|
855
|
-
|
|
856
|
-
'import "virtual:windi-devtools"'
|
|
857
|
-
);
|
|
861
|
+
imports.push('import "virtual:windi-utilities.css"');
|
|
862
|
+
if (process.env.NODE_ENV !== "production")
|
|
863
|
+
imports.push('import "virtual:windi-devtools"');
|
|
858
864
|
}
|
|
859
865
|
return imports.join("\n");
|
|
860
866
|
}
|
|
@@ -1076,7 +1082,8 @@ function isValidDelim(state, pos) {
|
|
|
1076
1082
|
let can_close = true;
|
|
1077
1083
|
const prevChar = pos > 0 ? state.src.charCodeAt(pos - 1) : -1;
|
|
1078
1084
|
const nextChar = pos + 1 <= max ? state.src.charCodeAt(pos + 1) : -1;
|
|
1079
|
-
if (prevChar === 32 || prevChar === 9 ||
|
|
1085
|
+
if (prevChar === 32 || prevChar === 9 || /* \t */
|
|
1086
|
+
nextChar >= 48 && nextChar <= 57)
|
|
1080
1087
|
can_close = false;
|
|
1081
1088
|
if (nextChar === 32 || nextChar === 9)
|
|
1082
1089
|
can_open = false;
|
|
@@ -1553,6 +1560,7 @@ async function createUnocssPlugin({ themeRoots, addonRoots, clientRoot, roots, u
|
|
|
1553
1560
|
|
|
1554
1561
|
// node/plugins/preset.ts
|
|
1555
1562
|
var customElements = /* @__PURE__ */ new Set([
|
|
1563
|
+
// katex
|
|
1556
1564
|
"annotation",
|
|
1557
1565
|
"math",
|
|
1558
1566
|
"menclose",
|
|
@@ -1683,7 +1691,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
1683
1691
|
dev: true,
|
|
1684
1692
|
build: true
|
|
1685
1693
|
}) : null,
|
|
1686
|
-
config.css === "unocss" ? await createUnocssPlugin(options, pluginOptions) : await createWindiCSSPlugin(options, pluginOptions)
|
|
1694
|
+
config.css === "none" ? null : config.css === "unocss" ? await createUnocssPlugin(options, pluginOptions) : await createWindiCSSPlugin(options, pluginOptions)
|
|
1687
1695
|
].flat().filter(notNullish2);
|
|
1688
1696
|
}
|
|
1689
1697
|
|