Download this file
| 1 | #if os(macOS) |
| 2 | import AppKit |
| 3 | import RastrilloApple |
| 4 | import SwiftUI |
| 5 | |
| 6 | struct DocsEditorContext { |
| 7 | let model: DocsModel |
| 8 | let rename: () -> Void |
| 9 | let client: NativeHTTP |
| 10 | let zoom: Binding<Double> |
| 11 | let paged: Binding<Bool> |
| 12 | let inspecting: Binding<Bool> |
| 13 | let sharing: Binding<Bool> |
| 14 | let exportRequest: Binding<String?> |
| 15 | @MainActor var actions: DocumentCommands? { |
| 16 | guard NSApp.keyWindow?.firstResponder is DocsTextView, let projection = model.projection else { return nil } |
| 17 | return DocumentCommands(model: model, content: NativeTextProjection.render(projection)) |
| 18 | } |
| 19 | } |
| 20 | extension FocusedValues { @Entry var docsEditor: DocsEditorContext? } |
| 21 | #endif |
| 22 | |