Skip to content

Commit 523f129

Browse files
committed
fix: codemirroreditor
1 parent cc24ccf commit 523f129

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ node_modules/
4040
# Version file is handled by hatchling
4141
**/jupyter_react/_version.py
4242

43+
**/jupyter_react/static
44+
4345
# Integration tests
4446
test-results/
4547
playwright-report/
@@ -169,3 +171,4 @@ packages/*/content
169171
!.licenserc.yaml
170172
!**/static/README.md
171173
!docs/static/img
174+
!**/jupyter_react/static/README.md

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@datalayer/jupyter-react",
3-
"version": "0.17.0",
3+
"version": "0.18.0",
44
"description": "Jupyter React - React.js components 100% compatible with Jupyter.",
55
"license": "MIT",
66
"main": "lib/index.js",

packages/react/src/components/codemirror/CodeMirrorEditor.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66

77
import { useState, useRef, useEffect } from 'react';
88
import { basicSetup } from 'codemirror';
9-
import { EditorState, Compartment } from '@codemirror/state';
9+
import { EditorState } from '@codemirror/state';
10+
// import { Compartment } from '@codemirror/state';
1011
import { keymap, EditorView, ViewUpdate } from '@codemirror/view';
11-
import { python } from '@codemirror/lang-python';
12+
// import { python } from '@codemirror/lang-python';
1213
import Kernel from '../../jupyter/kernel/Kernel';
1314
import codeMirrorTheme from './CodeMirrorTheme';
1415
import OutputAdapter from '../output/OutputAdapter';
@@ -79,7 +80,7 @@ export const CodeMirrorEditor = (props: {
7980
};
8081
useEffect(() => {
8182
outputStore.setInput(sourceId, code);
82-
const language = new Compartment();
83+
// const language = new Compartment();
8384
const keyBinding = [
8485
{
8586
key: 'Shift-Enter',
@@ -91,7 +92,7 @@ export const CodeMirrorEditor = (props: {
9192
doc: code,
9293
extensions: [
9394
basicSetup,
94-
language.of(python()),
95+
// language.of(python()), // TODO CodeMirrorEditor imported by Output breaks the JupyterLab extension loading. https://github.com/datalayer/jupyter-ui/issues/170
9596
EditorView.lineWrapping,
9697
keymap.of([...keyBinding]),
9798
codeMirrorTheme,

packages/react/src/index.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ export * from './components/cell/Cell';
4444
export * from './components/cell/CellAdapter';
4545
export * from './components/cell/CellState';
4646

47-
// CodeMirror Editor.
48-
// @todo CodeMirrorEditor breaks the JupyterLab extension loading.
49-
// @see https://github.com/datalayer/jupyter-ui/issues/170
50-
// export * from './components/codemirror/CodeMirrorEditor';
51-
5247
// Commands.
5348
export * from './components/commands/Commands';
5449

@@ -75,6 +70,9 @@ export * from './components/jupyterlab/JupyterLabAppAdapter';
7570
export * from './components/jupyterlab/JupyterLabAppPlugins';
7671
export * from './components/jupyterlab/JupyterLabAppCss';
7772

73+
// CodeMirrorEditor.
74+
export * from './components/codemirror/CodeMirrorEditor';
75+
7876
// Kernel.
7977
export * from './components/kernel';
8078

@@ -98,9 +96,6 @@ export * from './components/notebook/cell/sidebar/CellSidebarWidget';
9896
export * from './components/notebook/cell/sidebar/CellSidebar';
9997
export * from './components/notebook/cell/sidebar/CellSidebarRun';
10098

101-
// Outputs.
102-
// @todo CodeMirrorEditor imported by Output breaks the JupyterLab extension loading.
103-
// @see https://github.com/datalayer/jupyter-ui/issues/170
10499
export * from './components/output/Output';
105100
export * from './components/output/OutputAdapter';
106101
export * from './components/output/OutputState';

0 commit comments

Comments
 (0)