@mdxeditor/editor
Version:
React component for rich text markdown editing
28 lines (27 loc) • 974 B
JavaScript
import { addEditorWrapper$, viewMode$ } from "../core/index.js";
import { DiffSourceWrapper } from "./DiffSourceWrapper.js";
import { Cell } from "@mdxeditor/gurx";
import { realmPlugin } from "../../RealmWithPlugins.js";
const diffMarkdown$ = Cell("");
const cmExtensions$ = Cell([]);
const readOnlyDiff$ = Cell(false);
const diffSourcePlugin = realmPlugin({
update: (r, params) => {
r.pub(diffMarkdown$, (params == null ? void 0 : params.diffMarkdown) ?? "");
},
init(r, params) {
r.pubIn({
[ ]: (params == null ? void 0 : params.diffMarkdown) ?? "",
[ ]: (params == null ? void 0 : params.codeMirrorExtensions) ?? [],
[ ]: DiffSourceWrapper,
[ ]: (params == null ? void 0 : params.readOnlyDiff) ?? false,
[ ]: (params == null ? void 0 : params.viewMode) ?? "rich-text"
});
}
});
export {
cmExtensions$,
diffMarkdown$,
diffSourcePlugin,
readOnlyDiff$
};