Merge branch 'develop' into fix/can-commands

This commit is contained in:
guanriyue 2024-10-24 19:52:10 +08:00 committed by GitHub
commit 83e48ffda3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
133 changed files with 871 additions and 476 deletions

View File

@ -1,5 +0,0 @@
---
"@tiptap/core": patch
---
insertContentAt, setContent, and insertContent commands now respect the editor's pre-defined parseOptions configuration if the command does not specify it's own parseOptions

View File

@ -1,6 +0,0 @@
---
"@tiptap/extension-italic": patch
"@tiptap/extension-bold": patch
---
Add parse rules that reset bold & italic marks

View File

@ -1,5 +0,0 @@
---
"@tiptap/vue-3": patch
---
Fix editor content being destroyed before transition end

View File

@ -1,5 +0,0 @@
---
"@tiptap/pm": patch
---
Update prosemirror-view version

View File

@ -1,5 +0,0 @@
---
"@tiptap/extension-mention": patch
---
Increase mention extension priority to allow mentions to be inserted in lists using the Enter key

View File

@ -1,5 +0,0 @@
---
"@tiptap/core": patch
---
Fixed an issue while updating attributes on a NodePos that was not a text

View File

@ -1,5 +0,0 @@
---
"@tiptap/core": patch
---
Updates the typings of `DecorationsWithTypes` to be more accurate to the prosemirror implementation even though it is not completely exposed as an API

View File

@ -1,5 +0,0 @@
---
"@tiptap/core": patch
---
Added role and aria-label attributes to the contenteditable field for better screenreader support and mouseless controls

View File

@ -1,5 +0,0 @@
---
"@tiptap/core": patch
---
Fixed issues with NodePos child positions causing wrong positions when used on non-text atoms

View File

@ -1,5 +0,0 @@
---
"@tiptap/core": patch
---
Fixed an issue with getMarkRange not returning the correct range when cursor is at the start of the specified mark

View File

@ -1,5 +0,0 @@
---
"@tiptap/starter-kit": patch
---
Adds @tiptap/extension-text-style to @tiptap/starter-kit deps but does not install the extension, since it is only to resolve a peer dep install for list-items

View File

@ -1,7 +0,0 @@
---
"@tiptap/extension-table-cell": patch
"@tiptap/extension-table-header": patch
---
Tables now properly respect colwidths with multiple values, fixing resizeable columns when the first row has a colspan

View File

@ -1,6 +1,7 @@
import './styles.scss'
import { Color } from '@tiptap/extension-color'
import Link from '@tiptap/extension-link'
import ListItem from '@tiptap/extension-list-item'
import TextStyle from '@tiptap/extension-text-style'
import { EditorProvider, useCurrentEditor } from '@tiptap/react'
@ -48,6 +49,7 @@ const MenuBar = () => {
const extensions = [
Color.configure({ types: [TextStyle.name, ListItem.name] }),
TextStyle.configure({ types: [ListItem.name] }),
Link,
StarterKit.configure({
bulletList: {
keepMarks: true,

View File

@ -11,7 +11,7 @@ context('/src/Commands/InsertContent/React/', () => {
cy.get('button[data-test-id="html-content"]').click()
// check if the content html is correct
cy.get('.tiptap').should('contain.html', '<h1>Tiptap</h1><p><strong>Hello World</strong></p><p>This is a paragraph<br>with a break.</p><p>And this is some additional string content.</p>')
cy.get('.tiptap').should('contain.html', '<h1><a target="_blank" rel="noopener noreferrer nofollow" href="https://tiptap.dev/">Tiptap</a></h1><p><strong>Hello World</strong></p><p>This is a paragraph<br>with a break.</p><p>And this is some additional string content.</p>')
})
it('should keep spaces inbetween tags in html content', () => {

View File

@ -72,19 +72,23 @@ const getRandomColor = () => getRandomElement(colors)
const getRandomName = () => getRandomElement(names)
const getInitialUser = () => {
return (
{
name: getRandomName(),
color: getRandomColor(),
}
)
return {
name: getRandomName(),
color: getRandomColor(),
}
}
const Editor = ({ ydoc, provider, room }) => {
const Editor = ({
ydoc, provider, room,
}) => {
const [status, setStatus] = useState('connecting')
const [currentUser, setCurrentUser] = useState(getInitialUser)
const editor = useEditor({
enableContentCheck: true,
onContentError: ({ disableCollaboration }) => {
disableCollaboration()
},
onCreate: ({ editor: currentEditor }) => {
provider.on('synced', () => {
if (currentEditor.isEmpty) {
@ -99,13 +103,13 @@ const Editor = ({ ydoc, provider, room }) => {
Highlight,
TaskList,
TaskItem,
CharacterCount.configure({
CharacterCount.extend().configure({
limit: 10000,
}),
Collaboration.configure({
Collaboration.extend().configure({
document: ydoc,
}),
CollaborationCursor.configure({
CollaborationCursor.extend().configure({
provider,
}),
],
@ -183,7 +187,10 @@ const Editor = ({ ydoc, provider, room }) => {
<EditorContent editor={editor} className="main-group" />
<div className="collab-status-group" data-state={status === 'connected' ? 'online' : 'offline'}>
<div
className="collab-status-group"
data-state={status === 'connected' ? 'online' : 'offline'}
>
<label>
{status === 'connected'
? `${editor.storage.collaborationCursor.users.length} user${
@ -191,7 +198,9 @@ const Editor = ({ ydoc, provider, room }) => {
} online in ${room}`
: 'offline'}
</label>
<button style={{ '--color': currentUser.color }} onClick={setName}> {currentUser.name}</button>
<button style={{ '--color': currentUser.color }} onClick={setName}>
{currentUser.name}
</button>
</div>
</div>
)

View File

@ -9,7 +9,7 @@ const appId = '7j9y6m10'
const room = `room.${new Date()
.getFullYear()
.toString()
.slice(-2)}${new Date().getMonth() + 1}${new Date().getDate()}`
.slice(-2)}${new Date().getMonth() + 1}${new Date().getDate()}-ok`
// ydoc and provider for Editor A
const ydocA = new Y.Doc()

View File

@ -29,7 +29,6 @@
.hljs-template-variable,
.hljs-attribute,
.hljs-tag,
.hljs-name,
.hljs-regexp,
.hljs-link,
.hljs-name,

328
package-lock.json generated
View File

@ -18849,10 +18849,10 @@
},
"packages/core": {
"name": "@tiptap/core",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/pm": "^2.8.0"
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -18864,10 +18864,10 @@
},
"packages/extension-blockquote": {
"name": "@tiptap/extension-blockquote",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -18879,10 +18879,10 @@
},
"packages/extension-bold": {
"name": "@tiptap/extension-bold",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -18894,14 +18894,14 @@
},
"packages/extension-bubble-menu": {
"name": "@tiptap/extension-bubble-menu",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"dependencies": {
"tippy.js": "^6.3.7"
},
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -18914,30 +18914,26 @@
},
"packages/extension-bullet-list": {
"name": "@tiptap/extension-bullet-list",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/extension-list-item": "^2.8.0",
"@tiptap/extension-text-style": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",
"@tiptap/extension-list-item": "^2.7.0",
"@tiptap/extension-text-style": "^2.7.0"
"@tiptap/core": "^2.7.0"
}
},
"packages/extension-character-count": {
"name": "@tiptap/extension-character-count",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -18950,10 +18946,10 @@
},
"packages/extension-code": {
"name": "@tiptap/extension-code",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -18965,11 +18961,11 @@
},
"packages/extension-code-block": {
"name": "@tiptap/extension-code-block",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -18982,12 +18978,12 @@
},
"packages/extension-code-block-lowlight": {
"name": "@tiptap/extension-code-block-lowlight",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/extension-code-block": "^2.8.0",
"@tiptap/pm": "^2.8.0",
"@tiptap/core": "^2.9.1",
"@tiptap/extension-code-block": "^2.9.1",
"@tiptap/pm": "^2.9.1",
"lowlight": "^2 || ^3"
},
"funding": {
@ -19004,11 +19000,11 @@
},
"packages/extension-collaboration": {
"name": "@tiptap/extension-collaboration",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0",
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1",
"y-prosemirror": "^1.2.12"
},
"funding": {
@ -19023,10 +19019,10 @@
},
"packages/extension-collaboration-cursor": {
"name": "@tiptap/extension-collaboration-cursor",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/core": "^2.9.1",
"y-prosemirror": "^1.2.12"
},
"funding": {
@ -19090,11 +19086,11 @@
},
"packages/extension-color": {
"name": "@tiptap/extension-color",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/extension-text-style": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/extension-text-style": "^2.9.1"
},
"funding": {
"type": "github",
@ -19107,10 +19103,10 @@
},
"packages/extension-document": {
"name": "@tiptap/extension-document",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19122,11 +19118,11 @@
},
"packages/extension-dropcursor": {
"name": "@tiptap/extension-dropcursor",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -19139,14 +19135,14 @@
},
"packages/extension-floating-menu": {
"name": "@tiptap/extension-floating-menu",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"dependencies": {
"tippy.js": "^6.3.7"
},
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -19159,11 +19155,11 @@
},
"packages/extension-focus": {
"name": "@tiptap/extension-focus",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -19176,11 +19172,11 @@
},
"packages/extension-font-family": {
"name": "@tiptap/extension-font-family",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/extension-text-style": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/extension-text-style": "^2.9.1"
},
"funding": {
"type": "github",
@ -19193,11 +19189,11 @@
},
"packages/extension-gapcursor": {
"name": "@tiptap/extension-gapcursor",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -19210,10 +19206,10 @@
},
"packages/extension-hard-break": {
"name": "@tiptap/extension-hard-break",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19225,10 +19221,10 @@
},
"packages/extension-heading": {
"name": "@tiptap/extension-heading",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19240,10 +19236,10 @@
},
"packages/extension-highlight": {
"name": "@tiptap/extension-highlight",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19255,11 +19251,11 @@
},
"packages/extension-history": {
"name": "@tiptap/extension-history",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -19272,11 +19268,11 @@
},
"packages/extension-horizontal-rule": {
"name": "@tiptap/extension-horizontal-rule",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -19289,10 +19285,10 @@
},
"packages/extension-image": {
"name": "@tiptap/extension-image",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19304,10 +19300,10 @@
},
"packages/extension-italic": {
"name": "@tiptap/extension-italic",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19319,14 +19315,14 @@
},
"packages/extension-link": {
"name": "@tiptap/extension-link",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"dependencies": {
"linkifyjs": "^4.1.0"
},
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -19339,10 +19335,10 @@
},
"packages/extension-list-item": {
"name": "@tiptap/extension-list-item",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19354,10 +19350,10 @@
},
"packages/extension-list-keymap": {
"name": "@tiptap/extension-list-keymap",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19369,12 +19365,12 @@
},
"packages/extension-mention": {
"name": "@tiptap/extension-mention",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0",
"@tiptap/suggestion": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1",
"@tiptap/suggestion": "^2.9.1"
},
"funding": {
"type": "github",
@ -19388,29 +19384,25 @@
},
"packages/extension-ordered-list": {
"name": "@tiptap/extension-ordered-list",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/extension-list-item": "^2.8.0",
"@tiptap/extension-text-style": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",
"@tiptap/extension-list-item": "^2.7.0",
"@tiptap/extension-text-style": "^2.7.0"
"@tiptap/core": "^2.7.0"
}
},
"packages/extension-paragraph": {
"name": "@tiptap/extension-paragraph",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19422,11 +19414,11 @@
},
"packages/extension-placeholder": {
"name": "@tiptap/extension-placeholder",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -19439,10 +19431,10 @@
},
"packages/extension-strike": {
"name": "@tiptap/extension-strike",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19454,10 +19446,10 @@
},
"packages/extension-subscript": {
"name": "@tiptap/extension-subscript",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19469,10 +19461,10 @@
},
"packages/extension-superscript": {
"name": "@tiptap/extension-superscript",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19484,11 +19476,11 @@
},
"packages/extension-table": {
"name": "@tiptap/extension-table",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -19501,10 +19493,10 @@
},
"packages/extension-table-cell": {
"name": "@tiptap/extension-table-cell",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19516,10 +19508,10 @@
},
"packages/extension-table-header": {
"name": "@tiptap/extension-table-header",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19531,10 +19523,10 @@
},
"packages/extension-table-row": {
"name": "@tiptap/extension-table-row",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19546,11 +19538,11 @@
},
"packages/extension-task-item": {
"name": "@tiptap/extension-task-item",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -19563,10 +19555,10 @@
},
"packages/extension-task-list": {
"name": "@tiptap/extension-task-list",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19578,10 +19570,10 @@
},
"packages/extension-text": {
"name": "@tiptap/extension-text",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19593,10 +19585,10 @@
},
"packages/extension-text-align": {
"name": "@tiptap/extension-text-align",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19608,10 +19600,10 @@
},
"packages/extension-text-style": {
"name": "@tiptap/extension-text-style",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19623,10 +19615,10 @@
},
"packages/extension-typography": {
"name": "@tiptap/extension-typography",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19638,10 +19630,10 @@
},
"packages/extension-underline": {
"name": "@tiptap/extension-underline",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19653,10 +19645,10 @@
},
"packages/extension-youtube": {
"name": "@tiptap/extension-youtube",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"funding": {
"type": "github",
@ -19668,14 +19660,14 @@
},
"packages/html": {
"name": "@tiptap/html",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"dependencies": {
"zeed-dom": "^0.15.1"
},
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -19717,7 +19709,7 @@
},
"packages/pm": {
"name": "@tiptap/pm",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"dependencies": {
"prosemirror-changeset": "^2.2.1",
@ -19746,18 +19738,18 @@
},
"packages/react": {
"name": "@tiptap/react",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"dependencies": {
"@tiptap/extension-bubble-menu": "^2.8.0",
"@tiptap/extension-floating-menu": "^2.8.0",
"@tiptap/extension-bubble-menu": "^2.9.1",
"@tiptap/extension-floating-menu": "^2.9.1",
"@types/use-sync-external-store": "^0.0.6",
"fast-deep-equal": "^3",
"use-sync-external-store": "^1.2.2"
},
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0",
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1",
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.6",
"react": "^18.0.0",
@ -19776,30 +19768,30 @@
},
"packages/starter-kit": {
"name": "@tiptap/starter-kit",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"dependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/extension-blockquote": "^2.8.0",
"@tiptap/extension-bold": "^2.8.0",
"@tiptap/extension-bullet-list": "^2.8.0",
"@tiptap/extension-code": "^2.8.0",
"@tiptap/extension-code-block": "^2.8.0",
"@tiptap/extension-document": "^2.8.0",
"@tiptap/extension-dropcursor": "^2.8.0",
"@tiptap/extension-gapcursor": "^2.8.0",
"@tiptap/extension-hard-break": "^2.8.0",
"@tiptap/extension-heading": "^2.8.0",
"@tiptap/extension-history": "^2.8.0",
"@tiptap/extension-horizontal-rule": "^2.8.0",
"@tiptap/extension-italic": "^2.8.0",
"@tiptap/extension-list-item": "^2.8.0",
"@tiptap/extension-ordered-list": "^2.8.0",
"@tiptap/extension-paragraph": "^2.8.0",
"@tiptap/extension-strike": "^2.8.0",
"@tiptap/extension-text": "^2.8.0",
"@tiptap/extension-text-style": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/extension-blockquote": "^2.9.1",
"@tiptap/extension-bold": "^2.9.1",
"@tiptap/extension-bullet-list": "^2.9.1",
"@tiptap/extension-code": "^2.9.1",
"@tiptap/extension-code-block": "^2.9.1",
"@tiptap/extension-document": "^2.9.1",
"@tiptap/extension-dropcursor": "^2.9.1",
"@tiptap/extension-gapcursor": "^2.9.1",
"@tiptap/extension-hard-break": "^2.9.1",
"@tiptap/extension-heading": "^2.9.1",
"@tiptap/extension-history": "^2.9.1",
"@tiptap/extension-horizontal-rule": "^2.9.1",
"@tiptap/extension-italic": "^2.9.1",
"@tiptap/extension-list-item": "^2.9.1",
"@tiptap/extension-ordered-list": "^2.9.1",
"@tiptap/extension-paragraph": "^2.9.1",
"@tiptap/extension-strike": "^2.9.1",
"@tiptap/extension-text": "^2.9.1",
"@tiptap/extension-text-style": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -19808,11 +19800,11 @@
},
"packages/suggestion": {
"name": "@tiptap/suggestion",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"funding": {
"type": "github",
@ -19825,16 +19817,16 @@
},
"packages/vue-2": {
"name": "@tiptap/vue-2",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"dependencies": {
"@tiptap/extension-bubble-menu": "^2.8.0",
"@tiptap/extension-floating-menu": "^2.8.0",
"@tiptap/extension-bubble-menu": "^2.9.1",
"@tiptap/extension-floating-menu": "^2.9.1",
"vue-ts-types": "^1.6.0"
},
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0",
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1",
"vue": "^2.6.0"
},
"funding": {
@ -19885,15 +19877,15 @@
},
"packages/vue-3": {
"name": "@tiptap/vue-3",
"version": "2.8.0",
"version": "2.9.1",
"license": "MIT",
"dependencies": {
"@tiptap/extension-bubble-menu": "^2.8.0",
"@tiptap/extension-floating-menu": "^2.8.0"
"@tiptap/extension-bubble-menu": "^2.9.1",
"@tiptap/extension-floating-menu": "^2.9.1"
},
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0",
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1",
"vue": "^3.0.0"
},
"funding": {

View File

@ -1,5 +1,19 @@
# Change Log
## 2.9.1
## 2.9.0
### Patch Changes
- ffb51d3: insertContentAt, setContent, and insertContent commands now respect the editor's pre-defined parseOptions configuration if the command does not specify it's own parseOptions
- 873a67c: This allows the Editor isntance to unregister multiple plugins in a single editor state replacement
- d96f679: Fixed an issue while updating attributes on a NodePos that was not a text
- e606c06: Updates the typings of `DecorationsWithTypes` to be more accurate to the prosemirror implementation even though it is not completely exposed as an API
- a2eea24: Added role and aria-label attributes to the contenteditable field for better screenreader support and mouseless controls
- d96f679: Fixed issues with NodePos child positions causing wrong positions when used on non-text atoms
- 4efd227: Fixed an issue with getMarkRange not returning the correct range when cursor is at the start of the specified mark
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/core",
"description": "headless rich text editor",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -32,7 +32,7 @@
"dist"
],
"devDependencies": {
"@tiptap/pm": "^2.8.0"
"@tiptap/pm": "^2.9.1"
},
"peerDependencies": {
"@tiptap/pm": "^2.7.0"

View File

@ -237,20 +237,32 @@ export class Editor extends EventEmitter<EditorEvents> {
/**
* Unregister a ProseMirror plugin.
*
* @param nameOrPluginKey The plugins name
* @param nameOrPluginKeyToRemove The plugins name
* @returns The new editor state or undefined if the editor is destroyed
*/
public unregisterPlugin(nameOrPluginKey: string | PluginKey): EditorState | undefined {
public unregisterPlugin(nameOrPluginKeyToRemove: string | PluginKey | (string | PluginKey)[]): EditorState | undefined {
if (this.isDestroyed) {
return undefined
}
// @ts-ignore
const name = typeof nameOrPluginKey === 'string' ? `${nameOrPluginKey}$` : nameOrPluginKey.key
const prevPlugins = this.state.plugins
let plugins = prevPlugins;
([] as (string | PluginKey)[]).concat(nameOrPluginKeyToRemove).forEach(nameOrPluginKey => {
// @ts-ignore
const name = typeof nameOrPluginKey === 'string' ? `${nameOrPluginKey}$` : nameOrPluginKey.key
// @ts-ignore
plugins = prevPlugins.filter(plugin => !plugin.key.startsWith(name))
})
if (prevPlugins.length === plugins.length) {
// No plugin was removed, so we dont need to update the state
return undefined
}
const state = this.state.reconfigure({
// @ts-ignore
plugins: this.state.plugins.filter(plugin => !plugin.key.startsWith(name)),
plugins,
})
this.view.updateState(state)
@ -325,6 +337,9 @@ export class Editor extends EventEmitter<EditorEvents> {
editor: this,
error: e as Error,
disableCollaboration: () => {
if (this.storage.collaboration) {
this.storage.collaboration.isDisabled = true
}
// To avoid syncing back invalid content, reinitialize the extensions without the collaboration extension
this.options.extensions = this.options.extensions.filter(extension => extension.name !== 'collaboration')

View File

@ -85,7 +85,9 @@ export const insertContentAt: RawCommands['insertContentAt'] = (position, value,
editor,
error: e as Error,
disableCollaboration: () => {
console.error('[tiptap error]: Unable to disable collaboration at this point in time')
if (editor.storage.collaboration) {
editor.storage.collaboration.isDisabled = true
}
},
})
return false

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-blockquote",
"description": "blockquote extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,13 @@
# Change Log
## 2.9.1
## 2.9.0
### Patch Changes
- 6fae240: Add parse rules that reset bold & italic marks
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-bold",
"description": "bold extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-bubble-menu",
"description": "bubble-menu extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -38,8 +38,8 @@
},
"sideEffects": false,
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,13 @@
# Change Log
## 2.9.1
### Patch Changes
- 0c9004f: This resolves an issue where the bullet-list and ordered-list extensions were depending on the list-item and text-style extensions unneccesarily. They are no longer imported and constants are used instead.
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-bullet-list",
"description": "bullet list extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,14 +29,10 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/extension-list-item": "^2.8.0",
"@tiptap/extension-text-style": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",
"@tiptap/extension-list-item": "^2.7.0",
"@tiptap/extension-text-style": "^2.7.0"
"@tiptap/core": "^2.7.0"
},
"repository": {
"type": "git",

View File

@ -1,6 +1,7 @@
import { mergeAttributes, Node, wrappingInputRule } from '@tiptap/core'
import { ListItem } from '@tiptap/extension-list-item'
import { TextStyle } from '@tiptap/extension-text-style'
const ListItemName = 'listItem'
const TextStyleName = 'textStyle'
export interface BulletListOptions {
/**
@ -86,7 +87,7 @@ export const BulletList = Node.create<BulletListOptions>({
return {
toggleBulletList: () => ({ commands, chain }) => {
if (this.options.keepAttributes) {
return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItem.name, this.editor.getAttributes(TextStyle.name)).run()
return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName, this.editor.getAttributes(TextStyleName)).run()
}
return commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
},
@ -111,7 +112,7 @@ export const BulletList = Node.create<BulletListOptions>({
type: this.type,
keepMarks: this.options.keepMarks,
keepAttributes: this.options.keepAttributes,
getAttributes: () => { return this.editor.getAttributes(TextStyle.name) },
getAttributes: () => { return this.editor.getAttributes(TextStyleName) },
editor: this.editor,
})
}

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-character-count",
"description": "font family extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,8 +29,8 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-code-block-lowlight",
"description": "code block extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,9 +29,9 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/extension-code-block": "^2.8.0",
"@tiptap/pm": "^2.8.0",
"@tiptap/core": "^2.9.1",
"@tiptap/extension-code-block": "^2.9.1",
"@tiptap/pm": "^2.9.1",
"lowlight": "^2 || ^3"
},
"peerDependencies": {

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-code-block",
"description": "code block extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,8 +29,8 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-code",
"description": "code extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-collaboration-cursor",
"description": "collaboration cursor extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/core": "^2.9.1",
"y-prosemirror": "^1.2.12"
},
"peerDependencies": {

View File

@ -1,5 +1,13 @@
# Change Log
## 2.9.1
## 2.9.0
### Minor Changes
- 873a67c: When collaborating on a document, a client may send changes which are invalid to the current client. This change makes it so that the client can be disabled from synchronizing any further changes to avoid the default behavior of stripping unknown content. This would allow the other client to continue editing on the document while still synchronizing any known changes.
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-collaboration",
"description": "collaboration extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,8 +29,8 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0",
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1",
"y-prosemirror": "^1.2.12"
},
"peerDependencies": {

View File

@ -1,4 +1,5 @@
import { Extension } from '@tiptap/core'
import { Plugin, PluginKey } from '@tiptap/pm/state'
import { EditorView } from '@tiptap/pm/view'
import {
redo,
@ -6,10 +7,12 @@ import {
ySyncPlugin,
yUndoPlugin,
yUndoPluginKey,
yXmlFragmentToProsemirrorJSON,
} from 'y-prosemirror'
import { UndoManager } from 'yjs'
import { Doc, UndoManager, XmlFragment } from 'yjs'
type YSyncOpts = Parameters<typeof ySyncPlugin>[1]
type YSyncOpts = Parameters<typeof ySyncPlugin>[1];
type YUndoOpts = Parameters<typeof yUndoPlugin>[0];
declare module '@tiptap/core' {
interface Commands<ReturnType> {
@ -18,49 +21,65 @@ declare module '@tiptap/core' {
* Undo recent changes
* @example editor.commands.undo()
*/
undo: () => ReturnType,
undo: () => ReturnType;
/**
* Reapply reverted changes
* @example editor.commands.redo()
*/
redo: () => ReturnType,
}
redo: () => ReturnType;
};
}
}
export interface CollaborationStorage {
/**
* Whether collaboration is currently disabled.
* Disabling collaboration will prevent any changes from being synced with other users.
*/
isDisabled: boolean;
}
export interface CollaborationOptions {
/**
* An initialized Y.js document.
* @example new Y.Doc()
*/
document: any,
document?: Doc | null;
/**
* Name of a Y.js fragment, can be changed to sync multiple fields with one Y.js document.
* @default 'default'
* @example 'my-custom-field'
*/
field: string,
field?: string;
/**
* A raw Y.js fragment, can be used instead of `document` and `field`.
* @example new Y.Doc().getXmlFragment('body')
*/
fragment: any,
fragment?: XmlFragment | null;
/**
* Fired when the content from Yjs is initially rendered to Tiptap.
*/
onFirstRender?: () => void,
onFirstRender?: () => void;
ySyncOptions?: YSyncOpts
/**
* Options for the Yjs sync plugin.
*/
ySyncOptions?: YSyncOpts;
/**
* Options for the Yjs undo plugin.
*/
yUndoOptions?: YUndoOpts;
}
/**
* This extension allows you to collaborate with others in real-time.
* @see https://tiptap.dev/api/extensions/collaboration
*/
export const Collaboration = Extension.create<CollaborationOptions>({
export const Collaboration = Extension.create<CollaborationOptions, CollaborationStorage>({
name: 'collaboration',
priority: 1000,
@ -73,44 +92,54 @@ export const Collaboration = Extension.create<CollaborationOptions>({
}
},
addStorage() {
return {
isDisabled: false,
}
},
onCreate() {
if (this.editor.extensionManager.extensions.find(extension => extension.name === 'history')) {
console.warn('[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history".')
console.warn(
'[tiptap warn]: "@tiptap/extension-collaboration" comes with its own history support and is not compatible with "@tiptap/extension-history".',
)
}
},
addCommands() {
return {
undo: () => ({ tr, state, dispatch }) => {
tr.setMeta('preventDispatch', true)
undo:
() => ({ tr, state, dispatch }) => {
tr.setMeta('preventDispatch', true)
const undoManager: UndoManager = yUndoPluginKey.getState(state).undoManager
const undoManager: UndoManager = yUndoPluginKey.getState(state).undoManager
if (undoManager.undoStack.length === 0) {
return false
}
if (undoManager.undoStack.length === 0) {
return false
}
if (!dispatch) {
return true
}
if (!dispatch) {
return true
}
return undo(state)
},
redo: () => ({ tr, state, dispatch }) => {
tr.setMeta('preventDispatch', true)
return undo(state)
},
redo:
() => ({ tr, state, dispatch }) => {
tr.setMeta('preventDispatch', true)
const undoManager: UndoManager = yUndoPluginKey.getState(state).undoManager
const undoManager: UndoManager = yUndoPluginKey.getState(state).undoManager
if (undoManager.redoStack.length === 0) {
return false
}
if (undoManager.redoStack.length === 0) {
return false
}
if (!dispatch) {
return true
}
if (!dispatch) {
return true
}
return redo(state)
},
return redo(state)
},
}
},
@ -125,11 +154,11 @@ export const Collaboration = Extension.create<CollaborationOptions>({
addProseMirrorPlugins() {
const fragment = this.options.fragment
? this.options.fragment
: this.options.document.getXmlFragment(this.options.field)
: (this.options.document as Doc).getXmlFragment(this.options.field)
// Quick fix until there is an official implementation (thanks to @hamflx).
// See https://github.com/yjs/y-prosemirror/issues/114 and https://github.com/yjs/y-prosemirror/issues/102
const yUndoPluginInstance = yUndoPlugin()
const yUndoPluginInstance = yUndoPlugin(this.options.yUndoOptions)
const originalUndoPluginView = yUndoPluginInstance.spec.view
yUndoPluginInstance.spec.view = (view: EditorView) => {
@ -137,8 +166,9 @@ export const Collaboration = Extension.create<CollaborationOptions>({
if (undoManager.restore) {
undoManager.restore()
// eslint-disable-next-line
undoManager.restore = () => {}
undoManager.restore = () => {
// noop
}
}
const viewRet = originalUndoPluginView ? originalUndoPluginView(view) : undefined
@ -146,7 +176,7 @@ export const Collaboration = Extension.create<CollaborationOptions>({
return {
destroy: () => {
const hasUndoManSelf = undoManager.trackedOrigins.has(undoManager)
// eslint-disable-next-line
// eslint-disable-next-line no-underscore-dangle
const observers = undoManager._observers
undoManager.restore = () => {
@ -155,7 +185,7 @@ export const Collaboration = Extension.create<CollaborationOptions>({
}
undoManager.doc.on('afterTransaction', undoManager.afterTransactionHandler)
// eslint-disable-next-line
// eslint-disable-next-line no-underscore-dangle
undoManager._observers = observers
}
@ -173,6 +203,50 @@ export const Collaboration = Extension.create<CollaborationOptions>({
const ySyncPluginInstance = ySyncPlugin(fragment, ySyncPluginOptions)
return [ySyncPluginInstance, yUndoPluginInstance]
if (this.editor.options.enableContentCheck) {
fragment.doc?.on('beforeTransaction', () => {
try {
const jsonContent = (yXmlFragmentToProsemirrorJSON(fragment))
if (jsonContent.content.length === 0) {
return
}
this.editor.schema.nodeFromJSON(jsonContent).check()
} catch (error) {
this.editor.emit('contentError', {
error: error as Error,
editor: this.editor,
disableCollaboration: () => {
fragment.doc?.destroy()
this.storage.isDisabled = true
},
})
// If the content is invalid, return false to prevent the transaction from being applied
return false
}
})
}
return [
ySyncPluginInstance,
yUndoPluginInstance,
// Only add the filterInvalidContent plugin if content checking is enabled
this.editor.options.enableContentCheck
&& new Plugin({
key: new PluginKey('filterInvalidContent'),
filterTransaction: () => {
// When collaboration is disabled, prevent any sync transactions from being applied
if (this.storage.isDisabled) {
// Destroy the Yjs document to prevent any further sync transactions
fragment.doc?.destroy()
return true
}
return true
},
}),
].filter(Boolean)
},
})

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-color",
"description": "text color extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,8 +29,8 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/extension-text-style": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/extension-text-style": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-document",
"description": "document extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-dropcursor",
"description": "dropcursor extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,8 +29,8 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-floating-menu",
"description": "floating-menu extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,8 +29,8 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-focus",
"description": "focus extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,8 +29,8 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-font-family",
"description": "font family extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,8 +29,8 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/extension-text-style": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/extension-text-style": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-gapcursor",
"description": "gapcursor extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,8 +29,8 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-hard-break",
"description": "hard break extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-heading",
"description": "heading extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-highlight",
"description": "highlight extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-history",
"description": "history extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,8 +29,8 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-horizontal-rule",
"description": "horizontal rule extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,8 +29,8 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-image",
"description": "image extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,13 @@
# Change Log
## 2.9.1
## 2.9.0
### Patch Changes
- 6fae240: Add parse rules that reset bold & italic marks
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-italic",
"description": "italic extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-link",
"description": "link extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -32,8 +32,8 @@
"linkifyjs": "^4.1.0"
},
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-list-item",
"description": "list item extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-list-keymap",
"description": "list keymap extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,13 @@
# Change Log
## 2.9.1
## 2.9.0
### Patch Changes
- ae711ab: Increase mention extension priority to allow mentions to be inserted in lists using the Enter key
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-mention",
"description": "mention extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,9 +29,9 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0",
"@tiptap/suggestion": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1",
"@tiptap/suggestion": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,13 @@
# Change Log
## 2.9.1
### Patch Changes
- 0c9004f: This resolves an issue where the bullet-list and ordered-list extensions were depending on the list-item and text-style extensions unneccesarily. They are no longer imported and constants are used instead.
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-ordered-list",
"description": "ordered list extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,14 +29,10 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/extension-list-item": "^2.8.0",
"@tiptap/extension-text-style": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",
"@tiptap/extension-list-item": "^2.7.0",
"@tiptap/extension-text-style": "^2.7.0"
"@tiptap/core": "^2.7.0"
},
"repository": {
"type": "git",

View File

@ -1,6 +1,7 @@
import { mergeAttributes, Node, wrappingInputRule } from '@tiptap/core'
import { ListItem } from '@tiptap/extension-list-item'
import { TextStyle } from '@tiptap/extension-text-style'
const ListItemName = 'listItem'
const TextStyleName = 'textStyle'
export interface OrderedListOptions {
/**
@ -110,7 +111,7 @@ export const OrderedList = Node.create<OrderedListOptions>({
return {
toggleOrderedList: () => ({ commands, chain }) => {
if (this.options.keepAttributes) {
return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItem.name, this.editor.getAttributes(TextStyle.name)).run()
return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName, this.editor.getAttributes(TextStyleName)).run()
}
return commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
},
@ -137,7 +138,7 @@ export const OrderedList = Node.create<OrderedListOptions>({
type: this.type,
keepMarks: this.options.keepMarks,
keepAttributes: this.options.keepAttributes,
getAttributes: match => ({ start: +match[1], ...this.editor.getAttributes(TextStyle.name) }),
getAttributes: match => ({ start: +match[1], ...this.editor.getAttributes(TextStyleName) }),
joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1],
editor: this.editor,
})

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-paragraph",
"description": "paragraph extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-placeholder",
"description": "placeholder extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,8 +29,8 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0",
"@tiptap/pm": "^2.8.0"
"@tiptap/core": "^2.9.1",
"@tiptap/pm": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0",

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-strike",
"description": "strike extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-subscript",
"description": "subscript extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-superscript",
"description": "superscript extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,13 @@
# Change Log
## 2.9.1
## 2.9.0
### Patch Changes
- 21df331: Tables now properly respect colwidths with multiple values, fixing resizeable columns when the first row has a colspan
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-table-cell",
"description": "table cell extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,13 @@
# Change Log
## 2.9.1
## 2.9.0
### Patch Changes
- 21df331: Tables now properly respect colwidths with multiple values, fixing resizeable columns when the first row has a colspan
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-table-header",
"description": "table cell extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

View File

@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-table-row",
"description": "table row extension for tiptap",
"version": "2.8.0",
"version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@ -29,7 +29,7 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^2.8.0"
"@tiptap/core": "^2.9.1"
},
"peerDependencies": {
"@tiptap/core": "^2.7.0"

View File

@ -1,5 +1,9 @@
# Change Log
## 2.9.1
## 2.9.0
## 2.8.0
### Minor Changes

Some files were not shown because too many files have changed in this diff Show More