File tree Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change 66export * from './active-cell-manager' ;
77export * from './components' ;
88export * from './icons' ;
9+ export * from './input-model' ;
910export * from './model' ;
1011export * from './registry' ;
1112export * from './selection-watcher' ;
Original file line number Diff line number Diff line change @@ -161,11 +161,6 @@ export interface IChatModel extends IDisposable {
161161 * Update the current writers list.
162162 */
163163 updateWriters ( writers : IUser [ ] ) : void ;
164-
165- /**
166- * Function called by the input on key pressed.
167- */
168- inputChanged ?( input ?: string ) : void ;
169164}
170165
171166/**
@@ -514,11 +509,6 @@ export class ChatModel implements IChatModel {
514509 this . _writersChanged . emit ( writers ) ;
515510 }
516511
517- /**
518- * Function called by the input on key pressed.
519- */
520- inputChanged ?( input ?: string ) : void { }
521-
522512 /**
523513 * Add unread messages to the list.
524514 * @param indexes - list of new indexes.
Original file line number Diff line number Diff line change 77 ChatModel ,
88 IAttachment ,
99 IChatMessage ,
10+ IInputModel ,
1011 INewMessage ,
1112 IUser
1213} from '@jupyter/chat' ;
@@ -59,6 +60,8 @@ export class LabChatModel extends ChatModel implements DocumentRegistry.IModel {
5960 } ) ;
6061
6162 this . sharedModel . awareness . on ( 'change' , this . onAwarenessChange ) ;
63+
64+ this . input . valueChanged . connect ( this . onInputChanged ) ;
6265 }
6366
6467 readonly collaborative = true ;
@@ -209,8 +212,8 @@ export class LabChatModel extends ChatModel implements DocumentRegistry.IModel {
209212 /**
210213 * Function called by the input on key pressed.
211214 */
212- inputChanged ( input ?: string ) : void {
213- if ( ! input || ! this . config . sendTypingNotification ) {
215+ onInputChanged = ( _ : IInputModel , value : string ) : void => {
216+ if ( ! value || ! this . config . sendTypingNotification ) {
214217 return ;
215218 }
216219 const awareness = this . sharedModel . awareness ;
@@ -221,7 +224,7 @@ export class LabChatModel extends ChatModel implements DocumentRegistry.IModel {
221224 this . _timeoutWriting = window . setTimeout ( ( ) => {
222225 this . _resetWritingStatus ( ) ;
223226 } , WRITING_DELAY ) ;
224- }
227+ } ;
225228
226229 /**
227230 * Triggered when an awareness state changes.
You can’t perform that action at this time.
0 commit comments