ckeditor5-luongthanhnhi-custom-build
v2.1.3
Published
A custom CKEditor 5 build made by the CKEditor 5 online builder.
Downloads
107
Readme
###Installation: Using npm:
$ npm install ckeditor5-luongthanhnhi-custom-build
Using yarn:
$ yarn add ckeditor5-luongthanhnhi-custom-build
###Rebuilding editor:
$ npm run build
$ yarn build
How to use, Ex:
import ClassicEditor from "ckeditor5-luongthanhnhi-custom-build/build/ckeditor";
import { CKEditor } from "@ckeditor/ckeditor5-react";
const CkeditorComponent = ({ name, label, rules, data, onFocus, ...props }) => {
const config = {
extraPlugins: [uploadPlugin],
};
function uploadAdapter(loader) {
return {
upload: async () => {
//Handle upload
},
};
}
function uploadPlugin(editor) {
editor.plugins.get("FileRepository").createUploadAdapter = (loader) => {
return uploadAdapter(loader);
};
}
return (
<CKEditor
editor={ClassicEditor}
data={data}
config={config}
onFocus={onFocus}
{...props}
/>
);
};
export default CkeditorComponent;