
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@synapsestudios/draftjs-editor
Advanced tools
A customized WYSIWYG editor utilizing Facebook's Draft.js library
A simple WYSIWYG text editor utilizing Facebook's Draft.js library– customized by Synapse Studios
A demo is available at https://synapsestudios.github.io/draftjs-editor/
// yarn
yarn add @synapsestudios/draftjs-editor
// npm
npm install --save @synapsestudios/draftjs-editor
The default export is the React editor component itself:
import SynapseDraft from '@synapsestudios/draftjs-editor';
It also exports the following utilities:
DraftJSEditor
- The default React componentRenderer(customBlocks)
- A constructor that creates a new Draft to HTML renderer, currently only exposes the method convertRawToHTML(rawContent)
defaultBlocks
- A default set of blocks to pass into the Renderer, these can be used or overridden in your own project as wellconvertFromRaw()
- Simple passthrough of DraftJS's convertFromRaw
utility// Minified, autoprefixed css
import '@synapsestudios/draftjs-editor/lib/draftjs-editor.min.css';
// Not-minified, not-autoprefixed css
import '@synapsestudios/draftjs-editor/lib/draftjs-editor.css';
The two main component classNames are DraftJSEditor-root
for the container and DraftJSEditor-editor
for the editor itself.
If you are using Stylus you can import the .styl file into your build:
@import '@synapsestudios/draftjs-editor/lib/draftjs-editor.styl';
Props
Props are automatically passed onto the DraftJS Editor component. Anything usable from the api can also be passed into DraftJSEditor.
containerStyle
(object) - passes inline styling directly into the parent component of the editor. This can also be modified by using CSS to style the class name DraftJSEditor-root
className
(string) - Classes to add to the editor componentid
(string) - ID to add to the editor componentcustomBlocks
(object) - An object containing the custom blocks you want the editor to render, see defaultBlocks
for examplescustomBlockControls
(array) - An array of keys of custom blocks to render the controls forRenderer
MethodsconvertRawToHTML(rawContent)
- Takes raw DraftJS state object and renders it to HTMLTo run the project on your own computer:
yarn install
or npm install
yarn run storybook
or npm run storybook
src
directory should immediately compile and be visible in your browser.v3.1.0
containerStyle
prop to allow for the styling of the container surrounding the editor.FAQs
A customized WYSIWYG editor utilizing Facebook's Draft.js library
The npm package @synapsestudios/draftjs-editor receives a total of 31 weekly downloads. As such, @synapsestudios/draftjs-editor popularity was classified as not popular.
We found that @synapsestudios/draftjs-editor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.