@datalayer/core 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -2
- package/lib/App.css +47 -0
- package/lib/App.js +14 -2
- package/lib/__tests__/index.test.js +7 -6
- package/lib/api/{RunApi.d.ts → DatalayerApi.d.ts} +4 -4
- package/lib/api/{RunApi.js → DatalayerApi.js} +6 -11
- package/lib/api/index.d.ts +3 -2
- package/lib/api/index.js +3 -7
- 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} +47 -53
- 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 +3 -8
- package/lib/api/runtimes/snapshots.d.ts +1 -1
- package/lib/api/runtimes/snapshots.js +8 -13
- package/lib/api/runtimes/utils.js +1 -9
- package/lib/assets/react.svg +1 -0
- package/lib/collaboration/DatalayerCollaboration.d.ts +9 -0
- package/lib/collaboration/DatalayerCollaboration.js +28 -0
- package/lib/collaboration/DatalayerCollaborationProvider.d.ts +54 -0
- package/lib/collaboration/DatalayerCollaborationProvider.js +162 -0
- package/lib/collaboration/index.d.ts +2 -0
- package/lib/collaboration/index.js +6 -0
- package/lib/components/avatars/BoringAvatar.d.ts +2 -3
- 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 +2 -14
- package/lib/components/avatars/index.js +0 -5
- package/lib/components/banners/NoAutomationBanner.js +4 -9
- package/lib/components/banners/index.js +0 -5
- package/lib/components/buttons/DownloadCSVButton.d.ts +1 -1
- package/lib/components/buttons/DownloadCSVButton.js +1 -6
- 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 +1 -6
- package/lib/components/buttons/index.js +0 -5
- package/lib/components/checkout/StripeCheckout.d.ts +1 -1
- package/lib/components/checkout/StripeCheckout.js +6 -11
- package/lib/components/checkout/index.js +0 -5
- package/lib/components/confetti/ConfettiSuccess.js +1 -6
- package/lib/components/confetti/index.js +0 -5
- package/lib/components/context/OrganizationSelect.js +5 -10
- package/lib/components/context/SpaceSelect.js +7 -12
- package/lib/components/context/index.js +0 -5
- package/lib/components/display/AvatarSkeleton.js +1 -6
- package/lib/components/display/CenteredSpinner.js +4 -9
- package/lib/components/display/CodePreview.js +4 -9
- package/lib/components/display/DatalayerBox.js +13 -19
- package/lib/components/display/HorizontalCenter.d.ts +1 -1
- package/lib/components/display/HorizontalCenter.js +1 -1
- package/lib/components/display/JupyterDialog.js +17 -20
- package/lib/components/display/NavLink.d.ts +4 -2
- package/lib/components/display/NavLink.js +6 -9
- package/lib/components/display/NotebookSkeleton.js +2 -7
- package/lib/components/display/Placeholder.js +1 -6
- package/lib/components/display/ToTopBranded.js +1 -6
- package/lib/components/display/VisuallyHidden.js +0 -5
- package/lib/components/display/index.js +0 -5
- package/lib/components/echarts/EChartsReact.d.ts +1 -1
- package/lib/components/echarts/EChartsReact.js +7 -7
- package/lib/components/echarts/index.js +0 -5
- package/lib/components/flashes/FlashClosable.js +11 -16
- package/lib/components/flashes/FlashDisclaimer.js +2 -8
- package/lib/components/flashes/FlashGuest.js +3 -9
- package/lib/components/flashes/FlashSurveys.js +3 -9
- package/lib/components/flashes/FlashUnauthorized.js +2 -7
- package/lib/components/flashes/index.js +0 -5
- package/lib/components/flashes/surveys/Survey2025_1.d.ts +1 -1
- package/lib/components/flashes/surveys/Survey2025_1.js +62 -90
- package/lib/components/flashes/surveys/index.js +0 -5
- package/lib/components/iam/ExternalTokenSilentLogin.js +6 -9
- package/lib/components/iam/index.js +0 -5
- package/lib/components/icons/ArtifactIcon.d.ts +2 -2
- package/lib/components/icons/ArtifactIcon.js +39 -44
- package/lib/components/icons/index.js +0 -5
- package/lib/components/index.js +1 -6
- package/lib/components/labels/VisibilityLabel.js +2 -10
- package/lib/components/labels/index.js +0 -5
- package/lib/components/landings/StepBlock.d.ts +1 -1
- package/lib/components/landings/StepBlock.js +1 -6
- package/lib/components/landings/index.js +0 -5
- package/lib/components/navbar/NavigationVisbilityObserver.js +2 -7
- package/lib/components/navbar/SubdomainNavBar.js +46 -29
- package/lib/components/navbar/SubdomainNavBar.module.css +737 -0
- package/lib/components/navbar/index.js +0 -5
- package/lib/components/nbgrader/NbGradesDetails.d.ts +1 -1
- package/lib/components/nbgrader/NbGradesDetails.js +5 -13
- package/lib/components/nbgrader/index.js +0 -5
- package/lib/components/notebooks/JupyterNotebook.js +5 -10
- package/lib/components/notebooks/JupyterNotebookToolbar.js +3 -8
- package/lib/components/notebooks/index.js +0 -5
- package/lib/components/primer/Helper.d.ts +1 -1
- package/lib/components/primer/Helper.js +5 -3
- package/lib/components/primer/Portals.d.ts +1 -1
- package/lib/components/primer/Portals.js +2 -7
- package/lib/components/primer/Styles.js +1 -6
- package/lib/components/primer/index.js +0 -5
- package/lib/components/progress/ConsumptionBar.js +2 -7
- package/lib/components/progress/CreditsIndicator.d.ts +1 -1
- package/lib/components/progress/CreditsIndicator.js +4 -13
- package/lib/components/progress/ProgressBar.js +0 -5
- package/lib/components/progress/ProgressRing.js +2 -2
- package/lib/components/progress/Timer.js +0 -5
- package/lib/components/progress/index.js +0 -5
- package/lib/components/runtimes/RuntimeCellVariables.js +9 -14
- package/lib/components/runtimes/RuntimeCellVariablesDialog.js +7 -12
- package/lib/components/runtimes/RuntimeLauncherDialog.d.ts +1 -2
- package/lib/components/runtimes/RuntimeLauncherDialog.js +32 -40
- package/lib/components/runtimes/RuntimePickerBase.d.ts +1 -1
- package/lib/components/runtimes/RuntimePickerBase.js +42 -36
- package/lib/components/runtimes/RuntimePickerCell.js +9 -17
- package/lib/components/runtimes/RuntimePickerNotebook.d.ts +1 -2
- package/lib/components/runtimes/RuntimePickerNotebook.js +45 -50
- package/lib/components/runtimes/RuntimeReservationControl.js +10 -20
- package/lib/components/runtimes/RuntimeSimplePicker.d.ts +1 -1
- package/lib/components/runtimes/RuntimeSimplePicker.js +44 -52
- package/lib/components/runtimes/RuntimeUtils.d.ts +1 -1
- package/lib/components/runtimes/RuntimeUtils.js +22 -17
- package/lib/components/runtimes/RuntimeVariables.js +7 -12
- package/lib/components/runtimes/index.js +0 -5
- package/lib/components/screenshot/ScreenCapture.js +10 -19
- package/lib/components/screenshot/ScreenCaptureButton.d.ts +1 -1
- package/lib/components/screenshot/ScreenCaptureButton.js +14 -8
- package/lib/components/screenshot/index.js +0 -5
- package/lib/components/snapshots/RuntimeSnapshotMenu.js +19 -22
- package/lib/components/snapshots/index.js +0 -5
- package/lib/components/snippets/SnippetDialog.js +5 -10
- package/lib/components/snippets/index.js +0 -5
- package/lib/components/storage/ContentsBrowser.js +75 -63
- package/lib/components/storage/ContentsItems.js +10 -13
- package/lib/components/storage/index.js +0 -5
- package/lib/components/students/StudentItemStatus.d.ts +1 -1
- package/lib/components/students/StudentItemStatus.js +38 -21
- package/lib/components/students/index.js +0 -5
- package/lib/components/subnav/SubNav.d.ts +3 -3
- package/lib/components/subnav/SubNav.js +34 -24
- package/lib/components/subnav/SubNav.module.css +717 -0
- package/lib/components/subnav/index.js +0 -5
- package/lib/components/tables/DataTable.js +1 -9
- package/lib/components/tables/index.js +0 -5
- package/lib/components/text-reveal/TextRevealAnimation.js +7 -8
- package/lib/components/text-reveal/TextRevealAnimation.module.css +45 -0
- package/lib/components/text-reveal/index.js +0 -5
- package/lib/components/text-reveal/useTextRevealAnimationLines.js +0 -5
- package/lib/components/tokens/SpaceVariantToken.d.ts +1 -1
- package/lib/components/tokens/SpaceVariantToken.js +5 -10
- package/lib/components/tokens/index.js +0 -5
- package/lib/components/toolbars/AssignmentEditorToolbar.js +1 -8
- 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.d.ts +1 -1
- package/lib/components/users/PeerIndicator.js +5 -10
- package/lib/components/users/index.js +0 -5
- package/lib/config/Configuration.d.ts +48 -0
- package/lib/config/Configuration.js +42 -5
- package/lib/config/index.js +0 -5
- package/lib/config/integrations/Loom.js +3 -8
- package/lib/config/integrations/index.js +0 -5
- package/lib/examples/CellExample.d.ts +6 -0
- package/lib/examples/CellExample.js +55 -0
- package/lib/examples/DatalayerNotebookExample.d.ts +16 -0
- package/lib/examples/DatalayerNotebookExample.js +75 -0
- package/lib/examples/NativeNavigationExample.d.ts +8 -0
- package/lib/examples/NativeNavigationExample.js +97 -0
- package/lib/examples/NotebookExample.d.ts +6 -0
- package/lib/examples/NotebookExample.js +24 -0
- package/lib/examples/NotebookMutationsKernel.d.ts +2 -0
- package/lib/examples/NotebookMutationsKernel.js +115 -0
- package/lib/examples/NotebookMutationsServiceManager.d.ts +2 -0
- package/lib/examples/NotebookMutationsServiceManager.js +107 -0
- package/lib/examples/ReactRouterExample.d.ts +6 -0
- package/lib/examples/ReactRouterExample.js +175 -0
- package/lib/examples/example-selector.d.ts +22 -0
- package/lib/examples/example-selector.js +45 -0
- package/lib/examples/index.d.ts +2 -0
- package/lib/examples/index.js +6 -0
- package/lib/examples/main.js +153 -0
- package/lib/examples/notebooks/IPyWidgetsExample.ipynb.json +101 -0
- package/lib/examples/notebooks/IPyWidgetsExampleWithState.ipynb.json +112 -0
- package/lib/examples/notebooks/Lite.ipynb.json +128 -0
- package/lib/examples/notebooks/Matplotlib.ipynb.json +137 -0
- package/lib/examples/notebooks/NotebookExample1.ipynb.json +126 -0
- package/lib/examples/notebooks/NotebookExample2.ipynb.json +48 -0
- package/lib/examples/notebooks/NotebookOutputs.ipynb.json +49 -0
- package/lib/examples/notebooks/NotebookToCExample.ipynb.json +102 -0
- package/lib/examples/notebooks/OutputIPyWidgetsExample.d.ts +145 -0
- package/lib/examples/notebooks/OutputIPyWidgetsExample.js +153 -0
- package/lib/examples/notebooks/PyGWalker.ipynb.json +55 -0
- package/lib/hooks/assets/OutputshotPlaceholders.d.ts +10 -10
- package/lib/hooks/assets/OutputshotPlaceholders.js +9 -14
- package/lib/hooks/assets/index.js +0 -5
- package/lib/hooks/index.d.ts +29 -28
- package/lib/hooks/index.js +29 -33
- package/lib/hooks/layouts/LayoutBackdrop.js +3 -11
- package/lib/hooks/layouts/LayoutScreenshot.css +58 -0
- package/lib/hooks/layouts/LayoutScreenshot.d.ts +1 -0
- package/lib/hooks/layouts/LayoutScreenshot.js +7 -11
- package/lib/hooks/layouts/index.js +0 -5
- package/lib/hooks/useAIAgents.d.ts +1 -1
- package/lib/hooks/useAIAgents.js +13 -18
- package/lib/hooks/useAuthorization.js +4 -10
- package/lib/hooks/useBackdrop.js +7 -12
- package/lib/hooks/useBackdropJupyterLab.d.ts +1 -1
- package/lib/hooks/useBackdropJupyterLab.js +4 -9
- package/lib/hooks/useCache.d.ts +8 -4
- package/lib/hooks/useCache.js +410 -361
- package/lib/hooks/useCellOutputshot.js +3 -11
- package/lib/hooks/useContainsFocus.js +2 -6
- package/lib/hooks/useDatalayer.d.ts +21 -0
- package/lib/hooks/{useRun.js → useDatalayer.js} +16 -18
- package/lib/hooks/useError.d.ts +1 -1
- package/lib/hooks/useError.js +2 -7
- package/lib/hooks/useExternalScript.js +4 -9
- package/lib/hooks/useFocusTrap.d.ts +1 -1
- package/lib/hooks/useFocusTrap.js +3 -7
- package/lib/hooks/useIAM.js +6 -12
- package/lib/hooks/useId.js +6 -11
- package/lib/hooks/useIsomorphicLayoutEffect.js +0 -5
- package/lib/hooks/useJupyterLabTheme.js +3 -6
- package/lib/hooks/useKeyboardEscape.js +0 -5
- package/lib/hooks/useLocation.d.ts +22 -0
- package/lib/hooks/useLocation.js +149 -0
- package/lib/hooks/useLocationHandles.d.ts +2 -2
- package/lib/hooks/useLocationHandles.js +6 -9
- package/lib/hooks/useNavigate.d.ts +5 -1
- package/lib/hooks/useNavigate.js +62 -12
- package/lib/hooks/useNotebookAIAgent.js +3 -6
- package/lib/hooks/useOnClickOutside.js +0 -5
- package/lib/hooks/useParams.d.ts +5 -0
- package/lib/hooks/useParams.js +152 -0
- package/lib/hooks/useRef.js +0 -5
- package/lib/hooks/useRuntimes.js +2 -7
- package/lib/hooks/useScreenshot.js +5 -10
- package/lib/hooks/useToast.js +21 -21
- package/lib/hooks/useUpload.js +9 -14
- package/lib/hooks/useUser.js +1 -1
- 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/index.d.ts +6 -3
- package/lib/index.js +7 -3
- package/lib/main.js +1 -2
- package/lib/mocks/components/FlashMock.js +4 -9
- 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 +15 -23
- package/lib/mocks/hooks/useDatalayerMock.d.ts +6 -0
- package/lib/mocks/hooks/{useRunMock.js → useDatalayerMock.js} +9 -14
- package/lib/mocks/index.js +0 -5
- package/lib/mocks/jupyter/index.js +1 -6
- package/lib/mocks/models/CodeBlockMock.js +1 -6
- package/lib/mocks/models/CodelineMock.js +1 -6
- package/lib/mocks/models/CourseMock.d.ts +1 -1
- package/lib/mocks/models/CourseMock.js +10 -15
- package/lib/mocks/models/InviteMock.d.ts +1 -1
- package/lib/mocks/models/InviteMock.js +21 -11
- package/lib/mocks/models/JupyterLabUserMock.js +2 -2
- package/lib/mocks/models/OrganisationMock.d.ts +1 -1
- package/lib/mocks/models/OrganisationMock.js +11 -7
- package/lib/mocks/models/SchoolMock.d.ts +1 -1
- package/lib/mocks/models/SchoolMock.js +6 -6
- package/lib/mocks/models/SpaceMock.d.ts +1 -1
- package/lib/mocks/models/SpaceMock.js +9 -14
- package/lib/mocks/models/TeamMock.d.ts +1 -1
- package/lib/mocks/models/TeamMock.js +6 -6
- package/lib/mocks/models/UserMock.d.ts +1 -1
- package/lib/mocks/models/UserMock.js +4 -11
- package/lib/mocks/models/index.js +0 -5
- package/lib/mocks/views/ActionMenuMock.js +1 -6
- package/lib/mocks/views/ChartMock.js +3 -8
- package/lib/mocks/views/ChartMockOptions.js +24 -29
- package/lib/mocks/views/DashboardMock.js +74 -79
- package/lib/mocks/views/FormMock.js +1 -6
- package/lib/mocks/views/TableMock.js +1 -6
- package/lib/mocks/views/WipMock.js +0 -5
- package/lib/mocks/views/index.js +0 -5
- package/lib/models/Account.d.ts +2 -2
- package/lib/models/Assignment.d.ts +2 -2
- package/lib/models/Cell.d.ts +1 -1
- package/lib/models/CodeBlock.d.ts +1 -1
- package/lib/models/CodefeedBlocks.d.ts +2 -2
- package/lib/models/Contact.d.ts +1 -1
- package/lib/models/Contact.js +14 -19
- package/lib/models/ContactEvent.js +0 -5
- package/lib/models/ContactIAMProvider.js +2 -2
- package/lib/models/Course.d.ts +7 -7
- package/lib/models/Credits.js +0 -5
- package/lib/models/Dataset.d.ts +2 -2
- package/lib/models/Datasource.js +0 -5
- package/lib/models/Dean.d.ts +1 -1
- package/lib/models/Document.d.ts +1 -1
- package/lib/models/Environment.d.ts +2 -2
- package/lib/models/Errors.js +0 -5
- package/lib/models/Exercise.d.ts +1 -1
- package/lib/models/GrowthKPI.js +0 -5
- package/lib/models/IAMProviderLinked.js +1 -1
- package/lib/models/IAMProviderUsers.js +0 -5
- package/lib/models/IAMToken.js +0 -5
- package/lib/models/Inbound.js +0 -5
- package/lib/models/Instructor.d.ts +1 -1
- package/lib/models/Invite.d.ts +2 -2
- package/lib/models/Invite.js +1 -1
- package/lib/models/Item.d.ts +5 -5
- package/lib/models/LandingRoles.js +18 -23
- package/lib/models/Lesson.d.ts +1 -1
- package/lib/models/Member.d.ts +1 -1
- package/lib/models/Notebook.d.ts +1 -1
- package/lib/models/Organization.d.ts +4 -4
- package/lib/models/Organization.js +2 -7
- package/lib/models/OrganizationMember.d.ts +2 -2
- package/lib/models/Outbound.js +7 -12
- package/lib/models/Page.js +4 -2
- package/lib/models/PageTag.d.ts +2 -2
- package/lib/models/PageTag.js +56 -9
- package/lib/models/Profile.d.ts +1 -1
- package/lib/models/RolesOrganization.d.ts +1 -1
- package/lib/models/RolesOrganization.js +4 -17
- package/lib/models/RolesPlatform.d.ts +1 -1
- package/lib/models/RolesPlatform.js +12 -39
- package/lib/models/RolesTeam.d.ts +1 -1
- package/lib/models/RolesTeam.js +3 -15
- package/lib/models/Runtime.d.ts +59 -1
- package/lib/models/Runtime.js +11 -9
- package/lib/models/RuntimeSnapshot.js +1 -1
- package/lib/models/School.d.ts +4 -4
- package/lib/models/Secret.js +0 -5
- package/lib/models/Space.d.ts +5 -5
- package/lib/models/Space.js +3 -3
- package/lib/models/SpaceItem.d.ts +8 -8
- package/lib/models/SpaceMember.d.ts +2 -2
- package/lib/models/Student.d.ts +2 -2
- package/lib/models/StudentItem.d.ts +3 -3
- package/lib/models/Survey.js +0 -5
- package/lib/models/Team.d.ts +3 -3
- package/lib/models/Team.js +2 -7
- package/lib/models/TeamMember.d.ts +2 -2
- package/lib/models/URN.js +1 -6
- package/lib/models/User.d.ts +2 -2
- package/lib/models/User.js +7 -10
- package/lib/models/UserEvent.js +0 -5
- package/lib/models/UserOnboarding.d.ts +1 -1
- package/lib/models/UserOnboarding.js +7 -12
- package/lib/models/UserSettings.js +2 -7
- package/lib/models/index.d.ts +2 -2
- package/lib/models/index.js +2 -7
- package/lib/navigation/adapters/native.d.ts +11 -0
- package/lib/navigation/adapters/native.js +48 -0
- package/lib/navigation/adapters/nextjs.d.ts +9 -0
- package/lib/navigation/adapters/nextjs.js +35 -0
- package/lib/navigation/adapters/react-router.d.ts +4 -0
- package/lib/navigation/adapters/react-router.js +12 -0
- package/lib/navigation/components.d.ts +20 -0
- package/lib/navigation/components.js +36 -0
- package/lib/navigation/index.d.ts +4 -0
- package/lib/navigation/index.js +12 -0
- package/lib/routes/Routes.js +0 -5
- package/lib/routes/index.d.ts +1 -1
- package/lib/routes/index.js +1 -6
- package/lib/services/DatalayerServiceManager.d.ts +22 -0
- package/lib/services/DatalayerServiceManager.js +79 -0
- package/lib/services/index.d.ts +4 -0
- package/lib/services/index.js +7 -0
- package/lib/services/reconnectToRuntime.d.ts +32 -0
- package/lib/services/reconnectToRuntime.js +59 -0
- package/lib/state/State.d.ts +1 -1
- package/lib/state/State.js +1 -6
- package/lib/state/index.d.ts +1 -1
- package/lib/state/index.js +1 -6
- package/lib/state/storage/IAMStorage.js +14 -7
- package/lib/state/storage/index.d.ts +1 -1
- package/lib/state/storage/index.js +1 -6
- package/lib/state/substates/AIAgentState.js +4 -7
- package/lib/state/substates/CellState.js +6 -10
- package/lib/state/substates/CoreState.d.ts +1 -1
- package/lib/state/substates/CoreState.js +23 -20
- package/lib/state/substates/DatasourceState.js +1 -6
- package/lib/state/substates/DocumentState.js +0 -5
- package/lib/state/substates/GradeState.js +0 -5
- package/lib/state/substates/IAMState.d.ts +5 -1
- package/lib/state/substates/IAMState.js +88 -72
- package/lib/state/substates/JupyterLabState.js +1 -6
- package/lib/state/substates/LayoutState.d.ts +2 -2
- package/lib/state/substates/LayoutState.js +41 -28
- package/lib/state/substates/NbformatState.js +0 -5
- package/lib/state/substates/OrganizationState.js +1 -6
- package/lib/state/substates/RuntimesState.d.ts +2 -2
- package/lib/state/substates/RuntimesState.js +6 -10
- package/lib/state/substates/SpaceState.js +1 -6
- package/lib/state/substates/SurveysState.js +7 -12
- package/lib/state/substates/TeamState.js +1 -6
- 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 +73 -1
- package/lib/theme/DatalayerTheme.js +1 -6
- package/lib/theme/DatalayerThemeProvider.js +17 -19
- package/lib/theme/Palette.js +1 -6
- package/lib/theme/index.js +0 -5
- package/lib/utils/Array.js +0 -5
- package/lib/utils/Avatar.js +2 -7
- package/lib/utils/Browser.js +6 -11
- package/lib/utils/Cells.d.ts +1 -1
- package/lib/utils/Cookie.js +1 -6
- package/lib/utils/Date.js +5 -10
- package/lib/utils/Download.js +5 -8
- package/lib/utils/DownloadFile.js +4 -7
- package/lib/utils/Env.js +2 -6
- 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.d.ts +1 -1
- package/lib/utils/Lazy.js +2 -8
- package/lib/utils/Name.js +10 -13
- package/lib/utils/Notebook.d.ts +1 -1
- package/lib/utils/Notebook.js +3 -3
- package/lib/utils/Number.js +13 -14
- package/lib/utils/Plots.d.ts +1 -1
- package/lib/utils/Plots.js +5 -5
- package/lib/utils/Random.js +0 -5
- package/lib/utils/Screenshot.js +1 -6
- package/lib/utils/Scroll.js +3 -7
- package/lib/utils/Sleep.js +1 -6
- package/lib/utils/Snapshot.js +2 -7
- package/lib/utils/String.js +2 -7
- package/lib/utils/Uri.js +2 -7
- package/lib/utils/Validator.js +0 -5
- package/lib/utils/WithSuspense.js +3 -11
- package/lib/utils/index.js +0 -5
- package/package.json +96 -30
- package/style/animation/Animation.module.css +174 -0
- package/style/base.css +64 -0
- package/style/index.css +6 -0
- package/lib/__tests__/App.test.js +0 -17
- 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
- /package/lib/{__tests__/App.test.d.ts → examples/main.d.ts} +0 -0
package/lib/hooks/index.js
CHANGED
|
@@ -2,37 +2,33 @@
|
|
|
2
2
|
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from "./useBackdrop";
|
|
13
|
-
export * from "./useBackdropJupyterLab";
|
|
14
|
-
export * from "./useCache";
|
|
15
|
-
export * from "./useContainsFocus";
|
|
5
|
+
export * from './useAIAgents';
|
|
6
|
+
export * from './useAuthorization';
|
|
7
|
+
export * from './useBackdrop';
|
|
8
|
+
export * from './useBackdropJupyterLab';
|
|
9
|
+
export * from './useCache';
|
|
10
|
+
export * from './useContainsFocus';
|
|
11
|
+
export * from './useDatalayer';
|
|
16
12
|
// export * from "./useCellOutputshot"; // Do not export html2canvas
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
export * from
|
|
22
|
-
export * from
|
|
23
|
-
export * from
|
|
24
|
-
export * from
|
|
25
|
-
export * from
|
|
26
|
-
export * from
|
|
27
|
-
export * from
|
|
28
|
-
export * from
|
|
29
|
-
export * from
|
|
30
|
-
export * from
|
|
31
|
-
export * from
|
|
32
|
-
export * from
|
|
33
|
-
export * from
|
|
34
|
-
export * from
|
|
35
|
-
export * from
|
|
36
|
-
export * from
|
|
37
|
-
export * from
|
|
38
|
-
export * from
|
|
13
|
+
export * from './useError';
|
|
14
|
+
export * from './useExternalScript';
|
|
15
|
+
export * from './useFocusTrap';
|
|
16
|
+
export * from './useIAM';
|
|
17
|
+
export * from './useId';
|
|
18
|
+
export * from './useIsomorphicLayoutEffect';
|
|
19
|
+
export * from './useJupyterLabTheme';
|
|
20
|
+
export * from './useKeyboardEscape';
|
|
21
|
+
export * from './useLocation';
|
|
22
|
+
export * from './useLocationHandles';
|
|
23
|
+
export * from './useNavigate';
|
|
24
|
+
export * from './useParams';
|
|
25
|
+
export * from './useNotebookAIAgent';
|
|
26
|
+
export * from './useOnClickOutside';
|
|
27
|
+
export * from './useRef';
|
|
28
|
+
export * from './useRuntimes';
|
|
29
|
+
export * from './useScreenshot';
|
|
30
|
+
export * from './useToast';
|
|
31
|
+
export * from './useUpload';
|
|
32
|
+
export * from './useUser';
|
|
33
|
+
export * from './useVisibilityObserver';
|
|
34
|
+
export * from './useWindowSize';
|
|
@@ -3,21 +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
|
-
|
|
8
|
-
*
|
|
9
|
-
* Datalayer License
|
|
10
|
-
*/
|
|
11
|
-
import { useEffect } from "react";
|
|
12
|
-
import { Heading, Box, Spinner } from "@primer/react";
|
|
6
|
+
import { useEffect } from 'react';
|
|
7
|
+
import { Heading, Box, Spinner } from '@primer/react';
|
|
13
8
|
import { useBackdrop } from '..';
|
|
14
9
|
import { useLayoutStore } from '../../state';
|
|
15
10
|
const BackdropContent = (props) => {
|
|
16
11
|
const { backdropDisplay } = props;
|
|
17
|
-
return (_jsx(Box, { style: { zIndex: 10999 }, children: backdropDisplay.message ?
|
|
18
|
-
_jsxs(Box, { display: "flex", style: { alignItems: "center" }, children: [_jsx(Box, { mr: 3, children: _jsx(Spinner, { size: "large" }) }), _jsx(Box, { children: _jsx(Heading, { sx: { fontSize: 5, color: 'white' }, children: backdropDisplay.message }) })] })
|
|
19
|
-
:
|
|
20
|
-
_jsx(Spinner, { size: "large" }) }));
|
|
12
|
+
return (_jsx(Box, { style: { zIndex: 10999 }, children: backdropDisplay.message ? (_jsxs(Box, { display: "flex", style: { alignItems: 'center' }, children: [_jsx(Box, { mr: 3, children: _jsx(Spinner, { size: "large" }) }), _jsx(Box, { children: _jsx(Heading, { sx: { fontSize: 5, color: 'white' }, children: backdropDisplay.message }) })] })) : (_jsx(Spinner, { size: "large" })) }));
|
|
21
13
|
};
|
|
22
14
|
export const LayoutBackdrop = () => {
|
|
23
15
|
const { backdrop } = useLayoutStore();
|
|
@@ -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,17 +3,13 @@ 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
|
-
|
|
8
|
-
*
|
|
9
|
-
* Datalayer License
|
|
10
|
-
*/
|
|
11
|
-
import { useEffect } from "react";
|
|
12
|
-
import { Box } from "@primer/react";
|
|
6
|
+
import { useEffect } from 'react';
|
|
7
|
+
import { Box } from '@primer/react';
|
|
13
8
|
import { useScreenshot, useToast } from '..';
|
|
14
|
-
import { lazyWithPreload, WithSuspense } from
|
|
9
|
+
import { lazyWithPreload, WithSuspense } from '../../utils';
|
|
15
10
|
import { useLayoutStore } from '../../state';
|
|
16
|
-
|
|
11
|
+
import './LayoutScreenshot.css';
|
|
12
|
+
const ScreenCapture = WithSuspense(lazyWithPreload(() => import('../../components/screenshot/ScreenCapture')));
|
|
17
13
|
const Capture = (props) => {
|
|
18
14
|
const { onStartCapture } = props;
|
|
19
15
|
useEffect(() => {
|
|
@@ -30,14 +26,14 @@ const ScreenshotContent = (props) => {
|
|
|
30
26
|
hideScreenshot();
|
|
31
27
|
enqueueToast('Screen is captured.', { variant: 'success' });
|
|
32
28
|
};
|
|
33
|
-
return (_jsx(Box, { children: _jsx(ScreenCapture, { onEndCapture: handleScreenCapture, children: ({ onStartCapture }) =>
|
|
29
|
+
return (_jsx(Box, { children: _jsx(ScreenCapture, { onEndCapture: handleScreenCapture, children: ({ onStartCapture }) => _jsx(Capture, { onStartCapture: onStartCapture }) }) }));
|
|
34
30
|
};
|
|
35
31
|
export const LayoutScreenshot = () => {
|
|
36
32
|
const { screenshot } = useLayoutStore();
|
|
37
33
|
const { displayScreenshot, closeScreenshot } = useScreenshot();
|
|
38
34
|
useEffect(() => {
|
|
39
35
|
if (screenshot && screenshot.open) {
|
|
40
|
-
displayScreenshot(() => _jsx(ScreenshotContent, { screenshotDisplay: screenshot }));
|
|
36
|
+
displayScreenshot(() => (_jsx(ScreenshotContent, { screenshotDisplay: screenshot })));
|
|
41
37
|
}
|
|
42
38
|
else {
|
|
43
39
|
closeScreenshot();
|
|
@@ -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';
|
|
@@ -5,7 +5,7 @@ export type RequestOptions = {
|
|
|
5
5
|
export type RoomType = 'notebook_persist' | 'notebook_memory' | 'doc_memory';
|
|
6
6
|
export declare const useAIAgents: (baseUrlOverride?: string) => {
|
|
7
7
|
createAIAgent: (documentId: string, documentType: RoomType, ingress?: string, token?: string, kernelId?: string, { signal, baseUrl }?: RequestOptions) => Promise<any>;
|
|
8
|
-
getAIAgents: ({ signal, baseUrl }?: RequestOptions) => Promise<any>;
|
|
8
|
+
getAIAgents: ({ signal, baseUrl, }?: RequestOptions) => Promise<any>;
|
|
9
9
|
deleteAIAgent: (documentId: string, { signal, baseUrl }?: RequestOptions) => Promise<any>;
|
|
10
10
|
getAIAgent: (documentId: string, { signal, baseUrl }?: RequestOptions) => Promise<any>;
|
|
11
11
|
patchAIAgent: (documentId: string, ingress?: string, token?: string, kernelId?: string, { signal, baseUrl }?: RequestOptions) => Promise<any>;
|
package/lib/hooks/useAIAgents.js
CHANGED
|
@@ -2,19 +2,14 @@
|
|
|
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 { URLExt } from '@jupyterlab/coreutils';
|
|
11
6
|
import { useCoreStore } from '../state';
|
|
12
|
-
import {
|
|
7
|
+
import { useDatalayer } from './useDatalayer';
|
|
13
8
|
export const useAIAgents = (baseUrlOverride = 'api/ai-agents/v1') => {
|
|
14
9
|
const { configuration } = useCoreStore();
|
|
15
|
-
const {
|
|
10
|
+
const { requestDatalayer } = useDatalayer({ notifyOnError: false });
|
|
16
11
|
const createAIAgent = (documentId, documentType, ingress, token, kernelId, { signal, baseUrl = baseUrlOverride } = {}) => {
|
|
17
|
-
return
|
|
12
|
+
return requestDatalayer({
|
|
18
13
|
url: URLExt.join(configuration.aiagentsRunUrl, baseUrl, 'agents'),
|
|
19
14
|
method: 'POST',
|
|
20
15
|
body: {
|
|
@@ -24,34 +19,34 @@ export const useAIAgents = (baseUrlOverride = 'api/ai-agents/v1') => {
|
|
|
24
19
|
ingress,
|
|
25
20
|
token,
|
|
26
21
|
kernel_id: kernelId,
|
|
27
|
-
}
|
|
22
|
+
},
|
|
28
23
|
},
|
|
29
|
-
signal
|
|
24
|
+
signal,
|
|
30
25
|
});
|
|
31
26
|
};
|
|
32
|
-
const getAIAgents = ({ signal, baseUrl = baseUrlOverride } = {}) => {
|
|
33
|
-
return
|
|
27
|
+
const getAIAgents = ({ signal, baseUrl = baseUrlOverride, } = {}) => {
|
|
28
|
+
return requestDatalayer({
|
|
34
29
|
url: URLExt.join(configuration.aiagentsRunUrl, baseUrl, 'agents'),
|
|
35
30
|
method: 'GET',
|
|
36
31
|
signal,
|
|
37
32
|
});
|
|
38
33
|
};
|
|
39
34
|
const deleteAIAgent = (documentId, { signal, baseUrl = baseUrlOverride } = {}) => {
|
|
40
|
-
return
|
|
35
|
+
return requestDatalayer({
|
|
41
36
|
url: URLExt.join(configuration.aiagentsRunUrl, baseUrl, 'agents', documentId),
|
|
42
37
|
method: 'DELETE',
|
|
43
38
|
signal,
|
|
44
39
|
});
|
|
45
40
|
};
|
|
46
41
|
const getAIAgent = (documentId, { signal, baseUrl = baseUrlOverride } = {}) => {
|
|
47
|
-
return
|
|
42
|
+
return requestDatalayer({
|
|
48
43
|
url: URLExt.join(configuration.aiagentsRunUrl, baseUrl, 'agents', documentId),
|
|
49
44
|
method: 'GET',
|
|
50
45
|
signal,
|
|
51
46
|
});
|
|
52
47
|
};
|
|
53
48
|
const patchAIAgent = (documentId, ingress, token, kernelId, { signal, baseUrl = baseUrlOverride } = {}) => {
|
|
54
|
-
return
|
|
49
|
+
return requestDatalayer({
|
|
55
50
|
url: URLExt.join(configuration.aiagentsRunUrl, baseUrl, 'agents', documentId),
|
|
56
51
|
method: 'PATCH',
|
|
57
52
|
body: {
|
|
@@ -59,9 +54,9 @@ export const useAIAgents = (baseUrlOverride = 'api/ai-agents/v1') => {
|
|
|
59
54
|
? {
|
|
60
55
|
ingress,
|
|
61
56
|
token,
|
|
62
|
-
kernel_id: kernelId
|
|
57
|
+
kernel_id: kernelId,
|
|
63
58
|
}
|
|
64
|
-
: null
|
|
59
|
+
: null,
|
|
65
60
|
},
|
|
66
61
|
signal,
|
|
67
62
|
});
|
|
@@ -71,7 +66,7 @@ export const useAIAgents = (baseUrlOverride = 'api/ai-agents/v1') => {
|
|
|
71
66
|
getAIAgents,
|
|
72
67
|
deleteAIAgent,
|
|
73
68
|
getAIAgent,
|
|
74
|
-
patchAIAgent
|
|
69
|
+
patchAIAgent,
|
|
75
70
|
};
|
|
76
71
|
};
|
|
77
72
|
export default useAIAgents;
|
|
@@ -2,20 +2,15 @@
|
|
|
2
2
|
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* Datalayer License
|
|
9
|
-
*/
|
|
10
|
-
import { useLocation } from "react-router-dom";
|
|
11
|
-
import { PlatformRoles, OrganizationRoles, TeamRoles } from '../models';
|
|
12
|
-
import useNavigate from "./useNavigate";
|
|
5
|
+
import { useLocation } from './useLocation';
|
|
6
|
+
import { PlatformRoles, OrganizationRoles, TeamRoles, } from '../models';
|
|
7
|
+
import useNavigate from './useNavigate';
|
|
13
8
|
export const useAuthorization = () => {
|
|
14
9
|
const navigate = useNavigate();
|
|
15
10
|
const location = useLocation();
|
|
16
11
|
const goToApplicationStateError = (message) => {
|
|
17
12
|
console.warn(message);
|
|
18
|
-
console.log(
|
|
13
|
+
console.log('Application error while navigating to ', location);
|
|
19
14
|
console.trace();
|
|
20
15
|
navigate('/error/application/state');
|
|
21
16
|
};
|
|
@@ -86,7 +81,6 @@ export const useAuthorization = () => {
|
|
|
86
81
|
if (team.members[i].id === user.id) {
|
|
87
82
|
if (checkIsTeamOwer(team.members[i])) {
|
|
88
83
|
return true;
|
|
89
|
-
0;
|
|
90
84
|
}
|
|
91
85
|
}
|
|
92
86
|
}
|
package/lib/hooks/useBackdrop.js
CHANGED
|
@@ -3,14 +3,9 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
4
4
|
* Distributed under the terms of the Modified BSD License.
|
|
5
5
|
*/
|
|
6
|
-
/*
|
|
7
|
-
* Copyright (c) 2021-2024 Datalayer, Inc.
|
|
8
|
-
*
|
|
9
|
-
* Datalayer License
|
|
10
|
-
*/
|
|
11
6
|
import { createContext, useState, useContext } from 'react';
|
|
12
7
|
import PropTypes from 'prop-types';
|
|
13
|
-
import { LayoutBackdrop } from
|
|
8
|
+
import { LayoutBackdrop } from './layouts';
|
|
14
9
|
export const BackdropContext = createContext({
|
|
15
10
|
closeBackdrop: () => { },
|
|
16
11
|
displayBackdrop: (nextBackdrop) => { },
|
|
@@ -56,7 +51,7 @@ export default App
|
|
|
56
51
|
export function BackdropProvider(props) {
|
|
57
52
|
const { children, zIndex, disableDarken, backdropSurface } = props;
|
|
58
53
|
const defaultBackdropSurface = {
|
|
59
|
-
position:
|
|
54
|
+
position: 'fixed',
|
|
60
55
|
top: 0,
|
|
61
56
|
left: 0,
|
|
62
57
|
width: '100%',
|
|
@@ -69,18 +64,18 @@ export function BackdropProvider(props) {
|
|
|
69
64
|
};
|
|
70
65
|
const [backdrop, setBackdrop] = useState({
|
|
71
66
|
open: false,
|
|
72
|
-
render: (closeBackdrop) => _jsx(_Fragment, {})
|
|
67
|
+
render: (closeBackdrop) => _jsx(_Fragment, {}),
|
|
73
68
|
});
|
|
74
69
|
const displayBackdrop = (nextBackdrop) => {
|
|
75
70
|
setBackdrop({
|
|
76
71
|
open: true,
|
|
77
|
-
render: nextBackdrop
|
|
72
|
+
render: nextBackdrop,
|
|
78
73
|
});
|
|
79
74
|
};
|
|
80
75
|
const closeBackdrop = () => {
|
|
81
76
|
setBackdrop({
|
|
82
77
|
open: false,
|
|
83
|
-
render: (closeBackdrop) => _jsx(_Fragment, {})
|
|
78
|
+
render: (closeBackdrop) => _jsx(_Fragment, {}),
|
|
84
79
|
});
|
|
85
80
|
};
|
|
86
81
|
return (_jsxs(BackdropContextProvider, { value: { closeBackdrop, displayBackdrop }, children: [_jsx(LayoutBackdrop, {}), children, backdrop.open &&
|
|
@@ -95,11 +90,11 @@ BackdropProvider.propTypes = {
|
|
|
95
90
|
// A render function that returns a Component that overrides (takes the
|
|
96
91
|
// place of) the default darkened div background.
|
|
97
92
|
// See /example/src/ExampleApp.jsx for proper use.
|
|
98
|
-
backdropSurface: PropTypes.func
|
|
93
|
+
backdropSurface: PropTypes.func,
|
|
99
94
|
};
|
|
100
95
|
BackdropProvider.defaultProps = {
|
|
101
96
|
children: undefined,
|
|
102
97
|
disableBackdrop: false,
|
|
103
98
|
zIndex: 9999,
|
|
104
|
-
backdropSurface: null
|
|
99
|
+
backdropSurface: null,
|
|
105
100
|
};
|
|
@@ -10,6 +10,6 @@ type UseJupyterLabBackdropProps = {
|
|
|
10
10
|
openBackdrop: (element: JSX.Element) => void;
|
|
11
11
|
closeBackdrop: () => void;
|
|
12
12
|
};
|
|
13
|
-
declare const JupyterLabBackdropProvider: ({ children }: React.PropsWithChildren<JupyterLabBackdropProps>) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const JupyterLabBackdropProvider: ({ children, }: React.PropsWithChildren<JupyterLabBackdropProps>) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
declare function useJupyterLabBackdrop(): UseJupyterLabBackdropProps;
|
|
15
15
|
export { useJupyterLabBackdrop, JupyterLabBackdropProvider };
|
|
@@ -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 { createContext, useState, useContext } from 'react';
|
|
12
7
|
import styled from 'styled-components';
|
|
13
8
|
const JupyterLabBackdropComponent = styled.div `
|
|
@@ -23,7 +18,7 @@ const JupyterLabBackdropComponent = styled.div `
|
|
|
23
18
|
z-index: 1000000000;
|
|
24
19
|
`;
|
|
25
20
|
function JupyterLabBackdrop({ open, element }) {
|
|
26
|
-
return open ? _jsx(JupyterLabBackdropComponent, { children: element }) : _jsx(_Fragment, {});
|
|
21
|
+
return open ? (_jsx(JupyterLabBackdropComponent, { children: element })) : (_jsx(_Fragment, {}));
|
|
27
22
|
}
|
|
28
23
|
export default JupyterLabBackdrop;
|
|
29
24
|
const JupyterLabBackdropContext = createContext({
|
|
@@ -32,9 +27,9 @@ const JupyterLabBackdropContext = createContext({
|
|
|
32
27
|
},
|
|
33
28
|
closeBackdrop: () => {
|
|
34
29
|
/* no-op */
|
|
35
|
-
}
|
|
30
|
+
},
|
|
36
31
|
});
|
|
37
|
-
const JupyterLabBackdropProvider = ({ children }) => {
|
|
32
|
+
const JupyterLabBackdropProvider = ({ children, }) => {
|
|
38
33
|
const [opened, setOpened] = useState(false);
|
|
39
34
|
const [element, setElement] = useState();
|
|
40
35
|
const openBackdrop = (element) => {
|
|
@@ -47,7 +42,7 @@ const JupyterLabBackdropProvider = ({ children }) => {
|
|
|
47
42
|
};
|
|
48
43
|
return (_jsxs(JupyterLabBackdropContext.Provider, { value: {
|
|
49
44
|
openBackdrop: openBackdrop,
|
|
50
|
-
closeBackdrop: closeBackdrop
|
|
45
|
+
closeBackdrop: closeBackdrop,
|
|
51
46
|
}, children: [_jsx(JupyterLabBackdrop, { open: opened, element: element }), children] }));
|
|
52
47
|
};
|
|
53
48
|
function useJupyterLabBackdrop() {
|
package/lib/hooks/useCache.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IAnyOrganization, IAnySpace, IAssignment, ICell, IContact, ICourse, IDataset, IDatasource, IDocument, IEnvironment, IExercise, IIAMToken, IInbound, IInvite, IItemType, ILesson, ILinkedInUser, INotebook, IOrganization, IOutbound, IPage, ISchool, ISecret, ISpaceItem, IStudent, ITeam, IUsage, IUser, IUserOnboarding, IUserSettings, LinkedInUser, WaitingListFormData } from
|
|
2
|
-
import { IPrice } from
|
|
1
|
+
import { IAnyOrganization, IAnySpace, IAssignment, ICell, IContact, ICourse, IDataset, IDatasource, IDocument, IEnvironment, IExercise, IIAMToken, IInbound, IInvite, IItemType, ILesson, ILinkedInUser, INotebook, IOrganization, IOutbound, IPage, ISchool, ISecret, ISpaceItem, IStudent, ITeam, IUsage, IUser, IUserOnboarding, IUserSettings, LinkedInUser, WaitingListFormData } from '../models';
|
|
2
|
+
import { IPrice } from './../components/checkout';
|
|
3
3
|
import { type IRESTBaseResponse } from '../models';
|
|
4
4
|
type CacheProps = {
|
|
5
5
|
loginRoute?: string;
|
|
@@ -43,6 +43,7 @@ export declare const useCache: ({ loginRoute }?: CacheProps) => {
|
|
|
43
43
|
cloneExercise: (exerciseId: string) => Promise<any>;
|
|
44
44
|
cloneLesson: (lessonId: string) => Promise<any>;
|
|
45
45
|
cloneNotebook: (notebookId: string) => Promise<any>;
|
|
46
|
+
createNotebook: (spaceId: string, name: string, description?: string, notebookType?: string) => Promise<any>;
|
|
46
47
|
confirmCourseItemCompletion: (courseId: any, itemType: IItemType, itemId: string, completed: boolean) => Promise<any>;
|
|
47
48
|
confirmEmailUpdate: (token: any) => Promise<any>;
|
|
48
49
|
confirmJoinWithToken: (userHandle: any, token: any) => Promise<any>;
|
|
@@ -173,8 +174,8 @@ export declare const useCache: ({ loginRoute }?: CacheProps) => {
|
|
|
173
174
|
postLinkedinShare: (linkedinUser: ILinkedInUser, postText: string, accessToken: string) => Promise<any>;
|
|
174
175
|
postLinkedinShareWithUpload: (linkedinUser: ILinkedInUser, postText: string, uploadObject: string, accessToken: string) => Promise<any>;
|
|
175
176
|
proxyGET: (url: string, token: string) => Promise<any>;
|
|
176
|
-
proxyPOST: (url: string, body:
|
|
177
|
-
proxyPUT: (url: string, body:
|
|
177
|
+
proxyPOST: (url: string, body: object, token: string) => Promise<any>;
|
|
178
|
+
proxyPUT: (url: string, body: object, token: string) => Promise<any>;
|
|
178
179
|
putInvite: (token: string) => Promise<any>;
|
|
179
180
|
refreshAccount: (accountHandle: string) => Promise<any>;
|
|
180
181
|
refreshAssignment: (assignmentId: string) => Promise<any>;
|
|
@@ -302,5 +303,8 @@ export declare const useCache: ({ loginRoute }?: CacheProps) => {
|
|
|
302
303
|
updateUserSettings: (userId: string, settings: IUserSettings) => Promise<any>;
|
|
303
304
|
validateUserMFACode: (userUid: any, code: string) => Promise<any>;
|
|
304
305
|
whoami: () => Promise<any>;
|
|
306
|
+
notebookUploadLoading: boolean;
|
|
307
|
+
notebookUploadProgress: number;
|
|
308
|
+
resetNotebookUpload: () => void;
|
|
305
309
|
};
|
|
306
310
|
export default useCache;
|