diff --git a/.changeset/five-melons-compete.md b/.changeset/five-melons-compete.md
deleted file mode 100644
index 0d4b8d20663..00000000000
--- a/.changeset/five-melons-compete.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"@tiptap/vue-3": patch
----
-
-Fix editor content being destroyed before transition end
diff --git a/.changeset/fresh-coats-relate.md b/.changeset/fresh-coats-relate.md
new file mode 100644
index 00000000000..e187ea460be
--- /dev/null
+++ b/.changeset/fresh-coats-relate.md
@@ -0,0 +1,5 @@
+---
+"@tiptap/core": minor
+---
+
+Previously, only a json representation of the node could be inserted into the editor. This change allows for the insertion of Prosemirror `Node`s and `Fragment`s directly into the editor through the `insertContentAt`, `setContent` and `insertContent` commands.
diff --git a/.changeset/funny-otters-protect.md b/.changeset/funny-otters-protect.md
new file mode 100644
index 00000000000..63cb6a9e331
--- /dev/null
+++ b/.changeset/funny-otters-protect.md
@@ -0,0 +1,5 @@
+---
+"@tiptap/core": patch
+---
+
+Addresses a bug with `insertContentAt`'s `simulatedPasteRules` option where it could only accept text and not Prosemirror `Node` and `Content`
diff --git a/.changeset/khaki-timers-jump.md b/.changeset/khaki-timers-jump.md
deleted file mode 100644
index 08d4492a6aa..00000000000
--- a/.changeset/khaki-timers-jump.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"@tiptap/pm": patch
----
-
-Update prosemirror-view version
diff --git a/.changeset/nervous-bats-film.md b/.changeset/nervous-bats-film.md
deleted file mode 100644
index 0defe712520..00000000000
--- a/.changeset/nervous-bats-film.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"@tiptap/core": patch
----
-
-Fixed an issue while updating attributes on a NodePos that was not a text
diff --git a/.changeset/slow-peaches-film.md b/.changeset/slow-peaches-film.md
deleted file mode 100644
index 5fe3d8c2861..00000000000
--- a/.changeset/slow-peaches-film.md
+++ /dev/null
@@ -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
diff --git a/.changeset/sweet-feet-dream.md b/.changeset/sweet-feet-dream.md
deleted file mode 100644
index 8d1b9e180ff..00000000000
--- a/.changeset/sweet-feet-dream.md
+++ /dev/null
@@ -1,5 +0,0 @@
----
-"@tiptap/core": patch
----
-
-Fixed issues with NodePos child positions causing wrong positions when used on non-text atoms
diff --git a/.changeset/sweet-masks-smash.md b/.changeset/sweet-masks-smash.md
deleted file mode 100644
index 44bc236500f..00000000000
--- a/.changeset/sweet-masks-smash.md
+++ /dev/null
@@ -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
diff --git a/.changeset/thirty-apes-boil.md b/.changeset/thirty-apes-boil.md
deleted file mode 100644
index d86eb94f266..00000000000
--- a/.changeset/thirty-apes-boil.md
+++ /dev/null
@@ -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
diff --git a/.changeset/violet-cameras-brush.md b/.changeset/violet-cameras-brush.md
deleted file mode 100644
index 0cb10af92d4..00000000000
--- a/.changeset/violet-cameras-brush.md
+++ /dev/null
@@ -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
-
diff --git a/demos/src/Commands/InsertContent/React/index.jsx b/demos/src/Commands/InsertContent/React/index.jsx
index 2da2ad9bbde..d3c67072474 100644
--- a/demos/src/Commands/InsertContent/React/index.jsx
+++ b/demos/src/Commands/InsertContent/React/index.jsx
@@ -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,
diff --git a/demos/src/Commands/InsertContent/React/index.spec.js b/demos/src/Commands/InsertContent/React/index.spec.js
index 9bfe7083773..58dff9562ab 100644
--- a/demos/src/Commands/InsertContent/React/index.spec.js
+++ b/demos/src/Commands/InsertContent/React/index.spec.js
@@ -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', '
And this is some additional string content.
')
+ cy.get('.tiptap').should('contain.html', 'And this is some additional string content.
')
})
it('should keep spaces inbetween tags in html content', () => {
@@ -91,4 +91,28 @@ context('/src/Commands/InsertContent/React/', () => {
})
})
+ it('should respect editor.options.parseOptions if defined to be `false`', () => {
+ cy.get('.tiptap').then(([{ editor }]) => {
+ editor.options.parseOptions = { preserveWhitespace: false }
+ editor.commands.insertContent('\nHello World.
')
+ })
+ })
+
+ it('should insert a Prosemirror Node as content', () => {
+ cy.get('.tiptap').then(([{ editor }]) => {
+ editor.commands.setContent(editor.schema.node('paragraph', null, editor.schema.text('Hello World.')))
+ cy.get('.tiptap').should('contain.html', 'Hello World.
')
+ })
+ })
+
+ it('should insert a Prosemirror Fragment as content', () => {
+ cy.get('.tiptap').then(([{ editor }]) => {
+ editor.commands.setContent(editor.schema.node('doc', null, editor.schema.node('paragraph', null, editor.schema.text('Hello World.'))).content)
+ cy.get('.tiptap').should('contain.html', 'Hello World.
')
+ })
+ })
+
it('should emit updates', () => {
cy.get('.tiptap').then(([{ editor }]) => {
let updateCount = 0
diff --git a/demos/src/Demos/CollaborationSplitPane/React/Editor.jsx b/demos/src/Demos/CollaborationSplitPane/React/Editor.jsx
index feedcbc6acd..dbf4863797d 100644
--- a/demos/src/Demos/CollaborationSplitPane/React/Editor.jsx
+++ b/demos/src/Demos/CollaborationSplitPane/React/Editor.jsx
@@ -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 }) => {
-
+
{{ showEditor ? 'Hide editor' : 'Show editor' }}
diff --git a/demos/src/Nodes/CodeBlockLowlight/React/styles.scss b/demos/src/Nodes/CodeBlockLowlight/React/styles.scss
index a8484746e77..9e318386eba 100644
--- a/demos/src/Nodes/CodeBlockLowlight/React/styles.scss
+++ b/demos/src/Nodes/CodeBlockLowlight/React/styles.scss
@@ -29,7 +29,6 @@
.hljs-template-variable,
.hljs-attribute,
.hljs-tag,
- .hljs-name,
.hljs-regexp,
.hljs-link,
.hljs-name,
diff --git a/package-lock.json b/package-lock.json
index 319d5d70e5b..082a62505d7 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -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",
- "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"
+ "version": "2.9.1",
+ "license": "MIT",
+ "dependencies": {
+ "@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": {
diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md
index a8fef37650d..32270f1193a 100644
--- a/packages/core/CHANGELOG.md
+++ b/packages/core/CHANGELOG.md
@@ -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
diff --git a/packages/core/package.json b/packages/core/package.json
index 0ff96909599..883310415c2 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -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"
diff --git a/packages/core/src/Editor.ts b/packages/core/src/Editor.ts
index b7a58cd0d1c..f7cddb7238e 100644
--- a/packages/core/src/Editor.ts
+++ b/packages/core/src/Editor.ts
@@ -237,20 +237,32 @@ export class Editor extends EventEmitter {
/**
* 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
- const state = this.state.reconfigure({
// @ts-ignore
- plugins: this.state.plugins.filter(plugin => !plugin.key.startsWith(name)),
+ plugins = prevPlugins.filter(plugin => !plugin.key.startsWith(name))
+ })
+
+ if (prevPlugins.length === plugins.length) {
+ // No plugin was removed, so we don’t need to update the state
+ return undefined
+ }
+
+ const state = this.state.reconfigure({
+ plugins,
})
this.view.updateState(state)
@@ -325,6 +337,9 @@ export class Editor extends EventEmitter {
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')
@@ -352,6 +367,14 @@ export class Editor extends EventEmitter {
}),
})
+ // add `role="textbox"` to the editor element
+ this.view.dom.setAttribute('role', 'textbox')
+
+ // add aria-label to the editor element
+ if (!this.view.dom.getAttribute('aria-label')) {
+ this.view.dom.setAttribute('aria-label', 'Rich-Text Editor')
+ }
+
// `editor.view` is not yet available at this time.
// Therefore we will add all plugins and node views directly afterwards.
const newState = this.state.reconfigure({
diff --git a/packages/core/src/InputRule.ts b/packages/core/src/InputRule.ts
index 1b56dccfc7b..3bd1bc5c964 100644
--- a/packages/core/src/InputRule.ts
+++ b/packages/core/src/InputRule.ts
@@ -1,8 +1,10 @@
+import { Fragment, Node as ProseMirrorNode } from '@tiptap/pm/model'
import { EditorState, Plugin, TextSelection } from '@tiptap/pm/state'
import { CommandManager } from './CommandManager.js'
import { Editor } from './Editor.js'
import { createChainableState } from './helpers/createChainableState.js'
+import { getHTMLFromFragment } from './helpers/getHTMLFromFragment.js'
import { getTextContentFromNodes } from './helpers/getTextContentFromNodes.js'
import {
CanCommands,
@@ -14,37 +16,37 @@ import {
import { isRegExp } from './utilities/isRegExp.js'
export type InputRuleMatch = {
- index: number
- text: string
- replaceWith?: string
- match?: RegExpMatchArray
- data?: Record
-}
+ index: number;
+ text: string;
+ replaceWith?: string;
+ match?: RegExpMatchArray;
+ data?: Record;
+};
-export type InputRuleFinder = RegExp | ((text: string) => InputRuleMatch | null)
+export type InputRuleFinder = RegExp | ((text: string) => InputRuleMatch | null);
export class InputRule {
find: InputRuleFinder
handler: (props: {
- state: EditorState
- range: Range
- match: ExtendedRegExpMatchArray
- commands: SingleCommands
- chain: () => ChainedCommands
- can: () => CanCommands
+ state: EditorState;
+ range: Range;
+ match: ExtendedRegExpMatchArray;
+ commands: SingleCommands;
+ chain: () => ChainedCommands;
+ can: () => CanCommands;
}) => void | null
constructor(config: {
- find: InputRuleFinder
+ find: InputRuleFinder;
handler: (props: {
- state: EditorState
- range: Range
- match: ExtendedRegExpMatchArray
- commands: SingleCommands
- chain: () => ChainedCommands
- can: () => CanCommands
- }) => void | null
+ state: EditorState;
+ range: Range;
+ match: ExtendedRegExpMatchArray;
+ commands: SingleCommands;
+ chain: () => ChainedCommands;
+ can: () => CanCommands;
+ }) => void | null;
}) {
this.find = config.find
this.handler = config.handler
@@ -85,12 +87,12 @@ const inputRuleMatcherHandler = (
}
function run(config: {
- editor: Editor
- from: number
- to: number
- text: string
- rules: InputRule[]
- plugin: Plugin
+ editor: Editor;
+ from: number;
+ to: number;
+ text: string;
+ rules: InputRule[];
+ plugin: Plugin;
}): boolean {
const {
editor, from, to, text, rules, plugin,
@@ -184,7 +186,7 @@ export function inputRulesPlugin(props: { editor: Editor; rules: InputRule[] }):
init() {
return null
},
- apply(tr, prev) {
+ apply(tr, prev, state) {
const stored = tr.getMeta(plugin)
if (stored) {
@@ -192,12 +194,25 @@ export function inputRulesPlugin(props: { editor: Editor; rules: InputRule[] }):
}
// if InputRule is triggered by insertContent()
- const simulatedInputMeta = tr.getMeta('applyInputRules')
+ const simulatedInputMeta = tr.getMeta('applyInputRules') as
+ | undefined
+ | {
+ from: number;
+ text: string | ProseMirrorNode | Fragment;
+ }
const isSimulatedInput = !!simulatedInputMeta
if (isSimulatedInput) {
setTimeout(() => {
- const { from, text } = simulatedInputMeta
+ let { text } = simulatedInputMeta
+
+ if (typeof text === 'string') {
+ text = text as string
+ } else {
+ text = getHTMLFromFragment(Fragment.from(text), state.schema)
+ }
+
+ const { from } = simulatedInputMeta
const to = from + text.length
run({
diff --git a/packages/core/src/PasteRule.ts b/packages/core/src/PasteRule.ts
index a0969673476..355acd6f9fa 100644
--- a/packages/core/src/PasteRule.ts
+++ b/packages/core/src/PasteRule.ts
@@ -1,8 +1,10 @@
+import { Fragment, Node as ProseMirrorNode } from '@tiptap/pm/model'
import { EditorState, Plugin } from '@tiptap/pm/state'
import { CommandManager } from './CommandManager.js'
import { Editor } from './Editor.js'
import { createChainableState } from './helpers/createChainableState.js'
+import { getHTMLFromFragment } from './helpers/getHTMLFromFragment.js'
import {
CanCommands,
ChainedCommands,
@@ -14,14 +16,16 @@ import { isNumber } from './utilities/isNumber.js'
import { isRegExp } from './utilities/isRegExp.js'
export type PasteRuleMatch = {
- index: number
- text: string
- replaceWith?: string
- match?: RegExpMatchArray
- data?: Record
-}
+ index: number;
+ text: string;
+ replaceWith?: string;
+ match?: RegExpMatchArray;
+ data?: Record;
+};
-export type PasteRuleFinder = RegExp | ((text: string, event?: ClipboardEvent | null) => PasteRuleMatch[] | null | undefined)
+export type PasteRuleFinder =
+ | RegExp
+ | ((text: string, event?: ClipboardEvent | null) => PasteRuleMatch[] | null | undefined);
/**
* Paste rules are used to react to pasted content.
@@ -31,28 +35,28 @@ export class PasteRule {
find: PasteRuleFinder
handler: (props: {
- state: EditorState
- range: Range
- match: ExtendedRegExpMatchArray
- commands: SingleCommands
- chain: () => ChainedCommands
- can: () => CanCommands
- pasteEvent: ClipboardEvent | null
- dropEvent: DragEvent | null
+ state: EditorState;
+ range: Range;
+ match: ExtendedRegExpMatchArray;
+ commands: SingleCommands;
+ chain: () => ChainedCommands;
+ can: () => CanCommands;
+ pasteEvent: ClipboardEvent | null;
+ dropEvent: DragEvent | null;
}) => void | null
constructor(config: {
- find: PasteRuleFinder
+ find: PasteRuleFinder;
handler: (props: {
- can: () => CanCommands
- chain: () => ChainedCommands
- commands: SingleCommands
- dropEvent: DragEvent | null
- match: ExtendedRegExpMatchArray
- pasteEvent: ClipboardEvent | null
- range: Range
- state: EditorState
- }) => void | null
+ can: () => CanCommands;
+ chain: () => ChainedCommands;
+ commands: SingleCommands;
+ dropEvent: DragEvent | null;
+ match: ExtendedRegExpMatchArray;
+ pasteEvent: ClipboardEvent | null;
+ range: Range;
+ state: EditorState;
+ }) => void | null;
}) {
this.find = config.find
this.handler = config.handler
@@ -96,13 +100,13 @@ const pasteRuleMatcherHandler = (
}
function run(config: {
- editor: Editor
- state: EditorState
- from: number
- to: number
- rule: PasteRule
- pasteEvent: ClipboardEvent | null
- dropEvent: DragEvent | null
+ editor: Editor;
+ state: EditorState;
+ from: number;
+ to: number;
+ rule: PasteRule;
+ pasteEvent: ClipboardEvent | null;
+ dropEvent: DragEvent | null;
}): boolean {
const {
editor, state, from, to, rule, pasteEvent, dropEvent,
@@ -179,7 +183,13 @@ export function pasteRulesPlugin(props: { editor: Editor; rules: PasteRule[] }):
let isPastedFromProseMirror = false
let isDroppedFromProseMirror = false
let pasteEvent = typeof ClipboardEvent !== 'undefined' ? new ClipboardEvent('paste') : null
- let dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null
+ let dropEvent: DragEvent | null
+
+ try {
+ dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null
+ } catch (e) {
+ dropEvent = null
+ }
const processEvent = ({
state,
@@ -188,11 +198,11 @@ export function pasteRulesPlugin(props: { editor: Editor; rules: PasteRule[] }):
rule,
pasteEvt,
}: {
- state: EditorState
- from: number
- to: { b: number }
- rule: PasteRule
- pasteEvt: ClipboardEvent | null
+ state: EditorState;
+ from: number;
+ to: { b: number };
+ rule: PasteRule;
+ pasteEvt: ClipboardEvent | null;
}) => {
const tr = state.tr
const chainableState = createChainableState({
@@ -214,7 +224,11 @@ export function pasteRulesPlugin(props: { editor: Editor; rules: PasteRule[] }):
return
}
- dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null
+ try {
+ dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null
+ } catch (e) {
+ dropEvent = null
+ }
pasteEvent = typeof ClipboardEvent !== 'undefined' ? new ClipboardEvent('paste') : null
return tr
@@ -266,7 +280,9 @@ export function pasteRulesPlugin(props: { editor: Editor; rules: PasteRule[] }):
const isDrop = transaction.getMeta('uiEvent') === 'drop' && !isDroppedFromProseMirror
// if PasteRule is triggered by insertContent()
- const simulatedPasteMeta = transaction.getMeta('applyPasteRules')
+ const simulatedPasteMeta = transaction.getMeta('applyPasteRules') as
+ | undefined
+ | { from: number; text: string | ProseMirrorNode | Fragment }
const isSimulatedPaste = !!simulatedPasteMeta
if (!isPaste && !isDrop && !isSimulatedPaste) {
@@ -275,8 +291,17 @@ export function pasteRulesPlugin(props: { editor: Editor; rules: PasteRule[] }):
// Handle simulated paste
if (isSimulatedPaste) {
- const { from, text } = simulatedPasteMeta
+ let { text } = simulatedPasteMeta
+
+ if (typeof text === 'string') {
+ text = text as string
+ } else {
+ text = getHTMLFromFragment(Fragment.from(text), state.schema)
+ }
+
+ const { from } = simulatedPasteMeta
const to = from + text.length
+
const pasteEvt = createClipboardPasteEvent(text)
return processEvent({
diff --git a/packages/core/src/commands/insertContent.ts b/packages/core/src/commands/insertContent.ts
index 37e9bb14812..44210d69df1 100644
--- a/packages/core/src/commands/insertContent.ts
+++ b/packages/core/src/commands/insertContent.ts
@@ -1,4 +1,4 @@
-import { ParseOptions } from '@tiptap/pm/model'
+import { Fragment, Node as ProseMirrorNode, ParseOptions } from '@tiptap/pm/model'
import { Content, RawCommands } from '../types.js'
@@ -14,7 +14,7 @@ declare module '@tiptap/core' {
/**
* The ProseMirror content to insert.
*/
- value: Content,
+ value: Content | ProseMirrorNode | Fragment,
/**
* Optional options
@@ -23,17 +23,17 @@ declare module '@tiptap/core' {
/**
* Options for parsing the content.
*/
- parseOptions?: ParseOptions
+ parseOptions?: ParseOptions;
/**
* Whether to update the selection after inserting the content.
*/
- updateSelection?: boolean
- applyInputRules?: boolean
- applyPasteRules?: boolean
- },
- ) => ReturnType
- }
+ updateSelection?: boolean;
+ applyInputRules?: boolean;
+ applyPasteRules?: boolean;
+ }
+ ) => ReturnType;
+ };
}
}
diff --git a/packages/core/src/commands/insertContentAt.ts b/packages/core/src/commands/insertContentAt.ts
index e02b6f20600..33c84524d27 100644
--- a/packages/core/src/commands/insertContentAt.ts
+++ b/packages/core/src/commands/insertContentAt.ts
@@ -20,7 +20,7 @@ declare module '@tiptap/core' {
/**
* The ProseMirror content to insert.
*/
- value: Content,
+ value: Content | ProseMirrorNode | Fragment,
/**
* Optional options
@@ -63,7 +63,7 @@ const isFragment = (nodeOrFragment: ProseMirrorNode | Fragment): nodeOrFragment
export const insertContentAt: RawCommands['insertContentAt'] = (position, value, options) => ({ tr, dispatch, editor }) => {
if (dispatch) {
options = {
- parseOptions: {},
+ parseOptions: editor.options.parseOptions,
updateSelection: true,
applyInputRules: false,
applyPasteRules: false,
@@ -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
@@ -130,6 +132,16 @@ export const insertContentAt: RawCommands['insertContentAt'] = (position, value,
// otherwise if it is an array, we have to join it
if (Array.isArray(value)) {
newContent = value.map(v => v.text || '').join('')
+ } else if (value instanceof Fragment) {
+ let text = ''
+
+ value.forEach(node => {
+ if (node.text) {
+ text += node.text
+ }
+ })
+
+ newContent = text
} else if (typeof value === 'object' && !!value && !!value.text) {
newContent = value.text
} else {
diff --git a/packages/core/src/commands/setContent.ts b/packages/core/src/commands/setContent.ts
index 0819c3cd05a..50211496b9d 100644
--- a/packages/core/src/commands/setContent.ts
+++ b/packages/core/src/commands/setContent.ts
@@ -1,4 +1,4 @@
-import { ParseOptions } from '@tiptap/pm/model'
+import { Fragment, Node as ProseMirrorNode, ParseOptions } from '@tiptap/pm/model'
import { createDocument } from '../helpers/createDocument.js'
import { Content, RawCommands } from '../types.js'
@@ -17,7 +17,7 @@ declare module '@tiptap/core' {
/**
* The new content.
*/
- content: Content,
+ content: Content | Fragment | ProseMirrorNode,
/**
* Whether to emit an update event.
@@ -37,10 +37,10 @@ declare module '@tiptap/core' {
/**
* Whether to throw an error if the content is invalid.
*/
- errorOnInvalidContent?: boolean
- },
- ) => ReturnType
- }
+ errorOnInvalidContent?: boolean;
+ }
+ ) => ReturnType;
+ };
}
}
@@ -66,12 +66,8 @@ export const setContent: RawCommands['setContent'] = (content, emitUpdate = fals
tr.setMeta('preventUpdate', !emitUpdate)
}
- return commands.insertContentAt(
- { from: 0, to: doc.content.size },
- content,
- {
- parseOptions,
- errorOnInvalidContent: options.errorOnInvalidContent ?? editor.options.enableContentCheck,
- },
- )
+ return commands.insertContentAt({ from: 0, to: doc.content.size }, content, {
+ parseOptions,
+ errorOnInvalidContent: options.errorOnInvalidContent ?? editor.options.enableContentCheck,
+ })
}
diff --git a/packages/core/src/helpers/createDocument.ts b/packages/core/src/helpers/createDocument.ts
index 44bcc669d4a..2ab6fcdd97d 100644
--- a/packages/core/src/helpers/createDocument.ts
+++ b/packages/core/src/helpers/createDocument.ts
@@ -1,4 +1,6 @@
-import { Node as ProseMirrorNode, ParseOptions, Schema } from '@tiptap/pm/model'
+import {
+ Fragment, Node as ProseMirrorNode, ParseOptions, Schema,
+} from '@tiptap/pm/model'
import { Content } from '../types.js'
import { createNodeFromContent } from './createNodeFromContent.js'
@@ -11,7 +13,7 @@ import { createNodeFromContent } from './createNodeFromContent.js'
* @returns The created Prosemirror document node
*/
export function createDocument(
- content: Content,
+ content: Content | ProseMirrorNode | Fragment,
schema: Schema,
parseOptions: ParseOptions = {},
options: { errorOnInvalidContent?: boolean } = {},
diff --git a/packages/core/src/helpers/createNodeFromContent.ts b/packages/core/src/helpers/createNodeFromContent.ts
index 63a9a2f9d67..5493b362c4a 100644
--- a/packages/core/src/helpers/createNodeFromContent.ts
+++ b/packages/core/src/helpers/createNodeFromContent.ts
@@ -23,10 +23,13 @@ export type CreateNodeFromContentOptions = {
* @returns The created Prosemirror node or fragment
*/
export function createNodeFromContent(
- content: Content,
+ content: Content | ProseMirrorNode | Fragment,
schema: Schema,
options?: CreateNodeFromContentOptions,
): ProseMirrorNode | Fragment {
+ if (content instanceof ProseMirrorNode || content instanceof Fragment) {
+ return content
+ }
options = {
slice: true,
parseOptions: {},
diff --git a/packages/extension-blockquote/CHANGELOG.md b/packages/extension-blockquote/CHANGELOG.md
index 4175bed48de..8f839e9095a 100644
--- a/packages/extension-blockquote/CHANGELOG.md
+++ b/packages/extension-blockquote/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-blockquote/package.json b/packages/extension-blockquote/package.json
index 9c1ea69c659..8855b9d9ec4 100644
--- a/packages/extension-blockquote/package.json
+++ b/packages/extension-blockquote/package.json
@@ -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"
diff --git a/packages/extension-bold/CHANGELOG.md b/packages/extension-bold/CHANGELOG.md
index 5ffb2b2e508..8b1934ce149 100644
--- a/packages/extension-bold/CHANGELOG.md
+++ b/packages/extension-bold/CHANGELOG.md
@@ -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
diff --git a/packages/extension-bold/package.json b/packages/extension-bold/package.json
index 4bd00ec46ea..7a22106fcae 100644
--- a/packages/extension-bold/package.json
+++ b/packages/extension-bold/package.json
@@ -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"
diff --git a/packages/extension-bold/src/bold.ts b/packages/extension-bold/src/bold.ts
index f3c6a2bb649..da7386b5711 100644
--- a/packages/extension-bold/src/bold.ts
+++ b/packages/extension-bold/src/bold.ts
@@ -75,6 +75,10 @@ export const Bold = Mark.create({
tag: 'b',
getAttrs: node => (node as HTMLElement).style.fontWeight !== 'normal' && null,
},
+ {
+ style: 'font-weight=400',
+ clearMark: mark => mark.type.name === this.name,
+ },
{
style: 'font-weight',
getAttrs: value => /^(bold(er)?|[5-9]\d{2,})$/.test(value as string) && null,
diff --git a/packages/extension-bubble-menu/CHANGELOG.md b/packages/extension-bubble-menu/CHANGELOG.md
index 53c925885f9..81bafa110a6 100644
--- a/packages/extension-bubble-menu/CHANGELOG.md
+++ b/packages/extension-bubble-menu/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-bubble-menu/package.json b/packages/extension-bubble-menu/package.json
index 63678a4f48a..ec08af89778 100644
--- a/packages/extension-bubble-menu/package.json
+++ b/packages/extension-bubble-menu/package.json
@@ -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",
diff --git a/packages/extension-bullet-list/CHANGELOG.md b/packages/extension-bullet-list/CHANGELOG.md
index cdd54d225b7..1eff126b967 100644
--- a/packages/extension-bullet-list/CHANGELOG.md
+++ b/packages/extension-bullet-list/CHANGELOG.md
@@ -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
diff --git a/packages/extension-bullet-list/package.json b/packages/extension-bullet-list/package.json
index dceb8f702c9..230b7222f2a 100644
--- a/packages/extension-bullet-list/package.json
+++ b/packages/extension-bullet-list/package.json
@@ -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",
diff --git a/packages/extension-bullet-list/src/bullet-list.ts b/packages/extension-bullet-list/src/bullet-list.ts
index 63ff3f23714..320d3abf402 100644
--- a/packages/extension-bullet-list/src/bullet-list.ts
+++ b/packages/extension-bullet-list/src/bullet-list.ts
@@ -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({
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({
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,
})
}
diff --git a/packages/extension-character-count/CHANGELOG.md b/packages/extension-character-count/CHANGELOG.md
index 1291e0a3300..7a4931ca138 100644
--- a/packages/extension-character-count/CHANGELOG.md
+++ b/packages/extension-character-count/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-character-count/package.json b/packages/extension-character-count/package.json
index f401ddbc8a9..095c6aa379c 100644
--- a/packages/extension-character-count/package.json
+++ b/packages/extension-character-count/package.json
@@ -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",
diff --git a/packages/extension-code-block-lowlight/CHANGELOG.md b/packages/extension-code-block-lowlight/CHANGELOG.md
index c524cd8fe1b..a7c1b646f22 100644
--- a/packages/extension-code-block-lowlight/CHANGELOG.md
+++ b/packages/extension-code-block-lowlight/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-code-block-lowlight/package.json b/packages/extension-code-block-lowlight/package.json
index d908580d504..eb7c6fb3317 100644
--- a/packages/extension-code-block-lowlight/package.json
+++ b/packages/extension-code-block-lowlight/package.json
@@ -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": {
diff --git a/packages/extension-code-block/CHANGELOG.md b/packages/extension-code-block/CHANGELOG.md
index e2b1a657475..47c6d470621 100644
--- a/packages/extension-code-block/CHANGELOG.md
+++ b/packages/extension-code-block/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-code-block/package.json b/packages/extension-code-block/package.json
index d7544b7bba9..8d826ba93d4 100644
--- a/packages/extension-code-block/package.json
+++ b/packages/extension-code-block/package.json
@@ -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",
diff --git a/packages/extension-code/CHANGELOG.md b/packages/extension-code/CHANGELOG.md
index 2404c1ebbc6..ebd5ef72ec6 100644
--- a/packages/extension-code/CHANGELOG.md
+++ b/packages/extension-code/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-code/package.json b/packages/extension-code/package.json
index be5c2dc6c8f..6885e96d8c2 100644
--- a/packages/extension-code/package.json
+++ b/packages/extension-code/package.json
@@ -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"
diff --git a/packages/extension-collaboration-cursor/CHANGELOG.md b/packages/extension-collaboration-cursor/CHANGELOG.md
index a042ed54c35..d7bfa4cbfda 100644
--- a/packages/extension-collaboration-cursor/CHANGELOG.md
+++ b/packages/extension-collaboration-cursor/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-collaboration-cursor/package.json b/packages/extension-collaboration-cursor/package.json
index 5cfc8991e0b..680ec81fdd8 100644
--- a/packages/extension-collaboration-cursor/package.json
+++ b/packages/extension-collaboration-cursor/package.json
@@ -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": {
diff --git a/packages/extension-collaboration/CHANGELOG.md b/packages/extension-collaboration/CHANGELOG.md
index 3bdc6c39684..a26f807fef5 100644
--- a/packages/extension-collaboration/CHANGELOG.md
+++ b/packages/extension-collaboration/CHANGELOG.md
@@ -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
diff --git a/packages/extension-collaboration/package.json b/packages/extension-collaboration/package.json
index 62bbed8659c..760c1ba5604 100644
--- a/packages/extension-collaboration/package.json
+++ b/packages/extension-collaboration/package.json
@@ -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": {
diff --git a/packages/extension-collaboration/src/collaboration.ts b/packages/extension-collaboration/src/collaboration.ts
index 3ca0c381b2c..b2a8641ca56 100644
--- a/packages/extension-collaboration/src/collaboration.ts
+++ b/packages/extension-collaboration/src/collaboration.ts
@@ -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[1]
+type YSyncOpts = Parameters[1];
+type YUndoOpts = Parameters[0];
declare module '@tiptap/core' {
interface Commands {
@@ -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({
+export const Collaboration = Extension.create({
name: 'collaboration',
priority: 1000,
@@ -73,44 +92,54 @@ export const Collaboration = Extension.create({
}
},
+ 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({
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({
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({
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({
}
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({
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)
},
})
diff --git a/packages/extension-color/CHANGELOG.md b/packages/extension-color/CHANGELOG.md
index 45ff45d50d1..d762fd6902c 100644
--- a/packages/extension-color/CHANGELOG.md
+++ b/packages/extension-color/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-color/package.json b/packages/extension-color/package.json
index 90f9785badd..1943e4f48e5 100644
--- a/packages/extension-color/package.json
+++ b/packages/extension-color/package.json
@@ -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",
diff --git a/packages/extension-document/CHANGELOG.md b/packages/extension-document/CHANGELOG.md
index 35be193b4ce..0f4996098ba 100644
--- a/packages/extension-document/CHANGELOG.md
+++ b/packages/extension-document/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-document/package.json b/packages/extension-document/package.json
index 84ff71ff761..941b0c45b9e 100644
--- a/packages/extension-document/package.json
+++ b/packages/extension-document/package.json
@@ -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"
diff --git a/packages/extension-dropcursor/CHANGELOG.md b/packages/extension-dropcursor/CHANGELOG.md
index 0791330394c..ad6c1e994fd 100644
--- a/packages/extension-dropcursor/CHANGELOG.md
+++ b/packages/extension-dropcursor/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-dropcursor/package.json b/packages/extension-dropcursor/package.json
index 66b7e732951..c017db063cf 100644
--- a/packages/extension-dropcursor/package.json
+++ b/packages/extension-dropcursor/package.json
@@ -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",
diff --git a/packages/extension-floating-menu/CHANGELOG.md b/packages/extension-floating-menu/CHANGELOG.md
index 1682406efc8..58bd975ee7d 100644
--- a/packages/extension-floating-menu/CHANGELOG.md
+++ b/packages/extension-floating-menu/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-floating-menu/package.json b/packages/extension-floating-menu/package.json
index c30e9fb3095..516cc16efcf 100644
--- a/packages/extension-floating-menu/package.json
+++ b/packages/extension-floating-menu/package.json
@@ -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",
diff --git a/packages/extension-focus/CHANGELOG.md b/packages/extension-focus/CHANGELOG.md
index fea849d8f99..77bc016f0fe 100644
--- a/packages/extension-focus/CHANGELOG.md
+++ b/packages/extension-focus/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-focus/package.json b/packages/extension-focus/package.json
index 5c0bf3ee42f..54b8e8032d5 100644
--- a/packages/extension-focus/package.json
+++ b/packages/extension-focus/package.json
@@ -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",
diff --git a/packages/extension-font-family/CHANGELOG.md b/packages/extension-font-family/CHANGELOG.md
index f22bc8eacd0..f3c6e73c066 100644
--- a/packages/extension-font-family/CHANGELOG.md
+++ b/packages/extension-font-family/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-font-family/package.json b/packages/extension-font-family/package.json
index 996e2f3764a..fc762b033ea 100644
--- a/packages/extension-font-family/package.json
+++ b/packages/extension-font-family/package.json
@@ -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",
diff --git a/packages/extension-gapcursor/CHANGELOG.md b/packages/extension-gapcursor/CHANGELOG.md
index 2531f6cdcf8..0da8b7cd4a9 100644
--- a/packages/extension-gapcursor/CHANGELOG.md
+++ b/packages/extension-gapcursor/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-gapcursor/package.json b/packages/extension-gapcursor/package.json
index affd78d7c90..b2ea5b76bfc 100644
--- a/packages/extension-gapcursor/package.json
+++ b/packages/extension-gapcursor/package.json
@@ -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",
diff --git a/packages/extension-hard-break/CHANGELOG.md b/packages/extension-hard-break/CHANGELOG.md
index cc2b713e802..b6447de50cb 100644
--- a/packages/extension-hard-break/CHANGELOG.md
+++ b/packages/extension-hard-break/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-hard-break/package.json b/packages/extension-hard-break/package.json
index 26765c72ab7..5226807f49b 100644
--- a/packages/extension-hard-break/package.json
+++ b/packages/extension-hard-break/package.json
@@ -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"
diff --git a/packages/extension-heading/CHANGELOG.md b/packages/extension-heading/CHANGELOG.md
index c2b393f37e8..f34511346f3 100644
--- a/packages/extension-heading/CHANGELOG.md
+++ b/packages/extension-heading/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-heading/package.json b/packages/extension-heading/package.json
index 812b9f54ef5..f8027e22bb3 100644
--- a/packages/extension-heading/package.json
+++ b/packages/extension-heading/package.json
@@ -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"
diff --git a/packages/extension-highlight/CHANGELOG.md b/packages/extension-highlight/CHANGELOG.md
index 468f148facb..00529a7c775 100644
--- a/packages/extension-highlight/CHANGELOG.md
+++ b/packages/extension-highlight/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-highlight/package.json b/packages/extension-highlight/package.json
index 7c668af202a..08e22334bb0 100644
--- a/packages/extension-highlight/package.json
+++ b/packages/extension-highlight/package.json
@@ -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"
diff --git a/packages/extension-history/CHANGELOG.md b/packages/extension-history/CHANGELOG.md
index dbead5776d0..b33a3364e7a 100644
--- a/packages/extension-history/CHANGELOG.md
+++ b/packages/extension-history/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-history/package.json b/packages/extension-history/package.json
index 808363b6398..4f7ef0e7083 100644
--- a/packages/extension-history/package.json
+++ b/packages/extension-history/package.json
@@ -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",
diff --git a/packages/extension-horizontal-rule/CHANGELOG.md b/packages/extension-horizontal-rule/CHANGELOG.md
index d0f809e9dfa..c9f1b405a31 100644
--- a/packages/extension-horizontal-rule/CHANGELOG.md
+++ b/packages/extension-horizontal-rule/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-horizontal-rule/package.json b/packages/extension-horizontal-rule/package.json
index 67e88f5759f..cb4bd4a0ad6 100644
--- a/packages/extension-horizontal-rule/package.json
+++ b/packages/extension-horizontal-rule/package.json
@@ -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",
diff --git a/packages/extension-image/CHANGELOG.md b/packages/extension-image/CHANGELOG.md
index cf819b197ba..499fe09e323 100644
--- a/packages/extension-image/CHANGELOG.md
+++ b/packages/extension-image/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-image/package.json b/packages/extension-image/package.json
index 5e7d4333008..d51bb1370e5 100644
--- a/packages/extension-image/package.json
+++ b/packages/extension-image/package.json
@@ -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"
diff --git a/packages/extension-italic/CHANGELOG.md b/packages/extension-italic/CHANGELOG.md
index 6eb4291c2c1..39e4ba780f7 100644
--- a/packages/extension-italic/CHANGELOG.md
+++ b/packages/extension-italic/CHANGELOG.md
@@ -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
diff --git a/packages/extension-italic/package.json b/packages/extension-italic/package.json
index 3de31044200..f722513f384 100644
--- a/packages/extension-italic/package.json
+++ b/packages/extension-italic/package.json
@@ -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"
diff --git a/packages/extension-italic/src/italic.ts b/packages/extension-italic/src/italic.ts
index 6afc6b3288f..9a737c94c7e 100644
--- a/packages/extension-italic/src/italic.ts
+++ b/packages/extension-italic/src/italic.ts
@@ -78,6 +78,10 @@ export const Italic = Mark.create({
tag: 'i',
getAttrs: node => (node as HTMLElement).style.fontStyle !== 'normal' && null,
},
+ {
+ style: 'font-style=normal',
+ clearMark: mark => mark.type.name === this.name,
+ },
{
style: 'font-style=italic',
},
diff --git a/packages/extension-link/CHANGELOG.md b/packages/extension-link/CHANGELOG.md
index dbec73611cc..61421ddf0ca 100644
--- a/packages/extension-link/CHANGELOG.md
+++ b/packages/extension-link/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-link/package.json b/packages/extension-link/package.json
index 248f5c62a9d..fbf84cabdbf 100644
--- a/packages/extension-link/package.json
+++ b/packages/extension-link/package.json
@@ -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",
diff --git a/packages/extension-list-item/CHANGELOG.md b/packages/extension-list-item/CHANGELOG.md
index 14bc1d5b857..4edcb1387d2 100644
--- a/packages/extension-list-item/CHANGELOG.md
+++ b/packages/extension-list-item/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-list-item/package.json b/packages/extension-list-item/package.json
index 59a1871af90..6914c16838d 100644
--- a/packages/extension-list-item/package.json
+++ b/packages/extension-list-item/package.json
@@ -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"
diff --git a/packages/extension-list-keymap/CHANGELOG.md b/packages/extension-list-keymap/CHANGELOG.md
index 286d8564cfb..052186f9ef0 100644
--- a/packages/extension-list-keymap/CHANGELOG.md
+++ b/packages/extension-list-keymap/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-list-keymap/package.json b/packages/extension-list-keymap/package.json
index 0c001ae13be..3d36ccf2dc1 100644
--- a/packages/extension-list-keymap/package.json
+++ b/packages/extension-list-keymap/package.json
@@ -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"
diff --git a/packages/extension-mention/CHANGELOG.md b/packages/extension-mention/CHANGELOG.md
index 1b749e1e9e0..8074bb98f48 100644
--- a/packages/extension-mention/CHANGELOG.md
+++ b/packages/extension-mention/CHANGELOG.md
@@ -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
diff --git a/packages/extension-mention/package.json b/packages/extension-mention/package.json
index f5389823d17..8a801737da1 100644
--- a/packages/extension-mention/package.json
+++ b/packages/extension-mention/package.json
@@ -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",
diff --git a/packages/extension-mention/src/mention.ts b/packages/extension-mention/src/mention.ts
index a3d2f2146fd..04b0056a119 100644
--- a/packages/extension-mention/src/mention.ts
+++ b/packages/extension-mention/src/mention.ts
@@ -77,6 +77,8 @@ export const MentionPluginKey = new PluginKey('mention')
export const Mention = Node.create({
name: 'mention',
+ priority: 101,
+
addOptions() {
return {
HTMLAttributes: {},
diff --git a/packages/extension-ordered-list/CHANGELOG.md b/packages/extension-ordered-list/CHANGELOG.md
index 250a54250e2..16b7d52b3f5 100644
--- a/packages/extension-ordered-list/CHANGELOG.md
+++ b/packages/extension-ordered-list/CHANGELOG.md
@@ -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
diff --git a/packages/extension-ordered-list/package.json b/packages/extension-ordered-list/package.json
index 7d54ac0cf75..23fb6c3fc1e 100644
--- a/packages/extension-ordered-list/package.json
+++ b/packages/extension-ordered-list/package.json
@@ -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",
diff --git a/packages/extension-ordered-list/src/ordered-list.ts b/packages/extension-ordered-list/src/ordered-list.ts
index d4cf1c4720a..950ac92ccc7 100644
--- a/packages/extension-ordered-list/src/ordered-list.ts
+++ b/packages/extension-ordered-list/src/ordered-list.ts
@@ -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({
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({
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,
})
diff --git a/packages/extension-paragraph/CHANGELOG.md b/packages/extension-paragraph/CHANGELOG.md
index 909da6bbfca..38727b9c572 100644
--- a/packages/extension-paragraph/CHANGELOG.md
+++ b/packages/extension-paragraph/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-paragraph/package.json b/packages/extension-paragraph/package.json
index c0e0d346dcc..adc42632e71 100644
--- a/packages/extension-paragraph/package.json
+++ b/packages/extension-paragraph/package.json
@@ -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"
diff --git a/packages/extension-placeholder/CHANGELOG.md b/packages/extension-placeholder/CHANGELOG.md
index af3e4378c07..3404f49f950 100644
--- a/packages/extension-placeholder/CHANGELOG.md
+++ b/packages/extension-placeholder/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-placeholder/package.json b/packages/extension-placeholder/package.json
index 01151c4de66..5a26f758bd9 100644
--- a/packages/extension-placeholder/package.json
+++ b/packages/extension-placeholder/package.json
@@ -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",
diff --git a/packages/extension-strike/CHANGELOG.md b/packages/extension-strike/CHANGELOG.md
index 835aeee53a1..414fb8dce8b 100644
--- a/packages/extension-strike/CHANGELOG.md
+++ b/packages/extension-strike/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-strike/package.json b/packages/extension-strike/package.json
index 55d72c6168a..2709e11f69b 100644
--- a/packages/extension-strike/package.json
+++ b/packages/extension-strike/package.json
@@ -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"
diff --git a/packages/extension-subscript/CHANGELOG.md b/packages/extension-subscript/CHANGELOG.md
index 3ed7316e2fc..98673be2c27 100644
--- a/packages/extension-subscript/CHANGELOG.md
+++ b/packages/extension-subscript/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-subscript/package.json b/packages/extension-subscript/package.json
index 799e5b32596..4eec3b3fa6c 100644
--- a/packages/extension-subscript/package.json
+++ b/packages/extension-subscript/package.json
@@ -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"
diff --git a/packages/extension-superscript/CHANGELOG.md b/packages/extension-superscript/CHANGELOG.md
index e636dfd438d..eba6c81e758 100644
--- a/packages/extension-superscript/CHANGELOG.md
+++ b/packages/extension-superscript/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-superscript/package.json b/packages/extension-superscript/package.json
index ab21063c21f..dcc1df35c81 100644
--- a/packages/extension-superscript/package.json
+++ b/packages/extension-superscript/package.json
@@ -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"
diff --git a/packages/extension-table-cell/CHANGELOG.md b/packages/extension-table-cell/CHANGELOG.md
index 0ea4fc2e256..953d4d33845 100644
--- a/packages/extension-table-cell/CHANGELOG.md
+++ b/packages/extension-table-cell/CHANGELOG.md
@@ -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
diff --git a/packages/extension-table-cell/package.json b/packages/extension-table-cell/package.json
index 98e991ba970..84cb13e2fb6 100644
--- a/packages/extension-table-cell/package.json
+++ b/packages/extension-table-cell/package.json
@@ -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"
diff --git a/packages/extension-table-header/CHANGELOG.md b/packages/extension-table-header/CHANGELOG.md
index eab32a42ec0..e57d7233015 100644
--- a/packages/extension-table-header/CHANGELOG.md
+++ b/packages/extension-table-header/CHANGELOG.md
@@ -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
diff --git a/packages/extension-table-header/package.json b/packages/extension-table-header/package.json
index 90edd27128e..5f7ddb07f73 100644
--- a/packages/extension-table-header/package.json
+++ b/packages/extension-table-header/package.json
@@ -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"
diff --git a/packages/extension-table-row/CHANGELOG.md b/packages/extension-table-row/CHANGELOG.md
index 623d7a261ca..4379b1d72f9 100644
--- a/packages/extension-table-row/CHANGELOG.md
+++ b/packages/extension-table-row/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-table-row/package.json b/packages/extension-table-row/package.json
index 535667690f2..d4fb64caa50 100644
--- a/packages/extension-table-row/package.json
+++ b/packages/extension-table-row/package.json
@@ -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"
diff --git a/packages/extension-table/CHANGELOG.md b/packages/extension-table/CHANGELOG.md
index d97e62a547a..cdaef43885e 100644
--- a/packages/extension-table/CHANGELOG.md
+++ b/packages/extension-table/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-table/package.json b/packages/extension-table/package.json
index e3501a856d4..1cf3c17817a 100644
--- a/packages/extension-table/package.json
+++ b/packages/extension-table/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-table",
"description": "table 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",
diff --git a/packages/extension-task-item/CHANGELOG.md b/packages/extension-task-item/CHANGELOG.md
index 86455c0bdbb..dee032b7523 100644
--- a/packages/extension-task-item/CHANGELOG.md
+++ b/packages/extension-task-item/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-task-item/package.json b/packages/extension-task-item/package.json
index 9da05fa8838..9d96f96a8d6 100644
--- a/packages/extension-task-item/package.json
+++ b/packages/extension-task-item/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-task-item",
"description": "task item 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",
diff --git a/packages/extension-task-list/CHANGELOG.md b/packages/extension-task-list/CHANGELOG.md
index aac04ac1150..8cc41180bb4 100644
--- a/packages/extension-task-list/CHANGELOG.md
+++ b/packages/extension-task-list/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-task-list/package.json b/packages/extension-task-list/package.json
index 86c4be3e67d..15e1445a9fe 100644
--- a/packages/extension-task-list/package.json
+++ b/packages/extension-task-list/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-task-list",
"description": "task list 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"
diff --git a/packages/extension-text-align/CHANGELOG.md b/packages/extension-text-align/CHANGELOG.md
index f0f2701cee3..8405be430f3 100644
--- a/packages/extension-text-align/CHANGELOG.md
+++ b/packages/extension-text-align/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-text-align/package.json b/packages/extension-text-align/package.json
index 03b039fac49..fe008aef6fb 100644
--- a/packages/extension-text-align/package.json
+++ b/packages/extension-text-align/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-text-align",
"description": "text align 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"
diff --git a/packages/extension-text-style/CHANGELOG.md b/packages/extension-text-style/CHANGELOG.md
index 6a19d4e802a..3d4b86432a1 100644
--- a/packages/extension-text-style/CHANGELOG.md
+++ b/packages/extension-text-style/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-text-style/package.json b/packages/extension-text-style/package.json
index 9307e57b287..9c0b2e6bd22 100644
--- a/packages/extension-text-style/package.json
+++ b/packages/extension-text-style/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-text-style",
"description": "text style 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"
diff --git a/packages/extension-text/CHANGELOG.md b/packages/extension-text/CHANGELOG.md
index 7e48efc226b..ebbffb5b74a 100644
--- a/packages/extension-text/CHANGELOG.md
+++ b/packages/extension-text/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-text/package.json b/packages/extension-text/package.json
index 02fd9b744e7..cec0d285f71 100644
--- a/packages/extension-text/package.json
+++ b/packages/extension-text/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-text",
"description": "text 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"
diff --git a/packages/extension-typography/CHANGELOG.md b/packages/extension-typography/CHANGELOG.md
index 0f3acede6b0..6ff956ebb8d 100644
--- a/packages/extension-typography/CHANGELOG.md
+++ b/packages/extension-typography/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-typography/package.json b/packages/extension-typography/package.json
index b42b484c2db..d25115342a5 100644
--- a/packages/extension-typography/package.json
+++ b/packages/extension-typography/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-typography",
"description": "typography 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"
diff --git a/packages/extension-underline/CHANGELOG.md b/packages/extension-underline/CHANGELOG.md
index 09b819d394c..af00df56a7d 100644
--- a/packages/extension-underline/CHANGELOG.md
+++ b/packages/extension-underline/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-underline/package.json b/packages/extension-underline/package.json
index 40b04f3399c..fe905ec332d 100644
--- a/packages/extension-underline/package.json
+++ b/packages/extension-underline/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-underline",
"description": "underline 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"
diff --git a/packages/extension-youtube/CHANGELOG.md b/packages/extension-youtube/CHANGELOG.md
index d0c7a21d9ee..f4bfca73472 100644
--- a/packages/extension-youtube/CHANGELOG.md
+++ b/packages/extension-youtube/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/extension-youtube/package.json b/packages/extension-youtube/package.json
index 180e9140725..51ce44df997 100644
--- a/packages/extension-youtube/package.json
+++ b/packages/extension-youtube/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/extension-youtube",
"description": "a youtube embed 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"
diff --git a/packages/html/CHANGELOG.md b/packages/html/CHANGELOG.md
index f82616d5ce6..a750806e8ca 100644
--- a/packages/html/CHANGELOG.md
+++ b/packages/html/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/html/package.json b/packages/html/package.json
index d00c5d7bbe0..fc0c2ec9103 100644
--- a/packages/html/package.json
+++ b/packages/html/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/html",
"description": "utility package to render tiptap JSON as HTML",
- "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",
diff --git a/packages/pm/CHANGELOG.md b/packages/pm/CHANGELOG.md
index 91510778aa3..2aa96eb20db 100644
--- a/packages/pm/CHANGELOG.md
+++ b/packages/pm/CHANGELOG.md
@@ -1,5 +1,13 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
+### Patch Changes
+
+- feea1f6: Update prosemirror-view version
+
## 2.8.0
### Minor Changes
diff --git a/packages/pm/package.json b/packages/pm/package.json
index 6a010dbe923..d4bb8b0f3b9 100644
--- a/packages/pm/package.json
+++ b/packages/pm/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/pm",
"description": "prosemirror wrapper package for tiptap",
- "version": "2.8.0",
+ "version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md
index d1e7bfe66dc..0a97939543b 100644
--- a/packages/react/CHANGELOG.md
+++ b/packages/react/CHANGELOG.md
@@ -1,5 +1,20 @@
# Change Log
+## 2.9.1
+
+### Patch Changes
+
+- @tiptap/extension-bubble-menu@2.9.1
+- @tiptap/extension-floating-menu@2.9.1
+
+## 2.9.0
+
+### Patch Changes
+
+- 304eedb: preserve editable option across re-renders #5547
+ - @tiptap/extension-bubble-menu@2.9.0
+ - @tiptap/extension-floating-menu@2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/react/package.json b/packages/react/package.json
index 0b4065e3803..350739d702a 100644
--- a/packages/react/package.json
+++ b/packages/react/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/react",
"description": "React components for tiptap",
- "version": "2.8.0",
+ "version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@@ -29,15 +29,15 @@
"dist"
],
"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",
diff --git a/packages/react/src/useEditor.ts b/packages/react/src/useEditor.ts
index 9a841807f63..77684061543 100644
--- a/packages/react/src/useEditor.ts
+++ b/packages/react/src/useEditor.ts
@@ -199,7 +199,10 @@ class EditorInstanceManager {
if (this.editor && !this.editor.isDestroyed && deps.length === 0) {
// if the editor does exist & deps are empty, we don't need to re-initialize the editor
// we can fast-path to update the editor options on the existing instance
- this.editor.setOptions(this.options.current)
+ this.editor.setOptions({
+ ...this.options.current,
+ editable: this.editor.isEditable,
+ })
} else {
// When the editor:
// - does not yet exist
diff --git a/packages/starter-kit/CHANGELOG.md b/packages/starter-kit/CHANGELOG.md
index 3458106e3b8..80e9a9b568e 100644
--- a/packages/starter-kit/CHANGELOG.md
+++ b/packages/starter-kit/CHANGELOG.md
@@ -1,5 +1,68 @@
# Change Log
+## 2.9.1
+
+### Patch Changes
+
+- Updated dependencies [0c9004f]
+ - @tiptap/extension-ordered-list@2.9.1
+ - @tiptap/extension-bullet-list@2.9.1
+ - @tiptap/core@2.9.1
+ - @tiptap/extension-blockquote@2.9.1
+ - @tiptap/extension-bold@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-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
+
+## 2.9.0
+
+### Patch Changes
+
+- 087e581: 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
+- Updated dependencies [ffb51d3]
+- Updated dependencies [6fae240]
+- Updated dependencies [feea1f6]
+- Updated dependencies [873a67c]
+- Updated dependencies [d96f679]
+- Updated dependencies [e606c06]
+- Updated dependencies [a2eea24]
+- Updated dependencies [d96f679]
+- Updated dependencies [4efd227]
+ - @tiptap/core@2.9.0
+ - @tiptap/extension-italic@2.9.0
+ - @tiptap/extension-bold@2.9.0
+ - @tiptap/pm@2.9.0
+ - @tiptap/extension-blockquote@2.9.0
+ - @tiptap/extension-bullet-list@2.9.0
+ - @tiptap/extension-code@2.9.0
+ - @tiptap/extension-code-block@2.9.0
+ - @tiptap/extension-document@2.9.0
+ - @tiptap/extension-dropcursor@2.9.0
+ - @tiptap/extension-gapcursor@2.9.0
+ - @tiptap/extension-hard-break@2.9.0
+ - @tiptap/extension-heading@2.9.0
+ - @tiptap/extension-history@2.9.0
+ - @tiptap/extension-horizontal-rule@2.9.0
+ - @tiptap/extension-list-item@2.9.0
+ - @tiptap/extension-ordered-list@2.9.0
+ - @tiptap/extension-paragraph@2.9.0
+ - @tiptap/extension-strike@2.9.0
+ - @tiptap/extension-text@2.9.0
+ - @tiptap/extension-text-style@2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/starter-kit/package.json b/packages/starter-kit/package.json
index b321c416e55..5a5a1e18a37 100644
--- a/packages/starter-kit/package.json
+++ b/packages/starter-kit/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/starter-kit",
"description": "starter kit for tiptap",
- "version": "2.8.0",
+ "version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@@ -29,27 +29,27 @@
"dist"
],
"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"
},
"repository": {
"type": "git",
diff --git a/packages/suggestion/CHANGELOG.md b/packages/suggestion/CHANGELOG.md
index 45aded83a5b..353e3536e5a 100644
--- a/packages/suggestion/CHANGELOG.md
+++ b/packages/suggestion/CHANGELOG.md
@@ -1,5 +1,9 @@
# Change Log
+## 2.9.1
+
+## 2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/suggestion/package.json b/packages/suggestion/package.json
index ffef68b1e5f..2a5cef87792 100644
--- a/packages/suggestion/package.json
+++ b/packages/suggestion/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/suggestion",
"description": "suggestion plugin 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",
diff --git a/packages/vue-2/CHANGELOG.md b/packages/vue-2/CHANGELOG.md
index acfd601ab9c..ad34d436ae9 100644
--- a/packages/vue-2/CHANGELOG.md
+++ b/packages/vue-2/CHANGELOG.md
@@ -1,5 +1,19 @@
# Change Log
+## 2.9.1
+
+### Patch Changes
+
+- @tiptap/extension-bubble-menu@2.9.1
+- @tiptap/extension-floating-menu@2.9.1
+
+## 2.9.0
+
+### Patch Changes
+
+- @tiptap/extension-bubble-menu@2.9.0
+- @tiptap/extension-floating-menu@2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/vue-2/package.json b/packages/vue-2/package.json
index d8f9cb00326..995e50341e1 100644
--- a/packages/vue-2/package.json
+++ b/packages/vue-2/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/vue-2",
"description": "Vue components for tiptap",
- "version": "2.8.0",
+ "version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@@ -29,13 +29,13 @@
"dist"
],
"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"
},
"peerDependencies": {
diff --git a/packages/vue-3/CHANGELOG.md b/packages/vue-3/CHANGELOG.md
index 3580e71766c..057c6c49655 100644
--- a/packages/vue-3/CHANGELOG.md
+++ b/packages/vue-3/CHANGELOG.md
@@ -1,5 +1,20 @@
# Change Log
+## 2.9.1
+
+### Patch Changes
+
+- @tiptap/extension-bubble-menu@2.9.1
+- @tiptap/extension-floating-menu@2.9.1
+
+## 2.9.0
+
+### Patch Changes
+
+- 364231a: Fix editor content being destroyed before transition end
+ - @tiptap/extension-bubble-menu@2.9.0
+ - @tiptap/extension-floating-menu@2.9.0
+
## 2.8.0
### Minor Changes
diff --git a/packages/vue-3/package.json b/packages/vue-3/package.json
index 64d5d233b61..36526ec60f4 100644
--- a/packages/vue-3/package.json
+++ b/packages/vue-3/package.json
@@ -1,7 +1,7 @@
{
"name": "@tiptap/vue-3",
"description": "Vue components for tiptap",
- "version": "2.8.0",
+ "version": "2.9.1",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
@@ -29,12 +29,12 @@
"dist"
],
"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"
},
"peerDependencies": {
diff --git a/tests/cypress/integration/core/onContentError.spec.ts b/tests/cypress/integration/core/onContentError.spec.ts
index 1d78e68f626..c6bf3d74613 100644
--- a/tests/cypress/integration/core/onContentError.spec.ts
+++ b/tests/cypress/integration/core/onContentError.spec.ts
@@ -134,16 +134,23 @@ describe('onContentError', () => {
const editor = new Editor({
content: json,
- extensions: [Document, Paragraph, Text, Extension.create({ name: 'collaboration' })],
+ extensions: [Document, Paragraph, Text, Extension.create({
+ name: 'collaboration',
+ addStorage() {
+ return {
+ isDisabled: false,
+ }
+ },
+ })],
enableContentCheck: true,
onContentError: args => {
args.disableCollaboration()
- expect(args.editor.extensionManager.extensions.find(extension => extension.name === 'collaboration')).to.eq(undefined)
+ expect(args.editor.storage.collaboration.isDisabled).to.eq(true)
},
})
expect(editor.getText()).to.eq('')
- expect(editor.extensionManager.extensions.find(extension => extension.name === 'collaboration')).to.eq(undefined)
+ expect(editor.storage.collaboration.isDisabled).to.eq(true)
})
it('does not remove the collaboration extension when has valid content (when enableContentCheck = true)', () => {
@@ -164,14 +171,22 @@ describe('onContentError', () => {
const editor = new Editor({
content: json,
- extensions: [Document, Paragraph, Text, Extension.create({ name: 'collaboration' })],
+ extensions: [Document, Paragraph, Text, Extension.create({
+ name: 'collaboration',
+ addStorage() {
+ return {
+ isDisabled: false,
+ }
+ },
+ })],
enableContentCheck: true,
onContentError: () => {
+ // Should not be called, so we fail the test
expect(true).to.eq(false)
},
})
expect(editor.getText()).to.eq('Example Text')
- expect(editor.extensionManager.extensions.find(extension => extension.name === 'collaboration')).to.not.eq(undefined)
+ expect(editor.storage.collaboration.isDisabled).to.eq(false)
})
})