Skip to content

feat: solve the problem of losing content style when copying from Excel#466

Open
wuyiping0628 wants to merge 2 commits intodevfrom
wyp/table-style-0414
Open

feat: solve the problem of losing content style when copying from Excel#466
wuyiping0628 wants to merge 2 commits intodevfrom
wyp/table-style-0414

Conversation

@wuyiping0628
Copy link
Copy Markdown
Collaborator

@wuyiping0628 wuyiping0628 commented Apr 14, 2026

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Added an interactive demo showcasing table clipboard paste styling with configurable paste styling and default tag style behavior.
  • Documentation

    • Included documentation and an embedded demo illustrating the table clipboard paste options and usage.
  • Chores

    • Upgraded the table editor plugin dependency to version 3.5.0.

@github-actions github-actions bot added the enhancement New feature or request label Apr 14, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 29b82297-7500-4f9a-b265-7ca1cd947ceb

📥 Commits

Reviewing files that changed from the base of the PR and between c5f5e2d and 0fa198a.

📒 Files selected for processing (2)
  • packages/docs/fluent-editor/demos/table-up-clipboard.vue
  • packages/docs/fluent-editor/docs/demo/table-up.md
✅ Files skipped from review due to trivial changes (1)
  • packages/docs/fluent-editor/docs/demo/table-up.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/docs/fluent-editor/demos/table-up-clipboard.vue

Walkthrough

Added a client-only Vue demo that mounts FluentEditor with the quill-table-up table plugin (configuring clipboard paste styling and context menu), updated docs to include the demo, and bumped quill-table-up to ^3.5.0 in two package manifests.

Changes

Cohort / File(s) Summary
Demo Component
packages/docs/fluent-editor/demos/table-up-clipboard.vue
New Vue demo that dynamically imports @opentiny/fluent-editor and quill-table-up on mount, registers table-up, extends the toolbar with a table-up control, and configures paste styling and nested table modules.
Documentation
packages/docs/fluent-editor/docs/demo/table-up.md
Inserted a new 表格剪粘板 section and embedded the new demo via <demo vue="../../demos/table-up-clipboard.vue" />.
Dependency Updates
packages/docs/package.json, packages/projects/package.json
Bumped quill-table-up dependency to ^3.5.0 in both package manifests (from ^3.4.0 and ^3.0.1).

Sequence Diagram(s)

sequenceDiagram
    participant Browser
    participant DemoComponent as Demo.vue
    participant FluentEditorPkg as `@opentiny/fluent-editor`
    participant TableUpPkg as quill-table-up
    participant DOM as EditorMount

    Browser->>DemoComponent: load component (SSR -> client)
    DemoComponent->>DemoComponent: onMounted()
    DemoComponent->>FluentEditorPkg: dynamic import
    DemoComponent->>TableUpPkg: dynamic import
    Note right of DemoComponent: generateTableUp(TableUp) and register module
    DemoComponent->>DOM: find editor mount (`editorContextmenuRef`)
    DemoComponent->>FluentEditorPkg: new FluentEditor({... toolbar + table-up, modules config ...}, mount=DOM)
    FluentEditorPkg->>DOM: render editor UI
    Browser->>FluentEditorPkg: user paste into table (clipboard)
    FluentEditorPkg->>TableUpPkg: handle paste using configured pasteStyleSheet/pasteDefaultTagStyle
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I hopped in for a quick deploy, clipboard and tables in my paw,
I fetch v3.5, register modules, then mount without a flaw.
Paste the style, skip the noise, context menus softly hum,
A tiny demo, shining bright — hop in, the editor's come! 🥕📋

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: solving style loss when copying from Excel, which is directly addressed by the new demo component and dependency updates for table-up clipboard functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wyp/table-style-0414

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/docs/fluent-editor/demos/table-up-clipboard.vue`:
- Around line 48-51: 将这段说明改写为更清晰、可读的中文:提到 quill-table-up 从 3.5.0 版本新增了选项
pasteStyleSheet(将其名与版本号保留),说明将其设为 true 会解析粘贴 HTML 中的 style
标签;如果希望保留通过标签选择器设置的样式,建议同时启用 pasteDefaultTagStyle(保留该选项名);将 "excel" 改为规范书写
"Excel",拆分冗长句子并在末尾保留性能提示(开启 pasteStyleSheet 可能会降低粘贴解析性能),保证语句通顺且信息完整以提高可读性。

In `@packages/docs/fluent-editor/docs/demo/table-up.md`:
- Line 23: Update the heading text "## 表格剪切板" to use the standard term by
replacing "剪切板" with "剪贴板" so the heading reads "## 表格剪贴板" to ensure consistency
and better searchability across user-facing docs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b0978e9a-6f76-4e6b-aae8-fadae6d1053e

📥 Commits

Reviewing files that changed from the base of the PR and between 4a3ccb5 and c5f5e2d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • packages/docs/fluent-editor/demos/table-up-clipboard.vue
  • packages/docs/fluent-editor/docs/demo/table-up.md
  • packages/docs/package.json
  • packages/projects/package.json

Comment thread packages/docs/fluent-editor/demos/table-up-clipboard.vue Outdated
Comment thread packages/docs/fluent-editor/docs/demo/table-up.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant