@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.
- package/README.md +12 -1
- package/lib/App.css +47 -0
- package/lib/App.d.ts +1 -1
- package/lib/App.js +17 -5
- package/lib/__tests__/index.test.js +2 -1
- package/lib/api/{RunApi.d.ts → DatalayerApi.d.ts} +4 -4
- package/lib/api/{RunApi.js → DatalayerApi.js} +4 -9
- package/lib/api/index.d.ts +2 -1
- package/lib/api/index.js +2 -6
- package/lib/api/{runtimes → jupyter}/exec/Python.js +0 -5
- package/lib/api/{runtimes → jupyter}/exec/Snippets.js +0 -5
- package/lib/api/{runtimes → jupyter}/exec/index.js +0 -5
- package/lib/api/jupyter/index.d.ts +2 -0
- package/lib/api/jupyter/index.js +6 -0
- package/lib/api/{runtimes → jupyter}/kernelsHandler.d.ts +1 -1
- package/lib/api/{runtimes → jupyter}/kernelsHandler.js +1 -6
- package/lib/api/runtimes/actions.d.ts +102 -0
- package/lib/api/runtimes/{runtimesApi.js → actions.js} +26 -31
- package/lib/api/runtimes/{runtimesApi.d.ts → apis.d.ts} +8 -105
- package/lib/api/runtimes/apis.js +5 -0
- package/lib/api/runtimes/index.d.ts +2 -4
- package/lib/api/runtimes/index.js +2 -9
- package/lib/api/runtimes/settings.js +0 -5
- package/lib/api/runtimes/snapshots.js +0 -5
- package/lib/api/runtimes/utils.js +0 -5
- package/lib/assets/react.svg +1 -0
- package/lib/components/avatars/BoringAvatar.d.ts +1 -2
- package/lib/components/avatars/BoringAvatar.js +14 -9
- package/lib/components/avatars/BoringAvatar.stories.d.ts +27 -0
- package/lib/components/avatars/BoringAvatar.stories.js +23 -0
- package/lib/components/avatars/UserProfileAvatar.js +0 -5
- package/lib/components/avatars/index.js +0 -5
- package/lib/components/banners/NoAutomationBanner.js +0 -5
- package/lib/components/banners/index.js +0 -5
- package/lib/components/buttons/DownloadCSVButton.d.ts +1 -1
- package/lib/components/buttons/DownloadCSVButton.js +0 -5
- package/lib/components/buttons/DownloadJsonButton.d.ts +1 -1
- package/lib/components/buttons/DownloadJsonButton.js +0 -5
- package/lib/components/buttons/LongActionButton.js +0 -5
- package/lib/components/buttons/UploadButton.js +0 -5
- package/lib/components/buttons/index.js +0 -5
- package/lib/components/checkout/StripeCheckout.js +0 -5
- package/lib/components/checkout/index.js +0 -5
- package/lib/components/confetti/ConfettiSuccess.js +0 -5
- package/lib/components/confetti/index.js +0 -5
- package/lib/components/context/OrganizationSelect.js +0 -5
- package/lib/components/context/SpaceSelect.js +0 -5
- package/lib/components/context/index.js +0 -5
- package/lib/components/display/AvatarSkeleton.js +0 -5
- package/lib/components/display/CenteredSpinner.js +0 -5
- package/lib/components/display/CodePreview.js +0 -5
- package/lib/components/display/DatalayerBox.js +0 -5
- package/lib/components/display/JupyterDialog.js +0 -5
- package/lib/components/display/NavLink.js +0 -5
- package/lib/components/display/NotebookSkeleton.js +0 -5
- package/lib/components/display/Placeholder.js +0 -5
- package/lib/components/display/ToTopBranded.js +0 -5
- package/lib/components/display/VisuallyHidden.js +0 -5
- package/lib/components/display/index.js +0 -5
- package/lib/components/echarts/EChartsReact.js +6 -6
- package/lib/components/echarts/index.js +0 -5
- package/lib/components/flashes/FlashClosable.js +0 -5
- package/lib/components/flashes/FlashDisclaimer.js +0 -5
- package/lib/components/flashes/FlashGuest.js +0 -5
- package/lib/components/flashes/FlashSurveys.js +0 -5
- package/lib/components/flashes/FlashUnauthorized.js +0 -5
- package/lib/components/flashes/index.js +0 -5
- package/lib/components/flashes/surveys/Survey2025_1.js +0 -5
- package/lib/components/flashes/surveys/index.js +0 -5
- package/lib/components/iam/ExternalTokenSilentLogin.js +0 -5
- package/lib/components/iam/index.js +0 -5
- package/lib/components/icons/ArtifactIcon.js +0 -5
- package/lib/components/icons/index.js +0 -5
- package/lib/components/index.js +1 -6
- package/lib/components/labels/VisibilityLabel.js +0 -5
- package/lib/components/labels/index.js +0 -5
- package/lib/components/landings/StepBlock.js +0 -5
- package/lib/components/landings/index.js +0 -5
- package/lib/components/navbar/NavigationVisbilityObserver.js +0 -5
- package/lib/components/navbar/SubdomainNavBar.js +2 -7
- package/lib/components/navbar/SubdomainNavBar.module.css +718 -0
- package/lib/components/navbar/index.js +0 -5
- package/lib/components/nbgrader/NbGradesDetails.js +0 -5
- package/lib/components/nbgrader/index.js +0 -5
- package/lib/components/notebooks/JupyterNotebook.js +0 -5
- package/lib/components/notebooks/JupyterNotebookToolbar.js +0 -5
- package/lib/components/notebooks/index.js +0 -5
- package/lib/components/primer/Portals.js +0 -5
- package/lib/components/primer/Styles.js +0 -5
- package/lib/components/primer/index.js +0 -5
- package/lib/components/progress/ConsumptionBar.js +0 -5
- package/lib/components/progress/CreditsIndicator.js +0 -6
- package/lib/components/progress/ProgressBar.js +0 -5
- package/lib/components/progress/Timer.js +0 -5
- package/lib/components/progress/index.js +0 -5
- package/lib/components/runtimes/RuntimeCellVariables.js +0 -5
- package/lib/components/runtimes/RuntimeCellVariablesDialog.js +4 -9
- package/lib/components/runtimes/RuntimeLauncherDialog.d.ts +1 -2
- package/lib/components/runtimes/RuntimeLauncherDialog.js +2 -6
- package/lib/components/runtimes/RuntimePickerBase.d.ts +1 -1
- package/lib/components/runtimes/RuntimePickerBase.js +0 -5
- package/lib/components/runtimes/RuntimePickerCell.js +0 -5
- package/lib/components/runtimes/RuntimePickerNotebook.d.ts +1 -2
- package/lib/components/runtimes/RuntimePickerNotebook.js +1 -6
- package/lib/components/runtimes/RuntimeReservationControl.js +0 -5
- package/lib/components/runtimes/RuntimeSimplePicker.d.ts +1 -1
- package/lib/components/runtimes/RuntimeSimplePicker.js +36 -41
- package/lib/components/runtimes/RuntimeUtils.d.ts +1 -1
- package/lib/components/runtimes/RuntimeUtils.js +0 -5
- package/lib/components/runtimes/RuntimeVariables.js +0 -5
- package/lib/components/runtimes/index.js +0 -5
- package/lib/components/screenshot/ScreenCapture.js +1 -6
- package/lib/components/screenshot/index.js +0 -5
- package/lib/components/snapshots/RuntimeSnapshotMenu.js +0 -5
- package/lib/components/snapshots/index.js +0 -5
- package/lib/components/snippets/SnippetDialog.js +0 -5
- package/lib/components/snippets/index.js +0 -5
- package/lib/components/storage/ContentsBrowser.js +12 -7
- package/lib/components/storage/ContentsItems.js +0 -5
- package/lib/components/storage/index.js +0 -5
- package/lib/components/students/StudentItemStatus.js +6 -8
- package/lib/components/students/index.js +0 -5
- package/lib/components/subnav/SubNav.d.ts +2 -2
- package/lib/components/subnav/SubNav.js +4 -9
- package/lib/components/subnav/SubNav.module.css +683 -0
- package/lib/components/subnav/index.js +0 -5
- package/lib/components/tables/DataTable.js +0 -5
- package/lib/components/tables/index.js +0 -5
- package/lib/components/text-reveal/TextRevealAnimation.js +0 -6
- package/lib/components/text-reveal/TextRevealAnimation.module.css +43 -0
- package/lib/components/text-reveal/index.js +0 -5
- package/lib/components/text-reveal/useTextRevealAnimationLines.js +0 -5
- package/lib/components/tokens/SpaceVariantToken.js +0 -5
- package/lib/components/tokens/index.js +0 -5
- package/lib/components/toolbars/AssignmentEditorToolbar.js +0 -5
- package/lib/components/toolbars/DocumentEditorToolbar.js +0 -5
- package/lib/components/toolbars/NotebookEditorToolbar.d.ts +1 -1
- package/lib/components/toolbars/NotebookEditorToolbar.js +0 -5
- package/lib/components/toolbars/index.js +0 -5
- package/lib/components/users/PeerIndicator.js +0 -5
- package/lib/components/users/index.js +0 -5
- package/lib/config/Configuration.js +0 -5
- package/lib/config/index.js +0 -5
- package/lib/config/integrations/Loom.js +0 -5
- package/lib/config/integrations/index.js +0 -5
- package/lib/examples/CellExample.d.ts +6 -0
- package/lib/examples/CellExample.js +24 -0
- package/lib/examples/NotebookExample.d.ts +8 -0
- package/lib/examples/NotebookExample.js +22 -0
- package/lib/examples/NotebookExample1.ipynb.json +136 -0
- package/lib/hooks/assets/OutputshotPlaceholders.js +0 -5
- package/lib/hooks/assets/index.js +0 -5
- package/lib/hooks/index.d.ts +1 -1
- package/lib/hooks/index.js +1 -6
- package/lib/hooks/layouts/LayoutBackdrop.js +0 -5
- package/lib/hooks/layouts/LayoutScreenshot.css +58 -0
- package/lib/hooks/layouts/LayoutScreenshot.d.ts +1 -0
- package/lib/hooks/layouts/LayoutScreenshot.js +1 -5
- package/lib/hooks/layouts/index.js +0 -5
- package/lib/hooks/useAIAgents.js +7 -12
- package/lib/hooks/useAuthorization.js +0 -6
- package/lib/hooks/useBackdrop.js +0 -5
- package/lib/hooks/useBackdropJupyterLab.js +0 -5
- package/lib/hooks/useCache.d.ts +2 -2
- package/lib/hooks/useCache.js +178 -183
- package/lib/hooks/useCellOutputshot.js +0 -5
- package/lib/hooks/useContainsFocus.js +0 -5
- package/lib/hooks/useDatalayer.d.ts +21 -0
- package/lib/hooks/{useRun.js → useDatalayer.js} +12 -16
- package/lib/hooks/useError.js +0 -5
- package/lib/hooks/useExternalScript.js +0 -5
- package/lib/hooks/useFocusTrap.d.ts +1 -1
- package/lib/hooks/useFocusTrap.js +1 -6
- package/lib/hooks/useIAM.js +2 -7
- package/lib/hooks/useId.js +3 -8
- package/lib/hooks/useIsomorphicLayoutEffect.js +0 -5
- package/lib/hooks/useJupyterLabTheme.js +0 -5
- package/lib/hooks/useKeyboardEscape.js +0 -5
- package/lib/hooks/useLocationHandles.js +0 -5
- package/lib/hooks/useNavigate.js +0 -5
- package/lib/hooks/useNotebookAIAgent.js +0 -5
- package/lib/hooks/useOnClickOutside.js +0 -5
- package/lib/hooks/useRef.js +0 -5
- package/lib/hooks/useRuntimes.js +0 -5
- package/lib/hooks/useScreenshot.js +0 -5
- package/lib/hooks/useToast.js +6 -8
- package/lib/hooks/useUpload.js +0 -5
- package/lib/hooks/useVisibilityObserver.js +0 -5
- package/lib/hooks/useWindowSize.js +0 -6
- package/lib/i18n/Labels.js +0 -5
- package/lib/i18n/index.js +0 -5
- package/lib/index.css +73 -0
- package/lib/main.js +1 -2
- package/lib/mocks/components/FlashMock.js +0 -5
- package/lib/mocks/components/index.js +0 -5
- package/lib/mocks/hooks/index.d.ts +1 -1
- package/lib/mocks/hooks/index.js +1 -6
- package/lib/mocks/hooks/rests/index.js +0 -5
- package/lib/mocks/hooks/rests/rests.js +0 -5
- package/lib/mocks/hooks/useDatalayerMock.d.ts +6 -0
- package/lib/mocks/hooks/{useRunMock.js → useDatalayerMock.js} +2 -7
- package/lib/mocks/index.js +0 -5
- package/lib/mocks/jupyter/index.js +1 -6
- package/lib/mocks/models/CodeBlockMock.js +0 -5
- package/lib/mocks/models/CodelineMock.js +0 -5
- package/lib/mocks/models/CourseMock.js +0 -5
- package/lib/mocks/models/InviteMock.js +0 -5
- package/lib/mocks/models/SpaceMock.js +0 -5
- package/lib/mocks/models/UserMock.js +0 -5
- package/lib/mocks/models/index.js +0 -5
- package/lib/mocks/views/ActionMenuMock.js +0 -5
- package/lib/mocks/views/ChartMock.js +0 -5
- package/lib/mocks/views/ChartMockOptions.js +0 -5
- package/lib/mocks/views/DashboardMock.js +0 -5
- package/lib/mocks/views/FormMock.js +0 -5
- package/lib/mocks/views/TableMock.js +0 -5
- package/lib/mocks/views/WipMock.js +0 -5
- package/lib/mocks/views/index.js +0 -5
- package/lib/models/Contact.js +0 -5
- package/lib/models/ContactEvent.js +0 -5
- package/lib/models/Credits.js +0 -5
- package/lib/models/Dataset.d.ts +1 -1
- package/lib/models/Datasource.js +0 -5
- package/lib/models/Errors.js +0 -5
- package/lib/models/GrowthKPI.js +0 -5
- package/lib/models/IAMProviderUsers.js +0 -5
- package/lib/models/IAMToken.js +0 -5
- package/lib/models/Inbound.js +0 -5
- package/lib/models/LandingRoles.js +0 -5
- package/lib/models/Organization.js +0 -5
- package/lib/models/Outbound.js +7 -12
- package/lib/models/PageTag.d.ts +1 -1
- package/lib/models/RolesOrganization.js +0 -5
- package/lib/models/RolesPlatform.js +0 -5
- package/lib/models/RolesTeam.js +0 -5
- package/lib/models/Runtime.d.ts +59 -1
- package/lib/models/Runtime.js +7 -5
- package/lib/models/Secret.js +0 -5
- package/lib/models/Survey.js +0 -5
- package/lib/models/Team.js +0 -5
- package/lib/models/URN.js +0 -5
- package/lib/models/User.js +2 -7
- package/lib/models/UserEvent.js +0 -5
- package/lib/models/UserOnboarding.js +0 -5
- package/lib/models/UserSettings.js +0 -5
- package/lib/models/index.js +0 -5
- package/lib/routes/Routes.js +0 -5
- package/lib/routes/index.js +0 -5
- package/lib/state/State.js +0 -5
- package/lib/state/index.js +0 -5
- package/lib/state/storage/IAMStorage.js +0 -5
- package/lib/state/storage/index.js +0 -5
- package/lib/state/substates/AIAgentState.js +0 -5
- package/lib/state/substates/CellState.js +0 -5
- package/lib/state/substates/CoreState.js +0 -5
- package/lib/state/substates/DatasourceState.js +0 -5
- package/lib/state/substates/DocumentState.js +0 -5
- package/lib/state/substates/GradeState.js +0 -5
- package/lib/state/substates/IAMState.d.ts +1 -1
- package/lib/state/substates/IAMState.js +15 -18
- package/lib/state/substates/JupyterLabState.js +0 -5
- package/lib/state/substates/NbformatState.js +0 -5
- package/lib/state/substates/OrganizationState.js +0 -5
- package/lib/state/substates/RuntimesState.d.ts +2 -2
- package/lib/state/substates/RuntimesState.js +0 -5
- package/lib/state/substates/SpaceState.js +0 -5
- package/lib/state/substates/SurveysState.js +3 -8
- package/lib/state/substates/TeamState.js +0 -5
- package/lib/state/substates/index.js +0 -5
- package/lib/stories/assets/accessibility.png +0 -0
- package/lib/stories/assets/accessibility.svg +1 -0
- package/lib/stories/assets/addon-library.png +0 -0
- package/lib/stories/assets/assets.png +0 -0
- package/lib/stories/assets/context.png +0 -0
- package/lib/stories/assets/discord.svg +1 -0
- package/lib/stories/assets/docs.png +0 -0
- package/lib/stories/assets/figma-plugin.png +0 -0
- package/lib/stories/assets/github.svg +1 -0
- package/lib/stories/assets/share.png +0 -0
- package/lib/stories/assets/styling.png +0 -0
- package/lib/stories/assets/testing.png +0 -0
- package/lib/stories/assets/theming.png +0 -0
- package/lib/stories/assets/tutorials.svg +1 -0
- package/lib/stories/assets/youtube.svg +1 -0
- package/lib/stories/button.css +35 -0
- package/lib/stories/header.css +37 -0
- package/lib/stories/page.css +73 -0
- package/lib/test-setup.js +51 -1
- package/lib/theme/DatalayerTheme.js +0 -5
- package/lib/theme/DatalayerThemeProvider.js +0 -5
- package/lib/theme/Palette.js +0 -5
- package/lib/theme/index.js +0 -5
- package/lib/utils/Array.js +0 -5
- package/lib/utils/Avatar.js +0 -5
- package/lib/utils/Browser.js +0 -5
- package/lib/utils/Cookie.js +0 -5
- package/lib/utils/Date.js +3 -8
- package/lib/utils/Download.js +0 -5
- package/lib/utils/DownloadFile.js +0 -5
- package/lib/utils/Env.js +0 -5
- package/lib/utils/File.js +0 -5
- package/lib/utils/Ids.js +0 -5
- package/lib/utils/Jupyter.js +0 -5
- package/lib/utils/Lazy.js +0 -6
- package/lib/utils/Name.js +0 -5
- package/lib/utils/Number.js +1 -6
- package/lib/utils/Plots.d.ts +1 -1
- package/lib/utils/Plots.js +1 -1
- package/lib/utils/Random.js +0 -5
- package/lib/utils/Screenshot.js +0 -5
- package/lib/utils/Scroll.js +3 -7
- package/lib/utils/Sleep.js +0 -5
- package/lib/utils/Snapshot.js +0 -5
- package/lib/utils/String.js +0 -5
- package/lib/utils/Uri.js +1 -6
- package/lib/utils/Validator.js +0 -5
- package/lib/utils/WithSuspense.js +0 -5
- package/lib/utils/index.js +0 -5
- package/package.json +58 -28
- package/style/animation/Animation.module.css +174 -0
- package/style/base.css +64 -0
- package/style/index.css +6 -0
- package/lib/api/runtimes/models.d.ts +0 -59
- package/lib/api/runtimes/models.js +0 -11
- package/lib/hooks/useRun.d.ts +0 -21
- package/lib/mocks/hooks/useRunMock.d.ts +0 -6
- /package/lib/api/{runtimes → jupyter}/exec/Python.d.ts +0 -0
- /package/lib/api/{runtimes → jupyter}/exec/Snippets.d.ts +0 -0
- /package/lib/api/{runtimes → jupyter}/exec/index.d.ts +0 -0
|
@@ -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 { Heading, Text } from "@primer/react";
|
|
12
7
|
import { Box } from "@datalayer/primer-addons";
|
|
13
8
|
export const NbGradesDetails = (props) => {
|
|
@@ -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 { Box } from "@datalayer/primer-addons";
|
|
12
7
|
import { Lumino } from '@datalayer/jupyter-react';
|
|
13
8
|
export const JupyterNotebook = (props) => {
|
|
@@ -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 { CircleCurrentColorIcon, CircleGreenIcon, CircleOrangeIcon } from '@datalayer/icons-react';
|
|
12
7
|
import { Text } from '@primer/react';
|
|
13
8
|
import { Box } from "@datalayer/primer-addons";
|
|
@@ -2,10 +2,5 @@
|
|
|
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 './JupyterNotebook';
|
|
11
6
|
export * from './JupyterNotebookToolbar';
|
|
@@ -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 { registerPortalRoot } from "@primer/react";
|
|
11
6
|
// import { render } from 'react-dom';
|
|
12
7
|
// import { Styles } from './Styles';
|
|
@@ -3,11 +3,6 @@ import { jsx as _jsx, Fragment as _Fragment } 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 { ThemeProvider, BaseStyles } from '@primer/react';
|
|
12
7
|
import { jupyterLabTheme } from '@datalayer/jupyter-react';
|
|
13
8
|
export const Styles = () => {
|
|
@@ -3,11 +3,6 @@ import { jsx as _jsx, Fragment as _Fragment } 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 { useEffect, useMemo, useState } from 'react';
|
|
12
7
|
import { ProgressBar, Tooltip, Button } from '@primer/react';
|
|
13
8
|
import { Box } from "@datalayer/primer-addons";
|
|
@@ -3,14 +3,8 @@ import { jsx as _jsx, Fragment as _Fragment } 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, useEffect } from "react";
|
|
12
7
|
import { Box } from "@datalayer/primer-addons";
|
|
13
|
-
// import { ArtifactIcon } from "../../components/icons";
|
|
14
8
|
import { ConsumptionBar } from "../../components/progress";
|
|
15
9
|
/**
|
|
16
10
|
* Credits indicator component.
|
|
@@ -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 { useInterval } from 'usehooks-ts';
|
|
13
8
|
import { ProgressBar as PrimerProgressBar } from '@primer/react';
|
|
@@ -3,11 +3,6 @@ import { 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 { useState, useEffect } from 'react';
|
|
12
7
|
import { Text } from '@primer/react';
|
|
13
8
|
/**
|
|
@@ -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 './ConsumptionBar';
|
|
11
6
|
export * from './CreditsIndicator';
|
|
12
7
|
export * from './ProgressBar';
|
|
@@ -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 { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
12
7
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
13
8
|
import { JSONExt } from '@lumino/coreutils';
|
|
@@ -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 { useCallback, useEffect, useMemo, useState } from 'react';
|
|
12
7
|
import { Dialog } from '@primer/react/experimental';
|
|
13
8
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
@@ -38,7 +33,7 @@ export function RuntimeCellVariablesDialog(props) {
|
|
|
38
33
|
return () => {
|
|
39
34
|
model.metadataChanged.disconnect(updateState);
|
|
40
35
|
};
|
|
41
|
-
}, [model]);
|
|
36
|
+
}, [model, inputs, output]);
|
|
42
37
|
const setVariables = useCallback(() => {
|
|
43
38
|
const datalayerMeta = model.getMetadata('datalayer') ?? {};
|
|
44
39
|
if (inputs.length) {
|
|
@@ -55,7 +50,7 @@ export function RuntimeCellVariablesDialog(props) {
|
|
|
55
50
|
}
|
|
56
51
|
model.setMetadata('datalayer', { ...datalayerMeta });
|
|
57
52
|
onClose();
|
|
58
|
-
}, [inputs, output]);
|
|
53
|
+
}, [model, inputs, output, onClose]);
|
|
59
54
|
const getInputCandidates = useCallback(async () => {
|
|
60
55
|
if (!sessionContext) {
|
|
61
56
|
return [];
|
|
@@ -66,10 +61,10 @@ export function RuntimeCellVariablesDialog(props) {
|
|
|
66
61
|
const outputs = await new KernelExecutor({ connection }).execute(snippets.listVariables());
|
|
67
62
|
const content = outputs.get(0).data['text/plain'];
|
|
68
63
|
if (content) {
|
|
69
|
-
const
|
|
64
|
+
const runtimeVariables = JSON.parse(
|
|
70
65
|
// We need to remove the quotes prior to parsing
|
|
71
66
|
content.slice(1, content.length - 1));
|
|
72
|
-
return Object.keys(
|
|
67
|
+
return Object.keys(runtimeVariables ?? {});
|
|
73
68
|
}
|
|
74
69
|
return [];
|
|
75
70
|
}, [preference, sessionContext]);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { IMarkdownParser, IRenderMime } from '@jupyterlab/rendermime';
|
|
2
2
|
import type { IRemoteServicesManager } from '../../api';
|
|
3
|
-
import {
|
|
4
|
-
import type { IRuntimeDesc } from '../../api';
|
|
3
|
+
import type { IRuntimeSnapshot, IRuntimeDesc } from '../../models';
|
|
5
4
|
/**
|
|
6
5
|
* {@link KernelLauncherDialog} properties.
|
|
7
6
|
*/
|
|
@@ -3,17 +3,13 @@ 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 { useCallback, useEffect, useMemo, useState } from 'react';
|
|
12
7
|
import { useIsMounted } from 'usehooks-ts';
|
|
13
8
|
import { Button, FormControl, Select, Spinner, Text, TextInput, ToggleSwitch, Tooltip, IconButton } from '@primer/react';
|
|
14
9
|
import { Dialog } from '@primer/react/experimental';
|
|
15
10
|
import { AlertIcon } from '@primer/octicons-react';
|
|
16
11
|
import { Box } from "@datalayer/primer-addons";
|
|
12
|
+
import { USAGE_ROUTE } from '../../routes';
|
|
17
13
|
import { useNavigate } from '../../hooks';
|
|
18
14
|
import { NO_RUNTIME_AVAILABLE_LABEL } from '../../i18n';
|
|
19
15
|
import { iamStore, useCoreStore, useIAMStore, useRuntimesStore } from '../../state';
|
|
@@ -22,7 +18,6 @@ import { Markdown } from '../display';
|
|
|
22
18
|
import { Timer } from '../progress';
|
|
23
19
|
import { FlashClosable } from '../flashes';
|
|
24
20
|
import { RuntimeReservationControl, MAXIMAL_RUNTIME_TIME_RESERVATION_MINUTES } from './RuntimeReservationControl';
|
|
25
|
-
import { USAGE_ROUTE } from '../../routes';
|
|
26
21
|
/**
|
|
27
22
|
* Initial time in milliseconds before retrying in case no kernels are available
|
|
28
23
|
*/
|
|
@@ -43,6 +38,7 @@ export function KernelLauncherDialog(props) {
|
|
|
43
38
|
const { credits, refreshCredits } = useIAMStore();
|
|
44
39
|
let navigate;
|
|
45
40
|
try {
|
|
41
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
46
42
|
navigate = useNavigate();
|
|
47
43
|
}
|
|
48
44
|
catch (reason) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { ISessionContext } from '@jupyterlab/apputils';
|
|
3
3
|
import { ITranslator } from '@jupyterlab/translation';
|
|
4
|
-
import { IRuntimeDesc } from '../../
|
|
4
|
+
import { IRuntimeDesc } from '../../models';
|
|
5
5
|
import { IMultiServiceManager } from '../../api';
|
|
6
6
|
type IDisplayMode = 'menu' | 'radio';
|
|
7
7
|
/**
|
|
@@ -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 { useEffect, useMemo, useState } from 'react';
|
|
12
7
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
13
8
|
//import { kernelIcon } from '@jupyterlab/ui-components';
|
|
@@ -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 { useCallback, useEffect, useMemo, useState } from 'react';
|
|
12
7
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
13
8
|
import { ActionList } from '@primer/react';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ITranslator } from '@jupyterlab/translation';
|
|
2
2
|
import { CommandRegistry } from '@lumino/commands';
|
|
3
|
-
import type { IMultiServiceManager } from '../../api';
|
|
4
|
-
import { IDatalayerSessionContext } from '../../api';
|
|
3
|
+
import type { IMultiServiceManager, IDatalayerSessionContext } from '../../api';
|
|
5
4
|
import { RuntimeTransfer } from './RuntimeTransfer';
|
|
6
5
|
/**
|
|
7
6
|
* {@link RuntimePickerNotebook} properties
|
|
@@ -3,24 +3,19 @@ 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 { useCallback, useEffect, useState } from 'react';
|
|
12
7
|
import { ActionList, FormControl, ToggleSwitch, Tooltip, IconButton } from '@primer/react';
|
|
13
8
|
import { Box } from "@datalayer/primer-addons";
|
|
14
9
|
import { AlertIcon } from '@primer/octicons-react';
|
|
15
10
|
import { JSONExt } from '@lumino/coreutils';
|
|
16
11
|
import { KernelExecutor } from '@datalayer/jupyter-react';
|
|
12
|
+
import { DatalayerThemeProvider } from '../../theme';
|
|
17
13
|
import { RuntimeSnippetsFacade } from '../../api';
|
|
18
14
|
import { ExternalTokenSilentLogin } from '../../components/iam';
|
|
19
15
|
import { useCoreStore, useIAMStore } from '../../state';
|
|
20
16
|
import { RuntimeReservationControl, MAXIMAL_RUNTIME_TIME_RESERVATION_MINUTES } from './RuntimeReservationControl';
|
|
21
17
|
import { RuntimeVariables } from './RuntimeVariables';
|
|
22
18
|
import { RuntimePickerBase } from './RuntimePickerBase';
|
|
23
|
-
import { DatalayerThemeProvider } from '../../theme';
|
|
24
19
|
/**
|
|
25
20
|
* Runtime Picker components for a Notebook.
|
|
26
21
|
*/
|
|
@@ -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 { FormControl, IconButton, Text, TextInput } from '@primer/react';
|
|
12
7
|
import { Box } from "@datalayer/primer-addons";
|
|
13
8
|
import { PlusIcon } from '@primer/octicons-react';
|
|
@@ -3,11 +3,6 @@ import { jsx as _jsx, Fragment as _Fragment, 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 { useCallback, useEffect, useState } from 'react';
|
|
12
7
|
import { KernelIndicator } from '@datalayer/jupyter-react';
|
|
13
8
|
import { ISanitizer } from '@jupyterlab/apputils';
|
|
@@ -19,32 +14,32 @@ import { ArtifactIcon } from '../../components/icons';
|
|
|
19
14
|
import { KernelLauncherDialog } from '../../components/runtimes';
|
|
20
15
|
import { useRuntimesStore } from '../../state';
|
|
21
16
|
/**
|
|
22
|
-
* Cause to open the new
|
|
17
|
+
* Cause to open the new runtime dialog.
|
|
23
18
|
*/
|
|
24
|
-
var
|
|
25
|
-
(function (
|
|
19
|
+
var RuntimeDialogCause;
|
|
20
|
+
(function (RuntimeDialogCause) {
|
|
26
21
|
/**
|
|
27
22
|
* Don't open.
|
|
28
23
|
*/
|
|
29
|
-
|
|
24
|
+
RuntimeDialogCause[RuntimeDialogCause["None"] = 0] = "None";
|
|
30
25
|
/**
|
|
31
|
-
* Launch a new Remote
|
|
26
|
+
* Launch a new Remote Runtime.
|
|
32
27
|
*/
|
|
33
|
-
|
|
28
|
+
RuntimeDialogCause[RuntimeDialogCause["New"] = 1] = "New";
|
|
34
29
|
/**
|
|
35
|
-
* Transfer the state from the current
|
|
30
|
+
* Transfer the state from the current Runtime to a new Remote Runtime.
|
|
36
31
|
*/
|
|
37
|
-
|
|
38
|
-
})(
|
|
32
|
+
RuntimeDialogCause[RuntimeDialogCause["Transfer"] = 2] = "Transfer";
|
|
33
|
+
})(RuntimeDialogCause || (RuntimeDialogCause = {}));
|
|
39
34
|
/**
|
|
40
35
|
* Runtime simple picker component.
|
|
41
36
|
*/
|
|
42
37
|
export function RuntimeSimplePicker(props) {
|
|
43
|
-
const { assignRuntime
|
|
44
|
-
const { runtimeModels
|
|
45
|
-
const [
|
|
38
|
+
const { assignRuntime, sessionConnection } = props;
|
|
39
|
+
const { runtimeModels, multiServiceManager, jupyterLabAdapter } = useRuntimesStore();
|
|
40
|
+
const [runtimeLocation, setRuntimeLocation] = useState();
|
|
46
41
|
const [luminoServices, setLuminoServices] = useState({});
|
|
47
|
-
const [dialogCause, setDialogCause] = useState(
|
|
42
|
+
const [dialogCause, setDialogCause] = useState(RuntimeDialogCause.None);
|
|
48
43
|
const [status, setStatus] = useState('');
|
|
49
44
|
useEffect(() => {
|
|
50
45
|
if (sessionConnection) {
|
|
@@ -69,15 +64,15 @@ export function RuntimeSimplePicker(props) {
|
|
|
69
64
|
}
|
|
70
65
|
}, [multiServiceManager?.remote?.runtimesManager]);
|
|
71
66
|
const handleLaunchRemoteKernel = useCallback(() => {
|
|
72
|
-
setDialogCause(
|
|
67
|
+
setDialogCause(RuntimeDialogCause.New);
|
|
73
68
|
}, []);
|
|
74
69
|
const handleCloseDialog = useCallback((runtimeDesc) => {
|
|
75
70
|
if (runtimeDesc) {
|
|
76
71
|
switch (dialogCause) {
|
|
77
|
-
case
|
|
72
|
+
case RuntimeDialogCause.New:
|
|
78
73
|
refreshRemoteKernels().then(() => {
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
setRuntimeLocation('remote');
|
|
75
|
+
assignRuntime({
|
|
81
76
|
runtimeDesc,
|
|
82
77
|
runtimeModel: multiServiceManager?.remote?.runtimesManager
|
|
83
78
|
.get()
|
|
@@ -85,13 +80,13 @@ export function RuntimeSimplePicker(props) {
|
|
|
85
80
|
});
|
|
86
81
|
});
|
|
87
82
|
break;
|
|
88
|
-
case
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
case RuntimeDialogCause.Transfer:
|
|
84
|
+
setRuntimeLocation('remote');
|
|
85
|
+
assignRuntime({ runtimeDesc, transferState: true });
|
|
91
86
|
break;
|
|
92
87
|
}
|
|
93
88
|
}
|
|
94
|
-
setDialogCause(
|
|
89
|
+
setDialogCause(RuntimeDialogCause.None);
|
|
95
90
|
}, [refreshRemoteKernels, multiServiceManager?.remote, dialogCause]);
|
|
96
91
|
useEffect(() => {
|
|
97
92
|
if (jupyterLabAdapter) {
|
|
@@ -110,7 +105,7 @@ export function RuntimeSimplePicker(props) {
|
|
|
110
105
|
}
|
|
111
106
|
}, [jupyterLabAdapter]);
|
|
112
107
|
return (_jsxs(_Fragment, { children: [_jsxs(ActionMenu, { children: [_jsx(ActionMenu.Button, { leadingVisual: () => {
|
|
113
|
-
switch (
|
|
108
|
+
switch (runtimeLocation) {
|
|
114
109
|
case 'browser':
|
|
115
110
|
return _jsx(BrowserIcon, {});
|
|
116
111
|
case 'remote':
|
|
@@ -123,22 +118,22 @@ export function RuntimeSimplePicker(props) {
|
|
|
123
118
|
?
|
|
124
119
|
_jsx(Box, { sx: { paddingTop: '5px' }, children: _jsx(KernelIndicator, { kernel: sessionConnection.kernel }) })
|
|
125
120
|
:
|
|
126
|
-
_jsx(_Fragment, {}), size: "small", variant: "invisible", children: _jsx(Tooltip, { text: status, direction: "s", children: _jsx(Button, { variant: "invisible", size: "small", children: sessionConnection?.kernel?.name ?? 'Runtimes' }) }) }), _jsx(ActionMenu.Overlay, { width: "medium", children: _jsxs(ActionList, { selectionVariant: "single", showDividers: true, children: [_jsxs(ActionList.Group, { children: [_jsxs(ActionList.Item, { selected:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(EyeIcon, {}) }), "Viewer", _jsx(ActionList.Description, { variant: "block", children: "A simple Notebook Viewer without Runtime." })] }), _jsxs(ActionList.Item, { selected:
|
|
130
|
-
|
|
131
|
-
|
|
121
|
+
_jsx(_Fragment, {}), size: "small", variant: "invisible", children: _jsx(Tooltip, { text: status, direction: "s", children: _jsx(Button, { variant: "invisible", size: "small", children: sessionConnection?.kernel?.name ?? 'Runtimes' }) }) }), _jsx(ActionMenu.Overlay, { width: "medium", children: _jsxs(ActionList, { selectionVariant: "single", showDividers: true, children: [_jsxs(ActionList.Group, { children: [_jsxs(ActionList.Item, { selected: runtimeLocation === undefined && sessionConnection === undefined, onSelect: () => {
|
|
122
|
+
setRuntimeLocation(undefined);
|
|
123
|
+
assignRuntime({ runtimeDesc: undefined });
|
|
124
|
+
}, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(EyeIcon, {}) }), "Viewer", _jsx(ActionList.Description, { variant: "block", children: "A simple Notebook Viewer without Runtime." })] }), _jsxs(ActionList.Item, { selected: runtimeLocation === 'browser', onSelect: () => {
|
|
125
|
+
setRuntimeLocation('browser');
|
|
126
|
+
assignRuntime({
|
|
132
127
|
runtimeDesc: {
|
|
133
128
|
name: 'pyodide',
|
|
134
129
|
location: 'browser',
|
|
135
130
|
language: 'python'
|
|
136
131
|
}
|
|
137
132
|
});
|
|
138
|
-
}, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(BrowserIcon, {}) }), "Browser Runtime", _jsx(ActionList.Description, { variant: "block", children: "A Browser Runtime based on Pyodide." })] })] }),
|
|
133
|
+
}, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(BrowserIcon, {}) }), "Browser Runtime", _jsx(ActionList.Description, { variant: "block", children: "A Browser Runtime based on Pyodide." })] })] }), runtimeModels.length > 0 && (_jsxs(ActionList.Group, { children: [_jsx(ActionList.GroupHeading, { children: "Cloud Runtimes" }), runtimeModels.map(kernelModel => {
|
|
139
134
|
return (_jsxs(ActionList.Item, { selected: sessionConnection?.kernel?.id === kernelModel.id, onSelect: () => {
|
|
140
|
-
|
|
141
|
-
|
|
135
|
+
setRuntimeLocation('remote');
|
|
136
|
+
assignRuntime({
|
|
142
137
|
runtimeDesc: {
|
|
143
138
|
name: kernelModel.environment_name,
|
|
144
139
|
language: '',
|
|
@@ -151,11 +146,11 @@ export function RuntimeSimplePicker(props) {
|
|
|
151
146
|
runtimeModel: kernelModel
|
|
152
147
|
});
|
|
153
148
|
}, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(ArtifactIcon, { type: "runtime" }) }), kernelModel.given_name, _jsx(ActionList.Description, { variant: "block", children: kernelModel.environment_name })] }, kernelModel.id));
|
|
154
|
-
})] })), _jsx(ActionList.Divider, {}), _jsxs(ActionList.Group, { children: [_jsxs(ActionList.Item, { selected: false, onSelect: handleLaunchRemoteKernel, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(PlusIcon, {}) }), "Launch a new Runtime\u2026"] }), _jsxs(ActionList.Item, { disabled:
|
|
155
|
-
setDialogCause(
|
|
156
|
-
}, title: "Transfer the state of the current Runtime to a new Remote Runtime.", children: [_jsx(ActionList.LeadingVisual, { children: _jsx(UnfoldIcon, {}) }), "Transfer state to a new Runtime\u2026"] })] })] }) })] }), multiServiceManager?.remote && dialogCause > 0 && (_jsx(KernelLauncherDialog, { dialogTitle: dialogCause ===
|
|
149
|
+
})] })), _jsx(ActionList.Divider, {}), _jsxs(ActionList.Group, { children: [_jsxs(ActionList.Item, { selected: false, onSelect: handleLaunchRemoteKernel, children: [_jsx(ActionList.LeadingVisual, { children: _jsx(PlusIcon, {}) }), "Launch a new Runtime\u2026"] }), _jsxs(ActionList.Item, { disabled: runtimeLocation !== 'browser', selected: false, onSelect: () => {
|
|
150
|
+
setDialogCause(RuntimeDialogCause.Transfer);
|
|
151
|
+
}, title: "Transfer the state of the current Runtime to a new Remote Runtime.", children: [_jsx(ActionList.LeadingVisual, { children: _jsx(UnfoldIcon, {}) }), "Transfer state to a new Runtime\u2026"] })] })] }) })] }), multiServiceManager?.remote && dialogCause > 0 && (_jsx(KernelLauncherDialog, { dialogTitle: dialogCause === RuntimeDialogCause.Transfer
|
|
157
152
|
? 'Switch to a new Cloud Runtime'
|
|
158
|
-
: undefined, manager: multiServiceManager.remote, onSubmit: handleCloseDialog, markdownParser: luminoServices[IMarkdownParser.name], sanitizer: luminoServices[ISanitizer.name], startKernel: dialogCause ===
|
|
153
|
+
: undefined, manager: multiServiceManager.remote, onSubmit: handleCloseDialog, markdownParser: luminoServices[IMarkdownParser.name], sanitizer: luminoServices[ISanitizer.name], startKernel: dialogCause === RuntimeDialogCause.Transfer
|
|
159
154
|
? 'defer'
|
|
160
|
-
: dialogCause ===
|
|
155
|
+
: dialogCause === RuntimeDialogCause.New }))] }));
|
|
161
156
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SessionContext } from '@jupyterlab/apputils';
|
|
2
2
|
import { ITranslator } from '@jupyterlab/translation';
|
|
3
3
|
import { IMultiServiceManager } from '../../api';
|
|
4
|
-
import { IRuntimeDesc } from '../../
|
|
4
|
+
import { IRuntimeDesc } from '../../models';
|
|
5
5
|
export type IDatalayerRuntimeDesc = IRuntimeDesc & {
|
|
6
6
|
gpu?: string;
|
|
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 { PathExt } from '@jupyterlab/coreutils';
|
|
11
6
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
12
7
|
const ASSIGN_NEW_RUNTIME_LABEL = 'Assign a new Runtime';
|
|
@@ -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 { useMemo } from 'react';
|
|
12
7
|
import { IconButton, ToggleSwitch, FormControl } from '@primer/react';
|
|
13
8
|
import { Box } from "@datalayer/primer-addons";
|
|
@@ -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 './RuntimeCellVariables';
|
|
11
6
|
export * from './RuntimeCellVariablesDialog';
|
|
12
7
|
export * from './RuntimeLauncherDialog';
|
|
@@ -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 { Component } from 'react';
|
|
12
7
|
import html2canvas from 'html2canvas';
|
|
13
8
|
export class ScreenCapture extends Component {
|
|
@@ -132,7 +127,7 @@ export class ScreenCapture extends Component {
|
|
|
132
127
|
const { windowWidth, windowHeight, cropPositionTop, cropPositionLeft, cropWidth, cropHeigth, } = this.state;
|
|
133
128
|
const body = document.querySelector('body');
|
|
134
129
|
if (body) {
|
|
135
|
-
|
|
130
|
+
const scale = window.devicePixelRatio;
|
|
136
131
|
html2canvas(body, {
|
|
137
132
|
width: windowWidth,
|
|
138
133
|
height: windowHeight,
|
|
@@ -2,10 +2,5 @@
|
|
|
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 './ScreenCapture';
|
|
11
6
|
export * from './ScreenCaptureButton';
|
|
@@ -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 { useCallback, useEffect, useState } from 'react';
|
|
12
7
|
import { CameraIcon } from '@datalayer/icons-react';
|
|
13
8
|
import { ActionList, ActionMenu, Box, Flash, FormControl, Select, Spinner } from '@primer/react';
|
|
@@ -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 { useCallback, useMemo, useState } from 'react';
|
|
12
7
|
import { nullTranslator } from '@jupyterlab/translation';
|
|
13
8
|
import { FormControl, Select, Text } from '@primer/react';
|