-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ba2b51
commit e8aa17f
Showing
22 changed files
with
113 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
Sources/RichTextKit/Context/RichTextContextFocusedValueKey.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// RichTextContextFocusedValueKey.swift | ||
// RichTextKit | ||
// | ||
// Created by Daniel Saidi on 2022-12-19. | ||
// Copyright © 2022-2024 Daniel Saidi. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public extension RichTextContext { | ||
|
||
/// This key can be used to keep track of a context in a | ||
/// multi-windowed app. | ||
struct FocusedValueKey: SwiftUI.FocusedValueKey { | ||
|
||
public typealias Value = RichTextContext | ||
} | ||
} | ||
|
||
public extension FocusedValues { | ||
|
||
/// This value can be used to keep track of a context in | ||
/// a multi-windowed app. | ||
/// | ||
/// You can bind a context to a view with `focusedValue`: | ||
/// | ||
/// ```swift | ||
/// RichTextEditor(...) | ||
/// .focusedValue(\.richTextContext, richTextContext) | ||
/// ``` | ||
/// | ||
/// You can then access the context as a `@FocusedValue`: | ||
/// | ||
/// ```swift | ||
/// @FocusedValue(\.richTextContext) | ||
/// var richTextContext: RichTextContext? | ||
/// ``` | ||
var richTextContext: RichTextContext.FocusedValueKey.Value? { | ||
get { self[RichTextContext.FocusedValueKey.self] } | ||
set { self[RichTextContext.FocusedValueKey.self] = newValue } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
4 changes: 3 additions & 1 deletion
4
...hTextKit/RichTextView+Config_AppKit.swift → ...t/Editor/RichTextView+Config_AppKit.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 0 additions & 46 deletions
46
Sources/RichTextKit/Focus/RichTextContextFocusedValueKey.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...chTextKit/Bundle/Bundle+RichTextKit.swift → ...hTextKit/Localization/Bundle+Locale.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters