themed-markdown 0.1.13 → 0.1.14
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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +63 -122
- package/dist/industryMarkdown/components/SlidePresentationWithThemeSwitcher.stories.d.ts +8 -0
- package/dist/industryMarkdown/components/SlidePresentationWithThemeSwitcher.stories.d.ts.map +1 -0
- package/dist/industryMarkdown/index.d.ts +1 -1
- package/dist/industryMarkdown/index.d.ts.map +1 -1
- package/dist/industryTheme/ThemeProvider.d.ts +0 -5
- package/dist/industryTheme/ThemeProvider.d.ts.map +1 -1
- package/dist/industryTheme/index.d.ts +1 -26
- package/dist/industryTheme/index.d.ts.map +1 -1
- package/dist/industryTheme/utils.d.ts.map +1 -1
- package/package.json +4 -5
- package/dist/index.js +0 -3804
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ export type { MarkdownPresentation, MarkdownSlide, MarkdownPresentationFormat, M
|
|
|
18
18
|
export type { ContentChunk, MarkdownChunk, MermaidChunk, CodeChunk, } from './industryMarkdown/types/customMarkdownChunks';
|
|
19
19
|
export type { Theme } from './industryTheme';
|
|
20
20
|
export { theme as defaultTheme } from './industryTheme';
|
|
21
|
-
export { ThemeProvider, useTheme,
|
|
21
|
+
export { ThemeProvider, useTheme, withTheme } from './industryTheme/ThemeProvider';
|
|
22
22
|
export { scaleThemeFonts, increaseFontScale, decreaseFontScale, resetFontScale } from './industryTheme';
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,YAAY,EAAE,0BAA0B,EAAE,MAAM,qDAAqD,CAAC;AAEtG,OAAO,EAAE,iBA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1B,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,qBAAqB,GACtB,MAAM,uCAAuC,CAAC;AAE/C,YAAY,EACV,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,SAAS,GACV,MAAM,+CAA+C,CAAC;AAGvD,YAAY,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EACL,aAAa,EACb,QAAQ,EACR,SAAS,EACV,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACf,MAAM,iBAAiB,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// industryMarkdown/components/IndustryMarkdownSlide.tsx
|
|
2
2
|
import { defaultSchema } from "hast-util-sanitize";
|
|
3
|
-
import React11, { useRef as useRef7, useEffect as
|
|
3
|
+
import React11, { useRef as useRef7, useEffect as useEffect6, useState as useState8, useMemo as useMemo2, useCallback } from "react";
|
|
4
4
|
import ReactMarkdown from "react-markdown";
|
|
5
5
|
import rehypeHighlight from "rehype-highlight";
|
|
6
6
|
import rehypeRaw from "rehype-raw";
|
|
@@ -9,7 +9,7 @@ import rehypeSlug from "rehype-slug";
|
|
|
9
9
|
import remarkGfm from "remark-gfm";
|
|
10
10
|
|
|
11
11
|
// industryTheme/ThemeProvider.tsx
|
|
12
|
-
import React, { createContext, useContext
|
|
12
|
+
import React, { createContext, useContext } from "react";
|
|
13
13
|
var ThemeContext;
|
|
14
14
|
var getThemeContext = () => {
|
|
15
15
|
if (typeof window !== "undefined") {
|
|
@@ -33,46 +33,12 @@ var useTheme = () => {
|
|
|
33
33
|
}
|
|
34
34
|
return context;
|
|
35
35
|
};
|
|
36
|
-
var getThemeWithMode = (baseTheme, colorMode) => {
|
|
37
|
-
if (colorMode === "light") {
|
|
38
|
-
return baseTheme;
|
|
39
|
-
}
|
|
40
|
-
const darkModeColors = baseTheme.colors.modes.dark;
|
|
41
|
-
return {
|
|
42
|
-
...baseTheme,
|
|
43
|
-
colors: {
|
|
44
|
-
...baseTheme.colors,
|
|
45
|
-
...darkModeColors
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
36
|
var ThemeProvider = ({
|
|
50
37
|
children,
|
|
51
|
-
theme: customTheme = theme
|
|
52
|
-
initialColorMode = "dark"
|
|
38
|
+
theme: customTheme = theme
|
|
53
39
|
}) => {
|
|
54
|
-
const [colorMode, setColorMode] = useState(initialColorMode);
|
|
55
|
-
useEffect(() => {
|
|
56
|
-
const savedMode = localStorage.getItem("principlemd-color-mode");
|
|
57
|
-
if (savedMode === "light" || savedMode === "dark") {
|
|
58
|
-
setColorMode(savedMode);
|
|
59
|
-
} else {
|
|
60
|
-
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
61
|
-
setColorMode(prefersDark ? "dark" : "light");
|
|
62
|
-
}
|
|
63
|
-
}, []);
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
localStorage.setItem("principlemd-color-mode", colorMode);
|
|
66
|
-
}, [colorMode]);
|
|
67
|
-
const toggleColorMode = () => {
|
|
68
|
-
setColorMode((prev) => prev === "light" ? "dark" : "light");
|
|
69
|
-
};
|
|
70
|
-
const themeWithMode = getThemeWithMode(customTheme, colorMode);
|
|
71
40
|
const value = {
|
|
72
|
-
theme:
|
|
73
|
-
colorMode,
|
|
74
|
-
setColorMode,
|
|
75
|
-
toggleColorMode
|
|
41
|
+
theme: customTheme
|
|
76
42
|
};
|
|
77
43
|
return /* @__PURE__ */ React.createElement(ThemeContextSingleton.Provider, {
|
|
78
44
|
value
|
|
@@ -144,31 +110,7 @@ var theme = {
|
|
|
144
110
|
surface: "#212738",
|
|
145
111
|
textSecondary: "#c9b8a3",
|
|
146
112
|
textTertiary: "#8b7968",
|
|
147
|
-
textMuted: "#8b7968"
|
|
148
|
-
modes: {
|
|
149
|
-
dark: {
|
|
150
|
-
text: "#f1e8dc",
|
|
151
|
-
background: "#1a1f2e",
|
|
152
|
-
primary: "#d4a574",
|
|
153
|
-
secondary: "#e0b584",
|
|
154
|
-
accent: "#c9b8a3",
|
|
155
|
-
highlight: "rgba(212, 165, 116, 0.15)",
|
|
156
|
-
muted: "#8b7968",
|
|
157
|
-
success: "#5c8a72",
|
|
158
|
-
warning: "#d4a574",
|
|
159
|
-
error: "#a85751",
|
|
160
|
-
info: "#d4a574",
|
|
161
|
-
border: "rgba(212, 165, 116, 0.2)",
|
|
162
|
-
backgroundSecondary: "#212738",
|
|
163
|
-
backgroundTertiary: "#2d3446",
|
|
164
|
-
backgroundLight: "rgba(212, 165, 116, 0.08)",
|
|
165
|
-
backgroundHover: "rgba(212, 165, 116, 0.15)",
|
|
166
|
-
surface: "#212738",
|
|
167
|
-
textSecondary: "#c9b8a3",
|
|
168
|
-
textTertiary: "#8b7968",
|
|
169
|
-
textMuted: "#8b7968"
|
|
170
|
-
}
|
|
171
|
-
}
|
|
113
|
+
textMuted: "#8b7968"
|
|
172
114
|
},
|
|
173
115
|
buttons: {
|
|
174
116
|
primary: {
|
|
@@ -323,10 +265,10 @@ function parseMarkdownChunks(markdownContent, idPrefix) {
|
|
|
323
265
|
}
|
|
324
266
|
|
|
325
267
|
// industryMarkdown/components/IndustryHtmlModal.tsx
|
|
326
|
-
import React2, { useState
|
|
268
|
+
import React2, { useState } from "react";
|
|
327
269
|
var useIndustryHtmlModal = () => {
|
|
328
|
-
const [htmlModalOpen, setHtmlModalOpen] =
|
|
329
|
-
const [htmlModalContent, setHtmlModalContent] =
|
|
270
|
+
const [htmlModalOpen, setHtmlModalOpen] = useState(false);
|
|
271
|
+
const [htmlModalContent, setHtmlModalContent] = useState("");
|
|
330
272
|
const openHtmlModal = (content) => {
|
|
331
273
|
setHtmlModalContent(content);
|
|
332
274
|
setHtmlModalOpen(true);
|
|
@@ -437,11 +379,11 @@ function IndustryHtmlModal({ isOpen, onClose, htmlContent, theme: theme2 }) {
|
|
|
437
379
|
|
|
438
380
|
// industryMarkdown/components/IndustryLazyMermaidDiagram.tsx
|
|
439
381
|
import { MoveRight } from "lucide-react";
|
|
440
|
-
import React4, { useEffect as
|
|
382
|
+
import React4, { useEffect as useEffect2, useRef as useRef2, useState as useState3 } from "react";
|
|
441
383
|
|
|
442
384
|
// industryMarkdown/components/IndustryMermaidDiagram.tsx
|
|
443
385
|
import { ZoomIn, ZoomOut, RotateCcw } from "lucide-react";
|
|
444
|
-
import React3, { useEffect
|
|
386
|
+
import React3, { useEffect, useRef, useState as useState2 } from "react";
|
|
445
387
|
var getMermaidSync = () => {
|
|
446
388
|
if (typeof window !== "undefined") {
|
|
447
389
|
const mermaid = window.mermaid;
|
|
@@ -461,11 +403,11 @@ function IndustryMermaidDiagram({
|
|
|
461
403
|
isModalMode = false
|
|
462
404
|
}) {
|
|
463
405
|
const theme2 = themeOverride || theme;
|
|
464
|
-
const [errorDetails, setErrorDetails] =
|
|
465
|
-
const [isIntersecting, setIsIntersecting] =
|
|
466
|
-
const [hasRendered, setHasRendered] =
|
|
467
|
-
const [containerElement, setContainerElement] =
|
|
468
|
-
const [zoomLevel, setZoomLevel] =
|
|
406
|
+
const [errorDetails, setErrorDetails] = useState2(null);
|
|
407
|
+
const [isIntersecting, setIsIntersecting] = useState2(false);
|
|
408
|
+
const [hasRendered, setHasRendered] = useState2(false);
|
|
409
|
+
const [containerElement, setContainerElement] = useState2(null);
|
|
410
|
+
const [zoomLevel, setZoomLevel] = useState2(1);
|
|
469
411
|
const observerRef = useRef(null);
|
|
470
412
|
const containerRef = React3.useCallback((node) => {
|
|
471
413
|
setContainerElement(node);
|
|
@@ -491,14 +433,14 @@ function IndustryMermaidDiagram({
|
|
|
491
433
|
observerRef.current.observe(node);
|
|
492
434
|
}
|
|
493
435
|
}, [rootMargin, hasRendered, isModalMode]);
|
|
494
|
-
|
|
436
|
+
useEffect(() => {
|
|
495
437
|
return () => {
|
|
496
438
|
if (observerRef.current) {
|
|
497
439
|
observerRef.current.disconnect();
|
|
498
440
|
}
|
|
499
441
|
};
|
|
500
442
|
}, []);
|
|
501
|
-
|
|
443
|
+
useEffect(() => {
|
|
502
444
|
if (!hasRendered)
|
|
503
445
|
return;
|
|
504
446
|
const renderDiagram = async () => {
|
|
@@ -602,7 +544,7 @@ function IndustryMermaidDiagram({
|
|
|
602
544
|
};
|
|
603
545
|
renderDiagram();
|
|
604
546
|
}, [hasRendered, code, id, theme2, containerElement, onError, isModalMode]);
|
|
605
|
-
|
|
547
|
+
useEffect(() => {
|
|
606
548
|
if (!containerElement || !hasRendered)
|
|
607
549
|
return;
|
|
608
550
|
const svgElement = containerElement.querySelector("svg");
|
|
@@ -627,7 +569,7 @@ function IndustryMermaidDiagram({
|
|
|
627
569
|
}
|
|
628
570
|
}
|
|
629
571
|
}, [zoomLevel, containerElement, hasRendered, isModalMode]);
|
|
630
|
-
|
|
572
|
+
useEffect(() => {
|
|
631
573
|
if (errorDetails && onCopyError) {
|
|
632
574
|
const handleKeyDown = (e) => {
|
|
633
575
|
if ((e.ctrlKey || e.metaKey) && e.key === "c" && window.getSelection()?.toString()) {
|
|
@@ -773,15 +715,15 @@ function IndustryLazyMermaidDiagram({
|
|
|
773
715
|
onShowInPanel,
|
|
774
716
|
theme: theme2 = theme
|
|
775
717
|
}) {
|
|
776
|
-
const [isIntersecting, setIsIntersecting] =
|
|
777
|
-
const [hasRendered, setHasRendered] =
|
|
778
|
-
const [isMounted, setIsMounted] =
|
|
779
|
-
const [hasError, setHasError] =
|
|
718
|
+
const [isIntersecting, setIsIntersecting] = useState3(false);
|
|
719
|
+
const [hasRendered, setHasRendered] = useState3(false);
|
|
720
|
+
const [isMounted, setIsMounted] = useState3(false);
|
|
721
|
+
const [hasError, setHasError] = useState3(false);
|
|
780
722
|
const containerRef = useRef2(null);
|
|
781
|
-
|
|
723
|
+
useEffect2(() => {
|
|
782
724
|
setIsMounted(true);
|
|
783
725
|
}, []);
|
|
784
|
-
|
|
726
|
+
useEffect2(() => {
|
|
785
727
|
if (!isMounted)
|
|
786
728
|
return;
|
|
787
729
|
if (typeof IntersectionObserver === "undefined") {
|
|
@@ -901,7 +843,7 @@ function IndustryLazyMermaidDiagram({
|
|
|
901
843
|
|
|
902
844
|
// industryMarkdown/components/IndustryMarkdownComponents.tsx
|
|
903
845
|
import { Copy, Monitor, FileText, Check } from "lucide-react";
|
|
904
|
-
import React7, { useMemo, useState as
|
|
846
|
+
import React7, { useMemo, useState as useState5, useRef as useRef4 } from "react";
|
|
905
847
|
|
|
906
848
|
// industryMarkdown/utils/bashCommandParser.ts
|
|
907
849
|
function parseBashCommands(codeString) {
|
|
@@ -1054,7 +996,7 @@ function transformImageUrl(src, repositoryInfo) {
|
|
|
1054
996
|
|
|
1055
997
|
// industryMarkdown/components/IndustryBashCommandDropdown.tsx
|
|
1056
998
|
import { Play, ChevronDown } from "lucide-react";
|
|
1057
|
-
import React6, { useState as
|
|
999
|
+
import React6, { useState as useState4, useRef as useRef3, useEffect as useEffect3 } from "react";
|
|
1058
1000
|
var IndustryBashCommandDropdown = ({
|
|
1059
1001
|
commands,
|
|
1060
1002
|
allCommands,
|
|
@@ -1063,12 +1005,12 @@ var IndustryBashCommandDropdown = ({
|
|
|
1063
1005
|
slideIdPrefix: _slideIdPrefix,
|
|
1064
1006
|
theme: themeOverride
|
|
1065
1007
|
}) => {
|
|
1066
|
-
const [isOpen, setIsOpen] =
|
|
1067
|
-
const [isRunning, setIsRunning] =
|
|
1008
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
1009
|
+
const [isRunning, setIsRunning] = useState4(false);
|
|
1068
1010
|
const dropdownRef = useRef3(null);
|
|
1069
1011
|
const { theme: contextTheme } = useTheme();
|
|
1070
1012
|
const theme2 = themeOverride || contextTheme;
|
|
1071
|
-
|
|
1013
|
+
useEffect3(() => {
|
|
1072
1014
|
const handleClickOutside = (event) => {
|
|
1073
1015
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
1074
1016
|
setIsOpen(false);
|
|
@@ -1187,7 +1129,7 @@ var IndustryBashCommandDropdown = ({
|
|
|
1187
1129
|
e.currentTarget.style.backgroundColor = theme2.colors.muted;
|
|
1188
1130
|
}
|
|
1189
1131
|
}, "\uD83D\uDE80 Run all (", commands.length, " commands)"), commands.map((cmd, index) => {
|
|
1190
|
-
const [isHovered, setIsHovered] =
|
|
1132
|
+
const [isHovered, setIsHovered] = useState4(false);
|
|
1191
1133
|
return /* @__PURE__ */ React6.createElement("div", {
|
|
1192
1134
|
key: index,
|
|
1193
1135
|
style: dropdownItemStyle(isHovered),
|
|
@@ -1229,7 +1171,7 @@ var OptimizedMarkdownImage = React7.memo(({
|
|
|
1229
1171
|
const transformedSrc = useMemo(() => {
|
|
1230
1172
|
return transformImageUrl(src, repositoryInfo);
|
|
1231
1173
|
}, [src, repositoryInfo]);
|
|
1232
|
-
const [hasErrored, setHasErrored] =
|
|
1174
|
+
const [hasErrored, setHasErrored] = useState5(() => failedImageCache.has(transformedSrc));
|
|
1233
1175
|
const retryCount = useRef4(0);
|
|
1234
1176
|
const imageStyle = useMemo(() => ({
|
|
1235
1177
|
maxWidth: "100%",
|
|
@@ -1532,7 +1474,7 @@ var createIndustryMarkdownComponents = ({
|
|
|
1532
1474
|
const codeString = extractTextFromChildren(children);
|
|
1533
1475
|
const matchLang = /language-(\w+)/.exec(className || "");
|
|
1534
1476
|
const language = matchLang ? matchLang[1] : null;
|
|
1535
|
-
const [copied, setCopied] =
|
|
1477
|
+
const [copied, setCopied] = useState5(false);
|
|
1536
1478
|
let isInline;
|
|
1537
1479
|
let isCodeBlock;
|
|
1538
1480
|
const hasNewlines = codeString.includes(`
|
|
@@ -1756,11 +1698,11 @@ var createIndustryMarkdownComponents = ({
|
|
|
1756
1698
|
};
|
|
1757
1699
|
|
|
1758
1700
|
// industryMarkdown/components/IndustryMermaidModal.tsx
|
|
1759
|
-
import React9, { useEffect as
|
|
1701
|
+
import React9, { useEffect as useEffect5, useRef as useRef6 } from "react";
|
|
1760
1702
|
import ReactDOM from "react-dom";
|
|
1761
1703
|
|
|
1762
1704
|
// industryMarkdown/components/IndustryZoomableMermaidDiagram.tsx
|
|
1763
|
-
import React8, { useEffect as
|
|
1705
|
+
import React8, { useEffect as useEffect4, useRef as useRef5, useState as useState6 } from "react";
|
|
1764
1706
|
import { TransformWrapper, TransformComponent } from "react-zoom-pan-pinch";
|
|
1765
1707
|
function IndustryZoomableMermaidDiagram({
|
|
1766
1708
|
code,
|
|
@@ -1771,11 +1713,11 @@ function IndustryZoomableMermaidDiagram({
|
|
|
1771
1713
|
}) {
|
|
1772
1714
|
const { theme: contextTheme } = useTheme();
|
|
1773
1715
|
const theme2 = themeOverride || contextTheme;
|
|
1774
|
-
const [calculatedScale, setCalculatedScale] =
|
|
1716
|
+
const [calculatedScale, setCalculatedScale] = useState6(0.8);
|
|
1775
1717
|
const containerRef = useRef5(null);
|
|
1776
1718
|
const diagramRef = useRef5(null);
|
|
1777
|
-
const [isCalculating, setIsCalculating] =
|
|
1778
|
-
|
|
1719
|
+
const [isCalculating, setIsCalculating] = useState6(true);
|
|
1720
|
+
useEffect4(() => {
|
|
1779
1721
|
if (!containerRef.current || !diagramRef.current)
|
|
1780
1722
|
return;
|
|
1781
1723
|
const calculateOptimalScale = () => {
|
|
@@ -1949,7 +1891,7 @@ function IndustryMermaidModal({
|
|
|
1949
1891
|
theme: theme2
|
|
1950
1892
|
}) {
|
|
1951
1893
|
const modalRef = useRef6(null);
|
|
1952
|
-
|
|
1894
|
+
useEffect5(() => {
|
|
1953
1895
|
const handleEscape = (event) => {
|
|
1954
1896
|
if (event.key === "Escape") {
|
|
1955
1897
|
onClose();
|
|
@@ -2041,7 +1983,7 @@ function IndustryMermaidModal({
|
|
|
2041
1983
|
}
|
|
2042
1984
|
|
|
2043
1985
|
// industryMarkdown/components/IndustryPlaceholderModal.tsx
|
|
2044
|
-
import React10, { useState as
|
|
1986
|
+
import React10, { useState as useState7 } from "react";
|
|
2045
1987
|
function IndustryPlaceholderModal({
|
|
2046
1988
|
isOpen,
|
|
2047
1989
|
onClose,
|
|
@@ -2050,7 +1992,7 @@ function IndustryPlaceholderModal({
|
|
|
2050
1992
|
onCopy,
|
|
2051
1993
|
theme: theme2
|
|
2052
1994
|
}) {
|
|
2053
|
-
const [values, setValues] =
|
|
1995
|
+
const [values, setValues] = useState7({});
|
|
2054
1996
|
if (!isOpen)
|
|
2055
1997
|
return null;
|
|
2056
1998
|
const handleSubmit = (e) => {
|
|
@@ -2376,7 +2318,7 @@ var IndustryMarkdownSlide = React11.memo(function IndustryMarkdownSlide2({
|
|
|
2376
2318
|
}) {
|
|
2377
2319
|
const slideRef = useRef7(null);
|
|
2378
2320
|
const scrollPositionRef = useRef7(0);
|
|
2379
|
-
const [measuredContainerWidth, setMeasuredContainerWidth] =
|
|
2321
|
+
const [measuredContainerWidth, setMeasuredContainerWidth] = useState8(null);
|
|
2380
2322
|
let chunks = [];
|
|
2381
2323
|
try {
|
|
2382
2324
|
if (typeof content === "string") {
|
|
@@ -2385,16 +2327,16 @@ var IndustryMarkdownSlide = React11.memo(function IndustryMarkdownSlide2({
|
|
|
2385
2327
|
} catch (error) {
|
|
2386
2328
|
console.error("Error parsing markdown chunks:", error);
|
|
2387
2329
|
}
|
|
2388
|
-
const [checkedItems, setCheckedItems] =
|
|
2330
|
+
const [checkedItems, setCheckedItems] = useState8({});
|
|
2389
2331
|
const { htmlModalOpen, htmlModalContent, openHtmlModal, closeHtmlModal } = useIndustryHtmlModal();
|
|
2390
|
-
const [mermaidModalOpen, setMermaidModalOpen] =
|
|
2391
|
-
const [mermaidModalCode, setMermaidModalCode] =
|
|
2392
|
-
const [placeholderModalOpen, setPlaceholderModalOpen] =
|
|
2393
|
-
const [placeholderModalData, setPlaceholderModalData] =
|
|
2394
|
-
|
|
2332
|
+
const [mermaidModalOpen, setMermaidModalOpen] = useState8(false);
|
|
2333
|
+
const [mermaidModalCode, setMermaidModalCode] = useState8("");
|
|
2334
|
+
const [placeholderModalOpen, setPlaceholderModalOpen] = useState8(false);
|
|
2335
|
+
const [placeholderModalData, setPlaceholderModalData] = useState8(null);
|
|
2336
|
+
useEffect6(() => {
|
|
2395
2337
|
injectStyles();
|
|
2396
2338
|
}, []);
|
|
2397
|
-
|
|
2339
|
+
useEffect6(() => {
|
|
2398
2340
|
if (containerWidth !== undefined) {
|
|
2399
2341
|
return;
|
|
2400
2342
|
}
|
|
@@ -2563,7 +2505,7 @@ var IndustryMarkdownSlide = React11.memo(function IndustryMarkdownSlide2({
|
|
|
2563
2505
|
}, scrollConfig.smoothScroll ? 100 : 0);
|
|
2564
2506
|
}
|
|
2565
2507
|
}, [enableKeyboardScrolling, isVisible, slideIndex, scrollConfig]);
|
|
2566
|
-
|
|
2508
|
+
useEffect6(() => {
|
|
2567
2509
|
if (isVisible && slideRef.current) {
|
|
2568
2510
|
console.log("\uD83C\uDFAF Auto-focusing slide container");
|
|
2569
2511
|
slideRef.current.focus();
|
|
@@ -2613,7 +2555,7 @@ var IndustryMarkdownSlide = React11.memo(function IndustryMarkdownSlide2({
|
|
|
2613
2555
|
};
|
|
2614
2556
|
return result;
|
|
2615
2557
|
}, [containerWidth, measuredContainerWidth]);
|
|
2616
|
-
|
|
2558
|
+
useEffect6(() => {
|
|
2617
2559
|
const slideElement = slideRef.current;
|
|
2618
2560
|
if (slideElement) {
|
|
2619
2561
|
const handleScroll = () => {
|
|
@@ -2626,7 +2568,7 @@ var IndustryMarkdownSlide = React11.memo(function IndustryMarkdownSlide2({
|
|
|
2626
2568
|
}
|
|
2627
2569
|
return;
|
|
2628
2570
|
}, []);
|
|
2629
|
-
|
|
2571
|
+
useEffect6(() => {
|
|
2630
2572
|
if (slideRef.current && scrollPositionRef.current) {
|
|
2631
2573
|
slideRef.current.scrollTop = scrollPositionRef.current;
|
|
2632
2574
|
}
|
|
@@ -2797,7 +2739,7 @@ var IndustryMarkdownSlide = React11.memo(function IndustryMarkdownSlide2({
|
|
|
2797
2739
|
});
|
|
2798
2740
|
// industryMarkdown/components/SlidePresentation.tsx
|
|
2799
2741
|
import { ChevronLeft, ChevronRight, Maximize2, Minimize2 } from "lucide-react";
|
|
2800
|
-
import React12, { useState as
|
|
2742
|
+
import React12, { useState as useState9, useCallback as useCallback2, useRef as useRef8, useEffect as useEffect7 } from "react";
|
|
2801
2743
|
var SlidePresentation = ({
|
|
2802
2744
|
slides,
|
|
2803
2745
|
initialSlide = 0,
|
|
@@ -2815,8 +2757,8 @@ var SlidePresentation = ({
|
|
|
2815
2757
|
handlePromptCopy,
|
|
2816
2758
|
fontSizeScale
|
|
2817
2759
|
}) => {
|
|
2818
|
-
const [currentSlide, setCurrentSlide] =
|
|
2819
|
-
const [isFullscreen, setIsFullscreen] =
|
|
2760
|
+
const [currentSlide, setCurrentSlide] = useState9(initialSlide);
|
|
2761
|
+
const [isFullscreen, setIsFullscreen] = useState9(false);
|
|
2820
2762
|
const containerRef = useRef8(null);
|
|
2821
2763
|
const { theme: theme2 } = useTheme();
|
|
2822
2764
|
const navigateToSlide = useCallback2((slideIndex) => {
|
|
@@ -2842,7 +2784,7 @@ var SlidePresentation = ({
|
|
|
2842
2784
|
setIsFullscreen(false);
|
|
2843
2785
|
}
|
|
2844
2786
|
}, [isFullscreen]);
|
|
2845
|
-
|
|
2787
|
+
useEffect7(() => {
|
|
2846
2788
|
const handleKeyDown = (event) => {
|
|
2847
2789
|
if (event.target instanceof HTMLInputElement || event.target instanceof HTMLTextAreaElement) {
|
|
2848
2790
|
return;
|
|
@@ -2895,7 +2837,7 @@ var SlidePresentation = ({
|
|
|
2895
2837
|
window.addEventListener("keydown", handleKeyDown);
|
|
2896
2838
|
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
2897
2839
|
}, [goToPreviousSlide, goToNextSlide, navigateToSlide, slides.length, toggleFullscreen]);
|
|
2898
|
-
|
|
2840
|
+
useEffect7(() => {
|
|
2899
2841
|
if (currentSlide >= slides.length && slides.length > 0) {
|
|
2900
2842
|
setCurrentSlide(slides.length - 1);
|
|
2901
2843
|
}
|
|
@@ -3264,7 +3206,7 @@ var DocumentView = ({
|
|
|
3264
3206
|
};
|
|
3265
3207
|
// industryMarkdown/components/IndustryEditableMarkdownSlide.tsx
|
|
3266
3208
|
import { Pencil, Save, X } from "lucide-react";
|
|
3267
|
-
import React14, { useState as
|
|
3209
|
+
import React14, { useState as useState10, useCallback as useCallback4, useRef as useRef10, useEffect as useEffect8 } from "react";
|
|
3268
3210
|
var IndustryEditableMarkdownSlide = ({
|
|
3269
3211
|
content,
|
|
3270
3212
|
onContentChange,
|
|
@@ -3284,15 +3226,15 @@ var IndustryEditableMarkdownSlide = ({
|
|
|
3284
3226
|
if (!theme2) {
|
|
3285
3227
|
throw new Error("IndustryEditableMarkdownSlide: theme must be provided either as a prop or through ThemeProvider");
|
|
3286
3228
|
}
|
|
3287
|
-
const [isEditing, setIsEditing] =
|
|
3288
|
-
const [editContent, setEditContent] =
|
|
3289
|
-
const [isSaving, setIsSaving] =
|
|
3229
|
+
const [isEditing, setIsEditing] = useState10(false);
|
|
3230
|
+
const [editContent, setEditContent] = useState10(content);
|
|
3231
|
+
const [isSaving, setIsSaving] = useState10(false);
|
|
3290
3232
|
const textareaRef = useRef10(null);
|
|
3291
3233
|
const saveTimeoutRef = useRef10(undefined);
|
|
3292
|
-
|
|
3234
|
+
useEffect8(() => {
|
|
3293
3235
|
setEditContent(content);
|
|
3294
3236
|
}, [content]);
|
|
3295
|
-
|
|
3237
|
+
useEffect8(() => {
|
|
3296
3238
|
if (isEditing && autoSaveDelay && onSave) {
|
|
3297
3239
|
if (saveTimeoutRef.current) {
|
|
3298
3240
|
clearTimeout(saveTimeoutRef.current);
|
|
@@ -3736,7 +3678,6 @@ export {
|
|
|
3736
3678
|
parseMarkdownIntoPresentation,
|
|
3737
3679
|
parseMarkdownChunks,
|
|
3738
3680
|
increaseFontScale,
|
|
3739
|
-
getThemeWithMode,
|
|
3740
3681
|
getAllSlideTitles,
|
|
3741
3682
|
findSlideIndexByTitle,
|
|
3742
3683
|
findSlideByTitle,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { SlidePresentation } from './SlidePresentation';
|
|
3
|
+
declare const meta: Meta<typeof SlidePresentation>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const ThemeSwitcherDemo: Story;
|
|
7
|
+
export declare const MinimalThemeSwitcher: Story;
|
|
8
|
+
//# sourceMappingURL=SlidePresentationWithThemeSwitcher.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SlidePresentationWithThemeSwitcher.stories.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/components/SlidePresentationWithThemeSwitcher.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAKvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AA+KxD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,iBAAiB,CAWxC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAqKnC,eAAO,MAAM,iBAAiB,EAAE,KAS/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAgClC,CAAC"}
|
|
@@ -19,6 +19,6 @@ export { parseMarkdownChunks } from './utils/markdownUtils';
|
|
|
19
19
|
export type { MarkdownPresentation, MarkdownSlide, MarkdownPresentationFormat, MarkdownSource, MarkdownSourceType, RepositoryInfo, MarkdownSlideLocation, } from './types/presentation';
|
|
20
20
|
export type { Theme } from '../industryTheme';
|
|
21
21
|
export { theme as defaultTheme } from '../industryTheme';
|
|
22
|
-
export { ThemeProvider, useTheme,
|
|
22
|
+
export { ThemeProvider, useTheme, withTheme } from '../industryTheme/ThemeProvider';
|
|
23
23
|
export { scaleThemeFonts, increaseFontScale, decreaseFontScale, resetFontScale } from '../industryTheme';
|
|
24
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../industryMarkdown/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,YAAY,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAGrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;AAC3F,YAAY,EAAE,kCAAkC,EAAE,MAAM,4CAA4C,CAAC;AAGrG,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAC7F,YAAY,EAAE,mCAAmC,EAAE,MAAM,6CAA6C,CAAC;AAGvG,OAAO,EAAE,gCAAgC,EAAE,MAAM,yCAAyC,CAAC;AAG3F,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAG7F,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,uBAAuB,EACvB,uCAAuC,EACvC,sBAAsB,EACtB,iBAAiB,EACjB,kCAAkC,EAClC,0BAA0B,EAC1B,iBAAiB,EACjB,g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B,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AACrF,OAAO,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAG7F,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,uBAAuB,EACvB,uCAAuC,EACvC,sBAAsB,EACtB,iBAAiB,EACjB,kCAAkC,EAClC,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D,YAAY,EACV,oBAAoB,EACpB,aAAa,EACb,0BAA0B,EAC1B,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAG9B,YAAY,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACL,aAAa,EACb,QAAQ,EACR,SAAS,EACV,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACf,MAAM,kBAAkB,CAAC"}
|
|
@@ -2,16 +2,11 @@ import React, { ReactNode } from 'react';
|
|
|
2
2
|
import { Theme } from './index';
|
|
3
3
|
interface ThemeContextValue {
|
|
4
4
|
theme: Theme;
|
|
5
|
-
colorMode: 'light' | 'dark';
|
|
6
|
-
setColorMode: (mode: 'light' | 'dark') => void;
|
|
7
|
-
toggleColorMode: () => void;
|
|
8
5
|
}
|
|
9
6
|
export declare const useTheme: () => ThemeContextValue;
|
|
10
|
-
export declare const getThemeWithMode: (baseTheme: Theme, colorMode: "light" | "dark") => Theme;
|
|
11
7
|
interface ThemeProviderProps {
|
|
12
8
|
children: ReactNode;
|
|
13
9
|
theme?: Theme;
|
|
14
|
-
initialColorMode?: 'light' | 'dark';
|
|
15
10
|
}
|
|
16
11
|
export declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
17
12
|
export declare const withTheme: <P extends object>(Component: React.ComponentType<P & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../industryTheme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../industryTheme/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,KAAK,EAAyB,MAAM,SAAS,CAAC;AAGvD,UAAU,iBAAiB;IACzB,KAAK,EAAE,KAAK,CAAC;CACd;AA+BD,eAAO,MAAM,QAAQ,QAAO,iBAO3B,CAAC;AAGF,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAStD,CAAC;AAGF,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,MAAM,EACxC,WAAW,KAAK,CAAC,aAAa,CAAC,CAAC,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC,MAE5C,OAAO,CAAC,sBAIjB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -82,9 +82,6 @@ export interface Theme {
|
|
|
82
82
|
textSecondary: string;
|
|
83
83
|
textTertiary: string;
|
|
84
84
|
textMuted: string;
|
|
85
|
-
modes: {
|
|
86
|
-
dark: Partial<Colors>;
|
|
87
|
-
};
|
|
88
85
|
};
|
|
89
86
|
buttons: {
|
|
90
87
|
primary: ButtonVariant;
|
|
@@ -101,28 +98,6 @@ export interface Theme {
|
|
|
101
98
|
secondary: CardVariant;
|
|
102
99
|
};
|
|
103
100
|
}
|
|
104
|
-
interface Colors {
|
|
105
|
-
text: string;
|
|
106
|
-
background: string;
|
|
107
|
-
primary: string;
|
|
108
|
-
secondary: string;
|
|
109
|
-
accent: string;
|
|
110
|
-
highlight: string;
|
|
111
|
-
muted: string;
|
|
112
|
-
success: string;
|
|
113
|
-
warning: string;
|
|
114
|
-
error: string;
|
|
115
|
-
info: string;
|
|
116
|
-
border: string;
|
|
117
|
-
backgroundSecondary: string;
|
|
118
|
-
backgroundTertiary: string;
|
|
119
|
-
backgroundLight: string;
|
|
120
|
-
backgroundHover: string;
|
|
121
|
-
surface: string;
|
|
122
|
-
textSecondary: string;
|
|
123
|
-
textTertiary: string;
|
|
124
|
-
textMuted: string;
|
|
125
|
-
}
|
|
126
101
|
export declare const theme: Theme;
|
|
127
102
|
/**
|
|
128
103
|
* Scale font sizes in a theme by a given factor
|
|
@@ -140,7 +115,7 @@ export declare function decreaseFontScale(theme: Theme): Theme;
|
|
|
140
115
|
* Reset font scale to 100%
|
|
141
116
|
*/
|
|
142
117
|
export declare function resetFontScale(theme: Theme): Theme;
|
|
143
|
-
export { ThemeProvider, useTheme, withTheme,
|
|
118
|
+
export { ThemeProvider, useTheme, withTheme, } from './ThemeProvider';
|
|
144
119
|
export { getColor, getSpace, getFontSize, getRadius, getShadow, getZIndex, responsive, sx, createStyle, mergeThemes, } from './utils';
|
|
145
120
|
export default theme;
|
|
146
121
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../industryTheme/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,KAAK,aAAa,GAAG;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC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YAAY,WAAW,KAAG,WAAW;6BAsCtC,KAAK,gBAAgB,OAAO,CAAC,KAAK,CAAC,EAAE,KAAG,KAAK;;AAyBpF,wBAWE"}
|
package/package.json
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "themed-markdown",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "Industry-themed markdown renderer with presentation capabilities",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.mjs",
|
|
6
7
|
"module": "dist/index.mjs",
|
|
7
8
|
"types": "dist/index.d.ts",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
11
|
"import": "./dist/index.mjs",
|
|
11
|
-
"require": "./dist/index.js",
|
|
12
12
|
"types": "./dist/index.d.ts"
|
|
13
13
|
},
|
|
14
14
|
"./dist/index.css": "./dist/index.css"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"build": "bun run clean && bun run build:esm && bun run build:
|
|
17
|
+
"build": "bun run clean && bun run build:esm && bun run build:types && bun run copy:css",
|
|
18
18
|
"build:esm": "bun build ./index.ts --outfile ./dist/index.mjs --format esm --target browser --external react --external react-dom --external react-markdown --external lucide-react --external react-zoom-pan-pinch --external remark-gfm --external rehype-raw --external rehype-highlight --external rehype-sanitize --external rehype-slug --external hast-util-sanitize --external highlight.js",
|
|
19
|
-
"build:cjs": "bun build ./index.ts --outfile ./dist/index.js --format cjs --target browser --external react --external react-dom --external react-markdown --external lucide-react --external react-zoom-pan-pinch --external remark-gfm --external rehype-raw --external rehype-highlight --external rehype-sanitize --external rehype-slug --external hast-util-sanitize --external highlight.js",
|
|
20
19
|
"build:types": "tsc --emitDeclarationOnly --declaration --declarationMap",
|
|
21
20
|
"copy:css": "cp node_modules/highlight.js/styles/atom-one-dark.css ./dist/index.css",
|
|
22
21
|
"dev": "bun run build --watch",
|