aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/frontend/src/editor
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/frontend/src/editor')
-rw-r--r--subprojects/frontend/src/editor/EditorStore.ts7
-rw-r--r--subprojects/frontend/src/editor/EditorTheme.ts4
2 files changed, 5 insertions, 6 deletions
diff --git a/subprojects/frontend/src/editor/EditorStore.ts b/subprojects/frontend/src/editor/EditorStore.ts
index 10f01099..b5989ad1 100644
--- a/subprojects/frontend/src/editor/EditorStore.ts
+++ b/subprojects/frontend/src/editor/EditorStore.ts
@@ -26,6 +26,7 @@ import { makeAutoObservable, observable, runInAction } from 'mobx';
26import { nanoid } from 'nanoid'; 26import { nanoid } from 'nanoid';
27 27
28import type PWAStore from '../PWAStore'; 28import type PWAStore from '../PWAStore';
29import GraphStore from '../graph/GraphStore';
29import getLogger from '../utils/getLogger'; 30import getLogger from '../utils/getLogger';
30import type XtextClient from '../xtext/XtextClient'; 31import type XtextClient from '../xtext/XtextClient';
31import type { SemanticsSuccessResult } from '../xtext/xtextServiceResults'; 32import type { SemanticsSuccessResult } from '../xtext/xtextServiceResults';
@@ -66,7 +67,7 @@ export default class EditorStore {
66 67
67 semanticsError: string | undefined; 68 semanticsError: string | undefined;
68 69
69 semantics: SemanticsSuccessResult | undefined; 70 graph: GraphStore;
70 71
71 constructor(initialValue: string, pwaStore: PWAStore) { 72 constructor(initialValue: string, pwaStore: PWAStore) {
72 this.id = nanoid(); 73 this.id = nanoid();
@@ -86,12 +87,12 @@ export default class EditorStore {
86 })().catch((error) => { 87 })().catch((error) => {
87 log.error('Failed to load XtextClient', error); 88 log.error('Failed to load XtextClient', error);
88 }); 89 });
90 this.graph = new GraphStore();
89 makeAutoObservable<EditorStore, 'client'>(this, { 91 makeAutoObservable<EditorStore, 'client'>(this, {
90 id: false, 92 id: false,
91 state: observable.ref, 93 state: observable.ref,
92 client: observable.ref, 94 client: observable.ref,
93 view: observable.ref, 95 view: observable.ref,
94 semantics: observable.ref,
95 searchPanel: false, 96 searchPanel: false,
96 lintPanel: false, 97 lintPanel: false,
97 contentAssist: false, 98 contentAssist: false,
@@ -298,7 +299,7 @@ export default class EditorStore {
298 299
299 setSemantics(semantics: SemanticsSuccessResult) { 300 setSemantics(semantics: SemanticsSuccessResult) {
300 this.semanticsError = undefined; 301 this.semanticsError = undefined;
301 this.semantics = semantics; 302 this.graph.setSemantics(semantics);
302 } 303 }
303 304
304 dispose(): void { 305 dispose(): void {
diff --git a/subprojects/frontend/src/editor/EditorTheme.ts b/subprojects/frontend/src/editor/EditorTheme.ts
index 4508273b..308d5be0 100644
--- a/subprojects/frontend/src/editor/EditorTheme.ts
+++ b/subprojects/frontend/src/editor/EditorTheme.ts
@@ -10,9 +10,7 @@ import infoSVG from '@material-icons/svg/svg/info/baseline.svg?raw';
10import warningSVG from '@material-icons/svg/svg/warning/baseline.svg?raw'; 10import warningSVG from '@material-icons/svg/svg/warning/baseline.svg?raw';
11import { alpha, styled, type CSSObject } from '@mui/material/styles'; 11import { alpha, styled, type CSSObject } from '@mui/material/styles';
12 12
13function svgURL(svg: string): string { 13import svgURL from '../utils/svgURL';
14 return `url('data:image/svg+xml;utf8,${svg}')`;
15}
16 14
17export default styled('div', { 15export default styled('div', {
18 name: 'EditorTheme', 16 name: 'EditorTheme',