dont-track-me-google
Firefox and Chrome extensions to prevent Google from making links ugly.
React version of canvas editor
git clone https://github.com/mindfiredigital/react-canvas-editor.gitmindfiredigital/react-canvas-editorExperience powerful document creation with our React-based editor. Craft and manage multi-page documents effortlessly
The @mindfiredigital/react-canvas-editor is a tool that allows developers to integrate multi page document editors built on top of Canvas using React.
The canvas element in HTML serves as a versatile space for drawing graphics using JavaScript, enabling the creation of dynamic, interactive, and visually engaging content on web pages. Within this context, a Canvas editor emerges as a powerful tool or application that harnesses the capabilities of the canvas element. This editor facilitates the creation, editing, and manipulation of graphics or drawings directly within a web browser.
Fine-Grained Control: Fine-Grained Control: Total freedom to manipulate pixels, dictate rendering, and create custom elements and interactivity beyond what HTML offers out of the box.
Scalable Performance: Blazing fast rendering and lightweight data synchronization fueled by the raw power of canvas APIs rather than heavy HTML DOM reconciliation.
Easy Multiplayer Integration: Canvas state using simple coordinate vectors flows seamlessly cross-device enabling effortless real-time collaborative editing at scale.
Unleashed Creativity: No limits enforced by page markup frees imagination to run wild. Build beyond editor chrome right on the infinite canvas with total creative liberty.
Future Facing Setup: Canvas as a technology continues rapid innovation, unlike stale HTML editors. What’s created today on canvas can easily harness tomorrow’s new features.
Skill Transferability: Canvas skills open doors across cutting edge domains like metaverse experiences, game dev, 3D, generative art, and other growth areas.
To know more you can check the link Canvas vs HTML Editor
To install the @mindfiredigital/react-canvas-editor npm package in your project, use the following command:
npm install @mindfiredigital/react-canvas-editor
| React Component | Web Component for React | Web Component for JavaScript |
|---|---|---|
import { DocumentEditor } from "@mindfiredigital/react-canvas-editor";
import React from "react";
export const App = () => {
const toolbarItem: any = {
bold: true,
italic: true,
underline: true,
undo: true,
redo: true,
image: true,
};
const handleChange = (data) => {
console.log("test ->", data);
};
const handleSelectedText = (text) => {
console.log(text);
};
return (
<DocumentEditor
toolbar={toolbarItem}
on_change={handleChange}
on_select={handleSelectedText}
value='Hello world'
/>
);
};
|
import { DocumentEditorWebComponent } from "@mindfiredigital/react-canvas-editor";
const toolbarItem: any = {
bold: true,
italic: true,
underline: true,
undo: true,
redo: true,
image: true,
};
const handleChange = (data) => {
console.log("test ->", data);
};
const handleSelectedText = (text) => {
console.log(text);
};
const props = {
toolbar:toolbarItem
on_change:handleChange
on_select:handleSelectedText
value:'Hello world'
};
DocumentEditorWebComponent(props);
export const App = () => <div id='document-editor'></div>;
|
<!-- In you html file add following code in a body tag where you want to use react canvas editor --> <body> <div id="document-editor"></div> <script type="module" src="/main.js"></script> </body> ; // In main.js file(i.e. used as a script in html file) add the following code
import { DocumentEditorWebComponent } from "@mindfiredigital/react-canvas-editor";
const toolbarItem = {
bold: true,
italic: true,
underline: true,
undo: true,
redo: true,
image: true,
};
function handleChange(data) {
console.log(`test1 -> ${data}`);
}
function handleSelectedText(text) {
console.log(`select1 ->, ${text}`);
}
DocumentEditorWebComponent({
toolbar:toolbarItem
on_change:handleChange
on_select:handleSelectedText
value:'Hello world'
});
|
| React Component | Web Component for React | Web Component for JavaScript |
|---|---|---|
import { DocumentEditor } from "@mindfiredigital/react-canvas-editor";
import React from "react";
export const App = () => {
const toolbarClass: any = {
container: {
// backgroundColor: "red"
},
primaryToolbar: {
justifyContent: "center",
},
item: {
undo: {
// border: 'red solid 2px',
// background:'yellow'
},
redo: {
// border: 'black solid 3px',
// background:'blue'
},
bold: {
// border: 'black solid 3px',
// background:'blue'
},
italic: {
// border: 'black solid 3px',
// background:'blue'
},
underline: {
// border: 'black solid 3px',
// background:'blue'
},
image: {
// border: 'black solid 3px',
// background:'blue'
},
fontType: {
// background:'green'
},
table: {
// background:'green'
},
fontColor: {
// background:'green'
},
highlight: {
// background:'green'
},
fontSize: {
// background:'green'
},
heading: {
// background:'green'
},
selectedToolbarItemColor: {
// color: "#1a73e8",
},
},
};
const canvasClass = {
editorMain: {
// background:'antiquewhite'
},
margin: {},
};
return (
<DocumentEditor toolbar_class={toolbarClass} canvas_class={canvasClass} />
);
};
|
import { DocumentEditorWebComponent } from "@mindfiredigital/react-canvas-editor";
const toolbarClass: any = {
container: {
// backgroundColor: "red"
},
primaryToolbar: {
justifyContent: "center",
},
item: {
undo: {
// border: 'red solid 2px',
// background:'yellow'
},
redo: {
// border: 'black solid 3px',
// background:'blue'
},
bold: {
// border: 'black solid 3px',
// background:'blue'
},
italic: {
// border: 'black solid 3px',
// background:'blue'
},
underline: {
// border: 'black solid 3px',
// background:'blue'
},
image: {
// border: 'black solid 3px',
// background:'blue'
},
fontType: {
// background:'green'
},
table: {
// background:'green'
},
fontColor: {
// background:'green'
},
highlight: {
// background:'green'
},
fontSize: {
// background:'green'
},
heading: {
// background:'green'
},
selectedToolbarItemColor: {
// color: "#1a73e8",
},
},
};
const canvasClass = {
editorMain: {
// background:'antiquewhite'
},
margin: {},
};
const props = {
toolbar_class: toolbarClass,
canvas_class: canvasClass,
};
DocumentEditorWebComponent(props);
export const App = () => <div id='document-editor'></div>;
|
<!-- In you html file add following code in a body tag where you want to use react canvas editor --> <body> <div id="document-editor"></div> <script type="module" src="/main.js"></script> </body> ; // In main.js file(i.e. used as a script in html file) add the following code
import { DocumentEditorWebComponent } from "@mindfiredigital/react-canvas-editor";
const toolbarClass: any = {
container: {
// backgroundColor: "red"
},
primaryToolbar: {
justifyContent: "center",
},
item: {
undo: {
// border: 'red solid 2px',
// background:'yellow'
},
redo: {
// border: 'black solid 3px',
// background:'blue'
},
bold: {
// border: 'black solid 3px',
// background:'blue'
},
italic: {
// border: 'black solid 3px',
// background:'blue'
},
underline: {
// border: 'black solid 3px',
// background:'blue'
},
image: {
// border: 'black solid 3px',
// background:'blue'
},
fontType: {
// background:'green'
},
table: {
// background:'green'
},
fontColor: {
// background:'green'
},
highlight: {
// background:'green'
},
fontSize: {
// background:'green'
},
heading: {
// background:'green'
},
selectedToolbarItemColor: {
// color: "#1a73e8",
},
},
};
const canvasClass = {
editorMain: {
// background:'antiquewhite'
},
margin: {},
};
DocumentEditorWebComponent({
toolbar_class: toolbarClass,
canvas_class: canvasClass,
});
|
We welcome contributions from the community. If you'd like to contribute to the react-document-editor npm package, please follow our Contributing Guidelines.
Copyright (c) Mindfire Digital llp. All rights reserved.
Licensed under the MIT license.
more like this
Firefox and Chrome extensions to prevent Google from making links ugly.
search projects, people, and tags