@slidev/cli 0.35.2 → 0.35.6
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-Z26FNYJ3.js → build-3OBKYP4E.js} +58 -43
- package/dist/{build-52YMLBLI.mjs → build-JJPJN7L3.mjs} +52 -37
- package/dist/{chunk-DQSKYR2M.mjs → chunk-3VPTNK23.mjs} +64 -27
- package/dist/{chunk-OIH6DIQ4.js → chunk-4UR3M5JD.js} +194 -157
- package/dist/{chunk-GVA336JI.mjs → chunk-57E5R3IA.mjs} +12 -7
- package/dist/{chunk-SQLX75IO.js → chunk-AW7KQET4.js} +12 -7
- package/dist/{chunk-X2HQWYH2.mjs → chunk-IY7QSYZ2.mjs} +119 -85
- package/dist/{chunk-GH4JJSLK.js → chunk-YUXTNPKA.js} +159 -125
- package/dist/cli.js +291 -247
- package/dist/cli.mjs +286 -242
- package/dist/{export-TH7MNEXN.js → export-3CTBMUMP.js} +9 -6
- package/dist/{export-5OVMZQWE.mjs → export-I2KYMDHO.mjs} +6 -3
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/package.json +16 -16
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkYUXTNPKAjs = require('./chunk-YUXTNPKA.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkAW7KQET4js = require('./chunk-AW7KQET4.js');
|
|
11
11
|
|
|
12
12
|
// node/build.ts
|
|
13
|
-
|
|
13
|
+
_chunkAW7KQET4js.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
|
+
_chunkAW7KQET4js.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
|
+
_chunkAW7KQET4js.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.21/node_modules/@polka/url/build.mjs
|
|
41
|
-
|
|
41
|
+
_chunkAW7KQET4js.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
|
+
_chunkAW7KQET4js.init_cjs_shims.call(void 0, );
|
|
66
66
|
var mimes = {
|
|
67
67
|
"ez": "application/andrew-inset",
|
|
68
68
|
"aw": "application/applixware",
|
|
@@ -655,48 +655,60 @@ 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 _chunkYUXTNPKAjs.getIndexHtml.call(void 0, options), "utf-8");
|
|
659
659
|
let config = void 0;
|
|
660
660
|
try {
|
|
661
|
-
const inlineConfig = await
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
661
|
+
const inlineConfig = await _chunkYUXTNPKAjs.mergeViteConfigs.call(void 0,
|
|
662
|
+
options,
|
|
663
|
+
viteConfig,
|
|
664
|
+
{
|
|
665
|
+
root: options.userRoot,
|
|
666
|
+
plugins: [
|
|
667
|
+
await _chunkYUXTNPKAjs.ViteSlidevPlugin.call(void 0, options, pluginOptions),
|
|
668
|
+
{
|
|
669
|
+
name: "resolve-config",
|
|
670
|
+
configResolved(_config) {
|
|
671
|
+
config = _config;
|
|
672
|
+
}
|
|
669
673
|
}
|
|
674
|
+
],
|
|
675
|
+
build: {
|
|
676
|
+
chunkSizeWarningLimit: 2e3
|
|
670
677
|
}
|
|
671
|
-
|
|
672
|
-
build
|
|
673
|
-
|
|
674
|
-
}
|
|
675
|
-
}, "build");
|
|
678
|
+
},
|
|
679
|
+
"build"
|
|
680
|
+
);
|
|
676
681
|
await _vite.build.call(void 0, inlineConfig);
|
|
677
682
|
if (options.data.features.monaco) {
|
|
678
683
|
if (options.data.config.monaco === "dev") {
|
|
679
684
|
console.log(_kolorist.yellow.call(void 0, " Monaco is disabled in the build, to enabled it, set `monaco: true` in the frontmatter"));
|
|
680
685
|
} else {
|
|
681
686
|
console.log(_kolorist.blue.call(void 0, " building for Monaco...\n"));
|
|
682
|
-
await _vite.build.call(void 0,
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
687
|
+
await _vite.build.call(void 0,
|
|
688
|
+
await _chunkYUXTNPKAjs.mergeViteConfigs.call(void 0,
|
|
689
|
+
options,
|
|
690
|
+
inlineConfig,
|
|
691
|
+
{
|
|
692
|
+
root: _path.join.call(void 0, options.clientRoot, "iframes/monaco"),
|
|
693
|
+
base: `${config.base}iframes/monaco/`,
|
|
694
|
+
build: {
|
|
695
|
+
outDir: _path.resolve.call(void 0, config.build.outDir, "iframes/monaco"),
|
|
696
|
+
rollupOptions: {
|
|
697
|
+
output: {
|
|
698
|
+
manualChunks: {
|
|
699
|
+
jsonWorker: ["monaco-editor/esm/vs/language/json/json.worker"],
|
|
700
|
+
cssWorker: ["monaco-editor/esm/vs/language/css/css.worker"],
|
|
701
|
+
htmlWorker: ["monaco-editor/esm/vs/language/html/html.worker"],
|
|
702
|
+
tsWorker: ["monaco-editor/esm/vs/language/typescript/ts.worker"],
|
|
703
|
+
editorWorker: ["monaco-editor/esm/vs/editor/editor.worker"]
|
|
704
|
+
}
|
|
705
|
+
}
|
|
695
706
|
}
|
|
696
707
|
}
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
|
|
708
|
+
},
|
|
709
|
+
"build"
|
|
710
|
+
)
|
|
711
|
+
);
|
|
700
712
|
}
|
|
701
713
|
}
|
|
702
714
|
} finally {
|
|
@@ -713,15 +725,18 @@ async function build(options, viteConfig = {}) {
|
|
|
713
725
|
await _fsextra2.default.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
714
726
|
`, "utf-8");
|
|
715
727
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
716
|
-
const { exportSlides } = await Promise.resolve().then(() =>
|
|
728
|
+
const { exportSlides } = await Promise.resolve().then(() => _chunkAW7KQET4js.__toESM.call(void 0, _chunkAW7KQET4js.__require.call(void 0, "./export-3CTBMUMP.js")));
|
|
717
729
|
const port = 12445;
|
|
718
730
|
const app = _connect2.default.call(void 0, );
|
|
719
731
|
const server = _http2.default.createServer(app);
|
|
720
|
-
app.use(
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
732
|
+
app.use(
|
|
733
|
+
config.base,
|
|
734
|
+
build_default(outDir, {
|
|
735
|
+
etag: true,
|
|
736
|
+
single: true,
|
|
737
|
+
dev: true
|
|
738
|
+
})
|
|
739
|
+
);
|
|
725
740
|
server.listen(port);
|
|
726
741
|
await exportSlides({
|
|
727
742
|
port,
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
getIndexHtml,
|
|
4
4
|
mergeViteConfigs
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-IY7QSYZ2.mjs";
|
|
6
6
|
import {
|
|
7
7
|
__require,
|
|
8
8
|
__toESM,
|
|
9
9
|
init_esm_shims
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-57E5R3IA.mjs";
|
|
11
11
|
|
|
12
12
|
// node/build.ts
|
|
13
13
|
init_esm_shims();
|
|
@@ -658,45 +658,57 @@ async function build(options, viteConfig = {}) {
|
|
|
658
658
|
await fs2.writeFile(indexPath, await getIndexHtml(options), "utf-8");
|
|
659
659
|
let config = void 0;
|
|
660
660
|
try {
|
|
661
|
-
const inlineConfig = await mergeViteConfigs(
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
661
|
+
const inlineConfig = await mergeViteConfigs(
|
|
662
|
+
options,
|
|
663
|
+
viteConfig,
|
|
664
|
+
{
|
|
665
|
+
root: options.userRoot,
|
|
666
|
+
plugins: [
|
|
667
|
+
await ViteSlidevPlugin(options, pluginOptions),
|
|
668
|
+
{
|
|
669
|
+
name: "resolve-config",
|
|
670
|
+
configResolved(_config) {
|
|
671
|
+
config = _config;
|
|
672
|
+
}
|
|
669
673
|
}
|
|
674
|
+
],
|
|
675
|
+
build: {
|
|
676
|
+
chunkSizeWarningLimit: 2e3
|
|
670
677
|
}
|
|
671
|
-
|
|
672
|
-
build
|
|
673
|
-
|
|
674
|
-
}
|
|
675
|
-
}, "build");
|
|
678
|
+
},
|
|
679
|
+
"build"
|
|
680
|
+
);
|
|
676
681
|
await viteBuild(inlineConfig);
|
|
677
682
|
if (options.data.features.monaco) {
|
|
678
683
|
if (options.data.config.monaco === "dev") {
|
|
679
684
|
console.log(yellow(" Monaco is disabled in the build, to enabled it, set `monaco: true` in the frontmatter"));
|
|
680
685
|
} else {
|
|
681
686
|
console.log(blue(" building for Monaco...\n"));
|
|
682
|
-
await viteBuild(
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
687
|
+
await viteBuild(
|
|
688
|
+
await mergeViteConfigs(
|
|
689
|
+
options,
|
|
690
|
+
inlineConfig,
|
|
691
|
+
{
|
|
692
|
+
root: join3(options.clientRoot, "iframes/monaco"),
|
|
693
|
+
base: `${config.base}iframes/monaco/`,
|
|
694
|
+
build: {
|
|
695
|
+
outDir: resolve3(config.build.outDir, "iframes/monaco"),
|
|
696
|
+
rollupOptions: {
|
|
697
|
+
output: {
|
|
698
|
+
manualChunks: {
|
|
699
|
+
jsonWorker: ["monaco-editor/esm/vs/language/json/json.worker"],
|
|
700
|
+
cssWorker: ["monaco-editor/esm/vs/language/css/css.worker"],
|
|
701
|
+
htmlWorker: ["monaco-editor/esm/vs/language/html/html.worker"],
|
|
702
|
+
tsWorker: ["monaco-editor/esm/vs/language/typescript/ts.worker"],
|
|
703
|
+
editorWorker: ["monaco-editor/esm/vs/editor/editor.worker"]
|
|
704
|
+
}
|
|
705
|
+
}
|
|
695
706
|
}
|
|
696
707
|
}
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
|
|
708
|
+
},
|
|
709
|
+
"build"
|
|
710
|
+
)
|
|
711
|
+
);
|
|
700
712
|
}
|
|
701
713
|
}
|
|
702
714
|
} finally {
|
|
@@ -713,15 +725,18 @@ async function build(options, viteConfig = {}) {
|
|
|
713
725
|
await fs2.writeFile(redirectsPath, `${config.base}* ${config.base}index.html 200
|
|
714
726
|
`, "utf-8");
|
|
715
727
|
if ([true, "true", "auto"].includes(options.data.config.download)) {
|
|
716
|
-
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-
|
|
728
|
+
const { exportSlides } = await Promise.resolve().then(() => __toESM(__require("./export-I2KYMDHO.mjs")));
|
|
717
729
|
const port = 12445;
|
|
718
730
|
const app = connect();
|
|
719
731
|
const server = http.createServer(app);
|
|
720
|
-
app.use(
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
732
|
+
app.use(
|
|
733
|
+
config.base,
|
|
734
|
+
build_default(outDir, {
|
|
735
|
+
etag: true,
|
|
736
|
+
single: true,
|
|
737
|
+
dev: true
|
|
738
|
+
})
|
|
739
|
+
);
|
|
725
740
|
server.listen(port);
|
|
726
741
|
await exportSlides({
|
|
727
742
|
port,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ViteSlidevPlugin,
|
|
3
3
|
mergeViteConfigs
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IY7QSYZ2.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__commonJS,
|
|
7
7
|
__dirname,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
init_esm_shims,
|
|
14
14
|
packageExists,
|
|
15
15
|
resolveImportPath
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-57E5R3IA.mjs";
|
|
17
17
|
|
|
18
18
|
// ../../node_modules/.pnpm/semver@7.3.7/node_modules/semver/internal/constants.js
|
|
19
19
|
var require_constants = __commonJS({
|
|
@@ -163,7 +163,9 @@ var require_semver = __commonJS({
|
|
|
163
163
|
throw new TypeError(`Invalid Version: ${version3}`);
|
|
164
164
|
}
|
|
165
165
|
if (version3.length > MAX_LENGTH) {
|
|
166
|
-
throw new TypeError(
|
|
166
|
+
throw new TypeError(
|
|
167
|
+
`version is longer than ${MAX_LENGTH} characters`
|
|
168
|
+
);
|
|
167
169
|
}
|
|
168
170
|
debug2("SemVer", version3, options);
|
|
169
171
|
this.options = options;
|
|
@@ -436,7 +438,10 @@ var require_inc = __commonJS({
|
|
|
436
438
|
options = void 0;
|
|
437
439
|
}
|
|
438
440
|
try {
|
|
439
|
-
return new SemVer(
|
|
441
|
+
return new SemVer(
|
|
442
|
+
version3 instanceof SemVer ? version3.version : version3,
|
|
443
|
+
options
|
|
444
|
+
).inc(release, identifier).version;
|
|
440
445
|
} catch (er) {
|
|
441
446
|
return null;
|
|
442
447
|
}
|
|
@@ -2381,16 +2386,23 @@ async function createServer(options, viteConfig = {}, serverOptions = {}) {
|
|
|
2381
2386
|
const rawConfig = await resolveConfig({}, "serve");
|
|
2382
2387
|
const pluginOptions = rawConfig.slidev || {};
|
|
2383
2388
|
process.env.EDITOR = process.env.EDITOR || "code";
|
|
2384
|
-
const server = await createViteServer(
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2389
|
+
const server = await createViteServer(
|
|
2390
|
+
await mergeViteConfigs(
|
|
2391
|
+
options,
|
|
2392
|
+
viteConfig,
|
|
2393
|
+
{
|
|
2394
|
+
optimizeDeps: {
|
|
2395
|
+
entries: [
|
|
2396
|
+
join(options.clientRoot, "main.ts")
|
|
2397
|
+
]
|
|
2398
|
+
},
|
|
2399
|
+
plugins: [
|
|
2400
|
+
await ViteSlidevPlugin(options, pluginOptions, serverOptions)
|
|
2401
|
+
]
|
|
2402
|
+
},
|
|
2403
|
+
"serve"
|
|
2404
|
+
)
|
|
2405
|
+
);
|
|
2394
2406
|
return server;
|
|
2395
2407
|
}
|
|
2396
2408
|
|
|
@@ -2399,16 +2411,16 @@ init_esm_shims();
|
|
|
2399
2411
|
import * as parser from "@slidev/parser/fs";
|
|
2400
2412
|
|
|
2401
2413
|
// package.json
|
|
2402
|
-
var version = "0.35.
|
|
2414
|
+
var version = "0.35.6";
|
|
2403
2415
|
|
|
2404
2416
|
// node/themes.ts
|
|
2405
2417
|
init_esm_shims();
|
|
2406
2418
|
import prompts2 from "prompts";
|
|
2407
2419
|
|
|
2408
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.
|
|
2420
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.18.0/node_modules/@antfu/ni/dist/index.mjs
|
|
2409
2421
|
init_esm_shims();
|
|
2410
2422
|
|
|
2411
|
-
// ../../node_modules/.pnpm/@antfu+ni@0.
|
|
2423
|
+
// ../../node_modules/.pnpm/@antfu+ni@0.18.0/node_modules/@antfu/ni/dist/chunks/runner.mjs
|
|
2412
2424
|
init_esm_shims();
|
|
2413
2425
|
import require$$0, { resolve } from "path";
|
|
2414
2426
|
import require$$0$5 from "readline";
|
|
@@ -2428,7 +2440,7 @@ import require$$0$3 from "stream";
|
|
|
2428
2440
|
import require$$2$1 from "util";
|
|
2429
2441
|
import { promises } from "fs";
|
|
2430
2442
|
import require$$1 from "tty";
|
|
2431
|
-
var version2 = "0.
|
|
2443
|
+
var version2 = "0.18.0";
|
|
2432
2444
|
var npmRun = (agent) => (args) => {
|
|
2433
2445
|
if (args.length > 1)
|
|
2434
2446
|
return `${agent} run ${args[0]} -- ${args.slice(1).join(" ")}`;
|
|
@@ -2514,11 +2526,11 @@ var LOCKS = {
|
|
|
2514
2526
|
};
|
|
2515
2527
|
var INSTALL_PAGE = {
|
|
2516
2528
|
"bun": "https://bun.sh",
|
|
2517
|
-
"pnpm": "https://pnpm.
|
|
2518
|
-
"pnpm@6": "https://pnpm.
|
|
2529
|
+
"pnpm": "https://pnpm.io/installation",
|
|
2530
|
+
"pnpm@6": "https://pnpm.io/6.x/installation",
|
|
2519
2531
|
"yarn": "https://classic.yarnpkg.com/en/docs/install",
|
|
2520
2532
|
"yarn@berry": "https://yarnpkg.com/getting-started/install",
|
|
2521
|
-
"npm": "https://
|
|
2533
|
+
"npm": "https://docs.npmjs.com/cli/v8/configuring-npm/install"
|
|
2522
2534
|
};
|
|
2523
2535
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2524
2536
|
var windows = isexe$3;
|
|
@@ -3961,10 +3973,25 @@ var signals$1 = { exports: {} };
|
|
|
3961
3973
|
"SIGTERM"
|
|
3962
3974
|
];
|
|
3963
3975
|
if (process.platform !== "win32") {
|
|
3964
|
-
module.exports.push(
|
|
3976
|
+
module.exports.push(
|
|
3977
|
+
"SIGVTALRM",
|
|
3978
|
+
"SIGXCPU",
|
|
3979
|
+
"SIGXFSZ",
|
|
3980
|
+
"SIGUSR2",
|
|
3981
|
+
"SIGTRAP",
|
|
3982
|
+
"SIGSYS",
|
|
3983
|
+
"SIGQUIT",
|
|
3984
|
+
"SIGIOT"
|
|
3985
|
+
);
|
|
3965
3986
|
}
|
|
3966
3987
|
if (process.platform === "linux") {
|
|
3967
|
-
module.exports.push(
|
|
3988
|
+
module.exports.push(
|
|
3989
|
+
"SIGIO",
|
|
3990
|
+
"SIGPOLL",
|
|
3991
|
+
"SIGPWR",
|
|
3992
|
+
"SIGSTKFLT",
|
|
3993
|
+
"SIGUNUSED"
|
|
3994
|
+
);
|
|
3968
3995
|
}
|
|
3969
3996
|
})(signals$1);
|
|
3970
3997
|
var process$1 = commonjsGlobal.process;
|
|
@@ -8417,8 +8444,11 @@ var DatePrompt = class extends Prompt$4 {
|
|
|
8417
8444
|
this.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color$5.cyan().underline(p.toString()) : p), []).join("")
|
|
8418
8445
|
].join(" ");
|
|
8419
8446
|
if (this.error) {
|
|
8420
|
-
this.outputText += this.errorMsg.split("\n").reduce(
|
|
8421
|
-
|
|
8447
|
+
this.outputText += this.errorMsg.split("\n").reduce(
|
|
8448
|
+
(a, l, i) => a + `
|
|
8449
|
+
${i ? ` ` : figures$4.pointerSmall} ${color$5.red().italic(l)}`,
|
|
8450
|
+
``
|
|
8451
|
+
);
|
|
8422
8452
|
}
|
|
8423
8453
|
this.out.write(erase$3.line + cursor$5.to(0) + this.outputText);
|
|
8424
8454
|
}
|
|
@@ -9031,7 +9061,12 @@ var AutocompletePrompt = class extends Prompt$1 {
|
|
|
9031
9061
|
this.done && this.suggestions[this.select] ? this.suggestions[this.select].title : this.rendered = this.transform.render(this.input)
|
|
9032
9062
|
].join(" ");
|
|
9033
9063
|
if (!this.done) {
|
|
9034
|
-
const suggestions = this.suggestions.slice(startIndex, endIndex).map((item2, i) => this.renderOption(
|
|
9064
|
+
const suggestions = this.suggestions.slice(startIndex, endIndex).map((item2, i) => this.renderOption(
|
|
9065
|
+
item2,
|
|
9066
|
+
this.select === i + startIndex,
|
|
9067
|
+
i === 0 && startIndex > 0,
|
|
9068
|
+
i + startIndex === endIndex - 1 && endIndex < this.choices.length
|
|
9069
|
+
)).join("\n");
|
|
9035
9070
|
this.outputText += `
|
|
9036
9071
|
` + (suggestions || color$2.gray(this.fallback.title));
|
|
9037
9072
|
}
|
|
@@ -9329,7 +9364,9 @@ var elements = {
|
|
|
9329
9364
|
onSubmit: toSelected
|
|
9330
9365
|
});
|
|
9331
9366
|
};
|
|
9332
|
-
const byTitle = (input, choices) => Promise.resolve(
|
|
9367
|
+
const byTitle = (input, choices) => Promise.resolve(
|
|
9368
|
+
choices.filter((item2) => item2.title.slice(0, input.length).toLowerCase() === input.toLowerCase())
|
|
9369
|
+
);
|
|
9333
9370
|
$2.autocomplete = (args) => {
|
|
9334
9371
|
args.suggest = args.suggest || byTitle;
|
|
9335
9372
|
args.choices = [].concat(args.choices || []);
|