diff --git a/packages/voici/src/main.ts b/packages/voici/src/main.ts index aa7df3b..dbd8fc0 100644 --- a/packages/voici/src/main.ts +++ b/packages/voici/src/main.ts @@ -25,11 +25,6 @@ import plugins from './voiciplugins'; const serverExtensions = [import('@jupyterlite/server-extension')]; -const disabled = [ - '@jupyter-widgets/jupyterlab-manager:plugin', - '@jupyter-widgets/jupyterlab-manager:saveWidgetState', -]; - /** * The main function */ @@ -45,6 +40,9 @@ async function main() { require('@jupyterlab/rendermime-extension'), require('@jupyterlab/theme-light-extension'), require('@jupyterlab/theme-dark-extension'), + require('@jupyter-widgets/jupyterlab-manager/lib/plugin').default.filter( + (p: any) => p.id !== '@jupyter-widgets/jupyterlab-manager:plugin' + ), themesManagerPlugin, plugins, ]; @@ -110,7 +108,7 @@ async function main() { ); federatedExtensions.forEach((p) => { if (p.status === 'fulfilled') { - for (const plugin of activePlugins(p.value, disabled)) { + for (const plugin of activePlugins(p.value, [])) { mods.push(plugin); } } else { @@ -124,7 +122,7 @@ async function main() { ); federatedMimeExtensions.forEach((p) => { if (p.status === 'fulfilled') { - for (const plugin of activePlugins(p.value, disabled)) { + for (const plugin of activePlugins(p.value, [])) { mimeExtensions.push(plugin); } } else { @@ -142,7 +140,7 @@ async function main() { const litePluginsToRegister: any[] = []; const baseServerExtensions = await Promise.all(serverExtensions); baseServerExtensions.forEach((p) => { - for (const plugin of activePlugins(p, disabled)) { + for (const plugin of activePlugins(p, [])) { litePluginsToRegister.push(plugin); } }); @@ -153,7 +151,7 @@ async function main() { ); federatedLiteExtensions.forEach((p) => { if (p.status === 'fulfilled') { - for (const plugin of activePlugins(p.value, disabled)) { + for (const plugin of activePlugins(p.value, [])) { litePluginsToRegister.push(plugin); } } else { diff --git a/packages/voici/src/tree.ts b/packages/voici/src/tree.ts index 046f23e..3e7d60e 100644 --- a/packages/voici/src/tree.ts +++ b/packages/voici/src/tree.ts @@ -25,14 +25,6 @@ import { treeWidgetPlugin } from './plugins/tree'; const serverExtensions = [import('@jupyterlite/server-extension')]; -export const TREE_DISABLED_EXTENSIONS = [ - '@jupyter-widgets/jupyterlab-manager:plugin', - '@jupyter-widgets/jupyterlab-manager:saveWidgetState', - '@jupyter-widgets/jupyterlab-manager:base-2.0.0', - '@jupyter-widgets/jupyterlab-manager:controls-2.0.0', - '@jupyter-widgets/jupyterlab-manager:output-1.0.0', -]; - /** * The main function */ @@ -99,7 +91,7 @@ async function main() { ); federatedExtensions.forEach((p) => { if (p.status === 'fulfilled') { - for (const plugin of activePlugins(p.value, TREE_DISABLED_EXTENSIONS)) { + for (const plugin of activePlugins(p.value, [])) { mods.push(plugin); } } else { @@ -113,7 +105,7 @@ async function main() { ); federatedMimeExtensions.forEach((p) => { if (p.status === 'fulfilled') { - for (const plugin of activePlugins(p.value, TREE_DISABLED_EXTENSIONS)) { + for (const plugin of activePlugins(p.value, [])) { mimeExtensions.push(plugin); } } else { @@ -131,7 +123,7 @@ async function main() { const litePluginsToRegister: any[] = []; const baseServerExtensions = await Promise.all(serverExtensions); baseServerExtensions.forEach((p) => { - for (const plugin of activePlugins(p, TREE_DISABLED_EXTENSIONS)) { + for (const plugin of activePlugins(p, [])) { litePluginsToRegister.push(plugin); } }); diff --git a/voici/addon.py b/voici/addon.py index 3ff46bb..7754534 100644 --- a/voici/addon.py +++ b/voici/addon.py @@ -25,15 +25,6 @@ from .tree_exporter import VoiciTreeExporter -# Try to patch xeus-python's jupyter-widgets version st. we pull the right one -try: - from jupyterlite_xeus_python.env_build_addon import XeusPythonEnv - - if hasattr(XeusPythonEnv, "pin_packages"): - XeusPythonEnv.pin_packages = ["ipywidgets=8.0.6", "jupyterlab_widgets=3.0.7"] -except ImportError: - pass - class VoiciAddon(BaseAddon): """The Voici JupyterLite app""" diff --git a/voici/tree_exporter.py b/voici/tree_exporter.py index adaee8e..42464af 100644 --- a/voici/tree_exporter.py +++ b/voici/tree_exporter.py @@ -9,7 +9,7 @@ from jupyter_server.utils import url_escape, url_path_join from nbconvert.exporters.html import HTMLExporter from voila.configuration import VoilaConfiguration -from voila.utils import include_lab_theme +from voila.utils import include_lab_theme, filter_extension from .exporter import VoiciExporter @@ -75,6 +75,17 @@ def patch_page_config( page_config_copy[ "fullMathjaxUrl" ] = f'{page_config_copy["baseUrl"]}{page_config_copy["fullMathjaxUrl"]}' + + federated_extensions = page_config_copy["federated_extensions"] + disabled_extensions = [ + "@voila-dashboards/jupyterlab-preview", + "@jupyter/collaboration-extension", + "@jupyter-widgets/jupyterlab-manager", + ] + page_config_copy["federated_extensions"] = filter_extension( + federated_extensions=federated_extensions, + disabled_extensions=disabled_extensions, + ) return page_config_copy