Files
obsidian-excalidraw-plugin/scripts/reactRuntimeEntry.mjs
T

23 lines
954 B
JavaScript

/**
* Browser entry for the private React runtime used by Excalidraw.
*
* The plugin evaluates the generated artifact in a private function scope once
* per Obsidian window. Keep these exports aligned with the lexical externals
* configured by the Excalidraw `build:obsidian` package target.
*/
import React from "react";
import ReactDOMLegacy from "react-dom";
import * as ReactDOMClient from "react-dom/client";
import * as jsxDevRuntime from "react/jsx-dev-runtime";
import * as jsxRuntime from "react/jsx-runtime";
const ReactDOM = Object.assign({}, ReactDOMLegacy, ReactDOMClient);
const ReactJSXRuntime = jsxRuntime;
const ReactJSXDevRuntime = Object.assign({}, jsxDevRuntime, {
// React 18's production entry exposes `jsxDEV` as undefined. Keep the
// callable compatibility surface used by the former runtime shim.
jsxDEV: jsxDevRuntime.jsxDEV || jsxRuntime.jsx,
});
export { React, ReactDOM, ReactJSXRuntime, ReactJSXDevRuntime };