yumiamd 0.1.33 → 0.1.34

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-IY7SXY6N.js";
4
+ } from "./chunk-VTY4XT47.js";
5
5
 
6
6
  // src/bin.ts
7
7
  var result = await runCli(process.argv);
@@ -1781,14 +1781,14 @@ var NativeYumiaParser = class {
1781
1781
  const baseIndent = tok.indent;
1782
1782
  switch (tok.command) {
1783
1783
  case "hero": {
1784
- const titleMatch = tok.args.match(/^(?:title=)?["']([^"']+)["']/);
1785
- const subMatch = tok.args.match(/\bsubtitle=["']([^"']+)["']/);
1786
- const tagMatch = tok.args.match(/\btagline=["']([^"']+)["']/);
1787
- const badgeMatch = tok.args.match(/\bbadge=["']([^"']+)["']/);
1788
- const alignMatch = tok.args.match(/\balign=["']?([^"'\s]+)["']?/);
1789
- const emphMatch = tok.args.match(/\bemphasis=["']?([^"'\s]+)["']?/);
1790
- const densMatch = tok.args.match(/\bdensity=["']?([^"'\s]+)["']?/);
1791
- const title = titleMatch ? titleMatch[1] : this.stripQuotes(tok.args) || "Hero";
1784
+ const titleVal = this.extractAttr(tok.args, "title") ?? this.extractAttr(tok.args);
1785
+ const subVal = this.extractAttr(tok.args, "subtitle");
1786
+ const tagVal = this.extractAttr(tok.args, "tagline");
1787
+ const badgeVal = this.extractAttr(tok.args, "badge");
1788
+ const alignVal = this.extractAttr(tok.args, "align");
1789
+ const emphVal = this.extractAttr(tok.args, "emphasis");
1790
+ const densVal = this.extractAttr(tok.args, "density");
1791
+ const title = (titleVal ?? this.stripQuotes(tok.args)) || "Hero";
1792
1792
  const children = [];
1793
1793
  let nextIdx = idx + 1;
1794
1794
  while (nextIdx < tokens.length && tokens[nextIdx].indent > baseIndent) {
@@ -1800,12 +1800,12 @@ var NativeYumiaParser = class {
1800
1800
  nextIdx++;
1801
1801
  }
1802
1802
  }
1803
- const heroEl = createHero(title, subMatch ? subMatch[1] : void 0, children.length > 0 ? children : void 0, {
1804
- tagline: tagMatch ? tagMatch[1] : void 0,
1805
- badge: badgeMatch ? badgeMatch[1] : void 0,
1806
- align: alignMatch ? alignMatch[1] : void 0,
1807
- emphasis: emphMatch ? emphMatch[1] : void 0,
1808
- density: densMatch ? densMatch[1] : void 0
1803
+ const heroEl = createHero(title, subVal, children.length > 0 ? children : void 0, {
1804
+ tagline: tagVal,
1805
+ badge: badgeVal,
1806
+ align: alignVal,
1807
+ emphasis: emphVal,
1808
+ density: densVal
1809
1809
  });
1810
1810
  heroEl.loc = {
1811
1811
  start: { line: tok.lineNum, column: 1 },
@@ -2598,6 +2598,15 @@ var NativeYumiaParser = class {
2598
2598
  return template;
2599
2599
  }
2600
2600
  }
2601
+ extractAttr(argsStr, key) {
2602
+ if (!argsStr)
2603
+ return void 0;
2604
+ const pattern = key ? new RegExp(`\\b${key}=(?:"([^"]*)"|'([^']*)'|([^\\s"']+))`) : /^(?:"([^"]*)"|'([^']*)')/;
2605
+ const m = argsStr.match(pattern);
2606
+ if (!m)
2607
+ return void 0;
2608
+ return m[1] ?? m[2] ?? m[3];
2609
+ }
2601
2610
  stripQuotes(str) {
2602
2611
  if (!str)
2603
2612
  return "";
@@ -12052,7 +12061,7 @@ function startDevServer(filePath, options = {}) {
12052
12061
  // src/cli.ts
12053
12062
  import { mkdirSync, readFileSync as readFileSync3, watch as fsWatch, writeFileSync } from "fs";
12054
12063
  import { basename, dirname, extname, join, resolve as resolve3 } from "path";
12055
- var VERSION = "0.1.33";
12064
+ var VERSION = "0.1.34";
12056
12065
  function printHelp() {
12057
12066
  return `
12058
12067
  YumiaMD \u2014 Markdown-based presentation compiler (v${VERSION})
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ 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.33";
12
+ declare const VERSION = "0.1.34";
13
13
  declare function printHelp(): string;
14
14
  declare function runCli(argv: string[]): Promise<{
15
15
  exitCode: number;
package/dist/index.js CHANGED
@@ -92,7 +92,7 @@ import {
92
92
  themeSizeToPptxPoints,
93
93
  tokyoNightTheme,
94
94
  validate
95
- } from "./chunk-IY7SXY6N.js";
95
+ } from "./chunk-VTY4XT47.js";
96
96
  export {
97
97
  DEFAULT_VIEWPORT,
98
98
  DefaultLayoutEngine,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yumiamd",
3
- "version": "0.1.33",
3
+ "version": "0.1.34",
4
4
  "description": "Command line interface and compiler for YumiaMD presentations",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -22,15 +22,15 @@
22
22
  },
23
23
  "devDependencies": {
24
24
  "tsup": "^8.5.1",
25
- "@yumiamd/ast": "0.1.33",
26
- "@yumiamd/parser": "0.1.33",
27
- "@yumiamd/layout": "0.1.33",
28
- "@yumiamd/renderer": "0.1.33",
29
- "@yumiamd/core": "0.1.33",
30
- "@yumiamd/theme": "0.1.33",
31
- "@yumiamd/renderer-pdf": "0.1.33",
32
- "@yumiamd/renderer-pptx": "0.1.33",
33
- "@yumiamd/renderer-html": "0.1.33"
25
+ "@yumiamd/ast": "0.1.34",
26
+ "@yumiamd/parser": "0.1.34",
27
+ "@yumiamd/layout": "0.1.34",
28
+ "@yumiamd/core": "0.1.34",
29
+ "@yumiamd/renderer-pdf": "0.1.34",
30
+ "@yumiamd/renderer": "0.1.34",
31
+ "@yumiamd/renderer-pptx": "0.1.34",
32
+ "@yumiamd/renderer-html": "0.1.34",
33
+ "@yumiamd/theme": "0.1.34"
34
34
  },
35
35
  "keywords": [
36
36
  "yumia",