diff options
author | 2022-11-22 16:35:42 +0100 | |
---|---|---|
committer | 2022-11-22 16:40:04 +0100 | |
commit | 862cb00e40aa6f094aff019a44f52ebfca90ab88 (patch) | |
tree | 3c32b6ca6612d07d3d1fcfc5620c86ba9c774b3b /subprojects/frontend/src/editor | |
parent | refactor(language): simplify syntax (diff) | |
download | refinery-862cb00e40aa6f094aff019a44f52ebfca90ab88.tar.gz refinery-862cb00e40aa6f094aff019a44f52ebfca90ab88.tar.zst refinery-862cb00e40aa6f094aff019a44f52ebfca90ab88.zip |
fix(frontend): mobx 6.7.0 typing
Also bumps some dependencies and updates tsconfig.json
The added workarounds should be remove once
https://github.com/mobxjs/mobx/issues/3582 is resolved.
Diffstat (limited to 'subprojects/frontend/src/editor')
12 files changed, 13 insertions, 13 deletions
diff --git a/subprojects/frontend/src/editor/AnimatedButton.tsx b/subprojects/frontend/src/editor/AnimatedButton.tsx index d08decbc..7f6c61f0 100644 --- a/subprojects/frontend/src/editor/AnimatedButton.tsx +++ b/subprojects/frontend/src/editor/AnimatedButton.tsx | |||
@@ -1,7 +1,7 @@ | |||
1 | import Box from '@mui/material/Box'; | 1 | import Box from '@mui/material/Box'; |
2 | import Button from '@mui/material/Button'; | 2 | import Button from '@mui/material/Button'; |
3 | import { styled } from '@mui/material/styles'; | 3 | import { styled } from '@mui/material/styles'; |
4 | import React, { type ReactNode, useLayoutEffect, useState } from 'react'; | 4 | import { type ReactNode, useLayoutEffect, useState } from 'react'; |
5 | 5 | ||
6 | const AnimatedButtonBase = styled(Button, { | 6 | const AnimatedButtonBase = styled(Button, { |
7 | shouldForwardProp: (prop) => prop !== 'width', | 7 | shouldForwardProp: (prop) => prop !== 'width', |
diff --git a/subprojects/frontend/src/editor/ConnectButton.tsx b/subprojects/frontend/src/editor/ConnectButton.tsx index 52e7b854..e2d251f3 100644 --- a/subprojects/frontend/src/editor/ConnectButton.tsx +++ b/subprojects/frontend/src/editor/ConnectButton.tsx | |||
@@ -5,7 +5,6 @@ import SyncProblemIcon from '@mui/icons-material/SyncProblem'; | |||
5 | import IconButton from '@mui/material/IconButton'; | 5 | import IconButton from '@mui/material/IconButton'; |
6 | import { keyframes, styled } from '@mui/material/styles'; | 6 | import { keyframes, styled } from '@mui/material/styles'; |
7 | import { observer } from 'mobx-react-lite'; | 7 | import { observer } from 'mobx-react-lite'; |
8 | import React from 'react'; | ||
9 | 8 | ||
10 | import type EditorStore from './EditorStore'; | 9 | import type EditorStore from './EditorStore'; |
11 | 10 | ||
diff --git a/subprojects/frontend/src/editor/ConnectionStatusNotification.tsx b/subprojects/frontend/src/editor/ConnectionStatusNotification.tsx index f7f089f0..9b27f45c 100644 --- a/subprojects/frontend/src/editor/ConnectionStatusNotification.tsx +++ b/subprojects/frontend/src/editor/ConnectionStatusNotification.tsx | |||
@@ -1,6 +1,6 @@ | |||
1 | import Button from '@mui/material/Button'; | 1 | import Button from '@mui/material/Button'; |
2 | import { observer } from 'mobx-react-lite'; | 2 | import { observer } from 'mobx-react-lite'; |
3 | import React, { useEffect } from 'react'; | 3 | import { useEffect } from 'react'; |
4 | 4 | ||
5 | import { ContrastThemeProvider } from '../theme/ThemeProvider'; | 5 | import { ContrastThemeProvider } from '../theme/ThemeProvider'; |
6 | import useDelayedSnackbar from '../utils/useDelayedSnackbar'; | 6 | import useDelayedSnackbar from '../utils/useDelayedSnackbar'; |
diff --git a/subprojects/frontend/src/editor/EditorArea.tsx b/subprojects/frontend/src/editor/EditorArea.tsx index 95f0f92e..cfb988b2 100644 --- a/subprojects/frontend/src/editor/EditorArea.tsx +++ b/subprojects/frontend/src/editor/EditorArea.tsx | |||
@@ -1,7 +1,7 @@ | |||
1 | import Box from '@mui/material/Box'; | 1 | import Box from '@mui/material/Box'; |
2 | import { useTheme } from '@mui/material/styles'; | 2 | import { useTheme } from '@mui/material/styles'; |
3 | import { observer } from 'mobx-react-lite'; | 3 | import { observer } from 'mobx-react-lite'; |
4 | import React, { useCallback, useEffect } from 'react'; | 4 | import { useCallback, useEffect } from 'react'; |
5 | 5 | ||
6 | import type EditorStore from './EditorStore'; | 6 | import type EditorStore from './EditorStore'; |
7 | import EditorTheme from './EditorTheme'; | 7 | import EditorTheme from './EditorTheme'; |
diff --git a/subprojects/frontend/src/editor/EditorButtons.tsx b/subprojects/frontend/src/editor/EditorButtons.tsx index fd046d46..53b06e23 100644 --- a/subprojects/frontend/src/editor/EditorButtons.tsx +++ b/subprojects/frontend/src/editor/EditorButtons.tsx | |||
@@ -13,7 +13,6 @@ import Stack from '@mui/material/Stack'; | |||
13 | import ToggleButton from '@mui/material/ToggleButton'; | 13 | import ToggleButton from '@mui/material/ToggleButton'; |
14 | import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'; | 14 | import ToggleButtonGroup from '@mui/material/ToggleButtonGroup'; |
15 | import { observer } from 'mobx-react-lite'; | 15 | import { observer } from 'mobx-react-lite'; |
16 | import React from 'react'; | ||
17 | 16 | ||
18 | import ConnectButton from './ConnectButton'; | 17 | import ConnectButton from './ConnectButton'; |
19 | import type EditorStore from './EditorStore'; | 18 | import type EditorStore from './EditorStore'; |
diff --git a/subprojects/frontend/src/editor/EditorPane.tsx b/subprojects/frontend/src/editor/EditorPane.tsx index 0db4b892..1d51b3f5 100644 --- a/subprojects/frontend/src/editor/EditorPane.tsx +++ b/subprojects/frontend/src/editor/EditorPane.tsx | |||
@@ -5,7 +5,7 @@ import Toolbar from '@mui/material/Toolbar'; | |||
5 | import { useTheme } from '@mui/material/styles'; | 5 | import { useTheme } from '@mui/material/styles'; |
6 | import useMediaQuery from '@mui/material/useMediaQuery'; | 6 | import useMediaQuery from '@mui/material/useMediaQuery'; |
7 | import { observer } from 'mobx-react-lite'; | 7 | import { observer } from 'mobx-react-lite'; |
8 | import React, { useState } from 'react'; | 8 | import { useState } from 'react'; |
9 | 9 | ||
10 | import { useRootStore } from '../RootStoreProvider'; | 10 | import { useRootStore } from '../RootStoreProvider'; |
11 | 11 | ||
diff --git a/subprojects/frontend/src/editor/EditorStore.ts b/subprojects/frontend/src/editor/EditorStore.ts index acad3d09..d966690c 100644 --- a/subprojects/frontend/src/editor/EditorStore.ts +++ b/subprojects/frontend/src/editor/EditorStore.ts | |||
@@ -1,4 +1,7 @@ | |||
1 | import { CompletionContext, CompletionResult } from '@codemirror/autocomplete'; | 1 | import type { |
2 | CompletionContext, | ||
3 | CompletionResult, | ||
4 | } from '@codemirror/autocomplete'; | ||
2 | import { redo, redoDepth, undo, undoDepth } from '@codemirror/commands'; | 5 | import { redo, redoDepth, undo, undoDepth } from '@codemirror/commands'; |
3 | import { | 6 | import { |
4 | type Diagnostic, | 7 | type Diagnostic, |
diff --git a/subprojects/frontend/src/editor/GenerateButton.tsx b/subprojects/frontend/src/editor/GenerateButton.tsx index 8b6ae660..1a32f5ce 100644 --- a/subprojects/frontend/src/editor/GenerateButton.tsx +++ b/subprojects/frontend/src/editor/GenerateButton.tsx | |||
@@ -2,7 +2,6 @@ import DangerousOutlinedIcon from '@mui/icons-material/DangerousOutlined'; | |||
2 | import PlayArrowIcon from '@mui/icons-material/PlayArrow'; | 2 | import PlayArrowIcon from '@mui/icons-material/PlayArrow'; |
3 | import Button from '@mui/material/Button'; | 3 | import Button from '@mui/material/Button'; |
4 | import { observer } from 'mobx-react-lite'; | 4 | import { observer } from 'mobx-react-lite'; |
5 | import React from 'react'; | ||
6 | 5 | ||
7 | import AnimatedButton from './AnimatedButton'; | 6 | import AnimatedButton from './AnimatedButton'; |
8 | import type EditorStore from './EditorStore'; | 7 | import type EditorStore from './EditorStore'; |
diff --git a/subprojects/frontend/src/editor/SearchPanelPortal.tsx b/subprojects/frontend/src/editor/SearchPanelPortal.tsx index b6b375e3..5cf1c90e 100644 --- a/subprojects/frontend/src/editor/SearchPanelPortal.tsx +++ b/subprojects/frontend/src/editor/SearchPanelPortal.tsx | |||
@@ -1,6 +1,5 @@ | |||
1 | import Portal from '@mui/material/Portal'; | 1 | import Portal from '@mui/material/Portal'; |
2 | import { observer } from 'mobx-react-lite'; | 2 | import { observer } from 'mobx-react-lite'; |
3 | import React from 'react'; | ||
4 | 3 | ||
5 | import type EditorStore from './EditorStore'; | 4 | import type EditorStore from './EditorStore'; |
6 | import SearchToolbar from './SearchToolbar'; | 5 | import SearchToolbar from './SearchToolbar'; |
diff --git a/subprojects/frontend/src/editor/SearchToolbar.tsx b/subprojects/frontend/src/editor/SearchToolbar.tsx index a9b9811d..54f3dba7 100644 --- a/subprojects/frontend/src/editor/SearchToolbar.tsx +++ b/subprojects/frontend/src/editor/SearchToolbar.tsx | |||
@@ -14,7 +14,7 @@ import Toolbar from '@mui/material/Toolbar'; | |||
14 | import { styled } from '@mui/material/styles'; | 14 | import { styled } from '@mui/material/styles'; |
15 | import useMediaQuery from '@mui/material/useMediaQuery'; | 15 | import useMediaQuery from '@mui/material/useMediaQuery'; |
16 | import { observer } from 'mobx-react-lite'; | 16 | import { observer } from 'mobx-react-lite'; |
17 | import React, { useCallback, useState } from 'react'; | 17 | import { useCallback, useState } from 'react'; |
18 | 18 | ||
19 | import type SearchPanelStore from './SearchPanelStore'; | 19 | import type SearchPanelStore from './SearchPanelStore'; |
20 | 20 | ||
diff --git a/subprojects/frontend/src/editor/indentationMarkerViewPlugin.ts b/subprojects/frontend/src/editor/indentationMarkerViewPlugin.ts index 96be0eea..d5ad536b 100644 --- a/subprojects/frontend/src/editor/indentationMarkerViewPlugin.ts +++ b/subprojects/frontend/src/editor/indentationMarkerViewPlugin.ts | |||
@@ -91,7 +91,7 @@ function getNumIndentMarkersForNonEmptyLine( | |||
91 | ) { | 91 | ) { |
92 | let numIndents = 0; | 92 | let numIndents = 0; |
93 | let numConsecutiveSpaces = 0; | 93 | let numConsecutiveSpaces = 0; |
94 | let prevChar: string | null = null; | 94 | let prevChar: string | undefined; |
95 | 95 | ||
96 | for (let char = 0; char < text.length; char += 1) { | 96 | for (let char = 0; char < text.length; char += 1) { |
97 | // Bail if we encounter a non-whitespace character | 97 | // Bail if we encounter a non-whitespace character |
diff --git a/subprojects/frontend/src/editor/scrollbarViewPlugin.ts b/subprojects/frontend/src/editor/scrollbarViewPlugin.ts index c95e581d..0edaeb70 100644 --- a/subprojects/frontend/src/editor/scrollbarViewPlugin.ts +++ b/subprojects/frontend/src/editor/scrollbarViewPlugin.ts | |||
@@ -128,10 +128,11 @@ export default function scrollbarViewPlugin( | |||
128 | Math.max(1, endLine - startLine) * lineHeight, | 128 | Math.max(1, endLine - startLine) * lineHeight, |
129 | ); | 129 | ); |
130 | 130 | ||
131 | let annotation: HTMLDivElement; | 131 | let annotation: HTMLDivElement | undefined; |
132 | if (i < annotations.length) { | 132 | if (i < annotations.length) { |
133 | annotation = annotations[i]; | 133 | annotation = annotations[i]; |
134 | } else { | 134 | } |
135 | if (annotation === undefined) { | ||
135 | annotation = ownerDocument.createElement('div'); | 136 | annotation = ownerDocument.createElement('div'); |
136 | annotations.push(annotation); | 137 | annotations.push(annotation); |
137 | holder.appendChild(annotation); | 138 | holder.appendChild(annotation); |