@thanh01.pmt/presentation-kit 0.2.13 → 0.2.15
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/ai/index.cjs +14 -14
- package/dist/ai/index.js +1 -1
- package/dist/{chunk-53GLUCYC.cjs → chunk-SUGKWGJJ.cjs} +161 -199
- package/dist/chunk-SUGKWGJJ.cjs.map +1 -0
- package/dist/{chunk-3VGV5KYZ.js → chunk-YPYAP4TF.js} +161 -199
- package/dist/chunk-YPYAP4TF.js.map +1 -0
- package/dist/index.cjs +15 -15
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -2
- package/dist/react/index.cjs +43 -24
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +2 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +39 -20
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3VGV5KYZ.js.map +0 -1
- package/dist/chunk-53GLUCYC.cjs.map +0 -1
package/dist/react/index.d.cts
CHANGED
|
@@ -186,6 +186,8 @@ interface HtmlSlideViewerProps {
|
|
|
186
186
|
className?: string;
|
|
187
187
|
/** Callback fired when active slide index changes */
|
|
188
188
|
onSlideChange?: (current: number, total: number) => void;
|
|
189
|
+
/** Callback fired when slide deck is exported or saved from inline editor */
|
|
190
|
+
onSaveHtml?: (savedHtml: string) => void;
|
|
189
191
|
/** Show top control bar */
|
|
190
192
|
showTopBar?: boolean;
|
|
191
193
|
}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -186,6 +186,8 @@ interface HtmlSlideViewerProps {
|
|
|
186
186
|
className?: string;
|
|
187
187
|
/** Callback fired when active slide index changes */
|
|
188
188
|
onSlideChange?: (current: number, total: number) => void;
|
|
189
|
+
/** Callback fired when slide deck is exported or saved from inline editor */
|
|
190
|
+
onSaveHtml?: (savedHtml: string) => void;
|
|
189
191
|
/** Show top control bar */
|
|
190
192
|
showTopBar?: boolean;
|
|
191
193
|
}
|
package/dist/react/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { renderSlide, renderMermaidDiagrams } from '../chunk-NYLDRVHZ.js';
|
|
2
2
|
export { defineTheme, extractMaxClicks, generateClickCss, postprocessClicks, preprocessClicks, renderSlide, renderSlideAsync, resolveTheme } from '../chunk-NYLDRVHZ.js';
|
|
3
|
-
import { SLIDE_LAYOUT_PRESETS, updateSlideLayoutInMarkdown, compileHtmlDeck } from '../chunk-
|
|
3
|
+
import { SLIDE_LAYOUT_PRESETS, updateSlideLayoutInMarkdown, compileHtmlDeck } from '../chunk-YPYAP4TF.js';
|
|
4
4
|
import React2, { useState, useRef, useMemo, useEffect, useCallback } from 'react';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -625,7 +625,10 @@ function PresenterNotesDrawer({
|
|
|
625
625
|
borderRadius: "4px"
|
|
626
626
|
},
|
|
627
627
|
title: "\u0110\xF3ng ghi ch\xFA",
|
|
628
|
-
children: "
|
|
628
|
+
children: /* @__PURE__ */ jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
629
|
+
/* @__PURE__ */ jsx("path", { d: "M18 6 6 18" }),
|
|
630
|
+
/* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })
|
|
631
|
+
] })
|
|
629
632
|
}
|
|
630
633
|
)
|
|
631
634
|
]
|
|
@@ -1602,6 +1605,7 @@ var HtmlSlideViewer = ({
|
|
|
1602
1605
|
title: propTitle,
|
|
1603
1606
|
className = "",
|
|
1604
1607
|
onSlideChange,
|
|
1608
|
+
onSaveHtml,
|
|
1605
1609
|
showTopBar = true
|
|
1606
1610
|
}) => {
|
|
1607
1611
|
const iframeRef = useRef(null);
|
|
@@ -1628,11 +1632,15 @@ var HtmlSlideViewer = ({
|
|
|
1628
1632
|
if (onSlideChange) {
|
|
1629
1633
|
onSlideChange(cur, tot);
|
|
1630
1634
|
}
|
|
1635
|
+
} else if (e.data.type === "SLIDE_HTML_SAVED") {
|
|
1636
|
+
if (onSaveHtml && typeof e.data.html === "string") {
|
|
1637
|
+
onSaveHtml(e.data.html);
|
|
1638
|
+
}
|
|
1631
1639
|
}
|
|
1632
1640
|
};
|
|
1633
1641
|
window.addEventListener("message", handleMessage);
|
|
1634
1642
|
return () => window.removeEventListener("message", handleMessage);
|
|
1635
|
-
}, [onSlideChange]);
|
|
1643
|
+
}, [onSlideChange, onSaveHtml]);
|
|
1636
1644
|
useEffect(() => {
|
|
1637
1645
|
const onFsChange = () => {
|
|
1638
1646
|
setIsFullscreen(Boolean(document.fullscreenElement));
|
|
@@ -1645,6 +1653,14 @@ var HtmlSlideViewer = ({
|
|
|
1645
1653
|
iframeRef.current.contentWindow.postMessage(msg, "*");
|
|
1646
1654
|
}
|
|
1647
1655
|
}, []);
|
|
1656
|
+
useEffect(() => {
|
|
1657
|
+
if (!containerRef.current || typeof ResizeObserver === "undefined") return;
|
|
1658
|
+
const ro = new ResizeObserver(() => {
|
|
1659
|
+
sendIframeMessage({ type: "RESIZE" });
|
|
1660
|
+
});
|
|
1661
|
+
ro.observe(containerRef.current);
|
|
1662
|
+
return () => ro.disconnect();
|
|
1663
|
+
}, [sendIframeMessage]);
|
|
1648
1664
|
const handleNext = () => sendIframeMessage({ type: "NEXT_SLIDE" });
|
|
1649
1665
|
const handlePrev = () => sendIframeMessage({ type: "PREV_SLIDE" });
|
|
1650
1666
|
const handleToggleFullscreen = () => {
|
|
@@ -1673,27 +1689,27 @@ var HtmlSlideViewer = ({
|
|
|
1673
1689
|
"div",
|
|
1674
1690
|
{
|
|
1675
1691
|
ref: containerRef,
|
|
1676
|
-
className: `relative flex flex-col w-full h-full bg-
|
|
1692
|
+
className: `relative flex flex-col w-full h-full bg-card text-txt-pri rounded-xl overflow-hidden border border-border/80 shadow-xs ${className}`,
|
|
1677
1693
|
style: { minHeight: "480px" },
|
|
1678
1694
|
children: [
|
|
1679
|
-
showTopBar && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2 bg-
|
|
1695
|
+
showTopBar && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2 bg-panel/90 backdrop-blur border-b border-border/80 text-meta select-none z-20", children: [
|
|
1680
1696
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 font-medium truncate max-w-md", children: [
|
|
1681
|
-
/* @__PURE__ */ jsx("span", { className: "w-2 h-2 rounded-full bg-
|
|
1682
|
-
/* @__PURE__ */ jsx("span", { className: "truncate text-
|
|
1697
|
+
/* @__PURE__ */ jsx("span", { className: "w-2 h-2 rounded-full bg-primary inline-block shrink-0" }),
|
|
1698
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-txt-pri", children: deckTitle })
|
|
1683
1699
|
] }),
|
|
1684
1700
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1685
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 bg-
|
|
1701
|
+
/* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-1 bg-card px-2 py-0.5 rounded-lg border border-border/80 font-mono text-meta text-txt-sec h-7.5", children: [
|
|
1686
1702
|
/* @__PURE__ */ jsx(
|
|
1687
1703
|
"button",
|
|
1688
1704
|
{
|
|
1689
1705
|
onClick: handlePrev,
|
|
1690
1706
|
disabled: currentSlide <= 0,
|
|
1691
|
-
className: "hover:text-
|
|
1692
|
-
title: "Previous Slide",
|
|
1693
|
-
children: "
|
|
1707
|
+
className: "hover:text-txt-pri disabled:opacity-30 p-1 text-txt-sec cursor-pointer transition-colors flex items-center justify-center rounded",
|
|
1708
|
+
title: "Previous Slide (\u2190)",
|
|
1709
|
+
children: /* @__PURE__ */ jsx("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "15 18 9 12 15 6" }) })
|
|
1694
1710
|
}
|
|
1695
1711
|
),
|
|
1696
|
-
/* @__PURE__ */ jsxs("span", { className: "px-1 font-semibold text-
|
|
1712
|
+
/* @__PURE__ */ jsxs("span", { className: "px-1.5 font-semibold text-txt-pri text-center min-w-[45px]", children: [
|
|
1697
1713
|
String(currentSlide + 1).padStart(2, "0"),
|
|
1698
1714
|
" / ",
|
|
1699
1715
|
String(totalSlides).padStart(2, "0")
|
|
@@ -1703,9 +1719,9 @@ var HtmlSlideViewer = ({
|
|
|
1703
1719
|
{
|
|
1704
1720
|
onClick: handleNext,
|
|
1705
1721
|
disabled: currentSlide >= totalSlides - 1,
|
|
1706
|
-
className: "hover:text-
|
|
1707
|
-
title: "Next Slide",
|
|
1708
|
-
children: "
|
|
1722
|
+
className: "hover:text-txt-pri disabled:opacity-30 p-1 text-txt-sec cursor-pointer transition-colors flex items-center justify-center rounded",
|
|
1723
|
+
title: "Next Slide (\u2192)",
|
|
1724
|
+
children: /* @__PURE__ */ jsx("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "9 18 15 12 9 6" }) })
|
|
1709
1725
|
}
|
|
1710
1726
|
)
|
|
1711
1727
|
] }),
|
|
@@ -1713,10 +1729,10 @@ var HtmlSlideViewer = ({
|
|
|
1713
1729
|
"button",
|
|
1714
1730
|
{
|
|
1715
1731
|
onClick: handleDownloadHtml,
|
|
1716
|
-
className: "flex items-center gap-1 px-2.5
|
|
1732
|
+
className: "flex items-center gap-1.5 h-7.5 px-2.5 rounded-lg bg-panel hover:bg-txt-pri/5 text-txt-pri border border-border/80 text-meta font-medium transition-colors cursor-pointer shadow-2xs leading-none shrink-0",
|
|
1717
1733
|
title: "Download standalone offline HTML file",
|
|
1718
1734
|
children: [
|
|
1719
|
-
/* @__PURE__ */ jsxs("svg", { width: "
|
|
1735
|
+
/* @__PURE__ */ jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1720
1736
|
/* @__PURE__ */ jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
1721
1737
|
/* @__PURE__ */ jsx("polyline", { points: "7 10 12 15 17 10" }),
|
|
1722
1738
|
/* @__PURE__ */ jsx("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
|
|
@@ -1729,9 +1745,9 @@ var HtmlSlideViewer = ({
|
|
|
1729
1745
|
"button",
|
|
1730
1746
|
{
|
|
1731
1747
|
onClick: handleToggleFullscreen,
|
|
1732
|
-
className: "
|
|
1748
|
+
className: "h-7.5 px-2 rounded-lg bg-panel hover:bg-txt-pri/5 text-txt-pri border border-border/80 text-meta transition-colors cursor-pointer shadow-2xs flex items-center justify-center shrink-0",
|
|
1733
1749
|
title: "Toggle Fullscreen (F)",
|
|
1734
|
-
children: /* @__PURE__ */ jsx("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: isFullscreen ? /* @__PURE__ */ jsx("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" }) : /* @__PURE__ */ jsx("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) })
|
|
1750
|
+
children: /* @__PURE__ */ jsx("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: isFullscreen ? /* @__PURE__ */ jsx("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" }) : /* @__PURE__ */ jsx("path", { d: "M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3" }) })
|
|
1735
1751
|
}
|
|
1736
1752
|
)
|
|
1737
1753
|
] })
|
|
@@ -1743,7 +1759,10 @@ var HtmlSlideViewer = ({
|
|
|
1743
1759
|
srcDoc: fullHtml,
|
|
1744
1760
|
title: deckTitle,
|
|
1745
1761
|
sandbox: "allow-scripts allow-same-origin allow-popups allow-forms",
|
|
1746
|
-
className: "w-full h-full border-0 block"
|
|
1762
|
+
className: "w-full h-full border-0 block",
|
|
1763
|
+
onLoad: () => {
|
|
1764
|
+
sendIframeMessage({ type: "RESIZE" });
|
|
1765
|
+
}
|
|
1747
1766
|
}
|
|
1748
1767
|
) : /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center text-neutral-500 text-sm", children: "No slide deck content loaded." }) })
|
|
1749
1768
|
]
|