Upgrade dependencies

This commit is contained in:
Luck
2024-12-08 22:11:46 +00:00
parent 8936a95ef9
commit 6bf06ab651
6 changed files with 3349 additions and 2798 deletions

View File

@@ -27,7 +27,7 @@ export default function Editor({
}: EditorProps) {
const [language, setLanguage] = useState<string>('plain');
const [readOnly, setReadOnly] = useState<boolean>(isMobile && !!pasteId);
const resetFunction = useRef<ResetFunction>();
const resetFunction = useRef<ResetFunction>(null);
const [theme, setTheme] = usePreference<keyof Themes>(
'theme',

View File

@@ -1,6 +1,6 @@
import copy from 'copy-to-clipboard';
import history from 'history/browser';
import { MutableRefObject, useCallback, useEffect, useState } from 'react';
import { RefObject, useCallback, useEffect, useState } from 'react';
import styled from 'styled-components';
import themes, { Themes } from '../style/themes';
@@ -12,7 +12,7 @@ import MenuButton from './MenuButton';
export interface EditorControlsProps {
actualContent: string;
resetFunction: MutableRefObject<ResetFunction | undefined>;
resetFunction: RefObject<ResetFunction | null>;
language: string;
setLanguage: (value: string) => void;
readOnly: boolean;

View File

@@ -5,23 +5,17 @@ import Editor, {
OnMount,
} from '@monaco-editor/react';
import history from 'history/browser';
import React, {
MutableRefObject,
useCallback,
useEffect,
useRef,
useState,
} from 'react';
import { RefObject, useCallback, useEffect, useRef, useState } from 'react';
import styled from 'styled-components';
import themes, { Theme } from '../style/themes';
import type { editor } from 'monaco-editor';
import { ResetFunction } from './Editor';
import { logLanguage } from '../util/languages/log';
import { diffLanguage } from '../util/languages/diff';
import { logLanguage } from '../util/languages/log';
import { ResetFunction } from './Editor';
import * as monaco from 'monaco-editor';
import { loader } from '@monaco-editor/react';
import * as monaco from 'monaco-editor';
loader.config({ monaco });
@@ -33,7 +27,7 @@ export interface EditorTextAreaProps {
language: string;
fontSize: number;
readOnly: boolean;
resetFunction: MutableRefObject<ResetFunction | undefined>;
resetFunction: RefObject<ResetFunction | null>;
}
export default function EditorTextArea({
@@ -254,7 +248,7 @@ function useSelectedLine(): [SelectedLine, ToggleSelectedFunction] {
}
function useLineNumberMagic(
editorAreaRef: React.RefObject<HTMLDivElement>,
editorAreaRef: RefObject<HTMLDivElement | null>,
selected: SelectedLine,
toggleSelected: ToggleSelectedFunction,
forcedContent: string,