
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
editorjs-alert
Advanced tools
Provides Alert blocks for the Editor.js.
Watch this tool in action in the following short GIF movie.
Try it out yourself on the demo page.
Get the package
npm i --save editorjs-alert
Include module at your application
const Header = require('editorjs-alert');
// OR
import Alert from 'editorjs-alert';
Copy dist/bundle.js file to your page.
You can load specific version of package from jsDelivr CDN.
<script src="https://cdn.jsdelivr.net/npm/editorjs-alert@latest"></script>
Add a new Tool Alert to the tools property of the Editor.js initial config.
var editor = EditorJS({
// ...
tools: {
// ...
alert: Alert,
},
// ...
});
Or initialize Alert tool with additional optional settings
var editor = EditorJS({
//...
tools: {
//...
alert: {
class: Alert,
inlineToolbar: true,
shortcut: 'CMD+SHIFT+A',
config: {
alertTypes: ['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark'],
defaultType: 'primary',
messagePlaceholder: 'Enter something',
},
},
},
//...
});
All properties are optional.
| Field | Type | Default Value | Description |
|---|---|---|---|
alertTypes | array | ['primary', 'secondary', 'info', 'success', 'warning', 'danger', 'light', 'dark'] | Alert types that can be used in the editor |
defaultType | string | info | default Alert type (should be either of primary, secondary, info, success, warning, danger, light or dark) |
defaultAlign | string | left | default Alert alignment (should be either of left, center or right) |
messagePlaceholder | string | Type here... | placeholder to show in Alert`s message |
| Field | Type | Description |
|---|---|---|
| message | string | Alert message |
| type | string | Alert type among one of primary, secondary, info, success, warning, danger, light or dark |
| align | string | Align type should be one of left, center or right |
{
"type": "alert",
"data": {
"type": "danger",
"align" : "center",
"text": "<strong>Holy smokes!</strong><br>Something seriously <em>bad</em> happened."
}
}
yarn install.yarn dev to continuously watch for the changes made in ./src/index.js and updates a development bundle under ./dist folder../examples/development.html in the browser to verify the tool's functionality.yarn build to build the production bundle, bump the version in package.json.git tag v1.0.2).git push --tags.yarn publish.This project is licensed under the MIT License.
FAQs
Editor.js tool for adding colorful alerts
The npm package editorjs-alert receives a total of 2,660 weekly downloads. As such, editorjs-alert popularity was classified as popular.
We found that editorjs-alert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.