Update composer library version to 1.1.0 (#7365)

* Update composer library version to 1.1.0

* Add changelog file
This commit is contained in:
aringenbach
2023-02-13 10:44:03 +01:00
committed by GitHub
parent ae19155c4a
commit 2425721614
7 changed files with 88 additions and 33 deletions
@@ -71,12 +71,15 @@ struct Composer: View {
}
private var formatItems: [FormatItem] {
FormatType.allCases.map { type in
FormatItem(
type: type,
state: wysiwygViewModel.actionStates[type.composerAction] ?? .disabled
)
}
return FormatType.allCases
// Exclude indent type outside of lists.
.filter { wysiwygViewModel.isInList || !$0.isIndentType }
.map { type in
FormatItem(
type: type,
state: wysiwygViewModel.actionStates[type.composerAction] ?? .disabled
)
}
}
private var composerContainer: some View {
@@ -257,6 +260,13 @@ struct Composer: View {
}
}
private extension WysiwygComposerViewModel {
/// Return true if the selection of the composer is currently located in a list.
var isInList: Bool {
actionStates[.orderedList] == .reversed || actionStates[.unorderedList] == .reversed
}
}
// MARK: Previews
struct Composer_Previews: PreviewProvider {