[PR #2714] [MERGED] Copy and paste appflowy editor data #5386

Closed
opened 2026-03-23 22:18:31 +00:00 by mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/2714
Author: @qinluhe
Created: 6/5/2023
Status: Merged
Merged: 6/8/2023
Merged by: @qinluhe

Base: developHead: feat/copy-paste


📝 Commits (2)

  • e5acf58 feat: copy and paste appflowy editor data
  • 01aa6b2 fix: review suggestion

📊 Changes

23 files changed (+632 additions, -112 deletions)

View changed files

📝 frontend/appflowy_tauri/src-tauri/Cargo.lock (+1 -0)
📝 frontend/appflowy_tauri/src/appflowy_app/components/document/BlockSelection/RangeKeyDown.hooks.ts (+26 -5)
📝 frontend/appflowy_tauri/src/appflowy_app/components/document/CodeBlock/useKeyDown.ts (+1 -1)
📝 frontend/appflowy_tauri/src/appflowy_app/components/document/Overlay/index.tsx (+4 -0)
📝 frontend/appflowy_tauri/src/appflowy_app/components/document/TextBlock/useKeyDown.ts (+5 -8)
frontend/appflowy_tauri/src/appflowy_app/components/document/_shared/CopyPasteHooks/useCopy.ts (+37 -0)
frontend/appflowy_tauri/src/appflowy_app/components/document/_shared/CopyPasteHooks/usePaste.ts (+36 -0)
📝 frontend/appflowy_tauri/src/appflowy_app/components/document/_shared/EditorHooks/useCommonKeyEvents.ts (+17 -0)
📝 frontend/appflowy_tauri/src/appflowy_app/components/document/_shared/SlateEditor/useEditor.ts (+12 -15)
📝 frontend/appflowy_tauri/src/appflowy_app/components/document/_shared/SlateEditor/useSlateYjs.ts (+9 -9)
frontend/appflowy_tauri/src/appflowy_app/constants/document/copy_paste.ts (+5 -0)
📝 frontend/appflowy_tauri/src/appflowy_app/constants/document/keyboard.ts (+10 -0)
📝 frontend/appflowy_tauri/src/appflowy_app/interfaces/document.ts (+13 -1)
📝 frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_controller.ts (+1 -1)
📝 frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async-actions/blocks/merge.ts (+6 -5)
frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async-actions/copyPaste.ts (+202 -0)
📝 frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async-actions/format.ts (+8 -4)
📝 frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async-actions/range.ts (+17 -21)
📝 frontend/appflowy_tauri/src/appflowy_app/utils/document/action.ts (+65 -28)
frontend/appflowy_tauri/src/appflowy_app/utils/document/copy_paste.ts (+82 -0)

...and 3 more files

📄 Description

Feature Preview

  • Support copy and paste (JSON) of data inside the Editor, does not support HTML parsing copy and paste
  • Support shortcut keys for text format

PR Checklist

  • My code adheres to the AppFlowy Style Guide
  • I've listed at least one issue that this PR fixes in the description above.
  • I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes.
  • All existing tests are passing.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AppFlowy-IO/AppFlowy/pull/2714 **Author:** [@qinluhe](https://github.com/qinluhe) **Created:** 6/5/2023 **Status:** ✅ Merged **Merged:** 6/8/2023 **Merged by:** [@qinluhe](https://github.com/qinluhe) **Base:** `develop` ← **Head:** `feat/copy-paste` --- ### 📝 Commits (2) - [`e5acf58`](https://github.com/AppFlowy-IO/AppFlowy/commit/e5acf58aa9d1d6b239dd02ef741ddb9a20685b51) feat: copy and paste appflowy editor data - [`01aa6b2`](https://github.com/AppFlowy-IO/AppFlowy/commit/01aa6b2b1a3010c32ce41742089b30526dd32061) fix: review suggestion ### 📊 Changes **23 files changed** (+632 additions, -112 deletions) <details> <summary>View changed files</summary> 📝 `frontend/appflowy_tauri/src-tauri/Cargo.lock` (+1 -0) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/document/BlockSelection/RangeKeyDown.hooks.ts` (+26 -5) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/document/CodeBlock/useKeyDown.ts` (+1 -1) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/document/Overlay/index.tsx` (+4 -0) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/document/TextBlock/useKeyDown.ts` (+5 -8) ➕ `frontend/appflowy_tauri/src/appflowy_app/components/document/_shared/CopyPasteHooks/useCopy.ts` (+37 -0) ➕ `frontend/appflowy_tauri/src/appflowy_app/components/document/_shared/CopyPasteHooks/usePaste.ts` (+36 -0) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/document/_shared/EditorHooks/useCommonKeyEvents.ts` (+17 -0) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/document/_shared/SlateEditor/useEditor.ts` (+12 -15) 📝 `frontend/appflowy_tauri/src/appflowy_app/components/document/_shared/SlateEditor/useSlateYjs.ts` (+9 -9) ➕ `frontend/appflowy_tauri/src/appflowy_app/constants/document/copy_paste.ts` (+5 -0) 📝 `frontend/appflowy_tauri/src/appflowy_app/constants/document/keyboard.ts` (+10 -0) 📝 `frontend/appflowy_tauri/src/appflowy_app/interfaces/document.ts` (+13 -1) 📝 `frontend/appflowy_tauri/src/appflowy_app/stores/effects/document/document_controller.ts` (+1 -1) 📝 `frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async-actions/blocks/merge.ts` (+6 -5) ➕ `frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async-actions/copyPaste.ts` (+202 -0) 📝 `frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async-actions/format.ts` (+8 -4) 📝 `frontend/appflowy_tauri/src/appflowy_app/stores/reducers/document/async-actions/range.ts` (+17 -21) 📝 `frontend/appflowy_tauri/src/appflowy_app/utils/document/action.ts` (+65 -28) ➕ `frontend/appflowy_tauri/src/appflowy_app/utils/document/copy_paste.ts` (+82 -0) _...and 3 more files_ </details> ### 📄 Description <!--- Thank you for submitting a pull request to AppFlowy. The team will dedicate their best efforts to reviewing and approving your pull request. If you have any questions about the project or feedback for us, please join our [Discord](https://discord.gg/wdjWUXXhtw). --> <!--- If your pull request adds a new feature, please drag and drop a video into this section to showcase what you've done! If not, you may delete this section. --> ### Feature Preview - [x] Support copy and paste (JSON) of data inside the Editor, does not support HTML parsing copy and paste - [x] Support shortcut keys for text format <!--- List at least one issue here that this PR addresses. If it fixes the issue, please use the [fixes](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests) keyword to close the issue. For example: fixes https://github.com/AppFlowy-IO/AppFlowy/pull/2106 --> --- <!--- Before you mark this PR ready for review, run through this checklist! --> #### PR Checklist - [ ] My code adheres to the [AppFlowy Style Guide](https://appflowy.gitbook.io/docs/essential-documentation/contribute-to-appflowy/software-contributions/submitting-code/style-guides) - [ ] I've listed at least one issue that this PR fixes in the description above. - [ ] I've added a test(s) to validate changes in this PR, or this PR only contains semantic changes. - [ ] All existing tests are passing. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
mirror 2026-03-23 22:18:31 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#5386
No description provided.