@datalayer/core 0.0.2 → 0.0.4

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 (474) hide show
  1. package/README.md +124 -2
  2. package/lib/App.css +47 -0
  3. package/lib/App.js +14 -2
  4. package/lib/__tests__/index.test.js +7 -6
  5. package/lib/api/{RunApi.d.ts → DatalayerApi.d.ts} +4 -4
  6. package/lib/api/{RunApi.js → DatalayerApi.js} +6 -11
  7. package/lib/api/index.d.ts +3 -2
  8. package/lib/api/index.js +3 -7
  9. package/lib/api/{runtimes → jupyter}/exec/Python.js +0 -5
  10. package/lib/api/{runtimes → jupyter}/exec/Snippets.js +0 -5
  11. package/lib/api/{runtimes → jupyter}/exec/index.js +0 -5
  12. package/lib/api/jupyter/index.d.ts +2 -0
  13. package/lib/api/jupyter/index.js +6 -0
  14. package/lib/api/{runtimes → jupyter}/kernelsHandler.d.ts +1 -1
  15. package/lib/api/{runtimes → jupyter}/kernelsHandler.js +1 -6
  16. package/lib/api/runtimes/actions.d.ts +102 -0
  17. package/lib/api/runtimes/{runtimesApi.js → actions.js} +47 -53
  18. package/lib/api/runtimes/{runtimesApi.d.ts → apis.d.ts} +8 -105
  19. package/lib/api/runtimes/apis.js +5 -0
  20. package/lib/api/runtimes/index.d.ts +2 -4
  21. package/lib/api/runtimes/index.js +2 -9
  22. package/lib/api/runtimes/settings.js +3 -8
  23. package/lib/api/runtimes/snapshots.d.ts +1 -1
  24. package/lib/api/runtimes/snapshots.js +8 -13
  25. package/lib/api/runtimes/utils.js +1 -9
  26. package/lib/assets/react.svg +1 -0
  27. package/lib/collaboration/DatalayerCollaboration.d.ts +9 -0
  28. package/lib/collaboration/DatalayerCollaboration.js +28 -0
  29. package/lib/collaboration/DatalayerCollaborationProvider.d.ts +54 -0
  30. package/lib/collaboration/DatalayerCollaborationProvider.js +162 -0
  31. package/lib/collaboration/index.d.ts +2 -0
  32. package/lib/collaboration/index.js +6 -0
  33. package/lib/components/avatars/BoringAvatar.d.ts +2 -3
  34. package/lib/components/avatars/BoringAvatar.js +14 -9
  35. package/lib/components/avatars/BoringAvatar.stories.d.ts +27 -0
  36. package/lib/components/avatars/BoringAvatar.stories.js +23 -0
  37. package/lib/components/avatars/UserProfileAvatar.js +2 -14
  38. package/lib/components/avatars/index.js +0 -5
  39. package/lib/components/banners/NoAutomationBanner.js +4 -9
  40. package/lib/components/banners/index.js +0 -5
  41. package/lib/components/buttons/DownloadCSVButton.d.ts +1 -1
  42. package/lib/components/buttons/DownloadCSVButton.js +1 -6
  43. package/lib/components/buttons/DownloadJsonButton.d.ts +1 -1
  44. package/lib/components/buttons/DownloadJsonButton.js +0 -5
  45. package/lib/components/buttons/LongActionButton.js +0 -5
  46. package/lib/components/buttons/UploadButton.js +1 -6
  47. package/lib/components/buttons/index.js +0 -5
  48. package/lib/components/checkout/StripeCheckout.d.ts +1 -1
  49. package/lib/components/checkout/StripeCheckout.js +6 -11
  50. package/lib/components/checkout/index.js +0 -5
  51. package/lib/components/confetti/ConfettiSuccess.js +1 -6
  52. package/lib/components/confetti/index.js +0 -5
  53. package/lib/components/context/OrganizationSelect.js +5 -10
  54. package/lib/components/context/SpaceSelect.js +7 -12
  55. package/lib/components/context/index.js +0 -5
  56. package/lib/components/display/AvatarSkeleton.js +1 -6
  57. package/lib/components/display/CenteredSpinner.js +4 -9
  58. package/lib/components/display/CodePreview.js +4 -9
  59. package/lib/components/display/DatalayerBox.js +13 -19
  60. package/lib/components/display/HorizontalCenter.d.ts +1 -1
  61. package/lib/components/display/HorizontalCenter.js +1 -1
  62. package/lib/components/display/JupyterDialog.js +17 -20
  63. package/lib/components/display/NavLink.d.ts +4 -2
  64. package/lib/components/display/NavLink.js +6 -9
  65. package/lib/components/display/NotebookSkeleton.js +2 -7
  66. package/lib/components/display/Placeholder.js +1 -6
  67. package/lib/components/display/ToTopBranded.js +1 -6
  68. package/lib/components/display/VisuallyHidden.js +0 -5
  69. package/lib/components/display/index.js +0 -5
  70. package/lib/components/echarts/EChartsReact.d.ts +1 -1
  71. package/lib/components/echarts/EChartsReact.js +7 -7
  72. package/lib/components/echarts/index.js +0 -5
  73. package/lib/components/flashes/FlashClosable.js +11 -16
  74. package/lib/components/flashes/FlashDisclaimer.js +2 -8
  75. package/lib/components/flashes/FlashGuest.js +3 -9
  76. package/lib/components/flashes/FlashSurveys.js +3 -9
  77. package/lib/components/flashes/FlashUnauthorized.js +2 -7
  78. package/lib/components/flashes/index.js +0 -5
  79. package/lib/components/flashes/surveys/Survey2025_1.d.ts +1 -1
  80. package/lib/components/flashes/surveys/Survey2025_1.js +62 -90
  81. package/lib/components/flashes/surveys/index.js +0 -5
  82. package/lib/components/iam/ExternalTokenSilentLogin.js +6 -9
  83. package/lib/components/iam/index.js +0 -5
  84. package/lib/components/icons/ArtifactIcon.d.ts +2 -2
  85. package/lib/components/icons/ArtifactIcon.js +39 -44
  86. package/lib/components/icons/index.js +0 -5
  87. package/lib/components/index.js +1 -6
  88. package/lib/components/labels/VisibilityLabel.js +2 -10
  89. package/lib/components/labels/index.js +0 -5
  90. package/lib/components/landings/StepBlock.d.ts +1 -1
  91. package/lib/components/landings/StepBlock.js +1 -6
  92. package/lib/components/landings/index.js +0 -5
  93. package/lib/components/navbar/NavigationVisbilityObserver.js +2 -7
  94. package/lib/components/navbar/SubdomainNavBar.js +46 -29
  95. package/lib/components/navbar/SubdomainNavBar.module.css +737 -0
  96. package/lib/components/navbar/index.js +0 -5
  97. package/lib/components/nbgrader/NbGradesDetails.d.ts +1 -1
  98. package/lib/components/nbgrader/NbGradesDetails.js +5 -13
  99. package/lib/components/nbgrader/index.js +0 -5
  100. package/lib/components/notebooks/JupyterNotebook.js +5 -10
  101. package/lib/components/notebooks/JupyterNotebookToolbar.js +3 -8
  102. package/lib/components/notebooks/index.js +0 -5
  103. package/lib/components/primer/Helper.d.ts +1 -1
  104. package/lib/components/primer/Helper.js +5 -3
  105. package/lib/components/primer/Portals.d.ts +1 -1
  106. package/lib/components/primer/Portals.js +2 -7
  107. package/lib/components/primer/Styles.js +1 -6
  108. package/lib/components/primer/index.js +0 -5
  109. package/lib/components/progress/ConsumptionBar.js +2 -7
  110. package/lib/components/progress/CreditsIndicator.d.ts +1 -1
  111. package/lib/components/progress/CreditsIndicator.js +4 -13
  112. package/lib/components/progress/ProgressBar.js +0 -5
  113. package/lib/components/progress/ProgressRing.js +2 -2
  114. package/lib/components/progress/Timer.js +0 -5
  115. package/lib/components/progress/index.js +0 -5
  116. package/lib/components/runtimes/RuntimeCellVariables.js +9 -14
  117. package/lib/components/runtimes/RuntimeCellVariablesDialog.js +7 -12
  118. package/lib/components/runtimes/RuntimeLauncherDialog.d.ts +1 -2
  119. package/lib/components/runtimes/RuntimeLauncherDialog.js +32 -40
  120. package/lib/components/runtimes/RuntimePickerBase.d.ts +1 -1
  121. package/lib/components/runtimes/RuntimePickerBase.js +42 -36
  122. package/lib/components/runtimes/RuntimePickerCell.js +9 -17
  123. package/lib/components/runtimes/RuntimePickerNotebook.d.ts +1 -2
  124. package/lib/components/runtimes/RuntimePickerNotebook.js +45 -50
  125. package/lib/components/runtimes/RuntimeReservationControl.js +10 -20
  126. package/lib/components/runtimes/RuntimeSimplePicker.d.ts +1 -1
  127. package/lib/components/runtimes/RuntimeSimplePicker.js +44 -52
  128. package/lib/components/runtimes/RuntimeUtils.d.ts +1 -1
  129. package/lib/components/runtimes/RuntimeUtils.js +22 -17
  130. package/lib/components/runtimes/RuntimeVariables.js +7 -12
  131. package/lib/components/runtimes/index.js +0 -5
  132. package/lib/components/screenshot/ScreenCapture.js +10 -19
  133. package/lib/components/screenshot/ScreenCaptureButton.d.ts +1 -1
  134. package/lib/components/screenshot/ScreenCaptureButton.js +14 -8
  135. package/lib/components/screenshot/index.js +0 -5
  136. package/lib/components/snapshots/RuntimeSnapshotMenu.js +19 -22
  137. package/lib/components/snapshots/index.js +0 -5
  138. package/lib/components/snippets/SnippetDialog.js +5 -10
  139. package/lib/components/snippets/index.js +0 -5
  140. package/lib/components/storage/ContentsBrowser.js +75 -63
  141. package/lib/components/storage/ContentsItems.js +10 -13
  142. package/lib/components/storage/index.js +0 -5
  143. package/lib/components/students/StudentItemStatus.d.ts +1 -1
  144. package/lib/components/students/StudentItemStatus.js +38 -21
  145. package/lib/components/students/index.js +0 -5
  146. package/lib/components/subnav/SubNav.d.ts +3 -3
  147. package/lib/components/subnav/SubNav.js +34 -24
  148. package/lib/components/subnav/SubNav.module.css +717 -0
  149. package/lib/components/subnav/index.js +0 -5
  150. package/lib/components/tables/DataTable.js +1 -9
  151. package/lib/components/tables/index.js +0 -5
  152. package/lib/components/text-reveal/TextRevealAnimation.js +7 -8
  153. package/lib/components/text-reveal/TextRevealAnimation.module.css +45 -0
  154. package/lib/components/text-reveal/index.js +0 -5
  155. package/lib/components/text-reveal/useTextRevealAnimationLines.js +0 -5
  156. package/lib/components/tokens/SpaceVariantToken.d.ts +1 -1
  157. package/lib/components/tokens/SpaceVariantToken.js +5 -10
  158. package/lib/components/tokens/index.js +0 -5
  159. package/lib/components/toolbars/AssignmentEditorToolbar.js +1 -8
  160. package/lib/components/toolbars/DocumentEditorToolbar.js +0 -5
  161. package/lib/components/toolbars/NotebookEditorToolbar.d.ts +1 -1
  162. package/lib/components/toolbars/NotebookEditorToolbar.js +0 -5
  163. package/lib/components/toolbars/index.js +0 -5
  164. package/lib/components/users/PeerIndicator.d.ts +1 -1
  165. package/lib/components/users/PeerIndicator.js +5 -10
  166. package/lib/components/users/index.js +0 -5
  167. package/lib/config/Configuration.d.ts +48 -0
  168. package/lib/config/Configuration.js +42 -5
  169. package/lib/config/index.js +0 -5
  170. package/lib/config/integrations/Loom.js +3 -8
  171. package/lib/config/integrations/index.js +0 -5
  172. package/lib/examples/CellExample.d.ts +6 -0
  173. package/lib/examples/CellExample.js +55 -0
  174. package/lib/examples/DatalayerNotebookExample.d.ts +16 -0
  175. package/lib/examples/DatalayerNotebookExample.js +75 -0
  176. package/lib/examples/NativeNavigationExample.d.ts +8 -0
  177. package/lib/examples/NativeNavigationExample.js +97 -0
  178. package/lib/examples/NotebookExample.d.ts +6 -0
  179. package/lib/examples/NotebookExample.js +24 -0
  180. package/lib/examples/NotebookMutationsKernel.d.ts +2 -0
  181. package/lib/examples/NotebookMutationsKernel.js +115 -0
  182. package/lib/examples/NotebookMutationsServiceManager.d.ts +2 -0
  183. package/lib/examples/NotebookMutationsServiceManager.js +107 -0
  184. package/lib/examples/ReactRouterExample.d.ts +6 -0
  185. package/lib/examples/ReactRouterExample.js +175 -0
  186. package/lib/examples/example-selector.d.ts +22 -0
  187. package/lib/examples/example-selector.js +45 -0
  188. package/lib/examples/index.d.ts +2 -0
  189. package/lib/examples/index.js +6 -0
  190. package/lib/examples/main.js +153 -0
  191. package/lib/examples/notebooks/IPyWidgetsExample.ipynb.json +101 -0
  192. package/lib/examples/notebooks/IPyWidgetsExampleWithState.ipynb.json +112 -0
  193. package/lib/examples/notebooks/Lite.ipynb.json +128 -0
  194. package/lib/examples/notebooks/Matplotlib.ipynb.json +137 -0
  195. package/lib/examples/notebooks/NotebookExample1.ipynb.json +126 -0
  196. package/lib/examples/notebooks/NotebookExample2.ipynb.json +48 -0
  197. package/lib/examples/notebooks/NotebookOutputs.ipynb.json +49 -0
  198. package/lib/examples/notebooks/NotebookToCExample.ipynb.json +102 -0
  199. package/lib/examples/notebooks/OutputIPyWidgetsExample.d.ts +145 -0
  200. package/lib/examples/notebooks/OutputIPyWidgetsExample.js +153 -0
  201. package/lib/examples/notebooks/PyGWalker.ipynb.json +55 -0
  202. package/lib/hooks/assets/OutputshotPlaceholders.d.ts +10 -10
  203. package/lib/hooks/assets/OutputshotPlaceholders.js +9 -14
  204. package/lib/hooks/assets/index.js +0 -5
  205. package/lib/hooks/index.d.ts +29 -28
  206. package/lib/hooks/index.js +29 -33
  207. package/lib/hooks/layouts/LayoutBackdrop.js +3 -11
  208. package/lib/hooks/layouts/LayoutScreenshot.css +58 -0
  209. package/lib/hooks/layouts/LayoutScreenshot.d.ts +1 -0
  210. package/lib/hooks/layouts/LayoutScreenshot.js +7 -11
  211. package/lib/hooks/layouts/index.js +0 -5
  212. package/lib/hooks/useAIAgents.d.ts +1 -1
  213. package/lib/hooks/useAIAgents.js +13 -18
  214. package/lib/hooks/useAuthorization.js +4 -10
  215. package/lib/hooks/useBackdrop.js +7 -12
  216. package/lib/hooks/useBackdropJupyterLab.d.ts +1 -1
  217. package/lib/hooks/useBackdropJupyterLab.js +4 -9
  218. package/lib/hooks/useCache.d.ts +8 -4
  219. package/lib/hooks/useCache.js +410 -361
  220. package/lib/hooks/useCellOutputshot.js +3 -11
  221. package/lib/hooks/useContainsFocus.js +2 -6
  222. package/lib/hooks/useDatalayer.d.ts +21 -0
  223. package/lib/hooks/{useRun.js → useDatalayer.js} +16 -18
  224. package/lib/hooks/useError.d.ts +1 -1
  225. package/lib/hooks/useError.js +2 -7
  226. package/lib/hooks/useExternalScript.js +4 -9
  227. package/lib/hooks/useFocusTrap.d.ts +1 -1
  228. package/lib/hooks/useFocusTrap.js +3 -7
  229. package/lib/hooks/useIAM.js +6 -12
  230. package/lib/hooks/useId.js +6 -11
  231. package/lib/hooks/useIsomorphicLayoutEffect.js +0 -5
  232. package/lib/hooks/useJupyterLabTheme.js +3 -6
  233. package/lib/hooks/useKeyboardEscape.js +0 -5
  234. package/lib/hooks/useLocation.d.ts +22 -0
  235. package/lib/hooks/useLocation.js +149 -0
  236. package/lib/hooks/useLocationHandles.d.ts +2 -2
  237. package/lib/hooks/useLocationHandles.js +6 -9
  238. package/lib/hooks/useNavigate.d.ts +5 -1
  239. package/lib/hooks/useNavigate.js +62 -12
  240. package/lib/hooks/useNotebookAIAgent.js +3 -6
  241. package/lib/hooks/useOnClickOutside.js +0 -5
  242. package/lib/hooks/useParams.d.ts +5 -0
  243. package/lib/hooks/useParams.js +152 -0
  244. package/lib/hooks/useRef.js +0 -5
  245. package/lib/hooks/useRuntimes.js +2 -7
  246. package/lib/hooks/useScreenshot.js +5 -10
  247. package/lib/hooks/useToast.js +21 -21
  248. package/lib/hooks/useUpload.js +9 -14
  249. package/lib/hooks/useUser.js +1 -1
  250. package/lib/hooks/useVisibilityObserver.js +0 -5
  251. package/lib/hooks/useWindowSize.js +0 -6
  252. package/lib/i18n/Labels.js +0 -5
  253. package/lib/i18n/index.js +0 -5
  254. package/lib/index.css +73 -0
  255. package/lib/index.d.ts +6 -3
  256. package/lib/index.js +7 -3
  257. package/lib/main.js +1 -2
  258. package/lib/mocks/components/FlashMock.js +4 -9
  259. package/lib/mocks/components/index.js +0 -5
  260. package/lib/mocks/hooks/index.d.ts +1 -1
  261. package/lib/mocks/hooks/index.js +1 -6
  262. package/lib/mocks/hooks/rests/index.js +0 -5
  263. package/lib/mocks/hooks/rests/rests.js +15 -23
  264. package/lib/mocks/hooks/useDatalayerMock.d.ts +6 -0
  265. package/lib/mocks/hooks/{useRunMock.js → useDatalayerMock.js} +9 -14
  266. package/lib/mocks/index.js +0 -5
  267. package/lib/mocks/jupyter/index.js +1 -6
  268. package/lib/mocks/models/CodeBlockMock.js +1 -6
  269. package/lib/mocks/models/CodelineMock.js +1 -6
  270. package/lib/mocks/models/CourseMock.d.ts +1 -1
  271. package/lib/mocks/models/CourseMock.js +10 -15
  272. package/lib/mocks/models/InviteMock.d.ts +1 -1
  273. package/lib/mocks/models/InviteMock.js +21 -11
  274. package/lib/mocks/models/JupyterLabUserMock.js +2 -2
  275. package/lib/mocks/models/OrganisationMock.d.ts +1 -1
  276. package/lib/mocks/models/OrganisationMock.js +11 -7
  277. package/lib/mocks/models/SchoolMock.d.ts +1 -1
  278. package/lib/mocks/models/SchoolMock.js +6 -6
  279. package/lib/mocks/models/SpaceMock.d.ts +1 -1
  280. package/lib/mocks/models/SpaceMock.js +9 -14
  281. package/lib/mocks/models/TeamMock.d.ts +1 -1
  282. package/lib/mocks/models/TeamMock.js +6 -6
  283. package/lib/mocks/models/UserMock.d.ts +1 -1
  284. package/lib/mocks/models/UserMock.js +4 -11
  285. package/lib/mocks/models/index.js +0 -5
  286. package/lib/mocks/views/ActionMenuMock.js +1 -6
  287. package/lib/mocks/views/ChartMock.js +3 -8
  288. package/lib/mocks/views/ChartMockOptions.js +24 -29
  289. package/lib/mocks/views/DashboardMock.js +74 -79
  290. package/lib/mocks/views/FormMock.js +1 -6
  291. package/lib/mocks/views/TableMock.js +1 -6
  292. package/lib/mocks/views/WipMock.js +0 -5
  293. package/lib/mocks/views/index.js +0 -5
  294. package/lib/models/Account.d.ts +2 -2
  295. package/lib/models/Assignment.d.ts +2 -2
  296. package/lib/models/Cell.d.ts +1 -1
  297. package/lib/models/CodeBlock.d.ts +1 -1
  298. package/lib/models/CodefeedBlocks.d.ts +2 -2
  299. package/lib/models/Contact.d.ts +1 -1
  300. package/lib/models/Contact.js +14 -19
  301. package/lib/models/ContactEvent.js +0 -5
  302. package/lib/models/ContactIAMProvider.js +2 -2
  303. package/lib/models/Course.d.ts +7 -7
  304. package/lib/models/Credits.js +0 -5
  305. package/lib/models/Dataset.d.ts +2 -2
  306. package/lib/models/Datasource.js +0 -5
  307. package/lib/models/Dean.d.ts +1 -1
  308. package/lib/models/Document.d.ts +1 -1
  309. package/lib/models/Environment.d.ts +2 -2
  310. package/lib/models/Errors.js +0 -5
  311. package/lib/models/Exercise.d.ts +1 -1
  312. package/lib/models/GrowthKPI.js +0 -5
  313. package/lib/models/IAMProviderLinked.js +1 -1
  314. package/lib/models/IAMProviderUsers.js +0 -5
  315. package/lib/models/IAMToken.js +0 -5
  316. package/lib/models/Inbound.js +0 -5
  317. package/lib/models/Instructor.d.ts +1 -1
  318. package/lib/models/Invite.d.ts +2 -2
  319. package/lib/models/Invite.js +1 -1
  320. package/lib/models/Item.d.ts +5 -5
  321. package/lib/models/LandingRoles.js +18 -23
  322. package/lib/models/Lesson.d.ts +1 -1
  323. package/lib/models/Member.d.ts +1 -1
  324. package/lib/models/Notebook.d.ts +1 -1
  325. package/lib/models/Organization.d.ts +4 -4
  326. package/lib/models/Organization.js +2 -7
  327. package/lib/models/OrganizationMember.d.ts +2 -2
  328. package/lib/models/Outbound.js +7 -12
  329. package/lib/models/Page.js +4 -2
  330. package/lib/models/PageTag.d.ts +2 -2
  331. package/lib/models/PageTag.js +56 -9
  332. package/lib/models/Profile.d.ts +1 -1
  333. package/lib/models/RolesOrganization.d.ts +1 -1
  334. package/lib/models/RolesOrganization.js +4 -17
  335. package/lib/models/RolesPlatform.d.ts +1 -1
  336. package/lib/models/RolesPlatform.js +12 -39
  337. package/lib/models/RolesTeam.d.ts +1 -1
  338. package/lib/models/RolesTeam.js +3 -15
  339. package/lib/models/Runtime.d.ts +59 -1
  340. package/lib/models/Runtime.js +11 -9
  341. package/lib/models/RuntimeSnapshot.js +1 -1
  342. package/lib/models/School.d.ts +4 -4
  343. package/lib/models/Secret.js +0 -5
  344. package/lib/models/Space.d.ts +5 -5
  345. package/lib/models/Space.js +3 -3
  346. package/lib/models/SpaceItem.d.ts +8 -8
  347. package/lib/models/SpaceMember.d.ts +2 -2
  348. package/lib/models/Student.d.ts +2 -2
  349. package/lib/models/StudentItem.d.ts +3 -3
  350. package/lib/models/Survey.js +0 -5
  351. package/lib/models/Team.d.ts +3 -3
  352. package/lib/models/Team.js +2 -7
  353. package/lib/models/TeamMember.d.ts +2 -2
  354. package/lib/models/URN.js +1 -6
  355. package/lib/models/User.d.ts +2 -2
  356. package/lib/models/User.js +7 -10
  357. package/lib/models/UserEvent.js +0 -5
  358. package/lib/models/UserOnboarding.d.ts +1 -1
  359. package/lib/models/UserOnboarding.js +7 -12
  360. package/lib/models/UserSettings.js +2 -7
  361. package/lib/models/index.d.ts +2 -2
  362. package/lib/models/index.js +2 -7
  363. package/lib/navigation/adapters/native.d.ts +11 -0
  364. package/lib/navigation/adapters/native.js +48 -0
  365. package/lib/navigation/adapters/nextjs.d.ts +9 -0
  366. package/lib/navigation/adapters/nextjs.js +35 -0
  367. package/lib/navigation/adapters/react-router.d.ts +4 -0
  368. package/lib/navigation/adapters/react-router.js +12 -0
  369. package/lib/navigation/components.d.ts +20 -0
  370. package/lib/navigation/components.js +36 -0
  371. package/lib/navigation/index.d.ts +4 -0
  372. package/lib/navigation/index.js +12 -0
  373. package/lib/routes/Routes.js +0 -5
  374. package/lib/routes/index.d.ts +1 -1
  375. package/lib/routes/index.js +1 -6
  376. package/lib/services/DatalayerServiceManager.d.ts +22 -0
  377. package/lib/services/DatalayerServiceManager.js +79 -0
  378. package/lib/services/index.d.ts +4 -0
  379. package/lib/services/index.js +7 -0
  380. package/lib/services/reconnectToRuntime.d.ts +32 -0
  381. package/lib/services/reconnectToRuntime.js +59 -0
  382. package/lib/state/State.d.ts +1 -1
  383. package/lib/state/State.js +1 -6
  384. package/lib/state/index.d.ts +1 -1
  385. package/lib/state/index.js +1 -6
  386. package/lib/state/storage/IAMStorage.js +14 -7
  387. package/lib/state/storage/index.d.ts +1 -1
  388. package/lib/state/storage/index.js +1 -6
  389. package/lib/state/substates/AIAgentState.js +4 -7
  390. package/lib/state/substates/CellState.js +6 -10
  391. package/lib/state/substates/CoreState.d.ts +1 -1
  392. package/lib/state/substates/CoreState.js +23 -20
  393. package/lib/state/substates/DatasourceState.js +1 -6
  394. package/lib/state/substates/DocumentState.js +0 -5
  395. package/lib/state/substates/GradeState.js +0 -5
  396. package/lib/state/substates/IAMState.d.ts +5 -1
  397. package/lib/state/substates/IAMState.js +88 -72
  398. package/lib/state/substates/JupyterLabState.js +1 -6
  399. package/lib/state/substates/LayoutState.d.ts +2 -2
  400. package/lib/state/substates/LayoutState.js +41 -28
  401. package/lib/state/substates/NbformatState.js +0 -5
  402. package/lib/state/substates/OrganizationState.js +1 -6
  403. package/lib/state/substates/RuntimesState.d.ts +2 -2
  404. package/lib/state/substates/RuntimesState.js +6 -10
  405. package/lib/state/substates/SpaceState.js +1 -6
  406. package/lib/state/substates/SurveysState.js +7 -12
  407. package/lib/state/substates/TeamState.js +1 -6
  408. package/lib/state/substates/index.js +0 -5
  409. package/lib/stories/assets/accessibility.png +0 -0
  410. package/lib/stories/assets/accessibility.svg +1 -0
  411. package/lib/stories/assets/addon-library.png +0 -0
  412. package/lib/stories/assets/assets.png +0 -0
  413. package/lib/stories/assets/context.png +0 -0
  414. package/lib/stories/assets/discord.svg +1 -0
  415. package/lib/stories/assets/docs.png +0 -0
  416. package/lib/stories/assets/figma-plugin.png +0 -0
  417. package/lib/stories/assets/github.svg +1 -0
  418. package/lib/stories/assets/share.png +0 -0
  419. package/lib/stories/assets/styling.png +0 -0
  420. package/lib/stories/assets/testing.png +0 -0
  421. package/lib/stories/assets/theming.png +0 -0
  422. package/lib/stories/assets/tutorials.svg +1 -0
  423. package/lib/stories/assets/youtube.svg +1 -0
  424. package/lib/stories/button.css +35 -0
  425. package/lib/stories/header.css +37 -0
  426. package/lib/stories/page.css +73 -0
  427. package/lib/test-setup.js +73 -1
  428. package/lib/theme/DatalayerTheme.js +1 -6
  429. package/lib/theme/DatalayerThemeProvider.js +17 -19
  430. package/lib/theme/Palette.js +1 -6
  431. package/lib/theme/index.js +0 -5
  432. package/lib/utils/Array.js +0 -5
  433. package/lib/utils/Avatar.js +2 -7
  434. package/lib/utils/Browser.js +6 -11
  435. package/lib/utils/Cells.d.ts +1 -1
  436. package/lib/utils/Cookie.js +1 -6
  437. package/lib/utils/Date.js +5 -10
  438. package/lib/utils/Download.js +5 -8
  439. package/lib/utils/DownloadFile.js +4 -7
  440. package/lib/utils/Env.js +2 -6
  441. package/lib/utils/File.js +0 -5
  442. package/lib/utils/Ids.js +0 -5
  443. package/lib/utils/Jupyter.js +0 -5
  444. package/lib/utils/Lazy.d.ts +1 -1
  445. package/lib/utils/Lazy.js +2 -8
  446. package/lib/utils/Name.js +10 -13
  447. package/lib/utils/Notebook.d.ts +1 -1
  448. package/lib/utils/Notebook.js +3 -3
  449. package/lib/utils/Number.js +13 -14
  450. package/lib/utils/Plots.d.ts +1 -1
  451. package/lib/utils/Plots.js +5 -5
  452. package/lib/utils/Random.js +0 -5
  453. package/lib/utils/Screenshot.js +1 -6
  454. package/lib/utils/Scroll.js +3 -7
  455. package/lib/utils/Sleep.js +1 -6
  456. package/lib/utils/Snapshot.js +2 -7
  457. package/lib/utils/String.js +2 -7
  458. package/lib/utils/Uri.js +2 -7
  459. package/lib/utils/Validator.js +0 -5
  460. package/lib/utils/WithSuspense.js +3 -11
  461. package/lib/utils/index.js +0 -5
  462. package/package.json +96 -30
  463. package/style/animation/Animation.module.css +174 -0
  464. package/style/base.css +64 -0
  465. package/style/index.css +6 -0
  466. package/lib/__tests__/App.test.js +0 -17
  467. package/lib/api/runtimes/models.d.ts +0 -59
  468. package/lib/api/runtimes/models.js +0 -11
  469. package/lib/hooks/useRun.d.ts +0 -21
  470. package/lib/mocks/hooks/useRunMock.d.ts +0 -6
  471. /package/lib/api/{runtimes → jupyter}/exec/Python.d.ts +0 -0
  472. /package/lib/api/{runtimes → jupyter}/exec/Snippets.d.ts +0 -0
  473. /package/lib/api/{runtimes → jupyter}/exec/index.d.ts +0 -0
  474. /package/lib/{__tests__/App.test.d.ts → examples/main.d.ts} +0 -0
@@ -2,17 +2,12 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- /*
6
- * Copyright (c) 2021-2024 Datalayer, Inc.
7
- *
8
- * Datalayer License
9
- */
10
5
  import { Poll } from '@lumino/polling';
11
6
  import { useStore } from 'zustand';
12
7
  import { createStore } from 'zustand/vanilla';
13
- import { ANONYMOUS_USER_TOKEN, ANONYMOUS_USER, asUser, IAMProvidersSpecs } from '../../models';
14
- import { getStoredToken, getStoredUser, loadRefreshTokenFromCookie, storeToken, storeUser } from '../storage';
15
- import { requestRunAPI } from '../../api';
8
+ import { ANONYMOUS_USER_TOKEN, ANONYMOUS_USER, asUser, IAMProvidersSpecs, } from '../../models';
9
+ import { getStoredToken, getStoredUser, loadRefreshTokenFromCookie, storeToken, storeUser, } from '../storage';
10
+ import { requestDatalayerAPI } from '../../api';
16
11
  import { getCookie, setCookie, deleteCookie } from '../../utils';
17
12
  import { coreStore } from './CoreState';
18
13
  /**
@@ -29,24 +24,27 @@ export const iamStore = createStore((set, get) => {
29
24
  iamRunUrl: coreStore.getState().configuration?.iamRunUrl,
30
25
  iamProvidersAuthorizationURL: {},
31
26
  version: '',
27
+ isLoginInProgress: false,
32
28
  addIAMProviderAuthorizationURL: (provider, authorizationURL) => {
33
29
  set(state => ({
34
30
  iamProvidersAuthorizationURL: {
35
31
  ...state.iamProvidersAuthorizationURL,
36
32
  [provider]: authorizationURL,
37
- }
33
+ },
38
34
  }));
39
35
  },
40
36
  login: async (token) => {
41
37
  const { refreshUserByToken, iamRunUrl, logout } = get();
38
+ // Set flag to prevent interference from automatic token refresh
39
+ set({ isLoginInProgress: true });
42
40
  try {
43
- const resp = await requestRunAPI({
41
+ const resp = await requestDatalayerAPI({
44
42
  url: `${iamRunUrl}/api/iam/v1/login`,
45
43
  method: 'POST',
46
44
  body: { token },
47
45
  });
48
46
  if (resp.success && resp.token) {
49
- refreshUserByToken(resp.token);
47
+ await refreshUserByToken(resp.token);
50
48
  }
51
49
  else {
52
50
  throw new Error('Invalid Token.');
@@ -54,12 +52,16 @@ export const iamStore = createStore((set, get) => {
54
52
  }
55
53
  catch (error) {
56
54
  console.debug('Failed to login.', error);
57
- if (error.name === 'RunResponseError' && error.response.status === 401) {
55
+ if (error.name === 'RunResponseError' &&
56
+ error.response.status === 401) {
58
57
  console.debug('Received 401 error - Logging out.');
59
58
  logout();
60
59
  }
61
60
  throw error;
62
61
  }
62
+ finally {
63
+ set({ isLoginInProgress: false });
64
+ }
63
65
  },
64
66
  logout: () => {
65
67
  storeUser();
@@ -102,7 +104,7 @@ export const iamStore = createStore((set, get) => {
102
104
  user: {
103
105
  ...state.user,
104
106
  ...user,
105
- }
107
+ },
106
108
  };
107
109
  /*
108
110
  if (state.user?.email && !updatedState.user.email) {
@@ -115,14 +117,14 @@ export const iamStore = createStore((set, get) => {
115
117
  const { externalToken, token, iamRunUrl, logout } = get();
116
118
  if (token) {
117
119
  try {
118
- const creditsRaw = await requestRunAPI({
120
+ const creditsRaw = await requestDatalayerAPI({
119
121
  url: `${iamRunUrl}/api/iam/v1/usage/credits`,
120
122
  token,
121
123
  headers: externalToken
122
124
  ? {
123
- 'X-External-Token': externalToken
125
+ 'X-External-Token': externalToken,
124
126
  }
125
- : undefined
127
+ : undefined,
126
128
  });
127
129
  const { credits, reservations: creditsReservations = [] } = creditsRaw;
128
130
  let available = credits.quota !== null
@@ -131,7 +133,7 @@ export const iamStore = createStore((set, get) => {
131
133
  available -= creditsReservations.reduce((consumed, reservation) => consumed + reservation.credits, 0);
132
134
  set({
133
135
  credits: { ...credits, available: Math.max(0, available) },
134
- creditsReservations: creditsReservations
136
+ creditsReservations: creditsReservations,
135
137
  });
136
138
  }
137
139
  catch (error) {
@@ -167,9 +169,9 @@ export const iamStore = createStore((set, get) => {
167
169
  }
168
170
  },
169
171
  refreshUserByToken: async (token) => {
170
- const { iamRunUrl, logout } = get();
172
+ const { iamRunUrl, logout, isLoginInProgress } = get();
171
173
  try {
172
- const data = await requestRunAPI({
174
+ const data = await requestDatalayerAPI({
173
175
  url: `${iamRunUrl}/api/iam/v1/whoami`,
174
176
  token,
175
177
  });
@@ -193,16 +195,21 @@ export const iamStore = createStore((set, get) => {
193
195
  else {
194
196
  console.debug('Failed to fetch user identity.', error);
195
197
  }
196
- logout();
198
+ // Only logout if we're not in the middle of a login attempt
199
+ if (!isLoginInProgress) {
200
+ logout();
201
+ }
197
202
  }
198
203
  },
199
- setExternalToken: (externalToken) => set((state) => { return { externalToken }; }),
204
+ setExternalToken: (externalToken) => set((state) => {
205
+ return { externalToken };
206
+ }),
200
207
  setLogin: (user, token) => set((state) => {
201
208
  storeUser(user);
202
209
  storeToken(token);
203
210
  return {
204
211
  user,
205
- token
212
+ token,
206
213
  };
207
214
  }),
208
215
  setVersion: version => {
@@ -223,52 +230,57 @@ const creditsPoll = new Poll({
223
230
  frequency: {
224
231
  interval: 60 * 1000,
225
232
  backoff: true,
226
- max: 600 * 1000
233
+ max: 600 * 1000,
227
234
  },
228
- standby: () => (iamStore.getState().user?.id ? 'when-hidden' : true)
235
+ standby: () => (iamStore.getState().user?.id ? 'when-hidden' : true),
229
236
  });
230
237
  // Initialize the IAM store with the stored token if it is valid.
231
- iamStore
232
- .getState()
233
- .refreshUserByTokenStored()
234
- .catch(reason => {
235
- console.error('Failed to refresh to validate the stored token.', reason);
236
- })
237
- .finally(() => {
238
- const { externalToken, iamRunUrl, checkIAMToken, token } = iamStore.getState();
239
- // If the stored token is invalid and an external token exists, try authenticating with it.
240
- if (!token && externalToken) {
241
- console.debug('Can not login with token - Trying with the external token.');
242
- requestRunAPI({
243
- url: `${iamRunUrl}/api/iam/v1/login`,
244
- method: 'POST',
245
- body: { token: externalToken }
246
- })
247
- .then(response => {
248
- if (response.token) {
249
- checkIAMToken(response.token);
250
- }
251
- })
252
- .catch(reason => {
253
- console.debug('Can not login with token.', token, reason);
254
- });
255
- }
256
- if (token) {
257
- console.log('Logged in with token and external token.');
258
- }
259
- else {
260
- console.debug('Failed to login with token and no external token available.');
261
- }
262
- // Start the credits poll in any case after trying to validate the user token.
263
- creditsPoll.start();
264
- // Force a refresh when the user comeback to the application tab
265
- // Useful for checkout platform redirecting to another tab to add credits.
266
- document.addEventListener('visibilitychange', () => {
267
- if (!document.hidden && iamStore.getState().user?.id) {
268
- creditsPoll.refresh();
238
+ // Delay initialization slightly to allow apps to set up first
239
+ setTimeout(() => {
240
+ iamStore
241
+ .getState()
242
+ .refreshUserByTokenStored()
243
+ .catch(reason => {
244
+ console.error('Failed to refresh to validate the stored token.', reason);
245
+ })
246
+ .finally(() => {
247
+ const { externalToken, iamRunUrl, checkIAMToken, token } = iamStore.getState();
248
+ // If the stored token is invalid and an external token exists, try authenticating with it.
249
+ if (!token && externalToken) {
250
+ console.debug('Can not login with token - Trying with the external token.');
251
+ requestDatalayerAPI({
252
+ url: `${iamRunUrl}/api/iam/v1/login`,
253
+ method: 'POST',
254
+ body: { token: externalToken },
255
+ })
256
+ .then(response => {
257
+ if (response.token) {
258
+ checkIAMToken(response.token);
259
+ }
260
+ })
261
+ .catch(reason => {
262
+ console.debug('Can not login with token.', token, reason);
263
+ });
264
+ }
265
+ if (token) {
266
+ console.log('Logged in with token and external token.');
267
+ }
268
+ else {
269
+ console.debug('Failed to login with token and no external token available.');
270
+ }
271
+ // Start the credits poll in any case after trying to validate the user token.
272
+ creditsPoll.start();
273
+ // Force a refresh when the user comeback to the application tab
274
+ // Useful for checkout platform redirecting to another tab to add credits.
275
+ if (typeof document !== 'undefined') {
276
+ document.addEventListener('visibilitychange', () => {
277
+ if (!document.hidden && iamStore.getState().user?.id) {
278
+ creditsPoll.refresh();
279
+ }
280
+ });
269
281
  }
270
282
  });
271
- });
283
+ }, 100); // 100ms delay to allow app initialization
272
284
  // Connect the core store with the iam store.
273
285
  coreStore.subscribe((state, prevState) => {
274
286
  if (state.configuration?.iamRunUrl &&
@@ -277,18 +289,22 @@ coreStore.subscribe((state, prevState) => {
277
289
  console.log('Updating iamRunUrl with new value', iamRunUrl);
278
290
  iamStore.setState({ iamRunUrl });
279
291
  // Check the token is valid with the new server.
280
- iamStore.getState().externalToken ?
281
- iamStore.getState()
292
+ if (iamStore.getState().externalToken) {
293
+ iamStore
294
+ .getState()
282
295
  .login(iamStore.getState().externalToken)
283
296
  .catch(reason => {
284
297
  console.error('Failed to refresh the user after updating the IAM RUN URL.', reason);
285
- })
286
- :
287
- iamStore.getState()
288
- .refreshUser()
289
- .catch(reason => {
290
- console.error('Failed to refresh the user after updating the IAM server URL.', reason);
291
- });
298
+ });
299
+ }
300
+ else {
301
+ iamStore
302
+ .getState()
303
+ .refreshUser()
304
+ .catch(reason => {
305
+ console.error('Failed to refresh the user after updating the IAM server URL.', reason);
306
+ });
307
+ }
292
308
  }
293
309
  });
294
310
  export default useIAMStore;
@@ -2,11 +2,6 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- /*
6
- * Copyright (c) 2021-2024 Datalayer, Inc.
7
- *
8
- * Datalayer License
9
- */
10
5
  import { createStore } from 'zustand/vanilla';
11
6
  import { useStore } from 'zustand';
12
7
  export const jupyterLabStore = createStore((set, get) => ({
@@ -14,7 +9,7 @@ export const jupyterLabStore = createStore((set, get) => ({
14
9
  setJupyterLabAdapter: (jupyterLabAdapter) => set((state) => ({ jupyterLabAdapter })),
15
10
  plugin: (id) => {
16
11
  return get().jupyterLabAdapter?.plugin(id);
17
- }
12
+ },
18
13
  }));
19
14
  export function useJupyterLabStore(selector) {
20
15
  return useStore(jupyterLabStore, selector);
@@ -1,5 +1,5 @@
1
- import { ReactPortal } from "react";
2
- import { IAnyOrganization, IAnySpace, IAnyTeam, ISpaceItem } from "../../models";
1
+ import { ReactPortal } from 'react';
2
+ import { IAnyOrganization, IAnySpace, IAnyTeam, ISpaceItem } from '../../models';
3
3
  export type BannerDisplayVariant = 'danger' | 'info' | 'success' | 'warning';
4
4
  export type LeftSidebarVariant = 'codefeed' | 'course' | 'empty' | 'guess-account' | 'guess-space' | 'guess-spaces' | 'organization' | 'organization-space' | 'organization-spaces' | 'organizations' | 'public' | 'unchanged' | 'user' | 'user-space' | 'user-spaces';
5
5
  export type BackdropDisplay = {
@@ -17,8 +17,12 @@ export const layoutStore = createStore((set, get) => ({
17
17
  screenCapture: undefined,
18
18
  space: undefined,
19
19
  team: undefined,
20
- hideBackdrop: () => set((state) => ({ backdrop: { open: false, message: undefined } })),
21
- hideScreenshot: () => set((state) => ({ screenshot: { open: false, message: undefined } })),
20
+ hideBackdrop: () => set((state) => ({
21
+ backdrop: { open: false, message: undefined },
22
+ })),
23
+ hideScreenshot: () => set((state) => ({
24
+ screenshot: { open: false, message: undefined },
25
+ })),
22
26
  setBootstrapped: (bootstrapped) => set((state) => ({ bootstrapped })),
23
27
  showBackdrop: (message) => set((state) => ({ backdrop: { open: true, message } })),
24
28
  showScreenshot: (message) => set((state) => ({ screenshot: { open: true, message } })),
@@ -27,46 +31,55 @@ export const layoutStore = createStore((set, get) => ({
27
31
  timestamp: new Date(),
28
32
  message: bannerDisplay.message,
29
33
  variant: bannerDisplay.variant,
30
- }
34
+ },
31
35
  })),
32
36
  setLeftPortal: (leftPortal) => set((state) => ({ leftPortal })),
33
37
  setRightPortal: (rightPortal) => set((state) => ({ rightPortal })),
34
- resetLeftPortal: () => set((state) => ({ leftPortal: state.leftPortal?.pinned ? state.leftPortal : undefined, })),
35
- resetRightPortal: () => set((state) => ({ rightPortal: state.rightPortal?.pinned ? state.rightPortal : undefined, })),
38
+ resetLeftPortal: () => set((state) => ({
39
+ leftPortal: state.leftPortal?.pinned ? state.leftPortal : undefined,
40
+ })),
41
+ resetRightPortal: () => set((state) => ({
42
+ rightPortal: state.rightPortal?.pinned ? state.rightPortal : undefined,
43
+ })),
36
44
  resetForcedLeftPortal: () => set((state) => ({ leftPortal: undefined })),
37
45
  resetForcedRightPortal: () => set((state) => ({ rightPortal: undefined })),
38
46
  setLeftSidebarVariant: (leftSidebarVariant) => set((state) => ({ leftSidebarVariant })),
39
47
  updateLayoutOrganization: (organization) => set((state) => {
40
- return ({
41
- organization: organization ? {
42
- ...state.organization,
43
- ...organization,
44
- }
45
- : undefined
46
- });
48
+ return {
49
+ organization: organization
50
+ ? {
51
+ ...state.organization,
52
+ ...organization,
53
+ }
54
+ : undefined,
55
+ };
47
56
  }),
48
57
  updateLayoutTeam: (team) => set((state) => {
49
- return ({
50
- team: team ? {
51
- ...state.team,
52
- ...team,
53
- }
54
- : undefined
55
- });
58
+ return {
59
+ team: team
60
+ ? {
61
+ ...state.team,
62
+ ...team,
63
+ }
64
+ : undefined,
65
+ };
56
66
  }),
57
67
  updateLayoutSpace: (space) => set((state) => {
58
- return ({
59
- space: space ? {
60
- ...state.space,
61
- ...space,
62
- }
63
- : undefined
64
- });
68
+ return {
69
+ space: space
70
+ ? {
71
+ ...state.space,
72
+ ...space,
73
+ }
74
+ : undefined,
75
+ };
65
76
  }),
66
77
  setItem: (item) => set((state) => ({ item })),
67
- triggerItemsRefresh: () => set((state) => ({ itemsRefreshCount: state.itemsRefreshCount + 1 })),
78
+ triggerItemsRefresh: () => set((state) => ({
79
+ itemsRefreshCount: state.itemsRefreshCount + 1,
80
+ })),
68
81
  setScreenCapture: (screenCapture) => set((state) => ({ screenCapture })),
69
- reset: () => set((state) => ({ bootstrapped: false, })),
82
+ reset: () => set((state) => ({ bootstrapped: false })),
70
83
  }));
71
84
  export function useLayoutStore(selector) {
72
85
  return useStore(layoutStore, selector);
@@ -2,11 +2,6 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- /*
6
- * Copyright (c) 2021-2024 Datalayer, Inc.
7
- *
8
- * Datalayer License
9
- */
10
5
  import { createStore } from 'zustand/vanilla';
11
6
  import { useStore } from 'zustand';
12
7
  export const nbformatStore = createStore((set, get) => ({
@@ -2,17 +2,12 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- /*
6
- * Copyright (c) 2021-2024 Datalayer, Inc.
7
- *
8
- * Datalayer License
9
- */
10
5
  import { createStore } from 'zustand/vanilla';
11
6
  import { useStore } from 'zustand';
12
7
  export const organizationStore = createStore((set, get) => ({
13
8
  organizations: [],
14
9
  updateOrganizations: (organizations) => set((state) => ({
15
- organizations
10
+ organizations,
16
11
  })),
17
12
  }));
18
13
  export function useOrganizationStore(selector) {
@@ -1,7 +1,7 @@
1
1
  import type { JupyterLabAppAdapter } from '@datalayer/jupyter-react';
2
- import type { IMultiServiceManager, IRuntimeModel } from '../../api';
2
+ import type { IMultiServiceManager } from '../../api';
3
3
  import type { IRuntimesConfiguration } from '../../config';
4
- import type { IRuntimePod, IRuntimeSnapshot } from '../../models';
4
+ import type { IRuntimePod, IRuntimeSnapshot, IRuntimeModel } from '../../models';
5
5
  /**
6
6
  * Datalayer Runtimes state.
7
7
  */
@@ -2,11 +2,6 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- /*
6
- * Copyright (c) 2021-2024 Datalayer, Inc.
7
- *
8
- * Datalayer License
9
- */
10
5
  import { useStore } from 'zustand';
11
6
  import { createStore } from 'zustand/vanilla';
12
7
  import { JSONExt } from '@lumino/coreutils';
@@ -21,7 +16,7 @@ export const runtimesStore = createStore((set, get) => {
21
16
  return {
22
17
  configuration: {
23
18
  maxNotebookRuntimes: 5,
24
- maxCellRuntimes: 3
19
+ maxCellRuntimes: 3,
25
20
  },
26
21
  setConfiguration: (configuration) => {
27
22
  set(state => JSONExt.deepEqual(state.configuration, configuration)
@@ -132,7 +127,7 @@ export const runtimesStore = createStore((set, get) => {
132
127
  if (version && !get().version) {
133
128
  set(state => ({ version }));
134
129
  }
135
- }
130
+ },
136
131
  };
137
132
  });
138
133
  // Poll remote kernels
@@ -142,12 +137,12 @@ const kernelsPoll = new Poll({
142
137
  frequency: {
143
138
  interval: 61 * 1000,
144
139
  backoff: true,
145
- max: 300 * 1000
140
+ max: 300 * 1000,
146
141
  },
147
142
  name: '@datalayer/jupyter-kernels:KernelsManager#kernels',
148
143
  standby: () => iamStore.getState().token || runtimesStore.getState().runtimesRunUrl
149
144
  ? 'when-hidden'
150
- : true
145
+ : true,
151
146
  });
152
147
  // Force refresh at expiration date if next tick is after it.
153
148
  runtimesStore.subscribe((state, prevState) => {
@@ -165,7 +160,8 @@ runtimesStore.subscribe((state, prevState) => {
165
160
  });
166
161
  coreStore.subscribe((state, prevState) => {
167
162
  if (state.configuration.runtimesRunUrl &&
168
- state.configuration.runtimesRunUrl !== prevState.configuration.runtimesRunUrl) {
163
+ state.configuration.runtimesRunUrl !==
164
+ prevState.configuration.runtimesRunUrl) {
169
165
  const runtimesRunUrl = state.configuration.runtimesRunUrl;
170
166
  console.log(`Updating runtimesRunUrl with new value ${runtimesRunUrl}`);
171
167
  runtimesStore.setState({ runtimesRunUrl });
@@ -2,17 +2,12 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- /*
6
- * Copyright (c) 2021-2024 Datalayer, Inc.
7
- *
8
- * Datalayer License
9
- */
10
5
  import { createStore } from 'zustand/vanilla';
11
6
  import { useStore } from 'zustand';
12
7
  export const spaceStore = createStore((set, get) => ({
13
8
  spaces: [],
14
9
  updateSpaces: (spaces) => set((state) => ({
15
- spaces
10
+ spaces,
16
11
  })),
17
12
  }));
18
13
  export function useSpaceStore(selector) {
@@ -2,15 +2,10 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- /*
6
- * Copyright (c) 2021-2024 Datalayer, Inc.
7
- *
8
- * Datalayer License
9
- */
10
5
  import { createStore } from 'zustand/vanilla';
11
6
  import { useStore } from 'zustand';
12
- import { requestRunAPI } from '../../api';
13
- import { asSurvey } from '../../models';
7
+ import { requestDatalayerAPI } from '../../api';
8
+ import { asSurvey, } from '../../models';
14
9
  import { coreStore } from './CoreState';
15
10
  import { iamStore } from './IAMState';
16
11
  export const surveysStore = createStore((set, get) => ({
@@ -25,7 +20,7 @@ export const surveysStore = createStore((set, get) => ({
25
20
  const { token } = iamStore.getState();
26
21
  const { growthRunUrl } = get();
27
22
  try {
28
- const resp = await requestRunAPI({
23
+ const resp = await requestDatalayerAPI({
29
24
  url: `${growthRunUrl}/api/growth/v1/surveys`,
30
25
  method: 'GET',
31
26
  token,
@@ -53,7 +48,7 @@ export const surveysStore = createStore((set, get) => ({
53
48
  const { growthRunUrl } = get();
54
49
  const { token } = iamStore.getState();
55
50
  try {
56
- const resp = await requestRunAPI({
51
+ const resp = await requestDatalayerAPI({
57
52
  url: `${growthRunUrl}/api/growth/v1/surveys`,
58
53
  method: 'POST',
59
54
  body: {
@@ -70,9 +65,9 @@ export const surveysStore = createStore((set, get) => ({
70
65
  set((state) => ({ surveys }));
71
66
  }
72
67
  else {
73
- set((state) => ({ surveys: new Map([
74
- [survey.name, survey]
75
- ]) }));
68
+ set((state) => ({
69
+ surveys: new Map([[survey.name, survey]]),
70
+ }));
76
71
  }
77
72
  }
78
73
  else {
@@ -2,18 +2,13 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- /*
6
- * Copyright (c) 2021-2024 Datalayer, Inc.
7
- *
8
- * Datalayer License
9
- */
10
5
  import { createStore } from 'zustand/vanilla';
11
6
  import { useStore } from 'zustand';
12
7
  import { TEAMS_MOCK } from '../../mocks';
13
8
  export const teamStore = createStore((set, get) => ({
14
9
  teams: TEAMS_MOCK,
15
10
  update: (teams) => set((state) => ({
16
- teams
11
+ teams,
17
12
  })),
18
13
  }));
19
14
  export function useTeamStore(selector) {
@@ -2,11 +2,6 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- /*
6
- * Copyright (c) 2021-2024 Datalayer, Inc.
7
- *
8
- * Datalayer License
9
- */
10
5
  export * from './AIAgentState';
11
6
  export * from './CellState';
12
7
  export * from './CoreState';
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" fill="none" viewBox="0 0 48 48"><title>Accessibility</title><circle cx="24.334" cy="24" r="24" fill="#A849FF" fill-opacity=".3"/><path fill="#A470D5" fill-rule="evenodd" d="M27.8609 11.585C27.8609 9.59506 26.2497 7.99023 24.2519 7.99023C22.254 7.99023 20.6429 9.65925 20.6429 11.585C20.6429 13.575 22.254 15.1799 24.2519 15.1799C26.2497 15.1799 27.8609 13.575 27.8609 11.585ZM21.8922 22.6473C21.8467 23.9096 21.7901 25.4788 21.5897 26.2771C20.9853 29.0462 17.7348 36.3314 17.3325 37.2275C17.1891 37.4923 17.1077 37.7955 17.1077 38.1178C17.1077 39.1519 17.946 39.9902 18.9802 39.9902C19.6587 39.9902 20.253 39.6293 20.5814 39.0889L20.6429 38.9874L24.2841 31.22C24.2841 31.22 27.5529 37.9214 27.9238 38.6591C28.2948 39.3967 28.8709 39.9902 29.7168 39.9902C30.751 39.9902 31.5893 39.1519 31.5893 38.1178C31.5893 37.7951 31.3639 37.2265 31.3639 37.2265C30.9581 36.3258 27.698 29.0452 27.0938 26.2771C26.8975 25.4948 26.847 23.9722 26.8056 22.7236C26.7927 22.333 26.7806 21.9693 26.7653 21.6634C26.7008 21.214 27.0231 20.8289 27.4097 20.7005L35.3366 18.3253C36.3033 18.0685 36.8834 16.9773 36.6256 16.0144C36.3678 15.0515 35.2722 14.4737 34.3055 14.7305C34.3055 14.7305 26.8619 17.1057 24.2841 17.1057C21.7062 17.1057 14.456 14.7947 14.456 14.7947C13.4893 14.5379 12.3937 14.9873 12.0715 15.9502C11.7493 16.9131 12.3293 18.0044 13.3604 18.3253L21.2873 20.7005C21.674 20.8289 21.9318 21.214 21.9318 21.6634C21.9174 21.9493 21.9053 22.2857 21.8922 22.6473Z" clip-rule="evenodd"/></svg>
Binary file
Binary file
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="33" height="32" fill="none" viewBox="0 0 33 32"><g clip-path="url(#clip0_10031_177575)"><mask id="mask0_10031_177575" style="mask-type:luminance" width="33" height="25" x="0" y="4" maskUnits="userSpaceOnUse"><path fill="#fff" d="M32.5034 4.00195H0.503906V28.7758H32.5034V4.00195Z"/></mask><g mask="url(#mask0_10031_177575)"><path fill="#5865F2" d="M27.5928 6.20817C25.5533 5.27289 23.3662 4.58382 21.0794 4.18916C21.0378 4.18154 20.9962 4.20057 20.9747 4.23864C20.6935 4.73863 20.3819 5.3909 20.1637 5.90358C17.7042 5.53558 15.2573 5.53558 12.8481 5.90358C12.6299 5.37951 12.307 4.73863 12.0245 4.23864C12.003 4.20184 11.9614 4.18281 11.9198 4.18916C9.63431 4.58255 7.44721 5.27163 5.40641 6.20817C5.38874 6.21578 5.3736 6.22848 5.36355 6.24497C1.21508 12.439 0.078646 18.4809 0.636144 24.4478C0.638667 24.477 0.655064 24.5049 0.677768 24.5227C3.41481 26.5315 6.06609 27.7511 8.66815 28.5594C8.70979 28.5721 8.75392 28.5569 8.78042 28.5226C9.39594 27.6826 9.94461 26.7968 10.4151 25.8653C10.4428 25.8107 10.4163 25.746 10.3596 25.7244C9.48927 25.3945 8.66058 24.9922 7.86343 24.5354C7.80038 24.4986 7.79533 24.4084 7.85333 24.3653C8.02108 24.2397 8.18888 24.109 8.34906 23.977C8.37804 23.9529 8.41842 23.9478 8.45249 23.963C13.6894 26.3526 19.359 26.3526 24.5341 23.963C24.5682 23.9465 24.6086 23.9516 24.6388 23.9757C24.799 24.1077 24.9668 24.2397 25.1358 24.3653C25.1938 24.4084 25.19 24.4986 25.127 24.5354C24.3298 25.0011 23.5011 25.3945 22.6296 25.7232C22.5728 25.7447 22.5476 25.8107 22.5754 25.8653C23.0559 26.7955 23.6046 27.6812 24.2087 28.5213C24.234 28.5569 24.2794 28.5721 24.321 28.5594C26.9357 27.7511 29.5869 26.5315 32.324 24.5227C32.348 24.5049 32.3631 24.4783 32.3656 24.4491C33.0328 17.5506 31.2481 11.5584 27.6344 6.24623C27.6256 6.22848 27.6105 6.21578 27.5928 6.20817ZM11.1971 20.8146C9.62043 20.8146 8.32129 19.3679 8.32129 17.5913C8.32129 15.8146 9.59523 14.368 11.1971 14.368C12.8115 14.368 14.0981 15.8273 14.0729 17.5913C14.0729 19.3679 12.7989 20.8146 11.1971 20.8146ZM21.8299 20.8146C20.2533 20.8146 18.9541 19.3679 18.9541 17.5913C18.9541 15.8146 20.228 14.368 21.8299 14.368C23.4444 14.368 24.7309 15.8273 24.7057 17.5913C24.7057 19.3679 23.4444 20.8146 21.8299 20.8146Z"/></g></g><defs><clipPath id="clip0_10031_177575"><rect width="32" height="32" fill="#fff" transform="translate(0.5)"/></clipPath></defs></svg>
Binary file
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="none" viewBox="0 0 32 32"><path fill="#161614" d="M16.0001 0C7.16466 0 0 7.17472 0 16.0256C0 23.1061 4.58452 29.1131 10.9419 31.2322C11.7415 31.3805 12.0351 30.8845 12.0351 30.4613C12.0351 30.0791 12.0202 28.8167 12.0133 27.4776C7.56209 28.447 6.62283 25.5868 6.62283 25.5868C5.89499 23.7345 4.8463 23.2419 4.8463 23.2419C3.39461 22.2473 4.95573 22.2678 4.95573 22.2678C6.56242 22.3808 7.40842 23.9192 7.40842 23.9192C8.83547 26.3691 11.1514 25.6609 12.0645 25.2514C12.2081 24.2156 12.6227 23.5087 13.0803 23.1085C9.52648 22.7032 5.7906 21.3291 5.7906 15.1886C5.7906 13.4389 6.41563 12.0094 7.43916 10.8871C7.27303 10.4834 6.72537 8.85349 7.59415 6.64609C7.59415 6.64609 8.93774 6.21539 11.9953 8.28877C13.2716 7.9337 14.6404 7.75563 16.0001 7.74953C17.3599 7.75563 18.7297 7.9337 20.0084 8.28877C23.0623 6.21539 24.404 6.64609 24.404 6.64609C25.2749 8.85349 24.727 10.4834 24.5608 10.8871C25.5868 12.0094 26.2075 13.4389 26.2075 15.1886C26.2075 21.3437 22.4645 22.699 18.9017 23.0957C19.4756 23.593 19.9869 24.5683 19.9869 26.0634C19.9869 28.2077 19.9684 29.9334 19.9684 30.4613C19.9684 30.8877 20.2564 31.3874 21.0674 31.2301C27.4213 29.1086 32 23.1037 32 16.0256C32 7.17472 24.8364 0 16.0001 0ZM5.99257 22.8288C5.95733 22.9084 5.83227 22.9322 5.71834 22.8776C5.60229 22.8253 5.53711 22.7168 5.57474 22.6369C5.60918 22.5549 5.7345 22.5321 5.85029 22.587C5.9666 22.6393 6.03284 22.7489 5.99257 22.8288ZM6.7796 23.5321C6.70329 23.603 6.55412 23.5701 6.45291 23.4581C6.34825 23.3464 6.32864 23.197 6.40601 23.125C6.4847 23.0542 6.62937 23.0874 6.73429 23.1991C6.83895 23.3121 6.85935 23.4605 6.7796 23.5321ZM7.31953 24.4321C7.2215 24.5003 7.0612 24.4363 6.96211 24.2938C6.86407 24.1513 6.86407 23.9804 6.96422 23.9119C7.06358 23.8435 7.2215 23.905 7.32191 24.0465C7.41968 24.1914 7.41968 24.3623 7.31953 24.4321ZM8.23267 25.4743C8.14497 25.5712 7.95818 25.5452 7.82146 25.413C7.68156 25.2838 7.64261 25.1004 7.73058 25.0035C7.81934 24.9064 8.00719 24.9337 8.14497 25.0648C8.28381 25.1938 8.3262 25.3785 8.23267 25.4743ZM9.41281 25.8262C9.37413 25.9517 9.19423 26.0088 9.013 25.9554C8.83203 25.9005 8.7136 25.7535 8.75016 25.6266C8.78778 25.5003 8.96848 25.4408 9.15104 25.4979C9.33174 25.5526 9.45044 25.6985 9.41281 25.8262ZM10.7559 25.9754C10.7604 26.1076 10.6067 26.2172 10.4165 26.2196C10.2252 26.2238 10.0704 26.1169 10.0683 25.9868C10.0683 25.8534 10.2185 25.7448 10.4098 25.7416C10.6001 25.7379 10.7559 25.8441 10.7559 25.9754ZM12.0753 25.9248C12.0981 26.0537 11.9658 26.1862 11.7769 26.2215C11.5912 26.2554 11.4192 26.1758 11.3957 26.0479C11.3726 25.9157 11.5072 25.7833 11.6927 25.7491C11.8819 25.7162 12.0512 25.7937 12.0753 25.9248Z"/></svg>
Binary file
Binary file
Binary file
Binary file