Build(package.json): Upgrade dependencies

This commit is contained in:
2024-10-16 17:39:54 +08:00
parent 07f24333d9
commit b353ab07e2
33 changed files with 1574 additions and 4940 deletions

View File

@@ -34,8 +34,7 @@ export interface TypeHelper {
export const createATA = async (): Promise<TypeHelper> => {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const ts = await import('https://esm.sh/typescript@5.3.3')
const ts = await import('https://esm.sh/typescript@5.6.3')
const maxConcurrentRequests = 50
let activeRequests = 0
@@ -63,7 +62,6 @@ export const createATA = async (): Promise<TypeHelper> => {
const ata = setupTypeAcquisition({
projectName: 'monaco-ts',
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
typescript: ts,
logger: console,
fetcher: (input, init) => {
@@ -117,7 +115,6 @@ export const createATA = async (): Promise<TypeHelper> => {
}
return {
// eslint-disable-next-line @typescript-eslint/no-misused-promises
acquireType,
addListener,
removeListener,

View File

@@ -73,7 +73,6 @@ const Editor = ({
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
editor['_codeEditorService'].doOpenEditor = function (
editor: editor.IStandaloneCodeEditor,
input: { options: { selection: Selection }; resource: { path: string } }

View File

@@ -2,6 +2,6 @@ import { loader } from '@monaco-editor/react'
loader.config({
paths: {
vs: 'https://unpkg.com/monaco-editor@0.49.0/min/vs'
vs: 'https://unpkg.com/monaco-editor@0.52.0/min/vs'
}
})

View File

@@ -2,4 +2,4 @@
position: relative;
width: 100%;
height: 100%;
}
}

View File

@@ -186,15 +186,15 @@ const Render = ({ iframeKey, compiledCode, mobileMode = false }: RenderProps) =>
className={`device-content${isRotate ? ' rotate' : ''}`}
style={{
width: isRotate
? devices.find((value) => value.name === selectedDevice)
?.height ?? 915
: devices.find((value) => value.name === selectedDevice)
?.width ?? 412,
? (devices.find((value) => value.name === selectedDevice)
?.height ?? 915)
: (devices.find((value) => value.name === selectedDevice)
?.width ?? 412),
height: isRotate
? devices.find((value) => value.name === selectedDevice)
?.width ?? 412
: devices.find((value) => value.name === selectedDevice)
?.height ?? 915
? (devices.find((value) => value.name === selectedDevice)
?.width ?? 412)
: (devices.find((value) => value.name === selectedDevice)
?.height ?? 915)
}}
>
<iframe

View File

@@ -38,7 +38,7 @@
}
if (data?.type === "SCALE") {
document.getElementById("root").style.zoom = data.data.zoom
document.getElementById("root").style.zoom = data.data.zoom;
}
});
</script>

View File

@@ -1,3 +1,3 @@
[data-component=playground-transform] {
position: relative;
}
}

View File

@@ -30,7 +30,7 @@ class Compiler {
void esbuild
.initialize({
worker: true,
wasmURL: 'https://esm.sh/esbuild-wasm@0.21.5/esbuild.wasm'
wasmURL: 'https://esm.sh/esbuild-wasm@0.24.0/esbuild.wasm'
})
.finally(() => {
this.init = true

View File

@@ -1,4 +1,4 @@
{
"type": "object",
"additionalProperties": {"type": "string"}
}
}

View File

@@ -5,4 +5,4 @@
> * {
width: 0 !important;
}
}
}

View File

@@ -864,4 +864,4 @@
}
}
}
}
}

View File

@@ -1,7 +1,7 @@
import { DetailedHTMLProps, HTMLAttributes } from 'react'
import '@/assets/css/components/common/card.scss'
interface CardProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {}
type CardProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>
const Card = forwardRef<HTMLDivElement, CardProps>(({ className, ...props }, ref) => {
return <div className={`card-box${className ? ` ${className}` : ''}`} {...props} ref={ref} />

View File

@@ -82,94 +82,90 @@ const HideScrollbar = forwardRef<HideScrollbarElement, HideScrollbarProps>(
},
ref
) => {
useImperativeHandle<HideScrollbarElement, HideScrollbarElement>(
ref,
() => {
return {
scrollTo(x, y, smooth?: boolean) {
rootRef.current?.scrollTo({
left: x,
top: y,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
scrollX(x, smooth?: boolean) {
rootRef.current?.scrollTo({
left: x,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
scrollY(y, smooth?: boolean) {
rootRef.current?.scrollTo({
top: y,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
scrollLeft(length, smooth?: boolean) {
rootRef.current?.scrollTo({
left: rootRef.current?.scrollLeft - length,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
scrollRight(length, smooth?: boolean) {
rootRef.current?.scrollTo({
left: rootRef.current?.scrollLeft + length,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
scrollUp(length, smooth?: boolean) {
rootRef.current?.scrollTo({
top: rootRef.current?.scrollTop - length,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
scrollDown(length, smooth?: boolean) {
rootRef.current?.scrollTo({
top: rootRef.current?.scrollTop + length,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
getX() {
return rootRef.current?.scrollLeft ?? 0
},
getY() {
return rootRef.current?.scrollTop ?? 0
},
addEventListenerWithType<K extends keyof HTMLElementEventMap>(
type: K,
listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => never,
options?: boolean | AddEventListenerOptions
): void {
rootRef.current?.addEventListener<K>(type, listener, options)
},
addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions
): void {
rootRef.current?.addEventListener(type, listener, options)
},
removeEventListenerWithType<K extends keyof HTMLElementEventMap>(
type: K,
listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => never,
options?: boolean | EventListenerOptions
): void {
rootRef.current?.removeEventListener<K>(type, listener, options)
},
removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions
): void {
rootRef.current?.removeEventListener(type, listener, options)
},
refreshLayout(): void {
refreshLayout()
}
useImperativeHandle<HideScrollbarElement, HideScrollbarElement>(ref, () => {
return {
scrollTo(x, y, smooth?: boolean) {
rootRef.current?.scrollTo({
left: x,
top: y,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
scrollX(x, smooth?: boolean) {
rootRef.current?.scrollTo({
left: x,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
scrollY(y, smooth?: boolean) {
rootRef.current?.scrollTo({
top: y,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
scrollLeft(length, smooth?: boolean) {
rootRef.current?.scrollTo({
left: rootRef.current?.scrollLeft - length,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
scrollRight(length, smooth?: boolean) {
rootRef.current?.scrollTo({
left: rootRef.current?.scrollLeft + length,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
scrollUp(length, smooth?: boolean) {
rootRef.current?.scrollTo({
top: rootRef.current?.scrollTop - length,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
scrollDown(length, smooth?: boolean) {
rootRef.current?.scrollTo({
top: rootRef.current?.scrollTop + length,
behavior: smooth === false ? 'instant' : 'smooth'
})
},
getX() {
return rootRef.current?.scrollLeft ?? 0
},
getY() {
return rootRef.current?.scrollTop ?? 0
},
addEventListenerWithType<K extends keyof HTMLElementEventMap>(
type: K,
listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => never,
options?: boolean | AddEventListenerOptions
): void {
rootRef.current?.addEventListener<K>(type, listener, options)
},
addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions
): void {
rootRef.current?.addEventListener(type, listener, options)
},
removeEventListenerWithType<K extends keyof HTMLElementEventMap>(
type: K,
listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => never,
options?: boolean | EventListenerOptions
): void {
rootRef.current?.removeEventListener<K>(type, listener, options)
},
removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions
): void {
rootRef.current?.removeEventListener(type, listener, options)
},
refreshLayout(): void {
refreshLayout()
}
},
[]
)
}
}, [])
const maskRef = useRef<HTMLDivElement>(null)
const rootRef = useRef<HTMLDivElement>(null)

View File

@@ -7,7 +7,6 @@ interface DragHandleProps {
}
const DragHandle = ({ padding }: DragHandleProps) => {
// eslint-disable-next-line @typescript-eslint/unbound-method
const { attributes, listeners, ref } = useContext(HandleContextInst)
return (

View File

@@ -1,6 +1,7 @@
import { DraggableSyntheticListeners } from '@dnd-kit/core'
export interface HandleContext {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
attributes: Record<string, any>
listeners: DraggableSyntheticListeners
ref(node: HTMLElement | null): void

View File

@@ -126,10 +126,8 @@ const SignIn = () => {
form={twoFactorForm}
ref={() => {
setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
twoFactorForm
.getFieldInstance('twoFactorCode')
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
.focus()
}, 50)
}}

View File

@@ -31,7 +31,6 @@ const Mail = () => {
form={mailSendForm}
ref={() => {
setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
mailSendForm?.getFieldInstance('to').focus()
}, 50)
}}

View File

@@ -14,8 +14,6 @@ import {
import { BarChart, BarSeriesOption, LineChart, LineSeriesOption } from 'echarts/charts'
import { SVGRenderer } from 'echarts/renderers'
import { UniversalTransition } from 'echarts/features'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
import { CallbackDataParams } from 'echarts/types/dist/shared'
import { utcToLocalTime } from '@/util/datetime'
@@ -83,11 +81,13 @@ export const barEChartsBaseOption: EChartsOption = {
export const getTooltipTimeFormatter = (format: string = 'yyyy-MM-DD HH:mm:ss') => {
return (params: CallbackDataParams[]) =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
`${utcToLocalTime(params[0].data[0], format)}<br>${params
.map(
(param) =>
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
`<span style="display: flex; justify-content: space-between;"><span>${param.marker}${param.seriesName}</span><span style="font-weight: bold; margin-left: 16px;">${param.data[1]}</span></span>`
)
.join('')}`

View File

@@ -628,7 +628,6 @@ const Base = () => {
form={addFileForm}
ref={() => {
setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
addFileForm?.getFieldInstance('fileName').focus()
}, 50)
}}
@@ -822,7 +821,6 @@ const Base = () => {
form={renameFileForm}
ref={() => {
setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
renameFileForm?.getFieldInstance('fileName').focus()
}, 50)
}}

View File

@@ -479,7 +479,6 @@ const Template = () => {
form={addFileForm}
ref={() => {
setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
addFileForm?.getFieldInstance('fileName').focus()
}, 50)
}}
@@ -674,7 +673,6 @@ const Template = () => {
form={renameFileForm}
ref={() => {
setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
renameFileForm?.getFieldInstance('fileName').focus()
}, 50)
}}

View File

@@ -353,7 +353,6 @@ const User = () => {
wrapperCol={{ span: 18 }}
ref={() => {
setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
changePasswordForm?.getFieldInstance('password').focus()
}, 50)
}}

View File

@@ -74,7 +74,6 @@ const Create = () => {
const reader = new FileReader()
reader.addEventListener('load', () => {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
form.setFieldValue('icon', reader.result!.toString().split(',')[1])
void form.validateFields(['icon'])
})
@@ -163,7 +162,7 @@ const Create = () => {
temp.push(item)
}
})
form.setFieldValue('keyword', temp)
form.setFieldValue('keywords', temp)
}, [form, formValues?.keywords])
useEffect(() => {

View File

@@ -151,7 +151,6 @@ const Edit = () => {
const reader = new FileReader()
reader.addEventListener('load', () => {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
form.setFieldValue('icon', reader.result!.toString().split(',')[1])
void form.validateFields(['icon'])
})

View File

@@ -266,7 +266,6 @@ const Tools = () => {
form={upgradeForm}
ref={() => {
setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
upgradeForm?.getFieldInstance('toolId').focus()
}, 50)
}}

View File

@@ -22,10 +22,6 @@ import Card from '@/components/common/Card'
import FlexBox from '@/components/common/FlexBox'
import HideScrollbar from '@/components/common/HideScrollbar'
interface ChangePasswordFields extends UserUpdatePasswordParam {
newPasswordConfirm: string
}
const User = () => {
const [modal, contextHolder] = AntdModal.useModal()
const [form] = AntdForm.useForm<UserInfoUpdateParam>()
@@ -37,7 +33,7 @@ const User = () => {
const [isGettingAvatar, setIsGettingAvatar] = useState(false)
const [avatar, setAvatar] = useState('')
const [userWithPowerInfoVo, setUserWithPowerInfoVo] = useState<UserWithPowerInfoVo>()
const [changePasswordForm] = AntdForm.useForm<ChangePasswordFields>()
const [changePasswordForm] = AntdForm.useForm<UserChangePasswordParam>()
const handleOnCopyToClipboard = (username?: string) => {
return username
@@ -127,7 +123,6 @@ const User = () => {
wrapperCol={{ span: 18 }}
ref={() => {
setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
changePasswordForm?.getFieldInstance('originalPassword').focus()
}, 50)
}}
@@ -260,10 +255,8 @@ const User = () => {
form={twoFactorForm}
ref={() => {
setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
twoFactorForm
?.getFieldInstance('twoFactorCode')
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
.focus()
}, 50)
}}
@@ -352,10 +345,8 @@ const User = () => {
form={twoFactorForm}
ref={() => {
setTimeout(() => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
twoFactorForm
?.getFieldInstance('twoFactorCode')
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
.focus()
}, 50)
}}

View File

@@ -12,7 +12,7 @@ export const useUpdatedEffect = (effect: EffectCallback, dependencies: Dependenc
}, dependencies)
}
export const usePrevious = <T,>(value: T): T | undefined => {
export const usePrevious = <T>(value: T): T | undefined => {
const ref = useRef<T>()
useEffect(() => {
ref.current = value