Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@tiptap/extension-task-item
Advanced tools
@tiptap/extension-task-item is an extension for the Tiptap editor that allows you to create and manage task items (checkboxes) within your rich text editor. It provides a way to add interactive checkboxes to your content, making it useful for creating to-do lists, task management applications, and other similar functionalities.
Creating Task Items
This code demonstrates how to import and use the TaskItem extension in a Tiptap editor instance. By including TaskItem in the extensions array, you enable the creation of task items within the editor.
import TaskItem from '@tiptap/extension-task-item';
const editor = new Editor({
extensions: [
TaskItem,
],
});
Customizing Task Items
This code shows how to configure the TaskItem extension to allow nested task items. The `nested` option is set to true, enabling the creation of sub-tasks within a task list.
import TaskItem from '@tiptap/extension-task-item';
const editor = new Editor({
extensions: [
TaskItem.configure({
nested: true,
}),
],
});
Handling Task Item State
This code demonstrates how to handle the state of task items within the editor. By listening to the 'update' event, you can get the current state of the editor content in JSON format, which includes the state of the task items (checked or unchecked).
import TaskItem from '@tiptap/extension-task-item';
const editor = new Editor({
extensions: [
TaskItem,
],
});
editor.on('update', ({ editor }) => {
const json = editor.getJSON();
console.log(json);
});
draft-js-checkable-list-item is a plugin for Draft.js that adds checkable list items to the editor. It offers similar functionality to @tiptap/extension-task-item, enabling the creation of interactive checkboxes within a Draft.js editor. This package is specifically designed for Draft.js and may require different integration steps compared to Tiptap.
Tiptap is a headless wrapper around ProseMirror – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as New York Times, The Guardian or Atlassian.
Documentation can be found on the Tiptap website.
Tiptap is open sourced software licensed under the MIT license.
FAQs
task item extension for tiptap
The npm package @tiptap/extension-task-item receives a total of 104,813 weekly downloads. As such, @tiptap/extension-task-item popularity was classified as popular.
We found that @tiptap/extension-task-item demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.