ck5-custom
v0.0.1
Published
A custom ck5
Downloads
1
Readme
CK5-custom-build
Install
npm install @andrei-dut/ck5-custom-build
Usage JS
import CustomEditor from "@andrei-dut/ck5-custom-build";
const config = {
language: "ru",
};
CustomEditor.create(document.querySelector("#editor"), config)
.then((editor) => {
console.log("Editor was initialized", editor);
})
.catch((error) => {
console.error(error.stack);
});
Usage REACT (@ckeditor/ckeditor5-react)
import { CKEditor } from "@ckeditor/ckeditor5-react";
import CustomEditor from "@andrei-dut/ck5-custom-build";
const config = {
language: "ru",
};
<CKEditor
editor={Editor}
config={config}
data="<p>Hello from CKEditor 5!</p>"
onReady={(editor) => {
console.log("Editor is ready to use!", editor);
}}
onChange={(event) => {
console.log(event);
}}
onBlur={(event, editor) => {
console.log("Blur.", editor);
}}
onFocus={(event, editor) => {
console.log("Focus.", editor);
}}
/>;
Usage REACT (without @ckeditor/ckeditor5-react)
import CustomEditor from "@andrei-dut/ck5-custom-build";
export default function Component() {
useEffect(() => {
const config = {
language: "ru",
};
CustomEditor.create(document.querySelector("#editor"), config)
.then((editor) => {
console.log("Editor was initialized", editor);
})
.catch((error) => {
console.error(error.stack);
});
});
return (
<div id="editor">
<h2>Timestamp plugin</h2>
<p>Press the timestamp button to insert the current date and time.</p>
</div>
);
}