Merge remote-tracking branch 'origin/develop' into client_vite

This commit is contained in:
Elian Doran
2025-05-19 16:42:11 +03:00
16 changed files with 461 additions and 718 deletions

View File

@@ -10,7 +10,7 @@
"url": "https://github.com/TriliumNext/Notes"
},
"dependencies": {
"@eslint/js": "9.26.0",
"@eslint/js": "9.27.0",
"@excalidraw/excalidraw": "0.18.0",
"@fullcalendar/core": "6.1.17",
"@fullcalendar/daygrid": "6.1.17",

View File

@@ -1637,7 +1637,9 @@ div.find-replace-widget div.find-widget-found-wrapper > span {
#right-pane .toc li,
#right-pane .highlights-list li {
padding: 2px 8px;
padding-top: 2px;
padding-right: 8px;
padding-bottom: 2px;
border-radius: 4px;
text-align: unset;
transition:

View File

@@ -35,12 +35,8 @@ const TPL = /*html*/`<div class="toc-widget">
.toc ol {
position: relative;
overflow: hidden;
padding-left: 20px;
transition: max-height 0.3s ease;
}
.toc > ol {
padding-left: 0px;
transition: max-height 0.3s ease;
}
.toc li.collapsed + ol {
@@ -51,8 +47,8 @@ const TPL = /*html*/`<div class="toc-widget">
content: "";
position: absolute;
height: 100%;
left: 17px;
border-left: 1px solid var(--main-border-color);
z-index: 10;
}
.toc li {
@@ -67,11 +63,35 @@ const TPL = /*html*/`<div class="toc-widget">
hyphens: auto;
}
.toc > ol {
--toc-depth-level: 1;
}
.toc > ol > ol {
--toc-depth-level: 2;
}
.toc > ol > ol > ol {
--toc-depth-level: 3;
}
.toc > ol > ol > ol > ol {
--toc-depth-level: 4;
}
.toc > ol > ol > ol > ol > ol {
--toc-depth-level: 5;
}
.toc > ol ol::before {
left: calc((var(--toc-depth-level) - 2) * 20px + 14px);
}
.toc li {
padding-left: calc((var(--toc-depth-level) - 1) * 20px + 4px);
}
.toc li .collapse-button {
display: flex;
position: relative;
width: 20px;
height: 20px;
width: 21px;
height: 21px;
flex-shrink: 0;
align-items: center;
justify-content: center;
@@ -83,12 +103,12 @@ const TPL = /*html*/`<div class="toc-widget">
}
.toc li .item-content {
margin-left: 28px;
margin-left: 25px;
flex: 1;
}
.toc li .collapse-button + .item-content {
margin-left: 8px;
margin-left: 4px;
}
.toc li:hover {
@@ -316,10 +336,9 @@ export default class TocWidget extends RightPanelWidget {
//
const headingText = await this.replaceMathTextWithKatax(m[2]);
const $itemContent = $('<div class="item-content">').html(headingText).on("click", () => {
this.jumpToHeading(headingIndex);
});
const $li = $("<li>").append($itemContent);
const $itemContent = $('<div class="item-content">').html(headingText);
const $li = $("<li>").append($itemContent)
.on("click", () => this.jumpToHeading(headingIndex));
$ols[$ols.length - 1].append($li);
headingCount = headingIndex;
$previousLi = $li;
@@ -400,7 +419,8 @@ export default class TocWidget extends RightPanelWidget {
$previousLi.removeClass("collapsed");
}
$collapseButton.on("click", () => {
$collapseButton.on("click", (event) => {
event.stopPropagation();
if ($previousLi.hasClass("animating")) return;
const willCollapse = !$previousLi.hasClass("collapsed");
$previousLi.addClass("animating");