Skip to content

Commit

Permalink
Something that compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Oct 15, 2024
1 parent ad8fc91 commit 0386bca
Show file tree
Hide file tree
Showing 8 changed files with 2,558 additions and 3,757 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ share/jupyter/voila/templates/base/static/*.LICENSE.txt

lib

voila/labextension
voila/labextensions
tsconfig.tsbuildinfo

ui-tests/playwright-report
Expand Down
128 changes: 128 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,133 @@
"prettier": "^2.8.6",
"rimraf": "^3.0.2",
"shell-quote": "^1.7.2"
},
"resolutions": {
"@codemirror/language": "^6.0.0",
"@codemirror/state": "^6.2.0",
"@codemirror/view": "^6.9.6",
"@jupyter/react-components": "^0.15.3",
"@jupyter/web-components": "^0.15.3",
"@jupyter/ydoc": "^2.0.1",
"@jupyterlab/application": "~4.2.5",
"@jupyterlab/application-extension": "~4.2.5",
"@jupyterlab/apputils": "~4.3.5",
"@jupyterlab/apputils-extension": "~4.2.5",
"@jupyterlab/attachments": "~4.2.5",
"@jupyterlab/cell-toolbar": "~4.2.5",
"@jupyterlab/cell-toolbar-extension": "~4.2.5",
"@jupyterlab/cells": "~4.2.5",
"@jupyterlab/celltags-extension": "~4.2.5",
"@jupyterlab/codeeditor": "~4.2.5",
"@jupyterlab/codemirror": "~4.2.5",
"@jupyterlab/codemirror-extension": "~4.2.5",
"@jupyterlab/completer": "~4.2.5",
"@jupyterlab/completer-extension": "~4.2.5",
"@jupyterlab/console": "~4.2.5",
"@jupyterlab/console-extension": "~4.2.5",
"@jupyterlab/coreutils": "~6.2.5",
"@jupyterlab/csvviewer": "~4.2.5",
"@jupyterlab/csvviewer-extension": "~4.2.5",
"@jupyterlab/debugger": "~4.2.5",
"@jupyterlab/debugger-extension": "~4.2.5",
"@jupyterlab/docmanager": "~4.2.5",
"@jupyterlab/docmanager-extension": "~4.2.5",
"@jupyterlab/docregistry": "~4.2.5",
"@jupyterlab/documentsearch": "~4.2.5",
"@jupyterlab/documentsearch-extension": "~4.2.5",
"@jupyterlab/extensionmanager": "~4.2.5",
"@jupyterlab/extensionmanager-extension": "~4.2.5",
"@jupyterlab/filebrowser": "~4.2.5",
"@jupyterlab/filebrowser-extension": "~4.2.5",
"@jupyterlab/fileeditor": "~4.2.5",
"@jupyterlab/fileeditor-extension": "~4.2.5",
"@jupyterlab/help-extension": "~4.2.5",
"@jupyterlab/htmlviewer": "~4.2.5",
"@jupyterlab/htmlviewer-extension": "~4.2.5",
"@jupyterlab/hub-extension": "~4.2.5",
"@jupyterlab/imageviewer": "~4.2.5",
"@jupyterlab/imageviewer-extension": "~4.2.5",
"@jupyterlab/inspector": "~4.2.5",
"@jupyterlab/inspector-extension": "~4.2.5",
"@jupyterlab/javascript-extension": "~4.2.5",
"@jupyterlab/json-extension": "~4.2.5",
"@jupyterlab/launcher": "~4.2.5",
"@jupyterlab/launcher-extension": "~4.2.5",
"@jupyterlab/logconsole": "~4.2.5",
"@jupyterlab/logconsole-extension": "~4.2.5",
"@jupyterlab/lsp": "~4.2.5",
"@jupyterlab/lsp-extension": "~4.2.5",
"@jupyterlab/mainmenu": "~4.2.5",
"@jupyterlab/mainmenu-extension": "~4.2.5",
"@jupyterlab/markdownviewer": "~4.2.5",
"@jupyterlab/markdownviewer-extension": "~4.2.5",
"@jupyterlab/markedparser-extension": "~4.2.5",
"@jupyterlab/mathjax-extension": "~4.2.5",
"@jupyterlab/mermaid": "~4.2.5",
"@jupyterlab/mermaid-extension": "~4.2.5",
"@jupyterlab/metadataform": "~4.2.5",
"@jupyterlab/metadataform-extension": "~4.2.5",
"@jupyterlab/metapackage": "~4.2.5",
"@jupyterlab/nbconvert-css": "~4.2.5",
"@jupyterlab/nbformat": "~4.2.5",
"@jupyterlab/notebook": "~4.2.5",
"@jupyterlab/notebook-extension": "~4.2.5",
"@jupyterlab/observables": "~5.2.5",
"@jupyterlab/outputarea": "~4.2.5",
"@jupyterlab/pdf-extension": "~4.2.5",
"@jupyterlab/pluginmanager": "~4.2.5",
"@jupyterlab/pluginmanager-extension": "~4.2.5",
"@jupyterlab/property-inspector": "~4.2.5",
"@jupyterlab/rendermime": "~4.2.5",
"@jupyterlab/rendermime-extension": "~4.2.5",
"@jupyterlab/rendermime-interfaces": "~3.10.5",
"@jupyterlab/running": "~4.2.5",
"@jupyterlab/running-extension": "~4.2.5",
"@jupyterlab/services": "~7.2.5",
"@jupyterlab/settingeditor": "~4.2.5",
"@jupyterlab/settingeditor-extension": "~4.2.5",
"@jupyterlab/settingregistry": "~4.2.5",
"@jupyterlab/shortcuts-extension": "~5.0.5",
"@jupyterlab/statedb": "~4.2.5",
"@jupyterlab/statusbar": "~4.2.5",
"@jupyterlab/statusbar-extension": "~4.2.5",
"@jupyterlab/terminal": "~4.2.5",
"@jupyterlab/terminal-extension": "~4.2.5",
"@jupyterlab/theme-dark-extension": "~4.2.5",
"@jupyterlab/theme-dark-high-contrast-extension": "~4.2.5",
"@jupyterlab/theme-light-extension": "~4.2.5",
"@jupyterlab/toc": "~6.2.5",
"@jupyterlab/toc-extension": "~6.2.5",
"@jupyterlab/tooltip": "~4.2.5",
"@jupyterlab/tooltip-extension": "~4.2.5",
"@jupyterlab/translation": "~4.2.5",
"@jupyterlab/translation-extension": "~4.2.5",
"@jupyterlab/ui-components": "~4.2.5",
"@jupyterlab/ui-components-extension": "~4.2.5",
"@jupyterlab/vega5-extension": "~4.2.5",
"@jupyterlab/workspaces": "~4.2.5",
"@jupyterlab/workspaces-extension": "~4.2.5",
"@lezer/common": "^1.0.0",
"@lezer/highlight": "^1.0.0",
"@lumino/algorithm": "^2.0.0",
"@lumino/application": "^2.3.0-alpha.0",
"@lumino/commands": "^2.0.1",
"@lumino/coreutils": "^2.0.0",
"@lumino/datagrid": "^2.3.0-alpha.0",
"@lumino/disposable": "^2.0.0",
"@lumino/domutils": "^2.0.0",
"@lumino/dragdrop": "^2.0.0",
"@lumino/keyboard": "^2.0.0",
"@lumino/messaging": "^2.0.0",
"@lumino/polling": "^2.0.0",
"@lumino/properties": "^2.0.0",
"@lumino/signaling": "^2.0.0",
"@lumino/virtualdom": "^2.0.0",
"@lumino/widgets": "^2.3.1-alpha.0",
"@microsoft/fast-element": "^1.12.0",
"@microsoft/fast-foundation": "^2.49.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"yjs": "^13.5.40"
}
}
1 change: 1 addition & 0 deletions packages/widgets_manager7/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"@babel/preset-env": "^7.10.2",
"@jupyterlab/builder": "^4.0.0",
"@jupyterlab/testutils": "^4.0.0",
"@types/node": "^22.7.5",
"npm-run-all": "^4.1.5",
"rimraf": "^2.6.1",
"source-map-loader": "~1.0.2",
Expand Down
41 changes: 35 additions & 6 deletions packages/widgets_manager7/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import { VoilaWidgetManager } from './manager';

const WIDGET_MIMETYPE = 'application/vnd.jupyter.widget-view+json';


/**
* The Voila widgets manager plugin.
*/
Expand Down Expand Up @@ -65,8 +66,36 @@ export const widgetManager: JupyterFrontEndPlugin<IJupyterWidgetRegistry> = {
};
}
const kernel = new KernelConnection({ model, serverSettings });
const manager = new VoilaWidgetManager(kernel, rendermime);
app.widgetManager = manager;

const context = {
sessionContext: {
session: {
kernel,
kernelChanged: {
connect: () => {}
},
},
statusChanged: {
connect: () => {}
},
kernelChanged: {
connect: () => {}
},
connectionStatusChanged: {
connect: () => {}
},
},
saveState: {
connect: () => {}
},
};

const settings = {
saveState: false
};

const manager = new VoilaWidgetManager(context as any, rendermime, settings);
(app as any).widgetManager = manager;

rendermime.removeMimeType(WIDGET_MIMETYPE);
rendermime.addFactory(
Expand All @@ -92,7 +121,7 @@ export const widgetManager: JupyterFrontEndPlugin<IJupyterWidgetRegistry> = {

return {
registerWidget: async (data: IWidgetRegistryData) => {
const manager = await app.widgetManagerPromise.promise;
const manager = await (app as any).widgetManagerPromise.promise;

manager.register(data);
}
Expand Down Expand Up @@ -145,15 +174,15 @@ export const controlWidgets7Plugin: JupyterFrontEndPlugin<void> = {
exports: () => {
return new Promise((resolve, reject) => {
(require as any).ensure(
['@jupyter-widgets/controls7'],
['@jupyter-widgets/controls'],
(require: NodeRequire) => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
resolve(require('@jupyter-widgets/controls7'));
resolve(require('@jupyter-widgets/controls'));
},
(err: any) => {
reject(err);
},
'@jupyter-widgets/controls7'
'@jupyter-widgets/controls'
);
});
}
Expand Down
4 changes: 2 additions & 2 deletions packages/widgets_manager7/src/manager.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { WidgetModel } from '@jupyter-widgets/base';
import { KernelWidgetManager } from '@jupyter-widgets/jupyterlab-manager';
import { WidgetManager } from '@jupyter-widgets/jupyterlab-manager';
import { ISignal, Signal } from '@lumino/signaling';


export class VoilaWidgetManager extends KernelWidgetManager {
export class VoilaWidgetManager extends WidgetManager {
register_model(model_id: string, modelPromise: Promise<WidgetModel>): void {
super.register_model(model_id, modelPromise);
this._registeredModels.add(model_id);
Expand Down
3 changes: 2 additions & 1 deletion packages/widgets_manager7/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "../../tsconfigbase",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
"rootDir": "src",
"types": ["node"]
},
"include": ["src/**/*"]
}
4 changes: 2 additions & 2 deletions packages/widgets_manager8/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const widgetManager: JupyterFrontEndPlugin<IJupyterWidgetRegistry> = {
}
const kernel = new KernelConnection({ model, serverSettings });
const manager = new VoilaWidgetManager(kernel, rendermime);
app.widgetManager = manager;
(app as any).widgetManager = manager;

rendermime.removeMimeType(WIDGET_MIMETYPE);
rendermime.addFactory(
Expand All @@ -81,7 +81,7 @@ export const widgetManager: JupyterFrontEndPlugin<IJupyterWidgetRegistry> = {

return {
registerWidget: async (data: IWidgetRegistryData) => {
const manager = await app.widgetManagerPromise.promise;
const manager = await (app as any).widgetManagerPromise.promise;

manager.register(data);
}
Expand Down
Loading

0 comments on commit 0386bca

Please sign in to comment.