@tiptap/extension-task-item
Advanced tools
Comparing version 2.0.0-alpha.4 to 2.0.0-alpha.5
@@ -6,2 +6,10 @@ # Change Log | ||
# [2.0.0-alpha.5](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-item@2.0.0-alpha.4...@tiptap/extension-task-item@2.0.0-alpha.5) (2020-12-02) | ||
**Note:** Version bump only for package @tiptap/extension-task-item | ||
# [2.0.0-alpha.4](https://github.com/ueberdosis/tiptap-next/compare/@tiptap/extension-task-item@2.0.0-alpha.3...@tiptap/extension-task-item@2.0.0-alpha.4) (2020-12-02) | ||
@@ -8,0 +16,0 @@ |
@@ -57,3 +57,3 @@ 'use strict'; | ||
addNodeView() { | ||
return ({ HTMLAttributes, getPos, editor }) => { | ||
return ({ node, HTMLAttributes, getPos, editor, }) => { | ||
const { view } = editor; | ||
@@ -74,3 +74,3 @@ const listItem = document.createElement('li'); | ||
}); | ||
if (HTMLAttributes['data-checked'] === true) { | ||
if (node.attrs.checked) { | ||
checkbox.setAttribute('checked', 'checked'); | ||
@@ -85,6 +85,12 @@ } | ||
contentDOM: content, | ||
update: node => { | ||
if (node.type !== this.type) { | ||
update: updatedNode => { | ||
if (updatedNode.type !== this.type) { | ||
return false; | ||
} | ||
if (updatedNode.attrs.checked) { | ||
checkbox.setAttribute('checked', 'checked'); | ||
} | ||
else { | ||
checkbox.removeAttribute('checked'); | ||
} | ||
return true; | ||
@@ -91,0 +97,0 @@ }, |
@@ -53,3 +53,3 @@ import { Node, mergeAttributes } from '@tiptap/core'; | ||
addNodeView() { | ||
return ({ HTMLAttributes, getPos, editor }) => { | ||
return ({ node, HTMLAttributes, getPos, editor, }) => { | ||
const { view } = editor; | ||
@@ -70,3 +70,3 @@ const listItem = document.createElement('li'); | ||
}); | ||
if (HTMLAttributes['data-checked'] === true) { | ||
if (node.attrs.checked) { | ||
checkbox.setAttribute('checked', 'checked'); | ||
@@ -81,6 +81,12 @@ } | ||
contentDOM: content, | ||
update: node => { | ||
if (node.type !== this.type) { | ||
update: updatedNode => { | ||
if (updatedNode.type !== this.type) { | ||
return false; | ||
} | ||
if (updatedNode.attrs.checked) { | ||
checkbox.setAttribute('checked', 'checked'); | ||
} | ||
else { | ||
checkbox.removeAttribute('checked'); | ||
} | ||
return true; | ||
@@ -87,0 +93,0 @@ }, |
@@ -56,3 +56,3 @@ (function (global, factory) { | ||
addNodeView() { | ||
return ({ HTMLAttributes, getPos, editor }) => { | ||
return ({ node, HTMLAttributes, getPos, editor, }) => { | ||
const { view } = editor; | ||
@@ -73,3 +73,3 @@ const listItem = document.createElement('li'); | ||
}); | ||
if (HTMLAttributes['data-checked'] === true) { | ||
if (node.attrs.checked) { | ||
checkbox.setAttribute('checked', 'checked'); | ||
@@ -84,6 +84,12 @@ } | ||
contentDOM: content, | ||
update: node => { | ||
if (node.type !== this.type) { | ||
update: updatedNode => { | ||
if (updatedNode.type !== this.type) { | ||
return false; | ||
} | ||
if (updatedNode.attrs.checked) { | ||
checkbox.setAttribute('checked', 'checked'); | ||
} | ||
else { | ||
checkbox.removeAttribute('checked'); | ||
} | ||
return true; | ||
@@ -90,0 +96,0 @@ }, |
{ | ||
"name": "@tiptap/extension-task-item", | ||
"description": "task item extension for tiptap", | ||
"version": "2.0.0-alpha.4", | ||
"version": "2.0.0-alpha.5", | ||
"homepage": "https://tiptap.dev", | ||
@@ -30,3 +30,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "a884cb81de8783d0097741c1ddb97a82ea88ae0e" | ||
"gitHead": "cf47ceb4c6a1c8e8aadc3bc45009e2d88056e7b9" | ||
} |
@@ -75,3 +75,8 @@ import { Node, mergeAttributes } from '@tiptap/core' | ||
addNodeView() { | ||
return ({ HTMLAttributes, getPos, editor }) => { | ||
return ({ | ||
node, | ||
HTMLAttributes, | ||
getPos, | ||
editor, | ||
}) => { | ||
const { view } = editor | ||
@@ -95,3 +100,3 @@ const listItem = document.createElement('li') | ||
if (HTMLAttributes['data-checked'] === true) { | ||
if (node.attrs.checked) { | ||
checkbox.setAttribute('checked', 'checked') | ||
@@ -109,7 +114,13 @@ } | ||
contentDOM: content, | ||
update: node => { | ||
if (node.type !== this.type) { | ||
update: updatedNode => { | ||
if (updatedNode.type !== this.type) { | ||
return false | ||
} | ||
if (updatedNode.attrs.checked) { | ||
checkbox.setAttribute('checked', 'checked') | ||
} else { | ||
checkbox.removeAttribute('checked') | ||
} | ||
return true | ||
@@ -116,0 +127,0 @@ }, |
Sorry, the diff of this file is too big to display
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
478027
784