diff --git a/.changeset/blue-poems-camp.md b/.changeset/blue-poems-camp.md deleted file mode 100644 index 332aa3adc..000000000 --- a/.changeset/blue-poems-camp.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tiptap/core": patch ---- - -insertContentAt, setContent, and insertContent commands now respect the editor's pre-defined parseOptions configuration if the command does not specify it's own parseOptions diff --git a/.changeset/calm-carpets-smile.md b/.changeset/calm-carpets-smile.md deleted file mode 100644 index 0110f7065..000000000 --- a/.changeset/calm-carpets-smile.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@tiptap/extension-italic": patch -"@tiptap/extension-bold": patch ---- - -Add parse rules that reset bold & italic marks diff --git a/.changeset/five-melons-compete.md b/.changeset/five-melons-compete.md deleted file mode 100644 index 0d4b8d206..000000000 --- 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/khaki-timers-jump.md b/.changeset/khaki-timers-jump.md deleted file mode 100644 index 08d4492a6..000000000 --- a/.changeset/khaki-timers-jump.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tiptap/pm": patch ---- - -Update prosemirror-view version diff --git a/.changeset/lemon-onions-walk.md b/.changeset/lemon-onions-walk.md deleted file mode 100644 index 84420d3e4..000000000 --- a/.changeset/lemon-onions-walk.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tiptap/extension-mention": patch ---- - -Increase mention extension priority to allow mentions to be inserted in lists using the Enter key diff --git a/.changeset/nervous-bats-film.md b/.changeset/nervous-bats-film.md deleted file mode 100644 index 0defe7125..000000000 --- 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 5fe3d8c28..000000000 --- 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/soft-peaches-hang.md b/.changeset/soft-peaches-hang.md deleted file mode 100644 index 2ba9e1862..000000000 --- a/.changeset/soft-peaches-hang.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tiptap/core": patch ---- - -Added role and aria-label attributes to the contenteditable field for better screenreader support and mouseless controls diff --git a/.changeset/sweet-feet-dream.md b/.changeset/sweet-feet-dream.md deleted file mode 100644 index 8d1b9e180..000000000 --- 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 44bc23650..000000000 --- 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 d86eb94f2..000000000 --- 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 0cb10af92..000000000 --- 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 2da2ad9bb..d3c670724 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 b65da1507..58dff9562 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', '

Tiptap

Hello World

This is a paragraph
with a break.

And this is some additional string content.

') + cy.get('.tiptap').should('contain.html', '

Tiptap

Hello World

This is a paragraph
with a break.

And this is some additional string content.

') }) it('should keep spaces inbetween tags in html content', () => { diff --git a/demos/src/Demos/CollaborationSplitPane/React/Editor.jsx b/demos/src/Demos/CollaborationSplitPane/React/Editor.jsx index feedcbc6a..dbf486379 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 }) => { -
+
- +
) diff --git a/demos/src/Demos/CollaborationSplitPane/React/index.jsx b/demos/src/Demos/CollaborationSplitPane/React/index.jsx index 5a624ee8a..4464403a2 100644 --- a/demos/src/Demos/CollaborationSplitPane/React/index.jsx +++ b/demos/src/Demos/CollaborationSplitPane/React/index.jsx @@ -9,7 +9,7 @@ const appId = '7j9y6m10' const room = `room.${new Date() .getFullYear() .toString() - .slice(-2)}${new Date().getMonth() + 1}${new Date().getDate()}` + .slice(-2)}${new Date().getMonth() + 1}${new Date().getDate()}-ok` // ydoc and provider for Editor A const ydocA = new Y.Doc() diff --git a/demos/src/Nodes/CodeBlockLowlight/React/styles.scss b/demos/src/Nodes/CodeBlockLowlight/React/styles.scss index a8484746e..9e318386e 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 319d5d70e..082a62505 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", + "version": "2.9.1", "license": "MIT", "dependencies": { - "@tiptap/core": "^2.8.0", - "@tiptap/extension-blockquote": "^2.8.0", - "@tiptap/extension-bold": "^2.8.0", - "@tiptap/extension-bullet-list": "^2.8.0", - "@tiptap/extension-code": "^2.8.0", - "@tiptap/extension-code-block": "^2.8.0", - "@tiptap/extension-document": "^2.8.0", - "@tiptap/extension-dropcursor": "^2.8.0", - "@tiptap/extension-gapcursor": "^2.8.0", - "@tiptap/extension-hard-break": "^2.8.0", - "@tiptap/extension-heading": "^2.8.0", - "@tiptap/extension-history": "^2.8.0", - "@tiptap/extension-horizontal-rule": "^2.8.0", - "@tiptap/extension-italic": "^2.8.0", - "@tiptap/extension-list-item": "^2.8.0", - "@tiptap/extension-ordered-list": "^2.8.0", - "@tiptap/extension-paragraph": "^2.8.0", - "@tiptap/extension-strike": "^2.8.0", - "@tiptap/extension-text": "^2.8.0", - "@tiptap/extension-text-style": "^2.8.0", - "@tiptap/pm": "^2.8.0" + "@tiptap/core": "^2.9.1", + "@tiptap/extension-blockquote": "^2.9.1", + "@tiptap/extension-bold": "^2.9.1", + "@tiptap/extension-bullet-list": "^2.9.1", + "@tiptap/extension-code": "^2.9.1", + "@tiptap/extension-code-block": "^2.9.1", + "@tiptap/extension-document": "^2.9.1", + "@tiptap/extension-dropcursor": "^2.9.1", + "@tiptap/extension-gapcursor": "^2.9.1", + "@tiptap/extension-hard-break": "^2.9.1", + "@tiptap/extension-heading": "^2.9.1", + "@tiptap/extension-history": "^2.9.1", + "@tiptap/extension-horizontal-rule": "^2.9.1", + "@tiptap/extension-italic": "^2.9.1", + "@tiptap/extension-list-item": "^2.9.1", + "@tiptap/extension-ordered-list": "^2.9.1", + "@tiptap/extension-paragraph": "^2.9.1", + "@tiptap/extension-strike": "^2.9.1", + "@tiptap/extension-text": "^2.9.1", + "@tiptap/extension-text-style": "^2.9.1", + "@tiptap/pm": "^2.9.1" }, "funding": { "type": "github", @@ -19808,11 +19800,11 @@ }, "packages/suggestion": { "name": "@tiptap/suggestion", - "version": "2.8.0", + "version": "2.9.1", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.8.0", - "@tiptap/pm": "^2.8.0" + "@tiptap/core": "^2.9.1", + "@tiptap/pm": "^2.9.1" }, "funding": { "type": "github", @@ -19825,16 +19817,16 @@ }, "packages/vue-2": { "name": "@tiptap/vue-2", - "version": "2.8.0", + "version": "2.9.1", "license": "MIT", "dependencies": { - "@tiptap/extension-bubble-menu": "^2.8.0", - "@tiptap/extension-floating-menu": "^2.8.0", + "@tiptap/extension-bubble-menu": "^2.9.1", + "@tiptap/extension-floating-menu": "^2.9.1", "vue-ts-types": "^1.6.0" }, "devDependencies": { - "@tiptap/core": "^2.8.0", - "@tiptap/pm": "^2.8.0", + "@tiptap/core": "^2.9.1", + "@tiptap/pm": "^2.9.1", "vue": "^2.6.0" }, "funding": { @@ -19885,15 +19877,15 @@ }, "packages/vue-3": { "name": "@tiptap/vue-3", - "version": "2.8.0", + "version": "2.9.1", "license": "MIT", "dependencies": { - "@tiptap/extension-bubble-menu": "^2.8.0", - "@tiptap/extension-floating-menu": "^2.8.0" + "@tiptap/extension-bubble-menu": "^2.9.1", + "@tiptap/extension-floating-menu": "^2.9.1" }, "devDependencies": { - "@tiptap/core": "^2.8.0", - "@tiptap/pm": "^2.8.0", + "@tiptap/core": "^2.9.1", + "@tiptap/pm": "^2.9.1", "vue": "^3.0.0" }, "funding": { diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index a8fef3765..32270f119 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 0ff969095..883310415 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 cd8526ca9..f7cddb723 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 + + // @ts-ignore + 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({ - // @ts-ignore - plugins: this.state.plugins.filter(plugin => !plugin.key.startsWith(name)), + plugins, }) this.view.updateState(state) @@ -325,6 +337,9 @@ export class Editor extends EventEmitter { 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') diff --git a/packages/core/src/commands/insertContentAt.ts b/packages/core/src/commands/insertContentAt.ts index 11ac94ae6..520398ba1 100644 --- a/packages/core/src/commands/insertContentAt.ts +++ b/packages/core/src/commands/insertContentAt.ts @@ -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 diff --git a/packages/extension-blockquote/CHANGELOG.md b/packages/extension-blockquote/CHANGELOG.md index 4175bed48..8f839e909 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 9c1ea69c6..8855b9d9e 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 5ffb2b2e5..8b1934ce1 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 4bd00ec46..7a22106fc 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-bubble-menu/CHANGELOG.md b/packages/extension-bubble-menu/CHANGELOG.md index 53c925885..81bafa110 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 63678a4f4..ec08af897 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 cdd54d225..1eff126b9 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 dceb8f702..230b7222f 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 63ff3f237..320d3abf4 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 1291e0a33..7a4931ca1 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 f401ddbc8..095c6aa37 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 c524cd8fe..a7c1b646f 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 d908580d5..eb7c6fb33 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 e2b1a6574..47c6d4706 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 d7544b7bb..8d826ba93 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 2404c1ebb..ebd5ef72e 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 be5c2dc6c..6885e96d8 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 a042ed54c..d7bfa4cbf 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 5cfc8991e..680ec81fd 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 3bdc6c396..a26f807fe 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 62bbed865..760c1ba56 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 3ca0c381b..b2a8641ca 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 45ff45d50..d762fd690 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 90f9785ba..1943e4f48 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 35be193b4..0f4996098 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 84ff71ff7..941b0c45b 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 079133039..ad6c1e994 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 66b7e7329..c017db063 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 1682406ef..58bd975ee 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 c30e9fb30..516cc16ef 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 fea849d8f..77bc016f0 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 5c0bf3ee4..54b8e8032 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 f22bc8eac..f3c6e73c0 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 996e2f376..fc762b033 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 2531f6cdc..0da8b7cd4 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 affd78d7c..b2ea5b76b 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 cc2b713e8..b6447de50 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 26765c72a..5226807f4 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 c2b393f37..f34511346 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 812b9f54e..f8027e22b 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 468f148fa..00529a7c7 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 7c668af20..08e22334b 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 dbead5776..b33a3364e 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 808363b63..4f7ef0e70 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 d0f809e9d..c9f1b405a 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 67e88f575..cb4bd4a0a 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 cf819b197..499fe09e3 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 5e7d43330..d51bb1370 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 6eb4291c2..39e4ba780 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 3de310442..f722513f3 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-link/CHANGELOG.md b/packages/extension-link/CHANGELOG.md index dbec73611..61421ddf0 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 248f5c62a..fbf84cabd 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 14bc1d5b8..4edcb1387 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 59a1871af..6914c1683 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 286d8564c..052186f9e 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 0c001ae13..3d36ccf2d 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 1b749e1e9..8074bb98f 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 f5389823d..8a801737d 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-ordered-list/CHANGELOG.md b/packages/extension-ordered-list/CHANGELOG.md index 250a54250..16b7d52b3 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 7d54ac0cf..23fb6c3fc 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 d4cf1c472..950ac92cc 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 909da6bbf..38727b9c5 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 c0e0d346d..adc42632e 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 af3e4378c..3404f49f9 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 01151c4de..5a26f758b 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 835aeee53..414fb8dce 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 55d72c616..2709e11f6 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 3ed7316e2..98673be2c 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 799e5b325..4eec3b3fa 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 e636dfd43..eba6c81e7 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 ab21063c2..dcc1df35c 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 0ea4fc2e2..953d4d338 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 98e991ba9..84cb13e2f 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 eab32a42e..e57d72330 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 90edd2712..5f7ddb07f 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 623d7a261..4379b1d72 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 535667690..d4fb64caa 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 d97e62a54..cdaef4388 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 e3501a856..1cf3c1781 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 86455c0bd..dee032b75 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 9da05fa88..9d96f96a8 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 aac04ac11..8cc41180b 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 86c4be3e6..15e1445a9 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 f0f2701ce..8405be430 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 03b039fac..fe008aef6 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 6a19d4e80..3d4b86432 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 9307e57b2..9c0b2e6bd 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 7e48efc22..ebbffb5b7 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 02fd9b744..cec0d285f 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 0f3acede6..6ff956ebb 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 b42b484c2..d25115342 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 09b819d39..af00df56a 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 40b04f339..fe905ec33 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 d0c7a21d9..f4bfca734 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 180e91407..51ce44df9 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 f82616d5c..a750806e8 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 d00c5d7bb..fc0c2ec91 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 91510778a..2aa96eb20 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 6a010dbe9..d4bb8b0f3 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 d1e7bfe66..0a9793954 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 0b4065e38..350739d70 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 9a841807f..776840615 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 3458106e3..80e9a9b56 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 b321c416e..5a5a1e18a 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 45aded83a..353e3536e 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 ffef68b1e..2a5cef877 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 acfd601ab..ad34d436a 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 d8f9cb003..995e50341 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 3580e7176..057c6c496 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 64d5d233b..36526ec60 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 1d78e68f6..c6bf3d746 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) }) })