// The shell's writing editors over the whole stack (`StackHost`): the// short-text input over the dimmed deck while a line is written, the// full-screen editor while a long text is (`DeckEditor.writing`). Nothing// under the dim moves for the keyboard either raises: from the moment a// writer opens until its keyboard has gone (`DeckEditor.holdsKeyboard`)// every page ignores the keyboard, so no card, deck or fan is laid out// again for it; the input alone rides the keyboard.//// WHERE THE KEYBOARD IS IGNORED. Every page stands in a UIKit host of its// own (`TileStack`'s root and record hosts: Home's, and each fan tile's),// and a host lays its own content out for the keyboard, past any modifier// outside it: ignored over the stack alone, Home's host still lifted the// fan over the keyboard, and the deck's card, standing above the fan,// squeezed into the strip left (walk 332). So each host's content ignores// it itself (`deckStillUnderWriter`), as this stack's does. A window of the// writer's own would not do: a host lays itself out for any keyboard in the// scene, whichever window's field raised it.importSwiftUIextensionView {/// The shell's writing editors over this stack.func deckWriting() -> someView { modifier(DeckWritingLayer()) }/// A page host's content under the shell's writer: it ignores the/// keyboard while the writer holds it (`DeckEditor.holdsKeyboard`).func deckStillUnderWriter() -> someView { modifier(DeckStillUnderWriter()) }}structDeckStillUnderWriter: ViewModifier {privatevar editor: DeckEditor { .session }func body(content: Content) -> someView { content.ignoresSafeArea(.keyboard, edges: editor.holdsKeyboard ? .bottom : []) }}structDeckWritingLayer: ViewModifier { @Environment(\.fanCover) privatevar cover @Environment(ToastCenter.self) privatevar toasts: ToastCenter?privatevar editor: DeckEditor { .session }privatevar line: DeckWriting? { editor.writing.flatMap { [.line, .amount].contains($0.editor) ? $0 : nil } }func body(content: Content) -> someView { content .deckStillUnderWriter() .overlay(alignment: .top) {iflet draft = editor.draft {GeometryReader { room inOpenedDraftCard(draft: draft, editor: editor) .environment(\.deckEditor, editor) .frame(height: max(0, room.size.height - (cover?.scrollClearance ?? 0))) } } } .overlay {iflet line {DeckLineInput(writing: line, commit: { editor.commit($0) }, dismiss: { editor.dismissWriting() }) .id(line.id) .transition(.opacity) } } .animation(.easeOut(duration: 0.18), value: line?.id)// A write the deck could not make is said where it was made, and// stands until the next tap: read, not glimpsed. .onChange(of: editor.refusal) { _, refused iniflet refused { _ = toasts?.show(refused.sentence, tone: .error, window: ToastWindow.untilTap) } } .fullScreenCover(item: Binding( get: { editor.writing?.editor == .page && editor.writing?.overReader == false ? editor.writing : nil }, set: { if $0 == nil, editor.writing?.editor == .page, editor.writing?.overReader == false { editor.dismissWriting() } })) { page inDeckLongTextEditor(title: page.title, words: page.words, voice: page.voicePlan(surface: "note")) { text iniflet text { editor.commit(text) } else { editor.dismissWriting() } } } #if os(iOS) .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardWillShowNotification)) { _ in editor.keyboard(shown: true) } .onReceive(NotificationCenter.default.publisher(for: UIResponder.keyboardDidHideNotification)) { _ in editor.keyboard(shown: false) } #endif }}