jupyterlab-chat 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/factory.d.ts +7 -0
- package/lib/factory.js +10 -0
- package/lib/widget.d.ts +3 -3
- package/lib/widget.js +3 -3
- package/package.json +3 -3
- package/src/factory.ts +10 -0
- package/src/widget.tsx +6 -6
package/lib/factory.d.ts
CHANGED
|
@@ -48,6 +48,13 @@ export declare class ChatWidgetFactory extends ABCWidgetFactory<LabChatPanel, La
|
|
|
48
48
|
* @returns The widget
|
|
49
49
|
*/
|
|
50
50
|
protected createNewWidget(context: ChatWidgetFactory.IContext): LabChatPanel;
|
|
51
|
+
/**
|
|
52
|
+
* IMPORTANT: this property must be defined to use the `RtcContentProvider`
|
|
53
|
+
* registered by `jupyter_collaboration`. Without this, the chat document
|
|
54
|
+
* widgets will not connect.
|
|
55
|
+
*/
|
|
56
|
+
get contentProviderId(): string;
|
|
57
|
+
set contentProviderId(_value: string | undefined);
|
|
51
58
|
private _themeManager;
|
|
52
59
|
private _rmRegistry;
|
|
53
60
|
private _chatCommandRegistry?;
|
package/lib/factory.js
CHANGED
|
@@ -77,6 +77,16 @@ export class ChatWidgetFactory extends ABCWidgetFactory {
|
|
|
77
77
|
content: new ChatWidget(context)
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* IMPORTANT: this property must be defined to use the `RtcContentProvider`
|
|
82
|
+
* registered by `jupyter_collaboration`. Without this, the chat document
|
|
83
|
+
* widgets will not connect.
|
|
84
|
+
*/
|
|
85
|
+
get contentProviderId() {
|
|
86
|
+
return 'rtc';
|
|
87
|
+
}
|
|
88
|
+
// Must override both getter and setter from ABCFactory for type compatibility.
|
|
89
|
+
set contentProviderId(_value) { }
|
|
80
90
|
}
|
|
81
91
|
export class LabChatModelFactory {
|
|
82
92
|
constructor(options) {
|
package/lib/widget.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatWidget, IAttachmentOpenerRegistry, IChatCommandRegistry, IChatModel, IMessageFooterRegistry } from '@jupyter/chat';
|
|
2
|
-
import {
|
|
2
|
+
import { Contents } from '@jupyterlab/services';
|
|
3
3
|
import { IThemeManager } from '@jupyterlab/apputils';
|
|
4
4
|
import { DocumentWidget } from '@jupyterlab/docregistry';
|
|
5
5
|
import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
|
|
@@ -84,7 +84,7 @@ export declare class ChatPanel extends SidePanel {
|
|
|
84
84
|
private _chatNamesChanged;
|
|
85
85
|
private _commands;
|
|
86
86
|
private _defaultDirectory;
|
|
87
|
-
private
|
|
87
|
+
private _contentsManager;
|
|
88
88
|
private _openChat;
|
|
89
89
|
private _rmRegistry;
|
|
90
90
|
private _themeManager;
|
|
@@ -103,7 +103,7 @@ export declare namespace ChatPanel {
|
|
|
103
103
|
*/
|
|
104
104
|
interface IOptions extends SidePanel.IOptions {
|
|
105
105
|
commands: CommandRegistry;
|
|
106
|
-
|
|
106
|
+
contentsManager: Contents.IManager;
|
|
107
107
|
rmRegistry: IRenderMimeRegistry;
|
|
108
108
|
themeManager: IThemeManager | null;
|
|
109
109
|
defaultDirectory: string;
|
package/lib/widget.js
CHANGED
|
@@ -69,9 +69,9 @@ export class ChatPanel extends SidePanel {
|
|
|
69
69
|
*/
|
|
70
70
|
this.updateChatList = async () => {
|
|
71
71
|
const extension = chatFileType.extensions[0];
|
|
72
|
-
this.
|
|
72
|
+
this._contentsManager
|
|
73
73
|
.get(this._defaultDirectory)
|
|
74
|
-
.then(contentModel => {
|
|
74
|
+
.then((contentModel) => {
|
|
75
75
|
const chatsNames = {};
|
|
76
76
|
contentModel.content
|
|
77
77
|
.filter(f => f.type === 'file' && f.name.endsWith(extension))
|
|
@@ -101,7 +101,7 @@ export class ChatPanel extends SidePanel {
|
|
|
101
101
|
this._chatNamesChanged = new Signal(this);
|
|
102
102
|
this.addClass(SIDEPANEL_CLASS);
|
|
103
103
|
this._commands = options.commands;
|
|
104
|
-
this.
|
|
104
|
+
this._contentsManager = options.contentsManager;
|
|
105
105
|
this._rmRegistry = options.rmRegistry;
|
|
106
106
|
this._themeManager = options.themeManager;
|
|
107
107
|
this._defaultDirectory = options.defaultDirectory;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jupyterlab-chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "The library to build a chat based on shared document",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"watch:src": "tsc -w --sourceMap"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@jupyter/chat": "^0.
|
|
46
|
-
"@jupyter/collaborative-drive": "^
|
|
45
|
+
"@jupyter/chat": "^0.13.0",
|
|
46
|
+
"@jupyter/collaborative-drive": "^4.0.2",
|
|
47
47
|
"@jupyter/ydoc": "^2.0.0 || ^3.0.0",
|
|
48
48
|
"@jupyterlab/application": "^4.2.0",
|
|
49
49
|
"@jupyterlab/apputils": "^4.3.0",
|
package/src/factory.ts
CHANGED
|
@@ -111,6 +111,16 @@ export class ChatWidgetFactory extends ABCWidgetFactory<
|
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
+
/**
|
|
115
|
+
* IMPORTANT: this property must be defined to use the `RtcContentProvider`
|
|
116
|
+
* registered by `jupyter_collaboration`. Without this, the chat document
|
|
117
|
+
* widgets will not connect.
|
|
118
|
+
*/
|
|
119
|
+
get contentProviderId(): string {
|
|
120
|
+
return 'rtc';
|
|
121
|
+
}
|
|
122
|
+
// Must override both getter and setter from ABCFactory for type compatibility.
|
|
123
|
+
set contentProviderId(_value: string | undefined) {}
|
|
114
124
|
private _themeManager: IThemeManager | null;
|
|
115
125
|
private _rmRegistry: IRenderMimeRegistry;
|
|
116
126
|
private _chatCommandRegistry?: IChatCommandRegistry;
|
package/src/widget.tsx
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
IMessageFooterRegistry,
|
|
13
13
|
readIcon
|
|
14
14
|
} from '@jupyter/chat';
|
|
15
|
-
import {
|
|
15
|
+
import { Contents } from '@jupyterlab/services';
|
|
16
16
|
import { IThemeManager } from '@jupyterlab/apputils';
|
|
17
17
|
import { PathExt } from '@jupyterlab/coreutils';
|
|
18
18
|
import { DocumentWidget } from '@jupyterlab/docregistry';
|
|
@@ -105,7 +105,7 @@ export class ChatPanel extends SidePanel {
|
|
|
105
105
|
super(options);
|
|
106
106
|
this.addClass(SIDEPANEL_CLASS);
|
|
107
107
|
this._commands = options.commands;
|
|
108
|
-
this.
|
|
108
|
+
this._contentsManager = options.contentsManager;
|
|
109
109
|
this._rmRegistry = options.rmRegistry;
|
|
110
110
|
this._themeManager = options.themeManager;
|
|
111
111
|
this._defaultDirectory = options.defaultDirectory;
|
|
@@ -205,9 +205,9 @@ export class ChatPanel extends SidePanel {
|
|
|
205
205
|
*/
|
|
206
206
|
updateChatList = async (): Promise<void> => {
|
|
207
207
|
const extension = chatFileType.extensions[0];
|
|
208
|
-
this.
|
|
208
|
+
this._contentsManager
|
|
209
209
|
.get(this._defaultDirectory)
|
|
210
|
-
.then(contentModel => {
|
|
210
|
+
.then((contentModel: Contents.IModel) => {
|
|
211
211
|
const chatsNames: { [name: string]: string } = {};
|
|
212
212
|
(contentModel.content as any[])
|
|
213
213
|
.filter(f => f.type === 'file' && f.name.endsWith(extension))
|
|
@@ -300,7 +300,7 @@ export class ChatPanel extends SidePanel {
|
|
|
300
300
|
);
|
|
301
301
|
private _commands: CommandRegistry;
|
|
302
302
|
private _defaultDirectory: string;
|
|
303
|
-
private
|
|
303
|
+
private _contentsManager: Contents.IManager;
|
|
304
304
|
private _openChat: ReactWidget;
|
|
305
305
|
private _rmRegistry: IRenderMimeRegistry;
|
|
306
306
|
private _themeManager: IThemeManager | null;
|
|
@@ -320,7 +320,7 @@ export namespace ChatPanel {
|
|
|
320
320
|
*/
|
|
321
321
|
export interface IOptions extends SidePanel.IOptions {
|
|
322
322
|
commands: CommandRegistry;
|
|
323
|
-
|
|
323
|
+
contentsManager: Contents.IManager;
|
|
324
324
|
rmRegistry: IRenderMimeRegistry;
|
|
325
325
|
themeManager: IThemeManager | null;
|
|
326
326
|
defaultDirectory: string;
|