diff --git a/apps/client/src/widgets/sidebar/HighlightsList.tsx b/apps/client/src/widgets/sidebar/HighlightsList.tsx index 95ecea6d4..6f09ddd03 100644 --- a/apps/client/src/widgets/sidebar/HighlightsList.tsx +++ b/apps/client/src/widgets/sidebar/HighlightsList.tsx @@ -8,7 +8,13 @@ import RightPanelWidget from "./RightPanelWidget"; interface RawHighlight { id: string; text: string; - attrs: Record; + attrs: { + bold: boolean; + italic: boolean; + underline: boolean; + color: string | undefined; + background: string | undefined; + } } export default function HighlightsList() { @@ -33,7 +39,15 @@ function AbstractHighlightsList({ highlights, scrollToHi
    {highlights.map(highlight => (
  1. scrollToHighlight(highlight)}> - {highlight.text} + {highlight.text}
  2. ))}
@@ -116,12 +130,12 @@ function extractHighlightsFromTextEditor(editor: CKTextEditor) { for (const { item } of editor.model.createRangeIn(root).getWalker({ ignoreElementEnd: true })) { if (!item.is('$textProxy')) continue; - const attrs = { + const attrs: RawHighlight["attrs"] = { bold: item.hasAttribute('bold'), italic: item.hasAttribute('italic'), underline: item.hasAttribute('underline'), - color: item.getAttribute('fontColor'), - background: item.getAttribute('fontBackgroundColor') + color: item.getAttribute('fontColor') as string | undefined, + background: item.getAttribute('fontBackgroundColor') as string | undefined }; if (Object.values(attrs).some(Boolean)) {