yumiamd 0.1.18 → 0.1.20
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-SP4B4UF7.js → chunk-KZLRNRVU.js} +258 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/package.json +10 -10
package/dist/bin.js
CHANGED
|
@@ -143,6 +143,13 @@ function createColumns(columns, ratios, gap) {
|
|
|
143
143
|
...gap !== void 0 ? { gap } : {}
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
+
function createMath(expression, displayMode = true) {
|
|
147
|
+
return {
|
|
148
|
+
type: "math",
|
|
149
|
+
expression,
|
|
150
|
+
displayMode
|
|
151
|
+
};
|
|
152
|
+
}
|
|
146
153
|
function createLayoutDirective(mode, attributes) {
|
|
147
154
|
return {
|
|
148
155
|
type: "layout-directive",
|
|
@@ -252,6 +259,15 @@ var DefaultYumiaParser = class {
|
|
|
252
259
|
result.theme = metadata["theme"];
|
|
253
260
|
if (typeof metadata["aspectRatio"] === "string")
|
|
254
261
|
result.aspectRatio = metadata["aspectRatio"];
|
|
262
|
+
if (typeof metadata["transition"] === "string")
|
|
263
|
+
result.transition = metadata["transition"];
|
|
264
|
+
if (typeof metadata["template"] === "string")
|
|
265
|
+
result.template = metadata["template"];
|
|
266
|
+
if (typeof metadata["embedFonts"] === "string") {
|
|
267
|
+
result.embedFonts = metadata["embedFonts"] === "true" || metadata["embedFonts"] === "yes";
|
|
268
|
+
} else if (typeof metadata["embedFonts"] === "boolean") {
|
|
269
|
+
result.embedFonts = metadata["embedFonts"];
|
|
270
|
+
}
|
|
255
271
|
const colors = {};
|
|
256
272
|
if (typeof metadata["background"] === "string")
|
|
257
273
|
colors.background = metadata["background"];
|
|
@@ -304,12 +320,14 @@ var DefaultYumiaParser = class {
|
|
|
304
320
|
}
|
|
305
321
|
parseSlide(slideContent, startLine) {
|
|
306
322
|
const lines = slideContent.split("\n");
|
|
307
|
-
const { elements, notes, layout } = this.parseLines(lines, startLine);
|
|
323
|
+
const { elements, notes, layout, transition } = this.parseLines(lines, startLine);
|
|
308
324
|
const slideOptions = {};
|
|
309
325
|
if (notes)
|
|
310
326
|
slideOptions.notes = notes;
|
|
311
327
|
if (layout)
|
|
312
328
|
slideOptions.layout = layout;
|
|
329
|
+
if (transition)
|
|
330
|
+
slideOptions.transition = transition;
|
|
313
331
|
slideOptions.loc = {
|
|
314
332
|
start: { line: startLine, column: 1 },
|
|
315
333
|
end: {
|
|
@@ -323,6 +341,7 @@ var DefaultYumiaParser = class {
|
|
|
323
341
|
const elements = [];
|
|
324
342
|
let notes;
|
|
325
343
|
let layout;
|
|
344
|
+
let transition;
|
|
326
345
|
let i = 0;
|
|
327
346
|
let currentParagraph = [];
|
|
328
347
|
let paragraphStartLine = baseLine;
|
|
@@ -405,6 +424,24 @@ var DefaultYumiaParser = class {
|
|
|
405
424
|
flushAll();
|
|
406
425
|
const directiveHeader = line.slice(3).trim();
|
|
407
426
|
const directiveStartLine = currentLineNum;
|
|
427
|
+
if (directiveHeader.startsWith("transition")) {
|
|
428
|
+
const transArg = directiveHeader.slice(10).trim();
|
|
429
|
+
const typeMatch = transArg.match(/type=['"](.*?)['"]/);
|
|
430
|
+
const durationMatch = transArg.match(/duration=['"](.*?)['"]/);
|
|
431
|
+
const dirMatch = transArg.match(/direction=['"](.*?)['"]/);
|
|
432
|
+
const rawType = typeMatch ? typeMatch[1] : transArg.replace(/duration=['"].*?['"]|direction=['"].*?['"]/, "").trim() || "fade";
|
|
433
|
+
const cleanType = (rawType || "fade").replace(/^['"](.*)['"]$/, "$1");
|
|
434
|
+
const transObj = {
|
|
435
|
+
type: cleanType
|
|
436
|
+
};
|
|
437
|
+
if (durationMatch && durationMatch[1])
|
|
438
|
+
transObj.duration = durationMatch[1];
|
|
439
|
+
if (dirMatch && dirMatch[1])
|
|
440
|
+
transObj.direction = dirMatch[1];
|
|
441
|
+
transition = transObj;
|
|
442
|
+
i++;
|
|
443
|
+
continue;
|
|
444
|
+
}
|
|
408
445
|
if (directiveHeader.startsWith("layout")) {
|
|
409
446
|
const layoutMatch = directiveHeader.match(/^layout\s*(.*)$/);
|
|
410
447
|
const rawArg = layoutMatch && layoutMatch[1] ? layoutMatch[1].trim() : "default";
|
|
@@ -477,7 +514,7 @@ var DefaultYumiaParser = class {
|
|
|
477
514
|
const innerLine = lines[i]?.trim() ?? "";
|
|
478
515
|
const isInlineClosed = innerLine.startsWith(":::") && innerLine.endsWith(":::") && innerLine.length > 5;
|
|
479
516
|
const isSeparator = innerLine === ":::vs" || innerLine.startsWith(":::vs ");
|
|
480
|
-
const isSingleLine = isInlineClosed || isSeparator || innerLine.startsWith(":::metric") || innerLine.startsWith(":::layout") || innerLine.startsWith(":::badge") && (innerLine.includes("text=") || innerLine.includes("variant=")) || innerLine.startsWith(":::chart") && innerLine.includes("data=");
|
|
517
|
+
const isSingleLine = isInlineClosed || isSeparator || innerLine.startsWith(":::transition") || innerLine.startsWith(":::metric") || innerLine.startsWith(":::layout") || innerLine.startsWith(":::badge") && (innerLine.includes("text=") || innerLine.includes("variant=")) || innerLine.startsWith(":::chart") && innerLine.includes("data=");
|
|
481
518
|
if (innerLine.startsWith(":::") && innerLine.length > 3 && !isSingleLine) {
|
|
482
519
|
nestedCount++;
|
|
483
520
|
} else if (innerLine === ":::") {
|
|
@@ -575,9 +612,50 @@ var DefaultYumiaParser = class {
|
|
|
575
612
|
sEl.step = 1;
|
|
576
613
|
elements.push(sEl);
|
|
577
614
|
}
|
|
615
|
+
} else if (directiveName === "math") {
|
|
616
|
+
const expr = blockLines.join("\n").trim();
|
|
617
|
+
const el = createMath(expr, true);
|
|
618
|
+
el.loc = {
|
|
619
|
+
start: { line: directiveStartLine, column: 1 },
|
|
620
|
+
end: { line: baseLine + i - 1, column: 1 }
|
|
621
|
+
};
|
|
622
|
+
elements.push(el);
|
|
578
623
|
}
|
|
579
624
|
continue;
|
|
580
625
|
}
|
|
626
|
+
if (line.startsWith("$$")) {
|
|
627
|
+
flushAll();
|
|
628
|
+
const mathStartLine = currentLineNum;
|
|
629
|
+
if (line.length > 2 && line.endsWith("$$") && line.length > 4) {
|
|
630
|
+
const expr = line.slice(2, -2).trim();
|
|
631
|
+
const el2 = createMath(expr, true);
|
|
632
|
+
el2.loc = {
|
|
633
|
+
start: { line: currentLineNum, column: 1 },
|
|
634
|
+
end: { line: currentLineNum, column: rawLine.length + 1 }
|
|
635
|
+
};
|
|
636
|
+
elements.push(el2);
|
|
637
|
+
i++;
|
|
638
|
+
continue;
|
|
639
|
+
}
|
|
640
|
+
const mathLines = [];
|
|
641
|
+
i++;
|
|
642
|
+
while (i < lines.length) {
|
|
643
|
+
const mLine = lines[i] ?? "";
|
|
644
|
+
if (mLine.trim() === "$$") {
|
|
645
|
+
i++;
|
|
646
|
+
break;
|
|
647
|
+
}
|
|
648
|
+
mathLines.push(mLine);
|
|
649
|
+
i++;
|
|
650
|
+
}
|
|
651
|
+
const el = createMath(mathLines.join("\n").trim(), true);
|
|
652
|
+
el.loc = {
|
|
653
|
+
start: { line: mathStartLine, column: 1 },
|
|
654
|
+
end: { line: baseLine + i - 1, column: 1 }
|
|
655
|
+
};
|
|
656
|
+
elements.push(el);
|
|
657
|
+
continue;
|
|
658
|
+
}
|
|
581
659
|
if (line.startsWith("|") && line.endsWith("|")) {
|
|
582
660
|
const nextLine = lines[i + 1]?.trim() ?? "";
|
|
583
661
|
if (nextLine.startsWith("|") && nextLine.includes("---")) {
|
|
@@ -678,7 +756,8 @@ var DefaultYumiaParser = class {
|
|
|
678
756
|
return {
|
|
679
757
|
elements,
|
|
680
758
|
...notes ? { notes } : {},
|
|
681
|
-
...layout ? { layout } : {}
|
|
759
|
+
...layout ? { layout } : {},
|
|
760
|
+
...transition ? { transition } : {}
|
|
682
761
|
};
|
|
683
762
|
}
|
|
684
763
|
parseColumnsBlock(lines, baseLine) {
|
|
@@ -699,7 +778,7 @@ var DefaultYumiaParser = class {
|
|
|
699
778
|
const innerLine = lines[i]?.trim() ?? "";
|
|
700
779
|
const isInlineClosed = innerLine.startsWith(":::") && innerLine.endsWith(":::") && innerLine.length > 5;
|
|
701
780
|
const isSeparator = innerLine === ":::vs" || innerLine.startsWith(":::vs ");
|
|
702
|
-
const isSingleLine = isInlineClosed || isSeparator || innerLine.startsWith(":::metric") || innerLine.startsWith(":::layout") || innerLine.startsWith(":::badge") && (innerLine.includes("text=") || innerLine.includes("variant=")) || innerLine.startsWith(":::chart") && innerLine.includes("data=");
|
|
781
|
+
const isSingleLine = isInlineClosed || isSeparator || innerLine.startsWith(":::transition") || innerLine.startsWith(":::metric") || innerLine.startsWith(":::layout") || innerLine.startsWith(":::badge") && (innerLine.includes("text=") || innerLine.includes("variant=")) || innerLine.startsWith(":::chart") && innerLine.includes("data=");
|
|
703
782
|
if (innerLine.startsWith(":::") && innerLine.length > 3 && !isSingleLine) {
|
|
704
783
|
nestedCount++;
|
|
705
784
|
} else if (innerLine === ":::") {
|
|
@@ -953,6 +1032,10 @@ var DefaultLayoutEngine = class {
|
|
|
953
1032
|
const height = this.estimateMetricHeight(element);
|
|
954
1033
|
return { element, bounds: { x, y, width, height } };
|
|
955
1034
|
}
|
|
1035
|
+
case "math": {
|
|
1036
|
+
const height = 90;
|
|
1037
|
+
return { element, bounds: { x, y, width, height } };
|
|
1038
|
+
}
|
|
956
1039
|
case "card": {
|
|
957
1040
|
return this.layoutCard(element, x, y, width, gap);
|
|
958
1041
|
}
|
|
@@ -2337,6 +2420,9 @@ var PptxRenderer = class {
|
|
|
2337
2420
|
case "mermaid":
|
|
2338
2421
|
this.renderMermaid(pptxSlide, pptx, element, rect, theme);
|
|
2339
2422
|
break;
|
|
2423
|
+
case "math":
|
|
2424
|
+
this.renderMath(pptxSlide, pptx, element, rect, theme);
|
|
2425
|
+
break;
|
|
2340
2426
|
default:
|
|
2341
2427
|
break;
|
|
2342
2428
|
}
|
|
@@ -2878,6 +2964,48 @@ ${mermaid.code}`, {
|
|
|
2878
2964
|
return 18;
|
|
2879
2965
|
}
|
|
2880
2966
|
}
|
|
2967
|
+
renderMath(pptxSlide, pptx, math, rect, theme) {
|
|
2968
|
+
const surfaceColor = this.cleanHexColor(theme.colors.surface || "11111b");
|
|
2969
|
+
const borderColor = this.cleanHexColor(theme.colors.border || theme.colors.primary);
|
|
2970
|
+
const accentColor = this.cleanHexColor(theme.colors.primary);
|
|
2971
|
+
const textColor = this.cleanHexColor(theme.colors.text || "ffffff");
|
|
2972
|
+
pptxSlide.addShape(pptx.ShapeType.roundRect, {
|
|
2973
|
+
x: rect.x,
|
|
2974
|
+
y: rect.y,
|
|
2975
|
+
w: rect.w,
|
|
2976
|
+
h: rect.h,
|
|
2977
|
+
rectRadius: 0.08,
|
|
2978
|
+
fill: { color: surfaceColor },
|
|
2979
|
+
line: { color: borderColor, width: 1.2 }
|
|
2980
|
+
});
|
|
2981
|
+
pptxSlide.addShape(pptx.ShapeType.rect, {
|
|
2982
|
+
x: rect.x,
|
|
2983
|
+
y: rect.y,
|
|
2984
|
+
w: 0.06,
|
|
2985
|
+
h: rect.h,
|
|
2986
|
+
fill: { color: accentColor },
|
|
2987
|
+
line: { color: accentColor, width: 0 }
|
|
2988
|
+
});
|
|
2989
|
+
pptxSlide.addText([
|
|
2990
|
+
{
|
|
2991
|
+
text: math.expression,
|
|
2992
|
+
options: {
|
|
2993
|
+
fontFace: "Cambria Math",
|
|
2994
|
+
fontSize: 20,
|
|
2995
|
+
color: textColor,
|
|
2996
|
+
italic: true,
|
|
2997
|
+
align: "center",
|
|
2998
|
+
valign: "middle"
|
|
2999
|
+
}
|
|
3000
|
+
}
|
|
3001
|
+
], {
|
|
3002
|
+
x: rect.x + 0.15,
|
|
3003
|
+
y: rect.y,
|
|
3004
|
+
w: Math.max(0.1, rect.w - 0.3),
|
|
3005
|
+
h: rect.h,
|
|
3006
|
+
margin: 0.08
|
|
3007
|
+
});
|
|
3008
|
+
}
|
|
2881
3009
|
isDarkColor(rawHex) {
|
|
2882
3010
|
const hex = this.cleanHexColor(rawHex);
|
|
2883
3011
|
const r = parseInt(hex.substring(0, 2), 16) || 0;
|
|
@@ -3342,7 +3470,7 @@ var HtmlRenderer = class {
|
|
|
3342
3470
|
padding: 6px 14px;
|
|
3343
3471
|
border-radius: 30px;
|
|
3344
3472
|
border: 1px solid rgba(255, 255, 255, 0.15);
|
|
3345
|
-
z-index:
|
|
3473
|
+
z-index: 2500;
|
|
3346
3474
|
font-size: 13px;
|
|
3347
3475
|
color: #e2e8f0;
|
|
3348
3476
|
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
|
|
@@ -3551,6 +3679,55 @@ var HtmlRenderer = class {
|
|
|
3551
3679
|
max-height: 420px;
|
|
3552
3680
|
}
|
|
3553
3681
|
|
|
3682
|
+
/* Math Equation Container */
|
|
3683
|
+
.yumia-math-container {
|
|
3684
|
+
background: var(--yumia-surface);
|
|
3685
|
+
border: 1.5px solid var(--yumia-border);
|
|
3686
|
+
border-left: 4px solid var(--yumia-primary);
|
|
3687
|
+
border-radius: var(--yumia-radius-card);
|
|
3688
|
+
padding: 1.25rem 2rem;
|
|
3689
|
+
margin: 1.2rem 0;
|
|
3690
|
+
display: flex;
|
|
3691
|
+
align-items: center;
|
|
3692
|
+
justify-content: center;
|
|
3693
|
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
|
|
3694
|
+
}
|
|
3695
|
+
|
|
3696
|
+
.yumia-math-equation {
|
|
3697
|
+
font-family: 'Cambria Math', 'JetBrains Mono', monospace;
|
|
3698
|
+
font-size: clamp(1.2rem, 2.2vw, 1.8rem);
|
|
3699
|
+
font-style: italic;
|
|
3700
|
+
color: var(--yumia-text);
|
|
3701
|
+
letter-spacing: 0.05em;
|
|
3702
|
+
}
|
|
3703
|
+
|
|
3704
|
+
/* Slide Transitions */
|
|
3705
|
+
.yumia-slide-wrapper.transition-fade.active {
|
|
3706
|
+
animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
3707
|
+
}
|
|
3708
|
+
.yumia-slide-wrapper.transition-push.active {
|
|
3709
|
+
animation: pushIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
|
|
3710
|
+
}
|
|
3711
|
+
.yumia-slide-wrapper.transition-wipe.active {
|
|
3712
|
+
animation: wipeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
|
|
3713
|
+
}
|
|
3714
|
+
.yumia-slide-wrapper.transition-zoom.active {
|
|
3715
|
+
animation: zoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
|
|
3716
|
+
}
|
|
3717
|
+
|
|
3718
|
+
@keyframes pushIn {
|
|
3719
|
+
from { opacity: 0; transform: translateX(40px); }
|
|
3720
|
+
to { opacity: 1; transform: translateX(0); }
|
|
3721
|
+
}
|
|
3722
|
+
@keyframes wipeIn {
|
|
3723
|
+
from { clip-path: polygon(0 0, 0 0, 0 100%, 0% 100%); }
|
|
3724
|
+
to { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
|
|
3725
|
+
}
|
|
3726
|
+
@keyframes zoomIn {
|
|
3727
|
+
from { opacity: 0; transform: scale(0.92); }
|
|
3728
|
+
to { opacity: 1; transform: scale(1); }
|
|
3729
|
+
}
|
|
3730
|
+
|
|
3554
3731
|
/* Progressive Reveal (Step Builds) */
|
|
3555
3732
|
.yumia-slide-wrapper [data-step] {
|
|
3556
3733
|
transition: opacity 0.25s ease, transform 0.25s ease;
|
|
@@ -3570,11 +3747,11 @@ var HtmlRenderer = class {
|
|
|
3570
3747
|
bottom: 0;
|
|
3571
3748
|
left: 0;
|
|
3572
3749
|
right: 0;
|
|
3573
|
-
max-height:
|
|
3750
|
+
max-height: 260px;
|
|
3574
3751
|
background: rgba(10, 10, 18, 0.96);
|
|
3575
3752
|
backdrop-filter: blur(16px);
|
|
3576
3753
|
border-top: 2px solid var(--yumia-primary);
|
|
3577
|
-
padding: 18px
|
|
3754
|
+
padding: 14px 24px 18px 24px;
|
|
3578
3755
|
overflow-y: auto;
|
|
3579
3756
|
display: none;
|
|
3580
3757
|
z-index: 2000;
|
|
@@ -3588,6 +3765,22 @@ var HtmlRenderer = class {
|
|
|
3588
3765
|
display: block;
|
|
3589
3766
|
}
|
|
3590
3767
|
|
|
3768
|
+
.yumia-notes-header {
|
|
3769
|
+
display: flex;
|
|
3770
|
+
justify-content: space-between;
|
|
3771
|
+
align-items: center;
|
|
3772
|
+
margin-bottom: 8px;
|
|
3773
|
+
padding-bottom: 6px;
|
|
3774
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
|
|
3775
|
+
font-weight: 700;
|
|
3776
|
+
font-size: 14px;
|
|
3777
|
+
color: var(--yumia-primary);
|
|
3778
|
+
}
|
|
3779
|
+
|
|
3780
|
+
.yumia-notes-content {
|
|
3781
|
+
padding-right: 200px;
|
|
3782
|
+
}
|
|
3783
|
+
|
|
3591
3784
|
/* Slide Overview Modal */
|
|
3592
3785
|
.yumia-overview-modal {
|
|
3593
3786
|
position: fixed;
|
|
@@ -3779,7 +3972,13 @@ var HtmlRenderer = class {
|
|
|
3779
3972
|
<button class="yumia-btn" id="btn-fs" title="Fullscreen (F)">\u26F6</button>
|
|
3780
3973
|
</div>
|
|
3781
3974
|
|
|
3782
|
-
<div id="notes-drawer" class="yumia-notes-drawer"
|
|
3975
|
+
<div id="notes-drawer" class="yumia-notes-drawer">
|
|
3976
|
+
<div class="yumia-notes-header">
|
|
3977
|
+
<span>\u{1F4DD} Speaker Notes</span>
|
|
3978
|
+
<button class="yumia-btn" id="btn-close-notes" title="Close Notes (N / ESC)" style="font-size: 13px; padding: 2px 8px; border: 1px solid rgba(255,255,255,0.2);">\u2715 Close</button>
|
|
3979
|
+
</div>
|
|
3980
|
+
<div id="notes-drawer-content" class="yumia-notes-content"></div>
|
|
3981
|
+
</div>
|
|
3783
3982
|
|
|
3784
3983
|
<div id="overview-modal" class="yumia-overview-modal">
|
|
3785
3984
|
<div class="yumia-overview-header">
|
|
@@ -3866,8 +4065,9 @@ var HtmlRenderer = class {
|
|
|
3866
4065
|
|
|
3867
4066
|
const currentSlide = slides[currentIdx];
|
|
3868
4067
|
const notes = currentSlide ? currentSlide.getAttribute('data-notes') : '';
|
|
3869
|
-
|
|
3870
|
-
|
|
4068
|
+
const notesContent = document.getElementById('notes-drawer-content');
|
|
4069
|
+
if (notesContent) {
|
|
4070
|
+
notesContent.innerHTML = notes ? notes : '<em>No speaker notes for this slide.</em>';
|
|
3871
4071
|
}
|
|
3872
4072
|
|
|
3873
4073
|
window.location.hash = '#' + (currentIdx + 1);
|
|
@@ -4052,6 +4252,9 @@ var HtmlRenderer = class {
|
|
|
4052
4252
|
document.getElementById('btn-next')?.addEventListener('click', window.deckController.next);
|
|
4053
4253
|
document.getElementById('btn-prev')?.addEventListener('click', window.deckController.prev);
|
|
4054
4254
|
document.getElementById('btn-notes')?.addEventListener('click', window.deckController.toggleNotes);
|
|
4255
|
+
document.getElementById('btn-close-notes')?.addEventListener('click', () => {
|
|
4256
|
+
notesDrawer?.classList.remove('open');
|
|
4257
|
+
});
|
|
4055
4258
|
document.getElementById('btn-overview')?.addEventListener('click', window.deckController.toggleOverview);
|
|
4056
4259
|
document.getElementById('btn-close-overview')?.addEventListener('click', () => toggleOverview(false));
|
|
4057
4260
|
document.getElementById('btn-speaker')?.addEventListener('click', window.deckController.openSpeaker);
|
|
@@ -4065,6 +4268,13 @@ var HtmlRenderer = class {
|
|
|
4065
4268
|
return;
|
|
4066
4269
|
}
|
|
4067
4270
|
|
|
4271
|
+
if (e.key === 'Escape') {
|
|
4272
|
+
if (notesDrawer && notesDrawer.classList.contains('open')) {
|
|
4273
|
+
notesDrawer.classList.remove('open');
|
|
4274
|
+
return;
|
|
4275
|
+
}
|
|
4276
|
+
}
|
|
4277
|
+
|
|
4068
4278
|
if (e.key === 'ArrowRight' || e.key === ' ' || e.key === 'PageDown' || e.key.toLowerCase() === 'l') {
|
|
4069
4279
|
e.preventDefault();
|
|
4070
4280
|
window.deckController.next();
|
|
@@ -4109,9 +4319,12 @@ var HtmlRenderer = class {
|
|
|
4109
4319
|
const activeClass = slideNum === 1 ? "active" : "";
|
|
4110
4320
|
const notesAttr = slide.notes ? this.escapeHtml(slide.notes.replace(/\n/g, "<br>")) : "";
|
|
4111
4321
|
const progressPercent = Math.round(slideNum / totalSlides * 100);
|
|
4322
|
+
const transition = slide.transition || "fade";
|
|
4323
|
+
const transType = typeof transition === "string" ? transition : transition.type;
|
|
4324
|
+
const transClass = `transition-${transType || "fade"}`;
|
|
4112
4325
|
const elementsHtml = slide.elements.map((el) => this.renderElement(el, theme)).join("\n");
|
|
4113
4326
|
return `
|
|
4114
|
-
<div class="yumia-slide-wrapper ${activeClass}" id="slide-${slideNum}" data-notes="${notesAttr}">
|
|
4327
|
+
<div class="yumia-slide-wrapper ${activeClass} ${transClass}" id="slide-${slideNum}" data-notes="${notesAttr}">
|
|
4115
4328
|
${elementsHtml}
|
|
4116
4329
|
<div class="yumia-progress-bar" style="width: ${progressPercent}%;"></div>
|
|
4117
4330
|
</div>`;
|
|
@@ -4211,6 +4424,13 @@ var HtmlRenderer = class {
|
|
|
4211
4424
|
<pre class="mermaid">${this.escapeHtml(m.code)}</pre>
|
|
4212
4425
|
</div>`;
|
|
4213
4426
|
}
|
|
4427
|
+
case "math": {
|
|
4428
|
+
const mathEl = element;
|
|
4429
|
+
return `
|
|
4430
|
+
<div class="yumia-math-container">
|
|
4431
|
+
<div class="yumia-math-equation">${this.escapeHtml(mathEl.expression)}</div>
|
|
4432
|
+
</div>`;
|
|
4433
|
+
}
|
|
4214
4434
|
case "chart": {
|
|
4215
4435
|
return this.renderChart(element, theme);
|
|
4216
4436
|
}
|
|
@@ -4727,6 +4947,18 @@ var PdfRenderer = class {
|
|
|
4727
4947
|
doc.font("Courier").fontSize(11).fillColor(theme.colors.text).text(this.stripFormatting(m.code), x + 12, y + 12, { width: width - 24 });
|
|
4728
4948
|
return y + boxH + 8;
|
|
4729
4949
|
}
|
|
4950
|
+
case "math": {
|
|
4951
|
+
const mathEl = element;
|
|
4952
|
+
const boxH = 50;
|
|
4953
|
+
doc.roundedRect(x, y, width, boxH, 6).fill(theme.colors.surface || "rgba(255,255,255,0.06)");
|
|
4954
|
+
doc.roundedRect(x, y, width, boxH, 6).lineWidth(1).strokeColor(theme.colors.border || theme.colors.primary).stroke();
|
|
4955
|
+
doc.rect(x, y, 4, boxH).fill(theme.colors.primary);
|
|
4956
|
+
doc.font("Helvetica-Oblique").fontSize(14).fillColor(theme.colors.text).text(this.stripFormatting(mathEl.expression), x + 16, y + 18, {
|
|
4957
|
+
width: width - 32,
|
|
4958
|
+
align: "center"
|
|
4959
|
+
});
|
|
4960
|
+
return y + boxH + 8;
|
|
4961
|
+
}
|
|
4730
4962
|
default:
|
|
4731
4963
|
return y;
|
|
4732
4964
|
}
|
|
@@ -4782,8 +5014,15 @@ function startDevServer(filePath, options = {}) {
|
|
|
4782
5014
|
}
|
|
4783
5015
|
}
|
|
4784
5016
|
const server = createServer(async (req, res) => {
|
|
4785
|
-
const
|
|
4786
|
-
|
|
5017
|
+
const rawUrl = req.url || "/";
|
|
5018
|
+
let pathname = "/";
|
|
5019
|
+
try {
|
|
5020
|
+
const parsed = new URL(rawUrl, `http://localhost:${port}`);
|
|
5021
|
+
pathname = parsed.pathname;
|
|
5022
|
+
} catch {
|
|
5023
|
+
pathname = rawUrl.split("?")[0] || "/";
|
|
5024
|
+
}
|
|
5025
|
+
if (pathname === "/__yumia_live_reload") {
|
|
4787
5026
|
res.writeHead(200, {
|
|
4788
5027
|
"Content-Type": "text/event-stream",
|
|
4789
5028
|
"Cache-Control": "no-cache",
|
|
@@ -4797,7 +5036,7 @@ function startDevServer(filePath, options = {}) {
|
|
|
4797
5036
|
});
|
|
4798
5037
|
return;
|
|
4799
5038
|
}
|
|
4800
|
-
if (
|
|
5039
|
+
if (pathname === "/" || pathname === "/index.html" || pathname.startsWith("/#")) {
|
|
4801
5040
|
const html = await getCompiledHtml();
|
|
4802
5041
|
res.writeHead(200, {
|
|
4803
5042
|
"Content-Type": "text/html; charset=utf-8",
|
|
@@ -4858,7 +5097,7 @@ function startDevServer(filePath, options = {}) {
|
|
|
4858
5097
|
// src/cli.ts
|
|
4859
5098
|
import { mkdirSync, readFileSync as readFileSync2, watch as fsWatch, writeFileSync } from "fs";
|
|
4860
5099
|
import { basename, dirname, extname, join, resolve as resolve2 } from "path";
|
|
4861
|
-
var VERSION = "0.1.
|
|
5100
|
+
var VERSION = "0.1.20";
|
|
4862
5101
|
function printHelp() {
|
|
4863
5102
|
return `
|
|
4864
5103
|
YumiaMD \u2014 Markdown-based presentation compiler (v${VERSION})
|
|
@@ -4884,6 +5123,9 @@ Theming & Color Options:
|
|
|
4884
5123
|
--secondary Hex secondary color (e.g. "#00F0FF")
|
|
4885
5124
|
--text Hex text color (e.g. "#FFFFFF" or "#0F172A")
|
|
4886
5125
|
--accent Hex accent bar & highlight color
|
|
5126
|
+
--transition Default transition: push | fade | wipe | zoom
|
|
5127
|
+
--template, -T Master template file (.potx) or custom layout
|
|
5128
|
+
--embed-fonts Embed custom TrueType fonts in presentation package
|
|
4887
5129
|
|
|
4888
5130
|
Server & Compiler Options:
|
|
4889
5131
|
--port <num> Port for live dev server (default: 3000)
|
|
@@ -5394,6 +5636,7 @@ export {
|
|
|
5394
5636
|
createGroup,
|
|
5395
5637
|
createColumn,
|
|
5396
5638
|
createColumns,
|
|
5639
|
+
createMath,
|
|
5397
5640
|
createLayoutDirective,
|
|
5398
5641
|
DefaultYumiaParser,
|
|
5399
5642
|
parseYumia,
|
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.20";
|
|
13
13
|
declare function printHelp(): string;
|
|
14
14
|
declare function runCli(argv: string[]): Promise<{
|
|
15
15
|
exitCode: number;
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
createImage,
|
|
26
26
|
createLayoutDirective,
|
|
27
27
|
createList,
|
|
28
|
+
createMath,
|
|
28
29
|
createMermaid,
|
|
29
30
|
createMetric,
|
|
30
31
|
createParagraph,
|
|
@@ -47,7 +48,7 @@ import {
|
|
|
47
48
|
startDevServer,
|
|
48
49
|
terminalTheme,
|
|
49
50
|
validate
|
|
50
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-KZLRNRVU.js";
|
|
51
52
|
export {
|
|
52
53
|
DEFAULT_VIEWPORT,
|
|
53
54
|
DefaultLayoutEngine,
|
|
@@ -75,6 +76,7 @@ export {
|
|
|
75
76
|
createImage,
|
|
76
77
|
createLayoutDirective,
|
|
77
78
|
createList,
|
|
79
|
+
createMath,
|
|
78
80
|
createMermaid,
|
|
79
81
|
createMetric,
|
|
80
82
|
createParagraph,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yumiamd",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.20",
|
|
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/ast": "0.1.
|
|
25
|
-
"@yumiamd/
|
|
26
|
-
"@yumiamd/
|
|
27
|
-
"@yumiamd/
|
|
28
|
-
"@yumiamd/
|
|
29
|
-
"@yumiamd/renderer-html": "0.1.
|
|
30
|
-
"@yumiamd/
|
|
31
|
-
"@yumiamd/
|
|
32
|
-
"@yumiamd/renderer-
|
|
24
|
+
"@yumiamd/ast": "0.1.20",
|
|
25
|
+
"@yumiamd/layout": "0.1.20",
|
|
26
|
+
"@yumiamd/core": "0.1.20",
|
|
27
|
+
"@yumiamd/parser": "0.1.20",
|
|
28
|
+
"@yumiamd/renderer": "0.1.20",
|
|
29
|
+
"@yumiamd/renderer-html": "0.1.20",
|
|
30
|
+
"@yumiamd/renderer-pdf": "0.1.20",
|
|
31
|
+
"@yumiamd/theme": "0.1.20",
|
|
32
|
+
"@yumiamd/renderer-pptx": "0.1.20"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"yumia",
|