@datalayer/core 0.0.2 → 0.0.3

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 (329) hide show
  1. package/README.md +12 -1
  2. package/lib/App.css +47 -0
  3. package/lib/App.d.ts +1 -1
  4. package/lib/App.js +17 -5
  5. package/lib/__tests__/index.test.js +2 -1
  6. package/lib/api/{RunApi.d.ts → DatalayerApi.d.ts} +4 -4
  7. package/lib/api/{RunApi.js → DatalayerApi.js} +4 -9
  8. package/lib/api/index.d.ts +2 -1
  9. package/lib/api/index.js +2 -6
  10. package/lib/api/{runtimes → jupyter}/exec/Python.js +0 -5
  11. package/lib/api/{runtimes → jupyter}/exec/Snippets.js +0 -5
  12. package/lib/api/{runtimes → jupyter}/exec/index.js +0 -5
  13. package/lib/api/jupyter/index.d.ts +2 -0
  14. package/lib/api/jupyter/index.js +6 -0
  15. package/lib/api/{runtimes → jupyter}/kernelsHandler.d.ts +1 -1
  16. package/lib/api/{runtimes → jupyter}/kernelsHandler.js +1 -6
  17. package/lib/api/runtimes/actions.d.ts +102 -0
  18. package/lib/api/runtimes/{runtimesApi.js → actions.js} +26 -31
  19. package/lib/api/runtimes/{runtimesApi.d.ts → apis.d.ts} +8 -105
  20. package/lib/api/runtimes/apis.js +5 -0
  21. package/lib/api/runtimes/index.d.ts +2 -4
  22. package/lib/api/runtimes/index.js +2 -9
  23. package/lib/api/runtimes/settings.js +0 -5
  24. package/lib/api/runtimes/snapshots.js +0 -5
  25. package/lib/api/runtimes/utils.js +0 -5
  26. package/lib/assets/react.svg +1 -0
  27. package/lib/components/avatars/BoringAvatar.d.ts +1 -2
  28. package/lib/components/avatars/BoringAvatar.js +14 -9
  29. package/lib/components/avatars/BoringAvatar.stories.d.ts +27 -0
  30. package/lib/components/avatars/BoringAvatar.stories.js +23 -0
  31. package/lib/components/avatars/UserProfileAvatar.js +0 -5
  32. package/lib/components/avatars/index.js +0 -5
  33. package/lib/components/banners/NoAutomationBanner.js +0 -5
  34. package/lib/components/banners/index.js +0 -5
  35. package/lib/components/buttons/DownloadCSVButton.d.ts +1 -1
  36. package/lib/components/buttons/DownloadCSVButton.js +0 -5
  37. package/lib/components/buttons/DownloadJsonButton.d.ts +1 -1
  38. package/lib/components/buttons/DownloadJsonButton.js +0 -5
  39. package/lib/components/buttons/LongActionButton.js +0 -5
  40. package/lib/components/buttons/UploadButton.js +0 -5
  41. package/lib/components/buttons/index.js +0 -5
  42. package/lib/components/checkout/StripeCheckout.js +0 -5
  43. package/lib/components/checkout/index.js +0 -5
  44. package/lib/components/confetti/ConfettiSuccess.js +0 -5
  45. package/lib/components/confetti/index.js +0 -5
  46. package/lib/components/context/OrganizationSelect.js +0 -5
  47. package/lib/components/context/SpaceSelect.js +0 -5
  48. package/lib/components/context/index.js +0 -5
  49. package/lib/components/display/AvatarSkeleton.js +0 -5
  50. package/lib/components/display/CenteredSpinner.js +0 -5
  51. package/lib/components/display/CodePreview.js +0 -5
  52. package/lib/components/display/DatalayerBox.js +0 -5
  53. package/lib/components/display/JupyterDialog.js +0 -5
  54. package/lib/components/display/NavLink.js +0 -5
  55. package/lib/components/display/NotebookSkeleton.js +0 -5
  56. package/lib/components/display/Placeholder.js +0 -5
  57. package/lib/components/display/ToTopBranded.js +0 -5
  58. package/lib/components/display/VisuallyHidden.js +0 -5
  59. package/lib/components/display/index.js +0 -5
  60. package/lib/components/echarts/EChartsReact.js +6 -6
  61. package/lib/components/echarts/index.js +0 -5
  62. package/lib/components/flashes/FlashClosable.js +0 -5
  63. package/lib/components/flashes/FlashDisclaimer.js +0 -5
  64. package/lib/components/flashes/FlashGuest.js +0 -5
  65. package/lib/components/flashes/FlashSurveys.js +0 -5
  66. package/lib/components/flashes/FlashUnauthorized.js +0 -5
  67. package/lib/components/flashes/index.js +0 -5
  68. package/lib/components/flashes/surveys/Survey2025_1.js +0 -5
  69. package/lib/components/flashes/surveys/index.js +0 -5
  70. package/lib/components/iam/ExternalTokenSilentLogin.js +0 -5
  71. package/lib/components/iam/index.js +0 -5
  72. package/lib/components/icons/ArtifactIcon.js +0 -5
  73. package/lib/components/icons/index.js +0 -5
  74. package/lib/components/index.js +1 -6
  75. package/lib/components/labels/VisibilityLabel.js +0 -5
  76. package/lib/components/labels/index.js +0 -5
  77. package/lib/components/landings/StepBlock.js +0 -5
  78. package/lib/components/landings/index.js +0 -5
  79. package/lib/components/navbar/NavigationVisbilityObserver.js +0 -5
  80. package/lib/components/navbar/SubdomainNavBar.js +2 -7
  81. package/lib/components/navbar/SubdomainNavBar.module.css +718 -0
  82. package/lib/components/navbar/index.js +0 -5
  83. package/lib/components/nbgrader/NbGradesDetails.js +0 -5
  84. package/lib/components/nbgrader/index.js +0 -5
  85. package/lib/components/notebooks/JupyterNotebook.js +0 -5
  86. package/lib/components/notebooks/JupyterNotebookToolbar.js +0 -5
  87. package/lib/components/notebooks/index.js +0 -5
  88. package/lib/components/primer/Portals.js +0 -5
  89. package/lib/components/primer/Styles.js +0 -5
  90. package/lib/components/primer/index.js +0 -5
  91. package/lib/components/progress/ConsumptionBar.js +0 -5
  92. package/lib/components/progress/CreditsIndicator.js +0 -6
  93. package/lib/components/progress/ProgressBar.js +0 -5
  94. package/lib/components/progress/Timer.js +0 -5
  95. package/lib/components/progress/index.js +0 -5
  96. package/lib/components/runtimes/RuntimeCellVariables.js +0 -5
  97. package/lib/components/runtimes/RuntimeCellVariablesDialog.js +4 -9
  98. package/lib/components/runtimes/RuntimeLauncherDialog.d.ts +1 -2
  99. package/lib/components/runtimes/RuntimeLauncherDialog.js +2 -6
  100. package/lib/components/runtimes/RuntimePickerBase.d.ts +1 -1
  101. package/lib/components/runtimes/RuntimePickerBase.js +0 -5
  102. package/lib/components/runtimes/RuntimePickerCell.js +0 -5
  103. package/lib/components/runtimes/RuntimePickerNotebook.d.ts +1 -2
  104. package/lib/components/runtimes/RuntimePickerNotebook.js +1 -6
  105. package/lib/components/runtimes/RuntimeReservationControl.js +0 -5
  106. package/lib/components/runtimes/RuntimeSimplePicker.d.ts +1 -1
  107. package/lib/components/runtimes/RuntimeSimplePicker.js +36 -41
  108. package/lib/components/runtimes/RuntimeUtils.d.ts +1 -1
  109. package/lib/components/runtimes/RuntimeUtils.js +0 -5
  110. package/lib/components/runtimes/RuntimeVariables.js +0 -5
  111. package/lib/components/runtimes/index.js +0 -5
  112. package/lib/components/screenshot/ScreenCapture.js +1 -6
  113. package/lib/components/screenshot/index.js +0 -5
  114. package/lib/components/snapshots/RuntimeSnapshotMenu.js +0 -5
  115. package/lib/components/snapshots/index.js +0 -5
  116. package/lib/components/snippets/SnippetDialog.js +0 -5
  117. package/lib/components/snippets/index.js +0 -5
  118. package/lib/components/storage/ContentsBrowser.js +12 -7
  119. package/lib/components/storage/ContentsItems.js +0 -5
  120. package/lib/components/storage/index.js +0 -5
  121. package/lib/components/students/StudentItemStatus.js +6 -8
  122. package/lib/components/students/index.js +0 -5
  123. package/lib/components/subnav/SubNav.d.ts +2 -2
  124. package/lib/components/subnav/SubNav.js +4 -9
  125. package/lib/components/subnav/SubNav.module.css +683 -0
  126. package/lib/components/subnav/index.js +0 -5
  127. package/lib/components/tables/DataTable.js +0 -5
  128. package/lib/components/tables/index.js +0 -5
  129. package/lib/components/text-reveal/TextRevealAnimation.js +0 -6
  130. package/lib/components/text-reveal/TextRevealAnimation.module.css +43 -0
  131. package/lib/components/text-reveal/index.js +0 -5
  132. package/lib/components/text-reveal/useTextRevealAnimationLines.js +0 -5
  133. package/lib/components/tokens/SpaceVariantToken.js +0 -5
  134. package/lib/components/tokens/index.js +0 -5
  135. package/lib/components/toolbars/AssignmentEditorToolbar.js +0 -5
  136. package/lib/components/toolbars/DocumentEditorToolbar.js +0 -5
  137. package/lib/components/toolbars/NotebookEditorToolbar.d.ts +1 -1
  138. package/lib/components/toolbars/NotebookEditorToolbar.js +0 -5
  139. package/lib/components/toolbars/index.js +0 -5
  140. package/lib/components/users/PeerIndicator.js +0 -5
  141. package/lib/components/users/index.js +0 -5
  142. package/lib/config/Configuration.js +0 -5
  143. package/lib/config/index.js +0 -5
  144. package/lib/config/integrations/Loom.js +0 -5
  145. package/lib/config/integrations/index.js +0 -5
  146. package/lib/examples/CellExample.d.ts +6 -0
  147. package/lib/examples/CellExample.js +24 -0
  148. package/lib/examples/NotebookExample.d.ts +8 -0
  149. package/lib/examples/NotebookExample.js +22 -0
  150. package/lib/examples/NotebookExample1.ipynb.json +136 -0
  151. package/lib/hooks/assets/OutputshotPlaceholders.js +0 -5
  152. package/lib/hooks/assets/index.js +0 -5
  153. package/lib/hooks/index.d.ts +1 -1
  154. package/lib/hooks/index.js +1 -6
  155. package/lib/hooks/layouts/LayoutBackdrop.js +0 -5
  156. package/lib/hooks/layouts/LayoutScreenshot.css +58 -0
  157. package/lib/hooks/layouts/LayoutScreenshot.d.ts +1 -0
  158. package/lib/hooks/layouts/LayoutScreenshot.js +1 -5
  159. package/lib/hooks/layouts/index.js +0 -5
  160. package/lib/hooks/useAIAgents.js +7 -12
  161. package/lib/hooks/useAuthorization.js +0 -6
  162. package/lib/hooks/useBackdrop.js +0 -5
  163. package/lib/hooks/useBackdropJupyterLab.js +0 -5
  164. package/lib/hooks/useCache.d.ts +2 -2
  165. package/lib/hooks/useCache.js +178 -183
  166. package/lib/hooks/useCellOutputshot.js +0 -5
  167. package/lib/hooks/useContainsFocus.js +0 -5
  168. package/lib/hooks/useDatalayer.d.ts +21 -0
  169. package/lib/hooks/{useRun.js → useDatalayer.js} +12 -16
  170. package/lib/hooks/useError.js +0 -5
  171. package/lib/hooks/useExternalScript.js +0 -5
  172. package/lib/hooks/useFocusTrap.d.ts +1 -1
  173. package/lib/hooks/useFocusTrap.js +1 -6
  174. package/lib/hooks/useIAM.js +2 -7
  175. package/lib/hooks/useId.js +3 -8
  176. package/lib/hooks/useIsomorphicLayoutEffect.js +0 -5
  177. package/lib/hooks/useJupyterLabTheme.js +0 -5
  178. package/lib/hooks/useKeyboardEscape.js +0 -5
  179. package/lib/hooks/useLocationHandles.js +0 -5
  180. package/lib/hooks/useNavigate.js +0 -5
  181. package/lib/hooks/useNotebookAIAgent.js +0 -5
  182. package/lib/hooks/useOnClickOutside.js +0 -5
  183. package/lib/hooks/useRef.js +0 -5
  184. package/lib/hooks/useRuntimes.js +0 -5
  185. package/lib/hooks/useScreenshot.js +0 -5
  186. package/lib/hooks/useToast.js +6 -8
  187. package/lib/hooks/useUpload.js +0 -5
  188. package/lib/hooks/useVisibilityObserver.js +0 -5
  189. package/lib/hooks/useWindowSize.js +0 -6
  190. package/lib/i18n/Labels.js +0 -5
  191. package/lib/i18n/index.js +0 -5
  192. package/lib/index.css +73 -0
  193. package/lib/main.js +1 -2
  194. package/lib/mocks/components/FlashMock.js +0 -5
  195. package/lib/mocks/components/index.js +0 -5
  196. package/lib/mocks/hooks/index.d.ts +1 -1
  197. package/lib/mocks/hooks/index.js +1 -6
  198. package/lib/mocks/hooks/rests/index.js +0 -5
  199. package/lib/mocks/hooks/rests/rests.js +0 -5
  200. package/lib/mocks/hooks/useDatalayerMock.d.ts +6 -0
  201. package/lib/mocks/hooks/{useRunMock.js → useDatalayerMock.js} +2 -7
  202. package/lib/mocks/index.js +0 -5
  203. package/lib/mocks/jupyter/index.js +1 -6
  204. package/lib/mocks/models/CodeBlockMock.js +0 -5
  205. package/lib/mocks/models/CodelineMock.js +0 -5
  206. package/lib/mocks/models/CourseMock.js +0 -5
  207. package/lib/mocks/models/InviteMock.js +0 -5
  208. package/lib/mocks/models/SpaceMock.js +0 -5
  209. package/lib/mocks/models/UserMock.js +0 -5
  210. package/lib/mocks/models/index.js +0 -5
  211. package/lib/mocks/views/ActionMenuMock.js +0 -5
  212. package/lib/mocks/views/ChartMock.js +0 -5
  213. package/lib/mocks/views/ChartMockOptions.js +0 -5
  214. package/lib/mocks/views/DashboardMock.js +0 -5
  215. package/lib/mocks/views/FormMock.js +0 -5
  216. package/lib/mocks/views/TableMock.js +0 -5
  217. package/lib/mocks/views/WipMock.js +0 -5
  218. package/lib/mocks/views/index.js +0 -5
  219. package/lib/models/Contact.js +0 -5
  220. package/lib/models/ContactEvent.js +0 -5
  221. package/lib/models/Credits.js +0 -5
  222. package/lib/models/Dataset.d.ts +1 -1
  223. package/lib/models/Datasource.js +0 -5
  224. package/lib/models/Errors.js +0 -5
  225. package/lib/models/GrowthKPI.js +0 -5
  226. package/lib/models/IAMProviderUsers.js +0 -5
  227. package/lib/models/IAMToken.js +0 -5
  228. package/lib/models/Inbound.js +0 -5
  229. package/lib/models/LandingRoles.js +0 -5
  230. package/lib/models/Organization.js +0 -5
  231. package/lib/models/Outbound.js +7 -12
  232. package/lib/models/PageTag.d.ts +1 -1
  233. package/lib/models/RolesOrganization.js +0 -5
  234. package/lib/models/RolesPlatform.js +0 -5
  235. package/lib/models/RolesTeam.js +0 -5
  236. package/lib/models/Runtime.d.ts +59 -1
  237. package/lib/models/Runtime.js +7 -5
  238. package/lib/models/Secret.js +0 -5
  239. package/lib/models/Survey.js +0 -5
  240. package/lib/models/Team.js +0 -5
  241. package/lib/models/URN.js +0 -5
  242. package/lib/models/User.js +2 -7
  243. package/lib/models/UserEvent.js +0 -5
  244. package/lib/models/UserOnboarding.js +0 -5
  245. package/lib/models/UserSettings.js +0 -5
  246. package/lib/models/index.js +0 -5
  247. package/lib/routes/Routes.js +0 -5
  248. package/lib/routes/index.js +0 -5
  249. package/lib/state/State.js +0 -5
  250. package/lib/state/index.js +0 -5
  251. package/lib/state/storage/IAMStorage.js +0 -5
  252. package/lib/state/storage/index.js +0 -5
  253. package/lib/state/substates/AIAgentState.js +0 -5
  254. package/lib/state/substates/CellState.js +0 -5
  255. package/lib/state/substates/CoreState.js +0 -5
  256. package/lib/state/substates/DatasourceState.js +0 -5
  257. package/lib/state/substates/DocumentState.js +0 -5
  258. package/lib/state/substates/GradeState.js +0 -5
  259. package/lib/state/substates/IAMState.d.ts +1 -1
  260. package/lib/state/substates/IAMState.js +15 -18
  261. package/lib/state/substates/JupyterLabState.js +0 -5
  262. package/lib/state/substates/NbformatState.js +0 -5
  263. package/lib/state/substates/OrganizationState.js +0 -5
  264. package/lib/state/substates/RuntimesState.d.ts +2 -2
  265. package/lib/state/substates/RuntimesState.js +0 -5
  266. package/lib/state/substates/SpaceState.js +0 -5
  267. package/lib/state/substates/SurveysState.js +3 -8
  268. package/lib/state/substates/TeamState.js +0 -5
  269. package/lib/state/substates/index.js +0 -5
  270. package/lib/stories/assets/accessibility.png +0 -0
  271. package/lib/stories/assets/accessibility.svg +1 -0
  272. package/lib/stories/assets/addon-library.png +0 -0
  273. package/lib/stories/assets/assets.png +0 -0
  274. package/lib/stories/assets/context.png +0 -0
  275. package/lib/stories/assets/discord.svg +1 -0
  276. package/lib/stories/assets/docs.png +0 -0
  277. package/lib/stories/assets/figma-plugin.png +0 -0
  278. package/lib/stories/assets/github.svg +1 -0
  279. package/lib/stories/assets/share.png +0 -0
  280. package/lib/stories/assets/styling.png +0 -0
  281. package/lib/stories/assets/testing.png +0 -0
  282. package/lib/stories/assets/theming.png +0 -0
  283. package/lib/stories/assets/tutorials.svg +1 -0
  284. package/lib/stories/assets/youtube.svg +1 -0
  285. package/lib/stories/button.css +35 -0
  286. package/lib/stories/header.css +37 -0
  287. package/lib/stories/page.css +73 -0
  288. package/lib/test-setup.js +51 -1
  289. package/lib/theme/DatalayerTheme.js +0 -5
  290. package/lib/theme/DatalayerThemeProvider.js +0 -5
  291. package/lib/theme/Palette.js +0 -5
  292. package/lib/theme/index.js +0 -5
  293. package/lib/utils/Array.js +0 -5
  294. package/lib/utils/Avatar.js +0 -5
  295. package/lib/utils/Browser.js +0 -5
  296. package/lib/utils/Cookie.js +0 -5
  297. package/lib/utils/Date.js +3 -8
  298. package/lib/utils/Download.js +0 -5
  299. package/lib/utils/DownloadFile.js +0 -5
  300. package/lib/utils/Env.js +0 -5
  301. package/lib/utils/File.js +0 -5
  302. package/lib/utils/Ids.js +0 -5
  303. package/lib/utils/Jupyter.js +0 -5
  304. package/lib/utils/Lazy.js +0 -6
  305. package/lib/utils/Name.js +0 -5
  306. package/lib/utils/Number.js +1 -6
  307. package/lib/utils/Plots.d.ts +1 -1
  308. package/lib/utils/Plots.js +1 -1
  309. package/lib/utils/Random.js +0 -5
  310. package/lib/utils/Screenshot.js +0 -5
  311. package/lib/utils/Scroll.js +3 -7
  312. package/lib/utils/Sleep.js +0 -5
  313. package/lib/utils/Snapshot.js +0 -5
  314. package/lib/utils/String.js +0 -5
  315. package/lib/utils/Uri.js +1 -6
  316. package/lib/utils/Validator.js +0 -5
  317. package/lib/utils/WithSuspense.js +0 -5
  318. package/lib/utils/index.js +0 -5
  319. package/package.json +58 -28
  320. package/style/animation/Animation.module.css +174 -0
  321. package/style/base.css +64 -0
  322. package/style/index.css +6 -0
  323. package/lib/api/runtimes/models.d.ts +0 -59
  324. package/lib/api/runtimes/models.js +0 -11
  325. package/lib/hooks/useRun.d.ts +0 -21
  326. package/lib/mocks/hooks/useRunMock.d.ts +0 -6
  327. /package/lib/api/{runtimes → jupyter}/exec/Python.d.ts +0 -0
  328. /package/lib/api/{runtimes → jupyter}/exec/Snippets.d.ts +0 -0
  329. /package/lib/api/{runtimes → jupyter}/exec/index.d.ts +0 -0
@@ -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 { useState } from 'react';
11
6
  import { useCellStore } from '../state';
12
7
  import { takeHTMLNodeScreenshot } from '../utils/Screenshot';
@@ -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 { useCallback, useEffect, useState } from 'react';
11
6
  /**
12
7
  * Determine if a child element of the provided ref is currently focussed.
@@ -0,0 +1,21 @@
1
+ import type { IRequestDatalayerAPIOptions } from '../api';
2
+ export type IDatalayerRequestProps = {
3
+ /**
4
+ * React router login route
5
+ *
6
+ * @default '/login'
7
+ */
8
+ loginRoute?: string;
9
+ /**
10
+ * Notify user through toast on errors.
11
+ *
12
+ * @default true
13
+ */
14
+ notifyOnError?: boolean;
15
+ };
16
+ export interface DatalayerRequest extends IDatalayerRequestProps, IRequestDatalayerAPIOptions {
17
+ }
18
+ export declare function useDatalayer(props?: IDatalayerRequestProps): {
19
+ requestDatalayer: <T = any>(request: DatalayerRequest) => Promise<T>;
20
+ };
21
+ export default useDatalayer;
@@ -2,32 +2,30 @@
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 { useLocation } from 'react-router-dom';
11
6
  import { useNavigate } from './useNavigate';
12
7
  import { useToast } from './useToast';
13
- import { useRunMock } from './../mocks';
14
- import { useIAMStore, useCoreStore } from '../state';
15
- import { requestRunAPI } from '../api';
16
- export function useRun(props = {}) {
8
+ // import { useRuMnock } from './../mocks';
9
+ import { useIAMStore, } from '../state';
10
+ import { requestDatalayerAPI } from '../api';
11
+ export function useDatalayer(props = {}) {
17
12
  const { loginRoute = '/login', notifyOnError = true } = props;
18
13
  const location = useLocation();
14
+ /*
15
+ // TODO Fix the conditional hook call.
19
16
  const coreStore = useCoreStore();
20
17
  // Don't remove === true for the test, otherwise it will always be true???
21
18
  if (coreStore.configuration.useMock === true) {
22
- return useRunMock();
19
+ return useDatalayerMock();
23
20
  }
21
+ */
24
22
  const { enqueueToast } = useToast();
25
23
  const iamStore = useIAMStore();
26
24
  const navigate = useNavigate();
27
- const requestRun = async (request) => {
25
+ const requestDatalayer = async (request) => {
28
26
  const { loginRoute: loginRoute_ = loginRoute, notifyOnError: notifyOnError_ = notifyOnError, ...apiRequest } = request;
29
27
  const token = apiRequest.token ?? iamStore.token;
30
- return requestRunAPI({
28
+ return requestDatalayerAPI({
31
29
  ...apiRequest,
32
30
  token,
33
31
  })
@@ -78,8 +76,6 @@ export function useRun(props = {}) {
78
76
  throw error;
79
77
  });
80
78
  };
81
- return {
82
- requestRun
83
- };
79
+ return { requestDatalayer };
84
80
  }
85
- export default useRun;
81
+ export default useDatalayer;
@@ -3,11 +3,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  * Copyright (c) 2023-2025 Datalayer, Inc.
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
- /*
7
- * Copyright (c) 2021-2024 Datalayer, Inc.
8
- *
9
- * Datalayer License
10
- */
11
6
  import { useState } from "react";
12
7
  import { Flash } from '@primer/react';
13
8
  export const ErrorMessage = ({ message }) => {
@@ -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 { useEffect } from "react";
11
6
  const useExternalScript = (url) => {
12
7
  useEffect(() => {
@@ -22,7 +22,7 @@ export interface FocusTrapHookSettings {
22
22
  /**
23
23
  * Hook used to trap focus inside a container. Returns a ref that can be added to the container
24
24
  * that should trap focus.
25
- * @param settings {FocusTrapHookSettings}
25
+ * @param settings &lcub;FocusTrapHookSettings&rcub;
26
26
  */
27
27
  export declare function useFocusTrap(settings?: FocusTrapHookSettings, dependencies?: React.DependencyList): {
28
28
  containerRef: React.RefObject<HTMLElement> | undefined;
@@ -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 React from 'react';
11
6
  import { focusTrap } from '@primer/behaviors';
12
7
  /**
13
8
  * Hook used to trap focus inside a container. Returns a ref that can be added to the container
14
9
  * that should trap focus.
15
- * @param settings {FocusTrapHookSettings}
10
+ * @param settings &lcub;FocusTrapHookSettings&rcub;
16
11
  */
17
12
  export function useFocusTrap(settings, dependencies = []) {
18
13
  const containerRef = settings?.containerRef;
@@ -2,16 +2,11 @@
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 { useEffect, useState } from 'react';
11
6
  import { useCache } from './useCache';
12
7
  import { coreStore, useIAMStore, useLayoutStore, useOrganizationStore, useSpaceStore } from '../state';
13
8
  import { asUser, ANONYMOUS_USER, ANONYMOUS_USER_TOKEN } from '../models';
14
- import { requestRunAPI } from '../api';
9
+ import { requestDatalayerAPI } from '../api';
15
10
  export const useIAM = (props = { user: undefined, token: undefined }) => {
16
11
  const { token } = props;
17
12
  const [iamState, setIAMState] = useState(props);
@@ -22,7 +17,7 @@ export const useIAM = (props = { user: undefined, token: undefined }) => {
22
17
  const { clearAllCaches, whoami } = useCache();
23
18
  const loginAndNavigate = async (token, logout, refresh, navigate, homeRoute) => {
24
19
  try {
25
- const resp = await requestRunAPI({
20
+ const resp = await requestDatalayerAPI({
26
21
  url: `${iamStore.iamRunUrl}/api/iam/v1/login`,
27
22
  method: 'POST',
28
23
  body: { token },
@@ -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
  /*
11
6
  * Welcome to @reach/auto-id!
12
7
 
@@ -75,13 +70,13 @@ function genId() {
75
70
  const maybeReactUseId = React["useId".toString()];
76
71
  function useId(providedId) {
77
72
  if (maybeReactUseId !== undefined) {
78
- let generatedId = maybeReactUseId();
73
+ const generatedId = maybeReactUseId();
79
74
  return providedId ?? generatedId;
80
75
  }
81
76
  // If this instance isn't part of the initial render, we don't have to do the
82
77
  // double render/patch-up dance. We can just generate the ID and return it.
83
- let initialId = providedId ?? (serverHandoffComplete ? genId() : null);
84
- let [id, setId] = React.useState(initialId);
78
+ const initialId = providedId ?? (serverHandoffComplete ? genId() : null);
79
+ const [id, setId] = React.useState(initialId);
85
80
  useLayoutEffect(() => {
86
81
  if (id === null) {
87
82
  // Patch the ID after render. We do this in `useLayoutEffect` to avoid any
@@ -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 { useEffect, useLayoutEffect } from 'react';
11
6
  const useIsomorphicLayoutEffect = typeof window !== 'undefined' &&
12
7
  typeof window.document !== 'undefined' &&
@@ -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 { useEffect, useState } from 'react';
11
6
  export var JupyterLabTheme;
12
7
  (function (JupyterLabTheme) {
@@ -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 { useCallback, useEffect } from 'react';
11
6
  export function useKeyboardEscape(handler) {
12
7
  const handleKeyboardEscape = useCallback(event => {
@@ -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 { useLocation, useParams } from "react-router-dom";
11
6
  import { useRunStore } from "../state";
12
7
  export const useLocationHandles = () => {
@@ -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 { useNavigate as useRouterNavigate } from "react-router-dom";
11
6
  import { useLayoutStore } from '../state';
12
7
  export const useNavigate = () => {
@@ -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 { useEffect } from 'react';
11
6
  import { useAIAgentStore } from '../state';
12
7
  import { useAIAgents } from './useAIAgents';
@@ -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 { useEffect } from 'react';
11
6
  export function useOnClickOutside(ref, handler) {
12
7
  useEffect(() => {
@@ -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 { useRef } from 'react';
11
6
  /**
12
7
  * There are some situations where we only want to create a new ref if one is not provided to a component
@@ -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 { requestJupyterKernelsExtension } from '../api';
11
6
  export const useRuntimes = () => {
12
7
  // Folder Mounting ----------------------------------------------------------
@@ -3,11 +3,6 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
3
3
  * Copyright (c) 2023-2025 Datalayer, Inc.
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
- /*
7
- * Copyright (c) 2021-2024 Datalayer, Inc.
8
- *
9
- * Datalayer License
10
- */
11
6
  import { createContext, useState, useContext } from 'react';
12
7
  import { LayoutScreenshot } from "./layouts";
13
8
  export const ScreenshotContext = createContext({
@@ -3,11 +3,6 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
3
3
  * Copyright (c) 2023-2025 Datalayer, Inc.
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
- /*
7
- * Copyright (c) 2021-2024 Datalayer, Inc.
8
- *
9
- * Datalayer License
10
- */
11
6
  import React from 'react';
12
7
  import { toast } from 'react-toastify';
13
8
  import { Notification } from '@jupyterlab/apputils';
@@ -125,9 +120,12 @@ export const useToast = () => {
125
120
  * @param id Toast id
126
121
  */
127
122
  dismiss: (id) => {
128
- insideJupyterLab
129
- ? Notification.dismiss(id)
130
- : toast.dismiss(id);
123
+ if (insideJupyterLab) {
124
+ Notification.dismiss(id);
125
+ }
126
+ else {
127
+ toast.dismiss(id);
128
+ }
131
129
  },
132
130
  /**
133
131
  * Track the progress of an asynchronous task
@@ -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 { useState } from "react";
11
6
  import axios from "axios";
12
7
  // import useRun from "./useRun";
@@ -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 { useState, useEffect } from 'react';
11
6
  export function useVisibilityObserver(navigationRef, children) {
12
7
  const [visibilityMap, setVisibilityMap] = useState({});
@@ -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 { useState, useEffect } from 'react';
11
6
  export var BreakpointSize;
12
7
  (function (BreakpointSize) {
@@ -48,7 +43,6 @@ export function useWindowSize() {
48
43
  currentBreakpointSize: breakpointSwitch(window.innerWidth),
49
44
  });
50
45
  }
51
- // eslint-disable-next-line github/prefer-observers
52
46
  window.addEventListener('resize', handleResize);
53
47
  handleResize();
54
48
  return () => window.removeEventListener('resize', handleResize);
@@ -2,9 +2,4 @@
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 const NO_RUNTIME_AVAILABLE_LABEL = 'The runtime you have requested is currently not available due to resource limitations. Please try again later...';
package/lib/i18n/index.js CHANGED
@@ -2,9 +2,4 @@
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 './Labels';
package/lib/index.css ADDED
@@ -0,0 +1,73 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+
6
+ :root {
7
+ font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
8
+ line-height: 1.5;
9
+ font-weight: 400;
10
+
11
+ color-scheme: light dark;
12
+ color: rgba(255, 255, 255, 0.87);
13
+ background-color: #242424;
14
+
15
+ font-synthesis: none;
16
+ text-rendering: optimizeLegibility;
17
+ -webkit-font-smoothing: antialiased;
18
+ -moz-osx-font-smoothing: grayscale;
19
+ }
20
+
21
+ a {
22
+ font-weight: 500;
23
+ color: #646cff;
24
+ text-decoration: inherit;
25
+ }
26
+ a:hover {
27
+ color: #535bf2;
28
+ }
29
+
30
+ body {
31
+ margin: 0;
32
+ display: flex;
33
+ place-items: center;
34
+ min-width: 320px;
35
+ min-height: 100vh;
36
+ }
37
+
38
+ h1 {
39
+ font-size: 3.2em;
40
+ line-height: 1.1;
41
+ }
42
+
43
+ button {
44
+ border-radius: 8px;
45
+ border: 1px solid transparent;
46
+ padding: 0.6em 1.2em;
47
+ font-size: 1em;
48
+ font-weight: 500;
49
+ font-family: inherit;
50
+ background-color: #1a1a1a;
51
+ cursor: pointer;
52
+ transition: border-color 0.25s;
53
+ }
54
+ button:hover {
55
+ border-color: #646cff;
56
+ }
57
+ button:focus,
58
+ button:focus-visible {
59
+ outline: 4px auto -webkit-focus-ring-color;
60
+ }
61
+
62
+ @media (prefers-color-scheme: light) {
63
+ :root {
64
+ color: #213547;
65
+ background-color: #ffffff;
66
+ }
67
+ a:hover {
68
+ color: #747bff;
69
+ }
70
+ button {
71
+ background-color: #f9f9f9;
72
+ }
73
+ }
package/lib/main.js CHANGED
@@ -3,8 +3,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  * Copyright (c) 2023-2025 Datalayer, Inc.
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
- import { StrictMode } from 'react';
7
6
  import { createRoot } from 'react-dom/client';
8
7
  import App from './App';
9
8
  import './index.css';
10
- createRoot(document.getElementById('root')).render(_jsx(StrictMode, { children: _jsx(App, {}) }));
9
+ createRoot(document.getElementById('root')).render(_jsx(App, {}));
@@ -3,11 +3,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  * Copyright (c) 2023-2025 Datalayer, Inc.
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
- /*
7
- * Copyright (c) 2021-2024 Datalayer, Inc.
8
- *
9
- * Datalayer License
10
- */
11
6
  import { AlertIcon } from "@primer/octicons-react";
12
7
  import { Flash, Link } from "@primer/react";
13
8
  import { useNavigate } from "../../hooks";
@@ -2,9 +2,4 @@
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 './FlashMock';
@@ -1 +1 @@
1
- export * from './useRunMock';
1
+ export * from './useDatalayerMock';
@@ -2,9 +2,4 @@
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
- export * from './useRunMock';
5
+ export * from './useDatalayerMock';
@@ -2,9 +2,4 @@
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 './rests';
@@ -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
  const TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJodHRwczovL2Rldi5kYXRhbGF5ZXIuaW8iLCJpYXQiOjE3MTc1MDE1MjYsImV4cCI6MTcxNzU4NzkyNiwic3ViIjp7InVpZCI6IjRkODk2ZjI0LWM1MzEtNDljMS1iMjcyLTRlNTM2NjJjZDNkZSIsImhhbmRsZSI6ImVyaWMiLCJlbWFpbCI6ImVyaWNAZGF0YWxheWVyLmlvIiwiZmlyc3RfbmFtZSI6IkVyaWMiLCJsYXN0X25hbWUiOiJDaGFybGVzIiwicm9sZXMiOlsic3lzdGVtX2FkbWluIiwidXNlciJdfSwianRpIjoiZTAxYjIzMTYtYWJlMi00OTkyLWJjMmUtY2UyODIzZGJiOTdmIiwicm9sZXMiOlsic3lzdGVtX2FkbWluIiwidXNlciJdfQ.-cnEfJAUhet_nBLmxzx96zuv3PMEsGWLNCN6HV8PEso";
11
6
  export const systemAdminLogin = (handle = 'hello') => {
12
7
  return {
@@ -0,0 +1,6 @@
1
+ import { IAMStateProps } from "./../../hooks";
2
+ import { DatalayerRequest } from "./../../hooks";
3
+ export declare const useDatalayerMock: (props?: IAMStateProps) => {
4
+ requestRun: <T = any>(request: DatalayerRequest) => Promise<T>;
5
+ };
6
+ export default useDatalayerMock;
@@ -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 { useLocation } from 'react-router-dom';
11
6
  import { useNavigate } from './../../hooks';
12
7
  import { useToast } from './../../hooks';
@@ -18,7 +13,7 @@ const getMockResponse = (request) => {
18
13
  return systemAdminLogin(body.handle);
19
14
  }
20
15
  };
21
- export const useRunMock = (props = { user: undefined, token: undefined }) => {
16
+ export const useDatalayerMock = (props = { user: undefined, token: undefined }) => {
22
17
  const location = useLocation();
23
18
  const navigate = useNavigate();
24
19
  const iamStore = useIAMStore();
@@ -80,4 +75,4 @@ export const useRunMock = (props = { user: undefined, token: undefined }) => {
80
75
  requestRun,
81
76
  };
82
77
  };
83
- export default useRunMock;
78
+ export default useDatalayerMock;
@@ -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 './components';
11
6
  export * from './hooks';
12
7
  // export * from './jupyter';
@@ -1,10 +1,5 @@
1
+ export {};
1
2
  /*
2
3
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
4
  * Distributed under the terms of the Modified BSD License.
4
5
  */
5
- export {};
6
- /*
7
- * Copyright (c) 2021-2024 Datalayer, Inc.
8
- *
9
- * Datalayer License
10
- */
@@ -2,9 +2,4 @@
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 const CodeBlockMock = "";