feat(client/rtl): improve alignment of the attribute editor

This commit is contained in:
Elian Doran 2025-10-09 18:34:32 +03:00
parent 74d7191222
commit f4df7c1eec
No known key found for this signature in database
2 changed files with 9 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import { t } from "../../../services/i18n";
import server from "../../../services/server";
import note_autocomplete, { Suggestion } from "../../../services/note_autocomplete";
import CKEditor, { CKEditorApi } from "../../react/CKEditor";
import { useLegacyImperativeHandlers, useLegacyWidget, useTooltip, useTriliumEvent } from "../../react/hooks";
import { useLegacyImperativeHandlers, useLegacyWidget, useTooltip, useTriliumEvent, useTriliumOption } from "../../react/hooks";
import FAttribute from "../../../entities/fattribute";
import attribute_renderer from "../../../services/attribute_renderer";
import FNote from "../../../entities/fnote";
@ -100,6 +100,7 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
const currentValueRef = useRef(currentValue);
const wrapperRef = useRef<HTMLDivElement>(null);
const editorRef = useRef<CKEditorApi>();
const [ locale ] = useTriliumOption("locale");
const { showTooltip, hideTooltip } = useTooltip(wrapperRef, {
trigger: "focus",
@ -308,7 +309,8 @@ export default function AttributeEditor({ api, note, componentId, notePath, ntxI
toolbar: { items: [] },
placeholder: t("attribute_editor.placeholder"),
mention: { feeds: mentionSetup },
licenseKey: "GPL"
licenseKey: "GPL",
language: "en"
}}
onChange={(currentValue) => {
currentValueRef.current = currentValue ?? "";

View File

@ -285,6 +285,11 @@
transition: opacity .1s linear;
}
body[dir=rtl] .attribute-list-editor {
padding: 0 5px 0 100px !important;
text-align: right !important;
}
.attribute-list-editor.ck-content .mention {
color: var(--muted-text-color) !important;
background: transparent !important;