@@ -185,6 +185,7 @@ public struct MessageComposerView<Factory: ViewFactory>: View, KeyboardReadable
185
185
186
186
/// View for the composer's input (text and media).
187
187
public struct ComposerInputView < Factory: ViewFactory > : View {
188
+
188
189
@Injected ( \. colors) private var colors
189
190
@Injected ( \. fonts) private var fonts
190
191
@Injected ( \. images) private var images
@@ -204,6 +205,34 @@ public struct ComposerInputView<Factory: ViewFactory>: View {
204
205
205
206
@State var textHeight : CGFloat = TextSizeConstants . minimumHeight
206
207
208
+ public init (
209
+ factory: Factory ,
210
+ text: Binding < String > ,
211
+ selectedRangeLocation: Binding < Int > ,
212
+ command: Binding < ComposerCommand ? > ,
213
+ addedAssets: [ AddedAsset ] ,
214
+ addedFileURLs: [ URL ] ,
215
+ addedCustomAttachments: [ CustomAttachment ] ,
216
+ quotedMessage: Binding < ChatMessage ? > ,
217
+ maxMessageLength: Int ? = nil ,
218
+ cooldownDuration: Int ,
219
+ onCustomAttachmentTap: @escaping ( CustomAttachment ) -> Void ,
220
+ removeAttachmentWithId: @escaping ( String ) -> Void
221
+ ) {
222
+ self . factory = factory
223
+ _text = text
224
+ _selectedRangeLocation = selectedRangeLocation
225
+ _command = command
226
+ self . addedAssets = addedAssets
227
+ self . addedFileURLs = addedFileURLs
228
+ self . addedCustomAttachments = addedCustomAttachments
229
+ self . quotedMessage = quotedMessage
230
+ self . maxMessageLength = maxMessageLength
231
+ self . cooldownDuration = cooldownDuration
232
+ self . onCustomAttachmentTap = onCustomAttachmentTap
233
+ self . removeAttachmentWithId = removeAttachmentWithId
234
+ }
235
+
207
236
var textFieldHeight : CGFloat {
208
237
let minHeight : CGFloat = TextSizeConstants . minimumHeight
209
238
let maxHeight : CGFloat = TextSizeConstants . maximumHeight
0 commit comments