mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-21 20:11:43 +08:00
feat: done create new doc
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// File.swift
|
||||
// Intelligents
|
||||
//
|
||||
// Created by 秋星桥 on 4/4/25.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
|
||||
public extension Intelligents {
|
||||
enum Delegates {
|
||||
public static var createNewDocument: ((_ title: String, _ content: String) -> Void) = { _, _ in }
|
||||
public static var dismissAll: (() -> Void) = { }
|
||||
}
|
||||
}
|
||||
+10
@@ -131,6 +131,10 @@ public class IntelligentsEphemeralActionController: UIViewController {
|
||||
guard let self else { return }
|
||||
continueToChat()
|
||||
}
|
||||
actionBar.createNewDoc.action = { [weak self] in
|
||||
guard let self else { return }
|
||||
createNewDoc()
|
||||
}
|
||||
}
|
||||
|
||||
func setupContentViews() {
|
||||
@@ -294,4 +298,10 @@ extension IntelligentsEphemeralActionController {
|
||||
chatController.metadata[.content] = documentContent
|
||||
navigationController?.pushViewController(chatController, animated: true)
|
||||
}
|
||||
|
||||
func createNewDoc() {
|
||||
let content = copilotDocumentStorage
|
||||
Intelligents.Delegates.createNewDocument("New Document", content)
|
||||
Intelligents.Delegates.dismissAll()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user