@datalayer/jupyter-react 0.19.3 → 0.19.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/lib/app/tabs/components/NotebookComponent.js +3 -2
  2. package/lib/app/tabs/components/NotebookComponent.js.map +1 -1
  3. package/lib/components/cell/CellCommands.d.ts +1 -1
  4. package/lib/components/cell/CellCommands.js +7 -7
  5. package/lib/components/cell/CellCommands.js.map +1 -1
  6. package/lib/components/notebook/BaseNotebook.d.ts +148 -0
  7. package/lib/components/notebook/BaseNotebook.js +732 -0
  8. package/lib/components/notebook/BaseNotebook.js.map +1 -0
  9. package/lib/components/notebook/Notebook.css +13 -0
  10. package/lib/components/notebook/Notebook.d.ts +14 -16
  11. package/lib/components/notebook/Notebook.js +143 -65
  12. package/lib/components/notebook/Notebook.js.map +1 -1
  13. package/lib/components/notebook/NotebookAdapter.d.ts +7 -9
  14. package/lib/components/notebook/NotebookAdapter.js +18 -22
  15. package/lib/components/notebook/NotebookAdapter.js.map +1 -1
  16. package/lib/components/notebook/NotebookCommands.d.ts +14 -4
  17. package/lib/components/notebook/NotebookCommands.js +230 -156
  18. package/lib/components/notebook/NotebookCommands.js.map +1 -1
  19. package/lib/components/notebook/NotebookState.js +6 -6
  20. package/lib/components/notebook/NotebookState.js.map +1 -1
  21. package/lib/components/notebook/SimpleNotebook.d.ts +40 -0
  22. package/lib/components/notebook/SimpleNotebook.js +73 -0
  23. package/lib/components/notebook/SimpleNotebook.js.map +1 -0
  24. package/lib/components/notebook/cell/metadata/CellMetadataEditor.d.ts +14 -6
  25. package/lib/components/notebook/cell/metadata/CellMetadataEditor.js +35 -37
  26. package/lib/components/notebook/cell/metadata/CellMetadataEditor.js.map +1 -1
  27. package/lib/components/notebook/cell/metadata/NbGraderCells.d.ts +2 -2
  28. package/lib/components/notebook/cell/metadata/NbGraderCells.js +2 -2
  29. package/lib/components/notebook/cell/metadata/NbGraderCells.js.map +1 -1
  30. package/lib/components/notebook/cell/sidebar/CellSidebar.d.ts +28 -2
  31. package/lib/components/notebook/cell/sidebar/CellSidebar.js +64 -78
  32. package/lib/components/notebook/cell/sidebar/CellSidebar.js.map +1 -1
  33. package/lib/components/notebook/cell/sidebar/CellSidebarButton.d.ts +3 -2
  34. package/lib/components/notebook/cell/sidebar/CellSidebarButton.js +57 -72
  35. package/lib/components/notebook/cell/sidebar/CellSidebarButton.js.map +1 -1
  36. package/lib/components/notebook/cell/sidebar/CellSidebarRun.d.ts +3 -2
  37. package/lib/components/notebook/cell/sidebar/CellSidebarRun.js +14 -29
  38. package/lib/components/notebook/cell/sidebar/CellSidebarRun.js.map +1 -1
  39. package/lib/components/notebook/cell/sidebar/extension.d.ts +31 -0
  40. package/lib/components/notebook/cell/sidebar/extension.js +121 -0
  41. package/lib/components/notebook/cell/sidebar/extension.js.map +1 -0
  42. package/lib/components/notebook/cell/sidebar/index.d.ts +1 -1
  43. package/lib/components/notebook/cell/sidebar/index.js +1 -1
  44. package/lib/components/notebook/cell/sidebar/index.js.map +1 -1
  45. package/lib/components/notebook/content/JupyterReactContentFactory.d.ts +1 -12
  46. package/lib/components/notebook/content/JupyterReactContentFactory.js +4 -22
  47. package/lib/components/notebook/content/JupyterReactContentFactory.js.map +1 -1
  48. package/lib/components/notebook/index.d.ts +2 -0
  49. package/lib/components/notebook/index.js +2 -0
  50. package/lib/components/notebook/index.js.map +1 -1
  51. package/lib/components/utils/Loader.d.ts +4 -0
  52. package/lib/components/utils/Loader.js +23 -0
  53. package/lib/components/utils/Loader.js.map +1 -0
  54. package/lib/components/utils/SpinnerCentered.d.ts +2 -1
  55. package/lib/components/utils/SpinnerCentered.js +2 -2
  56. package/lib/components/utils/SpinnerCentered.js.map +1 -1
  57. package/lib/components/utils/index.d.ts +1 -0
  58. package/lib/components/utils/index.js +1 -0
  59. package/lib/components/utils/index.js.map +1 -1
  60. package/lib/examples/Bokeh.js +8 -4
  61. package/lib/examples/Bokeh.js.map +1 -1
  62. package/lib/examples/Bqplot.js +8 -4
  63. package/lib/examples/Bqplot.js.map +1 -1
  64. package/lib/examples/Dashboard.js +8 -9
  65. package/lib/examples/Dashboard.js.map +1 -1
  66. package/lib/examples/Deno.js +8 -4
  67. package/lib/examples/Deno.js.map +1 -1
  68. package/lib/examples/GeoJson.js +10 -5
  69. package/lib/examples/GeoJson.js.map +1 -1
  70. package/lib/examples/IPyLeaflet.js +8 -4
  71. package/lib/examples/IPyLeaflet.js.map +1 -1
  72. package/lib/examples/IPyReact.js +8 -4
  73. package/lib/examples/IPyReact.js.map +1 -1
  74. package/lib/examples/IPyWidgets.js +8 -9
  75. package/lib/examples/IPyWidgets.js.map +1 -1
  76. package/lib/examples/IPyWidgetsState.js +8 -9
  77. package/lib/examples/IPyWidgetsState.js.map +1 -1
  78. package/lib/examples/JupyterContext.js +20 -22
  79. package/lib/examples/JupyterContext.js.map +1 -1
  80. package/lib/examples/Matplotlib.js +8 -9
  81. package/lib/examples/Matplotlib.js.map +1 -1
  82. package/lib/examples/Notebook.js +4 -3
  83. package/lib/examples/Notebook.js.map +1 -1
  84. package/lib/examples/NotebookCellSidebar.js +4 -8
  85. package/lib/examples/NotebookCellSidebar.js.map +1 -1
  86. package/lib/examples/NotebookCellToolbar.js +11 -12
  87. package/lib/examples/NotebookCellToolbar.js.map +1 -1
  88. package/lib/examples/NotebookCollaborative.js +6 -3
  89. package/lib/examples/NotebookCollaborative.js.map +1 -1
  90. package/lib/examples/NotebookColormode.js +6 -10
  91. package/lib/examples/NotebookColormode.js.map +1 -1
  92. package/lib/examples/NotebookExtension.js +11 -12
  93. package/lib/examples/NotebookExtension.js.map +1 -1
  94. package/lib/examples/NotebookExternalContent.js +10 -12
  95. package/lib/examples/NotebookExternalContent.js.map +1 -1
  96. package/lib/examples/NotebookInit.js +5 -4
  97. package/lib/examples/NotebookInit.js.map +1 -1
  98. package/lib/examples/NotebookKernelChange.js +7 -6
  99. package/lib/examples/NotebookKernelChange.js.map +1 -1
  100. package/lib/examples/NotebookLess.js +8 -12
  101. package/lib/examples/NotebookLess.js.map +1 -1
  102. package/lib/examples/NotebookLite.js +5 -10
  103. package/lib/examples/NotebookLite.js.map +1 -1
  104. package/lib/examples/NotebookLiteContext.js +9 -10
  105. package/lib/examples/NotebookLiteContext.js.map +1 -1
  106. package/lib/examples/NotebookLocalServer.js +10 -7
  107. package/lib/examples/NotebookLocalServer.js.map +1 -1
  108. package/lib/examples/NotebookNbformat.js +8 -9
  109. package/lib/examples/NotebookNbformat.js.map +1 -1
  110. package/lib/examples/NotebookNbformatChange.js +9 -11
  111. package/lib/examples/NotebookNbformatChange.js.map +1 -1
  112. package/lib/examples/NotebookNoContext.js +4 -3
  113. package/lib/examples/NotebookNoContext.js.map +1 -1
  114. package/lib/examples/NotebookNoPrimer.js +5 -4
  115. package/lib/examples/NotebookNoPrimer.js.map +1 -1
  116. package/lib/examples/NotebookOnSessionConnection.js +7 -11
  117. package/lib/examples/NotebookOnSessionConnection.js.map +1 -1
  118. package/lib/examples/NotebookPath.js +4 -3
  119. package/lib/examples/NotebookPath.js.map +1 -1
  120. package/lib/examples/NotebookPathChange.js +9 -6
  121. package/lib/examples/NotebookPathChange.js.map +1 -1
  122. package/lib/examples/NotebookReadonly.js +6 -4
  123. package/lib/examples/NotebookReadonly.js.map +1 -1
  124. package/lib/examples/NotebookServiceManager.js +10 -14
  125. package/lib/examples/NotebookServiceManager.js.map +1 -1
  126. package/lib/examples/NotebookSkeleton.js +5 -4
  127. package/lib/examples/NotebookSkeleton.js.map +1 -1
  128. package/lib/examples/NotebookTheme.js +6 -10
  129. package/lib/examples/NotebookTheme.js.map +1 -1
  130. package/lib/examples/NotebookThemeColormode.js +6 -10
  131. package/lib/examples/NotebookThemeColormode.js.map +1 -1
  132. package/lib/examples/NotebookURL.js +4 -3
  133. package/lib/examples/NotebookURL.js.map +1 -1
  134. package/lib/examples/NotebookUnmount.js +7 -11
  135. package/lib/examples/NotebookUnmount.js.map +1 -1
  136. package/lib/examples/ObservableHQ.js +8 -4
  137. package/lib/examples/ObservableHQ.js.map +1 -1
  138. package/lib/examples/Panel.js +6 -3
  139. package/lib/examples/Panel.js.map +1 -1
  140. package/lib/examples/Plotly.js +8 -4
  141. package/lib/examples/Plotly.js.map +1 -1
  142. package/lib/examples/PyGWalker.js +8 -9
  143. package/lib/examples/PyGWalker.js.map +1 -1
  144. package/lib/examples/Vega.js +5 -4
  145. package/lib/examples/Vega.js.map +1 -1
  146. package/lib/examples/extensions/celltoolbar/CellToolbarExtension.d.ts +1 -1
  147. package/lib/examples/extensions/celltoolbar/CellToolbarExtension.js +6 -2
  148. package/lib/examples/extensions/celltoolbar/CellToolbarExtension.js.map +1 -1
  149. package/lib/examples/extensions/exectime/ExecTimeExtension.d.ts +1 -1
  150. package/lib/examples/extensions/exectime/ExecTimeExtension.js +1 -1
  151. package/lib/examples/extensions/exectime/ExecTimeExtension.js.map +1 -1
  152. package/lib/examples/sidebars/CellSidebarSource.js +56 -73
  153. package/lib/examples/sidebars/CellSidebarSource.js.map +1 -1
  154. package/lib/examples/toolbars/NotebookToolbarAutoSave.js +3 -3
  155. package/lib/examples/toolbars/NotebookToolbarAutoSave.js.map +1 -1
  156. package/lib/jupyter/collaboration/DatalayerCollaboration.d.ts +7 -2
  157. package/lib/jupyter/collaboration/DatalayerCollaboration.js +24 -1
  158. package/lib/jupyter/collaboration/DatalayerCollaboration.js.map +1 -1
  159. package/lib/jupyter/collaboration/JupyterCollaboration.d.ts +2 -2
  160. package/lib/jupyter/collaboration/JupyterCollaboration.js +3 -3
  161. package/lib/jupyter/collaboration/JupyterCollaboration.js.map +1 -1
  162. package/lib/utils/Utils.d.ts +6 -0
  163. package/lib/utils/Utils.js +9 -1
  164. package/lib/utils/Utils.js.map +1 -1
  165. package/package.json +1 -1
  166. package/lib/components/notebook/cell/sidebar/CellSidebarWidget.d.ts +0 -16
  167. package/lib/components/notebook/cell/sidebar/CellSidebarWidget.js +0 -37
  168. package/lib/components/notebook/cell/sidebar/CellSidebarWidget.js.map +0 -1
@@ -4,12 +4,13 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
4
4
  *
5
5
  * MIT License
6
6
  */
7
+ import { CellSidebarExtension } from '../../../components';
7
8
  import Notebook from '../../../components/notebook/Notebook';
8
- import CellSidebarNew from './../../../components/notebook/cell/sidebar/CellSidebarButton';
9
9
  import nbformat from './../../..//examples/notebooks/NotebookExample1.ipynb.json';
10
+ import CellSidebarNew from './../../../components/notebook/cell/sidebar/CellSidebarButton';
10
11
  export const NotebookComponent = () => {
11
12
  return (_jsx(_Fragment, { children: _jsx(Notebook, { startDefaultKernel: true, nbformat: nbformat, id: "notebook-id", cellSidebarMargin: 60, height: "calc(100vh - 2.6rem)" // (Height - Toolbar Height).
12
- , CellSidebar: CellSidebarNew }) }));
13
+ , extensions: [new CellSidebarExtension({ factory: CellSidebarNew })] }) }));
13
14
  };
14
15
  export default NotebookComponent;
15
16
  //# sourceMappingURL=NotebookComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotebookComponent.js","sourceRoot":"","sources":["../../../../src/app/tabs/components/NotebookComponent.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,QAAQ,MAAM,uCAAuC,CAAC;AAC7D,OAAO,cAAc,MAAM,+DAA+D,CAAC;AAE3F,OAAO,QAAQ,MAAM,4DAA4D,CAAC;AAElF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,OAAO,CACL,4BACE,KAAC,QAAQ,IACP,kBAAkB,EAAE,IAAI,EACxB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAC,aAAa,EAChB,iBAAiB,EAAE,EAAE,EACrB,MAAM,EAAC,sBAAsB,CAAC,6BAA6B;cAC3D,WAAW,EAAE,cAAc,GAC3B,GACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"NotebookComponent.js","sourceRoot":"","sources":["../../../../src/app/tabs/components/NotebookComponent.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,QAAQ,MAAM,uCAAuC,CAAC;AAC7D,OAAO,QAAQ,MAAM,4DAA4D,CAAC;AAClF,OAAO,cAAc,MAAM,+DAA+D,CAAC;AAE3F,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IACpC,OAAO,CACL,4BACE,KAAC,QAAQ,IACP,kBAAkB,EAAE,IAAI,EACxB,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAC,aAAa,EAChB,iBAAiB,EAAE,EAAE,EACrB,MAAM,EAAC,sBAAsB,CAAC,6BAA6B;cAC3D,UAAU,EAAE,CAAC,IAAI,oBAAoB,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC,GACnE,GACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -2,5 +2,5 @@ import { CommandRegistry } from '@lumino/commands';
2
2
  import { CompletionHandler } from '@jupyterlab/completer';
3
3
  import { CodeCell, MarkdownCell, RawCell } from '@jupyterlab/cells';
4
4
  import CellAdapter from './CellAdapter';
5
- export declare const CellCommands: (commandRegistry: CommandRegistry, cell: CodeCell | MarkdownCell | RawCell, completerHandler: CompletionHandler, cellAdapter: CellAdapter) => void;
5
+ export declare const CellCommands: (commands: CommandRegistry, cell: CodeCell | MarkdownCell | RawCell, completerHandler: CompletionHandler, cellAdapter: CellAdapter) => void;
6
6
  export default CellCommands;
@@ -8,16 +8,16 @@ const cmdIds = {
8
8
  invoke: 'completer:invoke',
9
9
  select: 'completer:select',
10
10
  };
11
- export const CellCommands = (commandRegistry, cell, completerHandler, cellAdapter) => {
12
- commandRegistry.addCommand(cmdIds.invoke, {
11
+ export const CellCommands = (commands, cell, completerHandler, cellAdapter) => {
12
+ commands.addCommand(cmdIds.invoke, {
13
13
  label: 'Completer: Invoke',
14
14
  execute: () => completerHandler.invoke(),
15
15
  });
16
- commandRegistry.addCommand(cmdIds.select, {
16
+ commands.addCommand(cmdIds.select, {
17
17
  label: 'Completer: Select',
18
18
  execute: () => completerHandler.completer.selectActive(),
19
19
  });
20
- commandRegistry.addCommand('run:cell', {
20
+ commands.addCommand('run:cell', {
21
21
  execute: () => {
22
22
  if (cell instanceof CodeCell) {
23
23
  cellAdapter.execute();
@@ -27,12 +27,12 @@ export const CellCommands = (commandRegistry, cell, completerHandler, cellAdapte
27
27
  }
28
28
  },
29
29
  });
30
- commandRegistry.addKeyBinding({
30
+ commands.addKeyBinding({
31
31
  selector: '.jp-InputArea-editor.jp-mod-completer-enabled',
32
32
  keys: ['Tab'],
33
33
  command: cmdIds.invoke,
34
34
  });
35
- commandRegistry.addKeyBinding({
35
+ commands.addKeyBinding({
36
36
  selector: '.jp-InputArea-editor',
37
37
  keys: ['Shift Enter'],
38
38
  command: 'run:cell',
@@ -44,7 +44,7 @@ export const CellCommands = (commandRegistry, cell, completerHandler, cellAdapte
44
44
  command: cmdIds.select,
45
45
  },
46
46
  ];
47
- bindings.map(binding => commandRegistry.addKeyBinding(binding));
47
+ bindings.map(binding => commands.addKeyBinding(binding));
48
48
  };
49
49
  export default CellCommands;
50
50
  //# sourceMappingURL=CellCommands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CellCommands.js","sourceRoot":"","sources":["../../../src/components/cell/CellCommands.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAW,MAAM,mBAAmB,CAAC;AAGpE,MAAM,MAAM,GAAG;IACb,MAAM,EAAE,kBAAkB;IAC1B,MAAM,EAAE,kBAAkB;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,eAAgC,EAChC,IAAuC,EACvC,gBAAmC,EACnC,WAAwB,EAClB,EAAE;IACR,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE;Q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OAAO,EAAE,MAAM,CAAC,MAAM;SACvB;KACF,CAAC;IACF,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,148 @@
1
+ /// <reference types="react" />
2
+ import type { INotebookContent } from '@jupyterlab/nbformat';
3
+ import { NotebookModel } from '@jupyterlab/notebook';
4
+ import type { Kernel, ServerConnection, ServiceManager } from '@jupyterlab/services';
5
+ import { CommandRegistry } from '@lumino/commands';
6
+ import type { OnSessionConnection } from '../../state';
7
+ import type { DatalayerNotebookExtension } from './Notebook';
8
+ /**
9
+ * Base notebook component properties
10
+ */
11
+ export interface IBaseNotebookProps {
12
+ /**
13
+ * Custom command registry.
14
+ *
15
+ * Note:
16
+ * Providing it allows to command the component from an higher level.
17
+ */
18
+ commands?: CommandRegistry;
19
+ /**
20
+ * Notebook ID
21
+ */
22
+ id?: string;
23
+ /**
24
+ * Notebook extensions
25
+ */
26
+ extensions?: DatalayerNotebookExtension[];
27
+ /**
28
+ * Kernel ID to connect to
29
+ */
30
+ kernelId?: string;
31
+ /**
32
+ * Service manager
33
+ */
34
+ serviceManager: ServiceManager.IManager;
35
+ /**
36
+ * Notebook content model
37
+ */
38
+ model: NotebookModel;
39
+ /**
40
+ * Callback on session connection changed
41
+ */
42
+ onSessionConnectionChanged?: OnSessionConnection;
43
+ /**
44
+ * Notebook path
45
+ *
46
+ * Set this only if you use Jupyter Server to fetch
47
+ * and save the content.
48
+ */
49
+ path?: string;
50
+ }
51
+ /**
52
+ * Base notebook component
53
+ *
54
+ * The notebook model and kernel lifecycle is not handled by
55
+ * this component.
56
+ *
57
+ * Important
58
+ * This component is not connected to any React stores.
59
+ */
60
+ export declare function BaseNotebook(props: IBaseNotebookProps): JSX.Element;
61
+ /**
62
+ * Get the kernel ID to connect to.
63
+ *
64
+ * Steps:
65
+ * - Check the requested kernel ID exists
66
+ * - If no kernel found, start a new one if required
67
+ *
68
+ * Note
69
+ * If the hook starts the kernel, it will shut it down when unmounting.
70
+ */
71
+ export declare function useKernelId(options: {
72
+ /**
73
+ * Kernels manager
74
+ */
75
+ kernels: Kernel.IManager;
76
+ /**
77
+ * Kernel ID to connect to
78
+ *
79
+ * If the kernel does not exist and {@link startDefaultKernel} is `true`,
80
+ * another kernel will be started.
81
+ */
82
+ requestedKernelId?: string;
83
+ /**
84
+ * Whether or not to start a default kernel.
85
+ *
86
+ * Default: false
87
+ */
88
+ startDefaultKernel?: boolean;
89
+ }): string | undefined;
90
+ export type CollaborationServer = {
91
+ /**
92
+ * Base server URL
93
+ */
94
+ baseURL: string;
95
+ /**
96
+ * Notebook room name to connect to.
97
+ */
98
+ roomName: string;
99
+ /**
100
+ * JWT token
101
+ */
102
+ token: string;
103
+ /**
104
+ * Server type
105
+ */
106
+ type: 'datalayer';
107
+ } | {
108
+ /**
109
+ * Notebook path
110
+ */
111
+ path: string;
112
+ /**
113
+ * Jupyter server settings
114
+ */
115
+ serverSettings: ServerConnection.ISettings;
116
+ /**
117
+ * Server type
118
+ */
119
+ type: 'jupyter';
120
+ };
121
+ /**
122
+ * Hook to handle a notebook model.
123
+ *
124
+ * The notebook content may come from 3 sources:
125
+ * - {@link nbformat}: The notebook content
126
+ * - {@link url}: A URL to fetch the notebook content from
127
+ * - {@link collaborationServer}: Parameters to connect to a collaboration server
128
+ */
129
+ export declare function useNotebookModel(options: {
130
+ /**
131
+ * Collaboration server providing the document rooms
132
+ */
133
+ collaborationServer?: CollaborationServer;
134
+ /**
135
+ * Notebook content.
136
+ */
137
+ nbformat?: INotebookContent;
138
+ /**
139
+ * Whether the model is read-only or not.
140
+ *
141
+ * Default: false
142
+ */
143
+ readonly?: boolean;
144
+ /**
145
+ * URL to fetch the notebook content from.
146
+ */
147
+ url?: string;
148
+ }): NotebookModel | null;