From 6ec259a0e71174651bae95d4628138bf6fd68742 Mon Sep 17 00:00:00 2001 From: kj_sh604 Date: Sun, 15 Mar 2026 16:19:35 -0400 Subject: refactor: packages/ --- .../DiagramToCodePlugin/DiagramToCodePlugin.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 packages/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.tsx (limited to 'packages/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.tsx') diff --git a/packages/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.tsx b/packages/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.tsx new file mode 100644 index 0000000..9505999 --- /dev/null +++ b/packages/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.tsx @@ -0,0 +1,17 @@ +import { useLayoutEffect } from "react"; +import { useApp } from "../App"; +import type { GenerateDiagramToCode } from "../../types"; + +export const DiagramToCodePlugin = (props: { + generate: GenerateDiagramToCode; +}) => { + const app = useApp(); + + useLayoutEffect(() => { + app.setPlugins({ + diagramToCode: { generate: props.generate }, + }); + }, [app, props.generate]); + + return null; +}; -- cgit v1.2.3