diff options
author | Kristóf Marussy <marussy@mit.bme.hu> | 2023-03-31 17:31:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-31 17:31:46 +0200 |
commit | 93f1d439f33a5139039fe93280bbfcae61a904ab (patch) | |
tree | e98eae681a866d2d0cd728885ed6c8f8fa65e9a2 /subprojects/frontend | |
parent | refactor: PartialInterpretation adapter naming (diff) | |
parent | build: try to fix secret detection in workflow (diff) | |
download | refinery-93f1d439f33a5139039fe93280bbfcae61a904ab.tar.gz refinery-93f1d439f33a5139039fe93280bbfcae61a904ab.tar.zst refinery-93f1d439f33a5139039fe93280bbfcae61a904ab.zip |
Merge pull request #24 from kris7t/partial-interpretation
Changes for supporting partial interpretation
Diffstat (limited to 'subprojects/frontend')
-rw-r--r-- | subprojects/frontend/package.json | 68 | ||||
-rw-r--r-- | subprojects/frontend/src/Refinery.tsx | 1 | ||||
-rw-r--r-- | subprojects/frontend/src/UpdateNotification.tsx | 4 | ||||
-rw-r--r-- | subprojects/frontend/src/editor/scrollbarViewPlugin.ts | 1 | ||||
-rw-r--r-- | subprojects/frontend/src/theme/ThemeProvider.tsx | 8 | ||||
-rw-r--r-- | subprojects/frontend/src/utils/PendingTask.ts | 1 | ||||
-rw-r--r-- | subprojects/frontend/src/utils/useDelayedSnackbar.ts | 1 | ||||
-rw-r--r-- | subprojects/frontend/src/xtext/webSocketMachine.ts | 11 | ||||
-rw-r--r-- | subprojects/frontend/tsconfig.base.json | 5 |
9 files changed, 49 insertions, 51 deletions
diff --git a/subprojects/frontend/package.json b/subprojects/frontend/package.json index a9153cd4..a761e74c 100644 --- a/subprojects/frontend/package.json +++ b/subprojects/frontend/package.json | |||
@@ -2,6 +2,7 @@ | |||
2 | "name": "@refinery/frontend", | 2 | "name": "@refinery/frontend", |
3 | "version": "0.0.0", | 3 | "version": "0.0.0", |
4 | "description": "Web frontend for Refinery", | 4 | "description": "Web frontend for Refinery", |
5 | "type": "module", | ||
5 | "private": true, | 6 | "private": true, |
6 | "scripts": { | 7 | "scripts": { |
7 | "build": "cross-env MODE=production vite build", | 8 | "build": "cross-env MODE=production vite build", |
@@ -23,60 +24,61 @@ | |||
23 | }, | 24 | }, |
24 | "homepage": "https://refinery.tools", | 25 | "homepage": "https://refinery.tools", |
25 | "dependencies": { | 26 | "dependencies": { |
26 | "@codemirror/autocomplete": "^6.4.0", | 27 | "@codemirror/autocomplete": "^6.4.2", |
27 | "@codemirror/commands": "^6.2.0", | 28 | "@codemirror/commands": "^6.2.2", |
28 | "@codemirror/language": "^6.4.0", | 29 | "@codemirror/language": "^6.6.0", |
29 | "@codemirror/lint": "^6.1.0", | 30 | "@codemirror/lint": "^6.2.0", |
30 | "@codemirror/search": "^6.2.3", | 31 | "@codemirror/search": "^6.3.0", |
31 | "@codemirror/state": "^6.2.0", | 32 | "@codemirror/state": "^6.2.0", |
32 | "@codemirror/view": "^6.7.3", | 33 | "@codemirror/view": "^6.9.3", |
33 | "@emotion/react": "^11.10.5", | 34 | "@emotion/react": "^11.10.6", |
34 | "@emotion/styled": "^11.10.5", | 35 | "@emotion/styled": "^11.10.6", |
35 | "@fontsource/inter": "^4.5.15", | 36 | "@fontsource/inter": "^4.5.15", |
36 | "@fontsource/jetbrains-mono": "^4.5.12", | 37 | "@fontsource/jetbrains-mono": "^4.5.12", |
37 | "@lezer/common": "^1.0.2", | 38 | "@lezer/common": "^1.0.2", |
38 | "@lezer/highlight": "^1.1.3", | 39 | "@lezer/highlight": "^1.1.4", |
39 | "@lezer/lr": "^1.3.3", | 40 | "@lezer/lr": "^1.3.3", |
40 | "@material-icons/svg": "^1.0.33", | 41 | "@material-icons/svg": "^1.0.33", |
41 | "@mui/icons-material": "5.11.0", | 42 | "@mui/icons-material": "5.11.11", |
42 | "@mui/material": "5.11.7", | 43 | "@mui/material": "5.11.15", |
43 | "@vitejs/plugin-react-swc": "^3.1.0", | 44 | "@vitejs/plugin-react-swc": "^3.2.0", |
44 | "ansi-styles": "^6.2.1", | 45 | "ansi-styles": "^6.2.1", |
46 | "csstype": "^3.1.1", | ||
45 | "escape-string-regexp": "^5.0.0", | 47 | "escape-string-regexp": "^5.0.0", |
46 | "lodash-es": "^4.17.21", | 48 | "lodash-es": "^4.17.21", |
47 | "loglevel": "^1.8.1", | 49 | "loglevel": "^1.8.1", |
48 | "loglevel-plugin-prefix": "^0.8.4", | 50 | "loglevel-plugin-prefix": "^0.8.4", |
49 | "mobx": "^6.7.0", | 51 | "mobx": "^6.9.0", |
50 | "mobx-react-lite": "^3.4.0", | 52 | "mobx-react-lite": "^3.4.3", |
51 | "ms": "^2.1.3", | 53 | "ms": "^2.1.3", |
52 | "nanoid": "^4.0.0", | 54 | "nanoid": "^4.0.2", |
53 | "notistack": "^2.0.8", | 55 | "notistack": "^3.0.1", |
54 | "react": "^18.2.0", | 56 | "react": "^18.2.0", |
55 | "react-dom": "^18.2.0", | 57 | "react-dom": "^18.2.0", |
56 | "xstate": "^4.35.4", | 58 | "xstate": "^4.37.1", |
57 | "zod": "^3.20.2" | 59 | "zod": "^3.21.4" |
58 | }, | 60 | }, |
59 | "devDependencies": { | 61 | "devDependencies": { |
60 | "@lezer/generator": "^1.2.2", | 62 | "@lezer/generator": "^1.2.2", |
61 | "@tsconfig/node18-strictest-esm": "^1.0.1", | 63 | "@tsconfig/strictest": "^2.0.0", |
62 | "@types/eslint": "^8.21.0", | 64 | "@types/eslint": "^8.37.0", |
63 | "@types/html-minifier-terser": "^7.0.0", | 65 | "@types/html-minifier-terser": "^7.0.0", |
64 | "@types/lodash-es": "^4.17.6", | 66 | "@types/lodash-es": "^4.17.7", |
65 | "@types/micromatch": "^4.0.2", | 67 | "@types/micromatch": "^4.0.2", |
66 | "@types/ms": "^0.7.31", | 68 | "@types/ms": "^0.7.31", |
67 | "@types/node": "^18.11.18", | 69 | "@types/node": "^18.15.11", |
68 | "@types/prettier": "^2.7.2", | 70 | "@types/prettier": "^2.7.2", |
69 | "@types/react": "^18.0.27", | 71 | "@types/react": "^18.0.31", |
70 | "@types/react-dom": "^18.0.10", | 72 | "@types/react-dom": "^18.0.11", |
71 | "@typescript-eslint/eslint-plugin": "^5.50.0", | 73 | "@typescript-eslint/eslint-plugin": "^5.57.0", |
72 | "@typescript-eslint/parser": "^5.50.0", | 74 | "@typescript-eslint/parser": "^5.57.0", |
73 | "@xstate/cli": "^0.4.2", | 75 | "@xstate/cli": "^0.4.2", |
74 | "cross-env": "^7.0.3", | 76 | "cross-env": "^7.0.3", |
75 | "eslint": "^8.33.0", | 77 | "eslint": "^8.37.0", |
76 | "eslint-config-airbnb": "^19.0.4", | 78 | "eslint-config-airbnb": "^19.0.4", |
77 | "eslint-config-airbnb-typescript": "^17.0.0", | 79 | "eslint-config-airbnb-typescript": "^17.0.0", |
78 | "eslint-config-prettier": "^8.6.0", | 80 | "eslint-config-prettier": "^8.8.0", |
79 | "eslint-import-resolver-typescript": "^3.5.3", | 81 | "eslint-import-resolver-typescript": "^3.5.4", |
80 | "eslint-plugin-import": "^2.27.5", | 82 | "eslint-plugin-import": "^2.27.5", |
81 | "eslint-plugin-jsx-a11y": "^6.7.1", | 83 | "eslint-plugin-jsx-a11y": "^6.7.1", |
82 | "eslint-plugin-mobx": "^0.0.9", | 84 | "eslint-plugin-mobx": "^0.0.9", |
@@ -85,10 +87,10 @@ | |||
85 | "eslint-plugin-react-hooks": "^4.6.0", | 87 | "eslint-plugin-react-hooks": "^4.6.0", |
86 | "html-minifier-terser": "^7.1.0", | 88 | "html-minifier-terser": "^7.1.0", |
87 | "micromatch": "^4.0.5", | 89 | "micromatch": "^4.0.5", |
88 | "prettier": "^2.8.3", | 90 | "prettier": "^2.8.7", |
89 | "typescript": "4.9.5", | 91 | "typescript": "5.0.3", |
90 | "vite": "^4.1.1", | 92 | "vite": "^4.2.1", |
91 | "vite-plugin-pwa": "^0.14.1", | 93 | "vite-plugin-pwa": "^0.14.7", |
92 | "workbox-window": "^6.5.4" | 94 | "workbox-window": "^6.5.4" |
93 | } | 95 | } |
94 | } | 96 | } |
diff --git a/subprojects/frontend/src/Refinery.tsx b/subprojects/frontend/src/Refinery.tsx index 93a82ee1..f0162349 100644 --- a/subprojects/frontend/src/Refinery.tsx +++ b/subprojects/frontend/src/Refinery.tsx | |||
@@ -8,7 +8,6 @@ import EditorPane from './editor/EditorPane'; | |||
8 | 8 | ||
9 | export default function Refinery(): JSX.Element { | 9 | export default function Refinery(): JSX.Element { |
10 | return ( | 10 | return ( |
11 | // @ts-expect-error -- notistack has problems with `exactOptionalPropertyTypes | ||
12 | <SnackbarProvider TransitionComponent={Grow}> | 11 | <SnackbarProvider TransitionComponent={Grow}> |
13 | <UpdateNotification /> | 12 | <UpdateNotification /> |
14 | <Stack direction="column" height="100%" overflow="auto"> | 13 | <Stack direction="column" height="100%" overflow="auto"> |
diff --git a/subprojects/frontend/src/UpdateNotification.tsx b/subprojects/frontend/src/UpdateNotification.tsx index 07f7f5f7..5c8c2d01 100644 --- a/subprojects/frontend/src/UpdateNotification.tsx +++ b/subprojects/frontend/src/UpdateNotification.tsx | |||
@@ -32,14 +32,14 @@ export default observer(function UpdateNotification(): null { | |||
32 | return enqueueLater('Failed to download update', { | 32 | return enqueueLater('Failed to download update', { |
33 | variant: 'error', | 33 | variant: 'error', |
34 | action: ( | 34 | action: ( |
35 | <> | 35 | <ContrastThemeProvider> |
36 | <Button color="inherit" onClick={() => pwaStore.checkForUpdates()}> | 36 | <Button color="inherit" onClick={() => pwaStore.checkForUpdates()}> |
37 | Try again | 37 | Try again |
38 | </Button> | 38 | </Button> |
39 | <Button color="inherit" onClick={() => pwaStore.dismissError()}> | 39 | <Button color="inherit" onClick={() => pwaStore.dismissError()}> |
40 | Dismiss | 40 | Dismiss |
41 | </Button> | 41 | </Button> |
42 | </> | 42 | </ContrastThemeProvider> |
43 | ), | 43 | ), |
44 | }); | 44 | }); |
45 | } | 45 | } |
diff --git a/subprojects/frontend/src/editor/scrollbarViewPlugin.ts b/subprojects/frontend/src/editor/scrollbarViewPlugin.ts index f54251a9..f44034fd 100644 --- a/subprojects/frontend/src/editor/scrollbarViewPlugin.ts +++ b/subprojects/frontend/src/editor/scrollbarViewPlugin.ts | |||
@@ -266,7 +266,6 @@ export default function scrollbarViewPlugin( | |||
266 | if (firstRunTimeout !== undefined) { | 266 | if (firstRunTimeout !== undefined) { |
267 | clearTimeout(firstRunTimeout); | 267 | clearTimeout(firstRunTimeout); |
268 | } | 268 | } |
269 | // @ts-expect-error `@types/node` typings should not be in effect here. | ||
270 | firstRunTimeout = setTimeout(() => { | 269 | firstRunTimeout = setTimeout(() => { |
271 | spacer.style.minHeight = `${scrollHeight}px`; | 270 | spacer.style.minHeight = `${scrollHeight}px`; |
272 | firstRun = false; | 271 | firstRun = false; |
diff --git a/subprojects/frontend/src/theme/ThemeProvider.tsx b/subprojects/frontend/src/theme/ThemeProvider.tsx index 7bda1ede..ff97d524 100644 --- a/subprojects/frontend/src/theme/ThemeProvider.tsx +++ b/subprojects/frontend/src/theme/ThemeProvider.tsx | |||
@@ -6,7 +6,6 @@ import { | |||
6 | type ThemeOptions, | 6 | type ThemeOptions, |
7 | ThemeProvider as MaterialUiThemeProvider, | 7 | ThemeProvider as MaterialUiThemeProvider, |
8 | type TypographyStyle, | 8 | type TypographyStyle, |
9 | useTheme, | ||
10 | type CSSObject, | 9 | type CSSObject, |
11 | } from '@mui/material/styles'; | 10 | } from '@mui/material/styles'; |
12 | import { observer } from 'mobx-react-lite'; | 11 | import { observer } from 'mobx-react-lite'; |
@@ -350,15 +349,14 @@ export function ContrastThemeProvider({ | |||
350 | }: { | 349 | }: { |
351 | children?: ReactNode; | 350 | children?: ReactNode; |
352 | }): JSX.Element { | 351 | }): JSX.Element { |
353 | const theme = useTheme(); | ||
354 | const contrastTheme = useContext(ContrastThemeContext); | 352 | const contrastTheme = useContext(ContrastThemeContext); |
355 | if (!contrastTheme) { | 353 | if (!contrastTheme) { |
356 | throw new Error('ContrastThemeProvider must be used within ThemeProvider'); | 354 | throw new Error('ContrastThemeProvider must be used within ThemeProvider'); |
357 | } | 355 | } |
358 | return ( | 356 | return ( |
359 | <ThemeAndContrastThemeProvider theme={contrastTheme} contrastTheme={theme}> | 357 | <MaterialUiThemeProvider theme={contrastTheme}> |
360 | {children} | 358 | {children} |
361 | </ThemeAndContrastThemeProvider> | 359 | </MaterialUiThemeProvider> |
362 | ); | 360 | ); |
363 | } | 361 | } |
364 | 362 | ||
@@ -378,7 +376,7 @@ const ThemeProvider = observer(function ThemeProvider({ | |||
378 | return ( | 376 | return ( |
379 | <ThemeAndContrastThemeProvider | 377 | <ThemeAndContrastThemeProvider |
380 | theme={darkMode ? darkTheme : lightTheme} | 378 | theme={darkMode ? darkTheme : lightTheme} |
381 | contrastTheme={darkMode ? lightTheme : darkTheme} | 379 | contrastTheme={darkTheme} |
382 | > | 380 | > |
383 | {children} | 381 | {children} |
384 | </ThemeAndContrastThemeProvider> | 382 | </ThemeAndContrastThemeProvider> |
diff --git a/subprojects/frontend/src/utils/PendingTask.ts b/subprojects/frontend/src/utils/PendingTask.ts index fd52cef1..d0b24c1f 100644 --- a/subprojects/frontend/src/utils/PendingTask.ts +++ b/subprojects/frontend/src/utils/PendingTask.ts | |||
@@ -20,7 +20,6 @@ export default class PendingTask<T> { | |||
20 | ) { | 20 | ) { |
21 | this.resolveCallback = resolveCallback; | 21 | this.resolveCallback = resolveCallback; |
22 | this.rejectCallback = rejectCallback; | 22 | this.rejectCallback = rejectCallback; |
23 | // @ts-expect-error See https://github.com/mobxjs/mobx/issues/3582 on `@types/node` pollution | ||
24 | this.timeout = setTimeout(() => { | 23 | this.timeout = setTimeout(() => { |
25 | if (!this.resolved) { | 24 | if (!this.resolved) { |
26 | this.reject(new TimeoutError()); | 25 | this.reject(new TimeoutError()); |
diff --git a/subprojects/frontend/src/utils/useDelayedSnackbar.ts b/subprojects/frontend/src/utils/useDelayedSnackbar.ts index 54716c0c..03ad6caa 100644 --- a/subprojects/frontend/src/utils/useDelayedSnackbar.ts +++ b/subprojects/frontend/src/utils/useDelayedSnackbar.ts | |||
@@ -21,7 +21,6 @@ export default function useDelayedSnackbar( | |||
21 | delay = defaultDelay, | 21 | delay = defaultDelay, |
22 | ) => { | 22 | ) => { |
23 | let key: SnackbarKey | undefined; | 23 | let key: SnackbarKey | undefined; |
24 | // @ts-expect-error See https://github.com/mobxjs/mobx/issues/3582 on `@types/node` pollution | ||
25 | let timeout: number | undefined = setTimeout(() => { | 24 | let timeout: number | undefined = setTimeout(() => { |
26 | timeout = undefined; | 25 | timeout = undefined; |
27 | key = enqueueSnackbar(message, options); | 26 | key = enqueueSnackbar(message, options); |
diff --git a/subprojects/frontend/src/xtext/webSocketMachine.ts b/subprojects/frontend/src/xtext/webSocketMachine.ts index 216ed86a..fc53fef3 100644 --- a/subprojects/frontend/src/xtext/webSocketMachine.ts +++ b/subprojects/frontend/src/xtext/webSocketMachine.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import ms from 'ms'; | 1 | import ms from 'ms'; |
2 | import { actions, assign, createMachine, RaiseAction } from 'xstate'; | 2 | import { actions, assign, createMachine } from 'xstate'; |
3 | 3 | ||
4 | const { raise } = actions; | 4 | const { raise } = actions; |
5 | 5 | ||
@@ -217,16 +217,15 @@ export default createMachine( | |||
217 | ...context, | 217 | ...context, |
218 | errors: [], | 218 | errors: [], |
219 | })), | 219 | })), |
220 | // Workaround from https://github.com/statelyai/xstate/issues/1414#issuecomment-699972485 | ||
221 | raiseTimeoutError: raise({ | 220 | raiseTimeoutError: raise({ |
222 | type: 'ERROR', | 221 | type: 'ERROR', |
223 | message: 'Open timeout', | 222 | message: 'Open timeout', |
224 | }) as RaiseAction<WebSocketEvent>, | 223 | }), |
225 | raisePromiseRejectionError: (_context, { data }) => | 224 | raisePromiseRejectionError: (_context, { data }) => |
226 | raise({ | 225 | raise<WebSocketContext, WebSocketEvent>({ |
227 | type: 'ERROR', | 226 | type: 'ERROR', |
228 | message: data, | 227 | message: String(data), |
229 | }) as RaiseAction<WebSocketEvent>, | 228 | }), |
230 | }, | 229 | }, |
231 | }, | 230 | }, |
232 | ); | 231 | ); |
diff --git a/subprojects/frontend/tsconfig.base.json b/subprojects/frontend/tsconfig.base.json index 585866f1..b960e93c 100644 --- a/subprojects/frontend/tsconfig.base.json +++ b/subprojects/frontend/tsconfig.base.json | |||
@@ -1,7 +1,10 @@ | |||
1 | { | 1 | { |
2 | "extends": "@tsconfig/node18-strictest-esm/tsconfig.json", | 2 | "extends": "@tsconfig/strictest", |
3 | "compilerOptions": { | 3 | "compilerOptions": { |
4 | "useDefineForClassFields": true, | 4 | "useDefineForClassFields": true, |
5 | "verbatimModuleSyntax": false, | ||
5 | "isolatedModules": true, | 6 | "isolatedModules": true, |
7 | "module": "es2022", | ||
8 | "moduleResolution": "node" | ||
6 | } | 9 | } |
7 | } | 10 | } |