1.1.4 • Published 3 years ago
kedao v1.1.4
Kedao(刻刀) 编辑器
kedao 是一个基于 braft-editor 修改而来的前端编辑器,底层基于 draft-js。
在 Braft-Editor 的基础之上,kedao 做了一些改进工作,如:
- 重构了 braft-editor 的多个工程,合并成一个大工程,并修改构建产物,从原来的 webpack 打包后的 bundle,改成源码打包。
- 升级了依赖包和工具链的版本。
- 改成 Typescript 语言,添加类型定义,方便使用。
安装
npm i kedao使用
import React, { useState } from "react";
import Editor, {
EditorState,
convertRawToEditorState,
convertEditorStateToRaw,
} from "kedao";
import { useLocalStorage } from "react-use";
function App() {
const [value, setValue] = useLocalStorage(
"kedao-state",
convertEditorStateToRaw(EditorState.createEmpty())
);
const [editorState, setEditorState] = useState(
convertRawToEditorState(value)
);
const handleChange = (newEditorState: EditorState) => {
setEditorState(newEditorState);
setValue(convertEditorStateToRaw(newEditorState));
};
return (
<div className="App">
<Editor value={editorState} onChange={handleChange} />
</div>
);
}
export default App;更多示例参见 examples
贡献
欢迎任何方式的贡献,issue、文档、翻译等。
文档
更多文档见组件官网:https://kedao.vercel.app
1.1.4
3 years ago
1.1.2
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
0.1.30
4 years ago
1.0.1
3 years ago
1.0.0
3 years ago
0.1.10
4 years ago
0.1.11
4 years ago
0.1.12
4 years ago
0.1.13
4 years ago
0.1.14
4 years ago
0.1.15
4 years ago
0.1.27
4 years ago
0.1.28
4 years ago
0.1.29
4 years ago
0.1.20
4 years ago
0.1.21
4 years ago
0.1.22
4 years ago
0.1.23
4 years ago
0.1.24
4 years ago
0.1.25
4 years ago
0.1.26
4 years ago
0.1.0
4 years ago
0.1.2
4 years ago
0.1.16
4 years ago
0.1.8
4 years ago
0.1.17
4 years ago
0.1.7
4 years ago
0.1.18
4 years ago
0.1.19
4 years ago
0.1.9
4 years ago
0.1.4
4 years ago
0.0.5
4 years ago
0.0.4
4 years ago
0.1.5
4 years ago
0.0.3
4 years ago
0.0.1
4 years ago