@tiptap/extension-task-item
Advanced tools
Comparing version 2.3.2 to 2.4.0
import { Node, mergeAttributes, wrappingInputRule } from '@tiptap/core'; | ||
/** | ||
* Matches a task item to a - [ ] on input. | ||
*/ | ||
const inputRegex = /^\s*(\[([( |x])?\])\s$/; | ||
/** | ||
* This extension allows you to create task items. | ||
* @see https://www.tiptap.dev/api/nodes/task-item | ||
*/ | ||
const TaskItem = Node.create({ | ||
@@ -5,0 +12,0 @@ name: 'taskItem', |
@@ -7,3 +7,10 @@ (function (global, factory) { | ||
/** | ||
* Matches a task item to a - [ ] on input. | ||
*/ | ||
const inputRegex = /^\s*(\[([( |x])?\])\s$/; | ||
/** | ||
* This extension allows you to create task items. | ||
* @see https://www.tiptap.dev/api/nodes/task-item | ||
*/ | ||
const TaskItem = core.Node.create({ | ||
@@ -10,0 +17,0 @@ name: 'taskItem', |
import { Node } from '@tiptap/core'; | ||
import { Node as ProseMirrorNode } from '@tiptap/pm/model'; | ||
export interface TaskItemOptions { | ||
/** | ||
* A callback function that is called when the checkbox is clicked while the editor is in readonly mode. | ||
* @param node The prosemirror node of the task item | ||
* @param checked The new checked state | ||
* @returns boolean | ||
*/ | ||
onReadOnlyChecked?: (node: ProseMirrorNode, checked: boolean) => boolean; | ||
/** | ||
* Controls whether the task items can be nested or not. | ||
* @default false | ||
* @example true | ||
*/ | ||
nested: boolean; | ||
/** | ||
* HTML attributes to add to the task item element. | ||
* @default {} | ||
* @example { class: 'foo' } | ||
*/ | ||
HTMLAttributes: Record<string, any>; | ||
/** | ||
* The node type for taskList nodes | ||
* @default 'taskList' | ||
* @example 'myCustomTaskList' | ||
*/ | ||
taskListTypeName: string; | ||
} | ||
/** | ||
* Matches a task item to a - [ ] on input. | ||
*/ | ||
export declare const inputRegex: RegExp; | ||
/** | ||
* This extension allows you to create task items. | ||
* @see https://www.tiptap.dev/api/nodes/task-item | ||
*/ | ||
export declare const TaskItem: Node<TaskItemOptions, any>; |
{ | ||
"name": "@tiptap/extension-task-item", | ||
"description": "task item extension for tiptap", | ||
"version": "2.3.2", | ||
"version": "2.4.0", | ||
"homepage": "https://tiptap.dev", | ||
@@ -32,4 +32,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@tiptap/core": "^2.3.2", | ||
"@tiptap/pm": "^2.3.2" | ||
"@tiptap/core": "^2.4.0", | ||
"@tiptap/pm": "^2.4.0" | ||
}, | ||
@@ -36,0 +36,0 @@ "peerDependencies": { |
@@ -7,10 +7,41 @@ import { | ||
export interface TaskItemOptions { | ||
/** | ||
* A callback function that is called when the checkbox is clicked while the editor is in readonly mode. | ||
* @param node The prosemirror node of the task item | ||
* @param checked The new checked state | ||
* @returns boolean | ||
*/ | ||
onReadOnlyChecked?: (node: ProseMirrorNode, checked: boolean) => boolean | ||
/** | ||
* Controls whether the task items can be nested or not. | ||
* @default false | ||
* @example true | ||
*/ | ||
nested: boolean | ||
/** | ||
* HTML attributes to add to the task item element. | ||
* @default {} | ||
* @example { class: 'foo' } | ||
*/ | ||
HTMLAttributes: Record<string, any> | ||
/** | ||
* The node type for taskList nodes | ||
* @default 'taskList' | ||
* @example 'myCustomTaskList' | ||
*/ | ||
taskListTypeName: string | ||
} | ||
/** | ||
* Matches a task item to a - [ ] on input. | ||
*/ | ||
export const inputRegex = /^\s*(\[([( |x])?\])\s$/ | ||
/** | ||
* This extension allows you to create task items. | ||
* @see https://www.tiptap.dev/api/nodes/task-item | ||
*/ | ||
export const TaskItem = Node.create<TaskItemOptions>({ | ||
@@ -17,0 +48,0 @@ name: 'taskItem', |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59033
723