2.0.5 • Published 9 months ago
advanced_texteditor v2.0.5
Advanced Texteditor
It has basic text editing tools and speech to text feature.
Examples:
Pure js:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://unpkg.com/advanced_texteditor/index.css" />
<script type="text/javascript" src="https://unpkg.com/advanced_texteditor/dist/index.js"></script>
</head>
<body>
<h1>Text Editor</h1>
<div id="editor"></div>
</body>
<script>
new Advanced.TextEditor("#editor", { toolbar: "bold italic underline strikeThrough superscript subscript formatBlock justifyLeft justifyCenter justifyRight justifyFull insertOrderedList insertUnorderedList insertHorizontalRule html pre indent outdent createLink unlink refresh undoRedo clear", value: "<b>hello world</b>", onChange: (e,value) => { console.log(value) } })
</script>
</html>
React Js:
Class Component
import { TextEditor } from "advanced_texteditor";
import "advanced_texteditor/index.css";
class Sample extends React.Component {
constructor(props) {
this.editoRef = null;
}
componentDidMount = () => {
this.editoRef = new TextEditor("#editor", {
toolbar: "bold italic underline strikeThrough superscript subscript formatBlock justifyLeft justifyCenter justifyRight justifyFull insertOrderedList insertUnorderedList insertHorizontalRule html pre indent outdent createLink unlink refresh undoRedo clear",
value: "<b>hello world</b>",
onChange: (e,value) => {
console.log(value);
},
}),
}
render = () => {
return(
<div id="editor"/>
)
}
}
Functional Component
import React, { useRef, useEffect } from 'react';
import { TextEditor } from "advanced_texteditor";
import "advanced_texteditor/index.css";
const Sample = () => {
const editoRef = useRef(null);
useEffect(() => {
editoRef.current = new TextEditor("#editor", {
toolbar: "bold italic underline strikeThrough superscript subscript formatBlock justifyLeft justifyCenter justifyRight justifyFull insertOrderedList insertUnorderedList insertHorizontalRule html pre indent outdent createLink unlink refresh undoRedo clear",
value: "<b>hello world</b>",
onChange: (e,value) => {
console.log(e,value);
},
}),
}, []);
return (
<div id="editor"/>
);
}
Custom Styles
Create index.css file, import this file and update css like below
.ate_editor [contenteditable] {
// add here
}
.ate_editor .ate_toolbar,
.ate_editor .ate_bottom_bar {
// add here
}
.ate_editor .ate_toolbar button,
.ate_editor .ate_bottom_bar button {
// add here
}
.ate_editor .ate_toolbar button .tooltiptext,
.ate_editor .ate_bottom_bar button .tooltiptext {
// add here
}
.ate_editor .ate_bottom_bar {
// add here
}
// add here
Ref Instance
2.0.5
9 months ago
2.0.4
9 months ago
2.0.3
9 months ago
2.0.2
9 months ago
2.0.1
9 months ago
2.0.0
9 months ago
1.2.7
10 months ago
1.2.4
10 months ago
1.2.3
10 months ago
1.2.2
10 months ago
1.2.1
10 months ago
1.2.0
10 months ago
1.1.9
10 months ago
1.1.8
10 months ago
1.1.7
10 months ago
1.1.6
10 months ago
1.1.5
10 months ago
1.1.4
10 months ago
1.1.3
10 months ago
1.1.2
10 months ago
1.1.1
10 months ago
1.1.0
10 months ago
1.0.9
10 months ago
1.0.8
10 months ago
1.0.7
10 months ago
1.0.6
10 months ago
1.0.5
10 months ago
1.0.4
10 months ago
1.0.3
10 months ago
1.0.2
10 months ago
1.0.1
10 months ago
1.0.0
10 months ago