@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.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkTGI6YSZP_cjs = require('../chunk-TGI6YSZP.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkSUGKWGJJ_cjs = require('../chunk-SUGKWGJJ.cjs');
|
|
5
5
|
var React2 = require('react');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
|
|
@@ -630,7 +630,10 @@ function PresenterNotesDrawer({
|
|
|
630
630
|
borderRadius: "4px"
|
|
631
631
|
},
|
|
632
632
|
title: "\u0110\xF3ng ghi ch\xFA",
|
|
633
|
-
children: "
|
|
633
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
634
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18 6 6 18" }),
|
|
635
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 6 12 12" })
|
|
636
|
+
] })
|
|
634
637
|
}
|
|
635
638
|
)
|
|
636
639
|
]
|
|
@@ -911,7 +914,7 @@ function SlideDesignOverlay({
|
|
|
911
914
|
"select",
|
|
912
915
|
{
|
|
913
916
|
onChange: (e) => {
|
|
914
|
-
const preset =
|
|
917
|
+
const preset = chunkSUGKWGJJ_cjs.SLIDE_LAYOUT_PRESETS.find((p) => p.id === e.target.value);
|
|
915
918
|
if (preset) {
|
|
916
919
|
const clonedBoxes = JSON.parse(JSON.stringify(preset.layout.boxes));
|
|
917
920
|
setBoxes(clonedBoxes);
|
|
@@ -931,7 +934,7 @@ function SlideDesignOverlay({
|
|
|
931
934
|
title: "\xC1p d\u1EE5ng m\u1EABu b\u1ED1 c\u1EE5c c\xF3 s\u1EB5n",
|
|
932
935
|
children: [
|
|
933
936
|
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, style: { backgroundColor: isLight ? "#ffffff" : "#1e1f29", color: subtextColor }, children: "M\u1EABu b\u1ED1 c\u1EE5c (Presets)..." }),
|
|
934
|
-
|
|
937
|
+
chunkSUGKWGJJ_cjs.SLIDE_LAYOUT_PRESETS.map((p) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: p.id, style: { backgroundColor: isLight ? "#ffffff" : "#1e1f29", color: isLight ? "#0f172a" : "#f8fafc" }, children: p.name }, p.id))
|
|
935
938
|
]
|
|
936
939
|
}
|
|
937
940
|
),
|
|
@@ -1564,7 +1567,7 @@ function SlideViewer({
|
|
|
1564
1567
|
onSave: (layout) => {
|
|
1565
1568
|
setLiveLayout(layout);
|
|
1566
1569
|
if (onSaveMarkdown) {
|
|
1567
|
-
const updated =
|
|
1570
|
+
const updated = chunkSUGKWGJJ_cjs.updateSlideLayoutInMarkdown(markdown, currentIndex, layout);
|
|
1568
1571
|
onSaveMarkdown(updated);
|
|
1569
1572
|
}
|
|
1570
1573
|
},
|
|
@@ -1607,6 +1610,7 @@ var HtmlSlideViewer = ({
|
|
|
1607
1610
|
title: propTitle,
|
|
1608
1611
|
className = "",
|
|
1609
1612
|
onSlideChange,
|
|
1613
|
+
onSaveHtml,
|
|
1610
1614
|
showTopBar = true
|
|
1611
1615
|
}) => {
|
|
1612
1616
|
const iframeRef = React2.useRef(null);
|
|
@@ -1617,7 +1621,7 @@ var HtmlSlideViewer = ({
|
|
|
1617
1621
|
const fullHtml = React2.useMemo(() => {
|
|
1618
1622
|
if (initialHtml) return initialHtml;
|
|
1619
1623
|
if (deckData) {
|
|
1620
|
-
return
|
|
1624
|
+
return chunkSUGKWGJJ_cjs.compileHtmlDeck(deckData).html;
|
|
1621
1625
|
}
|
|
1622
1626
|
return "";
|
|
1623
1627
|
}, [initialHtml, deckData]);
|
|
@@ -1633,11 +1637,15 @@ var HtmlSlideViewer = ({
|
|
|
1633
1637
|
if (onSlideChange) {
|
|
1634
1638
|
onSlideChange(cur, tot);
|
|
1635
1639
|
}
|
|
1640
|
+
} else if (e.data.type === "SLIDE_HTML_SAVED") {
|
|
1641
|
+
if (onSaveHtml && typeof e.data.html === "string") {
|
|
1642
|
+
onSaveHtml(e.data.html);
|
|
1643
|
+
}
|
|
1636
1644
|
}
|
|
1637
1645
|
};
|
|
1638
1646
|
window.addEventListener("message", handleMessage);
|
|
1639
1647
|
return () => window.removeEventListener("message", handleMessage);
|
|
1640
|
-
}, [onSlideChange]);
|
|
1648
|
+
}, [onSlideChange, onSaveHtml]);
|
|
1641
1649
|
React2.useEffect(() => {
|
|
1642
1650
|
const onFsChange = () => {
|
|
1643
1651
|
setIsFullscreen(Boolean(document.fullscreenElement));
|
|
@@ -1650,6 +1658,14 @@ var HtmlSlideViewer = ({
|
|
|
1650
1658
|
iframeRef.current.contentWindow.postMessage(msg, "*");
|
|
1651
1659
|
}
|
|
1652
1660
|
}, []);
|
|
1661
|
+
React2.useEffect(() => {
|
|
1662
|
+
if (!containerRef.current || typeof ResizeObserver === "undefined") return;
|
|
1663
|
+
const ro = new ResizeObserver(() => {
|
|
1664
|
+
sendIframeMessage({ type: "RESIZE" });
|
|
1665
|
+
});
|
|
1666
|
+
ro.observe(containerRef.current);
|
|
1667
|
+
return () => ro.disconnect();
|
|
1668
|
+
}, [sendIframeMessage]);
|
|
1653
1669
|
const handleNext = () => sendIframeMessage({ type: "NEXT_SLIDE" });
|
|
1654
1670
|
const handlePrev = () => sendIframeMessage({ type: "PREV_SLIDE" });
|
|
1655
1671
|
const handleToggleFullscreen = () => {
|
|
@@ -1678,27 +1694,27 @@ var HtmlSlideViewer = ({
|
|
|
1678
1694
|
"div",
|
|
1679
1695
|
{
|
|
1680
1696
|
ref: containerRef,
|
|
1681
|
-
className: `relative flex flex-col w-full h-full bg-
|
|
1697
|
+
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}`,
|
|
1682
1698
|
style: { minHeight: "480px" },
|
|
1683
1699
|
children: [
|
|
1684
|
-
showTopBar && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-4 py-2 bg-
|
|
1700
|
+
showTopBar && /* @__PURE__ */ jsxRuntime.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: [
|
|
1685
1701
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 font-medium truncate max-w-md", children: [
|
|
1686
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-2 h-2 rounded-full bg-
|
|
1687
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-
|
|
1702
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "w-2 h-2 rounded-full bg-primary inline-block shrink-0" }),
|
|
1703
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-txt-pri", children: deckTitle })
|
|
1688
1704
|
] }),
|
|
1689
1705
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1690
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 bg-
|
|
1706
|
+
/* @__PURE__ */ jsxRuntime.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: [
|
|
1691
1707
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1692
1708
|
"button",
|
|
1693
1709
|
{
|
|
1694
1710
|
onClick: handlePrev,
|
|
1695
1711
|
disabled: currentSlide <= 0,
|
|
1696
|
-
className: "hover:text-
|
|
1697
|
-
title: "Previous Slide",
|
|
1698
|
-
children: "
|
|
1712
|
+
className: "hover:text-txt-pri disabled:opacity-30 p-1 text-txt-sec cursor-pointer transition-colors flex items-center justify-center rounded",
|
|
1713
|
+
title: "Previous Slide (\u2190)",
|
|
1714
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "15 18 9 12 15 6" }) })
|
|
1699
1715
|
}
|
|
1700
1716
|
),
|
|
1701
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-1 font-semibold text-
|
|
1717
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "px-1.5 font-semibold text-txt-pri text-center min-w-[45px]", children: [
|
|
1702
1718
|
String(currentSlide + 1).padStart(2, "0"),
|
|
1703
1719
|
" / ",
|
|
1704
1720
|
String(totalSlides).padStart(2, "0")
|
|
@@ -1708,9 +1724,9 @@ var HtmlSlideViewer = ({
|
|
|
1708
1724
|
{
|
|
1709
1725
|
onClick: handleNext,
|
|
1710
1726
|
disabled: currentSlide >= totalSlides - 1,
|
|
1711
|
-
className: "hover:text-
|
|
1712
|
-
title: "Next Slide",
|
|
1713
|
-
children: "
|
|
1727
|
+
className: "hover:text-txt-pri disabled:opacity-30 p-1 text-txt-sec cursor-pointer transition-colors flex items-center justify-center rounded",
|
|
1728
|
+
title: "Next Slide (\u2192)",
|
|
1729
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "9 18 15 12 9 6" }) })
|
|
1714
1730
|
}
|
|
1715
1731
|
)
|
|
1716
1732
|
] }),
|
|
@@ -1718,10 +1734,10 @@ var HtmlSlideViewer = ({
|
|
|
1718
1734
|
"button",
|
|
1719
1735
|
{
|
|
1720
1736
|
onClick: handleDownloadHtml,
|
|
1721
|
-
className: "flex items-center gap-1 px-2.5
|
|
1737
|
+
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",
|
|
1722
1738
|
title: "Download standalone offline HTML file",
|
|
1723
1739
|
children: [
|
|
1724
|
-
/* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "
|
|
1740
|
+
/* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
1725
1741
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
1726
1742
|
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "7 10 12 15 17 10" }),
|
|
1727
1743
|
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "15", x2: "12", y2: "3" })
|
|
@@ -1734,9 +1750,9 @@ var HtmlSlideViewer = ({
|
|
|
1734
1750
|
"button",
|
|
1735
1751
|
{
|
|
1736
1752
|
onClick: handleToggleFullscreen,
|
|
1737
|
-
className: "
|
|
1753
|
+
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",
|
|
1738
1754
|
title: "Toggle Fullscreen (F)",
|
|
1739
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: isFullscreen ? /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.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" }) })
|
|
1755
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: isFullscreen ? /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.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" }) })
|
|
1740
1756
|
}
|
|
1741
1757
|
)
|
|
1742
1758
|
] })
|
|
@@ -1748,7 +1764,10 @@ var HtmlSlideViewer = ({
|
|
|
1748
1764
|
srcDoc: fullHtml,
|
|
1749
1765
|
title: deckTitle,
|
|
1750
1766
|
sandbox: "allow-scripts allow-same-origin allow-popups allow-forms",
|
|
1751
|
-
className: "w-full h-full border-0 block"
|
|
1767
|
+
className: "w-full h-full border-0 block",
|
|
1768
|
+
onLoad: () => {
|
|
1769
|
+
sendIframeMessage({ type: "RESIZE" });
|
|
1770
|
+
}
|
|
1752
1771
|
}
|
|
1753
1772
|
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full h-full flex items-center justify-center text-neutral-500 text-sm", children: "No slide deck content loaded." }) })
|
|
1754
1773
|
]
|