feat: move table column bars by mouse
This commit is contained in:
1 parent
d5aa63cd77
commit
dafca8de2b
5 files changed
+494
-11
No files matched your search
+31
-2
@@ -189,8 +189,10 @@
|
||||
|
||||
.paper .tiptap table {
|
||||
width: 100%;
|
||||
/* fixed layout + width:100% → equal-width columns regardless of content,
|
||||
matching odf-kit's even column distribution on export. */
|
||||
/* fixed layout → the per-column <col> percentage widths from the custom node
|
||||
view (tableView.ts) are authoritative; width:100% keeps the table the full
|
||||
text width, matching the ODT export (export/odt.ts emits per-column widths
|
||||
summing to the text width with table:align="margins"). */
|
||||
table-layout: fixed;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
@@ -200,6 +202,9 @@
|
||||
border: 1px solid #000;
|
||||
padding: 0.1cm;
|
||||
vertical-align: top;
|
||||
/* Positioning context for the column-resize handle widget (a child div the
|
||||
resize plugin places at the cell's right edge). */
|
||||
position: relative;
|
||||
/* Cells hold paragraphs; suppress their bottom margin so a single-line cell
|
||||
isn't taller than its text (matches the list-item paragraph treatment). */
|
||||
}
|
||||
@@ -224,6 +229,30 @@
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Column resize (tableColumnResize.ts). The handle is a widget the plugin places
|
||||
at a cell's right edge when the pointer is near an internal column border; the
|
||||
plugin reads the pointer position itself, so the handle ignores pointer events.
|
||||
`.resize-cursor` is toggled on the whole editor while a border is active. */
|
||||
.paper .tiptap.resize-cursor {
|
||||
cursor: col-resize;
|
||||
}
|
||||
|
||||
.paper .tiptap .column-resize-handle {
|
||||
position: absolute;
|
||||
right: -2px;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
width: 4px;
|
||||
z-index: 20;
|
||||
background: var(--color-primary);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.paper .tiptap .column-resize-dragging {
|
||||
/* Suppress text-selection flicker while dragging a column border. */
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.paper .tiptap p.is-editor-empty:first-child::before {
|
||||
content: attr(data-placeholder);
|
||||
float: left;
|
||||
|
||||
Reference in new issue
Block a user