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
77micromamba activate my-jupyter-shared-drive
88micromamba install pip nodejs
99git clone https://github.com/davidbrochart/my-jupyter-shared-drive
10- cd my jupyter-shared-drive
10+ cd my- jupyter-shared-drive
1111pip install -e .
1212pip install jupyterlab
1313jupyter labextension develop --overwrite .
Original file line number Diff line number Diff line change 5353 "watch:labextension" : " jupyter labextension watch ."
5454 },
5555 "dependencies" : {
56+ "@jupyter/collaborative-drive" : " ^3.1.0" ,
5657 "@jupyter/my-shared-docprovider" : " ^0.1.0" ,
5758 "@jupyterlab/filebrowser" : " ^4.2.0"
5859 },
8788 "bundled" : false ,
8889 "singleton" : true
8990 },
91+ "@jupyter/collaborative-drive" : {
92+ "bundled" : true ,
93+ "singleton" : true
94+ },
9095 "@jupyter/my-shared-drive" : {
9196 "bundled" : false ,
9297 "singleton" : true
Original file line number Diff line number Diff line change @@ -158,7 +158,9 @@ export class MySharedDrive extends Drive implements ICollaborativeDrive {
158158 translator : this . _trans
159159 } ) ;
160160
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+ } ) ;
162164
163165 const key = `${ options . format } :${ options . contentType } :${ options . path } ` ;
164166 this . _providers . set ( key , provider ) ;
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export class MyProvider implements IDocumentProvider {
2929 this . _contentType = options . contentType ;
3030 this . _format = options . format ;
3131 this . _awareness = options . model . awareness ;
32+ this . _model = options . model ;
3233
3334 const user = options . user ;
3435
@@ -38,7 +39,10 @@ export class MyProvider implements IDocumentProvider {
3839 } )
3940 . catch ( e => console . error ( e ) ) ;
4041 user . userChanged . connect ( this . _onUserChanged , this ) ;
42+ }
4143
44+ setSource ( value : any ) : void {
45+ this . _model . setSource ( value ) ;
4246 this . _ready . resolve ( ) ;
4347 }
4448
@@ -82,6 +86,7 @@ export class MyProvider implements IDocumentProvider {
8286 private _format : string ;
8387 private _isDisposed : boolean ;
8488 private _ready = new PromiseDelegate < void > ( ) ;
89+ private _model : YDocument < DocumentChange > ;
8590}
8691
8792/**
Original file line number Diff line number Diff line change @@ -1754,7 +1754,7 @@ __metadata:
17541754 languageName : node
17551755 linkType : hard
17561756
1757- " @jupyter/collaborative-drive@npm:^3.0.0 " :
1757+ " @jupyter/collaborative-drive@npm:^3.0.0, @jupyter/collaborative-drive@npm:^3.1.0 " :
17581758 version : 3.1.0
17591759 resolution : " @jupyter/collaborative-drive@npm:3.1.0"
17601760 dependencies :
@@ -1793,6 +1793,7 @@ __metadata:
17931793 version : 0.0.0-use.local
17941794 resolution : " @jupyter/my-shared-docprovider-extension@workspace:packages/my-shared-docprovider-extension"
17951795 dependencies :
1796+ " @jupyter/collaborative-drive " : ^3.1.0
17961797 " @jupyter/my-shared-docprovider " : ^0.1.0
17971798 " @jupyterlab/builder " : ^4.0.5
17981799 " @jupyterlab/filebrowser " : ^4.2.0
You can’t perform that action at this time.
0 commit comments