@datalayer/core 1.1.60 → 1.1.66

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.
Files changed (364) hide show
  1. package/README.md +2 -2
  2. package/lib/api/DatalayerApi.d.ts +42 -1
  3. package/lib/api/DatalayerApi.js +90 -3
  4. package/lib/api/constants.d.ts +18 -0
  5. package/lib/api/constants.js +18 -0
  6. package/lib/api/contents/attachments.d.ts +9 -0
  7. package/lib/api/contents/attachments.js +43 -0
  8. package/lib/api/contents/bridges.d.ts +22 -0
  9. package/lib/api/contents/bridges.js +79 -0
  10. package/lib/api/contents/capabilities.d.ts +11 -0
  11. package/lib/api/contents/capabilities.js +21 -0
  12. package/lib/api/contents/cloudStorage.d.ts +31 -0
  13. package/lib/api/contents/cloudStorage.js +89 -0
  14. package/lib/api/contents/dataservers.d.ts +37 -0
  15. package/lib/api/contents/dataservers.js +121 -0
  16. package/lib/api/contents/datasets.d.ts +15 -0
  17. package/lib/api/contents/datasets.js +45 -0
  18. package/lib/api/contents/datasources.d.ts +70 -0
  19. package/lib/api/contents/datasources.js +149 -0
  20. package/lib/api/contents/generated.d.ts +1070 -0
  21. package/lib/api/contents/index.d.ts +16 -0
  22. package/lib/api/contents/index.js +20 -0
  23. package/lib/api/contents/mcp.d.ts +46 -0
  24. package/lib/api/contents/mcp.js +157 -0
  25. package/lib/api/contents/objects.d.ts +31 -0
  26. package/lib/api/contents/objects.js +88 -0
  27. package/lib/api/contents/operations.d.ts +3 -0
  28. package/lib/api/contents/operations.js +19 -0
  29. package/lib/api/contents/runtimeMounts.d.ts +40 -0
  30. package/lib/api/contents/runtimeMounts.js +59 -0
  31. package/lib/api/contents/sandboxUid.d.ts +53 -0
  32. package/lib/api/contents/sandboxUid.js +78 -0
  33. package/lib/api/contents/sources.d.ts +19 -0
  34. package/lib/api/contents/sources.js +119 -0
  35. package/lib/api/contents/sync.d.ts +18 -0
  36. package/lib/api/contents/sync.js +69 -0
  37. package/lib/api/contents/transfers.d.ts +38 -0
  38. package/lib/api/contents/transfers.js +123 -0
  39. package/lib/api/iam/connectedAgents.d.ts +39 -0
  40. package/lib/api/iam/connectedAgents.js +52 -0
  41. package/lib/api/iam/index.d.ts +2 -1
  42. package/lib/api/iam/index.js +2 -1
  43. package/lib/api/iam/mcpAlertRules.d.ts +51 -0
  44. package/lib/api/iam/mcpAlertRules.js +198 -0
  45. package/lib/api/iam/mcpAuditSettings.d.ts +46 -0
  46. package/lib/api/iam/mcpAuditSettings.js +120 -0
  47. package/lib/api/iam/mcpPolicy.d.ts +80 -0
  48. package/lib/api/iam/mcpPolicy.js +132 -0
  49. package/lib/api/iam/organizationTeams.d.ts +13 -0
  50. package/lib/api/iam/organizationTeams.js +43 -0
  51. package/lib/api/iam/serviceAgents.d.ts +68 -0
  52. package/lib/api/iam/serviceAgents.js +119 -0
  53. package/lib/api/index.d.ts +4 -1
  54. package/lib/api/index.js +3 -1
  55. package/lib/api/mcp/activity.d.ts +37 -0
  56. package/lib/api/mcp/activity.js +26 -0
  57. package/lib/api/mcp/alerts.d.ts +25 -0
  58. package/lib/api/mcp/alerts.js +51 -0
  59. package/lib/api/mcp/audit.d.ts +29 -0
  60. package/lib/api/mcp/audit.js +55 -0
  61. package/lib/api/mcp/bindings.d.ts +18 -0
  62. package/lib/api/mcp/bindings.js +42 -0
  63. package/lib/api/mcp/forwarding.d.ts +25 -0
  64. package/lib/api/mcp/forwarding.js +46 -0
  65. package/lib/api/mcp/gateway.d.ts +16 -0
  66. package/lib/api/mcp/gateway.js +70 -0
  67. package/lib/api/mcp/generated.d.ts +22 -0
  68. package/lib/api/mcp/generated.js +213 -0
  69. package/lib/api/mcp/index.d.ts +17 -0
  70. package/lib/api/mcp/index.js +25 -0
  71. package/lib/api/mcp/observability.d.ts +125 -0
  72. package/lib/api/mcp/observability.js +254 -0
  73. package/lib/api/mcp/operations.d.ts +83 -0
  74. package/lib/api/mcp/operations.js +50 -0
  75. package/lib/api/mcp/organizations.d.ts +102 -0
  76. package/lib/api/mcp/organizations.js +46 -0
  77. package/lib/api/mcp/policy.d.ts +9 -0
  78. package/lib/api/mcp/policy.js +23 -0
  79. package/lib/api/mcp/tasks.d.ts +49 -0
  80. package/lib/api/mcp/tasks.js +147 -0
  81. package/lib/api/utils/validation.d.ts +1 -1
  82. package/lib/api/utils/validation.js +1 -1
  83. package/lib/client/auth/index.js +0 -5
  84. package/lib/client/auth/storage.js +0 -5
  85. package/lib/client/auth/strategies.js +0 -5
  86. package/lib/client/base.d.ts +6 -0
  87. package/lib/client/base.js +8 -0
  88. package/lib/client/index.d.ts +0 -10
  89. package/lib/client/index.js +2 -2
  90. package/lib/client/mixins/ContentsMixin.d.ts +71 -0
  91. package/lib/client/mixins/ContentsMixin.js +157 -0
  92. package/lib/client/mixins/IAMMixin.d.ts +0 -31
  93. package/lib/client/mixins/IAMMixin.js +0 -58
  94. package/lib/components/animation/AnimatedText.d.ts +1 -0
  95. package/lib/components/animation/AnimatedText.js +0 -4
  96. package/lib/components/auth/SigInAPIKey.d.ts +1 -0
  97. package/lib/components/auth/SigInAPIKey.js +0 -6
  98. package/lib/components/auth/SignIn.d.ts +1 -0
  99. package/lib/components/auth/SignIn.js +0 -4
  100. package/lib/components/auth/SignIn.stories.d.ts +2 -2
  101. package/lib/components/avatars/BoringAvatar.d.ts +1 -1
  102. package/lib/components/avatars/BoringAvatar.stories.d.ts +1 -1
  103. package/lib/components/avatars/DLAvatar.d.ts +1 -1
  104. package/lib/components/avatars/DLAvatar.js +0 -4
  105. package/lib/components/avatars/UserAvatar.d.ts +9 -0
  106. package/lib/components/avatars/UserAvatar.js +0 -12
  107. package/lib/components/avatars/UserProfileAvatar.d.ts +1 -1
  108. package/lib/components/banners/NoAutomationBanner.d.ts +1 -1
  109. package/lib/components/billing/BillingEntitySelect.d.ts +10 -0
  110. package/lib/components/billing/BillingEntitySelect.js +0 -17
  111. package/lib/components/billing/index.js +0 -4
  112. package/lib/components/buttons/DownloadCSVButton.d.ts +1 -1
  113. package/lib/components/buttons/DownloadJsonButton.d.ts +1 -1
  114. package/lib/components/buttons/LongActionButton.d.ts +1 -0
  115. package/lib/components/buttons/LongActionButton.js +0 -4
  116. package/lib/components/buttons/UploadButton.d.ts +1 -0
  117. package/lib/components/buttons/UploadButton.js +0 -4
  118. package/lib/components/checkout/StripeCheckout.d.ts +1 -1
  119. package/lib/components/collaboration/LiveEditorCollaborators.d.ts +31 -0
  120. package/lib/components/collaboration/LiveEditorCollaborators.js +86 -53
  121. package/lib/components/collaboration/index.js +0 -4
  122. package/lib/components/confetti/ConfettiSuccess.d.ts +1 -1
  123. package/lib/components/contents/ContentSourceCard.d.ts +8 -0
  124. package/lib/components/contents/ContentSourceCard.js +23 -0
  125. package/lib/components/contents/HomeFolderObjectsBrowser.d.ts +10 -0
  126. package/lib/components/contents/HomeFolderObjectsBrowser.js +148 -0
  127. package/lib/components/contents/index.d.ts +2 -0
  128. package/lib/components/contents/index.js +6 -0
  129. package/lib/components/context/OrganizationSelect.d.ts +1 -1
  130. package/lib/components/display/AvatarSkeleton.d.ts +1 -1
  131. package/lib/components/display/BusyDots.d.ts +1 -1
  132. package/lib/components/display/CenteredSpinner.d.ts +1 -1
  133. package/lib/components/display/CodePreview.d.ts +1 -1
  134. package/lib/components/display/DatalayerBox.d.ts +7 -2
  135. package/lib/components/display/DatalayerBox.js +6 -6
  136. package/lib/components/display/HorizontalCenter.d.ts +1 -1
  137. package/lib/components/display/JupyterDialog.d.ts +1 -0
  138. package/lib/components/display/JupyterDialog.js +1 -7
  139. package/lib/components/display/Markdown.d.ts +1 -0
  140. package/lib/components/display/NotebookSkeleton.d.ts +1 -1
  141. package/lib/components/display/Placeholder.d.ts +1 -1
  142. package/lib/components/display/ToTopBranded.d.ts +1 -1
  143. package/lib/components/echarts/EChartsReact.d.ts +1 -1
  144. package/lib/components/flashes/FlashClosable.d.ts +1 -0
  145. package/lib/components/flashes/FlashClosable.js +0 -4
  146. package/lib/components/flashes/FlashGuest.d.ts +1 -1
  147. package/lib/components/flashes/FlashSurveys.d.ts +1 -1
  148. package/lib/components/flashes/FlashUnauthorized.d.ts +1 -0
  149. package/lib/components/flashes/FlashUnauthorized.js +0 -6
  150. package/lib/components/flashes/surveys/Survey2025_1.d.ts +1 -1
  151. package/lib/components/iam/ExternalTokenSilentLogin.d.ts +1 -1
  152. package/lib/components/index.d.ts +2 -0
  153. package/lib/components/index.js +2 -0
  154. package/lib/components/labels/StatusLabels.d.ts +1 -0
  155. package/lib/components/labels/VisibilityLabel.d.ts +1 -1
  156. package/lib/components/landings/StepBlock.d.ts +1 -1
  157. package/lib/components/mcp/ClientBadge.d.ts +41 -0
  158. package/lib/components/mcp/ClientBadge.js +33 -0
  159. package/lib/components/mcp/McpErrorBlankslate.d.ts +21 -0
  160. package/lib/components/mcp/McpErrorBlankslate.js +17 -0
  161. package/lib/components/mcp/ScopeList.d.ts +28 -0
  162. package/lib/components/mcp/ScopeList.js +14 -0
  163. package/lib/components/mcp/index.d.ts +10 -0
  164. package/lib/components/mcp/index.js +18 -0
  165. package/lib/components/navbar/NavigationVisbilityObserver.d.ts +2 -1
  166. package/lib/components/navbar/SubdomainNavBar.d.ts +10 -5
  167. package/lib/components/navbar/SubdomainNavBar.js +2 -1
  168. package/lib/components/notebooks/JupyterNotebook.d.ts +1 -1
  169. package/lib/components/notebooks/JupyterNotebookToolbar.d.ts +1 -1
  170. package/lib/components/principal/PrincipalAppearance.d.ts +1 -0
  171. package/lib/components/principal/PrincipalAppearance.js +0 -8
  172. package/lib/components/principal/PrincipalAvatar.d.ts +1 -0
  173. package/lib/components/principal/PrincipalAvatar.js +17 -9
  174. package/lib/components/principal/PrincipalBadge.d.ts +1 -1
  175. package/lib/components/principal/PrincipalBanner.d.ts +1 -1
  176. package/lib/components/principal/PrincipalDetailsOverlay.d.ts +31 -1
  177. package/lib/components/principal/PrincipalDetailsOverlay.js +64 -33
  178. package/lib/components/principal/PrincipalHoverCard.d.ts +31 -0
  179. package/lib/components/principal/PrincipalHoverCard.js +52 -0
  180. package/lib/components/principal/PrincipalSwitcherMenu.d.ts +1 -0
  181. package/lib/components/principal/PrincipalSwitcherMenu.js +5 -14
  182. package/lib/components/principal/index.d.ts +2 -1
  183. package/lib/components/principal/index.js +2 -1
  184. package/lib/components/progress/ConsumptionBar.d.ts +1 -0
  185. package/lib/components/progress/ConsumptionBar.js +0 -4
  186. package/lib/components/progress/ProgressRing.d.ts +1 -0
  187. package/lib/components/progress/SpinnerBar.d.ts +1 -1
  188. package/lib/components/progress/Timer.d.ts +1 -0
  189. package/lib/components/progress/Timer.js +0 -4
  190. package/lib/components/screencapture/ScreencaptureButton.d.ts +1 -1
  191. package/lib/components/sharing/ShareAccessComponent.d.ts +15 -1
  192. package/lib/components/sharing/ShareAccessComponent.js +36 -23
  193. package/lib/components/sharing/SharingEditor.d.ts +17 -0
  194. package/lib/components/sharing/SharingEditor.js +0 -24
  195. package/lib/components/sparklines/Sparklines.js +3 -4
  196. package/lib/components/sparklines/index.js +0 -4
  197. package/lib/components/storage/ContentsBrowser.d.ts +25 -1
  198. package/lib/components/storage/ContentsBrowser.js +145 -52
  199. package/lib/components/storage/ContentsBrowserMock.d.ts +3 -0
  200. package/lib/components/storage/ContentsBrowserMock.js +75 -0
  201. package/lib/components/storage/ContentsItems.d.ts +2 -1
  202. package/lib/components/storage/ContentsItems.js +0 -4
  203. package/lib/components/storage/ContentsTable.d.ts +50 -0
  204. package/lib/components/storage/ContentsTable.js +134 -0
  205. package/lib/components/storage/HomeFolderDrive.d.ts +71 -0
  206. package/lib/components/storage/HomeFolderDrive.js +248 -0
  207. package/lib/components/storage/index.d.ts +2 -0
  208. package/lib/components/storage/index.js +2 -0
  209. package/lib/components/students/StudentItemStatus.d.ts +1 -1
  210. package/lib/components/students/StudentResultCircle.d.ts +1 -1
  211. package/lib/components/subnav/SubNav.d.ts +5 -5
  212. package/lib/components/subnav/SubNav.js +11 -9
  213. package/lib/components/tables/DataTable.d.ts +1 -1
  214. package/lib/components/text-reveal/TextRevealAnimation.d.ts +2 -2
  215. package/lib/components/text-reveal/useTextRevealAnimationLines.d.ts +1 -1
  216. package/lib/components/time/LiveRelativeTime.d.ts +1 -0
  217. package/lib/components/time/LiveRelativeTime.js +0 -8
  218. package/lib/components/time/index.js +0 -4
  219. package/lib/components/timeline/Timeline.d.ts +1 -1
  220. package/lib/components/timeline/index.js +0 -4
  221. package/lib/components/users/PeerIndicator.d.ts +1 -0
  222. package/lib/components/users/PeerIndicator.js +0 -4
  223. package/lib/config/Configuration.d.ts +15 -17
  224. package/lib/config/Configuration.js +7 -0
  225. package/lib/hooks/index.d.ts +2 -0
  226. package/lib/hooks/index.js +2 -0
  227. package/lib/hooks/layouts/LayoutBackdrop.d.ts +1 -1
  228. package/lib/hooks/layouts/LayoutScreencapture.d.ts +1 -1
  229. package/lib/hooks/useBackdrop.d.ts +1 -1
  230. package/lib/hooks/useBackdropJupyterLab.d.ts +3 -2
  231. package/lib/hooks/useBackdropJupyterLab.js +0 -4
  232. package/lib/hooks/useCache.d.ts +310 -105
  233. package/lib/hooks/useCache.js +142 -355
  234. package/lib/hooks/useContainsFocus.d.ts +1 -1
  235. package/lib/hooks/useContents.d.ts +313 -0
  236. package/lib/hooks/useContents.js +964 -0
  237. package/lib/hooks/useFocusTrap.d.ts +4 -4
  238. package/lib/hooks/useFocusTrap.js +1 -1
  239. package/lib/hooks/useMcp.d.ts +229 -0
  240. package/lib/hooks/useMcp.js +656 -0
  241. package/lib/hooks/useMobile.js +0 -5
  242. package/lib/hooks/useProjectStore.d.ts +3 -3
  243. package/lib/hooks/useProjectStore.js +4 -4
  244. package/lib/hooks/useRef.d.ts +1 -1
  245. package/lib/hooks/useRef.js +3 -0
  246. package/lib/hooks/useScreencapture.d.ts +2 -1
  247. package/lib/hooks/useScreencapture.js +0 -4
  248. package/lib/hooks/useToast.js +0 -4
  249. package/lib/hooks/useVisibilityObserver.d.ts +1 -1
  250. package/lib/index.d.ts +4 -1
  251. package/lib/index.js +3 -1
  252. package/lib/mocks/components/FlashMock.d.ts +1 -1
  253. package/lib/mocks/views/ActionMenuMock.d.ts +1 -1
  254. package/lib/mocks/views/ChartMock.d.ts +1 -1
  255. package/lib/mocks/views/DashboardMock.d.ts +1 -1
  256. package/lib/mocks/views/FormMock.d.ts +1 -1
  257. package/lib/mocks/views/TableMock.d.ts +1 -1
  258. package/lib/mocks/views/WipMock.d.ts +1 -1
  259. package/lib/models/Credits.d.ts +16 -0
  260. package/lib/models/Credits.js +22 -0
  261. package/lib/models/McpAuditEvent.d.ts +52 -0
  262. package/lib/models/McpAuditEvent.js +5 -0
  263. package/lib/models/McpBinding.d.ts +51 -0
  264. package/lib/models/McpBinding.js +5 -0
  265. package/lib/models/McpPolicy.d.ts +77 -0
  266. package/lib/models/McpPolicy.js +5 -0
  267. package/lib/models/McpTask.d.ts +94 -0
  268. package/lib/models/McpTask.js +7 -0
  269. package/lib/models/StartedBy.d.ts +57 -0
  270. package/lib/models/StartedBy.js +81 -0
  271. package/lib/models/UserDTO.js +4 -2
  272. package/lib/models/contents/__fixtures__/solr-codec.json +57 -0
  273. package/lib/models/contents/__fixtures__/v1-contracts.json +66 -0
  274. package/lib/models/contents/fieldCase.d.ts +8 -0
  275. package/lib/models/contents/fieldCase.js +37 -0
  276. package/lib/models/contents/index.d.ts +2 -0
  277. package/lib/models/contents/index.js +6 -0
  278. package/lib/models/contents/permissions.d.ts +16 -0
  279. package/lib/models/contents/permissions.js +34 -0
  280. package/lib/models/index.d.ts +5 -1
  281. package/lib/models/index.js +5 -1
  282. package/lib/state/substates/CoreState.d.ts +15 -7
  283. package/lib/state/substates/CoreState.js +18 -14
  284. package/lib/state/substates/IAMState.d.ts +1 -1
  285. package/lib/state/substates/IAMState.js +5 -5
  286. package/lib/state/substates/ProfileState.js +0 -4
  287. package/lib/state/substates/index.d.ts +0 -1
  288. package/lib/state/substates/index.js +0 -1
  289. package/lib/utils/Jwt.d.ts +26 -0
  290. package/lib/utils/Jwt.js +37 -0
  291. package/lib/utils/WithSuspense.d.ts +1 -1
  292. package/lib/views/api-keys/APIKeyEdit.d.ts +1 -1
  293. package/lib/views/api-keys/APIKeyNew.d.ts +1 -1
  294. package/lib/views/api-keys/APIKeys.d.ts +1 -1
  295. package/lib/views/api-keys/APIKeys.js +30 -4
  296. package/lib/views/api-keys/APIKeysStandalone.d.ts +5 -1
  297. package/lib/views/api-keys/APIKeysStandalone.js +2 -2
  298. package/lib/views/datasources/DatasourceDetail.d.ts +12 -5
  299. package/lib/views/datasources/DatasourceDetail.js +80 -110
  300. package/lib/views/datasources/DatasourceNew.d.ts +14 -8
  301. package/lib/views/datasources/DatasourceNew.js +129 -118
  302. package/lib/views/datasources/Datasources.d.ts +39 -7
  303. package/lib/views/datasources/Datasources.js +95 -40
  304. package/lib/views/datasources/DatasourcesMock.d.ts +3 -0
  305. package/lib/views/datasources/DatasourcesMock.js +57 -0
  306. package/lib/views/iam/SignInSimple.d.ts +12 -0
  307. package/lib/views/iam/SignInSimple.js +4 -4
  308. package/lib/views/index.d.ts +1 -0
  309. package/lib/views/index.js +1 -0
  310. package/lib/views/mcp/AlertDestinations.d.ts +34 -0
  311. package/lib/views/mcp/AlertDestinations.js +75 -0
  312. package/lib/views/mcp/AlertRules.d.ts +32 -0
  313. package/lib/views/mcp/AlertRules.js +245 -0
  314. package/lib/views/mcp/AuditLog.d.ts +42 -0
  315. package/lib/views/mcp/AuditLog.js +144 -0
  316. package/lib/views/mcp/ConnectedAgents.d.ts +34 -0
  317. package/lib/views/mcp/ConnectedAgents.js +100 -0
  318. package/lib/views/mcp/EnterpriseConsole.d.ts +74 -0
  319. package/lib/views/mcp/EnterpriseConsole.js +173 -0
  320. package/lib/views/mcp/McpDashboard.d.ts +50 -0
  321. package/lib/views/mcp/McpDashboard.js +347 -0
  322. package/lib/views/mcp/McpHome.d.ts +92 -0
  323. package/lib/views/mcp/McpHome.js +153 -0
  324. package/lib/views/mcp/McpObservability.d.ts +50 -0
  325. package/lib/views/mcp/McpObservability.js +150 -0
  326. package/lib/views/mcp/OrganizationPolicy.d.ts +45 -0
  327. package/lib/views/mcp/OrganizationPolicy.js +107 -0
  328. package/lib/views/mcp/OrganizationUsage.d.ts +69 -0
  329. package/lib/views/mcp/OrganizationUsage.js +113 -0
  330. package/lib/views/mcp/PersonalPolicy.d.ts +54 -0
  331. package/lib/views/mcp/PersonalPolicy.js +125 -0
  332. package/lib/views/mcp/Policies.d.ts +53 -0
  333. package/lib/views/mcp/Policies.js +210 -0
  334. package/lib/views/mcp/PolicyForm.d.ts +67 -0
  335. package/lib/views/mcp/PolicyForm.js +91 -0
  336. package/lib/views/mcp/PolicyHistory.d.ts +45 -0
  337. package/lib/views/mcp/PolicyHistory.js +62 -0
  338. package/lib/views/mcp/ServiceAgents.d.ts +46 -0
  339. package/lib/views/mcp/ServiceAgents.js +194 -0
  340. package/lib/views/mcp/TeamPolicies.d.ts +33 -0
  341. package/lib/views/mcp/TeamPolicies.js +98 -0
  342. package/lib/views/mcp/format.d.ts +25 -0
  343. package/lib/views/mcp/format.js +77 -0
  344. package/lib/views/mcp/index.d.ts +29 -0
  345. package/lib/views/mcp/index.js +37 -0
  346. package/lib/views/mcp/types.d.ts +66 -0
  347. package/lib/views/mcp/types.js +5 -0
  348. package/lib/views/secrets/SecretEdit.d.ts +5 -1
  349. package/lib/views/secrets/SecretEdit.js +2 -2
  350. package/lib/views/secrets/SecretNew.d.ts +11 -1
  351. package/lib/views/secrets/SecretNew.js +2 -2
  352. package/lib/views/secrets/Secrets.d.ts +12 -1
  353. package/lib/views/secrets/Secrets.js +2 -2
  354. package/package.json +28 -24
  355. package/scripts/generate-contents-types.py +169 -0
  356. package/scripts/generate-mcp-types.py +233 -0
  357. package/lib/api/iam/datasources.d.ts +0 -86
  358. package/lib/api/iam/datasources.js +0 -185
  359. package/lib/components/toolbars/index.d.ts +0 -1
  360. package/lib/models/Datasource.d.ts +0 -181
  361. package/lib/models/Datasource.js +0 -154
  362. package/lib/state/substates/DatasourceState.d.ts +0 -11
  363. package/lib/state/substates/DatasourceState.js +0 -16
  364. /package/lib/{components/toolbars/index.js → api/contents/generated.js} +0 -0
@@ -1,10 +1,4 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- /*
3
- * Copyright (c) 2023-2025 Datalayer, Inc.
4
- * Distributed under the terms of the Modified BSD License.
5
- */
6
- // import { AlertIcon } from '@primer/octicons-react';
7
- // import { Box, Flash as PrimerFlash, Link } from '@primer/react';
8
2
  import { Link } from '@primer/react';
9
3
  import { Banner } from '@primer/react/experimental';
10
4
  import { QuestionIcon } from '@primer/octicons-react';
@@ -1,3 +1,3 @@
1
1
  import { ISurveyProps } from './SurveyProps';
2
- export declare const Survey2025_1: (props: ISurveyProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const Survey2025_1: (props: ISurveyProps) => import("react").JSX.Element;
3
3
  export default Survey2025_1;
@@ -1,5 +1,5 @@
1
1
  type IExternalTokenSilentLoginProps = {
2
2
  message: string;
3
3
  };
4
- export declare const ExternalTokenSilentLogin: (props: IExternalTokenSilentLoginProps) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const ExternalTokenSilentLogin: (props: IExternalTokenSilentLoginProps) => import("react").JSX.Element;
5
5
  export default ExternalTokenSilentLogin;
@@ -2,6 +2,8 @@ export * from './auth';
2
2
  export * from './animation';
3
3
  export * from './billing';
4
4
  export * from './collaboration';
5
+ export * from './contents';
6
+ export * from './mcp';
5
7
  export * from './sharing';
6
8
  export * from './sparklines';
7
9
  export * from './time';
@@ -6,6 +6,8 @@ export * from './auth/index.js';
6
6
  export * from './animation/index.js';
7
7
  export * from './billing/index.js';
8
8
  export * from './collaboration/index.js';
9
+ export * from './contents/index.js';
10
+ export * from './mcp/index.js';
9
11
  export * from './sharing/index.js';
10
12
  export * from './sparklines/index.js';
11
13
  export * from './time/index.js';
@@ -9,6 +9,7 @@
9
9
  *
10
10
  * @module components/labels/StatusLabels
11
11
  */
12
+ import type { JSX } from 'react';
12
13
  import type { ReactNode } from 'react';
13
14
  /** The tones a status pill is read in. */
14
15
  export type StatusLabelTone = 'accent' | 'attention' | 'success' | 'neutral';
@@ -1,4 +1,4 @@
1
1
  export declare const VisibilityLabel: (props: {
2
2
  isPublic: boolean | undefined;
3
- }) => import("react/jsx-runtime").JSX.Element;
3
+ }) => import("react").JSX.Element;
4
4
  export default VisibilityLabel;
@@ -7,5 +7,5 @@ type IStepBlockProps = {
7
7
  colored?: boolean;
8
8
  }>;
9
9
  };
10
- export declare const StepBlock: (props: IStepBlockProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const StepBlock: (props: IStepBlockProps) => import("react").JSX.Element;
11
11
  export default StepBlock;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Which client this is, said the way its identity was established.
3
+ *
4
+ * A client that registered by Client ID Metadata Document *is* its URL: the
5
+ * host is the part of its identity nobody can invent, and it is what the
6
+ * consent screen showed — so the URL is the client id on screen, with the
7
+ * hostname read out beneath the name. A client registered through the
8
+ * deprecated dynamic path has an opaque id and gets it plainly, marked as
9
+ * such, because the two are not the same kind of fact.
10
+ *
11
+ * The badge explains itself through `title` and its accessible name rather
12
+ * than a Primer `Tooltip`. That component requires an interactive child and
13
+ * warns otherwise, because a tooltip on a label appears on hover and nowhere
14
+ * else — it does not exist for a keyboard or a screen reader. A `<button>`
15
+ * around the word would silence the warning by trading one problem for
16
+ * another: a tab stop that announces itself as a button and does nothing.
17
+ *
18
+ * The word alone is the part that needs explaining. "Document" read out on
19
+ * its own says nothing, so the accessible name is the whole sentence.
20
+ *
21
+ * @module components/mcp/ClientBadge
22
+ */
23
+ import type { JSX } from 'react';
24
+ import type { ConnectedAgentRegistration } from '../../api/iam/connectedAgents';
25
+ export interface ClientBadgeProps {
26
+ clientId: string;
27
+ clientName?: string | null;
28
+ /**
29
+ * How the client registered, when IAM said. Without it the id's shape is
30
+ * used, which is what an audit row or a task leaves us with.
31
+ */
32
+ registration?: ConnectedAgentRegistration;
33
+ /** The document's hostname, when IAM answered one. */
34
+ clientHostname?: string | null;
35
+ /** Without the second line, for a dense table. */
36
+ compact?: boolean;
37
+ }
38
+ /** The hostname of a document URL, or an empty string for anything else. */
39
+ export declare const clientHostnameOf: (clientId: string) => string;
40
+ export declare const ClientBadge: ({ clientId, clientName, registration, clientHostname, compact, }: ClientBadgeProps) => JSX.Element;
41
+ export default ClientBadge;
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Label, Text } from '@primer/react';
3
+ import { Box } from '@datalayer/primer-addons';
4
+ import { isCimdClientId } from '../../api/iam/connectedAgents.js';
5
+ /** The hostname of a document URL, or an empty string for anything else. */
6
+ export const clientHostnameOf = (clientId) => {
7
+ try {
8
+ return new URL(clientId).hostname;
9
+ }
10
+ catch {
11
+ return '';
12
+ }
13
+ };
14
+ export const ClientBadge = ({ clientId, clientName, registration, clientHostname, compact = false, }) => {
15
+ const byDocument = (registration ?? (isCimdClientId(clientId) ? 'cimd' : 'dcr')) === 'cimd';
16
+ const hostname = clientHostname || (byDocument ? clientHostnameOf(clientId) : '');
17
+ const name = clientName || (byDocument ? hostname : '') || clientId || 'Unknown client';
18
+ return (_jsxs(Box, { sx: { display: 'grid', gap: '2px', minWidth: 0 }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2, minWidth: 0 }, children: [_jsx(Text, { sx: {
19
+ fontSize: 1,
20
+ fontWeight: 'semibold',
21
+ overflow: 'hidden',
22
+ textOverflow: 'ellipsis',
23
+ whiteSpace: 'nowrap',
24
+ }, children: name }), byDocument ? (_jsx(Label, { size: "small", variant: "accent", title: "Registered by Client ID Metadata Document", "aria-label": "Registered by Client ID Metadata Document", children: "Document" })) : (_jsx(Label, { size: "small", variant: "secondary", title: "Registered dynamically; its id is opaque", "aria-label": "Registered dynamically; its id is opaque", children: "Dynamic" }))] }), !compact && clientId && (_jsx(Text, { sx: {
25
+ fontSize: 0,
26
+ color: 'fg.muted',
27
+ fontFamily: 'mono',
28
+ overflow: 'hidden',
29
+ textOverflow: 'ellipsis',
30
+ whiteSpace: 'nowrap',
31
+ }, title: clientId, children: clientId }))] }));
32
+ };
33
+ export default ClientBadge;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * A failure, said in the reader's terms, with a way out of it.
3
+ *
4
+ * The four situations "could not be loaded" covers each call for a
5
+ * different response — sign in, ask for access, wait, report — so the
6
+ * heading and the description come from the application's catalog and the
7
+ * retry button appears only when retrying could plausibly work.
8
+ *
9
+ * @module components/mcp/McpErrorBlankslate
10
+ */
11
+ import type { JSX } from 'react';
12
+ import type { McpErrorState } from '../../views/mcp/types';
13
+ export interface McpErrorBlankslateProps {
14
+ state: McpErrorState;
15
+ /** Asked again; drawn only when the failure is retryable. */
16
+ onRetry?: () => void;
17
+ /** Without a border when it sits inside a panel that has one. */
18
+ border?: boolean;
19
+ }
20
+ export declare const McpErrorBlankslate: ({ state, onRetry, border, }: McpErrorBlankslateProps) => JSX.Element;
21
+ export default McpErrorBlankslate;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Text } from '@primer/react';
3
+ import { Blankslate } from '@primer/react/experimental';
4
+ import { AlertIcon, LockIcon, SearchIcon, ShieldLockIcon, StopIcon, } from '@primer/octicons-react';
5
+ import { Box } from '@datalayer/primer-addons';
6
+ const VISUAL = {
7
+ unauthenticated: ShieldLockIcon,
8
+ forbidden: LockIcon,
9
+ 'not-found': SearchIcon,
10
+ unavailable: StopIcon,
11
+ unknown: AlertIcon,
12
+ };
13
+ export const McpErrorBlankslate = ({ state, onRetry, border = true, }) => {
14
+ const Icon = VISUAL[state.reason];
15
+ return (_jsx(Box, { sx: { width: '100%', minWidth: 0 }, children: _jsxs(Blankslate, { border: border, spacious: true, children: [_jsx(Blankslate.Visual, { children: _jsx(Icon, { size: "medium" }) }), _jsx(Blankslate.Heading, { children: state.heading }), _jsx(Blankslate.Description, { children: _jsx(Text, { sx: { textAlign: 'center' }, children: state.description }) }), state.retryable && onRetry && (_jsx(Button, { size: "small", onClick: onRetry, children: "Try again" }))] }) }));
16
+ };
17
+ export default McpErrorBlankslate;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The scopes a grant carries, as labels.
3
+ *
4
+ * A grant with a dozen scopes would push every other column off the row, so
5
+ * the list shows the first few and says how many more there are; the whole
6
+ * list is in the title, which is where a reader who needs it looks.
7
+ *
8
+ * The `+N` is **not** a Primer `Tooltip`. That component requires an
9
+ * interactive child and warns otherwise, for a good reason: a tooltip on a
10
+ * span appears on hover and nowhere else, so it does not exist for anybody
11
+ * using a keyboard or a screen reader. Wrapping the count in a `<button>`
12
+ * would silence the warning by trading one problem for another — a tab stop
13
+ * that announces itself as a button and does nothing when pressed.
14
+ *
15
+ * So the scopes go where they are actually readable: `title` for the mouse,
16
+ * and the accessible name for everything else. Which is what the sentence
17
+ * above always said.
18
+ *
19
+ * @module components/mcp/ScopeList
20
+ */
21
+ import type { JSX } from 'react';
22
+ export interface ScopeListProps {
23
+ scopes: string[];
24
+ /** How many are drawn before the rest become a count. */
25
+ max?: number;
26
+ }
27
+ export declare const ScopeList: ({ scopes, max }: ScopeListProps) => JSX.Element;
28
+ export default ScopeList;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Label, Text } from '@primer/react';
3
+ import { Box } from '@datalayer/primer-addons';
4
+ export const ScopeList = ({ scopes, max = 3 }) => {
5
+ if (scopes.length === 0) {
6
+ // A grant with no scope grants nothing, which is worth saying rather
7
+ // than drawing as an empty cell.
8
+ return _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "No scope" });
9
+ }
10
+ const shown = scopes.slice(0, max);
11
+ const rest = scopes.length - shown.length;
12
+ return (_jsxs(Box, { sx: { display: 'flex', gap: 1, flexWrap: 'wrap', alignItems: 'center' }, children: [shown.map(scope => (_jsx(Label, { size: "small", variant: "secondary", children: scope }, scope))), rest > 0 && (_jsxs(Text, { as: "span", title: scopes.join('\n'), "aria-label": `and ${rest} more: ${scopes.slice(max).join(', ')}`, sx: { fontSize: 0, color: 'fg.muted' }, children: ["+", rest] }))] }));
13
+ };
14
+ export default ScopeList;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The pieces every MCP surface is drawn from, so a client, a scope and a
3
+ * failure look the same on the dashboard, in the settings and in the
4
+ * Enterprise console.
5
+ *
6
+ * @module components/mcp
7
+ */
8
+ export * from './ClientBadge';
9
+ export * from './McpErrorBlankslate';
10
+ export * from './ScopeList';
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Copyright (c) 2023-2025 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /*
6
+ * Copyright (c) 2023-2026 Datalayer, Inc.
7
+ * Distributed under the terms of the Modified BSD License.
8
+ */
9
+ /**
10
+ * The pieces every MCP surface is drawn from, so a client, a scope and a
11
+ * failure look the same on the dashboard, in the settings and in the
12
+ * Enterprise console.
13
+ *
14
+ * @module components/mcp
15
+ */
16
+ export * from './ClientBadge.js';
17
+ export * from './McpErrorBlankslate.js';
18
+ export * from './ScopeList.js';
@@ -1,5 +1,6 @@
1
+ import React from 'react';
1
2
  export declare function NavigationVisbilityObserver({ children, className, ...rest }: {
2
3
  [x: string]: any;
3
4
  children: any;
4
5
  className: any;
5
- }): import("react/jsx-runtime").JSX.Element;
6
+ }): React.JSX.Element;
@@ -34,13 +34,18 @@ export type SubdomainNavBarProps = {
34
34
  */
35
35
  logoHref?: string;
36
36
  };
37
- declare function Root({ children, className, fixed, fullWidth, logoHref, title, titleHref, ...rest }: SubdomainNavBarProps): import("react/jsx-runtime").JSX.Element;
37
+ declare function Root({ children, className, fixed, fullWidth, logoHref, title, titleHref, ...rest }: SubdomainNavBarProps): React.JSX.Element;
38
38
  type LinkProps = {
39
39
  href: string;
40
40
  isExternal?: boolean;
41
41
  target?: string;
42
+ /**
43
+ * Set from the link's own text when the overflow menu clones it, so
44
+ * `useVisibilityObserver` can track which items are visible.
45
+ */
46
+ 'data-navitemid'?: React.ReactNode;
42
47
  } & React.DetailedHTMLProps<React.LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>;
43
- declare function Link({ href, className, children, isExternal, target, ...rest }: PropsWithChildren<LinkProps>): import("react/jsx-runtime").JSX.Element;
48
+ declare function Link({ href, className, children, isExternal, target, ...rest }: PropsWithChildren<LinkProps>): React.JSX.Element;
44
49
  export type SubdomainNavBarSearchResultProps = {
45
50
  title: string;
46
51
  description: string;
@@ -51,7 +56,7 @@ export type SubdomainNavBarSearchResultProps = {
51
56
  type SearchProps = {
52
57
  onSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
53
58
  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
54
- ref: React.RefObject<HTMLInputElement>;
59
+ ref: React.RefObject<HTMLInputElement | null>;
55
60
  active?: boolean;
56
61
  title?: string;
57
62
  handlerFn?: (event: MouseEvent | TouchEvent | FocusEvent) => void;
@@ -63,8 +68,8 @@ type CTAActionProps = {
63
68
  hasArrow?: boolean;
64
69
  size?: string;
65
70
  } & React.HTMLAttributes<HTMLAnchorElement>;
66
- declare function PrimaryAction({ children, ...rest }: PropsWithChildren<CTAActionProps>): import("react/jsx-runtime").JSX.Element;
67
- declare function SecondaryAction({ children, ...rest }: PropsWithChildren<CTAActionProps>): import("react/jsx-runtime").JSX.Element;
71
+ declare function PrimaryAction({ children, ...rest }: PropsWithChildren<CTAActionProps>): React.JSX.Element;
72
+ declare function SecondaryAction({ children, ...rest }: PropsWithChildren<CTAActionProps>): React.JSX.Element;
68
73
  export declare const SubdomainNavBar: typeof Root & {
69
74
  Link: typeof Link;
70
75
  Search: React.ForwardRefExoticComponent<Omit<SearchProps, "ref"> & React.RefAttributes<unknown>>;
@@ -81,7 +81,8 @@ function Root({ children, className, fixed = true, fullWidth = false, logoHref =
81
81
  []).length > 0;
82
82
  const menuItems = useMemo(() => React.Children.toArray(children)
83
83
  .map((child, index) => {
84
- if (React.isValidElement(child) && typeof child.type !== 'string') {
84
+ if (React.isValidElement(child) &&
85
+ typeof child.type !== 'string') {
85
86
  if (child.type === Link) {
86
87
  return React.cloneElement(child, {
87
88
  'data-navitemid': child.props.children,
@@ -3,5 +3,5 @@ type IJupyterNotebooProps = {
3
3
  boxPanel: BoxPanel;
4
4
  height?: string;
5
5
  };
6
- export declare const JupyterNotebook: ({ boxPanel, height, }: IJupyterNotebooProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const JupyterNotebook: ({ boxPanel, height, }: IJupyterNotebooProps) => import("react").JSX.Element;
7
7
  export default JupyterNotebook;
@@ -1,2 +1,2 @@
1
- export declare const JupyterNotebookToolbar: () => import("react/jsx-runtime").JSX.Element;
1
+ export declare const JupyterNotebookToolbar: () => import("react").JSX.Element;
2
2
  export default JupyterNotebookToolbar;
@@ -1,3 +1,4 @@
1
+ import type { JSX } from 'react';
1
2
  import { type ComponentType, type SVGProps } from 'react';
2
3
  import { SvgAboutHero } from '@datalayer/design/lib/svg/SvgAboutHero';
3
4
  import { SvgAgentsHero } from '@datalayer/design/lib/svg/SvgAgentsHero';
@@ -1,12 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /*
3
- * Copyright (c) 2023-2025 Datalayer, Inc.
4
- * Distributed under the terms of the Modified BSD License.
5
- */
6
- /*
7
- * Copyright (c) 2023-2026 Datalayer, Inc.
8
- * Distributed under the terms of the Modified BSD License.
9
- */
10
2
  import { useEffect, useState } from 'react';
11
3
  import { Box, Button, Text, Tooltip } from '@primer/react';
12
4
  import { Dialog } from '@primer/react/experimental';
@@ -1,3 +1,4 @@
1
+ import type { JSX } from 'react';
1
2
  import { type PrincipalType } from './PrincipalAppearance';
2
3
  export type PrincipalAvatarKind = PrincipalType;
3
4
  export type PrincipalAvatarProps = {
@@ -1,12 +1,8 @@
1
1
  import { 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
2
  import { Box } from '@datalayer/primer-addons';
7
3
  import { OrganizationIcon, PeopleIcon } from '@primer/octicons-react';
8
4
  import { UserAvatar } from '../avatars/index.js';
9
- import { getPrincipalAvatarIcon } from './PrincipalAppearance.js';
5
+ import { getPrincipalAvatarIcon, } from './PrincipalAppearance.js';
10
6
  function getFallbackIconSize(size) {
11
7
  return Math.max(12, Math.round(size * 0.62));
12
8
  }
@@ -17,6 +13,18 @@ export function PrincipalAvatar({ kind, avatarUrl, avatarIcon, alt, size = 20, s
17
13
  const ringSx = ring
18
14
  ? { boxShadow: '0 0 0 1px var(--borderColor-default, currentColor)' }
19
15
  : undefined;
16
+ /*
17
+ * A person is drawn by `UserAvatar`, whatever they wear.
18
+ *
19
+ * It is the single source of truth for a user's avatar — a photograph, a
20
+ * chosen icon, or the default one — and it sets a chosen icon on the tinted
21
+ * disc that makes it read as an avatar rather than as a loose glyph.
22
+ * Answering the icon here first drew that same icon WITHOUT the disc, so a
23
+ * person who had chosen one was a bare drawing among circles.
24
+ */
25
+ if (kind === 'personal') {
26
+ return (_jsx(UserAvatar, { avatarUrl: avatarUrl, avatarIcon: avatarIcon, size: size, square: square, iconSize: getFallbackIconSize(size), ring: ring, className: className }));
27
+ }
20
28
  if (SelectedIcon) {
21
29
  return (_jsx(Box, { className: className, sx: {
22
30
  width: size,
@@ -26,11 +34,11 @@ export function PrincipalAvatar({ kind, avatarUrl, avatarIcon, alt, size = 20, s
26
34
  justifyContent: 'center',
27
35
  overflow: 'hidden',
28
36
  borderRadius: square ? 2 : '50%',
37
+ // The disc of `UserAvatar`, for the same reason: the shape is what
38
+ // says "avatar", and an icon drawn on nothing shows none of it.
39
+ bg: 'accent.subtle',
29
40
  ...ringSx,
30
- }, "aria-label": alt || `${kind} avatar`, children: _jsx(SelectedIcon, { size: size, themed: true, colormode: true }) }));
31
- }
32
- if (kind === 'personal') {
33
- return (_jsx(UserAvatar, { avatarUrl: avatarUrl, avatarIcon: avatarIcon, size: size, square: square, iconSize: getFallbackIconSize(size), ring: ring, className: className }));
41
+ }, "aria-label": alt || `${kind} avatar`, children: _jsx(SelectedIcon, { size: getFallbackIconSize(size), themed: true, colormode: true }) }));
34
42
  }
35
43
  const iconSize = getFallbackIconSize(size);
36
44
  const borderRadius = square ? 2 : '50%';
@@ -16,5 +16,5 @@ type PrincipalBadgeProps = {
16
16
  * (user / organization / team). Falls back to the currently selected
17
17
  * principal when no explicit `principal` prop is supplied.
18
18
  */
19
- export declare const PrincipalBadge: ({ principal: providedPrincipal, showPrincipalLabel, showApplyingToText, showOriginLabel, principalLabel, isAdmin, sx, }?: PrincipalBadgeProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const PrincipalBadge: ({ principal: providedPrincipal, showPrincipalLabel, showApplyingToText, showOriginLabel, principalLabel, isAdmin, sx, }?: PrincipalBadgeProps) => import("react").JSX.Element;
20
20
  export default PrincipalBadge;
@@ -3,5 +3,5 @@ export type PrincipalBannerProps = {
3
3
  caption?: string;
4
4
  rightContent?: ReactNode;
5
5
  };
6
- export declare const PrincipalBanner: ({ caption, rightContent, }: PrincipalBannerProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const PrincipalBanner: ({ caption, rightContent, }: PrincipalBannerProps) => import("react").JSX.Element;
7
7
  export default PrincipalBanner;
@@ -1,3 +1,4 @@
1
+ import type { JSX } from 'react';
1
2
  export type PrincipalKind = 'personal' | 'team' | 'organization';
2
3
  export type PrincipalDetailsOverlayProps = {
3
4
  kind: PrincipalKind;
@@ -20,6 +21,20 @@ export type PrincipalDetailsOverlayProps = {
20
21
  /** Team/organization visibility. */
21
22
  isPublic?: boolean;
22
23
  isAdmin?: boolean;
24
+ /**
25
+ * Show a route some other way than through the router of this subtree.
26
+ *
27
+ * The card is also shown inside the notebook and document editors, which
28
+ * JupyterLab embeds under a `MemoryRouter` of their own — a router with none
29
+ * of the application's routes behind it, where a `navigate` reaches nobody.
30
+ * Those editors hand the route to the view that does have the routes; the
31
+ * profile then renders there, navigated to rather than loaded, and the page
32
+ * is never reloaded.
33
+ *
34
+ * Left out, the route is followed with `useNavigate`, which is what the web
35
+ * application and the Datalayer view both want.
36
+ */
37
+ onNavigate?: (path: string) => void;
23
38
  };
24
39
  export declare function buildPrincipalProfilePath({ kind, uid, handle, accountHandle, isAdmin, }: {
25
40
  kind: PrincipalKind;
@@ -28,5 +43,20 @@ export declare function buildPrincipalProfilePath({ kind, uid, handle, accountHa
28
43
  accountHandle?: string;
29
44
  isAdmin?: boolean;
30
45
  }): string | null;
31
- export declare function PrincipalDetailsOverlay({ kind, uid, displayName, name, description, handle, accountHandle, firstName, lastName, email, origin, avatarUrl, avatarIcon, organizationName, memberCount, isPublic, isAdmin, }: PrincipalDetailsOverlayProps): JSX.Element;
46
+ /**
47
+ * The card of a principal, on its own — avatar, identity, and the buttons.
48
+ *
49
+ * The body every surface that shows a principal shares: the click overlay
50
+ * anchored on a name ({@link PrincipalDetailsOverlay}) and the hover card
51
+ * anchored on an avatar ({@link PrincipalHoverCard}) both render this, so
52
+ * the two never drift.
53
+ */
54
+ export declare function PrincipalDetailsCard({ kind, uid, displayName, name, description, handle, accountHandle, firstName, lastName, email, origin, avatarUrl, avatarIcon, organizationName, memberCount, isPublic, isAdmin, onNavigate, }: PrincipalDetailsOverlayProps): JSX.Element;
55
+ /**
56
+ * A principal's details, shown from a click on their name.
57
+ *
58
+ * The name is the anchor; clicking it opens the shared
59
+ * {@link PrincipalDetailsCard}.
60
+ */
61
+ export declare function PrincipalDetailsOverlay(props: PrincipalDetailsOverlayProps): JSX.Element;
32
62
  export default PrincipalDetailsOverlay;
@@ -1,8 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /*
3
- * Copyright (c) 2023-2025 Datalayer, Inc.
4
- * Distributed under the terms of the Modified BSD License.
5
- */
6
2
  import { ActionMenu, Box, Button, Label, Text, ThemeProvider, } from '@primer/react';
7
3
  import { useNavigate } from '../../hooks/index.js';
8
4
  import { PrincipalAvatar } from './PrincipalAvatar.js';
@@ -80,8 +76,30 @@ export function buildPrincipalProfilePath({ kind, uid, handle, accountHandle, is
80
76
  }
81
77
  return null;
82
78
  }
83
- export function PrincipalDetailsOverlay({ kind, uid, displayName, name, description, handle, accountHandle, firstName, lastName, email, origin, avatarUrl, avatarIcon, organizationName, memberCount, isPublic, isAdmin = false, }) {
79
+ /**
80
+ * The card of a principal, on its own — avatar, identity, and the buttons.
81
+ *
82
+ * The body every surface that shows a principal shares: the click overlay
83
+ * anchored on a name ({@link PrincipalDetailsOverlay}) and the hover card
84
+ * anchored on an avatar ({@link PrincipalHoverCard}) both render this, so
85
+ * the two never drift.
86
+ */
87
+ export function PrincipalDetailsCard({ kind, uid, displayName, name, description, handle, accountHandle, firstName, lastName, email, origin, avatarUrl, avatarIcon, organizationName, memberCount, isPublic, isAdmin = false, onNavigate, }) {
84
88
  const navigate = useNavigate();
89
+ // Where a profile or organization link goes: the router of this subtree,
90
+ // unless the caller knows of one that can actually serve it — see
91
+ // `onNavigate`. Either way it is a navigation, never a page load.
92
+ const go = (path) => {
93
+ if (!path) {
94
+ return;
95
+ }
96
+ if (onNavigate) {
97
+ onNavigate(path);
98
+ }
99
+ else {
100
+ navigate(path);
101
+ }
102
+ };
85
103
  const normalizedDisplayName = normalize(displayName) ||
86
104
  normalize(handle) ||
87
105
  normalize(uid) ||
@@ -117,6 +135,46 @@ export function PrincipalDetailsOverlay({ kind, uid, displayName, name, descript
117
135
  const organizationPath = teamOrganizationHandle
118
136
  ? `/${teamOrganizationHandle.replace(/^@+/, '')}`
119
137
  : '';
138
+ return (_jsxs(Box, { sx: { display: 'grid', gap: 3, p: 4, minWidth: 420 }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(PrincipalAvatar, { kind: kind, avatarUrl: avatarUrl, avatarIcon: avatarIcon, alt: normalizedDisplayName, size: 40,
139
+ // The card sets the avatar on its own ground, the same colour
140
+ // the avatar itself is on: without an edge of its own it has
141
+ // no visible shape at all. Round, and ringed.
142
+ square: false, ring: true }), _jsxs(Box, { sx: { display: 'grid', gap: 0.5 }, children: [_jsx(Text, { sx: { fontWeight: 'semibold' }, children: normalizedDisplayName }), kind === 'team' ? (teamHandleOnly ? (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: [displayHandleText(teamHandleOnly), teamOrganizationHandle
143
+ ? ` · @${teamOrganizationHandle.replace(/^@+/, '')}`
144
+ : ''] })) : null) : resolvedHandle ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: displayHandleText(resolvedHandle) })) : null] })] }), _jsxs(Box, { sx: {
145
+ display: 'grid',
146
+ gridTemplateColumns: '110px 1fr',
147
+ gap: 1,
148
+ alignItems: 'baseline',
149
+ }, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Kind" }), _jsx(Text, { sx: { fontSize: 1 }, children: kind }), resolvedHandle && kind !== 'team' ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Handle" }), _jsx(Text, { sx: { fontSize: 1 }, children: displayHandleText(resolvedHandle) })] })) : null, normalizedUid ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "UID" }), _jsx(Text, { sx: { fontSize: 1 }, children: normalizedUid })] })) : null, kind === 'personal' ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "First name" }), _jsx(Text, { sx: { fontSize: 1 }, children: firstName || 'N/A' }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Last name" }), _jsx(Text, { sx: { fontSize: 1 }, children: lastName || 'N/A' }), email ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Email" }), _jsx(Text, { sx: { fontSize: 1 }, children: email })] })) : null, _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Origin" }), _jsx(Label, { size: "small", variant: "secondary", title: normalizedOrigin, sx: {
150
+ justifySelf: 'start',
151
+ width: 'fit-content',
152
+ maxWidth: '100%',
153
+ overflow: 'hidden',
154
+ textOverflow: 'ellipsis',
155
+ whiteSpace: 'nowrap',
156
+ }, children: normalizedOrigin })] })) : (_jsxs(_Fragment, { children: [kind === 'team' && teamHandleOnly ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Handle" }), _jsx(Text, { sx: { fontSize: 1 }, children: displayHandleText(teamHandleOnly) })] })) : null, kind === 'team' && teamOrganizationHandle ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Organization" }), _jsx(Text, { sx: { fontSize: 1 }, children: normalizedOrganizationName
157
+ ? `${normalizedOrganizationName} (${displayHandleText(teamOrganizationHandle)})`
158
+ : displayHandleText(teamOrganizationHandle) })] })) : null, _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Name" }), _jsx(Text, { sx: { fontSize: 1 }, children: normalizedName || normalizedDisplayName }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Description" }), _jsx(Text, { sx: { fontSize: 1 }, children: normalizedDescription || 'N/A' }), kind === 'team' && typeof memberCount === 'number' ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Members" }), _jsxs(Text, { sx: { fontSize: 1 }, children: [memberCount, " ", memberCount === 1 ? 'member' : 'members'] })] })) : null, typeof isPublic === 'boolean' ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Visibility" }), _jsx(Label, { size: "small", variant: isPublic ? 'success' : 'secondary', sx: { justifySelf: 'start', width: 'fit-content' }, children: isPublic ? 'Public' : 'Private' })] })) : null, _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Origin" }), _jsx(Label, { size: "small", variant: "secondary", title: normalizedOrigin, sx: {
159
+ justifySelf: 'start',
160
+ width: 'fit-content',
161
+ maxWidth: '100%',
162
+ overflow: 'hidden',
163
+ textOverflow: 'ellipsis',
164
+ whiteSpace: 'nowrap',
165
+ }, children: normalizedOrigin })] }))] }), _jsxs(Box, { sx: { display: 'flex', justifyContent: 'flex-end', gap: 2 }, children: [kind === 'team' && organizationPath ? (_jsx(Button, { size: "small", variant: "invisible", onClick: () => go(organizationPath), children: "View Organization" })) : null, _jsx(Button, { size: "small", onClick: () => go(targetPath), disabled: !targetPath, children: "View Profile" })] })] }));
166
+ }
167
+ /**
168
+ * A principal's details, shown from a click on their name.
169
+ *
170
+ * The name is the anchor; clicking it opens the shared
171
+ * {@link PrincipalDetailsCard}.
172
+ */
173
+ export function PrincipalDetailsOverlay(props) {
174
+ const normalizedDisplayName = normalize(props.displayName) ||
175
+ normalize(props.handle) ||
176
+ normalize(props.uid) ||
177
+ 'Principal';
120
178
  return (_jsx(ThemeProvider, { children: _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Box, { as: "button", type: "button", sx: {
121
179
  fontWeight: 'semibold',
122
180
  color: 'accent.fg',
@@ -129,33 +187,6 @@ export function PrincipalDetailsOverlay({ kind, uid, displayName, name, descript
129
187
  ':hover': {
130
188
  textDecoration: 'underline',
131
189
  },
132
- }, children: normalizedDisplayName }) }), _jsx(ActionMenu.Overlay, { width: "large", children: _jsxs(Box, { sx: { display: 'grid', gap: 3, p: 4, minWidth: 420 }, children: [_jsxs(Box, { sx: { display: 'flex', alignItems: 'center', gap: 2 }, children: [_jsx(PrincipalAvatar, { kind: kind, avatarUrl: avatarUrl, avatarIcon: avatarIcon, alt: normalizedDisplayName, size: 40 }), _jsxs(Box, { sx: { display: 'grid', gap: 0.5 }, children: [_jsx(Text, { sx: { fontWeight: 'semibold' }, children: normalizedDisplayName }), kind === 'team' ? (teamHandleOnly ? (_jsxs(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: [displayHandleText(teamHandleOnly), teamOrganizationHandle
133
- ? ` · @${teamOrganizationHandle.replace(/^@+/, '')}`
134
- : ''] })) : null) : resolvedHandle ? (_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: displayHandleText(resolvedHandle) })) : null] })] }), _jsxs(Box, { sx: {
135
- display: 'grid',
136
- gridTemplateColumns: '110px 1fr',
137
- gap: 1,
138
- alignItems: 'baseline',
139
- }, children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Kind" }), _jsx(Text, { sx: { fontSize: 1 }, children: kind }), resolvedHandle && kind !== 'team' ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Handle" }), _jsx(Text, { sx: { fontSize: 1 }, children: displayHandleText(resolvedHandle) })] })) : null, normalizedUid ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "UID" }), _jsx(Text, { sx: { fontSize: 1 }, children: normalizedUid })] })) : null, kind === 'personal' ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "First name" }), _jsx(Text, { sx: { fontSize: 1 }, children: firstName || 'N/A' }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Last name" }), _jsx(Text, { sx: { fontSize: 1 }, children: lastName || 'N/A' }), email ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Email" }), _jsx(Text, { sx: { fontSize: 1 }, children: email })] })) : null, _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Origin" }), _jsx(Label, { size: "small", variant: "secondary", title: normalizedOrigin, sx: {
140
- justifySelf: 'start',
141
- width: 'fit-content',
142
- maxWidth: '100%',
143
- overflow: 'hidden',
144
- textOverflow: 'ellipsis',
145
- whiteSpace: 'nowrap',
146
- }, children: normalizedOrigin })] })) : (_jsxs(_Fragment, { children: [kind === 'team' && teamHandleOnly ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Handle" }), _jsx(Text, { sx: { fontSize: 1 }, children: displayHandleText(teamHandleOnly) })] })) : null, kind === 'team' && teamOrganizationHandle ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Organization" }), _jsx(Text, { sx: { fontSize: 1 }, children: normalizedOrganizationName
147
- ? `${normalizedOrganizationName} (${displayHandleText(teamOrganizationHandle)})`
148
- : displayHandleText(teamOrganizationHandle) })] })) : null, _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Name" }), _jsx(Text, { sx: { fontSize: 1 }, children: normalizedName || normalizedDisplayName }), _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Description" }), _jsx(Text, { sx: { fontSize: 1 }, children: normalizedDescription || 'N/A' }), kind === 'team' && typeof memberCount === 'number' ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Members" }), _jsxs(Text, { sx: { fontSize: 1 }, children: [memberCount, " ", memberCount === 1 ? 'member' : 'members'] })] })) : null, typeof isPublic === 'boolean' ? (_jsxs(_Fragment, { children: [_jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Visibility" }), _jsx(Label, { size: "small", variant: isPublic ? 'success' : 'secondary', sx: { justifySelf: 'start', width: 'fit-content' }, children: isPublic ? 'Public' : 'Private' })] })) : null, _jsx(Text, { sx: { fontSize: 0, color: 'fg.muted' }, children: "Origin" }), _jsx(Label, { size: "small", variant: "secondary", title: normalizedOrigin, sx: {
149
- justifySelf: 'start',
150
- width: 'fit-content',
151
- maxWidth: '100%',
152
- overflow: 'hidden',
153
- textOverflow: 'ellipsis',
154
- whiteSpace: 'nowrap',
155
- }, children: normalizedOrigin })] }))] }), _jsxs(Box, { sx: { display: 'flex', justifyContent: 'flex-end', gap: 2 }, children: [kind === 'team' && organizationPath ? (_jsx(Button, { size: "small", variant: "invisible", onClick: () => navigate(organizationPath), children: "View Organization" })) : null, _jsx(Button, { size: "small", onClick: () => {
156
- if (targetPath) {
157
- navigate(targetPath);
158
- }
159
- }, disabled: !targetPath, children: "View Profile" })] })] }) })] }) }));
190
+ }, children: normalizedDisplayName }) }), _jsx(ActionMenu.Overlay, { width: "large", children: _jsx(PrincipalDetailsCard, { ...props }) })] }) }));
160
191
  }
161
192
  export default PrincipalDetailsOverlay;