@@ -9,8 +9,6 @@ import { Title, Widget } from '@lumino/widgets';
99import {
1010 INotebookTracker ,
1111 NotebookPanel ,
12- // Notebook,
13- // ExecutionIndicator,
1412 INotebookModel
1513} from '@jupyterlab/notebook' ;
1614import { IStatusBar } from '@jupyterlab/statusbar' ;
@@ -24,16 +22,12 @@ import {
2422 SessionContextDialogs
2523} from '@jupyterlab/apputils' ;
2624import { KeyboardEvent } from 'react' ;
27- import {
28- IToolbarWidgetRegistry ,
29- } from '@jupyterlab/apputils' ;
30- import {
31- AwarenessExecutionIndicator
32- } from './executionindicator' ;
25+ import { IToolbarWidgetRegistry } from '@jupyterlab/apputils' ;
26+ import { AwarenessExecutionIndicator } from './executionindicator' ;
3327
3428import { IEditorServices } from '@jupyterlab/codeeditor' ;
3529import { requestAPI } from './handler' ;
36- import { YNotebookContentFactory } from './notebook' ;
30+ import { RtcNotebookContentFactory } from './notebook' ;
3731
3832import { rtcContentProvider , yfile , ynotebook , logger } from './docprovider' ;
3933
@@ -43,12 +37,10 @@ import * as Y from 'yjs';
4337import { Awareness } from 'y-protocols/awareness' ;
4438import { IAwareness } from '@jupyter/ydoc' ;
4539
46- import {
47- AwarenessKernelStatus
48- } from './kernelstatus' ;
4940import { ServerConnection } from '@jupyterlab/services' ;
5041import { WebSocketAwarenessProvider } from './docprovider/awareness' ;
5142import { URLExt } from '@jupyterlab/coreutils' ;
43+ import { AwarenessKernelStatus } from './kernelstatus' ;
5244/**
5345 * Initialization data for the @jupyter/rtc-core extension.
5446 */
@@ -98,7 +90,6 @@ export const rtcGlobalAwarenessPlugin: JupyterFrontEndPlugin<IAwareness> = {
9890 requires : [ IStateDB ] ,
9991 provides : IGlobalAwareness ,
10092 activate : ( app : JupyterFrontEnd , state : StateDB ) : IAwareness => {
101- // @ts -ignore
10293 const { user } = app . serviceManager ;
10394
10495 const ydoc = new Y . Doc ( ) ;
@@ -132,20 +123,18 @@ export const rtcGlobalAwarenessPlugin: JupyterFrontEndPlugin<IAwareness> = {
132123 }
133124} ;
134125
135- class AwarenessExecutionIndicatorIcon implements DocumentRegistry . IWidgetExtension <
136- NotebookPanel ,
137- INotebookModel
138- > {
139- createNew ( panel : NotebookPanel ) : IDisposable {
140- let item = new AwarenessExecutionIndicator ( )
141- let nb = panel . content ;
142- item . model . attachNotebook ( { content : nb } )
126+ class AwarenessExecutionIndicatorIcon
127+ implements DocumentRegistry . IWidgetExtension < NotebookPanel , INotebookModel >
128+ {
129+ createNew ( panel : NotebookPanel ) : IDisposable {
130+ const item = new AwarenessExecutionIndicator ( ) ;
131+ const nb = panel . content ;
132+ item . model . attachNotebook ( { content : nb } ) ;
143133 panel . toolbar . insertAfter ( 'kernelName' , 'awarenessExecutionProgress' , item ) ;
144- return item
134+ return item ;
145135 }
146136}
147137
148-
149138/**
150139 * A plugin that provides a execution indicator item to the status bar.
151140 */
@@ -162,17 +151,18 @@ export const executionIndicator: JupyterFrontEndPlugin<void> = {
162151 translator : ITranslator ,
163152 statusBar : IStatusBar | null ,
164153 settingRegistry : ISettingRegistry | null ,
165- toolbarRegistry : IToolbarWidgetRegistry ,
154+ toolbarRegistry : IToolbarWidgetRegistry
166155 ) => {
167- console . log ( "JupyterLab extension activated: Awareness Execution Indicator" )
156+ console . log (
157+ 'JupyterLab extension activated: Awareness Execution Indicator'
158+ ) ;
168159 app . docRegistry . addWidgetExtension (
169- " Notebook" ,
160+ ' Notebook' ,
170161 new AwarenessExecutionIndicatorIcon ( )
171- )
162+ ) ;
172163 }
173164} ;
174165
175-
176166/**
177167 * A plugin that provides a kernel status item to the status bar.
178168 */
@@ -190,7 +180,9 @@ export const kernelStatus: JupyterFrontEndPlugin<IKernelStatusModel> = {
190180 translator_ : ITranslator | null ,
191181 labShell : ILabShell | null
192182 ) : IKernelStatusModel => {
193- console . log ( "JupyterLab extension activated: Awareness Kernel Status Indicator" )
183+ console . log (
184+ 'JupyterLab extension activated: Awareness Kernel Status Indicator'
185+ ) ;
194186 const translator = translator_ ?? nullTranslator ;
195187 const sessionDialogs =
196188 sessionDialogs_ ?? new SessionContextDialogs ( { translator } ) ;
@@ -249,7 +241,7 @@ export const kernelStatus: JupyterFrontEndPlugin<IKernelStatusModel> = {
249241 if ( oldValue ) {
250242 oldValue . title . changed . disconnect ( onTitleChanged ) ;
251243 }
252-
244+
253245 item . model . attachDocument ( newValue ) ;
254246 item . model . sessionContext =
255247 [ ...providers ]
@@ -284,7 +276,6 @@ export const kernelStatus: JupyterFrontEndPlugin<IKernelStatusModel> = {
284276 }
285277} ;
286278
287-
288279/**
289280 * The notebook cell factory provider.
290281 */
@@ -296,7 +287,7 @@ const factory: JupyterFrontEndPlugin<NotebookPanel.IContentFactory> = {
296287 autoStart : true ,
297288 activate : ( app : JupyterFrontEnd , editorServices : IEditorServices ) => {
298289 const editorFactory = editorServices . factoryService . newInlineEditor ;
299- return new YNotebookContentFactory ( { editorFactory } ) ;
290+ return new RtcNotebookContentFactory ( { editorFactory } ) ;
300291 }
301292} ;
302293
@@ -313,4 +304,3 @@ const plugins: JupyterFrontEndPlugin<unknown>[] = [
313304] ;
314305
315306export default plugins ;
316-
0 commit comments