Closed jschyz closed 1 month ago
The recent changes to the table-module
package involve enhancements and refactoring aimed at improving table manipulation functionality. Key updates include handling table column deletion and insertion, adding new features for merging and splitting cells, and introducing column width configurations. These changes enhance table editing capabilities, improve performance, and refine rendering logic.
File(s) | Change Summary |
---|---|
DeleteCol.ts , InsertCol.ts |
Refactored logic for deleting and inserting columns, including handling cells, column spans, widths, and table structures. |
InsertTable.ts |
Introduced a columnWidths array within the TableElement object for specifying column widths. |
MergeCell.ts , SplitCell.ts |
Added functionality for merging and splitting table cells, along with related configurations. |
plugin.ts |
Added an import for withSelection and integrated a call to withSelection within withTable for improved selection handling. |
render-cell.tsx |
Refactored table cell rendering logic, including removal of column width resizing and adjustments based on cell properties. |
render-table.tsx |
Enhanced table rendering, managing cell borders, column resizing, and event listeners for table interactions. |
sequenceDiagram
participant User
participant TableEditor
participant DeleteCol
participant InsertCol
participant MergeCell
participant SplitCell
participant RenderTable
participant Plugin
User->>TableEditor: Delete Column
TableEditor->>DeleteCol: Execute delete column logic
DeleteCol-->>TableEditor: Updated table structure
User->>TableEditor: Insert Column
TableEditor->>InsertCol: Execute insert column logic
InsertCol-->>TableEditor: Updated table structure
User->>TableEditor: Merge Cells
TableEditor->>MergeCell: Execute merge cell logic
MergeCell-->>TableEditor: Merged cells
User->>TableEditor: Split Cells
TableEditor->>SplitCell: Execute split cell logic
SplitCell-->>TableEditor: Split cells
TableEditor->>RenderTable: Render updated table
RenderTable-->>User: Display updated table
In the land of code where tables dwell,
Columns shift and cells now tell,
Of merges and splits, widths anew,
A dance of data, sleek and true.
With each new change, we celebrate,
A table's tale, forever great.
🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
本地测试截图
收到,今晚 review。
需要跑一下 yarn lint --fix
我这边check到你的分支改了部分 test 文件,因为 lint 校验没过,提不上去,没法合到你的分支里,这太扯了😂
我这边check到你的分支改了部分 test 文件,因为 lint 校验没过,提不上去,没法合到你的分支里,这太扯了😂
确实没有 lint; table 单测完看看。
求助,这个 test FAIL 莫名其妙
哈哈哈,我就是这个有点困惑才让你看下的,我今天有事应该看不了这个了,明天看看能不能解决,不能解决的话就小步快跑了。说不定看半天是jest的毛病呢,我有打算换 vtest 的,现在单测有点多,vtest 似乎更快一些。
看报错信息 似乎是 tableEntry 可能不存在 解构 null 报错了。
我在给 jest打断点,找到问题了,我改改
已经发布了新版本,Cypress 的 action checkout,出问题了,我晚上回去看一下。
嗯嗯,什么问题
看了一下,似乎是 e2e 测试的 docker 容器版本过时了,换了最新版和node版本,现在没问题了。
@jschyz 方便加个微信不?ylf2991205548 我今天测试,发现飞书的表格在加入合并功能后复制进来渲染出了问题,这个你方便看一下嘛。 我正在搞文档,另一个飞书文档渲染 blockquote 出错的问题也得看看,这个我可以晚点看下。
实现参考 https://github.com/nlulic/slate-table 飞书表格
WangEditor 支持 Table Cell 合并 [预览]
基础能力
列拖拽
行列新增 / 删除
宽度自适应
图片自适应
Summary by CodeRabbit
New Features
Bug Fixes
Refactor