
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.
@block-forge/block-forge-editor
Advanced tools
A powerful article builder for React based on EditorJS and built with shadcn/ui and Tailwind CSS. Create beautiful, structured content with a modern block-based editor.
npm i @block-forge/block-forge-editor
# or
yarn add @block-forge/block-forge-editor
# or
pnpm add @block-forge/block-forge-editor
import { BlockForgeEditor } from "@block-forge/block-forge-editor";
import "@block-forge/block-forge-editor/dist/index.css";
function App() {
return (
<BlockForgeEditor
data={initialData}
onChange={handleChange}
onSave={handleSave}
onCancel={handleCancel}
tools={[...array of your editor js tools]}
/>
);
}
The easiest way to control components is using predefined tool presets:
import {
BlockForgeEditor,
TOOL_PRESETS,
} from "@block-forge/block-forge-editor";
function App() {
return (
<BlockForgeEditor
id="my-editor"
toolPreset="basic" // Use a predefined preset
onChange={handleChange}
onSave={handleSave}
/>
);
}
full
- All available components (default)minimal
- Basic text editing: paragraph, list, dividerbasic
- Common components: paragraph, list, table, divider, quote, codemedia
- Media-focused: paragraph, list, imageSingle, imageGallery, videoEmbed, figmaaccordion
- For accordion content: paragraph, list, divider, tablecolumns
- For column layouts: paragraph, list, divider, tableFor more granular control, you can specify exactly which tools to enable:
import { BlockForgeEditor } from "@block-forge/block-forge-editor";
function App() {
return (
<BlockForgeEditor
id="my-editor"
enabledTools={["paragraph", "list", "imageSingle", "quote", "timeline"]}
onChange={handleChange}
onSave={handleSave}
/>
);
}
The following components can be enabled via enabledTools
:
paragraph
- Text paragraphs with formattinglist
- Ordered and unordered liststable
- Data tables with headersdivider
- Visual separatorsexcalidraw
- Drawing and diagramscolumns
- Multi-column layoutsimageGallery
- Image galleriesimageSingle
- Single image blocksfigma
- Figma embed blocksquote
- Quote blocks with attributioncode
- Code blocks with syntax highlightingvideoEmbed
- Video embeds (YouTube, Vimeo, etc.)social
- Social media linkscard
- Card componentsstats
- Statistics/metrics displaystimeline
- Timeline componentsprogress
- Progress bars and indicatorstestimonials
- Testimonial blocksaccordion
- Collapsible accordion sectionsYou can provide tools using tools prop which will override any default tool with same name:
import { BlockForgeEditor } from "@block-forge/block-forge-editor";
function App() {
const tools = [
{
paragraph: {
class: MyCustomParagraphTool,
config: {
preserveBlank: true,
},
},
},
];
return (
<BlockForgeEditor
id="my-editor"
tools={tools}
onChange={handleChange}
onSave={handleSave}
/>
);
}
The editor saves data in EditorJS format. Here's an example of the saved data structure:
type EditorData = {
time: number;
blocks: Array<{
id: string;
type: string;
data: any;
}>;
version: string;
meta?: {
font?: string;
background?: string;
[key: string]: any;
};
};
{
"time": 1750583863555,
"blocks": [
{
"id": "4k-k_4z4uf",
"type": "paragraph",
"data": {
"text": "<b>Block Forge Editor Demo</b>",
"fontSize": 20,
"tag": "h1"
}
},
{
"id": "P7pzcUmYw1",
"type": "list",
"data": {
"style": "unordered",
"items": [
{ "content": "Item 1", "meta": {}, "items": [] },
{ "content": "Item 2", "meta": {}, "items": [] }
]
}
},
{
"id": "5CxpNLMX0W",
"type": "table",
"data": {
"withHeadings": true,
"content": [
["Header 1", "Header 2"],
["Cell 1", "Cell 2"]
]
}
}
],
"version": "2.31.0-rc.7",
"meta": {
"font": "times",
"background": "emerald-50"
}
}
const handleChange = (data: EditorData) => {
console.log('Editor data changed:', data);
// Save to your backend or state management
};
const handleSave = async (data: EditorData) => {
console.log('Editor data changed:', data);
};
const handleCancel = () => {
console.log('Edit cancelled')
}
## Available Blocks
This document provides a comprehensive overview of the saved data structure for each component.
### AccordionEditor
```typescript
type TAccordionData = {
title: string;
data: OutputData | null;
};
type TColumnData = {
data: OutputData;
};
type TParagraphData = {
text: string;
fontSize?: number;
};
type THeaderData = {
text: string;
level: number;
fontSize: number;
};
type TEmbedData = {
url: string;
variant: "primary" | "secondary";
platform: "vimeo" | "other" | "youtube";
};
type TDividerData = {
color?: string;
};
type TTimelineData = {
variant: "primary" | "secondary";
events: Array<{
date: string;
title: string;
description: string;
}>;
};
type TTestimonialsData = {
variant: "primary" | "secondary";
items: Array<{
name: string;
role: string;
text: string;
photo: string;
}>;
};
type TStatsData = {
variant: "primary" | "secondary";
items: Array<{
value: string;
label: string;
icon?: string;
}>;
};
type TSocialData = {
variant: "primary" | "secondary";
links: Array<{
url: string;
platform: string;
}>;
};
type TQuoteData = {
text: string;
author?: string;
source?: string;
variant: "primary" | "secondary";
};
type TProgressData = {
variant: "primary" | "secondary";
items: Array<{
label: string;
value: number;
}>;
};
The Table component extends EditorJsTable and includes the following sanitization rules:
{
br: true,
div: true,
a: true,
i: true,
p: true,
b: true
}
We welcome contributions!
Semantic-release automatically publishes a new version to npm whenever changes are merged into main
. Make sure your commits follow the Conventional Commits specification.
Special thanks to the all amazing open-source projects that made this library possible!
MIT ©
FAQs
A React component library with modern UI blocks
The npm package @block-forge/block-forge-editor receives a total of 0 weekly downloads. As such, @block-forge/block-forge-editor popularity was classified as not popular.
We found that @block-forge/block-forge-editor demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
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.