|
3 | 3 | * Distributed under the terms of the Modified BSD License. |
4 | 4 | */ |
5 | 5 |
|
6 | | -import { |
7 | | - Chat, |
8 | | - ChatWidget, |
9 | | - IActiveCellManager, |
10 | | - ISelectionWatcher, |
11 | | - IInputToolbarRegistryFactory |
12 | | -} from '@jupyter/chat'; |
13 | | -import { IDocumentManager } from '@jupyterlab/docmanager'; |
| 6 | +import { Chat, ChatWidget, IInputToolbarRegistryFactory } from '@jupyter/chat'; |
14 | 7 | import { ABCWidgetFactory, DocumentRegistry } from '@jupyterlab/docregistry'; |
15 | | -import { Contents, User } from '@jupyterlab/services'; |
16 | | -import { CommandRegistry } from '@lumino/commands'; |
| 8 | +import { Contents } from '@jupyterlab/services'; |
17 | 9 | import { ISignal, Signal } from '@lumino/signaling'; |
18 | 10 |
|
19 | 11 | import { LabChatModel } from './model'; |
@@ -123,12 +115,7 @@ export class LabChatModelFactory |
123 | 115 | implements DocumentRegistry.IModelFactory<LabChatModel> |
124 | 116 | { |
125 | 117 | constructor(options: LabChatModel.IOptions) { |
126 | | - this._user = options.user; |
127 | | - this._widgetConfig = options.widgetConfig; |
128 | | - this._commands = options.commands; |
129 | | - this._activeCellManager = options.activeCellManager ?? null; |
130 | | - this._selectionWatcher = options.selectionWatcher ?? null; |
131 | | - this._documentManager = options.documentManager ?? null; |
| 118 | + this._modelOptions = options; |
132 | 119 | } |
133 | 120 |
|
134 | 121 | collaborative = true; |
@@ -197,20 +184,10 @@ export class LabChatModelFactory |
197 | 184 | createNew(options: DocumentRegistry.IModelOptions<YChat>): LabChatModel { |
198 | 185 | return new LabChatModel({ |
199 | 186 | ...options, |
200 | | - user: this._user, |
201 | | - widgetConfig: this._widgetConfig, |
202 | | - commands: this._commands, |
203 | | - activeCellManager: this._activeCellManager, |
204 | | - selectionWatcher: this._selectionWatcher, |
205 | | - documentManager: this._documentManager |
| 187 | + ...this._modelOptions |
206 | 188 | }); |
207 | 189 | } |
208 | 190 |
|
209 | 191 | private _disposed = false; |
210 | | - private _user: User.IIdentity | null; |
211 | | - private _widgetConfig: IWidgetConfig; |
212 | | - private _commands?: CommandRegistry; |
213 | | - private _activeCellManager: IActiveCellManager | null; |
214 | | - private _selectionWatcher: ISelectionWatcher | null; |
215 | | - private _documentManager: IDocumentManager | null; |
| 192 | + private _modelOptions: Omit<LabChatModel.IOptions, 'sharedModel'>; |
216 | 193 | } |
0 commit comments