From afd87a63908d0413704c61cfed3cff20f7311d71 Mon Sep 17 00:00:00 2001 From: Ollie Hsieh Date: Thu, 27 Apr 2023 07:27:33 -0700 Subject: [PATCH] Add undo to web composer (#542) --- package.json | 1 + src/view/com/composer/text-input/TextInput.web.tsx | 2 ++ yarn.lock | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/package.json b/package.json index c07b3d79..1d19d609 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "@segment/sovran-react-native": "^0.4.5", "@tiptap/core": "^2.0.0-beta.220", "@tiptap/extension-document": "^2.0.0-beta.220", + "@tiptap/extension-history": "^2.0.3", "@tiptap/extension-link": "^2.0.0-beta.220", "@tiptap/extension-mention": "^2.0.0-beta.220", "@tiptap/extension-paragraph": "^2.0.0-beta.220", diff --git a/src/view/com/composer/text-input/TextInput.web.tsx b/src/view/com/composer/text-input/TextInput.web.tsx index f21d4ac1..ef767661 100644 --- a/src/view/com/composer/text-input/TextInput.web.tsx +++ b/src/view/com/composer/text-input/TextInput.web.tsx @@ -3,6 +3,7 @@ import {StyleSheet, View} from 'react-native' import {RichText} from '@atproto/api' import {useEditor, EditorContent, JSONContent} from '@tiptap/react' import {Document} from '@tiptap/extension-document' +import History from '@tiptap/extension-history' import {Link} from '@tiptap/extension-link' import {Mention} from '@tiptap/extension-mention' import {Paragraph} from '@tiptap/extension-paragraph' @@ -70,6 +71,7 @@ export const TextInput = React.forwardRef( placeholder, }), Text, + History, ], editorProps: { attributes: { diff --git a/yarn.lock b/yarn.lock index fb45b87a..a6f174a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4193,6 +4193,11 @@ dependencies: tippy.js "^6.3.7" +"@tiptap/extension-history@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@tiptap/extension-history/-/extension-history-2.0.3.tgz#8936c15aa46f2ddeada1c3d9abe2888d58d08c30" + integrity sha512-00KHIcJ8kivn2ARI6NQYphv2LfllVCXViHGm0EhzDW6NQxCrriJKE3tKDcTFCu7LlC5doMpq9Z6KXdljc4oVeQ== + "@tiptap/extension-link@^2.0.0-beta.220": version "2.0.0-beta.220" resolved "https://registry.yarnpkg.com/@tiptap/extension-link/-/extension-link-2.0.0-beta.220.tgz#c9954613cd1e0a0f1527853b732ef50dff734eac"