Skip to content

Commit e6df223

Browse files
ft: lexical editor (#356)
* example: notebook simple * chore: lite notebook * notebook lite * chore: rm defaultkernelisloading * fix: cra example * Automatic application of license header * examples: more fixes * fix: storybook * fix: examples * bump: jupyter-react * bump: jupyter-react * fix: jupyter-react python package build * chore: datalayer notebook * fix: notebook simple * Automatic application of license header * makefile: storybook * fix: theme * bump: version * lexical: refactor * lexical: styles * lexical: styles * react: theme example * css: refactor * fix: style * fix: style * lexical: more plugins * bump: versions * lexical: components * lexical: components * lint * lexical: hooks * fix: build * fix: build * Automatic application of license header --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent e821eb6 commit e6df223

File tree

361 files changed

+4579
-5283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

361 files changed

+4579
-5283
lines changed

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ node_modules/
4040
# Version file is handled by hatchling
4141
**/jupyter_react/_version.py
4242

43-
**/jupyter_react/static
43+
**/jupyter_react/static/*.js
44+
**/jupyter_react/static/*.css
4445

4546
# Integration tests
4647
test-results/
@@ -174,4 +175,4 @@ packages/react/.vscode/launch.json
174175
!.licenserc.yaml
175176
!dev/notebooks/.datalayer
176177
!docs/static/img
177-
!packages/react/jupyter_react/static/README.md
178+
!**/static/README.md

examples/cra/src/App.test.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* MIT License
55
*/
66

7-
import React from 'react';
87
import { render, screen } from '@testing-library/react';
98
import App from './App';
109

examples/cra/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const App = () => {
1414
return (
1515
<>
1616
<Layers/>
17-
<Jupyter startDefaultKernel={true} terminals={true}>
17+
<Jupyter startDefaultKernel terminals>
1818
<GalleryExample/>
1919
</Jupyter>
2020
</>

examples/cra/src/examples/AllExamples.tsx

+10-6
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ const AllExample = () => {
8383
<>
8484
<OutputToolbar />
8585
<Output
86-
showEditor={true}
86+
showEditor
8787
autoRun={false}
8888
kernel={kernel}
8989
code={"print('Hello Datalayer 👍')"}
@@ -93,16 +93,20 @@ const AllExample = () => {
9393
kernel={kernel}
9494
code={"print('Hello Datalayer 👍')"}
9595
/>
96-
<Output autoRun={true} kernel={kernel} code={source} />
96+
<Output autoRun kernel={kernel} code={source} />
9797
<Output
98-
autoRun={true}
98+
autoRun
9999
kernel={kernel}
100100
code={
101101
"print('=> Hello Datalayer again... I am the output of an non-shown editor 👍 <=')"
102102
}
103103
/>
104104
<CellToolbar cellId={CELL_ID} />
105-
<Cell id={CELL_ID} source={source} />
105+
<Cell
106+
id={CELL_ID}
107+
kernel={kernel}
108+
source={source}
109+
/>
106110
<CommandsToolbar />
107111
<Commands />
108112
<ConsoleToolbar />
@@ -115,7 +119,7 @@ const AllExample = () => {
115119
{serviceManager && <FileBrowser serviceManager={serviceManager}/> }
116120
<FileManagerJupyterLab />
117121
<NotebookToolbar notebookId={NOTEBOOK_ID} />
118-
<Notebook id={NOTEBOOK_ID} path="ping.ipynb"/>
122+
<Notebook id={NOTEBOOK_ID} path=".datalayer/ping.ipynb"/>
119123
<SettingsToolbar />
120124
<Settings />
121125
<LuminoComponent />
@@ -129,7 +133,7 @@ const div = document.createElement('div');
129133
document.body.appendChild(div);
130134

131135
render(
132-
<Jupyter collaborative={true} terminals={true}>
136+
<Jupyter startDefaultKernel collaborative terminals>
133137
<AllExample />
134138
</Jupyter>,
135139
div

examples/cra/src/examples/CellExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const div = document.createElement('div');
1515
document.body.appendChild(div);
1616

1717
render(
18-
<Jupyter collaborative={false} terminals={false}>
18+
<Jupyter startDefaultKernel collaborative={false} terminals={false}>
1919
<Layers />
2020
<CellComponents />
2121
</Jupyter>,

examples/cra/src/examples/ConsoleExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const div = document.createElement('div');
1515
document.body.appendChild(div);
1616

1717
render(
18-
<Jupyter collaborative={false} terminals={false}>
18+
<Jupyter startDefaultKernel collaborative={false} terminals={false}>
1919
<Layers />
2020
<ConsoleToolbar />
2121
<Console />

examples/cra/src/examples/GalleryExample.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { UnderlineNav } from '@primer/react';
99
import { Box } from '@primer/react';
1010
import {
1111
useJupyter, Cell, Commands, Console, Dialog, FileBrowser, FileManagerJupyterLab,
12-
OutputIPyWidgets, Notebook, Kernel, Settings, Terminal,
12+
OutputIPyWidgets, Notebook, Kernel, Settings, Terminal, CellSidebarExtension,
1313
} from '@datalayer/jupyter-react';
1414
import { Output } from '@datalayer/jupyter-react/lib/components/output/Output';
1515
import { IOutput } from '@jupyterlab/nbformat';
@@ -227,7 +227,7 @@ const GalleryExample = () => {
227227
<Notebook
228228
id={NOTEBOOK_ID}
229229
path="ping.ipynb"
230-
CellSidebar={CellSidebar}
230+
extensions={[new CellSidebarExtension({ factory: CellSidebar })]}
231231
/>
232232
</>
233233
)}

examples/cra/src/examples/LuminoExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const div = document.createElement('div');
1414
document.body.appendChild(div);
1515

1616
render(
17-
<Jupyter collaborative={false} terminals={false}>
17+
<Jupyter startDefaultKernel collaborative={false} terminals={false}>
1818
<Layers />
1919
<LuminoToolbar />
2020
<LuminoComponent />

examples/cra/src/examples/NotebookExample.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ const NOTEBOOK_UID = 'notebook-uid-example';
1818
*/
1919
const Example = () => {
2020
return (
21-
<Jupyter collaborative={false} terminals={false}>
21+
<Jupyter startDefaultKernel collaborative={false} terminals={false}>
2222
<Layers />
2323
<NotebookSimpleToolbar notebookId={NOTEBOOK_UID} />
24-
<Notebook id={NOTEBOOK_UID} path="ping.ipynb" />
24+
<Notebook id={NOTEBOOK_UID} path=".datalayer/ping.ipynb" />
2525
</Jupyter>
2626
);
2727
};

examples/cra/src/examples/NotebookSidebarExample.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
* MIT License
55
*/
66

7-
import {Jupyter, Notebook} from '@datalayer/jupyter-react';
8-
import {Box} from '@primer/react';
7+
import { Jupyter, Notebook, CellSidebarExtension } from "@datalayer/jupyter-react";
8+
import { Box } from '@primer/react';
99
import NotebookToolbar from './notebook/NotebookToolbar';
1010
import CellSidebar from './notebook/cell/CellSidebar';
1111

1212
const NOTEBOOK_UID = 'notebook-id-simple';
1313

1414
export default function NotebookSidebarComponent() {
1515
return (
16-
<Jupyter collaborative={false} terminals={true}>
16+
<Jupyter startDefaultKernel collaborative={false} terminals>
1717
<div style={{padding: '2rem'}}>
1818
<Box sx={{width: '100%'}}>
1919
<NotebookToolbar notebookId={NOTEBOOK_UID} />
2020
<Notebook
21-
path="ping.ipynb"
21+
path=".datalayer/ping.ipynb"
2222
id={NOTEBOOK_UID}
23-
CellSidebar={CellSidebar}
23+
extensions={[new CellSidebarExtension({ factory: CellSidebar })]}
2424
/>
2525
</Box>
2626
</div>

examples/cra/src/examples/OutputsExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const div = document.createElement('div');
1616
document.body.appendChild(div);
1717

1818
render(
19-
<Jupyter collaborative={false} terminals={false}>
19+
<Jupyter startDefaultKernel collaborative={false} terminals={false}>
2020
<Layers />
2121
<OutputsToolbar />
2222
<OutputsComponents />

examples/cra/src/examples/TerminalExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const div = document.createElement('div');
1515
document.body.appendChild(div);
1616

1717
render(
18-
<Jupyter collaborative={false} terminals={true}>
18+
<Jupyter startDefaultKernel collaborative={false} terminals>
1919
<Layers />
2020
<TerminalToolbar />
2121
<Terminal height="500px" />

examples/cra/src/examples/cell/CellToolbar.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* MIT License
55
*/
66

7-
import React from 'react';
87
import { Box, IconButton, Text, Tooltip } from '@primer/react';
98
import { PlayIcon, ReplyIcon, ThreeBarsIcon } from '@primer/octicons-react';
109
import { useCellsStore } from '@datalayer/jupyter-react';
@@ -39,12 +38,12 @@ const CellToolbar = (props: {cellId: string}) => {
3938
onClick={() => cellStore.execute()}
4039
/>
4140
</Tooltip>
42-
<Tooltip aria-label="Run the cell">
41+
<Tooltip aria-label="Reset output count">
4342
<IconButton
4443
size="small"
4544
variant="invisible"
4645
icon={ReplyIcon}
47-
aria-label="Rest the outputcount"
46+
aria-label="Reset the output count"
4847
onClick={() => cellStore.setOutputsCount(cellId, 0)}
4948
/>
5049
</Tooltip>

examples/cra/src/examples/ipywidgets/IPyWidgetsExample.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const div = document.createElement('div');
1616
document.body.appendChild(div);
1717

1818
render(
19-
<Jupyter collaborative={false} terminals={false}>
19+
<Jupyter startDefaultKernel collaborative={false} terminals={false}>
2020
<Layers />
2121
<IPyWidgetsToolbar />
2222
<OutputIPyWidgets state={state} view={view} />

examples/cra/src/examples/labapp/JupyterLabHeadlessApp.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const JupyterLabHeadlessAppExample = () => {
5353
}
5454
return (
5555
<>
56-
<Jupyter startDefaultKernel={false} disableCssLoading={true} colormode="light">
56+
<Jupyter startDefaultKernel={false} disableCssLoading colormode="light">
5757
{ boxPanel &&
5858
<div style={{ position: "relative" }}>
5959
<Box className="jp-LabShell"
@@ -79,7 +79,7 @@ export const JupyterLabHeadlessAppExample = () => {
7979
mimeRenderers={[
8080
mimePlotlyExtension,
8181
]}
82-
headless={true}
82+
headless
8383
onJupyterLab={onJupyterLab}
8484
pluginId="@jupyterlab/apputils-extension:themes"
8585
PluginType={ThemeManager}

0 commit comments

Comments
 (0)