zidane-ui 9.2.3 → 9.4.0

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 (354) hide show
  1. package/dist/adapters/live.d.ts +8 -0
  2. package/dist/adapters/live.js +19 -8
  3. package/dist/adapters/server-composer-host.js +22 -9
  4. package/dist/adapters/server-git-host.js +5 -2
  5. package/dist/adapters/server-host.js +158 -27
  6. package/dist/adapters/server-machines-host.js +7 -0
  7. package/dist/adapters/server-media.d.ts +9 -1
  8. package/dist/adapters/server-media.js +14 -1
  9. package/dist/adapters/server-session-host.js +49 -0
  10. package/dist/adapters/server-settings-sections.js +4 -1
  11. package/dist/adapters/sse-host.js +3 -0
  12. package/dist/adapters/sse-protocol.d.ts +10 -0
  13. package/dist/appearance/ZoomIndicator.js +5 -8
  14. package/dist/chat/HostTranscript.d.ts +0 -12
  15. package/dist/chat/HostTranscript.js +20 -1
  16. package/dist/chat/SessionStreamsProvider.d.ts +9 -1
  17. package/dist/chat/SessionStreamsProvider.js +11 -2
  18. package/dist/chat/Transcript.d.ts +21 -11
  19. package/dist/chat/Transcript.js +346 -161
  20. package/dist/chat/composer/ModelOptionsPicker.js +6 -2
  21. package/dist/chat/composer/ModelPicker.d.ts +1 -1
  22. package/dist/chat/composer/PlacePicker.d.ts +3 -1
  23. package/dist/chat/composer/PlacePicker.js +5 -1
  24. package/dist/chat/composer/use-draft-target.js +15 -3
  25. package/dist/chat/headless/block-runs.js +26 -1
  26. package/dist/chat/headless/chip-views.js +1 -1
  27. package/dist/chat/headless/draft-target.d.ts +28 -1
  28. package/dist/chat/headless/draft-target.js +22 -1
  29. package/dist/chat/headless/host.d.ts +43 -7
  30. package/dist/chat/headless/hosts.d.ts +4 -0
  31. package/dist/chat/headless/index.d.ts +27 -26
  32. package/dist/chat/headless/index.js +15 -14
  33. package/dist/chat/headless/labels.d.ts +17 -0
  34. package/dist/chat/headless/labels.js +17 -0
  35. package/dist/chat/headless/markdown-chunks.d.ts +2 -1
  36. package/dist/chat/headless/markdown-chunks.js +12 -20
  37. package/dist/chat/headless/markdown-scan.d.ts +64 -0
  38. package/dist/chat/headless/markdown-scan.js +119 -0
  39. package/dist/chat/headless/markdown-stream.d.ts +64 -0
  40. package/dist/chat/headless/markdown-stream.js +143 -0
  41. package/dist/chat/headless/output-pager.d.ts +68 -0
  42. package/dist/chat/headless/output-pager.js +113 -0
  43. package/dist/chat/headless/prompt-origin.d.ts +2 -0
  44. package/dist/chat/headless/prompt-origin.js +6 -2
  45. package/dist/chat/headless/session-list.d.ts +10 -0
  46. package/dist/chat/headless/sidebar/activity.d.ts +14 -0
  47. package/dist/chat/headless/sidebar/activity.js +32 -0
  48. package/dist/chat/headless/sidebar/directory.d.ts +19 -2
  49. package/dist/chat/headless/sidebar/directory.js +19 -51
  50. package/dist/chat/headless/sidebar/environment.d.ts +15 -4
  51. package/dist/chat/headless/sidebar/environment.js +27 -9
  52. package/dist/chat/headless/sidebar/index.d.ts +2 -2
  53. package/dist/chat/headless/sidebar/index.js +2 -2
  54. package/dist/chat/headless/sidebar/labels.d.ts +19 -2
  55. package/dist/chat/headless/sidebar/labels.js +8 -1
  56. package/dist/chat/headless/sidebar/prewarm.d.ts +68 -0
  57. package/dist/chat/headless/sidebar/prewarm.js +114 -0
  58. package/dist/chat/headless/streams/actions.d.ts +4 -2
  59. package/dist/chat/headless/streams/actions.js +2 -1
  60. package/dist/chat/headless/streams/event-bytes.d.ts +17 -0
  61. package/dist/chat/headless/streams/event-bytes.js +46 -0
  62. package/dist/chat/headless/streams/live-events.d.ts +25 -1
  63. package/dist/chat/headless/streams/live-events.js +53 -2
  64. package/dist/chat/headless/streams/selectors.d.ts +3 -0
  65. package/dist/chat/headless/streams/selectors.js +8 -1
  66. package/dist/chat/headless/streams/session-streams.d.ts +15 -3
  67. package/dist/chat/headless/streams/session-streams.js +31 -3
  68. package/dist/chat/headless/streams/store.d.ts +45 -6
  69. package/dist/chat/headless/streams/store.js +85 -31
  70. package/dist/chat/headless/streams/transcript-map.d.ts +57 -0
  71. package/dist/chat/headless/streams/transcript-map.js +85 -0
  72. package/dist/chat/headless/streams/transcript.d.ts +4 -2
  73. package/dist/chat/headless/streams/transcript.js +19 -7
  74. package/dist/chat/headless/streams/types.d.ts +2 -1
  75. package/dist/chat/headless/transcript/batch.js +5 -1
  76. package/dist/chat/headless/transcript/blob-media.d.ts +15 -0
  77. package/dist/chat/headless/transcript/blob-media.js +23 -0
  78. package/dist/chat/headless/transcript/collapse.d.ts +10 -0
  79. package/dist/chat/headless/transcript/collapse.js +35 -6
  80. package/dist/chat/headless/transcript/derive.d.ts +98 -0
  81. package/dist/chat/headless/transcript/derive.js +89 -0
  82. package/dist/chat/headless/transcript/exchange-media.d.ts +3 -1
  83. package/dist/chat/headless/transcript/exchange-media.js +8 -5
  84. package/dist/chat/headless/transcript/fold-attachments.d.ts +2 -0
  85. package/dist/chat/headless/transcript/fold-attachments.js +3 -2
  86. package/dist/chat/headless/transcript/fold.d.ts +2 -1
  87. package/dist/chat/headless/transcript/fold.js +16 -6
  88. package/dist/chat/headless/transcript/incremental.d.ts +53 -0
  89. package/dist/chat/headless/transcript/incremental.js +181 -0
  90. package/dist/chat/headless/transcript/index.d.ts +2 -2
  91. package/dist/chat/headless/transcript/index.js +2 -2
  92. package/dist/chat/headless/transcript/nesting.js +2 -1
  93. package/dist/chat/headless/transcript/rail.d.ts +50 -1
  94. package/dist/chat/headless/transcript/rail.js +165 -23
  95. package/dist/chat/headless/transcript/rows.d.ts +5 -1
  96. package/dist/chat/headless/transcript/run-failures.js +2 -1
  97. package/dist/chat/headless/transcript/seams.d.ts +78 -0
  98. package/dist/chat/headless/transcript/seams.js +116 -0
  99. package/dist/chat/headless/transcript/tool-media.d.ts +6 -7
  100. package/dist/chat/headless/transcript/tool-media.js +27 -9
  101. package/dist/chat/index.d.ts +9 -8
  102. package/dist/chat/index.js +18 -17
  103. package/dist/chat/sidebar/ProjectIcon.js +1 -1
  104. package/dist/chat/sidebar/RowChips.js +2 -2
  105. package/dist/chat/sidebar/SessionSidebar.d.ts +6 -0
  106. package/dist/chat/sidebar/SessionSidebar.js +23 -16
  107. package/dist/chat/sidebar/SidebarFilterMenu.js +0 -1
  108. package/dist/chat/sidebar/SidebarFold.js +17 -16
  109. package/dist/chat/sidebar/SidebarFooter.d.ts +8 -5
  110. package/dist/chat/sidebar/SidebarFooter.js +6 -6
  111. package/dist/chat/sidebar/SidebarSessionRow.d.ts +7 -1
  112. package/dist/chat/sidebar/SidebarSessionRow.js +11 -8
  113. package/dist/chat/sidebar/session-menu.d.ts +4 -0
  114. package/dist/chat/sidebar/session-menu.js +14 -2
  115. package/dist/chat/sidebar/sidebar-live.js +28 -4
  116. package/dist/chat/sidebar/useInboxRows.js +6 -6
  117. package/dist/chat/sidebar/useInboxTriage.js +50 -47
  118. package/dist/chat/sidebar/useSessionSearch.js +19 -18
  119. package/dist/chat/testing/contract.d.ts +5 -3
  120. package/dist/chat/testing/contract.js +66 -1
  121. package/dist/chat/transcript/DiffLines.d.ts +6 -1
  122. package/dist/chat/transcript/DiffLines.js +35 -20
  123. package/dist/chat/transcript/EditDiffBlock.d.ts +5 -1
  124. package/dist/chat/transcript/EditDiffBlock.js +89 -30
  125. package/dist/chat/transcript/FileChip.js +28 -0
  126. package/dist/chat/transcript/LazyRow.d.ts +40 -40
  127. package/dist/chat/transcript/LazyRow.js +100 -149
  128. package/dist/chat/transcript/MermaidDiagram.js +2 -1
  129. package/dist/chat/transcript/PromptEcho.js +3 -11
  130. package/dist/chat/transcript/SessionChip.d.ts +11 -0
  131. package/dist/chat/transcript/SessionChip.js +34 -0
  132. package/dist/chat/transcript/SubagentBlock.js +3 -2
  133. package/dist/chat/transcript/TranscriptRail.d.ts +25 -2
  134. package/dist/chat/transcript/TranscriptRail.js +175 -17
  135. package/dist/chat/transcript/TranscriptRow.d.ts +4 -7
  136. package/dist/chat/transcript/TranscriptRow.js +4 -3
  137. package/dist/chat/transcript/actions.d.ts +37 -1
  138. package/dist/chat/transcript/actions.js +27 -1
  139. package/dist/chat/transcript/chip-details.d.ts +11 -0
  140. package/dist/chat/transcript/chip-details.js +17 -1
  141. package/dist/chat/transcript/clipped-output.d.ts +58 -0
  142. package/dist/chat/transcript/clipped-output.js +131 -0
  143. package/dist/chat/transcript/fold-attachments.js +10 -5
  144. package/dist/chat/transcript/fold-worker.js +5 -3
  145. package/dist/chat/transcript/fold.js +13 -4
  146. package/dist/chat/transcript/index.d.ts +11 -10
  147. package/dist/chat/transcript/index.js +10 -9
  148. package/dist/chat/transcript/markdown-cache.d.ts +17 -2
  149. package/dist/chat/transcript/markdown-cache.js +48 -4
  150. package/dist/chat/transcript/markdown.js +110 -55
  151. package/dist/chat/transcript/media-gallery.d.ts +3 -2
  152. package/dist/chat/transcript/media-gallery.js +19 -19
  153. package/dist/chat/transcript/messages.js +5 -4
  154. package/dist/chat/transcript/notices.js +2 -1
  155. package/dist/chat/transcript/prompt.d.ts +1 -1
  156. package/dist/chat/transcript/prompt.js +6 -4
  157. package/dist/chat/transcript/prose.js +2 -1
  158. package/dist/chat/transcript/root-items.d.ts +96 -0
  159. package/dist/chat/transcript/root-items.js +180 -0
  160. package/dist/chat/transcript/row-mount.d.ts +184 -0
  161. package/dist/chat/transcript/row-mount.js +532 -0
  162. package/dist/chat/transcript/row-parking.d.ts +152 -0
  163. package/dist/chat/transcript/row-parking.js +171 -0
  164. package/dist/chat/transcript/row-ui-state.d.ts +37 -0
  165. package/dist/chat/transcript/row-ui-state.js +53 -0
  166. package/dist/chat/transcript/run-rows.js +3 -2
  167. package/dist/chat/transcript/script-input.d.ts +1 -1
  168. package/dist/chat/transcript/tasks.js +3 -2
  169. package/dist/chat/transcript/tool-media.d.ts +4 -2
  170. package/dist/chat/transcript/tool-media.js +15 -7
  171. package/dist/chat/transcript/tool-parts.d.ts +27 -4
  172. package/dist/chat/transcript/tool-parts.js +31 -6
  173. package/dist/chat/transcript/tool-payload.js +26 -11
  174. package/dist/chat/transcript/tool-row.d.ts +2 -1
  175. package/dist/chat/transcript/tool-row.js +38 -19
  176. package/dist/chat/transcript/use-transcript-rows.d.ts +25 -8
  177. package/dist/chat/transcript/use-transcript-rows.js +28 -46
  178. package/dist/chat/transcript/useHistoryBackfill.d.ts +42 -0
  179. package/dist/chat/transcript/useHistoryBackfill.js +170 -0
  180. package/dist/chat/transcript/useStickToBottom.js +2 -3
  181. package/dist/chat/transcript/useTranscriptFind.js +2 -4
  182. package/dist/chat/transcript/useTranscriptScroll.d.ts +7 -4
  183. package/dist/chat/transcript/useTranscriptScroll.js +12 -1
  184. package/dist/chat/transcript/useTranscriptSearch.d.ts +2 -2
  185. package/dist/chat/transcript/useTranscriptSearch.js +35 -19
  186. package/dist/chat/transcript/useTranscriptSelectionCopy.d.ts +5 -5
  187. package/dist/chat/transcript/useTranscriptSelectionCopy.js +28 -7
  188. package/dist/chat/transcript/view-scope.d.ts +26 -6
  189. package/dist/chat/transcript/view-scope.js +106 -20
  190. package/dist/code/editor/FileTree.d.ts +2 -0
  191. package/dist/code/editor/FileTree.js +1 -1
  192. package/dist/code/editor/FileView.js +16 -25
  193. package/dist/code/editor/find/useFind.js +17 -17
  194. package/dist/code/editor/useCodeDocument.js +22 -19
  195. package/dist/code/editor/useDetachCleanup.js +4 -3
  196. package/dist/code/use-highlighted-html.js +12 -13
  197. package/dist/components/IconButton.d.ts +3 -1
  198. package/dist/components/IconButton.js +7 -2
  199. package/dist/components/IconButtonTip.d.ts +3 -1
  200. package/dist/components/IconButtonTip.js +2 -1
  201. package/dist/components/RowActionsMenu.js +7 -14
  202. package/dist/components/Tooltip.d.ts +4 -1
  203. package/dist/components/Tooltip.js +8 -6
  204. package/dist/components/assign-ref.d.ts +8 -0
  205. package/dist/components/assign-ref.js +12 -0
  206. package/dist/components/floating/FloatingSurface.js +2 -2
  207. package/dist/components/floating/HoverCard.js +32 -14
  208. package/dist/components/floating/Popover.js +4 -7
  209. package/dist/components/floating/useAnchoredPosition.d.ts +5 -3
  210. package/dist/components/floating/useAnchoredPosition.js +7 -7
  211. package/dist/components/object-key.d.ts +7 -0
  212. package/dist/components/object-key.js +18 -0
  213. package/dist/components/palette/PaletteList.js +2 -7
  214. package/dist/components/tooltip-arming.d.ts +3 -0
  215. package/dist/components/tooltip-arming.js +8 -1
  216. package/dist/core.css +3 -3
  217. package/dist/dist/{index-E1Z0aPmi.d.ts → index-BheVJOLc.d.ts} +3 -1
  218. package/dist/dist/index.d.ts +2 -2
  219. package/dist/files/FilesTab.js +0 -1
  220. package/dist/files/TreeColumn.d.ts +2 -4
  221. package/dist/files/TreeColumn.js +0 -5
  222. package/dist/files/headless/host.d.ts +3 -7
  223. package/dist/files/headless/labels.d.ts +0 -1
  224. package/dist/files/headless/labels.js +0 -1
  225. package/dist/files/headless/workspace-diff.js +1 -1
  226. package/dist/files/useCodeReview.js +1 -3
  227. package/dist/files/useFilesDiagnostics.d.ts +1 -1
  228. package/dist/files/useFilesDiagnostics.js +4 -11
  229. package/dist/files/useOpenFiles.js +9 -12
  230. package/dist/files/useWorkspace.d.ts +5 -7
  231. package/dist/files/useWorkspace.js +4 -15
  232. package/dist/git/GitBar.js +5 -3
  233. package/dist/git/MoveSessionDialog.d.ts +18 -8
  234. package/dist/git/MoveSessionDialog.js +32 -53
  235. package/dist/git/MoveToDialog.d.ts +61 -0
  236. package/dist/git/MoveToDialog.js +240 -0
  237. package/dist/git/SandboxManager.js +9 -4
  238. package/dist/git/SyncChip.js +11 -4
  239. package/dist/git/TeleportSessionDialog.d.ts +69 -0
  240. package/dist/git/TeleportSessionDialog.js +440 -0
  241. package/dist/git/headless/host.d.ts +14 -0
  242. package/dist/git/headless/index.d.ts +2 -1
  243. package/dist/git/headless/index.js +2 -1
  244. package/dist/git/headless/labels.d.ts +44 -1
  245. package/dist/git/headless/labels.js +50 -0
  246. package/dist/git/headless/sandboxes.d.ts +1 -1
  247. package/dist/git/headless/sandboxes.js +4 -3
  248. package/dist/git/headless/teleport.d.ts +76 -0
  249. package/dist/git/headless/teleport.js +19 -0
  250. package/dist/git/index.d.ts +4 -2
  251. package/dist/git/index.js +4 -2
  252. package/dist/git/useEnvironmentChoices.d.ts +5 -2
  253. package/dist/git/useEnvironmentChoices.js +12 -4
  254. package/dist/hooks/useLatest.d.ts +8 -0
  255. package/dist/hooks/useLatest.js +17 -0
  256. package/dist/hooks/useMinuteTick.d.ts +6 -2
  257. package/dist/hooks/useMinuteTick.js +12 -6
  258. package/dist/hooks/useNearViewport.js +11 -8
  259. package/dist/index.d.ts +3 -2
  260. package/dist/index.js +2 -1
  261. package/dist/keybindings/KeybindingsProvider.js +3 -4
  262. package/dist/keybindings/headless/catalog.d.ts +1 -1
  263. package/dist/keybindings/headless/catalog.js +18 -0
  264. package/dist/machines/AddServerForm.js +55 -3
  265. package/dist/machines/Banners.d.ts +2 -2
  266. package/dist/machines/Banners.js +3 -3
  267. package/dist/machines/DaemonMenu.js +1 -3
  268. package/dist/machines/HostsSection.js +5 -1
  269. package/dist/machines/OrganizationPanel.d.ts +25 -0
  270. package/dist/machines/OrganizationPanel.js +266 -0
  271. package/dist/machines/PersonalLayerPanel.d.ts +32 -0
  272. package/dist/machines/PersonalLayerPanel.js +360 -0
  273. package/dist/machines/headless/fixture-host.d.ts +10 -0
  274. package/dist/machines/headless/fixture-host.js +44 -0
  275. package/dist/machines/headless/host.d.ts +21 -1
  276. package/dist/machines/headless/index.d.ts +3 -1
  277. package/dist/machines/headless/index.js +3 -1
  278. package/dist/machines/headless/labels.d.ts +55 -0
  279. package/dist/machines/headless/labels.js +58 -1
  280. package/dist/machines/headless/layer.d.ts +64 -0
  281. package/dist/machines/headless/layer.js +56 -0
  282. package/dist/machines/headless/organization.d.ts +38 -0
  283. package/dist/machines/headless/organization.js +44 -0
  284. package/dist/machines/index.d.ts +3 -1
  285. package/dist/machines/index.js +3 -1
  286. package/dist/machines/testing/contract.d.ts +25 -1
  287. package/dist/machines/testing/contract.js +97 -1
  288. package/dist/motion/grow.js +12 -13
  289. package/dist/motion/swap.js +2 -5
  290. package/dist/motion/use-flip-list.d.ts +14 -0
  291. package/dist/motion/use-flip-list.js +17 -12
  292. package/dist/palette/headless/app-sources.js +37 -0
  293. package/dist/palette/headless/labels.js +3 -0
  294. package/dist/server/sse-handler.js +25 -2
  295. package/dist/session/DiffFileTree.js +1 -4
  296. package/dist/session/OpenSessionsDialog.d.ts +46 -0
  297. package/dist/session/OpenSessionsDialog.js +170 -0
  298. package/dist/session/PlanTracker.js +1 -2
  299. package/dist/session/ProjectHome.js +10 -9
  300. package/dist/session/RemindersPanel.js +10 -12
  301. package/dist/session/SecretsPanel.js +2 -1
  302. package/dist/session/SessionHeader.js +1 -0
  303. package/dist/session/SessionPeopleStack.d.ts +23 -0
  304. package/dist/session/SessionPeopleStack.js +65 -0
  305. package/dist/session/SessionPlaceMenu.js +5 -4
  306. package/dist/session/ShareSessionDialog.d.ts +32 -0
  307. package/dist/session/ShareSessionDialog.js +342 -0
  308. package/dist/session/TypingLine.d.ts +22 -0
  309. package/dist/session/TypingLine.js +31 -0
  310. package/dist/session/headless/host.d.ts +40 -1
  311. package/dist/session/headless/index.d.ts +4 -2
  312. package/dist/session/headless/index.js +3 -1
  313. package/dist/session/headless/labels.d.ts +49 -0
  314. package/dist/session/headless/labels.js +56 -0
  315. package/dist/session/headless/people.d.ts +29 -0
  316. package/dist/session/headless/people.js +53 -0
  317. package/dist/session/headless/place.d.ts +5 -0
  318. package/dist/session/headless/place.js +5 -1
  319. package/dist/session/headless/typing.d.ts +37 -0
  320. package/dist/session/headless/typing.js +60 -0
  321. package/dist/session/index.d.ts +5 -1
  322. package/dist/session/index.js +5 -1
  323. package/dist/settings/headless/fixture-performance.js +4 -2
  324. package/dist/settings/headless/performance.d.ts +4 -0
  325. package/dist/settings/headless/search.d.ts +1 -1
  326. package/dist/settings/headless/sections-host.d.ts +7 -2
  327. package/dist/settings/section.d.ts +15 -3
  328. package/dist/settings/section.js +15 -3
  329. package/dist/settings/sections/environments/EnvironmentsSection.js +30 -6
  330. package/dist/settings/sections/keybindings/labels.d.ts +3 -0
  331. package/dist/settings/sections/keybindings/labels.js +3 -0
  332. package/dist/settings/sections/keybindings/rows.js +12 -0
  333. package/dist/settings/sections/logs/LogsSection.js +5 -8
  334. package/dist/settings/sections/performance/PerformanceSection.js +8 -1
  335. package/dist/settings/sections/performance/labels.d.ts +2 -0
  336. package/dist/settings/sections/performance/labels.js +2 -0
  337. package/dist/styles.css +65 -9
  338. package/dist/terminal/HostTerminalSurface.js +28 -30
  339. package/dist/terminal/TerminalPanel.js +4 -12
  340. package/dist/terminal/TerminalProvider.d.ts +10 -2
  341. package/dist/terminal/TerminalProvider.js +10 -2
  342. package/dist/terminal/headless/labels.d.ts +0 -1
  343. package/dist/terminal/headless/labels.js +1 -2
  344. package/dist/terminal/headless/store.js +5 -1
  345. package/dist/views/headless/answers.d.ts +8 -2
  346. package/dist/views/headless/answers.js +58 -1
  347. package/dist/views/headless/placement.d.ts +78 -0
  348. package/dist/views/headless/placement.js +154 -44
  349. package/dist/workspace/LayoutBudget.js +1 -7
  350. package/package.json +2 -2
  351. package/src/styles/chat.css +3 -1
  352. package/src/styles/palette.css +3 -3
  353. package/src/styles/transcript.css +50 -5
  354. /package/dist/dist/{index-De9AbmxS.d.ts → index-ttmMvjgM.d.ts} +0 -0
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Teleport in the kit (docs/TELEPORT.md): what the dialog reads from a
3
+ * `GitHost` and the pure rules it renders by. The comparison itself comes
4
+ * from the host (`checkTeleportTarget` in `zidane/ipc`).
5
+ */
6
+ import { movingCount, shownRows, workTarget } from "zidane/chat/pure";
7
+ import { CompareRow, Readiness } from "zidane/ipc";
8
+ /** A host a session could go to, compared with it. `error`: it could not be asked. */
9
+ export interface TeleportTargetView {
10
+ /** The host's id. */
11
+ hostId: string;
12
+ /** The host's name, as people see it. */
13
+ name: string;
14
+ /** A server (absent or `false`: This computer). */
15
+ remote?: boolean;
16
+ /** The differences with the session, worst first. */
17
+ rows: readonly CompareRow[];
18
+ /** The worst of them, as the picker shows it. */
19
+ readiness: Readiness;
20
+ /** Why it could not be asked. */
21
+ error?: string;
22
+ }
23
+ /** What a teleport asks for. */
24
+ export interface TeleportRequestView {
25
+ /** The target's id. */
26
+ hostId: string;
27
+ /** Carry the git work into a new worktree of `repo` at `path` on `branch` (on the target). */
28
+ work?: {
29
+ repo: string;
30
+ path: string;
31
+ branch: string;
32
+ };
33
+ /** Ignored files the person ticked. */
34
+ carryIgnored?: string[];
35
+ /** The session's folder on the target when no work is carried. */
36
+ cwd?: string;
37
+ }
38
+ /** Where a teleport is: its stage, and while it sends the session the chunks sent of all. */
39
+ export interface TeleportProgressView {
40
+ /** The step it is at. */
41
+ stage: 'export' | 'transfer' | 'prepare' | 'commit' | 'complete';
42
+ /** The chunks sent so far, during `transfer`. */
43
+ done?: number;
44
+ /** All the chunks to send, during `transfer`. */
45
+ total?: number;
46
+ }
47
+ /** A teleport's progress, and a stop before its commit (nothing changes then). */
48
+ export interface TeleportCallView {
49
+ /** Gets each step, and the chunks sent during `transfer`. */
50
+ onProgress?: (progress: TeleportProgressView) => void;
51
+ /** Stops the teleport before its commit. */
52
+ signal?: AbortSignal;
53
+ }
54
+ /**
55
+ * Until the commit, a teleport can stop with nothing changed.
56
+ *
57
+ * @param progress - Where the teleport is; `null` before it starts.
58
+ */
59
+ export declare function teleportStoppable(progress: TeleportProgressView | null): boolean;
60
+ /** What a teleport answered: the session's id on the target, and a notice to show when the source could not be told. */
61
+ export type TeleportOutcome = {
62
+ ok: true;
63
+ sessionId: string;
64
+ notice?: string;
65
+ } | {
66
+ ok: false;
67
+ message: string;
68
+ unknown?: true;
69
+ };
70
+ /**
71
+ * A target can be picked unless something blocks it or it could not be asked.
72
+ *
73
+ * @param target - The target, compared with the session.
74
+ */
75
+ export declare function canTeleportTo(target: TeleportTargetView): boolean;
76
+ export { movingCount, shownRows, workTarget };
@@ -0,0 +1,19 @@
1
+ import { movingCount, shownRows, workTarget } from "zidane/chat/pure";
2
+ // src/git/headless/teleport.ts
3
+ /**
4
+ * Until the commit, a teleport can stop with nothing changed.
5
+ *
6
+ * @param progress - Where the teleport is; `null` before it starts.
7
+ */
8
+ function teleportStoppable(progress) {
9
+ return progress === null || progress.stage === "export" || progress.stage === "transfer" || progress.stage === "prepare";
10
+ }
11
+ /**
12
+ * A target can be picked unless something blocks it or it could not be asked.
13
+ *
14
+ * @param target - The target, compared with the session.
15
+ */
16
+ function canTeleportTo(target) {
17
+ return target.error === void 0 && target.readiness !== "blocked";
18
+ }
19
+ export { canTeleportTo, movingCount, shownRows, teleportStoppable, workTarget };
@@ -2,12 +2,14 @@ import { BranchMenu, BranchMenuProps, BranchMenuWorktree } from "./BranchMenu.js
2
2
  import { GitBar, GitBarBranchMenuProps, GitBarProps } from "./GitBar.js";
3
3
  import { GitProvider, GitProviderProps, useGitHost, useGitLabels } from "./GitProvider.js";
4
4
  import { ImportRepoDialog, ImportRepoDialogProps, ImportRepoTarget, useImportRepo } from "./ImportRepoDialog.js";
5
- import { MoveSessionDialog, MoveSessionDialogProps, useMoveSession } from "./MoveSessionDialog.js";
5
+ import { MOVE_SESSION_TITLE_ID, MoveSessionDialog, MoveSessionDialogProps } from "./MoveSessionDialog.js";
6
+ import { MoveSessionOptions, MoveToDialog, MoveToDialogProps, useMoveSession } from "./MoveToDialog.js";
6
7
  import { RemoteFolderBrowser, RemoteFolderBrowserProps, RemoteFolderPicker, RemoteFolderPickerProps } from "./RemoteFolderPicker.js";
7
8
  import { SandboxManager, SandboxManagerKind, SandboxManagerProps } from "./SandboxManager.js";
8
9
  import { GIT_BAR_ITEM, SyncChip, SyncChipProps } from "./SyncChip.js";
10
+ import { TeleportDone, TeleportSessionDialog, TeleportSessionDialogProps, TeleportSubject, useTeleportSession } from "./TeleportSessionDialog.js";
9
11
  import { useEnvironmentChoices } from "./useEnvironmentChoices.js";
10
12
  import { GitBarState, useGitBar } from "./useGitBar.js";
11
13
  import { StartFromPanelDraft, StartFromPanelResult, useStartFromPanel } from "./useStartFromPanel.js";
12
14
  import { WhereMenu, WhereMenuProps, WherePicker, WherePickerProps } from "./WherePicker.js";
13
- export { BranchMenu, BranchMenuProps, BranchMenuWorktree, GIT_BAR_ITEM, GitBar, GitBarBranchMenuProps, GitBarProps, GitBarState, GitProvider, GitProviderProps, ImportRepoDialog, ImportRepoDialogProps, ImportRepoTarget, MoveSessionDialog, MoveSessionDialogProps, RemoteFolderBrowser, RemoteFolderBrowserProps, RemoteFolderPicker, RemoteFolderPickerProps, SandboxManager, SandboxManagerKind, SandboxManagerProps, StartFromPanelDraft, StartFromPanelResult, SyncChip, SyncChipProps, WhereMenu, WhereMenuProps, WherePicker, WherePickerProps, useEnvironmentChoices, useGitBar, useGitHost, useGitLabels, useImportRepo, useMoveSession, useStartFromPanel };
15
+ export { BranchMenu, BranchMenuProps, BranchMenuWorktree, GIT_BAR_ITEM, GitBar, GitBarBranchMenuProps, GitBarProps, GitBarState, GitProvider, GitProviderProps, ImportRepoDialog, ImportRepoDialogProps, ImportRepoTarget, MOVE_SESSION_TITLE_ID, MoveSessionDialog, MoveSessionDialogProps, MoveSessionOptions, MoveToDialog, MoveToDialogProps, RemoteFolderBrowser, RemoteFolderBrowserProps, RemoteFolderPicker, RemoteFolderPickerProps, SandboxManager, SandboxManagerKind, SandboxManagerProps, StartFromPanelDraft, StartFromPanelResult, SyncChip, SyncChipProps, TeleportDone, TeleportSessionDialog, TeleportSessionDialogProps, TeleportSubject, WhereMenu, WhereMenuProps, WherePicker, WherePickerProps, useEnvironmentChoices, useGitBar, useGitHost, useGitLabels, useImportRepo, useMoveSession, useStartFromPanel, useTeleportSession };
package/dist/git/index.js CHANGED
@@ -2,12 +2,14 @@ import { BranchMenu } from "./BranchMenu.js";
2
2
  import { GitBar } from "./GitBar.js";
3
3
  import { GitProvider, useGitHost, useGitLabels } from "./GitProvider.js";
4
4
  import { ImportRepoDialog, useImportRepo } from "./ImportRepoDialog.js";
5
- import { MoveSessionDialog, useMoveSession } from "./MoveSessionDialog.js";
5
+ import { MOVE_SESSION_TITLE_ID, MoveSessionDialog } from "./MoveSessionDialog.js";
6
+ import { MoveToDialog, useMoveSession } from "./MoveToDialog.js";
6
7
  import { RemoteFolderBrowser, RemoteFolderPicker } from "./RemoteFolderPicker.js";
7
8
  import { SandboxManager } from "./SandboxManager.js";
8
9
  import { GIT_BAR_ITEM, SyncChip } from "./SyncChip.js";
10
+ import { TeleportSessionDialog, useTeleportSession } from "./TeleportSessionDialog.js";
9
11
  import { useEnvironmentChoices } from "./useEnvironmentChoices.js";
10
12
  import { useGitBar } from "./useGitBar.js";
11
13
  import { useStartFromPanel } from "./useStartFromPanel.js";
12
14
  import { WhereMenu, WherePicker } from "./WherePicker.js";
13
- export { BranchMenu, GIT_BAR_ITEM, GitBar, GitProvider, ImportRepoDialog, MoveSessionDialog, RemoteFolderBrowser, RemoteFolderPicker, SandboxManager, SyncChip, WhereMenu, WherePicker, useEnvironmentChoices, useGitBar, useGitHost, useGitLabels, useImportRepo, useMoveSession, useStartFromPanel };
15
+ export { BranchMenu, GIT_BAR_ITEM, GitBar, GitProvider, ImportRepoDialog, MOVE_SESSION_TITLE_ID, MoveSessionDialog, MoveToDialog, RemoteFolderBrowser, RemoteFolderPicker, SandboxManager, SyncChip, TeleportSessionDialog, WhereMenu, WherePicker, useEnvironmentChoices, useGitBar, useGitHost, useGitLabels, useImportRepo, useMoveSession, useStartFromPanel, useTeleportSession };
@@ -13,6 +13,9 @@ import { EnvironmentDescriptor } from "zidane/chat";
13
13
  *
14
14
  * @param cwd - The draft's folder (`''`: none); `null` reads nothing (no draft on screen).
15
15
  * @param hostId - The saved server the draft runs on (absent: this host).
16
- * @param options - Whether an offline machine's kinds stay usable (a new chat waits for it).
16
+ * @param options - Whether an offline machine's kinds stay usable (a new chat waits for it), and whether to list
17
+ * what the host can run whatever the folder (`machineOnly`: a default for many folders).
17
18
  */
18
- export declare function useEnvironmentChoices(cwd: string | null, hostId?: string, options?: WithMachinesOptions): readonly EnvironmentDescriptor[];
19
+ export declare function useEnvironmentChoices(cwd: string | null, hostId?: string, options?: WithMachinesOptions & {
20
+ machineOnly?: boolean;
21
+ }): readonly EnvironmentDescriptor[];
@@ -9,19 +9,26 @@ const NO_DESCRIPTORS = [];
9
9
  *
10
10
  * @param cwd - The draft's folder (`''`: none); `null` reads nothing (no draft on screen).
11
11
  * @param hostId - The saved server the draft runs on (absent: this host).
12
- * @param options - Whether an offline machine's kinds stay usable (a new chat waits for it).
12
+ * @param options - Whether an offline machine's kinds stay usable (a new chat waits for it), and whether to list
13
+ * what the host can run whatever the folder (`machineOnly`: a default for many folders).
13
14
  */
14
15
  function useEnvironmentChoices(cwd, hostId, options = {}) {
15
16
  const offlineWaits = options.offlineWaits === true;
17
+ const machineOnly = options.machineOnly === true;
16
18
  const host = useGitHost();
17
19
  const [listed, setListed] = useState(null);
18
- const key = cwd === null ? null : JSON.stringify([cwd, hostId ?? null]);
20
+ const key = cwd === null ? null : JSON.stringify([
21
+ cwd,
22
+ hostId ?? null,
23
+ machineOnly
24
+ ]);
19
25
  useEffect(() => {
20
26
  const list = host?.environments;
21
27
  if (key === null || cwd === null || !list) return void 0;
22
28
  const query = {
23
29
  cwd,
24
- ...hostId ? { hostId } : {}
30
+ ...hostId ? { hostId } : {},
31
+ ...machineOnly ? { machineOnly: true } : {}
25
32
  };
26
33
  let read = 0;
27
34
  let live = true;
@@ -45,7 +52,8 @@ function useEnvironmentChoices(cwd, hostId, options = {}) {
45
52
  key,
46
53
  cwd,
47
54
  hostId,
48
- offlineWaits
55
+ offlineWaits,
56
+ machineOnly
49
57
  ]);
50
58
  return listed && listed.key === key ? listed.descriptors : NO_DESCRIPTORS;
51
59
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * A stable function returning `value` as of the last commit, for what is built once (a store, a palette
3
+ * source, a listener) and reads the current value when it runs. Never call it during render.
4
+ *
5
+ * @param value - What the function returns.
6
+ * @returns The same function for the component's life.
7
+ */
8
+ export declare function useLatest<T>(value: T): () => T;
@@ -0,0 +1,17 @@
1
+ import { useCallback, useInsertionEffect, useRef } from "react";
2
+ // src/hooks/useLatest.ts
3
+ /**
4
+ * A stable function returning `value` as of the last commit, for what is built once (a store, a palette
5
+ * source, a listener) and reads the current value when it runs. Never call it during render.
6
+ *
7
+ * @param value - What the function returns.
8
+ * @returns The same function for the component's life.
9
+ */
10
+ function useLatest(value) {
11
+ const ref = useRef(value);
12
+ useInsertionEffect(() => {
13
+ ref.current = value;
14
+ });
15
+ return useCallback(() => ref.current, []);
16
+ }
17
+ export { useLatest };
@@ -1,2 +1,6 @@
1
- /** Re-renders the caller once a minute (and when the window shows again); read `Date.now()` for the time. */
2
- export declare function useMinuteTick(): void;
1
+ /**
2
+ * Re-renders the caller once a minute (and when the window shows again).
3
+ *
4
+ * @returns The time to measure from: the last tick's, or the caller's first render's when later.
5
+ */
6
+ export declare function useMinuteTick(): number;
@@ -1,4 +1,4 @@
1
- import { useSyncExternalStore } from "react";
1
+ import { useState, useSyncExternalStore } from "react";
2
2
  // src/hooks/useMinuteTick.ts
3
3
  /**
4
4
  * One shared minute tick for relative times ("now", "5m", "2h"): a single
@@ -6,11 +6,12 @@ import { useSyncExternalStore } from "react";
6
6
  * visible. A window coming back into view ticks at once.
7
7
  */
8
8
  const MINUTE_MS = 6e4;
9
- let minute = 0;
9
+ /** When the last tick happened (0 before the first). */
10
+ let tickedAt = 0;
10
11
  let timer = null;
11
12
  const listeners = /* @__PURE__ */ new Set();
12
13
  function tick() {
13
- minute++;
14
+ tickedAt = Date.now();
14
15
  for (const listener of [...listeners]) listener();
15
16
  }
16
17
  function sync() {
@@ -35,9 +36,14 @@ function subscribe(listener) {
35
36
  sync();
36
37
  };
37
38
  }
38
- const read = () => minute;
39
- /** Re-renders the caller once a minute (and when the window shows again); read `Date.now()` for the time. */
39
+ const read = () => tickedAt;
40
+ /**
41
+ * Re-renders the caller once a minute (and when the window shows again).
42
+ *
43
+ * @returns The time to measure from: the last tick's, or the caller's first render's when later.
44
+ */
40
45
  function useMinuteTick() {
41
- useSyncExternalStore(subscribe, read, read);
46
+ const [mountedAt] = useState(() => Date.now());
47
+ return Math.max(useSyncExternalStore(subscribe, read, read), mountedAt);
42
48
  }
43
49
  export { useMinuteTick };
@@ -1,5 +1,5 @@
1
1
  import { AllNearViewportContext } from "./near-viewport-all.js";
2
- import { useContext, useEffect, useState } from "react";
2
+ import { useContext, useEffect, useState, useSyncExternalStore } from "react";
3
3
  // src/hooks/useNearViewport.ts
4
4
  const listeners = /* @__PURE__ */ new WeakMap();
5
5
  const observers = /* @__PURE__ */ new WeakMap();
@@ -62,6 +62,11 @@ function shared(margin, root) {
62
62
  byMargin.set(margin, io);
63
63
  return io;
64
64
  }
65
+ const noSubscribe = () => () => {};
66
+ /** No `IntersectionObserver` to watch with (an old engine, jsdom): everything counts as near. */
67
+ const noObserver = () => typeof IntersectionObserver === "undefined";
68
+ /** While hydrating: as the server rendered, not near. */
69
+ const notYet = () => false;
65
70
  /**
66
71
  * Reports whether an element has come within `margin` of the viewport. It turns true once
67
72
  * and stays true, so it suits lazy work such as highlighting code that scrolls into reach.
@@ -75,13 +80,10 @@ function shared(margin, root) {
75
80
  function useNearViewport(ref, margin = "600px 0px") {
76
81
  const [near, setNear] = useState(false);
77
82
  const all = useContext(AllNearViewportContext);
83
+ const unwatched = useSyncExternalStore(noSubscribe, noObserver, notYet);
78
84
  useEffect(() => {
79
85
  const el = ref.current;
80
- if (!el || near || all) return void 0;
81
- if (typeof IntersectionObserver === "undefined") {
82
- setNear(true);
83
- return;
84
- }
86
+ if (!el || near || all || unwatched) return void 0;
85
87
  const io = shared(margin, scrollRootOf(el));
86
88
  listeners.set(el, () => setNear(true));
87
89
  io.observe(el);
@@ -93,8 +95,9 @@ function useNearViewport(ref, margin = "600px 0px") {
93
95
  ref,
94
96
  near,
95
97
  margin,
96
- all
98
+ all,
99
+ unwatched
97
100
  ]);
98
- return near || all;
101
+ return near || all || unwatched;
99
102
  }
100
103
  export { scrollRootOf, useNearViewport };
package/dist/index.d.ts CHANGED
@@ -86,6 +86,7 @@ import { ZidaneMark, ZidaneMarkProps } from "./components/ZidaneMark.js";
86
86
  import { ZoomableImage, ZoomableImageHandle, ZoomableImageProps } from "./components/ZoomableImage.js";
87
87
  import { KeyedStore, createKeyedStore, useKeyedValue } from "./hooks/keyed-store.js";
88
88
  import { PathDisplay, PathDisplayProvider, PathDisplayProviderProps, PathDisplayScope, PathDisplayScopeProps, useDisplayPath } from "./hooks/useDisplayPath.js";
89
+ import { useLatest } from "./hooks/useLatest.js";
89
90
  import { useMinuteTick } from "./hooks/useMinuteTick.js";
90
91
  import { scrollRootOf, useNearViewport } from "./hooks/useNearViewport.js";
91
92
  import { oneOf, parseBoolean, readPersisted, usePersistedState, writePersisted } from "./hooks/usePersistedState.js";
@@ -106,7 +107,7 @@ import { ApplyMotionOptions, DEFAULT_PANEL_MS, FADE_KEYS, HOVER_MOTION, INSTANT,
106
107
  import { Crossfade, CrossfadeProps, Presence, PresenceProps, useCadencedValue } from "./motion/swap.js";
107
108
  import { SwapIcon, SwapIconProps } from "./motion/SwapIcon.js";
108
109
  import { TitleText, TitleTextProps } from "./motion/title-text.js";
109
- import { FlipSnapshot, FlipSnapshotProps, UseFlipList, UseFlipListOptions, useFlipList } from "./motion/use-flip-list.js";
110
+ import { FlipPlan, FlipSnapshot, FlipSnapshotProps, UseFlipList, UseFlipListOptions, useFlipList } from "./motion/use-flip-list.js";
110
111
  import { basename, compactPath, formatPathForCwd, splitPath, tildePath, tildeText } from "./path.js";
111
112
  import { ACCENT_PRESETS, AccentPreset, presetFor } from "./theme/accents.js";
112
113
  import { DARK_LUMINANCE_THRESHOLD, Oklch, Rgb, capChroma, contrastRatio, ensureContrast, formatColor, isDark, luminance, mix, oklch, oklchToRgb, parseColor, readableOn, rgbToOklch, tintedNeutral, toOklch, withAlpha, withLightness } from "./theme/color.js";
@@ -117,4 +118,4 @@ import { IconCollection, RuntimeIconsOptions, watchRuntimeIcons } from "./theme/
117
118
  import { themeCssVars, themeStylesheet } from "./theme/stylesheet.js";
118
119
  import { BUILTIN_THEMES, DEFAULT_THEME, SyntaxStyles, SyntaxTokenStyle, Theme, ThemeColors, ThemeDiff, ThemeSelect, ThemeSurfaces, resolveTheme } from "./theme/themes.js";
119
120
  import { withoutTransitions } from "./theme/without-transitions.js";
120
- export { ACCENT_PRESETS, AccentPreset, Accordion, AccordionItem, AccordionProps, AddressBar, AddressBarProps, Align, Anchor, Appearance, ApplyMotionOptions, BRAND_MARKS, BREAKDOWN_MIN_SHARE, BREAKDOWN_SHOW_ALL, BTN_DANGER, BTN_DANGER_CONFIRM, BTN_LG_DANGER, BTN_LG_PRIMARY, BTN_LG_SECONDARY, BTN_LG_SOLID, BTN_PRIMARY, BTN_SECONDARY, BUILTIN_THEMES, BadgeTone, BrandMark, BrandMarkData, BrandMarkPath, BrandMarkProps, BrandMarkSize, Breadcrumb, BreadcrumbProps, Breakdown, BreakdownPart, BreakdownProps, BreakdownSlice, BrowserSignIn, BrowserSignInProps, BrowserSignInState, ButtonVariant, CONFIRM_TITLE_ID, CONTRAST, Callout, CalloutProps, CalloutTone, CalloutVariant, Checkbox, CheckboxProps, Checklist, ChecklistGroup, ChecklistItem, ChecklistProps, ChecklistStatus, ChipColors, ChipKind, ChoiceCardOption, ChoiceCards, ChoiceCardsProps, CodeFrame, CodeFrameProps, CodeHighlightProvider, CodeHighlightProviderProps, CodeHighlighter, CodeHighlighterOptions, CodePanel, CodePanelProps, CodeWrapProvider, CodeWrapProviderProps, Compare, CompareProps, CompareRow, CompareVerdict, ConfirmDialog, ConfirmDialogProps, ConfirmOptions, CopyButton, CopyButtonProps, CopyValue, CopyValueProps, CountBadge, CountBadgeProps, CountTone, Crossfade, CrossfadeProps, CssVarMap, DARK_LUMINANCE_THRESHOLD, DEFAULT_EDITOR_SETTINGS, DEFAULT_LABELS, DEFAULT_PANEL_MS, DEFAULT_THEME, Delta, DeltaProps, DeltaTone, DiffColors, DiffCounts, DiffCountsProps, DismissHandlers, DotColors, EditableTitle, EditableTitleProps, EditorEnvironment, EditorEnvironmentProvider, EditorEnvironmentProviderProps, EditorSettings, EmptyState, EmptyStateProps, ErrorBoundary, ErrorBoundaryProps, ErrorDetails, ErrorDetailsProps, ErrorFallback, ErrorFallbackFrameProps, ErrorFallbackProps, ErrorNote, ErrorNoteProps, ErrorReport, ErrorReportOptions, ErrorReportSink, FADE_KEYS, FIELD_LABEL_CLASS, FLIP_CLIP_ATTR, FLIP_FLIGHT_ATTR, FLIP_KEY_ATTR, FLIP_MOVING_ATTR, FLIP_REGION_ATTR, FLIP_SCROLLER_ATTR, FLIP_STICKY_ATTR, FORM_CARD_CLASS, FlipLanding, FlipList, FlipListOptions, FlipMode, FlipSnapshot, FlipSnapshotProps, FloatingSurface, FloatingSurfaceProps, FormCard, FormCardProps, FormSection, FormSectionProps, Grow, GrowPresence, GrowProps, HOVER_MOTION, HeldWidth, HeldWidthProps, HighlightRequest, HighlightResponse, Highlighted, HighlightedCode, HighlightedCodeProps, HighlightedProps, HostRow, HostRowProps, HoverCard, HoverCardProps, HoverCardTriggerProps, HowItWorks, HowItWorksProps, HowItWorksStep, INPUT_CLASS, INSTANT, IconButton, IconButtonLook, IconButtonProps, IconButtonRenderProps, IconButtonSize, IconCollection, IconToggle, IconToggleProps, KeyCombo, KeyComboProps, KeyValue, KeyValueItem, KeyValueProps, Keycap, KeycapProps, KeyedStore, LabelOverrides, Labels, LabelsProvider, LabelsProviderProps, LayerOptions, LightboxItem, LoadError, LoadErrorProps, MAX_REAL_SCALE, MENU_FADE_RATIO, MOTIONS, MOTION_NAMES, MatchedTitle, MatchedTitleProps, MediaNav, type MediaNavProps, Menu, MenuNote, MenuNoteProps, MenuProps, MenuRow, MenuRowProps, MenuRowRenderProps, MenuSection, MenuSectionProps, MenuSeparator, MenuSeparatorProps, MenuSwitch, MenuSwitchProps, Meta, MetaChip, MetaChipProps, MetaProps, MotionLevel, MotionName, MotionPrefs, MotionProvider, MotionProviderProps, NavButton, NavButtonProps, NavRow, NavRowProps, Notice, NoticeProps, NoticeTone, NumberFormats, Oklch, OpLine, OpLineProps, Overlay, OverlayProps, PANEL_ROW, PANEL_ROW_HOVER, PUNCTUATION_CODES, PaletteEntry, PaletteIcon, PaletteIconProps, PaletteKeys, PaletteList, PaletteListProps, PaletteNotice, PaletteOption, PaletteOptionProps, PalettePanel, PalettePanelProps, PaletteRow, PaletteRowData, PaletteRowProps, PaletteSection, PanelEmpty, PanelEmptyProps, PanelLoading, PanelLoadingProps, PathDisplay, PathDisplayProvider, PathDisplayProviderProps, PathDisplayScope, PathDisplayScopeProps, Placement, Popover, PopoverProps, PopoverState, PopoverTriggerProps, Presence, type Presence$1 as PresenceHandle, type PresenceOptions, PresenceProps, type PresenceState, PreviewWindow, PreviewWindowProps, Progress, ProgressProps, ProgressTone, REDUCED_FADE, ROW_BUTTON_CLASS, ROW_CLASS, ROW_HOST_CLASS, ROW_TRIGGER_CLASS, Raised, RaisedProps, Rect, ReorderTabState, ReorderTabs, ReorderTabsProps, ResizeDrag, ResizeDragHandleProps, ResizeDragOptions, ResolvedPalette, Restricted, RestrictedProps, Rgb, RollDirection, RollingText, RollingTextProps, RowActionItem, RowActionsMenu, RowActionsMenuProps, RowBadge, RowBadgeProps, RowMenuButton, RowMenuButtonProps, RowText, RowTextProps, RuntimeIconsOptions, SHIMMER_MS, STAT_ROW_COLUMNS, SectionLabel, SectionLabelProps, SegmentSpinner, SegmentSpinnerProps, Segmented, SegmentedOption, SegmentedProps, SegmentedRow, SegmentedRowProps, Side, Skeleton, SkeletonProps, SliderRow, SliderRowProps, SmoothHeight, SmoothHeightProps, SmoothWidth, SmoothWidthProps, SphereShading, Stat, StatProps, StatRow, StatRowProps, StatSize, StatTone, StepActions, StepActionsProps, StepFrame, StepFrameProps, StepStatus, Stepper, StepperProps, StepperStep, Steps, StepsItem, StepsProps, SurfaceLadder, SwapIcon, SwapIconProps, Swatch, SwatchPicker, SwatchPickerProps, Switch, SwitchGlyph, SwitchGlyphProps, SwitchProps, SwitchRow, SwitchRowProps, SyntaxStyles, SyntaxTokenStyle, TEXTAREA_CLASS, TabDragBounds, TabPill, TabPillProps, Table, TableCellValue, TableColumn, TableFilterBar, TableProps, TableSort, Tabs, TabsItem, TabsProps, Theme, ThemeColors, ThemeDiff, ThemeSeed, ThemeSelect, ThemeSurfaces, ThemeThumb, ThemeThumbProps, TitleText, TitleTextProps, ToggleCard, ToggleCardProps, ToggleSwitch, ToggleSwitchProps, Tooltip, type TooltipProps, Tray, TrayProps, UseFlipList, UseFlipListOptions, type UseTooltip, type UseTooltipOptions, WaapiTiming, ZidaneMark, ZidaneMarkProps, ZoomableImage, type ZoomableImageHandle, type ZoomableImageProps, _resetKeyboardLayout, anchorNudge, applyMotionVars, basename, beginLayoutAnimation, breakdownColor, breakdownSlices, breakdownTop, buttonClass, capChroma, checklistIsGrid, clampWidth, compactPath, compareBars, compareCells, configureErrorReports, contrastRatio, contrastToCssVars, createCodeHighlighter, createFlipList, createKeyedStore, cssMotionVars, currentMotionPrefs, currentMotionTransition, currentWithFade, defaultPaletteKeys, defaultShikiTheme, deltaTone, depthToCssVars, derivePalette, ensureContrast, errorMessage, errorStacksShown, extendLabels, fadeTransition, focusMenuRow, formatColor, formatPathForCwd, handleMenuKeyDown, hasBrandMark, iconButtonClass, inferAppearance, installRendererErrorHandlers, isCompact, isDark, isLayoutAnimating, layoutKeyLabel, luminance, menuTransition, mix, motionTransition, motionVars, moveId, numberFormats, oklch, oklchToRgb, oneOf, paletteToCssVars, paletteVerb, panelMotionVars, parseBoolean, parseColor, placeSurface, presetFor, progressShare, progressTone, pulseLayout, readDurationVar, readExitMs, readMenuExitMs, readMotionMs, readPanelMs, readPersisted, readRollMs, readableOn, reportRendererError, resetReportedErrors, resolveTheme, returnFocus, rgbToOklch, rollCells, scrollRootOf, seedFromTheme, setDecimals, shareDecimals, shikiThemeFor, splitPath, subscribeLayoutAnimating, syncShimmer, themeCssVars, themeStylesheet, tildePath, tildeText, tintedNeutral, toOklch, transitionState, trueMinus, typesStandIn, unitDecimals, useAnchoredPosition, useCadencedValue, useCodeHighlight, useDismiss, useDisplayPath, useDocumentAppearance, useEditorEnvironment, useFlipList, useKeyboardLayout, useKeyedValue, useLabels, useLayer, useLightbox, useMenuTransition, useMinuteTick, useMotionLevel, useMotionPrefs, useMotionTransition, useNearViewport, usePersistedState, usePopover, usePresence, useReducedMotion, useResizeDrag, useRowHint, useScrollLock, useSprings, useStaysMounted, useTabDrag, useTabExit, useTooltip, useWithFade, waapiTiming, watchRuntimeIcons, withAlpha, withFade, withLightness, withUnit, withoutTransitions, writePersisted };
121
+ export { ACCENT_PRESETS, AccentPreset, Accordion, AccordionItem, AccordionProps, AddressBar, AddressBarProps, Align, Anchor, Appearance, ApplyMotionOptions, BRAND_MARKS, BREAKDOWN_MIN_SHARE, BREAKDOWN_SHOW_ALL, BTN_DANGER, BTN_DANGER_CONFIRM, BTN_LG_DANGER, BTN_LG_PRIMARY, BTN_LG_SECONDARY, BTN_LG_SOLID, BTN_PRIMARY, BTN_SECONDARY, BUILTIN_THEMES, BadgeTone, BrandMark, BrandMarkData, BrandMarkPath, BrandMarkProps, BrandMarkSize, Breadcrumb, BreadcrumbProps, Breakdown, BreakdownPart, BreakdownProps, BreakdownSlice, BrowserSignIn, BrowserSignInProps, BrowserSignInState, ButtonVariant, CONFIRM_TITLE_ID, CONTRAST, Callout, CalloutProps, CalloutTone, CalloutVariant, Checkbox, CheckboxProps, Checklist, ChecklistGroup, ChecklistItem, ChecklistProps, ChecklistStatus, ChipColors, ChipKind, ChoiceCardOption, ChoiceCards, ChoiceCardsProps, CodeFrame, CodeFrameProps, CodeHighlightProvider, CodeHighlightProviderProps, CodeHighlighter, CodeHighlighterOptions, CodePanel, CodePanelProps, CodeWrapProvider, CodeWrapProviderProps, Compare, CompareProps, CompareRow, CompareVerdict, ConfirmDialog, ConfirmDialogProps, ConfirmOptions, CopyButton, CopyButtonProps, CopyValue, CopyValueProps, CountBadge, CountBadgeProps, CountTone, Crossfade, CrossfadeProps, CssVarMap, DARK_LUMINANCE_THRESHOLD, DEFAULT_EDITOR_SETTINGS, DEFAULT_LABELS, DEFAULT_PANEL_MS, DEFAULT_THEME, Delta, DeltaProps, DeltaTone, DiffColors, DiffCounts, DiffCountsProps, DismissHandlers, DotColors, EditableTitle, EditableTitleProps, EditorEnvironment, EditorEnvironmentProvider, EditorEnvironmentProviderProps, EditorSettings, EmptyState, EmptyStateProps, ErrorBoundary, ErrorBoundaryProps, ErrorDetails, ErrorDetailsProps, ErrorFallback, ErrorFallbackFrameProps, ErrorFallbackProps, ErrorNote, ErrorNoteProps, ErrorReport, ErrorReportOptions, ErrorReportSink, FADE_KEYS, FIELD_LABEL_CLASS, FLIP_CLIP_ATTR, FLIP_FLIGHT_ATTR, FLIP_KEY_ATTR, FLIP_MOVING_ATTR, FLIP_REGION_ATTR, FLIP_SCROLLER_ATTR, FLIP_STICKY_ATTR, FORM_CARD_CLASS, FlipLanding, FlipList, FlipListOptions, FlipMode, FlipPlan, FlipSnapshot, FlipSnapshotProps, FloatingSurface, FloatingSurfaceProps, FormCard, FormCardProps, FormSection, FormSectionProps, Grow, GrowPresence, GrowProps, HOVER_MOTION, HeldWidth, HeldWidthProps, HighlightRequest, HighlightResponse, Highlighted, HighlightedCode, HighlightedCodeProps, HighlightedProps, HostRow, HostRowProps, HoverCard, HoverCardProps, HoverCardTriggerProps, HowItWorks, HowItWorksProps, HowItWorksStep, INPUT_CLASS, INSTANT, IconButton, IconButtonLook, IconButtonProps, IconButtonRenderProps, IconButtonSize, IconCollection, IconToggle, IconToggleProps, KeyCombo, KeyComboProps, KeyValue, KeyValueItem, KeyValueProps, Keycap, KeycapProps, KeyedStore, LabelOverrides, Labels, LabelsProvider, LabelsProviderProps, LayerOptions, LightboxItem, LoadError, LoadErrorProps, MAX_REAL_SCALE, MENU_FADE_RATIO, MOTIONS, MOTION_NAMES, MatchedTitle, MatchedTitleProps, MediaNav, type MediaNavProps, Menu, MenuNote, MenuNoteProps, MenuProps, MenuRow, MenuRowProps, MenuRowRenderProps, MenuSection, MenuSectionProps, MenuSeparator, MenuSeparatorProps, MenuSwitch, MenuSwitchProps, Meta, MetaChip, MetaChipProps, MetaProps, MotionLevel, MotionName, MotionPrefs, MotionProvider, MotionProviderProps, NavButton, NavButtonProps, NavRow, NavRowProps, Notice, NoticeProps, NoticeTone, NumberFormats, Oklch, OpLine, OpLineProps, Overlay, OverlayProps, PANEL_ROW, PANEL_ROW_HOVER, PUNCTUATION_CODES, PaletteEntry, PaletteIcon, PaletteIconProps, PaletteKeys, PaletteList, PaletteListProps, PaletteNotice, PaletteOption, PaletteOptionProps, PalettePanel, PalettePanelProps, PaletteRow, PaletteRowData, PaletteRowProps, PaletteSection, PanelEmpty, PanelEmptyProps, PanelLoading, PanelLoadingProps, PathDisplay, PathDisplayProvider, PathDisplayProviderProps, PathDisplayScope, PathDisplayScopeProps, Placement, Popover, PopoverProps, PopoverState, PopoverTriggerProps, Presence, type Presence$1 as PresenceHandle, type PresenceOptions, PresenceProps, type PresenceState, PreviewWindow, PreviewWindowProps, Progress, ProgressProps, ProgressTone, REDUCED_FADE, ROW_BUTTON_CLASS, ROW_CLASS, ROW_HOST_CLASS, ROW_TRIGGER_CLASS, Raised, RaisedProps, Rect, ReorderTabState, ReorderTabs, ReorderTabsProps, ResizeDrag, ResizeDragHandleProps, ResizeDragOptions, ResolvedPalette, Restricted, RestrictedProps, Rgb, RollDirection, RollingText, RollingTextProps, RowActionItem, RowActionsMenu, RowActionsMenuProps, RowBadge, RowBadgeProps, RowMenuButton, RowMenuButtonProps, RowText, RowTextProps, RuntimeIconsOptions, SHIMMER_MS, STAT_ROW_COLUMNS, SectionLabel, SectionLabelProps, SegmentSpinner, SegmentSpinnerProps, Segmented, SegmentedOption, SegmentedProps, SegmentedRow, SegmentedRowProps, Side, Skeleton, SkeletonProps, SliderRow, SliderRowProps, SmoothHeight, SmoothHeightProps, SmoothWidth, SmoothWidthProps, SphereShading, Stat, StatProps, StatRow, StatRowProps, StatSize, StatTone, StepActions, StepActionsProps, StepFrame, StepFrameProps, StepStatus, Stepper, StepperProps, StepperStep, Steps, StepsItem, StepsProps, SurfaceLadder, SwapIcon, SwapIconProps, Swatch, SwatchPicker, SwatchPickerProps, Switch, SwitchGlyph, SwitchGlyphProps, SwitchProps, SwitchRow, SwitchRowProps, SyntaxStyles, SyntaxTokenStyle, TEXTAREA_CLASS, TabDragBounds, TabPill, TabPillProps, Table, TableCellValue, TableColumn, TableFilterBar, TableProps, TableSort, Tabs, TabsItem, TabsProps, Theme, ThemeColors, ThemeDiff, ThemeSeed, ThemeSelect, ThemeSurfaces, ThemeThumb, ThemeThumbProps, TitleText, TitleTextProps, ToggleCard, ToggleCardProps, ToggleSwitch, ToggleSwitchProps, Tooltip, type TooltipProps, Tray, TrayProps, UseFlipList, UseFlipListOptions, type UseTooltip, type UseTooltipOptions, WaapiTiming, ZidaneMark, ZidaneMarkProps, ZoomableImage, type ZoomableImageHandle, type ZoomableImageProps, _resetKeyboardLayout, anchorNudge, applyMotionVars, basename, beginLayoutAnimation, breakdownColor, breakdownSlices, breakdownTop, buttonClass, capChroma, checklistIsGrid, clampWidth, compactPath, compareBars, compareCells, configureErrorReports, contrastRatio, contrastToCssVars, createCodeHighlighter, createFlipList, createKeyedStore, cssMotionVars, currentMotionPrefs, currentMotionTransition, currentWithFade, defaultPaletteKeys, defaultShikiTheme, deltaTone, depthToCssVars, derivePalette, ensureContrast, errorMessage, errorStacksShown, extendLabels, fadeTransition, focusMenuRow, formatColor, formatPathForCwd, handleMenuKeyDown, hasBrandMark, iconButtonClass, inferAppearance, installRendererErrorHandlers, isCompact, isDark, isLayoutAnimating, layoutKeyLabel, luminance, menuTransition, mix, motionTransition, motionVars, moveId, numberFormats, oklch, oklchToRgb, oneOf, paletteToCssVars, paletteVerb, panelMotionVars, parseBoolean, parseColor, placeSurface, presetFor, progressShare, progressTone, pulseLayout, readDurationVar, readExitMs, readMenuExitMs, readMotionMs, readPanelMs, readPersisted, readRollMs, readableOn, reportRendererError, resetReportedErrors, resolveTheme, returnFocus, rgbToOklch, rollCells, scrollRootOf, seedFromTheme, setDecimals, shareDecimals, shikiThemeFor, splitPath, subscribeLayoutAnimating, syncShimmer, themeCssVars, themeStylesheet, tildePath, tildeText, tintedNeutral, toOklch, transitionState, trueMinus, typesStandIn, unitDecimals, useAnchoredPosition, useCadencedValue, useCodeHighlight, useDismiss, useDisplayPath, useDocumentAppearance, useEditorEnvironment, useFlipList, useKeyboardLayout, useKeyedValue, useLabels, useLatest, useLayer, useLightbox, useMenuTransition, useMinuteTick, useMotionLevel, useMotionPrefs, useMotionTransition, useNearViewport, usePersistedState, usePopover, usePresence, useReducedMotion, useResizeDrag, useRowHint, useScrollLock, useSprings, useStaysMounted, useTabDrag, useTabExit, useTooltip, useWithFade, waapiTiming, watchRuntimeIcons, withAlpha, withFade, withLightness, withUnit, withoutTransitions, writePersisted };
package/dist/index.js CHANGED
@@ -73,6 +73,7 @@ import { ZidaneMark } from "./components/ZidaneMark.js";
73
73
  import { ZoomableImage } from "./components/ZoomableImage.js";
74
74
  import { createKeyedStore, useKeyedValue } from "./hooks/keyed-store.js";
75
75
  import { PathDisplayProvider, PathDisplayScope, useDisplayPath } from "./hooks/useDisplayPath.js";
76
+ import { useLatest } from "./hooks/useLatest.js";
76
77
  import { useMinuteTick } from "./hooks/useMinuteTick.js";
77
78
  import { scrollRootOf, useNearViewport } from "./hooks/useNearViewport.js";
78
79
  import { oneOf, parseBoolean, readPersisted, usePersistedState, writePersisted } from "./hooks/usePersistedState.js";
@@ -104,4 +105,4 @@ import { watchRuntimeIcons } from "./theme/runtime-icons.js";
104
105
  import { themeCssVars, themeStylesheet } from "./theme/stylesheet.js";
105
106
  import { BUILTIN_THEMES, DEFAULT_THEME, resolveTheme } from "./theme/themes.js";
106
107
  import { withoutTransitions } from "./theme/without-transitions.js";
107
- export { ACCENT_PRESETS, Accordion, AddressBar, BRAND_MARKS, BREAKDOWN_MIN_SHARE, BREAKDOWN_SHOW_ALL, BTN_DANGER, BTN_DANGER_CONFIRM, BTN_LG_DANGER, BTN_LG_PRIMARY, BTN_LG_SECONDARY, BTN_LG_SOLID, BTN_PRIMARY, BTN_SECONDARY, BUILTIN_THEMES, BrandMark, Breadcrumb, Breakdown, BrowserSignIn, CONFIRM_TITLE_ID, CONTRAST, Callout, Checkbox, Checklist, ChoiceCards, CodeFrame, CodeHighlightProvider, CodePanel, CodeWrapProvider, Compare, ConfirmDialog, CopyButton, CopyValue, CountBadge, Crossfade, DARK_LUMINANCE_THRESHOLD, DEFAULT_EDITOR_SETTINGS, DEFAULT_LABELS, DEFAULT_PANEL_MS, DEFAULT_THEME, Delta, DiffCounts, EditableTitle, EditorEnvironmentProvider, EmptyState, ErrorBoundary, ErrorDetails, ErrorFallback, ErrorNote, FADE_KEYS, FIELD_LABEL_CLASS, FLIP_CLIP_ATTR, FLIP_FLIGHT_ATTR, FLIP_KEY_ATTR, FLIP_MOVING_ATTR, FLIP_REGION_ATTR, FLIP_SCROLLER_ATTR, FLIP_STICKY_ATTR, FORM_CARD_CLASS, FlipSnapshot, FloatingSurface, FormCard, FormSection, Grow, GrowPresence, HOVER_MOTION, HeldWidth, Highlighted, HighlightedCode, HostRow, HoverCard, HowItWorks, INPUT_CLASS, INSTANT, IconButton, IconToggle, KeyCombo, KeyValue, Keycap, LabelsProvider, LoadError, MAX_REAL_SCALE, MENU_FADE_RATIO, MOTIONS, MOTION_NAMES, MatchedTitle, MediaNav, Menu, MenuNote, MenuRow, MenuSection, MenuSeparator, MenuSwitch, Meta, MetaChip, MotionProvider, NavButton, NavRow, Notice, OpLine, Overlay, PANEL_ROW, PANEL_ROW_HOVER, PUNCTUATION_CODES, PaletteIcon, PaletteList, PaletteOption, PalettePanel, PaletteRow, PanelEmpty, PanelLoading, PathDisplayProvider, PathDisplayScope, Popover, Presence, PreviewWindow, Progress, REDUCED_FADE, ROW_BUTTON_CLASS, ROW_CLASS, ROW_HOST_CLASS, ROW_TRIGGER_CLASS, Raised, ReorderTabs, Restricted, RollingText, RowActionsMenu, RowBadge, RowMenuButton, RowText, SHIMMER_MS, STAT_ROW_COLUMNS, SectionLabel, SegmentSpinner, Segmented, SegmentedRow, Skeleton, SliderRow, SmoothHeight, SmoothWidth, Stat, StatRow, StepActions, StepFrame, Stepper, Steps, SwapIcon, SwatchPicker, Switch, SwitchGlyph, SwitchRow, TEXTAREA_CLASS, TabPill, Table, Tabs, ThemeThumb, TitleText, ToggleCard, ToggleSwitch, Tooltip, Tray, ZidaneMark, ZoomableImage, _resetKeyboardLayout, anchorNudge, applyMotionVars, basename, beginLayoutAnimation, breakdownColor, breakdownSlices, breakdownTop, buttonClass, capChroma, checklistIsGrid, clampWidth, compactPath, compareBars, compareCells, configureErrorReports, contrastRatio, contrastToCssVars, createCodeHighlighter, createFlipList, createKeyedStore, cssMotionVars, currentMotionPrefs, currentMotionTransition, currentWithFade, defaultPaletteKeys, defaultShikiTheme, deltaTone, depthToCssVars, derivePalette, ensureContrast, errorMessage, errorStacksShown, extendLabels, fadeTransition, focusMenuRow, formatColor, formatPathForCwd, handleMenuKeyDown, hasBrandMark, iconButtonClass, inferAppearance, installRendererErrorHandlers, isCompact, isDark, isLayoutAnimating, layoutKeyLabel, luminance, menuTransition, mix, motionTransition, motionVars, moveId, numberFormats, oklch, oklchToRgb, oneOf, paletteToCssVars, paletteVerb, panelMotionVars, parseBoolean, parseColor, placeSurface, presetFor, progressShare, progressTone, pulseLayout, readDurationVar, readExitMs, readMenuExitMs, readMotionMs, readPanelMs, readPersisted, readRollMs, readableOn, reportRendererError, resetReportedErrors, resolveTheme, returnFocus, rgbToOklch, rollCells, scrollRootOf, seedFromTheme, setDecimals, shareDecimals, shikiThemeFor, splitPath, subscribeLayoutAnimating, syncShimmer, themeCssVars, themeStylesheet, tildePath, tildeText, tintedNeutral, toOklch, transitionState, trueMinus, typesStandIn, unitDecimals, useAnchoredPosition, useCadencedValue, useCodeHighlight, useDismiss, useDisplayPath, useDocumentAppearance, useEditorEnvironment, useFlipList, useKeyboardLayout, useKeyedValue, useLabels, useLayer, useLightbox, useMenuTransition, useMinuteTick, useMotionLevel, useMotionPrefs, useMotionTransition, useNearViewport, usePersistedState, usePopover, usePresence, useReducedMotion, useResizeDrag, useRowHint, useScrollLock, useSprings, useStaysMounted, useTabDrag, useTabExit, useTooltip, useWithFade, waapiTiming, watchRuntimeIcons, withAlpha, withFade, withLightness, withUnit, withoutTransitions, writePersisted };
108
+ export { ACCENT_PRESETS, Accordion, AddressBar, BRAND_MARKS, BREAKDOWN_MIN_SHARE, BREAKDOWN_SHOW_ALL, BTN_DANGER, BTN_DANGER_CONFIRM, BTN_LG_DANGER, BTN_LG_PRIMARY, BTN_LG_SECONDARY, BTN_LG_SOLID, BTN_PRIMARY, BTN_SECONDARY, BUILTIN_THEMES, BrandMark, Breadcrumb, Breakdown, BrowserSignIn, CONFIRM_TITLE_ID, CONTRAST, Callout, Checkbox, Checklist, ChoiceCards, CodeFrame, CodeHighlightProvider, CodePanel, CodeWrapProvider, Compare, ConfirmDialog, CopyButton, CopyValue, CountBadge, Crossfade, DARK_LUMINANCE_THRESHOLD, DEFAULT_EDITOR_SETTINGS, DEFAULT_LABELS, DEFAULT_PANEL_MS, DEFAULT_THEME, Delta, DiffCounts, EditableTitle, EditorEnvironmentProvider, EmptyState, ErrorBoundary, ErrorDetails, ErrorFallback, ErrorNote, FADE_KEYS, FIELD_LABEL_CLASS, FLIP_CLIP_ATTR, FLIP_FLIGHT_ATTR, FLIP_KEY_ATTR, FLIP_MOVING_ATTR, FLIP_REGION_ATTR, FLIP_SCROLLER_ATTR, FLIP_STICKY_ATTR, FORM_CARD_CLASS, FlipSnapshot, FloatingSurface, FormCard, FormSection, Grow, GrowPresence, HOVER_MOTION, HeldWidth, Highlighted, HighlightedCode, HostRow, HoverCard, HowItWorks, INPUT_CLASS, INSTANT, IconButton, IconToggle, KeyCombo, KeyValue, Keycap, LabelsProvider, LoadError, MAX_REAL_SCALE, MENU_FADE_RATIO, MOTIONS, MOTION_NAMES, MatchedTitle, MediaNav, Menu, MenuNote, MenuRow, MenuSection, MenuSeparator, MenuSwitch, Meta, MetaChip, MotionProvider, NavButton, NavRow, Notice, OpLine, Overlay, PANEL_ROW, PANEL_ROW_HOVER, PUNCTUATION_CODES, PaletteIcon, PaletteList, PaletteOption, PalettePanel, PaletteRow, PanelEmpty, PanelLoading, PathDisplayProvider, PathDisplayScope, Popover, Presence, PreviewWindow, Progress, REDUCED_FADE, ROW_BUTTON_CLASS, ROW_CLASS, ROW_HOST_CLASS, ROW_TRIGGER_CLASS, Raised, ReorderTabs, Restricted, RollingText, RowActionsMenu, RowBadge, RowMenuButton, RowText, SHIMMER_MS, STAT_ROW_COLUMNS, SectionLabel, SegmentSpinner, Segmented, SegmentedRow, Skeleton, SliderRow, SmoothHeight, SmoothWidth, Stat, StatRow, StepActions, StepFrame, Stepper, Steps, SwapIcon, SwatchPicker, Switch, SwitchGlyph, SwitchRow, TEXTAREA_CLASS, TabPill, Table, Tabs, ThemeThumb, TitleText, ToggleCard, ToggleSwitch, Tooltip, Tray, ZidaneMark, ZoomableImage, _resetKeyboardLayout, anchorNudge, applyMotionVars, basename, beginLayoutAnimation, breakdownColor, breakdownSlices, breakdownTop, buttonClass, capChroma, checklistIsGrid, clampWidth, compactPath, compareBars, compareCells, configureErrorReports, contrastRatio, contrastToCssVars, createCodeHighlighter, createFlipList, createKeyedStore, cssMotionVars, currentMotionPrefs, currentMotionTransition, currentWithFade, defaultPaletteKeys, defaultShikiTheme, deltaTone, depthToCssVars, derivePalette, ensureContrast, errorMessage, errorStacksShown, extendLabels, fadeTransition, focusMenuRow, formatColor, formatPathForCwd, handleMenuKeyDown, hasBrandMark, iconButtonClass, inferAppearance, installRendererErrorHandlers, isCompact, isDark, isLayoutAnimating, layoutKeyLabel, luminance, menuTransition, mix, motionTransition, motionVars, moveId, numberFormats, oklch, oklchToRgb, oneOf, paletteToCssVars, paletteVerb, panelMotionVars, parseBoolean, parseColor, placeSurface, presetFor, progressShare, progressTone, pulseLayout, readDurationVar, readExitMs, readMenuExitMs, readMotionMs, readPanelMs, readPersisted, readRollMs, readableOn, reportRendererError, resetReportedErrors, resolveTheme, returnFocus, rgbToOklch, rollCells, scrollRootOf, seedFromTheme, setDecimals, shareDecimals, shikiThemeFor, splitPath, subscribeLayoutAnimating, syncShimmer, themeCssVars, themeStylesheet, tildePath, tildeText, tintedNeutral, toOklch, transitionState, trueMinus, typesStandIn, unitDecimals, useAnchoredPosition, useCadencedValue, useCodeHighlight, useDismiss, useDisplayPath, useDocumentAppearance, useEditorEnvironment, useFlipList, useKeyboardLayout, useKeyedValue, useLabels, useLatest, useLayer, useLightbox, useMenuTransition, useMinuteTick, useMotionLevel, useMotionPrefs, useMotionTransition, useNearViewport, usePersistedState, usePopover, usePresence, useReducedMotion, useResizeDrag, useRowHint, useScrollLock, useSprings, useStaysMounted, useTabDrag, useTabExit, useTooltip, useWithFade, waapiTiming, watchRuntimeIcons, withAlpha, withFade, withLightness, withUnit, withoutTransitions, writePersisted };
@@ -4,7 +4,7 @@ import { bindingAllowedIn, keyScopeOf } from "./headless/key-scope.js";
4
4
  import { getMergedKeybindings } from "./headless/overrides.js";
5
5
  import { loadOnce } from "./load-once.js";
6
6
  import { matchesBinding } from "./match.js";
7
- import { createContext, startTransition, useContext, useEffect, useMemo, useReducer, useRef, useSyncExternalStore } from "react";
7
+ import { createContext, startTransition, useContext, useEffect, useEffectEvent, useMemo, useReducer, useSyncExternalStore } from "react";
8
8
  import { jsx } from "react/jsx-runtime";
9
9
  import { parseBindingSpecs } from "zidane/chat/pure";
10
10
  // src/keybindings/KeybindingsProvider.tsx
@@ -65,8 +65,7 @@ function runKeyHandler(action, handler) {
65
65
  function useKeybindings(handlers) {
66
66
  const host = useKeybindingsHost();
67
67
  const [tick, bump] = useReducer((n) => n + 1, 0);
68
- const handlersRef = useRef(handlers);
69
- handlersRef.current = handlers;
68
+ const handlerOf = useEffectEvent((action) => handlers[action]);
70
69
  const actionsKey = Object.keys(handlers).join(" ");
71
70
  useEffect(() => {
72
71
  loadOnce(host);
@@ -76,7 +75,7 @@ function useKeybindings(handlers) {
76
75
  unsubscribe();
77
76
  };
78
77
  }, [host]);
79
- useEffect(() => bindKeyListeners(actionsKey ? actionsKey.split(" ") : [], getMergedKeybindings(host), (action) => handlersRef.current[action]), [
78
+ useEffect(() => bindKeyListeners(actionsKey ? actionsKey.split(" ") : [], getMergedKeybindings(host), (action) => handlerOf(action)), [
80
79
  actionsKey,
81
80
  tick,
82
81
  host
@@ -11,7 +11,7 @@
11
11
  */
12
12
  import { ParsedBinding, bindingAlternatives, parseBindingSpec, parseBindingSpecs } from "zidane/chat/pure";
13
13
  /** Every action a key binding can fire. */
14
- export type KeyAction = 'openSettings' | 'openSessionDetails' | 'openModelPicker' | 'openEffortPicker' | 'openTodos' | 'openArtifacts' | 'openMainSession' | 'openUsagePanel' | 'newSession' | 'openKeybindings' | 'openPalette' | 'cancelToolCall' | 'cycleAgent' | 'enterSelectTurnMode' | 'previousPrompt' | 'nextPrompt' | 'toggleSidebar' | 'navigateBack' | 'navigateForward' | 'sessionGenerateTitle' | 'sessionCompact' | 'sessionExportMarkdown' | 'sessionExportJson' | 'sessionDelete' | 'sessionCopyId' | 'sessionFavorite' | 'zoomIn' | 'zoomOut' | 'zoomReset' | 'panelNext' | 'panelPrev' | 'tabNext' | 'tabPrev' | 'closeTab' | 'toggleTerminal' | 'newTerminal' | 'annotatePage' | 'splitTabRight' | 'splitTabDown';
14
+ export type KeyAction = 'openSettings' | 'openSessionDetails' | 'openModelPicker' | 'openEffortPicker' | 'openTodos' | 'openArtifacts' | 'openMainSession' | 'openUsagePanel' | 'newSession' | 'openKeybindings' | 'openPalette' | 'cancelToolCall' | 'cycleAgent' | 'enterSelectTurnMode' | 'previousPrompt' | 'nextPrompt' | 'toggleSidebar' | 'navigateBack' | 'navigateForward' | 'sessionGenerateTitle' | 'sessionCompact' | 'sessionExportMarkdown' | 'sessionExportJson' | 'sessionDelete' | 'sessionCopyId' | 'sessionFavorite' | 'sessionMove' | 'sessionShare' | 'openSessions' | 'zoomIn' | 'zoomOut' | 'zoomReset' | 'panelNext' | 'panelPrev' | 'tabNext' | 'tabPrev' | 'closeTab' | 'toggleTerminal' | 'newTerminal' | 'annotatePage' | 'splitTabRight' | 'splitTabDown';
15
15
  /** One action of the catalog. */
16
16
  export interface KeyBindingDef {
17
17
  /** The action. */
@@ -171,6 +171,24 @@ const KEYBINDING_DEFS = [
171
171
  label: "favorite",
172
172
  description: "add the session to favorites, or remove it"
173
173
  },
174
+ {
175
+ action: "sessionMove",
176
+ default: "",
177
+ label: "move to",
178
+ description: "move the session to another host, machine or sandbox (teleport)"
179
+ },
180
+ {
181
+ action: "sessionShare",
182
+ default: "",
183
+ label: "share",
184
+ description: "share the session with people of your organization"
185
+ },
186
+ {
187
+ action: "openSessions",
188
+ default: "",
189
+ label: "open sessions",
190
+ description: "the sessions open to join on your organization's servers"
191
+ },
174
192
  {
175
193
  action: "panelNext",
176
194
  default: "ctrl+shift+]",
@@ -1,10 +1,11 @@
1
1
  import { BTN_PRIMARY, BTN_SECONDARY } from "../components/button.js";
2
2
  import { ErrorNote, FIELD_LABEL_CLASS, FORM_CARD_CLASS, INPUT_CLASS, OpLine } from "../components/Form.js";
3
+ import { RoutedLink } from "../extensions/links.js";
3
4
  import { machinesError } from "./headless/host.js";
4
5
  import { hostCheckMessage, hostCheckOkLine } from "./headless/messages.js";
5
6
  import { useMachinesHost, useMachinesLabels } from "./MachinesProvider.js";
6
7
  import { HOST_TOKEN_MAX, HOST_URL_MAX, escapeCancels } from "./ServerCard.js";
7
- import { useState } from "react";
8
+ import { useEffect, useRef, useState } from "react";
8
9
  import { jsx, jsxs } from "react/jsx-runtime";
9
10
  // src/machines/AddServerForm.tsx
10
11
  /**
@@ -14,7 +15,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
14
15
  */
15
16
  function AddServerForm({ onCancel, onAdded, idPrefix = "host", className = "", style }) {
16
17
  const labels = useMachinesLabels();
17
- const { addHost, testHost } = useMachinesHost();
18
+ const { addHost, testHost, signInToServer, serverSignsIn } = useMachinesHost();
19
+ const [code, setCode] = useState(null);
20
+ /** The URL a probe found signing its users in with Google: the button shows for it only. */
21
+ const [signsIn, setSignsIn] = useState(null);
22
+ const signingIn = useRef(null);
23
+ useEffect(() => () => signingIn.current?.abort(), []);
18
24
  const [url, setUrl] = useState("");
19
25
  const [token, setToken] = useState("");
20
26
  const [name, setName] = useState("");
@@ -49,6 +55,26 @@ function AddServerForm({ onCancel, onAdded, idPrefix = "host", className = "", s
49
55
  }
50
56
  await onAdded(result);
51
57
  };
58
+ const signInWithGoogle = async () => {
59
+ if (!signInToServer) return;
60
+ setBusy(labels.machinesSigningIn);
61
+ setTested(null);
62
+ const abort = new AbortController();
63
+ signingIn.current = abort;
64
+ const result = await signInToServer({
65
+ url,
66
+ ...name.trim() ? { name } : {}
67
+ }, setCode, abort.signal).catch(refused);
68
+ signingIn.current = null;
69
+ setBusy(null);
70
+ setCode(null);
71
+ if (abort.signal.aborted) return;
72
+ if (!result.ok) {
73
+ setTested(result);
74
+ return;
75
+ }
76
+ await onAdded(result);
77
+ };
52
78
  return /* @__PURE__ */ jsxs("form", {
53
79
  className: `${FORM_CARD_CLASS} ${className}`.trimEnd(),
54
80
  style,
@@ -74,6 +100,10 @@ function AddServerForm({ onCancel, onAdded, idPrefix = "host", className = "", s
74
100
  onChange: (event) => {
75
101
  setUrl(event.target.value);
76
102
  setTested(null);
103
+ },
104
+ onBlur: () => {
105
+ const asked = url.trim();
106
+ if (serverSignsIn && asked) serverSignsIn(asked).then((yes) => setSignsIn(yes ? asked : null), () => setSignsIn(null));
77
107
  }
78
108
  })] }),
79
109
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("label", {
@@ -108,6 +138,18 @@ function AddServerForm({ onCancel, onAdded, idPrefix = "host", className = "", s
108
138
  kind: "busy",
109
139
  children: busy
110
140
  }),
141
+ code && /* @__PURE__ */ jsxs(OpLine, {
142
+ kind: "notice",
143
+ children: [
144
+ labels.machinesSignInCode(code.userCode),
145
+ " ",
146
+ /* @__PURE__ */ jsx(RoutedLink, {
147
+ href: code.verificationUrl,
148
+ source: "auth",
149
+ children: code.verificationUrl
150
+ })
151
+ ]
152
+ }),
111
153
  tested && !busy && (tested.ok ? /* @__PURE__ */ jsx(OpLine, {
112
154
  kind: "notice",
113
155
  children: hostCheckOkLine(tested, labels)
@@ -118,9 +160,19 @@ function AddServerForm({ onCancel, onAdded, idPrefix = "host", className = "", s
118
160
  /* @__PURE__ */ jsx("button", {
119
161
  type: "button",
120
162
  className: BTN_SECONDARY,
121
- onClick: onCancel,
163
+ onClick: () => {
164
+ signingIn.current?.abort();
165
+ onCancel();
166
+ },
122
167
  children: labels.machinesCancel
123
168
  }),
169
+ signInToServer && (!serverSignsIn || signsIn === url.trim()) && /* @__PURE__ */ jsx("button", {
170
+ type: "button",
171
+ className: "zg-press inline-flex items-center justify-center gap-1.5 shrink-0 whitespace-nowrap rounded-zg-md cursor-pointer transition-colors disabled:opacity-zg-disabled disabled:cursor-default zg-focus-ring h-7 px-2.5 text-zg-label zg-raised border text-[var(--zg-text-muted)] hover:text-[var(--zg-text)]",
172
+ onClick: () => void signInWithGoogle(),
173
+ disabled: busy !== null || !url.trim(),
174
+ children: labels.machinesSignInGoogle
175
+ }),
124
176
  testHost && /* @__PURE__ */ jsx("button", {
125
177
  type: "button",
126
178
  className: "zg-press inline-flex items-center justify-center gap-1.5 shrink-0 whitespace-nowrap rounded-zg-md cursor-pointer transition-colors disabled:opacity-zg-disabled disabled:cursor-default zg-focus-ring h-7 px-2.5 text-zg-label zg-raised border text-[var(--zg-text-muted)] hover:text-[var(--zg-text)]",
@@ -69,8 +69,8 @@ export interface DraftPlaceNoticeProps {
69
69
  }
70
70
  /**
71
71
  * The new chat's place, when it cannot be what the default says: the default names a server this device has not
72
- * saved (Add it), a machine that left the server, a folder that is gone, or its server is offline (use this
73
- * computer instead). Nothing when all is well.
72
+ * saved (Add it), a machine that left the server, a folder that is gone, an isolation the folder can't run (the
73
+ * chat starts in the host's default), or its server is offline (use this computer instead). Nothing when all is well.
74
74
  *
75
75
  * @param props - The issue, the offline server, the actions and `className`.
76
76
  */
@@ -74,14 +74,14 @@ function ComposerNotice({ text, tone, detail, onDismiss, testId, className = "",
74
74
  }
75
75
  /**
76
76
  * The new chat's place, when it cannot be what the default says: the default names a server this device has not
77
- * saved (Add it), a machine that left the server, a folder that is gone, or its server is offline (use this
78
- * computer instead). Nothing when all is well.
77
+ * saved (Add it), a machine that left the server, a folder that is gone, an isolation the folder can't run (the
78
+ * chat starts in the host's default), or its server is offline (use this computer instead). Nothing when all is well.
79
79
  *
80
80
  * @param props - The issue, the offline server, the actions and `className`.
81
81
  */
82
82
  function DraftPlaceNotice({ issue, offlineServer, onUseThisComputer, onAddServer, onDismiss, className = "" }) {
83
83
  const labels = useMachinesLabels();
84
- const text = offlineServer ? labels.machinesDraftServerOffline(offlineServer) : issue?.kind === "unsaved" ? labels.machinesPlaceUnsaved(issue.hostName) : issue?.kind === "machine-gone" ? labels.machinesPlaceMachineGone(issue.machine, issue.hostName) : issue?.kind === "folder-gone" ? labels.machinesPlaceFolderGone(issue.folder) : null;
84
+ const text = offlineServer ? labels.machinesDraftServerOffline(offlineServer) : issue?.kind === "unsaved" ? labels.machinesPlaceUnsaved(issue.hostName) : issue?.kind === "machine-gone" ? labels.machinesPlaceMachineGone(issue.machine, issue.hostName) : issue?.kind === "folder-gone" ? labels.machinesPlaceFolderGone(issue.folder) : issue?.kind === "unavailable" ? labels.machinesPlaceUnavailable(issue.label, issue.reason, issue.fallback) : null;
85
85
  if (!text) return null;
86
86
  const action = offlineServer ? onUseThisComputer && /* @__PURE__ */ jsx("button", {
87
87
  type: "button",
@@ -73,9 +73,7 @@ function DaemonMenuBody({ daemon, running: runningCount = 0, attention = 0, sess
73
73
  const [busy, setBusy] = useState(false);
74
74
  const wrapperRef = useRef(null);
75
75
  const menuRef = useRef(null);
76
- const refresh = useCallback(async () => {
77
- setStatus(await daemon.status());
78
- }, [daemon]);
76
+ const refresh = useCallback(() => daemon.status().then(setStatus), [daemon]);
79
77
  useEffect(() => {
80
78
  if (!open) return void 0;
81
79
  refresh();