feat(client/rtl): handle left

This commit is contained in:
Elian Doran 2025-10-08 17:50:54 +03:00
parent a8e44afd6d
commit db1bcfda45
No known key found for this signature in database
21 changed files with 80 additions and 80 deletions

View File

@ -151,7 +151,7 @@ class ContextMenu {
.css({
display: "block",
top: top,
left: left
"inset-inline-start": left
})
.addClass("show");
}
@ -187,7 +187,7 @@ class ContextMenu {
}
// Create a new group to avoid column breaks before and after the seaparator / header.
// This is a workaround for Firefox not supporting break-before / break-after: avoid
// This is a workaround for Firefox not supporting break-before / break-after: avoid
// for columns.
if (shouldStartNewGroup) {
$group = $("<div class='dropdown-no-break'>");
@ -313,7 +313,7 @@ class ContextMenu {
}
$group.append($item);
// After adding a menu item, if the previous item was a separator or header,
// reset the group so that the next item will be appended directly to the parent.
if (shouldResetGroup) {

View File

@ -299,7 +299,7 @@
content: '';
position: absolute;
top: 0;
left: -100%;
inset-inline-start: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, var(--hover-item-background-color, rgba(0, 0, 0, 0.03)), transparent);
@ -406,10 +406,10 @@
@keyframes shimmer {
0% {
left: -100%;
inset-inline-start: -100%;
}
100% {
left: 100%;
inset-inline-start: 100%;
}
}

View File

@ -281,7 +281,7 @@ span[style] {
position: absolute;
top: 0;
left: 0;
inset-inline-start: 0;
width: 100%;
height: 100%;
}

View File

@ -725,7 +725,7 @@ table.promoted-attributes-in-tooltip th {
.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before,
.bs-tooltip-left .tooltip-arrow::before {
left: -1px;
inset-inline-start: -1px;
border-width: 0.4rem 0 0.4rem 0.4rem;
border-inline-start-color: var(--main-border-color) !important;
}
@ -753,7 +753,7 @@ table.promoted-attributes-in-tooltip th {
.bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::after,
.bs-tooltip-left .tooltip-arrow::after {
left: -1px;
inset-inline-start: -1px;
border-width: 0.4rem 0 0.4rem 0.4rem;
border-inline-start-color: var(--tooltip-background-color) !important;
}
@ -1274,7 +1274,7 @@ a.external:not(.no-arrow):after, a[href^="http://"]:not(.no-arrow):after, a[href
#context-menu-cover.show {
position: fixed;
top: 0;
left: 0;
inset-inline-start: 0;
right: 0;
bottom: 0;
z-index: 1000;
@ -1288,7 +1288,7 @@ a.external:not(.no-arrow):after, a[href^="http://"]:not(.no-arrow):after, a[href
body.mobile #context-menu-container.mobile-bottom-menu {
position: fixed !important;
left: 0 !important;
inset-inline-start: 0 !important;
right: 0 !important;
bottom: 0 !important;
top: unset !important;
@ -1339,7 +1339,7 @@ body.desktop li.dropdown-submenu:hover > ul.dropdown-menu {
.dropdown-submenu > .dropdown-menu {
top: 0;
left: calc(100% - 2px); /* -2px, otherwise there's a small gap between menu and submenu where the hover can disappear */
inset-inline-start: calc(100% - 2px); /* -2px, otherwise there's a small gap between menu and submenu where the hover can disappear */
margin-top: -10px;
min-width: 15rem;
/* to make submenu scrollable https://github.com/zadam/trilium/issues/3136 */
@ -1348,7 +1348,7 @@ body.desktop li.dropdown-submenu:hover > ul.dropdown-menu {
}
body:not(.mobile) #launcher-pane.horizontal .dropdown-submenu > .dropdown-menu {
left: calc(-100% + 10px);
inset-inline-start: calc(-100% + 10px);
}
.right-dropdown-widget {
@ -1533,7 +1533,7 @@ body:not(.mobile) #launcher-pane.horizontal .dropdown-submenu > .dropdown-menu {
position: fixed !important;
bottom: calc(var(--mobile-bottom-offset) + var(--launcher-pane-size)) !important;
top: unset !important;
left: 0 !important;
inset-inline-start: 0 !important;
right: 0 !important;
transform: unset !important;
}
@ -1541,7 +1541,7 @@ body:not(.mobile) #launcher-pane.horizontal .dropdown-submenu > .dropdown-menu {
#mobile-sidebar-container {
position: fixed;
top: 0;
left: 0;
inset-inline-start: 0;
right: 0;
bottom: 0;
z-index: 1000;
@ -1557,7 +1557,7 @@ body:not(.mobile) #launcher-pane.horizontal .dropdown-submenu > .dropdown-menu {
#mobile-sidebar-wrapper {
position: absolute;
top: 0;
left: 0;
inset-inline-start: 0;
bottom: 0;
width: 85vw;
padding-top: env(safe-area-inset-top);
@ -1589,7 +1589,7 @@ body:not(.mobile) #launcher-pane.horizontal .dropdown-submenu > .dropdown-menu {
body.mobile .modal-dialog {
position: fixed;
bottom: 0;
left: 0;
inset-inline-start: 0;
right: 0;
margin: 0 !important;
max-height: 85vh;
@ -2293,7 +2293,7 @@ footer.webview-footer button {
font-family: boxicons !important;
position: absolute;
top: 1em;
left: 1em;
inset-inline-start: 1em;
}
.admonition.note { --accent-color: var(--admonition-note-accent-color); }
@ -2369,12 +2369,12 @@ footer.webview-footer button {
.content-floating-buttons.top-left {
top: 10px;
left: 10px;
inset-inline-start: 10px;
}
.content-floating-buttons.bottom-left {
bottom: 10px;
left: 10px;
inset-inline-start: 10px;
}
.content-floating-buttons.bottom-right {

View File

@ -120,7 +120,7 @@ body.desktop .dropdown-menu::before,
border-radius: var(--dropdown-border-radius);
position: absolute;
top: 0;
left: 0;
inset-inline-start: 0;
right: 0;
bottom: 0;
z-index: -1;
@ -224,7 +224,7 @@ html body .dropdown-item[disabled] {
position: absolute;
content: "";
top: -1px;
left: calc(0px - var(--menu-padding-size));
inset-inline-start: calc(0px - var(--menu-padding-size));
right: calc(0px - var(--menu-padding-size));
border-top: 1px solid var(--menu-item-delimiter-color);
}
@ -264,7 +264,7 @@ html body .dropdown-item[disabled] {
content: "";
position: absolute;
bottom: 8px;
left: calc(0px - var(--menu-padding-size));
inset-inline-start: calc(0px - var(--menu-padding-size));
right: calc(0px - var(--menu-padding-size));
border-top: 1px solid var(--menu-item-delimiter-color);
}

View File

@ -259,7 +259,7 @@ div.tn-tool-dialog {
position: absolute;
content: "";
top: var(--connector-top, 0);
left: calc(var(--timeline-left-gap) + ((var(--timeline-bullet-size) - var(--timeline-connector-size)) / 2));
inset-inline-start: calc(var(--timeline-left-gap) + ((var(--timeline-bullet-size) - var(--timeline-connector-size)) / 2));
bottom: var(--connector-bottom, 0);
width: var(--timeline-connector-size);
border-radius: var(--connector-radius, 0) var(--connector-radius, 0) 0 0;
@ -291,7 +291,7 @@ div.tn-tool-dialog {
position: absolute;
content: "";
top: calc(var(--timeline-item-top-padding) + var(--timeline-bullet-vertical-pos));
left: var(--timeline-left-gap);
inset-inline-start: var(--timeline-left-gap);
width: var(--timeline-bullet-size);
height: var(--timeline-bullet-size);
border-radius: 50%;

View File

@ -471,7 +471,7 @@ optgroup {
label.tn-checkbox > input[type="checkbox"] {
position: absolute;
top: 0;
left: 0;
inset-inline-start: 0;
width: var(--box-size);
height: 100%;
margin: unset;
@ -485,7 +485,7 @@ optgroup {
content: "";
position: absolute;
top: 50%;
left: 0;
inset-inline-start: 0;
translate: 0 -50%;
width: var(--box-size);
height: var(--box-size);

View File

@ -119,7 +119,7 @@
top: var(--negative-padding);
right: var(--negative-padding);
bottom: var(--negative-padding);
left: var(--negative-padding);
inset-inline-start: var(--negative-padding);
border-radius: var(--dropdown-border-radius);
backdrop-filter: var(--dropdown-backdrop-filter);
z-index: -1;
@ -233,7 +233,7 @@
position: absolute;
top: 0;
bottom: var(--negative-padding);
left: var(--negative-padding);
inset-inline-start: var(--negative-padding);
right: var(--negative-padding);
border-top: 1px solid var(--ck-editor-popup-border-color);
background: var(--menu-section-background-color);
@ -615,7 +615,7 @@ html .note-detail-editable-text :not(figure, .include-note, hr):first-child {
.ck-content blockquote:before {
content: "“";
left: 0.2em;
inset-inline-start: 0.2em;
}
.ck-content blockquote:after {

View File

@ -402,7 +402,7 @@ body.layout-horizontal > .horizontal {
top: var(--vertical-margin);
right: var(--horiz-margin);
bottom: var(--vertical-margin);
left: var(--horiz-margin);
inset-inline-start: var(--horiz-margin);
border-radius: 6px;
background: var(--calendar-day-highlight-background);
z-index: -1;
@ -496,7 +496,7 @@ div.quick-search::before {
position: absolute;
content: "";
top: var(--padding-top);
left: var(--padding-inline-start);
inset-inline-start: var(--padding-inline-start);
bottom: var(--padding-bottom);
right: var(--padding-inline-end);
z-index: 0;
@ -658,7 +658,7 @@ body.layout-vertical.background-effects div.quick-search .dropdown-menu {
position: absolute;
content: "";
top: var(--left-pane-item-selected-shadow-size);
left: var(--left-pane-item-selected-shadow-size);
inset-inline-start: var(--left-pane-item-selected-shadow-size);
bottom: var(--left-pane-item-selected-shadow-size);
right: var(--left-pane-item-selected-shadow-size);
background: var(--left-pane-item-selected-background) !important;
@ -906,7 +906,7 @@ body.electron.background-effects.layout-horizontal .tab-row-container .toggle-bu
content: "";
position: absolute;
bottom: 0;
left: -10px;
inset-inline-start: -10px;
right: -10px;
top: 32px;
height: 1px;
@ -918,12 +918,12 @@ body.electron.background-effects.layout-horizontal .tab-row-container .tab-scrol
position: relative;
}
body.electron.background-effects.layout-horizontal .tab-row-container .tab-scroll-button-left:after,
body.electron.background-effects.layout-horizontal .tab-row-container .tab-scroll-button-inset-inline-start:after,
body.electron.background-effects.layout-horizontal .tab-row-container .tab-scroll-button-right:after {
content: "";
position: absolute;
bottom: 0;
left: 0px;
inset-inline-start: 0px;
right: 0px;
height: 1px;
border-bottom: 1px solid var(--launcher-pane-horiz-border-color);
@ -933,7 +933,7 @@ body.electron.background-effects.layout-horizontal .tab-row-container .note-tab[
content: "";
position: absolute;
bottom: 0;
left: -32768px;
inset-inline-start: -32768px;
top: var(--tab-height);
right: calc(100% - 1px);
height: 1px;
@ -944,7 +944,7 @@ body.electron.background-effects.layout-horizontal .tab-row-container .note-tab[
content: "";
position: absolute;
bottom: 0;
left: 100%;
inset-inline-start: 100%;
top: var(--tab-height);
right: 0;
width: 100vw;
@ -956,7 +956,7 @@ body.electron.background-effects.layout-horizontal .tab-row-container .note-new-
content: "";
position: absolute;
bottom: 0;
left: -4px;
inset-inline-start: -4px;
top: calc(var(--tab-height), -1);
right: 0;
width: 100vw;
@ -1045,7 +1045,7 @@ body.layout-horizontal .tab-row-widget .note-tab .note-tab-wrapper {
content: "";
position: absolute;
top: 0;
left: 0;
inset-inline-start: 0;
right: 0;
height: 3px;
background-color: var(--workspace-tab-background-color);
@ -1114,7 +1114,7 @@ body.layout-vertical .tab-row-widget-is-sorting .note-tab.note-tab-is-dragging .
position: absolute;
content: "";
top: calc((var(--tab-height) - var(--new-tab-button-size)) / 2);
left: calc((var(--tab-height) - var(--new-tab-button-size)) / 2);
inset-inline-start: calc((var(--tab-height) - var(--new-tab-button-size)) / 2);
width: var(--new-tab-button-size);
height: var(--new-tab-button-size);
background: var(--new-tab-button-background);
@ -1139,7 +1139,7 @@ body.layout-vertical .tab-row-widget-is-sorting .note-tab.note-tab-is-dragging .
display: flex;
position: absolute;
content: "\ebc0";
left: 0;
inset-inline-start: 0;
top: 0;
width: 100%;
height: 100%;

View File

@ -16,7 +16,7 @@
.note-split.rtl .floating-buttons-children,
.note-split.rtl .show-floating-buttons {
right: unset;
left: 10px;
inset-inline-start: 10px;
}
.note-split.rtl .close-floating-buttons {

View File

@ -21,6 +21,6 @@ body.zen.mobile .close-zen-container {
}
body.zen.electron:not(.platform-darwin):not(.native-titlebar) .close-zen-container {
left: calc(env(titlebar-area-width) - var(--zen-button-size) - 2px);
inset-inline-start: calc(env(titlebar-area-width) - var(--zen-button-size) - 2px);
right: unset;
}

View File

@ -13,7 +13,7 @@
.search-result-widget-content .calendar-view {
position: absolute;
top: 0;
left: 0;
inset-inline-start: 0;
right: 0;
bottom: 0;
}

View File

@ -36,14 +36,14 @@
.geo-map-container .leaflet-div-icon .icon-shadow {
position: absolute;
top: 0;
left: 0;
inset-inline-start: 0;
z-index: -1;
}
.geo-map-container .leaflet-div-icon .bx {
position: absolute;
top: 3px;
left: 2px;
inset-inline-start: 2px;
background-color: white;
color: black;
padding: 2px;
@ -55,7 +55,7 @@
display: block;
position: absolute;
top: 100%;
left: 50%;
inset-inline-start: 50%;
transform: translateX(-50%);
font-size: 0.75rem;
height: 1rem;

View File

@ -13,7 +13,7 @@
.search-result-widget-content .table-view {
position: absolute;
top: 0;
left: 0;
inset-inline-start: 0;
right: 0;
bottom: 0;
}
@ -65,7 +65,7 @@
.tabulator button.tree-collapse span {
position: absolute;
top: 0;
left: 0;
inset-inline-start: 0;
font-size: 1.5em;
transform: translateY(-50%);
}

View File

@ -46,7 +46,7 @@ const TPL = /*html*/`\
.modal.popup-editor-dialog .classic-toolbar-widget {
position: sticky;
top: 0;
left: 0;
inset-inline-start: 0;
right: 0;
background: var(--modal-background-color);
z-index: 998;

View File

@ -95,7 +95,7 @@ const TPL = /*html*/`
content: "";
position: absolute;
top: 10px;
left: 0px;
inset-inline-start: 0px;
right: 0;
height: 2px;
background: rgba(0, 0, 0, 0.5);

View File

@ -15,12 +15,12 @@ const TPL = /*html*/`
padding: 10px 10px 10px 0px;
height: 50px;
}
.quick-search button, .quick-search input {
border: 0;
font-size: 100% !important;
}
.quick-search .dropdown-menu {
--quick-search-item-delimiter-color: var(--dropdown-border-color);
@ -32,40 +32,40 @@ const TPL = /*html*/`
text-overflow: ellipsis;
box-shadow: -30px 50px 93px -50px black;
}
.quick-search .dropdown-item {
white-space: normal;
padding: 12px 16px;
line-height: 1.4;
position: relative;
}
.quick-search .dropdown-item + .dropdown-item::after {
content: '';
position: absolute;
left: 0;
inset-inline-start: 0;
top: 0;
width: 100%;
height: 1px;
border-bottom: 1px solid var(--quick-search-item-delimiter-color);
}
.quick-search .dropdown-item:last-child::after {
display: none;
}
.quick-search .dropdown-item.disabled::after {
display: none;
}
.quick-search .dropdown-item.show-in-full-search::after {
display: none;
}
.quick-search-item.dropdown-item:hover {
background-color: #f8f9fa;
}
.quick-search .quick-search-item {
width: 100%;
}
@ -151,7 +151,7 @@ export default class QuickSearchWidget extends BasicWidget {
private dropdown!: bootstrap.Dropdown;
private $searchString!: JQuery<HTMLElement>;
private $dropdownMenu!: JQuery<HTMLElement>;
// State for infinite scrolling
private allSearchResults: Array<any> = [];
private allSearchResultNoteIds: string[] = [];
@ -172,7 +172,7 @@ export default class QuickSearchWidget extends BasicWidget {
});
this.$widget.find(".input-group-prepend").on("shown.bs.dropdown", () => this.search());
// Add scroll event listener for infinite scrolling
this.$dropdownMenu.on("scroll", () => {
this.handleScroll();
@ -187,7 +187,7 @@ export default class QuickSearchWidget extends BasicWidget {
if (originalEvent && isIMEComposing(originalEvent)) {
return;
}
if (e.which === 13) {
if (this.$dropdownMenu.is(":visible")) {
this.search(); // just update already visible dropdown
@ -293,40 +293,40 @@ export default class QuickSearchWidget extends BasicWidget {
if (!noteId) continue;
const $item = $('<a class="dropdown-item" tabindex="0" href="javascript:">');
// Build the display HTML with content snippet below the title
let itemHtml = `<div class="quick-search-item">
<div class="quick-search-item-header">
<span class="quick-search-item-icon ${result.icon}"></span>
<span class="search-result-title">${result.highlightedNotePathTitle}</span>
</div>`;
// Add attribute snippet (tags/attributes) below the title if available
if (result.highlightedAttributeSnippet) {
// Replace <br> with a blank space to join the atributes on the same single line
const snippet = (result.highlightedAttributeSnippet as string).replace(/<br\s?\/?>/g, " ");
itemHtml += `<div class="search-result-attributes">${snippet}</div>`;
}
// Add content snippet below the attributes if available
if (result.highlightedContentSnippet) {
itemHtml += `<div class="search-result-content">${result.highlightedContentSnippet}</div>`;
}
itemHtml += `</div>`;
$item.html(itemHtml);
$item.on("click", (e) => {
this.dropdown.hide();
e.preventDefault();
const activeContext = appContext.tabManager.getActiveContext();
if (activeContext) {
activeContext.setNote(noteId);
}
});
shortcutService.bindElShortcut($item, "return", () => {
this.dropdown.hide();
@ -390,7 +390,7 @@ export default class QuickSearchWidget extends BasicWidget {
// Trigger loading more when user scrolls near the bottom (within 50px)
if (scrollTop + clientHeight >= scrollHeight - 50) {
const totalResults = this.allSearchResults.length > 0 ? this.allSearchResults.length : this.allSearchResultNoteIds.length;
if (this.currentDisplayedCount < totalResults) {
this.displayMoreResults(LOAD_MORE_BATCH_SIZE).then(() => {
this.addShowInFullSearchButton();

View File

@ -40,7 +40,7 @@
content: "";
position: absolute;
top: 0;
left: 0;
inset-inline-start: 0;
width: var(--switch-thumb-width);
height: var(--switch-thumb-height);
background-color: var(--switch-off-thumb-background);
@ -63,7 +63,7 @@
/* A hidden check box for accesibility purposes */
position: absolute;
top: 0;
left: 0;
inset-inline-start: 0;
width: 100%;
height: 100%;
opacity: 0;

View File

@ -27,7 +27,7 @@ const TPL = /*html*/`
.sync-status .sync-status-sub-icon {
font-size: 40%;
position: absolute;
left: 0;
inset-inline-start: 0;
top: 16px;
}

View File

@ -80,7 +80,7 @@ const TPL = /*html*/`<div class="toc-widget">
}
.toc > ol ol::before {
left: calc((var(--toc-depth-level) - 2) * 20px + 14px);
inset-inline-start: calc((var(--toc-depth-level) - 2) * 20px + 14px);
}
.toc li {

View File

@ -12,7 +12,7 @@
#root-widget.virtual-keyboard-opened .classic-toolbar-outer-container.ios {
position: absolute;
left: 0;
inset-inline-start: 0;
right: 0;
bottom: 0;
}
@ -20,7 +20,7 @@
.classic-toolbar-widget {
position: absolute;
bottom: 0;
left: 0;
inset-inline-start: 0;
right: 0;
height: 38px;
overflow: scroll;