@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,74 @@
1
+ import { ReadonlyJSONObject, Token } from '@lumino/coreutils';
2
+ /**
3
+ * The well-known name of the file. Can actually be configured by alternate
4
+ * implementations, but the default is probably good enough for "best-effort."
5
+ */
6
+ export declare const THIRD_PARTY_LICENSES = "third-party-licenses.json";
7
+ /**
8
+ * The token for the licenses service.
9
+ */
10
+ export declare const ILicenses: Token<ILicenses>;
11
+ /**
12
+ * The interface for the Settings service.
13
+ */
14
+ export interface ILicenses {
15
+ /**
16
+ * Get licenses
17
+ *
18
+ */
19
+ get(): Promise<ILicenseResponse | undefined>;
20
+ }
21
+ /**
22
+ * A named bundle of licenses
23
+ */
24
+ export interface ILicenseBundles {
25
+ [key: string]: ILicenseBundle;
26
+ }
27
+ /**
28
+ * The JSON response from the API
29
+ */
30
+ export interface ILicenseResponse {
31
+ bundles: ILicenseBundles;
32
+ }
33
+ /**
34
+ * A top-level report of the licenses for all code included in a bundle
35
+ *
36
+ * Note
37
+ *
38
+ * This is roughly informed by the terms defined in the SPDX spec, though is not
39
+ * an SPDX Document, since there seem to be several (incompatible) specs
40
+ * in that repo.
41
+ *
42
+ * @see https://github.com/spdx/spdx-spec/blob/development/v2.2.1/schemas/spdx-schema.json
43
+ **/
44
+ export interface ILicenseBundle extends ReadonlyJSONObject {
45
+ packages: IPackageLicenseInfo[];
46
+ }
47
+ /**
48
+ * A best-effort single bundled package's information.
49
+ *
50
+ * Note
51
+ *
52
+ * This is roughly informed by SPDX `packages` and `hasExtractedLicenseInfos`,
53
+ * as making it conformant would vastly complicate the structure.
54
+ *
55
+ * @see https://github.com/spdx/spdx-spec/blob/development/v2.2.1/schemas/spdx-schema.json
56
+ **/
57
+ export interface IPackageLicenseInfo extends ReadonlyJSONObject {
58
+ /**
59
+ * the name of the package as it appears in package.json
60
+ */
61
+ name: string;
62
+ /**
63
+ * the version of the package, or an empty string if unknown
64
+ */
65
+ versionInfo: string;
66
+ /**
67
+ * an SPDX license identifier or LicenseRef, or an empty string if unknown
68
+ */
69
+ licenseId: string;
70
+ /**
71
+ * the verbatim extracted text of the license, or an empty string if unknown
72
+ */
73
+ extractedText: string;
74
+ }
@@ -0,0 +1,13 @@
1
+ // Copyright (c) Jupyter Development Team.
2
+ // Distributed under the terms of the Modified BSD License.
3
+ import { Token } from '@lumino/coreutils';
4
+ /**
5
+ * The well-known name of the file. Can actually be configured by alternate
6
+ * implementations, but the default is probably good enough for "best-effort."
7
+ */
8
+ export const THIRD_PARTY_LICENSES = 'third-party-licenses.json';
9
+ /**
10
+ * The token for the licenses service.
11
+ */
12
+ export const ILicenses = new Token('@jupyterlite/licenses:ILicenses');
13
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/licenses/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,OAAO,EAAsB,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;;GAGG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,KAAK,CAChC,iCAAiC,CAClC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './tokens';
2
+ export * from './memory';
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Jupyter Development Team.
2
+ // Distributed under the terms of the Modified BSD License.
3
+ export * from './tokens';
4
+ export * from './memory';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/localforage/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type localforage from 'localforage';
2
+ /**
3
+ * Ensure a localforage singleton has had the memory storage driver installed
4
+ */
5
+ export declare function ensureMemoryStorage(theLocalforage: typeof localforage): Promise<void>;
@@ -0,0 +1,10 @@
1
+ // Copyright (c) Jupyter Development Team.
2
+ // Distributed under the terms of the Modified BSD License.
3
+ import memoryStorageDriver from 'localforage-memoryStorageDriver';
4
+ /**
5
+ * Ensure a localforage singleton has had the memory storage driver installed
6
+ */
7
+ export async function ensureMemoryStorage(theLocalforage) {
8
+ return await theLocalforage.defineDriver(memoryStorageDriver);
9
+ }
10
+ //# sourceMappingURL=memory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/localforage/memory.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAG3D,OAAO,mBAAmB,MAAM,iCAAiC,CAAC;AAElE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,cAAkC;IAElC,OAAO,MAAM,cAAc,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;AAChE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type localforage from 'localforage';
2
+ import { Token } from '@lumino/coreutils';
3
+ /**
4
+ * The token for the localforage singleton.
5
+ */
6
+ export declare const ILocalForage: Token<ILocalForage>;
7
+ /**
8
+ * An interface for the localforage singleton.
9
+ */
10
+ export interface ILocalForage {
11
+ localforage: typeof localforage;
12
+ }
@@ -0,0 +1,8 @@
1
+ // Copyright (c) Jupyter Development Team.
2
+ // Distributed under the terms of the Modified BSD License.
3
+ import { Token } from '@lumino/coreutils';
4
+ /**
5
+ * The token for the localforage singleton.
6
+ */
7
+ export const ILocalForage = new Token('@jupyterlite/localforge:ILocalForage');
8
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/localforage/tokens.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAI3D,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,KAAK,CACnC,sCAAsC,CACvC,CAAC"}
@@ -0,0 +1,18 @@
1
+ export declare const allJSONUrl: {
2
+ readonly default: string;
3
+ };
4
+ export declare const ipykernelWheelUrl: {
5
+ readonly default: string;
6
+ };
7
+ export declare const pipliteWheelUrl: {
8
+ readonly default: string;
9
+ };
10
+ export declare const pyodide_kernelWheelUrl: {
11
+ readonly default: string;
12
+ };
13
+ export declare const widgetsnbextensionWheelUrl: {
14
+ readonly default: string;
15
+ };
16
+ export declare const widgetsnbextensionWheelUrl1: {
17
+ readonly default: string;
18
+ };
@@ -0,0 +1,45 @@
1
+ // Wheel URLs must be full HTTP URLs for micropip to recognize as remote
2
+ // We construct them at runtime using the origin
3
+ // Helper to get the base URL - works in both main thread and workers
4
+ function getBaseUrl() {
5
+ if (typeof window !== 'undefined') {
6
+ return window.location.origin;
7
+ }
8
+ if (typeof self !== 'undefined' && 'location' in self) {
9
+ return self.location.origin;
10
+ }
11
+ return '';
12
+ }
13
+ // Export as namespace objects with default property to match the original API
14
+ // The URLs are getters so they're resolved at runtime
15
+ export const allJSONUrl = {
16
+ get default() {
17
+ return `${getBaseUrl()}/pypi/all.json`;
18
+ },
19
+ };
20
+ export const ipykernelWheelUrl = {
21
+ get default() {
22
+ return `${getBaseUrl()}/pypi/ipykernel-6.9.2-py3-none-any.whl`;
23
+ },
24
+ };
25
+ export const pipliteWheelUrl = {
26
+ get default() {
27
+ return `${getBaseUrl()}/pypi/piplite-0.5.1-py3-none-any.whl`;
28
+ },
29
+ };
30
+ export const pyodide_kernelWheelUrl = {
31
+ get default() {
32
+ return `${getBaseUrl()}/pypi/pyodide_kernel-0.5.1-py3-none-any.whl`;
33
+ },
34
+ };
35
+ export const widgetsnbextensionWheelUrl = {
36
+ get default() {
37
+ return `${getBaseUrl()}/pypi/widgetsnbextension-3.6.999-py3-none-any.whl`;
38
+ },
39
+ };
40
+ export const widgetsnbextensionWheelUrl1 = {
41
+ get default() {
42
+ return `${getBaseUrl()}/pypi/widgetsnbextension-4.0.999-py3-none-any.whl`;
43
+ },
44
+ };
45
+ //# sourceMappingURL=_pypi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_pypi.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/pyodide-kernel/_pypi.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,gDAAgD;AAEhD,qEAAqE;AACrE,SAAS,UAAU;IACjB,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IAChC,CAAC;IACD,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;QACtD,OAAQ,IAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;IACvC,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,8EAA8E;AAC9E,sDAAsD;AACtD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,OAAO;QACT,OAAO,GAAG,UAAU,EAAE,gBAAgB,CAAC;IACzC,CAAC;CACF,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,OAAO;QACT,OAAO,GAAG,UAAU,EAAE,wCAAwC,CAAC;IACjE,CAAC;CACF,CAAC;AACF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,OAAO;QACT,OAAO,GAAG,UAAU,EAAE,sCAAsC,CAAC;IAC/D,CAAC;CACF,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,OAAO;QACT,OAAO,GAAG,UAAU,EAAE,6CAA6C,CAAC;IACtE,CAAC;CACF,CAAC;AACF,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,IAAI,OAAO;QACT,OAAO,GAAG,UAAU,EAAE,mDAAmD,CAAC;IAC5E,CAAC;CACF,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,IAAI,OAAO;QACT,OAAO,GAAG,UAAU,EAAE,mDAAmD,CAAC;IAC5E,CAAC;CACF,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { ContentsAPI, TDriveMethod, TDriveRequest, TDriveResponse } from '@jupyterlite/contents';
2
+ import { IPyodideWorkerKernel } from './tokens';
3
+ import { PyodideRemoteKernel } from './worker';
4
+ /**
5
+ * An Emscripten-compatible synchronous Contents API using shared array buffers.
6
+ */
7
+ export declare class SharedBufferContentsAPI extends ContentsAPI {
8
+ request<T extends TDriveMethod>(data: TDriveRequest<T>): TDriveResponse<T>;
9
+ }
10
+ export declare class PyodideCoincidentKernel extends PyodideRemoteKernel {
11
+ /**
12
+ * Setup custom Emscripten FileSystem
13
+ */
14
+ protected initFilesystem(options: IPyodideWorkerKernel.IOptions): Promise<void>;
15
+ }
@@ -0,0 +1,63 @@
1
+ // Copyright (c) Jupyter Development Team.
2
+ // Distributed under the terms of the Modified BSD License.
3
+ /**
4
+ * A WebWorker entrypoint that uses coincident to handle postMessage details
5
+ */
6
+ import coincident from 'coincident';
7
+ import { ContentsAPI, DriveFS, } from '@jupyterlite/contents';
8
+ import { PyodideRemoteKernel } from './worker';
9
+ const workerAPI = coincident(self);
10
+ /**
11
+ * An Emscripten-compatible synchronous Contents API using shared array buffers.
12
+ */
13
+ export class SharedBufferContentsAPI extends ContentsAPI {
14
+ request(data) {
15
+ return workerAPI.processDriveRequest(data);
16
+ }
17
+ }
18
+ /**
19
+ * A custom drive implementation which uses shared array buffers (via coincident) if available
20
+ */
21
+ class PyodideDriveFS extends DriveFS {
22
+ createAPI(options) {
23
+ return new SharedBufferContentsAPI(options.driveName, options.mountpoint, options.FS, options.ERRNO_CODES);
24
+ }
25
+ }
26
+ export class PyodideCoincidentKernel extends PyodideRemoteKernel {
27
+ /**
28
+ * Setup custom Emscripten FileSystem
29
+ */
30
+ async initFilesystem(options) {
31
+ if (options.mountDrive) {
32
+ const mountpoint = '/drive';
33
+ const { FS, PATH, ERRNO_CODES } = this._pyodide;
34
+ const { baseUrl } = options;
35
+ const driveFS = new PyodideDriveFS({
36
+ FS: FS,
37
+ PATH,
38
+ ERRNO_CODES,
39
+ baseUrl,
40
+ driveName: this._driveName,
41
+ mountpoint,
42
+ });
43
+ FS.mkdirTree(mountpoint);
44
+ FS.mount(driveFS, {}, mountpoint);
45
+ FS.chdir(mountpoint);
46
+ this._driveFS = driveFS;
47
+ }
48
+ }
49
+ }
50
+ const worker = new PyodideCoincidentKernel();
51
+ const sendWorkerMessage = workerAPI.processWorkerMessage.bind(workerAPI);
52
+ worker.registerCallback(sendWorkerMessage);
53
+ workerAPI.initialize = worker.initialize.bind(worker);
54
+ workerAPI.execute = worker.execute.bind(worker);
55
+ workerAPI.complete = worker.complete.bind(worker);
56
+ workerAPI.inspect = worker.inspect.bind(worker);
57
+ workerAPI.isComplete = worker.isComplete.bind(worker);
58
+ workerAPI.commInfo = worker.commInfo.bind(worker);
59
+ workerAPI.commOpen = worker.commOpen.bind(worker);
60
+ workerAPI.commMsg = worker.commMsg.bind(worker);
61
+ workerAPI.commClose = worker.commClose.bind(worker);
62
+ workerAPI.inputReply = worker.inputReply.bind(worker);
63
+ //# sourceMappingURL=coincident.worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coincident.worker.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/pyodide-kernel/coincident.worker.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D;;GAEG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EACL,WAAW,EACX,OAAO,GAIR,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAyB,CAAC;AAE3D;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,WAAW;IACtD,OAAO,CAAyB,IAAsB;QACpD,OAAO,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;CACF;AAED;;GAEG;AACH,MAAM,cAAe,SAAQ,OAAO;IAClC,SAAS,CAAC,OAAyB;QACjC,OAAO,IAAI,uBAAuB,CAChC,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,UAAU,EAClB,OAAO,CAAC,EAAE,EACV,OAAO,CAAC,WAAW,CACpB,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,uBAAwB,SAAQ,mBAAmB;IAC9D;;OAEG;IACO,KAAK,CAAC,cAAc,CAC5B,OAAsC;QAEtC,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,MAAM,UAAU,GAAG,QAAQ,CAAC;YAC5B,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;YAChD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;YAE5B,MAAM,OAAO,GAAG,IAAI,cAAc,CAAC;gBACjC,EAAE,EAAE,EAAS;gBACb,IAAI;gBACJ,WAAW;gBACX,OAAO;gBACP,SAAS,EAAE,IAAI,CAAC,UAAU;gBAC1B,UAAU;aACX,CAAC,CAAC;YACH,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACzB,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;YAClC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACrB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QAC1B,CAAC;IACH,CAAC;CACF;AAED,MAAM,MAAM,GAAG,IAAI,uBAAuB,EAAE,CAAC;AAE7C,MAAM,iBAAiB,GAAG,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AACzE,MAAM,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;AAE3C,SAAS,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACtD,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAChD,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAClD,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAChD,SAAS,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACtD,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAClD,SAAS,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAClD,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAChD,SAAS,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACpD,SAAS,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { IPyodideWorkerKernel } from './tokens';
2
+ import { PyodideRemoteKernel } from './worker';
3
+ export declare class PyodideComlinkKernel extends PyodideRemoteKernel {
4
+ constructor();
5
+ /**
6
+ * Setup custom Emscripten FileSystem
7
+ */
8
+ protected initFilesystem(options: IPyodideWorkerKernel.IOptions): Promise<void>;
9
+ }
@@ -0,0 +1,50 @@
1
+ // Copyright (c) Jupyter Development Team.
2
+ // Distributed under the terms of the Modified BSD License.
3
+ /**
4
+ * A WebWorker entrypoint that uses comlink to handle postMessage details
5
+ */
6
+ import { expose } from 'comlink';
7
+ import { DriveFS, ServiceWorkerContentsAPI, } from '@jupyterlite/contents';
8
+ import { PyodideRemoteKernel } from './worker';
9
+ /**
10
+ * A custom drive implementation which uses the service worker
11
+ */
12
+ class PyodideDriveFS extends DriveFS {
13
+ createAPI(options) {
14
+ return new ServiceWorkerContentsAPI(options.baseUrl, options.driveName, options.mountpoint, options.FS, options.ERRNO_CODES);
15
+ }
16
+ }
17
+ export class PyodideComlinkKernel extends PyodideRemoteKernel {
18
+ constructor() {
19
+ super();
20
+ this._sendWorkerMessage = (msg) => {
21
+ // use postMessage, but in a format, that comlink would not process.
22
+ postMessage({ _kernelMessage: msg });
23
+ };
24
+ }
25
+ /**
26
+ * Setup custom Emscripten FileSystem
27
+ */
28
+ async initFilesystem(options) {
29
+ if (options.mountDrive) {
30
+ const mountpoint = '/drive';
31
+ const { FS, PATH, ERRNO_CODES } = this._pyodide;
32
+ const { baseUrl } = options;
33
+ const driveFS = new PyodideDriveFS({
34
+ FS: FS,
35
+ PATH,
36
+ ERRNO_CODES,
37
+ baseUrl,
38
+ driveName: this._driveName,
39
+ mountpoint,
40
+ });
41
+ FS.mkdirTree(mountpoint);
42
+ FS.mount(driveFS, {}, mountpoint);
43
+ FS.chdir(mountpoint);
44
+ this._driveFS = driveFS;
45
+ }
46
+ }
47
+ }
48
+ const worker = new PyodideComlinkKernel();
49
+ expose(worker);
50
+ //# sourceMappingURL=comlink.worker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comlink.worker.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/pyodide-kernel/comlink.worker.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAEL,OAAO,EACP,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C;;GAEG;AACH,MAAM,cAAe,SAAQ,OAAO;IAClC,SAAS,CAAC,OAAyB;QACjC,OAAO,IAAI,wBAAwB,CACjC,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,UAAU,EAClB,OAAO,CAAC,EAAE,EACV,OAAO,CAAC,WAAW,CACpB,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,oBAAqB,SAAQ,mBAAmB;IAC3D;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,kBAAkB,GAAG,CAAC,GAAQ,EAAE,EAAE;YACrC,oEAAoE;YACpE,WAAW,CAAC,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC;QACvC,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACO,KAAK,CAAC,cAAc,CAC5B,OAAsC;QAEtC,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,MAAM,UAAU,GAAG,QAAQ,CAAC;YAC5B,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;YAChD,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;YAE5B,MAAM,OAAO,GAAG,IAAI,cAAc,CAAC;gBACjC,EAAE,EAAE,EAAS;gBACb,IAAI;gBACJ,WAAW;gBACX,OAAO;gBACP,SAAS,EAAE,IAAI,CAAC,UAAU;gBAC1B,UAAU;aACX,CAAC,CAAC;YACH,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;YACzB,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;YAClC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACrB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QAC1B,CAAC;IACH,CAAC;CACF;AAED,MAAM,MAAM,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAE1C,MAAM,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './_pypi';
2
+ export * from './coincident.worker';
3
+ export * from './comlink.worker';
4
+ export * from './kernel';
5
+ export * from './tokens';
6
+ export * from './worker';
@@ -0,0 +1,9 @@
1
+ // Copyright (c) Jupyter Development Team.
2
+ // Distributed under the terms of the Modified BSD License.
3
+ export * from './_pypi';
4
+ export * from './coincident.worker';
5
+ export * from './comlink.worker';
6
+ export * from './kernel';
7
+ export * from './tokens';
8
+ export * from './worker';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/jupyter/lite/pyodide-kernel/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,2DAA2D;AAE3D,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,157 @@
1
+ import { Contents, KernelMessage } from '@jupyterlab/services';
2
+ import { BaseKernel, IKernel } from '@jupyterlite/kernel';
3
+ import { IPyodideWorkerKernel } from './tokens';
4
+ /**
5
+ * A kernel that executes Python code with Pyodide.
6
+ */
7
+ export declare class PyodideKernel extends BaseKernel implements IKernel {
8
+ /**
9
+ * Instantiate a new PyodideKernel
10
+ *
11
+ * @param options The instantiation options for a new PyodideKernel
12
+ */
13
+ constructor(options: PyodideKernel.IOptions);
14
+ /**
15
+ * Load the worker.
16
+ *
17
+ * ### Note
18
+ *
19
+ * Subclasses must implement this typographically almost _exactly_ for
20
+ * webpack to find it.
21
+ */
22
+ protected initWorker(options: PyodideKernel.IOptions): Worker;
23
+ /**
24
+ * Initialize the remote kernel.
25
+ * Use coincident if crossOriginIsolated, comlink otherwise
26
+ * See the two following issues for more context:
27
+ * - https://github.com/jupyterlite/jupyterlite/issues/1424
28
+ * - https://github.com/jupyterlite/pyodide-kernel/pull/126
29
+ */
30
+ protected initRemote(options: PyodideKernel.IOptions): IPyodideWorkerKernel;
31
+ protected initRemoteOptions(options: PyodideKernel.IOptions): IPyodideWorkerKernel.IOptions;
32
+ /**
33
+ * Dispose the kernel.
34
+ */
35
+ dispose(): void;
36
+ /**
37
+ * A promise that is fulfilled when the kernel is ready.
38
+ */
39
+ get ready(): Promise<void>;
40
+ /**
41
+ * Process a message coming from the pyodide web worker.
42
+ *
43
+ * @param msg The worker message to process.
44
+ */
45
+ private _processWorkerMessage;
46
+ /**
47
+ * Handle a kernel_info_request message
48
+ */
49
+ kernelInfoRequest(): Promise<KernelMessage.IInfoReplyMsg['content']>;
50
+ /**
51
+ * Handle an `execute_request` message
52
+ *
53
+ * @param msg The parent message.
54
+ */
55
+ executeRequest(content: KernelMessage.IExecuteRequestMsg['content']): Promise<KernelMessage.IExecuteReplyMsg['content']>;
56
+ /**
57
+ * Handle an complete_request message
58
+ *
59
+ * @param msg The parent message.
60
+ */
61
+ completeRequest(content: KernelMessage.ICompleteRequestMsg['content']): Promise<KernelMessage.ICompleteReplyMsg['content']>;
62
+ /**
63
+ * Handle an `inspect_request` message.
64
+ *
65
+ * @param content - The content of the request.
66
+ *
67
+ * @returns A promise that resolves with the response message.
68
+ */
69
+ inspectRequest(content: KernelMessage.IInspectRequestMsg['content']): Promise<KernelMessage.IInspectReplyMsg['content']>;
70
+ /**
71
+ * Handle an `is_complete_request` message.
72
+ *
73
+ * @param content - The content of the request.
74
+ *
75
+ * @returns A promise that resolves with the response message.
76
+ */
77
+ isCompleteRequest(content: KernelMessage.IIsCompleteRequestMsg['content']): Promise<KernelMessage.IIsCompleteReplyMsg['content']>;
78
+ /**
79
+ * Handle a `comm_info_request` message.
80
+ *
81
+ * @param content - The content of the request.
82
+ *
83
+ * @returns A promise that resolves with the response message.
84
+ */
85
+ commInfoRequest(content: KernelMessage.ICommInfoRequestMsg['content']): Promise<KernelMessage.ICommInfoReplyMsg['content']>;
86
+ /**
87
+ * Send an `comm_open` message.
88
+ *
89
+ * @param msg - The comm_open message.
90
+ */
91
+ commOpen(msg: KernelMessage.ICommOpenMsg): Promise<void>;
92
+ /**
93
+ * Send an `comm_msg` message.
94
+ *
95
+ * @param msg - The comm_msg message.
96
+ */
97
+ commMsg(msg: KernelMessage.ICommMsgMsg): Promise<void>;
98
+ /**
99
+ * Send an `comm_close` message.
100
+ *
101
+ * @param close - The comm_close message.
102
+ */
103
+ commClose(msg: KernelMessage.ICommCloseMsg): Promise<void>;
104
+ /**
105
+ * Send an `input_reply` message.
106
+ *
107
+ * @param content - The content of the reply.
108
+ */
109
+ inputReply(content: KernelMessage.IInputReplyMsg['content']): Promise<void>;
110
+ private _contentsManager;
111
+ private _contentsProcessor;
112
+ private _worker;
113
+ private _remoteKernel;
114
+ private _ready;
115
+ }
116
+ /**
117
+ * A namespace for PyodideKernel statics.
118
+ */
119
+ export declare namespace PyodideKernel {
120
+ /**
121
+ * The instantiation options for a Pyodide kernel
122
+ */
123
+ interface IOptions extends IKernel.IOptions {
124
+ /**
125
+ * The URL to fetch Pyodide.
126
+ */
127
+ pyodideUrl: string;
128
+ /**
129
+ * The URL to fetch piplite
130
+ */
131
+ pipliteWheelUrl?: string;
132
+ /**
133
+ * The URLs from which to attempt PyPI API requests
134
+ */
135
+ pipliteUrls: string[];
136
+ /**
137
+ * Do not try pypi.org if `piplite.install` fails against local URLs
138
+ */
139
+ disablePyPIFallback: boolean;
140
+ /**
141
+ * Whether or not to mount the Emscripten drive
142
+ */
143
+ mountDrive: boolean;
144
+ /**
145
+ * additional options to provide to `loadPyodide`
146
+ * @see https://pyodide.org/en/stable/usage/api/js-api.html#globalThis.loadPyodide
147
+ */
148
+ loadPyodideOptions: Record<string, any> & {
149
+ lockFileURL: string;
150
+ packages: string[];
151
+ };
152
+ /**
153
+ * The Jupyterlite content manager
154
+ */
155
+ contentsManager: Contents.IManager;
156
+ }
157
+ }