mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-21 19:33:49 +08:00
feat: replace react-codemirror2 with @uiw/react-codemirror (#3577)
Signed-off-by: WindSpiritSR <simon343riley@gmail.com>
This commit is contained in:
@ -13,13 +13,11 @@
|
||||
// limitations under the License.
|
||||
|
||||
import React, {useCallback, useEffect, useRef, useState} from "react";
|
||||
import {Controlled as CodeMirror} from "react-codemirror2";
|
||||
import "codemirror/lib/codemirror.css";
|
||||
import "codemirror/mode/properties/properties";
|
||||
import * as Setting from "./Setting";
|
||||
import IframeEditor from "./IframeEditor";
|
||||
import {Tabs} from "antd";
|
||||
import i18next from "i18next";
|
||||
import Editor from "./common/Editor";
|
||||
|
||||
const {TabPane} = Tabs;
|
||||
|
||||
@ -81,11 +79,10 @@ const CasbinEditor = ({model, onModelTextChange}) => {
|
||||
style={{width: "100%", height: "100%"}}
|
||||
/>
|
||||
) : (
|
||||
<CodeMirror
|
||||
<Editor
|
||||
value={localModelText}
|
||||
className="full-height-editor no-horizontal-scroll-editor"
|
||||
options={{mode: "properties", theme: "default"}}
|
||||
onBeforeChange={(editor, data, value) => {
|
||||
readOnly={Setting.builtInObject(model)}
|
||||
onChange={value => {
|
||||
handleModelTextChange(value);
|
||||
}}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user