
Security News
Google’s OSV Fix Just Added 500+ New Advisories — All Thanks to One Small Policy Change
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
@bento-editor/core
Advanced tools
Bento is build on top of Slate. Bento's primary objective is to provide Notion-like editor using Slate APIs. For Bento having this aim, you'll find Bento similar to Slate and Notion regarding its terminology, function, etc.
To better understand Bento, we highly recommend you to read Slate's documents:
and try out Notion.
Editor
Editable
is the main UI field to display user-editted data, think it as a canvas on which you edit content.
Element
Though for users who have experience using Notion or Notion-like editors the term Block
would be their familiar, we stick to using the term Element
so as to follow the Slate's definition. Block and Element are the same, anyway.
Text
(, or Leaf
)On the same reason we call inline-level components as Text. Because Slate uses the term Leaf
to, we guess, refer to the same component and we think that's redundant, we stick to using only Text
in as many situations as possible.
Node
refers to both Element and Text. Read the first section of this Slate's doc to see the difference between them.
Attributes
Each Node has its own set of attributes and their set, or structure, that varies depending on which Node type they are of. One example for an attribute is the href
attribute of @bento-editor/element-link
which is used to create a link; href: 'https://cam-inc.co.jp'
would be regarded as <a href="https://cam-inc.co.jp" />
.
Package
is a deliverable parcel which contains a single Node, is to be plugged in to Bento, and can be owned by Bento or you. Examples are Bento-owned packages on the npm registory like @bento-editor/element-paragraph, and any package you create tailored to your service domain like element-{Your Service Name}-media
to handle your-service-specific media objects.
Toolbox
, Toolbar
and Toolmenu
First of all, please read Notion's document of 'Writing & editing basics' to grab the idea of those tools: Toolbox, Toolbar and Toolmenu.
+
icon on Notion Editor.⋮⋮
icon on Notion Editor.Bento has specific types for Node: type Element
and type Text
in this file.
Bento restricts all packages, including yours, to follow those types, but they are simple and straight-forward; You'll just need to define some of the characters found on the Terminology section one-by-one :)
You can read their code of all the Bento-owned packages prefixed with element-
or text-
as examples when creating your own package.
Though Bento has most of its UI fixed, it allows users to change some of its design tokens by configuring their key-values, like so:
import { Editor } from '@bento-editor/core';
const config = {
themeToken: {
color: {
background: 'lightblue',
backgroundOn: 'darkblue',
}
}
};
const YourEditor = () => {
return (
<Editor config={config} />
);
};
Remember that Bento doesn't intend to offer full-customizable functions related to design, rather Bento offers you the way to adjust its design to your service UI design by allowing you to change only design tokens like color, space, font size, etc. Read this for detail about all the customizable tokens.
Bento watches users' prefers-color-scheme
CSS media feature and switches design tokens accordingly. Pass token values for both light
and dark
modes separately like this:
const config = {
themeToken: {
color: {
light: {
background: 'lightblue',
backgroundOn: 'darkblue',
},
dark: {
background: 'darkblue',
backgroundOn: 'lightblue',
},
}
}
};
FAQs
Core for Bento Editor
We found that @bento-editor/core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
A data handling bug in OSV.dev caused disputed CVEs to disappear from vulnerability feeds until a recent fix restored over 500 advisories.
Research
/Security News
175 malicious npm packages (26k+ downloads) used unpkg CDN to host redirect scripts for a credential-phishing campaign targeting 135+ organizations worldwide.
Security News
Python 3.14 adds template strings, deferred annotations, and subinterpreters, plus free-threaded mode, an experimental JIT, and Sigstore verification.