1+ diff --git a/node_modules/@datalayer/jupyter-react/lib/components/lumino/Lumino.js b/node_modules/@datalayer/jupyter-react/lib/components/lumino/Lumino.js
2+ index 850306f..138e9c6 100644
3+ --- a/node_modules/@datalayer/jupyter-react/lib/components/lumino/Lumino.js
4+ +++ b/node_modules/@datalayer/jupyter-react/lib/components/lumino/Lumino.js
5+ @@ -6,9 +6,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
6+ */
7+ import { useRef, useEffect } from 'react';
8+ import { Widget } from '@lumino/widgets';
9+ - export const Lumino = (props) => {
10+ + export const Lumino = ({ id = 'lumino-id', height = '100%', children }) => {
11+ const ref = useRef(null);
12+ - const { children, id, height } = props;
13+ useEffect(() => {
14+ console.log('Lumino useEffect - ref.current:', ref.current, 'children:', children, 'children.isAttached:', children?.isAttached);
15+ if (ref && ref.current && children) {
16+ @@ -59,9 +58,5 @@ export const Lumino = (props) => {
17+ }, [ref, children]);
18+ return (_jsx("div", { id: id, ref: ref, style: { height: height, minHeight: height } }));
19+ };
20+ - Lumino.defaultProps = {
21+ - id: 'lumino-id',
22+ - height: '100%',
23+ - };
24+ export default Lumino;
25+ //# sourceMappingURL=Lumino.js.map
26+ \ No newline at end of file
27+ diff --git a/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2Adapter.d.ts b/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2Adapter.d.ts
28+ index 841a2cf..05e0d52 100644
29+ --- a/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2Adapter.d.ts
30+ +++ b/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2Adapter.d.ts
31+ @@ -54,6 +54,14 @@ export declare class Notebook2Adapter {
32+ * Get the notebook model.
33+ */
34+ get model(): NotebookModel | null;
35+ + /**
36+ + * Undo the last change in the notebook.
37+ + */
38+ + undo(): void;
39+ + /**
40+ + * Redo the last undone change in the notebook.
41+ + */
42+ + redo(): void;
43+ /**
44+ * Dispose of the adapter.
45+ */
46+ diff --git a/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2Adapter.js b/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2Adapter.js
47+ index a6c29d2..8d6d435 100644
48+ --- a/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2Adapter.js
49+ +++ b/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2Adapter.js
50+ @@ -110,6 +110,36 @@ export class Notebook2Adapter {
51+ get model() {
52+ return this._context.model;
53+ }
54+ + /**
55+ + * Undo the last change in the notebook.
56+ + */
57+ + undo() {
58+ + const notebook = this._notebook;
59+ + // If in edit mode and active cell has an editor, undo within the cell editor (CodeMirror)
60+ + // Otherwise, undo structural changes (add/delete/move cells)
61+ + if (notebook.mode === 'edit' && notebook.activeCell?.editor) {
62+ + notebook.activeCell.editor.undo();
63+ + }
64+ + else {
65+ + // Structural undo (cell operations)
66+ + NotebookActions.undo(notebook);
67+ + }
68+ + }
69+ + /**
70+ + * Redo the last undone change in the notebook.
71+ + */
72+ + redo() {
73+ + const notebook = this._notebook;
74+ + // If in edit mode and active cell has an editor, redo within the cell editor (CodeMirror)
75+ + // Otherwise, redo structural changes (add/delete/move cells)
76+ + if (notebook.mode === 'edit' && notebook.activeCell?.editor) {
77+ + notebook.activeCell.editor.redo();
78+ + }
79+ + else {
80+ + // Structural redo (cell operations)
81+ + NotebookActions.redo(notebook);
82+ + }
83+ + }
84+ /**
85+ * Dispose of the adapter.
86+ */
87+ diff --git a/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2State.d.ts b/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2State.d.ts
88+ index 1ea7f63..c6f6cb7 100644
89+ --- a/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2State.d.ts
90+ +++ b/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2State.d.ts
91+ @@ -22,6 +22,8 @@ export type Notebook2State = INotebooks2State & {
92+ insertBelow: (mutation: CellMutation) => void;
93+ delete: (id: string) => void;
94+ changeCellType: (mutation: CellMutation) => void;
95+ + undo: (id: string) => void;
96+ + redo: (id: string) => void;
97+ reset: () => void;
98+ };
99+ export declare const notebookStore2: import("zustand").StoreApi<Notebook2State>;
100+ diff --git a/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2State.js b/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2State.js
101+ index 33a060c..543392e 100644
102+ --- a/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2State.js
103+ +++ b/node_modules/@datalayer/jupyter-react/lib/components/notebook/Notebook2State.js
104+ @@ -54,6 +54,20 @@ export const notebookStore2 = createStore((set, get) => ({
105+ .notebooks.get(mutation.id)
106+ ?.adapter?.changeCellType(mutation.cellType);
107+ },
108+ + undo: (id) => {
109+ + // Directly call adapter's undo method which uses NotebookActions
110+ + // This works for both local notebooks and collaborative notebooks
111+ + get()
112+ + .notebooks.get(id)
113+ + ?.adapter?.undo();
114+ + },
115+ + redo: (id) => {
116+ + // Directly call adapter's redo method which uses NotebookActions
117+ + // This works for both local notebooks and collaborative notebooks
118+ + get()
119+ + .notebooks.get(id)
120+ + ?.adapter?.redo();
121+ + },
122+ reset: () => set((state) => ({
123+ notebooks: new Map(),
124+ })),
1125diff --git a/node_modules/@datalayer/jupyter-react/lib/jupyter/JupyterConfig.d.ts b/node_modules/@datalayer/jupyter-react/lib/jupyter/JupyterConfig.d.ts
2- index 1234567..abcdefg 100644
126+ index 2e6c71b..a1551d1 100644
3127--- a/node_modules/@datalayer/jupyter-react/lib/jupyter/JupyterConfig.d.ts
4128+++ b/node_modules/@datalayer/jupyter-react/lib/jupyter/JupyterConfig.d.ts
5- @@ -25 ,6 +25 ,12 @@ export declare const setJupyterServerToken: (jupyterServerToken: string) => voi
129+ @@ -24 ,6 +24 ,12 @@ export declare const setJupyterServerToken: (jupyterServerToken: string) => void
6130 * Getter for jupyterServerToken.
7131 */
8132 export declare const getJupyterServerToken: () => string;
@@ -16,10 +140,10 @@ index 1234567..abcdefg 100644
16140 * Method to load the Jupyter configuration from the host HTML page.
17141 */
18142diff --git a/node_modules/@datalayer/jupyter-react/lib/jupyter/JupyterConfig.js b/node_modules/@datalayer/jupyter-react/lib/jupyter/JupyterConfig.js
19- index 1234567..abcdefg 100644
143+ index c6ea148..c5cbbe3 100644
20144--- a/node_modules/@datalayer/jupyter-react/lib/jupyter/JupyterConfig.js
21145+++ b/node_modules/@datalayer/jupyter-react/lib/jupyter/JupyterConfig.js
22- @@ -60 ,6 +60 ,14 @@ export const getJupyterServerToken = () => {
146+ @@ -48 ,6 +48 ,14 @@ export const getJupyterServerToken = () => {
23147 }
24148 return config.jupyterServerToken;
25149 };
0 commit comments