@datalayer/jupyter-react 1.1.8 → 1.2.0

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 (528) hide show
  1. package/README.md +74 -1
  2. package/lib/app/tabs/components/CellComponent.js +4 -2
  3. package/lib/app/tabs/components/CellComponent.js.map +1 -1
  4. package/lib/app/tabs/components/NotebookComponent.js +2 -2
  5. package/lib/app/tabs/components/NotebookComponent.js.map +1 -1
  6. package/lib/app/tabs/components/ViewerComponent.js +1 -1
  7. package/lib/app/tabs/components/ViewerComponent.js.map +1 -1
  8. package/lib/components/cell/Cell.d.ts +5 -8
  9. package/lib/components/cell/Cell.js +6 -22
  10. package/lib/components/cell/Cell.js.map +1 -1
  11. package/lib/components/cell/CellAdapter.d.ts +1 -3
  12. package/lib/components/cell/CellAdapter.js +5 -17
  13. package/lib/components/cell/CellAdapter.js.map +1 -1
  14. package/lib/components/codemirror/CodeMirrorOutputToolbar.d.ts +2 -2
  15. package/lib/components/codemirror/CodeMirrorOutputToolbar.js.map +1 -1
  16. package/lib/components/console/ConsoleAdapter.d.ts +1 -1
  17. package/lib/components/console/ConsoleAdapter.js +1 -1
  18. package/lib/components/console/ConsoleAdapter.js.map +1 -1
  19. package/lib/components/jupyterlab/JupyterLabApp.d.ts +16 -19
  20. package/lib/components/jupyterlab/JupyterLabApp.js +27 -21
  21. package/lib/components/jupyterlab/JupyterLabApp.js.map +1 -1
  22. package/lib/components/jupyterlab/JupyterLabAppAdapter.d.ts +4 -4
  23. package/lib/components/jupyterlab/JupyterLabAppAdapter.js +1 -1
  24. package/lib/components/jupyterlab/JupyterLabAppAdapter.js.map +1 -1
  25. package/lib/components/jupyterlab/JupyterLabAppCss.d.ts +1 -4
  26. package/lib/components/jupyterlab/JupyterLabAppCss.js +1 -5
  27. package/lib/components/jupyterlab/JupyterLabAppCss.js.map +1 -1
  28. package/lib/components/kernel/KernelActionMenu.d.ts +2 -2
  29. package/lib/components/kernel/KernelActionMenu.js.map +1 -1
  30. package/lib/components/kernel/KernelDetective.d.ts +1 -1
  31. package/lib/components/kernel/{Kernelndicator.d.ts → KernelIndicator.d.ts} +2 -1
  32. package/lib/components/kernel/{Kernelndicator.js → KernelIndicator.js} +13 -5
  33. package/lib/components/kernel/KernelIndicator.js.map +1 -0
  34. package/lib/components/kernel/KernelInspector.d.ts +2 -2
  35. package/lib/components/kernel/KernelInspector.js.map +1 -1
  36. package/lib/components/kernel/KernelSelector.d.ts +2 -2
  37. package/lib/components/kernel/KernelSelector.js.map +1 -1
  38. package/lib/components/kernel/KernelUsage.d.ts +2 -2
  39. package/lib/components/kernel/KernelUsage.js.map +1 -1
  40. package/lib/components/kernel/KernelVariables.d.ts +2 -2
  41. package/lib/components/kernel/KernelVariables.js.map +1 -1
  42. package/lib/components/kernel/index.d.ts +1 -1
  43. package/lib/components/kernel/index.js +1 -1
  44. package/lib/components/kernel/index.js.map +1 -1
  45. package/lib/components/kernel/variables/kernelconnector.d.ts +2 -2
  46. package/lib/components/kernel/variables/kernelconnector.js +2 -2
  47. package/lib/components/kernel/variables/widget.d.ts +4 -2
  48. package/lib/components/kernel/variables/widget.js.map +1 -1
  49. package/lib/components/lumino/Lumino.d.ts +1 -1
  50. package/lib/components/lumino/LuminoBox.d.ts +3 -9
  51. package/lib/components/lumino/LuminoBox.js +1 -6
  52. package/lib/components/lumino/LuminoBox.js.map +1 -1
  53. package/lib/components/lumino/ReactPortalWidget.d.ts +1 -2
  54. package/lib/components/notebook/Notebook.d.ts +4 -6
  55. package/lib/components/notebook/Notebook.js +11 -26
  56. package/lib/components/notebook/Notebook.js.map +1 -1
  57. package/lib/components/notebook/Notebook2.d.ts +6 -2
  58. package/lib/components/notebook/Notebook2.js +3 -2
  59. package/lib/components/notebook/Notebook2.js.map +1 -1
  60. package/lib/components/notebook/Notebook2Adapter.d.ts +189 -0
  61. package/lib/components/notebook/Notebook2Adapter.js +554 -10
  62. package/lib/components/notebook/Notebook2Adapter.js.map +1 -1
  63. package/lib/components/notebook/Notebook2Base.d.ts +15 -9
  64. package/lib/components/notebook/Notebook2Base.js +89 -50
  65. package/lib/components/notebook/Notebook2Base.js.map +1 -1
  66. package/lib/components/notebook/Notebook2State.d.ts +35 -8
  67. package/lib/components/notebook/Notebook2State.js +74 -45
  68. package/lib/components/notebook/Notebook2State.js.map +1 -1
  69. package/lib/components/notebook/NotebookAdapter.d.ts +1 -0
  70. package/lib/components/notebook/NotebookAdapter.js +13 -8
  71. package/lib/components/notebook/NotebookAdapter.js.map +1 -1
  72. package/lib/components/notebook/NotebookCommands.d.ts +25 -2
  73. package/lib/components/notebook/NotebookCommands.js +89 -10
  74. package/lib/components/notebook/NotebookCommands.js.map +1 -1
  75. package/lib/components/notebook/NotebookState.d.ts +11 -11
  76. package/lib/components/notebook/cell/sidebar/CellSidebarButton.js +1 -1
  77. package/lib/components/notebook/cell/sidebar/CellSidebarExtension.d.ts +2 -4
  78. package/lib/components/notebook/cell/sidebar/CellSidebarExtension.js +1 -3
  79. package/lib/components/notebook/cell/sidebar/CellSidebarExtension.js.map +1 -1
  80. package/lib/components/notebook/index.d.ts +1 -0
  81. package/lib/components/notebook/index.js +1 -0
  82. package/lib/components/notebook/index.js.map +1 -1
  83. package/lib/components/notebook/model/JupyterReactNotebookModelFactory.d.ts +28 -1
  84. package/lib/components/notebook/model/JupyterReactNotebookModelFactory.js +15 -1
  85. package/lib/components/notebook/model/JupyterReactNotebookModelFactory.js.map +1 -1
  86. package/lib/components/output/Output.d.ts +11 -13
  87. package/lib/components/output/Output.js +19 -30
  88. package/lib/components/output/Output.js.map +1 -1
  89. package/lib/components/output/OutputIPyWidgets.d.ts +2 -2
  90. package/lib/components/output/OutputIPyWidgets.js.map +1 -1
  91. package/lib/components/output/OutputRenderer.d.ts +2 -2
  92. package/lib/components/output/OutputRenderer.js.map +1 -1
  93. package/lib/components/terminal/Terminal.d.ts +1 -4
  94. package/lib/components/terminal/Terminal.js +5 -8
  95. package/lib/components/terminal/Terminal.js.map +1 -1
  96. package/lib/components/viewer/Viewer.d.ts +1 -1
  97. package/lib/components/viewer/output/OutputViewer.d.ts +3 -6
  98. package/lib/components/viewer/output/OutputViewer.js +1 -5
  99. package/lib/components/viewer/output/OutputViewer.js.map +1 -1
  100. package/lib/examples/Bokeh.js +2 -2
  101. package/lib/examples/Bokeh.js.map +1 -1
  102. package/lib/examples/Bqplot.js +2 -2
  103. package/lib/examples/Bqplot.js.map +1 -1
  104. package/lib/examples/Cell.js +4 -4
  105. package/lib/examples/Cell.js.map +1 -1
  106. package/lib/examples/CellLite.js +16 -4
  107. package/lib/examples/CellLite.js.map +1 -1
  108. package/lib/examples/Cells.js +9 -6
  109. package/lib/examples/Cells.js.map +1 -1
  110. package/lib/examples/CellsExecute.js +13 -9
  111. package/lib/examples/CellsExecute.js.map +1 -1
  112. package/lib/examples/Console.js +2 -2
  113. package/lib/examples/Console.js.map +1 -1
  114. package/lib/examples/ConsoleLite.js +3 -3
  115. package/lib/examples/ConsoleLite.js.map +1 -1
  116. package/lib/examples/Dashboard.js +2 -2
  117. package/lib/examples/Dashboard.js.map +1 -1
  118. package/lib/examples/Deno.js +2 -2
  119. package/lib/examples/Deno.js.map +1 -1
  120. package/lib/examples/Examples.d.ts +23 -0
  121. package/lib/examples/Examples.js +342 -0
  122. package/lib/examples/Examples.js.map +1 -0
  123. package/lib/examples/FileBrowser.js +2 -2
  124. package/lib/examples/FileBrowser.js.map +1 -1
  125. package/lib/examples/GeoJson.js +2 -2
  126. package/lib/examples/GeoJson.js.map +1 -1
  127. package/lib/examples/IPyLeaflet.js +3 -3
  128. package/lib/examples/IPyLeaflet.js.map +1 -1
  129. package/lib/examples/IPyReact.js +3 -3
  130. package/lib/examples/IPyReact.js.map +1 -1
  131. package/lib/examples/IPyWidgets.js +3 -3
  132. package/lib/examples/IPyWidgets.js.map +1 -1
  133. package/lib/examples/IPyWidgetsState.js +3 -3
  134. package/lib/examples/IPyWidgetsState.js.map +1 -1
  135. package/lib/examples/JupyterContext.js +2 -2
  136. package/lib/examples/JupyterContext.js.map +1 -1
  137. package/lib/examples/JupyterLabAppHeadless.js +2 -2
  138. package/lib/examples/JupyterLabAppHeadless.js.map +1 -1
  139. package/lib/examples/JupyterLabAppHeadlessServerless.js +2 -2
  140. package/lib/examples/JupyterLabAppHeadlessServerless.js.map +1 -1
  141. package/lib/examples/JupyterLabAppServerless.js +2 -2
  142. package/lib/examples/JupyterLabAppServerless.js.map +1 -1
  143. package/lib/examples/JupyterLabAppServiceManager.js +2 -2
  144. package/lib/examples/JupyterLabAppServiceManager.js.map +1 -1
  145. package/lib/examples/JupyterLabTheme.js +2 -2
  146. package/lib/examples/JupyterLabTheme.js.map +1 -1
  147. package/lib/examples/KernelExecute.d.ts +1 -1
  148. package/lib/examples/KernelExecute.js +9 -11
  149. package/lib/examples/KernelExecute.js.map +1 -1
  150. package/lib/examples/KernelExecuteLite.d.ts +1 -0
  151. package/lib/examples/KernelExecuteLite.js +51 -0
  152. package/lib/examples/KernelExecuteLite.js.map +1 -0
  153. package/lib/examples/KernelExecutor.js +10 -9
  154. package/lib/examples/KernelExecutor.js.map +1 -1
  155. package/lib/examples/KernelExecutorLite.js +63 -0
  156. package/lib/examples/KernelExecutorLite.js.map +1 -0
  157. package/lib/examples/Kernels.js +6 -5
  158. package/lib/examples/Kernels.js.map +1 -1
  159. package/lib/examples/Lumino.js +2 -2
  160. package/lib/examples/Lumino.js.map +1 -1
  161. package/lib/examples/Matplotlib.js +10 -6
  162. package/lib/examples/Matplotlib.js.map +1 -1
  163. package/lib/examples/Notebook.js +3 -2
  164. package/lib/examples/Notebook.js.map +1 -1
  165. package/lib/examples/Notebook2.js +9 -6
  166. package/lib/examples/Notebook2.js.map +1 -1
  167. package/lib/examples/Notebook2Actions.js +8 -6
  168. package/lib/examples/Notebook2Actions.js.map +1 -1
  169. package/lib/examples/Notebook2Collaborative.js +2 -2
  170. package/lib/examples/Notebook2Collaborative.js.map +1 -1
  171. package/lib/examples/Notebook2Lite.js +19 -14
  172. package/lib/examples/Notebook2Lite.js.map +1 -1
  173. package/lib/examples/NotebookCellSidebar.js +3 -3
  174. package/lib/examples/NotebookCellSidebar.js.map +1 -1
  175. package/lib/examples/NotebookCellToolbar.js +4 -4
  176. package/lib/examples/NotebookCellToolbar.js.map +1 -1
  177. package/lib/examples/NotebookCollaborative.js +2 -2
  178. package/lib/examples/NotebookCollaborative.js.map +1 -1
  179. package/lib/examples/NotebookColormode.js +15 -10
  180. package/lib/examples/NotebookColormode.js.map +1 -1
  181. package/lib/examples/NotebookExtension.js +4 -4
  182. package/lib/examples/NotebookExtension.js.map +1 -1
  183. package/lib/examples/NotebookExternalContent.js +18 -13
  184. package/lib/examples/NotebookExternalContent.js.map +1 -1
  185. package/lib/examples/NotebookInit.js +10 -9
  186. package/lib/examples/NotebookInit.js.map +1 -1
  187. package/lib/examples/NotebookKernel.js +4 -4
  188. package/lib/examples/NotebookKernel.js.map +1 -1
  189. package/lib/examples/NotebookKernelChange.js +2 -2
  190. package/lib/examples/NotebookKernelChange.js.map +1 -1
  191. package/lib/examples/NotebookLess.js +4 -4
  192. package/lib/examples/NotebookLess.js.map +1 -1
  193. package/lib/examples/NotebookLite.js +10 -6
  194. package/lib/examples/NotebookLite.js.map +1 -1
  195. package/lib/examples/NotebookLiteContext.js +10 -5
  196. package/lib/examples/NotebookLiteContext.js.map +1 -1
  197. package/lib/examples/NotebookLocalServer.js +3 -3
  198. package/lib/examples/NotebookLocalServer.js.map +1 -1
  199. package/lib/examples/NotebookNbformat.js +7 -5
  200. package/lib/examples/NotebookNbformat.js.map +1 -1
  201. package/lib/examples/NotebookNbformatChange.js +12 -6
  202. package/lib/examples/NotebookNbformatChange.js.map +1 -1
  203. package/lib/examples/NotebookNoContext.js +4 -3
  204. package/lib/examples/NotebookNoContext.js.map +1 -1
  205. package/lib/examples/NotebookNoPrimer.js +3 -2
  206. package/lib/examples/NotebookNoPrimer.js.map +1 -1
  207. package/lib/examples/NotebookOnSessionConnection.js +5 -5
  208. package/lib/examples/NotebookOnSessionConnection.js.map +1 -1
  209. package/lib/examples/NotebookPath.js +2 -2
  210. package/lib/examples/NotebookPath.js.map +1 -1
  211. package/lib/examples/NotebookPathChange.js +5 -4
  212. package/lib/examples/NotebookPathChange.js.map +1 -1
  213. package/lib/examples/NotebookReadonly.js +4 -4
  214. package/lib/examples/NotebookReadonly.js.map +1 -1
  215. package/lib/examples/NotebookServiceManager.js +4 -4
  216. package/lib/examples/NotebookServiceManager.js.map +1 -1
  217. package/lib/examples/NotebookSkeleton.js +3 -2
  218. package/lib/examples/NotebookSkeleton.js.map +1 -1
  219. package/lib/examples/NotebookTOC.d.ts +1 -0
  220. package/lib/examples/{NotebookToc.js → NotebookTOC.js} +12 -6
  221. package/lib/examples/NotebookTOC.js.map +1 -0
  222. package/lib/examples/NotebookTheme.js +10 -5
  223. package/lib/examples/NotebookTheme.js.map +1 -1
  224. package/lib/examples/NotebookThemeColormode.js +4 -4
  225. package/lib/examples/NotebookThemeColormode.js.map +1 -1
  226. package/lib/examples/NotebookURL.js +3 -2
  227. package/lib/examples/NotebookURL.js.map +1 -1
  228. package/lib/examples/NotebookUnmount.js +13 -7
  229. package/lib/examples/NotebookUnmount.js.map +1 -1
  230. package/lib/examples/ObservableHQ.js +2 -2
  231. package/lib/examples/ObservableHQ.js.map +1 -1
  232. package/lib/examples/OutputIPyWidgets.js +3 -3
  233. package/lib/examples/OutputIPyWidgets.js.map +1 -1
  234. package/lib/examples/OutputWithMonitoring.js +3 -2
  235. package/lib/examples/OutputWithMonitoring.js.map +1 -1
  236. package/lib/examples/Outputs.js +8 -8
  237. package/lib/examples/Outputs.js.map +1 -1
  238. package/lib/examples/OutputsIpynb.js +4 -4
  239. package/lib/examples/OutputsIpynb.js.map +1 -1
  240. package/lib/examples/Panel.js +2 -2
  241. package/lib/examples/Panel.js.map +1 -1
  242. package/lib/examples/Plotly.js +2 -2
  243. package/lib/examples/Plotly.js.map +1 -1
  244. package/lib/examples/PyGWalker.js +4 -4
  245. package/lib/examples/PyGWalker.js.map +1 -1
  246. package/lib/examples/Terminal.js +4 -3
  247. package/lib/examples/Terminal.js.map +1 -1
  248. package/lib/examples/Vega.js +2 -2
  249. package/lib/examples/Vega.js.map +1 -1
  250. package/lib/examples/Viewer.js +5 -4
  251. package/lib/examples/Viewer.js.map +1 -1
  252. package/lib/examples/extensions/celltoolbar/CellToolbarComponent.js +1 -1
  253. package/lib/index.d.ts +1 -0
  254. package/lib/index.js +1 -0
  255. package/lib/index.js.map +1 -1
  256. package/lib/jupyter/Jupyter.d.ts +1 -74
  257. package/lib/jupyter/Jupyter.js +2 -9
  258. package/lib/jupyter/Jupyter.js.map +1 -1
  259. package/lib/jupyter/JupyterConfig.js +7 -5
  260. package/lib/jupyter/JupyterConfig.js.map +1 -1
  261. package/lib/jupyter/JupyterContext.d.ts +2 -2
  262. package/lib/jupyter/collaboration/ICollaborationProvider.js.map +1 -1
  263. package/lib/jupyter/ipywidgets/classic/htmlmanager.d.ts +6 -0
  264. package/lib/jupyter/ipywidgets/classic/htmlmanager.js +8 -0
  265. package/lib/jupyter/ipywidgets/classic/htmlmanager.js.map +1 -1
  266. package/lib/jupyter/ipywidgets/lab/manager.d.ts +6 -0
  267. package/lib/jupyter/ipywidgets/lab/manager.js +8 -0
  268. package/lib/jupyter/ipywidgets/lab/manager.js.map +1 -1
  269. package/lib/jupyter/ipywidgets/libembed-amd.d.ts +1 -1
  270. package/lib/jupyter/ipywidgets/libembed-amd.js +1 -1
  271. package/lib/jupyter/kernel/Kernel.js +21 -15
  272. package/lib/jupyter/kernel/Kernel.js.map +1 -1
  273. package/lib/jupyter/kernel/KernelState.d.ts +1 -1
  274. package/lib/jupyter/lite/Lite.d.ts +1 -1
  275. package/lib/jupyter/lite/LiteServer.d.ts +2 -2
  276. package/lib/jupyter/lite/LiteServer.js +21 -6
  277. package/lib/jupyter/lite/LiteServer.js.map +1 -1
  278. package/lib/jupyter/lite/contents/broadcast.d.ts +27 -0
  279. package/lib/jupyter/lite/contents/broadcast.js +60 -0
  280. package/lib/jupyter/lite/contents/broadcast.js.map +1 -0
  281. package/lib/jupyter/lite/contents/contents.d.ts +228 -0
  282. package/lib/jupyter/lite/contents/contents.js +774 -0
  283. package/lib/jupyter/lite/contents/contents.js.map +1 -0
  284. package/lib/jupyter/lite/contents/drivecontents.d.ts +92 -0
  285. package/lib/jupyter/lite/contents/drivecontents.js +133 -0
  286. package/lib/jupyter/lite/contents/drivecontents.js.map +1 -0
  287. package/lib/jupyter/lite/contents/drivefs.d.ts +193 -0
  288. package/lib/jupyter/lite/contents/drivefs.js +432 -0
  289. package/lib/jupyter/lite/contents/drivefs.js.map +1 -0
  290. package/lib/jupyter/lite/contents/emscripten.d.ts +89 -0
  291. package/lib/jupyter/lite/contents/emscripten.js +11 -0
  292. package/lib/jupyter/lite/contents/emscripten.js.map +1 -0
  293. package/lib/jupyter/lite/contents/index.d.ts +6 -0
  294. package/lib/jupyter/lite/contents/index.js +9 -0
  295. package/lib/jupyter/lite/contents/index.js.map +1 -0
  296. package/lib/jupyter/lite/contents/tokens.d.ts +136 -0
  297. package/lib/jupyter/lite/contents/tokens.js +66 -0
  298. package/lib/jupyter/lite/contents/tokens.js.map +1 -0
  299. package/lib/jupyter/lite/kernel/index.d.ts +4 -0
  300. package/lib/jupyter/lite/kernel/index.js +7 -0
  301. package/lib/jupyter/lite/kernel/index.js.map +1 -0
  302. package/lib/jupyter/lite/kernel/kernel.d.ts +245 -0
  303. package/lib/jupyter/lite/kernel/kernel.js +453 -0
  304. package/lib/jupyter/lite/kernel/kernel.js.map +1 -0
  305. package/lib/jupyter/lite/kernel/kernels.d.ts +85 -0
  306. package/lib/jupyter/lite/kernel/kernels.js +218 -0
  307. package/lib/jupyter/lite/kernel/kernels.js.map +1 -0
  308. package/lib/jupyter/lite/kernel/kernelspecs.d.ts +53 -0
  309. package/lib/jupyter/lite/kernel/kernelspecs.js +50 -0
  310. package/lib/jupyter/lite/kernel/kernelspecs.js.map +1 -0
  311. package/lib/jupyter/lite/kernel/tokens.d.ts +171 -0
  312. package/lib/jupyter/lite/kernel/tokens.js +16 -0
  313. package/lib/jupyter/lite/kernel/tokens.js.map +1 -0
  314. package/lib/jupyter/lite/licenses/index.d.ts +2 -0
  315. package/lib/jupyter/lite/licenses/index.js +5 -0
  316. package/lib/jupyter/lite/licenses/index.js.map +1 -0
  317. package/lib/jupyter/lite/licenses/licenses.d.ts +35 -0
  318. package/lib/jupyter/lite/licenses/licenses.js +95 -0
  319. package/lib/jupyter/lite/licenses/licenses.js.map +1 -0
  320. package/lib/jupyter/lite/licenses/tokens.d.ts +74 -0
  321. package/lib/jupyter/lite/licenses/tokens.js +13 -0
  322. package/lib/jupyter/lite/licenses/tokens.js.map +1 -0
  323. package/lib/jupyter/lite/localforage/index.d.ts +2 -0
  324. package/lib/jupyter/lite/localforage/index.js +5 -0
  325. package/lib/jupyter/lite/localforage/index.js.map +1 -0
  326. package/lib/jupyter/lite/localforage/memory.d.ts +5 -0
  327. package/lib/jupyter/lite/localforage/memory.js +10 -0
  328. package/lib/jupyter/lite/localforage/memory.js.map +1 -0
  329. package/lib/jupyter/lite/localforage/tokens.d.ts +12 -0
  330. package/lib/jupyter/lite/localforage/tokens.js +8 -0
  331. package/lib/jupyter/lite/localforage/tokens.js.map +1 -0
  332. package/lib/jupyter/lite/pyodide-kernel/_pypi.d.ts +18 -0
  333. package/lib/jupyter/lite/pyodide-kernel/_pypi.js +45 -0
  334. package/lib/jupyter/lite/pyodide-kernel/_pypi.js.map +1 -0
  335. package/lib/jupyter/lite/pyodide-kernel/coincident.worker.d.ts +15 -0
  336. package/lib/jupyter/lite/pyodide-kernel/coincident.worker.js +63 -0
  337. package/lib/jupyter/lite/pyodide-kernel/coincident.worker.js.map +1 -0
  338. package/lib/jupyter/lite/pyodide-kernel/comlink.worker.d.ts +9 -0
  339. package/lib/jupyter/lite/pyodide-kernel/comlink.worker.js +50 -0
  340. package/lib/jupyter/lite/pyodide-kernel/comlink.worker.js.map +1 -0
  341. package/lib/jupyter/lite/pyodide-kernel/index.d.ts +6 -0
  342. package/lib/jupyter/lite/pyodide-kernel/index.js +9 -0
  343. package/lib/jupyter/lite/pyodide-kernel/index.js.map +1 -0
  344. package/lib/jupyter/lite/pyodide-kernel/kernel.d.ts +157 -0
  345. package/lib/jupyter/lite/pyodide-kernel/kernel.js +294 -0
  346. package/lib/jupyter/lite/pyodide-kernel/kernel.js.map +1 -0
  347. package/lib/jupyter/lite/pyodide-kernel/pypi/all-local.json +128 -0
  348. package/lib/jupyter/lite/pyodide-kernel/pypi/all.json +128 -0
  349. package/lib/jupyter/lite/pyodide-kernel/schema/piplite.v0.schema.json +113 -0
  350. package/lib/jupyter/lite/pyodide-kernel/tokens.d.ts +82 -0
  351. package/lib/jupyter/lite/pyodide-kernel/tokens.js +8 -0
  352. package/lib/jupyter/lite/pyodide-kernel/tokens.js.map +1 -0
  353. package/lib/jupyter/lite/pyodide-kernel/worker.d.ts +138 -0
  354. package/lib/jupyter/lite/pyodide-kernel/worker.js +426 -0
  355. package/lib/jupyter/lite/pyodide-kernel/worker.js.map +1 -0
  356. package/lib/jupyter/lite/pyodide-kernel-extension/index.d.ts +4 -0
  357. package/lib/jupyter/lite/pyodide-kernel-extension/index.js +88 -0
  358. package/lib/jupyter/lite/pyodide-kernel-extension/index.js.map +1 -0
  359. package/lib/jupyter/lite/server/app.d.ts +87 -0
  360. package/lib/jupyter/lite/server/app.js +157 -0
  361. package/lib/jupyter/lite/server/app.js.map +1 -0
  362. package/lib/jupyter/lite/server/index.d.ts +4 -0
  363. package/lib/jupyter/lite/server/index.js +7 -0
  364. package/lib/jupyter/lite/server/index.js.map +1 -0
  365. package/lib/jupyter/lite/server/router.d.ts +99 -0
  366. package/lib/jupyter/lite/server/router.js +109 -0
  367. package/lib/jupyter/lite/server/router.js.map +1 -0
  368. package/lib/jupyter/lite/server/service-manager.d.ts +21 -0
  369. package/lib/jupyter/lite/server/service-manager.js +102 -0
  370. package/lib/jupyter/lite/server/service-manager.js.map +1 -0
  371. package/lib/jupyter/lite/server/service-worker.d.ts +58 -0
  372. package/lib/jupyter/lite/server/service-worker.js +145 -0
  373. package/lib/jupyter/lite/server/service-worker.js.map +1 -0
  374. package/lib/jupyter/lite/server/status.d.ts +18 -0
  375. package/lib/jupyter/lite/server/status.js +21 -0
  376. package/lib/jupyter/lite/server/status.js.map +1 -0
  377. package/lib/jupyter/lite/server/tokens.d.ts +38 -0
  378. package/lib/jupyter/lite/server/tokens.js +8 -0
  379. package/lib/jupyter/lite/server/tokens.js.map +1 -0
  380. package/lib/jupyter/lite/server-extension/index.d.ts +3 -0
  381. package/lib/jupyter/lite/server-extension/index.js +500 -0
  382. package/lib/jupyter/lite/server-extension/index.js.map +1 -0
  383. package/lib/jupyter/lite/session/index.d.ts +2 -0
  384. package/lib/jupyter/lite/session/index.js +5 -0
  385. package/lib/jupyter/lite/session/index.js.map +1 -0
  386. package/lib/jupyter/lite/session/sessions.d.ts +68 -0
  387. package/lib/jupyter/lite/session/sessions.js +185 -0
  388. package/lib/jupyter/lite/session/sessions.js.map +1 -0
  389. package/lib/jupyter/lite/session/tokens.d.ts +40 -0
  390. package/lib/jupyter/lite/session/tokens.js +6 -0
  391. package/lib/jupyter/lite/session/tokens.js.map +1 -0
  392. package/lib/jupyter/lite/settings/index.d.ts +2 -0
  393. package/lib/jupyter/lite/settings/index.js +5 -0
  394. package/lib/jupyter/lite/settings/index.js.map +1 -0
  395. package/lib/jupyter/lite/settings/settings.d.ts +75 -0
  396. package/lib/jupyter/lite/settings/settings.js +155 -0
  397. package/lib/jupyter/lite/settings/settings.js.map +1 -0
  398. package/lib/jupyter/lite/settings/tokens.d.ts +65 -0
  399. package/lib/jupyter/lite/settings/tokens.js +6 -0
  400. package/lib/jupyter/lite/settings/tokens.js.map +1 -0
  401. package/lib/jupyter/lite/translation/index.d.ts +2 -0
  402. package/lib/jupyter/lite/translation/index.js +5 -0
  403. package/lib/jupyter/lite/translation/index.js.map +1 -0
  404. package/lib/jupyter/lite/translation/tokens.d.ts +17 -0
  405. package/lib/jupyter/lite/translation/tokens.js +6 -0
  406. package/lib/jupyter/lite/translation/tokens.js.map +1 -0
  407. package/lib/jupyter/lite/translation/translation.d.ts +13 -0
  408. package/lib/jupyter/lite/translation/translation.js +52 -0
  409. package/lib/jupyter/lite/translation/translation.js.map +1 -0
  410. package/lib/jupyter/lite/types/index.d.ts +1 -0
  411. package/lib/jupyter/lite/types/index.js +4 -0
  412. package/lib/jupyter/lite/types/index.js.map +1 -0
  413. package/lib/jupyter/lite/types/tokens.d.ts +27 -0
  414. package/lib/jupyter/lite/types/tokens.js +4 -0
  415. package/lib/jupyter/lite/types/tokens.js.map +1 -0
  416. package/lib/jupyter/services/ServiceManagerLite.js +15 -6
  417. package/lib/jupyter/services/ServiceManagerLite.js.map +1 -1
  418. package/lib/state/JupyterReactState.js +7 -8
  419. package/lib/state/JupyterReactState.js.map +1 -1
  420. package/lib/theme/JupyterLabCss.d.ts +1 -1
  421. package/lib/theme/JupyterLabCss.js +4 -2
  422. package/lib/theme/JupyterLabCss.js.map +1 -1
  423. package/lib/theme/JupyterReactTheme.d.ts +1 -1
  424. package/lib/tools/__tests__/operationRunner.test.d.ts +1 -0
  425. package/lib/tools/__tests__/operationRunner.test.js +193 -0
  426. package/lib/tools/__tests__/operationRunner.test.js.map +1 -0
  427. package/lib/tools/core/executor.d.ts +46 -0
  428. package/lib/tools/core/executor.js +55 -0
  429. package/lib/tools/core/executor.js.map +1 -0
  430. package/lib/tools/core/formatter.d.ts +20 -0
  431. package/lib/tools/core/formatter.js +41 -0
  432. package/lib/tools/core/formatter.js.map +1 -0
  433. package/lib/tools/core/index.d.ts +18 -0
  434. package/lib/tools/core/index.js +24 -0
  435. package/lib/tools/core/index.js.map +1 -0
  436. package/lib/tools/core/interfaces.d.ts +38 -0
  437. package/lib/tools/core/interfaces.js +7 -0
  438. package/lib/tools/core/interfaces.js.map +1 -0
  439. package/lib/tools/core/operationRunner.d.ts +27 -0
  440. package/lib/tools/core/operationRunner.js +33 -0
  441. package/lib/tools/core/operationRunner.js.map +1 -0
  442. package/lib/tools/core/schema.d.ts +47 -0
  443. package/lib/tools/core/schema.js +7 -0
  444. package/lib/tools/core/schema.js.map +1 -0
  445. package/lib/tools/core/types.d.ts +36 -0
  446. package/lib/tools/core/types.js +7 -0
  447. package/lib/tools/core/types.js.map +1 -0
  448. package/lib/tools/core/zodUtils.d.ts +56 -0
  449. package/lib/tools/core/zodUtils.js +179 -0
  450. package/lib/tools/core/zodUtils.js.map +1 -0
  451. package/lib/tools/definitions/deleteCell.d.ts +7 -0
  452. package/lib/tools/definitions/deleteCell.js +25 -0
  453. package/lib/tools/definitions/deleteCell.js.map +1 -0
  454. package/lib/tools/definitions/executeCode.d.ts +7 -0
  455. package/lib/tools/definitions/executeCode.js +33 -0
  456. package/lib/tools/definitions/executeCode.js.map +1 -0
  457. package/lib/tools/definitions/index.d.ts +12 -0
  458. package/lib/tools/definitions/index.js +18 -0
  459. package/lib/tools/definitions/index.js.map +1 -0
  460. package/lib/tools/definitions/insertCell.d.ts +7 -0
  461. package/lib/tools/definitions/insertCell.js +24 -0
  462. package/lib/tools/definitions/insertCell.js.map +1 -0
  463. package/lib/tools/definitions/readAllCells.d.ts +7 -0
  464. package/lib/tools/definitions/readAllCells.js +24 -0
  465. package/lib/tools/definitions/readAllCells.js.map +1 -0
  466. package/lib/tools/definitions/readCell.d.ts +7 -0
  467. package/lib/tools/definitions/readCell.js +24 -0
  468. package/lib/tools/definitions/readCell.js.map +1 -0
  469. package/lib/tools/definitions/runCell.d.ts +7 -0
  470. package/lib/tools/definitions/runCell.js +31 -0
  471. package/lib/tools/definitions/runCell.js.map +1 -0
  472. package/lib/tools/definitions/updateCell.d.ts +7 -0
  473. package/lib/tools/definitions/updateCell.js +24 -0
  474. package/lib/tools/definitions/updateCell.js.map +1 -0
  475. package/lib/tools/index.d.ts +20 -0
  476. package/lib/tools/index.js +62 -0
  477. package/lib/tools/index.js.map +1 -0
  478. package/lib/tools/operations/deleteCell.d.ts +49 -0
  479. package/lib/tools/operations/deleteCell.js +103 -0
  480. package/lib/tools/operations/deleteCell.js.map +1 -0
  481. package/lib/tools/operations/executeCode.d.ts +33 -0
  482. package/lib/tools/operations/executeCode.js +45 -0
  483. package/lib/tools/operations/executeCode.js.map +1 -0
  484. package/lib/tools/operations/insertCell.d.ts +27 -0
  485. package/lib/tools/operations/insertCell.js +56 -0
  486. package/lib/tools/operations/insertCell.js.map +1 -0
  487. package/lib/tools/operations/readAllCells.d.ts +21 -0
  488. package/lib/tools/operations/readAllCells.js +45 -0
  489. package/lib/tools/operations/readAllCells.js.map +1 -0
  490. package/lib/tools/operations/readCell.d.ts +39 -0
  491. package/lib/tools/operations/readCell.js +90 -0
  492. package/lib/tools/operations/readCell.js.map +1 -0
  493. package/lib/tools/operations/runCell.d.ts +24 -0
  494. package/lib/tools/operations/runCell.js +124 -0
  495. package/lib/tools/operations/runCell.js.map +1 -0
  496. package/lib/tools/operations/updateCell.d.ts +27 -0
  497. package/lib/tools/operations/updateCell.js +53 -0
  498. package/lib/tools/operations/updateCell.js.map +1 -0
  499. package/lib/tools/schemas/deleteCell.d.ts +20 -0
  500. package/lib/tools/schemas/deleteCell.js +24 -0
  501. package/lib/tools/schemas/deleteCell.js.map +1 -0
  502. package/lib/tools/schemas/executeCode.d.ts +19 -0
  503. package/lib/tools/schemas/executeCode.js +28 -0
  504. package/lib/tools/schemas/executeCode.js.map +1 -0
  505. package/lib/tools/schemas/index.d.ts +12 -0
  506. package/lib/tools/schemas/index.js +18 -0
  507. package/lib/tools/schemas/index.js.map +1 -0
  508. package/lib/tools/schemas/insertCell.d.ts +24 -0
  509. package/lib/tools/schemas/insertCell.js +29 -0
  510. package/lib/tools/schemas/insertCell.js.map +1 -0
  511. package/lib/tools/schemas/readAllCells.d.ts +19 -0
  512. package/lib/tools/schemas/readAllCells.js +18 -0
  513. package/lib/tools/schemas/readAllCells.js.map +1 -0
  514. package/lib/tools/schemas/readCell.d.ts +19 -0
  515. package/lib/tools/schemas/readCell.js +24 -0
  516. package/lib/tools/schemas/readCell.js.map +1 -0
  517. package/lib/tools/schemas/runCell.d.ts +21 -0
  518. package/lib/tools/schemas/runCell.js +39 -0
  519. package/lib/tools/schemas/runCell.js.map +1 -0
  520. package/lib/tools/schemas/updateCell.d.ts +19 -0
  521. package/lib/tools/schemas/updateCell.js +21 -0
  522. package/lib/tools/schemas/updateCell.js.map +1 -0
  523. package/package.json +40 -28
  524. package/schema/kernel.v0.schema.json +42 -0
  525. package/style/icons/pyodide.svg +17 -0
  526. package/lib/components/kernel/Kernelndicator.js.map +0 -1
  527. package/lib/examples/NotebookToc.js.map +0 -1
  528. /package/lib/examples/{NotebookToc.d.ts → KernelExecutorLite.d.ts} +0 -0
@@ -0,0 +1,185 @@
1
+ import { PathExt } from '@jupyterlab/coreutils';
2
+ import { ArrayExt } from '@lumino/algorithm';
3
+ import { UUID } from '@lumino/coreutils';
4
+ /**
5
+ * A class to handle requests to /api/sessions
6
+ */
7
+ export class Sessions {
8
+ /**
9
+ * Construct a new Sessions.
10
+ *
11
+ * @param options The instantiation options for a Sessions.
12
+ */
13
+ constructor(options) {
14
+ this._kernels = options.kernels;
15
+ // Listen for kernel removals
16
+ this._kernels.changed.connect((_, args) => {
17
+ switch (args.type) {
18
+ case 'remove': {
19
+ const kernelId = args.oldValue?.id;
20
+ if (!kernelId) {
21
+ return;
22
+ }
23
+ // find the session associated with the kernel
24
+ const session = this._sessions.find(s => s.kernel?.id === kernelId);
25
+ if (!session) {
26
+ return;
27
+ }
28
+ // Track the kernel ID for restart detection
29
+ this._pendingRestarts.add(kernelId);
30
+ setTimeout(async () => {
31
+ // If after a short delay the kernel hasn't been re-added, it was terminated
32
+ if (this._pendingRestarts.has(kernelId)) {
33
+ this._pendingRestarts.delete(kernelId);
34
+ await this.shutdown(session.id);
35
+ }
36
+ }, 100);
37
+ break;
38
+ }
39
+ case 'add': {
40
+ // If this was a restart, remove it from pending
41
+ const kernelId = args.newValue?.id;
42
+ if (!kernelId) {
43
+ return;
44
+ }
45
+ this._pendingRestarts.delete(kernelId);
46
+ break;
47
+ }
48
+ }
49
+ });
50
+ }
51
+ /**
52
+ * Get a session by id.
53
+ *
54
+ * @param id The id of the session.
55
+ */
56
+ async get(id) {
57
+ const session = this._sessions.find(s => s.id === id);
58
+ if (!session) {
59
+ throw Error(`Session ${id} not found`);
60
+ }
61
+ return session;
62
+ }
63
+ /**
64
+ * List the running sessions
65
+ */
66
+ async list() {
67
+ return this._sessions;
68
+ }
69
+ /**
70
+ * Patch an existing session.
71
+ * This can be used to rename a session.
72
+ *
73
+ * - path updates session to track renamed paths
74
+ * - kernel.name starts a new kernel with a given kernelspec
75
+ *
76
+ * @param options The options to patch the session.
77
+ */
78
+ async patch(options) {
79
+ const { id, path, name, kernel } = options;
80
+ const index = this._sessions.findIndex(s => s.id === id);
81
+ const session = this._sessions[index];
82
+ if (!session) {
83
+ throw Error(`Session ${id} not found`);
84
+ }
85
+ const patched = {
86
+ ...session,
87
+ path: path ?? session.path,
88
+ name: name ?? session.name,
89
+ };
90
+ if (kernel) {
91
+ // Kernel id takes precedence over name.
92
+ if (kernel.id) {
93
+ const session = this._sessions.find(session => session.kernel?.id === kernel?.id);
94
+ if (session) {
95
+ patched.kernel = session.kernel;
96
+ }
97
+ }
98
+ else if (kernel.name) {
99
+ const newKernel = await this._kernels.startNew({
100
+ id: UUID.uuid4(),
101
+ name: kernel.name,
102
+ location: PathExt.dirname(patched.path),
103
+ });
104
+ if (newKernel) {
105
+ patched.kernel = newKernel;
106
+ }
107
+ // clean up the session on kernel shutdown
108
+ void this._handleKernelShutdown({
109
+ kernelId: newKernel.id,
110
+ sessionId: session.id,
111
+ });
112
+ }
113
+ }
114
+ this._sessions[index] = patched;
115
+ return patched;
116
+ }
117
+ /**
118
+ * Start a new session
119
+ * TODO: read path and name
120
+ *
121
+ * @param options The options to start a new session.
122
+ */
123
+ async startNew(options) {
124
+ const { path, name } = options;
125
+ const running = this._sessions.find(s => s.name === name);
126
+ if (running) {
127
+ return running;
128
+ }
129
+ const kernelName = options.kernel?.name ?? '';
130
+ const id = options.id ?? UUID.uuid4();
131
+ const nameOrPath = options.name ?? options.path;
132
+ const dirname = PathExt.dirname(options.name) || PathExt.dirname(options.path);
133
+ const hasDrive = nameOrPath.includes(':');
134
+ const driveName = hasDrive ? nameOrPath.split(':')[0] : '';
135
+ // add drive name if missing (top level directory)
136
+ const location = dirname.includes(driveName)
137
+ ? dirname
138
+ : `${driveName}:${dirname}`;
139
+ const kernel = await this._kernels.startNew({
140
+ id,
141
+ name: kernelName,
142
+ location,
143
+ });
144
+ const session = {
145
+ id,
146
+ path,
147
+ name: name ?? path,
148
+ type: 'notebook',
149
+ kernel: {
150
+ id: kernel.id,
151
+ name: kernel.name,
152
+ },
153
+ };
154
+ this._sessions.push(session);
155
+ // clean up the session on kernel shutdown
156
+ void this._handleKernelShutdown({ kernelId: id, sessionId: session.id });
157
+ return session;
158
+ }
159
+ /**
160
+ * Shut down a session.
161
+ *
162
+ * @param id The id of the session to shut down.
163
+ */
164
+ async shutdown(id) {
165
+ const session = this._sessions.find(s => s.id === id);
166
+ if (!session) {
167
+ throw Error(`Session ${id} not found`);
168
+ }
169
+ const kernelId = session.kernel?.id;
170
+ if (kernelId) {
171
+ await this._kernels.shutdown(kernelId);
172
+ }
173
+ ArrayExt.removeFirstOf(this._sessions, session);
174
+ }
175
+ /**
176
+ * Handle kernel shutdown
177
+ */
178
+ async _handleKernelShutdown({ kernelId, sessionId, }) {
179
+ // No need to handle kernel shutdown here anymore since we're using the changed signal
180
+ }
181
+ _kernels;
182
+ _sessions = [];
183
+ _pendingRestarts = new Set();
184
+ }
185
+ //# sourceMappingURL=sessions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessions.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/session/sessions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAA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,qBAAqB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;QAEzE,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAU;QACvB,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,KAAK,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QACzC,CAAC;QACD,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;QACpC,IAAI,QAAQ,EAAE,CAAC;YACb,MAAM,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;QACD,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,qBAAqB,CAAC,EAClC,QAAQ,EACR,SAAS,GAIV;QACC,sFAAsF;IACxF,CAAC;IAEO,QAAQ,CAAW;IACnB,SAAS,GAAqB,EAAE,CAAC;IACjC,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;CAC9C"}
@@ -0,0 +1,40 @@
1
+ import { Session } from '@jupyterlab/services';
2
+ import { Token } from '@lumino/coreutils';
3
+ /**
4
+ * The token for the sessions service.
5
+ */
6
+ export declare const ISessions: Token<ISessions>;
7
+ /**
8
+ * The interface for the sessions services.
9
+ */
10
+ export interface ISessions {
11
+ /**
12
+ * Get a session by id.
13
+ *
14
+ * @param id The id of the session.
15
+ */
16
+ get(id: string): Promise<Session.IModel>;
17
+ /**
18
+ * List the running sessions
19
+ */
20
+ list(): Promise<Session.IModel[]>;
21
+ /**
22
+ * Path an existing session.
23
+ * This can be used to rename a session.
24
+ *
25
+ * @param options The options to patch the session.
26
+ */
27
+ patch: (options: Session.IModel) => Promise<Session.IModel>;
28
+ /**
29
+ * Start a new session.
30
+ *
31
+ * @param options The options to start a new session.
32
+ */
33
+ startNew: (options: Session.IModel) => Promise<Session.IModel>;
34
+ /**
35
+ * Shut down a session.
36
+ *
37
+ * @param id The id of the session to shut down.
38
+ */
39
+ shutdown: (id: string) => Promise<void>;
40
+ }
@@ -0,0 +1,6 @@
1
+ import { Token } from '@lumino/coreutils';
2
+ /**
3
+ * The token for the sessions service.
4
+ */
5
+ export const ISessions = new Token('@jupyterlite/session:ISessions');
6
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/session/tokens.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,KAAK,CAAY,gCAAgC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './settings';
2
+ export * from './tokens';
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Jupyter Development Team.
2
+ // Distributed under the terms of the Modified BSD License.
3
+ export * from './settings';
4
+ export * from './tokens';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/settings/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,75 @@
1
+ import type localforage from 'localforage';
2
+ import { IPlugin, ISettings } from './tokens';
3
+ /**
4
+ * A class to handle requests to /api/settings
5
+ */
6
+ export declare class Settings implements ISettings {
7
+ constructor(options: Settings.IOptions);
8
+ /**
9
+ * A promise that resolves when the settings storage is fully initialized
10
+ */
11
+ get ready(): Promise<void>;
12
+ /**
13
+ * A lazy reference to initialized storage
14
+ */
15
+ protected get storage(): Promise<LocalForage>;
16
+ /**
17
+ * Finish any initialization after server has started and all extensions are applied.
18
+ */
19
+ initialize(): Promise<void>;
20
+ /**
21
+ * Prepare the storage
22
+ */
23
+ protected initStorage(): Promise<void>;
24
+ /**
25
+ * Get default options for localForage instances
26
+ */
27
+ protected get defaultStorageOptions(): LocalForageOptions;
28
+ /**
29
+ * Create a settings store.
30
+ */
31
+ protected defaultSettingsStorage(): LocalForage;
32
+ /**
33
+ * Get settings by plugin id
34
+ *
35
+ * @param pluginId the id of the plugin
36
+ *
37
+ */
38
+ get(pluginId: string): Promise<IPlugin | undefined>;
39
+ /**
40
+ * Get all the settings
41
+ */
42
+ getAll(): Promise<{
43
+ settings: IPlugin[];
44
+ }>;
45
+ /**
46
+ * Save settings for a given plugin id
47
+ *
48
+ * @param pluginId The id of the plugin
49
+ * @param raw The raw settings
50
+ *
51
+ */
52
+ save(pluginId: string, raw: string): Promise<void>;
53
+ /**
54
+ * Get all the settings for core or federated plugins
55
+ */
56
+ private _getAll;
57
+ private _storageName;
58
+ private _storageDrivers;
59
+ private _storage;
60
+ private _localforage;
61
+ private _ready;
62
+ }
63
+ /**
64
+ * A namespace for settings metadata.
65
+ */
66
+ export declare namespace Settings {
67
+ /**
68
+ * Initialization options for settings.
69
+ */
70
+ interface IOptions {
71
+ localforage: typeof localforage;
72
+ storageName?: string | null;
73
+ storageDrivers?: string[] | null;
74
+ }
75
+ }
@@ -0,0 +1,155 @@
1
+ import { PageConfig, URLExt } from '@jupyterlab/coreutils';
2
+ import { PromiseDelegate } from '@lumino/coreutils';
3
+ import * as json5 from 'json5';
4
+ /**
5
+ * The name of the local storage.
6
+ */
7
+ const DEFAULT_STORAGE_NAME = 'JupyterLite Storage';
8
+ /**
9
+ * A class to handle requests to /api/settings
10
+ */
11
+ export class Settings {
12
+ constructor(options) {
13
+ this._localforage = options.localforage;
14
+ this._storageName = options.storageName || DEFAULT_STORAGE_NAME;
15
+ this._storageDrivers = options.storageDrivers || null;
16
+ this._ready = new PromiseDelegate();
17
+ }
18
+ /**
19
+ * A promise that resolves when the settings storage is fully initialized
20
+ */
21
+ get ready() {
22
+ return this._ready.promise;
23
+ }
24
+ /**
25
+ * A lazy reference to initialized storage
26
+ */
27
+ get storage() {
28
+ return this.ready.then(() => this._storage);
29
+ }
30
+ /**
31
+ * Finish any initialization after server has started and all extensions are applied.
32
+ */
33
+ async initialize() {
34
+ await this.initStorage();
35
+ this._ready.resolve(void 0);
36
+ }
37
+ /**
38
+ * Prepare the storage
39
+ */
40
+ async initStorage() {
41
+ this._storage = this.defaultSettingsStorage();
42
+ }
43
+ /**
44
+ * Get default options for localForage instances
45
+ */
46
+ get defaultStorageOptions() {
47
+ const driver = this._storageDrivers?.length ? this._storageDrivers : null;
48
+ return {
49
+ version: 1,
50
+ name: this._storageName,
51
+ ...(driver ? { driver } : {}),
52
+ };
53
+ }
54
+ /**
55
+ * Create a settings store.
56
+ */
57
+ defaultSettingsStorage() {
58
+ return this._localforage.createInstance({
59
+ description: 'Offline Storage for Settings',
60
+ storeName: 'settings',
61
+ ...this.defaultStorageOptions,
62
+ });
63
+ }
64
+ /**
65
+ * Get settings by plugin id
66
+ *
67
+ * @param pluginId the id of the plugin
68
+ *
69
+ */
70
+ async get(pluginId) {
71
+ const all = await this.getAll();
72
+ const settings = all.settings;
73
+ const setting = settings.find((setting) => {
74
+ return setting.id === pluginId;
75
+ });
76
+ return setting;
77
+ }
78
+ /**
79
+ * Get all the settings
80
+ */
81
+ async getAll() {
82
+ const allCore = await this._getAll('all.json');
83
+ let allFederated = [];
84
+ try {
85
+ allFederated = await this._getAll('all_federated.json');
86
+ }
87
+ catch {
88
+ // handle the case where there is no federated extension
89
+ }
90
+ // JupyterLab 4 expects all settings to be returned in one go
91
+ // so append the settings from federated plugins to the core ones
92
+ const all = allCore.concat(allFederated);
93
+ // return existing user settings if they exist
94
+ const storage = await this.storage;
95
+ const settings = await Promise.all(all.map(async (plugin) => {
96
+ const { id } = plugin;
97
+ const raw = (await storage.getItem(id)) ?? plugin.raw;
98
+ return {
99
+ ...Private.override(plugin),
100
+ raw,
101
+ settings: json5.parse(raw),
102
+ };
103
+ }));
104
+ return { settings };
105
+ }
106
+ /**
107
+ * Save settings for a given plugin id
108
+ *
109
+ * @param pluginId The id of the plugin
110
+ * @param raw The raw settings
111
+ *
112
+ */
113
+ async save(pluginId, raw) {
114
+ await (await this.storage).setItem(pluginId, raw);
115
+ }
116
+ /**
117
+ * Get all the settings for core or federated plugins
118
+ */
119
+ async _getAll(file) {
120
+ const settingsUrl = PageConfig.getOption('settingsUrl') ?? '/';
121
+ const all = (await (await fetch(URLExt.join(settingsUrl, file))).json());
122
+ return all;
123
+ }
124
+ _storageName = DEFAULT_STORAGE_NAME;
125
+ _storageDrivers = null;
126
+ _storage;
127
+ _localforage;
128
+ _ready;
129
+ }
130
+ /**
131
+ * A namespace for private data
132
+ */
133
+ var Private;
134
+ (function (Private) {
135
+ const _overrides = JSON.parse(PageConfig.getOption('settingsOverrides') || '{}');
136
+ /**
137
+ * Override the defaults of the schema with ones from PageConfig
138
+ *
139
+ * @see https://github.com/jupyterlab/jupyterlab_server/blob/v2.5.2/jupyterlab_server/settings_handler.py#L216-L227
140
+ */
141
+ function override(plugin) {
142
+ if (_overrides[plugin.id]) {
143
+ if (!plugin.schema.properties) {
144
+ // probably malformed, or only provides keyboard shortcuts, etc.
145
+ plugin.schema.properties = {};
146
+ }
147
+ for (const [prop, propDefault] of Object.entries(_overrides[plugin.id] || {})) {
148
+ plugin.schema.properties[prop].default = propDefault;
149
+ }
150
+ }
151
+ return plugin;
152
+ }
153
+ Private.override = override;
154
+ })(Private || (Private = {}));
155
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/settings/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAA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AAI,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;gBAC9B,gEAAgE;gBAChE,MAAM,CAAC,MAAM,CAAC,UAAU,GAAG,EAAE,CAAC;YAChC,CAAC;YACD,KAAK,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAC9C,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAC5B,EAAE,CAAC;gBACF,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,OAAO,GAAG,WAAW,CAAC;YACvD,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAbe,gBAAQ,WAavB,CAAA;AACH,CAAC,EAxBS,OAAO,KAAP,OAAO,QAwBhB"}
@@ -0,0 +1,65 @@
1
+ import { ISettingRegistry } from '@jupyterlab/settingregistry';
2
+ import { JSONObject, PartialJSONObject, Token } from '@lumino/coreutils';
3
+ /**
4
+ * The token for the settings service.
5
+ */
6
+ export declare const ISettings: Token<ISettings>;
7
+ /**
8
+ * The settings file to request
9
+ */
10
+ export type SettingsFile = 'all.json' | 'all_federated.json';
11
+ /**
12
+ * An interface for the plugin settings.
13
+ */
14
+ export interface IPlugin extends PartialJSONObject {
15
+ /**
16
+ * The name of the plugin.
17
+ */
18
+ id: string;
19
+ /**
20
+ * The settings for the plugin.
21
+ */
22
+ settings: JSONObject;
23
+ /**
24
+ * The raw user settings data as a string containing JSON with comments.
25
+ */
26
+ raw: string;
27
+ /**
28
+ * The JSON schema for the plugin.
29
+ */
30
+ schema: ISettingRegistry.ISchema;
31
+ /**
32
+ * The published version of the NPM package containing the plugin.
33
+ */
34
+ version: string;
35
+ }
36
+ /**
37
+ * The interface for the Settings service.
38
+ */
39
+ export interface ISettings {
40
+ /**
41
+ * A promise that resolves after the settings have been full initialized
42
+ */
43
+ ready: Promise<void>;
44
+ /**
45
+ * Get settings by plugin id
46
+ *
47
+ * @param pluginId the id of the plugin
48
+ *
49
+ */
50
+ get(pluginId: string): Promise<IPlugin | undefined>;
51
+ /**
52
+ * Get all the settings
53
+ */
54
+ getAll(): Promise<{
55
+ settings: IPlugin[];
56
+ }>;
57
+ /**
58
+ * Save settings for a given plugin id
59
+ *
60
+ * @param pluginId The id of the plugin
61
+ * @param raw The raw settings
62
+ *
63
+ */
64
+ save(pluginId: string, raw: string): Promise<void>;
65
+ }
@@ -0,0 +1,6 @@
1
+ import { Token } from '@lumino/coreutils';
2
+ /**
3
+ * The token for the settings service.
4
+ */
5
+ export const ISettings = new Token('@jupyterlite/settings:ISettings');
6
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/settings/tokens.ts"],"names":[],"mappings":"AACA,OAAO,EAAiC,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEzE;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,KAAK,CAChC,iCAAiC,CAClC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './translation';
2
+ export * from './tokens';
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Jupyter Development Team.
2
+ // Distributed under the terms of the Modified BSD License.
3
+ export * from './translation';
4
+ export * from './tokens';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/translation/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { JSONObject, Token } from '@lumino/coreutils';
2
+ /**
3
+ * The token for the settings service.
4
+ */
5
+ export declare const ITranslation: Token<ITranslation>;
6
+ /**
7
+ * The interface for the Translation service.
8
+ */
9
+ export interface ITranslation {
10
+ /**
11
+ * Get the translation data for a given locale
12
+ *
13
+ * @param locale the locale
14
+ *
15
+ */
16
+ get(locale: string): Promise<JSONObject>;
17
+ }
@@ -0,0 +1,6 @@
1
+ import { Token } from '@lumino/coreutils';
2
+ /**
3
+ * The token for the settings service.
4
+ */
5
+ export const ITranslation = new Token('@jupyterlite/translation:ITranslation');
6
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/translation/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,KAAK,CACnC,uCAAuC,CACxC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { JSONObject } from '@lumino/coreutils';
2
+ /**
3
+ * A class to handle requests to /api/translations
4
+ */
5
+ export declare class Translation {
6
+ /**
7
+ * Get the translation data for the given locale
8
+ * @param locale The locale
9
+ * @returns
10
+ */
11
+ get(locale: string): Promise<JSONObject>;
12
+ private _prevLocale;
13
+ }