@industry-theme/markdown-panels 0.2.21 → 0.2.22

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,SAAS,CAAC;AAGlE;;;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
+ {"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,23 @@
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
+ }
4
12
  /**
5
13
  * MarkdownPanel - A panel for rendering markdown documents with industry theming
6
14
  *
7
15
  * This panel integrates with the panel framework to:
8
16
  * - Listen to file:opened events
9
- * - Read content from the active-file context slice
17
+ * - Read content from the active-file context slice (or from filePath prop)
10
18
  * - Display markdown with themed rendering using DocumentView
11
19
  * - Support view mode switching between document and slides
12
20
  * - Provide font size controls and slide navigation
13
21
  */
14
- export declare const MarkdownPanel: React.FC<PanelComponentProps>;
22
+ export declare const MarkdownPanel: React.FC<MarkdownPanelProps>;
15
23
  //# 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,mBAAmB,CAsZvD,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;CAC1B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAmatD,CAAC"}
@@ -47710,8 +47710,9 @@ const getBasePath = (filePath) => {
47710
47710
  };
47711
47711
  const MarkdownPanel = ({
47712
47712
  context,
47713
- actions: _actions,
47714
- events
47713
+ actions,
47714
+ events,
47715
+ filePath: filePathProp
47715
47716
  }) => {
47716
47717
  var _a, _b, _c, _d, _e2, _f, _g;
47717
47718
  const { theme: theme2 } = useTheme();
@@ -47720,6 +47721,15 @@ const MarkdownPanel = ({
47720
47721
  const [fontSizeScale, setFontSizeScale] = useState(1);
47721
47722
  const [isMobile, setIsMobile] = useState(false);
47722
47723
  const [preferencesLoaded, setPreferencesLoaded] = useState(false);
47724
+ useEffect(() => {
47725
+ if (filePathProp) {
47726
+ console.log("[MarkdownPanel] Loading file from prop:", filePathProp);
47727
+ const setActiveFile = actions == null ? void 0 : actions.setActiveFile;
47728
+ if (typeof setActiveFile === "function") {
47729
+ setActiveFile(filePathProp);
47730
+ }
47731
+ }
47732
+ }, [filePathProp, actions]);
47723
47733
  useEffect(() => {
47724
47734
  const checkMobile = () => {
47725
47735
  setIsMobile(window.innerWidth < 768);
@@ -48209,6 +48219,7 @@ const onPackageUnload = async () => {
48209
48219
  console.log("Panel package unloading - Industry-Themed Markdown Panels");
48210
48220
  };
48211
48221
  export {
48222
+ MarkdownPanel,
48212
48223
  changeFontSizeTool,
48213
48224
  markdownPanelTools,
48214
48225
  markdownPanelToolsMetadata,