
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
jodit-react
Advanced tools
React wrapper for Jodit
Jodit React PRO it is an extended version of Jodit React with the same API, but with a lot more features.
npm install jodit-react --save
npm update jodit-react
npm install --dev
npm run demo
and open
http://localhost:4000/
import React, { useState, useRef, useMemo } from 'react';
import JoditEditor from 'jodit-react';
const Example = ({ placeholder }) => {
const editor = useRef(null);
const [content, setContent] = useState('');
const config = useMemo(() => ({
readonly: false, // all options from https://xdsoft.net/jodit/docs/,
placeholder: placeholder || 'Start typings...'
}),
[placeholder]
);
return (
<JoditEditor
ref={editor}
value={content}
config={config}
tabIndex={1} // tabIndex of textarea
onBlur={newContent => setContent(newContent)} // preferred to use only this option to update the content for performance reasons
onChange={newContent => {}}
/>
);
};
You can use all Jodit features and write your own plugin for example.
import JoditEditor, { Jodit } from 'jodit-react';
/**
* @param {Jodit} jodit
*/
function preparePaste(jodit) {
jodit.e.on(
'paste',
e => {
if (confirm('Change pasted content?')) {
jodit.e.stopPropagation('paste');
jodit.s.insertHTML(
Jodit.modules.Helpers.getDataTransfer(e)
.getData(Jodit.constants.TEXT_HTML)
.replace(/a/g, 'b')
);
return false;
}
},
{ top: true }
);
}
Jodit.plugins.add('preparePaste', preparePaste);
//...
return <JoditEditor />;
You can see how to write plugins in the documentation or on the stand
You can connect any Jodit constructor and set it as the JoditConstructor
property of the component.
import React from 'react';
import JoditEditor from 'jodit-react';
import {Jodit} from 'jodit-pro';
import 'jodit-pro/es5/jodit.min.css';
// ...
function App() {
return <JoditEditor JoditConstructor={Jodit} />;
}
This package is available under MIT
License.
FAQs
Jodit is awesome and usefully wysiwyg editor with filebrowser
The npm package jodit-react receives a total of 59,559 weekly downloads. As such, jodit-react popularity was classified as popular.
We found that jodit-react demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.