@thanh01.pmt/presentation-kit 0.2.0 → 0.2.1
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/{chunk-FATGZ25L.js → chunk-PAHIW5IX.js} +643 -3
- package/dist/chunk-PAHIW5IX.js.map +1 -0
- package/dist/{chunk-O4Y3VEOA.cjs → chunk-RJMPTRL3.cjs} +645 -2
- package/dist/chunk-RJMPTRL3.cjs.map +1 -0
- package/dist/index.cjs +50 -38
- package/dist/index.d.cts +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +2 -2
- package/dist/react/index.cjs +38 -12
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +28 -2
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-FATGZ25L.js.map +0 -1
- package/dist/chunk-O4Y3VEOA.cjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -111,6 +111,25 @@ declare function updateSlideLayoutInMarkdown(markdown: string, slideIndex: numbe
|
|
|
111
111
|
*/
|
|
112
112
|
declare function generateLayoutCss(layouts: (SlideLayoutData | null)[], containerId?: string): string;
|
|
113
113
|
|
|
114
|
+
type SlideLayoutCategory = 'cover' | 'content' | 'split' | 'code' | 'metrics' | 'diagram' | 'quote' | 'assessment';
|
|
115
|
+
interface SlideLayoutPreset {
|
|
116
|
+
id: string;
|
|
117
|
+
name: string;
|
|
118
|
+
category: SlideLayoutCategory;
|
|
119
|
+
description: string;
|
|
120
|
+
layout: SlideLayoutData;
|
|
121
|
+
markdownSnippet: string;
|
|
122
|
+
}
|
|
123
|
+
declare const SLIDE_LAYOUT_PRESETS: SlideLayoutPreset[];
|
|
124
|
+
/**
|
|
125
|
+
* Find a preset by its unique ID
|
|
126
|
+
*/
|
|
127
|
+
declare function getSlideLayoutPresetById(id: string): SlideLayoutPreset | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* Filter presets by category
|
|
130
|
+
*/
|
|
131
|
+
declare function getSlideLayoutPresetsByCategory(category: SlideLayoutCategory): SlideLayoutPreset[];
|
|
132
|
+
|
|
114
133
|
interface PptxExportOptions {
|
|
115
134
|
title?: string;
|
|
116
135
|
author?: string;
|
|
@@ -148,4 +167,4 @@ declare function convertTextArrows(text: string): string;
|
|
|
148
167
|
*/
|
|
149
168
|
declare function extractMarpSource(raw: string): string;
|
|
150
169
|
|
|
151
|
-
export { MermaidBlock, type PptxExportOptions, SlideEngine, SlideEngineConfig, SlideLayoutData, ThemeTokens, cleanHexColor, convertMarkdownToPptx, convertTextArrows, createEngine, darkThemeTokens, detectMermaidBlocks, extractLayoutsAndNotes, extractMarpSource, filterPresenterNotes, generateLayoutCss, generateScopedCss as generateScopedCssFromTokens, getHighlighter, highlightCodeBlocks, isLayoutComment, lightThemeTokens, navyThemeTokens, parseFontSizeToPt, parseLayoutFromComment, renderMermaidDiagrams, sanitizeMermaidCode, serializeLayoutToComment, splitMarkdownSlides, updateSlideLayoutInMarkdown };
|
|
170
|
+
export { MermaidBlock, type PptxExportOptions, SLIDE_LAYOUT_PRESETS, SlideEngine, SlideEngineConfig, type SlideLayoutCategory, SlideLayoutData, type SlideLayoutPreset, ThemeTokens, cleanHexColor, convertMarkdownToPptx, convertTextArrows, createEngine, darkThemeTokens, detectMermaidBlocks, extractLayoutsAndNotes, extractMarpSource, filterPresenterNotes, generateLayoutCss, generateScopedCss as generateScopedCssFromTokens, getHighlighter, getSlideLayoutPresetById, getSlideLayoutPresetsByCategory, highlightCodeBlocks, isLayoutComment, lightThemeTokens, navyThemeTokens, parseFontSizeToPt, parseLayoutFromComment, renderMermaidDiagrams, sanitizeMermaidCode, serializeLayoutToComment, splitMarkdownSlides, updateSlideLayoutInMarkdown };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveTheme, generateScopedCss2, renderSlideAsync, renderSlide, splitMarkdownSlides } from './chunk-
|
|
2
|
-
export { convertTextArrows, countSlides, darkThemeTokens, defineTheme, detectMermaidBlocks, extractLayoutsAndNotes, extractMarpSource, extractMaxClicks, filterPresenterNotes, generateClickCss, generateLayoutCss, generateScopedCss2 as generateScopedCss, generateScopedCss as generateScopedCssFromTokens, getHighlighter, getThemeTokens, highlightCodeBlocks, isLayoutComment, lightThemeTokens, navyThemeTokens, parseLayoutFromComment, postprocessClicks, preprocessClicks, renderMarp, renderMermaidDiagrams, renderSlide, renderSlideAsync, resolveTheme, sanitizeMermaidCode, serializeLayoutToComment, splitMarkdownSlides, updateSlideLayoutInMarkdown } from './chunk-
|
|
1
|
+
import { resolveTheme, generateScopedCss2, renderSlideAsync, renderSlide, splitMarkdownSlides } from './chunk-PAHIW5IX.js';
|
|
2
|
+
export { SLIDE_LAYOUT_PRESETS, convertTextArrows, countSlides, darkThemeTokens, defineTheme, detectMermaidBlocks, extractLayoutsAndNotes, extractMarpSource, extractMaxClicks, filterPresenterNotes, generateClickCss, generateLayoutCss, generateScopedCss2 as generateScopedCss, generateScopedCss as generateScopedCssFromTokens, getHighlighter, getSlideLayoutPresetById, getSlideLayoutPresetsByCategory, getThemeTokens, highlightCodeBlocks, isLayoutComment, lightThemeTokens, navyThemeTokens, parseLayoutFromComment, postprocessClicks, preprocessClicks, renderMarp, renderMermaidDiagrams, renderSlide, renderSlideAsync, resolveTheme, sanitizeMermaidCode, serializeLayoutToComment, splitMarkdownSlides, updateSlideLayoutInMarkdown } from './chunk-PAHIW5IX.js';
|
|
3
3
|
|
|
4
4
|
// src/engine.ts
|
|
5
5
|
function createEngine(config = {}) {
|
package/dist/react/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkRJMPTRL3_cjs = require('../chunk-RJMPTRL3.cjs');
|
|
4
4
|
var react = require('react');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
|
|
@@ -20,7 +20,7 @@ function useSlideState(options) {
|
|
|
20
20
|
const result = react.useMemo(() => {
|
|
21
21
|
if (!markdown || !markdown.trim()) return null;
|
|
22
22
|
renderCountRef.current++;
|
|
23
|
-
return
|
|
23
|
+
return chunkRJMPTRL3_cjs.renderSlide(markdown, {
|
|
24
24
|
theme,
|
|
25
25
|
enableMermaid: true,
|
|
26
26
|
enableClicks,
|
|
@@ -760,6 +760,32 @@ function SlideDesignOverlay({
|
|
|
760
760
|
children: "+ \u0110o\u1EA1n v\u0103n (P)"
|
|
761
761
|
}
|
|
762
762
|
),
|
|
763
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
764
|
+
"select",
|
|
765
|
+
{
|
|
766
|
+
onChange: (e) => {
|
|
767
|
+
const preset = chunkRJMPTRL3_cjs.SLIDE_LAYOUT_PRESETS.find((p) => p.id === e.target.value);
|
|
768
|
+
if (preset) {
|
|
769
|
+
const clonedBoxes = JSON.parse(JSON.stringify(preset.layout.boxes));
|
|
770
|
+
setBoxes(clonedBoxes);
|
|
771
|
+
onLayoutChange({ boxes: clonedBoxes });
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
defaultValue: "",
|
|
775
|
+
style: {
|
|
776
|
+
...toolbarButtonStyle,
|
|
777
|
+
cursor: "pointer",
|
|
778
|
+
outline: "none",
|
|
779
|
+
color: "#f8fafc",
|
|
780
|
+
border: "1px solid rgba(56, 189, 248, 0.3)"
|
|
781
|
+
},
|
|
782
|
+
title: "\xC1p d\u1EE5ng m\u1EABu b\u1ED1 c\u1EE5c c\xF3 s\u1EB5n",
|
|
783
|
+
children: [
|
|
784
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, style: { backgroundColor: "#1e1f29", color: "#94a3b8" }, children: "M\u1EABu b\u1ED1 c\u1EE5c (Presets)..." }),
|
|
785
|
+
chunkRJMPTRL3_cjs.SLIDE_LAYOUT_PRESETS.map((p) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: p.id, style: { backgroundColor: "#1e1f29", color: "#f8fafc" }, children: p.name }, p.id))
|
|
786
|
+
]
|
|
787
|
+
}
|
|
788
|
+
),
|
|
763
789
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "1px", height: "16px", backgroundColor: "rgba(255,255,255,0.2)" } }),
|
|
764
790
|
onSave && /* @__PURE__ */ jsxRuntime.jsx(
|
|
765
791
|
"button",
|
|
@@ -1186,7 +1212,7 @@ function SlideViewer({
|
|
|
1186
1212
|
containers.forEach((container) => {
|
|
1187
1213
|
if (container instanceof HTMLElement) {
|
|
1188
1214
|
const themeName2 = typeof theme === "string" ? theme : "dark";
|
|
1189
|
-
|
|
1215
|
+
chunkRJMPTRL3_cjs.renderMermaidDiagrams(container, themeName2).catch(() => {
|
|
1190
1216
|
});
|
|
1191
1217
|
}
|
|
1192
1218
|
});
|
|
@@ -1403,7 +1429,7 @@ function SlideViewer({
|
|
|
1403
1429
|
onSave: (layout) => {
|
|
1404
1430
|
setLiveLayout(layout);
|
|
1405
1431
|
if (onSaveMarkdown) {
|
|
1406
|
-
const updated =
|
|
1432
|
+
const updated = chunkRJMPTRL3_cjs.updateSlideLayoutInMarkdown(markdown, currentIndex, layout);
|
|
1407
1433
|
onSaveMarkdown(updated);
|
|
1408
1434
|
}
|
|
1409
1435
|
},
|
|
@@ -1439,35 +1465,35 @@ function SlideViewer({
|
|
|
1439
1465
|
|
|
1440
1466
|
Object.defineProperty(exports, "defineTheme", {
|
|
1441
1467
|
enumerable: true,
|
|
1442
|
-
get: function () { return
|
|
1468
|
+
get: function () { return chunkRJMPTRL3_cjs.defineTheme; }
|
|
1443
1469
|
});
|
|
1444
1470
|
Object.defineProperty(exports, "extractMaxClicks", {
|
|
1445
1471
|
enumerable: true,
|
|
1446
|
-
get: function () { return
|
|
1472
|
+
get: function () { return chunkRJMPTRL3_cjs.extractMaxClicks; }
|
|
1447
1473
|
});
|
|
1448
1474
|
Object.defineProperty(exports, "generateClickCss", {
|
|
1449
1475
|
enumerable: true,
|
|
1450
|
-
get: function () { return
|
|
1476
|
+
get: function () { return chunkRJMPTRL3_cjs.generateClickCss; }
|
|
1451
1477
|
});
|
|
1452
1478
|
Object.defineProperty(exports, "postprocessClicks", {
|
|
1453
1479
|
enumerable: true,
|
|
1454
|
-
get: function () { return
|
|
1480
|
+
get: function () { return chunkRJMPTRL3_cjs.postprocessClicks; }
|
|
1455
1481
|
});
|
|
1456
1482
|
Object.defineProperty(exports, "preprocessClicks", {
|
|
1457
1483
|
enumerable: true,
|
|
1458
|
-
get: function () { return
|
|
1484
|
+
get: function () { return chunkRJMPTRL3_cjs.preprocessClicks; }
|
|
1459
1485
|
});
|
|
1460
1486
|
Object.defineProperty(exports, "renderSlide", {
|
|
1461
1487
|
enumerable: true,
|
|
1462
|
-
get: function () { return
|
|
1488
|
+
get: function () { return chunkRJMPTRL3_cjs.renderSlide; }
|
|
1463
1489
|
});
|
|
1464
1490
|
Object.defineProperty(exports, "renderSlideAsync", {
|
|
1465
1491
|
enumerable: true,
|
|
1466
|
-
get: function () { return
|
|
1492
|
+
get: function () { return chunkRJMPTRL3_cjs.renderSlideAsync; }
|
|
1467
1493
|
});
|
|
1468
1494
|
Object.defineProperty(exports, "resolveTheme", {
|
|
1469
1495
|
enumerable: true,
|
|
1470
|
-
get: function () { return
|
|
1496
|
+
get: function () { return chunkRJMPTRL3_cjs.resolveTheme; }
|
|
1471
1497
|
});
|
|
1472
1498
|
exports.DeckView = DeckView;
|
|
1473
1499
|
exports.NavigationBar = NavigationBar;
|