feat: 合同富文本改为表头调列宽、首列调行高,避免拖拽把邻列挤窄。

产品表按像素列宽重排,水印改到页面右下角,打开编辑时不再铺满整表绿线。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-10-29 11:57:39 +08:00
1 parent bde19c0644
commit 3aa0f0ff2e
12 files changed
+734 -161

No files matched your search

@@ -0,0 +1,26 @@
import assert from 'node:assert/strict'
import { describe, it } from 'node:test'
import { applyColumnWidthDelta, applyRowHeightDelta } from './tinymce-table-edge-resize.ts'
describe('applyColumnWidthDelta', () => {
it('widens only the dragged column and grows the table by the same amount', () => {
const start = [100, 36, 46]
const { widths, tableWidth } = applyColumnWidthDelta(start, 1, 20)
assert.deepEqual(widths, [100, 56, 46])
assert.equal(tableWidth, 202)
assert.deepEqual(start, [100, 36, 46])
})
it('does not shrink a column below 28px', () => {
const { widths, tableWidth } = applyColumnWidthDelta([100, 36, 46], 1, -100)
assert.deepEqual(widths, [100, 28, 46])
assert.equal(tableWidth, 174)
})
})
describe('applyRowHeightDelta', () => {
it('keeps row height at or above 20px', () => {
assert.equal(applyRowHeightDelta(30, 10), 40)
assert.equal(applyRowHeightDelta(30, -40), 20)
})
})