@tiptap/extension-task-item
Advanced tools
Comparing version 3.0.0-next.3 to 3.0.0-next.4
// src/task-item.ts | ||
import { | ||
mergeAttributes, | ||
Node, | ||
wrappingInputRule | ||
} from "@tiptap/core"; | ||
import { mergeAttributes, Node, wrappingInputRule } from "@tiptap/core"; | ||
var inputRegex = /^\s*(\[([( |x])?\])\s$/; | ||
@@ -78,8 +74,3 @@ var TaskItem = Node.create({ | ||
addNodeView() { | ||
return ({ | ||
node, | ||
HTMLAttributes, | ||
getPos, | ||
editor | ||
}) => { | ||
return ({ node, HTMLAttributes, getPos, editor }) => { | ||
const listItem = document.createElement("li"); | ||
@@ -123,5 +114,3 @@ const checkboxWrapper = document.createElement("label"); | ||
listItem.dataset.checked = node.attrs.checked; | ||
if (node.attrs.checked) { | ||
checkbox.setAttribute("checked", "checked"); | ||
} | ||
checkbox.checked = node.attrs.checked; | ||
checkboxWrapper.append(checkbox, checkboxStyler); | ||
@@ -140,7 +129,3 @@ listItem.append(checkboxWrapper, content); | ||
listItem.dataset.checked = updatedNode.attrs.checked; | ||
if (updatedNode.attrs.checked) { | ||
checkbox.setAttribute("checked", "checked"); | ||
} else { | ||
checkbox.removeAttribute("checked"); | ||
} | ||
checkbox.checked = updatedNode.attrs.checked; | ||
return true; | ||
@@ -165,8 +150,8 @@ } | ||
// src/index.ts | ||
var src_default = TaskItem; | ||
var index_default = TaskItem; | ||
export { | ||
TaskItem, | ||
src_default as default, | ||
index_default as default, | ||
inputRegex | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@tiptap/extension-task-item", | ||
"description": "task item extension for tiptap", | ||
"version": "3.0.0-next.3", | ||
"version": "3.0.0-next.4", | ||
"homepage": "https://tiptap.dev", | ||
@@ -18,3 +18,6 @@ "keywords": [ | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"types": { | ||
"import": "./dist/index.d.ts", | ||
"require": "./dist/index.d.cts" | ||
}, | ||
"import": "./dist/index.js", | ||
@@ -32,4 +35,4 @@ "require": "./dist/index.cjs" | ||
"devDependencies": { | ||
"@tiptap/core": "^3.0.0-next.3", | ||
"@tiptap/pm": "^3.0.0-next.3" | ||
"@tiptap/core": "^3.0.0-next.4", | ||
"@tiptap/pm": "^3.0.0-next.4" | ||
}, | ||
@@ -46,4 +49,5 @@ "peerDependencies": { | ||
"scripts": { | ||
"build": "tsup" | ||
"build": "tsup", | ||
"lint": "prettier ./src/ --check && eslint --cache --quiet --no-error-on-unmatched-pattern ./src/" | ||
} | ||
} | ||
} |
# @tiptap/extension-task-item | ||
[![Version](https://img.shields.io/npm/v/@tiptap/extension-task-item.svg?label=version)](https://www.npmjs.com/package/@tiptap/extension-task-item) | ||
@@ -8,8 +9,11 @@ [![Downloads](https://img.shields.io/npm/dm/@tiptap/extension-task-item.svg)](https://npmcharts.com/compare/tiptap?minimal=true) | ||
## Introduction | ||
Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – 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*. | ||
Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – 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_. | ||
## Official Documentation | ||
Documentation can be found on the [Tiptap website](https://tiptap.dev). | ||
## License | ||
Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md). |
@@ -1,4 +0,2 @@ | ||
import { | ||
KeyboardShortcutCommand, mergeAttributes, Node, wrappingInputRule, | ||
} from '@tiptap/core' | ||
import { KeyboardShortcutCommand, mergeAttributes, Node, wrappingInputRule } from '@tiptap/core' | ||
import { Node as ProseMirrorNode } from '@tiptap/pm/model' | ||
@@ -129,5 +127,3 @@ | ||
addNodeView() { | ||
return ({ | ||
node, HTMLAttributes, getPos, editor, | ||
}) => { | ||
return ({ node, HTMLAttributes, getPos, editor }) => { | ||
const listItem = document.createElement('li') | ||
@@ -187,5 +183,3 @@ const checkboxWrapper = document.createElement('label') | ||
listItem.dataset.checked = node.attrs.checked | ||
if (node.attrs.checked) { | ||
checkbox.setAttribute('checked', 'checked') | ||
} | ||
checkbox.checked = node.attrs.checked | ||
@@ -208,7 +202,3 @@ checkboxWrapper.append(checkbox, checkboxStyler) | ||
listItem.dataset.checked = updatedNode.attrs.checked | ||
if (updatedNode.attrs.checked) { | ||
checkbox.setAttribute('checked', 'checked') | ||
} else { | ||
checkbox.removeAttribute('checked') | ||
} | ||
checkbox.checked = updatedNode.attrs.checked | ||
@@ -215,0 +205,0 @@ return true |
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
279346
11
19
39430
557