From f5a38c0ebd032878dfe96b54207c140b832396d0 Mon Sep 17 00:00:00 2001 From: Nookery Date: Fri, 17 Jan 2025 17:00:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=8E=20Improve:=20=20Enhance=20existing?= =?UTF-8?q?=20functionality?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Package.resolved | 2 +- Sources/JuiceEditorKit/Views/EditorViewApi.swift | 13 ++----------- Sources/JuiceEditorKit/Views/EditorViewEvent.swift | 1 - 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/Package.resolved b/Package.resolved index d2af8ccb..8b8c5bcf 100644 --- a/Package.resolved +++ b/Package.resolved @@ -42,7 +42,7 @@ "location" : "https://github.com/CofficLab/MagicKit.git", "state" : { "branch" : "dev", - "revision" : "5fe2985e11d23a76d9fd9598a52bd169a0dfe07f" + "revision" : "4d7d2ac23138eec9394beee4c5f8c815f7d61c6f" } }, { diff --git a/Sources/JuiceEditorKit/Views/EditorViewApi.swift b/Sources/JuiceEditorKit/Views/EditorViewApi.swift index 5eceefbd..4eb11689 100644 --- a/Sources/JuiceEditorKit/Views/EditorViewApi.swift +++ b/Sources/JuiceEditorKit/Views/EditorViewApi.swift @@ -33,10 +33,7 @@ public extension EditorView { @discardableResult func disableDebugBar() async throws -> Any { - debug("disableDebugBar") - let result = try await run("window.editor.disableDebugBar()") - debug("disableDebugBar result: \(result)") - return result + try await run("window.editor.disableDebugBar()") } func disableFloatingMenuAndBubbleMenu() async throws -> Any { @@ -273,13 +270,7 @@ public extension EditorView { } func run(_ script: String) async throws -> Any { - "nil" -// try await self.webView.content.run(script) - } - - func evaluateJavaScript(_ script: String) async throws -> Any { - "nil" -// try await self.webView.content.evaluateJavaScript(script) + self.webView?.evaluateJavaScript(script) } func closeDraw() async throws -> Any { diff --git a/Sources/JuiceEditorKit/Views/EditorViewEvent.swift b/Sources/JuiceEditorKit/Views/EditorViewEvent.swift index e520ea93..d4a7b026 100644 --- a/Sources/JuiceEditorKit/Views/EditorViewEvent.swift +++ b/Sources/JuiceEditorKit/Views/EditorViewEvent.swift @@ -11,7 +11,6 @@ extension EditorView { do { try await self.setChatApi(server.chatApi) try await self.setDrawLink(server.drawIoLink) - try await self.disableFloatingMenu() try await self.disableDebugBar() self.delegate.onReady()