diff options
Diffstat (limited to 'subprojects/frontend/src/editor')
-rw-r--r-- | subprojects/frontend/src/editor/EditorStore.ts | 7 | ||||
-rw-r--r-- | subprojects/frontend/src/editor/EditorTheme.ts | 4 |
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'; | |||
26 | import { nanoid } from 'nanoid'; | 26 | import { nanoid } from 'nanoid'; |
27 | 27 | ||
28 | import type PWAStore from '../PWAStore'; | 28 | import type PWAStore from '../PWAStore'; |
29 | import GraphStore from '../graph/GraphStore'; | ||
29 | import getLogger from '../utils/getLogger'; | 30 | import getLogger from '../utils/getLogger'; |
30 | import type XtextClient from '../xtext/XtextClient'; | 31 | import type XtextClient from '../xtext/XtextClient'; |
31 | import type { SemanticsSuccessResult } from '../xtext/xtextServiceResults'; | 32 | import 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'; | |||
10 | import warningSVG from '@material-icons/svg/svg/warning/baseline.svg?raw'; | 10 | import warningSVG from '@material-icons/svg/svg/warning/baseline.svg?raw'; |
11 | import { alpha, styled, type CSSObject } from '@mui/material/styles'; | 11 | import { alpha, styled, type CSSObject } from '@mui/material/styles'; |
12 | 12 | ||
13 | function svgURL(svg: string): string { | 13 | import svgURL from '../utils/svgURL'; |
14 | return `url('data:image/svg+xml;utf8,${svg}')`; | ||
15 | } | ||
16 | 14 | ||
17 | export default styled('div', { | 15 | export default styled('div', { |
18 | name: 'EditorTheme', | 16 | name: 'EditorTheme', |