Skip to content

Commit

Permalink
Update to jupyterlab 4.2.x (#66)
Browse files Browse the repository at this point in the history
* Update to jupyterlab 4.2.x

* Pin jupyter-collaboration>2,<3
  • Loading branch information
brichet authored Jul 16, 2024
1 parent f539c6d commit 2f4a533
Show file tree
Hide file tree
Showing 8 changed files with 1,656 additions and 1,608 deletions.
6 changes: 3 additions & 3 deletions packages/jupyter-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"@emotion/react": "^11.10.5",
"@emotion/styled": "^11.10.5",
"@jupyter/react-components": "^0.15.2",
"@jupyterlab/apputils": "^4.0.0",
"@jupyterlab/rendermime": "^4.0.0",
"@jupyterlab/ui-components": "^4.0.0",
"@jupyterlab/apputils": "^4.3.0",
"@jupyterlab/rendermime": "^4.2.0",
"@jupyterlab/ui-components": "^4.2.0",
"@lumino/commands": "^2.0.0",
"@lumino/disposable": "^2.0.0",
"@lumino/signaling": "^2.0.0",
Expand Down
29 changes: 15 additions & 14 deletions packages/jupyterlab-collaborative-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,19 @@
},
"dependencies": {
"@jupyter/chat": "^0.2.0",
"@jupyter/collaboration": "^2.0.11",
"@jupyter/docprovider": "^2.0.11",
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/apputils": "^4.0.0",
"@jupyterlab/coreutils": "^6.0.0",
"@jupyterlab/docregistry": "^4.0.0",
"@jupyterlab/launcher": "^4.0.0",
"@jupyterlab/rendermime": "^4.0.0",
"@jupyterlab/services": "^7.0.0",
"@jupyterlab/settingregistry": "^4.0.0",
"@jupyterlab/translation": "^4.0.0",
"@jupyterlab/ui-components": "^4.0.0",
"@jupyter/collaboration": "^2.1.0",
"@jupyter/docprovider": "^2.1.0",
"@jupyter/ydoc": "^1.1.1",
"@jupyterlab/application": "^4.2.0",
"@jupyterlab/apputils": "^4.3.0",
"@jupyterlab/coreutils": "^6.2.0",
"@jupyterlab/docregistry": "^4.2.0",
"@jupyterlab/launcher": "^4.2.0",
"@jupyterlab/rendermime": "^4.2.0",
"@jupyterlab/services": "^7.2.0",
"@jupyterlab/settingregistry": "^4.2.0",
"@jupyterlab/translation": "^4.2.0",
"@jupyterlab/ui-components": "^4.2.0",
"@lumino/commands": "^2.0.0",
"@lumino/coreutils": "^2.0.0",
"@lumino/signaling": "^2.0.0",
Expand All @@ -79,8 +80,8 @@
"yjs": "^13.5.40"
},
"devDependencies": {
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/testutils": "^4.0.0",
"@jupyterlab/builder": "^4.2.0",
"@jupyterlab/testutils": "^4.2.0",
"@types/jest": "^29.2.0",
"@types/json-schema": "^7.0.11",
"@types/react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jupyterlab-collaborative-chat/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ classifiers = [
]
dependencies = [
"jupyterlab~=4.0",
"jupyter_collaboration",
"jupyter_collaboration>=2,<3",
"jupyter_server>=2.0.1,<3",
"jupyter_ydoc>=2.0.0,<3.0.0",
"pycrdt"
Expand Down
7 changes: 5 additions & 2 deletions packages/jupyterlab-collaborative-chat/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import {
chatIcon,
readIcon
} from '@jupyter/chat';
import { ICollaborativeDrive } from '@jupyter/docprovider';
import {
ICollaborativeDrive,
SharedDocumentFactory
} from '@jupyter/docprovider';
import {
ILayoutRestorer,
JupyterFrontEnd,
Expand Down Expand Up @@ -174,7 +177,7 @@ const docFactories: JupyterFrontEndPlugin<IChatFactory> = {
app.docRegistry.addFileType(chatFileType);

if (drive) {
const chatFactory = () => {
const chatFactory: SharedDocumentFactory = () => {
return YChat.create();
};
drive.sharedModelFactory.registerDocumentFactory('chat', chatFactory);
Expand Down
4 changes: 2 additions & 2 deletions packages/jupyterlab-collaborative-chat/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { PartialJSONObject, UUID } from '@lumino/coreutils';
import { ISignal, Signal } from '@lumino/signaling';

import { IWidgetConfig } from './token';
import { ChatChanges, IYmessage, YChat } from './ychat';
import { IChatChanges, IYmessage, YChat } from './ychat';

/**
* Collaborative chat namespace.
Expand Down Expand Up @@ -171,7 +171,7 @@ export class CollaborativeChatModel
this.sharedModel.updateMessage(index, message);
}

private _onchange = (_: YChat, changes: ChatChanges) => {
private _onchange = (_: YChat, changes: IChatChanges) => {
if (changes.messageChanges) {
const msgDelta = changes.messageChanges;
let index = 0;
Expand Down
12 changes: 6 additions & 6 deletions packages/jupyterlab-collaborative-chat/src/ychat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type IMetadata = PartialJSONValue;
/**
* Definition of the shared Chat changes.
*/
export type ChatChanges = DocumentChange & {
export interface IChatChanges extends DocumentChange {
/**
* Changes in messages.
*/
Expand All @@ -34,7 +34,7 @@ export type ChatChanges = DocumentChange & {
* Changes in metadata.
*/
metadataChanges?: MetadataChange[];
};
}

/**
* The message change type.
Expand All @@ -54,7 +54,7 @@ export type MetadataChange = IMapChange<IMetadata>;
/**
* The collaborative chat shared document.
*/
export class YChat extends YDocument<ChatChanges> {
export class YChat extends YDocument<IChatChanges> {
/**
* Create a new collaborative chat model.
*/
Expand Down Expand Up @@ -169,14 +169,14 @@ export class YChat extends YDocument<ChatChanges> {
}
});

this._changed.emit({ userChange: userChange } as Partial<ChatChanges>);
this._changed.emit({ userChange: userChange } as Partial<IChatChanges>);
};

private _messagesObserver = (event: Y.YArrayEvent<IYmessage>): void => {
const messageChanges = event.delta;
this._changed.emit({
messageChanges: messageChanges
} as Partial<ChatChanges>);
} as Partial<IChatChanges>);
};

private _metadataObserver = (event: Y.YMapEvent<IMetadata>): void => {
Expand Down Expand Up @@ -210,7 +210,7 @@ export class YChat extends YDocument<ChatChanges> {

this._changed.emit({
metadataChanges: metadataChange
} as Partial<ChatChanges>);
} as Partial<IChatChanges>);
};

private _users: Y.Map<IUser>;
Expand Down
14 changes: 7 additions & 7 deletions packages/jupyterlab-ws-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@
},
"dependencies": {
"@jupyter/chat": "^0.2.0",
"@jupyterlab/apputils": "^4.0.0",
"@jupyterlab/coreutils": "^6.0.0",
"@jupyterlab/rendermime": "^4.0.0",
"@jupyterlab/services": "^7.0.0",
"@jupyterlab/settingregistry": "^4.0.0",
"@jupyterlab/apputils": "^4.3.0",
"@jupyterlab/coreutils": "^6.2.0",
"@jupyterlab/rendermime": "^4.2.0",
"@jupyterlab/services": "^7.2.0",
"@jupyterlab/settingregistry": "^4.2.0",
"@lumino/coreutils": "^2.0.0"
},
"devDependencies": {
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/testutils": "^4.0.0",
"@jupyterlab/builder": "^4.2.0",
"@jupyterlab/testutils": "^4.2.0",
"@types/json-schema": "^7.0.11",
"@types/react": "^18.2.0",
"@types/react-addons-linked-state-mixin": "^0.14.22",
Expand Down
Loading

0 comments on commit 2f4a533

Please sign in to comment.