@slidev/cli 0.49.11 → 0.49.12

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,6 +1,6 @@
1
1
  import {
2
2
  resolveViteConfigs
3
- } from "./chunk-4LA667A3.mjs";
3
+ } from "./chunk-KNG6PIQ7.mjs";
4
4
 
5
5
  // node/commands/server.ts
6
6
  import { join } from "node:path";
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-G75DCGK3.mjs";
3
+ } from "./chunk-Z7QBEIOP.mjs";
4
4
  import {
5
5
  getThemeMeta,
6
6
  parser,
@@ -8,7 +8,7 @@ import {
8
8
  resolveOptions,
9
9
  resolveTheme,
10
10
  version
11
- } from "./chunk-4LA667A3.mjs";
11
+ } from "./chunk-KNG6PIQ7.mjs";
12
12
  import {
13
13
  loadSetups
14
14
  } from "./chunk-LOUKLO2C.mjs";
@@ -328,7 +328,7 @@ cli.command(
328
328
  }).strict().help(),
329
329
  async (args) => {
330
330
  const { entry, theme, base, download, out, inspect } = args;
331
- const { build } = await import("./build-2HGCTOR5.mjs");
331
+ const { build } = await import("./build-U63KCQIF.mjs");
332
332
  for (const entryFile of entry) {
333
333
  const options = await resolveOptions({ entry: entryFile, theme, inspect }, "build");
334
334
  if (download && !options.data.config.download)
@@ -408,7 +408,7 @@ cli.command(
408
408
  (args) => exportOptions(commonOptions(args)).strict().help(),
409
409
  async (args) => {
410
410
  const { entry, theme } = args;
411
- const { exportSlides, getExportOptions } = await import("./export-BSOHDR2A.mjs");
411
+ const { exportSlides, getExportOptions } = await import("./export-IRR3JZOI.mjs");
412
412
  const port = await getPort(12445);
413
413
  for (const entryFile of entry) {
414
414
  const options = await resolveOptions({ entry: entryFile, theme }, "export");
@@ -457,7 +457,7 @@ cli.command(
457
457
  timeout,
458
458
  wait
459
459
  }) => {
460
- const { exportNotes } = await import("./export-BSOHDR2A.mjs");
460
+ const { exportNotes } = await import("./export-IRR3JZOI.mjs");
461
461
  const port = await getPort(12445);
462
462
  for (const entryFile of entry) {
463
463
  const options = await resolveOptions({ entry: entryFile }, "export");
@@ -509,6 +509,10 @@ function exportOptions(args) {
509
509
  }).option("wait", {
510
510
  type: "number",
511
511
  describe: "wait for the specified ms before exporting"
512
+ }).option("wait-until", {
513
+ type: "string",
514
+ choices: ["networkidle", "load", "domcontentloaded", "none"],
515
+ describe: "wait until the specified event before exporting each slide"
512
516
  }).option("range", {
513
517
  type: "string",
514
518
  describe: 'page ranges to export, for example "1,4-5,6"'
@@ -78,7 +78,8 @@ async function exportNotes({
78
78
  base = "/",
79
79
  output = "notes",
80
80
  timeout = 3e4,
81
- wait = 0
81
+ wait = 0,
82
+ waitUntil
82
83
  }) {
83
84
  const { chromium } = await importPlaywright();
84
85
  const browser = await chromium.launch();
@@ -88,8 +89,9 @@ async function exportNotes({
88
89
  progress.start(1);
89
90
  if (!output.endsWith(".pdf"))
90
91
  output = `${output}.pdf`;
91
- await page.goto(`http://localhost:${port}${base}presenter/print`, { waitUntil: "networkidle", timeout });
92
- await page.waitForLoadState("networkidle");
92
+ await page.goto(`http://localhost:${port}${base}presenter/print`, { waitUntil, timeout });
93
+ if (waitUntil)
94
+ await page.waitForLoadState(waitUntil);
93
95
  await page.emulateMedia({ media: "screen" });
94
96
  if (wait)
95
97
  await page.waitForTimeout(wait);
@@ -126,7 +128,8 @@ async function exportSlides({
126
128
  executablePath = void 0,
127
129
  withToc = false,
128
130
  perSlide = false,
129
- scale = 1
131
+ scale = 1,
132
+ waitUntil
130
133
  }) {
131
134
  const pages = parseRangeString(total, range);
132
135
  const { chromium } = await importPlaywright();
@@ -155,10 +158,11 @@ async function exportSlides({
155
158
  query.set("clicks", clicks);
156
159
  const url = routerMode === "hash" ? `http://localhost:${port}${base}?${query}#${no}` : `http://localhost:${port}${base}${no}?${query}`;
157
160
  await page.goto(url, {
158
- waitUntil: "networkidle",
161
+ waitUntil,
159
162
  timeout
160
163
  });
161
- await page.waitForLoadState("networkidle");
164
+ if (waitUntil)
165
+ await page.waitForLoadState(waitUntil);
162
166
  await page.emulateMedia({ colorScheme: dark ? "dark" : "light", media: "screen" });
163
167
  const slide = no === "print" ? page.locator("body") : page.locator(`[data-slidev-no="${no}"]`);
164
168
  await slide.waitFor();
@@ -442,6 +446,7 @@ function getExportOptions(args, options, outDir, outFilename) {
442
446
  ...options.data.config.export,
443
447
  ...args,
444
448
  ...clearUndefined({
449
+ waitUntil: args["wait-until"],
445
450
  withClicks: args["with-clicks"],
446
451
  executablePath: args["executable-path"],
447
452
  withToc: args["with-toc"],
@@ -454,6 +459,7 @@ function getExportOptions(args, options, outDir, outFilename) {
454
459
  format,
455
460
  timeout,
456
461
  wait,
462
+ waitUntil,
457
463
  range,
458
464
  dark,
459
465
  withClicks,
@@ -473,6 +479,7 @@ function getExportOptions(args, options, outDir, outFilename) {
473
479
  format: format || "pdf",
474
480
  timeout: timeout ?? 3e4,
475
481
  wait: wait ?? 0,
482
+ waitUntil: waitUntil === "none" ? void 0 : waitUntil,
476
483
  dark: dark || options.data.config.colorSchema === "dark",
477
484
  routerMode: options.data.config.routerMode,
478
485
  width: options.data.config.canvasWidth,
package/dist/index.mjs CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createServer
3
- } from "./chunk-G75DCGK3.mjs";
3
+ } from "./chunk-Z7QBEIOP.mjs";
4
4
  import {
5
5
  ViteSlidevPlugin,
6
6
  createDataUtils,
7
7
  parser,
8
8
  resolveOptions
9
- } from "./chunk-4LA667A3.mjs";
9
+ } from "./chunk-KNG6PIQ7.mjs";
10
10
  import "./chunk-LOUKLO2C.mjs";
11
11
  import "./chunk-RG2EEPCO.mjs";
12
12
  import "./chunk-BXO7ZPPU.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/cli",
3
- "version": "0.49.11",
3
+ "version": "0.49.12",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -44,20 +44,19 @@
44
44
  "dependencies": {
45
45
  "@antfu/ni": "^0.21.12",
46
46
  "@antfu/utils": "^0.7.8",
47
- "@iconify-json/carbon": "^1.1.34",
47
+ "@iconify-json/carbon": "^1.1.36",
48
48
  "@iconify-json/ph": "^1.1.13",
49
49
  "@iconify-json/svg-spinners": "^1.1.2",
50
50
  "@lillallol/outline-pdf": "^4.0.0",
51
- "@shikijs/markdown-it": "^1.6.1",
52
- "@shikijs/twoslash": "^1.6.1",
53
- "@shikijs/vitepress-twoslash": "^1.6.1",
54
- "@unocss/extractor-mdc": "^0.60.4",
55
- "@unocss/reset": "^0.60.4",
51
+ "@shikijs/markdown-it": "^1.9.1",
52
+ "@shikijs/twoslash": "^1.9.1",
53
+ "@shikijs/vitepress-twoslash": "^1.9.1",
54
+ "@unocss/extractor-mdc": "^0.61.0",
55
+ "@unocss/reset": "^0.61.0",
56
56
  "@vitejs/plugin-vue": "^5.0.5",
57
- "@vitejs/plugin-vue-jsx": "^3.1.0",
57
+ "@vitejs/plugin-vue-jsx": "^4.0.0",
58
58
  "chokidar": "^3.6.0",
59
59
  "cli-progress": "^3.12.0",
60
- "codemirror": "^5.65.16",
61
60
  "connect": "^3.7.0",
62
61
  "debug": "^4.3.5",
63
62
  "fast-deep-equal": "^3.1.3",
@@ -67,7 +66,7 @@
67
66
  "global-directory": "^4.0.1",
68
67
  "htmlparser2": "^9.1.0",
69
68
  "is-installed-globally": "^1.0.0",
70
- "jiti": "^1.21.0",
69
+ "jiti": "^1.21.6",
71
70
  "katex": "^0.16.10",
72
71
  "kolorist": "^1.8.0",
73
72
  "local-pkg": "^0.5.0",
@@ -78,8 +77,8 @@
78
77
  "markdown-it-footnote": "^4.0.0",
79
78
  "markdown-it-mdc": "^0.2.5",
80
79
  "micromatch": "^4.0.7",
81
- "mlly": "^1.7.0",
82
- "monaco-editor": "^0.49.0",
80
+ "mlly": "^1.7.1",
81
+ "monaco-editor": "^0.50.0",
83
82
  "open": "^10.1.0",
84
83
  "pdf-lib": "^1.17.1",
85
84
  "plantuml-encoder": "^1.4.0",
@@ -91,28 +90,28 @@
91
90
  "resolve-from": "^5.0.0",
92
91
  "resolve-global": "^2.0.0",
93
92
  "semver": "^7.6.2",
94
- "shiki": "^1.6.1",
93
+ "shiki": "^1.9.1",
95
94
  "shiki-magic-move": "^0.4.2",
96
95
  "sirv": "^2.0.4",
97
96
  "source-map-js": "^1.2.0",
98
- "typescript": "^5.4.5",
99
- "unocss": "^0.60.4",
97
+ "typescript": "^5.5.2",
98
+ "unocss": "^0.61.0",
100
99
  "unplugin-icons": "^0.19.0",
101
- "unplugin-vue-components": "^0.27.0",
100
+ "unplugin-vue-components": "^0.27.1",
102
101
  "unplugin-vue-markdown": "^0.26.2",
103
102
  "untun": "^0.1.3",
104
103
  "uqr": "^0.1.2",
105
- "vite": "^5.2.12",
104
+ "vite": "^5.3.1",
106
105
  "vite-plugin-inspect": "^0.8.4",
107
106
  "vite-plugin-remote-assets": "^0.4.1",
108
107
  "vite-plugin-static-copy": "^1.0.5",
109
108
  "vite-plugin-vue-server-ref": "^0.4.2",
110
109
  "vitefu": "^0.2.5",
111
- "vue": "^3.4.27",
110
+ "vue": "^3.4.30",
112
111
  "yargs": "^17.7.2",
113
- "@slidev/client": "0.49.11",
114
- "@slidev/parser": "0.49.11",
115
- "@slidev/types": "0.49.11"
112
+ "@slidev/client": "0.49.12",
113
+ "@slidev/parser": "0.49.12",
114
+ "@slidev/types": "0.49.12"
116
115
  },
117
116
  "devDependencies": {
118
117
  "@hedgedoc/markdown-it-plugins": "^2.1.4",