diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 85f51bae..44ef996a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@v2.3.4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2.4.0 + uses: actions/setup-node@v2.4.1 with: node-version: ${{ matrix.node-version }} @@ -83,7 +83,7 @@ jobs: - uses: actions/checkout@v2.3.4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2.4.0 + uses: actions/setup-node@v2.4.1 with: node-version: ${{ matrix.node-version }} @@ -139,7 +139,7 @@ jobs: - uses: actions/checkout@v2.3.4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2.4.0 + uses: actions/setup-node@v2.4.1 with: node-version: ${{ matrix.node-version }} diff --git a/README.md b/README.md index ac8a56c6..49896d4b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# tiptap 2 +# tiptap A headless, framework-agnostic and extendable rich text editor, based on [ProseMirror](https://github.com/ProseMirror/prosemirror). [![Build Status](https://github.com/ueberdosis/tiptap/workflows/build/badge.svg)](https://github.com/ueberdosis/tiptap/actions) @@ -54,6 +54,12 @@ For help, discussion about best practices, or any other conversation that would Gamma + + +
+ Storyblok +
+ diff --git a/docs/api/extensions.md b/docs/api/extensions.md index 2d5b318d..998052ec 100644 --- a/docs/api/extensions.md +++ b/docs/api/extensions.md @@ -23,7 +23,7 @@ There are also some extensions with more capabilities. We call them [nodes](/api | [History](/api/extensions/history) | Included | [GitHub](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-history/) | | [Placeholder](/api/extensions/placeholder) | – | [GitHub](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-placeholder/) | | [TextAlign](/api/extensions/text-align) | – | [GitHub](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-text-align/) | -| [UniqueId](/api/extensions/unique-id) | – | Requires a tiptap pro subscription | +| [UniqueID](/api/extensions/unique-id) | – | Requires a tiptap pro subscription | | [Typography](/api/extensions/typography) | – | [GitHub](https://github.com/ueberdosis/tiptap/blob/main/packages/extension-typography/) | You don’t have to use it, but we prepared a `@tiptap/starter-kit` which includes the most common extensions. Read more about [`StarterKit`](/guide/configuration#default-extensions). diff --git a/docs/api/nodes/hard-break.md b/docs/api/nodes/hard-break.md index f987b46f..9eb7d518 100644 --- a/docs/api/nodes/hard-break.md +++ b/docs/api/nodes/hard-break.md @@ -43,7 +43,7 @@ HardBreak.configure({ Add a line break. ```js -editor.commands.setHeardBreak() +editor.commands.setHardBreak() ``` ## Keyboard shortcuts diff --git a/docs/installation.md b/docs/installation.md index ee4b6076..74245f3c 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -10,6 +10,7 @@ tiptap is framework-agnostic and even works with Vanilla JavaScript (if that’s ## Integration guides * [CDN](/installation/cdn) * [React](/installation/react) +* [Next.js](/installation/nextjs) * [Vue 3](/installation/vue3) * [Vue 2](/installation/vue2) * [Nuxt.js](/installation/nuxt) diff --git a/docs/installation/nextjs.md b/docs/installation/nextjs.md new file mode 100644 index 00000000..f752b1b6 --- /dev/null +++ b/docs/installation/nextjs.md @@ -0,0 +1,75 @@ +--- +title: Next.js WYSIWYG +tableOfContents: true +--- + +# Next.js + +## Introduction +The following guide describes how to integrate tiptap with your [Next.js](https://nextjs.org/) project. + +## Requirements +* [Node](https://nodejs.org/en/download/) installed on your machine +* Experience with [React](https://reactjs.org/) + +## 1. Create a project (optional) +If you already have an existing Next.js project, that’s fine too. Just skip this step and proceed with the next step. + +For the sake of this guide, let’s start with a new Next.js project called `tiptap-example`. The following command sets up everything we need to get started. +```bash +# create a project +npx create-next-app tiptap-example + +# change directory +cd tiptap-example +``` + +## 2. Install the dependencies +Now that we have a standard boilerplate set up we can get started on getting tiptap up and running! For this we will need to install two packages: `@tiptap/react` and `@tipta/starter-kit` which includes all the extensions you need to get started quickly. + +```bash +# install with npm +npm install @tiptap/react @tiptap/starter-kit + +# install with Yarn +yarn add @tiptap/react @tiptap/starter-kit +``` + +If you followed step 1 and 2, you can now start your project with `npm run dev` or `yarn dev`, and open [http://localhost:3000/](http://localhost:3000/) in your favorite browser. This might be different, if you’re working with an existing project. + +## 3. Create a new component +To actually start using tiptap, you’ll need to add a new component to your app. To do this, first create a directory called `components/`. Now it's time to create our component which we'll call `Tiptap`. To do this put the following example code in `components/Tiptap.js`. + +```jsx +import { useEditor, EditorContent } from '@tiptap/react' +import StarterKit from '@tiptap/starter-kit' + +const Tiptap = () => { + const editor = useEditor({ + extensions: [ + StarterKit, + ], + content: '

Hello World! 🌎️

', + }) + + return ( + + ) +} + +export default Tiptap; +``` + +## 4. Add it to your app +Now, let’s replace the content of `pages/index.js` with the following example code to use our new `Tiptap` component in our app. + +```jsx +import Tiptap from '../components/Tiptap' + +export default function Home() { + return ( + + ) +} +``` +You should now see tiptap in your browser. Time to give yourself a pat on the back! :) \ No newline at end of file diff --git a/docs/installation/react.md b/docs/installation/react.md index a13eb896..e4a26e51 100644 --- a/docs/installation/react.md +++ b/docs/installation/react.md @@ -12,6 +12,14 @@ The following guide describes how to integrate tiptap with your [React](https:// * [Node](https://nodejs.org/en/download/) installed on your machine * Experience with [React](https://reactjs.org/docs/getting-started.html) +## Using a template +If you just want to get up and running with tiptap you can use the [tiptap Create React App template](https://github.com/alb/cra-template-tiptap) by [@alb](https://github.com/alb) to automatically create a new project with all the steps below already completed. + +```bash +# create a project based on the tiptap template +npx create-react-app tiptap-example --template tiptap +``` + ## 1. Create a project (optional) If you already have an existing React project, that’s fine too. Just skip this step and proceed with the next step. diff --git a/docs/links.yaml b/docs/links.yaml index b7873d29..e667bc4d 100644 --- a/docs/links.yaml +++ b/docs/links.yaml @@ -21,6 +21,9 @@ - title: React link: /installation/react skip: true + - title: Next.js + link: /installation/nextjs + skip: true - title: Vue 3 link: /installation/vue3 skip: true @@ -361,7 +364,7 @@ link: /api/extensions/text-align - title: Typography link: /api/extensions/typography - - title: UniqueId + - title: UniqueID link: /api/extensions/unique-id type: pro - title: Utilities diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index e9dcf31f..6f0bb866 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -3,6 +3,25 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.118](https://github.com/ueberdosis/tiptap/compare/@tiptap/core@2.0.0-beta.117...@tiptap/core@2.0.0-beta.118) (2021-10-03) + + +### Bug Fixes + +* fix order of executed plugins, fix [#1547](https://github.com/ueberdosis/tiptap/issues/1547) ([f8efdf7](https://github.com/ueberdosis/tiptap/commit/f8efdf797a10a01235b75091729b15aca076e47a)) + + + + + +# [2.0.0-beta.117](https://github.com/ueberdosis/tiptap/compare/@tiptap/core@2.0.0-beta.116...@tiptap/core@2.0.0-beta.117) (2021-10-02) + +**Note:** Version bump only for package @tiptap/core + + + + + # [2.0.0-beta.116](https://github.com/ueberdosis/tiptap/compare/@tiptap/core@2.0.0-beta.115...@tiptap/core@2.0.0-beta.116) (2021-09-30) diff --git a/packages/core/package.json b/packages/core/package.json index e9897aa7..aafd5fc2 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.0.0-beta.116", + "version": "2.0.0-beta.118", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", diff --git a/packages/core/src/ExtensionManager.ts b/packages/core/src/ExtensionManager.ts index a8e73bf4..53d861cf 100644 --- a/packages/core/src/ExtensionManager.ts +++ b/packages/core/src/ExtensionManager.ts @@ -205,8 +205,12 @@ export default class ExtensionManager { } get plugins(): Plugin[] { - return [...this.extensions] - .reverse() + // With ProseMirror, first plugins within an array are executed first. + // In tiptap, we provide the ability to override plugins, + // so it feels more natural to run plugins at the end of an array first. + // That’s why we have to reverse the `extensions` array and sort again + // based on the `priority` option. + return ExtensionManager.sort([...this.extensions].reverse()) .map(extension => { const context = { name: extension.name, diff --git a/packages/extension-bubble-menu/CHANGELOG.md b/packages/extension-bubble-menu/CHANGELOG.md index c68548df..3615c16d 100644 --- a/packages/extension-bubble-menu/CHANGELOG.md +++ b/packages/extension-bubble-menu/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.39](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bubble-menu@2.0.0-beta.38...@tiptap/extension-bubble-menu@2.0.0-beta.39) (2021-10-02) + +**Note:** Version bump only for package @tiptap/extension-bubble-menu + + + + + # [2.0.0-beta.38](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-bubble-menu@2.0.0-beta.37...@tiptap/extension-bubble-menu@2.0.0-beta.38) (2021-09-29) **Note:** Version bump only for package @tiptap/extension-bubble-menu diff --git a/packages/extension-bubble-menu/package.json b/packages/extension-bubble-menu/package.json index 3b86752a..fa6c6617 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.0.0-beta.38", + "version": "2.0.0-beta.39", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", diff --git a/packages/extension-code-block-lowlight/CHANGELOG.md b/packages/extension-code-block-lowlight/CHANGELOG.md index 5357a80e..fcadbfaa 100644 --- a/packages/extension-code-block-lowlight/CHANGELOG.md +++ b/packages/extension-code-block-lowlight/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.41](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code-block-lowlight@2.0.0-beta.40...@tiptap/extension-code-block-lowlight@2.0.0-beta.41) (2021-10-02) + +**Note:** Version bump only for package @tiptap/extension-code-block-lowlight + + + + + # [2.0.0-beta.40](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-code-block-lowlight@2.0.0-beta.39...@tiptap/extension-code-block-lowlight@2.0.0-beta.40) (2021-09-30) diff --git a/packages/extension-code-block-lowlight/package.json b/packages/extension-code-block-lowlight/package.json index 59c15923..67863966 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.0.0-beta.40", + "version": "2.0.0-beta.41", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", diff --git a/packages/extension-collaboration-cursor/CHANGELOG.md b/packages/extension-collaboration-cursor/CHANGELOG.md index e46484dd..391dbc2e 100644 --- a/packages/extension-collaboration-cursor/CHANGELOG.md +++ b/packages/extension-collaboration-cursor/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.22](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-collaboration-cursor@2.0.0-beta.21...@tiptap/extension-collaboration-cursor@2.0.0-beta.22) (2021-10-04) + + +### Bug Fixes + +* fix plugin order for collab, fix [#1973](https://github.com/ueberdosis/tiptap/issues/1973) ([2b16c2e](https://github.com/ueberdosis/tiptap/commit/2b16c2ea9633529657debff3cdbc74ff3a26b985)) + + + + + # [2.0.0-beta.21](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-collaboration-cursor@2.0.0-beta.20...@tiptap/extension-collaboration-cursor@2.0.0-beta.21) (2021-07-26) **Note:** Version bump only for package @tiptap/extension-collaboration-cursor diff --git a/packages/extension-collaboration-cursor/package.json b/packages/extension-collaboration-cursor/package.json index 4c9958c6..31002b11 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.0.0-beta.21", + "version": "2.0.0-beta.22", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", diff --git a/packages/extension-collaboration-cursor/src/collaboration-cursor.ts b/packages/extension-collaboration-cursor/src/collaboration-cursor.ts index 5ac60fc2..53870a56 100644 --- a/packages/extension-collaboration-cursor/src/collaboration-cursor.ts +++ b/packages/extension-collaboration-cursor/src/collaboration-cursor.ts @@ -31,8 +31,6 @@ const awarenessStatesToArray = (states: Map>) => { export const CollaborationCursor = Extension.create({ name: 'collaborationCursor', - priority: 1000, - defaultOptions: { provider: null, user: { diff --git a/packages/extension-collaboration/CHANGELOG.md b/packages/extension-collaboration/CHANGELOG.md index 940ed18f..4204a042 100644 --- a/packages/extension-collaboration/CHANGELOG.md +++ b/packages/extension-collaboration/CHANGELOG.md @@ -3,6 +3,28 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.22](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-collaboration@2.0.0-beta.21...@tiptap/extension-collaboration@2.0.0-beta.22) (2021-10-04) + + +### Bug Fixes + +* fix plugin order for collab, fix [#1973](https://github.com/ueberdosis/tiptap/issues/1973) ([2b16c2e](https://github.com/ueberdosis/tiptap/commit/2b16c2ea9633529657debff3cdbc74ff3a26b985)) + + + + + +# [2.0.0-beta.21](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-collaboration@2.0.0-beta.20...@tiptap/extension-collaboration@2.0.0-beta.21) (2021-10-03) + + +### Features + +* add isChangeOrigin helper method ([92b6c5b](https://github.com/ueberdosis/tiptap/commit/92b6c5bdcef4589acaa824c2fc599787c02c1832)) + + + + + # [2.0.0-beta.20](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-collaboration@2.0.0-beta.19...@tiptap/extension-collaboration@2.0.0-beta.20) (2021-07-26) **Note:** Version bump only for package @tiptap/extension-collaboration diff --git a/packages/extension-collaboration/package.json b/packages/extension-collaboration/package.json index 6c85c4be..59178b24 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.0.0-beta.20", + "version": "2.0.0-beta.22", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -24,6 +24,7 @@ "@tiptap/core": "^2.0.0-beta.1" }, "dependencies": { + "prosemirror-state": "^1.3.4", "y-prosemirror": "^1.0.9" }, "repository": { diff --git a/packages/extension-collaboration/src/collaboration.ts b/packages/extension-collaboration/src/collaboration.ts index e0ce339d..eed8078c 100644 --- a/packages/extension-collaboration/src/collaboration.ts +++ b/packages/extension-collaboration/src/collaboration.ts @@ -41,6 +41,8 @@ export interface CollaborationOptions { export const Collaboration = Extension.create({ name: 'collaboration', + priority: 1000, + defaultOptions: { document: null, field: 'default', diff --git a/packages/extension-collaboration/src/helpers/isChangeOrigin.ts b/packages/extension-collaboration/src/helpers/isChangeOrigin.ts new file mode 100644 index 00000000..285ec21d --- /dev/null +++ b/packages/extension-collaboration/src/helpers/isChangeOrigin.ts @@ -0,0 +1,6 @@ +import { ySyncPluginKey } from 'y-prosemirror' +import { Transaction } from 'prosemirror-state' + +export function isChangeOrigin(transaction: Transaction): boolean { + return !!transaction.getMeta(ySyncPluginKey) +} diff --git a/packages/extension-collaboration/src/index.ts b/packages/extension-collaboration/src/index.ts index 03ed9383..a81f764b 100644 --- a/packages/extension-collaboration/src/index.ts +++ b/packages/extension-collaboration/src/index.ts @@ -1,5 +1,6 @@ import { Collaboration } from './collaboration' export * from './collaboration' +export * from './helpers/isChangeOrigin' export default Collaboration diff --git a/packages/extension-floating-menu/CHANGELOG.md b/packages/extension-floating-menu/CHANGELOG.md index 7e1ecfdc..791820f5 100644 --- a/packages/extension-floating-menu/CHANGELOG.md +++ b/packages/extension-floating-menu/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.33](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-floating-menu@2.0.0-beta.32...@tiptap/extension-floating-menu@2.0.0-beta.33) (2021-10-02) + +**Note:** Version bump only for package @tiptap/extension-floating-menu + + + + + # [2.0.0-beta.32](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-floating-menu@2.0.0-beta.31...@tiptap/extension-floating-menu@2.0.0-beta.32) (2021-09-29) **Note:** Version bump only for package @tiptap/extension-floating-menu diff --git a/packages/extension-floating-menu/package.json b/packages/extension-floating-menu/package.json index 0f003c2f..78389c90 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.0.0-beta.32", + "version": "2.0.0-beta.33", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", diff --git a/packages/extension-gapcursor/CHANGELOG.md b/packages/extension-gapcursor/CHANGELOG.md index 17a8d563..34caa99d 100644 --- a/packages/extension-gapcursor/CHANGELOG.md +++ b/packages/extension-gapcursor/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.24](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-gapcursor@2.0.0-beta.23...@tiptap/extension-gapcursor@2.0.0-beta.24) (2021-10-02) + +**Note:** Version bump only for package @tiptap/extension-gapcursor + + + + + # [2.0.0-beta.23](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-gapcursor@2.0.0-beta.22...@tiptap/extension-gapcursor@2.0.0-beta.23) (2021-09-29) **Note:** Version bump only for package @tiptap/extension-gapcursor diff --git a/packages/extension-gapcursor/package.json b/packages/extension-gapcursor/package.json index 0b900f16..96ded2b1 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.0.0-beta.23", + "version": "2.0.0-beta.24", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", diff --git a/packages/extension-hard-break/CHANGELOG.md b/packages/extension-hard-break/CHANGELOG.md index 85af41de..e4d14f7b 100644 --- a/packages/extension-hard-break/CHANGELOG.md +++ b/packages/extension-hard-break/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.21](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-hard-break@2.0.0-beta.20...@tiptap/extension-hard-break@2.0.0-beta.21) (2021-10-02) + +**Note:** Version bump only for package @tiptap/extension-hard-break + + + + + # [2.0.0-beta.20](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-hard-break@2.0.0-beta.19...@tiptap/extension-hard-break@2.0.0-beta.20) (2021-09-29) **Note:** Version bump only for package @tiptap/extension-hard-break diff --git a/packages/extension-hard-break/package.json b/packages/extension-hard-break/package.json index b47a2667..d2ae04d2 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.0.0-beta.20", + "version": "2.0.0-beta.21", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", diff --git a/packages/extension-highlight/CHANGELOG.md b/packages/extension-highlight/CHANGELOG.md index f3e92e3f..a032596c 100644 --- a/packages/extension-highlight/CHANGELOG.md +++ b/packages/extension-highlight/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.21](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-highlight@2.0.0-beta.20...@tiptap/extension-highlight@2.0.0-beta.21) (2021-10-02) + +**Note:** Version bump only for package @tiptap/extension-highlight + + + + + # [2.0.0-beta.20](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-highlight@2.0.0-beta.19...@tiptap/extension-highlight@2.0.0-beta.20) (2021-09-29) **Note:** Version bump only for package @tiptap/extension-highlight diff --git a/packages/extension-highlight/package.json b/packages/extension-highlight/package.json index 5bb81770..9eb1ec92 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.0.0-beta.20", + "version": "2.0.0-beta.21", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", diff --git a/packages/extension-horizontal-rule/CHANGELOG.md b/packages/extension-horizontal-rule/CHANGELOG.md index e64ada4f..0a84d53d 100644 --- a/packages/extension-horizontal-rule/CHANGELOG.md +++ b/packages/extension-horizontal-rule/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.21](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-horizontal-rule@2.0.0-beta.20...@tiptap/extension-horizontal-rule@2.0.0-beta.21) (2021-10-02) + +**Note:** Version bump only for package @tiptap/extension-horizontal-rule + + + + + # [2.0.0-beta.20](https://github.com/ueberdosis/tiptap/compare/@tiptap/extension-horizontal-rule@2.0.0-beta.19...@tiptap/extension-horizontal-rule@2.0.0-beta.20) (2021-09-29) diff --git a/packages/extension-horizontal-rule/package.json b/packages/extension-horizontal-rule/package.json index 94aec61d..8b75fb2c 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.0.0-beta.20", + "version": "2.0.0-beta.21", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", diff --git a/packages/html/CHANGELOG.md b/packages/html/CHANGELOG.md index f9a76f64..1473b32e 100644 --- a/packages/html/CHANGELOG.md +++ b/packages/html/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.117](https://github.com/ueberdosis/tiptap/compare/@tiptap/html@2.0.0-beta.116...@tiptap/html@2.0.0-beta.117) (2021-10-03) + +**Note:** Version bump only for package @tiptap/html + + + + + +# [2.0.0-beta.116](https://github.com/ueberdosis/tiptap/compare/@tiptap/html@2.0.0-beta.115...@tiptap/html@2.0.0-beta.116) (2021-10-02) + +**Note:** Version bump only for package @tiptap/html + + + + + # [2.0.0-beta.115](https://github.com/ueberdosis/tiptap/compare/@tiptap/html@2.0.0-beta.114...@tiptap/html@2.0.0-beta.115) (2021-09-30) **Note:** Version bump only for package @tiptap/html diff --git a/packages/html/package.json b/packages/html/package.json index ab8520e9..8bdcc664 100644 --- a/packages/html/package.json +++ b/packages/html/package.json @@ -1,7 +1,7 @@ { "name": "@tiptap/html", "description": "utility package to render tiptap JSON as HTML", - "version": "2.0.0-beta.115", + "version": "2.0.0-beta.117", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -21,7 +21,7 @@ "dist" ], "dependencies": { - "@tiptap/core": "^2.0.0-beta.116", + "@tiptap/core": "^2.0.0-beta.118", "hostic-dom": "^0.8.7", "prosemirror-model": "^1.14.3" }, diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 3816f44a..99c5d7ab 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.78](https://github.com/ueberdosis/tiptap/compare/@tiptap/react@2.0.0-beta.77...@tiptap/react@2.0.0-beta.78) (2021-10-02) + +**Note:** Version bump only for package @tiptap/react + + + + + # [2.0.0-beta.77](https://github.com/ueberdosis/tiptap/compare/@tiptap/react@2.0.0-beta.76...@tiptap/react@2.0.0-beta.77) (2021-09-30) diff --git a/packages/react/package.json b/packages/react/package.json index 8cc92e78..7bf119bd 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,7 +1,7 @@ { "name": "@tiptap/react", "description": "React components for tiptap", - "version": "2.0.0-beta.77", + "version": "2.0.0-beta.78", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -32,8 +32,8 @@ "react-dom": "^17.0.0" }, "dependencies": { - "@tiptap/extension-bubble-menu": "^2.0.0-beta.38", - "@tiptap/extension-floating-menu": "^2.0.0-beta.32", + "@tiptap/extension-bubble-menu": "^2.0.0-beta.39", + "@tiptap/extension-floating-menu": "^2.0.0-beta.33", "prosemirror-view": "^1.20.1" }, "repository": { diff --git a/packages/starter-kit/CHANGELOG.md b/packages/starter-kit/CHANGELOG.md index 1b50df79..7f6cd6ff 100644 --- a/packages/starter-kit/CHANGELOG.md +++ b/packages/starter-kit/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.117](https://github.com/ueberdosis/tiptap/compare/@tiptap/starter-kit@2.0.0-beta.116...@tiptap/starter-kit@2.0.0-beta.117) (2021-10-03) + +**Note:** Version bump only for package @tiptap/starter-kit + + + + + +# [2.0.0-beta.116](https://github.com/ueberdosis/tiptap/compare/@tiptap/starter-kit@2.0.0-beta.115...@tiptap/starter-kit@2.0.0-beta.116) (2021-10-02) + +**Note:** Version bump only for package @tiptap/starter-kit + + + + + # [2.0.0-beta.115](https://github.com/ueberdosis/tiptap/compare/@tiptap/starter-kit@2.0.0-beta.114...@tiptap/starter-kit@2.0.0-beta.115) (2021-09-30) **Note:** Version bump only for package @tiptap/starter-kit diff --git a/packages/starter-kit/package.json b/packages/starter-kit/package.json index ea6b5518..ccf88cb2 100644 --- a/packages/starter-kit/package.json +++ b/packages/starter-kit/package.json @@ -1,7 +1,7 @@ { "name": "@tiptap/starter-kit", "description": "starter kit for tiptap", - "version": "2.0.0-beta.115", + "version": "2.0.0-beta.117", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -21,7 +21,7 @@ "dist" ], "dependencies": { - "@tiptap/core": "^2.0.0-beta.116", + "@tiptap/core": "^2.0.0-beta.118", "@tiptap/extension-blockquote": "^2.0.0-beta.15", "@tiptap/extension-bold": "^2.0.0-beta.15", "@tiptap/extension-bullet-list": "^2.0.0-beta.15", @@ -29,11 +29,11 @@ "@tiptap/extension-code-block": "^2.0.0-beta.18", "@tiptap/extension-document": "^2.0.0-beta.13", "@tiptap/extension-dropcursor": "^2.0.0-beta.19", - "@tiptap/extension-gapcursor": "^2.0.0-beta.23", - "@tiptap/extension-hard-break": "^2.0.0-beta.20", + "@tiptap/extension-gapcursor": "^2.0.0-beta.24", + "@tiptap/extension-hard-break": "^2.0.0-beta.21", "@tiptap/extension-heading": "^2.0.0-beta.15", "@tiptap/extension-history": "^2.0.0-beta.16", - "@tiptap/extension-horizontal-rule": "^2.0.0-beta.20", + "@tiptap/extension-horizontal-rule": "^2.0.0-beta.21", "@tiptap/extension-italic": "^2.0.0-beta.15", "@tiptap/extension-list-item": "^2.0.0-beta.14", "@tiptap/extension-ordered-list": "^2.0.0-beta.16", diff --git a/packages/vue-2/CHANGELOG.md b/packages/vue-2/CHANGELOG.md index 414c8c89..4ef27425 100644 --- a/packages/vue-2/CHANGELOG.md +++ b/packages/vue-2/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.57](https://github.com/ueberdosis/tiptap/compare/@tiptap/vue-2@2.0.0-beta.56...@tiptap/vue-2@2.0.0-beta.57) (2021-10-02) + +**Note:** Version bump only for package @tiptap/vue-2 + + + + + # [2.0.0-beta.56](https://github.com/ueberdosis/tiptap/compare/@tiptap/vue-2@2.0.0-beta.55...@tiptap/vue-2@2.0.0-beta.56) (2021-09-29) **Note:** Version bump only for package @tiptap/vue-2 diff --git a/packages/vue-2/package.json b/packages/vue-2/package.json index 5e51a4a7..36107b7f 100644 --- a/packages/vue-2/package.json +++ b/packages/vue-2/package.json @@ -1,7 +1,7 @@ { "name": "@tiptap/vue-2", "description": "Vue components for tiptap", - "version": "2.0.0-beta.56", + "version": "2.0.0-beta.57", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -28,8 +28,8 @@ "vue": "^2.6.0" }, "dependencies": { - "@tiptap/extension-bubble-menu": "^2.0.0-beta.38", - "@tiptap/extension-floating-menu": "^2.0.0-beta.32", + "@tiptap/extension-bubble-menu": "^2.0.0-beta.39", + "@tiptap/extension-floating-menu": "^2.0.0-beta.33", "prosemirror-view": "^1.20.1" }, "repository": { diff --git a/packages/vue-3/CHANGELOG.md b/packages/vue-3/CHANGELOG.md index 30bbe150..20ac79fb 100644 --- a/packages/vue-3/CHANGELOG.md +++ b/packages/vue-3/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0-beta.67](https://github.com/ueberdosis/tiptap/compare/@tiptap/vue-3@2.0.0-beta.66...@tiptap/vue-3@2.0.0-beta.67) (2021-10-02) + + +### Bug Fixes + +* fix reactive props, see [#1728](https://github.com/ueberdosis/tiptap/issues/1728) ([7f7f93d](https://github.com/ueberdosis/tiptap/commit/7f7f93dc1b4b56c7647de27a792e000b3513c226)) + + + + + # [2.0.0-beta.66](https://github.com/ueberdosis/tiptap/compare/@tiptap/vue-3@2.0.0-beta.65...@tiptap/vue-3@2.0.0-beta.66) (2021-09-29) **Note:** Version bump only for package @tiptap/vue-3 diff --git a/packages/vue-3/package.json b/packages/vue-3/package.json index 91163a48..2eabed47 100644 --- a/packages/vue-3/package.json +++ b/packages/vue-3/package.json @@ -1,7 +1,7 @@ { "name": "@tiptap/vue-3", "description": "Vue components for tiptap", - "version": "2.0.0-beta.66", + "version": "2.0.0-beta.67", "homepage": "https://tiptap.dev", "keywords": [ "tiptap", @@ -28,8 +28,8 @@ "vue": "^3.0.0" }, "dependencies": { - "@tiptap/extension-bubble-menu": "^2.0.0-beta.38", - "@tiptap/extension-floating-menu": "^2.0.0-beta.32", + "@tiptap/extension-bubble-menu": "^2.0.0-beta.39", + "@tiptap/extension-floating-menu": "^2.0.0-beta.33", "prosemirror-state": "^1.3.4", "prosemirror-view": "^1.20.1" }, diff --git a/packages/vue-3/src/VueNodeViewRenderer.ts b/packages/vue-3/src/VueNodeViewRenderer.ts index 1b8abb7c..d2af9deb 100644 --- a/packages/vue-3/src/VueNodeViewRenderer.ts +++ b/packages/vue-3/src/VueNodeViewRenderer.ts @@ -88,11 +88,11 @@ class VueNodeView extends NodeView { + setup: reactiveProps => { provide('onDragStart', onDragStart) provide('decorationClasses', this.decorationClasses) - return (this.component as any).setup?.(props, { + return (this.component as any).setup?.(reactiveProps, { expose: () => undefined, }) }, diff --git a/tests/cypress/integration/core/pluginOrder.spec.ts b/tests/cypress/integration/core/pluginOrder.spec.ts new file mode 100644 index 00000000..ddc50c35 --- /dev/null +++ b/tests/cypress/integration/core/pluginOrder.spec.ts @@ -0,0 +1,69 @@ +/// + +import { Editor, Extension } from '@tiptap/core' +import Document from '@tiptap/extension-document' +import Paragraph from '@tiptap/extension-paragraph' +import Text from '@tiptap/extension-text' + +describe('pluginOrder', () => { + it('should run keyboard shortcuts in correct order', () => { + const order: number[] = [] + + cy.window().then(({ document }) => { + const element = document.createElement('div') + + document.body.append(element) + + const editor = new Editor({ + element, + extensions: [ + Document, + Paragraph, + Text, + Extension.create({ + priority: 1000, + addKeyboardShortcuts() { + return { + a: () => { + order.push(1) + + return false + }, + } + }, + }), + Extension.create({ + addKeyboardShortcuts() { + return { + a: () => { + order.push(3) + + return false + }, + } + }, + }), + Extension.create({ + addKeyboardShortcuts() { + return { + a: () => { + order.push(2) + + return false + }, + } + }, + }), + ], + }) + + cy.get('.ProseMirror') + .type('a') + .wait(100).then(() => { + expect(order).to.deep.eq([1, 2, 3]) + + editor.destroy() + }) + }) + }) +})