@jupyter/docprovider 5.0.1 → 5.0.3
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/ydrive.js +10 -10
- package/lib/yprovider.js +3 -1
- package/package.json +2 -2
package/lib/ydrive.js
CHANGED
|
@@ -107,6 +107,15 @@ export class RtcContentProvider {
|
|
|
107
107
|
documents.push(newPath);
|
|
108
108
|
(_b = this._globalAwareness) === null || _b === void 0 ? void 0 : _b.setLocalStateField('documents', documents);
|
|
109
109
|
}
|
|
110
|
+
// Notify the ContentsManager/DocumentContext regardless of whether
|
|
111
|
+
// the rename was first reported by the drive or the shared model.
|
|
112
|
+
// Emitting this also feeds back into the drive signal, but the path
|
|
113
|
+
// check above makes that notification idempotent.
|
|
114
|
+
this._providerFileChanged.emit({
|
|
115
|
+
type: 'rename',
|
|
116
|
+
oldValue: { path: oldPath },
|
|
117
|
+
newValue: { path: newPath }
|
|
118
|
+
});
|
|
110
119
|
return true;
|
|
111
120
|
};
|
|
112
121
|
// The information about file being renamed can come from two places:
|
|
@@ -140,16 +149,7 @@ export class RtcContentProvider {
|
|
|
140
149
|
}
|
|
141
150
|
const pathChanges = change.stateChange.filter(change => change.name === 'path');
|
|
142
151
|
for (const pathChange of pathChanges) {
|
|
143
|
-
|
|
144
|
-
// The drive emits a rename directly in the client that initiated
|
|
145
|
-
// it. Other clients learn about it through the shared model, so
|
|
146
|
-
// proxy that change to their ContentsManager/DocumentContext too.
|
|
147
|
-
this._providerFileChanged.emit({
|
|
148
|
-
type: 'rename',
|
|
149
|
-
oldValue: { path: pathChange.oldValue },
|
|
150
|
-
newValue: { path: pathChange.newValue }
|
|
151
|
-
});
|
|
152
|
-
}
|
|
152
|
+
handlePathChange(pathChange);
|
|
153
153
|
}
|
|
154
154
|
const hashChanges = change.stateChange.filter(change => change.name === 'hash');
|
|
155
155
|
if (hashChanges.length === 0) {
|
package/lib/yprovider.js
CHANGED
|
@@ -413,7 +413,9 @@ export class WebSocketProvider {
|
|
|
413
413
|
case 'initialization_error':
|
|
414
414
|
return {
|
|
415
415
|
title: trans.__('Document error'),
|
|
416
|
-
body:
|
|
416
|
+
body: payload.errorReason
|
|
417
|
+
? trans.__(payload.errorReason)
|
|
418
|
+
: trans.__('Failed to initialize the document. Close this tab and reopen the file.')
|
|
417
419
|
};
|
|
418
420
|
case 'unknown_session':
|
|
419
421
|
default:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyter/docprovider",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"description": "JupyterLab - Document Provider",
|
|
5
5
|
"homepage": "https://github.com/jupyterlab/jupyter-collaboration",
|
|
6
6
|
"bugs": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"watch": "tsc -b --watch"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@jupyter/collaborative-drive": "^5.0.
|
|
44
|
+
"@jupyter/collaborative-drive": "^5.0.3",
|
|
45
45
|
"@jupyter/ydoc": "^4.0.0",
|
|
46
46
|
"@jupyterlab/apputils": "^4.7.0",
|
|
47
47
|
"@jupyterlab/cells": "^4.6.0",
|