yumiamd 0.1.13 → 0.1.14

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/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  runCli
4
- } from "./chunk-6GEDN7OB.js";
4
+ } from "./chunk-ZOJEPOPI.js";
5
5
 
6
6
  // src/bin.ts
7
7
  var result = await runCli(process.argv);
@@ -12,4 +12,6 @@ if (result.output) {
12
12
  console.error(result.output);
13
13
  }
14
14
  }
15
- process.exit(result.exitCode);
15
+ if (!result.keepAlive) {
16
+ process.exit(result.exitCode);
17
+ }
@@ -1541,11 +1541,33 @@ var CSS_NAMED_COLORS = {
1541
1541
  function cleanFontFace(fontString) {
1542
1542
  if (!fontString)
1543
1543
  return "Segoe UI";
1544
- const first = fontString.split(",")[0]?.trim().replace(/^['"]|['"]$/g, "") || "";
1545
- if (!first || first === "system-ui" || first === "-apple-system" || first === "sans-serif" || first === "monospace" || first === "serif") {
1546
- return "Segoe UI";
1547
- }
1548
- return first;
1544
+ const fonts = fontString.split(",").map((f) => f.trim().replace(/^['"]|['"]$/g, ""));
1545
+ const safeList = [
1546
+ "Segoe UI",
1547
+ "Arial",
1548
+ "Calibri",
1549
+ "Helvetica",
1550
+ "Verdana",
1551
+ "Tahoma",
1552
+ "Trebuchet MS",
1553
+ "Consolas",
1554
+ "Courier New",
1555
+ "Courier",
1556
+ "Georgia",
1557
+ "Times New Roman"
1558
+ ];
1559
+ for (const font of fonts) {
1560
+ if (safeList.includes(font)) {
1561
+ return font;
1562
+ }
1563
+ }
1564
+ if (fontString.toLowerCase().includes("mono") || fontString.toLowerCase().includes("code")) {
1565
+ return "Consolas";
1566
+ }
1567
+ if (fontString.toLowerCase().includes("serif") && !fontString.toLowerCase().includes("sans")) {
1568
+ return "Georgia";
1569
+ }
1570
+ return "Segoe UI";
1549
1571
  }
1550
1572
  function parseInlineMarkdown(rawText, baseOptions) {
1551
1573
  const chunks = [];
@@ -3328,7 +3350,7 @@ var PdfRenderer = class {
3328
3350
  }
3329
3351
  }
3330
3352
  stripFormatting(text) {
3331
- return text.replace(/\*\*(.*?)\*\*/g, "$1").replace(/\*(.*?)\*/g, "$1").replace(/`(.*?)`/g, "$1");
3353
+ return text.replace(/\*\*(.*?)\*\*/g, "$1").replace(/\*(.*?)\*/g, "$1").replace(/`(.*?)`/g, "$1").replace(/[\u{1F300}-\u{1FAFF}\u{2600}-\u{27BF}\u{1F900}-\u{1F9FF}\u{1F600}-\u{1F64F}\u{1F680}-\u{1F6FF}\u{2300}-\u{23FF}\u{2B50}]/gu, "").replace(/\u200D/g, "").replace(/\uFE0F/g, "").replace(/[“”]/g, '"').replace(/[‘’]/g, "'").replace(/[—–]/g, "-").trim();
3332
3354
  }
3333
3355
  };
3334
3356
 
@@ -3395,6 +3417,14 @@ function startDevServer(filePath, options = {}) {
3395
3417
  });
3396
3418
  server.listen(port, () => {
3397
3419
  const url = `http://localhost:${port}`;
3420
+ if (options.open) {
3421
+ const startCmd = process.platform === "win32" ? `start ${url}` : process.platform === "darwin" ? `open ${url}` : `xdg-open ${url}`;
3422
+ import("child_process").then(({ exec }) => {
3423
+ exec(startCmd, () => {
3424
+ });
3425
+ }).catch(() => {
3426
+ });
3427
+ }
3398
3428
  try {
3399
3429
  watcher = watch(resolvedPath, () => {
3400
3430
  if (debounceTimer) clearTimeout(debounceTimer);
@@ -3431,7 +3461,7 @@ function startDevServer(filePath, options = {}) {
3431
3461
  // src/cli.ts
3432
3462
  import { mkdirSync, readFileSync as readFileSync2, watch as fsWatch, writeFileSync } from "fs";
3433
3463
  import { basename, dirname, extname, join, resolve as resolve2 } from "path";
3434
- var VERSION = "0.1.13";
3464
+ var VERSION = "0.1.14";
3435
3465
  function printHelp() {
3436
3466
  return `
3437
3467
  YumiaMD \u2014 Markdown-based presentation compiler (v${VERSION})
@@ -3631,7 +3661,8 @@ Opening slide introducing the presentation deck.
3631
3661
  exitCode: 0,
3632
3662
  output: `\u{1F680} YumiaMD Live Dev Server running at: ${devInstance.url}
3633
3663
  Watching: ${target}
3634
- Hot-reloading active via SSE. Press Ctrl+C to stop.`
3664
+ Hot-reloading active via SSE. Press Ctrl+C to stop.`,
3665
+ keepAlive: true
3635
3666
  };
3636
3667
  } catch (err) {
3637
3668
  const msg = err instanceof Error ? err.message : String(err);
@@ -3863,7 +3894,8 @@ ${summary}${isStrict && report.warnings.length > 0 ? " (failed due to --strict)"
3863
3894
  const formatDesc = isHtml ? "interactive HTML slides" : isPdf ? "vector PDF slides" : "native editable slides";
3864
3895
  return {
3865
3896
  exitCode: 0,
3866
- output: `\u2713 Successfully compiled '${target}' \u2794 '${outputPath}' (${result.slideCount} ${formatDesc})${watchMsg}`
3897
+ output: `\u2713 Successfully compiled '${target}' \u2794 '${outputPath}' (${result.slideCount} ${formatDesc})${watchMsg}`,
3898
+ keepAlive: command === "watch" || isWatch
3867
3899
  };
3868
3900
  } catch (err) {
3869
3901
  const msg = err instanceof Error ? err.message : String(err);
package/dist/index.d.ts CHANGED
@@ -9,11 +9,12 @@ export * from '@yumiamd/renderer-pptx';
9
9
  export * from '@yumiamd/renderer-html';
10
10
  export * from '@yumiamd/renderer-pdf';
11
11
 
12
- declare const VERSION = "0.1.13";
12
+ declare const VERSION = "0.1.14";
13
13
  declare function printHelp(): string;
14
14
  declare function runCli(argv: string[]): Promise<{
15
15
  exitCode: number;
16
16
  output: string;
17
+ keepAlive?: boolean;
17
18
  }>;
18
19
 
19
20
  interface DevServerOptions {
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  runCli,
40
40
  startDevServer,
41
41
  terminalTheme
42
- } from "./chunk-6GEDN7OB.js";
42
+ } from "./chunk-ZOJEPOPI.js";
43
43
  export {
44
44
  DEFAULT_VIEWPORT,
45
45
  DefaultLayoutEngine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yumiamd",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Command line interface and compiler for YumiaMD presentations",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -21,15 +21,15 @@
21
21
  },
22
22
  "devDependencies": {
23
23
  "tsup": "^8.5.1",
24
- "@yumiamd/core": "0.1.13",
25
- "@yumiamd/parser": "0.1.13",
26
- "@yumiamd/renderer": "0.1.13",
27
- "@yumiamd/ast": "0.1.13",
28
- "@yumiamd/layout": "0.1.13",
29
- "@yumiamd/renderer-html": "0.1.13",
30
- "@yumiamd/renderer-pdf": "0.1.13",
31
- "@yumiamd/renderer-pptx": "0.1.13",
32
- "@yumiamd/theme": "0.1.13"
24
+ "@yumiamd/ast": "0.1.14",
25
+ "@yumiamd/parser": "0.1.14",
26
+ "@yumiamd/core": "0.1.14",
27
+ "@yumiamd/layout": "0.1.14",
28
+ "@yumiamd/renderer": "0.1.14",
29
+ "@yumiamd/renderer-pptx": "0.1.14",
30
+ "@yumiamd/renderer-html": "0.1.14",
31
+ "@yumiamd/renderer-pdf": "0.1.14",
32
+ "@yumiamd/theme": "0.1.14"
33
33
  },
34
34
  "keywords": [
35
35
  "yumia",