excalidraw/dev-docs/src/theme/ReactLiveScope/index.js
Aakansha Doshi d73cd14dfb
docs: add mermaid docs (#6971)
* docs: add mermaid docs

* fix link

* add development.mdx

* add codebase

* add parseEdge

* add subgraph

* convertors

* tweaks

* structure the codebase

* add docs for new diagram type

* decouple docs for flowchart parser

* fix broken links

* use diagram instead of chart

* revert package.json

* tweaks

* point root folder of mermaid-to-excalidraw to installation

* remove installation from sidebar children

* fix link

* update flowchart parser diagram

* update parser overview diagram

* update more diagrams

* remove note about change in element stroke

* update diagram

* increase size limit for excalidraw production bundle

* tweaks

* add link

* move codebase after introduction

* dummy

---------

Co-authored-by: dwelle <luzar.david@gmail.com>
2023-09-13 21:01:34 +05:30

31 lines
1 KiB
JavaScript

import React from "react";
import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment";
import initialData from "@site/src/initialData";
import { useColorMode } from "@docusaurus/theme-common";
let ExcalidrawComp = {};
if (ExecutionEnvironment.canUseDOM) {
ExcalidrawComp = require("@excalidraw/excalidraw");
}
const Excalidraw = React.forwardRef((props, ref) => {
const { colorMode } = useColorMode();
return <ExcalidrawComp.Excalidraw theme={colorMode} {...props} ref={ref} />;
});
// Add react-live imports you need here
const ExcalidrawScope = {
React,
...React,
Excalidraw,
Footer: ExcalidrawComp.Footer,
useDevice: ExcalidrawComp.useDevice,
MainMenu: ExcalidrawComp.MainMenu,
WelcomeScreen: ExcalidrawComp.WelcomeScreen,
LiveCollaborationTrigger: ExcalidrawComp.LiveCollaborationTrigger,
Sidebar: ExcalidrawComp.Sidebar,
exportToCanvas: ExcalidrawComp.exportToCanvas,
initialData,
useI18n: ExcalidrawComp.useI18n,
convertToExcalidrawElements: ExcalidrawComp.convertToExcalidrawElements,
};
export default ExcalidrawScope;