diff --git a/.changeset/atom-text-content-in-full.md b/.changeset/atom-text-content-in-full.md deleted file mode 100644 index 2fd75394b07..00000000000 --- a/.changeset/atom-text-content-in-full.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tiptap/core": patch ---- - -Make sure that atoms are used in-full without cutting the content. Node size for atoms is 1 which causes text to be cut unexpectedly. diff --git a/.changeset/rotten-geckos-notice.md b/.changeset/rotten-geckos-notice.md deleted file mode 100644 index 8be7818a63b..00000000000 --- a/.changeset/rotten-geckos-notice.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tiptap/core": patch ---- - -This changes the typing to not declare types on all HTMLElements, just a local one with the editor instance attached diff --git a/.changeset/serious-foxes-decide.md b/.changeset/serious-foxes-decide.md deleted file mode 100644 index 162aa1c17e4..00000000000 --- a/.changeset/serious-foxes-decide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tiptap/extension-task-item": patch ---- - -allow task items to be parsed when only having `
  • { const editor = useEditor({ + editable: true, extensions: [ Document, Paragraph, diff --git a/demos/src/Nodes/Table/React/index.spec.js b/demos/src/Nodes/Table/React/index.spec.js index 57530920daf..0b423b97502 100644 --- a/demos/src/Nodes/Table/React/index.spec.js +++ b/demos/src/Nodes/Table/React/index.spec.js @@ -63,7 +63,7 @@ context('/src/Nodes/Table/React/', () => { const html = editor.getHTML() expect(html).to.equal( - '

    ', + '

    ', ) }) }) @@ -75,7 +75,7 @@ context('/src/Nodes/Table/React/', () => { const html = editor.getHTML() expect(html).to.equal( - '

    ', + '

    ', ) }) }) diff --git a/demos/src/Nodes/Table/Vue/index.spec.js b/demos/src/Nodes/Table/Vue/index.spec.js index 09082c89533..cdfd5e9c258 100644 --- a/demos/src/Nodes/Table/Vue/index.spec.js +++ b/demos/src/Nodes/Table/Vue/index.spec.js @@ -62,7 +62,7 @@ context('/src/Nodes/Table/Vue/', () => { const html = editor.getHTML() - expect(html).to.equal('

    ') + expect(html).to.equal('

    ') }) }) @@ -72,7 +72,7 @@ context('/src/Nodes/Table/Vue/', () => { const html = editor.getHTML() - expect(html).to.equal('

    ') + expect(html).to.equal('

    ') }) }) diff --git a/package-lock.json b/package-lock.json index 9d7687555ad..913362adf30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13755,13 +13755,21 @@ } }, "node_modules/prosemirror-model": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.22.1.tgz", - "integrity": "sha512-gMrxal+F3higDFxCkBK5iQXckRVYvIu/3dopERJ6b20xfwZ9cbYvQvuldqaN+v/XytNPGyURYUpUU23kBRxWCQ==", + "version": "1.22.2", + "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.22.2.tgz", + "integrity": "sha512-I4lS7HHIW47D0Xv/gWmi4iUWcQIDYaJKd8Hk4+lcSps+553FlQrhmxtItpEvTr75iAruhzVShVp6WUwsT6Boww==", "dependencies": { "orderedmap": "^2.0.0" } }, + "node_modules/prosemirror-schema-basic": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/prosemirror-schema-basic/-/prosemirror-schema-basic-1.2.3.tgz", + "integrity": "sha512-h+H0OQwZVqMon1PNn0AG9cTfx513zgIG2DY00eJ00Yvgb3UD+GQ/VlWW5rcaxacpCGT1Yx8nuhwXk4+QbXUfJA==", + "dependencies": { + "prosemirror-model": "^1.19.0" + } + }, "node_modules/prosemirror-schema-list": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.4.1.tgz", @@ -13783,9 +13791,9 @@ } }, "node_modules/prosemirror-tables": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.3.7.tgz", - "integrity": "sha512-oEwX1wrziuxMtwFvdDWSFHVUWrFJWt929kVVfHvtTi8yvw+5ppxjXZkMG/fuTdFo+3DXyIPSKfid+Be1npKXDA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.4.0.tgz", + "integrity": "sha512-fxryZZkQG12fSCNuZDrYx6Xvo2rLYZTbKLRd8rglOPgNJGMKIS8uvTt6gGC38m7UCu/ENnXIP9pEz5uDaPc+cA==", "dependencies": { "prosemirror-keymap": "^1.1.2", "prosemirror-model": "^1.8.1", @@ -13795,17 +13803,17 @@ } }, "node_modules/prosemirror-trailing-node": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/prosemirror-trailing-node/-/prosemirror-trailing-node-2.0.8.tgz", - "integrity": "sha512-ujRYhSuhQb1Jsarh1IHqb2KoSnRiD7wAMDGucP35DN7j5af6X7B18PfdPIrbwsPTqIAj0fyOvxbuPsWhNvylmA==", + "version": "2.0.9", + "resolved": "https://registry.npmjs.org/prosemirror-trailing-node/-/prosemirror-trailing-node-2.0.9.tgz", + "integrity": "sha512-YvyIn3/UaLFlFKrlJB6cObvUhmwFNZVhy1Q8OpW/avoTbD/Y7H5EcjK4AZFKhmuS6/N6WkGgt7gWtBWDnmFvHg==", "dependencies": { "@remirror/core-constants": "^2.0.2", "escape-string-regexp": "^4.0.0" }, "peerDependencies": { - "prosemirror-model": "^1.19.0", + "prosemirror-model": "^1.22.1", "prosemirror-state": "^1.4.2", - "prosemirror-view": "^1.31.2" + "prosemirror-view": "^1.33.8" } }, "node_modules/prosemirror-trailing-node/node_modules/escape-string-regexp": { @@ -13828,9 +13836,9 @@ } }, "node_modules/prosemirror-view": { - "version": "1.33.8", - "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.33.8.tgz", - "integrity": "sha512-4PhMr/ufz2cdvFgpUAnZfs+0xij3RsFysreeG9V/utpwX7AJtYCDVyuRxzWoMJIEf4C7wVihuBNMPpFLPCiLQw==", + "version": "1.33.9", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.33.9.tgz", + "integrity": "sha512-xV1A0Vz9cIcEnwmMhKKFAOkfIp8XmJRnaZoPqNXrPS7EK5n11Ov8V76KhR0RsfQd/SIzmWY+bg+M44A2Lx/Nnw==", "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", @@ -17889,159 +17897,159 @@ }, "packages/core": { "name": "@tiptap/core", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/pm": "^2.5.4" + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/pm": "^2.5.4" + "@tiptap/pm": "^2.5.5" } }, "packages/extension-blockquote": { "name": "@tiptap/extension-blockquote", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-bold": { "name": "@tiptap/extension-bold", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-bubble-menu": { "name": "@tiptap/extension-bubble-menu", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "dependencies": { "tippy.js": "^6.3.7" }, "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-bullet-list": { "name": "@tiptap/extension-bullet-list", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-character-count": { "name": "@tiptap/extension-character-count", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-code": { "name": "@tiptap/extension-code", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-code-block": { "name": "@tiptap/extension-code-block", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-code-block-lowlight": { "name": "@tiptap/extension-code-block-lowlight", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/extension-code-block": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/extension-code-block": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/extension-code-block": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/extension-code-block": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-collaboration": { "name": "@tiptap/extension-collaboration", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5", "y-prosemirror": "^1.2.9" }, "funding": { @@ -18049,17 +18057,17 @@ "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5", "y-prosemirror": "^1.2.6" } }, "packages/extension-collaboration-cursor": { "name": "@tiptap/extension-collaboration-cursor", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", + "@tiptap/core": "^2.5.5", "y-prosemirror": "^1.2.9" }, "funding": { @@ -18067,607 +18075,607 @@ "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", + "@tiptap/core": "^2.5.5", "y-prosemirror": "^1.2.6" } }, "packages/extension-color": { "name": "@tiptap/extension-color", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/extension-text-style": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/extension-text-style": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/extension-text-style": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/extension-text-style": "^2.5.5" } }, "packages/extension-document": { "name": "@tiptap/extension-document", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-dropcursor": { "name": "@tiptap/extension-dropcursor", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-floating-menu": { "name": "@tiptap/extension-floating-menu", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "dependencies": { "tippy.js": "^6.3.7" }, "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-focus": { "name": "@tiptap/extension-focus", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-font-family": { "name": "@tiptap/extension-font-family", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/extension-text-style": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/extension-text-style": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/extension-text-style": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/extension-text-style": "^2.5.5" } }, "packages/extension-gapcursor": { "name": "@tiptap/extension-gapcursor", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-hard-break": { "name": "@tiptap/extension-hard-break", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-heading": { "name": "@tiptap/extension-heading", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-highlight": { "name": "@tiptap/extension-highlight", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-history": { "name": "@tiptap/extension-history", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-horizontal-rule": { "name": "@tiptap/extension-horizontal-rule", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-image": { "name": "@tiptap/extension-image", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-italic": { "name": "@tiptap/extension-italic", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-link": { "name": "@tiptap/extension-link", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "dependencies": { "linkifyjs": "^4.1.0" }, "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-list-item": { "name": "@tiptap/extension-list-item", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-list-keymap": { "name": "@tiptap/extension-list-keymap", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-mention": { "name": "@tiptap/extension-mention", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", - "@tiptap/suggestion": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5", + "@tiptap/suggestion": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", - "@tiptap/suggestion": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5", + "@tiptap/suggestion": "^2.5.5" } }, "packages/extension-ordered-list": { "name": "@tiptap/extension-ordered-list", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-paragraph": { "name": "@tiptap/extension-paragraph", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-placeholder": { "name": "@tiptap/extension-placeholder", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-strike": { "name": "@tiptap/extension-strike", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-subscript": { "name": "@tiptap/extension-subscript", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-superscript": { "name": "@tiptap/extension-superscript", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-table": { "name": "@tiptap/extension-table", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-table-cell": { "name": "@tiptap/extension-table-cell", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-table-header": { "name": "@tiptap/extension-table-header", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-table-row": { "name": "@tiptap/extension-table-row", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-task-item": { "name": "@tiptap/extension-task-item", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/extension-task-list": { "name": "@tiptap/extension-task-list", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-text": { "name": "@tiptap/extension-text", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-text-align": { "name": "@tiptap/extension-text-align", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-text-style": { "name": "@tiptap/extension-text-style", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-typography": { "name": "@tiptap/extension-typography", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-underline": { "name": "@tiptap/extension-underline", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/extension-youtube": { "name": "@tiptap/extension-youtube", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.5" } }, "packages/html": { "name": "@tiptap/html", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "dependencies": { "zeed-dom": "^0.10.9" }, "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/pm": { "name": "@tiptap/pm", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "dependencies": { "prosemirror-changeset": "^2.2.1", @@ -18680,41 +18688,33 @@ "prosemirror-keymap": "^1.2.2", "prosemirror-markdown": "^1.13.0", "prosemirror-menu": "^1.2.4", - "prosemirror-model": "^1.22.1", + "prosemirror-model": "^1.22.2", "prosemirror-schema-basic": "^1.2.3", "prosemirror-schema-list": "^1.4.1", "prosemirror-state": "^1.4.3", - "prosemirror-tables": "^1.3.7", - "prosemirror-trailing-node": "^2.0.8", + "prosemirror-tables": "^1.4.0", + "prosemirror-trailing-node": "^2.0.9", "prosemirror-transform": "^1.9.0", - "prosemirror-view": "^1.33.8" + "prosemirror-view": "^1.33.9" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" } }, - "packages/pm/node_modules/prosemirror-schema-basic": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/prosemirror-schema-basic/-/prosemirror-schema-basic-1.2.3.tgz", - "integrity": "sha512-h+H0OQwZVqMon1PNn0AG9cTfx513zgIG2DY00eJ00Yvgb3UD+GQ/VlWW5rcaxacpCGT1Yx8nuhwXk4+QbXUfJA==", - "dependencies": { - "prosemirror-model": "^1.19.0" - } - }, "packages/react": { "name": "@tiptap/react", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "dependencies": { - "@tiptap/extension-bubble-menu": "^2.5.4", - "@tiptap/extension-floating-menu": "^2.5.4", + "@tiptap/extension-bubble-menu": "^2.5.5", + "@tiptap/extension-floating-menu": "^2.5.5", "@types/use-sync-external-store": "^0.0.6", "use-sync-external-store": "^1.2.2" }, "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5", "@types/react": "^18.2.14", "@types/react-dom": "^18.2.6", "react": "^18.0.0", @@ -18725,36 +18725,36 @@ "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5", "react": "^17.0.0 || ^18.0.0", "react-dom": "^17.0.0 || ^18.0.0" } }, "packages/starter-kit": { "name": "@tiptap/starter-kit", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "dependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/extension-blockquote": "^2.5.4", - "@tiptap/extension-bold": "^2.5.4", - "@tiptap/extension-bullet-list": "^2.5.4", - "@tiptap/extension-code": "^2.5.4", - "@tiptap/extension-code-block": "^2.5.4", - "@tiptap/extension-document": "^2.5.4", - "@tiptap/extension-dropcursor": "^2.5.4", - "@tiptap/extension-gapcursor": "^2.5.4", - "@tiptap/extension-hard-break": "^2.5.4", - "@tiptap/extension-heading": "^2.5.4", - "@tiptap/extension-history": "^2.5.4", - "@tiptap/extension-horizontal-rule": "^2.5.4", - "@tiptap/extension-italic": "^2.5.4", - "@tiptap/extension-list-item": "^2.5.4", - "@tiptap/extension-ordered-list": "^2.5.4", - "@tiptap/extension-paragraph": "^2.5.4", - "@tiptap/extension-strike": "^2.5.4", - "@tiptap/extension-text": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/extension-blockquote": "^2.5.5", + "@tiptap/extension-bold": "^2.5.5", + "@tiptap/extension-bullet-list": "^2.5.5", + "@tiptap/extension-code": "^2.5.5", + "@tiptap/extension-code-block": "^2.5.5", + "@tiptap/extension-document": "^2.5.5", + "@tiptap/extension-dropcursor": "^2.5.5", + "@tiptap/extension-gapcursor": "^2.5.5", + "@tiptap/extension-hard-break": "^2.5.5", + "@tiptap/extension-heading": "^2.5.5", + "@tiptap/extension-history": "^2.5.5", + "@tiptap/extension-horizontal-rule": "^2.5.5", + "@tiptap/extension-italic": "^2.5.5", + "@tiptap/extension-list-item": "^2.5.5", + "@tiptap/extension-ordered-list": "^2.5.5", + "@tiptap/extension-paragraph": "^2.5.5", + "@tiptap/extension-strike": "^2.5.5", + "@tiptap/extension-text": "^2.5.5" }, "funding": { "type": "github", @@ -18763,33 +18763,33 @@ }, "packages/suggestion": { "name": "@tiptap/suggestion", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" }, "funding": { "type": "github", "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5" } }, "packages/vue-2": { "name": "@tiptap/vue-2", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "dependencies": { - "@tiptap/extension-bubble-menu": "^2.5.4", - "@tiptap/extension-floating-menu": "^2.5.4", + "@tiptap/extension-bubble-menu": "^2.5.5", + "@tiptap/extension-floating-menu": "^2.5.5", "vue-ts-types": "^1.6.0" }, "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5", "vue": "^2.6.0" }, "funding": { @@ -18797,8 +18797,8 @@ "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5", "vue": "^2.6.0" } }, @@ -18829,15 +18829,15 @@ }, "packages/vue-3": { "name": "@tiptap/vue-3", - "version": "2.5.4", + "version": "2.5.5", "license": "MIT", "dependencies": { - "@tiptap/extension-bubble-menu": "^2.5.4", - "@tiptap/extension-floating-menu": "^2.5.4" + "@tiptap/extension-bubble-menu": "^2.5.5", + "@tiptap/extension-floating-menu": "^2.5.5" }, "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5", "vue": "^3.0.0" }, "funding": { @@ -18845,8 +18845,8 @@ "url": "https://github.com/sponsors/ueberdosis" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", + "@tiptap/core": "^2.5.5", + "@tiptap/pm": "^2.5.5", "vue": "^3.0.0" } } diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 761a52bc897..4664505876d 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,23 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- 618bca9: Adjust the `splitBlock` command to return `false` when it was unsuccessful. +- 35682d1: This fixes a bug with the placeholder extension where a heading level other than the default was not considered empty, when comparing node contents, we need to consider that the node attributes are carried over for a fair comparison of content instead of attribute values +- 2104f0f: Add a check beforecreateNodeViews so that view.setProps is not called when the view has already been destroyed +- Updated dependencies [b5c1b32] + - @tiptap/pm@2.5.6 + +## 2.5.5 + +### Patch Changes + +- 4cca382: Make sure that atoms are used in-full without cutting the content. Node size for atoms is 1 which causes text to be cut unexpectedly. +- 3b67e8a: This changes the typing to not declare types on all HTMLElements, just a local one with the editor instance attached + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index bb87a7240d4..f08d30db52d 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -32,10 +32,10 @@ "dist" ], "devDependencies": { - "@tiptap/pm": "^2.5.4" + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/pm": "^2.5.4" + "@tiptap/pm": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/core/src/Editor.ts b/packages/core/src/Editor.ts index 109ee8dca0d..cd04cafc224 100644 --- a/packages/core/src/Editor.ts +++ b/packages/core/src/Editor.ts @@ -39,6 +39,7 @@ import { isFunction } from './utilities/isFunction.js' export * as extensions from './extensions/index.js' +// @ts-ignore export interface TiptapEditorHTMLElement extends HTMLElement { editor?: Editor } @@ -340,6 +341,7 @@ export class Editor extends EventEmitter { // Let’s store the editor instance in the DOM element. // So we’ll have access to it for tests. + // @ts-ignore const dom = this.view.dom as TiptapEditorHTMLElement dom.editor = this @@ -349,6 +351,10 @@ export class Editor extends EventEmitter { * Creates all node views. */ public createNodeViews(): void { + if (this.view.isDestroyed) { + return + } + this.view.setProps({ nodeViews: this.extensionManager.nodeViews, }) @@ -404,6 +410,11 @@ export class Editor extends EventEmitter { const state = this.state.apply(transaction) const selectionHasChanged = !this.state.selection.eq(state.selection) + this.emit('beforeTransaction', { + editor: this, + transaction, + nextState: state, + }) this.view.updateState(state) this.emit('transaction', { editor: this, diff --git a/packages/core/src/commands/splitBlock.ts b/packages/core/src/commands/splitBlock.ts index 483abb76c7f..2bd4ed532a4 100644 --- a/packages/core/src/commands/splitBlock.ts +++ b/packages/core/src/commands/splitBlock.ts @@ -61,18 +61,30 @@ export const splitBlock: RawCommands['splitBlock'] = ({ keepMarks = true } = {}) return false } - if (dispatch) { - const atEnd = $to.parentOffset === $to.parent.content.size - - if (selection instanceof TextSelection) { - tr.deleteSelection() - } - - const deflt = $from.depth === 0 - ? undefined - : defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1))) - - let types = atEnd && deflt + const atEnd = $to.parentOffset === $to.parent.content.size + + const deflt = $from.depth === 0 + ? undefined + : defaultBlockAt($from.node(-1).contentMatchAt($from.indexAfter(-1))) + + let types = atEnd && deflt + ? [ + { + type: deflt, + attrs: newAttributes, + }, + ] + : undefined + + let can = canSplit(tr.doc, tr.mapping.map($from.pos), 1, types) + + if ( + !types + && !can + && canSplit(tr.doc, tr.mapping.map($from.pos), 1, deflt ? [{ type: deflt }] : undefined) + ) { + can = true + types = deflt ? [ { type: deflt, @@ -80,26 +92,14 @@ export const splitBlock: RawCommands['splitBlock'] = ({ keepMarks = true } = {}) }, ] : undefined + } - let can = canSplit(tr.doc, tr.mapping.map($from.pos), 1, types) - - if ( - !types - && !can - && canSplit(tr.doc, tr.mapping.map($from.pos), 1, deflt ? [{ type: deflt }] : undefined) - ) { - can = true - types = deflt - ? [ - { - type: deflt, - attrs: newAttributes, - }, - ] - : undefined - } - + if (dispatch) { if (can) { + if (selection instanceof TextSelection) { + tr.deleteSelection() + } + tr.split(tr.mapping.map($from.pos), 1, types) if (deflt && !atEnd && !$from.parentOffset && $from.parent.type !== deflt) { @@ -119,5 +119,5 @@ export const splitBlock: RawCommands['splitBlock'] = ({ keepMarks = true } = {}) tr.scrollIntoView() } - return true + return can } diff --git a/packages/core/src/helpers/createNodeFromContent.ts b/packages/core/src/helpers/createNodeFromContent.ts index 0d89553d43b..7fe83f83cab 100644 --- a/packages/core/src/helpers/createNodeFromContent.ts +++ b/packages/core/src/helpers/createNodeFromContent.ts @@ -58,13 +58,14 @@ export function createNodeFromContent( } if (isTextContent) { - let schemaToUse = schema - let hasInvalidContent = false - let invalidContent = '' - // Only ever check for invalid content if we're supposed to throw an error + // Check for invalid content if (options.errorOnInvalidContent) { - schemaToUse = new Schema({ + let hasInvalidContent = false + let invalidContent = '' + + // A copy of the current schema with a catch-all node at the end + const contentCheckSchema = new Schema({ topNode: schema.spec.topNode, marks: schema.spec.marks, // Prosemirror's schemas are executed such that: the last to execute, matches last @@ -88,19 +89,26 @@ export function createNodeFromContent( }, }), }) - } - const parser = DOMParser.fromSchema(schemaToUse) + if (options.slice) { + DOMParser.fromSchema(contentCheckSchema).parseSlice(elementFromString(content), options.parseOptions) + } else { + DOMParser.fromSchema(contentCheckSchema).parse(elementFromString(content), options.parseOptions) + } - const response = options.slice - ? parser.parseSlice(elementFromString(content), options.parseOptions).content - : parser.parse(elementFromString(content), options.parseOptions) + if (options.errorOnInvalidContent && hasInvalidContent) { + throw new Error('[tiptap error]: Invalid HTML content', { cause: new Error(`Invalid element found: ${invalidContent}`) }) + } + } + + const parser = DOMParser.fromSchema(schema) - if (options.errorOnInvalidContent && hasInvalidContent) { - throw new Error('[tiptap error]: Invalid HTML content', { cause: new Error(`Invalid element found: ${invalidContent}`) }) + if (options.slice) { + return parser.parseSlice(elementFromString(content), options.parseOptions).content } - return response + return parser.parse(elementFromString(content), options.parseOptions) + } return createNodeFromContent('', schema, options) diff --git a/packages/core/src/helpers/isNodeEmpty.ts b/packages/core/src/helpers/isNodeEmpty.ts index daa4c5e4980..5d7a777d4e6 100644 --- a/packages/core/src/helpers/isNodeEmpty.ts +++ b/packages/core/src/helpers/isNodeEmpty.ts @@ -1,11 +1,41 @@ import { Node as ProseMirrorNode } from '@tiptap/pm/model' -export function isNodeEmpty(node: ProseMirrorNode): boolean { - const defaultContent = node.type.createAndFill() +/** + * Returns true if the given node is empty. + * When `checkChildren` is true (default), it will also check if all children are empty. + */ +export function isNodeEmpty( + node: ProseMirrorNode, + { checkChildren }: { checkChildren: boolean } = { checkChildren: true }, +): boolean { + if (node.isText) { + return !node.text + } + + if (node.content.childCount === 0) { + return true + } - if (!defaultContent) { + if (node.isLeaf) { return false } - return node.eq(defaultContent) + if (checkChildren) { + let hasSameContent = true + + node.content.forEach(childNode => { + if (hasSameContent === false) { + // Exit early for perf + return + } + + if (!isNodeEmpty(childNode)) { + hasSameContent = false + } + }) + + return hasSameContent + } + + return false } diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 41964830c8b..a83281e2f5d 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -1,5 +1,8 @@ import { - Mark as ProseMirrorMark, Node as ProseMirrorNode, NodeType, ParseOptions, + Mark as ProseMirrorMark, + Node as ProseMirrorNode, + NodeType, + ParseOptions, } from '@tiptap/pm/model' import { EditorState, Transaction } from '@tiptap/pm/state' import { @@ -14,266 +17,265 @@ import { import { Mark } from './Mark.js' import { Node } from './Node.js' -export type AnyConfig = ExtensionConfig | NodeConfig | MarkConfig -export type AnyExtension = Extension | Node | Mark -export type Extensions = AnyExtension[] +export type AnyConfig = ExtensionConfig | NodeConfig | MarkConfig; +export type AnyExtension = Extension | Node | Mark; +export type Extensions = AnyExtension[]; export type ParentConfig = Partial<{ [P in keyof T]: Required[P] extends (...args: any) => any ? (...args: Parameters[P]>) => ReturnType[P]> - : T[P] -}> + : T[P]; +}>; -export type Primitive = null | undefined | string | number | boolean | symbol | bigint +export type Primitive = null | undefined | string | number | boolean | symbol | bigint; export type RemoveThis = T extends (...args: any) => any ? (...args: Parameters) => ReturnType - : T + : T; -export type MaybeReturnType = T extends (...args: any) => any ? ReturnType : T +export type MaybeReturnType = T extends (...args: any) => any ? ReturnType : T; export type MaybeThisParameterType = Exclude extends (...args: any) => any ? ThisParameterType> - : any + : any; export interface EditorEvents { - beforeCreate: { editor: Editor } - create: { editor: Editor } + beforeCreate: { editor: Editor }; + create: { editor: Editor }; contentError: { - editor: Editor, - error: Error, + editor: Editor; + error: Error; /** * If called, will re-initialize the editor with the collaboration extension removed. * This will prevent syncing back deletions of content not present in the current schema. */ - disableCollaboration: () => void - } - update: { editor: Editor; transaction: Transaction } - selectionUpdate: { editor: Editor; transaction: Transaction } - transaction: { editor: Editor; transaction: Transaction } - focus: { editor: Editor; event: FocusEvent; transaction: Transaction } - blur: { editor: Editor; event: FocusEvent; transaction: Transaction } - destroy: void + disableCollaboration: () => void; + }; + update: { editor: Editor; transaction: Transaction }; + selectionUpdate: { editor: Editor; transaction: Transaction }; + beforeTransaction: { editor: Editor; transaction: Transaction; nextState: EditorState }; + transaction: { editor: Editor; transaction: Transaction }; + focus: { editor: Editor; event: FocusEvent; transaction: Transaction }; + blur: { editor: Editor; event: FocusEvent; transaction: Transaction }; + destroy: void; } -export type EnableRules = (AnyExtension | string)[] | boolean +export type EnableRules = (AnyExtension | string)[] | boolean; export interface EditorOptions { - element: Element - content: Content - extensions: Extensions - injectCSS: boolean - injectNonce: string | undefined - autofocus: FocusPosition - editable: boolean - editorProps: EditorProps - parseOptions: ParseOptions + element: Element; + content: Content; + extensions: Extensions; + injectCSS: boolean; + injectNonce: string | undefined; + autofocus: FocusPosition; + editable: boolean; + editorProps: EditorProps; + parseOptions: ParseOptions; coreExtensionOptions?: { clipboardTextSerializer?: { - blockSeparator?: string - } - } - enableInputRules: EnableRules - enablePasteRules: EnableRules - enableCoreExtensions: boolean + blockSeparator?: string; + }; + }; + enableInputRules: EnableRules; + enablePasteRules: EnableRules; + enableCoreExtensions: boolean; /** * If `true`, the editor will check the content for errors on initialization. * Emitting the `contentError` event if the content is invalid. * Which can be used to show a warning or error message to the user. * @default false */ - enableContentCheck: boolean - onBeforeCreate: (props: EditorEvents['beforeCreate']) => void - onCreate: (props: EditorEvents['create']) => void + enableContentCheck: boolean; + onBeforeCreate: (props: EditorEvents['beforeCreate']) => void; + onCreate: (props: EditorEvents['create']) => void; /** * Called when the editor encounters an error while parsing the content. * Only enabled if `enableContentCheck` is `true`. */ - onContentError: (props: EditorEvents['contentError']) => void - onUpdate: (props: EditorEvents['update']) => void - onSelectionUpdate: (props: EditorEvents['selectionUpdate']) => void - onTransaction: (props: EditorEvents['transaction']) => void - onFocus: (props: EditorEvents['focus']) => void - onBlur: (props: EditorEvents['blur']) => void - onDestroy: (props: EditorEvents['destroy']) => void + onContentError: (props: EditorEvents['contentError']) => void; + onUpdate: (props: EditorEvents['update']) => void; + onSelectionUpdate: (props: EditorEvents['selectionUpdate']) => void; + onTransaction: (props: EditorEvents['transaction']) => void; + onFocus: (props: EditorEvents['focus']) => void; + onBlur: (props: EditorEvents['blur']) => void; + onDestroy: (props: EditorEvents['destroy']) => void; } -export type HTMLContent = string +export type HTMLContent = string; export type JSONContent = { - type?: string - attrs?: Record - content?: JSONContent[] + type?: string; + attrs?: Record; + content?: JSONContent[]; marks?: { - type: string - attrs?: Record - [key: string]: any - }[] - text?: string - [key: string]: any -} + type: string; + attrs?: Record; + [key: string]: any; + }[]; + text?: string; + [key: string]: any; +}; -export type Content = HTMLContent | JSONContent | JSONContent[] | null +export type Content = HTMLContent | JSONContent | JSONContent[] | null; export type CommandProps = { - editor: Editor - tr: Transaction - commands: SingleCommands - can: () => CanCommands - chain: () => ChainedCommands - state: EditorState - view: EditorView - dispatch: ((args?: any) => any) | undefined -} + editor: Editor; + tr: Transaction; + commands: SingleCommands; + can: () => CanCommands; + chain: () => ChainedCommands; + state: EditorState; + view: EditorView; + dispatch: ((args?: any) => any) | undefined; +}; -export type Command = (props: CommandProps) => boolean +export type Command = (props: CommandProps) => boolean; -export type CommandSpec = (...args: any[]) => Command +export type CommandSpec = (...args: any[]) => Command; -export type KeyboardShortcutCommand = (props: { editor: Editor }) => boolean +export type KeyboardShortcutCommand = (props: { editor: Editor }) => boolean; export type Attribute = { - default?: any - rendered?: boolean - renderHTML?: ((attributes: Record) => Record | null) | null - parseHTML?: ((element: HTMLElement) => any | null) | null - keepOnSplit?: boolean - isRequired?: boolean -} + default?: any; + rendered?: boolean; + renderHTML?: ((attributes: Record) => Record | null) | null; + parseHTML?: ((element: HTMLElement) => any | null) | null; + keepOnSplit?: boolean; + isRequired?: boolean; +}; export type Attributes = { - [key: string]: Attribute -} + [key: string]: Attribute; +}; export type ExtensionAttribute = { - type: string - name: string - attribute: Required -} + type: string; + name: string; + attribute: Required; +}; export type GlobalAttributes = { /** * The node & mark types this attribute should be applied to. */ - types: string[] + types: string[]; /** * The attributes to add to the node or mark types. */ - attributes: { - [key: string]: Attribute - } -}[] + attributes: Record; +}[]; -export type PickValue = T[K] +export type PickValue = T[K]; export type UnionToIntersection = (U extends any ? (k: U) => void : never) extends ( - k: infer I, + k: infer I ) => void ? I - : never + : never; export type Diff = ({ [P in T]: P } & { - [P in U]: never -} & { [x: string]: never })[T] + [P in U]: never; +} & { [x: string]: never })[T]; -export type Overwrite = Pick> & U +export type Overwrite = Pick> & U; -export type ValuesOf = T[keyof T] +export type ValuesOf = T[keyof T]; -export type KeysWithTypeOf = { [P in keyof T]: T[P] extends Type ? P : never }[keyof T] +export type KeysWithTypeOf = { [P in keyof T]: T[P] extends Type ? P : never }[keyof T]; export type DecorationWithType = Decoration & { - type: NodeType -} + type: NodeType; +}; export type NodeViewProps = { - editor: Editor - node: ProseMirrorNode - decorations: DecorationWithType[] - selected: boolean - extension: Node - getPos: () => number - updateAttributes: (attributes: Record) => void - deleteNode: () => void -} + editor: Editor; + node: ProseMirrorNode; + decorations: DecorationWithType[]; + selected: boolean; + extension: Node; + getPos: () => number; + updateAttributes: (attributes: Record) => void; + deleteNode: () => void; +}; export interface NodeViewRendererOptions { - stopEvent: ((props: { event: Event }) => boolean) | null + stopEvent: ((props: { event: Event }) => boolean) | null; ignoreMutation: | ((props: { mutation: MutationRecord | { type: 'selection'; target: Element } }) => boolean) - | null - contentDOMElementTag: string + | null; + contentDOMElementTag: string; } export type NodeViewRendererProps = { - editor: Editor - node: ProseMirrorNode - getPos: (() => number) | boolean - HTMLAttributes: Record - decorations: Decoration[] - extension: Node -} + editor: Editor; + node: ProseMirrorNode; + getPos: (() => number) | boolean; + HTMLAttributes: Record; + decorations: Decoration[]; + extension: Node; +}; -export type NodeViewRenderer = (props: NodeViewRendererProps) => NodeView | {} +export type NodeViewRenderer = (props: NodeViewRendererProps) => NodeView | {}; -export type AnyCommands = Record Command> +export type AnyCommands = Record Command>; export type UnionCommands = UnionToIntersection< ValuesOf, KeysWithTypeOf, {}>>> -> +>; export type RawCommands = { - [Item in keyof UnionCommands]: UnionCommands[Item] -} + [Item in keyof UnionCommands]: UnionCommands[Item]; +}; export type SingleCommands = { - [Item in keyof UnionCommands]: UnionCommands[Item] -} + [Item in keyof UnionCommands]: UnionCommands[Item]; +}; export type ChainedCommands = { - [Item in keyof UnionCommands]: UnionCommands[Item] + [Item in keyof UnionCommands]: UnionCommands[Item]; } & { - run: () => boolean -} + run: () => boolean; +}; -export type CanCommands = SingleCommands & { chain: () => ChainedCommands } +export type CanCommands = SingleCommands & { chain: () => ChainedCommands }; -export type FocusPosition = 'start' | 'end' | 'all' | number | boolean | null +export type FocusPosition = 'start' | 'end' | 'all' | number | boolean | null; export type Range = { - from: number - to: number -} + from: number; + to: number; +}; export type NodeRange = { - node: ProseMirrorNode - from: number - to: number -} + node: ProseMirrorNode; + from: number; + to: number; +}; export type MarkRange = { - mark: ProseMirrorMark - from: number - to: number -} + mark: ProseMirrorMark; + from: number; + to: number; +}; -export type Predicate = (node: ProseMirrorNode) => boolean +export type Predicate = (node: ProseMirrorNode) => boolean; export type NodeWithPos = { - node: ProseMirrorNode - pos: number -} + node: ProseMirrorNode; + pos: number; +}; export type TextSerializer = (props: { - node: ProseMirrorNode - pos: number - parent: ProseMirrorNode - index: number - range: Range -}) => string + node: ProseMirrorNode; + pos: number; + parent: ProseMirrorNode; + index: number; + range: Range; +}) => string; export type ExtendedRegExpMatchArray = RegExpMatchArray & { - data?: Record -} + data?: Record; +}; -export type Dispatch = ((args?: any) => any) | undefined +export type Dispatch = ((args?: any) => any) | undefined; diff --git a/packages/extension-blockquote/CHANGELOG.md b/packages/extension-blockquote/CHANGELOG.md index f2e3fb276b8..7fd74a7ec73 100644 --- a/packages/extension-blockquote/CHANGELOG.md +++ b/packages/extension-blockquote/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-blockquote/package.json b/packages/extension-blockquote/package.json index ef0f602e082..a946fbda6f9 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-bold/CHANGELOG.md b/packages/extension-bold/CHANGELOG.md index 88709debb35..65aae7bec47 100644 --- a/packages/extension-bold/CHANGELOG.md +++ b/packages/extension-bold/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-bold/package.json b/packages/extension-bold/package.json index a3e81421df1..ed0d5b79278 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-bubble-menu/CHANGELOG.md b/packages/extension-bubble-menu/CHANGELOG.md index f936331a0bc..a320cf908ed 100644 --- a/packages/extension-bubble-menu/CHANGELOG.md +++ b/packages/extension-bubble-menu/CHANGELOG.md @@ -1,5 +1,25 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-bubble-menu/package.json b/packages/extension-bubble-menu/package.json index 7cfe1dfc173..1ea77cb17ca 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -38,12 +38,12 @@ }, "sideEffects": false, "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "scripts": { "clean": "rm -rf dist", diff --git a/packages/extension-bullet-list/CHANGELOG.md b/packages/extension-bullet-list/CHANGELOG.md index 3c60c6620d6..14315eb4fb2 100644 --- a/packages/extension-bullet-list/CHANGELOG.md +++ b/packages/extension-bullet-list/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-bullet-list/package.json b/packages/extension-bullet-list/package.json index 530b46ae4a3..3a759c3ddd4 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-character-count/CHANGELOG.md b/packages/extension-character-count/CHANGELOG.md index dc59f84f247..42ef74e9df1 100644 --- a/packages/extension-character-count/CHANGELOG.md +++ b/packages/extension-character-count/CHANGELOG.md @@ -1,5 +1,25 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-character-count/package.json b/packages/extension-character-count/package.json index 9e4da301dfb..75013e545ce 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,12 +29,12 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-code-block-lowlight/CHANGELOG.md b/packages/extension-code-block-lowlight/CHANGELOG.md index 5bff2a50612..1420de82b5b 100644 --- a/packages/extension-code-block-lowlight/CHANGELOG.md +++ b/packages/extension-code-block-lowlight/CHANGELOG.md @@ -1,5 +1,28 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [4e5b2d8] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + - @tiptap/extension-code-block@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/extension-code-block@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-code-block-lowlight/package.json b/packages/extension-code-block-lowlight/package.json index a236a189c75..02acad8566a 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,14 +29,14 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/extension-code-block": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/extension-code-block": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/extension-code-block": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/extension-code-block": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-code-block/CHANGELOG.md b/packages/extension-code-block/CHANGELOG.md index b488a7af10f..831d57f22b3 100644 --- a/packages/extension-code-block/CHANGELOG.md +++ b/packages/extension-code-block/CHANGELOG.md @@ -1,5 +1,26 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- 4e5b2d8: code-block: on arrow down move into the next node +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-code-block/package.json b/packages/extension-code-block/package.json index 3ebf44c892e..3ed46e8a7e1 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,12 +29,12 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-code-block/src/code-block.ts b/packages/extension-code-block/src/code-block.ts index 7b934598408..8d6b22d4c99 100644 --- a/packages/extension-code-block/src/code-block.ts +++ b/packages/extension-code-block/src/code-block.ts @@ -1,5 +1,10 @@ import { mergeAttributes, Node, textblockTypeInputRule } from '@tiptap/core' -import { Plugin, PluginKey, TextSelection } from '@tiptap/pm/state' +import { + Plugin, + PluginKey, + Selection, + TextSelection, +} from '@tiptap/pm/state' export interface CodeBlockOptions { /** @@ -222,7 +227,10 @@ export const CodeBlock = Node.create({ const nodeAfter = doc.nodeAt(after) if (nodeAfter) { - return false + return editor.commands.command(({ tr }) => { + tr.setSelection(Selection.near(doc.resolve(after))) + return true + }) } return editor.commands.exitCode() diff --git a/packages/extension-code/CHANGELOG.md b/packages/extension-code/CHANGELOG.md index a2fd1ff21f4..3b17ce2765c 100644 --- a/packages/extension-code/CHANGELOG.md +++ b/packages/extension-code/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-code/package.json b/packages/extension-code/package.json index e8d734cc8f1..b118fb03b2b 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-collaboration-cursor/CHANGELOG.md b/packages/extension-collaboration-cursor/CHANGELOG.md index 1d760945385..5f9ed3c83ca 100644 --- a/packages/extension-collaboration-cursor/CHANGELOG.md +++ b/packages/extension-collaboration-cursor/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-collaboration-cursor/package.json b/packages/extension-collaboration-cursor/package.json index ef869242d75..af35ffd2490 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,11 +29,11 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", + "@tiptap/core": "^2.5.6", "y-prosemirror": "^1.2.9" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", + "@tiptap/core": "^2.5.6", "y-prosemirror": "^1.2.6" }, "repository": { diff --git a/packages/extension-collaboration/CHANGELOG.md b/packages/extension-collaboration/CHANGELOG.md index 846a8a59755..c95333dfd88 100644 --- a/packages/extension-collaboration/CHANGELOG.md +++ b/packages/extension-collaboration/CHANGELOG.md @@ -1,5 +1,25 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-collaboration/package.json b/packages/extension-collaboration/package.json index 414390eac46..7e4f4644fa6 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,13 +29,13 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6", "y-prosemirror": "^1.2.9" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6", "y-prosemirror": "^1.2.6" }, "repository": { diff --git a/packages/extension-color/CHANGELOG.md b/packages/extension-color/CHANGELOG.md index a8377d2da88..0237e68b563 100644 --- a/packages/extension-color/CHANGELOG.md +++ b/packages/extension-color/CHANGELOG.md @@ -1,5 +1,24 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + - @tiptap/extension-text-style@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/extension-text-style@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-color/package.json b/packages/extension-color/package.json index 64cdf0e1525..e30209f76ec 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,12 +29,12 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/extension-text-style": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/extension-text-style": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/extension-text-style": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/extension-text-style": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-document/CHANGELOG.md b/packages/extension-document/CHANGELOG.md index 41ae7afa7bc..fd9b0b3ee21 100644 --- a/packages/extension-document/CHANGELOG.md +++ b/packages/extension-document/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-document/package.json b/packages/extension-document/package.json index 2df09c13f55..2e25e543e1c 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-dropcursor/CHANGELOG.md b/packages/extension-dropcursor/CHANGELOG.md index e24084e3a31..063b429cb5d 100644 --- a/packages/extension-dropcursor/CHANGELOG.md +++ b/packages/extension-dropcursor/CHANGELOG.md @@ -1,5 +1,25 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-dropcursor/package.json b/packages/extension-dropcursor/package.json index fc6e3030514..687627b6a28 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,12 +29,12 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-floating-menu/CHANGELOG.md b/packages/extension-floating-menu/CHANGELOG.md index c82a66b7466..dab0c07a12e 100644 --- a/packages/extension-floating-menu/CHANGELOG.md +++ b/packages/extension-floating-menu/CHANGELOG.md @@ -1,5 +1,25 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-floating-menu/package.json b/packages/extension-floating-menu/package.json index 7f54542acc5..6fdb649bcee 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,12 +29,12 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "dependencies": { "tippy.js": "^6.3.7" diff --git a/packages/extension-focus/CHANGELOG.md b/packages/extension-focus/CHANGELOG.md index 14fd449e665..73f6a7dce93 100644 --- a/packages/extension-focus/CHANGELOG.md +++ b/packages/extension-focus/CHANGELOG.md @@ -1,5 +1,25 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-focus/package.json b/packages/extension-focus/package.json index 428dd4b73ac..2e0a428ad04 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,12 +29,12 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-font-family/CHANGELOG.md b/packages/extension-font-family/CHANGELOG.md index 4abb73544f4..fbd809105c2 100644 --- a/packages/extension-font-family/CHANGELOG.md +++ b/packages/extension-font-family/CHANGELOG.md @@ -1,5 +1,24 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + - @tiptap/extension-text-style@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/extension-text-style@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-font-family/package.json b/packages/extension-font-family/package.json index 841ca88dab8..f3aee64dc5f 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,12 +29,12 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/extension-text-style": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/extension-text-style": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/extension-text-style": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/extension-text-style": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-gapcursor/CHANGELOG.md b/packages/extension-gapcursor/CHANGELOG.md index 98b0ba38cd1..a6d1c20b5a7 100644 --- a/packages/extension-gapcursor/CHANGELOG.md +++ b/packages/extension-gapcursor/CHANGELOG.md @@ -1,5 +1,25 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-gapcursor/package.json b/packages/extension-gapcursor/package.json index 5f2f617dd0e..2c6419fa229 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,12 +29,12 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-hard-break/CHANGELOG.md b/packages/extension-hard-break/CHANGELOG.md index b08932facfe..13a6ae737c0 100644 --- a/packages/extension-hard-break/CHANGELOG.md +++ b/packages/extension-hard-break/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-hard-break/package.json b/packages/extension-hard-break/package.json index 025a8b7f841..0ff84451c22 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-heading/CHANGELOG.md b/packages/extension-heading/CHANGELOG.md index a386ab3c7a2..6c32907da5f 100644 --- a/packages/extension-heading/CHANGELOG.md +++ b/packages/extension-heading/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-heading/package.json b/packages/extension-heading/package.json index 38573d65496..ea9d79d1268 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-highlight/CHANGELOG.md b/packages/extension-highlight/CHANGELOG.md index bb6871b2d97..1af9e407f4d 100644 --- a/packages/extension-highlight/CHANGELOG.md +++ b/packages/extension-highlight/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-highlight/package.json b/packages/extension-highlight/package.json index 8ab717805fa..0b3e80181cd 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-history/CHANGELOG.md b/packages/extension-history/CHANGELOG.md index 41e665e305c..0ec22dc7544 100644 --- a/packages/extension-history/CHANGELOG.md +++ b/packages/extension-history/CHANGELOG.md @@ -1,5 +1,25 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-history/package.json b/packages/extension-history/package.json index 249ee2ebea9..747ce6e4ea9 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,12 +29,12 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-horizontal-rule/CHANGELOG.md b/packages/extension-horizontal-rule/CHANGELOG.md index d95e3e1524f..a212cbdc982 100644 --- a/packages/extension-horizontal-rule/CHANGELOG.md +++ b/packages/extension-horizontal-rule/CHANGELOG.md @@ -1,5 +1,25 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-horizontal-rule/package.json b/packages/extension-horizontal-rule/package.json index 97627a4ab50..b36fb8b1212 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,12 +29,12 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-image/CHANGELOG.md b/packages/extension-image/CHANGELOG.md index 620b576db8c..07eb07ea42a 100644 --- a/packages/extension-image/CHANGELOG.md +++ b/packages/extension-image/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-image/package.json b/packages/extension-image/package.json index c476b6c97aa..c828f0c71fc 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-italic/CHANGELOG.md b/packages/extension-italic/CHANGELOG.md index dffd8b158cf..26d69bc2f05 100644 --- a/packages/extension-italic/CHANGELOG.md +++ b/packages/extension-italic/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-italic/package.json b/packages/extension-italic/package.json index c6123653155..4742c304522 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-link/CHANGELOG.md b/packages/extension-link/CHANGELOG.md index 576084706a3..851cd49c29a 100644 --- a/packages/extension-link/CHANGELOG.md +++ b/packages/extension-link/CHANGELOG.md @@ -1,5 +1,26 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- c0e5398: Links were opening twive when the editor was not editable and openOnclick was true, now openOnClick setting will check if it is editable before trying to open programmatically resolves #4877 +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-link/package.json b/packages/extension-link/package.json index da0bdc3b2bd..4b56843e809 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -32,12 +32,12 @@ "linkifyjs": "^4.1.0" }, "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-link/src/helpers/clickHandler.ts b/packages/extension-link/src/helpers/clickHandler.ts index b2c4ce5fb76..027d1e36c78 100644 --- a/packages/extension-link/src/helpers/clickHandler.ts +++ b/packages/extension-link/src/helpers/clickHandler.ts @@ -3,7 +3,7 @@ import { MarkType } from '@tiptap/pm/model' import { Plugin, PluginKey } from '@tiptap/pm/state' type ClickHandlerOptions = { - type: MarkType + type: MarkType; } export function clickHandler(options: ClickHandlerOptions): Plugin { @@ -15,6 +15,10 @@ export function clickHandler(options: ClickHandlerOptions): Plugin { return false } + if (!view.editable) { + return false + } + let a = event.target as HTMLElement const els = [] diff --git a/packages/extension-list-item/CHANGELOG.md b/packages/extension-list-item/CHANGELOG.md index e507f0615e2..ac89f44019c 100644 --- a/packages/extension-list-item/CHANGELOG.md +++ b/packages/extension-list-item/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-list-item/package.json b/packages/extension-list-item/package.json index 52fe2a34536..8d1e6cd09d3 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-list-keymap/CHANGELOG.md b/packages/extension-list-keymap/CHANGELOG.md index 4943acebf82..a21376d76ca 100644 --- a/packages/extension-list-keymap/CHANGELOG.md +++ b/packages/extension-list-keymap/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-list-keymap/package.json b/packages/extension-list-keymap/package.json index 5529acb639d..b438042d40c 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-mention/CHANGELOG.md b/packages/extension-mention/CHANGELOG.md index 3b5ac420aa2..de80e11f12c 100644 --- a/packages/extension-mention/CHANGELOG.md +++ b/packages/extension-mention/CHANGELOG.md @@ -1,5 +1,27 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + - @tiptap/suggestion@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + - @tiptap/suggestion@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-mention/package.json b/packages/extension-mention/package.json index a5e48c659fe..4123beab2a7 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,14 +29,14 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", - "@tiptap/suggestion": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6", + "@tiptap/suggestion": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4", - "@tiptap/suggestion": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6", + "@tiptap/suggestion": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-ordered-list/CHANGELOG.md b/packages/extension-ordered-list/CHANGELOG.md index 4d041f249ec..c6e425605f7 100644 --- a/packages/extension-ordered-list/CHANGELOG.md +++ b/packages/extension-ordered-list/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-ordered-list/package.json b/packages/extension-ordered-list/package.json index c27d1be2cc6..579ba51d75b 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-paragraph/CHANGELOG.md b/packages/extension-paragraph/CHANGELOG.md index fa2b9864e57..c589a14acd0 100644 --- a/packages/extension-paragraph/CHANGELOG.md +++ b/packages/extension-paragraph/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-paragraph/package.json b/packages/extension-paragraph/package.json index 2114c271b3c..eee64001cae 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-placeholder/CHANGELOG.md b/packages/extension-placeholder/CHANGELOG.md index 5f0d7ac2998..98bd672943d 100644 --- a/packages/extension-placeholder/CHANGELOG.md +++ b/packages/extension-placeholder/CHANGELOG.md @@ -1,5 +1,25 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-placeholder/package.json b/packages/extension-placeholder/package.json index 3b72fd65cfc..73a741f8df0 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,12 +29,12 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-strike/CHANGELOG.md b/packages/extension-strike/CHANGELOG.md index 9b15768b9b6..0a5e914dfc0 100644 --- a/packages/extension-strike/CHANGELOG.md +++ b/packages/extension-strike/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-strike/package.json b/packages/extension-strike/package.json index 53de2af0867..7e4d05966cd 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-subscript/CHANGELOG.md b/packages/extension-subscript/CHANGELOG.md index 86a36226978..8ebaf6c0885 100644 --- a/packages/extension-subscript/CHANGELOG.md +++ b/packages/extension-subscript/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-subscript/package.json b/packages/extension-subscript/package.json index ace3709a9b3..59215fadd74 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-superscript/CHANGELOG.md b/packages/extension-superscript/CHANGELOG.md index 5c847f8de72..848eeb69989 100644 --- a/packages/extension-superscript/CHANGELOG.md +++ b/packages/extension-superscript/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-superscript/package.json b/packages/extension-superscript/package.json index d1138fb3d82..f2dfea67de1 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-table-cell/CHANGELOG.md b/packages/extension-table-cell/CHANGELOG.md index 2aba42756c1..a254d7326a9 100644 --- a/packages/extension-table-cell/CHANGELOG.md +++ b/packages/extension-table-cell/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-table-cell/package.json b/packages/extension-table-cell/package.json index 7b43ee08c75..abb0d5b1c95 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-table-header/CHANGELOG.md b/packages/extension-table-header/CHANGELOG.md index 2dd40d9453e..805174c96db 100644 --- a/packages/extension-table-header/CHANGELOG.md +++ b/packages/extension-table-header/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-table-header/package.json b/packages/extension-table-header/package.json index 7e66223699d..734806c3791 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-table-row/CHANGELOG.md b/packages/extension-table-row/CHANGELOG.md index 761ee4acf65..db1741a7c31 100644 --- a/packages/extension-table-row/CHANGELOG.md +++ b/packages/extension-table-row/CHANGELOG.md @@ -1,5 +1,22 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-table-row/package.json b/packages/extension-table-row/package.json index 7a26492a0b2..9259b4bfb55 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,10 +29,10 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4" + "@tiptap/core": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-table/CHANGELOG.md b/packages/extension-table/CHANGELOG.md index 1ead2353f24..dc3a6aea93c 100644 --- a/packages/extension-table/CHANGELOG.md +++ b/packages/extension-table/CHANGELOG.md @@ -1,5 +1,26 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- c7f5550: Set correct `min-width` for a table fixes #5217 +- Updated dependencies [b5c1b32] +- Updated dependencies [618bca9] +- Updated dependencies [35682d1] +- Updated dependencies [2104f0f] + - @tiptap/pm@2.5.6 + - @tiptap/core@2.5.6 + +## 2.5.5 + +### Patch Changes + +- Updated dependencies [4cca382] +- Updated dependencies [3b67e8a] + - @tiptap/core@2.5.5 + - @tiptap/pm@2.5.5 + ## 2.5.4 ### Patch Changes diff --git a/packages/extension-table/package.json b/packages/extension-table/package.json index 93705dc862a..e6834f6b566 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.5.4", + "version": "2.5.6", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -29,12 +29,12 @@ "dist" ], "devDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "peerDependencies": { - "@tiptap/core": "^2.5.4", - "@tiptap/pm": "^2.5.4" + "@tiptap/core": "^2.5.6", + "@tiptap/pm": "^2.5.6" }, "repository": { "type": "git", diff --git a/packages/extension-table/src/table.ts b/packages/extension-table/src/table.ts index 79040bbf883..5a6fa4fb816 100644 --- a/packages/extension-table/src/table.ts +++ b/packages/extension-table/src/table.ts @@ -286,7 +286,7 @@ export const Table = Node.create({ mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { style: tableWidth ? `width: ${tableWidth}` - : `minWidth: ${tableMinWidth}`, + : `min-width: ${tableMinWidth}`, }), colgroup, ['tbody', 0], diff --git a/packages/extension-task-item/CHANGELOG.md b/packages/extension-task-item/CHANGELOG.md index 35d7398cd0c..d169269447e 100644 --- a/packages/extension-task-item/CHANGELOG.md +++ b/packages/extension-task-item/CHANGELOG.md @@ -1,5 +1,27 @@ # Change Log +## 2.5.6 + +### Patch Changes + +- e6c759b: allow task items to be parsed when only having `
  • (value: T) { return customRef((track, trigger) => { return { @@ -42,18 +40,18 @@ export class Editor extends CoreEditor { private reactiveExtensionStorage: Ref> - public vueRenderers = reactive>(new Map()) - public contentComponent: ContentComponent | null = null + public appContext: AppContext | null = null + constructor(options: Partial = {}) { super(options) this.reactiveState = useDebouncedRef(this.view.state) this.reactiveExtensionStorage = useDebouncedRef(this.extensionStorage) - this.on('transaction', () => { - this.reactiveState.value = this.view.state + this.on('beforeTransaction', ({ nextState }) => { + this.reactiveState.value = nextState this.reactiveExtensionStorage.value = this.extensionStorage }) diff --git a/packages/vue-3/src/EditorContent.ts b/packages/vue-3/src/EditorContent.ts index 09f1b51c426..7c215c3c95f 100644 --- a/packages/vue-3/src/EditorContent.ts +++ b/packages/vue-3/src/EditorContent.ts @@ -1,5 +1,4 @@ import { - DefineComponent, defineComponent, getCurrentInstance, h, @@ -8,7 +7,6 @@ import { PropType, Ref, ref, - Teleport, unref, watchEffect, } from 'vue' @@ -45,6 +43,17 @@ export const EditorContent = defineComponent({ // @ts-ignore editor.contentComponent = instance.ctx._ + if (instance) { + editor.appContext = { + ...instance.appContext, + provides: { + // @ts-ignore + ...instance.provides, + ...instance.appContext.provides, + }, + } + } + editor.setOptions({ element, }) @@ -69,6 +78,7 @@ export const EditorContent = defineComponent({ } editor.contentComponent = null + editor.appContext = null if (!editor.options.element.firstChild) { return @@ -87,35 +97,11 @@ export const EditorContent = defineComponent({ }, render() { - const vueRenderers: any[] = [] - - if (this.editor) { - this.editor.vueRenderers.forEach(vueRenderer => { - const node = h( - Teleport, - { - to: vueRenderer.teleportElement, - key: vueRenderer.id, - }, - h( - vueRenderer.component as DefineComponent, - { - ref: vueRenderer.id, - ...vueRenderer.props, - }, - ), - ) - - vueRenderers.push(node) - }) - } - return h( 'div', { ref: (el: any) => { this.rootEl = el }, }, - ...vueRenderers, ) }, }) diff --git a/packages/vue-3/src/VueNodeViewRenderer.ts b/packages/vue-3/src/VueNodeViewRenderer.ts index a9f9c448df9..1da7993ca78 100644 --- a/packages/vue-3/src/VueNodeViewRenderer.ts +++ b/packages/vue-3/src/VueNodeViewRenderer.ts @@ -124,7 +124,7 @@ class VueNodeView extends NodeView, + editor: Editor; + props?: Record; +} + +type ExtendedVNode = ReturnType | null; + +interface RenderedComponent { + vNode: ExtendedVNode; + destroy: () => void; + el: Element | null; } /** * This class is used to render Vue components inside the editor. */ export class VueRenderer { - id: string + renderedComponent!: RenderedComponent editor: ExtendedEditor component: Component - teleportElement: Element - - element: Element + el: Element | null props: Record constructor(component: Component, { props = {}, editor }: VueRendererOptions) { - this.id = Math.floor(Math.random() * 0xFFFFFFFF).toString() this.editor = editor as ExtendedEditor this.component = markRaw(component) - this.teleportElement = document.createElement('div') - this.element = this.teleportElement + this.el = document.createElement('div') this.props = reactive(props) - this.editor.vueRenderers.set(this.id, this) - - if (this.editor.contentComponent) { - this.editor.contentComponent.update() + this.renderedComponent = this.renderComponent() + } - if (this.teleportElement.children.length !== 1) { - throw Error('VueRenderer doesn’t support multiple child elements.') - } + get element(): Element | null { + return this.renderedComponent.el + } - this.element = this.teleportElement.firstElementChild as Element + get ref(): any { + // Composition API + if (this.renderedComponent.vNode?.component?.exposed) { + return this.renderedComponent.vNode.component.exposed } + // Option API + return this.renderedComponent.vNode?.component?.proxy } - get ref(): any { - return this.editor.contentComponent?.refs[this.id] + renderComponent() { + let vNode: ExtendedVNode = h(this.component as DefineComponent, this.props) + + if (this.editor.appContext) { + vNode.appContext = this.editor.appContext + } + if (typeof document !== 'undefined' && this.el) { + render(vNode, this.el) + } + + const destroy = () => { + if (this.el) { + render(null, this.el) + } + this.el = null + vNode = null + } + + return { vNode, destroy, el: this.el ? this.el.firstElementChild : null } } updateProps(props: Record = {}): void { - Object - .entries(props) - .forEach(([key, value]) => { - this.props[key] = value - }) + Object.entries(props).forEach(([key, value]) => { + this.props[key] = value + }) + this.renderComponent() } destroy(): void { - this.editor.vueRenderers.delete(this.id) + this.renderedComponent.destroy() } } diff --git a/tests/cypress/integration/core/isNodeEmpty.spec.ts b/tests/cypress/integration/core/isNodeEmpty.spec.ts new file mode 100644 index 00000000000..7db88996d68 --- /dev/null +++ b/tests/cypress/integration/core/isNodeEmpty.spec.ts @@ -0,0 +1,183 @@ +/// + +import { getSchema, isNodeEmpty } from '@tiptap/core' +import Document from '@tiptap/extension-document' +import Image from '@tiptap/extension-image' +import StarterKit from '@tiptap/starter-kit' + +const schema = getSchema([StarterKit]) +const modifiedSchema = getSchema([StarterKit.configure({ document: false }), Document.extend({ content: 'heading block*' })]) +const imageSchema = getSchema([StarterKit.configure({ document: false }), Document.extend({ content: 'image block*' }), Image]) + +describe('isNodeEmpty', () => { + describe('with default schema', () => { + it('should return false when text has content', () => { + const node = schema.nodeFromJSON({ type: 'text', text: 'Hello world!' }) + + expect(isNodeEmpty(node)).to.eq(false) + }) + + it('should return false when a paragraph has text', () => { + const node = schema.nodeFromJSON({ + type: 'paragraph', + content: [{ type: 'text', text: 'Hello world!' }], + }) + + expect(isNodeEmpty(node)).to.eq(false) + }) + + it('should return true when a paragraph has no content', () => { + const node = schema.nodeFromJSON({ + type: 'paragraph', + content: [], + }) + + expect(isNodeEmpty(node)).to.eq(true) + }) + + it('should return true when a paragraph has additional attrs & no content', () => { + const node = schema.nodeFromJSON({ + type: 'paragraph', + content: [], + attrs: { + id: 'test', + }, + }) + + expect(isNodeEmpty(node)).to.eq(true) + }) + + it('should return true when a paragraph has additional marks & no content', () => { + const node = schema.nodeFromJSON({ + type: 'paragraph', + content: [], + attrs: { + id: 'test', + }, + marks: [{ type: 'bold' }], + }) + + expect(isNodeEmpty(node)).to.eq(true) + }) + + it('should return false when a document has text', () => { + const node = schema.nodeFromJSON({ + type: 'doc', + content: [ + { + type: 'paragraph', + content: [{ type: 'text', text: 'Hello world!' }], + }, + ], + }) + + expect(isNodeEmpty(node)).to.eq(false) + }) + it('should return true when a document has an empty paragraph', () => { + const node = schema.nodeFromJSON({ + type: 'doc', + content: [ + { + type: 'paragraph', + content: [], + }, + ], + }) + + expect(isNodeEmpty(node)).to.eq(true) + }) + }) + + describe('with modified schema', () => { + it('should return false when a document has a filled heading', () => { + const node = modifiedSchema.nodeFromJSON({ + type: 'doc', + content: [ + { + type: 'heading', + content: [ + { type: 'text', text: 'Hello world!' }, + ], + }, + ], + }) + + expect(isNodeEmpty(node)).to.eq(false) + }) + + it('should return false when a document has a filled paragraph', () => { + const node = modifiedSchema.nodeFromJSON({ + type: 'doc', + content: [ + { type: 'heading' }, + { + type: 'paragraph', + content: [ + { type: 'text', text: 'Hello world!' }, + ], + }, + ], + }) + + expect(isNodeEmpty(node)).to.eq(false) + }) + + it('should return true when a document has an empty heading', () => { + const node = modifiedSchema.nodeFromJSON({ + type: 'doc', + content: [ + { type: 'heading', content: [] }, + { type: 'paragraph', content: [] }, + ], + }) + + expect(isNodeEmpty(node)).to.eq(true) + }) + + it('should return true when a document has an empty heading with attrs', () => { + const node = modifiedSchema.nodeFromJSON({ + type: 'doc', + content: [ + { type: 'heading', content: [], attrs: { level: 2 } }, + ], + }) + + expect(isNodeEmpty(node)).to.eq(true) + }) + + it('should return true when a document has an empty heading & paragraph', () => { + const node = modifiedSchema.nodeFromJSON({ + type: 'doc', + content: [ + { type: 'heading', content: [] }, + { type: 'paragraph', content: [] }, + ], + }) + + expect(isNodeEmpty(node)).to.eq(true) + }) + it('should return true when a document has an empty heading & paragraph with attributes', () => { + const node = modifiedSchema.nodeFromJSON({ + type: 'doc', + content: [ + { type: 'heading', content: [], attrs: { id: 'test' } }, + { type: 'paragraph', content: [], attrs: { id: 'test' } }, + ], + }) + + expect(isNodeEmpty(node)).to.eq(true) + }) + + it('can handle an image node', () => { + const node = imageSchema.nodeFromJSON({ + type: 'doc', + content: [ + { type: 'image', attrs: { src: 'https://examples.com' } }, + { type: 'heading', content: [] }, + ], + }) + + expect(isNodeEmpty(node)).to.eq(true) + }) + }) +})