yumiamd 0.1.33 → 0.1.35
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 +1 -1
- package/dist/{chunk-IY7SXY6N.js → chunk-FUQWTKHG.js} +48 -41
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +10 -10
package/dist/bin.js
CHANGED
|
@@ -1781,14 +1781,14 @@ var NativeYumiaParser = class {
|
|
|
1781
1781
|
const baseIndent = tok.indent;
|
|
1782
1782
|
switch (tok.command) {
|
|
1783
1783
|
case "hero": {
|
|
1784
|
-
const
|
|
1785
|
-
const
|
|
1786
|
-
const
|
|
1787
|
-
const
|
|
1788
|
-
const
|
|
1789
|
-
const
|
|
1790
|
-
const
|
|
1791
|
-
const title =
|
|
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,
|
|
1804
|
-
tagline:
|
|
1805
|
-
badge:
|
|
1806
|
-
align:
|
|
1807
|
-
emphasis:
|
|
1808
|
-
density:
|
|
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 },
|
|
@@ -1814,10 +1814,10 @@ var NativeYumiaParser = class {
|
|
|
1814
1814
|
return { element: heroEl, nextIdx };
|
|
1815
1815
|
}
|
|
1816
1816
|
case "callout": {
|
|
1817
|
-
const
|
|
1818
|
-
const
|
|
1819
|
-
const
|
|
1820
|
-
let text = this.stripQuotes(tok.args.replace(
|
|
1817
|
+
const titleVal = this.extractAttr(tok.args, "title");
|
|
1818
|
+
const sevVal = this.extractAttr(tok.args, "severity") ?? this.extractAttr(tok.args, "variant");
|
|
1819
|
+
const iconVal = this.extractAttr(tok.args, "icon");
|
|
1820
|
+
let text = this.stripQuotes(tok.args.replace(/\btitle=(?:"[^"]*"|'[^']*'|\S+)/g, "").replace(/\b(?:severity|variant|icon)=(?:"[^"]*"|'[^']*'|\S+)/g, ""));
|
|
1821
1821
|
let nextIdx = idx + 1;
|
|
1822
1822
|
if (!text) {
|
|
1823
1823
|
const cLines = [];
|
|
@@ -1827,7 +1827,7 @@ var NativeYumiaParser = class {
|
|
|
1827
1827
|
}
|
|
1828
1828
|
text = cLines.join(" ");
|
|
1829
1829
|
}
|
|
1830
|
-
const calloutEl = createCallout(text || "Note",
|
|
1830
|
+
const calloutEl = createCallout(text || "Note", sevVal ? sevVal : "info", titleVal, iconVal);
|
|
1831
1831
|
calloutEl.loc = {
|
|
1832
1832
|
start: { line: tok.lineNum, column: 1 },
|
|
1833
1833
|
end: { line: tok.lineNum, column: tok.text.length }
|
|
@@ -1888,10 +1888,10 @@ var NativeYumiaParser = class {
|
|
|
1888
1888
|
};
|
|
1889
1889
|
}
|
|
1890
1890
|
case "card": {
|
|
1891
|
-
const
|
|
1892
|
-
const
|
|
1893
|
-
const title =
|
|
1894
|
-
const variant =
|
|
1891
|
+
const titleVal = this.extractAttr(tok.args, "title");
|
|
1892
|
+
const variantVal = this.extractAttr(tok.args, "variant");
|
|
1893
|
+
const title = titleVal ?? (this.stripQuotes(tok.args) || void 0);
|
|
1894
|
+
const variant = variantVal ? variantVal : "default";
|
|
1895
1895
|
const children = [];
|
|
1896
1896
|
let nextIdx = idx + 1;
|
|
1897
1897
|
while (nextIdx < tokens.length && tokens[nextIdx].indent > baseIndent) {
|
|
@@ -1974,14 +1974,14 @@ var NativeYumiaParser = class {
|
|
|
1974
1974
|
};
|
|
1975
1975
|
}
|
|
1976
1976
|
case "metric": {
|
|
1977
|
-
const
|
|
1978
|
-
const
|
|
1979
|
-
const
|
|
1980
|
-
const
|
|
1981
|
-
const value =
|
|
1982
|
-
const label =
|
|
1977
|
+
const valVal = this.extractAttr(tok.args, "value") ?? this.extractAttr(tok.args);
|
|
1978
|
+
const labelVal = this.extractAttr(tok.args, "label");
|
|
1979
|
+
const diffVal = this.extractAttr(tok.args, "diff") ?? this.extractAttr(tok.args, "change");
|
|
1980
|
+
const variantVal = this.extractAttr(tok.args, "variant");
|
|
1981
|
+
const value = valVal || "0";
|
|
1982
|
+
const label = labelVal || "Metric";
|
|
1983
1983
|
return {
|
|
1984
|
-
element: createMetric(value, label,
|
|
1984
|
+
element: createMetric(value, label, variantVal || "primary", void 0, void 0, diffVal),
|
|
1985
1985
|
nextIdx: idx + 1
|
|
1986
1986
|
};
|
|
1987
1987
|
}
|
|
@@ -2451,10 +2451,8 @@ var NativeYumiaParser = class {
|
|
|
2451
2451
|
return { element: classEl, nextIdx };
|
|
2452
2452
|
}
|
|
2453
2453
|
case "compare": {
|
|
2454
|
-
const
|
|
2455
|
-
const
|
|
2456
|
-
const leftTitle = leftTitleMatch ? leftTitleMatch[1] : void 0;
|
|
2457
|
-
const rightTitle = rightTitleMatch ? rightTitleMatch[1] : void 0;
|
|
2454
|
+
const leftTitle = this.extractAttr(tok.args, "left") ?? this.extractAttr(tok.args, "leftTitle");
|
|
2455
|
+
const rightTitle = this.extractAttr(tok.args, "right") ?? this.extractAttr(tok.args, "rightTitle");
|
|
2458
2456
|
const leftEls = [];
|
|
2459
2457
|
const rightEls = [];
|
|
2460
2458
|
let currentSide = "left";
|
|
@@ -2491,13 +2489,13 @@ var NativeYumiaParser = class {
|
|
|
2491
2489
|
while (nextIdx < tokens.length && tokens[nextIdx].indent > baseIndent) {
|
|
2492
2490
|
const sub = tokens[nextIdx];
|
|
2493
2491
|
if (sub.command === "item") {
|
|
2494
|
-
const
|
|
2495
|
-
const
|
|
2496
|
-
const
|
|
2492
|
+
const dateVal = this.extractAttr(sub.args, "date");
|
|
2493
|
+
const titleVal = this.extractAttr(sub.args, "title");
|
|
2494
|
+
const descVal = this.extractAttr(sub.args, "desc") ?? this.extractAttr(sub.args, "description");
|
|
2497
2495
|
items.push({
|
|
2498
|
-
date:
|
|
2499
|
-
title:
|
|
2500
|
-
description:
|
|
2496
|
+
date: dateVal || "2026",
|
|
2497
|
+
title: titleVal || "Milestone",
|
|
2498
|
+
description: descVal
|
|
2501
2499
|
});
|
|
2502
2500
|
}
|
|
2503
2501
|
nextIdx++;
|
|
@@ -2598,6 +2596,15 @@ var NativeYumiaParser = class {
|
|
|
2598
2596
|
return template;
|
|
2599
2597
|
}
|
|
2600
2598
|
}
|
|
2599
|
+
extractAttr(argsStr, key) {
|
|
2600
|
+
if (!argsStr)
|
|
2601
|
+
return void 0;
|
|
2602
|
+
const pattern = key ? new RegExp(`\\b${key}=(?:"([^"]*)"|'([^']*)'|([^\\s"']+))`) : /^(?:"([^"]*)"|'([^']*)')/;
|
|
2603
|
+
const m = argsStr.match(pattern);
|
|
2604
|
+
if (!m)
|
|
2605
|
+
return void 0;
|
|
2606
|
+
return m[1] ?? m[2] ?? m[3];
|
|
2607
|
+
}
|
|
2601
2608
|
stripQuotes(str) {
|
|
2602
2609
|
if (!str)
|
|
2603
2610
|
return "";
|
|
@@ -12052,7 +12059,7 @@ function startDevServer(filePath, options = {}) {
|
|
|
12052
12059
|
// src/cli.ts
|
|
12053
12060
|
import { mkdirSync, readFileSync as readFileSync3, watch as fsWatch, writeFileSync } from "fs";
|
|
12054
12061
|
import { basename, dirname, extname, join, resolve as resolve3 } from "path";
|
|
12055
|
-
var VERSION = "0.1.
|
|
12062
|
+
var VERSION = "0.1.35";
|
|
12056
12063
|
function printHelp() {
|
|
12057
12064
|
return `
|
|
12058
12065
|
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.
|
|
12
|
+
declare const VERSION = "0.1.35";
|
|
13
13
|
declare function printHelp(): string;
|
|
14
14
|
declare function runCli(argv: string[]): Promise<{
|
|
15
15
|
exitCode: number;
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yumiamd",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.35",
|
|
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.
|
|
26
|
-
"@yumiamd/
|
|
27
|
-
"@yumiamd/
|
|
28
|
-
"@yumiamd/
|
|
29
|
-
"@yumiamd/
|
|
30
|
-
"@yumiamd/
|
|
31
|
-
"@yumiamd/renderer-pdf": "0.1.
|
|
32
|
-
"@yumiamd/
|
|
33
|
-
"@yumiamd/
|
|
25
|
+
"@yumiamd/ast": "0.1.35",
|
|
26
|
+
"@yumiamd/core": "0.1.35",
|
|
27
|
+
"@yumiamd/renderer-html": "0.1.35",
|
|
28
|
+
"@yumiamd/parser": "0.1.35",
|
|
29
|
+
"@yumiamd/renderer": "0.1.35",
|
|
30
|
+
"@yumiamd/renderer-pptx": "0.1.35",
|
|
31
|
+
"@yumiamd/renderer-pdf": "0.1.35",
|
|
32
|
+
"@yumiamd/layout": "0.1.35",
|
|
33
|
+
"@yumiamd/theme": "0.1.35"
|
|
34
34
|
},
|
|
35
35
|
"keywords": [
|
|
36
36
|
"yumia",
|