@datalayer/core 1.0.13 → 1.0.14

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 (250) hide show
  1. package/lib/App.js +2 -2
  2. package/lib/api/DatalayerApi.js +1 -1
  3. package/lib/api/iam/authentication.js +3 -3
  4. package/lib/api/iam/datasources.js +3 -3
  5. package/lib/api/iam/healthz.js +2 -2
  6. package/lib/api/iam/index.js +12 -12
  7. package/lib/api/iam/oauth2.js +2 -2
  8. package/lib/api/iam/profile.js +3 -3
  9. package/lib/api/iam/secrets.js +3 -3
  10. package/lib/api/iam/usage.js +2 -2
  11. package/lib/api/index.js +8 -8
  12. package/lib/api/otel/index.js +5 -5
  13. package/lib/api/otel/logs.js +3 -3
  14. package/lib/api/otel/metrics.js +3 -3
  15. package/lib/api/otel/query.js +3 -3
  16. package/lib/api/otel/services.js +3 -3
  17. package/lib/api/otel/traces.js +3 -3
  18. package/lib/api/runtimes/checkpoints.js +3 -3
  19. package/lib/api/runtimes/environments.js +3 -3
  20. package/lib/api/runtimes/healthz.js +2 -2
  21. package/lib/api/runtimes/index.js +5 -5
  22. package/lib/api/runtimes/runtimes.js +3 -3
  23. package/lib/api/runtimes/snapshots.js +3 -3
  24. package/lib/api/spacer/documents.js +2 -2
  25. package/lib/api/spacer/healthz.js +2 -2
  26. package/lib/api/spacer/index.js +7 -7
  27. package/lib/api/spacer/items.js +2 -2
  28. package/lib/api/spacer/lexicals.js +2 -2
  29. package/lib/api/spacer/notebooks.js +2 -2
  30. package/lib/api/spacer/spaces.js +3 -3
  31. package/lib/api/spacer/users.js +3 -3
  32. package/lib/client/auth/AuthenticationManager.js +3 -3
  33. package/lib/client/auth/index.js +4 -4
  34. package/lib/client/auth/storage.js +1 -1
  35. package/lib/client/auth/strategies.js +3 -3
  36. package/lib/client/base.js +2 -2
  37. package/lib/client/index.js +19 -19
  38. package/lib/client/mixins/IAMMixin.js +10 -10
  39. package/lib/client/mixins/RuntimesMixin.js +7 -7
  40. package/lib/client/mixins/SpacerMixin.js +11 -11
  41. package/lib/client/utils/spacerUtils.js +3 -3
  42. package/lib/collaboration/DatalayerCollaborationProvider.js +1 -1
  43. package/lib/collaboration/index.js +2 -2
  44. package/lib/components/auth/Login.js +6 -6
  45. package/lib/components/auth/Login.stories.js +2 -2
  46. package/lib/components/auth/LoginToken.js +2 -2
  47. package/lib/components/auth/index.js +3 -3
  48. package/lib/components/avatars/BoringAvatar.stories.js +1 -1
  49. package/lib/components/avatars/UserProfileAvatar.js +2 -2
  50. package/lib/components/avatars/index.js +2 -2
  51. package/lib/components/banners/NoAutomationBanner.js +1 -1
  52. package/lib/components/banners/index.js +1 -1
  53. package/lib/components/buttons/DownloadCSVButton.js +1 -1
  54. package/lib/components/buttons/DownloadJsonButton.js +1 -1
  55. package/lib/components/buttons/index.js +5 -5
  56. package/lib/components/checkout/StripeCheckout.js +1 -1
  57. package/lib/components/checkout/index.js +1 -1
  58. package/lib/components/confetti/index.js +1 -1
  59. package/lib/components/context/OrganizationSelect.js +2 -2
  60. package/lib/components/context/SpaceSelect.js +2 -2
  61. package/lib/components/context/index.js +2 -2
  62. package/lib/components/display/DatalayerBox.js +1 -1
  63. package/lib/components/display/LiveRelativeTime.js +1 -1
  64. package/lib/components/display/NavLink.js +1 -1
  65. package/lib/components/display/index.js +14 -14
  66. package/lib/components/echarts/index.js +1 -1
  67. package/lib/components/flashes/FlashDisclaimer.js +2 -2
  68. package/lib/components/flashes/FlashGuest.js +4 -4
  69. package/lib/components/flashes/FlashSurveys.js +4 -4
  70. package/lib/components/flashes/FlashUnauthorized.js +1 -1
  71. package/lib/components/flashes/index.js +6 -6
  72. package/lib/components/flashes/surveys/index.js +2 -2
  73. package/lib/components/iam/ExternalTokenSilentLogin.js +3 -3
  74. package/lib/components/iam/index.js +1 -1
  75. package/lib/components/icons/index.js +1 -1
  76. package/lib/components/index.js +2 -2
  77. package/lib/components/labels/index.js +1 -1
  78. package/lib/components/landings/index.js +1 -1
  79. package/lib/components/navbar/NavigationVisbilityObserver.js +4 -4
  80. package/lib/components/navbar/SubdomainNavBar.js +5 -5
  81. package/lib/components/navbar/index.js +2 -2
  82. package/lib/components/nbgrader/index.js +1 -1
  83. package/lib/components/notebooks/index.js +2 -2
  84. package/lib/components/progress/ConsumptionBar.js +1 -1
  85. package/lib/components/progress/CreditsIndicator.js +2 -2
  86. package/lib/components/progress/index.js +6 -6
  87. package/lib/components/runtimes/RuntimeCellVariablesDialog.js +2 -2
  88. package/lib/components/runtimes/RuntimeLauncherDialog.js +9 -9
  89. package/lib/components/runtimes/RuntimePickerBase.js +3 -3
  90. package/lib/components/runtimes/RuntimePickerCell.js +8 -8
  91. package/lib/components/runtimes/RuntimePickerNotebook.js +6 -6
  92. package/lib/components/runtimes/RuntimeSimplePicker.js +3 -3
  93. package/lib/components/runtimes/index.js +11 -11
  94. package/lib/components/screencapture/ScreencaptureButton.js +3 -3
  95. package/lib/components/screencapture/index.js +2 -2
  96. package/lib/components/snapshots/RuntimeSnapshotMenu.js +4 -4
  97. package/lib/components/snapshots/index.js +1 -1
  98. package/lib/components/snippets/SnippetDialog.js +1 -1
  99. package/lib/components/snippets/index.js +1 -1
  100. package/lib/components/sparklines/Sparklines.js +5 -1
  101. package/lib/components/sparklines/dataProcessing.js +4 -0
  102. package/lib/components/sparklines/index.js +7 -3
  103. package/lib/components/sparklines/types.js +1 -1
  104. package/lib/components/storage/ContentsBrowser.js +3 -3
  105. package/lib/components/storage/index.js +2 -2
  106. package/lib/components/students/index.js +1 -1
  107. package/lib/components/subnav/SubNav.js +2 -2
  108. package/lib/components/subnav/index.js +1 -1
  109. package/lib/components/tables/index.js +1 -1
  110. package/lib/components/text-reveal/TextRevealAnimation.js +1 -1
  111. package/lib/components/text-reveal/index.js +1 -1
  112. package/lib/components/tokens/index.js +1 -1
  113. package/lib/components/toolbars/AssignmentEditorToolbar.js +1 -1
  114. package/lib/components/toolbars/DocumentEditorToolbar.js +1 -1
  115. package/lib/components/toolbars/index.js +3 -3
  116. package/lib/components/users/PeerIndicator.js +1 -1
  117. package/lib/components/users/index.js +1 -1
  118. package/lib/config/Configuration.js +1 -1
  119. package/lib/config/index.js +2 -2
  120. package/lib/config/integrations/index.js +1 -1
  121. package/lib/hooks/assets/index.js +1 -1
  122. package/lib/hooks/index.js +33 -33
  123. package/lib/hooks/layouts/LayoutBackdrop.js +2 -2
  124. package/lib/hooks/layouts/LayoutScreencapture.js +3 -3
  125. package/lib/hooks/layouts/index.js +2 -2
  126. package/lib/hooks/useAuthorization.js +3 -3
  127. package/lib/hooks/useBackdrop.js +2 -2
  128. package/lib/hooks/useCache.js +8 -8
  129. package/lib/hooks/useCellOutputshot.js +2 -2
  130. package/lib/hooks/useDatalayer.js +6 -6
  131. package/lib/hooks/useIAM.js +4 -4
  132. package/lib/hooks/useLocation.js +2 -2
  133. package/lib/hooks/useLocationHandles.js +3 -3
  134. package/lib/hooks/useNavigate.js +4 -4
  135. package/lib/hooks/useParams.js +2 -2
  136. package/lib/hooks/useProjects.js +1 -1
  137. package/lib/hooks/useRuntimes.js +1 -1
  138. package/lib/hooks/useScreencapture.js +1 -1
  139. package/lib/hooks/useToast.js +41 -5
  140. package/lib/hooks/useUpload.js +2 -2
  141. package/lib/hooks/useUser.js +1 -1
  142. package/lib/i18n/index.js +1 -1
  143. package/lib/index.js +16 -16
  144. package/lib/main.js +1 -1
  145. package/lib/mocks/components/FlashMock.js +1 -1
  146. package/lib/mocks/components/index.js +1 -1
  147. package/lib/mocks/hooks/index.js +1 -1
  148. package/lib/mocks/hooks/rests/index.js +1 -1
  149. package/lib/mocks/hooks/useDatalayerMock.js +5 -5
  150. package/lib/mocks/index.js +5 -5
  151. package/lib/mocks/models/CourseMock.js +3 -3
  152. package/lib/mocks/models/InviteMock.js +2 -2
  153. package/lib/mocks/models/OrganisationMock.js +1 -1
  154. package/lib/mocks/models/SchoolMock.js +1 -1
  155. package/lib/mocks/models/SpaceMock.js +2 -2
  156. package/lib/mocks/models/TeamMock.js +1 -1
  157. package/lib/mocks/models/UserMock.js +1 -1
  158. package/lib/mocks/models/index.js +9 -9
  159. package/lib/mocks/views/ChartMock.js +3 -3
  160. package/lib/mocks/views/DashboardMock.js +2 -2
  161. package/lib/mocks/views/TableMock.js +1 -1
  162. package/lib/mocks/views/index.js +7 -7
  163. package/lib/models/Contact.js +3 -3
  164. package/lib/models/CreditsDTO.js +1 -1
  165. package/lib/models/Datasource.js +1 -1
  166. package/lib/models/EnvironmentDTO.js +1 -1
  167. package/lib/models/HealthCheck.js +1 -1
  168. package/lib/models/IAMProviderUsers.js +1 -1
  169. package/lib/models/Invite.js +1 -1
  170. package/lib/models/ItemDTO.js +1 -1
  171. package/lib/models/LexicalDTO.js +4 -4
  172. package/lib/models/NotebookDTO.js +4 -4
  173. package/lib/models/Organization.js +2 -2
  174. package/lib/models/Page.js +2 -2
  175. package/lib/models/RuntimeDTO.js +2 -2
  176. package/lib/models/RuntimeSnapshotDTO.js +2 -2
  177. package/lib/models/Secret.js +1 -1
  178. package/lib/models/Space.js +3 -3
  179. package/lib/models/SpaceDTO.js +9 -9
  180. package/lib/models/Team.js +2 -2
  181. package/lib/models/User.js +5 -5
  182. package/lib/models/UserDTO.js +1 -1
  183. package/lib/models/index.js +75 -75
  184. package/lib/navigation/components.js +1 -1
  185. package/lib/navigation/index.js +4 -4
  186. package/lib/otel/client/OtelClient.js +1 -1
  187. package/lib/otel/client/index.js +1 -1
  188. package/lib/otel/hooks/index.js +1 -1
  189. package/lib/otel/index.js +15 -15
  190. package/lib/otel/views/OtelLive.js +11 -11
  191. package/lib/otel/views/OtelLogsList.js +1 -1
  192. package/lib/otel/views/OtelMetricsList.js +2 -2
  193. package/lib/otel/views/OtelSpanDetail.js +2 -2
  194. package/lib/otel/views/OtelSpanTree.js +1 -1
  195. package/lib/otel/views/OtelSqlView.js +1 -1
  196. package/lib/otel/views/OtelSystemView.js +1 -1
  197. package/lib/otel/views/OtelTimeline.js +1 -1
  198. package/lib/otel/views/OtelTracesList.js +1 -1
  199. package/lib/otel/views/index.js +12 -12
  200. package/lib/routes/index.js +1 -1
  201. package/lib/services/DatalayerServiceManager.js +3 -3
  202. package/lib/services/index.js +3 -3
  203. package/lib/state/State.js +13 -13
  204. package/lib/state/index.js +3 -3
  205. package/lib/state/storage/IAMStorage.js +2 -2
  206. package/lib/state/storage/index.js +1 -1
  207. package/lib/state/substates/CoreState.js +1 -1
  208. package/lib/state/substates/IAMState.js +5 -5
  209. package/lib/state/substates/RuntimesState.js +3 -3
  210. package/lib/state/substates/SurveysState.js +4 -4
  211. package/lib/state/substates/TeamState.js +1 -1
  212. package/lib/state/substates/index.js +14 -14
  213. package/lib/stateful/index.js +2 -2
  214. package/lib/stateful/jupyter/exec/Snippets.js +1 -1
  215. package/lib/stateful/jupyter/exec/index.js +2 -2
  216. package/lib/stateful/jupyter/index.js +2 -2
  217. package/lib/stateful/runtimes/actions.js +4 -4
  218. package/lib/stateful/runtimes/index.js +5 -5
  219. package/lib/stateful/runtimes/snapshots.js +1 -1
  220. package/lib/utils/Date.d.ts +11 -0
  221. package/lib/utils/Date.js +30 -0
  222. package/lib/utils/cli/index.js +1 -1
  223. package/lib/utils/index.js +29 -29
  224. package/lib/views/datasources/DatasourceDetail.js +3 -3
  225. package/lib/views/datasources/DatasourceNew.js +2 -2
  226. package/lib/views/datasources/Datasources.js +1 -1
  227. package/lib/views/datasources/index.js +3 -3
  228. package/lib/views/iam/SignInSimple.js +1 -1
  229. package/lib/views/iam/index.js +1 -1
  230. package/lib/views/iam-tokens/IAMTokenEdit.js +3 -3
  231. package/lib/views/iam-tokens/IAMTokenNew.js +2 -2
  232. package/lib/views/iam-tokens/IAMTokens.js +1 -1
  233. package/lib/views/iam-tokens/Tokens.js +1 -1
  234. package/lib/views/iam-tokens/index.js +3 -3
  235. package/lib/views/index.js +3 -3
  236. package/lib/views/otel/DashboardView.js +1 -1
  237. package/lib/views/otel/LogsView.js +1 -1
  238. package/lib/views/otel/MetricsView.js +1 -1
  239. package/lib/views/otel/OtelHeader.js +1 -1
  240. package/lib/views/otel/SqlView.js +1 -1
  241. package/lib/views/otel/SystemView.js +1 -1
  242. package/lib/views/otel/TracesView.js +1 -1
  243. package/lib/views/otel/index.js +8 -8
  244. package/lib/views/profile/UserBadge.js +1 -1
  245. package/lib/views/profile/index.js +1 -1
  246. package/lib/views/secrets/SecretEdit.js +3 -3
  247. package/lib/views/secrets/SecretNew.js +2 -2
  248. package/lib/views/secrets/Secrets.js +1 -1
  249. package/lib/views/secrets/index.js +3 -3
  250. package/package.json +1 -1
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { useLocation } from './useLocation';
6
- import { useParams } from './useParams';
7
- import { useRunStore } from '../state';
5
+ import { useLocation } from './useLocation.js';
6
+ import { useParams } from './useParams.js';
7
+ import { useRunStore } from '../state/index.js';
8
8
  export const useLocationHandles = () => {
9
9
  const params = useParams();
10
10
  const { accountHandle, spaceHandle } = params;
@@ -3,13 +3,13 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { useCallback } from 'react';
6
- import { useLayoutStore } from '../state';
7
- import { createNativeNavigate } from '../navigation/adapters/native';
6
+ import { useLayoutStore } from '../state/index.js';
7
+ import { createNativeNavigate } from '../navigation/adapters/native.js';
8
8
  // Import React Router hooks from our wrapper
9
- import { useNavigateRR } from '../navigation/adapters/react-router';
9
+ import { useNavigateRR } from '../navigation/adapters/react-router.js';
10
10
  // Import Next.js hooks from our wrapper
11
11
  // Currently not used but kept for future Next.js support
12
- // import { useRouterNext } from '../navigation/adapters/nextjs';
12
+ // import { useRouterNext } from '../navigation/adapters/nextjs.js';
13
13
  /**
14
14
  * Main navigation hook that provides a universal navigate function
15
15
  * Works with React Router, Next.js, or native browser navigation
@@ -3,8 +3,8 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { useEffect, useState, useMemo } from 'react';
6
- import { useParamsRR } from '../navigation/adapters/react-router';
7
- import { useParamsNext, useSearchParamsNext, } from '../navigation/adapters/nextjs';
6
+ import { useParamsRR } from '../navigation/adapters/react-router.js';
7
+ import { useParamsNext, useSearchParamsNext, } from '../navigation/adapters/nextjs.js';
8
8
  /**
9
9
  * Hook to get URL parameters
10
10
  * Works with Next.js App Router, React Router, or falls back to URL parsing
@@ -13,7 +13,7 @@
13
13
  * @module hooks/useProjects
14
14
  */
15
15
  import { useMemo, useCallback } from 'react';
16
- import { useCache } from './useCache';
16
+ import { useCache } from './useCache.js';
17
17
  /** The space type value used to identify project spaces in Solr */
18
18
  export const PROJECT_SPACE_VARIANT = 'project';
19
19
  /**
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { requestJupyterKernelsExtension } from '../stateful/jupyter/kernelsHandler';
5
+ import { requestJupyterKernelsExtension } from '../stateful/jupyter/kernelsHandler.js';
6
6
  export const useRuntimes = () => {
7
7
  // Folder Mounting ----------------------------------------------------------
8
8
  const mountLocalFolder = (kernelId) => {
@@ -4,7 +4,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
6
  import { createContext, useState, useContext } from 'react';
7
- import { LayoutScreencapture } from './layouts';
7
+ import { LayoutScreencapture } from './layouts/index.js';
8
8
  export const ScreencaptureContext = createContext({
9
9
  closeScreencapture: () => { },
10
10
  displayScreencapture: (nextScreencapture) => { },
@@ -8,8 +8,33 @@ import { toast } from 'react-toastify';
8
8
  import { Notification } from '@jupyterlab/apputils';
9
9
  import { Button } from '@primer/react';
10
10
  import { JupyterReactTheme } from '@datalayer/jupyter-react';
11
- import { isInsideJupyterLab } from '../utils';
11
+ import { isInsideJupyterLab } from '../utils/index.js';
12
12
  const TOAST_POSITION = 'bottom-right';
13
+ const THEME_STORAGE_KEY = 'datalayer-theme';
14
+ function resolveToastTheme() {
15
+ if (typeof window === 'undefined') {
16
+ return 'dark';
17
+ }
18
+ let preferredMode;
19
+ try {
20
+ const raw = window.localStorage.getItem(THEME_STORAGE_KEY);
21
+ if (raw) {
22
+ const parsed = JSON.parse(raw);
23
+ preferredMode = parsed?.state?.colorMode;
24
+ }
25
+ }
26
+ catch {
27
+ // Ignore parsing/storage access errors and fall back to media query.
28
+ }
29
+ if (preferredMode === 'light') {
30
+ return 'light';
31
+ }
32
+ if (preferredMode === 'dark') {
33
+ return 'dark';
34
+ }
35
+ const systemPrefersDark = window.matchMedia?.('(prefers-color-scheme: dark)')?.matches;
36
+ return systemPrefersDark ? 'dark' : 'light';
37
+ }
13
38
  const displayType2Class = {
14
39
  accent: 'primary',
15
40
  link: 'invisible',
@@ -45,6 +70,7 @@ export const useToast = () => {
45
70
  const insideJupyterLab = isInsideJupyterLab();
46
71
  const enqueueToast = (message, options = { variant: 'info' }) => {
47
72
  const { actions, autoClose } = options;
73
+ const theme = resolveToastTheme();
48
74
  switch (options.variant) {
49
75
  case 'info': {
50
76
  return insideJupyterLab
@@ -55,7 +81,7 @@ export const useToast = () => {
55
81
  : toast.info(({ closeToast }) => createContent(message, () => {
56
82
  if (closeToast)
57
83
  closeToast();
58
- }, actions), { autoClose, position: TOAST_POSITION });
84
+ }, actions), { autoClose, position: TOAST_POSITION, theme });
59
85
  }
60
86
  case 'success': {
61
87
  return insideJupyterLab
@@ -66,7 +92,7 @@ export const useToast = () => {
66
92
  : toast.success(({ closeToast }) => createContent(message, () => {
67
93
  if (closeToast)
68
94
  closeToast();
69
- }, actions), { autoClose, position: TOAST_POSITION });
95
+ }, actions), { autoClose, position: TOAST_POSITION, theme });
70
96
  }
71
97
  case 'warning': {
72
98
  return insideJupyterLab
@@ -77,7 +103,11 @@ export const useToast = () => {
77
103
  : toast.warning(({ closeToast }) => createContent(message, () => {
78
104
  if (closeToast)
79
105
  closeToast();
80
- }, actions), { autoClose: autoClose ?? false, position: TOAST_POSITION });
106
+ }, actions), {
107
+ autoClose: autoClose ?? false,
108
+ position: TOAST_POSITION,
109
+ theme,
110
+ });
81
111
  }
82
112
  case 'error': {
83
113
  return insideJupyterLab
@@ -88,11 +118,16 @@ export const useToast = () => {
88
118
  : toast.error(({ closeToast }) => createContent(message, () => {
89
119
  if (closeToast)
90
120
  closeToast();
91
- }, actions), { autoClose: autoClose ?? false, position: TOAST_POSITION });
121
+ }, actions), {
122
+ autoClose: autoClose ?? false,
123
+ position: TOAST_POSITION,
124
+ theme,
125
+ });
92
126
  }
93
127
  }
94
128
  };
95
129
  const trackAsyncTask = (promise, options) => {
130
+ const theme = resolveToastTheme();
96
131
  return insideJupyterLab
97
132
  ? Notification.promise(promise, options)
98
133
  : toast.promise(promise, {
@@ -104,6 +139,7 @@ export const useToast = () => {
104
139
  },
105
140
  }, {
106
141
  position: TOAST_POSITION,
142
+ theme,
107
143
  ...options.pending.options,
108
144
  });
109
145
  };
@@ -4,8 +4,8 @@
4
4
  */
5
5
  import { useState } from 'react';
6
6
  import axios from 'axios';
7
- // import useRun from "./useRun";
8
- import { useIAMStore } from '../state';
7
+ // import useRun from "./useRun.js";
8
+ import { useIAMStore } from '../state/index.js';
9
9
  // TODO reuse useRun hook.
10
10
  export const useUploadForm = (url) => {
11
11
  const [isSuccess, setIsSuccess] = useState(false);
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { useIAMStore } from '../state';
5
+ import { useIAMStore } from '../state/index.js';
6
6
  const LOGIN_HREF = '/login';
7
7
  export const useUser = (role) => {
8
8
  const { user } = useIAMStore();
package/lib/i18n/index.js CHANGED
@@ -2,4 +2,4 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from './Labels';
5
+ export * from './Labels.js';
package/lib/index.js CHANGED
@@ -3,30 +3,30 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  // Export core components and utilities
6
- export * from './components';
7
- export * from './utils';
8
- export * from './state';
9
- export * from './collaboration';
10
- export * from './services';
6
+ export * from './components/index.js';
7
+ export * from './utils/index.js';
8
+ export * from './state/index.js';
9
+ export * from './collaboration/index.js';
10
+ export * from './services/index.js';
11
11
  // Export navigation before hooks to avoid conflicts
12
- export * from './navigation';
13
- export * from './hooks';
12
+ export * from './navigation/index.js';
13
+ export * from './hooks/index.js';
14
14
  // Export APIs.
15
- export { requestDatalayerAPI, RunResponseError, NetworkError, } from './api/DatalayerApi';
16
- export { API_BASE_PATHS } from './api/constants';
17
- export * as runtimesApi from './api/runtimes';
18
- export * as iamApi from './api/iam';
19
- export * as spacerApi from './api/spacer';
15
+ export { requestDatalayerAPI, RunResponseError, NetworkError, } from './api/DatalayerApi.js';
16
+ export { API_BASE_PATHS } from './api/constants.js';
17
+ export * as runtimesApi from './api/runtimes/index.js';
18
+ export * as iamApi from './api/iam/index.js';
19
+ export * as spacerApi from './api/spacer/index.js';
20
20
  export {
21
21
  // Export client and config types
22
22
  DatalayerClient,
23
23
  // Export domain models
24
24
  User, Runtime, Environment, Snapshot, Space, Notebook, LexicalDTO, Secret, Credits, Item, HealthCheck,
25
25
  // Export auth
26
- AuthenticationManager, Datasource, } from './client';
26
+ AuthenticationManager, Datasource, } from './client/index.js';
27
27
  // Export commonly used functions directly for convenience
28
- export { getEnvironments, createRuntime, getRuntimes, deleteRuntime, snapshotRuntime, getRuntimeSnapshots, loadRuntimeSnapshot, } from './stateful/runtimes/actions';
28
+ export { getEnvironments, createRuntime, getRuntimes, deleteRuntime, snapshotRuntime, getRuntimeSnapshots, loadRuntimeSnapshot, } from './stateful/runtimes/actions.js';
29
29
  // OTEL observability components, hooks, and types
30
- export * from './otel';
30
+ export * from './otel/index.js';
31
31
  // Reusable views (sign-in pages, etc.)
32
- export * from './views';
32
+ export * from './views/index.js';
package/lib/main.js CHANGED
@@ -4,7 +4,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
6
  import { createRoot } from 'react-dom/client';
7
- import App from './App';
7
+ import App from './App.js';
8
8
  import './index.css';
9
9
  const rootElement = document.getElementById('root');
10
10
  if (rootElement) {
@@ -5,7 +5,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  */
6
6
  import { AlertIcon } from '@primer/octicons-react';
7
7
  import { Flash, Link } from '@primer/react';
8
- import { useNavigate } from '../../hooks';
8
+ import { useNavigate } from '../../hooks/index.js';
9
9
  export const FlashMock = () => {
10
10
  const navigate = useNavigate();
11
11
  return (_jsxs(Flash, { variant: "warning", style: { marginBottom: 10 }, children: [_jsx(AlertIcon, {}), " This is a mock content.", ' ', _jsx(Link, { href: "#", onClick: e => navigate('/contact', e), children: "Contact us" }), ' ', "if you'd like to know more about this feature."] }));
@@ -2,4 +2,4 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from './FlashMock';
5
+ export * from './FlashMock.js';
@@ -2,4 +2,4 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from './useDatalayerMock';
5
+ export * from './useDatalayerMock.js';
@@ -2,4 +2,4 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from './rests';
5
+ export * from './rests.js';
@@ -2,11 +2,11 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { useLocation } from './../../hooks';
6
- import { useNavigate } from './../../hooks';
7
- import { useToast } from './../../hooks';
8
- import { useIAMStore } from '../../state';
9
- import { systemAdminLogin } from './rests';
5
+ import { useLocation } from './../../hooks/index.js';
6
+ import { useNavigate } from './../../hooks/index.js';
7
+ import { useToast } from './../../hooks/index.js';
8
+ import { useIAMStore } from '../../state/index.js';
9
+ import { systemAdminLogin } from './rests/index.js';
10
10
  const getMockResponse = (request) => {
11
11
  const { url, method, body } = request;
12
12
  if (url.match('/api/iam/v1/login$') && method === 'POST') {
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from './components';
6
- export * from './hooks';
7
- // export * from './jupyter';
8
- export * from './models';
9
- export * from './views';
5
+ export * from './components/index.js';
6
+ export * from './hooks/index.js';
7
+ // export * from './jupyter/index.js';
8
+ export * from './models/index.js';
9
+ export * from './views/index.js';
@@ -3,9 +3,9 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { uniqueNamesGenerator, names } from 'unique-names-generator';
6
- import { newUlid } from '../../utils';
7
- import { newSpaceMock } from './SpaceMock';
8
- import { newUserMock } from './UserMock';
6
+ import { newUlid } from '../../utils/index.js';
7
+ import { newSpaceMock } from './SpaceMock.js';
8
+ import { newUserMock } from './UserMock.js';
9
9
  export const newCourseMock = (name) => {
10
10
  const course = {
11
11
  id: newUlid(),
@@ -3,8 +3,8 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { uniqueNamesGenerator, names, colors, adjectives, animals, } from 'unique-names-generator';
6
- import { newUlid } from '../../utils';
7
- import { newUserMock } from './UserMock';
6
+ import { newUlid } from '../../utils/index.js';
7
+ import { newUserMock } from './UserMock.js';
8
8
  export const newInviteMock = (message) => {
9
9
  const invite = {
10
10
  id: newUlid(),
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { newUlid } from '../../utils';
5
+ import { newUlid } from '../../utils/index.js';
6
6
  const newOrganizationMock = (name) => {
7
7
  const organization = {
8
8
  id: newUlid(),
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { newUlid } from '../../utils';
5
+ import { newUlid } from '../../utils/index.js';
6
6
  export const newSchoolMock = (name) => {
7
7
  const school = {
8
8
  id: newUlid(),
@@ -3,8 +3,8 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { uniqueNamesGenerator, names } from 'unique-names-generator';
6
- import { newUlid } from '../../utils';
7
- import { newUserMock } from './UserMock';
6
+ import { newUlid } from '../../utils/index.js';
7
+ import { newUserMock } from './UserMock.js';
8
8
  export const newSpaceMock = (name) => {
9
9
  const space = {
10
10
  id: newUlid(),
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { newUlid } from '../../utils';
5
+ import { newUlid } from '../../utils/index.js';
6
6
  const newTeamMock = (name) => {
7
7
  const team = {
8
8
  id: newUlid(),
@@ -3,7 +3,7 @@
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
5
  import { uniqueNamesGenerator, animals, names } from 'unique-names-generator';
6
- import { newUlid, asDisplayName, namesAsInitials } from '../../utils';
6
+ import { newUlid, asDisplayName, namesAsInitials } from '../../utils/index.js';
7
7
  export const newUserMock = (firstName, lastName) => {
8
8
  const mockFistName = firstName ?? uniqueNamesGenerator({ dictionaries: [names] });
9
9
  const mockLastName = lastName ?? uniqueNamesGenerator({ dictionaries: [names] });
@@ -2,12 +2,12 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from './CodeBlockMock';
6
- export * from './CodelineMock';
7
- export * from './InviteMock';
8
- export * from './JupyterLabUserMock';
9
- export * from './OrganisationMock';
10
- export * from './SchoolMock';
11
- export * from './SpaceMock';
12
- export * from './TeamMock';
13
- export * from './UserMock';
5
+ export * from './CodeBlockMock.js';
6
+ export * from './CodelineMock.js';
7
+ export * from './InviteMock.js';
8
+ export * from './JupyterLabUserMock.js';
9
+ export * from './OrganisationMock.js';
10
+ export * from './SchoolMock.js';
11
+ export * from './SpaceMock.js';
12
+ export * from './TeamMock.js';
13
+ export * from './UserMock.js';
@@ -4,9 +4,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
6
  import { Heading } from '@primer/react-brand';
7
- import { lazyWithPreload, WithSuspense } from '../../utils';
8
- import { HorizontalCenter } from '../../components/display';
9
- import { CHART_4 } from './ChartMockOptions';
7
+ import { lazyWithPreload, WithSuspense } from '../../utils/index.js';
8
+ import { HorizontalCenter } from '../../components/display/index.js';
9
+ import { CHART_4 } from './ChartMockOptions.js';
10
10
  const ReactEcharts = WithSuspense(lazyWithPreload(() => import('echarts-for-react')), true);
11
11
  export const ChartMock = (props) => {
12
12
  const { title } = props;
@@ -6,8 +6,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
6
6
  import { Box, Link, Text, LabelGroup, Label, ActionMenu, ActionList, } from '@primer/react';
7
7
  import { ArrowRightIcon, CloudIcon, StarIcon, DotFillIcon, RepoForkedIcon, LinkIcon, } from '@primer/octicons-react';
8
8
  import { ReactJsIcon } from '@datalayer/icons-react';
9
- import { lazyWithPreload, WithSuspense } from '../../utils';
10
- import { ECHART_MOCK_1, ECHART_MOCK_2, ECHART_MOCK_3, FlashMock, } from '../../mocks';
9
+ import { lazyWithPreload, WithSuspense } from '../../utils/index.js';
10
+ import { ECHART_MOCK_1, ECHART_MOCK_2, ECHART_MOCK_3, FlashMock, } from '../../mocks/index.js';
11
11
  const ReactECharts = WithSuspense(lazyWithPreload(() => import('echarts-for-react')), true);
12
12
  export const DashboardMock = () => {
13
13
  return (_jsxs(_Fragment, { children: [_jsx(Box, { mb: 3, children: _jsx(FlashMock, {}) }), _jsxs(Box, { sx: {
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
6
6
  import { Box, LabelGroup, ActionMenu, ActionList, IconButton, Label, RelativeTime, } from '@primer/react';
7
7
  import { Table, DataTable } from '@primer/react/experimental';
8
8
  import { KebabHorizontalIcon, DownloadIcon } from '@primer/octicons-react';
9
- import { VisuallyHidden } from './../../components/display';
9
+ import { VisuallyHidden } from './../../components/display/index.js';
10
10
  const now = Date.now();
11
11
  const Second = 1000;
12
12
  const Minute = 60 * Second;
@@ -2,10 +2,10 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- export * from './ActionMenuMock';
6
- export * from './ChartMock';
7
- export * from './ChartMockOptions';
8
- export * from './DashboardMock';
9
- export * from './FormMock';
10
- export * from './TableMock';
11
- export * from './WipMock';
5
+ export * from './ActionMenuMock.js';
6
+ export * from './ChartMock.js';
7
+ export * from './ChartMockOptions.js';
8
+ export * from './DashboardMock.js';
9
+ export * from './FormMock.js';
10
+ export * from './TableMock.js';
11
+ export * from './WipMock.js';
@@ -2,9 +2,9 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { asContactIAMProvider, } from './ContactIAMProvider';
6
- import { asContactEvent } from './ContactEvent';
7
- import { asDisplayName, namesAsInitials } from '../utils';
5
+ import { asContactIAMProvider, } from './ContactIAMProvider.js';
6
+ import { asContactEvent } from './ContactEvent.js';
7
+ import { asDisplayName, namesAsInitials } from '../utils/index.js';
8
8
  export class Contact {
9
9
  id;
10
10
  handle;
@@ -7,7 +7,7 @@
7
7
  *
8
8
  * @module models/CreditsDTO
9
9
  */
10
- import { validateJSON } from '../api/utils/validation';
10
+ import { validateJSON } from '../api/utils/validation.js';
11
11
  /**
12
12
  * Credits model representing user's available credits and usage.
13
13
  *
@@ -18,7 +18,7 @@ export const asDatasource = (s) => {
18
18
  // ============================================================================
19
19
  // New API Types and DTO
20
20
  // ============================================================================
21
- import { validateJSON } from '../api/utils/validation';
21
+ import { validateJSON } from '../api/utils/validation.js';
22
22
  /**
23
23
  * Datasource domain model for the Datalayer Client.
24
24
  * Provides state management and operations for datasources.
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { validateJSON } from '../api/utils/validation';
5
+ import { validateJSON } from '../api/utils/validation.js';
6
6
  /**
7
7
  * Environment domain model that wraps API responses with convenient methods.
8
8
  * Provides information about available computational environments.
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { validateJSON } from '../api/utils/validation';
5
+ import { validateJSON } from '../api/utils/validation.js';
6
6
  /**
7
7
  * Represents a health check response from a Datalayer service.
8
8
  * Provides standardized health status information across all services.
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { asDisplayName } from '../utils';
5
+ import { asDisplayName } from '../utils/index.js';
6
6
  export class LinkedInUser {
7
7
  iamProvider = 'linkedin';
8
8
  sub;
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { asDisplayName, namesAsInitials } from '../utils';
5
+ import { asDisplayName, namesAsInitials } from '../utils/index.js';
6
6
  export const asInvite = (i) => {
7
7
  const to = {
8
8
  id: i.to_contact_uid,
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import * as items from '../api/spacer/items';
5
+ import * as items from '../api/spacer/items.js';
6
6
  /**
7
7
  * Abstract base class for all Datalayer content items.
8
8
  * Provides common functionality for content management including lifecycle tracking.
@@ -7,10 +7,10 @@
7
7
  *
8
8
  * @module models/LexicalDTO
9
9
  */
10
- import * as lexicals from '../api/spacer/lexicals';
11
- import { ItemTypes } from '../client';
12
- import { ItemDTO } from './ItemDTO';
13
- import { validateJSON } from '../api/utils/validation';
10
+ import * as lexicals from '../api/spacer/lexicals.js';
11
+ import { ItemTypes } from '../client/index.js';
12
+ import { ItemDTO } from './ItemDTO.js';
13
+ import { validateJSON } from '../api/utils/validation.js';
14
14
  /**
15
15
  * Lexical domain model that extends the base Item class.
16
16
  * Provides lexical document functionality for managing rich text documents.
@@ -2,10 +2,10 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import * as notebooks from '../api/spacer/notebooks';
6
- import { ItemDTO } from './ItemDTO';
7
- import { ItemTypes } from '../client/constants';
8
- import { validateJSON } from '../api/utils/validation';
5
+ import * as notebooks from '../api/spacer/notebooks.js';
6
+ import { ItemDTO } from './ItemDTO.js';
7
+ import { ItemTypes } from '../client/constants.js';
8
+ import { validateJSON } from '../api/utils/validation.js';
9
9
  /**
10
10
  * Notebook domain model that extends the base Item class.
11
11
  * Provides notebook-specific functionality for managing Jupyter notebooks.
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { asArray } from '../utils';
6
- import { asUser } from './User';
5
+ import { asArray } from '../utils/index.js';
6
+ import { asUser } from './User.js';
7
7
  /**
8
8
  * Convert the raw user object to {@link IOrganization}.
9
9
  *
@@ -2,8 +2,8 @@
2
2
  * Copyright (c) 2023-2025 Datalayer, Inc.
3
3
  * Distributed under the terms of the Modified BSD License.
4
4
  */
5
- import { asUser } from './User';
6
- import { asRuntimeSnapshot } from './RuntimeSnapshot';
5
+ import { asUser } from './User.js';
6
+ import { asRuntimeSnapshot } from './RuntimeSnapshot.js';
7
7
  export const asPage = (s) => {
8
8
  return {
9
9
  id: s.uid,