From 29ae72480471de3326e585c335fb7e0e267446a9 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 11 Mar 2024 21:38:27 +0800 Subject: [PATCH] fix: needless editor reload on content change (#158 close alist-org/alist#6098) * fix: needless editor reload on content change https://github.com/alist-org/alist/issues/6098 * minor fix --- package.json | 2 +- pnpm-lock.yaml | 14 +++++++------- src/pages/home/previews/text-editor.tsx | 3 +-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 281fd7044..bc5565320 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "dependencies": { "@github/webauthn-json": "^2.1.1", "@hope-ui/solid": "0.6.7", - "@monaco-editor/loader": "^1.3.2", + "@monaco-editor/loader": "^1.4.0", "@motionone/solid": "^10.14.1", "@solid-primitives/i18n": "^1.1.0", "@solid-primitives/keyboard": "^1.2.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 59e710ed7..7938b481c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ dependencies: specifier: 0.6.7 version: 0.6.7(@stitches/core@1.2.8)(solid-js@1.4.8)(solid-transition-group@0.0.12) '@monaco-editor/loader': - specifier: ^1.3.2 - version: 1.3.2(monaco-editor@0.44.0) + specifier: ^1.4.0 + version: 1.4.0(monaco-editor@0.46.0) '@motionone/solid': specifier: ^10.14.1 version: 10.14.1(solid-js@1.4.8) @@ -594,12 +594,12 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true - /@monaco-editor/loader@1.3.2(monaco-editor@0.44.0): - resolution: {integrity: sha512-BTDbpHl3e47r3AAtpfVFTlAi7WXv4UQ/xZmz8atKl4q7epQV5e7+JbigFDViWF71VBi4IIBdcWP57Hj+OWuc9g==} + /@monaco-editor/loader@1.4.0(monaco-editor@0.46.0): + resolution: {integrity: sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==} peerDependencies: monaco-editor: '>= 0.21.0 < 1' dependencies: - monaco-editor: 0.44.0 + monaco-editor: 0.46.0 state-local: 1.0.7 dev: false @@ -2554,8 +2554,8 @@ packages: minimist: 1.2.6 dev: true - /monaco-editor@0.44.0: - resolution: {integrity: sha512-5SmjNStN6bSuSE5WPT2ZV+iYn1/yI9sd4Igtk23ChvqB7kDk9lZbB9F5frsuvpB+2njdIeGGFf2G4gbE6rCC9Q==} + /monaco-editor@0.46.0: + resolution: {integrity: sha512-ADwtLIIww+9FKybWscd7OCfm9odsFYHImBRI1v9AviGce55QY8raT+9ihH8jX/E/e6QVSGM+pKj4jSUSRmALNQ==} dev: false /mri@1.2.0: diff --git a/src/pages/home/previews/text-editor.tsx b/src/pages/home/previews/text-editor.tsx index b74441cf0..d6d454720 100644 --- a/src/pages/home/previews/text-editor.tsx +++ b/src/pages/home/previews/text-editor.tsx @@ -30,7 +30,6 @@ function Editor(props: { data?: string | ArrayBuffer; contentType?: string }) { createEffect( on(encoding, (v) => { setValue(text(v)) - console.log(value()) }), ) @@ -49,7 +48,7 @@ function Editor(props: { data?: string | ArrayBuffer; contentType?: string }) { {