Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Sep 20, 2024
1 parent f416192 commit a24fafc
Show file tree
Hide file tree
Showing 4 changed files with 123 additions and 15 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,8 @@
"stylelint-prettier": "^3.0.0",
"typedoc": "~0.23.28",
"typescript": "~5.0.4"
},
"resolutions": {
"@jupyter/ydoc": "file:.yalc/@jupyter/ydoc"
}
}
37 changes: 32 additions & 5 deletions packages/docprovider/src/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,38 @@ export async function requestUndoRedo(
): Promise<any> {
const settings = ServerConnection.makeSettings();
let url = URLExt.join(
settings.baseUrl,
DOC_FORK_URL,
encodeURIComponent(roomid)
);

url = url.concat(`?action=${action}&&steps=${steps}&&forkRoom=${forkRoom}`);

const body = { method: 'PUT' };

let response: Response;
try {
response = await ServerConnection.makeRequest(url, body, settings);
} catch (error) {
throw new ServerConnection.NetworkError(error as Error);
}

let data: any = await response.text();

if (data.length > 0) {
try {
data = JSON.parse(data);
} catch (error) {
console.log('Not a JSON response body.', response);
}
}

if (!response.ok) {
throw new ServerConnection.ResponseError(response, data.message || data);
}

return data;
}

export async function requestDocFork(
roomid: string,
Expand All @@ -121,10 +153,6 @@ export async function requestDocFork(
encodeURIComponent(roomid)
);

url = url.concat(`?action=${action}&&steps=${steps}&&forkRoom=${forkRoom}`);

const body = { method: 'PUT' };
=======
const body = {method: 'PUT'};

let response: Response;
Expand Down Expand Up @@ -204,7 +232,6 @@ export async function requestDocDelete(
method: 'DELETE',
body: JSON.stringify({ fork_roomid: forkRoomid, root_roomid: rootRoomid })
};
>>>>>>> f64d251 (Support suggestions)

let response: Response;
try {
Expand Down
4 changes: 1 addition & 3 deletions projects/jupyter-server-ydoc/jupyter_server_ydoc/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import asyncio
import json
import time
import uuid
from logging import Logger
from typing import Any
from uuid import uuid4
Expand Down Expand Up @@ -36,8 +35,7 @@

YFILE = YDOCS["file"]


SERVER_SESSION = str(uuid.uuid4())
SERVER_SESSION = str(uuid4())
FORK_DOCUMENTS = {}


Expand Down
94 changes: 87 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2224,13 +2224,6 @@ __metadata:
"@jupyter/ydoc@npm:^2.0.0 || ^3.0.0-a3":
version: 3.0.0-a4
resolution: "@jupyter/ydoc@npm:3.0.0-a4"
dependencies:
"@jupyterlab/nbformat": ^3.0.0 || ^4.0.0-alpha.21 || ^4.0.0
"@lumino/coreutils": ^1.11.0 || ^2.0.0
"@lumino/disposable": ^1.10.0 || ^2.0.0
"@lumino/signaling": ^1.10.0 || ^2.0.0
y-protocols: ^1.0.5
yjs: ^13.5.40
checksum: ccd4d8b3c46346e14e4e20f093c0147349c403f1a61d624bc01a95fb805f41c8c5c4db54c5c43c59dc2ef7aeebb53a451a7fc75875c144578bf180c0d20c1878
languageName: node
linkType: hard
Expand All @@ -2246,6 +2239,37 @@ __metadata:
y-protocols: ^1.0.5
yjs: ^13.5.40
checksum: f10268d4d990f454279e3908a172755ed5885fa81bb70c31bdf66923598b283d26491741bece137d1c348619861e9b7f8354296773fe5352b1915e69101a9fb0
=======
checksum: 18ec446906af603ec9a9b78d891e6b2967f5cb934ffc724e0ad0f1640af82d7f06f64123ecf53fffb202b9cc2f1f10e909b75df06e6df313a84865635112df07
languageName: node
linkType: hard

"@jupyterlab/application@npm:^4.0.0":
version: 4.2.5
resolution: "@jupyterlab/application@npm:4.2.5"
dependencies:
"@fortawesome/fontawesome-free": ^5.12.0
"@jupyterlab/apputils": ^4.3.5
"@jupyterlab/coreutils": ^6.2.5
"@jupyterlab/docregistry": ^4.2.5
"@jupyterlab/rendermime": ^4.2.5
"@jupyterlab/rendermime-interfaces": ^3.10.5
"@jupyterlab/services": ^7.2.5
"@jupyterlab/statedb": ^4.2.5
"@jupyterlab/translation": ^4.2.5
"@jupyterlab/ui-components": ^4.2.5
"@lumino/algorithm": ^2.0.1
"@lumino/application": ^2.3.1
"@lumino/commands": ^2.3.0
"@lumino/coreutils": ^2.1.2
"@lumino/disposable": ^2.1.2
"@lumino/messaging": ^2.0.1
"@lumino/polling": ^2.1.2
"@lumino/properties": ^2.0.1
"@lumino/signaling": ^2.1.2
"@lumino/widgets": ^2.3.2
checksum: c424ea191ef4da45eeae44e366e2b3cb23426cc72c0321226c83000c02b91fa7c4bc54978aa0b0e9416211cce9c17469204fc2b133cb2bec3d8896a0b2f75ce1
>>>>>>> 4b5fdf7 (-)
languageName: node
linkType: hard

Expand Down Expand Up @@ -2652,6 +2676,15 @@ __metadata:
languageName: node
linkType: hard

"@jupyterlab/nbformat@npm:^4.2.5":
version: 4.2.5
resolution: "@jupyterlab/nbformat@npm:4.2.5"
dependencies:
"@lumino/coreutils": ^2.1.2
checksum: b3ad2026969bfa59f8cfb7b1a991419f96f7e6dc8c4acf4ac166c210d7ab99631350c785e9b04350095488965d2824492c8adbff24a2e26db615457545426b3c
languageName: node
linkType: hard

"@jupyterlab/notebook@npm:^4.2.0":
version: 4.2.4
resolution: "@jupyterlab/notebook@npm:4.2.4"
Expand Down Expand Up @@ -2822,6 +2855,22 @@ __metadata:
languageName: node
linkType: hard

"@jupyterlab/statusbar@npm:^4.2.5":
version: 4.2.5
resolution: "@jupyterlab/statusbar@npm:4.2.5"
dependencies:
"@jupyterlab/ui-components": ^4.2.5
"@lumino/algorithm": ^2.0.1
"@lumino/coreutils": ^2.1.2
"@lumino/disposable": ^2.1.2
"@lumino/messaging": ^2.0.1
"@lumino/signaling": ^2.1.2
"@lumino/widgets": ^2.3.2
react: ^18.2.0
checksum: fa429b88a5bcd6889b9ac32b5f2500cb10a968cc636ca8dede17972535cc47454cb7fc96518fc8def76935f826b66b071752d0fd26afdacba579f6f3785e97b2
languageName: node
linkType: hard

"@jupyterlab/testing@npm:^4.0.0":
version: 4.2.4
resolution: "@jupyterlab/testing@npm:4.2.4"
Expand Down Expand Up @@ -2911,6 +2960,37 @@ __metadata:
languageName: node
linkType: hard

"@jupyterlab/ui-components@npm:^4.2.5":
version: 4.2.5
resolution: "@jupyterlab/ui-components@npm:4.2.5"
dependencies:
"@jupyter/react-components": ^0.15.3
"@jupyter/web-components": ^0.15.3
"@jupyterlab/coreutils": ^6.2.5
"@jupyterlab/observables": ^5.2.5
"@jupyterlab/rendermime-interfaces": ^3.10.5
"@jupyterlab/translation": ^4.2.5
"@lumino/algorithm": ^2.0.1
"@lumino/commands": ^2.3.0
"@lumino/coreutils": ^2.1.2
"@lumino/disposable": ^2.1.2
"@lumino/messaging": ^2.0.1
"@lumino/polling": ^2.1.2
"@lumino/properties": ^2.0.1
"@lumino/signaling": ^2.1.2
"@lumino/virtualdom": ^2.0.1
"@lumino/widgets": ^2.3.2
"@rjsf/core": ^5.13.4
"@rjsf/utils": ^5.13.4
react: ^18.2.0
react-dom: ^18.2.0
typestyle: ^2.0.4
peerDependencies:
react: ^18.2.0
checksum: 9d2b887910a3b0d41645388c5ac6183d6fd2f3af4567de9b077b2492b1a9380f98c4598a4ae6d1c3186624ed4f956bedf8ba37adb5f772c96555761384a93e1e
languageName: node
linkType: hard

"@lerna/child-process@npm:6.6.2":
version: 6.6.2
resolution: "@lerna/child-process@npm:6.6.2"
Expand Down

0 comments on commit a24fafc

Please sign in to comment.