mirror of
https://github.com/docmost/docmost.git
synced 2026-08-29 18:14:58 +08:00
feat(base): add right-side scroll headroom on inline embed grid
Mirror the leftward padding with --embed-grid-pad-right = extendRight, applied as padding-right on .grid. The user can now pan past the last column into empty space — same shape as Notion's behavior. Standalone full-page bases are unaffected (var unset → 0).
This commit is contained in:
@@ -29,6 +29,10 @@
|
|||||||
* scrollable region — the user can pan left into it. Standalone
|
* scrollable region — the user can pan left into it. Standalone
|
||||||
* full-page bases never set the var, so it's a no-op there. */
|
* full-page bases never set the var, so it's a no-op there. */
|
||||||
padding-left: var(--embed-grid-pad-left, 0);
|
padding-left: var(--embed-grid-pad-left, 0);
|
||||||
|
/* Symmetric right-side padding lets the user scroll past the last
|
||||||
|
* column into empty space, so wide tables don't end abruptly at
|
||||||
|
* the viewport edge. */
|
||||||
|
padding-right: var(--embed-grid-pad-right, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.headerRow {
|
.headerRow {
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ function applyExtension(wrapper: HTMLDivElement) {
|
|||||||
wrapper.style.setProperty("--embed-extend-l", `${extendLeft}px`);
|
wrapper.style.setProperty("--embed-extend-l", `${extendLeft}px`);
|
||||||
wrapper.style.setProperty("--embed-extend-r", `${extendRight}px`);
|
wrapper.style.setProperty("--embed-extend-r", `${extendRight}px`);
|
||||||
wrapper.style.setProperty("--embed-grid-pad-left", `${extendLeft}px`);
|
wrapper.style.setProperty("--embed-grid-pad-left", `${extendLeft}px`);
|
||||||
|
// Symmetric right-side padding so the user can pan past the last
|
||||||
|
// column into empty space — same behaviour as Notion, gives the
|
||||||
|
// table breathing room on the right when scrolled fully right.
|
||||||
|
wrapper.style.setProperty("--embed-grid-pad-right", `${extendRight}px`);
|
||||||
// Drop the standalone "panel" frame: inline databases read as part
|
// Drop the standalone "panel" frame: inline databases read as part
|
||||||
// of the document, with only cell separators as gridlines.
|
// of the document, with only cell separators as gridlines.
|
||||||
wrapper.style.setProperty("--grid-outer-border", "none");
|
wrapper.style.setProperty("--grid-outer-border", "none");
|
||||||
|
|||||||
Reference in New Issue
Block a user