From 808e5a0569e02563d42d48d19abc5ba9ee6a0b87 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Thu, 3 Apr 2025 07:09:26 +0200 Subject: [PATCH 01/19] chore: python config handlers --- packages/lexical/jupyter_lexical/__init__.py | 21 +--- packages/lexical/jupyter_lexical/__main__.py | 10 ++ .../lexical/jupyter_lexical/__version__.py | 6 +- packages/lexical/jupyter_lexical/handlers.py | 29 ----- .../jupyter_lexical/handlers/__init__.py | 4 + .../lexical/jupyter_lexical/handlers/base.py | 13 +++ .../handlers/config/__init__.py | 4 + .../handlers/config/handler.py | 30 ++++++ .../handlers/index/__init__.py | 4 + .../jupyter_lexical/handlers/index/handler.py | 19 ++++ .../handlers/react/__init__.py | 4 + .../handlers/react/handlers.py | 31 ++++++ .../jupyter_lexical/serverapplication.py | 102 ++++++++++++++++++ .../lexical/jupyter_lexical/static/README.md | 0 .../jupyter_lexical/templates/index.html | 35 ++++++ .../jupyter_lexical/tests/test_handlers.py | 10 +- packages/lexical/pyproject.toml | 4 - packages/react/jupyter_react/__version__.py | 6 +- .../jupyter_react/handlers/config/handler.py | 10 +- .../react/jupyter_react/serverapplication.py | 54 +++++++++- packages/react/pyproject.toml | 4 - 21 files changed, 324 insertions(+), 76 deletions(-) create mode 100644 packages/lexical/jupyter_lexical/__main__.py delete mode 100644 packages/lexical/jupyter_lexical/handlers.py create mode 100644 packages/lexical/jupyter_lexical/handlers/__init__.py create mode 100644 packages/lexical/jupyter_lexical/handlers/base.py create mode 100644 packages/lexical/jupyter_lexical/handlers/config/__init__.py create mode 100644 packages/lexical/jupyter_lexical/handlers/config/handler.py create mode 100644 packages/lexical/jupyter_lexical/handlers/index/__init__.py create mode 100644 packages/lexical/jupyter_lexical/handlers/index/handler.py create mode 100644 packages/lexical/jupyter_lexical/handlers/react/__init__.py create mode 100644 packages/lexical/jupyter_lexical/handlers/react/handlers.py create mode 100644 packages/lexical/jupyter_lexical/serverapplication.py create mode 100644 packages/lexical/jupyter_lexical/static/README.md create mode 100644 packages/lexical/jupyter_lexical/templates/index.html diff --git a/packages/lexical/jupyter_lexical/__init__.py b/packages/lexical/jupyter_lexical/__init__.py index 6c85f2a0..bdc435b3 100644 --- a/packages/lexical/jupyter_lexical/__init__.py +++ b/packages/lexical/jupyter_lexical/__init__.py @@ -5,26 +5,11 @@ from typing import Any, Dict, List from .__version__ import __version__ -from .handlers import setup_handlers +from .serverapplication import JupyterLexicalExtensionApp def _jupyter_server_extension_points() -> List[Dict[str, Any]]: return [{ - "module": "jupyter_lexical" + "module": "jupyter_react", + "app": JupyterLexicalExtensionApp, }] - - -def _load_jupyter_server_extension(server_app): - """Registers the API handler to receive HTTP requests from the frontend extension. - - Parameters - ---------- - server_app: jupyter_server.serverapp.ServerApp - """ - setup_handlers(server_app.web_app) - name = "jupyter_lexical" - server_app.log.info(f"Registered {name} server extension") - - -# For backward compatibility with notebook server - useful for Binder/JupyterHub -load_jupyter_server_extension = _load_jupyter_server_extension diff --git a/packages/lexical/jupyter_lexical/__main__.py b/packages/lexical/jupyter_lexical/__main__.py new file mode 100644 index 00000000..17a1f749 --- /dev/null +++ b/packages/lexical/jupyter_lexical/__main__.py @@ -0,0 +1,10 @@ +# Copyright (c) 2021-2023 Datalayer, Inc. +# +# MIT License + +"""The main for Jupyter Lexical.""" + +from .serverapplication import main + +if __name__ == "__main__": + main() diff --git a/packages/lexical/jupyter_lexical/__version__.py b/packages/lexical/jupyter_lexical/__version__.py index f75d88b1..c7fd3f98 100644 --- a/packages/lexical/jupyter_lexical/__version__.py +++ b/packages/lexical/jupyter_lexical/__version__.py @@ -2,8 +2,4 @@ # # MIT License -# Copyright (c) 2023-2024 Datalayer, Inc. -# -# Datalayer License - -__version__ = '0.0.2' +__version__ = '0.0.3' diff --git a/packages/lexical/jupyter_lexical/handlers.py b/packages/lexical/jupyter_lexical/handlers.py deleted file mode 100644 index d62340ef..00000000 --- a/packages/lexical/jupyter_lexical/handlers.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) 2021-2023 Datalayer, Inc. -# -# MIT License - -import json - -import tornado - -from jupyter_server.base.handlers import APIHandler -from jupyter_server.utils import url_path_join - - -class JupyterLexicalHandler(APIHandler): - - # The following decorator should be present on all verb methods (head, get, post, - # patch, put, delete, options) to ensure only authorized user can request the Jupyter server - @tornado.web.authenticated - def get(self): - self.finish(json.dumps({ - "data": "This is /jupyter_lexical/config endpoint!" - })) - - -def setup_handlers(web_app): - host_pattern = ".*$" - base_url = web_app.settings["base_url"] - route_pattern = url_path_join(base_url, "jupyter_lexical", "config") - handlers = [(route_pattern, JupyterLexicalHandler)] - web_app.add_handlers(host_pattern, handlers) diff --git a/packages/lexical/jupyter_lexical/handlers/__init__.py b/packages/lexical/jupyter_lexical/handlers/__init__.py new file mode 100644 index 00000000..ea00f99b --- /dev/null +++ b/packages/lexical/jupyter_lexical/handlers/__init__.py @@ -0,0 +1,4 @@ +# Copyright (c) 2021-2023 Datalayer, Inc. +# +# MIT License + diff --git a/packages/lexical/jupyter_lexical/handlers/base.py b/packages/lexical/jupyter_lexical/handlers/base.py new file mode 100644 index 00000000..4075ccea --- /dev/null +++ b/packages/lexical/jupyter_lexical/handlers/base.py @@ -0,0 +1,13 @@ +# Copyright (c) 2021-2023 Datalayer, Inc. +# +# MIT License + +"""Base handler.""" + +from jupyter_server.base.handlers import JupyterHandler +from jupyter_server.extension.handler import ExtensionHandlerMixin, ExtensionHandlerJinjaMixin + + +# pylint: disable=W0223 +class BaseTemplateHandler(ExtensionHandlerJinjaMixin, ExtensionHandlerMixin, JupyterHandler): + """The Base handler for the templates.""" diff --git a/packages/lexical/jupyter_lexical/handlers/config/__init__.py b/packages/lexical/jupyter_lexical/handlers/config/__init__.py new file mode 100644 index 00000000..ea00f99b --- /dev/null +++ b/packages/lexical/jupyter_lexical/handlers/config/__init__.py @@ -0,0 +1,4 @@ +# Copyright (c) 2021-2023 Datalayer, Inc. +# +# MIT License + diff --git a/packages/lexical/jupyter_lexical/handlers/config/handler.py b/packages/lexical/jupyter_lexical/handlers/config/handler.py new file mode 100644 index 00000000..5a77df45 --- /dev/null +++ b/packages/lexical/jupyter_lexical/handlers/config/handler.py @@ -0,0 +1,30 @@ +# Copyright (c) 2021-2023 Datalayer, Inc. +# +# MIT License + +"""Config handler.""" + +import json + +import tornado + +from jupyter_server.base.handlers import APIHandler +from jupyter_server.extension.handler import ExtensionHandlerMixin + +from jupyter_lexical.__version__ import __version__ + + +class ConfigHandler(ExtensionHandlerMixin, APIHandler): + """The handler for configurations.""" + + @tornado.web.authenticated + def get(self): + """Returns the configurations of the server extensions.""" + res = json.dumps({ + "extension": self.name, + "version": __version__, + "configuration": { + "launcher": self.config["launcher"].to_dict() + } + }) + self.finish(res) diff --git a/packages/lexical/jupyter_lexical/handlers/index/__init__.py b/packages/lexical/jupyter_lexical/handlers/index/__init__.py new file mode 100644 index 00000000..ea00f99b --- /dev/null +++ b/packages/lexical/jupyter_lexical/handlers/index/__init__.py @@ -0,0 +1,4 @@ +# Copyright (c) 2021-2023 Datalayer, Inc. +# +# MIT License + diff --git a/packages/lexical/jupyter_lexical/handlers/index/handler.py b/packages/lexical/jupyter_lexical/handlers/index/handler.py new file mode 100644 index 00000000..b17dc45d --- /dev/null +++ b/packages/lexical/jupyter_lexical/handlers/index/handler.py @@ -0,0 +1,19 @@ +# Copyright (c) 2021-2023 Datalayer, Inc. +# +# MIT License + +"""Index handler.""" + +import tornado + +from ..base import BaseTemplateHandler + + +# pylint: disable=W0223 +class IndexHandler(BaseTemplateHandler): + """The handler for the index.""" + + @tornado.web.authenticated + def get(self): + """The index page.""" + self.write(self.render_template("index.html")) diff --git a/packages/lexical/jupyter_lexical/handlers/react/__init__.py b/packages/lexical/jupyter_lexical/handlers/react/__init__.py new file mode 100644 index 00000000..ea00f99b --- /dev/null +++ b/packages/lexical/jupyter_lexical/handlers/react/__init__.py @@ -0,0 +1,4 @@ +# Copyright (c) 2021-2023 Datalayer, Inc. +# +# MIT License + diff --git a/packages/lexical/jupyter_lexical/handlers/react/handlers.py b/packages/lexical/jupyter_lexical/handlers/react/handlers.py new file mode 100644 index 00000000..21bdd8e2 --- /dev/null +++ b/packages/lexical/jupyter_lexical/handlers/react/handlers.py @@ -0,0 +1,31 @@ +# Copyright (c) 2021-2023 Datalayer, Inc. +# +# MIT License + +import os + +from jupyter_server.base.handlers import JupyterHandler +from jupyter_server.extension.handler import ( + ExtensionHandlerMixin, + ExtensionHandlerJinjaMixin, +) + + +class LexicalBaseTemplateHandler(ExtensionHandlerJinjaMixin, ExtensionHandlerMixin, JupyterHandler): + pass + + +class LexicalPlotlyHandler(LexicalBaseTemplateHandler): + plotly_js = "" + + def get(self): + if self.plotly_js == "": + f = open( + os.path.join( + os.path.dirname(__file__), "./../static/plotly-2.3.0.min.js" + ), + "r", + ) + self.plotly_js = f.read() + self.set_header("Content-Type", 'text/javascript; charset="utf-8"') + self.write(self.plotly_js) diff --git a/packages/lexical/jupyter_lexical/serverapplication.py b/packages/lexical/jupyter_lexical/serverapplication.py new file mode 100644 index 00000000..1cdade3c --- /dev/null +++ b/packages/lexical/jupyter_lexical/serverapplication.py @@ -0,0 +1,102 @@ +# Copyright (c) 2021-2023 Datalayer, Inc. +# +# MIT License + +"""The Jupyter Lexical Server application.""" + +import os + +from traitlets import default, CInt, Instance, Unicode +from traitlets.config import Configurable + +from jupyter_server.utils import url_path_join +from jupyter_server.extension.application import ExtensionApp, ExtensionAppJinjaMixin + +from jupyter_lexical.__version__ import __version__ + +from jupyter_lexical.handlers.index.handler import IndexHandler +from jupyter_lexical.handlers.config.handler import ConfigHandler + + +DEFAULT_STATIC_FILES_PATH = os.path.join(os.path.dirname(__file__), "./static") + +DEFAULT_TEMPLATE_FILES_PATH = os.path.join(os.path.dirname(__file__), "./templates") + + +class JupyterLexicalExtensionApp(ExtensionAppJinjaMixin, ExtensionApp): + """The Jupyter Lexical Server extension.""" + + name = "jupyter_lexical" + + extension_url = "/jupyter_lexical" + + load_other_extensions = True + + static_paths = [DEFAULT_STATIC_FILES_PATH] + + template_paths = [DEFAULT_TEMPLATE_FILES_PATH] + + + class Launcher(Configurable): + """Jupyter Lexical launcher configuration""" + + def to_dict(self): + return { + "category": self.category, + "name": self.name, + "icon_svg_url": self.icon_svg_url, + "rank": self.rank, + } + + category = Unicode( + "", + config=True, + help=("Application launcher card category."), + ) + + name = Unicode( + "Jupyter Kubernetes", + config=True, + help=("Application launcher card name."), + ) + + icon_svg_url = Unicode( + None, + allow_none=True, + config=True, + help=("Application launcher card icon."), + ) + + rank = CInt( + 0, + config=True, + help=("Application launcher card rank."), + ) + + launcher = Instance(Launcher) + + @default("launcher") + def _default_launcher(self): + return JupyterLexicalExtensionApp.Launcher(parent=self, config=self.config) + + + def initialize_settings(self): + self.log.debug("Jupyter Lexical Config {}".format(self.config)) + + def initialize_templates(self): + self.serverapp.jinja_template_vars.update({"jupyter_lexical_version" : __version__}) + + def initialize_handlers(self): + self.log.debug("Jupyter Lexical Config {}".format(self.settings['jupyter_lexical_jinja2_env'])) + handlers = [ + ("jupyter_lexical", IndexHandler), + (url_path_join("jupyter_lexical", "config"), ConfigHandler), + ] + self.handlers.extend(handlers) + + +# ----------------------------------------------------------------------------- +# Main entry point +# ----------------------------------------------------------------------------- + +main = launch_new_instance = JupyterLexicalExtensionApp.launch_instance diff --git a/packages/lexical/jupyter_lexical/static/README.md b/packages/lexical/jupyter_lexical/static/README.md new file mode 100644 index 00000000..e69de29b diff --git a/packages/lexical/jupyter_lexical/templates/index.html b/packages/lexical/jupyter_lexical/templates/index.html new file mode 100644 index 00000000..904d6cc2 --- /dev/null +++ b/packages/lexical/jupyter_lexical/templates/index.html @@ -0,0 +1,35 @@ + + + + + + + Ξ Jupyter Lexical + + + + + + +
+ + diff --git a/packages/lexical/jupyter_lexical/tests/test_handlers.py b/packages/lexical/jupyter_lexical/tests/test_handlers.py index 622d6c9a..b37fa0a7 100644 --- a/packages/lexical/jupyter_lexical/tests/test_handlers.py +++ b/packages/lexical/jupyter_lexical/tests/test_handlers.py @@ -4,14 +4,16 @@ import json +from ..__version__ import __version__ -async def test_get_example(jp_fetch): + +async def test_config(jp_fetch): # When response = await jp_fetch("jupyter_lexical", "get_example") - # Then assert response.code == 200 payload = json.loads(response.body) assert payload == { - "data": "This is /jupyter_lexical/get_example endpoint!" - } \ No newline at end of file + "extension": "jupyter_lexical", + "version": __version__ + } diff --git a/packages/lexical/pyproject.toml b/packages/lexical/pyproject.toml index 915e8d6d..0f7419bc 100644 --- a/packages/lexical/pyproject.toml +++ b/packages/lexical/pyproject.toml @@ -2,10 +2,6 @@ # # MIT License -# Copyright (c) 2023-2024 Datalayer, Inc. -# -# Datalayer License - [build-system] requires = ["hatchling==1.21.1"] build-backend = "hatchling.build" diff --git a/packages/react/jupyter_react/__version__.py b/packages/react/jupyter_react/__version__.py index b2138201..42f62f62 100644 --- a/packages/react/jupyter_react/__version__.py +++ b/packages/react/jupyter_react/__version__.py @@ -2,8 +2,4 @@ # # MIT License -# Copyright (c) 2023-2024 Datalayer, Inc. -# -# Datalayer License - -__version__ = '0.8.0' +__version__ = '0.9.0' diff --git a/packages/react/jupyter_react/handlers/config/handler.py b/packages/react/jupyter_react/handlers/config/handler.py index 3c9adbef..219eea6c 100644 --- a/packages/react/jupyter_react/handlers/config/handler.py +++ b/packages/react/jupyter_react/handlers/config/handler.py @@ -11,10 +11,9 @@ from jupyter_server.base.handlers import APIHandler from jupyter_server.extension.handler import ExtensionHandlerMixin -from ...__version__ import __version__ +from jupyter_react.__version__ import __version__ -# pylint: disable=W0223 class ConfigHandler(ExtensionHandlerMixin, APIHandler): """The handler for configurations.""" @@ -22,7 +21,10 @@ class ConfigHandler(ExtensionHandlerMixin, APIHandler): def get(self): """Returns the configurations of the server extensions.""" res = json.dumps({ - "extension": "jupyter_react", - "version": __version__ + "extension": self.name, + "version": __version__, + "configuration": { + "launcher": self.config["launcher"].to_dict() + } }) self.finish(res) diff --git a/packages/react/jupyter_react/serverapplication.py b/packages/react/jupyter_react/serverapplication.py index ebd543a1..dfa81545 100644 --- a/packages/react/jupyter_react/serverapplication.py +++ b/packages/react/jupyter_react/serverapplication.py @@ -6,13 +6,16 @@ import os +from traitlets import default, CInt, Instance, Unicode +from traitlets.config import Configurable + from jupyter_server.utils import url_path_join from jupyter_server.extension.application import ExtensionApp, ExtensionAppJinjaMixin -from .__version__ import __version__ +from jupyter_react.__version__ import __version__ -from .handlers.index.handler import IndexHandler -from .handlers.config.handler import ConfigHandler +from jupyter_react.handlers.index.handler import IndexHandler +from jupyter_react.handlers.config.handler import ConfigHandler DEFAULT_STATIC_FILES_PATH = os.path.join(os.path.dirname(__file__), "./static") @@ -30,8 +33,53 @@ class JupyterReactExtensionApp(ExtensionAppJinjaMixin, ExtensionApp): load_other_extensions = True static_paths = [DEFAULT_STATIC_FILES_PATH] + template_paths = [DEFAULT_TEMPLATE_FILES_PATH] + + class Launcher(Configurable): + """Jupyter React launcher configuration""" + + def to_dict(self): + return { + "category": self.category, + "name": self.name, + "icon_svg_url": self.icon_svg_url, + "rank": self.rank, + } + + category = Unicode( + "", + config=True, + help=("Application launcher card category."), + ) + + name = Unicode( + "Jupyter Kubernetes", + config=True, + help=("Application launcher card name."), + ) + + icon_svg_url = Unicode( + None, + allow_none=True, + config=True, + help=("Application launcher card icon."), + ) + + rank = CInt( + 0, + config=True, + help=("Application launcher card rank."), + ) + + launcher = Instance(Launcher) + + @default("launcher") + def _default_launcher(self): + return JupyterReactExtensionApp.Launcher(parent=self, config=self.config) + + def initialize_settings(self): self.log.debug("Jupyter React Config {}".format(self.config)) diff --git a/packages/react/pyproject.toml b/packages/react/pyproject.toml index 3de3c615..8502b5e2 100644 --- a/packages/react/pyproject.toml +++ b/packages/react/pyproject.toml @@ -2,10 +2,6 @@ # # MIT License -# Copyright (c) 2023-2024 Datalayer, Inc. -# -# Datalayer License - [build-system] requires = ["hatchling==1.21.1"] build-backend = "hatchling.build" From ff9ed813ad82bcd75d6f416ffa693b886eddcb6a Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Sat, 5 Apr 2025 09:54:50 +0200 Subject: [PATCH 02/19] lab: disable console --- .../src/components/jupyterlab/JupyterLabAppAdapter.ts | 7 +------ .../src/components/jupyterlab/JupyterLabAppPlugins.ts | 4 ++-- packages/vscode/package.json | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/react/src/components/jupyterlab/JupyterLabAppAdapter.ts b/packages/react/src/components/jupyterlab/JupyterLabAppAdapter.ts index 56dc8b6a..75a3d3c1 100644 --- a/packages/react/src/components/jupyterlab/JupyterLabAppAdapter.ts +++ b/packages/react/src/components/jupyterlab/JupyterLabAppAdapter.ts @@ -6,12 +6,7 @@ import { CommandRegistry } from '@lumino/commands'; import { BoxPanel, Widget, FocusTracker } from '@lumino/widgets'; -import { - JupyterLab, - JupyterFrontEndPlugin, - JupyterFrontEnd, - LabShell, -} from '@jupyterlab/application'; +import { JupyterLab, JupyterFrontEndPlugin, JupyterFrontEnd, LabShell } from '@jupyterlab/application'; import { DocumentRegistry } from '@jupyterlab/docregistry'; import { IRenderMime } from '@jupyterlab/rendermime-interfaces'; import { NotebookPanel } from '@jupyterlab/notebook'; diff --git a/packages/react/src/components/jupyterlab/JupyterLabAppPlugins.ts b/packages/react/src/components/jupyterlab/JupyterLabAppPlugins.ts index 3a37b54f..0fae39aa 100644 --- a/packages/react/src/components/jupyterlab/JupyterLabAppPlugins.ts +++ b/packages/react/src/components/jupyterlab/JupyterLabAppPlugins.ts @@ -14,7 +14,7 @@ export const JupyterLabAppMinimumPlugins = { import('@jupyterlab/codemirror-extension'), import('@jupyterlab/cell-toolbar-extension'), import('@jupyterlab/completer-extension'), - import('@jupyterlab/console-extension'), +// import('@jupyterlab/console-extension'), import('@jupyterlab/docmanager-extension'), import('@jupyterlab/filebrowser-extension'), import('@jupyterlab/mainmenu-extension'), @@ -43,7 +43,7 @@ export const JupyterLabAppCorePlugins = () => { import('@jupyterlab/codemirror-extension'), import('@jupyterlab/cell-toolbar-extension'), import('@jupyterlab/completer-extension'), - import('@jupyterlab/console-extension'), +// import('@jupyterlab/console-extension'), import('@jupyterlab/docmanager-extension'), import('@jupyterlab/documentsearch-extension'), import('@jupyterlab/filebrowser-extension'), diff --git a/packages/vscode/package.json b/packages/vscode/package.json index 23ffdb2a..52119b00 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -72,9 +72,9 @@ "@types/vscode": "^1.98.0", "@typescript-eslint/eslint-plugin": "^8.25.0", "@typescript-eslint/parser": "^8.25.0", - "@vscode/vsce": "3.3.2", "@vscode/test-cli": "^0.0.10", "@vscode/test-electron": "^2.4.1", + "@vscode/vsce": "3.3.2", "css-loader": "5.1.3", "eslint": "^9.21.0", "mini-svg-data-uri": "^1.4.4", From cf871c9f42e5d51f05f254bc311fe7d77ed35713 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Sat, 5 Apr 2025 10:21:14 +0200 Subject: [PATCH 03/19] bump: version --- packages/react/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/package.json b/packages/react/package.json index a08a78e3..d6796265 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@datalayer/jupyter-react", - "version": "0.20.2", + "version": "0.21.0", "description": "Jupyter React - React.js components 100% compatible with Jupyter.", "license": "MIT", "main": "lib/index.js", From 4893fe586f78be5d2189edbfa4f7d9321e123cea Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Mon, 7 Apr 2025 08:51:52 +0200 Subject: [PATCH 04/19] chore: notebook2 --- packages/react/.prettierignore | 2 ++ .../src/components/notebook/Notebook.tsx | 20 ++--------- .../{SimpleNotebook.tsx => Notebook2.tsx} | 15 +++------ .../{BaseNotebook.tsx => NotebookBase.tsx} | 33 ++++++++++--------- .../components/notebook/NotebookCommands.ts | 12 ++----- .../react/src/components/notebook/index.ts | 4 +-- .../{NotebookSimple.tsx => Notebook2.tsx} | 4 +-- .../react/src/theme/JupyterReactTheme.tsx | 4 +-- 8 files changed, 34 insertions(+), 60 deletions(-) rename packages/react/src/components/notebook/{SimpleNotebook.tsx => Notebook2.tsx} (95%) rename packages/react/src/components/notebook/{BaseNotebook.tsx => NotebookBase.tsx} (98%) rename packages/react/src/examples/{NotebookSimple.tsx => Notebook2.tsx} (93%) diff --git a/packages/react/.prettierignore b/packages/react/.prettierignore index 720f9423..bc3b80b3 100644 --- a/packages/react/.prettierignore +++ b/packages/react/.prettierignore @@ -4,3 +4,5 @@ node_modules **/lib **/package.json jupyter_react/ + +**/src diff --git a/packages/react/src/components/notebook/Notebook.tsx b/packages/react/src/components/notebook/Notebook.tsx index 6f9f0237..6319e008 100644 --- a/packages/react/src/components/notebook/Notebook.tsx +++ b/packages/react/src/components/notebook/Notebook.tsx @@ -19,22 +19,10 @@ import { Box } from '@primer/react'; import { useEffect, useState } from 'react'; import { createPortal } from 'react-dom'; import { WebsocketProvider as YWebsocketProvider } from 'y-websocket'; -import { - jupyterReactStore, - KernelTransfer, - OnSessionConnection, -} from '../../state'; +import { jupyterReactStore, KernelTransfer, OnSessionConnection, } from '../../state'; import { newUuid, sleep } from '../../utils'; import { asObservable, Lumino } from '../lumino'; -import { - COLLABORATION_ROOM_URL_PATH, - fetchSessionId, - ICollaborative, - Kernel, - Lite, - requestDocSession, - useJupyter, -} from './../../jupyter'; +import { COLLABORATION_ROOM_URL_PATH, fetchSessionId, ICollaborative, Kernel, Lite, requestDocSession, useJupyter } from './../../jupyter'; import { CellMetadataEditor } from './cell/metadata'; import { NotebookAdapter } from './NotebookAdapter'; import { useNotebookStore } from './NotebookState'; @@ -172,9 +160,7 @@ export const Notebook = (props: INotebookProps) => { adapter, }); extension.createNew(adapter.notebookPanel!, adapter.context!); - setExtensionComponents( - extensionComponents.concat(extension.component ?? <>) - ); + setExtensionComponents(extensionComponents.concat(extension.component ?? <>)); }); // Update the notebook state with the adapter. notebookStore.update({ id, state: { adapter } }); diff --git a/packages/react/src/components/notebook/SimpleNotebook.tsx b/packages/react/src/components/notebook/Notebook2.tsx similarity index 95% rename from packages/react/src/components/notebook/SimpleNotebook.tsx rename to packages/react/src/components/notebook/Notebook2.tsx index 4ae0a256..1449c407 100644 --- a/packages/react/src/components/notebook/SimpleNotebook.tsx +++ b/packages/react/src/components/notebook/Notebook2.tsx @@ -4,21 +4,16 @@ * MIT License */ +import React, { useEffect, useState } from 'react'; import type { INotebookContent } from '@jupyterlab/nbformat'; import type { NotebookModel } from '@jupyterlab/notebook'; import type { IRenderMime } from '@jupyterlab/rendermime-interfaces'; import type { ServiceManager } from '@jupyterlab/services'; import type { CommandRegistry } from '@lumino/commands'; import { Box } from '@primer/react'; -import React, { useEffect, useState } from 'react'; import type { OnSessionConnection } from '../../state'; import { Loader } from '../utils'; -import { - BaseNotebook, - useKernelId, - useNotebookModel, - type CollaborationServer, -} from './BaseNotebook'; +import { BaseNotebook, useKernelId, useNotebookModel, type CollaborationServer } from './NotebookBase'; import type { DatalayerNotebookExtension } from './Notebook'; import type { INotebookToolbarProps } from './toolbar'; @@ -27,7 +22,7 @@ import './Notebook.css'; /** * Simple notebook component properties */ -export interface ISimpleNotebookProps { +export interface INotebook2Props { /** * Collaboration server providing the document rooms. */ @@ -114,9 +109,7 @@ export interface ISimpleNotebookProps { * - You must provide the appropriate service manager * - You can specified the kernel id to use; if it is not defined or empty and startDefaultKernel is true, a new kernel will be started. */ -export function SimpleNotebook( - props: React.PropsWithChildren -): JSX.Element { +export function Notebook2(props: React.PropsWithChildren): JSX.Element { const { Toolbar, children, diff --git a/packages/react/src/components/notebook/BaseNotebook.tsx b/packages/react/src/components/notebook/NotebookBase.tsx similarity index 98% rename from packages/react/src/components/notebook/BaseNotebook.tsx rename to packages/react/src/components/notebook/NotebookBase.tsx index 2acb54f4..0f0a2f6e 100644 --- a/packages/react/src/components/notebook/BaseNotebook.tsx +++ b/packages/react/src/components/notebook/NotebookBase.tsx @@ -4,6 +4,7 @@ * MIT License */ +import { useEffect, useMemo, useState } from 'react'; import type { ISessionContext } from '@jupyterlab/apputils'; import type { Cell, CodeCell, ICellModel } from '@jupyterlab/cells'; import { type IEditorServices } from '@jupyterlab/codeeditor'; @@ -30,7 +31,6 @@ import { Widget } from '@lumino/widgets'; import { Box } from '@primer/react'; import { Banner } from '@primer/react/experimental'; import { EditorView } from 'codemirror'; -import { useEffect, useMemo, useState } from 'react'; import { WebsocketProvider } from 'y-websocket'; import { COLLABORATION_ROOM_URL_PATH, fetchSessionId, requestDocSession, WIDGET_MIMETYPE, WidgetLabRenderer, WidgetManager } from '../../jupyter'; import type { OnSessionConnection } from '../../state'; @@ -38,7 +38,7 @@ import { newUuid, remoteUserCursors } from '../../utils'; import { Lumino } from '../lumino'; import { Loader } from '../utils'; import type { DatalayerNotebookExtension } from './Notebook'; -import addNotebookCommands from './NotebookCommands'; +import { addNotebookCommands } from './NotebookCommands'; const COMPLETER_TIMEOUT_MILLISECONDS = 1000; @@ -166,8 +166,8 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { }, []); // Widget factory - const [widgetFactory, setWidgetFactory] = - useState(null); + const [widgetFactory, setWidgetFactory] = useState(null); + useEffect(() => { const thisFactory = new NotebookWidgetFactory({ name: 'Notebook', @@ -188,7 +188,6 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { }, }); setWidgetFactory(thisFactory); - return () => { thisFactory.dispose(); setWidgetFactory(factory => (factory === thisFactory ? null : factory)); @@ -278,7 +277,6 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { panel: thisPanel!, }); extension.createNew(thisPanel!, context); - return extension.component ?? <>; }) ); @@ -322,10 +320,14 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { return () => { widgetsManager?.dispose(); if (thisPanel) { - if (thisPanel.content) Signal.clearData(thisPanel.content); + if (thisPanel.content) { + Signal.clearData(thisPanel.content); + } try { thisPanel.dispose(); - } catch (reason) {} + } catch (reason) { + // No-op + } } setPanel(panel => (panel === thisPanel ? null : panel)); }; @@ -411,13 +413,14 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { isMounted = false; // Reset the completer if (completer) { - if (onActiveCellChanged) + if (onActiveCellChanged) { panel?.content.activeCellChanged.disconnect(onActiveCellChanged); - if (onSessionChanged) + } + if (onSessionChanged) { panel?.context.sessionContext.sessionChanged.connect( onSessionChanged ); - + } completer.editor = null; completer.reconciliator = new ProviderReconciliator({ context: { @@ -649,7 +652,7 @@ export function useNotebookModel(options: { // reset for any reason while the client is still alive. let provider: WebsocketProvider | null = null; let ready = new PromiseDelegate(); - let isMounted = true; + const isMounted = true; let sharedModel: YNotebook | null = null; const onConnectionClose = (event: any) => { @@ -697,7 +700,7 @@ export function useNotebookModel(options: { const params: Record = {}; // Setup Collaboration - if (collaborationServer.type == 'jupyter') { + if (collaborationServer.type === 'jupyter') { const { path, serverSettings } = collaborationServer; const session = await requestDocSession( 'json', @@ -714,10 +717,10 @@ export function useNotebookModel(options: { if (serverSettings.token) { params.token = serverSettings.token; } - } else if (collaborationServer.type == 'datalayer') { + } else if (collaborationServer.type === 'datalayer') { const { baseURL, roomName: roomName_, token } = collaborationServer; roomName = roomName_; // Set non local variable - const serverURL = URLExt.join(baseURL, `/api/spacer/v1/rooms`); + const serverURL = URLExt.join(baseURL, '/api/spacer/v1/rooms'); roomURL = serverURL.replace(/^http/, 'ws'); params.sessionId = await fetchSessionId({ diff --git a/packages/react/src/components/notebook/NotebookCommands.ts b/packages/react/src/components/notebook/NotebookCommands.ts index 3bced758..d1fa6a99 100644 --- a/packages/react/src/components/notebook/NotebookCommands.ts +++ b/packages/react/src/components/notebook/NotebookCommands.ts @@ -9,16 +9,8 @@ import { CommandRegistry } from '@lumino/commands'; import { DisposableSet } from '@lumino/disposable'; import { SessionContextDialogs } from '@jupyterlab/apputils'; import { CompletionHandler } from '@jupyterlab/completer'; -import { - NotebookActions, - NotebookPanel, - NotebookSearchProvider, - NotebookTracker, -} from '@jupyterlab/notebook'; -import { - SearchDocumentModel, - SearchDocumentView, -} from '@jupyterlab/documentsearch'; +import { NotebookActions, NotebookPanel, NotebookSearchProvider, NotebookTracker, } from '@jupyterlab/notebook'; +import { SearchDocumentModel, SearchDocumentView } from '@jupyterlab/documentsearch'; import { Widget } from '@lumino/widgets'; import { nullTranslator } from '@jupyterlab/translation'; import { IYText } from '@jupyter/ydoc'; diff --git a/packages/react/src/components/notebook/index.ts b/packages/react/src/components/notebook/index.ts index 5bd61d4f..013f89fc 100644 --- a/packages/react/src/components/notebook/index.ts +++ b/packages/react/src/components/notebook/index.ts @@ -4,12 +4,12 @@ * MIT License */ -export * from './BaseNotebook'; export * from './Notebook'; +export * from './Notebook2'; export * from './NotebookAdapter'; +export * from './NotebookBase'; export * from './NotebookCommands'; export * from './NotebookState'; -export * from './SimpleNotebook'; export * from './cell'; export * from './content'; export * from './marked'; diff --git a/packages/react/src/examples/NotebookSimple.tsx b/packages/react/src/examples/Notebook2.tsx similarity index 93% rename from packages/react/src/examples/NotebookSimple.tsx rename to packages/react/src/examples/Notebook2.tsx index 82a75a93..2408a103 100644 --- a/packages/react/src/examples/NotebookSimple.tsx +++ b/packages/react/src/examples/Notebook2.tsx @@ -12,7 +12,7 @@ import { createRoot } from 'react-dom/client'; import { INotebookContent } from '@jupyterlab/nbformat'; import { JupyterReactTheme } from '../theme/JupyterReactTheme'; -import { SimpleNotebook } from '../components/notebook/SimpleNotebook'; +import { Notebook2 } from '../components/notebook/Notebook2'; import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar'; import { useJupyter } from '../jupyter'; @@ -23,7 +23,7 @@ const Notebook = () => { return ( serviceManager ? - ; }; -export function JupyterReactTheme( - props: React.PropsWithChildren -): JSX.Element { +export function JupyterReactTheme(props: React.PropsWithChildren): JSX.Element { const { children, colormode = 'light', From 2426f9bf8690d1840c8a025b9efa29ec96778417 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Tue, 8 Apr 2025 19:44:48 +0200 Subject: [PATCH 05/19] fix: deps --- attic/prosemirror/package.json | 2 +- attic/slate/package.json | 2 +- examples/cra/package.json | 2 +- examples/next-js/package.json | 2 +- package.json | 16 ++++++---------- packages/lexical/package.json | 2 +- packages/react/package.json | 7 ++++--- storybook/package.json | 2 +- 8 files changed, 16 insertions(+), 19 deletions(-) diff --git a/attic/prosemirror/package.json b/attic/prosemirror/package.json index 6dc7fd6f..e0abec59 100644 --- a/attic/prosemirror/package.json +++ b/attic/prosemirror/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@codemirror/lang-python": "6.0.1", - "@datalayer/jupyter-react": "^0.18.12", + "@datalayer/jupyter-react": "^0.21.0", "@prosemirror-adapter/react": "0.2.4", "@types/orderedmap": "1.0.0", "codemirror": "6.0.1", diff --git a/attic/slate/package.json b/attic/slate/package.json index fb647420..7633c611 100644 --- a/attic/slate/package.json +++ b/attic/slate/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^0.18.12", + "@datalayer/jupyter-react": "^0.21.0", "@datalayer/primer-addons": "^0.3.2", "@emotion/css": "^11.1.3", "@emotion/react": "^11.10.6", diff --git a/examples/cra/package.json b/examples/cra/package.json index 1148564b..0587f8f7 100644 --- a/examples/cra/package.json +++ b/examples/cra/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^0.18.12", + "@datalayer/jupyter-react": "^0.21.0", "@datalayer/primer-addons": "^0.3.2", "jupyterlab-plotly": "^5.17.0", "plotly.js": "^2.26.2", diff --git a/examples/next-js/package.json b/examples/next-js/package.json index 3f61d893..d1891780 100644 --- a/examples/next-js/package.json +++ b/examples/next-js/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^0.18.12", + "@datalayer/jupyter-react": "^0.21.0", "@datalayer/primer-addons": "^0.3.2", "autoprefixer": "^10.4.14", "eslint": "^8.40.0", diff --git a/package.json b/package.json index c010e737..206204c8 100644 --- a/package.json +++ b/package.json @@ -190,9 +190,7 @@ "prosemirror-view": "1.30.2", "react": "18.2.0", "react-dom": "18.2.0", - "redux": "4.1.0", - "redux-observable": "1.2.0", - "rxjs": "6.6.0", + "pyodide": "0.26.0", "typescript": "5.0.3", "webpack": "5.74.0", "webpack-cli": "4.10.0", @@ -247,8 +245,10 @@ "@jupyterlab/theme-light-extension": "4.1.0", "@jupyterlab/translation": "4.1.0", "@jupyterlab/ui-components": "4.1.0", - "@jupyterlite/server": "^0.4.0", - "@jupyterlite/server-extension": "^0.4.0", + "@jupyterlite/pyodide-kernel": "0.4.4", + "@jupyterlite/pyodide-kernel-extension": "0.4.4", + "@jupyterlite/server": "0.4.0", + "@jupyterlite/server-extension": "0.4.0", "@jupyter/ydoc": "3.0.2", "@lumino/algorithm": "2.0.1", "@lumino/application": "2.2.0", @@ -266,11 +266,6 @@ "@lumino/signaling": "2.1.1", "@lumino/virtualdom": "2.0.1", "@lumino/widgets": "2.3.1", - "@mui/icons-material": "5.10.16", - "@mui/lab": "5.0.0-alpha.85", - "@mui/material": "5.10.7", - "@mui/styles": "5.10.7", - "@mui/system": "5.10.7", "@rjsf/core": "5.3.0", "@rjsf/utils": "5.3.0", "@rjsf/validator-ajv6": "5.3.0", @@ -298,6 +293,7 @@ "prosemirror-state": "1.4.2", "prosemirror-transform": "1.7.1", "prosemirror-view": "1.30.2", + "pyodide": "0.26.0", "react": "18.2.0", "react-dom": "18.2.0", "redux": "4.1.0", diff --git a/packages/lexical/package.json b/packages/lexical/package.json index ec3f2fda..172ce23c 100644 --- a/packages/lexical/package.json +++ b/packages/lexical/package.json @@ -63,7 +63,7 @@ }, "dependencies": { "@datalayer/icons-react": "^0.3.7", - "@datalayer/jupyter-react": "^0.20.0", + "@datalayer/jupyter-react": "^0.21.0", "@datalayer/primer-addons": "^0.3.2", "@jupyterlab/application": "^4.0.0", "@jupyterlab/coreutils": "^6.0.0", diff --git a/packages/react/package.json b/packages/react/package.json index d6796265..5cc4f14c 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -128,9 +128,10 @@ "@jupyterlab/toc-extension": "^6.0.0", "@jupyterlab/translation-extension": "^4.0.0", "@jupyterlab/ui-components-extension": "^4.0.0", - "@jupyterlite/pyodide-kernel-extension": "^0.4.0", - "@jupyterlite/server": "^0.4.0", - "@jupyterlite/server-extension": "^0.4.0", + "@jupyterlite/pyodide-kernel": "0.4.0", + "@jupyterlite/pyodide-kernel-extension": "0.4.0", + "@jupyterlite/server": "0.4.0", + "@jupyterlite/server-extension": "0.4.0", "@lumino/default-theme": "^2.0.0", "@primer/react": "^36.27.0", "assert": "^2.0.0", diff --git a/storybook/package.json b/storybook/package.json index 2b7ea1a5..35e29aa3 100644 --- a/storybook/package.json +++ b/storybook/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "@datalayer/jupyter-lexical": "^0.2.0", - "@datalayer/jupyter-react": "^0.18.12", + "@datalayer/jupyter-react": "^0.21.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, From 91574d1e7aebf1e422c47084deb8a49a0fe7c021 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Sat, 12 Apr 2025 19:31:56 +0200 Subject: [PATCH 06/19] deps --- attic/esbuild/package.json | 114 ++++----- attic/prosemirror/package.json | 106 ++++---- attic/slate/package.json | 14 +- docs/docs/integrations/cra/index.mdx | 2 +- docs/package.json | 22 +- environment.yml | 2 +- examples/cra/package.json | 12 +- examples/docusaurus/package.json | 14 +- examples/lexical/package.json | 12 +- examples/next-js/package.json | 14 +- package.json | 241 +----------------- packages/docusaurus-plugin/package.json | 14 +- packages/ipyreactive/pyproject.toml | 2 +- packages/lexical/package.json | 30 +-- packages/lexical/ui-tests/package.json | 2 +- packages/react/Makefile | 2 +- packages/react/package.json | 48 ++-- .../react/src/components/cell/CellAdapter.ts | 37 +-- .../src/components/notebook/Notebook.tsx | 5 +- .../src/examples/NotebookCollaborative.tsx | 2 +- packages/vscode/package.json | 22 +- storybook/package.json | 14 +- 22 files changed, 245 insertions(+), 486 deletions(-) diff --git a/attic/esbuild/package.json b/attic/esbuild/package.json index 7f11cfa7..3d1b423b 100644 --- a/attic/esbuild/package.json +++ b/attic/esbuild/package.json @@ -13,75 +13,75 @@ "build:tsc": "tsc" }, "dependencies": { - "@datalayer/typescript-fsa-redux-observable": "0.18.0", - "@monaco-editor/react": "3.7.5", - "@mui/icons-material": "5.10.16", - "@mui/lab": "5.0.0-alpha.85", - "@mui/material": "5.10.7", - "@mui/styles": "5.10.7", - "@mui/system": "5.10.7", + "@datalayer/typescript-fsa-redux-observable": "^0.18.0", + "@monaco-editor/react": "^3.7.5", + "@mui/icons-material": "^5.10.16", + "@mui/lab": "^5.0.0-alpha.85", + "@mui/material": "^5.10.7", + "@mui/styles": "^5.10.7", + "@mui/system": "^5.10.7", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", - "@uiw/react-md-editor": "2.1.1", - "assert": "2.0.0", - "axios": "0.30.0", + "@uiw/react-md-editor": "^2.1.1", + "assert": "^2.0.0", + "axios": "^0.30.0", "bulmaswatch": "^0.8.1", - "constants-browserify": "1.0.0", - "esbuild-wasm": "0.8.27", - "history": "5.0.0", - "html2canvas": "1.0.0-rc.7", + "constants-browserify": "^1.0.0", + "esbuild-wasm": "^0.8.27", + "history": "^5.0.0", + "html2canvas": "^1.0.0-rc.7", "immer": "^9.0.2", - "jscodeshift": "0.11.0", + "jscodeshift": "^0.11.0", "jwt-decode": "^2.2.0", "localforage": "^1.9.0", - "monaco-jsx-highlighter": "0.0.15", - "notistack": "2.0.5", - "os-browserify": "0.3.0", - "prettier": "2.3.1", + "monaco-jsx-highlighter": "^0.0.15", + "notistack": "^2.0.5", + "os-browserify": "^0.3.0", + "prettier": "^2.3.1", "react": "18.2.0", "react-dom": "18.2.0", - "react-hook-form": "5.7.2", - "react-redux": "7.2.2", - "react-resizable": "1.11.0", - "react-router": "6.0.2", - "react-router-dom": "6.22.3", - "react-scripts": "5.0.1", - "react-syntax-highlighter": "15.4.3", - "redux": "4.2.1", - "redux-observable": "1.2.0", - "redux-thunk": "2.4.2", - "validator": "13.7.0", + "react-hook-form": "^5.7.2", + "react-redux": "^7.2.2", + "react-resizable": "^1.11.0", + "react-router": "^6.0.2", + "react-router-dom": "^6.22.3", + "react-scripts": "^5.0.1", + "react-syntax-highlighter": "^15.4.3", + "redux": "^4.2.1", + "redux-observable": "^1.2.0", + "redux-thunk": "^2.4.2", + "validator": "^13.7.0", "web-vitals": "^1.0.1" }, "devDependencies": { - "@babel/core": "7.21.0", - "@babel/plugin-proposal-class-properties": "7.18.6", - "@babel/preset-react": "7.18.6", - "@babel/preset-typescript": "7.21.0", - "@svgr/webpack": "5.5.0", - "@types/jest": "29.4.0", - "@types/jscodeshift": "0.7.2", - "@types/jwt-decode": "2.2.1", - "@types/node": "18.15.3", - "@types/prettier": "2.2.3", + "@babel/core": "^7.21.0", + "@babel/plugin-proposal-class-properties": "^7.18.6", + "@babel/preset-react": "^7.18.6", + "@babel/preset-typescript": "^7.21.0", + "@svgr/webpack": "^5.5.0", + "@types/jest": "^29.4.0", + "@types/jscodeshift": "^0.7.2", + "@types/jwt-decode": "^2.2.1", + "@types/node": "^18.15.3", + "@types/prettier": "^2.2.3", "@types/react": "18.2.12", - "@types/react-dom": "18.2.5", - "@types/react-resizable": "1.7.2", - "@types/validator": "9.4.1", - "babel-loader": "9.1.2", - "bundle-loader": "0.5.6", - "css-loader": "6.9.1", - "html-webpack-plugin": "5.3.1", - "npm-run-all": "4.1.5", - "path-browserify": "1.0.1", - "rimraf": "3.0.2", - "style-loader": "2.0.0", - "svg-url-loader": "7.1.1", - "typescript": "5.0.3", - "url-loader": "4.0.0", - "webpack": "5.94.0", - "webpack-cli": "4.10.0", - "webpack-dev-server": "4.9.3" + "@types/react-dom": "18.3.0", + "@types/react-resizable": "^1.7.2", + "@types/validator": "^9.4.1", + "babel-loader": "^9.1.2", + "bundle-loader": "^0.5.6", + "css-loader": "^6.9.1", + "html-webpack-plugin": "^5.3.1", + "npm-run-all": "^4.1.5", + "path-browserify": "^1.0.1", + "rimraf": "^6.0.1", + "style-loader": "^2.0.0", + "svg-url-loader": "^7.1.1", + "typescript": "^5.0.3", + "url-loader": "^4.0.0", + "webpack": "^5.94.0", + "webpack-cli": "^4.10.0", + "webpack-dev-server": "^4.9.3" } } diff --git a/attic/prosemirror/package.json b/attic/prosemirror/package.json index e0abec59..7a3bfaf0 100644 --- a/attic/prosemirror/package.json +++ b/attic/prosemirror/package.json @@ -22,61 +22,61 @@ "kill": "./../../dev/sh/kill.sh || true" }, "dependencies": { - "@codemirror/lang-python": "6.0.1", - "@datalayer/jupyter-react": "^0.21.0", - "@prosemirror-adapter/react": "0.2.4", - "@types/orderedmap": "1.0.0", - "codemirror": "6.0.1", + "@codemirror/lang-python": "^6.0.1", + "@datalayer/jupyter-react": "^0.21.2", + "@prosemirror-adapter/react": "^0.2.4", + "@types/orderedmap": "^1.0.0", + "codemirror": "^6.0.1", "lodash": "^4.17.4", - "prosemirror-commands": "1.5.1", - "prosemirror-dropcursor": "1.8.0", - "prosemirror-example-setup": "1.2.1", - "prosemirror-gapcursor": "1.3.1", - "prosemirror-history": "1.3.0", - "prosemirror-inputrules": "1.2.0", - "prosemirror-keymap": "1.2.1", - "prosemirror-menu": "1.2.1", - "prosemirror-model": "1.19.0", - "prosemirror-schema-list": "1.2.2", - "prosemirror-state": "1.4.2", - "prosemirror-transform": "1.7.1", - "prosemirror-view": "1.30.2", - "redux": "4.2.1", - "redux-observable": "1.2.0", - "uuid": "8.3.2" + "prosemirror-commands": "^1.5.1", + "prosemirror-dropcursor": "^1.8.0", + "prosemirror-example-setup": "^1.2.1", + "prosemirror-gapcursor": "^1.3.1", + "prosemirror-history": "^1.3.0", + "prosemirror-inputrules": "^1.2.0", + "prosemirror-keymap": "^1.2.1", + "prosemirror-menu": "^1.2.1", + "prosemirror-model": "^1.19.0", + "prosemirror-schema-list": "^1.2.2", + "prosemirror-state": "^1.4.2", + "prosemirror-transform": "^1.7.1", + "prosemirror-view": "^1.30.2", + "redux": "^4.2.1", + "redux-observable": "^1.2.0", + "uuid": "^8.3.2" }, "devDependencies": { - "@babel/core": "7.21.0", - "@babel/plugin-proposal-class-properties": "7.18.6", - "@babel/preset-react": "7.18.6", - "@babel/preset-typescript": "7.21.0", - "@svgr/webpack": "5.5.0", - "@types/codemirror": "5.60.4", - "@types/node": "18.15.3", - "@types/plotly.js": "1.54.11", - "@types/uuid": "8.3.0", - "assert": "2.0.0", - "css-loader": "6.9.1", - "file-loader": "6.2.0", - "gulp": "4.0.2", - "gulp-append-prepend": "1.0.8", - "gulp-filter": "6.0.0", - "gulp-watch": "5.0.1", - "html-webpack-plugin": "5.3.1", - "html-webpack-tags-plugin": "2.0.17", - "npm-run-all": "4.1.5", - "process": "0.11.10", - "raw-loader": "4.0.2", - "rimraf": "3.0.2", - "stream-browserify": "2.0.2", - "style-loader": "2.0.0", - "svg-url-loader": "7.1.1", - "typedoc": "0.25.7", - "typescript": "5.0.3", - "url-loader": "~3.0.0", - "watch": "~1.0.2", - "webpack": "5.94.0", - "webpack-cli": "4.10.0", - "webpack-dev-server": "4.9.3" + "@babel/core": "^7.21.0", + "@babel/plugin-proposal-class-properties": "^7.18.6", + "@babel/preset-react": "^7.18.6", + "@babel/preset-typescript": "^7.21.0", + "@svgr/webpack": "^5.5.0", + "@types/codemirror": "^5.60.4", + "@types/node": "^18.15.3", + "@types/plotly.js": "^1.54.11", + "@types/uuid": "^8.3.0", + "assert": "^2.0.0", + "css-loader": "^6.9.1", + "file-loader": "^6.2.0", + "gulp": "^4.0.2", + "gulp-append-prepend": "^1.0.8", + "gulp-filter": "^6.0.0", + "gulp-watch": "^5.0.1", + "html-webpack-plugin": "^5.3.1", + "html-webpack-tags-plugin": "^3.0.2", + "npm-run-all": "^4.1.5", + "process": "^0.11.10", + "raw-loader": "^4.0.2", + "rimraf": "^6.0.1", + "stream-browserify": "^2.0.2", + "style-loader": "^2.0.0", + "svg-url-loader": "^7.1.1", + "typedoc": "^0.25.7", + "typescript": "^5.0.3", + "url-loader": "^3.0.0", + "watch": "^1.0.2", + "webpack": "^5.94.0", + "webpack-cli": "^4.10.0", + "webpack-dev-server": "^4.9.3" } } diff --git a/attic/slate/package.json b/attic/slate/package.json index 7633c611..6648fbdb 100644 --- a/attic/slate/package.json +++ b/attic/slate/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^0.21.0", + "@datalayer/jupyter-react": "^0.21.2", "@datalayer/primer-addons": "^0.3.2", "@emotion/css": "^11.1.3", "@emotion/react": "^11.10.6", @@ -42,8 +42,8 @@ "is-url": "^1.2.4", "lodash": "^4.17.4", "prismjs": "^1.24.1", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "18.2.0", + "react-dom": "18.2.0", "react-error-boundary": "^3.1.3", "react-redux": "^8.0.2", "redux": "^4.2.1", @@ -63,8 +63,8 @@ "@types/deep-equal": "^1.0.1", "@types/node": "^18.15.3", "@types/plotly.js": "^1.54.11", - "@types/react": "^18.2.12", - "@types/react-dom": "^18.2.5", + "@types/react": "18.2.12", + "@types/react-dom": "18.3.0", "@types/uuid": "^8.3.0", "assert": "^2.0.0", "babel-loader": "^9.1.2", @@ -76,11 +76,11 @@ "gulp-filter": "^6.0.0", "gulp-watch": "^5.0.1", "html-webpack-plugin": "^5.3.1", - "html-webpack-tags-plugin": "^2.0.17", + "html-webpack-tags-plugin": "^3.0.2", "npm-run-all": "^4.1.5", "process": "^0.11.10", "raw-loader": "^4.0.2", - "rimraf": "^3.0.2", + "rimraf": "^6.0.1", "stream": "^0.0.2", "stream-browserify": "^2.0.2", "style-loader": "^2.0.0", diff --git a/docs/docs/integrations/cra/index.mdx b/docs/docs/integrations/cra/index.mdx index 9e2aa82c..32dfb23c 100644 --- a/docs/docs/integrations/cra/index.mdx +++ b/docs/docs/integrations/cra/index.mdx @@ -52,7 +52,7 @@ Add Jupyter React in `package.json`. ```json "dependencies": { - "@datalayer/jupyter-react": "0.5.1", + "@datalayer/jupyter-react": "^0.21.2", }, ``` diff --git a/docs/package.json b/docs/package.json index e200950b..40de332e 100644 --- a/docs/package.json +++ b/docs/package.json @@ -16,24 +16,24 @@ }, "dependencies": { "@datalayer/jupyter-docusaurus-plugin": "^0.1.2", - "@docusaurus/core": "3.5.2", - "@docusaurus/preset-classic": "3.5.2", - "@docusaurus/theme-live-codeblock": "3.5.2", - "@docusaurus/theme-mermaid": "3.5.2", + "@docusaurus/core": "^3.5.2", + "@docusaurus/preset-classic": "^3.5.2", + "@docusaurus/theme-live-codeblock": "^3.5.2", + "@docusaurus/theme-mermaid": "^3.5.2", "@mdx-js/react": "^3.0.1", "@primer/react-brand": "^0.44.1", "clsx": "^2.1.1", - "docusaurus-lunr-search": "3.5.0", - "docusaurus-plugin-typedoc": "~0.17.5", - "react": "^18.2.0", - "react-calendly": "4.1.0", - "react-dom": "^18.2.0", + "docusaurus-lunr-search": "^3.5.0", + "docusaurus-plugin-typedoc": "^0.17.5", + "react": "18.2.0", + "react-calendly": "^4.1.0", + "react-dom": "18.2.0", "react-modal-image": "^2.5.0", "typedoc-plugin-markdown": "^3.13.5" }, "devDependencies": { - "@docusaurus/module-type-aliases": "3.5.0", - "@tsconfig/docusaurus": "2.0.3", + "@docusaurus/module-type-aliases": "^3.5.0", + "@tsconfig/docusaurus": "^2.0.3", "cross-env": "^7.0.3", "typescript": "^5.0.3" }, diff --git a/environment.yml b/environment.yml index 28009b72..c21184c3 100644 --- a/environment.yml +++ b/environment.yml @@ -14,4 +14,4 @@ dependencies: - build - hatch - pip: - - jupyterlab==4.1.0b0 + - jupyterlab==4.1.0 diff --git a/examples/cra/package.json b/examples/cra/package.json index 0587f8f7..5916ab93 100644 --- a/examples/cra/package.json +++ b/examples/cra/package.json @@ -13,12 +13,12 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^0.21.0", + "@datalayer/jupyter-react": "^0.21.2", "@datalayer/primer-addons": "^0.3.2", "jupyterlab-plotly": "^5.17.0", "plotly.js": "^2.26.2", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "18.2.0", + "react-dom": "18.2.0", "web-vitals": "^2.1.4" }, "devDependencies": { @@ -27,11 +27,11 @@ "@testing-library/user-event": "^13.5.0", "@types/jest": "^29.4.0", "@types/node": "^18.15.3", - "@types/react": "^18.0.27", - "@types/react-dom": "^18.0.10", + "@types/react": "18.0.27", + "@types/react-dom": "18.0.10", "npm-run-all": "^4.1.5", "raw-loader": "^4.0.2", - "react-scripts": "5.0.1", + "react-scripts": "^5.0.1", "typescript": "^4" }, "eslintConfig": { diff --git a/examples/docusaurus/package.json b/examples/docusaurus/package.json index 2ab78801..0c07a062 100644 --- a/examples/docusaurus/package.json +++ b/examples/docusaurus/package.json @@ -21,16 +21,16 @@ "write-heading-ids": "docusaurus write-heading-ids" }, "dependencies": { - "@datalayer/jupyter-docusaurus-plugin": "0.1.0", - "@docusaurus/core": "3.5.2", - "@docusaurus/preset-classic": "3.5.2", - "@docusaurus/theme-live-codeblock": "3.5.2", - "@docusaurus/theme-mermaid": "3.5.2", + "@datalayer/jupyter-docusaurus-plugin": "^0.1.0", + "@docusaurus/core": "^3.5.2", + "@docusaurus/preset-classic": "^3.5.2", + "@docusaurus/theme-live-codeblock": "^3.5.2", + "@docusaurus/theme-mermaid": "^3.5.2", "@mdx-js/react": "^3.0.1", "clsx": "^2.1.1", "prism-react-renderer": "^1.2.1", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "18.2.0", + "react-dom": "18.2.0", "react-router-dom": "^6.22.3" }, "devDependencies": { diff --git a/examples/lexical/package.json b/examples/lexical/package.json index 1d89fe05..85aed850 100644 --- a/examples/lexical/package.json +++ b/examples/lexical/package.json @@ -30,8 +30,8 @@ "dependencies": { "@datalayer/jupyter-lexical": "^0.2.0", "@datalayer/primer-addons": "^0.3.2", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "18.2.0", + "react-dom": "18.2.0", "react-json-tree": "^0.17.0" }, "devDependencies": { @@ -41,8 +41,8 @@ "@babel/preset-typescript": "^7.21.0", "@babel/runtime": "^7.13.8", "@types/node": "^18.15.3", - "@types/react": "^18.2.12", - "@types/react-dom": "^18.2.5", + "@types/react": "18.2.12", + "@types/react-dom": "18.3.0", "@types/uuid": "^8.3.0", "babel-loader": "^9.1.2", "bundle-loader": "^0.5.6", @@ -50,11 +50,11 @@ "file-loader": "^6.2.0", "gulp": "^4.0.2", "html-webpack-plugin": "^5.3.1", - "html-webpack-tags-plugin": "^2.0.17", + "html-webpack-tags-plugin": "^3.0.2", "npm-run-all": "^4.1.5", "process": "^0.11.10", "raw-loader": "^4.0.2", - "rimraf": "^3.0.2", + "rimraf": "^6.0.1", "stream": "^0.0.2", "stream-browserify": "^2.0.2", "style-loader": "^2.0.0", diff --git a/examples/next-js/package.json b/examples/next-js/package.json index d1891780..1e1a3836 100644 --- a/examples/next-js/package.json +++ b/examples/next-js/package.json @@ -11,23 +11,23 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^0.21.0", + "@datalayer/jupyter-react": "^0.21.2", "@datalayer/primer-addons": "^0.3.2", "autoprefixer": "^10.4.14", - "eslint": "^8.40.0", - "eslint-config-next": "^13.4.1", + "eslint": "^9.0.0", + "eslint-config-next": "^15.3.0", "next": "^14.2.3", "next-themes": "^0.2.1", "postcss": "^8.4.23", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "18.2.0", + "react-dom": "18.2.0", "svg-url-loader": "^7.1.1", "tailwindcss": "^3.3.2" }, "devDependencies": { "@types/node": "^18.15.3", - "@types/react": "^18.2.12", - "@types/react-dom": "^18.2.5", + "@types/react": "18.2.12", + "@types/react-dom": "18.3.0", "raw-loader": "^4.0.2", "typescript": "^5.0.3" } diff --git a/package.json b/package.json index 206204c8..1d8257dc 100644 --- a/package.json +++ b/package.json @@ -57,253 +57,36 @@ "babel-eslint": "^10.0.1", "concurrently": "^6.2.0", "eslint": "^5.16.0", - "eslint-config-prettier": "^4.2.0", - "eslint-config-react-app": "^4.0.0", + "eslint-config-prettier": "^10.1.2", "eslint-config-xo": "^0.26.0", "eslint-config-xo-react": "^0.19.0", "eslint-plugin-import": "^2.17.2", "eslint-plugin-jsx-a11y": "^6.2.1", - "eslint-plugin-prettier": "^3.0.1", + "eslint-plugin-prettier": "^5.2.6", "eslint-plugin-react": "^7.12.4", - "eslint-plugin-react-hooks": "^1.6.0", + "eslint-plugin-react-hooks": "^5.2.0", "fkill-cli": "^7.1.0", "jest-prop-type-error": "^1.1.0", "lerna": "^8.1.2", "patch-package": "^8.0.0", "prettier": "^2.3.1", - "rimraf": "^3.0.2", + "rimraf": "^6.0.1", "vercel": "^21.3.3" }, "resolutions": { - "@datalayer/jupyter-docusaurus-plugin": "workspace:^", - "@datalayer/jupyter-lexical": "workspace:^", - "@datalayer/jupyter-lexical-example": "workspace:^", - "@datalayer/jupyter-react": "workspace:^", - "@datalayer/jupyter-slate-example": "workspace:^", - "@datalayer/jupyter-ui-docs": "workspace:^", - "@jupyter-widgets/base": "6.0.6", - "@jupyter-widgets/controls": "5.0.7", - "@jupyter-widgets/html-manager": "1.0.9", - "@jupyter-widgets/jupyterlab-manager": "5.0.9", - "@jupyter-widgets/output": "6.0.6", - "@jupyterlab/application": "4.1.0", - "@jupyterlab/apputils": "4.2.0", - "@jupyterlab/attachments": "4.1.0", - "@jupyterlab/cells": "4.1.0", - "@jupyterlab/codeeditor": "4.1.0", - "@jupyterlab/codemirror": "4.1.0", - "@jupyterlab/completer": "4.1.0", - "@jupyterlab/console": "4.1.0", - "@jupyterlab/coreutils": "6.1.0", - "@jupyterlab/docmanager": "4.1.0", - "@jupyterlab/docregistry": "4.1.0", - "@jupyterlab/documentsearch": "4.1.0", - "@jupyterlab/filebrowser": "4.1.0", - "@jupyterlab/fileeditor": "4.1.0", - "@jupyterlab/inspector": "4.1.0", - "@jupyterlab/javascript-extension": "4.1.0", - "@jupyterlab/json-extension": "4.1.0", - "@jupyterlab/launcher": "4.1.0", - "@jupyterlab/lsp": "4.1.0", - "@jupyterlab/mainmenu": "4.1.0", - "@jupyterlab/markdownviewer": "4.1.0", - "@jupyterlab/markedparser-extension": "4.1.0", - "@jupyterlab/mathjax-extension": "4.1.0", - "@jupyterlab/nbconvert-css": "4.1.0", - "@jupyterlab/nbformat": "4.1.0", - "@jupyterlab/notebook": "4.1.0", - "@jupyterlab/observables": "5.1.0", - "@jupyterlab/outputarea": "4.1.0", - "@jupyterlab/rendermime": "4.1.0", - "@jupyterlab/rendermime-extension": "4.1.0", - "@jupyterlab/rendermime-interfaces": "3.9.0", - "@jupyterlab/running": "4.1.0", - "@jupyterlab/running-extension": "4.1.0", - "@jupyterlab/services": "7.1.0", - "@jupyterlab/settingregistry": "4.1.0", - "@jupyterlab/statedb": "4.1.0", - "@jupyterlab/terminal": "4.1.0", - "@jupyterlab/theme-dark-extension": "4.1.0", - "@jupyterlab/theme-light-extension": "4.1.0", - "@jupyterlab/translation": "4.1.0", - "@jupyterlab/ui-components": "4.1.0", - "@jupyterlite/server": "^0.4.0", - "@jupyterlite/server-extension": "^0.4.0", - "@jupyter/ydoc": "3.0.2", - "@lexical/code": "0.23.1", - "@lexical/link": "0.23.1", - "@lexical/list": "0.23.1", - "@lexical/react": "0.23.1", - "@lexical/rich-text": "0.23.1", - "@lexical/selection": "0.23.1", - "@lexical/table": "0.23.1", - "@lexical/utils": "0.23.1", - "@lexical/yjs": "0.23.1", - "lexical": "0.23.1", - "@lumino/algorithm": "2.0.1", - "@lumino/application": "2.2.0", - "@lumino/collections": "2.0.1", - "@lumino/commands": "2.2.0", - "@lumino/coreutils": "2.1.1", - "@lumino/default-theme": "2.1.2", - "@lumino/disposable": "2.1.1", - "@lumino/domutils": "2.0.1", - "@lumino/dragdrop": "2.1.2", - "@lumino/keyboard": "2.0.1", - "@lumino/messaging": "2.0.1", - "@lumino/polling": "2.1.1", - "@lumino/properties": "2.0.1", - "@lumino/signaling": "2.1.1", - "@lumino/virtualdom": "2.0.1", - "@lumino/widgets": "2.3.1", - "@mui/icons-material": "5.10.16", - "@mui/lab": "5.0.0-alpha.85", - "@mui/material": "5.10.7", - "@mui/styles": "5.10.7", - "@mui/system": "5.10.7", - "@rjsf/core": "5.3.0", - "@rjsf/utils": "5.3.0", - "@rjsf/validator-ajv6": "5.3.0", - "@rjsf/validator-ajv8": "5.3.0", + "@jupyterlab/services": "^7.0.0", + "@primer/react": "^36.27.0", "@types/react": "18.2.12", - "@types/react-dom": "18.2.5", - "@jest/core": "29.4.3", - "@jest/transform": "29.4.3", - "csstype": "<3.1.0", - "jest": "29.4.3", - "jest-environment-jsdom": "29.4.3", - "ts-jest": "29.0.5", - "html-webpack-plugin": "5.3.1", - "htmlparser2": "8.0.1", - "prosemirror-commands": "1.5.1", - "prosemirror-dropcursor": "1.8.0", - "prosemirror-example-setup": "1.2.1", - "prosemirror-gapcursor": "1.3.1", - "prosemirror-history": "1.3.0", - "prosemirror-inputrules": "1.2.0", - "prosemirror-keymap": "1.2.1", - "prosemirror-menu": "1.2.1", - "prosemirror-model": "1.19.0", - "prosemirror-schema-list": "1.2.2", - "prosemirror-state": "1.4.2", - "prosemirror-transform": "1.7.1", - "prosemirror-view": "1.30.2", + "@types/react-dom": "18.3.0", "react": "18.2.0", - "react-dom": "18.2.0", - "pyodide": "0.26.0", - "typescript": "5.0.3", - "webpack": "5.74.0", - "webpack-cli": "4.10.0", - "webpack-dev-server": "4.9.3", - "y-websocket": "1.4.5", - "yjs": "13.6.24" + "react-dom": "18.2.0" }, "overrides": { - "@jupyter-widgets/base": "6.0.6", - "@jupyter-widgets/controls": "5.0.7", - "@jupyter-widgets/html-manager": "1.0.9", - "@jupyter-widgets/jupyterlab-manager": "5.0.9", - "@jupyter-widgets/output": "6.0.6", - "@jupyterlab/application": "4.1.0", - "@jupyterlab/apputils": "4.2.0", - "@jupyterlab/attachments": "4.1.0", - "@jupyterlab/cells": "4.1.0", - "@jupyterlab/codeeditor": "4.1.0", - "@jupyterlab/codemirror": "4.1.0", - "@jupyterlab/completer": "4.1.0", - "@jupyterlab/console": "4.1.0", - "@jupyterlab/coreutils": "6.1.0", - "@jupyterlab/docmanager": "4.1.0", - "@jupyterlab/docregistry": "4.1.0", - "@jupyterlab/documentsearch": "4.1.0", - "@jupyterlab/filebrowser": "4.1.0", - "@jupyterlab/fileeditor": "4.1.0", - "@jupyterlab/inspector": "4.1.0", - "@jupyterlab/javascript-extension": "4.1.0", - "@jupyterlab/json-extension": "4.1.0", - "@jupyterlab/launcher": "4.1.0", - "@jupyterlab/lsp": "4.1.0", - "@jupyterlab/mainmenu": "4.1.0", - "@jupyterlab/markdownviewer": "4.1.0", - "@jupyterlab/markedparser-extension": "4.1.0", - "@jupyterlab/mathjax-extension": "4.1.0", - "@jupyterlab/nbconvert-css": "4.1.0", - "@jupyterlab/nbformat": "4.1.0", - "@jupyterlab/notebook": "4.1.0", - "@jupyterlab/observables": "5.1.0", - "@jupyterlab/outputarea": "4.1.0", - "@jupyterlab/rendermime": "4.1.0", - "@jupyterlab/rendermime-extension": "4.1.0", - "@jupyterlab/rendermime-interfaces": "3.9.0", - "@jupyterlab/running": "4.1.0", - "@jupyterlab/running-extension": "4.1.0", - "@jupyterlab/services": "7.1.0", - "@jupyterlab/settingregistry": "4.1.0", - "@jupyterlab/statedb": "4.1.0", - "@jupyterlab/terminal": "4.1.0", - "@jupyterlab/theme-dark-extension": "4.1.0", - "@jupyterlab/theme-light-extension": "4.1.0", - "@jupyterlab/translation": "4.1.0", - "@jupyterlab/ui-components": "4.1.0", - "@jupyterlite/pyodide-kernel": "0.4.4", - "@jupyterlite/pyodide-kernel-extension": "0.4.4", - "@jupyterlite/server": "0.4.0", - "@jupyterlite/server-extension": "0.4.0", - "@jupyter/ydoc": "3.0.2", - "@lumino/algorithm": "2.0.1", - "@lumino/application": "2.2.0", - "@lumino/collections": "2.0.1", - "@lumino/commands": "2.2.0", - "@lumino/coreutils": "2.1.1", - "@lumino/default-theme": "2.1.2", - "@lumino/disposable": "2.1.1", - "@lumino/domutils": "2.0.1", - "@lumino/dragdrop": "2.1.2", - "@lumino/keyboard": "2.0.1", - "@lumino/messaging": "2.0.1", - "@lumino/polling": "2.1.1", - "@lumino/properties": "2.0.1", - "@lumino/signaling": "2.1.1", - "@lumino/virtualdom": "2.0.1", - "@lumino/widgets": "2.3.1", - "@rjsf/core": "5.3.0", - "@rjsf/utils": "5.3.0", - "@rjsf/validator-ajv6": "5.3.0", - "@rjsf/validator-ajv8": "5.3.0", + "@jupyterlab/services": "^7.0.0", + "@primer/react": "^36.27.0", "@types/react": "18.2.12", - "@types/react-dom": "18.2.5", - "@jest/core": "29.4.3", - "@jest/transform": "29.4.3", - "csstype": "<3.1.0", - "jest": "29.4.3", - "jest-environment-jsdom": "29.4.3", - "ts-jest": "29.0.5", - "html-webpack-plugin": "5.3.1", - "htmlparser2": "8.0.1", - "prosemirror-commands": "1.5.1", - "prosemirror-dropcursor": "1.8.0", - "prosemirror-example-setup": "1.2.1", - "prosemirror-gapcursor": "1.3.1", - "prosemirror-history": "1.3.0", - "prosemirror-inputrules": "1.2.0", - "prosemirror-keymap": "1.2.1", - "prosemirror-menu": "1.2.1", - "prosemirror-model": "1.19.0", - "prosemirror-schema-list": "1.2.2", - "prosemirror-state": "1.4.2", - "prosemirror-transform": "1.7.1", - "prosemirror-view": "1.30.2", - "pyodide": "0.26.0", + "@types/react-dom": "18.3.0", "react": "18.2.0", - "react-dom": "18.2.0", - "redux": "4.1.0", - "redux-observable": "1.2.0", - "rxjs": "6.6.0", - "typescript": "5.0.3", - "webpack": "5.74.0", - "webpack-cli": "4.10.0", - "webpack-dev-server": "4.9.3", - "y-websocket": "1.4.5", - "yjs": "13.6.24" + "react-dom": "18.2.0" } } diff --git a/packages/docusaurus-plugin/package.json b/packages/docusaurus-plugin/package.json index f61f014b..fe776a44 100644 --- a/packages/docusaurus-plugin/package.json +++ b/packages/docusaurus-plugin/package.json @@ -23,16 +23,16 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^0.17.0", + "@datalayer/jupyter-react": "^0.21.2", "@datalayer/primer-addons": "^0.3.2", - "@docusaurus/core": "3.5.2", - "@docusaurus/types": "3.5.2" + "@docusaurus/core": "^3.5.2", + "@docusaurus/types": "^3.5.2" }, "devDependencies": { "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/preset-env": "^7.19.4", "@babel/preset-react": "^7.18.6", - "@types/react": "^18.2.12", + "@types/react": "18.2.12", "assert": "^2.0.0", "babel-loader": "^9.1.2", "css-loader": "^6.9.1", @@ -40,7 +40,7 @@ "fs-extra": "^9.1.0", "process": "^0.11.10", "raw-loader": "^4.0.2", - "rimraf": "^3.0.2", + "rimraf": "^6.0.1", "stream-browserify": "^2.0.2", "style-loader": "^2.0.0", "svg-url-loader": "^7.1.1", @@ -51,7 +51,7 @@ "webpack": "^5.74.0" }, "peerDependencies": { - "react": "^18.2.0", - "react-dom": "^18.2.0" + "react": "18.2.0", + "react-dom": "18.2.0" } } diff --git a/packages/ipyreactive/pyproject.toml b/packages/ipyreactive/pyproject.toml index ae64da4c..62f2284e 100644 --- a/packages/ipyreactive/pyproject.toml +++ b/packages/ipyreactive/pyproject.toml @@ -3,5 +3,5 @@ # MIT License [build-system] -requires = ["jupyter_packaging==0.7.9", "jupyterlab==4.1.0b0", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging==0.7.9", "jupyterlab==4.1.0", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/packages/lexical/package.json b/packages/lexical/package.json index 172ce23c..6479a94e 100644 --- a/packages/lexical/package.json +++ b/packages/lexical/package.json @@ -63,7 +63,7 @@ }, "dependencies": { "@datalayer/icons-react": "^0.3.7", - "@datalayer/jupyter-react": "^0.21.0", + "@datalayer/jupyter-react": "^0.21.2", "@datalayer/primer-addons": "^0.3.2", "@jupyterlab/application": "^4.0.0", "@jupyterlab/coreutils": "^6.0.0", @@ -81,9 +81,9 @@ "katex": "^0.16.21", "lexical": "^0.23.1", "lodash-es": "^4.17.21", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-json-tree": "0.19.0", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-json-tree": "^0.19.0", "styled-components": "^5.3.10" }, "devDependencies": { @@ -99,34 +99,34 @@ "@types/marked": "^4.0.1", "@types/node": "^18.15.3", "@types/plotly.js": "^1.54.11", - "@types/prettier": "3.0.0", + "@types/prettier": "^3.0.0", "@types/prismjs": "^1.26.0", - "@types/react": "^18.2.12", - "@types/react-dom": "^18.2.5", + "@types/react": "18.2.12", + "@types/react-dom": "18.3.0", "@types/styled-components": "^5.1.26", "@types/uuid": "^8.3.0", - "@typescript-eslint/eslint-plugin": "^4.8.1", - "@typescript-eslint/parser": "^4.8.1", + "@typescript-eslint/eslint-plugin": "^8.29.1", + "@typescript-eslint/parser": "^8.29.1", "babel-loader": "^9.1.2", "bundle-loader": "^0.5.6", "css-loader": "^7.1.2", - "eslint": "^7.14.0", - "eslint-config-prettier": "^6.15.0", - "eslint-plugin-prettier": "^3.1.4", + "eslint": "^9.0.0", + "eslint-config-prettier": "^10.1.2", + "eslint-plugin-prettier": "^5.2.6", "file-loader": "^6.2.0", "gulp": "^4.0.2", "gulp-append-prepend": "^1.0.8", "gulp-filter": "^6.0.0", "gulp-watch": "^5.0.1", "html-webpack-plugin": "^5.3.1", - "html-webpack-tags-plugin": "^2.0.17", + "html-webpack-tags-plugin": "^3.0.2", "jest": "^29.4.3", "mkdirp": "^1.0.3", "npm-run-all": "^4.1.5", - "prettier": "3.3.2", + "prettier": "^3.3.2", "process": "^0.11.10", "raw-loader": "^4.0.2", - "rimraf": "^3.0.2", + "rimraf": "^6.0.1", "stream": "^0.0.2", "stream-browserify": "^2.0.2", "style-loader": "^4.0.0", diff --git a/packages/lexical/ui-tests/package.json b/packages/lexical/ui-tests/package.json index 5476d28a..a89936bb 100644 --- a/packages/lexical/ui-tests/package.json +++ b/packages/lexical/ui-tests/package.json @@ -9,6 +9,6 @@ "clean": "rimraf node_modules lib dist build tsconfig.tsbuildinfo" }, "devDependencies": { - "@jupyterlab/galata": "5.0.3" + "@jupyterlab/galata": "^5.0.3" } } diff --git a/packages/react/Makefile b/packages/react/Makefile index 71c86cd9..ce818750 100755 --- a/packages/react/Makefile +++ b/packages/react/Makefile @@ -29,7 +29,7 @@ build: ## build ($(CONDA_ACTIVATE) ${ENV_NAME}; \ npm run build ) -publish-npm: clean build ## publish +publish-npm: clean build ## publish-npm ($(CONDA_ACTIVATE) ${ENV_NAME}; \ npm publish ) echo open https://www.npmjs.com/package/@datalayer/jupyter-react diff --git a/packages/react/package.json b/packages/react/package.json index 5cc4f14c..e5d3b7dd 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@datalayer/jupyter-react", - "version": "0.21.0", + "version": "0.21.2", "description": "Jupyter React - React.js components 100% compatible with Jupyter.", "license": "MIT", "main": "lib/index.js", @@ -74,7 +74,7 @@ "@jupyter-widgets/jupyterlab-manager": "^5.0.0", "@jupyter-widgets/output": "^6.0.0", "@jupyter/web-components": "^0.15.3", - "@jupyter/ydoc": "3.0.2", + "@jupyter/ydoc": "^3.0.3", "@jupyterlab/application": "^4.0.0", "@jupyterlab/application-extension": "^4.0.0", "@jupyterlab/apputils": "^4.0.0", @@ -121,6 +121,7 @@ "@jupyterlab/services": "^7.0.0", "@jupyterlab/settingregistry": "^4.0.0", "@jupyterlab/shortcuts-extension": "^4.0.0", + "@jupyterlab/statedb": "^4.0.0", "@jupyterlab/statusbar-extension": "^4.0.0", "@jupyterlab/terminal": "^4.0.0", "@jupyterlab/theme-dark-extension": "^4.0.0", @@ -128,10 +129,15 @@ "@jupyterlab/toc-extension": "^6.0.0", "@jupyterlab/translation-extension": "^4.0.0", "@jupyterlab/ui-components-extension": "^4.0.0", - "@jupyterlite/pyodide-kernel": "0.4.0", - "@jupyterlite/pyodide-kernel-extension": "0.4.0", - "@jupyterlite/server": "0.4.0", - "@jupyterlite/server-extension": "0.4.0", + "@jupyterlite/licenses": "^0.5.1", + "@jupyterlite/localforage": "^0.5.1", + "@jupyterlite/pyodide-kernel": "^0.5.0", + "@jupyterlite/pyodide-kernel-extension": "^0.5.0", + "@jupyterlite/server": "^0.5.0", + "@jupyterlite/server-extension": "^0.5.0", + "@jupyterlite/session": "^0.5.1", + "@jupyterlite/settings": "^0.5.1", + "@jupyterlite/translation": "^0.5.1", "@lumino/default-theme": "^2.0.0", "@primer/react": "^36.27.0", "assert": "^2.0.0", @@ -141,8 +147,8 @@ "lodash": "^4.17.4", "marked": "^4.0.10", "plotly.js": "^2.35.2", - "react": "^18.2.0", - "react-dom": "^18.2.0", + "react": "18.2.0", + "react-dom": "18.2.0", "react-error-boundary": "^3.1.3", "react-inspector": "^6.0.2", "react-sparklines": "^1.7.0", @@ -171,45 +177,45 @@ "@jupyterlab/testutils": "^4.0.0", "@jupyterlab/vega3-extension": "^3.3.0", "@jupyterlite/javascript-kernel-extension": "^0.3.0", - "@mermaid-js/mermaid-zenuml": "0.2.0", + "@mermaid-js/mermaid-zenuml": "^0.2.0", "@playwright/test": "^1.40.1", - "@primer/octicons-react": "^19.8.0", + "@primer/octicons-react": "^19.15.1", "@types/codemirror": "^5.60.4", "@types/jest": "^29.4.0", "@types/marked": "^4.0.1", "@types/node": "^18.15.3", "@types/plotly.js": "^2.12.31", - "@types/react": "^18.2.12", - "@types/react-dom": "^18.2.5", + "@types/react": "18.2.12", + "@types/react-dom": "18.3.0", "@types/react-sparklines": "^1.7.5", "@types/semver": "^7.5.6", "@types/styled-components": "^5.1.26", "@types/uuid": "^8.3.0", "@types/webpack-env": "^1.18.2", - "@typescript-eslint/eslint-plugin": "^6.1.0", - "@typescript-eslint/parser": "^6.1.0", + "@typescript-eslint/eslint-plugin": "^8.29.1", + "@typescript-eslint/parser": "^8.29.1", "babel-loader": "^9.1.2", "bundle-loader": "^0.5.6", "cross-env": "^7.0.3", "css-loader": "^6.9.1", - "eslint": "^8.36.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-prettier": "^5.0.0", + "eslint": "^9.0.0", + "eslint-config-prettier": "^10.1.2", + "eslint-plugin-prettier": "^5.2.6", "gulp": "^4.0.2", "gulp-append-prepend": "^1.0.8", "gulp-filter": "^6.0.0", "gulp-watch": "^5.0.1", "html-webpack-plugin": "^5.3.1", - "html-webpack-tags-plugin": "^2.0.17", + "html-webpack-tags-plugin": "^3.0.2", "jest": "^29.4.3", "jupyterlab-plotly": "^5.17.0", "mdx-mermaid": "^2.0.0", "mermaid": "^10.9.0", "mkdirp": "^1.0.3", "npm-run-all": "^4.1.5", - "prettier": "3.3.2", + "prettier": "^3.3.2", "process": "^0.11.10", - "rimraf": "^3.0.2", + "rimraf": "^6.0.1", "source-map-loader": "^5.0.0", "stream": "^0.0.2", "stream-browserify": "^2.0.2", @@ -220,7 +226,7 @@ "stylelint-csstree-validator": "^3.0.0", "stylelint-prettier": "^4.0.0", "svg-url-loader": "^7.1.1", - "ts-jest": "29.0.5", + "ts-jest": "^29.0.5", "ts-loader": "^9.4.3", "typedoc": "^0.25.7", "typescript": "^5.0.3", diff --git a/packages/react/src/components/cell/CellAdapter.ts b/packages/react/src/components/cell/CellAdapter.ts index 3ddeb9d0..4d9cbf86 100755 --- a/packages/react/src/components/cell/CellAdapter.ts +++ b/packages/react/src/components/cell/CellAdapter.ts @@ -8,42 +8,15 @@ import { BoxPanel, Widget } from '@lumino/widgets'; import { find } from '@lumino/algorithm'; import { CommandRegistry } from '@lumino/commands'; import { JSONObject } from '@lumino/coreutils'; -import { - SessionContext, - ISessionContext, - Toolbar, - ToolbarButton, -} from '@jupyterlab/apputils'; +import { SessionContext, ISessionContext, Toolbar, ToolbarButton } from '@jupyterlab/apputils'; import { CodeCellModel, CodeCell, Cell, MarkdownCell, RawCell, MarkdownCellModel } from '@jupyterlab/cells'; import { IOutput } from '@jupyterlab/nbformat'; import { Kernel as JupyterKernel, KernelMessage } from '@jupyterlab/services'; -import { - ybinding, - CodeMirrorMimeTypeService, - EditorLanguageRegistry, - CodeMirrorEditorFactory, - EditorExtensionRegistry, - EditorThemeRegistry, -} from '@jupyterlab/codemirror'; +import { ybinding, CodeMirrorMimeTypeService, EditorLanguageRegistry, CodeMirrorEditorFactory, EditorExtensionRegistry, EditorThemeRegistry } from '@jupyterlab/codemirror'; import { MathJaxTypesetter } from '@jupyterlab/mathjax-extension'; -import { - Completer, - CompleterModel, - CompletionHandler, - ProviderReconciliator, - KernelCompleterProvider, -} from '@jupyterlab/completer'; -import { - RenderMimeRegistry, - standardRendererFactories as initialFactories, -} from '@jupyterlab/rendermime'; -import { - Session, - ServerConnection, - SessionManager, - KernelManager, - KernelSpecManager, -} from '@jupyterlab/services'; +import { Completer, CompleterModel, CompletionHandler, ProviderReconciliator, KernelCompleterProvider } from '@jupyterlab/completer'; +import { RenderMimeRegistry, standardRendererFactories as initialFactories } from '@jupyterlab/rendermime'; +import { Session, ServerConnection, SessionManager, KernelManager, KernelSpecManager } from '@jupyterlab/services'; import { runIcon } from '@jupyterlab/ui-components'; import { createStandaloneCell, YCodeCell, IYText, YMarkdownCell } from '@jupyter/ydoc'; import { execute as executeOutput } from './../output/OutputExecutor'; diff --git a/packages/react/src/components/notebook/Notebook.tsx b/packages/react/src/components/notebook/Notebook.tsx index 6319e008..665404e7 100644 --- a/packages/react/src/components/notebook/Notebook.tsx +++ b/packages/react/src/components/notebook/Notebook.tsx @@ -321,16 +321,13 @@ export const Notebook = (props: INotebookProps) => { awareness, }); } else if (collaborative == 'datalayer') { - const { runUrl, token } = - jupyterReactStore.getState().datalayerConfig ?? {}; + const { runUrl, token } = jupyterReactStore.getState().datalayerConfig ?? {}; const roomName = id; const roomURL = URLExt.join(runUrl!, `/api/spacer/v1/rooms`); - const sessionId = await fetchSessionId({ url: URLExt.join(roomURL, roomName), token, }); - provider = new YWebsocketProvider( roomURL.replace(/^http/, 'ws'), roomName, diff --git a/packages/react/src/examples/NotebookCollaborative.tsx b/packages/react/src/examples/NotebookCollaborative.tsx index 2e770f7c..595612b6 100644 --- a/packages/react/src/examples/NotebookCollaborative.tsx +++ b/packages/react/src/examples/NotebookCollaborative.tsx @@ -20,7 +20,7 @@ const NotebookCollaborative = () => { return ( Date: Sat, 12 Apr 2025 20:02:46 +0200 Subject: [PATCH 07/19] deps --- attic/esbuild/package.json | 4 ++-- attic/prosemirror/package.json | 2 +- attic/slate/package.json | 2 +- examples/cra/package.json | 2 +- examples/docusaurus/package.json | 2 +- examples/lexical/package.json | 4 ++-- examples/next-js/package.json | 2 +- package.json | 4 ++-- packages/lexical/package.json | 6 +++--- packages/react/package.json | 4 ++-- packages/vscode/package.json | 4 ++-- storybook/package.json | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/attic/esbuild/package.json b/attic/esbuild/package.json index 3d1b423b..e6847d90 100644 --- a/attic/esbuild/package.json +++ b/attic/esbuild/package.json @@ -38,7 +38,7 @@ "monaco-jsx-highlighter": "^0.0.15", "notistack": "^2.0.5", "os-browserify": "^0.3.0", - "prettier": "^2.3.1", + "prettier": "^3.5.3", "react": "18.2.0", "react-dom": "18.2.0", "react-hook-form": "^5.7.2", @@ -63,7 +63,7 @@ "@types/jest": "^29.4.0", "@types/jscodeshift": "^0.7.2", "@types/jwt-decode": "^2.2.1", - "@types/node": "^18.15.3", + "@types/node": "^22.14.1", "@types/prettier": "^2.2.3", "@types/react": "18.2.12", "@types/react-dom": "18.3.0", diff --git a/attic/prosemirror/package.json b/attic/prosemirror/package.json index 7a3bfaf0..a079709c 100644 --- a/attic/prosemirror/package.json +++ b/attic/prosemirror/package.json @@ -52,7 +52,7 @@ "@babel/preset-typescript": "^7.21.0", "@svgr/webpack": "^5.5.0", "@types/codemirror": "^5.60.4", - "@types/node": "^18.15.3", + "@types/node": "^22.14.1", "@types/plotly.js": "^1.54.11", "@types/uuid": "^8.3.0", "assert": "^2.0.0", diff --git a/attic/slate/package.json b/attic/slate/package.json index 6648fbdb..73971e3a 100644 --- a/attic/slate/package.json +++ b/attic/slate/package.json @@ -61,7 +61,7 @@ "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.21.0", "@types/deep-equal": "^1.0.1", - "@types/node": "^18.15.3", + "@types/node": "^22.14.1", "@types/plotly.js": "^1.54.11", "@types/react": "18.2.12", "@types/react-dom": "18.3.0", diff --git a/examples/cra/package.json b/examples/cra/package.json index 5916ab93..6c1ba17c 100644 --- a/examples/cra/package.json +++ b/examples/cra/package.json @@ -26,7 +26,7 @@ "@testing-library/react": "^13.3.0", "@testing-library/user-event": "^13.5.0", "@types/jest": "^29.4.0", - "@types/node": "^18.15.3", + "@types/node": "^22.14.1", "@types/react": "18.0.27", "@types/react-dom": "18.0.10", "npm-run-all": "^4.1.5", diff --git a/examples/docusaurus/package.json b/examples/docusaurus/package.json index 0c07a062..f467bacb 100644 --- a/examples/docusaurus/package.json +++ b/examples/docusaurus/package.json @@ -34,7 +34,7 @@ "react-router-dom": "^6.22.3" }, "devDependencies": { - "@types/node": "^18.15.3", + "@types/node": "^22.14.1", "assert": "^2.0.0", "buffer": "^6.0.3", "bufferutil": "^4.0.8", diff --git a/examples/lexical/package.json b/examples/lexical/package.json index 85aed850..4038ed42 100644 --- a/examples/lexical/package.json +++ b/examples/lexical/package.json @@ -28,7 +28,7 @@ "kill": "./../../dev/sh/kill.sh || true" }, "dependencies": { - "@datalayer/jupyter-lexical": "^0.2.0", + "@datalayer/jupyter-lexical": "^0.2.2", "@datalayer/primer-addons": "^0.3.2", "react": "18.2.0", "react-dom": "18.2.0", @@ -40,7 +40,7 @@ "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.21.0", "@babel/runtime": "^7.13.8", - "@types/node": "^18.15.3", + "@types/node": "^22.14.1", "@types/react": "18.2.12", "@types/react-dom": "18.3.0", "@types/uuid": "^8.3.0", diff --git a/examples/next-js/package.json b/examples/next-js/package.json index 1e1a3836..0799dc0b 100644 --- a/examples/next-js/package.json +++ b/examples/next-js/package.json @@ -25,7 +25,7 @@ "tailwindcss": "^3.3.2" }, "devDependencies": { - "@types/node": "^18.15.3", + "@types/node": "^22.14.1", "@types/react": "18.2.12", "@types/react-dom": "18.3.0", "raw-loader": "^4.0.2", diff --git a/package.json b/package.json index 1d8257dc..b45ec59d 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "devDependencies": { "babel-eslint": "^10.0.1", "concurrently": "^6.2.0", - "eslint": "^5.16.0", + "eslint": "^9.0.0", "eslint-config-prettier": "^10.1.2", "eslint-config-xo": "^0.26.0", "eslint-config-xo-react": "^0.19.0", @@ -69,7 +69,7 @@ "jest-prop-type-error": "^1.1.0", "lerna": "^8.1.2", "patch-package": "^8.0.0", - "prettier": "^2.3.1", + "prettier": "^3.5.3", "rimraf": "^6.0.1", "vercel": "^21.3.3" }, diff --git a/packages/lexical/package.json b/packages/lexical/package.json index 6479a94e..7e74c552 100644 --- a/packages/lexical/package.json +++ b/packages/lexical/package.json @@ -1,6 +1,6 @@ { "name": "@datalayer/jupyter-lexical", - "version": "0.2.1", + "version": "0.2.2", "description": "Jupyter UI for Lexical", "license": "MIT", "main": "lib/index.js", @@ -97,7 +97,7 @@ "@types/katex": "^0.14.0", "@types/lodash-es": "^4.17.6", "@types/marked": "^4.0.1", - "@types/node": "^18.15.3", + "@types/node": "^22.14.1", "@types/plotly.js": "^1.54.11", "@types/prettier": "^3.0.0", "@types/prismjs": "^1.26.0", @@ -123,7 +123,7 @@ "jest": "^29.4.3", "mkdirp": "^1.0.3", "npm-run-all": "^4.1.5", - "prettier": "^3.3.2", + "prettier": "^3.5.3", "process": "^0.11.10", "raw-loader": "^4.0.2", "rimraf": "^6.0.1", diff --git a/packages/react/package.json b/packages/react/package.json index e5d3b7dd..233788b2 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -183,7 +183,7 @@ "@types/codemirror": "^5.60.4", "@types/jest": "^29.4.0", "@types/marked": "^4.0.1", - "@types/node": "^18.15.3", + "@types/node": "^22.14.1", "@types/plotly.js": "^2.12.31", "@types/react": "18.2.12", "@types/react-dom": "18.3.0", @@ -213,7 +213,7 @@ "mermaid": "^10.9.0", "mkdirp": "^1.0.3", "npm-run-all": "^4.1.5", - "prettier": "^3.3.2", + "prettier": "^3.5.3", "process": "^0.11.10", "rimraf": "^6.0.1", "source-map-loader": "^5.0.0", diff --git a/packages/vscode/package.json b/packages/vscode/package.json index c58a870b..90be363b 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -66,7 +66,7 @@ }, "devDependencies": { "@types/mocha": "^10.0.10", - "@types/node": "^20.x", + "@types/node": "^22.14.1", "@types/react": "18.2.12", "@types/react-dom": "18.3.0", "@types/vscode": "^1.98.0", @@ -76,7 +76,7 @@ "@vscode/test-electron": "^2.4.1", "@vscode/vsce": "^3.3.2", "css-loader": "^5.1.3", - "eslint": "^9.21.0", + "eslint": "^9.0.0", "mini-svg-data-uri": "^1.4.4", "process": "^0.11.10", "style-loader": "^2.0.0", diff --git a/storybook/package.json b/storybook/package.json index e7a5667a..59ac5c4c 100644 --- a/storybook/package.json +++ b/storybook/package.json @@ -26,7 +26,7 @@ "build:storybook": "storybook build" }, "dependencies": { - "@datalayer/jupyter-lexical": "^0.2.0", + "@datalayer/jupyter-lexical": "^0.2.2", "@datalayer/jupyter-react": "^0.21.2", "react": "18.2.0", "react-dom": "18.2.0" From 82f4136141f3012f01dbbead1207675f81db7e4b Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Sun, 13 Apr 2025 07:39:48 +0200 Subject: [PATCH 08/19] deps --- packages/react/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/package.json b/packages/react/package.json index 233788b2..2b14a8a3 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -73,7 +73,7 @@ "@jupyter-widgets/html-manager": "^1.0.0", "@jupyter-widgets/jupyterlab-manager": "^5.0.0", "@jupyter-widgets/output": "^6.0.0", - "@jupyter/web-components": "^0.15.3", + "@jupyter/web-components": "^0.17.1", "@jupyter/ydoc": "^3.0.3", "@jupyterlab/application": "^4.0.0", "@jupyterlab/application-extension": "^4.0.0", From 10ecc8b1bca76aeb381b9bed82d04978a6cd8669 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Sun, 13 Apr 2025 15:25:06 +0200 Subject: [PATCH 09/19] deps --- attic/esbuild/package.json | 4 ++-- attic/prosemirror/package.json | 6 +++--- attic/slate/package.json | 8 ++++---- docs/package.json | 4 ++-- examples/cra/package.json | 8 ++++---- examples/docusaurus/package.json | 2 +- examples/lexical/package.json | 8 ++++---- examples/next-js/package.json | 8 ++++---- package.json | 1 - packages/docusaurus-plugin/package.json | 6 +++--- .../docusaurus-plugin/src/theme/JupyterCell.tsx | 13 +++---------- .../src/theme/ReactLiveScope/index.tsx | 6 ++---- packages/docusaurus-plugin/tsconfig.json | 4 ++-- packages/lexical/package.json | 10 +++++----- packages/react/package.json | 8 ++++---- packages/vscode/package.json | 4 ++-- storybook/package.json | 4 ++-- 17 files changed, 47 insertions(+), 57 deletions(-) diff --git a/attic/esbuild/package.json b/attic/esbuild/package.json index e6847d90..273c4e03 100644 --- a/attic/esbuild/package.json +++ b/attic/esbuild/package.json @@ -63,7 +63,7 @@ "@types/jest": "^29.4.0", "@types/jscodeshift": "^0.7.2", "@types/jwt-decode": "^2.2.1", - "@types/node": "^22.14.1", + "@types/node": "18.15.3", "@types/prettier": "^2.2.3", "@types/react": "18.2.12", "@types/react-dom": "18.3.0", @@ -78,7 +78,7 @@ "rimraf": "^6.0.1", "style-loader": "^2.0.0", "svg-url-loader": "^7.1.1", - "typescript": "^5.0.3", + "typescript": "5.0.3", "url-loader": "^4.0.0", "webpack": "^5.94.0", "webpack-cli": "^4.10.0", diff --git a/attic/prosemirror/package.json b/attic/prosemirror/package.json index a079709c..2a2b2325 100644 --- a/attic/prosemirror/package.json +++ b/attic/prosemirror/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@codemirror/lang-python": "^6.0.1", - "@datalayer/jupyter-react": "^0.21.2", + "@datalayer/jupyter-react": "^1.0.0", "@prosemirror-adapter/react": "^0.2.4", "@types/orderedmap": "^1.0.0", "codemirror": "^6.0.1", @@ -52,7 +52,7 @@ "@babel/preset-typescript": "^7.21.0", "@svgr/webpack": "^5.5.0", "@types/codemirror": "^5.60.4", - "@types/node": "^22.14.1", + "@types/node": "18.15.3", "@types/plotly.js": "^1.54.11", "@types/uuid": "^8.3.0", "assert": "^2.0.0", @@ -72,7 +72,7 @@ "style-loader": "^2.0.0", "svg-url-loader": "^7.1.1", "typedoc": "^0.25.7", - "typescript": "^5.0.3", + "typescript": "5.0.3", "url-loader": "^3.0.0", "watch": "^1.0.2", "webpack": "^5.94.0", diff --git a/attic/slate/package.json b/attic/slate/package.json index 73971e3a..44dba3a6 100644 --- a/attic/slate/package.json +++ b/attic/slate/package.json @@ -24,8 +24,8 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^0.21.2", - "@datalayer/primer-addons": "^0.3.2", + "@datalayer/jupyter-react": "^1.0.0", + "@datalayer/primer-addons": "^1.0.0", "@emotion/css": "^11.1.3", "@emotion/react": "^11.10.6", "@emotion/styled": "^11.10.6", @@ -61,7 +61,7 @@ "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.21.0", "@types/deep-equal": "^1.0.1", - "@types/node": "^22.14.1", + "@types/node": "18.15.3", "@types/plotly.js": "^1.54.11", "@types/react": "18.2.12", "@types/react-dom": "18.3.0", @@ -86,7 +86,7 @@ "style-loader": "^2.0.0", "svg-url-loader": "^7.1.1", "typedoc": "^0.25.7", - "typescript": "^5.0.3", + "typescript": "5.0.3", "url-loader": "^3.0.0", "watch": "^1.0.2", "webpack": "^5.74.0", diff --git a/docs/package.json b/docs/package.json index 40de332e..42e29d3f 100644 --- a/docs/package.json +++ b/docs/package.json @@ -21,7 +21,7 @@ "@docusaurus/theme-live-codeblock": "^3.5.2", "@docusaurus/theme-mermaid": "^3.5.2", "@mdx-js/react": "^3.0.1", - "@primer/react-brand": "^0.44.1", + "@primer/react-brand": "^0.51.0", "clsx": "^2.1.1", "docusaurus-lunr-search": "^3.5.0", "docusaurus-plugin-typedoc": "^0.17.5", @@ -35,7 +35,7 @@ "@docusaurus/module-type-aliases": "^3.5.0", "@tsconfig/docusaurus": "^2.0.3", "cross-env": "^7.0.3", - "typescript": "^5.0.3" + "typescript": "5.0.3" }, "browserslist": { "production": [ diff --git a/examples/cra/package.json b/examples/cra/package.json index 6c1ba17c..9bbb76bd 100644 --- a/examples/cra/package.json +++ b/examples/cra/package.json @@ -13,8 +13,8 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^0.21.2", - "@datalayer/primer-addons": "^0.3.2", + "@datalayer/jupyter-react": "^1.0.0", + "@datalayer/primer-addons": "^1.0.0", "jupyterlab-plotly": "^5.17.0", "plotly.js": "^2.26.2", "react": "18.2.0", @@ -26,13 +26,13 @@ "@testing-library/react": "^13.3.0", "@testing-library/user-event": "^13.5.0", "@types/jest": "^29.4.0", - "@types/node": "^22.14.1", + "@types/node": "18.15.3", "@types/react": "18.0.27", "@types/react-dom": "18.0.10", "npm-run-all": "^4.1.5", "raw-loader": "^4.0.2", "react-scripts": "^5.0.1", - "typescript": "^4" + "typescript": "5.0.3" }, "eslintConfig": { "extends": [ diff --git a/examples/docusaurus/package.json b/examples/docusaurus/package.json index f467bacb..cd9fc4cc 100644 --- a/examples/docusaurus/package.json +++ b/examples/docusaurus/package.json @@ -34,7 +34,7 @@ "react-router-dom": "^6.22.3" }, "devDependencies": { - "@types/node": "^22.14.1", + "@types/node": "18.15.3", "assert": "^2.0.0", "buffer": "^6.0.3", "bufferutil": "^4.0.8", diff --git a/examples/lexical/package.json b/examples/lexical/package.json index 4038ed42..f5077150 100644 --- a/examples/lexical/package.json +++ b/examples/lexical/package.json @@ -28,8 +28,8 @@ "kill": "./../../dev/sh/kill.sh || true" }, "dependencies": { - "@datalayer/jupyter-lexical": "^0.2.2", - "@datalayer/primer-addons": "^0.3.2", + "@datalayer/jupyter-lexical": "^1.0.0", + "@datalayer/primer-addons": "^1.0.0", "react": "18.2.0", "react-dom": "18.2.0", "react-json-tree": "^0.17.0" @@ -40,7 +40,7 @@ "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.21.0", "@babel/runtime": "^7.13.8", - "@types/node": "^22.14.1", + "@types/node": "18.15.3", "@types/react": "18.2.12", "@types/react-dom": "18.3.0", "@types/uuid": "^8.3.0", @@ -60,7 +60,7 @@ "style-loader": "^2.0.0", "svg-url-loader": "^7.1.1", "typedoc": "^0.25.7", - "typescript": "^5.0.3", + "typescript": "5.0.3", "url-loader": "^3.0.0", "vite": "^5.2.7", "watch": "^1.0.2", diff --git a/examples/next-js/package.json b/examples/next-js/package.json index 0799dc0b..a6d00f7a 100644 --- a/examples/next-js/package.json +++ b/examples/next-js/package.json @@ -11,8 +11,8 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^0.21.2", - "@datalayer/primer-addons": "^0.3.2", + "@datalayer/jupyter-react": "^1.0.0", + "@datalayer/primer-addons": "^1.0.0", "autoprefixer": "^10.4.14", "eslint": "^9.0.0", "eslint-config-next": "^15.3.0", @@ -25,10 +25,10 @@ "tailwindcss": "^3.3.2" }, "devDependencies": { - "@types/node": "^22.14.1", + "@types/node": "18.15.3", "@types/react": "18.2.12", "@types/react-dom": "18.3.0", "raw-loader": "^4.0.2", - "typescript": "^5.0.3" + "typescript": "5.0.3" } } diff --git a/package.json b/package.json index b45ec59d..1da0d965 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,6 @@ }, "overrides": { "@jupyterlab/services": "^7.0.0", - "@primer/react": "^36.27.0", "@types/react": "18.2.12", "@types/react-dom": "18.3.0", "react": "18.2.0", diff --git a/packages/docusaurus-plugin/package.json b/packages/docusaurus-plugin/package.json index fe776a44..1af0a4f7 100644 --- a/packages/docusaurus-plugin/package.json +++ b/packages/docusaurus-plugin/package.json @@ -23,8 +23,8 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^0.21.2", - "@datalayer/primer-addons": "^0.3.2", + "@datalayer/jupyter-react": "^1.0.0", + "@datalayer/primer-addons": "^1.0.0", "@docusaurus/core": "^3.5.2", "@docusaurus/types": "^3.5.2" }, @@ -46,7 +46,7 @@ "svg-url-loader": "^7.1.1", "ts-loader": "^8.0.3", "tslib": "^2.1.0", - "typescript": "^5.0.3", + "typescript": "5.0.3", "url-loader": "^3.0.0", "webpack": "^5.74.0" }, diff --git a/packages/docusaurus-plugin/src/theme/JupyterCell.tsx b/packages/docusaurus-plugin/src/theme/JupyterCell.tsx index 152a64d3..54f799f3 100644 --- a/packages/docusaurus-plugin/src/theme/JupyterCell.tsx +++ b/packages/docusaurus-plugin/src/theme/JupyterCell.tsx @@ -16,26 +16,22 @@ type JupyterCellProps = { const JupyterCell = (props: JupyterCellProps) => { return ( + // @ts-ignore Jupyter Cell fallback content for prerendering.}> {() => { - // Keep the import via require and keep it into the BrowserOnly code block.. // const { JupyterReactTheme } = require('@datalayer/jupyter-react/lib/theme'); // const { useJupyter } = require('@datalayer/jupyter-react/lib/jupyter/JupyterContext'); const { Jupyter } = require('@datalayer/jupyter-react/lib/jupyter/Jupyter'); const { Cell } = require('@datalayer/jupyter-react/lib/components/cell/Cell'); - const { jupyterServerUrl = 'https://oss.datalayer.run/api/jupyter-server', jupyterServerToken = '60c1661cc408f978c309d04157af55c9588ff9557c9380e4fb50785750703da6', source = '', } = props; /* - useJupyter({ - jupyterServerUrl, - jupyterServerToken, - }); + useJupyter({ jupyterServerUrl, jupyterServerToken }); */ return ( <> @@ -45,13 +41,10 @@ const JupyterCell = (props: JupyterCellProps) => { startDefaultKernel skeleton={} > - + ) - }} ) diff --git a/packages/docusaurus-plugin/src/theme/ReactLiveScope/index.tsx b/packages/docusaurus-plugin/src/theme/ReactLiveScope/index.tsx index eb168619..ebfde5b6 100644 --- a/packages/docusaurus-plugin/src/theme/ReactLiveScope/index.tsx +++ b/packages/docusaurus-plugin/src/theme/ReactLiveScope/index.tsx @@ -10,14 +10,13 @@ import { ContentLoader } from '@datalayer/primer-addons'; const Cell = (props: any) => { return ( + // @ts-ignore Jupyter Cell fallback content for prerendering.}> {() => { - // Keep the import via require in the BrowserOnly code block. const { Jupyter } = require('@datalayer/jupyter-react/lib/jupyter/Jupyter'); const { Cell } = require('@datalayer/jupyter-react/lib/components/cell/Cell'); - return ( <> { - ) - + ); }} ) diff --git a/packages/docusaurus-plugin/tsconfig.json b/packages/docusaurus-plugin/tsconfig.json index d6789324..11a2cac2 100644 --- a/packages/docusaurus-plugin/tsconfig.json +++ b/packages/docusaurus-plugin/tsconfig.json @@ -4,8 +4,8 @@ "incremental": true, "rootDir": "src", "outDir": "lib", - "target": "ES2022", - "module": "commonjs", + "target": "ESNext", + "module": "ESNext", "lib": [ "ESNext", "DOM" diff --git a/packages/lexical/package.json b/packages/lexical/package.json index 7e74c552..1e3686fe 100644 --- a/packages/lexical/package.json +++ b/packages/lexical/package.json @@ -1,6 +1,6 @@ { "name": "@datalayer/jupyter-lexical", - "version": "0.2.2", + "version": "1.0.0", "description": "Jupyter UI for Lexical", "license": "MIT", "main": "lib/index.js", @@ -63,8 +63,8 @@ }, "dependencies": { "@datalayer/icons-react": "^0.3.7", - "@datalayer/jupyter-react": "^0.21.2", - "@datalayer/primer-addons": "^0.3.2", + "@datalayer/jupyter-react": "^1.0.0", + "@datalayer/primer-addons": "^1.0.0", "@jupyterlab/application": "^4.0.0", "@jupyterlab/coreutils": "^6.0.0", "@jupyterlab/services": "^7.0.0", @@ -97,7 +97,7 @@ "@types/katex": "^0.14.0", "@types/lodash-es": "^4.17.6", "@types/marked": "^4.0.1", - "@types/node": "^22.14.1", + "@types/node": "18.15.3", "@types/plotly.js": "^1.54.11", "@types/prettier": "^3.0.0", "@types/prismjs": "^1.26.0", @@ -137,7 +137,7 @@ "stylelint-prettier": "^2.0.0", "svg-url-loader": "^7.1.1", "typedoc": "^0.25.7", - "typescript": "^5.0.3", + "typescript": "5.0.3", "url-loader": "^3.0.0", "watch": "^1.0.2", "webpack": "^5.74.0", diff --git a/packages/react/package.json b/packages/react/package.json index 2b14a8a3..e152507a 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@datalayer/jupyter-react", - "version": "0.21.2", + "version": "1.0.0", "description": "Jupyter React - React.js components 100% compatible with Jupyter.", "license": "MIT", "main": "lib/index.js", @@ -67,7 +67,7 @@ "@codemirror/lang-python": "^6.0.1", "@codemirror/state": "^6.2.0", "@codemirror/view": "^6.7.0", - "@datalayer/primer-addons": "^0.3.2", + "@datalayer/primer-addons": "^1.0.0", "@jupyter-widgets/base": "^6.0.0", "@jupyter-widgets/controls": "^5.0.0", "@jupyter-widgets/html-manager": "^1.0.0", @@ -183,7 +183,7 @@ "@types/codemirror": "^5.60.4", "@types/jest": "^29.4.0", "@types/marked": "^4.0.1", - "@types/node": "^22.14.1", + "@types/node": "18.15.3", "@types/plotly.js": "^2.12.31", "@types/react": "18.2.12", "@types/react-dom": "18.3.0", @@ -229,7 +229,7 @@ "ts-jest": "^29.0.5", "ts-loader": "^9.4.3", "typedoc": "^0.25.7", - "typescript": "^5.0.3", + "typescript": "5.0.3", "url-loader": "^3.0.0", "watch": "^1.0.2", "webpack": "^5.74.0", diff --git a/packages/vscode/package.json b/packages/vscode/package.json index 90be363b..e677f982 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -66,7 +66,7 @@ }, "devDependencies": { "@types/mocha": "^10.0.10", - "@types/node": "^22.14.1", + "@types/node": "18.15.3", "@types/react": "18.2.12", "@types/react-dom": "18.3.0", "@types/vscode": "^1.98.0", @@ -82,7 +82,7 @@ "style-loader": "^2.0.0", "svg-inline-loader": "^0.8.2", "ts-loader": "^9.5.2", - "typescript": "^5.0.3", + "typescript": "5.0.3", "webpack": "^5.98.0", "webpack-cli": "^6.0.1" } diff --git a/storybook/package.json b/storybook/package.json index 59ac5c4c..1b53180f 100644 --- a/storybook/package.json +++ b/storybook/package.json @@ -26,8 +26,8 @@ "build:storybook": "storybook build" }, "dependencies": { - "@datalayer/jupyter-lexical": "^0.2.2", - "@datalayer/jupyter-react": "^0.21.2", + "@datalayer/jupyter-lexical": "^1.0.0", + "@datalayer/jupyter-react": "^1.0.0", "react": "18.2.0", "react-dom": "18.2.0" }, From 974370eb8b377ccba08a576220215279013b5148 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Sun, 13 Apr 2025 17:26:44 +0200 Subject: [PATCH 10/19] deps --- attic/esbuild/package.json | 12 ++++++------ attic/prosemirror/package.json | 6 +++--- attic/slate/package.json | 14 +++++++------- docs/package.json | 10 +++++----- examples/cra/package.json | 8 ++++---- examples/docusaurus/package.json | 6 +++--- examples/lexical/package.json | 16 ++++++++-------- examples/next-js/package.json | 12 ++++++------ package.json | 18 +++++++++--------- packages/docusaurus-plugin/package.json | 8 ++++---- packages/lexical/package.json | 14 +++++++------- packages/react/package.json | 16 ++++++++-------- packages/react/src/app/tabs/AboutTab.tsx | 6 +++--- .../react/src/components/button/Button.tsx | 2 +- .../src/components/kernel/Kernelndicator.tsx | 4 ++-- .../react/src/components/kernel/Kernels.tsx | 8 ++------ .../src/components/textinput/TextInput.tsx | 2 +- .../react/src/examples/JupyterLabTheme.tsx | 9 +++------ packages/react/src/examples/Kernels.tsx | 4 ++-- packages/react/src/examples/NotebookTheme.tsx | 3 +-- .../src/examples/NotebookThemeColormode.tsx | 5 +---- packages/react/src/jupyter/Jupyter.tsx | 3 +-- packages/react/tsconfig.json | 2 +- packages/react/webpack.config.js | 4 ++-- packages/vscode/package.json | 14 +++++++------- storybook/package.json | 8 ++++---- 26 files changed, 101 insertions(+), 113 deletions(-) diff --git a/attic/esbuild/package.json b/attic/esbuild/package.json index 273c4e03..1b90e9ed 100644 --- a/attic/esbuild/package.json +++ b/attic/esbuild/package.json @@ -39,8 +39,8 @@ "notistack": "^2.0.5", "os-browserify": "^0.3.0", "prettier": "^3.5.3", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "react-hook-form": "^5.7.2", "react-redux": "^7.2.2", "react-resizable": "^1.11.0", @@ -63,10 +63,10 @@ "@types/jest": "^29.4.0", "@types/jscodeshift": "^0.7.2", "@types/jwt-decode": "^2.2.1", - "@types/node": "18.15.3", + "@types/node": "^22.14.1", "@types/prettier": "^2.2.3", - "@types/react": "18.2.12", - "@types/react-dom": "18.3.0", + "@types/react": "18.3.20", + "@types/react-dom": "18.3.6", "@types/react-resizable": "^1.7.2", "@types/validator": "^9.4.1", "babel-loader": "^9.1.2", @@ -78,7 +78,7 @@ "rimraf": "^6.0.1", "style-loader": "^2.0.0", "svg-url-loader": "^7.1.1", - "typescript": "5.0.3", + "typescript": "^5.8.3", "url-loader": "^4.0.0", "webpack": "^5.94.0", "webpack-cli": "^4.10.0", diff --git a/attic/prosemirror/package.json b/attic/prosemirror/package.json index 2a2b2325..8c27cb24 100644 --- a/attic/prosemirror/package.json +++ b/attic/prosemirror/package.json @@ -52,7 +52,7 @@ "@babel/preset-typescript": "^7.21.0", "@svgr/webpack": "^5.5.0", "@types/codemirror": "^5.60.4", - "@types/node": "18.15.3", + "@types/node": "^22.14.1", "@types/plotly.js": "^1.54.11", "@types/uuid": "^8.3.0", "assert": "^2.0.0", @@ -71,8 +71,8 @@ "stream-browserify": "^2.0.2", "style-loader": "^2.0.0", "svg-url-loader": "^7.1.1", - "typedoc": "^0.25.7", - "typescript": "5.0.3", + "typedoc": "^0.28.2", + "typescript": "^5.8.3", "url-loader": "^3.0.0", "watch": "^1.0.2", "webpack": "^5.94.0", diff --git a/attic/slate/package.json b/attic/slate/package.json index 44dba3a6..b5467c11 100644 --- a/attic/slate/package.json +++ b/attic/slate/package.json @@ -42,8 +42,8 @@ "is-url": "^1.2.4", "lodash": "^4.17.4", "prismjs": "^1.24.1", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "react-error-boundary": "^3.1.3", "react-redux": "^8.0.2", "redux": "^4.2.1", @@ -61,10 +61,10 @@ "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.21.0", "@types/deep-equal": "^1.0.1", - "@types/node": "18.15.3", + "@types/node": "^22.14.1", "@types/plotly.js": "^1.54.11", - "@types/react": "18.2.12", - "@types/react-dom": "18.3.0", + "@types/react": "18.3.20", + "@types/react-dom": "18.3.6", "@types/uuid": "^8.3.0", "assert": "^2.0.0", "babel-loader": "^9.1.2", @@ -85,8 +85,8 @@ "stream-browserify": "^2.0.2", "style-loader": "^2.0.0", "svg-url-loader": "^7.1.1", - "typedoc": "^0.25.7", - "typescript": "5.0.3", + "typedoc": "^0.28.2", + "typescript": "^5.8.3", "url-loader": "^3.0.0", "watch": "^1.0.2", "webpack": "^5.74.0", diff --git a/docs/package.json b/docs/package.json index 42e29d3f..f29a3bb0 100644 --- a/docs/package.json +++ b/docs/package.json @@ -24,18 +24,18 @@ "@primer/react-brand": "^0.51.0", "clsx": "^2.1.1", "docusaurus-lunr-search": "^3.5.0", - "docusaurus-plugin-typedoc": "^0.17.5", - "react": "18.2.0", + "docusaurus-plugin-typedoc": "^1.3.0", + "react": "18.3.1", "react-calendly": "^4.1.0", - "react-dom": "18.2.0", + "react-dom": "18.3.1", "react-modal-image": "^2.5.0", - "typedoc-plugin-markdown": "^3.13.5" + "typedoc-plugin-markdown": "^4.6.2" }, "devDependencies": { "@docusaurus/module-type-aliases": "^3.5.0", "@tsconfig/docusaurus": "^2.0.3", "cross-env": "^7.0.3", - "typescript": "5.0.3" + "typescript": "^5.8.3" }, "browserslist": { "production": [ diff --git a/examples/cra/package.json b/examples/cra/package.json index 9bbb76bd..5a45506e 100644 --- a/examples/cra/package.json +++ b/examples/cra/package.json @@ -17,8 +17,8 @@ "@datalayer/primer-addons": "^1.0.0", "jupyterlab-plotly": "^5.17.0", "plotly.js": "^2.26.2", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "web-vitals": "^2.1.4" }, "devDependencies": { @@ -26,13 +26,13 @@ "@testing-library/react": "^13.3.0", "@testing-library/user-event": "^13.5.0", "@types/jest": "^29.4.0", - "@types/node": "18.15.3", + "@types/node": "^22.14.1", "@types/react": "18.0.27", "@types/react-dom": "18.0.10", "npm-run-all": "^4.1.5", "raw-loader": "^4.0.2", "react-scripts": "^5.0.1", - "typescript": "5.0.3" + "typescript": "^5.8.3" }, "eslintConfig": { "extends": [ diff --git a/examples/docusaurus/package.json b/examples/docusaurus/package.json index cd9fc4cc..9f13e368 100644 --- a/examples/docusaurus/package.json +++ b/examples/docusaurus/package.json @@ -29,12 +29,12 @@ "@mdx-js/react": "^3.0.1", "clsx": "^2.1.1", "prism-react-renderer": "^1.2.1", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "react-router-dom": "^6.22.3" }, "devDependencies": { - "@types/node": "18.15.3", + "@types/node": "^22.14.1", "assert": "^2.0.0", "buffer": "^6.0.3", "bufferutil": "^4.0.8", diff --git a/examples/lexical/package.json b/examples/lexical/package.json index f5077150..566c3838 100644 --- a/examples/lexical/package.json +++ b/examples/lexical/package.json @@ -30,8 +30,8 @@ "dependencies": { "@datalayer/jupyter-lexical": "^1.0.0", "@datalayer/primer-addons": "^1.0.0", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "react-json-tree": "^0.17.0" }, "devDependencies": { @@ -40,9 +40,9 @@ "@babel/preset-react": "^7.18.6", "@babel/preset-typescript": "^7.21.0", "@babel/runtime": "^7.13.8", - "@types/node": "18.15.3", - "@types/react": "18.2.12", - "@types/react-dom": "18.3.0", + "@types/node": "^22.14.1", + "@types/react": "18.3.20", + "@types/react-dom": "18.3.6", "@types/uuid": "^8.3.0", "babel-loader": "^9.1.2", "bundle-loader": "^0.5.6", @@ -59,10 +59,10 @@ "stream-browserify": "^2.0.2", "style-loader": "^2.0.0", "svg-url-loader": "^7.1.1", - "typedoc": "^0.25.7", - "typescript": "5.0.3", + "typedoc": "^0.28.2", + "typescript": "^5.8.3", "url-loader": "^3.0.0", - "vite": "^5.2.7", + "vite": "^6.2.6", "watch": "^1.0.2", "webpack": "^5.74.0", "webpack-cli": "^4.10.0", diff --git a/examples/next-js/package.json b/examples/next-js/package.json index a6d00f7a..c8eef917 100644 --- a/examples/next-js/package.json +++ b/examples/next-js/package.json @@ -19,16 +19,16 @@ "next": "^14.2.3", "next-themes": "^0.2.1", "postcss": "^8.4.23", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "svg-url-loader": "^7.1.1", "tailwindcss": "^3.3.2" }, "devDependencies": { - "@types/node": "18.15.3", - "@types/react": "18.2.12", - "@types/react-dom": "18.3.0", + "@types/node": "^22.14.1", + "@types/react": "18.3.20", + "@types/react-dom": "18.3.6", "raw-loader": "^4.0.2", - "typescript": "5.0.3" + "typescript": "^5.8.3" } } diff --git a/package.json b/package.json index 1da0d965..d491250b 100644 --- a/package.json +++ b/package.json @@ -75,17 +75,17 @@ }, "resolutions": { "@jupyterlab/services": "^7.0.0", - "@primer/react": "^36.27.0", - "@types/react": "18.2.12", - "@types/react-dom": "18.3.0", - "react": "18.2.0", - "react-dom": "18.2.0" + "@primer/react": "^37.19.0", + "@types/react": "18.3.20", + "@types/react-dom": "18.3.6", + "react": "18.3.1", + "react-dom": "18.3.1" }, "overrides": { "@jupyterlab/services": "^7.0.0", - "@types/react": "18.2.12", - "@types/react-dom": "18.3.0", - "react": "18.2.0", - "react-dom": "18.2.0" + "@types/react": "18.3.20", + "@types/react-dom": "18.3.6", + "react": "18.3.1", + "react-dom": "18.3.1" } } diff --git a/packages/docusaurus-plugin/package.json b/packages/docusaurus-plugin/package.json index 1af0a4f7..9788634d 100644 --- a/packages/docusaurus-plugin/package.json +++ b/packages/docusaurus-plugin/package.json @@ -32,7 +32,7 @@ "@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/preset-env": "^7.19.4", "@babel/preset-react": "^7.18.6", - "@types/react": "18.2.12", + "@types/react": "18.3.20", "assert": "^2.0.0", "babel-loader": "^9.1.2", "css-loader": "^6.9.1", @@ -46,12 +46,12 @@ "svg-url-loader": "^7.1.1", "ts-loader": "^8.0.3", "tslib": "^2.1.0", - "typescript": "5.0.3", + "typescript": "^5.8.3", "url-loader": "^3.0.0", "webpack": "^5.74.0" }, "peerDependencies": { - "react": "18.2.0", - "react-dom": "18.2.0" + "react": "18.3.1", + "react-dom": "18.3.1" } } diff --git a/packages/lexical/package.json b/packages/lexical/package.json index 1e3686fe..079e532b 100644 --- a/packages/lexical/package.json +++ b/packages/lexical/package.json @@ -81,8 +81,8 @@ "katex": "^0.16.21", "lexical": "^0.23.1", "lodash-es": "^4.17.21", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "react-json-tree": "^0.19.0", "styled-components": "^5.3.10" }, @@ -97,12 +97,12 @@ "@types/katex": "^0.14.0", "@types/lodash-es": "^4.17.6", "@types/marked": "^4.0.1", - "@types/node": "18.15.3", + "@types/node": "^22.14.1", "@types/plotly.js": "^1.54.11", "@types/prettier": "^3.0.0", "@types/prismjs": "^1.26.0", - "@types/react": "18.2.12", - "@types/react-dom": "18.3.0", + "@types/react": "18.3.20", + "@types/react-dom": "18.3.6", "@types/styled-components": "^5.1.26", "@types/uuid": "^8.3.0", "@typescript-eslint/eslint-plugin": "^8.29.1", @@ -136,8 +136,8 @@ "stylelint-config-standard": "^24.0.0", "stylelint-prettier": "^2.0.0", "svg-url-loader": "^7.1.1", - "typedoc": "^0.25.7", - "typescript": "5.0.3", + "typedoc": "^0.28.2", + "typescript": "^5.8.3", "url-loader": "^3.0.0", "watch": "^1.0.2", "webpack": "^5.74.0", diff --git a/packages/react/package.json b/packages/react/package.json index e152507a..5359194b 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -139,7 +139,7 @@ "@jupyterlite/settings": "^0.5.1", "@jupyterlite/translation": "^0.5.1", "@lumino/default-theme": "^2.0.0", - "@primer/react": "^36.27.0", + "@primer/react": "^37.19.0", "assert": "^2.0.0", "bufferutil": "^4.0.8", "codemirror": "^6.0.1", @@ -147,8 +147,8 @@ "lodash": "^4.17.4", "marked": "^4.0.10", "plotly.js": "^2.35.2", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "react-error-boundary": "^3.1.3", "react-inspector": "^6.0.2", "react-sparklines": "^1.7.0", @@ -183,10 +183,10 @@ "@types/codemirror": "^5.60.4", "@types/jest": "^29.4.0", "@types/marked": "^4.0.1", - "@types/node": "18.15.3", + "@types/node": "^22.14.1", "@types/plotly.js": "^2.12.31", - "@types/react": "18.2.12", - "@types/react-dom": "18.3.0", + "@types/react": "18.3.20", + "@types/react-dom": "18.3.6", "@types/react-sparklines": "^1.7.5", "@types/semver": "^7.5.6", "@types/styled-components": "^5.1.26", @@ -228,8 +228,8 @@ "svg-url-loader": "^7.1.1", "ts-jest": "^29.0.5", "ts-loader": "^9.4.3", - "typedoc": "^0.25.7", - "typescript": "5.0.3", + "typedoc": "^0.28.2", + "typescript": "^5.8.3", "url-loader": "^3.0.0", "watch": "^1.0.2", "webpack": "^5.74.0", diff --git a/packages/react/src/app/tabs/AboutTab.tsx b/packages/react/src/app/tabs/AboutTab.tsx index e71a2575..1b8f036d 100644 --- a/packages/react/src/app/tabs/AboutTab.tsx +++ b/packages/react/src/app/tabs/AboutTab.tsx @@ -5,7 +5,7 @@ */ import { useState } from 'react'; -import { Pagehead, Label, Text, Link, Box } from '@primer/react'; +import { PageHeader, Label, Text, Link, Box } from '@primer/react'; import { ECharlesIcon } from '@datalayer/icons-react/eggs'; type Props = { @@ -17,9 +17,9 @@ export const AboutTab = (props: Props): JSX.Element => { const [egg, setEgg] = useState(false); return ( <> - + 🪐 ⚛️ Jupyter React - + React.js components 💯% compatible with 🪐 Jupyter. diff --git a/packages/react/src/components/button/Button.tsx b/packages/react/src/components/button/Button.tsx index 2c12fe48..00157b4e 100644 --- a/packages/react/src/components/button/Button.tsx +++ b/packages/react/src/components/button/Button.tsx @@ -5,7 +5,7 @@ */ import { Button as BaseButton, ButtonProps } from '@primer/react'; -import type { BetterCssProperties } from '@primer/react/lib/sx'; +import type { BetterCssProperties } from '@primer/react'; import type { FC } from 'react'; /** diff --git a/packages/react/src/components/kernel/Kernelndicator.tsx b/packages/react/src/components/kernel/Kernelndicator.tsx index d3c8a65b..3972f7d0 100644 --- a/packages/react/src/components/kernel/Kernelndicator.tsx +++ b/packages/react/src/components/kernel/Kernelndicator.tsx @@ -106,11 +106,11 @@ export const KernelIndicator = (props: KernelIndicatorProps) => { } }, [kernel]); return connectionStatus && status ? ( - + {KERNEL_STATES.get(toKernelState(connectionStatus, status))} ) : ( - + {KERNEL_STATES.get('undefined')} ); diff --git a/packages/react/src/components/kernel/Kernels.tsx b/packages/react/src/components/kernel/Kernels.tsx index e804652f..c8e50f62 100644 --- a/packages/react/src/components/kernel/Kernels.tsx +++ b/packages/react/src/components/kernel/Kernels.tsx @@ -5,13 +5,9 @@ */ import { useState, useEffect } from 'react'; -import { Table, DataTable, Blankslate } from '@primer/react/drafts'; +import { Table, DataTable, Blankslate } from '@primer/react/experimental'; import { Box, Text, IconButton, Spinner } from '@primer/react'; -import { - CrossMarkIcon, - JupyterIcon, - NotebookIcon, -} from '@datalayer/icons-react'; +import { CrossMarkIcon, JupyterIcon, NotebookIcon } from '@datalayer/icons-react'; import { ServiceManager } from '@jupyterlab/services'; import { JSONExt } from '@lumino/coreutils'; import { IModel } from '@jupyterlab/services/lib/kernel/kernel'; diff --git a/packages/react/src/components/textinput/TextInput.tsx b/packages/react/src/components/textinput/TextInput.tsx index 68f8cc51..0e108abb 100644 --- a/packages/react/src/components/textinput/TextInput.tsx +++ b/packages/react/src/components/textinput/TextInput.tsx @@ -5,7 +5,7 @@ */ import { TextInput as BaseTextInput, TextInputProps } from '@primer/react'; -import type { BetterSystemStyleObject } from '@primer/react/lib/sx'; +import type { BetterSystemStyleObject } from '@primer/react'; import type { FC } from 'react'; /** diff --git a/packages/react/src/examples/JupyterLabTheme.tsx b/packages/react/src/examples/JupyterLabTheme.tsx index f531446e..1e398e85 100644 --- a/packages/react/src/examples/JupyterLabTheme.tsx +++ b/packages/react/src/examples/JupyterLabTheme.tsx @@ -7,10 +7,7 @@ import { useState, useEffect, useCallback } from 'react'; import { createRoot } from 'react-dom/client'; import { - Box, Button, Heading, Text, Link, PageLayout, PageHeader, RadioGroup, Radio, FormControl, RelativeTime, - TextInput, TextInputWithTokens, Timeline, Octicon, ToggleSwitch, SegmentedControl, Label, LabelGroup, - NavList, IconButton, CircleBadge, CircleOcticon, Tooltip, -// theme, + Box, Button, Heading, Text, Link, PageLayout, PageHeader, RadioGroup, Radio, FormControl, RelativeTime, TextInput, TextInputWithTokens, Timeline, ToggleSwitch, SegmentedControl, Label, LabelGroup, NavList, IconButton, CircleBadge, CircleOcticon, Tooltip, } from '@primer/react'; import { DataTable, Table, SkeletonBox, Banner } from '@primer/react/experimental'; import { GitCommitIcon, HeartIcon, RocketIcon, CheckIcon } from '@primer/octicons-react'; @@ -300,13 +297,13 @@ const JupyterLabTheme = () => { - + This is a message - + This is a message diff --git a/packages/react/src/examples/Kernels.tsx b/packages/react/src/examples/Kernels.tsx index ef8d2604..a957bbbf 100644 --- a/packages/react/src/examples/Kernels.tsx +++ b/packages/react/src/examples/Kernels.tsx @@ -6,7 +6,7 @@ import { createRoot } from 'react-dom/client'; import { useState } from 'react'; -import { Box, Heading, Textarea, Button, Pagehead, Text } from '@primer/react'; +import { Box, Heading, Textarea, Button, PageHeader, Text } from '@primer/react'; import { IModel } from '@jupyterlab/services/lib/kernel/kernel'; import { ISpecModel } from '@jupyterlab/services/lib/kernelspec/kernelspec'; import { JupyterReactTheme } from '../theme/JupyterReactTheme'; @@ -296,7 +296,7 @@ const root = createRoot(div); root.render( - The Kernel Components + The Kernel Components ); diff --git a/packages/react/src/examples/NotebookTheme.tsx b/packages/react/src/examples/NotebookTheme.tsx index 8ebc2fc4..be2b5642 100644 --- a/packages/react/src/examples/NotebookTheme.tsx +++ b/packages/react/src/examples/NotebookTheme.tsx @@ -6,7 +6,6 @@ import { INotebookContent } from '@jupyterlab/nbformat'; import { Text, ToggleSwitch, theme as primerTheme } from '@primer/react'; -import { Theme } from '@primer/react/lib/ThemeProvider'; import { useCallback, useEffect, useMemo, useState } from 'react'; import { createRoot } from 'react-dom/client'; import { CellSidebarExtension } from '../components'; @@ -16,7 +15,7 @@ import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolba import nbformat from './notebooks/NotebookExample1.ipynb.json'; const NotebookTheme = () => { - const [theme, setTheme] = useState(jupyterLabTheme); + const [theme, setTheme] = useState(jupyterLabTheme); const [isOn, setIsOn] = useState(false); const extensions = useMemo(() => [new CellSidebarExtension()], []); const onClick = useCallback(() => { diff --git a/packages/react/src/examples/NotebookThemeColormode.tsx b/packages/react/src/examples/NotebookThemeColormode.tsx index e885fe6e..fe120f40 100644 --- a/packages/react/src/examples/NotebookThemeColormode.tsx +++ b/packages/react/src/examples/NotebookThemeColormode.tsx @@ -6,7 +6,6 @@ import { INotebookContent } from '@jupyterlab/nbformat'; import { Box, Text, ToggleSwitch, theme as primerTheme } from '@primer/react'; -import { Theme } from '@primer/react/lib/ThemeProvider'; import { useCallback, useEffect, useMemo, useState } from 'react'; import { createRoot } from 'react-dom/client'; import { CellSidebarExtension } from '../components'; @@ -17,12 +16,11 @@ import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolba import nbformat from './notebooks/NotebookExample1.ipynb.json'; const NotebookThemeColormode = () => { - const [theme, setTheme] = useState(jupyterLabTheme); + const [theme, setTheme] = useState(jupyterLabTheme); const [isThemeOn, setIsThemeOn] = useState(false); const [colormode, setColormode] = useState('light'); const [isOn, setIsOn] = useState(false); const extensions = useMemo(() => [new CellSidebarExtension()], []); - useEffect(() => { if (isThemeOn) { setTheme(primerTheme); @@ -36,7 +34,6 @@ const NotebookThemeColormode = () => { const handleThemeSwitchChange = useCallback((on: boolean) => { setIsThemeOn(on); }, []); - useEffect(() => { if (isOn) { setColormode('dark'); diff --git a/packages/react/src/jupyter/Jupyter.tsx b/packages/react/src/jupyter/Jupyter.tsx index c79dae82..b28afea5 100644 --- a/packages/react/src/jupyter/Jupyter.tsx +++ b/packages/react/src/jupyter/Jupyter.tsx @@ -5,7 +5,6 @@ */ import { BaseStyles, Box, ThemeProvider } from '@primer/react'; -import { Theme } from '@primer/react/lib/ThemeProvider'; import { useMemo } from 'react'; import { ErrorBoundary } from 'react-error-boundary'; import { loadJupyterConfig } from './JupyterConfig'; @@ -22,7 +21,7 @@ export type JupyterProps = Omit< > & { colormode?: Colormode; disableCssLoading?: boolean; - theme?: Theme; + theme?: any; terminals?: boolean; }; diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json index f2b5a1f7..ceb57b74 100644 --- a/packages/react/tsconfig.json +++ b/packages/react/tsconfig.json @@ -15,7 +15,7 @@ "jsx": "react-jsx", "jsxImportSource": "react", "module": "ES2022", - "moduleResolution": "node", + "moduleResolution": "bundler", "noEmitOnError": true, "noImplicitAny": true, "noUnusedLocals": true, diff --git a/packages/react/webpack.config.js b/packages/react/webpack.config.js index 1e35cad9..ee9bac63 100644 --- a/packages/react/webpack.config.js +++ b/packages/react/webpack.config.js @@ -44,7 +44,7 @@ const ENTRY = // './src/examples/Kernels'; // './src/examples/Lumino'; // './src/examples/Matplotlib'; - './src/examples/Notebook'; + // './src/examples/Notebook'; // './src/examples/NotebookCellSidebar'; // './src/examples/NotebookCellToolbar'; // './src/examples/NotebookColormode'; @@ -68,7 +68,7 @@ const ENTRY = // './src/examples/NotebookSimple'; // './src/examples/NotebookSkeleton'; // './src/examples/NotebookTheme'; - // './src/examples/NotebookThemeColormode'; + './src/examples/NotebookThemeColormode'; // './src/examples/NotebookURL'; // './src/examples/NotebookURL'; // './src/examples/ObservableHQ'; diff --git a/packages/vscode/package.json b/packages/vscode/package.json index e677f982..98f9bdb0 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -58,17 +58,17 @@ "@datalayer/jupyter-react": "^0.20.2", "@jupyterlab/services": "^7.0.0", "@lumino/coreutils": "^2.1.1", - "@primer/react": "^36.27.0", - "react": "18.2.0", - "react-dom": "18.2.0", + "@primer/react": "^37.19.0", + "react": "18.3.1", + "react-dom": "18.3.1", "typestyle": "^2.0.4", "ws": "^8.18.1" }, "devDependencies": { "@types/mocha": "^10.0.10", - "@types/node": "18.15.3", - "@types/react": "18.2.12", - "@types/react-dom": "18.3.0", + "@types/node": "^22.14.1", + "@types/react": "18.3.20", + "@types/react-dom": "18.3.6", "@types/vscode": "^1.98.0", "@typescript-eslint/eslint-plugin": "^8.29.1", "@typescript-eslint/parser": "^8.29.1", @@ -82,7 +82,7 @@ "style-loader": "^2.0.0", "svg-inline-loader": "^0.8.2", "ts-loader": "^9.5.2", - "typescript": "5.0.3", + "typescript": "^5.8.3", "webpack": "^5.98.0", "webpack-cli": "^6.0.1" } diff --git a/storybook/package.json b/storybook/package.json index 1b53180f..df8a8299 100644 --- a/storybook/package.json +++ b/storybook/package.json @@ -28,8 +28,8 @@ "dependencies": { "@datalayer/jupyter-lexical": "^1.0.0", "@datalayer/jupyter-react": "^1.0.0", - "react": "18.2.0", - "react-dom": "18.2.0" + "react": "18.3.1", + "react-dom": "18.3.1" }, "devDependencies": { "@babel/core": "^7.21.0", @@ -58,8 +58,8 @@ "@storybook/react": "^8.0.10", "@storybook/react-webpack5": "^8.0.10", "@storybook/test": "^8.0.10", - "@types/react": "18.2.12", - "@types/react-dom": "18.3.0", + "@types/react": "18.3.20", + "@types/react-dom": "18.3.6", "mdx-mermaid": "^2.0.0", "mermaid": "^10.9.0", "storybook": "^8.0.10", From fd55a8291b7fee2181a95c6ceae231ea51ee21a5 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Sun, 13 Apr 2025 20:06:43 +0200 Subject: [PATCH 11/19] fix: build --- .../src/theme/JupyterCell.tsx | 1 - .../src/theme/ReactLiveScope/index.tsx | 3 +- packages/lexical/install.json | 5 --- packages/lexical/package.json | 27 ++++++++-------- .../{Commenting.ts => Commenting.tsx} | 32 +++---------------- packages/lexical/src/editor/Editor.tsx | 2 +- packages/lexical/src/examples/AppNbformat.tsx | 18 +++++------ packages/lexical/src/nodes/ImageNode.tsx | 2 +- .../lexical/src/plugins/CommentPlugin.tsx | 4 +-- .../src/plugins/TableOfContentsPlugin.tsx | 13 ++++---- .../lexical/src/plugins/ToolbarPlugin.tsx | 11 ++++--- packages/lexical/src/typings.d.ts | 5 --- packages/lexical/tsconfig.json | 13 +++++--- packages/react/install.json | 5 --- packages/react/package.json | 6 ++-- .../src/examples/NotebookThemeColormode.tsx | 2 +- packages/react/src/theme/JupyterLabCss.tsx | 15 ++++++--- packages/react/tsconfig.json | 10 ++++-- packages/vscode/package.json | 2 +- 19 files changed, 77 insertions(+), 99 deletions(-) delete mode 100644 packages/lexical/install.json rename packages/lexical/src/components/{Commenting.ts => Commenting.tsx} (95%) delete mode 100644 packages/react/install.json diff --git a/packages/docusaurus-plugin/src/theme/JupyterCell.tsx b/packages/docusaurus-plugin/src/theme/JupyterCell.tsx index 54f799f3..879af18d 100644 --- a/packages/docusaurus-plugin/src/theme/JupyterCell.tsx +++ b/packages/docusaurus-plugin/src/theme/JupyterCell.tsx @@ -16,7 +16,6 @@ type JupyterCellProps = { const JupyterCell = (props: JupyterCellProps) => { return ( - // @ts-ignore Jupyter Cell fallback content for prerendering.}> {() => { diff --git a/packages/docusaurus-plugin/src/theme/ReactLiveScope/index.tsx b/packages/docusaurus-plugin/src/theme/ReactLiveScope/index.tsx index ebfde5b6..4d534145 100644 --- a/packages/docusaurus-plugin/src/theme/ReactLiveScope/index.tsx +++ b/packages/docusaurus-plugin/src/theme/ReactLiveScope/index.tsx @@ -10,7 +10,6 @@ import { ContentLoader } from '@datalayer/primer-addons'; const Cell = (props: any) => { return ( - // @ts-ignore Jupyter Cell fallback content for prerendering.}> {() => { @@ -40,6 +39,6 @@ const ReactLiveScope = { React, ...React, Cell, -}; +} as any; export default ReactLiveScope; diff --git a/packages/lexical/install.json b/packages/lexical/install.json deleted file mode 100644 index a06ea47d..00000000 --- a/packages/lexical/install.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "packageManager": "python", - "packageName": "jupyter_lexical", - "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyter_lexical" -} diff --git a/packages/lexical/package.json b/packages/lexical/package.json index 079e532b..ee4947db 100644 --- a/packages/lexical/package.json +++ b/packages/lexical/package.json @@ -62,29 +62,30 @@ "watch:src": "tsc -w" }, "dependencies": { - "@datalayer/icons-react": "^0.3.7", + "@datalayer/icons-react": "^1.0.0", "@datalayer/jupyter-react": "^1.0.0", "@datalayer/primer-addons": "^1.0.0", "@jupyterlab/application": "^4.0.0", "@jupyterlab/coreutils": "^6.0.0", "@jupyterlab/services": "^7.0.0", "@jupyterlab/settingregistry": "^4.0.0", - "@lexical/code": "^0.23.1", - "@lexical/link": "^0.23.1", - "@lexical/list": "^0.23.1", - "@lexical/react": "^0.23.1", - "@lexical/rich-text": "^0.23.1", - "@lexical/selection": "^0.23.1", - "@lexical/table": "^0.23.1", - "@lexical/utils": "^0.23.1", - "@lexical/yjs": "^0.23.1", + "@lexical/code": "^0.30.0", + "@lexical/link": "^0.30.0", + "@lexical/list": "^0.30.0", + "@lexical/react": "^0.30.0", + "@lexical/rich-text": "^0.30.0", + "@lexical/selection": "^0.30.0", + "@lexical/table": "^0.30.0", + "@lexical/utils": "^0.30.0", + "@lexical/yjs": "^0.30.0", "katex": "^0.16.21", - "lexical": "^0.23.1", + "lexical": "^0.30.0", "lodash-es": "^4.17.21", "react": "18.3.1", "react-dom": "18.3.1", "react-json-tree": "^0.19.0", - "styled-components": "^5.3.10" + "styled-components": "^5.3.10", + "yjs": "^13.6.24" }, "devDependencies": { "@babel/core": "^7.21.0", @@ -103,7 +104,7 @@ "@types/prismjs": "^1.26.0", "@types/react": "18.3.20", "@types/react-dom": "18.3.6", - "@types/styled-components": "^5.1.26", + "@types/styled-components": "^5.1.34", "@types/uuid": "^8.3.0", "@typescript-eslint/eslint-plugin": "^8.29.1", "@typescript-eslint/parser": "^8.29.1", diff --git a/packages/lexical/src/components/Commenting.ts b/packages/lexical/src/components/Commenting.tsx similarity index 95% rename from packages/lexical/src/components/Commenting.ts rename to packages/lexical/src/components/Commenting.tsx index 7c95db8c..c7d5e9bb 100644 --- a/packages/lexical/src/components/Commenting.ts +++ b/packages/lexical/src/components/Commenting.tsx @@ -4,24 +4,12 @@ * MIT License */ -/* - * Copyright (c) 2021-2024 Datalayer, Inc. - * - * Datalayer License - */ - +import {useEffect, useState} from 'react'; import type {LexicalEditor} from 'lexical'; import {TOGGLE_CONNECT_COMMAND} from '@lexical/yjs'; import {COMMAND_PRIORITY_LOW} from 'lexical'; -import {useEffect, useState} from 'react'; import {WebsocketProvider} from 'y-websocket'; -import { - Array as YArray, - Map as YMap, - Transaction, - YArrayEvent, - YEvent, -} from 'yjs'; +import { Array as YArray, Map as YMap, Transaction, YArrayEvent, YEvent } from 'yjs'; export type Comment = { author: string; @@ -135,7 +123,6 @@ export class CommentStore { // The YJS types explicitly use `any` as well. // eslint-disable-next-line @typescript-eslint/no-explicit-any const sharedCommentsArray: YArray | null = this._getCollabComments(); - if (thread !== undefined && commentOrThread.type === 'comment') { for (let i = 0; i < nextComments.length; i++) { const comment = nextComments[i]; @@ -180,7 +167,6 @@ export class CommentStore { // eslint-disable-next-line @typescript-eslint/no-explicit-any const sharedCommentsArray: YArray | null = this._getCollabComments(); let commentIndex: number | null = null; - if (thread !== undefined) { for (let i = 0; i < nextComments.length; i++) { const nextComment = nextComments[i]; @@ -250,19 +236,16 @@ export class CommentStore { } } - // eslint-disable-next-line @typescript-eslint/no-explicit-any _getCollabComments(): null | YArray { const provider = this._collabProvider; if (provider !== null) { - // @ts-ignore doc does exist const doc = provider.doc; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - return doc.get('comments', YArray) as YArray; +// return doc.get('comments', YArray) as YArray; + return doc.get('comments') as YArray; } return null; } - // eslint-disable-next-line @typescript-eslint/no-explicit-any _createCollabSharedMap(commentOrThread: Comment | Thread): YMap { const sharedMap = new YMap(); const type = commentOrThread.type; @@ -333,12 +316,10 @@ export class CommentStore { if (transaction.origin !== this) { for (let i = 0; i < events.length; i++) { const event = events[i]; - if (event instanceof YArrayEvent) { const target = event.target; const deltas = event.delta; let offset = 0; - for (let s = 0; s < deltas.length; s++) { const delta = deltas[s]; const insert = delta.insert; @@ -354,11 +335,9 @@ export class CommentStore { | undefined); if (Array.isArray(insert)) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any insert.forEach((map: YMap) => { const id = map.get('id'); const type = map.get('type'); - const commentOrThread = type === 'thread' ? createThread( @@ -366,7 +345,6 @@ export class CommentStore { map .get('comments') .toArray() - // eslint-disable-next-line @typescript-eslint/no-explicit-any .map( ( innerComment: Map< @@ -442,12 +420,10 @@ export function useCommentStore(commentStore: CommentStore): Comments { const [comments, setComments] = useState( commentStore.getComments(), ); - useEffect(() => { return commentStore.registerOnChange(() => { setComments(commentStore.getComments()); }); }, [commentStore]); - return comments; } diff --git a/packages/lexical/src/editor/Editor.tsx b/packages/lexical/src/editor/Editor.tsx index c4158022..80c81a68 100644 --- a/packages/lexical/src/editor/Editor.tsx +++ b/packages/lexical/src/editor/Editor.tsx @@ -19,7 +19,7 @@ import { HashtagNode } from '@lexical/hashtag'; import { OnChangePlugin } from "@lexical/react/LexicalOnChangePlugin"; import { CheckListPlugin } from "@lexical/react/LexicalCheckListPlugin"; import { HorizontalRuleNode } from "@lexical/react/LexicalHorizontalRuleNode"; -import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary'; +import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary'; import { HeadingNode, QuoteNode } from "@lexical/rich-text"; import { TableCellNode, TableNode, TableRowNode } from "@lexical/table"; import { ListItemNode, ListNode } from "@lexical/list"; diff --git a/packages/lexical/src/examples/AppNbformat.tsx b/packages/lexical/src/examples/AppNbformat.tsx index 79af0c1b..9762d56e 100644 --- a/packages/lexical/src/examples/AppNbformat.tsx +++ b/packages/lexical/src/examples/AppNbformat.tsx @@ -8,7 +8,7 @@ import { useState } from "react"; import { $getRoot } from "lexical"; import styled from "styled-components"; import { useNotebookStore, Jupyter, Notebook, CellSidebar, CellSidebarExtension } from "@datalayer/jupyter-react"; -import { Box, TabNav, Button } from "@primer/react"; +import { Box, UnderlineNav, Button } from "@primer/react"; import { ThreeBarsIcon } from "@primer/octicons-react" import { JSONTree } from "react-json-tree"; import { INotebookContent } from "@jupyterlab/nbformat"; @@ -61,17 +61,17 @@ const Tabs = () => { } return ( - - goToTab(e, 'editor', notebook?.model)}> + + goToTab(e, 'editor', notebook?.model)}> Editor - - goToTab(e, 'notebook', notebook?.model)}> + + goToTab(e, 'notebook', notebook?.model)}> Notebook - - goToTab(e, 'nbformat', notebook?.model)}> + + goToTab(e, 'nbformat', notebook?.model)}> NbFormat - - + + { tab === 'editor' && diff --git a/packages/lexical/src/nodes/ImageNode.tsx b/packages/lexical/src/nodes/ImageNode.tsx index a3323fe8..78f6363a 100644 --- a/packages/lexical/src/nodes/ImageNode.tsx +++ b/packages/lexical/src/nodes/ImageNode.tsx @@ -28,7 +28,7 @@ import {LexicalNestedComposer} from '@lexical/react/LexicalNestedComposer'; import {RichTextPlugin} from '@lexical/react/LexicalRichTextPlugin'; import {TablePlugin} from '@lexical/react/LexicalTablePlugin'; import {useLexicalNodeSelection} from '@lexical/react/useLexicalNodeSelection'; -import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary'; +import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary'; import {mergeRegister} from '@lexical/utils'; import { $createNodeSelection, diff --git a/packages/lexical/src/plugins/CommentPlugin.tsx b/packages/lexical/src/plugins/CommentPlugin.tsx index e61df820..06f276df 100644 --- a/packages/lexical/src/plugins/CommentPlugin.tsx +++ b/packages/lexical/src/plugins/CommentPlugin.tsx @@ -28,7 +28,7 @@ import { createCommand, KEY_ESCAPE_COMMAND, } from 'lexical'; -import type {Doc} from 'yjs'; +import type { Doc } from 'yjs'; import { $createMarkNode, $getMarkIDs, @@ -37,7 +37,7 @@ import { $wrapSelectionInMarkNode, MarkNode, } from '@lexical/mark'; -import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary'; +import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary'; import {AutoFocusPlugin} from '@lexical/react/LexicalAutoFocusPlugin'; import {ClearEditorPlugin} from '@lexical/react/LexicalClearEditorPlugin'; import {useCollaborationContext} from '@lexical/react/LexicalCollaborationContext'; diff --git a/packages/lexical/src/plugins/TableOfContentsPlugin.tsx b/packages/lexical/src/plugins/TableOfContentsPlugin.tsx index e26cf556..2c260e27 100644 --- a/packages/lexical/src/plugins/TableOfContentsPlugin.tsx +++ b/packages/lexical/src/plugins/TableOfContentsPlugin.tsx @@ -4,15 +4,14 @@ * MIT License */ +import {useEffect, useRef, useState} from 'react'; import type {HeadingTagType} from '@lexical/rich-text'; import type {NodeKey} from 'lexical'; +import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext'; +import {TableOfContentsPlugin as LexicalTableOfContentsPlugin} from '@lexical/react/LexicalTableOfContentsPlugin'; import './../../style/lexical/TableOfContentsPlugin.css'; -import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext'; -import LexicalTableOfContents from '@lexical/react/LexicalTableOfContents'; -import {useEffect, useRef, useState} from 'react'; - function indent(tagName: HeadingTagType) { if (tagName === 'h2') { return 'heading2'; @@ -179,11 +178,11 @@ function TableOfContentsList({ export const TableOfContentsPlugin = () => { return ( - - {(tableOfContents) => { + + {(tableOfContents: any) => { return ; }} - + ); } diff --git a/packages/lexical/src/plugins/ToolbarPlugin.tsx b/packages/lexical/src/plugins/ToolbarPlugin.tsx index a39bce94..eab87678 100644 --- a/packages/lexical/src/plugins/ToolbarPlugin.tsx +++ b/packages/lexical/src/plugins/ToolbarPlugin.tsx @@ -31,9 +31,10 @@ import { $isJupyterCodeNode, DropDownItem, DropDown, getDefaultCodeLanguage, getLanguageFriendlyName, CODE_LANGUAGE_FRIENDLY_NAME_MAP, $createYouTubeNode, INSERT_EQUATION_COMMAND, INSERT_JUPYTER_CELL_COMMAND, DEFAULT_INITIAL_OUTPUTS -} from "../index"; +} from "../"; import './../../style/lexical/ToolbarPlugin.css'; +import { JupyterCodeNode } from "../nodes"; const LowPriority = 1; @@ -42,7 +43,7 @@ function getCodeLanguageOptions(): [string, string][] { for (const [lang, friendlyName] of Object.entries( CODE_LANGUAGE_FRIENDLY_NAME_MAP, )) { - options.push([lang, friendlyName]); + options.push([lang, friendlyName as string]); } return options; } @@ -476,7 +477,7 @@ export function ToolbarPlugin() { : element.getType(); setBlockType(type); if ($isJupyterCodeNode(element)) { - setCodeLanguage(element.getLanguage() || getDefaultCodeLanguage()); + setCodeLanguage((element as JupyterCodeNode).getLanguage() || getDefaultCodeLanguage()); } } } @@ -536,8 +537,8 @@ export function ToolbarPlugin() { activeEditor.update(() => { if (selectedElementKey !== null) { const node = $getNodeByKey(selectedElementKey); - if ($isJupyterCodeNode(node)) { - node.setLanguage(value); + if (node && $isJupyterCodeNode(node)) { + (node as JupyterCodeNode).setLanguage(value); } } }); diff --git a/packages/lexical/src/typings.d.ts b/packages/lexical/src/typings.d.ts index 98d400ce..f6989cc5 100755 --- a/packages/lexical/src/typings.d.ts +++ b/packages/lexical/src/typings.d.ts @@ -23,8 +23,3 @@ declare module "*.svg" { const value: any; export default value; } - -declare module "prettier/*" { - const value: any; - export default value; -} diff --git a/packages/lexical/tsconfig.json b/packages/lexical/tsconfig.json index 1c06db86..fbe57cdf 100644 --- a/packages/lexical/tsconfig.json +++ b/packages/lexical/tsconfig.json @@ -1,7 +1,12 @@ { "$schema": "http://json.schemastore.org/tsconfig", - "include": ["./src/**/*", "./src/**/*.json"], - "exclude": ["node_modules"], + "include": [ + "./src/**/*", + "./src/**/*.json" + ], + "exclude": [ + "node_modules" + ], "compilerOptions": { "forceConsistentCasingInFileNames": true, "baseUrl": "/", @@ -14,7 +19,7 @@ "jsx": "react-jsx", "jsxImportSource": "react", "module": "ES2022", - "moduleResolution": "node", + "moduleResolution": "bundler", "noEmitOnError": true, "noImplicitAny": true, "noUnusedLocals": true, @@ -28,4 +33,4 @@ "types": ["jest", "node"], "lib": ["ESNext", "DOM"] } -} +} \ No newline at end of file diff --git a/packages/react/install.json b/packages/react/install.json deleted file mode 100644 index 766f28d0..00000000 --- a/packages/react/install.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "packageManager": "python", - "packageName": "jupyter_react", - "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package jupyter_react" -} diff --git a/packages/react/package.json b/packages/react/package.json index 5359194b..7883b9b4 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -159,8 +159,8 @@ "utf-8-validate": "^6.0.3", "wildcard-match": "^5.1.2", "y-protocols": "^1.0.5", - "y-websocket": "^2.1.0", - "yjs": "^13.5.40", + "y-websocket": "^3.0.0", + "yjs": "^13.6.24", "zustand": "^4.4.1" }, "devDependencies": { @@ -189,7 +189,7 @@ "@types/react-dom": "18.3.6", "@types/react-sparklines": "^1.7.5", "@types/semver": "^7.5.6", - "@types/styled-components": "^5.1.26", + "@types/styled-components": "^5.1.34", "@types/uuid": "^8.3.0", "@types/webpack-env": "^1.18.2", "@typescript-eslint/eslint-plugin": "^8.29.1", diff --git a/packages/react/src/examples/NotebookThemeColormode.tsx b/packages/react/src/examples/NotebookThemeColormode.tsx index fe120f40..43bbbf7e 100644 --- a/packages/react/src/examples/NotebookThemeColormode.tsx +++ b/packages/react/src/examples/NotebookThemeColormode.tsx @@ -4,9 +4,9 @@ * MIT License */ +import { useCallback, useEffect, useMemo, useState } from 'react'; import { INotebookContent } from '@jupyterlab/nbformat'; import { Box, Text, ToggleSwitch, theme as primerTheme } from '@primer/react'; -import { useCallback, useEffect, useMemo, useState } from 'react'; import { createRoot } from 'react-dom/client'; import { CellSidebarExtension } from '../components'; import { Notebook } from '../components/notebook/Notebook'; diff --git a/packages/react/src/theme/JupyterLabCss.tsx b/packages/react/src/theme/JupyterLabCss.tsx index 761ca197..b18df1fa 100644 --- a/packages/react/src/theme/JupyterLabCss.tsx +++ b/packages/react/src/theme/JupyterLabCss.tsx @@ -7,6 +7,16 @@ import { useEffect } from 'react'; import { Colormode } from './JupyterLabColormode'; +import "@primer/primitives/dist/css/base/typography/typography.css"; +import "@primer/primitives/dist/css/functional/themes/light.css"; +import "@primer/primitives/dist/css/functional/size/border.css"; +import "@primer/primitives/dist/css/functional/size/breakpoints.css"; +import "@primer/primitives/dist/css/functional/size/size-coarse.css"; +import "@primer/primitives/dist/css/functional/size/size-fine.css"; +import "@primer/primitives/dist/css/functional/size/size.css"; +import "@primer/primitives/dist/css/functional/size/viewport.css"; +import "@primer/primitives/dist/css/functional/typography/typography.css"; + const DATASET_LAB_THEME = 'data-lab-theme'; type JupyterLabCssProps = { @@ -51,7 +61,6 @@ export function JupyterLabCss(props: JupyterLabCssProps): JSX.Element { useEffect(() => { document.body.querySelector(`style[${DATASET_LAB_THEME}]`)?.remove(); - let theme; switch (colormode) { case 'light': { @@ -67,11 +76,9 @@ export function JupyterLabCss(props: JupyterLabCssProps): JSX.Element { } // Inject the JupyterLab theme stylesheet in a retrievable node - // ! webpack should be configured to load the theme style sheets - // with css-loader as string - this is available in css-loader v6.3.0 or later: + // ! webpack should be configured to load the theme style sheets with css-loader as string - this is available in css-loader v6.3.0 or later: // { test: /style\/theme\.css$/i, loader: 'css-loader', options: {exportType: 'string'} } theme?.then(module => { - if (module.default) { document.body.insertAdjacentHTML( 'afterbegin', diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json index ceb57b74..4af9cdbb 100644 --- a/packages/react/tsconfig.json +++ b/packages/react/tsconfig.json @@ -1,7 +1,13 @@ { "$schema": "http://json.schemastore.org/tsconfig", - "include": ["./src/**/*", "./src/**/*.json"], - "exclude": ["node_modules", "src/example"], + "include": [ + "./src/**/*", + "./src/**/*.json" + ], + "exclude": [ + "node_modules", + "src/example" + ], "compilerOptions": { "forceConsistentCasingInFileNames": true, "baseUrl": "/", diff --git a/packages/vscode/package.json b/packages/vscode/package.json index 98f9bdb0..8b83f81b 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -55,7 +55,7 @@ "vsix": "npx @vscode/vsce package --no-yarn --no-dependencies" }, "dependencies": { - "@datalayer/jupyter-react": "^0.20.2", + "@datalayer/jupyter-react": "^1.0.0", "@jupyterlab/services": "^7.0.0", "@lumino/coreutils": "^2.1.1", "@primer/react": "^37.19.0", From 70ad4ecaa4e15d6cb29a0cc5fc2f01d526df66e8 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Mon, 14 Apr 2025 09:59:53 +0200 Subject: [PATCH 12/19] deps --- attic/esbuild/package.json | 4 ++-- attic/slate/package.json | 4 ++-- docs/package.json | 4 ++-- examples/cra/package.json | 4 ++-- examples/docusaurus/package.json | 4 ++-- examples/lexical/package.json | 4 ++-- examples/next-js/package.json | 4 ++-- package.json | 8 ++++---- packages/docusaurus-plugin/package.json | 4 ++-- packages/lexical/package.json | 4 ++-- packages/react/package.json | 4 ++-- packages/vscode/package.json | 4 ++-- storybook/package.json | 4 ++-- 13 files changed, 28 insertions(+), 28 deletions(-) diff --git a/attic/esbuild/package.json b/attic/esbuild/package.json index 1b90e9ed..292d79ad 100644 --- a/attic/esbuild/package.json +++ b/attic/esbuild/package.json @@ -39,8 +39,8 @@ "notistack": "^2.0.5", "os-browserify": "^0.3.0", "prettier": "^3.5.3", - "react": "18.3.1", - "react-dom": "18.3.1", + "react": "18.2.0", + "react-dom": "18.2.0", "react-hook-form": "^5.7.2", "react-redux": "^7.2.2", "react-resizable": "^1.11.0", diff --git a/attic/slate/package.json b/attic/slate/package.json index b5467c11..376c8886 100644 --- a/attic/slate/package.json +++ b/attic/slate/package.json @@ -42,8 +42,8 @@ "is-url": "^1.2.4", "lodash": "^4.17.4", "prismjs": "^1.24.1", - "react": "18.3.1", - "react-dom": "18.3.1", + "react": "18.2.0", + "react-dom": "18.2.0", "react-error-boundary": "^3.1.3", "react-redux": "^8.0.2", "redux": "^4.2.1", diff --git a/docs/package.json b/docs/package.json index f29a3bb0..f355e897 100644 --- a/docs/package.json +++ b/docs/package.json @@ -25,9 +25,9 @@ "clsx": "^2.1.1", "docusaurus-lunr-search": "^3.5.0", "docusaurus-plugin-typedoc": "^1.3.0", - "react": "18.3.1", + "react": "18.2.0", "react-calendly": "^4.1.0", - "react-dom": "18.3.1", + "react-dom": "18.2.0", "react-modal-image": "^2.5.0", "typedoc-plugin-markdown": "^4.6.2" }, diff --git a/examples/cra/package.json b/examples/cra/package.json index 5a45506e..f44d9e1f 100644 --- a/examples/cra/package.json +++ b/examples/cra/package.json @@ -17,8 +17,8 @@ "@datalayer/primer-addons": "^1.0.0", "jupyterlab-plotly": "^5.17.0", "plotly.js": "^2.26.2", - "react": "18.3.1", - "react-dom": "18.3.1", + "react": "18.2.0", + "react-dom": "18.2.0", "web-vitals": "^2.1.4" }, "devDependencies": { diff --git a/examples/docusaurus/package.json b/examples/docusaurus/package.json index 9f13e368..f467bacb 100644 --- a/examples/docusaurus/package.json +++ b/examples/docusaurus/package.json @@ -29,8 +29,8 @@ "@mdx-js/react": "^3.0.1", "clsx": "^2.1.1", "prism-react-renderer": "^1.2.1", - "react": "18.3.1", - "react-dom": "18.3.1", + "react": "18.2.0", + "react-dom": "18.2.0", "react-router-dom": "^6.22.3" }, "devDependencies": { diff --git a/examples/lexical/package.json b/examples/lexical/package.json index 566c3838..4ccf6462 100644 --- a/examples/lexical/package.json +++ b/examples/lexical/package.json @@ -30,8 +30,8 @@ "dependencies": { "@datalayer/jupyter-lexical": "^1.0.0", "@datalayer/primer-addons": "^1.0.0", - "react": "18.3.1", - "react-dom": "18.3.1", + "react": "18.2.0", + "react-dom": "18.2.0", "react-json-tree": "^0.17.0" }, "devDependencies": { diff --git a/examples/next-js/package.json b/examples/next-js/package.json index c8eef917..e3e286ab 100644 --- a/examples/next-js/package.json +++ b/examples/next-js/package.json @@ -19,8 +19,8 @@ "next": "^14.2.3", "next-themes": "^0.2.1", "postcss": "^8.4.23", - "react": "18.3.1", - "react-dom": "18.3.1", + "react": "18.2.0", + "react-dom": "18.2.0", "svg-url-loader": "^7.1.1", "tailwindcss": "^3.3.2" }, diff --git a/package.json b/package.json index d491250b..92089170 100644 --- a/package.json +++ b/package.json @@ -78,14 +78,14 @@ "@primer/react": "^37.19.0", "@types/react": "18.3.20", "@types/react-dom": "18.3.6", - "react": "18.3.1", - "react-dom": "18.3.1" + "react": "18.2.0", + "react-dom": "18.2.0" }, "overrides": { "@jupyterlab/services": "^7.0.0", "@types/react": "18.3.20", "@types/react-dom": "18.3.6", - "react": "18.3.1", - "react-dom": "18.3.1" + "react": "18.2.0", + "react-dom": "18.2.0" } } diff --git a/packages/docusaurus-plugin/package.json b/packages/docusaurus-plugin/package.json index 9788634d..df06f987 100644 --- a/packages/docusaurus-plugin/package.json +++ b/packages/docusaurus-plugin/package.json @@ -51,7 +51,7 @@ "webpack": "^5.74.0" }, "peerDependencies": { - "react": "18.3.1", - "react-dom": "18.3.1" + "react": "18.2.0", + "react-dom": "18.2.0" } } diff --git a/packages/lexical/package.json b/packages/lexical/package.json index ee4947db..7278f0d2 100644 --- a/packages/lexical/package.json +++ b/packages/lexical/package.json @@ -81,8 +81,8 @@ "katex": "^0.16.21", "lexical": "^0.30.0", "lodash-es": "^4.17.21", - "react": "18.3.1", - "react-dom": "18.3.1", + "react": "18.2.0", + "react-dom": "18.2.0", "react-json-tree": "^0.19.0", "styled-components": "^5.3.10", "yjs": "^13.6.24" diff --git a/packages/react/package.json b/packages/react/package.json index 7883b9b4..5259c673 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -147,8 +147,8 @@ "lodash": "^4.17.4", "marked": "^4.0.10", "plotly.js": "^2.35.2", - "react": "18.3.1", - "react-dom": "18.3.1", + "react": "18.2.0", + "react-dom": "18.2.0", "react-error-boundary": "^3.1.3", "react-inspector": "^6.0.2", "react-sparklines": "^1.7.0", diff --git a/packages/vscode/package.json b/packages/vscode/package.json index 8b83f81b..4357b829 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -59,8 +59,8 @@ "@jupyterlab/services": "^7.0.0", "@lumino/coreutils": "^2.1.1", "@primer/react": "^37.19.0", - "react": "18.3.1", - "react-dom": "18.3.1", + "react": "18.2.0", + "react-dom": "18.2.0", "typestyle": "^2.0.4", "ws": "^8.18.1" }, diff --git a/storybook/package.json b/storybook/package.json index df8a8299..ee4d391c 100644 --- a/storybook/package.json +++ b/storybook/package.json @@ -28,8 +28,8 @@ "dependencies": { "@datalayer/jupyter-lexical": "^1.0.0", "@datalayer/jupyter-react": "^1.0.0", - "react": "18.3.1", - "react-dom": "18.3.1" + "react": "18.2.0", + "react-dom": "18.2.0" }, "devDependencies": { "@babel/core": "^7.21.0", From e40ab3f949c9e2bb64053e88d7d5b9e3f53a1140 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Mon, 14 Apr 2025 10:43:12 +0200 Subject: [PATCH 13/19] deps --- attic/esbuild/package.json | 4 ++-- attic/slate/package.json | 4 ++-- docs/package.json | 4 ++-- examples/cra/package.json | 4 ++-- examples/docusaurus/package.json | 4 ++-- examples/lexical/package.json | 4 ++-- examples/next-js/package.json | 4 ++-- package.json | 8 ++++---- packages/docusaurus-plugin/package.json | 4 ++-- packages/lexical/package.json | 4 ++-- packages/react/package.json | 4 ++-- packages/vscode/package.json | 4 ++-- storybook/package.json | 4 ++-- 13 files changed, 28 insertions(+), 28 deletions(-) diff --git a/attic/esbuild/package.json b/attic/esbuild/package.json index 292d79ad..1b90e9ed 100644 --- a/attic/esbuild/package.json +++ b/attic/esbuild/package.json @@ -39,8 +39,8 @@ "notistack": "^2.0.5", "os-browserify": "^0.3.0", "prettier": "^3.5.3", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "react-hook-form": "^5.7.2", "react-redux": "^7.2.2", "react-resizable": "^1.11.0", diff --git a/attic/slate/package.json b/attic/slate/package.json index 376c8886..b5467c11 100644 --- a/attic/slate/package.json +++ b/attic/slate/package.json @@ -42,8 +42,8 @@ "is-url": "^1.2.4", "lodash": "^4.17.4", "prismjs": "^1.24.1", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "react-error-boundary": "^3.1.3", "react-redux": "^8.0.2", "redux": "^4.2.1", diff --git a/docs/package.json b/docs/package.json index f355e897..f29a3bb0 100644 --- a/docs/package.json +++ b/docs/package.json @@ -25,9 +25,9 @@ "clsx": "^2.1.1", "docusaurus-lunr-search": "^3.5.0", "docusaurus-plugin-typedoc": "^1.3.0", - "react": "18.2.0", + "react": "18.3.1", "react-calendly": "^4.1.0", - "react-dom": "18.2.0", + "react-dom": "18.3.1", "react-modal-image": "^2.5.0", "typedoc-plugin-markdown": "^4.6.2" }, diff --git a/examples/cra/package.json b/examples/cra/package.json index f44d9e1f..5a45506e 100644 --- a/examples/cra/package.json +++ b/examples/cra/package.json @@ -17,8 +17,8 @@ "@datalayer/primer-addons": "^1.0.0", "jupyterlab-plotly": "^5.17.0", "plotly.js": "^2.26.2", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "web-vitals": "^2.1.4" }, "devDependencies": { diff --git a/examples/docusaurus/package.json b/examples/docusaurus/package.json index f467bacb..9f13e368 100644 --- a/examples/docusaurus/package.json +++ b/examples/docusaurus/package.json @@ -29,8 +29,8 @@ "@mdx-js/react": "^3.0.1", "clsx": "^2.1.1", "prism-react-renderer": "^1.2.1", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "react-router-dom": "^6.22.3" }, "devDependencies": { diff --git a/examples/lexical/package.json b/examples/lexical/package.json index 4ccf6462..566c3838 100644 --- a/examples/lexical/package.json +++ b/examples/lexical/package.json @@ -30,8 +30,8 @@ "dependencies": { "@datalayer/jupyter-lexical": "^1.0.0", "@datalayer/primer-addons": "^1.0.0", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "react-json-tree": "^0.17.0" }, "devDependencies": { diff --git a/examples/next-js/package.json b/examples/next-js/package.json index e3e286ab..c8eef917 100644 --- a/examples/next-js/package.json +++ b/examples/next-js/package.json @@ -19,8 +19,8 @@ "next": "^14.2.3", "next-themes": "^0.2.1", "postcss": "^8.4.23", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "svg-url-loader": "^7.1.1", "tailwindcss": "^3.3.2" }, diff --git a/package.json b/package.json index 92089170..d491250b 100644 --- a/package.json +++ b/package.json @@ -78,14 +78,14 @@ "@primer/react": "^37.19.0", "@types/react": "18.3.20", "@types/react-dom": "18.3.6", - "react": "18.2.0", - "react-dom": "18.2.0" + "react": "18.3.1", + "react-dom": "18.3.1" }, "overrides": { "@jupyterlab/services": "^7.0.0", "@types/react": "18.3.20", "@types/react-dom": "18.3.6", - "react": "18.2.0", - "react-dom": "18.2.0" + "react": "18.3.1", + "react-dom": "18.3.1" } } diff --git a/packages/docusaurus-plugin/package.json b/packages/docusaurus-plugin/package.json index df06f987..9788634d 100644 --- a/packages/docusaurus-plugin/package.json +++ b/packages/docusaurus-plugin/package.json @@ -51,7 +51,7 @@ "webpack": "^5.74.0" }, "peerDependencies": { - "react": "18.2.0", - "react-dom": "18.2.0" + "react": "18.3.1", + "react-dom": "18.3.1" } } diff --git a/packages/lexical/package.json b/packages/lexical/package.json index 7278f0d2..ee4947db 100644 --- a/packages/lexical/package.json +++ b/packages/lexical/package.json @@ -81,8 +81,8 @@ "katex": "^0.16.21", "lexical": "^0.30.0", "lodash-es": "^4.17.21", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "react-json-tree": "^0.19.0", "styled-components": "^5.3.10", "yjs": "^13.6.24" diff --git a/packages/react/package.json b/packages/react/package.json index 5259c673..7883b9b4 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -147,8 +147,8 @@ "lodash": "^4.17.4", "marked": "^4.0.10", "plotly.js": "^2.35.2", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "react-error-boundary": "^3.1.3", "react-inspector": "^6.0.2", "react-sparklines": "^1.7.0", diff --git a/packages/vscode/package.json b/packages/vscode/package.json index 4357b829..8b83f81b 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -59,8 +59,8 @@ "@jupyterlab/services": "^7.0.0", "@lumino/coreutils": "^2.1.1", "@primer/react": "^37.19.0", - "react": "18.2.0", - "react-dom": "18.2.0", + "react": "18.3.1", + "react-dom": "18.3.1", "typestyle": "^2.0.4", "ws": "^8.18.1" }, diff --git a/storybook/package.json b/storybook/package.json index ee4d391c..df8a8299 100644 --- a/storybook/package.json +++ b/storybook/package.json @@ -28,8 +28,8 @@ "dependencies": { "@datalayer/jupyter-lexical": "^1.0.0", "@datalayer/jupyter-react": "^1.0.0", - "react": "18.2.0", - "react-dom": "18.2.0" + "react": "18.3.1", + "react-dom": "18.3.1" }, "devDependencies": { "@babel/core": "^7.21.0", From a0d0af8cfe41a7627e03a6be35068ddb4b275562 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Wed, 16 Apr 2025 17:04:18 +0200 Subject: [PATCH 14/19] deps --- package.json | 27 ++++++++++++++++--- packages/react/package.json | 8 +++--- .../jupyterlab/JupyterLabAppAdapter.ts | 12 +++------ .../src/components/kernel/Kernelndicator.tsx | 15 ++++++----- packages/react/src/examples/CellLite.tsx | 4 +-- packages/react/src/examples/Notebook2.tsx | 11 +++----- packages/react/src/examples/NotebookLite.tsx | 7 +---- .../collaboration/JupyterCollaboration.ts | 6 +---- packages/react/src/jupyter/lite/LiteServer.ts | 12 ++------- packages/react/src/theme/JupyterLabCss.tsx | 19 ++++++++++--- packages/react/webpack.config.js | 3 ++- 11 files changed, 68 insertions(+), 56 deletions(-) diff --git a/package.json b/package.json index d491250b..cc61ecd1 100644 --- a/package.json +++ b/package.json @@ -74,18 +74,39 @@ "vercel": "^21.3.3" }, "resolutions": { + "@atlassiansox/analytics-web-client": "npm:empty-npm-package@1.0.0", + "@microsoft/fast-colors": "5.3.1", + "@microsoft/fast-components": "2.30.6", + "@microsoft/fast-element": "1.13.0", + "@microsoft/fast-foundation": "2.49.6", + "@microsoft/fast-react-wrapper": "0.3.24", + "@microsoft/fast-web-utilities": "5.4.1", + "@microsoft/load-themed-styles": "1.10.295", "@jupyterlab/services": "^7.0.0", - "@primer/react": "^37.19.0", "@types/react": "18.3.20", "@types/react-dom": "18.3.6", + "crypto": "npm:empty-npm-package@1.0.0", + "pyodide": "^0.27.5", "react": "18.3.1", - "react-dom": "18.3.1" + "react-dom": "18.3.1", + "typescript": "^5.8.3" }, "overrides": { + "@atlassiansox/analytics-web-client": "npm:empty-npm-package@1.0.0", + "@microsoft/fast-colors": "5.3.1", + "@microsoft/fast-components": "2.30.6", + "@microsoft/fast-element": "1.13.0", + "@microsoft/fast-foundation": "2.49.6", + "@microsoft/fast-react-wrapper": "0.3.24", + "@microsoft/fast-web-utilities": "5.4.1", + "@microsoft/load-themed-styles": "1.10.295", "@jupyterlab/services": "^7.0.0", "@types/react": "18.3.20", "@types/react-dom": "18.3.6", + "crypto": "npm:empty-npm-package@1.0.0", + "pyodide": "^0.27.5", "react": "18.3.1", - "react-dom": "18.3.1" + "react-dom": "18.3.1", + "typescript": "^5.8.3" } } diff --git a/packages/react/package.json b/packages/react/package.json index 7883b9b4..66a3e689 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -131,10 +131,10 @@ "@jupyterlab/ui-components-extension": "^4.0.0", "@jupyterlite/licenses": "^0.5.1", "@jupyterlite/localforage": "^0.5.1", - "@jupyterlite/pyodide-kernel": "^0.5.0", - "@jupyterlite/pyodide-kernel-extension": "^0.5.0", - "@jupyterlite/server": "^0.5.0", - "@jupyterlite/server-extension": "^0.5.0", + "@jupyterlite/pyodide-kernel": "^0.5.1", + "@jupyterlite/pyodide-kernel-extension": "^0.5.1", + "@jupyterlite/server": "^0.5.1", + "@jupyterlite/server-extension": "^0.5.1", "@jupyterlite/session": "^0.5.1", "@jupyterlite/settings": "^0.5.1", "@jupyterlite/translation": "^0.5.1", diff --git a/packages/react/src/components/jupyterlab/JupyterLabAppAdapter.ts b/packages/react/src/components/jupyterlab/JupyterLabAppAdapter.ts index 75a3d3c1..4b9508da 100644 --- a/packages/react/src/components/jupyterlab/JupyterLabAppAdapter.ts +++ b/packages/react/src/components/jupyterlab/JupyterLabAppAdapter.ts @@ -100,10 +100,7 @@ export class JupyterLabAppAdapter { }); this._jupyterLab.registerPluginModules(extensions); if (nosplash) { - this._jupyterLab.deregisterPlugin( - '@jupyterlab/apputils-extension:splash', - true - ); + this._jupyterLab.deregisterPlugin('@jupyterlab/apputils-extension:splash', true); } /* if (collaborative) { @@ -112,10 +109,9 @@ export class JupyterLabAppAdapter { */ this._jupyterLab.start({ hostID: hostId, - startPlugins: [ - ], // How is this used in JupyterLab core? - ignorePlugins: [ - ], // How is this used in JupyterLab core? + bubblingKeydown: true, + startPlugins: [], // How is this used in JupyterLab core? + ignorePlugins: [], // How is this used in JupyterLab core? }).then(() => { // this._plugins = (this._jupyterLab as any)['_plugins']; // this._readyResolve(); diff --git a/packages/react/src/components/kernel/Kernelndicator.tsx b/packages/react/src/components/kernel/Kernelndicator.tsx index 3972f7d0..6c73dd1a 100644 --- a/packages/react/src/components/kernel/Kernelndicator.tsx +++ b/packages/react/src/components/kernel/Kernelndicator.tsx @@ -5,7 +5,7 @@ */ import { useState, useEffect, ReactElement } from 'react'; -import { Tooltip } from '@primer/react'; +import { Button, Tooltip } from '@primer/react'; import { CircleBlackIcon, CircleBrownIcon, @@ -69,10 +69,7 @@ export const KERNEL_STATES: Map = new Map([ ['undefined', ], ]); -export const toKernelState = ( - connectionStatus: ConnectionStatus, - status: KernelMessage.Status -): ExecutionState => { +export const toKernelState = (connectionStatus: ConnectionStatus, status: KernelMessage.Status): ExecutionState => { if ( connectionStatus === 'connecting' || connectionStatus === 'disconnected' @@ -107,11 +104,15 @@ export const KernelIndicator = (props: KernelIndicatorProps) => { }, [kernel]); return connectionStatus && status ? ( - {KERNEL_STATES.get(toKernelState(connectionStatus, status))} + ) : ( - {KERNEL_STATES.get('undefined')} + ); }; diff --git a/packages/react/src/examples/CellLite.tsx b/packages/react/src/examples/CellLite.tsx index 4260dee8..c4e4871d 100644 --- a/packages/react/src/examples/CellLite.tsx +++ b/packages/react/src/examples/CellLite.tsx @@ -6,8 +6,8 @@ import { createRoot } from 'react-dom/client'; import { Box } from '@primer/react'; -import { Jupyter } from '../jupyter/Jupyter'; -import Cell from '../components/cell/Cell'; +import { Jupyter } from '../jupyter'; +import { Cell } from '../components/cell/Cell'; const div = document.createElement('div'); document.body.appendChild(div); diff --git a/packages/react/src/examples/Notebook2.tsx b/packages/react/src/examples/Notebook2.tsx index 2408a103..a664470a 100644 --- a/packages/react/src/examples/Notebook2.tsx +++ b/packages/react/src/examples/Notebook2.tsx @@ -4,17 +4,12 @@ * MIT License */ -/* - * Copyright (c) 2021-2024 Datalayer, Inc. - * - * MIT License - */ import { createRoot } from 'react-dom/client'; import { INotebookContent } from '@jupyterlab/nbformat'; import { JupyterReactTheme } from '../theme/JupyterReactTheme'; -import { Notebook2 } from '../components/notebook/Notebook2'; -import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar'; import { useJupyter } from '../jupyter'; +import { NotebookToolbar } from './../components/notebook/toolbar/NotebookToolbar'; +import { Notebook2 } from '../components/notebook/Notebook2'; import nbformat from './notebooks/NotebookExample1.ipynb.json'; @@ -30,12 +25,14 @@ const Notebook = () => { height="calc(100vh - 2.6rem)" // (Height - Toolbar Height). cellSidebarMargin={120} Toolbar={NotebookToolbar} + /* collaborationServer={{ baseURL: 'https://prod1.datalayer.run', token: '', roomName: '', type: 'datalayer' }} + */ serviceManager={serviceManager} /> diff --git a/packages/react/src/examples/NotebookLite.tsx b/packages/react/src/examples/NotebookLite.tsx index 8cb41cb0..63b543c9 100644 --- a/packages/react/src/examples/NotebookLite.tsx +++ b/packages/react/src/examples/NotebookLite.tsx @@ -19,15 +19,10 @@ import nbformat from './notebooks/Lite.ipynb.json'; const NotebookLite = () => { const [session, setSession] = useState(); const extensions = useMemo(() => [new CellSidebarExtension()], []); - const onSessionConnection: OnSessionConnection = ( session: Session.ISessionConnection | undefined ) => { - console.log( - 'Received a Kernel Session.', - session?.id, - session?.kernel?.clientId - ); + console.log('Received a Kernel Session.', session?.id, session?.kernel?.clientId); setSession(session); }; return ( diff --git a/packages/react/src/jupyter/collaboration/JupyterCollaboration.ts b/packages/react/src/jupyter/collaboration/JupyterCollaboration.ts index a8df53ae..61afcf4d 100644 --- a/packages/react/src/jupyter/collaboration/JupyterCollaboration.ts +++ b/packages/react/src/jupyter/collaboration/JupyterCollaboration.ts @@ -40,11 +40,7 @@ export async function requestDocSession( serverSettings?: ServerConnection.ISettings ): Promise { const settings = serverSettings ?? ServerConnection.makeSettings(); - const url = URLExt.join( - settings.baseUrl, - COLLABORATION_SESSION_URL_PATH, - encodeURIComponent(path) - ); + const url = URLExt.join(settings.baseUrl, COLLABORATION_SESSION_URL_PATH, encodeURIComponent(path)); const body = { method: 'PUT', body: JSON.stringify({ format, type }), diff --git a/packages/react/src/jupyter/lite/LiteServer.ts b/packages/react/src/jupyter/lite/LiteServer.ts index bc0f5c08..c097c4d3 100644 --- a/packages/react/src/jupyter/lite/LiteServer.ts +++ b/packages/react/src/jupyter/lite/LiteServer.ts @@ -4,18 +4,13 @@ * MIT License */ -import { - JupyterLiteServer, - JupyterLiteServerPlugin, -} from '@jupyterlite/server'; +import { JupyterLiteServer, JupyterLiteServerPlugin } from '@jupyterlite/server'; import { PageConfig } from '@jupyterlab/coreutils'; /** * Iterate over active plugins in an extension. */ -function* activePlugins( - extension: any -): Generator> { +function* activePlugins(extension: any): Generator> { // Handle commonjs or es2015 modules. let exports; // eslint-disable-next-line no-prototype-builtins @@ -48,18 +43,15 @@ function* activePlugins( */ export async function createLiteServer(): Promise { const litePluginsToRegister: any[] = []; - // Load the base serverlite extensions. const baseServerExtension = await import('@jupyterlite/server-extension'); for (const plugin of activePlugins(baseServerExtension)) { litePluginsToRegister.push(plugin); } - // Create the in-browser JupyterLite Server. const jupyterLiteServer = new JupyterLiteServer({} as any); jupyterLiteServer.registerPluginModules(litePluginsToRegister); // Start the server. await jupyterLiteServer.start(); - return jupyterLiteServer; } diff --git a/packages/react/src/theme/JupyterLabCss.tsx b/packages/react/src/theme/JupyterLabCss.tsx index b18df1fa..e3eb4449 100644 --- a/packages/react/src/theme/JupyterLabCss.tsx +++ b/packages/react/src/theme/JupyterLabCss.tsx @@ -5,6 +5,7 @@ */ import { useEffect } from 'react'; +import { createGlobalStyle } from 'styled-components'; import { Colormode } from './JupyterLabColormode'; import "@primer/primitives/dist/css/base/typography/typography.css"; @@ -19,6 +20,14 @@ import "@primer/primitives/dist/css/functional/typography/typography.css"; const DATASET_LAB_THEME = 'data-lab-theme'; +const GlobalStyle = createGlobalStyle` + .jp-ThemedContainer button { + --button-primary-bgColor-active: var(--jp-brand-color0, #0d47a1) !important; + --button-primary-bgColor-hover: var(--jp-brand-color0, #0d47a1) !important; + --button-primary-bgColor-rest: var(--jp-brand-color1, #1976d2) !important; + } +` + type JupyterLabCssProps = { colormode?: Colormode; }; @@ -75,7 +84,7 @@ export function JupyterLabCss(props: JupyterLabCssProps): JSX.Element { } } - // Inject the JupyterLab theme stylesheet in a retrievable node + // Inject the JupyterLab theme stylesheet in a retrievable node. // ! webpack should be configured to load the theme style sheets with css-loader as string - this is available in css-loader v6.3.0 or later: // { test: /style\/theme\.css$/i, loader: 'css-loader', options: {exportType: 'string'} } theme?.then(module => { @@ -89,7 +98,11 @@ ${module.default} } }); }, [colormode]); - return
; -}; + return ( +
+ +
+ ) +} export default JupyterLabCss; diff --git a/packages/react/webpack.config.js b/packages/react/webpack.config.js index ee9bac63..d24609de 100644 --- a/packages/react/webpack.config.js +++ b/packages/react/webpack.config.js @@ -45,6 +45,7 @@ const ENTRY = // './src/examples/Lumino'; // './src/examples/Matplotlib'; // './src/examples/Notebook'; + './src/examples/Notebook2'; // './src/examples/NotebookCellSidebar'; // './src/examples/NotebookCellToolbar'; // './src/examples/NotebookColormode'; @@ -68,7 +69,7 @@ const ENTRY = // './src/examples/NotebookSimple'; // './src/examples/NotebookSkeleton'; // './src/examples/NotebookTheme'; - './src/examples/NotebookThemeColormode'; + // './src/examples/NotebookThemeColormode'; // './src/examples/NotebookURL'; // './src/examples/NotebookURL'; // './src/examples/ObservableHQ'; From 9240eb396d6f6b0bc9d5c95b892da5c6eb8fa1ac Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Thu, 17 Apr 2025 06:35:10 +0200 Subject: [PATCH 15/19] bump: version --- attic/prosemirror/package.json | 2 +- attic/slate/package.json | 2 +- examples/cra/package.json | 2 +- examples/next-js/package.json | 2 +- packages/docusaurus-plugin/package.json | 2 +- packages/lexical/package.json | 4 ++-- packages/react/package.json | 2 +- packages/vscode/package.json | 2 +- storybook/package.json | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/attic/prosemirror/package.json b/attic/prosemirror/package.json index 8c27cb24..f2c07f58 100644 --- a/attic/prosemirror/package.json +++ b/attic/prosemirror/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@codemirror/lang-python": "^6.0.1", - "@datalayer/jupyter-react": "^1.0.0", + "@datalayer/jupyter-react": "^1.0.1", "@prosemirror-adapter/react": "^0.2.4", "@types/orderedmap": "^1.0.0", "codemirror": "^6.0.1", diff --git a/attic/slate/package.json b/attic/slate/package.json index b5467c11..9d7a5478 100644 --- a/attic/slate/package.json +++ b/attic/slate/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^1.0.0", + "@datalayer/jupyter-react": "^1.0.1", "@datalayer/primer-addons": "^1.0.0", "@emotion/css": "^11.1.3", "@emotion/react": "^11.10.6", diff --git a/examples/cra/package.json b/examples/cra/package.json index 5a45506e..4fa25407 100644 --- a/examples/cra/package.json +++ b/examples/cra/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^1.0.0", + "@datalayer/jupyter-react": "^1.0.1", "@datalayer/primer-addons": "^1.0.0", "jupyterlab-plotly": "^5.17.0", "plotly.js": "^2.26.2", diff --git a/examples/next-js/package.json b/examples/next-js/package.json index c8eef917..5dc777be 100644 --- a/examples/next-js/package.json +++ b/examples/next-js/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^1.0.0", + "@datalayer/jupyter-react": "^1.0.1", "@datalayer/primer-addons": "^1.0.0", "autoprefixer": "^10.4.14", "eslint": "^9.0.0", diff --git a/packages/docusaurus-plugin/package.json b/packages/docusaurus-plugin/package.json index 9788634d..c890ba20 100644 --- a/packages/docusaurus-plugin/package.json +++ b/packages/docusaurus-plugin/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^1.0.0", + "@datalayer/jupyter-react": "^1.0.1", "@datalayer/primer-addons": "^1.0.0", "@docusaurus/core": "^3.5.2", "@docusaurus/types": "^3.5.2" diff --git a/packages/lexical/package.json b/packages/lexical/package.json index ee4947db..a6c0246e 100644 --- a/packages/lexical/package.json +++ b/packages/lexical/package.json @@ -1,6 +1,6 @@ { "name": "@datalayer/jupyter-lexical", - "version": "1.0.0", + "version": "1.0.1", "description": "Jupyter UI for Lexical", "license": "MIT", "main": "lib/index.js", @@ -63,7 +63,7 @@ }, "dependencies": { "@datalayer/icons-react": "^1.0.0", - "@datalayer/jupyter-react": "^1.0.0", + "@datalayer/jupyter-react": "^1.0.1", "@datalayer/primer-addons": "^1.0.0", "@jupyterlab/application": "^4.0.0", "@jupyterlab/coreutils": "^6.0.0", diff --git a/packages/react/package.json b/packages/react/package.json index 66a3e689..857300cd 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@datalayer/jupyter-react", - "version": "1.0.0", + "version": "1.0.1", "description": "Jupyter React - React.js components 100% compatible with Jupyter.", "license": "MIT", "main": "lib/index.js", diff --git a/packages/vscode/package.json b/packages/vscode/package.json index 8b83f81b..15fe9d52 100644 --- a/packages/vscode/package.json +++ b/packages/vscode/package.json @@ -55,7 +55,7 @@ "vsix": "npx @vscode/vsce package --no-yarn --no-dependencies" }, "dependencies": { - "@datalayer/jupyter-react": "^1.0.0", + "@datalayer/jupyter-react": "^1.0.1", "@jupyterlab/services": "^7.0.0", "@lumino/coreutils": "^2.1.1", "@primer/react": "^37.19.0", diff --git a/storybook/package.json b/storybook/package.json index df8a8299..b283180d 100644 --- a/storybook/package.json +++ b/storybook/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "@datalayer/jupyter-lexical": "^1.0.0", - "@datalayer/jupyter-react": "^1.0.0", + "@datalayer/jupyter-react": "^1.0.1", "react": "18.3.1", "react-dom": "18.3.1" }, From ff12911f66bd78c88705110d5a7bc09c1bd1fb32 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Thu, 24 Apr 2025 14:25:51 +0200 Subject: [PATCH 16/19] lint --- .../notebook/cell/sidebar/CellSidebarButton.tsx | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/react/src/components/notebook/cell/sidebar/CellSidebarButton.tsx b/packages/react/src/components/notebook/cell/sidebar/CellSidebarButton.tsx index 33bbd1fa..bb79e641 100644 --- a/packages/react/src/components/notebook/cell/sidebar/CellSidebarButton.tsx +++ b/packages/react/src/components/notebook/cell/sidebar/CellSidebarButton.tsx @@ -4,19 +4,10 @@ * MIT License */ -import { - ChevronDownIcon, - ChevronUpIcon, - PlayIcon, - SquareIcon, - XIcon, -} from '@primer/octicons-react'; +import { ChevronDownIcon, ChevronUpIcon, PlayIcon, SquareIcon, XIcon } from '@primer/octicons-react'; import { Box, IconButton } from '@primer/react'; import { NotebookCommandIds } from '../../NotebookCommands'; -import { - DATALAYER_CELL_SIDEBAR_CLASS_NAME, - ICellSidebarProps, -} from './CellSidebar'; +import { DATALAYER_CELL_SIDEBAR_CLASS_NAME, ICellSidebarProps } from './CellSidebar'; export function CellSidebarButton(props: ICellSidebarProps): JSX.Element { const { commands, model } = props; From ec01bd017899fa7d7d05aa18094c0be7a3a8adee Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Thu, 8 May 2025 12:05:16 +0200 Subject: [PATCH 17/19] fix: config --- .../notebook/cell/sidebar/CellSidebarButton.tsx | 4 ++++ .../cellsidebars/CellSidebarSource.tsx | 17 +++-------------- packages/react/src/jupyter/JupyterConfig.ts | 16 ++++++++++------ 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/packages/react/src/components/notebook/cell/sidebar/CellSidebarButton.tsx b/packages/react/src/components/notebook/cell/sidebar/CellSidebarButton.tsx index bb79e641..280ec942 100644 --- a/packages/react/src/components/notebook/cell/sidebar/CellSidebarButton.tsx +++ b/packages/react/src/components/notebook/cell/sidebar/CellSidebarButton.tsx @@ -15,6 +15,10 @@ export function CellSidebarButton(props: ICellSidebarProps): JSX.Element { { const { commands, model, nbgrader } = props; diff --git a/packages/react/src/jupyter/JupyterConfig.ts b/packages/react/src/jupyter/JupyterConfig.ts index 85f51a9e..3bdd6241 100644 --- a/packages/react/src/jupyter/JupyterConfig.ts +++ b/packages/react/src/jupyter/JupyterConfig.ts @@ -131,6 +131,15 @@ export const loadJupyterConfig = ( insideJupyterLab: false, insideJupyterHub: false, } + // JupyterLab + const jupyterConfigData = document.getElementById('jupyter-config-data'); + let jupyterConfig = undefined; + if (jupyterConfigData) { + jupyterConfig = JSON.parse(jupyterConfigData.textContent || ''); + config.insideJupyterLab = jupyterConfig.appName === 'JupyterLab'; + } + // Hub related information ('hubHost' 'hubPrefix' 'hubUser' ,'hubServerName'). + config.insideJupyterHub = PageConfig.getOption('hubHost') !== ''; // Load the Datalayer config. loadDatalayerConfig(); if (datalayerConfigLoaded) { @@ -139,9 +148,7 @@ export const loadJupyterConfig = ( setJupyterServerToken(jupyterServerToken || config.jupyterServerToken); } else { // No Datalayer config, look for a Jupyter config... - const jupyterConfigData = document.getElementById('jupyter-config-data'); - if (jupyterConfigData) { - const jupyterConfig = JSON.parse(jupyterConfigData.textContent || ''); + if (jupyterConfig) { setJupyterServerUrl( jupyterServerUrl ?? jupyterConfig.jupyterServerUrl ?? @@ -152,9 +159,6 @@ export const loadJupyterConfig = ( jupyterConfig.token ?? '' ); - config.insideJupyterLab = jupyterConfig.appName === 'JupyterLab'; - // Hub related information ('hubHost' 'hubPrefix' 'hubUser' ,'hubServerName'). - config.insideJupyterHub = PageConfig.getOption('hubHost') !== ''; } else { // No Datalayer and no Jupyter config, rely on location... setJupyterServerUrl( From bec408e1710763d01d127f7ba138e30c436be5f6 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Fri, 16 May 2025 17:57:44 +0200 Subject: [PATCH 18/19] lint --- .../jupyterlab/JupyterLabAppAdapter.ts | 2 +- .../src/components/notebook/Notebook2.tsx | 5 +- .../src/components/notebook/NotebookBase.tsx | 61 +++++-------------- .../components/notebook/NotebookCommands.ts | 4 +- 4 files changed, 21 insertions(+), 51 deletions(-) diff --git a/packages/react/src/components/jupyterlab/JupyterLabAppAdapter.ts b/packages/react/src/components/jupyterlab/JupyterLabAppAdapter.ts index 4b9508da..03f4f10d 100644 --- a/packages/react/src/components/jupyterlab/JupyterLabAppAdapter.ts +++ b/packages/react/src/components/jupyterlab/JupyterLabAppAdapter.ts @@ -109,7 +109,7 @@ export class JupyterLabAppAdapter { */ this._jupyterLab.start({ hostID: hostId, - bubblingKeydown: true, + bubblingKeydown: true, // TODO Check this prop. startPlugins: [], // How is this used in JupyterLab core? ignorePlugins: [], // How is this used in JupyterLab core? }).then(() => { diff --git a/packages/react/src/components/notebook/Notebook2.tsx b/packages/react/src/components/notebook/Notebook2.tsx index 1449c407..ccda524e 100644 --- a/packages/react/src/components/notebook/Notebook2.tsx +++ b/packages/react/src/components/notebook/Notebook2.tsx @@ -150,7 +150,6 @@ export function Notebook2(props: React.PropsWithChildren): JSX. if (model) { setIsLoading(false); } - onNotebookModelChanged?.(model); }, [model, onNotebookModelChanged]); @@ -229,7 +228,7 @@ export function Notebook2(props: React.PropsWithChildren): JSX. }} > {children} - {model && serviceManager && ( + {model && serviceManager && ): JSX. serviceManager={serviceManager} onSessionConnectionChanged={onSessionConnection} /> - )} + } ); diff --git a/packages/react/src/components/notebook/NotebookBase.tsx b/packages/react/src/components/notebook/NotebookBase.tsx index 0f0a2f6e..2f557329 100644 --- a/packages/react/src/components/notebook/NotebookBase.tsx +++ b/packages/react/src/components/notebook/NotebookBase.tsx @@ -115,32 +115,16 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { } = props; const [isLoading, setIsLoading] = useState(true); - const [extensionComponents, setExtensionComponents] = useState( - new Array() - ); + const [extensionComponents, setExtensionComponents] = useState(new Array()); + const [completer, setCompleter] = useState(null); const id = useMemo(() => props.id || newUuid(), [props.id]); - const path = useMemo( - () => props.path || FALLBACK_NOTEBOOK_PATH, - [props.path] - ); - // Features - const features = useMemo( - () => new CommonFeatures({ commands, renderers }), - [commands, renderers] - ); - - // Content factory - const contentFactory = useMemo( - () => - new NotebookPanel.ContentFactory({ - editorFactory: features.editorServices.factoryService.newInlineEditor, - }), - [features.editorServices.factoryService.newInlineEditor] - ); + const path = useMemo(() => props.path || FALLBACK_NOTEBOOK_PATH, [props.path]); + const features = useMemo(() => new CommonFeatures({ commands, renderers }), [commands, renderers]); + const contentFactory = useMemo(() => new NotebookPanel.ContentFactory( + {editorFactory: features.editorServices.factoryService.newInlineEditor} + ),[features.editorServices.factoryService.newInlineEditor]); - // Completer - const [completer, setCompleter] = useState(null); useEffect(() => { const completer = new Completer({ model: new CompleterModel() }); // Dummy widget to initialize @@ -155,9 +139,7 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { const handler = new CompletionHandler({ completer, reconciliator }); completer.hide(); Widget.attach(completer, document.body); - setCompleter(handler); - return () => { handler.dispose(); completer.dispose(); @@ -165,7 +147,7 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { }; }, []); - // Widget factory + // Widget factory. const [widgetFactory, setWidgetFactory] = useState(null); useEffect(() => { @@ -194,22 +176,20 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { }; }, [contentFactory, features]); - // Tracker & commands + // Tracker & commands. const [tracker, setTracker] = useState(null); useEffect(() => { - const thisTracker = completer - ? new NotebookTracker({ namespace: id }) - : null; - const commands = completer - ? addNotebookCommands( + const thisTracker = completer ? new NotebookTracker({ namespace: id }) : null; + const commands = completer ? + addNotebookCommands( features.commands, completer, thisTracker!, - props.path + props.path, ) - : null; + : + null; setTracker(thisTracker); - return () => { commands?.dispose(); thisTracker?.dispose(); @@ -232,7 +212,6 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { shutdownOnDispose: false, }, }); - initializeContext( thisContext, id, @@ -241,9 +220,7 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { onSessionConnectionChanged, !serviceManager ); - setContext(thisContext); - return () => { thisContext.dispose(); factory.dispose(); @@ -262,7 +239,6 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { // Notebook const [panel, setPanel] = useState(null); - useEffect(() => { let thisPanel: NotebookPanel | null = null; let widgetsManager: WidgetManager | null = null; @@ -311,7 +287,6 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { setIsLoading(false); } } - setPanel(thisPanel); if (!thisPanel) { setExtensionComponents([]); @@ -331,6 +306,7 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { } setPanel(panel => (panel === thisPanel ? null : panel)); }; + }, [context, extensions, features.commands, widgetFactory]); useEffect(() => { @@ -359,7 +335,6 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { if (completer) { // Setup the completer here as it requires the panel - onActiveCellChanged = ( notebook: Notebook, cell: Cell | null @@ -370,7 +345,6 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { }); } }; - onSessionChanged = ( _: ISessionContext, changes: IChangedArgs< @@ -396,7 +370,6 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { completer.editor = editor; completer.reconciliator = reconciliator; }; - panel.context.sessionContext.sessionChanged.connect(onSessionChanged); panel.context.sessionContext.ready.then(() => { onSessionChanged?.(panel.context.sessionContext, { @@ -437,12 +410,10 @@ export function BaseNotebook(props: IBaseNotebookProps): JSX.Element { const onKeyDown = (event: any) => { features.commands.processKeydownEvent(event); }; - // FIXME It would be better to add the listener to the Box wrapping the panel // but this requires the use of the latest version of JupyterLab/Lumino that // capture event at bubbling phase for keyboard shortcuts rather than at capture phase. document.addEventListener('keydown', onKeyDown, true); - return () => { document.removeEventListener('keydown', onKeyDown, true); }; diff --git a/packages/react/src/components/notebook/NotebookCommands.ts b/packages/react/src/components/notebook/NotebookCommands.ts index d1fa6a99..abac4fcc 100644 --- a/packages/react/src/components/notebook/NotebookCommands.ts +++ b/packages/react/src/components/notebook/NotebookCommands.ts @@ -7,11 +7,11 @@ import { ReadonlyPartialJSONObject } from '@lumino/coreutils'; import { CommandRegistry } from '@lumino/commands'; import { DisposableSet } from '@lumino/disposable'; +import { Widget } from '@lumino/widgets'; import { SessionContextDialogs } from '@jupyterlab/apputils'; import { CompletionHandler } from '@jupyterlab/completer'; -import { NotebookActions, NotebookPanel, NotebookSearchProvider, NotebookTracker, } from '@jupyterlab/notebook'; import { SearchDocumentModel, SearchDocumentView } from '@jupyterlab/documentsearch'; -import { Widget } from '@lumino/widgets'; +import { NotebookActions, NotebookPanel, NotebookSearchProvider, NotebookTracker, } from '@jupyterlab/notebook'; import { nullTranslator } from '@jupyterlab/translation'; import { IYText } from '@jupyter/ydoc'; From 732f6dfd3c98a6914b87a2ada072f1716d6ea69d Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Tue, 20 May 2025 08:32:57 +0200 Subject: [PATCH 19/19] fix: build --- packages/lexical/pyproject.toml | 2 +- packages/react/pyproject.toml | 2 +- .../src/components/notebook/Notebook.tsx | 2 +- .../src/components/notebook/NotebookState.ts | 1 + .../examples/extensions/toc/TocExtension.tsx | 50 ++++++++----------- packages/react/webpack.config.js | 5 +- 6 files changed, 28 insertions(+), 34 deletions(-) diff --git a/packages/lexical/pyproject.toml b/packages/lexical/pyproject.toml index 0f7419bc..0e47a282 100644 --- a/packages/lexical/pyproject.toml +++ b/packages/lexical/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ - "datalayer_core>=1.0.0", + "datalayer_core", "jupyter_server>=2.10,<3", ] dynamic = ["version"] diff --git a/packages/react/pyproject.toml b/packages/react/pyproject.toml index 8502b5e2..20bf298a 100644 --- a/packages/react/pyproject.toml +++ b/packages/react/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ ] dependencies = [ - "datalayer_core>=1.0.0", + "datalayer_core", "jupyter_server>=2.10,<3", ] dynamic = ["version"] diff --git a/packages/react/src/components/notebook/Notebook.tsx b/packages/react/src/components/notebook/Notebook.tsx index 665404e7..7311fe88 100644 --- a/packages/react/src/components/notebook/Notebook.tsx +++ b/packages/react/src/components/notebook/Notebook.tsx @@ -44,7 +44,7 @@ export type IDatalayerNotebookExtensionProps = { notebookId: string; commands: CommandRegistry; panel: NotebookPanel; - adapter: NotebookAdapter; + adapter?: NotebookAdapter; }; export type DatalayerNotebookExtension = DocumentRegistry.IWidgetExtension< diff --git a/packages/react/src/components/notebook/NotebookState.ts b/packages/react/src/components/notebook/NotebookState.ts index 6439cf57..310e6fdd 100644 --- a/packages/react/src/components/notebook/NotebookState.ts +++ b/packages/react/src/components/notebook/NotebookState.ts @@ -228,6 +228,7 @@ export const notebookStore = createStore((set, get) => ({ }, changeNotebook: (notebookChangeId: NotebookChangeId) => { const notebooks = get().notebooks; + const notebook = notebooks.get(notebookChangeId.id); if (notebook) { notebook.notebookChange = notebookChangeId.notebookChange; set((state: NotebookState) => ({ notebooks })); diff --git a/packages/react/src/examples/extensions/toc/TocExtension.tsx b/packages/react/src/examples/extensions/toc/TocExtension.tsx index 41ec3e29..3a2d3e94 100644 --- a/packages/react/src/examples/extensions/toc/TocExtension.tsx +++ b/packages/react/src/examples/extensions/toc/TocExtension.tsx @@ -5,19 +5,27 @@ */ import { NotebookPanel, NotebookToCFactory } from '@jupyterlab/notebook'; -import { - DatalayerNotebookExtension, - IDatalayerNotebookExtensionProps, - notebookStore, -} from '../../../components'; -import { - TableOfContents, - TableOfContentsRegistry, - TableOfContentsTracker, -} from '@jupyterlab/toc'; +import { TableOfContents, TableOfContentsRegistry, TableOfContentsTracker } from '@jupyterlab/toc'; import { BoxPanel } from '@lumino/widgets'; +import { DatalayerNotebookExtension, IDatalayerNotebookExtensionProps, notebookStore } from '../../../components'; import { JupyterLayoutFactory } from './JupyterLayoutFactory'; +/** + * A factory to layout ToC Panel + */ +export interface TocLayoutFactory { + /** layout ToC Panel */ + layout( + boxPanel: BoxPanel, + notebookPanel: NotebookPanel, + notebookId: string + ): JSX.Element | null; + /** set model to ToC Panel */ + setModel(model: TableOfContents.Model): void; + /** dispose ToC Panel */ + dispose(): void; +} + export interface TocExtensionOptions { /** layout factory */ factory?: TocLayoutFactory; @@ -46,8 +54,8 @@ export class TocExtension implements DatalayerNotebookExtension { this._notebookPanel = notebookPanel; const adapter = this._props.adapter; // create factory - const tracker = adapter['_tracker']; - const rendermime = adapter['_rendermime']; + const tracker = adapter!['_tracker']; + const rendermime = adapter!['_rendermime']; const nbTocFactory = new NotebookToCFactory( tracker!, rendermime!.markdownParser, @@ -85,7 +93,7 @@ export class TocExtension implements DatalayerNotebookExtension { get component(): JSX.Element | null { return this._layoutFactory.layout( - this._props.adapter.panel, + this._props.adapter!.panel, this._notebookPanel, this._props.notebookId ); @@ -93,19 +101,3 @@ export class TocExtension implements DatalayerNotebookExtension { } export default TocExtension; - -/** - * A factory to layout ToC Panel - */ -export interface TocLayoutFactory { - /** layout ToC Panel */ - layout( - boxPanel: BoxPanel, - notebookPanel: NotebookPanel, - notebookId: string - ): JSX.Element | null; - /** set model to ToC Panel */ - setModel(model: TableOfContents.Model): void; - /** dispose ToC Panel */ - dispose(): void; -} diff --git a/packages/react/webpack.config.js b/packages/react/webpack.config.js index d24609de..ce42df7e 100644 --- a/packages/react/webpack.config.js +++ b/packages/react/webpack.config.js @@ -44,8 +44,8 @@ const ENTRY = // './src/examples/Kernels'; // './src/examples/Lumino'; // './src/examples/Matplotlib'; - // './src/examples/Notebook'; - './src/examples/Notebook2'; + './src/examples/Notebook'; + // './src/examples/Notebook2'; // './src/examples/NotebookCellSidebar'; // './src/examples/NotebookCellToolbar'; // './src/examples/NotebookColormode'; @@ -70,6 +70,7 @@ const ENTRY = // './src/examples/NotebookSkeleton'; // './src/examples/NotebookTheme'; // './src/examples/NotebookThemeColormode'; + // './src/examples/NotebookToc'; // './src/examples/NotebookURL'; // './src/examples/NotebookURL'; // './src/examples/ObservableHQ';