Skip to content

Commit f1baa58

Browse files
committed
Clean up whitespace
1 parent 69580bb commit f1baa58

38 files changed

+215
-207
lines changed

Sources/RichTextKit/Actions/RichTextAction+Button.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@
99
import SwiftUI
1010

1111
public extension RichTextAction {
12-
12+
1313
/**
1414
This button can be used to trigger a ``RichTextAction``.
15-
15+
1616
This renders a plain `Button`, which means that you can
1717
use and configure it as a normal button.
1818
*/
1919
struct Button: View {
2020
/**
2121
Create a rich text action button.
22-
22+
2323
- Parameters:
2424
- action: The action to trigger.
2525
- context: The context to affect.
@@ -34,13 +34,13 @@ public extension RichTextAction {
3434
self._context = ObservedObject(wrappedValue: context)
3535
self.fillVertically = fillVertically
3636
}
37-
37+
3838
private let action: RichTextAction
3939
private let fillVertically: Bool
40-
40+
4141
@ObservedObject
4242
private var context: RichTextContext
43-
43+
4444
public var body: some View {
4545
SwiftUI.Button(action: triggerAction) {
4646
action.label
@@ -67,7 +67,7 @@ struct RichTextAction_Button_Previews: PreviewProvider {
6767

6868
@StateObject
6969
private var context = RichTextContext()
70-
70+
7171
func button(
7272
for action: RichTextAction
7373
) -> some View {

Sources/RichTextKit/Actions/RichTextAction+ButtonGroup.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
import SwiftUI
1111

1212
public extension RichTextAction {
13-
13+
1414
/**
1515
This view lists ``RichTextAction`` buttons in a group.
16-
16+
1717
Since this view uses multiple values, it binds directly
1818
to a ``RichTextContext`` instead of individual values.
1919
*/
2020
struct ButtonGroup: View {
21-
21+
2222
/**
2323
Create a rich text action button stack.
24-
24+
2525
- Parameters:
2626
- context: The context to affect.
2727
- actions: The actions to list, by default all non-size actions.
@@ -36,13 +36,13 @@ public extension RichTextAction {
3636
self.actions = actions
3737
self.isGreedy = greedy
3838
}
39-
39+
4040
private let actions: [RichTextAction]
4141
private let isGreedy: Bool
42-
42+
4343
@ObservedObject
4444
private var context: RichTextContext
45-
45+
4646
public var body: some View {
4747
ControlGroup {
4848
ForEach(actions) {

Sources/RichTextKit/Actions/RichTextAction+ButtonStack.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@
99
import SwiftUI
1010

1111
public extension RichTextAction {
12-
12+
1313
/**
1414
This view lists ``RichTextAction`` buttons in a stack.
15-
15+
1616
Since this view uses multiple values, it binds directly
1717
to a ``RichTextContext`` instead of individual values.
1818
*/
1919
struct ButtonStack: View {
20-
20+
2121
/**
2222
Create a rich text action button stack.
23-
23+
2424
- Parameters:
2525
- context: The context to affect.
2626
- actions: The actions to list, by default all non-size actions.
@@ -35,13 +35,13 @@ public extension RichTextAction {
3535
self.actions = actions
3636
self.spacing = spacing
3737
}
38-
38+
3939
private let actions: [RichTextAction]
4040
private let spacing: Double
41-
41+
4242
@ObservedObject
4343
private var context: RichTextContext
44-
44+
4545
public var body: some View {
4646
HStack(spacing: spacing) {
4747
ForEach(actions) {

Sources/RichTextKit/Actions/RichTextAction+KeyboardShortcutModifier.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
import SwiftUI
1010

1111
public extension RichTextAction {
12-
12+
1313
/**
1414
This view modifier can apply keyboard shortcuts for any
1515
``RichTextAction`` to any view.
16-
16+
1717
You can also apply it with the `.keyboardShortcut(for:)`
1818
view extension.
1919
*/
2020
struct KeyboardShortcutModifier: ViewModifier {
21-
21+
2222
public init(_ action: RichTextAction) {
2323
self.action = action
2424
}
25-
25+
2626
private let action: RichTextAction
27-
27+
2828
public func body(content: Content) -> some View {
2929
content.keyboardShortcut(for: action)
3030
}

Sources/RichTextKit/Actions/RichTextAction.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import SwiftUI
1111
/**
1212
This enum defines rich text actions that can be executed on
1313
a rich text editor.
14-
14+
1515
This type also serves as a type namespace for other related
1616
types and views, like ``RichTextAction/Button``.
1717
*/

Sources/RichTextKit/Alignment/RichTextAlignment+KeyboardShortcutModifier.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99
import SwiftUI
1010

1111
public extension RichTextAlignment {
12-
12+
1313
/**
1414
This view modifier can apply keyboard shortcuts for any
1515
``RichTextAlignment`` to any view.
16-
16+
1717
You can also apply it with the `.keyboardShortcut(for:)`
1818
view extension.
1919
*/
2020
struct KeyboardShortcutModifier: ViewModifier {
21-
21+
2222
public init(_ alignment: RichTextAlignment) {
2323
self.alignment = alignment
2424
}
25-
25+
2626
private let alignment: RichTextAlignment
27-
27+
2828
public func body(content: Content) -> some View {
2929
content.keyboardShortcut(for: alignment)
3030
}

Sources/RichTextKit/Alignment/RichTextAlignment+Picker.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import SwiftUI
1010

1111
public extension RichTextAlignment {
12-
12+
1313
/**
1414
This picker can be used to pick a rich text alignment.
1515

Sources/RichTextKit/Alignment/RichTextAlignment.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public enum RichTextAlignment: String, CaseIterable, Codable, Equatable, Identif
4444
}
4545

4646
public extension Collection where Element == RichTextAlignment {
47-
47+
4848
static var all: [Element] { RichTextAlignment.allCases }
4949
}
5050

Sources/RichTextKit/Colors/RichTextColor+Picker.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
import SwiftUI
1010

1111
public extension RichTextColor {
12-
12+
1313
/**
1414
This picker can be used to select a rich text color.
15-
15+
1616
This picker renders an icon next to the color picker as
1717
well as an optional list of quick colors.
18-
18+
1919
The quick color list is empty by default. You can add a
2020
custom set of colors, for instance `.quickPickerColors`.
2121
*/
2222
struct Picker: View {
23-
23+
2424
/**
2525
Create a rich text color picker that binds to a color.
26-
26+
2727
- Parameters:
2828
- type: The type of color to pick, by default `.undefined`.
2929
- icon: The icon to show, if any, by default the `type` icon.
@@ -41,19 +41,19 @@ public extension RichTextColor {
4141
self._value = value
4242
self.quickColors = quickColors
4343
}
44-
44+
4545
private let type: RichTextColor
4646
private let icon: Image?
4747
private let quickColors: [Color]
48-
48+
4949
@Binding
5050
private var value: Color
51-
51+
5252
private let spacing = 10.0
53-
53+
5454
@Environment(\.colorScheme)
5555
private var colorScheme
56-
56+
5757
public var body: some View {
5858
HStack(spacing: 0) {
5959
iconView
@@ -161,7 +161,7 @@ private struct ColorButtonStyle: ButtonStyle {
161161
}
162162

163163
struct RichTextColor_Picker_Previews: PreviewProvider {
164-
164+
165165
private struct Preview: View {
166166
@State
167167
private var foregroundColor = Color.black

Sources/RichTextKit/Commands/RichTextCommand+ActionButton.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
import SwiftUI
1010

1111
public extension RichTextCommand {
12-
12+
1313
/**
1414
This button can be used to trigger any ``RichTextAction``
1515
from a main menu command item.
16-
16+
1717
This button gets ``RichTextContext`` as a focused value.
1818
It will be nil if no view has focus, which will disable
1919
the button altogether.
2020
*/
2121
struct ActionButton: View {
22-
22+
2323
/**
2424
Create a command button.
25-
25+
2626
- Parameters:
2727
- action: The action to trigger.
2828
*/
@@ -31,12 +31,12 @@ public extension RichTextCommand {
3131
) {
3232
self.action = action
3333
}
34-
34+
3535
private let action: RichTextAction
36-
36+
3737
@FocusedValue(\.richTextContext)
3838
private var context: RichTextContext?
39-
39+
4040
public var body: some View {
4141
SwiftUI.Button(action.menuTitle) {
4242
context?.handle(action)
@@ -45,7 +45,7 @@ public extension RichTextCommand {
4545
.keyboardShortcut(for: action)
4646
.accessibilityLabel(action.title)
4747
}
48-
48+
4949
private var canHandle: Bool {
5050
context?.canHandle(action) ?? false
5151
}

0 commit comments

Comments
 (0)