@industry-theme/markdown-panels 0.2.24 → 0.3.0
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 +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/mocks/panelContext.d.ts +1 -1
- package/dist/mocks/panelContext.d.ts.map +1 -1
- package/dist/panels/MarkdownPanel.d.ts +2 -2
- package/dist/panels/MarkdownPanel.d.ts.map +1 -1
- package/dist/panels.bundle.js +9 -20
- package/dist/panels.bundle.js.map +1 -1
- package/dist/types/index.d.ts +18 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +9 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { MarkdownPanel } from './panels/MarkdownPanel';
|
|
2
2
|
import type { MarkdownPanelProps } from './panels/MarkdownPanel';
|
|
3
|
-
import type { PanelDefinition } from './types';
|
|
3
|
+
import type { PanelDefinition, MarkdownPanelActions, MarkdownPanelContext } from './types';
|
|
4
4
|
export { MarkdownPanel };
|
|
5
5
|
export type { MarkdownPanelProps };
|
|
6
6
|
/**
|
|
7
7
|
* Export array of panel definitions.
|
|
8
8
|
* This is the required export for panel extensions.
|
|
9
9
|
*/
|
|
10
|
-
export declare const panels: PanelDefinition[];
|
|
10
|
+
export declare const panels: PanelDefinition<MarkdownPanelActions, MarkdownPanelContext>[];
|
|
11
11
|
/**
|
|
12
12
|
* Optional: Called once when the entire package is loaded.
|
|
13
13
|
* Use this for package-level initialization.
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EACV,eAAe,EAEf,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAIjB,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,eAAe,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,EA2B/E,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"}
|
|
@@ -7,7 +7,7 @@ export declare const mockGitStatus: GitStatus;
|
|
|
7
7
|
/**
|
|
8
8
|
* Mock Panel Context for Storybook
|
|
9
9
|
*/
|
|
10
|
-
export declare const createMockContext: (overrides?: Partial<PanelContextValue
|
|
10
|
+
export declare const createMockContext: <TData = {}>(overrides?: Partial<PanelContextValue<TData>>) => PanelContextValue<TData>;
|
|
11
11
|
/**
|
|
12
12
|
* Mock Panel Actions for Storybook
|
|
13
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panelContext.d.ts","sourceRoot":"","sources":["../../src/mocks/panelContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EAEjB,SAAS,EACV,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAK3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"panelContext.d.ts","sourceRoot":"","sources":["../../src/mocks/panelContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EACV,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EAEjB,SAAS,EACV,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAK3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,GAAG,EAAE,EAC1C,YAAY,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,KAC5C,iBAAiB,CAAC,KAAK,CAgBzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,YAAY,OAAO,CAAC,YAAY,CAAC,KAChC,YAcD,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAAO,iBA6BnC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,mBAAmB,OAAO,CAAC,iBAAiB,CAAC,EAC7C,mBAAmB,OAAO,CAAC,YAAY,CAAC,KACvC,mBAMF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC;IACvC,QAAQ,EAAE,CAAC,KAAK,EAAE,mBAAmB,KAAK,KAAK,CAAC,SAAS,CAAC;IAC1D,gBAAgB,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC9C,gBAAgB,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CAC1C,CAGA,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import 'themed-markdown/dist/index.css';
|
|
3
|
-
import type { PanelComponentProps } from '../types';
|
|
4
|
-
export interface MarkdownPanelProps extends PanelComponentProps {
|
|
3
|
+
import type { PanelComponentProps, MarkdownPanelActions, MarkdownPanelContext } from '../types';
|
|
4
|
+
export interface MarkdownPanelProps extends PanelComponentProps<MarkdownPanelActions, MarkdownPanelContext> {
|
|
5
5
|
/**
|
|
6
6
|
* Optional file path to display.
|
|
7
7
|
* If provided, this takes precedence over the active-file context slice.
|
|
@@ -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,
|
|
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,EACV,mBAAmB,EAEnB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAmBlB,MAAM,WAAW,kBACf,SAAQ,mBAAmB,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IACvE;;;;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,CAudtD,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -47723,7 +47723,7 @@ const MarkdownPanel = ({
|
|
|
47723
47723
|
filePath: filePathProp,
|
|
47724
47724
|
width
|
|
47725
47725
|
}) => {
|
|
47726
|
-
var _a, _b, _c, _d, _e2
|
|
47726
|
+
var _a, _b, _c, _d, _e2;
|
|
47727
47727
|
const { theme: theme2 } = useTheme();
|
|
47728
47728
|
const [viewMode, setViewMode] = useState("document");
|
|
47729
47729
|
const [currentSlide, setCurrentSlide] = useState(0);
|
|
@@ -47740,23 +47740,11 @@ const MarkdownPanel = ({
|
|
|
47740
47740
|
return;
|
|
47741
47741
|
}
|
|
47742
47742
|
const loadContent = async () => {
|
|
47743
|
-
var _a2;
|
|
47744
47743
|
console.log("[MarkdownPanel] Loading file from prop:", filePathProp);
|
|
47745
47744
|
setPropBasedContent({ path: filePathProp, content: "", loading: true, error: null });
|
|
47746
47745
|
try {
|
|
47747
|
-
const
|
|
47748
|
-
|
|
47749
|
-
const content2 = await fileSystem.readFile(filePathProp);
|
|
47750
|
-
setPropBasedContent({ path: filePathProp, content: content2, loading: false, error: null });
|
|
47751
|
-
} else {
|
|
47752
|
-
const setActiveFile = actions == null ? void 0 : actions.setActiveFile;
|
|
47753
|
-
if (typeof setActiveFile === "function") {
|
|
47754
|
-
await setActiveFile(filePathProp);
|
|
47755
|
-
setPropBasedContent(null);
|
|
47756
|
-
} else {
|
|
47757
|
-
throw new Error("No file reading capability available");
|
|
47758
|
-
}
|
|
47759
|
-
}
|
|
47746
|
+
const content2 = await actions.readFile(filePathProp);
|
|
47747
|
+
setPropBasedContent({ path: filePathProp, content: content2, loading: false, error: null });
|
|
47760
47748
|
} catch (err) {
|
|
47761
47749
|
console.error("[MarkdownPanel] Failed to load file:", err);
|
|
47762
47750
|
setPropBasedContent({
|
|
@@ -47768,7 +47756,7 @@ const MarkdownPanel = ({
|
|
|
47768
47756
|
}
|
|
47769
47757
|
};
|
|
47770
47758
|
loadContent();
|
|
47771
|
-
}, [filePathProp,
|
|
47759
|
+
}, [filePathProp, actions]);
|
|
47772
47760
|
useEffect(() => {
|
|
47773
47761
|
const checkMobile = () => {
|
|
47774
47762
|
setIsMobile(window.innerWidth < 768);
|
|
@@ -47805,7 +47793,7 @@ const MarkdownPanel = ({
|
|
|
47805
47793
|
});
|
|
47806
47794
|
return unsubscribe;
|
|
47807
47795
|
}, [events]);
|
|
47808
|
-
const activeFileSlice = context
|
|
47796
|
+
const { activeFile: activeFileSlice } = context;
|
|
47809
47797
|
const usePropBasedContent = filePathProp && (propBasedContent == null ? void 0 : propBasedContent.path) === filePathProp;
|
|
47810
47798
|
const activeFile = usePropBasedContent ? {
|
|
47811
47799
|
data: {
|
|
@@ -47816,8 +47804,8 @@ const MarkdownPanel = ({
|
|
|
47816
47804
|
loading: propBasedContent.loading,
|
|
47817
47805
|
error: propBasedContent.error
|
|
47818
47806
|
} : activeFileSlice;
|
|
47819
|
-
const isMarkdown = ((
|
|
47820
|
-
const markdownContent = ((
|
|
47807
|
+
const isMarkdown = ((_a = activeFile == null ? void 0 : activeFile.data) == null ? void 0 : _a.type) === "markdown" || ((_c = (_b = activeFile == null ? void 0 : activeFile.data) == null ? void 0 : _b.path) == null ? void 0 : _c.match(/\.(md|mdx|markdown)$/i));
|
|
47808
|
+
const markdownContent = ((_d = activeFile == null ? void 0 : activeFile.data) == null ? void 0 : _d.content) || "";
|
|
47821
47809
|
const presentation = useMemo(
|
|
47822
47810
|
() => parseMarkdownIntoPresentation2(markdownContent),
|
|
47823
47811
|
[markdownContent]
|
|
@@ -47885,7 +47873,7 @@ const MarkdownPanel = ({
|
|
|
47885
47873
|
},
|
|
47886
47874
|
children: /* @__PURE__ */ jsx("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ jsxs("p", { style: { color: theme2.colors.textSecondary }, children: [
|
|
47887
47875
|
"Loading ",
|
|
47888
|
-
((
|
|
47876
|
+
((_e2 = activeFile.data) == null ? void 0 : _e2.path) || "file",
|
|
47889
47877
|
"..."
|
|
47890
47878
|
] }) })
|
|
47891
47879
|
}
|
|
@@ -48248,6 +48236,7 @@ const panels = [
|
|
|
48248
48236
|
version: "0.2.0",
|
|
48249
48237
|
author: "Principal ADE",
|
|
48250
48238
|
description: "Themed markdown rendering panel with document and slide views",
|
|
48239
|
+
slices: ["active-file"],
|
|
48251
48240
|
// UTCP-compatible tools this panel exposes
|
|
48252
48241
|
tools: markdownPanelTools
|
|
48253
48242
|
},
|