Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ $restoreActionColor: #5485e7;

.sample-text {
white-space: nowrap;
font-family: var(--project-font);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { BehaviorSubject, of } from 'rxjs';
import { anything, deepEqual, instance, mock, verify, when } from 'ts-mockito';
import { ActivatedBookChapterService, RouteBookChapter } from 'xforge-common/activated-book-chapter.service';
import { ActivatedProjectService } from 'xforge-common/activated-project.service';
import { FontService } from 'xforge-common/font.service';
import { I18nService } from 'xforge-common/i18n.service';
import { IncludesPipe } from 'xforge-common/includes.pipe';
import { configureTestingModule, getTestTranslocoModule } from 'xforge-common/test-utils';
Expand All @@ -43,6 +44,7 @@ const mockRouter = mock<Router>();
const mockI18nService = mock<I18nService>();
const mockEditorSegmentService = mock<EditorSegmentService>();
const mockTextDoc = mock<TextDoc>();
const mockFontService = mock(FontService);

const OPTIMIZATION_THRESHOLD = 50;

Expand Down Expand Up @@ -132,6 +134,7 @@ describe('LynxInsightsPanelComponent', () => {
{ provide: Router, useMock: mockRouter },
{ provide: I18nService, useMock: mockI18nService },
{ provide: EditorSegmentService, useMock: mockEditorSegmentService },
{ provide: FontService, useMock: mockFontService },
{
provide: EDITOR_INSIGHT_DEFAULTS,
useValue: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NgClass } from '@angular/common';
import { AfterViewInit, Component, DestroyRef, Inject, ViewChild } from '@angular/core';
import { AfterViewInit, Component, DestroyRef, HostBinding, Inject, ViewChild } from '@angular/core';
import { MatButton } from '@angular/material/button';
import { MatRipple } from '@angular/material/core';
import { MatIcon } from '@angular/material/icon';
Expand All @@ -23,6 +23,7 @@ import { DeltaOperation } from 'rich-text';
import { asapScheduler, combineLatest, debounceTime, map, tap } from 'rxjs';
import { ActivatedBookChapterService, RouteBookChapter } from 'xforge-common/activated-book-chapter.service';
import { ActivatedProjectService } from 'xforge-common/activated-project.service';
import { FontService } from 'xforge-common/font.service';
import { I18nService } from 'xforge-common/i18n.service';
import { quietTakeUntilDestroyed } from 'xforge-common/util/rxjs-util';
import { isWhitespace } from 'xforge-common/util/string-util';
Expand Down Expand Up @@ -90,6 +91,10 @@ interface LynxInsightWithText extends LynxInsight {
})
export class LynxInsightsPanelComponent implements AfterViewInit {
@ViewChild(MatTree) tree?: MatTree<InsightPanelNode>;
@HostBinding('style.--project-font')
get projectFont(): string | null {
return this.fontService.getFontFamilyFromProject(this.activatedProject.projectDoc);
}

treeDataSource: InsightPanelNode[] = [];

Expand Down Expand Up @@ -152,6 +157,7 @@ export class LynxInsightsPanelComponent implements AfterViewInit {
private readonly activatedBookChapterService: ActivatedBookChapterService,
private readonly editorSegmentService: EditorSegmentService,
private readonly projectService: SFProjectService,
private readonly fontService: FontService,
private readonly router: Router,
readonly i18n: I18nService,
@Inject(EDITOR_INSIGHT_DEFAULTS) readonly lynxInsightConfig: LynxInsightConfig
Expand Down
Loading