zidane-ui 9.1.13 → 9.1.16

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 (290) hide show
  1. package/dist/adapters/index.d.ts +2 -2
  2. package/dist/adapters/index.js +2 -2
  3. package/dist/adapters/live.d.ts +29 -3
  4. package/dist/adapters/live.js +9 -1
  5. package/dist/adapters/server-composer-host.js +17 -2
  6. package/dist/adapters/server-extensions-host.d.ts +0 -1
  7. package/dist/adapters/server-extensions-host.js +4 -15
  8. package/dist/adapters/server-git-host.js +7 -16
  9. package/dist/adapters/server-host.js +181 -43
  10. package/dist/adapters/server-machines-host.d.ts +2 -0
  11. package/dist/adapters/server-machines-host.js +22 -23
  12. package/dist/adapters/server-onboarding-host.d.ts +1 -1
  13. package/dist/adapters/server-onboarding-host.js +3 -4
  14. package/dist/adapters/server-session-host.js +22 -3
  15. package/dist/adapters/server-settings-accounts.js +2 -2
  16. package/dist/adapters/server-settings-host.js +2 -2
  17. package/dist/adapters/server-settings-performance.js +7 -9
  18. package/dist/adapters/server-settings-sections.js +13 -14
  19. package/dist/adapters/server-sidebar-host.js +2 -2
  20. package/dist/adapters/sse-host.js +68 -3
  21. package/dist/adapters/sse-protocol.d.ts +12 -2
  22. package/dist/adapters/sse-protocol.js +4 -2
  23. package/dist/app/AppHostProvider.js +4 -3
  24. package/dist/app/ModalProvider.d.ts +13 -3
  25. package/dist/app/ModalProvider.js +103 -24
  26. package/dist/app/NoticeStack.d.ts +33 -0
  27. package/dist/app/NoticeStack.js +90 -0
  28. package/dist/app/index.d.ts +3 -2
  29. package/dist/app/index.js +3 -2
  30. package/dist/chat/SessionFilterMenu.d.ts +1 -1
  31. package/dist/chat/SessionFilterMenu.js +2 -1
  32. package/dist/chat/composer/Composer.js +10 -8
  33. package/dist/chat/composer/ModelChainList.js +17 -8
  34. package/dist/chat/composer/ModelChainTooltip.js +5 -2
  35. package/dist/chat/composer/use-draft-target.d.ts +20 -1
  36. package/dist/chat/composer/use-draft-target.js +121 -5
  37. package/dist/chat/composer/use-new-session-defaults.d.ts +5 -1
  38. package/dist/chat/composer/use-new-session-defaults.js +17 -4
  39. package/dist/chat/headless/chip-labels.d.ts +1 -0
  40. package/dist/chat/headless/chip-labels.js +1 -0
  41. package/dist/chat/headless/composer/labels-editor.d.ts +0 -2
  42. package/dist/chat/headless/composer/labels-editor.js +0 -2
  43. package/dist/chat/headless/draft-target.d.ts +21 -1
  44. package/dist/chat/headless/fixture-host.js +17 -2
  45. package/dist/chat/headless/host.d.ts +3 -3
  46. package/dist/chat/headless/index.d.ts +9 -9
  47. package/dist/chat/headless/index.js +2 -2
  48. package/dist/chat/headless/labels.d.ts +13 -6
  49. package/dist/chat/headless/labels.js +10 -9
  50. package/dist/chat/headless/session-list.d.ts +20 -8
  51. package/dist/chat/headless/session-list.js +1 -0
  52. package/dist/chat/headless/sidebar/directory.d.ts +56 -14
  53. package/dist/chat/headless/sidebar/directory.js +149 -70
  54. package/dist/chat/headless/sidebar/index.d.ts +3 -3
  55. package/dist/chat/headless/sidebar/index.js +2 -2
  56. package/dist/chat/headless/sidebar/labels.d.ts +15 -8
  57. package/dist/chat/headless/sidebar/types.d.ts +3 -1
  58. package/dist/chat/headless/sidebar/view.d.ts +13 -5
  59. package/dist/chat/headless/sidebar/view.js +31 -11
  60. package/dist/chat/headless/streams/actions.d.ts +5 -3
  61. package/dist/chat/headless/streams/actions.js +3 -2
  62. package/dist/chat/headless/streams/index.d.ts +3 -3
  63. package/dist/chat/headless/streams/merge.d.ts +6 -10
  64. package/dist/chat/headless/streams/merge.js +7 -21
  65. package/dist/chat/headless/streams/session-streams.d.ts +29 -4
  66. package/dist/chat/headless/streams/session-streams.js +86 -0
  67. package/dist/chat/headless/streams/store.d.ts +162 -16
  68. package/dist/chat/headless/streams/store.js +334 -38
  69. package/dist/chat/headless/streams/types.d.ts +10 -7
  70. package/dist/chat/headless/transcript-labels.d.ts +1 -0
  71. package/dist/chat/interactions/PlanCard.js +10 -3
  72. package/dist/chat/interactions/QuestionForm.js +7 -3
  73. package/dist/chat/interactions/card-ui.d.ts +5 -3
  74. package/dist/chat/interactions/card-ui.js +9 -7
  75. package/dist/chat/rich-composer/RichComposer.js +1 -7
  76. package/dist/chat/rich-composer/composer-extensions.d.ts +0 -2
  77. package/dist/chat/rich-composer/composer-extensions.js +2 -2
  78. package/dist/chat/rich-composer/use-composer-editor.d.ts +0 -2
  79. package/dist/chat/rich-composer/use-composer-editor.js +1 -2
  80. package/dist/chat/sidebar/SessionSidebar.js +5 -5
  81. package/dist/chat/sidebar/SidebarFilterMenu.js +3 -1
  82. package/dist/chat/sidebar/SidebarFrame.d.ts +4 -0
  83. package/dist/chat/sidebar/SidebarFrame.js +27 -9
  84. package/dist/chat/sidebar/SidebarGroupHeader.js +1 -1
  85. package/dist/chat/sidebar/SidebarHostProvider.d.ts +8 -5
  86. package/dist/chat/sidebar/SidebarHostProvider.js +13 -9
  87. package/dist/chat/sidebar/SidebarToggleButton.js +7 -3
  88. package/dist/chat/sidebar/index.d.ts +2 -2
  89. package/dist/chat/sidebar/session-menu.js +4 -4
  90. package/dist/chat/sidebar/useSaveViewAsSpace.js +2 -2
  91. package/dist/chat/testing/contract.js +2 -2
  92. package/dist/chat/transcript/AuthFailureCard.js +11 -8
  93. package/dist/chat/transcript/BadgeMenu.js +13 -2
  94. package/dist/chat/transcript/MermaidDiagram.js +7 -3
  95. package/dist/chat/transcript/fold.d.ts +4 -0
  96. package/dist/chat/transcript/fold.js +53 -22
  97. package/dist/chat/transcript/script-input.d.ts +1 -1
  98. package/dist/chat/transcript/shell-block.js +7 -3
  99. package/dist/chat/transcript/useStickToBottom.js +12 -0
  100. package/dist/components/BrowserSignIn.js +23 -21
  101. package/dist/components/Form.d.ts +6 -4
  102. package/dist/components/Form.js +16 -8
  103. package/dist/components/LoadError.d.ts +4 -2
  104. package/dist/components/LoadError.js +13 -9
  105. package/dist/components/Notice.d.ts +29 -0
  106. package/dist/components/Notice.js +63 -0
  107. package/dist/components/PanelEmpty.d.ts +1 -1
  108. package/dist/components/PanelEmpty.js +4 -2
  109. package/dist/components/Restricted.d.ts +1 -1
  110. package/dist/components/palette/PaletteList.js +8 -1
  111. package/dist/components/palette/PalettePanel.js +14 -6
  112. package/dist/core.css +24 -5
  113. package/dist/dist/{index-Bq87OcGy.d.ts → index-BZM8tu4L.d.ts} +28 -3
  114. package/dist/dist/index.d.ts +2 -2
  115. package/dist/dist/{timeout-B5pO5I5a.d.ts → timeout-Cyx3VGPz.d.ts} +1 -1
  116. package/dist/extensions/ExtensionSettingsPage.js +1 -4
  117. package/dist/extensions/ExtensionSettingsSection.js +4 -3
  118. package/dist/extensions/ExtensionSettingsSidebar.js +2 -6
  119. package/dist/extensions/SettingsWireForm.d.ts +1 -7
  120. package/dist/extensions/SettingsWireForm.js +7 -5
  121. package/dist/extensions/headless/fixture-host.d.ts +1 -5
  122. package/dist/extensions/headless/fixture-host.js +1 -4
  123. package/dist/extensions/headless/host.d.ts +1 -11
  124. package/dist/extensions/headless/index.d.ts +3 -3
  125. package/dist/extensions/headless/index.js +2 -2
  126. package/dist/extensions/headless/select.d.ts +1 -11
  127. package/dist/extensions/headless/select.js +1 -18
  128. package/dist/files/EditorColumn.js +12 -1
  129. package/dist/files/TreeColumn.js +13 -20
  130. package/dist/files/useOpenFiles.js +2 -0
  131. package/dist/git/BranchMenu.js +5 -3
  132. package/dist/git/ImportRepoDialog.js +18 -9
  133. package/dist/git/MoveSessionDialog.js +15 -7
  134. package/dist/git/RemoteFolderPicker.js +34 -16
  135. package/dist/git/SyncChip.js +17 -17
  136. package/dist/git/WherePicker.d.ts +16 -1
  137. package/dist/git/WherePicker.js +80 -36
  138. package/dist/git/headless/environment.d.ts +33 -3
  139. package/dist/git/headless/environment.js +33 -5
  140. package/dist/git/headless/index.d.ts +2 -2
  141. package/dist/git/headless/index.js +2 -2
  142. package/dist/git/headless/labels.d.ts +15 -2
  143. package/dist/git/headless/labels.js +17 -4
  144. package/dist/git/useEnvironmentChoices.d.ts +3 -1
  145. package/dist/git/useEnvironmentChoices.js +6 -3
  146. package/dist/index.d.ts +2 -1
  147. package/dist/index.js +2 -1
  148. package/dist/labels.d.ts +5 -0
  149. package/dist/labels.js +5 -0
  150. package/dist/machines/AddMachineDialog.d.ts +34 -0
  151. package/dist/machines/AddMachineDialog.js +464 -0
  152. package/dist/machines/Banners.d.ts +33 -4
  153. package/dist/machines/Banners.js +64 -3
  154. package/dist/machines/DaemonMenu.js +27 -4
  155. package/dist/machines/HostCapabilities.d.ts +1 -3
  156. package/dist/machines/HostCapabilities.js +24 -45
  157. package/dist/machines/HostSyncPanel.js +123 -129
  158. package/dist/machines/HostsSection.d.ts +4 -1
  159. package/dist/machines/HostsSection.js +30 -7
  160. package/dist/machines/MachinesExplainer.d.ts +17 -0
  161. package/dist/machines/MachinesExplainer.js +71 -0
  162. package/dist/machines/MachinesProvider.d.ts +14 -2
  163. package/dist/machines/MachinesProvider.js +35 -1
  164. package/dist/machines/ServerAddedCard.d.ts +31 -0
  165. package/dist/machines/ServerAddedCard.js +72 -0
  166. package/dist/machines/ServerCard.js +91 -215
  167. package/dist/machines/ServerMachinesPanel.d.ts +2 -2
  168. package/dist/machines/ServerMachinesPanel.js +184 -323
  169. package/dist/machines/ServerUpdatePanel.js +51 -40
  170. package/dist/machines/ShareThisComputerForm.d.ts +19 -0
  171. package/dist/machines/ShareThisComputerForm.js +133 -0
  172. package/dist/machines/TokensPanel.d.ts +5 -3
  173. package/dist/machines/TokensPanel.js +98 -78
  174. package/dist/machines/headless/fixture-host.d.ts +19 -3
  175. package/dist/machines/headless/fixture-host.js +42 -5
  176. package/dist/machines/headless/fixtures.js +4 -6
  177. package/dist/machines/headless/host.d.ts +40 -19
  178. package/dist/machines/headless/index.d.ts +3 -3
  179. package/dist/machines/headless/index.js +2 -2
  180. package/dist/machines/headless/labels.d.ts +63 -20
  181. package/dist/machines/headless/labels.js +88 -25
  182. package/dist/machines/headless/messages.js +8 -0
  183. package/dist/machines/headless/stores.d.ts +9 -2
  184. package/dist/machines/headless/stores.js +28 -1
  185. package/dist/machines/index.d.ts +7 -3
  186. package/dist/machines/index.js +8 -4
  187. package/dist/machines/testing/contract.d.ts +15 -3
  188. package/dist/machines/testing/contract.js +68 -14
  189. package/dist/motion/grow.d.ts +8 -1
  190. package/dist/motion/grow.js +10 -4
  191. package/dist/onboarding/demos/index.js +1 -1
  192. package/dist/onboarding/headless/labels.d.ts +13 -0
  193. package/dist/onboarding/headless/labels.js +8 -0
  194. package/dist/onboarding/index.js +3 -3
  195. package/dist/onboarding/sources/SourceBrowser.js +11 -7
  196. package/dist/onboarding/steps/ConnectorsStep.js +1 -1
  197. package/dist/onboarding/steps/ImportStep.js +4 -1
  198. package/dist/onboarding/steps/ReadyStep.js +9 -2
  199. package/dist/onboarding/steps/SkillsStep.js +1 -1
  200. package/dist/onboarding/steps/connect/KeyForm.js +6 -2
  201. package/dist/onboarding/steps/connect/ProviderPanel.js +6 -2
  202. package/dist/onboarding/steps/connect/ProviderReady.js +25 -20
  203. package/dist/onboarding/steps/tasks.js +17 -14
  204. package/dist/server/sse-handler.js +141 -19
  205. package/dist/session/ArtifactsPanel.js +39 -17
  206. package/dist/session/PlanTracker.js +12 -7
  207. package/dist/session/ProjectHome.js +13 -11
  208. package/dist/session/RemindersPanel.js +34 -16
  209. package/dist/session/RunningWorkDialog.js +6 -2
  210. package/dist/session/SecretsPanel.js +29 -10
  211. package/dist/session/SessionDetailsDialog.d.ts +1 -1
  212. package/dist/session/SessionDetailsDialog.js +18 -10
  213. package/dist/session/SideChat.js +10 -7
  214. package/dist/session/TurnDetailsDialog.js +19 -5
  215. package/dist/session/UsagePanel.js +10 -4
  216. package/dist/session/headless/host.d.ts +2 -0
  217. package/dist/session/headless/labels.d.ts +19 -1
  218. package/dist/session/headless/labels.js +15 -1
  219. package/dist/session/headless/queue.js +2 -1
  220. package/dist/session/headless/reminder-labels.d.ts +4 -0
  221. package/dist/session/headless/reminder-labels.js +4 -0
  222. package/dist/settings/SettingsRestricted.d.ts +1 -1
  223. package/dist/settings/SettingsRestricted.js +4 -4
  224. package/dist/settings/SettingsShell.d.ts +7 -0
  225. package/dist/settings/SettingsShell.js +6 -1
  226. package/dist/settings/headless/fixture-performance.d.ts +1 -1
  227. package/dist/settings/headless/host.d.ts +2 -2
  228. package/dist/settings/headless/labels.d.ts +3 -3
  229. package/dist/settings/headless/labels.js +3 -3
  230. package/dist/settings/headless/performance.d.ts +3 -4
  231. package/dist/settings/headless/search.d.ts +1 -1
  232. package/dist/settings/index.d.ts +2 -1
  233. package/dist/settings/index.js +2 -1
  234. package/dist/settings/sections/editor/EditorSection.js +7 -4
  235. package/dist/settings/sections/editor/labels.d.ts +1 -0
  236. package/dist/settings/sections/editor/labels.js +1 -0
  237. package/dist/settings/sections/environments/EnvironmentsSection.js +19 -12
  238. package/dist/settings/sections/environments/labels.d.ts +1 -0
  239. package/dist/settings/sections/environments/labels.js +2 -1
  240. package/dist/settings/sections/extensions/ExtensionConfigRows.d.ts +1 -3
  241. package/dist/settings/sections/extensions/ExtensionConfigRows.js +20 -19
  242. package/dist/settings/sections/extensions/ExtensionOptionsSection.js +2 -1
  243. package/dist/settings/sections/extensions/options-labels.d.ts +2 -1
  244. package/dist/settings/sections/extensions/options-labels.js +2 -1
  245. package/dist/settings/sections/index.d.ts +2 -1
  246. package/dist/settings/sections/index.js +2 -1
  247. package/dist/settings/sections/logs/LogsSection.d.ts +2 -2
  248. package/dist/settings/sections/logs/LogsSection.js +2 -2
  249. package/dist/settings/sections/mcp/McpSection.d.ts +1 -1
  250. package/dist/settings/sections/mcp/McpSection.js +12 -6
  251. package/dist/settings/sections/mcp/McpServerRow.js +20 -13
  252. package/dist/settings/sections/mcp/labels.d.ts +8 -2
  253. package/dist/settings/sections/mcp/labels.js +8 -2
  254. package/dist/settings/sections/models/ModelRows.js +1 -1
  255. package/dist/settings/sections/models/NewChatPlaceRow.d.ts +26 -0
  256. package/dist/settings/sections/models/NewChatPlaceRow.js +78 -0
  257. package/dist/settings/sections/models/SpacesDefaultsSection.js +15 -3
  258. package/dist/settings/sections/models/labels.d.ts +7 -0
  259. package/dist/settings/sections/models/labels.js +7 -0
  260. package/dist/settings/sections/models/model-test.js +7 -4
  261. package/dist/settings/sections/performance/PerformanceSection.js +16 -6
  262. package/dist/settings/sections/performance/labels.d.ts +1 -1
  263. package/dist/settings/sections/performance/labels.js +1 -1
  264. package/dist/settings/sections/providers/ProvidersSection.d.ts +1 -1
  265. package/dist/settings/sections/providers/ProvidersSection.js +14 -7
  266. package/dist/settings/sections/providers/ServerProvidersSection.d.ts +1 -1
  267. package/dist/settings/sections/providers/ServerProvidersSection.js +11 -5
  268. package/dist/settings/sections/providers/labels.d.ts +2 -2
  269. package/dist/settings/sections/providers/labels.js +2 -2
  270. package/dist/settings/sections/skills/SkillList.js +1 -1
  271. package/dist/settings/sections/skills/SkillsSection.js +1 -1
  272. package/dist/settings/testing/performance.contract.js +8 -12
  273. package/dist/styles.css +32 -3
  274. package/dist/terminal/HostTerminalSurface.js +15 -5
  275. package/dist/terminal/TerminalPanel.js +30 -17
  276. package/dist/terminal/TerminalSurface.js +11 -4
  277. package/dist/terminal/headless/labels.d.ts +5 -0
  278. package/dist/terminal/headless/labels.js +5 -0
  279. package/dist/terminal/headless/store.d.ts +1 -1
  280. package/dist/terminal/headless/store.js +6 -3
  281. package/dist/workspace/LayoutBudget.d.ts +5 -1
  282. package/dist/workspace/LayoutBudget.js +14 -1
  283. package/dist/workspace/PanelContentView.d.ts +1 -1
  284. package/dist/workspace/PanelContentView.js +17 -6
  285. package/dist/workspace/WorkspaceProvider.js +3 -2
  286. package/dist/workspace/headless/labels.d.ts +1 -0
  287. package/dist/workspace/headless/labels.js +1 -0
  288. package/package.json +3 -3
  289. package/src/styles/motion.css +8 -0
  290. package/src/styles/primitives.css +7 -0
@@ -187,23 +187,35 @@ function FoldOutcomes({ ok, failed }) {
187
187
  * a toggle with its caret when opening shows something more, otherwise the
188
188
  * same line, inert. Same box, tone and spacing either way.
189
189
  *
190
+ * One element in both states: swapping a `<div>` for a `<button>` remounted
191
+ * the line's content, so a live fold turning expandable (its 4th step) replayed
192
+ * the enter of everything in it, its elapsed chip popping in again.
193
+ *
190
194
  * @param props - Header props: `expandable`, `open`, `onToggle`, and the `children` of the line.
191
195
  */
192
196
  function FoldHeader({ expandable, open, onToggle, children, className, style }) {
193
197
  const line = "flex items-baseline gap-2 h-[22.4px] min-w-0 max-w-full text-[var(--zg-text-muted)]";
194
- if (!expandable) return /* @__PURE__ */ jsx("div", {
195
- "data-testid": "fold-head",
196
- className: [line, className].filter(Boolean).join(" "),
197
- style,
198
- children
199
- });
200
- return /* @__PURE__ */ jsxs("button", {
201
- type: "button",
202
- onClick: onToggle,
198
+ const toggle = expandable ? {
199
+ role: "button",
200
+ tabIndex: 0,
203
201
  "aria-expanded": open,
204
- className: [`zg-disclosure zg-press-subtle ${line}`, className].filter(Boolean).join(" "),
202
+ onClick: onToggle,
203
+ onKeyDown: (e) => {
204
+ if (e.key !== "Enter" && e.key !== " ") return;
205
+ e.preventDefault();
206
+ onToggle();
207
+ }
208
+ } : {};
209
+ return /* @__PURE__ */ jsxs("div", {
210
+ "data-testid": "fold-head",
211
+ className: [
212
+ expandable ? "zg-disclosure zg-press-subtle" : "",
213
+ line,
214
+ className
215
+ ].filter(Boolean).join(" "),
205
216
  style,
206
- children: [children, /* @__PURE__ */ jsx(Caret, {
217
+ ...toggle,
218
+ children: [children, expandable && /* @__PURE__ */ jsx(Caret, {
207
219
  open,
208
220
  className: "shrink-0 self-center"
209
221
  })]
@@ -224,6 +236,7 @@ function FoldActions({ items, all, openIds, onToggle, renderRows }) {
224
236
  children: items.map((item) => /* @__PURE__ */ jsx(Grow, {
225
237
  as: "li",
226
238
  appear: !firstIds.has(item.id),
239
+ symmetric: !all,
227
240
  className: "-mx-1.5 px-1.5",
228
241
  children: /* @__PURE__ */ jsx("div", {
229
242
  className: "pt-[var(--zg-fold-gap)]",
@@ -260,20 +273,38 @@ function ActionWithDetails({ item, openIds, onToggle, renderRows }) {
260
273
  })
261
274
  })
262
275
  }),
263
- item.children && item.children.length > 0 && /* @__PURE__ */ jsx("ul", {
264
- className: "list-none m-0 p-0 pl-7",
265
- "data-testid": "fold-action-children",
266
- children: item.children.map((child) => /* @__PURE__ */ jsx("li", {
267
- className: "pt-[var(--zg-fold-gap)]",
268
- children: /* @__PURE__ */ jsx(ActionWithDetails, {
269
- item: child,
270
- openIds,
271
- onToggle,
272
- renderRows
276
+ item.children && item.children.length > 0 && /* @__PURE__ */ jsx(ActionChildren, {
277
+ items: item.children,
278
+ openIds,
279
+ onToggle,
280
+ renderRows
281
+ })
282
+ ] });
283
+ }
284
+ /** The calls an action made, one step in. A call made after the list showed grows in instead of snapping the rows below down. */
285
+ function ActionChildren({ items, openIds, onToggle, renderRows }) {
286
+ const [firstIds] = useState(() => new Set(items.map((i) => i.id)));
287
+ return /* @__PURE__ */ jsx("ul", {
288
+ className: "list-none m-0 p-0 pl-7",
289
+ "data-testid": "fold-action-children",
290
+ children: /* @__PURE__ */ jsx(GrowPresence, {
291
+ initial: false,
292
+ children: items.map((child) => /* @__PURE__ */ jsx(Grow, {
293
+ as: "li",
294
+ appear: !firstIds.has(child.id),
295
+ className: "-mx-1.5 px-1.5",
296
+ children: /* @__PURE__ */ jsx("div", {
297
+ className: "pt-[var(--zg-fold-gap)]",
298
+ children: /* @__PURE__ */ jsx(ActionWithDetails, {
299
+ item: child,
300
+ openIds,
301
+ onToggle,
302
+ renderRows
303
+ })
273
304
  })
274
305
  }, child.id))
275
306
  })
276
- ] });
307
+ });
277
308
  }
278
309
  /** The item or one of the calls nested under it has its details open. */
279
310
  function openWithin(item, openIds) {
@@ -1,6 +1,6 @@
1
1
  import { ToolRowModel } from "../headless/transcript/rows.js";
2
2
  import "../headless/transcript/index.js";
3
- import { Yw as ScriptProgress } from "../../dist/index-Bq87OcGy.js";
3
+ import { iT as ScriptProgress } from "../../dist/index-BZM8tu4L.js";
4
4
  //#region src/chat/transcript/script-input.d.ts
5
5
  /**
6
6
  * A tool row's progress and how it ended, as `ToolInput` takes them for a Codemode script.
@@ -1,5 +1,6 @@
1
1
  import { iconButtonClass } from "../../components/IconButton.js";
2
2
  import { CopyButton } from "../../components/CopyButton.js";
3
+ import { Notice } from "../../components/Notice.js";
3
4
  import { Grow, GrowPresence } from "../../motion/grow.js";
4
5
  import { SmoothHeight } from "../../motion/size.js";
5
6
  import { constant, useReadable } from "../headless/store.js";
@@ -200,9 +201,12 @@ function RunPanel({ code, live, saved, onAgain, onTerminal, onRemove }) {
200
201
  running: true
201
202
  })]
202
203
  });
203
- if (live?.error !== void 0) return /* @__PURE__ */ jsx("span", {
204
- className: "text-zg-danger",
205
- children: labels.blockRunFailed(live.error)
204
+ if (live?.error !== void 0) return /* @__PURE__ */ jsx(Notice, {
205
+ tone: "error",
206
+ compact: true,
207
+ detail: live.error,
208
+ className: "min-w-0",
209
+ children: labels.blockRunError
206
210
  });
207
211
  if (!saved) return null;
208
212
  const label = saved.stopped === "timeout" ? labels.blockRunTimedOut : saved.stopped === "cancelled" ? labels.blockRunStopped : saved.exitCode === null ? labels.shellKilled : labels.shellExit(saved.exitCode);
@@ -422,6 +422,17 @@ function useStickToBottom(scrollRef, { paused = false, rowSelector = ".zg-cv-row
422
422
  ro.observe(el);
423
423
  const content = el.firstElementChild;
424
424
  if (content) ro.observe(content);
425
+ const clamps = new MutationObserver(() => {
426
+ if (!pinnedRef.current || held.current || pausedRef.current) return;
427
+ const top = el.scrollTop;
428
+ if (top < lastTop.current - 1 && el.scrollHeight - el.clientHeight - top <= 1) lastTop.current = top;
429
+ });
430
+ if (content) clamps.observe(content, {
431
+ childList: true,
432
+ subtree: true,
433
+ characterData: true,
434
+ attributes: true
435
+ });
425
436
  lastTop.current = el.scrollTop;
426
437
  const glideState = glide.current;
427
438
  return () => {
@@ -436,6 +447,7 @@ function useStickToBottom(scrollRef, { paused = false, rowSelector = ".zg-cv-row
436
447
  el.removeEventListener("wheel", onWheel);
437
448
  el.removeEventListener("keydown", onKey);
438
449
  ro.disconnect();
450
+ clamps.disconnect();
439
451
  };
440
452
  }, [
441
453
  scrollRef,
@@ -1,6 +1,7 @@
1
1
  import { useLabels } from "../labels.js";
2
2
  import { buttonClass } from "./button.js";
3
3
  import { CopyButton } from "./CopyButton.js";
4
+ import { Notice } from "./Notice.js";
4
5
  import { INPUT_CLASS } from "./Form.js";
5
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
7
  import { useState } from "react";
@@ -27,12 +28,27 @@ function hostOf(url) {
27
28
  */
28
29
  function BrowserSignIn({ state, service, onCancel, onRetry, onSubmit, className = "", style }) {
29
30
  const labels = useLabels();
30
- const failed = state.kind === "error";
31
+ if (state.kind === "error") return /* @__PURE__ */ jsx(Notice, {
32
+ tone: "error",
33
+ detail: state.message,
34
+ action: onRetry && /* @__PURE__ */ jsx("button", {
35
+ type: "button",
36
+ onClick: onRetry,
37
+ className: buttonClass({
38
+ variant: "primary",
39
+ size: "sm"
40
+ }),
41
+ children: labels.retry
42
+ }),
43
+ className: `text-zg-label ${className}`.trimEnd(),
44
+ style,
45
+ children: labels.signInFailed
46
+ });
31
47
  const done = state.kind === "done";
32
48
  return /* @__PURE__ */ jsxs("div", {
33
- role: failed ? "alert" : "status",
34
- "aria-live": failed ? void 0 : "polite",
35
- className: `flex flex-col gap-3 px-3 py-2.5 rounded-zg-md text-zg-label ${failed ? "bg-zg-danger/10" : "zg-tray"} ${className}`,
49
+ role: "status",
50
+ "aria-live": "polite",
51
+ className: `flex flex-col gap-3 px-3 py-2.5 rounded-zg-md text-zg-label zg-tray ${className}`,
36
52
  style,
37
53
  children: [/* @__PURE__ */ jsxs("div", {
38
54
  className: "flex items-start gap-3",
@@ -40,7 +56,7 @@ function BrowserSignIn({ state, service, onCancel, onRetry, onSubmit, className
40
56
  /* @__PURE__ */ jsx("span", {
41
57
  className: "mt-0.5 shrink-0",
42
58
  "aria-hidden": true,
43
- children: done ? /* @__PURE__ */ jsx("span", { className: "i-ph-check-circle-fill text-zg-body text-[var(--zg-accent)]" }) : failed ? /* @__PURE__ */ jsx("span", { className: "i-ph-warning-circle-fill text-zg-body text-zg-danger" }) : /* @__PURE__ */ jsx("span", { className: "zg-spin-ring zg-loop block mt-px text-[var(--zg-accent)]" })
59
+ children: done ? /* @__PURE__ */ jsx("span", { className: "i-ph-check-circle-fill text-zg-body text-[var(--zg-accent)]" }) : /* @__PURE__ */ jsx("span", { className: "zg-spin-ring zg-loop block mt-px text-[var(--zg-accent)]" })
44
60
  }),
45
61
  /* @__PURE__ */ jsx("div", {
46
62
  className: "flex-1 min-w-0 flex flex-col gap-1",
@@ -49,15 +65,7 @@ function BrowserSignIn({ state, service, onCancel, onRetry, onSubmit, className
49
65
  service
50
66
  })
51
67
  }),
52
- failed ? onRetry && /* @__PURE__ */ jsx("button", {
53
- type: "button",
54
- onClick: onRetry,
55
- className: buttonClass({
56
- variant: "primary",
57
- size: "sm"
58
- }),
59
- children: labels.retry
60
- }) : !done && onCancel && /* @__PURE__ */ jsx("button", {
68
+ !done && onCancel && /* @__PURE__ */ jsx("button", {
61
69
  type: "button",
62
70
  onClick: onCancel,
63
71
  className: buttonClass({
@@ -88,13 +96,7 @@ function SignInMessage({ state, service }) {
88
96
  className: "text-[var(--zg-text)]",
89
97
  children: labels.signInDone(state.account)
90
98
  });
91
- case "error": return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
92
- className: "text-zg-danger font-medium",
93
- children: labels.signInFailed
94
- }), /* @__PURE__ */ jsx("span", {
95
- className: "text-[var(--zg-text-muted)] break-words",
96
- children: state.message
97
- })] });
99
+ case "error": return null;
98
100
  case "url": return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
99
101
  className: "text-[var(--zg-text)]",
100
102
  children: state.instructions ?? labels.signInInBrowser(service)
@@ -18,25 +18,27 @@ declare const FIELD_LABEL_CLASS = "block text-xs text-[var(--zg-text-muted)] mb-
18
18
  declare const FORM_CARD_CLASS = "zg-raised border rounded-zg-lg p-4 space-y-3";
19
19
  /** Props for {@link ErrorNote}. */
20
20
  interface ErrorNoteProps {
21
- /** The error message. */
21
+ /** The error message, worded for people. */
22
22
  children: ReactNode;
23
+ /** The raw words behind it (an exception's message): folded under Details. */
24
+ detail?: string;
23
25
  /** Extra classes on the root element. */
24
26
  className?: string;
25
27
  /** Inline styles on the root element, merged after the component's own. */
26
28
  style?: CSSProperties;
27
29
  }
28
30
  /**
29
- * A failure worth reading: a soft danger wash, no border.
31
+ * A failure worth reading: an error {@link Notice}.
30
32
  *
31
33
  * @param props - Component props.
32
34
  */
33
- declare function ErrorNote({ children, className, style }: ErrorNoteProps): import("react").JSX.Element;
35
+ declare function ErrorNote({ children, detail, className, style }: ErrorNoteProps): import("react").JSX.Element;
34
36
  /** Props for {@link OpLine}. */
35
37
  interface OpLineProps {
36
38
  /**
37
39
  * Tone of the line: `busy` and `notice` are muted (a result worth a quiet line,
38
40
  * never a celebration: a success that shows elsewhere needs no line at all), and
39
- * `error` is danger-coloured and announced as an alert.
41
+ * `error` is a compact error {@link Notice}.
40
42
  */
41
43
  kind: 'busy' | 'notice' | 'error';
42
44
  /** The feedback text. */
@@ -1,3 +1,4 @@
1
+ import { Notice } from "./Notice.js";
1
2
  import { Segmented } from "./Segmented.js";
2
3
  import { Raised, SectionLabel, Tray } from "./Surface.js";
3
4
  import { SwitchGlyph } from "./SwitchGlyph.js";
@@ -23,15 +24,16 @@ const FIELD_LABEL_CLASS = "block text-xs text-[var(--zg-text-muted)] mb-1";
23
24
  /** An inline add / install form: a raised card above the list it feeds. */
24
25
  const FORM_CARD_CLASS = "zg-raised border rounded-zg-lg p-4 space-y-3";
25
26
  /**
26
- * A failure worth reading: a soft danger wash, no border.
27
+ * A failure worth reading: an error {@link Notice}.
27
28
  *
28
29
  * @param props - Component props.
29
30
  */
30
- function ErrorNote({ children, className, style }) {
31
- return /* @__PURE__ */ jsx("div", {
32
- role: "alert",
33
- className: ["px-3 py-2 rounded-zg-md bg-zg-danger/10 text-xs text-zg-danger break-words", className].filter(Boolean).join(" "),
34
- style,
31
+ function ErrorNote({ children, detail, className, style }) {
32
+ return /* @__PURE__ */ jsx(Notice, {
33
+ tone: "error",
34
+ ...detail ? { detail } : {},
35
+ ...className ? { className } : {},
36
+ ...style ? { style } : {},
35
37
  children
36
38
  });
37
39
  }
@@ -41,9 +43,15 @@ function ErrorNote({ children, className, style }) {
41
43
  * @param props - Component props.
42
44
  */
43
45
  function OpLine({ kind, children, className, style }) {
46
+ if (kind === "error") return /* @__PURE__ */ jsx(Notice, {
47
+ tone: "error",
48
+ compact: true,
49
+ ...className ? { className } : {},
50
+ ...style ? { style } : {},
51
+ children
52
+ });
44
53
  return /* @__PURE__ */ jsx("div", {
45
- role: kind === "error" ? "alert" : void 0,
46
- className: [`px-1 text-xs break-words ${kind === "error" ? "text-zg-danger" : "text-[var(--zg-text-muted)]"}`, className].filter(Boolean).join(" "),
54
+ className: ["px-1 text-xs break-words text-[var(--zg-text-muted)]", className].filter(Boolean).join(" "),
47
55
  style,
48
56
  children
49
57
  });
@@ -4,6 +4,8 @@ import { CSSProperties, ReactNode } from "react";
4
4
  interface LoadErrorProps {
5
5
  /** The line: what could not be read and why. */
6
6
  children: ReactNode;
7
+ /** The raw words behind it (an exception's message): folded under Details. */
8
+ detail?: string;
7
9
  /** Reads again; absent, no Retry. */
8
10
  onRetry?: () => void;
9
11
  /** Spacing from the surroundings. */
@@ -12,10 +14,10 @@ interface LoadErrorProps {
12
14
  style?: CSSProperties;
13
15
  }
14
16
  /**
15
- * Renders a failed read's line in the danger colour, `children` first (`Couldn't scan for plugins: …`).
17
+ * Renders a failed read's line as a compact error notice, `children` first (`Couldn't scan for plugins`).
16
18
  *
17
19
  * @param props - Component props.
18
20
  */
19
- declare function LoadError({ children, onRetry, className, style }: LoadErrorProps): import("react").JSX.Element;
21
+ declare function LoadError({ children, detail, onRetry, className, style }: LoadErrorProps): import("react").JSX.Element;
20
22
  //#endregion
21
23
  export { LoadError, LoadErrorProps };
@@ -1,23 +1,27 @@
1
1
  import { useLabels } from "../labels.js";
2
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
+ import { Notice } from "./Notice.js";
3
+ import { jsx } from "react/jsx-runtime";
3
4
  //#region src/components/LoadError.tsx
4
5
  /**
5
- * Renders a failed read's line in the danger colour, `children` first (`Couldn't scan for plugins: …`).
6
+ * Renders a failed read's line as a compact error notice, `children` first (`Couldn't scan for plugins`).
6
7
  *
7
8
  * @param props - Component props.
8
9
  */
9
- function LoadError({ children, onRetry, className = "", style }) {
10
+ function LoadError({ children, detail, onRetry, className, style }) {
10
11
  const labels = useLabels();
11
- return /* @__PURE__ */ jsxs("p", {
12
- role: "alert",
13
- className: `m-0 text-xs text-zg-danger ${className}`,
14
- style,
15
- children: [children, onRetry && /* @__PURE__ */ jsxs(Fragment, { children: [" ", /* @__PURE__ */ jsx("button", {
12
+ return /* @__PURE__ */ jsx(Notice, {
13
+ tone: "error",
14
+ compact: true,
15
+ ...detail ? { detail } : {},
16
+ ...className ? { className } : {},
17
+ ...style ? { style } : {},
18
+ ...onRetry ? { action: /* @__PURE__ */ jsx("button", {
16
19
  type: "button",
17
20
  className: "bg-transparent border-0 p-0 cursor-pointer underline text-inherit",
18
21
  onClick: onRetry,
19
22
  children: labels.retry
20
- })] })]
23
+ }) } : {},
24
+ children
21
25
  });
22
26
  }
23
27
  //#endregion
@@ -0,0 +1,29 @@
1
+ import { CSSProperties, ReactNode } from "react";
2
+ //#region src/components/Notice.d.ts
3
+ /** How serious a {@link Notice} is. */
4
+ type NoticeTone = 'error' | 'warning' | 'info';
5
+ /** Props for {@link Notice}. */
6
+ interface NoticeProps {
7
+ /** How serious it is: the glyph, the colour, and `alert` (error) or `status`. */
8
+ tone: NoticeTone;
9
+ /** The message, worded for people. */
10
+ children: ReactNode;
11
+ /** The raw words behind it (an exception's message, a server's answer): folded under Details. */
12
+ detail?: string;
13
+ /** A control after the message (Retry, Open settings). */
14
+ action?: ReactNode;
15
+ /** One tight line, for a row or a form field. Default: a block with room around it. */
16
+ compact?: boolean;
17
+ /** Extra classes on the root element. */
18
+ className?: string;
19
+ /** Inline styles on the root element, merged after the component's own. */
20
+ style?: CSSProperties;
21
+ }
22
+ /**
23
+ * Renders a toned message: glyph, the words, an optional action, and the raw detail folded away.
24
+ *
25
+ * @param props - {@link NoticeProps}.
26
+ */
27
+ declare function Notice({ tone, children, detail, action, compact, className, style }: NoticeProps): import("react").JSX.Element;
28
+ //#endregion
29
+ export { Notice, NoticeProps, NoticeTone };
@@ -0,0 +1,63 @@
1
+ import { useLabels } from "../labels.js";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ //#region src/components/Notice.tsx
4
+ const TONES = {
5
+ error: {
6
+ wash: "bg-zg-danger/10",
7
+ text: "text-zg-danger",
8
+ icon: "i-ph-warning-circle"
9
+ },
10
+ warning: {
11
+ wash: "bg-zg-warn/10",
12
+ text: "text-zg-warn",
13
+ icon: "i-ph-warning"
14
+ },
15
+ info: {
16
+ wash: "bg-zg-info/10",
17
+ text: "text-[var(--zg-text-muted)]",
18
+ icon: "i-ph-info"
19
+ }
20
+ };
21
+ /**
22
+ * Renders a toned message: glyph, the words, an optional action, and the raw detail folded away.
23
+ *
24
+ * @param props - {@link NoticeProps}.
25
+ */
26
+ function Notice({ tone, children, detail, action, compact = false, className, style }) {
27
+ const labels = useLabels();
28
+ const t = TONES[tone];
29
+ return /* @__PURE__ */ jsxs("div", {
30
+ role: tone === "error" ? "alert" : "status",
31
+ "data-tone": tone,
32
+ className: [
33
+ compact ? "px-2 py-1 rounded-zg-sm" : "px-3 py-2 rounded-zg-md",
34
+ `flex items-start gap-2 text-xs break-words ${t.wash} ${t.text}`,
35
+ className
36
+ ].filter(Boolean).join(" "),
37
+ style,
38
+ children: [/* @__PURE__ */ jsx("span", {
39
+ "aria-hidden": true,
40
+ className: `${t.icon} shrink-0 mt-[2px]`
41
+ }), /* @__PURE__ */ jsxs("div", {
42
+ className: "flex-1 min-w-0",
43
+ children: [/* @__PURE__ */ jsxs("div", {
44
+ className: "flex flex-wrap items-baseline gap-x-2 gap-y-1",
45
+ children: [/* @__PURE__ */ jsx("span", {
46
+ className: "min-w-0",
47
+ children
48
+ }), action]
49
+ }), detail && /* @__PURE__ */ jsxs("details", {
50
+ className: "mt-1 text-[var(--zg-text-muted)]",
51
+ children: [/* @__PURE__ */ jsx("summary", {
52
+ className: "cursor-pointer select-none",
53
+ children: labels.noticeDetails
54
+ }), /* @__PURE__ */ jsx("pre", {
55
+ className: "m-0 mt-1 whitespace-pre-wrap break-words font-mono text-zg-meta",
56
+ children: detail
57
+ })]
58
+ })]
59
+ })]
60
+ });
61
+ }
62
+ //#endregion
63
+ export { Notice };
@@ -4,7 +4,7 @@ import { CSSProperties, ReactNode } from "react";
4
4
  interface PanelEmptyProps {
5
5
  /** Icon class shown above the title, such as `i-ph-files`. */
6
6
  icon?: string;
7
- /** Main message. It takes the warning colour when `warn` is set. */
7
+ /** Main message. With `warn`, a warning {@link Notice}. */
8
8
  title: ReactNode;
9
9
  /** Secondary text under the title. */
10
10
  hint?: ReactNode;
@@ -1,4 +1,5 @@
1
1
  import { useLabels } from "../labels.js";
2
+ import { Notice } from "./Notice.js";
2
3
  import { EmptyState } from "./Surface.js";
3
4
  import { SegmentSpinner } from "./SegmentSpinner.js";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -15,8 +16,9 @@ function PanelEmpty({ icon, title, hint, warn = false, className, style }) {
15
16
  style,
16
17
  children: /* @__PURE__ */ jsx(EmptyState, {
17
18
  icon,
18
- title: warn ? /* @__PURE__ */ jsx("span", {
19
- className: "text-[var(--zg-warn)]",
19
+ title: warn ? /* @__PURE__ */ jsx(Notice, {
20
+ tone: "warning",
21
+ compact: true,
20
22
  children: title
21
23
  }) : title,
22
24
  hint,
@@ -4,7 +4,7 @@ import { CSSProperties, ReactNode } from "react";
4
4
  interface RestrictedProps {
5
5
  /** Whether this connection may not change what it wraps. */
6
6
  restricted: boolean;
7
- /** Why, short: the tooltip and the group's accessible name ("Admin only"). */
7
+ /** Why, short: the tooltip and the group's accessible name ("The server does not offer this"). */
8
8
  reason: string;
9
9
  /** What it wraps. */
10
10
  children: ReactNode;
@@ -79,7 +79,14 @@ function PaletteList({ groups, cursor, query, nested, onHover, onRun, renderRow,
79
79
  ref: scroller,
80
80
  id: "zg-palette-list",
81
81
  role: "listbox",
82
- className: ["zg-palette-list overflow-y-auto overscroll-contain", className].filter(Boolean).join(" "),
82
+ tabIndex: -1,
83
+ onMouseDown: (e) => {
84
+ if (e.target !== e.currentTarget) e.preventDefault();
85
+ },
86
+ onFocus: (e) => {
87
+ if (e.target === e.currentTarget && e.relatedTarget instanceof HTMLElement) e.relatedTarget.focus();
88
+ },
89
+ className: ["zg-palette-list select-none overflow-y-auto overscroll-contain", className].filter(Boolean).join(" "),
83
90
  style: {
84
91
  height: viewHeight,
85
92
  ...style
@@ -1,5 +1,6 @@
1
1
  import { useLabels } from "../../labels.js";
2
2
  import { IconButton } from "../IconButton.js";
3
+ import { Notice } from "../Notice.js";
3
4
  import { PaletteList, defaultPaletteKeys } from "./PaletteList.js";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  import { Fragment as Fragment$1, useEffect, useMemo, useRef, useState } from "react";
@@ -115,12 +116,12 @@ function PalettePanel({ groups, query, onQueryChange, cursor, onCursorChange, on
115
116
  return;
116
117
  }
117
118
  case "Tab":
119
+ e.preventDefault();
120
+ e.stopPropagation();
118
121
  if (e.shiftKey && !nested && onScopeNext) {
119
- e.preventDefault();
120
- e.stopPropagation();
121
122
  onScopeNext();
122
123
  onCursorChange(0);
123
- }
124
+ } else if (flat.length > 0) onCursorChange(e.shiftKey ? (cursor - 1 + flat.length) % flat.length : (cursor + 1) % flat.length);
124
125
  return;
125
126
  case "Backspace":
126
127
  if (query === "" && nested && onBack) {
@@ -225,11 +226,18 @@ function PalettePanel({ groups, query, onQueryChange, cursor, onCursorChange, on
225
226
  })
226
227
  ]
227
228
  }),
228
- notice && /* @__PURE__ */ jsx("div", {
229
+ notice && (notice.tone === "error" || notice.tone === "warn" ? /* @__PURE__ */ jsx("div", {
230
+ className: "px-3 py-2 shadow-[inset_0_1px_0_var(--zg-hairline)]",
231
+ children: /* @__PURE__ */ jsx(Notice, {
232
+ tone: notice.tone === "error" ? "error" : "warning",
233
+ compact: true,
234
+ children: notice.text
235
+ })
236
+ }) : /* @__PURE__ */ jsx("div", {
229
237
  role: "status",
230
- className: `px-3 py-2 shadow-[inset_0_1px_0_var(--zg-hairline)] text-zg-label ${notice.tone === "error" ? "text-zg-danger" : notice.tone === "warn" ? "text-zg-warn" : "text-[var(--zg-text-muted)]"}`,
238
+ className: "px-3 py-2 shadow-[inset_0_1px_0_var(--zg-hairline)] text-zg-label text-[var(--zg-text-muted)]",
231
239
  children: notice.text
232
- })
240
+ }))
233
241
  ]
234
242
  });
235
243
  }