@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
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Registry of available examples with dynamic imports.
|
|
7
|
+
* Add new examples here to make them available in the example runner.
|
|
8
|
+
*/
|
|
9
|
+
export const EXAMPLES = {
|
|
10
|
+
CellExample: () => import('./CellExample'),
|
|
11
|
+
DatalayerNotebookExample: () => import('./DatalayerNotebookExample'),
|
|
12
|
+
NotebookExample: () => import('./NotebookExample'),
|
|
13
|
+
NotebookMutationsKernel: () => import('./NotebookMutationsKernel'),
|
|
14
|
+
NotebookMutationsServiceManager: () => import('./NotebookMutationsServiceManager'),
|
|
15
|
+
ReactRouterExample: () => import('./ReactRouterExample'),
|
|
16
|
+
NativeNavigationExample: () => import('./NativeNavigationExample'),
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Get the list of available example names
|
|
20
|
+
*/
|
|
21
|
+
export function getExampleNames() {
|
|
22
|
+
return Object.keys(EXAMPLES);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the selected example based on environment variable
|
|
26
|
+
* Falls back to 'NotebookExample' if not specified or invalid
|
|
27
|
+
*/
|
|
28
|
+
export function getSelectedExample() {
|
|
29
|
+
// import.meta.env.EXAMPLE is defined in vite config
|
|
30
|
+
const exampleName = import.meta.env.EXAMPLE || 'NotebookExample';
|
|
31
|
+
if (!EXAMPLES[exampleName]) {
|
|
32
|
+
console.warn(`Example "${exampleName}" not found. Available examples:`, getExampleNames());
|
|
33
|
+
console.log('Falling back to NotebookExample');
|
|
34
|
+
return EXAMPLES['NotebookExample'];
|
|
35
|
+
}
|
|
36
|
+
return EXAMPLES[exampleName];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get the selected example name
|
|
40
|
+
*/
|
|
41
|
+
export function getSelectedExampleName() {
|
|
42
|
+
// import.meta.env.EXAMPLE is defined in vite config
|
|
43
|
+
const exampleName = import.meta.env.EXAMPLE || 'NotebookExample';
|
|
44
|
+
return EXAMPLES[exampleName] ? exampleName : 'NotebookExample';
|
|
45
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
4
|
+
* Distributed under the terms of the Modified BSD License.
|
|
5
|
+
*/
|
|
6
|
+
import { useEffect, useState } from 'react';
|
|
7
|
+
import { createRoot } from 'react-dom/client';
|
|
8
|
+
import { loadJupyterConfig, JupyterReactTheme, createServerSettings, setJupyterServerUrl, setJupyterServerToken, getJupyterServerUrl, getJupyterServerToken, } from '@datalayer/jupyter-react';
|
|
9
|
+
import { ServiceManager } from '@jupyterlab/services';
|
|
10
|
+
import { coreStore } from '../state/substates/CoreState';
|
|
11
|
+
import { iamStore } from '../state';
|
|
12
|
+
import { getSelectedExample, getSelectedExampleName } from './example-selector';
|
|
13
|
+
import { createDatalayerServiceManager } from '../services/DatalayerServiceManager';
|
|
14
|
+
// Load configurations from DOM
|
|
15
|
+
const loadConfigurations = () => {
|
|
16
|
+
// Load Datalayer configuration
|
|
17
|
+
const datalayerConfigElement = document.getElementById('datalayer-config-data');
|
|
18
|
+
if (datalayerConfigElement?.textContent) {
|
|
19
|
+
try {
|
|
20
|
+
const datalayerConfig = JSON.parse(datalayerConfigElement.textContent);
|
|
21
|
+
if (datalayerConfig.runUrl) {
|
|
22
|
+
console.log('Setting Datalayer config:', datalayerConfig);
|
|
23
|
+
coreStore.getState().setConfiguration(datalayerConfig);
|
|
24
|
+
// Also set the token in the IAM store for API authentication
|
|
25
|
+
if (datalayerConfig.token) {
|
|
26
|
+
// Use the setLogin method to set the token in IAM store
|
|
27
|
+
// For now, we'll just set a minimal user object since we don't have full user data
|
|
28
|
+
iamStore.getState().setLogin({
|
|
29
|
+
id: 'example-id',
|
|
30
|
+
handle: 'example-user',
|
|
31
|
+
email: 'example@datalayer.com',
|
|
32
|
+
firstName: 'Example',
|
|
33
|
+
lastName: 'User',
|
|
34
|
+
initials: 'EU',
|
|
35
|
+
displayName: 'Example User',
|
|
36
|
+
avatarUrl: '',
|
|
37
|
+
roles: [],
|
|
38
|
+
setRoles: () => { },
|
|
39
|
+
iamProviders: [],
|
|
40
|
+
settings: {},
|
|
41
|
+
unsubscribedFromOutbounds: false,
|
|
42
|
+
onboarding: {},
|
|
43
|
+
events: [],
|
|
44
|
+
}, datalayerConfig.token);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
console.error('Failed to parse Datalayer config:', e);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// Load Jupyter configuration
|
|
53
|
+
loadJupyterConfig();
|
|
54
|
+
// Also set Jupyter server URL and token if available in jupyter-config-data
|
|
55
|
+
const jupyterConfigElement = document.getElementById('jupyter-config-data');
|
|
56
|
+
if (jupyterConfigElement?.textContent) {
|
|
57
|
+
try {
|
|
58
|
+
const jupyterConfig = JSON.parse(jupyterConfigElement.textContent);
|
|
59
|
+
if (jupyterConfig.baseUrl) {
|
|
60
|
+
setJupyterServerUrl(jupyterConfig.baseUrl);
|
|
61
|
+
}
|
|
62
|
+
if (jupyterConfig.token) {
|
|
63
|
+
setJupyterServerToken(jupyterConfig.token);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
catch (e) {
|
|
67
|
+
console.error('Failed to parse Jupyter config:', e);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
// Main App component that loads and renders the selected example
|
|
72
|
+
const ExampleApp = () => {
|
|
73
|
+
const [ExampleComponent, setExampleComponent] = useState(null);
|
|
74
|
+
const [loading, setLoading] = useState(true);
|
|
75
|
+
const [error, setError] = useState(null);
|
|
76
|
+
const [serviceManager, setServiceManager] = useState(null);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
// Load configurations
|
|
79
|
+
loadConfigurations();
|
|
80
|
+
// Create service manager
|
|
81
|
+
const createManager = async () => {
|
|
82
|
+
const { configuration } = coreStore.getState();
|
|
83
|
+
// Try to use DatalayerServiceManager if we have a token
|
|
84
|
+
if (configuration?.token) {
|
|
85
|
+
console.log('Using DatalayerServiceManager with token');
|
|
86
|
+
try {
|
|
87
|
+
const manager = await createDatalayerServiceManager(configuration.cpuEnvironment || 'python-3.11', configuration.credits || 100);
|
|
88
|
+
await manager.ready;
|
|
89
|
+
console.log('DatalayerServiceManager is ready');
|
|
90
|
+
setServiceManager(manager);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
console.error('Failed to create DatalayerServiceManager:', error);
|
|
95
|
+
console.log('Falling back to regular ServiceManager');
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Fall back to regular ServiceManager
|
|
99
|
+
console.log('Using regular ServiceManager (no Datalayer token)');
|
|
100
|
+
const serverSettings = createServerSettings(getJupyterServerUrl(), getJupyterServerToken());
|
|
101
|
+
const manager = new ServiceManager({ serverSettings });
|
|
102
|
+
await manager.ready;
|
|
103
|
+
console.log('Regular ServiceManager is ready');
|
|
104
|
+
setServiceManager(manager);
|
|
105
|
+
};
|
|
106
|
+
createManager();
|
|
107
|
+
// Load the selected example
|
|
108
|
+
const loadExample = async () => {
|
|
109
|
+
try {
|
|
110
|
+
const exampleLoader = getSelectedExample();
|
|
111
|
+
const module = await exampleLoader();
|
|
112
|
+
setExampleComponent(() => module.default);
|
|
113
|
+
setLoading(false);
|
|
114
|
+
}
|
|
115
|
+
catch (e) {
|
|
116
|
+
console.error('Failed to load example:', e);
|
|
117
|
+
setError(`Failed to load example: ${e}`);
|
|
118
|
+
setLoading(false);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
loadExample();
|
|
122
|
+
}, []);
|
|
123
|
+
if (loading) {
|
|
124
|
+
return (_jsxs("div", { style: { padding: '20px', textAlign: 'center' }, children: [_jsxs("h2", { children: ["Loading Example: ", getSelectedExampleName()] }), _jsx("p", { children: "Please wait..." })] }));
|
|
125
|
+
}
|
|
126
|
+
if (error) {
|
|
127
|
+
return (_jsxs("div", { style: { padding: '20px', color: 'red' }, children: [_jsx("h2", { children: "Error Loading Example" }), _jsx("pre", { children: error })] }));
|
|
128
|
+
}
|
|
129
|
+
if (!ExampleComponent) {
|
|
130
|
+
return (_jsxs("div", { style: { padding: '20px' }, children: [_jsx("h2", { children: "Example Not Found" }), _jsx("p", { children: "The selected example could not be loaded." })] }));
|
|
131
|
+
}
|
|
132
|
+
// Check if the example component expects props
|
|
133
|
+
// Most examples will need serviceManager
|
|
134
|
+
const exampleProps = {};
|
|
135
|
+
if (serviceManager) {
|
|
136
|
+
exampleProps.serviceManager = serviceManager;
|
|
137
|
+
}
|
|
138
|
+
return (_jsx(JupyterReactTheme, { children: _jsxs("div", { style: { width: '100vw', height: '100vh', overflow: 'hidden' }, children: [_jsxs("div", { style: {
|
|
139
|
+
padding: '10px',
|
|
140
|
+
background: '#f0f0f0',
|
|
141
|
+
borderBottom: '1px solid #ccc',
|
|
142
|
+
fontSize: '14px',
|
|
143
|
+
fontFamily: 'monospace',
|
|
144
|
+
}, children: ["Running Example: ", _jsx("strong", { children: getSelectedExampleName() })] }), _jsx("div", { style: { height: 'calc(100vh - 40px)', overflow: 'auto' }, children: _jsx(ExampleComponent, { ...exampleProps }) })] }) }));
|
|
145
|
+
};
|
|
146
|
+
// Mount the app
|
|
147
|
+
const root = document.getElementById('root');
|
|
148
|
+
if (root) {
|
|
149
|
+
createRoot(root).render(_jsx(ExampleApp, {}));
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
console.error('Root element not found');
|
|
153
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "code",
|
|
5
|
+
"execution_count": 1,
|
|
6
|
+
"id": "3a86eccf-352d-480d-b1b0-4cf355921be9",
|
|
7
|
+
"metadata": {},
|
|
8
|
+
"outputs": [
|
|
9
|
+
{
|
|
10
|
+
"data": {
|
|
11
|
+
"application/vnd.jupyter.widget-view+json": {
|
|
12
|
+
"model_id": "c686864a5ad44793b53c9cf1b112fafe",
|
|
13
|
+
"version_major": 2,
|
|
14
|
+
"version_minor": 0
|
|
15
|
+
},
|
|
16
|
+
"text/plain": []
|
|
17
|
+
},
|
|
18
|
+
"metadata": {},
|
|
19
|
+
"output_type": "display_data"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"source": ["import ipywidgets as widgets\n", "widgets.IntSlider()"]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"cell_type": "code",
|
|
26
|
+
"execution_count": 8,
|
|
27
|
+
"id": "f347e0ac-7614-4643-8fed-e6b5dfb67bcd",
|
|
28
|
+
"metadata": {},
|
|
29
|
+
"outputs": [
|
|
30
|
+
{
|
|
31
|
+
"data": {
|
|
32
|
+
"application/vnd.jupyter.widget-view+json": {
|
|
33
|
+
"model_id": "e361a274319a4715ae5cfc8104c87224",
|
|
34
|
+
"version_major": 2,
|
|
35
|
+
"version_minor": 0
|
|
36
|
+
},
|
|
37
|
+
"text/plain": ["FloatText(value=0.0)"]
|
|
38
|
+
},
|
|
39
|
+
"metadata": {},
|
|
40
|
+
"output_type": "display_data"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"data": {
|
|
44
|
+
"application/vnd.jupyter.widget-view+json": {
|
|
45
|
+
"model_id": "859ac1871f56461fa8f2c97e6e18c4c4",
|
|
46
|
+
"version_major": 2,
|
|
47
|
+
"version_minor": 0
|
|
48
|
+
},
|
|
49
|
+
"text/plain": ["FloatSlider(value=0.0)"]
|
|
50
|
+
},
|
|
51
|
+
"metadata": {},
|
|
52
|
+
"output_type": "display_data"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"source": [
|
|
56
|
+
"from IPython.display import display\n",
|
|
57
|
+
"a = widgets.FloatText()\n",
|
|
58
|
+
"b = widgets.FloatSlider()\n",
|
|
59
|
+
"display(a,b)\n",
|
|
60
|
+
"mylink = widgets.jslink((a, 'value'), (b, 'value'))"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"cell_type": "code",
|
|
65
|
+
"execution_count": 7,
|
|
66
|
+
"id": "07f52271-ccae-476d-83b9-715c96168c7c",
|
|
67
|
+
"metadata": {},
|
|
68
|
+
"outputs": [],
|
|
69
|
+
"source": ["mylink.unlink()"]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"cell_type": "code",
|
|
73
|
+
"execution_count": null,
|
|
74
|
+
"id": "81b15288-063d-412d-99db-c73453e18565",
|
|
75
|
+
"metadata": {},
|
|
76
|
+
"outputs": [],
|
|
77
|
+
"source": []
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"metadata": {
|
|
81
|
+
"kernelspec": {
|
|
82
|
+
"display_name": "Python 3 (ipykernel)",
|
|
83
|
+
"language": "python",
|
|
84
|
+
"name": "python3"
|
|
85
|
+
},
|
|
86
|
+
"language_info": {
|
|
87
|
+
"codemirror_mode": {
|
|
88
|
+
"name": "ipython",
|
|
89
|
+
"version": 3
|
|
90
|
+
},
|
|
91
|
+
"file_extension": ".py",
|
|
92
|
+
"mimetype": "text/x-python",
|
|
93
|
+
"name": "python",
|
|
94
|
+
"nbconvert_exporter": "python",
|
|
95
|
+
"pygments_lexer": "ipython3",
|
|
96
|
+
"version": "3.11.4"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"nbformat": 4,
|
|
100
|
+
"nbformat_minor": 5
|
|
101
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "code",
|
|
5
|
+
"execution_count": 1,
|
|
6
|
+
"id": "58fc6682",
|
|
7
|
+
"metadata": {},
|
|
8
|
+
"outputs": [
|
|
9
|
+
{
|
|
10
|
+
"data": {
|
|
11
|
+
"application/vnd.jupyter.widget-view+json": {
|
|
12
|
+
"model_id": "68c218b87d4d43589628d4f23e112319",
|
|
13
|
+
"version_major": 2,
|
|
14
|
+
"version_minor": 0
|
|
15
|
+
},
|
|
16
|
+
"text/plain": ["IntSlider(value=0)"]
|
|
17
|
+
},
|
|
18
|
+
"execution_count": 1,
|
|
19
|
+
"metadata": {},
|
|
20
|
+
"output_type": "execute_result"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"source": ["import ipywidgets\n", "ipywidgets.IntSlider()"]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"cell_type": "code",
|
|
27
|
+
"execution_count": null,
|
|
28
|
+
"id": "5af4e4a9",
|
|
29
|
+
"metadata": {},
|
|
30
|
+
"outputs": [],
|
|
31
|
+
"source": []
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"metadata": {
|
|
35
|
+
"kernelspec": {
|
|
36
|
+
"display_name": "Python 3 (ipykernel)",
|
|
37
|
+
"language": "python",
|
|
38
|
+
"name": "python3"
|
|
39
|
+
},
|
|
40
|
+
"language_info": {
|
|
41
|
+
"codemirror_mode": {
|
|
42
|
+
"name": "ipython",
|
|
43
|
+
"version": 3
|
|
44
|
+
},
|
|
45
|
+
"file_extension": ".py",
|
|
46
|
+
"mimetype": "text/x-python",
|
|
47
|
+
"name": "python",
|
|
48
|
+
"nbconvert_exporter": "python",
|
|
49
|
+
"pygments_lexer": "ipython3",
|
|
50
|
+
"version": "3.10.13"
|
|
51
|
+
},
|
|
52
|
+
"widgets": {
|
|
53
|
+
"application/vnd.jupyter.widget-state+json": {
|
|
54
|
+
"state": {
|
|
55
|
+
"1a916ae14b904353bc5f2db9714a8f2b": {
|
|
56
|
+
"model_module": "@jupyter-widgets/base",
|
|
57
|
+
"model_module_version": "2.0.0",
|
|
58
|
+
"model_name": "LayoutModel",
|
|
59
|
+
"state": {}
|
|
60
|
+
},
|
|
61
|
+
"32c74c0d7a7a4bbe84039bb47cc032d6": {
|
|
62
|
+
"model_module": "@jupyter-widgets/controls",
|
|
63
|
+
"model_module_version": "2.0.0",
|
|
64
|
+
"model_name": "IntSliderModel",
|
|
65
|
+
"state": {
|
|
66
|
+
"behavior": "drag-tap",
|
|
67
|
+
"layout": "IPY_MODEL_6753cb5249ae4429b1d0aaf7af2ef7c1",
|
|
68
|
+
"style": "IPY_MODEL_f18c172d32f54e0b810ff0725b827fdf",
|
|
69
|
+
"value": 33
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"39beda15640c4c3fa82a284dc7df1235": {
|
|
73
|
+
"model_module": "@jupyter-widgets/controls",
|
|
74
|
+
"model_module_version": "2.0.0",
|
|
75
|
+
"model_name": "SliderStyleModel",
|
|
76
|
+
"state": {
|
|
77
|
+
"description_width": ""
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"6753cb5249ae4429b1d0aaf7af2ef7c1": {
|
|
81
|
+
"model_module": "@jupyter-widgets/base",
|
|
82
|
+
"model_module_version": "2.0.0",
|
|
83
|
+
"model_name": "LayoutModel",
|
|
84
|
+
"state": {}
|
|
85
|
+
},
|
|
86
|
+
"68c218b87d4d43589628d4f23e112319": {
|
|
87
|
+
"model_module": "@jupyter-widgets/controls",
|
|
88
|
+
"model_module_version": "2.0.0",
|
|
89
|
+
"model_name": "IntSliderModel",
|
|
90
|
+
"state": {
|
|
91
|
+
"behavior": "drag-tap",
|
|
92
|
+
"layout": "IPY_MODEL_1a916ae14b904353bc5f2db9714a8f2b",
|
|
93
|
+
"style": "IPY_MODEL_39beda15640c4c3fa82a284dc7df1235"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"f18c172d32f54e0b810ff0725b827fdf": {
|
|
97
|
+
"model_module": "@jupyter-widgets/controls",
|
|
98
|
+
"model_module_version": "2.0.0",
|
|
99
|
+
"model_name": "SliderStyleModel",
|
|
100
|
+
"state": {
|
|
101
|
+
"description_width": ""
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"version_major": 2,
|
|
106
|
+
"version_minor": 0
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"nbformat": 4,
|
|
111
|
+
"nbformat_minor": 5
|
|
112
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "code",
|
|
5
|
+
"execution_count": 1,
|
|
6
|
+
"metadata": {},
|
|
7
|
+
"outputs": [
|
|
8
|
+
{
|
|
9
|
+
"data": {
|
|
10
|
+
"text/plain": ["'Emscripten'"]
|
|
11
|
+
},
|
|
12
|
+
"execution_count": 1,
|
|
13
|
+
"metadata": {},
|
|
14
|
+
"output_type": "execute_result"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"source": ["import platform\n", "platform.system()"]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"cell_type": "code",
|
|
21
|
+
"execution_count": 1,
|
|
22
|
+
"metadata": {},
|
|
23
|
+
"outputs": [
|
|
24
|
+
{
|
|
25
|
+
"data": {
|
|
26
|
+
"text/plain": ["emscripten"]
|
|
27
|
+
},
|
|
28
|
+
"execution_count": 1,
|
|
29
|
+
"metadata": {},
|
|
30
|
+
"output_type": "execute_result"
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"source": ["import sys\n", "sys.platform"]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"cell_type": "code",
|
|
37
|
+
"execution_count": 1,
|
|
38
|
+
"metadata": {},
|
|
39
|
+
"outputs": [
|
|
40
|
+
{
|
|
41
|
+
"data": {
|
|
42
|
+
"text/plain": [
|
|
43
|
+
"<pyodide_kernel.interpreter.Interpreter at 0x22906f0>"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"execution_count": 1,
|
|
47
|
+
"metadata": {},
|
|
48
|
+
"output_type": "execute_result"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"source": ["get_ipython()"]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"cell_type": "code",
|
|
55
|
+
"execution_count": 1,
|
|
56
|
+
"metadata": {},
|
|
57
|
+
"outputs": [
|
|
58
|
+
{
|
|
59
|
+
"data": {
|
|
60
|
+
"text/plain": ["4"]
|
|
61
|
+
},
|
|
62
|
+
"execution_count": 1,
|
|
63
|
+
"metadata": {},
|
|
64
|
+
"output_type": "execute_result"
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"source": ["# I am a Python cell.\n", "print('2+2')"]
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"cell_type": "code",
|
|
71
|
+
"execution_count": 1,
|
|
72
|
+
"metadata": {},
|
|
73
|
+
"outputs": [
|
|
74
|
+
{
|
|
75
|
+
"data": {
|
|
76
|
+
"text/plain": []
|
|
77
|
+
},
|
|
78
|
+
"execution_count": 1,
|
|
79
|
+
"metadata": {},
|
|
80
|
+
"output_type": "execute_result"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"source": ["import micropip\n", "await micropip.install('ipywidgets')"]
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"cell_type": "code",
|
|
87
|
+
"execution_count": 1,
|
|
88
|
+
"metadata": {},
|
|
89
|
+
"outputs": [
|
|
90
|
+
{
|
|
91
|
+
"data": {
|
|
92
|
+
"text/plain": []
|
|
93
|
+
},
|
|
94
|
+
"execution_count": 1,
|
|
95
|
+
"metadata": {},
|
|
96
|
+
"output_type": "execute_result"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"source": ["from ipywidgets import IntSlider\n", "w = IntSlider()\n", "w"]
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"cell_type": "code",
|
|
103
|
+
"execution_count": 1,
|
|
104
|
+
"metadata": {},
|
|
105
|
+
"outputs": [
|
|
106
|
+
{
|
|
107
|
+
"data": {
|
|
108
|
+
"text/plain": []
|
|
109
|
+
},
|
|
110
|
+
"execution_count": 1,
|
|
111
|
+
"metadata": {},
|
|
112
|
+
"output_type": "execute_result"
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"source": ["w"]
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"cell_type": "code",
|
|
119
|
+
"execution_count": null,
|
|
120
|
+
"metadata": {},
|
|
121
|
+
"outputs": [],
|
|
122
|
+
"source": []
|
|
123
|
+
}
|
|
124
|
+
],
|
|
125
|
+
"metadata": {},
|
|
126
|
+
"nbformat": 4,
|
|
127
|
+
"nbformat_minor": 4
|
|
128
|
+
}
|