Skip to content

Commit 6bf06ab

Browse files
committed
Upgrade dependencies
1 parent 8936a95 commit 6bf06ab

File tree

6 files changed

+3384
-2833
lines changed

6 files changed

+3384
-2833
lines changed

.prettierrc

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"singleQuote": true,
66
"trailingComma": "es5",
77
"arrowParens": "avoid",
8-
"quoteProps": "consistent"
9-
}
8+
"quoteProps": "consistent",
9+
"plugins": ["prettier-plugin-organize-imports"]
10+
}

package.json

+11-10
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,30 @@
77
"copy-to-clipboard": "^3.3.3",
88
"history": "^5.3.0",
99
"local-storage": "^2.0.0",
10-
"monaco-editor": "^0.51.0",
10+
"monaco-editor": "^0.52.0",
1111
"monaco-themes": "^0.4.4",
1212
"pako": "^2.1.0",
13-
"react": "^18.2.0",
13+
"react": "^19.0.0",
1414
"react-device-detect": "^2.2.3",
15-
"react-dom": "^18.2.0",
15+
"react-dom": "^19.0.0",
1616
"react-scripts": "^5.0.1",
17-
"styled-components": "^6.1.1",
18-
"typescript": "^4.4.2",
17+
"styled-components": "^6.1.13",
18+
"typescript": "^5.7.2",
1919
"whatwg-mimetype": "^3.0.0"
2020
},
2121
"devDependencies": {
22+
"@testing-library/dom": "^10.4.0",
2223
"@testing-library/jest-dom": "^5.14.1",
23-
"@testing-library/react": "^13.0.0",
24+
"@testing-library/react": "^16.1.0",
2425
"@testing-library/user-event": "^13.2.1",
2526
"@types/jest": "^27.0.1",
2627
"@types/node": "^18.11.9",
2728
"@types/pako": "^2.0.3",
28-
"@types/react": "^18.2.0",
29-
"@types/react-dom": "^18.2.0",
29+
"@types/react": "^19.0.0",
30+
"@types/react-dom": "^19.0.0",
3031
"@types/whatwg-mimetype": "^3.0.2",
31-
"prettier": "^3.1.0",
32-
"prettier-plugin-organize-imports": "^3.2.4"
32+
"prettier": "^3.4.2",
33+
"prettier-plugin-organize-imports": "^4.1.0"
3334
},
3435
"scripts": {
3536
"start": "react-scripts start",

src/components/Editor.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function Editor({
2727
}: EditorProps) {
2828
const [language, setLanguage] = useState<string>('plain');
2929
const [readOnly, setReadOnly] = useState<boolean>(isMobile && !!pasteId);
30-
const resetFunction = useRef<ResetFunction>();
30+
const resetFunction = useRef<ResetFunction>(null);
3131

3232
const [theme, setTheme] = usePreference<keyof Themes>(
3333
'theme',

src/components/EditorControls.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import copy from 'copy-to-clipboard';
22
import history from 'history/browser';
3-
import { MutableRefObject, useCallback, useEffect, useState } from 'react';
3+
import { RefObject, useCallback, useEffect, useState } from 'react';
44
import styled from 'styled-components';
55

66
import themes, { Themes } from '../style/themes';
@@ -12,7 +12,7 @@ import MenuButton from './MenuButton';
1212

1313
export interface EditorControlsProps {
1414
actualContent: string;
15-
resetFunction: MutableRefObject<ResetFunction | undefined>;
15+
resetFunction: RefObject<ResetFunction | null>;
1616
language: string;
1717
setLanguage: (value: string) => void;
1818
readOnly: boolean;

src/components/EditorTextArea.tsx

+6-12
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,17 @@ import Editor, {
55
OnMount,
66
} from '@monaco-editor/react';
77
import history from 'history/browser';
8-
import React, {
9-
MutableRefObject,
10-
useCallback,
11-
useEffect,
12-
useRef,
13-
useState,
14-
} from 'react';
8+
import { RefObject, useCallback, useEffect, useRef, useState } from 'react';
159
import styled from 'styled-components';
1610
import themes, { Theme } from '../style/themes';
1711

1812
import type { editor } from 'monaco-editor';
19-
import { ResetFunction } from './Editor';
20-
import { logLanguage } from '../util/languages/log';
2113
import { diffLanguage } from '../util/languages/diff';
14+
import { logLanguage } from '../util/languages/log';
15+
import { ResetFunction } from './Editor';
2216

23-
import * as monaco from 'monaco-editor';
2417
import { loader } from '@monaco-editor/react';
18+
import * as monaco from 'monaco-editor';
2519

2620
loader.config({ monaco });
2721

@@ -33,7 +27,7 @@ export interface EditorTextAreaProps {
3327
language: string;
3428
fontSize: number;
3529
readOnly: boolean;
36-
resetFunction: MutableRefObject<ResetFunction | undefined>;
30+
resetFunction: RefObject<ResetFunction | null>;
3731
}
3832

3933
export default function EditorTextArea({
@@ -254,7 +248,7 @@ function useSelectedLine(): [SelectedLine, ToggleSelectedFunction] {
254248
}
255249

256250
function useLineNumberMagic(
257-
editorAreaRef: React.RefObject<HTMLDivElement>,
251+
editorAreaRef: RefObject<HTMLDivElement | null>,
258252
selected: SelectedLine,
259253
toggleSelected: ToggleSelectedFunction,
260254
forcedContent: string,

0 commit comments

Comments
 (0)