@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 React, { useEffect } from 'react';
|
|
12
7
|
import clsx from 'clsx';
|
|
13
8
|
import { useTextRevealAnimationLines } from './useTextRevealAnimationLines';
|
|
@@ -46,7 +41,6 @@ export function TextRevealAnimation({ children, ...rest }) {
|
|
|
46
41
|
};
|
|
47
42
|
}, [ref]);
|
|
48
43
|
if (typeof children !== 'string' && (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test')) {
|
|
49
|
-
// eslint-disable-next-line no-console
|
|
50
44
|
console.warn('Children passed to TextRevealAnimation must be a string');
|
|
51
45
|
return null;
|
|
52
46
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
@keyframes wipe {
|
|
7
|
+
from {
|
|
8
|
+
transform: scaleX(1);
|
|
9
|
+
}
|
|
10
|
+
to {
|
|
11
|
+
transform: scaleX(0);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.TextRevealAnimation {
|
|
16
|
+
opacity: 0;
|
|
17
|
+
transition: opacity var(--brand-animation-duration-default) var(--brand-animation-easing-default);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.TextRevealAnimation--visible {
|
|
21
|
+
opacity: 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.TextRevealAnimation,
|
|
25
|
+
.TextRevealAnimation--animated {
|
|
26
|
+
width: 100%;
|
|
27
|
+
min-height: 1lh;
|
|
28
|
+
position: relative;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.TextRevealAnimation--animated::after {
|
|
32
|
+
content: '';
|
|
33
|
+
display: inline;
|
|
34
|
+
position: absolute;
|
|
35
|
+
top: 0;
|
|
36
|
+
right: 0;
|
|
37
|
+
width: 100%;
|
|
38
|
+
height: 100%;
|
|
39
|
+
background-color: var(--brand-color-accent-primary);
|
|
40
|
+
transform-origin: right;
|
|
41
|
+
animation: wipe var(--brand-animation-duration-extended) forwards var(--brand-animation-easing-default);
|
|
42
|
+
animation-delay: var(--animation-delay);
|
|
43
|
+
}
|
|
@@ -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, useEffect, useState } from 'react';
|
|
11
6
|
export const useTextRevealAnimationLines = (text) => {
|
|
12
7
|
const ref = useRef(null);
|
|
@@ -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 { Token } from "@primer/react";
|
|
12
7
|
import { ProjectIcon } from "@primer/octicons-react";
|
|
13
8
|
import { StudentIcon } from "@datalayer/icons-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 { Button, Box } from '@primer/react';
|
|
12
7
|
import { RepoPushIcon, PlayIcon, StopIcon } from '@primer/octicons-react';
|
|
13
8
|
import { notebookStore } from '@datalayer/jupyter-react';
|
|
@@ -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 { Button, Box } from '@primer/react';
|
|
12
7
|
import { RepoPushIcon } from '@primer/octicons-react';
|
|
13
8
|
import { documentStore } from '../../state';
|
|
@@ -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 { NotebookCommandIds } from '@datalayer/jupyter-react';
|
|
12
7
|
import { Button } from '@primer/react';
|
|
13
8
|
import { PlayIcon, StopIcon } from '@primer/octicons-react';
|
|
@@ -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 './AssignmentEditorToolbar';
|
|
11
6
|
export * from './DocumentEditorToolbar';
|
|
12
7
|
export * from './NotebookEditorToolbar';
|
|
@@ -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 { useEffect, useState } from 'react';
|
|
12
7
|
import { Avatar, AvatarStack } from '@primer/react';
|
|
13
8
|
import { getAvatarURL, getRelativeTime } from '../../utils';
|
|
@@ -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 { Signal } from '@lumino/signaling';
|
|
11
6
|
import { coreStore } from '../state';
|
|
12
7
|
export const FORCE_ACTIVATE_RUNTIMES_PLUGINS = false;
|
package/lib/config/index.js
CHANGED
|
@@ -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 IS_LOCALHOST = location.hostname === 'localhost';
|
|
11
6
|
export const getLoomPublicAppId = () => {
|
|
12
7
|
return IS_LOCALHOST
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
/*
|
|
7
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
8
|
+
*
|
|
9
|
+
* MIT License
|
|
10
|
+
*/
|
|
11
|
+
import { Box, Button, Label } from '@primer/react';
|
|
12
|
+
import { Cell, KernelIndicator, useKernelsStore, useCellsStore } from '@datalayer/jupyter-react';
|
|
13
|
+
const CELL_ID = 'cell-example-1';
|
|
14
|
+
const DEFAULT_SOURCE = `from IPython.display import display
|
|
15
|
+
|
|
16
|
+
for i in range(10):
|
|
17
|
+
display('I am a long string which is repeatedly added to the dom in separated divs: %d' % i)`;
|
|
18
|
+
export const CellExample = (props) => {
|
|
19
|
+
const { kernel } = props;
|
|
20
|
+
const cellsStore = useCellsStore();
|
|
21
|
+
const kernelsStore = useKernelsStore();
|
|
22
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, { as: "h1", children: "A Jupyter Cell" }), _jsxs(Box, { children: ["Source: ", cellsStore.getSource(CELL_ID)] }), _jsxs(Box, { children: ["Outputs Count: ", cellsStore.getOutputsCount(CELL_ID)] }), _jsxs(Box, { children: ["Kernel State: ", _jsx(Label, { children: kernelsStore.getExecutionState(kernel.id) })] }), _jsxs(Box, { children: ["Kernel Phase: ", _jsx(Label, { children: kernelsStore.getExecutionPhase(kernel.id) })] }), _jsxs(Box, { display: "flex", children: [_jsx(Box, { children: "Kernel Indicator:" }), _jsx(Box, { ml: 3, children: _jsx(KernelIndicator, { kernel: kernel.connection }) })] }), _jsx(Box, { children: _jsx(Button, { onClick: () => cellsStore.execute(CELL_ID), children: "Run cell" }) }), _jsx(Cell, { source: DEFAULT_SOURCE, id: CELL_ID })] }));
|
|
23
|
+
};
|
|
24
|
+
export default CellExample;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Kernel } from '@datalayer/jupyter-react';
|
|
2
|
+
import { ServiceManager } from '@jupyterlab/services';
|
|
3
|
+
type INotebookExampleProps = {
|
|
4
|
+
kernel: Kernel;
|
|
5
|
+
serviceManager: ServiceManager.IManager;
|
|
6
|
+
};
|
|
7
|
+
export declare const NotebookExample: (props: INotebookExampleProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default NotebookExample;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
/*
|
|
7
|
+
* Copyright (c) 2021-2023 Datalayer, Inc.
|
|
8
|
+
*
|
|
9
|
+
* MIT License
|
|
10
|
+
*/
|
|
11
|
+
import { useMemo } from 'react';
|
|
12
|
+
import { Box } from '@datalayer/primer-addons';
|
|
13
|
+
import { Notebook2, NotebookToolbar, CellSidebarExtension, CellSidebarButton } from '@datalayer/jupyter-react';
|
|
14
|
+
const NOTEBOOK_ID = 'notebook-example-1';
|
|
15
|
+
export const NotebookExample = (props) => {
|
|
16
|
+
const { kernel, serviceManager } = props;
|
|
17
|
+
const extensions = useMemo(() => [
|
|
18
|
+
new CellSidebarExtension({ factory: CellSidebarButton })
|
|
19
|
+
], []);
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, { as: "h1", children: "A Jupyter Notebook" }), _jsx(Notebook2, { path: "ipywidgets.ipynb", id: NOTEBOOK_ID, serviceManager: serviceManager, kernelId: kernel.id, extensions: extensions, Toolbar: NotebookToolbar })] }));
|
|
21
|
+
};
|
|
22
|
+
export default NotebookExample;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "code",
|
|
5
|
+
"execution_count": 1,
|
|
6
|
+
"metadata": {},
|
|
7
|
+
"outputs": [
|
|
8
|
+
{
|
|
9
|
+
"data": {
|
|
10
|
+
"text/plain": ["2"]
|
|
11
|
+
},
|
|
12
|
+
"execution_count": 1,
|
|
13
|
+
"metadata": {},
|
|
14
|
+
"output_type": "execute_result"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"source": ["1+1"]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"cell_type": "code",
|
|
21
|
+
"execution_count": 1,
|
|
22
|
+
"metadata": {
|
|
23
|
+
"datalayer": {
|
|
24
|
+
"_about": "AI Platform for Data Analysis"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"outputs": [
|
|
28
|
+
{
|
|
29
|
+
"data": {
|
|
30
|
+
"text/plain": ["4"]
|
|
31
|
+
},
|
|
32
|
+
"execution_count": 1,
|
|
33
|
+
"metadata": {},
|
|
34
|
+
"output_type": "execute_result"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"source": [
|
|
38
|
+
"# I am a Python cell.\n",
|
|
39
|
+
"print('2+2')"
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"cell_type": "code",
|
|
44
|
+
"execution_count": 1,
|
|
45
|
+
"metadata": {
|
|
46
|
+
},
|
|
47
|
+
"outputs": [
|
|
48
|
+
{
|
|
49
|
+
"data": {
|
|
50
|
+
"text/plain": []
|
|
51
|
+
},
|
|
52
|
+
"execution_count": 1,
|
|
53
|
+
"metadata": {},
|
|
54
|
+
"output_type": "execute_result"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"source": [
|
|
58
|
+
"# import micropip\n",
|
|
59
|
+
"# await micropip.install('ipywidgets')\n",
|
|
60
|
+
"from ipywidgets import IntSlider\n",
|
|
61
|
+
"w = IntSlider()\n",
|
|
62
|
+
"w"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"cell_type": "code",
|
|
67
|
+
"execution_count": 1,
|
|
68
|
+
"metadata": {
|
|
69
|
+
},
|
|
70
|
+
"outputs": [
|
|
71
|
+
{
|
|
72
|
+
"data": {
|
|
73
|
+
"text/plain": []
|
|
74
|
+
},
|
|
75
|
+
"execution_count": 1,
|
|
76
|
+
"metadata": {},
|
|
77
|
+
"output_type": "execute_result"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"source": [
|
|
81
|
+
"w"
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"cell_type": "code",
|
|
86
|
+
"execution_count": 1,
|
|
87
|
+
"metadata": {
|
|
88
|
+
"datalayer": {
|
|
89
|
+
"sql": true
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"outputs": [
|
|
93
|
+
{
|
|
94
|
+
"data": {
|
|
95
|
+
"text/plain": [""]
|
|
96
|
+
},
|
|
97
|
+
"execution_count": 1,
|
|
98
|
+
"metadata": {},
|
|
99
|
+
"output_type": "execute_result"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"source": [
|
|
103
|
+
"-- I am a SQL cell.\n",
|
|
104
|
+
"SELECT * FROM LOGS"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"cell_type": "code",
|
|
109
|
+
"execution_count": null,
|
|
110
|
+
"metadata": {},
|
|
111
|
+
"outputs": [],
|
|
112
|
+
"source": []
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"metadata": {
|
|
116
|
+
"kernelspec": {
|
|
117
|
+
"display_name": "Python (ipykernel)",
|
|
118
|
+
"language": "python",
|
|
119
|
+
"name": "python"
|
|
120
|
+
},
|
|
121
|
+
"language_info": {
|
|
122
|
+
"codemirror_mode": {
|
|
123
|
+
"name": "ipython",
|
|
124
|
+
"version": 3
|
|
125
|
+
},
|
|
126
|
+
"file_extension": ".py",
|
|
127
|
+
"mimetype": "text/x-python",
|
|
128
|
+
"name": "python",
|
|
129
|
+
"nbconvert_exporter": "python",
|
|
130
|
+
"pygments_lexer": "ipython3",
|
|
131
|
+
"version": "3.10.4"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"nbformat": 4,
|
|
135
|
+
"nbformat_minor": 4
|
|
136
|
+
}
|
|
@@ -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
|
* Encode SVG online tool https://yoksel.github.io/url-encoder
|
|
12
7
|
*
|
package/lib/hooks/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./useBackdrop";
|
|
|
4
4
|
export * from "./useBackdropJupyterLab";
|
|
5
5
|
export * from "./useCache";
|
|
6
6
|
export * from "./useContainsFocus";
|
|
7
|
+
export * from "./useDatalayer";
|
|
7
8
|
export * from "./useError";
|
|
8
9
|
export * from "./useExternalScript";
|
|
9
10
|
export * from "./useFocusTrap";
|
|
@@ -18,7 +19,6 @@ export * from "./useNavigate";
|
|
|
18
19
|
export * from "./useNotebookAIAgent";
|
|
19
20
|
export * from "./useOnClickOutside";
|
|
20
21
|
export * from "./useRef";
|
|
21
|
-
export * from "./useRun";
|
|
22
22
|
export * from "./useRuntimes";
|
|
23
23
|
export * from "./useScreenshot";
|
|
24
24
|
export * from "./useToast";
|
package/lib/hooks/index.js
CHANGED
|
@@ -2,17 +2,13 @@
|
|
|
2
2
|
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
-
/*
|
|
6
|
-
* Copyright (c) 2021-2024 Datalayer, Inc.
|
|
7
|
-
*
|
|
8
|
-
* Datalayer License
|
|
9
|
-
*/
|
|
10
5
|
export * from "./useAIAgents";
|
|
11
6
|
export * from "./useAuthorization";
|
|
12
7
|
export * from "./useBackdrop";
|
|
13
8
|
export * from "./useBackdropJupyterLab";
|
|
14
9
|
export * from "./useCache";
|
|
15
10
|
export * from "./useContainsFocus";
|
|
11
|
+
export * from "./useDatalayer";
|
|
16
12
|
// export * from "./useCellOutputshot"; // Do not export html2canvas
|
|
17
13
|
export * from "./useError";
|
|
18
14
|
export * from "./useExternalScript";
|
|
@@ -28,7 +24,6 @@ export * from "./useNavigate";
|
|
|
28
24
|
export * from "./useNotebookAIAgent";
|
|
29
25
|
export * from "./useOnClickOutside";
|
|
30
26
|
export * from "./useRef";
|
|
31
|
-
export * from "./useRun";
|
|
32
27
|
export * from "./useRuntimes";
|
|
33
28
|
export * from "./useScreenshot";
|
|
34
29
|
export * from "./useToast";
|
|
@@ -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 } from "react";
|
|
12
7
|
import { Heading, Box, Spinner } from "@primer/react";
|
|
13
8
|
import { useBackdrop } from '..';
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
.crosshairs {
|
|
7
|
+
position: fixed;
|
|
8
|
+
width: 100%;
|
|
9
|
+
z-index: 2147483645;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.crosshairs.hidden {
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.crosshairs::before,
|
|
17
|
+
.crosshairs::after {
|
|
18
|
+
content: "";
|
|
19
|
+
position: absolute;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.crosshairs::before {
|
|
23
|
+
height: 24px;
|
|
24
|
+
width: 2px;
|
|
25
|
+
background: #000;
|
|
26
|
+
top: -11px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.crosshairs::after {
|
|
30
|
+
width: 24px;
|
|
31
|
+
height: 2px;
|
|
32
|
+
background: #000;
|
|
33
|
+
left: -11px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.overlay {
|
|
37
|
+
position: fixed;
|
|
38
|
+
top: 0;
|
|
39
|
+
left: 0;
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.overlay.highlighting {
|
|
46
|
+
background: none;
|
|
47
|
+
border-color: rgba(0, 0, 0, 0.5);
|
|
48
|
+
border-style: solid;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.crosshairs,
|
|
52
|
+
.crosshairs:before,
|
|
53
|
+
.crosshairs:after,
|
|
54
|
+
.overlay,
|
|
55
|
+
.overlay:before,
|
|
56
|
+
.overlay:after {
|
|
57
|
+
box-sizing: border-box;
|
|
58
|
+
}
|
|
@@ -3,16 +3,12 @@ import { Fragment as _Fragment, 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 { useEffect } from "react";
|
|
12
7
|
import { Box } from "@primer/react";
|
|
13
8
|
import { useScreenshot, useToast } from '..';
|
|
14
9
|
import { lazyWithPreload, WithSuspense } from "../../utils";
|
|
15
10
|
import { useLayoutStore } from '../../state';
|
|
11
|
+
import './LayoutScreenshot.css';
|
|
16
12
|
const ScreenCapture = WithSuspense(lazyWithPreload(() => import("../../components/screenshot/ScreenCapture")));
|
|
17
13
|
const Capture = (props) => {
|
|
18
14
|
const { onStartCapture } = props;
|
|
@@ -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 './LayoutBackdrop';
|
|
11
6
|
export * from './LayoutScreenshot';
|