@datalayer/core 1.1.60 → 1.2.10
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 +41 -18
- package/lib/api/DatalayerApi.d.ts +42 -1
- package/lib/api/DatalayerApi.js +90 -3
- package/lib/api/constants.d.ts +19 -1
- package/lib/api/constants.js +19 -1
- package/lib/api/contents/attachments.d.ts +9 -0
- package/lib/api/contents/attachments.js +39 -0
- package/lib/api/contents/bridges.d.ts +22 -0
- package/lib/api/contents/bridges.js +79 -0
- package/lib/api/contents/capabilities.d.ts +11 -0
- package/lib/api/contents/capabilities.js +21 -0
- package/lib/api/contents/cloudStorage.d.ts +31 -0
- package/lib/api/contents/cloudStorage.js +89 -0
- package/lib/api/contents/dataservers.d.ts +37 -0
- package/lib/api/contents/dataservers.js +121 -0
- package/lib/api/contents/datasets.d.ts +63 -0
- package/lib/api/contents/datasets.js +82 -0
- package/lib/api/contents/datasources.d.ts +70 -0
- package/lib/api/contents/datasources.js +149 -0
- package/lib/api/contents/generated.d.ts +1070 -0
- package/lib/api/contents/index.d.ts +16 -0
- package/lib/api/contents/index.js +20 -0
- package/lib/api/contents/mcp.d.ts +46 -0
- package/lib/api/contents/mcp.js +157 -0
- package/lib/api/contents/objects.d.ts +31 -0
- package/lib/api/contents/objects.js +88 -0
- package/lib/api/contents/operations.d.ts +3 -0
- package/lib/api/contents/operations.js +19 -0
- package/lib/api/contents/runtimeMounts.d.ts +40 -0
- package/lib/api/contents/runtimeMounts.js +59 -0
- package/lib/api/contents/sandboxUid.d.ts +21 -0
- package/lib/api/contents/sandboxUid.js +27 -0
- package/lib/api/contents/sources.d.ts +19 -0
- package/lib/api/contents/sources.js +119 -0
- package/lib/api/contents/sync.d.ts +18 -0
- package/lib/api/contents/sync.js +69 -0
- package/lib/api/contents/transfers.d.ts +38 -0
- package/lib/api/contents/transfers.js +123 -0
- package/lib/api/evals/client.d.ts +402 -0
- package/lib/api/evals/client.js +359 -0
- package/lib/api/evals/index.d.ts +10 -0
- package/lib/api/evals/index.js +18 -0
- package/lib/api/evals/request.d.ts +43 -0
- package/lib/api/evals/request.js +67 -0
- package/lib/api/evals/status.d.ts +27 -0
- package/lib/api/evals/status.js +122 -0
- package/lib/api/evals/types.d.ts +1335 -0
- package/lib/api/evals/types.js +5 -0
- package/lib/api/iam/connectedAgents.d.ts +68 -0
- package/lib/api/iam/connectedAgents.js +87 -0
- package/lib/api/iam/identityProviders.d.ts +76 -0
- package/lib/api/iam/identityProviders.js +187 -0
- package/lib/api/iam/index.d.ts +3 -1
- package/lib/api/iam/index.js +3 -1
- package/lib/api/iam/mcpAlertRules.d.ts +51 -0
- package/lib/api/iam/mcpAlertRules.js +198 -0
- package/lib/api/iam/mcpAuditSettings.d.ts +46 -0
- package/lib/api/iam/mcpAuditSettings.js +120 -0
- package/lib/api/iam/mcpPolicy.d.ts +181 -0
- package/lib/api/iam/mcpPolicy.js +168 -0
- package/lib/api/iam/organizationTeams.d.ts +13 -0
- package/lib/api/iam/organizationTeams.js +43 -0
- package/lib/api/iam/profile.d.ts +17 -1
- package/lib/api/iam/profile.js +27 -0
- package/lib/api/iam/scimTokens.d.ts +79 -0
- package/lib/api/iam/scimTokens.js +141 -0
- package/lib/api/iam/secrets.js +9 -21
- package/lib/api/iam/serviceAgents.d.ts +68 -0
- package/lib/api/iam/serviceAgents.js +119 -0
- package/lib/api/iam/trials.d.ts +38 -0
- package/lib/api/iam/trials.js +66 -0
- package/lib/api/index.d.ts +8 -1
- package/lib/api/index.js +7 -1
- package/lib/api/mcp/activity.d.ts +37 -0
- package/lib/api/mcp/activity.js +26 -0
- package/lib/api/mcp/alerts.d.ts +25 -0
- package/lib/api/mcp/alerts.js +51 -0
- package/lib/api/mcp/audit.d.ts +29 -0
- package/lib/api/mcp/audit.js +55 -0
- package/lib/api/mcp/bindings.d.ts +18 -0
- package/lib/api/mcp/bindings.js +42 -0
- package/lib/api/mcp/forwarding.d.ts +25 -0
- package/lib/api/mcp/forwarding.js +46 -0
- package/lib/api/mcp/gateway.d.ts +16 -0
- package/lib/api/mcp/gateway.js +70 -0
- package/lib/api/mcp/generated.d.ts +22 -0
- package/lib/api/mcp/generated.js +213 -0
- package/lib/api/mcp/index.d.ts +17 -0
- package/lib/api/mcp/index.js +25 -0
- package/lib/api/mcp/observability.d.ts +141 -0
- package/lib/api/mcp/observability.js +267 -0
- package/lib/api/mcp/operations.d.ts +83 -0
- package/lib/api/mcp/operations.js +50 -0
- package/lib/api/mcp/organizations.d.ts +102 -0
- package/lib/api/mcp/organizations.js +46 -0
- package/lib/api/mcp/policy.d.ts +9 -0
- package/lib/api/mcp/policy.js +23 -0
- package/lib/api/mcp/tasks.d.ts +49 -0
- package/lib/api/mcp/tasks.js +147 -0
- package/lib/api/orchestration/client.d.ts +53 -0
- package/lib/api/orchestration/client.js +105 -0
- package/lib/api/orchestration/events.d.ts +88 -0
- package/lib/api/orchestration/events.js +245 -0
- package/lib/api/orchestration/generated.d.ts +693 -0
- package/lib/api/orchestration/generated.js +687 -0
- package/lib/api/orchestration/index.d.ts +30 -0
- package/lib/api/orchestration/index.js +34 -0
- package/lib/api/orchestration/lifecycle.d.ts +39 -0
- package/lib/api/orchestration/lifecycle.js +57 -0
- package/lib/api/orchestration/measures.d.ts +55 -0
- package/lib/api/orchestration/measures.js +99 -0
- package/lib/api/otel/dashboards.d.ts +56 -0
- package/lib/api/otel/dashboards.js +50 -0
- package/lib/api/otel/index.d.ts +1 -0
- package/lib/api/otel/index.js +1 -0
- package/lib/api/otel/metrics.d.ts +16 -0
- package/lib/api/otel/metrics.js +15 -0
- package/lib/api/scheduler/client.d.ts +32 -0
- package/lib/api/scheduler/client.js +42 -0
- package/lib/api/scheduler/index.d.ts +8 -0
- package/lib/api/scheduler/index.js +16 -0
- package/lib/api/scheduler/request.d.ts +28 -0
- package/lib/api/scheduler/request.js +50 -0
- package/lib/api/scheduler/types.d.ts +88 -0
- package/lib/api/scheduler/types.js +5 -0
- package/lib/api/spacer/comments.d.ts +97 -0
- package/lib/api/spacer/comments.js +45 -0
- package/lib/api/spacer/index.d.ts +9 -0
- package/lib/api/spacer/index.js +17 -0
- package/lib/api/spacer/notebooks.d.ts +33 -0
- package/lib/api/spacer/notebooks.js +39 -0
- package/lib/api/spacer/request.d.ts +25 -0
- package/lib/api/spacer/request.js +46 -0
- package/lib/api/spacer/spaces.d.ts +68 -0
- package/lib/api/spacer/spaces.js +45 -0
- package/lib/api/utils/validation.d.ts +4 -4
- package/lib/api/utils/validation.js +10 -7
- package/lib/client/auth/index.js +0 -5
- package/lib/client/auth/storage.js +0 -5
- package/lib/client/auth/strategies.js +0 -5
- package/lib/client/base.d.ts +6 -0
- package/lib/client/base.js +8 -0
- package/lib/client/constants.d.ts +1 -0
- package/lib/client/constants.js +1 -0
- package/lib/client/index.d.ts +0 -10
- package/lib/client/index.js +2 -2
- package/lib/client/mixins/ContentsMixin.d.ts +71 -0
- package/lib/client/mixins/ContentsMixin.js +157 -0
- package/lib/client/mixins/IAMMixin.d.ts +0 -31
- package/lib/client/mixins/IAMMixin.js +0 -58
- package/lib/components/animation/AnimatedText.d.ts +2 -44
- package/lib/components/animation/AnimatedText.js +6 -126
- package/lib/components/anonymous/AnonymousKeyExpired.d.ts +56 -0
- package/lib/components/anonymous/AnonymousKeyExpired.js +96 -0
- package/lib/components/anonymous/AnonymousKeyTimer.d.ts +63 -0
- package/lib/components/anonymous/AnonymousKeyTimer.js +140 -0
- package/lib/components/anonymous/index.d.ts +7 -0
- package/lib/components/anonymous/index.js +15 -0
- package/lib/components/auth/SigInAPIKey.d.ts +1 -0
- package/lib/components/auth/SigInAPIKey.js +0 -6
- package/lib/components/auth/SignIn.d.ts +1 -0
- package/lib/components/auth/SignIn.js +0 -4
- package/lib/components/auth/SignIn.stories.d.ts +2 -2
- package/lib/components/avatars/BoringAvatar.d.ts +1 -1
- package/lib/components/avatars/BoringAvatar.stories.d.ts +1 -1
- package/lib/components/avatars/DLAvatar.d.ts +1 -1
- package/lib/components/avatars/DLAvatar.js +0 -4
- package/lib/components/avatars/UserAvatar.d.ts +16 -1
- package/lib/components/avatars/UserAvatar.js +15 -13
- package/lib/components/avatars/UserProfileAvatar.d.ts +1 -1
- package/lib/components/banners/NoAutomationBanner.d.ts +1 -1
- package/lib/components/billing/BillingEntitySelect.d.ts +16 -0
- package/lib/components/billing/BillingEntitySelect.js +49 -27
- package/lib/components/billing/eligibility.d.ts +22 -0
- package/lib/components/billing/eligibility.js +27 -0
- package/lib/components/billing/index.d.ts +1 -0
- package/lib/components/billing/index.js +1 -4
- package/lib/components/buttons/DownloadCSVButton.d.ts +1 -1
- package/lib/components/buttons/DownloadJsonButton.d.ts +1 -1
- package/lib/components/buttons/LongActionButton.d.ts +1 -0
- package/lib/components/buttons/LongActionButton.js +0 -4
- package/lib/components/buttons/UploadButton.d.ts +1 -0
- package/lib/components/buttons/UploadButton.js +0 -4
- package/lib/components/checkout/StripeCheckout.d.ts +1 -1
- package/lib/components/collaboration/LiveEditorCollaborators.d.ts +36 -0
- package/lib/components/collaboration/LiveEditorCollaborators.js +88 -53
- package/lib/components/collaboration/index.js +0 -4
- package/lib/components/confetti/ConfettiSuccess.d.ts +1 -1
- package/lib/components/contents/ContentSourceCard.d.ts +8 -0
- package/lib/components/contents/ContentSourceCard.js +23 -0
- package/lib/components/contents/HomeFolderObjectsBrowser.d.ts +10 -0
- package/lib/components/contents/HomeFolderObjectsBrowser.js +148 -0
- package/lib/components/contents/index.d.ts +2 -0
- package/lib/components/contents/index.js +6 -0
- package/lib/components/context/OrganizationSelect.d.ts +1 -1
- package/lib/components/display/AvatarSkeleton.d.ts +1 -1
- package/lib/components/display/BusyDots.d.ts +1 -1
- package/lib/components/display/CenteredSpinner.d.ts +1 -1
- package/lib/components/display/CodePreview.d.ts +1 -1
- package/lib/components/display/DatalayerBox.d.ts +7 -3
- package/lib/components/display/DatalayerBox.js +7 -7
- package/lib/components/display/HorizontalCenter.d.ts +1 -1
- package/lib/components/display/JupyterDialog.d.ts +1 -0
- package/lib/components/display/JupyterDialog.js +1 -7
- package/lib/components/display/Markdown.d.ts +1 -0
- package/lib/components/display/NavLink.js +3 -2
- package/lib/components/display/NotebookSkeleton.d.ts +1 -1
- package/lib/components/display/Placeholder.d.ts +1 -1
- package/lib/components/display/ToTopBranded.d.ts +1 -1
- package/lib/components/echarts/EChartsReact.d.ts +1 -1
- package/lib/components/flashes/FlashClosable.d.ts +1 -0
- package/lib/components/flashes/FlashClosable.js +0 -4
- package/lib/components/flashes/FlashGuest.d.ts +1 -1
- package/lib/components/flashes/FlashSurveys.d.ts +1 -1
- package/lib/components/flashes/FlashUnauthorized.d.ts +1 -0
- package/lib/components/flashes/FlashUnauthorized.js +0 -6
- package/lib/components/flashes/surveys/Survey2025_1.d.ts +1 -1
- package/lib/components/iam/ExternalTokenSilentLogin.d.ts +1 -1
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/lib/components/labels/StatusLabels.d.ts +2 -9
- package/lib/components/labels/StatusLabels.js +2 -26
- package/lib/components/labels/VisibilityLabel.d.ts +1 -1
- package/lib/components/landings/StepBlock.d.ts +1 -1
- package/lib/components/mcp/ClientBadge.d.ts +41 -0
- package/lib/components/mcp/ClientBadge.js +33 -0
- package/lib/components/mcp/McpErrorBlankslate.d.ts +21 -0
- package/lib/components/mcp/McpErrorBlankslate.js +17 -0
- package/lib/components/mcp/ScopeList.d.ts +28 -0
- package/lib/components/mcp/ScopeList.js +14 -0
- package/lib/components/mcp/index.d.ts +10 -0
- package/lib/components/mcp/index.js +18 -0
- package/lib/components/navbar/NavigationVisbilityObserver.d.ts +2 -1
- package/lib/components/navbar/SubdomainNavBar.d.ts +10 -5
- package/lib/components/navbar/SubdomainNavBar.js +2 -1
- package/lib/components/notebooks/JupyterNotebook.d.ts +1 -1
- package/lib/components/notebooks/JupyterNotebookToolbar.d.ts +1 -1
- package/lib/components/principal/PrincipalAppearance.d.ts +22 -42
- package/lib/components/principal/PrincipalAppearance.js +232 -182
- package/lib/components/principal/PrincipalAvatar.d.ts +9 -1
- package/lib/components/principal/PrincipalAvatar.js +18 -10
- package/lib/components/principal/PrincipalBadge.d.ts +1 -1
- package/lib/components/principal/PrincipalBanner.d.ts +1 -1
- package/lib/components/principal/PrincipalDetailsOverlay.d.ts +38 -1
- package/lib/components/principal/PrincipalDetailsOverlay.js +64 -33
- package/lib/components/principal/PrincipalHoverCard.d.ts +31 -0
- package/lib/components/principal/PrincipalHoverCard.js +52 -0
- package/lib/components/principal/PrincipalSwitcherMenu.d.ts +1 -0
- package/lib/components/principal/PrincipalSwitcherMenu.js +5 -14
- package/lib/components/principal/index.d.ts +2 -1
- package/lib/components/principal/index.js +2 -1
- package/lib/components/progress/ConsumptionBar.d.ts +1 -0
- package/lib/components/progress/ConsumptionBar.js +0 -4
- package/lib/components/progress/ProgressRing.d.ts +1 -0
- package/lib/components/progress/SpinnerBar.d.ts +1 -1
- package/lib/components/progress/Timer.d.ts +1 -0
- package/lib/components/progress/Timer.js +0 -4
- package/lib/components/screencapture/Screencapture.js +46 -3
- package/lib/components/screencapture/ScreencaptureButton.d.ts +1 -1
- package/lib/components/sharing/ShareAccessComponent.d.ts +58 -3
- package/lib/components/sharing/ShareAccessComponent.js +143 -98
- package/lib/components/sharing/SharingEditor.d.ts +21 -0
- package/lib/components/sharing/SharingEditor.js +9 -28
- package/lib/components/sharing/index.d.ts +1 -0
- package/lib/components/sharing/index.js +1 -0
- package/lib/components/sharing/sandboxSharing.d.ts +26 -0
- package/lib/components/sharing/sandboxSharing.js +41 -0
- package/lib/components/spaces/SpaceDetailsOverlay.d.ts +39 -0
- package/lib/components/spaces/SpaceDetailsOverlay.js +80 -0
- package/lib/components/spaces/SpaceDisplay.d.ts +38 -0
- package/lib/components/spaces/SpaceDisplay.js +92 -0
- package/lib/components/spaces/index.d.ts +4 -0
- package/lib/components/spaces/index.js +7 -0
- package/lib/components/spaces/spaceDisplayModel.d.ts +93 -0
- package/lib/components/spaces/spaceDisplayModel.js +170 -0
- package/lib/components/sparklines/Sparklines.js +3 -4
- package/lib/components/sparklines/index.js +0 -4
- package/lib/components/storage/ContentsBrowser.d.ts +25 -1
- package/lib/components/storage/ContentsBrowser.js +145 -52
- package/lib/components/storage/ContentsBrowserMock.d.ts +3 -0
- package/lib/components/storage/ContentsBrowserMock.js +75 -0
- package/lib/components/storage/ContentsItems.d.ts +2 -1
- package/lib/components/storage/ContentsItems.js +0 -4
- package/lib/components/storage/ContentsTable.d.ts +50 -0
- package/lib/components/storage/ContentsTable.js +134 -0
- package/lib/components/storage/HomeFolderDrive.d.ts +71 -0
- package/lib/components/storage/HomeFolderDrive.js +248 -0
- package/lib/components/storage/index.d.ts +2 -0
- package/lib/components/storage/index.js +2 -0
- package/lib/components/students/StudentItemStatus.d.ts +1 -1
- package/lib/components/students/StudentResultCircle.d.ts +1 -1
- package/lib/components/subnav/SubNav.d.ts +5 -5
- package/lib/components/subnav/SubNav.js +11 -9
- package/lib/components/tables/DataTable.d.ts +1 -1
- package/lib/components/text-reveal/TextRevealAnimation.d.ts +2 -2
- package/lib/components/text-reveal/useTextRevealAnimationLines.d.ts +1 -1
- package/lib/components/time/LiveRelativeTime.d.ts +1 -0
- package/lib/components/time/LiveRelativeTime.js +0 -8
- package/lib/components/time/index.js +0 -4
- package/lib/components/timeline/Timeline.d.ts +1 -1
- package/lib/components/timeline/index.js +0 -4
- package/lib/components/users/PeerIndicator.d.ts +1 -0
- package/lib/components/users/PeerIndicator.js +0 -4
- package/lib/config/Configuration.d.ts +15 -17
- package/lib/config/Configuration.js +7 -0
- package/lib/hooks/cacheConverters.d.ts +0 -7
- package/lib/hooks/cacheConverters.js +0 -25
- package/lib/hooks/index.d.ts +3 -0
- package/lib/hooks/index.js +3 -0
- package/lib/hooks/layouts/LayoutBackdrop.d.ts +1 -1
- package/lib/hooks/layouts/LayoutScreencapture.d.ts +1 -1
- package/lib/hooks/useBackdrop.d.ts +1 -1
- package/lib/hooks/useBackdropJupyterLab.d.ts +3 -2
- package/lib/hooks/useBackdropJupyterLab.js +0 -4
- package/lib/hooks/useBillingEntityStore.js +3 -0
- package/lib/hooks/useCache.d.ts +478 -130
- package/lib/hooks/useCache.js +1580 -676
- package/lib/hooks/useContainsFocus.d.ts +1 -1
- package/lib/hooks/useContents.d.ts +334 -0
- package/lib/hooks/useContents.js +1033 -0
- package/lib/hooks/useFocusTrap.d.ts +4 -4
- package/lib/hooks/useFocusTrap.js +1 -1
- package/lib/hooks/useMcp.d.ts +315 -0
- package/lib/hooks/useMcp.js +891 -0
- package/lib/hooks/useMobile.js +0 -5
- package/lib/hooks/useNavigate.d.ts +41 -3
- package/lib/hooks/useNavigate.js +106 -52
- package/lib/hooks/usePrincipalCacheStore.js +3 -0
- package/lib/hooks/usePrincipalStore.js +3 -0
- package/lib/hooks/useProjectStore.d.ts +3 -3
- package/lib/hooks/useProjectStore.js +4 -4
- package/lib/hooks/useRef.d.ts +1 -1
- package/lib/hooks/useRef.js +3 -0
- package/lib/hooks/useScreencapture.d.ts +2 -1
- package/lib/hooks/useScreencapture.js +0 -4
- package/lib/hooks/useSpaceCacheStore.d.ts +50 -0
- package/lib/hooks/useSpaceCacheStore.js +85 -0
- package/lib/hooks/useToast.js +0 -4
- package/lib/hooks/useVisibilityObserver.d.ts +1 -1
- package/lib/index.d.ts +4 -1
- package/lib/index.js +3 -1
- package/lib/mocks/components/FlashMock.d.ts +1 -1
- package/lib/mocks/views/ActionMenuMock.d.ts +1 -1
- package/lib/mocks/views/ChartMock.d.ts +1 -1
- package/lib/mocks/views/DashboardMock.d.ts +1 -1
- package/lib/mocks/views/FormMock.d.ts +1 -1
- package/lib/mocks/views/TableMock.d.ts +1 -1
- package/lib/mocks/views/WipMock.d.ts +1 -1
- package/lib/models/Credits.d.ts +16 -0
- package/lib/models/Credits.js +22 -0
- package/lib/models/CreditsDTO.d.ts +6 -5
- package/lib/models/CreditsDTO.js +7 -5
- package/lib/models/McpAuditEvent.d.ts +52 -0
- package/lib/models/McpAuditEvent.js +5 -0
- package/lib/models/McpBinding.d.ts +57 -0
- package/lib/models/McpBinding.js +5 -0
- package/lib/models/McpPolicy.d.ts +77 -0
- package/lib/models/McpPolicy.js +5 -0
- package/lib/models/McpTask.d.ts +94 -0
- package/lib/models/McpTask.js +7 -0
- package/lib/models/Organization.d.ts +69 -0
- package/lib/models/Organization.js +96 -0
- package/lib/models/Secret.d.ts +1 -2
- package/lib/models/Secret.js +2 -18
- package/lib/models/StartedBy.d.ts +91 -0
- package/lib/models/StartedBy.js +117 -0
- package/lib/models/Team.d.ts +2 -0
- package/lib/models/Team.js +2 -0
- package/lib/models/User.d.ts +4 -0
- package/lib/models/User.js +3 -0
- package/lib/models/UserDTO.js +4 -2
- package/lib/models/UserSettings.d.ts +13 -0
- package/lib/models/UserSettings.js +9 -0
- package/lib/models/contents/__fixtures__/solr-codec.json +57 -0
- package/lib/models/contents/__fixtures__/v1-contracts.json +194 -0
- package/lib/models/contents/fieldCase.d.ts +8 -0
- package/lib/models/contents/fieldCase.js +37 -0
- package/lib/models/contents/index.d.ts +2 -0
- package/lib/models/contents/index.js +6 -0
- package/lib/models/contents/permissions.d.ts +16 -0
- package/lib/models/contents/permissions.js +34 -0
- package/lib/models/index.d.ts +5 -1
- package/lib/models/index.js +5 -1
- package/lib/navigation/components.js +2 -3
- package/lib/routes/publicPaths.js +4 -0
- package/lib/state/index.d.ts +1 -0
- package/lib/state/index.js +1 -0
- package/lib/state/sessionEnd.d.ts +55 -0
- package/lib/state/sessionEnd.js +162 -0
- package/lib/state/substates/CoreState.d.ts +15 -7
- package/lib/state/substates/CoreState.js +21 -17
- package/lib/state/substates/IAMState.d.ts +1 -1
- package/lib/state/substates/IAMState.js +12 -5
- package/lib/state/substates/LayoutState.js +12 -0
- package/lib/state/substates/ProfileState.d.ts +1 -0
- package/lib/state/substates/ProfileState.js +1 -4
- package/lib/state/substates/index.d.ts +0 -1
- package/lib/state/substates/index.js +0 -1
- package/lib/utils/Jwt.d.ts +26 -0
- package/lib/utils/Jwt.js +37 -0
- package/lib/utils/Lazy.d.ts +20 -0
- package/lib/utils/Lazy.js +32 -6
- package/lib/utils/Screencapture.js +3 -0
- package/lib/utils/WithSuspense.d.ts +11 -1
- package/lib/utils/WithSuspense.js +11 -1
- package/lib/views/api-keys/APIKeyEdit.d.ts +1 -1
- package/lib/views/api-keys/APIKeyNew.d.ts +1 -1
- package/lib/views/api-keys/APIKeys.d.ts +1 -1
- package/lib/views/api-keys/APIKeys.js +30 -4
- package/lib/views/api-keys/APIKeysStandalone.d.ts +5 -1
- package/lib/views/api-keys/APIKeysStandalone.js +2 -2
- package/lib/views/datasources/DatasourceDetail.d.ts +12 -5
- package/lib/views/datasources/DatasourceDetail.js +80 -110
- package/lib/views/datasources/DatasourceNew.d.ts +14 -8
- package/lib/views/datasources/DatasourceNew.js +129 -118
- package/lib/views/datasources/Datasources.d.ts +39 -7
- package/lib/views/datasources/Datasources.js +95 -40
- package/lib/views/datasources/DatasourcesMock.d.ts +3 -0
- package/lib/views/datasources/DatasourcesMock.js +57 -0
- package/lib/views/iam/SignInSimple.d.ts +12 -0
- package/lib/views/iam/SignInSimple.js +4 -4
- package/lib/views/index.d.ts +1 -0
- package/lib/views/index.js +1 -0
- package/lib/views/mcp/AdmittedClients.d.ts +44 -0
- package/lib/views/mcp/AdmittedClients.js +59 -0
- package/lib/views/mcp/AlertDestinations.d.ts +34 -0
- package/lib/views/mcp/AlertDestinations.js +75 -0
- package/lib/views/mcp/AlertRules.d.ts +32 -0
- package/lib/views/mcp/AlertRules.js +245 -0
- package/lib/views/mcp/ApprovalQueue.d.ts +66 -0
- package/lib/views/mcp/ApprovalQueue.js +95 -0
- package/lib/views/mcp/AuditLog.d.ts +42 -0
- package/lib/views/mcp/AuditLog.js +144 -0
- package/lib/views/mcp/ConnectedAgents.d.ts +34 -0
- package/lib/views/mcp/ConnectedAgents.js +135 -0
- package/lib/views/mcp/EnterpriseConsole.d.ts +74 -0
- package/lib/views/mcp/EnterpriseConsole.js +195 -0
- package/lib/views/mcp/IdentityProviders.d.ts +33 -0
- package/lib/views/mcp/IdentityProviders.js +299 -0
- package/lib/views/mcp/McpDashboard.d.ts +50 -0
- package/lib/views/mcp/McpDashboard.js +430 -0
- package/lib/views/mcp/McpHome.d.ts +92 -0
- package/lib/views/mcp/McpHome.js +153 -0
- package/lib/views/mcp/McpObservability.d.ts +79 -0
- package/lib/views/mcp/McpObservability.js +236 -0
- package/lib/views/mcp/NotebookRuns.d.ts +39 -0
- package/lib/views/mcp/NotebookRuns.js +44 -0
- package/lib/views/mcp/OrganizationPolicy.d.ts +45 -0
- package/lib/views/mcp/OrganizationPolicy.js +108 -0
- package/lib/views/mcp/OrganizationUsage.d.ts +69 -0
- package/lib/views/mcp/OrganizationUsage.js +113 -0
- package/lib/views/mcp/PersonalPolicy.d.ts +54 -0
- package/lib/views/mcp/PersonalPolicy.js +126 -0
- package/lib/views/mcp/Policies.d.ts +53 -0
- package/lib/views/mcp/Policies.js +210 -0
- package/lib/views/mcp/PolicyForm.d.ts +83 -0
- package/lib/views/mcp/PolicyForm.js +113 -0
- package/lib/views/mcp/PolicyHistory.d.ts +58 -0
- package/lib/views/mcp/PolicyHistory.js +75 -0
- package/lib/views/mcp/RunDetail.d.ts +87 -0
- package/lib/views/mcp/RunDetail.js +186 -0
- package/lib/views/mcp/ScimProvisioning.d.ts +54 -0
- package/lib/views/mcp/ScimProvisioning.js +173 -0
- package/lib/views/mcp/ServiceAgents.d.ts +46 -0
- package/lib/views/mcp/ServiceAgents.js +194 -0
- package/lib/views/mcp/TeamPolicies.d.ts +33 -0
- package/lib/views/mcp/TeamPolicies.js +159 -0
- package/lib/views/mcp/ToolAccess.d.ts +60 -0
- package/lib/views/mcp/ToolAccess.js +101 -0
- package/lib/views/mcp/TraceTimeline.d.ts +81 -0
- package/lib/views/mcp/TraceTimeline.js +132 -0
- package/lib/views/mcp/format.d.ts +25 -0
- package/lib/views/mcp/format.js +77 -0
- package/lib/views/mcp/index.d.ts +34 -0
- package/lib/views/mcp/index.js +42 -0
- package/lib/views/mcp/types.d.ts +66 -0
- package/lib/views/mcp/types.js +5 -0
- package/lib/views/otel/simpleAuthStore.js +3 -0
- package/lib/views/secrets/SecretEdit.d.ts +5 -1
- package/lib/views/secrets/SecretEdit.js +5 -4
- package/lib/views/secrets/SecretNew.d.ts +11 -1
- package/lib/views/secrets/SecretNew.js +7 -3
- package/lib/views/secrets/Secrets.d.ts +12 -1
- package/lib/views/secrets/Secrets.js +2 -2
- package/package.json +269 -260
- package/scripts/generate-contents-types.py +169 -0
- package/scripts/generate-mcp-types.py +233 -0
- package/scripts/generate-orchestration-types.py +920 -0
- package/lib/api/iam/datasources.d.ts +0 -86
- package/lib/api/iam/datasources.js +0 -185
- package/lib/components/toolbars/index.d.ts +0 -1
- package/lib/models/Datasource.d.ts +0 -181
- package/lib/models/Datasource.js +0 -154
- package/lib/state/substates/DatasourceState.d.ts +0 -11
- package/lib/state/substates/DatasourceState.js +0 -16
- /package/lib/{components/toolbars/index.js → api/contents/generated.js} +0 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
const DEFAULT_PLACEHOLDER_MAX_LENGTH = 12;
|
|
6
|
+
const text = (value) => typeof value === 'string'
|
|
7
|
+
? value.trim()
|
|
8
|
+
: value === null || value === undefined
|
|
9
|
+
? ''
|
|
10
|
+
: String(value).trim();
|
|
11
|
+
const bareHandle = (value) => text(value).replace(/^@+/, '');
|
|
12
|
+
const firstText = (...values) => {
|
|
13
|
+
for (const value of values) {
|
|
14
|
+
const candidate = text(value);
|
|
15
|
+
if (candidate) {
|
|
16
|
+
return candidate;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return '';
|
|
20
|
+
};
|
|
21
|
+
const truncate = (value, maxLength) => maxLength > 0 && value.length > maxLength
|
|
22
|
+
? `${value.slice(0, maxLength)}…`
|
|
23
|
+
: value;
|
|
24
|
+
/** The uid of a space as the spacer API returns it, raw or converted. */
|
|
25
|
+
export const spaceUidOf = (space) => firstText(space?.uid, space?.uid_s, space?.id);
|
|
26
|
+
/**
|
|
27
|
+
* The account a space is addressed under: its organization, else its owner.
|
|
28
|
+
*
|
|
29
|
+
* The same order the web application's `resolveSpaceAccountHandle` reads, so
|
|
30
|
+
* a link built here and a link built there go to the same page.
|
|
31
|
+
*/
|
|
32
|
+
export const spaceAccountHandleOf = (space) => bareHandle(firstText(space?.accountHandle, space?.organization?.handle, space?.organization?.handle_s, space?.organization_handle, space?.organization_handle_s, space?.account_handle, space?.account_handle_s, space?.owner?.handle, space?.owner?.handle_s, space?.owner_handle, space?.owner_handle_s));
|
|
33
|
+
/** A space as the cache keeps it, out of a spacer payload, raw or converted. */
|
|
34
|
+
export const toCachedSpace = (space) => {
|
|
35
|
+
const raw = space;
|
|
36
|
+
const uid = spaceUidOf(raw);
|
|
37
|
+
if (!uid) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
const isPublic = raw?.public_b ?? raw?.public;
|
|
41
|
+
return {
|
|
42
|
+
uid,
|
|
43
|
+
rootId: text(raw?.id) || undefined,
|
|
44
|
+
handle: firstText(raw?.handle_s, raw?.handle) || undefined,
|
|
45
|
+
displayName: firstText(raw?.name_t, raw?.name) || undefined,
|
|
46
|
+
description: firstText(raw?.description_t, raw?.description) || undefined,
|
|
47
|
+
variant: firstText(raw?.variant_s, raw?.variant) || undefined,
|
|
48
|
+
isPublic: typeof isPublic === 'boolean' ? isPublic : undefined,
|
|
49
|
+
accountHandle: spaceAccountHandleOf(raw) || undefined,
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
const EMPTY_SPACES = Object.freeze([]);
|
|
53
|
+
const INDEXES = new WeakMap();
|
|
54
|
+
/**
|
|
55
|
+
* Index loaded spaces by uid, Solr id, the uids of their items, and
|
|
56
|
+
* account/handle.
|
|
57
|
+
*
|
|
58
|
+
* Memoised on the array: a query answers with the same array until it
|
|
59
|
+
* refetches, so a table of a hundred rows builds the index once, not a hundred
|
|
60
|
+
* times.
|
|
61
|
+
*/
|
|
62
|
+
export const indexSpaces = (spaces) => {
|
|
63
|
+
const list = Array.isArray(spaces) ? spaces : EMPTY_SPACES;
|
|
64
|
+
const known = INDEXES.get(list);
|
|
65
|
+
if (known) {
|
|
66
|
+
return known;
|
|
67
|
+
}
|
|
68
|
+
const byUid = new Map();
|
|
69
|
+
const byRootId = new Map();
|
|
70
|
+
const byItemUid = new Map();
|
|
71
|
+
const byAccountAndHandle = new Map();
|
|
72
|
+
for (const space of list) {
|
|
73
|
+
const raw = space;
|
|
74
|
+
const uid = spaceUidOf(raw);
|
|
75
|
+
if (!uid) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
byUid.set(uid, space);
|
|
79
|
+
const rootId = text(raw?.id);
|
|
80
|
+
if (rootId) {
|
|
81
|
+
byRootId.set(rootId, space);
|
|
82
|
+
}
|
|
83
|
+
const handle = firstText(raw?.handle_s, raw?.handle);
|
|
84
|
+
const account = spaceAccountHandleOf(raw);
|
|
85
|
+
if (handle && account) {
|
|
86
|
+
byAccountAndHandle.set(`${account}/${handle}`, space);
|
|
87
|
+
}
|
|
88
|
+
// The spaces listing carries each space's items as children, which is the
|
|
89
|
+
// only place a row from the cross-space listing can learn its space from
|
|
90
|
+
// when it did not keep `_root_`.
|
|
91
|
+
if (Array.isArray(raw?.items)) {
|
|
92
|
+
for (const item of raw.items) {
|
|
93
|
+
const itemUid = text(item?.uid);
|
|
94
|
+
if (itemUid) {
|
|
95
|
+
byItemUid.set(itemUid, space);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
const index = {
|
|
101
|
+
byUid,
|
|
102
|
+
byRootId,
|
|
103
|
+
byItemUid,
|
|
104
|
+
byAccountAndHandle,
|
|
105
|
+
};
|
|
106
|
+
INDEXES.set(list, index);
|
|
107
|
+
return index;
|
|
108
|
+
};
|
|
109
|
+
/** The loaded space a descriptor names, if any. */
|
|
110
|
+
export const findSpace = (index, descriptor) => {
|
|
111
|
+
const uid = text(descriptor.uid);
|
|
112
|
+
if (uid && index.byUid.has(uid)) {
|
|
113
|
+
return index.byUid.get(uid);
|
|
114
|
+
}
|
|
115
|
+
const rootId = text(descriptor.rootId);
|
|
116
|
+
if (rootId && index.byRootId.has(rootId)) {
|
|
117
|
+
return index.byRootId.get(rootId);
|
|
118
|
+
}
|
|
119
|
+
const itemUid = text(descriptor.itemUid);
|
|
120
|
+
if (itemUid && index.byItemUid.has(itemUid)) {
|
|
121
|
+
return index.byItemUid.get(itemUid);
|
|
122
|
+
}
|
|
123
|
+
// A uid is authoritative: when one was given and is not loaded, a space
|
|
124
|
+
// that merely shares its handle is not the same space.
|
|
125
|
+
const handle = text(descriptor.handle);
|
|
126
|
+
const account = bareHandle(descriptor.accountHandle);
|
|
127
|
+
if (!uid && handle && account) {
|
|
128
|
+
return index.byAccountAndHandle.get(`${account}/${handle}`);
|
|
129
|
+
}
|
|
130
|
+
return undefined;
|
|
131
|
+
};
|
|
132
|
+
/** Where a space's page is: `/<account>/<space>`, or nothing without both. */
|
|
133
|
+
export const buildSpaceDetailsPath = ({ accountHandle, handle, }) => {
|
|
134
|
+
const account = bareHandle(accountHandle);
|
|
135
|
+
const space = text(handle);
|
|
136
|
+
if (!account || !space) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
return `/${encodeURIComponent(account)}/${encodeURIComponent(space)}`;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* What a display shows for a descriptor, given what is known of its space.
|
|
143
|
+
*
|
|
144
|
+
* The space's own fields win over the snapshot remembered from an earlier
|
|
145
|
+
* view, which win over what the row said; the row's name is shown only until
|
|
146
|
+
* the space's own is known, and a handle or uid stands in before either.
|
|
147
|
+
*/
|
|
148
|
+
export const resolveSpace = ({ descriptor, found, cached, placeholderMaxLength = DEFAULT_PLACEHOLDER_MAX_LENGTH, }) => {
|
|
149
|
+
const uid = firstText(descriptor.uid, found?.uid, cached?.uid) || undefined;
|
|
150
|
+
const handle = firstText(found?.handle, cached?.handle, descriptor.handle) || undefined;
|
|
151
|
+
const accountHandle = bareHandle(firstText(found?.accountHandle, cached?.accountHandle, descriptor.accountHandle)) || undefined;
|
|
152
|
+
const ownName = firstText(found?.displayName, cached?.displayName);
|
|
153
|
+
const displayName = ownName ||
|
|
154
|
+
text(descriptor.displayName) ||
|
|
155
|
+
truncate(firstText(handle, uid), placeholderMaxLength) ||
|
|
156
|
+
'Space';
|
|
157
|
+
const isPublic = typeof found?.isPublic === 'boolean' ? found.isPublic : cached?.isPublic;
|
|
158
|
+
return {
|
|
159
|
+
uid,
|
|
160
|
+
rootId: firstText(found?.rootId, cached?.rootId, descriptor.rootId) || undefined,
|
|
161
|
+
handle,
|
|
162
|
+
accountHandle,
|
|
163
|
+
displayName,
|
|
164
|
+
description: firstText(found?.description, cached?.description) || undefined,
|
|
165
|
+
variant: firstText(found?.variant, cached?.variant) || undefined,
|
|
166
|
+
isPublic,
|
|
167
|
+
path: buildSpaceDetailsPath({ accountHandle, handle }),
|
|
168
|
+
resolved: Boolean(ownName),
|
|
169
|
+
};
|
|
170
|
+
};
|
|
@@ -3,10 +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) 2025-2026 Datalayer, Inc.
|
|
8
|
-
* Distributed under the terms of the Modified BSD License.
|
|
9
|
-
*/
|
|
10
6
|
import React, { useMemo } from 'react';
|
|
11
7
|
import { dataToPoints } from './dataProcessing.js';
|
|
12
8
|
/**
|
|
@@ -54,6 +50,9 @@ export const Sparklines = ({ data = [], width = 240, height = 60, svgWidth, svgH
|
|
|
54
50
|
svgProps.height = svgHeight;
|
|
55
51
|
}
|
|
56
52
|
return (_jsx("svg", { ...svgProps, children: React.Children.map(children, child => {
|
|
53
|
+
// React 19 types element props as `unknown` rather than `any`. Each
|
|
54
|
+
// child is a series component that takes the shared scale below and may
|
|
55
|
+
// override any of it with props of its own, so keep the shape open.
|
|
57
56
|
if (React.isValidElement(child)) {
|
|
58
57
|
return React.cloneElement(child, {
|
|
59
58
|
data,
|
|
@@ -2,10 +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) 2025-2026 Datalayer, Inc.
|
|
7
|
-
* Distributed under the terms of the Modified BSD License.
|
|
8
|
-
*/
|
|
9
5
|
export { Sparklines } from './Sparklines.js';
|
|
10
6
|
export { SparklinesLine } from './SparklinesLine.js';
|
|
11
7
|
export { dataToPoints, min, max } from './dataProcessing.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
1
2
|
import { type ReactNode } from 'react';
|
|
2
3
|
import { DocumentRegistry } from '@jupyterlab/docregistry';
|
|
3
4
|
import { Contents } from '@jupyterlab/services';
|
|
@@ -9,6 +10,14 @@ export declare const LARGE_FILE_SIZE: number;
|
|
|
9
10
|
* The size (in bytes) of the biggest chunk we should upload at once.
|
|
10
11
|
*/
|
|
11
12
|
export declare const CHUNK_SIZE: number;
|
|
13
|
+
/**
|
|
14
|
+
* How the contents browser renders the contents.
|
|
15
|
+
*
|
|
16
|
+
* - `tree`: an expandable tree of folders and files.
|
|
17
|
+
* - `table`: a table listing one folder at a time; folder rows open the
|
|
18
|
+
* folder and a `..` row goes back to the parent folder.
|
|
19
|
+
*/
|
|
20
|
+
export type ContentsBrowserView = 'tree' | 'table';
|
|
12
21
|
/**
|
|
13
22
|
* Storage browser component properties
|
|
14
23
|
*/
|
|
@@ -16,7 +25,11 @@ export interface IContentsBrowserProps {
|
|
|
16
25
|
/**
|
|
17
26
|
* Contents manager.
|
|
18
27
|
*/
|
|
19
|
-
contents
|
|
28
|
+
contents?: Contents.IManager;
|
|
29
|
+
/**
|
|
30
|
+
* Render an invented Code Sandbox filesystem for documentation and stories.
|
|
31
|
+
*/
|
|
32
|
+
mock?: boolean;
|
|
20
33
|
/**
|
|
21
34
|
* Contents manager.
|
|
22
35
|
*/
|
|
@@ -30,6 +43,17 @@ export interface IContentsBrowserProps {
|
|
|
30
43
|
* Defaults to "Contents Browser".
|
|
31
44
|
*/
|
|
32
45
|
title?: ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* How the contents are rendered: as a tree (default) or as a table.
|
|
48
|
+
*
|
|
49
|
+
* The user can switch views from the header toggle; changing this prop
|
|
50
|
+
* applies the requested view.
|
|
51
|
+
*/
|
|
52
|
+
view?: ContentsBrowserView;
|
|
53
|
+
/**
|
|
54
|
+
* Callback when the user switches views from the header toggle.
|
|
55
|
+
*/
|
|
56
|
+
onViewChange?: (view: ContentsBrowserView) => void;
|
|
33
57
|
}
|
|
34
58
|
/**
|
|
35
59
|
* Storage browser component.
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
-
|
|
3
|
-
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
4
|
-
* Distributed under the terms of the Modified BSD License.
|
|
5
|
-
*/
|
|
6
|
-
import { useCallback, useEffect, useState, } from 'react';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState, } from 'react';
|
|
7
3
|
import { PathExt } from '@jupyterlab/coreutils';
|
|
8
4
|
import { PromiseDelegate } from '@lumino/coreutils';
|
|
9
|
-
import { ActionList, ActionMenu, Heading, IconButton, Spinner, TreeView, } from '@primer/react';
|
|
5
|
+
import { ActionList, ActionMenu, Heading, IconButton, SegmentedControl, Spinner, TreeView, Text, } from '@primer/react';
|
|
10
6
|
import { Box } from '@datalayer/primer-addons';
|
|
11
7
|
import { Blankslate, Dialog } from '@primer/react/experimental';
|
|
12
|
-
import { SyncIcon } from '@primer/octicons-react';
|
|
8
|
+
import { ListUnorderedIcon, SyncIcon, TableIcon } from '@primer/octicons-react';
|
|
13
9
|
import { useIsMounted } from 'usehooks-ts';
|
|
14
10
|
import { useToast } from '../../hooks/index.js';
|
|
15
11
|
import { UploadIconButton } from '../buttons/index.js';
|
|
16
12
|
import { DirectoryItem, TreeItem, modelToView, } from './ContentsItems.js';
|
|
13
|
+
import { CONTENTS_BROWSER_MOCK_MANAGER } from './ContentsBrowserMock.js';
|
|
14
|
+
import { ContentsTable } from './ContentsTable.js';
|
|
17
15
|
/**
|
|
18
16
|
* The maximum upload size (in bytes) for notebook version < 5.1.0
|
|
19
17
|
*/
|
|
@@ -22,15 +20,33 @@ export const LARGE_FILE_SIZE = 15 * 1024 * 1024;
|
|
|
22
20
|
* The size (in bytes) of the biggest chunk we should upload at once.
|
|
23
21
|
*/
|
|
24
22
|
export const CHUNK_SIZE = 1024 * 1024;
|
|
23
|
+
/**
|
|
24
|
+
* Views offered by the header toggle.
|
|
25
|
+
*/
|
|
26
|
+
const CONTENTS_BROWSER_VIEWS = [
|
|
27
|
+
{ value: 'tree', label: 'Tree view', icon: ListUnorderedIcon },
|
|
28
|
+
{ value: 'table', label: 'Table view', icon: TableIcon },
|
|
29
|
+
];
|
|
25
30
|
/**
|
|
26
31
|
* Storage browser component.
|
|
27
32
|
*/
|
|
28
33
|
export function ContentsBrowser(props) {
|
|
29
|
-
const {
|
|
34
|
+
const { mock = false, title = (_jsx(Heading, { as: "h4", sx: {
|
|
30
35
|
fontSize: 'var(--text-title-size-small)',
|
|
31
36
|
lineHeight: 'var(--text-title-lineHeight-medium)',
|
|
32
37
|
fontWeight: 'var(--text-title-weight-medium)',
|
|
33
38
|
}, children: "Contents Browser" })), } = props;
|
|
39
|
+
// A browser with nothing behind it shows nothing — never the sample tree.
|
|
40
|
+
// The sample is for a documentation preview that asks for it by name; a
|
|
41
|
+
// caller that has not resolved its sandbox yet must not appear to have.
|
|
42
|
+
const contents = props.contents ?? (mock ? CONTENTS_BROWSER_MOCK_MANAGER : undefined);
|
|
43
|
+
if (!contents) {
|
|
44
|
+
return (_jsxs(Box, { sx: { p: 3 }, children: [title, _jsx(Text, { sx: { display: 'block', color: 'fg.muted', fontSize: 1, mt: 2 }, children: "No filesystem is connected." })] }));
|
|
45
|
+
}
|
|
46
|
+
return (_jsx(ConnectedContentsBrowser, { ...props, contents: contents, mock: mock, title: title }));
|
|
47
|
+
}
|
|
48
|
+
const ConnectedContentsBrowser = (props) => {
|
|
49
|
+
const { contents, mock, title, localContents, documentRegistry, onViewChange, } = props;
|
|
34
50
|
const isMounted = useIsMounted();
|
|
35
51
|
const { trackAsyncTask } = useToast();
|
|
36
52
|
const [children, setChildren] = useState(null);
|
|
@@ -39,6 +55,21 @@ export function ContentsBrowser(props) {
|
|
|
39
55
|
const [contextMenuAnchor, setContextMenuAnchor] = useState(null);
|
|
40
56
|
const [openDeleteConfirmation, setOpenDeleteConfirmation] = useState(false);
|
|
41
57
|
const [copyToLocalConfirmation, setCopyToLocalConfirmation] = useState(false);
|
|
58
|
+
const [view, setView] = useState(props.view ?? 'tree');
|
|
59
|
+
/**
|
|
60
|
+
* Folder listed by the table view; the empty string is the root.
|
|
61
|
+
*/
|
|
62
|
+
const [folderPath, setFolderPath] = useState('');
|
|
63
|
+
const [folderItems, setFolderItems] = useState(null);
|
|
64
|
+
const [isFolderLoading, setIsFolderLoading] = useState(false);
|
|
65
|
+
/**
|
|
66
|
+
* Identifier of the latest folder request, so that a slow response for a
|
|
67
|
+
* folder the user already left is dropped.
|
|
68
|
+
*/
|
|
69
|
+
const folderRequest = useRef(0);
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
setView(props.view ?? 'tree');
|
|
72
|
+
}, [props.view]);
|
|
42
73
|
const refresh = useCallback(() => {
|
|
43
74
|
contents
|
|
44
75
|
.get('')
|
|
@@ -54,6 +85,56 @@ export function ContentsBrowser(props) {
|
|
|
54
85
|
useEffect(() => {
|
|
55
86
|
refresh();
|
|
56
87
|
}, [refresh]);
|
|
88
|
+
const refreshFolder = useCallback(() => {
|
|
89
|
+
const request = ++folderRequest.current;
|
|
90
|
+
setIsFolderLoading(true);
|
|
91
|
+
contents
|
|
92
|
+
.get(folderPath)
|
|
93
|
+
.then(model => {
|
|
94
|
+
if (request !== folderRequest.current || !isMounted()) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
setIsFolderLoading(false);
|
|
98
|
+
setFolderItems(modelToView(model.content, documentRegistry));
|
|
99
|
+
})
|
|
100
|
+
.catch(reason => {
|
|
101
|
+
if (request !== folderRequest.current || !isMounted()) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
setIsFolderLoading(false);
|
|
105
|
+
console.error(`Failed to fetch folder '${folderPath}' content for manager ${contents.serverSettings.appUrl}.`, reason);
|
|
106
|
+
});
|
|
107
|
+
}, [contents, folderPath, documentRegistry]);
|
|
108
|
+
useEffect(() => {
|
|
109
|
+
if (view === 'table') {
|
|
110
|
+
refreshFolder();
|
|
111
|
+
}
|
|
112
|
+
}, [view, refreshFolder]);
|
|
113
|
+
/**
|
|
114
|
+
* Refresh whatever the active view displays.
|
|
115
|
+
*/
|
|
116
|
+
const refreshView = view === 'table' ? refreshFolder : refresh;
|
|
117
|
+
const changeView = useCallback((next) => {
|
|
118
|
+
if (next === view) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
// The selection belongs to the view being left.
|
|
122
|
+
setSelectedItem(null);
|
|
123
|
+
setContextMenuAnchor(null);
|
|
124
|
+
setView(next);
|
|
125
|
+
onViewChange?.(next);
|
|
126
|
+
}, [view, onViewChange]);
|
|
127
|
+
const navigateTo = useCallback((path) => {
|
|
128
|
+
setSelectedItem(null);
|
|
129
|
+
setContextMenuAnchor(null);
|
|
130
|
+
if (path === folderPath) {
|
|
131
|
+
// Already there: reload the folder instead.
|
|
132
|
+
refreshFolder();
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
setFolderPath(path);
|
|
136
|
+
}
|
|
137
|
+
}, [folderPath, refreshFolder]);
|
|
57
138
|
const upload = useCallback(
|
|
58
139
|
/**
|
|
59
140
|
* @param file File to upload
|
|
@@ -70,7 +151,9 @@ export function ContentsBrowser(props) {
|
|
|
70
151
|
? selectedItem.type === 'directory'
|
|
71
152
|
? selectedItem.path
|
|
72
153
|
: PathExt.dirname(selectedItem.path)
|
|
73
|
-
: ''
|
|
154
|
+
: view === 'table'
|
|
155
|
+
? folderPath
|
|
156
|
+
: '';
|
|
74
157
|
const path = currentDirectory
|
|
75
158
|
? PathExt.join(currentDirectory, file.name)
|
|
76
159
|
: file.name;
|
|
@@ -127,7 +210,7 @@ export function ContentsBrowser(props) {
|
|
|
127
210
|
selectedItem.refresh();
|
|
128
211
|
}
|
|
129
212
|
else {
|
|
130
|
-
|
|
213
|
+
refreshView();
|
|
131
214
|
}
|
|
132
215
|
return finalModel;
|
|
133
216
|
}
|
|
@@ -144,12 +227,12 @@ export function ContentsBrowser(props) {
|
|
|
144
227
|
selectedItem.refresh();
|
|
145
228
|
}
|
|
146
229
|
else {
|
|
147
|
-
|
|
230
|
+
refreshView();
|
|
148
231
|
}
|
|
149
232
|
});
|
|
150
233
|
return task;
|
|
151
234
|
}
|
|
152
|
-
}, [contents, selectedItem,
|
|
235
|
+
}, [contents, selectedItem, refreshView, view, folderPath]);
|
|
153
236
|
const onContextMenu = useCallback((ref) => {
|
|
154
237
|
if (contextMenuAnchor === ref) {
|
|
155
238
|
setContextMenuAnchor(null);
|
|
@@ -225,53 +308,63 @@ export function ContentsBrowser(props) {
|
|
|
225
308
|
alignItems: 'center',
|
|
226
309
|
flexWrap: 'nowrap',
|
|
227
310
|
flexShrink: 0,
|
|
228
|
-
}, children: [_jsx(
|
|
311
|
+
}, children: [_jsx(SegmentedControl, { "aria-label": "Contents view", size: "small", onChange: index => {
|
|
312
|
+
changeView(CONTENTS_BROWSER_VIEWS[index].value);
|
|
313
|
+
}, children: CONTENTS_BROWSER_VIEWS.map(candidate => (_jsx(SegmentedControl.IconButton, { icon: candidate.icon, "aria-label": candidate.label, selected: candidate.value === view }, candidate.value))) }), _jsx(IconButton, { variant: "invisible", "aria-label": 'Refresh contents browser.', title: 'Refresh contents browser.', icon: SyncIcon, onClick: refreshView, disabled: mock }), !mock && (_jsx(UploadIconButton, { label: 'Upload a file', multiple: true, upload: upload }))] })] }), isLoading ? (_jsx(Box, { sx: {
|
|
229
314
|
gridArea: 'content',
|
|
230
315
|
display: 'flex',
|
|
231
316
|
alignItems: 'center',
|
|
232
317
|
justifyContent: 'center',
|
|
233
318
|
minHeight: '40px',
|
|
234
319
|
height: '100vh',
|
|
235
|
-
}, children: _jsx(Spinner, {}) })) : (
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
320
|
+
}, children: _jsx(Spinner, {}) })) : (_jsxs(Box, { sx: { gridArea: 'content' }, children: [view === 'table' ? (folderItems === null && !isFolderLoading ? (_jsx(Blankslate, { children: _jsx(Blankslate.Heading, { children: "No contents" }) })) : (_jsx(ContentsTable, { path: folderPath, items: folderItems ?? [], current: selectedItem, loading: isFolderLoading, onNavigate: navigateTo, onSelect: item => {
|
|
321
|
+
onSelect(item, refreshFolder);
|
|
322
|
+
}, onContextMenu: onContextMenu }))) : children ? (_jsx(TreeView, { children: children?.map(child => {
|
|
323
|
+
return child.type === 'directory' ? (_jsx(DirectoryItem, { item: child, contents: contents, current: selectedItem, documentRegistry: documentRegistry, onContextMenu: onContextMenu, onSelect: onSelect }, child.name)) : (_jsx(TreeItem, { item: child, current: selectedItem?.path === child.path, onSelect: item => {
|
|
324
|
+
onSelect(item, refresh);
|
|
325
|
+
}, onContextMenu: onContextMenu }, child.name));
|
|
326
|
+
}) })) : (_jsx(Blankslate, { children: _jsx(Blankslate.Heading, { children: "No contents" }) })), !mock && contextMenuAnchor !== null && (_jsx(ActionMenu
|
|
327
|
+
// Primer 37 types `anchorRef` with React 18's non-nullable
|
|
328
|
+
// `RefObject<HTMLElement>`; the anchor this menu tracks is nullable.
|
|
329
|
+
, {
|
|
330
|
+
// Primer 37 types `anchorRef` with React 18's non-nullable
|
|
331
|
+
// `RefObject<HTMLElement>`; the anchor this menu tracks is nullable.
|
|
332
|
+
anchorRef: (contextMenuAnchor ?? undefined), open: contextMenuAnchor?.current !== null, onOpenChange: () => {
|
|
333
|
+
setContextMenuAnchor(null);
|
|
334
|
+
}, children: _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { children: [_jsx(ActionList.Item, { title: "Delete the active item.", onSelect: onSelectDelete, children: "Delete\u2026" }), localContents && (_jsx(ActionList.Item, { title: "Copy the active item to the local drive.", onSelect: onSelectCopyToLocal, children: "Copy to local drive\u2026" }))] }) }) })), openDeleteConfirmation && (_jsx(Dialog, { title: _jsx("span", { style: { color: 'var(--fgColor-default)' }, children: "Confirm deletion" }), onClose: () => {
|
|
335
|
+
setOpenDeleteConfirmation(false);
|
|
336
|
+
}, footerButtons: [
|
|
337
|
+
{
|
|
338
|
+
buttonType: 'default',
|
|
339
|
+
content: 'Cancel',
|
|
340
|
+
onClick: () => {
|
|
341
|
+
setOpenDeleteConfirmation(false);
|
|
250
342
|
},
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
buttonType: 'danger',
|
|
346
|
+
content: 'Delete',
|
|
347
|
+
onClick: () => {
|
|
348
|
+
deleteItem();
|
|
257
349
|
},
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
350
|
+
},
|
|
351
|
+
], children: `Are you sure you want to delete ${selectedItem?.path}?` })), copyToLocalConfirmation && (_jsx(Dialog, { title: _jsx("span", { style: { color: 'var(--fgColor-default)' }, children: "Confirm copy to local" }), onClose: () => {
|
|
352
|
+
setCopyToLocalConfirmation(false);
|
|
353
|
+
}, footerButtons: [
|
|
354
|
+
{
|
|
355
|
+
buttonType: 'default',
|
|
356
|
+
content: 'Cancel',
|
|
357
|
+
onClick: () => {
|
|
358
|
+
setCopyToLocalConfirmation(false);
|
|
267
359
|
},
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
buttonType: 'danger',
|
|
363
|
+
content: 'Copy to local',
|
|
364
|
+
onClick: () => {
|
|
365
|
+
copyToLocal();
|
|
274
366
|
},
|
|
275
|
-
|
|
276
|
-
}
|
|
367
|
+
},
|
|
368
|
+
], children: `Are you sure you want to copy to local ${selectedItem?.path}?` }))] }))] }));
|
|
369
|
+
};
|
|
277
370
|
export default ContentsBrowser;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023-2025 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
const timestamp = '2026-08-24T08:00:00.000Z';
|
|
6
|
+
function directory(name, path, content) {
|
|
7
|
+
return {
|
|
8
|
+
name,
|
|
9
|
+
path,
|
|
10
|
+
type: 'directory',
|
|
11
|
+
writable: true,
|
|
12
|
+
created: timestamp,
|
|
13
|
+
last_modified: timestamp,
|
|
14
|
+
mimetype: '',
|
|
15
|
+
content,
|
|
16
|
+
format: 'json',
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function file(name, path) {
|
|
20
|
+
return {
|
|
21
|
+
name,
|
|
22
|
+
path,
|
|
23
|
+
type: 'file',
|
|
24
|
+
writable: true,
|
|
25
|
+
created: timestamp,
|
|
26
|
+
last_modified: timestamp,
|
|
27
|
+
mimetype: 'application/octet-stream',
|
|
28
|
+
content: null,
|
|
29
|
+
format: null,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const entries = new Map();
|
|
33
|
+
const workspace = directory('workspace', 'workspace', [
|
|
34
|
+
file('analysis.ipynb', 'workspace/analysis.ipynb'),
|
|
35
|
+
file('prepare_data.py', 'workspace/prepare_data.py'),
|
|
36
|
+
directory('results', 'workspace/results', [
|
|
37
|
+
file('summary.parquet', 'workspace/results/summary.parquet'),
|
|
38
|
+
]),
|
|
39
|
+
]);
|
|
40
|
+
const data = directory('data', 'data', [
|
|
41
|
+
directory('earth-observation', 'data/earth-observation', [
|
|
42
|
+
file('manifest.json', 'data/earth-observation/manifest.json'),
|
|
43
|
+
file('observations.parquet', 'data/earth-observation/observations.parquet'),
|
|
44
|
+
]),
|
|
45
|
+
directory('model-artifacts', 'data/model-artifacts', [
|
|
46
|
+
file('checkpoint.bin', 'data/model-artifacts/checkpoint.bin'),
|
|
47
|
+
]),
|
|
48
|
+
]);
|
|
49
|
+
const environment = directory('environment', 'environment', [
|
|
50
|
+
directory('tutorials', 'environment/tutorials', [
|
|
51
|
+
file('README.md', 'environment/tutorials/README.md'),
|
|
52
|
+
file('example.ipynb', 'environment/tutorials/example.ipynb'),
|
|
53
|
+
]),
|
|
54
|
+
directory('reference-data', 'environment/reference-data', [
|
|
55
|
+
file('sentinel-catalog.json', 'environment/reference-data/sentinel-catalog.json'),
|
|
56
|
+
]),
|
|
57
|
+
]);
|
|
58
|
+
const root = directory('', '', [workspace, data, environment]);
|
|
59
|
+
function index(model) {
|
|
60
|
+
entries.set(model.path, model);
|
|
61
|
+
if (model.type === 'directory' && Array.isArray(model.content)) {
|
|
62
|
+
model.content.forEach(index);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
index(root);
|
|
66
|
+
/** Invented sandbox filesystem used by documentation previews. */
|
|
67
|
+
export const CONTENTS_BROWSER_MOCK_MANAGER = {
|
|
68
|
+
serverSettings: { appUrl: 'mock://code-sandbox/' },
|
|
69
|
+
get: async (path) => entries.get(path) ?? root,
|
|
70
|
+
save: async (path, model) => ({
|
|
71
|
+
...file(model.name ?? path, path),
|
|
72
|
+
...model,
|
|
73
|
+
}),
|
|
74
|
+
delete: async () => undefined,
|
|
75
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSX } from 'react';
|
|
1
2
|
import { MutableRefObject } from 'react';
|
|
2
3
|
import { DocumentRegistry } from '@jupyterlab/docregistry';
|
|
3
4
|
import { Contents } from '@jupyterlab/services';
|
|
@@ -54,5 +55,5 @@ export declare function modelToView(models: Contents.IModel[], docRegistry?: Doc
|
|
|
54
55
|
* Directory tree item component
|
|
55
56
|
*/
|
|
56
57
|
export declare function DirectoryItem(props: IDirectoryItemProps): JSX.Element;
|
|
57
|
-
export declare function TreeItem(props: ITreeItemProps):
|
|
58
|
+
export declare function TreeItem(props: ITreeItemProps): JSX.Element;
|
|
58
59
|
export {};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, 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
2
|
import { useCallback, useRef, useState } from 'react';
|
|
7
3
|
import { TreeView } from '@primer/react';
|
|
8
4
|
import { FileIcon } from '@primer/octicons-react';
|