@@ -144,7 +144,7 @@ export function registerWidgetManager(
144
144
/**
145
145
* The widget manager provider.
146
146
*/
147
- const plugin : JupyterFrontEndPlugin < base . IJupyterWidgetRegistry > = {
147
+ export const managerPlugin : JupyterFrontEndPlugin < base . IJupyterWidgetRegistry > = {
148
148
id : '@jupyter-widgets/jupyterlab-manager:plugin' ,
149
149
requires : [ IRenderMimeRegistry ] ,
150
150
optional : [
@@ -159,7 +159,6 @@ const plugin: JupyterFrontEndPlugin<base.IJupyterWidgetRegistry> = {
159
159
autoStart : true ,
160
160
} ;
161
161
162
- export default plugin ;
163
162
164
163
function updateSettings ( settings : ISettingRegistry . ISettings ) : void {
165
164
SETTINGS . saveState = settings . get ( 'saveState' ) . composite as boolean ;
@@ -277,47 +276,6 @@ function activateWidgetExtension(
277
276
] ) ;
278
277
}
279
278
280
- WIDGET_REGISTRY . push ( {
281
- name : '@jupyter-widgets/base' ,
282
- version : base . JUPYTER_WIDGETS_VERSION ,
283
- exports : {
284
- WidgetModel : base . WidgetModel ,
285
- WidgetView : base . WidgetView ,
286
- DOMWidgetView : base . DOMWidgetView ,
287
- DOMWidgetModel : base . DOMWidgetModel ,
288
- LayoutModel : base . LayoutModel ,
289
- LayoutView : base . LayoutView ,
290
- StyleModel : base . StyleModel ,
291
- StyleView : base . StyleView ,
292
- ErrorWidgetView : base . ErrorWidgetView ,
293
- } ,
294
- } ) ;
295
-
296
- WIDGET_REGISTRY . push ( {
297
- name : '@jupyter-widgets/controls' ,
298
- version : JUPYTER_CONTROLS_VERSION ,
299
- exports : ( ) => {
300
- return new Promise ( ( resolve , reject ) => {
301
- ( require as any ) . ensure (
302
- [ '@jupyter-widgets/controls' ] ,
303
- ( require : NodeRequire ) => {
304
- // eslint-disable-next-line @typescript-eslint/no-var-requires
305
- resolve ( require ( '@jupyter-widgets/controls' ) ) ;
306
- } ,
307
- ( err : any ) => {
308
- reject ( err ) ;
309
- } ,
310
- '@jupyter-widgets/controls'
311
- ) ;
312
- } ) ;
313
- } ,
314
- } ) ;
315
-
316
- WIDGET_REGISTRY . push ( {
317
- name : '@jupyter-widgets/output' ,
318
- version : OUTPUT_WIDGET_VERSION ,
319
- exports : { OutputModel, OutputView } ,
320
- } ) ;
321
279
322
280
return {
323
281
registerWidget ( data : base . IWidgetRegistryData ) : void {
@@ -326,6 +284,81 @@ function activateWidgetExtension(
326
284
} ;
327
285
}
328
286
287
+
288
+ /**
289
+ * The base widgets.
290
+ */
291
+ export const baseWidgetsPlugin : JupyterFrontEndPlugin < void > = {
292
+ id : `@jupyter-widgets/jupyterlab-manager:base-${ base . JUPYTER_WIDGETS_VERSION } ` ,
293
+ requires : [ base . IJupyterWidgetRegistry ] ,
294
+ autoStart : true ,
295
+ activate : ( app : JupyterFrontEnd , registry : base . IJupyterWidgetRegistry ) : void => {
296
+ registry . registerWidget ( {
297
+ name : '@jupyter-widgets/base' ,
298
+ version : base . JUPYTER_WIDGETS_VERSION ,
299
+ exports : {
300
+ WidgetModel : base . WidgetModel ,
301
+ WidgetView : base . WidgetView ,
302
+ DOMWidgetView : base . DOMWidgetView ,
303
+ DOMWidgetModel : base . DOMWidgetModel ,
304
+ LayoutModel : base . LayoutModel ,
305
+ LayoutView : base . LayoutView ,
306
+ StyleModel : base . StyleModel ,
307
+ StyleView : base . StyleView ,
308
+ ErrorWidgetView : base . ErrorWidgetView ,
309
+ } ,
310
+ } ) ;
311
+ }
312
+ } ;
313
+
314
+
315
+ /**
316
+ * The control widgets.
317
+ */
318
+ export const controlWidgetsPlugin : JupyterFrontEndPlugin < void > = {
319
+ id : `@jupyter-widgets/jupyterlab-manager:controls-${ JUPYTER_CONTROLS_VERSION } ` ,
320
+ requires : [ base . IJupyterWidgetRegistry ] ,
321
+ autoStart : true ,
322
+ activate : ( app : JupyterFrontEnd , registry : base . IJupyterWidgetRegistry ) : void => {
323
+ registry . registerWidget ( {
324
+ name : '@jupyter-widgets/controls' ,
325
+ version : JUPYTER_CONTROLS_VERSION ,
326
+ exports : ( ) => {
327
+ return new Promise ( ( resolve , reject ) => {
328
+ ( require as any ) . ensure (
329
+ [ '@jupyter-widgets/controls' ] ,
330
+ ( require : NodeRequire ) => {
331
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
332
+ resolve ( require ( '@jupyter-widgets/controls' ) ) ;
333
+ } ,
334
+ ( err : any ) => {
335
+ reject ( err ) ;
336
+ } ,
337
+ '@jupyter-widgets/controls'
338
+ ) ;
339
+ } ) ;
340
+ }
341
+ } ) ;
342
+ }
343
+ } ;
344
+
345
+ /**
346
+ * The output widget.
347
+ */
348
+ export const outputWidgetPlugin : JupyterFrontEndPlugin < void > = {
349
+ id : `@jupyter-widgets/jupyterlab-manager:output-${ OUTPUT_WIDGET_VERSION } ` ,
350
+ requires : [ base . IJupyterWidgetRegistry ] ,
351
+ autoStart : true ,
352
+ activate : ( app : JupyterFrontEnd , registry : base . IJupyterWidgetRegistry ) : void => {
353
+ registry . registerWidget ( {
354
+ name : '@jupyter-widgets/output' ,
355
+ version : OUTPUT_WIDGET_VERSION ,
356
+ exports : { OutputModel, OutputView }
357
+ } ) ;
358
+ }
359
+ } ;
360
+
361
+ export default [ managerPlugin , baseWidgetsPlugin , controlWidgetsPlugin , outputWidgetPlugin ] ;
329
362
namespace Private {
330
363
/**
331
364
* A private attached property for a widget manager.
0 commit comments