File tree Expand file tree Collapse file tree 5 files changed +16
-3
lines changed
my-shared-docprovider-extension
my-shared-docprovider/src Expand file tree Collapse file tree 5 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ micromamba create -n my-jupyter-shared-drive
7
7
micromamba activate my-jupyter-shared-drive
8
8
micromamba install pip nodejs
9
9
git clone https://github.com/davidbrochart/my-jupyter-shared-drive
10
- cd my jupyter-shared-drive
10
+ cd my- jupyter-shared-drive
11
11
pip install -e .
12
12
pip install jupyterlab
13
13
jupyter labextension develop --overwrite .
Original file line number Diff line number Diff line change 53
53
"watch:labextension" : " jupyter labextension watch ."
54
54
},
55
55
"dependencies" : {
56
+ "@jupyter/collaborative-drive" : " ^3.1.0" ,
56
57
"@jupyter/my-shared-docprovider" : " ^0.1.0" ,
57
58
"@jupyterlab/filebrowser" : " ^4.2.0"
58
59
},
87
88
"bundled" : false ,
88
89
"singleton" : true
89
90
},
91
+ "@jupyter/collaborative-drive" : {
92
+ "bundled" : true ,
93
+ "singleton" : true
94
+ },
90
95
"@jupyter/my-shared-drive" : {
91
96
"bundled" : false ,
92
97
"singleton" : true
Original file line number Diff line number Diff line change @@ -158,7 +158,9 @@ export class MySharedDrive extends Drive implements ICollaborativeDrive {
158
158
translator : this . _trans
159
159
} ) ;
160
160
161
- super . get ( options . path , { content : true } ) . then ( model => { sharedModel . source = model . content ; } ) ;
161
+ super . get ( options . path , { content : true } ) . then ( model => {
162
+ provider . setSource ( model . content ) ;
163
+ } ) ;
162
164
163
165
const key = `${ options . format } :${ options . contentType } :${ options . path } ` ;
164
166
this . _providers . set ( key , provider ) ;
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export class MyProvider implements IDocumentProvider {
29
29
this . _contentType = options . contentType ;
30
30
this . _format = options . format ;
31
31
this . _awareness = options . model . awareness ;
32
+ this . _model = options . model ;
32
33
33
34
const user = options . user ;
34
35
@@ -38,7 +39,10 @@ export class MyProvider implements IDocumentProvider {
38
39
} )
39
40
. catch ( e => console . error ( e ) ) ;
40
41
user . userChanged . connect ( this . _onUserChanged , this ) ;
42
+ }
41
43
44
+ setSource ( value : any ) : void {
45
+ this . _model . setSource ( value ) ;
42
46
this . _ready . resolve ( ) ;
43
47
}
44
48
@@ -82,6 +86,7 @@ export class MyProvider implements IDocumentProvider {
82
86
private _format : string ;
83
87
private _isDisposed : boolean ;
84
88
private _ready = new PromiseDelegate < void > ( ) ;
89
+ private _model : YDocument < DocumentChange > ;
85
90
}
86
91
87
92
/**
Original file line number Diff line number Diff line change @@ -1754,7 +1754,7 @@ __metadata:
1754
1754
languageName : node
1755
1755
linkType : hard
1756
1756
1757
- " @jupyter/collaborative-drive@npm:^3.0.0 " :
1757
+ " @jupyter/collaborative-drive@npm:^3.0.0, @jupyter/collaborative-drive@npm:^3.1.0 " :
1758
1758
version : 3.1.0
1759
1759
resolution : " @jupyter/collaborative-drive@npm:3.1.0"
1760
1760
dependencies :
@@ -1793,6 +1793,7 @@ __metadata:
1793
1793
version : 0.0.0-use.local
1794
1794
resolution : " @jupyter/my-shared-docprovider-extension@workspace:packages/my-shared-docprovider-extension"
1795
1795
dependencies :
1796
+ " @jupyter/collaborative-drive " : ^3.1.0
1796
1797
" @jupyter/my-shared-docprovider " : ^0.1.0
1797
1798
" @jupyterlab/builder " : ^4.0.5
1798
1799
" @jupyterlab/filebrowser " : ^4.2.0
You can’t perform that action at this time.
0 commit comments