Various improvements

This commit is contained in:
Ilya Laktyushin
2023-07-03 11:52:02 +02:00
parent f87c2ec00f
commit 5b51f35b36
25 changed files with 1122 additions and 287 deletions

View File

@@ -121,6 +121,7 @@ public final class EntityKeyboardComponent: Component {
public let displayBottomPanel: Bool
public let isExpanded: Bool
public let clipContentToTopPanel: Bool
public let useExternalSearchContainer: Bool
public let hidePanels: Bool
public init(
@@ -153,6 +154,7 @@ public final class EntityKeyboardComponent: Component {
displayBottomPanel: Bool,
isExpanded: Bool,
clipContentToTopPanel: Bool,
useExternalSearchContainer: Bool,
hidePanels: Bool = false
) {
self.theme = theme
@@ -184,6 +186,7 @@ public final class EntityKeyboardComponent: Component {
self.displayBottomPanel = displayBottomPanel
self.isExpanded = isExpanded
self.clipContentToTopPanel = clipContentToTopPanel
self.useExternalSearchContainer = useExternalSearchContainer
self.hidePanels = hidePanels
}
@@ -248,6 +251,9 @@ public final class EntityKeyboardComponent: Component {
if lhs.clipContentToTopPanel != rhs.clipContentToTopPanel {
return false
}
if lhs.useExternalSearchContainer != rhs.useExternalSearchContainer {
return false
}
return true
}
@@ -908,14 +914,20 @@ public final class EntityKeyboardComponent: Component {
contentType = .stickers
}
self.searchComponent = EntitySearchContentComponent(
makeContainerNode: {
return component.makeSearchContainerNode(contentType)
},
dismissSearch: { [weak self] in
self?.closeSearch()
}
)
if component.useExternalSearchContainer, let containerNode = component.makeSearchContainerNode(contentType) {
let controller = EntitySearchContainerController(containerNode: containerNode)
self.component?.emojiContent?.inputInteractionHolder.inputInteraction?.pushController(controller)
} else {
self.searchComponent = EntitySearchContentComponent(
makeContainerNode: {
return component.makeSearchContainerNode(contentType)
},
dismissSearch: { [weak self] in
self?.closeSearch()
}
)
}
//self.state?.updated(transition: Transition(animation: .curve(duration: 0.3, curve: .spring)))
component.hideInputUpdated(true, true, Transition(animation: .curve(duration: 0.3, curve: .spring)))
}