@industry-theme/markdown-panels 0.2.21 → 0.2.23
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
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { MarkdownPanel } from './panels/MarkdownPanel';
|
|
2
|
+
import type { MarkdownPanelProps } from './panels/MarkdownPanel';
|
|
1
3
|
import type { PanelDefinition } from './types';
|
|
4
|
+
export { MarkdownPanel };
|
|
5
|
+
export type { MarkdownPanelProps };
|
|
2
6
|
/**
|
|
3
7
|
* Export array of panel definitions.
|
|
4
8
|
* This is the required export for panel extensions.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,SAAS,CAAC;AAIlE,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,eAAe,EA0BnC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,qBAEzB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,qBAE3B,CAAC;AAEF;;;GAGG;AACH,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,SAAS,CAAC"}
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import 'themed-markdown/dist/index.css';
|
|
3
3
|
import type { PanelComponentProps } from '../types';
|
|
4
|
+
export interface MarkdownPanelProps extends PanelComponentProps {
|
|
5
|
+
/**
|
|
6
|
+
* Optional file path to display.
|
|
7
|
+
* If provided, this takes precedence over the active-file context slice.
|
|
8
|
+
* This allows the host to control panel state via props instead of context.
|
|
9
|
+
*/
|
|
10
|
+
filePath?: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Optional width to pass to DocumentView for layout calculations.
|
|
13
|
+
* Useful when embedding in panels that need responsive width handling.
|
|
14
|
+
*/
|
|
15
|
+
width?: number;
|
|
16
|
+
}
|
|
4
17
|
/**
|
|
5
18
|
* MarkdownPanel - A panel for rendering markdown documents with industry theming
|
|
6
19
|
*
|
|
7
20
|
* This panel integrates with the panel framework to:
|
|
8
21
|
* - Listen to file:opened events
|
|
9
|
-
* - Read content from the active-file context slice
|
|
22
|
+
* - Read content from the active-file context slice (or from filePath prop)
|
|
10
23
|
* - Display markdown with themed rendering using DocumentView
|
|
11
24
|
* - Support view mode switching between document and slides
|
|
12
25
|
* - Provide font size controls and slide navigation
|
|
13
26
|
*/
|
|
14
|
-
export declare const MarkdownPanel: React.FC<
|
|
27
|
+
export declare const MarkdownPanel: React.FC<MarkdownPanelProps>;
|
|
15
28
|
//# sourceMappingURL=MarkdownPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownPanel.d.ts","sourceRoot":"","sources":["../../src/panels/MarkdownPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,OAAO,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,mBAAmB,EAAmB,MAAM,UAAU,CAAC;AAmBrE;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"MarkdownPanel.d.ts","sourceRoot":"","sources":["../../src/panels/MarkdownPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAS5D,OAAO,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,mBAAmB,EAAmB,MAAM,UAAU,CAAC;AAmBrE,MAAM,WAAW,kBAAmB,SAAQ,mBAAmB;IAC7D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAsatD,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -46751,7 +46751,8 @@ var SlidePresentationBook = ({
|
|
|
46751
46751
|
handlePromptCopy,
|
|
46752
46752
|
fontSizeScale,
|
|
46753
46753
|
theme: theme2,
|
|
46754
|
-
repositoryInfo
|
|
46754
|
+
repositoryInfo,
|
|
46755
|
+
width
|
|
46755
46756
|
}) => {
|
|
46756
46757
|
const [isMobile, setIsMobile] = useState(false);
|
|
46757
46758
|
useEffect(() => {
|
|
@@ -47150,7 +47151,8 @@ var SlidePresentationBook = ({
|
|
|
47150
47151
|
handlePromptCopy,
|
|
47151
47152
|
fontSizeScale,
|
|
47152
47153
|
searchQuery: showSearch ? searchQuery : void 0,
|
|
47153
|
-
repositoryInfo
|
|
47154
|
+
repositoryInfo,
|
|
47155
|
+
containerWidth: width
|
|
47154
47156
|
}) : /* @__PURE__ */ React2__default.createElement("div", {
|
|
47155
47157
|
style: {
|
|
47156
47158
|
height: "100%",
|
|
@@ -47273,7 +47275,8 @@ var SlidePresentationBook = ({
|
|
|
47273
47275
|
handlePromptCopy,
|
|
47274
47276
|
fontSizeScale,
|
|
47275
47277
|
searchQuery: showSearch ? searchQuery : void 0,
|
|
47276
|
-
repositoryInfo
|
|
47278
|
+
repositoryInfo,
|
|
47279
|
+
containerWidth: width
|
|
47277
47280
|
}) : /* @__PURE__ */ React2__default.createElement("div", {
|
|
47278
47281
|
style: {
|
|
47279
47282
|
height: "100%",
|
|
@@ -47465,6 +47468,7 @@ var SlidePresentationBook = ({
|
|
|
47465
47468
|
fontSizeScale,
|
|
47466
47469
|
searchQuery: showSearch ? searchQuery : void 0,
|
|
47467
47470
|
repositoryInfo,
|
|
47471
|
+
containerWidth: width,
|
|
47468
47472
|
transparentBackground: true,
|
|
47469
47473
|
additionalPadding: {
|
|
47470
47474
|
left: `${theme2.space[4]}px`,
|
|
@@ -47511,6 +47515,7 @@ var SlidePresentationBook = ({
|
|
|
47511
47515
|
fontSizeScale,
|
|
47512
47516
|
searchQuery: showSearch ? searchQuery : void 0,
|
|
47513
47517
|
repositoryInfo,
|
|
47518
|
+
containerWidth: width,
|
|
47514
47519
|
transparentBackground: true,
|
|
47515
47520
|
additionalPadding: {
|
|
47516
47521
|
left: `${theme2.space[2]}px`,
|
|
@@ -47581,6 +47586,7 @@ var SlidePresentationBook = ({
|
|
|
47581
47586
|
fontSizeScale,
|
|
47582
47587
|
searchQuery: showSearch ? searchQuery : void 0,
|
|
47583
47588
|
repositoryInfo,
|
|
47589
|
+
containerWidth: width,
|
|
47584
47590
|
transparentBackground: false,
|
|
47585
47591
|
disableScroll: false
|
|
47586
47592
|
}))) : /* @__PURE__ */ React2__default.createElement("div", {
|
|
@@ -47649,6 +47655,7 @@ var DocumentView = ({
|
|
|
47649
47655
|
content: content2,
|
|
47650
47656
|
onCheckboxChange,
|
|
47651
47657
|
maxWidth = "900px",
|
|
47658
|
+
width,
|
|
47652
47659
|
slideIdPrefix = "document",
|
|
47653
47660
|
enableHtmlPopout = true,
|
|
47654
47661
|
enableKeyboardScrolling = true,
|
|
@@ -47693,7 +47700,8 @@ var DocumentView = ({
|
|
|
47693
47700
|
handlePromptCopy,
|
|
47694
47701
|
repositoryInfo,
|
|
47695
47702
|
transparentBackground,
|
|
47696
|
-
editable
|
|
47703
|
+
editable,
|
|
47704
|
+
containerWidth: width
|
|
47697
47705
|
})));
|
|
47698
47706
|
};
|
|
47699
47707
|
function parseMarkdownIntoPresentation2(markdownContent, repositoryInfo) {
|
|
@@ -47710,8 +47718,10 @@ const getBasePath = (filePath) => {
|
|
|
47710
47718
|
};
|
|
47711
47719
|
const MarkdownPanel = ({
|
|
47712
47720
|
context,
|
|
47713
|
-
actions
|
|
47714
|
-
events
|
|
47721
|
+
actions,
|
|
47722
|
+
events,
|
|
47723
|
+
filePath: filePathProp,
|
|
47724
|
+
width
|
|
47715
47725
|
}) => {
|
|
47716
47726
|
var _a, _b, _c, _d, _e2, _f, _g;
|
|
47717
47727
|
const { theme: theme2 } = useTheme();
|
|
@@ -47720,6 +47730,15 @@ const MarkdownPanel = ({
|
|
|
47720
47730
|
const [fontSizeScale, setFontSizeScale] = useState(1);
|
|
47721
47731
|
const [isMobile, setIsMobile] = useState(false);
|
|
47722
47732
|
const [preferencesLoaded, setPreferencesLoaded] = useState(false);
|
|
47733
|
+
useEffect(() => {
|
|
47734
|
+
if (filePathProp) {
|
|
47735
|
+
console.log("[MarkdownPanel] Loading file from prop:", filePathProp);
|
|
47736
|
+
const setActiveFile = actions == null ? void 0 : actions.setActiveFile;
|
|
47737
|
+
if (typeof setActiveFile === "function") {
|
|
47738
|
+
setActiveFile(filePathProp);
|
|
47739
|
+
}
|
|
47740
|
+
}
|
|
47741
|
+
}, [filePathProp, actions]);
|
|
47723
47742
|
useEffect(() => {
|
|
47724
47743
|
const checkMobile = () => {
|
|
47725
47744
|
setIsMobile(window.innerWidth < 768);
|
|
@@ -48047,7 +48066,8 @@ const MarkdownPanel = ({
|
|
|
48047
48066
|
},
|
|
48048
48067
|
slideIdPrefix: "markdown-panel",
|
|
48049
48068
|
maxWidth: "100%",
|
|
48050
|
-
repositoryInfo
|
|
48069
|
+
repositoryInfo,
|
|
48070
|
+
width
|
|
48051
48071
|
}
|
|
48052
48072
|
) : /* @__PURE__ */ jsx(
|
|
48053
48073
|
SlidePresentationBook,
|
|
@@ -48069,7 +48089,8 @@ const MarkdownPanel = ({
|
|
|
48069
48089
|
tocDisplayMode: "sidebar",
|
|
48070
48090
|
tocSidebarPosition: "left",
|
|
48071
48091
|
initialTocOpen: false,
|
|
48072
|
-
repositoryInfo
|
|
48092
|
+
repositoryInfo,
|
|
48093
|
+
width
|
|
48073
48094
|
}
|
|
48074
48095
|
)
|
|
48075
48096
|
}
|
|
@@ -48209,6 +48230,7 @@ const onPackageUnload = async () => {
|
|
|
48209
48230
|
console.log("Panel package unloading - Industry-Themed Markdown Panels");
|
|
48210
48231
|
};
|
|
48211
48232
|
export {
|
|
48233
|
+
MarkdownPanel,
|
|
48212
48234
|
changeFontSizeTool,
|
|
48213
48235
|
markdownPanelTools,
|
|
48214
48236
|
markdownPanelToolsMetadata,
|