addFile
console.log(editorRef.current)}>ref api
console.log(
editorRef.current.refresh(files, "/style.md", {
start: {
line: 29,
column: 1,
},
end: {
line: 40,
column: 1,
},
})
)
}
>
refresh
{
console.log(editorRef.current.getAllValue());
}}
>
real getAllvalue
setColors(themes["OneDarkPro"].colors)}>
refresh theme color
{Object.keys(files).length > 0 && (
{ setActivePath(path); }}
// onFileSave={(key: string, value: string) => {
// console.log(editorRef.current.getAllValue());
// }}
onFileChange={(...args) => console.log(args)}
onRenameFile={(...args) => {
// setFiles((pre) => {
// const res = {...pre};
// res[args[1]] = res[args[0]];
// delete res[args[0]];
// return res;
// });
// setActivePath(args[1]);
console.log(args);
}}
ref={editorRef}
defaultPath={activePath}
defaultFiles={files}
options={{
fontSize: 14,
automaticLayout: true,
}}
/>
)}
{/*
*/}
{Object.keys(colors).map((v) => (
{
copyDataToClipBoard(`var(--monaco-${v.replace(".", "-")})`);
}}
key={v}
>
{v}
))}