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.
- package/dist/adapters/index.d.ts +2 -2
- package/dist/adapters/index.js +2 -2
- package/dist/adapters/live.d.ts +29 -3
- package/dist/adapters/live.js +9 -1
- package/dist/adapters/server-composer-host.js +17 -2
- package/dist/adapters/server-extensions-host.d.ts +0 -1
- package/dist/adapters/server-extensions-host.js +4 -15
- package/dist/adapters/server-git-host.js +7 -16
- package/dist/adapters/server-host.js +181 -43
- package/dist/adapters/server-machines-host.d.ts +2 -0
- package/dist/adapters/server-machines-host.js +22 -23
- package/dist/adapters/server-onboarding-host.d.ts +1 -1
- package/dist/adapters/server-onboarding-host.js +3 -4
- package/dist/adapters/server-session-host.js +22 -3
- package/dist/adapters/server-settings-accounts.js +2 -2
- package/dist/adapters/server-settings-host.js +2 -2
- package/dist/adapters/server-settings-performance.js +7 -9
- package/dist/adapters/server-settings-sections.js +13 -14
- package/dist/adapters/server-sidebar-host.js +2 -2
- package/dist/adapters/sse-host.js +68 -3
- package/dist/adapters/sse-protocol.d.ts +12 -2
- package/dist/adapters/sse-protocol.js +4 -2
- package/dist/app/AppHostProvider.js +4 -3
- package/dist/app/ModalProvider.d.ts +13 -3
- package/dist/app/ModalProvider.js +103 -24
- package/dist/app/NoticeStack.d.ts +33 -0
- package/dist/app/NoticeStack.js +90 -0
- package/dist/app/index.d.ts +3 -2
- package/dist/app/index.js +3 -2
- package/dist/chat/SessionFilterMenu.d.ts +1 -1
- package/dist/chat/SessionFilterMenu.js +2 -1
- package/dist/chat/composer/Composer.js +10 -8
- package/dist/chat/composer/ModelChainList.js +17 -8
- package/dist/chat/composer/ModelChainTooltip.js +5 -2
- package/dist/chat/composer/use-draft-target.d.ts +20 -1
- package/dist/chat/composer/use-draft-target.js +121 -5
- package/dist/chat/composer/use-new-session-defaults.d.ts +5 -1
- package/dist/chat/composer/use-new-session-defaults.js +17 -4
- package/dist/chat/headless/chip-labels.d.ts +1 -0
- package/dist/chat/headless/chip-labels.js +1 -0
- package/dist/chat/headless/composer/labels-editor.d.ts +0 -2
- package/dist/chat/headless/composer/labels-editor.js +0 -2
- package/dist/chat/headless/draft-target.d.ts +21 -1
- package/dist/chat/headless/fixture-host.js +17 -2
- package/dist/chat/headless/host.d.ts +3 -3
- package/dist/chat/headless/index.d.ts +9 -9
- package/dist/chat/headless/index.js +2 -2
- package/dist/chat/headless/labels.d.ts +13 -6
- package/dist/chat/headless/labels.js +10 -9
- package/dist/chat/headless/session-list.d.ts +20 -8
- package/dist/chat/headless/session-list.js +1 -0
- package/dist/chat/headless/sidebar/directory.d.ts +56 -14
- package/dist/chat/headless/sidebar/directory.js +149 -70
- package/dist/chat/headless/sidebar/index.d.ts +3 -3
- package/dist/chat/headless/sidebar/index.js +2 -2
- package/dist/chat/headless/sidebar/labels.d.ts +15 -8
- package/dist/chat/headless/sidebar/types.d.ts +3 -1
- package/dist/chat/headless/sidebar/view.d.ts +13 -5
- package/dist/chat/headless/sidebar/view.js +31 -11
- package/dist/chat/headless/streams/actions.d.ts +5 -3
- package/dist/chat/headless/streams/actions.js +3 -2
- package/dist/chat/headless/streams/index.d.ts +3 -3
- package/dist/chat/headless/streams/merge.d.ts +6 -10
- package/dist/chat/headless/streams/merge.js +7 -21
- package/dist/chat/headless/streams/session-streams.d.ts +29 -4
- package/dist/chat/headless/streams/session-streams.js +86 -0
- package/dist/chat/headless/streams/store.d.ts +162 -16
- package/dist/chat/headless/streams/store.js +334 -38
- package/dist/chat/headless/streams/types.d.ts +10 -7
- package/dist/chat/headless/transcript-labels.d.ts +1 -0
- package/dist/chat/interactions/PlanCard.js +10 -3
- package/dist/chat/interactions/QuestionForm.js +7 -3
- package/dist/chat/interactions/card-ui.d.ts +5 -3
- package/dist/chat/interactions/card-ui.js +9 -7
- package/dist/chat/rich-composer/RichComposer.js +1 -7
- package/dist/chat/rich-composer/composer-extensions.d.ts +0 -2
- package/dist/chat/rich-composer/composer-extensions.js +2 -2
- package/dist/chat/rich-composer/use-composer-editor.d.ts +0 -2
- package/dist/chat/rich-composer/use-composer-editor.js +1 -2
- package/dist/chat/sidebar/SessionSidebar.js +5 -5
- package/dist/chat/sidebar/SidebarFilterMenu.js +3 -1
- package/dist/chat/sidebar/SidebarFrame.d.ts +4 -0
- package/dist/chat/sidebar/SidebarFrame.js +27 -9
- package/dist/chat/sidebar/SidebarGroupHeader.js +1 -1
- package/dist/chat/sidebar/SidebarHostProvider.d.ts +8 -5
- package/dist/chat/sidebar/SidebarHostProvider.js +13 -9
- package/dist/chat/sidebar/SidebarToggleButton.js +7 -3
- package/dist/chat/sidebar/index.d.ts +2 -2
- package/dist/chat/sidebar/session-menu.js +4 -4
- package/dist/chat/sidebar/useSaveViewAsSpace.js +2 -2
- package/dist/chat/testing/contract.js +2 -2
- package/dist/chat/transcript/AuthFailureCard.js +11 -8
- package/dist/chat/transcript/BadgeMenu.js +13 -2
- package/dist/chat/transcript/MermaidDiagram.js +7 -3
- package/dist/chat/transcript/fold.d.ts +4 -0
- package/dist/chat/transcript/fold.js +53 -22
- package/dist/chat/transcript/script-input.d.ts +1 -1
- package/dist/chat/transcript/shell-block.js +7 -3
- package/dist/chat/transcript/useStickToBottom.js +12 -0
- package/dist/components/BrowserSignIn.js +23 -21
- package/dist/components/Form.d.ts +6 -4
- package/dist/components/Form.js +16 -8
- package/dist/components/LoadError.d.ts +4 -2
- package/dist/components/LoadError.js +13 -9
- package/dist/components/Notice.d.ts +29 -0
- package/dist/components/Notice.js +63 -0
- package/dist/components/PanelEmpty.d.ts +1 -1
- package/dist/components/PanelEmpty.js +4 -2
- package/dist/components/Restricted.d.ts +1 -1
- package/dist/components/palette/PaletteList.js +8 -1
- package/dist/components/palette/PalettePanel.js +14 -6
- package/dist/core.css +24 -5
- package/dist/dist/{index-Bq87OcGy.d.ts → index-BZM8tu4L.d.ts} +28 -3
- package/dist/dist/index.d.ts +2 -2
- package/dist/dist/{timeout-B5pO5I5a.d.ts → timeout-Cyx3VGPz.d.ts} +1 -1
- package/dist/extensions/ExtensionSettingsPage.js +1 -4
- package/dist/extensions/ExtensionSettingsSection.js +4 -3
- package/dist/extensions/ExtensionSettingsSidebar.js +2 -6
- package/dist/extensions/SettingsWireForm.d.ts +1 -7
- package/dist/extensions/SettingsWireForm.js +7 -5
- package/dist/extensions/headless/fixture-host.d.ts +1 -5
- package/dist/extensions/headless/fixture-host.js +1 -4
- package/dist/extensions/headless/host.d.ts +1 -11
- package/dist/extensions/headless/index.d.ts +3 -3
- package/dist/extensions/headless/index.js +2 -2
- package/dist/extensions/headless/select.d.ts +1 -11
- package/dist/extensions/headless/select.js +1 -18
- package/dist/files/EditorColumn.js +12 -1
- package/dist/files/TreeColumn.js +13 -20
- package/dist/files/useOpenFiles.js +2 -0
- package/dist/git/BranchMenu.js +5 -3
- package/dist/git/ImportRepoDialog.js +18 -9
- package/dist/git/MoveSessionDialog.js +15 -7
- package/dist/git/RemoteFolderPicker.js +34 -16
- package/dist/git/SyncChip.js +17 -17
- package/dist/git/WherePicker.d.ts +16 -1
- package/dist/git/WherePicker.js +80 -36
- package/dist/git/headless/environment.d.ts +33 -3
- package/dist/git/headless/environment.js +33 -5
- package/dist/git/headless/index.d.ts +2 -2
- package/dist/git/headless/index.js +2 -2
- package/dist/git/headless/labels.d.ts +15 -2
- package/dist/git/headless/labels.js +17 -4
- package/dist/git/useEnvironmentChoices.d.ts +3 -1
- package/dist/git/useEnvironmentChoices.js +6 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/labels.d.ts +5 -0
- package/dist/labels.js +5 -0
- package/dist/machines/AddMachineDialog.d.ts +34 -0
- package/dist/machines/AddMachineDialog.js +464 -0
- package/dist/machines/Banners.d.ts +33 -4
- package/dist/machines/Banners.js +64 -3
- package/dist/machines/DaemonMenu.js +27 -4
- package/dist/machines/HostCapabilities.d.ts +1 -3
- package/dist/machines/HostCapabilities.js +24 -45
- package/dist/machines/HostSyncPanel.js +123 -129
- package/dist/machines/HostsSection.d.ts +4 -1
- package/dist/machines/HostsSection.js +30 -7
- package/dist/machines/MachinesExplainer.d.ts +17 -0
- package/dist/machines/MachinesExplainer.js +71 -0
- package/dist/machines/MachinesProvider.d.ts +14 -2
- package/dist/machines/MachinesProvider.js +35 -1
- package/dist/machines/ServerAddedCard.d.ts +31 -0
- package/dist/machines/ServerAddedCard.js +72 -0
- package/dist/machines/ServerCard.js +91 -215
- package/dist/machines/ServerMachinesPanel.d.ts +2 -2
- package/dist/machines/ServerMachinesPanel.js +184 -323
- package/dist/machines/ServerUpdatePanel.js +51 -40
- package/dist/machines/ShareThisComputerForm.d.ts +19 -0
- package/dist/machines/ShareThisComputerForm.js +133 -0
- package/dist/machines/TokensPanel.d.ts +5 -3
- package/dist/machines/TokensPanel.js +98 -78
- package/dist/machines/headless/fixture-host.d.ts +19 -3
- package/dist/machines/headless/fixture-host.js +42 -5
- package/dist/machines/headless/fixtures.js +4 -6
- package/dist/machines/headless/host.d.ts +40 -19
- package/dist/machines/headless/index.d.ts +3 -3
- package/dist/machines/headless/index.js +2 -2
- package/dist/machines/headless/labels.d.ts +63 -20
- package/dist/machines/headless/labels.js +88 -25
- package/dist/machines/headless/messages.js +8 -0
- package/dist/machines/headless/stores.d.ts +9 -2
- package/dist/machines/headless/stores.js +28 -1
- package/dist/machines/index.d.ts +7 -3
- package/dist/machines/index.js +8 -4
- package/dist/machines/testing/contract.d.ts +15 -3
- package/dist/machines/testing/contract.js +68 -14
- package/dist/motion/grow.d.ts +8 -1
- package/dist/motion/grow.js +10 -4
- package/dist/onboarding/demos/index.js +1 -1
- package/dist/onboarding/headless/labels.d.ts +13 -0
- package/dist/onboarding/headless/labels.js +8 -0
- package/dist/onboarding/index.js +3 -3
- package/dist/onboarding/sources/SourceBrowser.js +11 -7
- package/dist/onboarding/steps/ConnectorsStep.js +1 -1
- package/dist/onboarding/steps/ImportStep.js +4 -1
- package/dist/onboarding/steps/ReadyStep.js +9 -2
- package/dist/onboarding/steps/SkillsStep.js +1 -1
- package/dist/onboarding/steps/connect/KeyForm.js +6 -2
- package/dist/onboarding/steps/connect/ProviderPanel.js +6 -2
- package/dist/onboarding/steps/connect/ProviderReady.js +25 -20
- package/dist/onboarding/steps/tasks.js +17 -14
- package/dist/server/sse-handler.js +141 -19
- package/dist/session/ArtifactsPanel.js +39 -17
- package/dist/session/PlanTracker.js +12 -7
- package/dist/session/ProjectHome.js +13 -11
- package/dist/session/RemindersPanel.js +34 -16
- package/dist/session/RunningWorkDialog.js +6 -2
- package/dist/session/SecretsPanel.js +29 -10
- package/dist/session/SessionDetailsDialog.d.ts +1 -1
- package/dist/session/SessionDetailsDialog.js +18 -10
- package/dist/session/SideChat.js +10 -7
- package/dist/session/TurnDetailsDialog.js +19 -5
- package/dist/session/UsagePanel.js +10 -4
- package/dist/session/headless/host.d.ts +2 -0
- package/dist/session/headless/labels.d.ts +19 -1
- package/dist/session/headless/labels.js +15 -1
- package/dist/session/headless/queue.js +2 -1
- package/dist/session/headless/reminder-labels.d.ts +4 -0
- package/dist/session/headless/reminder-labels.js +4 -0
- package/dist/settings/SettingsRestricted.d.ts +1 -1
- package/dist/settings/SettingsRestricted.js +4 -4
- package/dist/settings/SettingsShell.d.ts +7 -0
- package/dist/settings/SettingsShell.js +6 -1
- package/dist/settings/headless/fixture-performance.d.ts +1 -1
- package/dist/settings/headless/host.d.ts +2 -2
- package/dist/settings/headless/labels.d.ts +3 -3
- package/dist/settings/headless/labels.js +3 -3
- package/dist/settings/headless/performance.d.ts +3 -4
- package/dist/settings/headless/search.d.ts +1 -1
- package/dist/settings/index.d.ts +2 -1
- package/dist/settings/index.js +2 -1
- package/dist/settings/sections/editor/EditorSection.js +7 -4
- package/dist/settings/sections/editor/labels.d.ts +1 -0
- package/dist/settings/sections/editor/labels.js +1 -0
- package/dist/settings/sections/environments/EnvironmentsSection.js +19 -12
- package/dist/settings/sections/environments/labels.d.ts +1 -0
- package/dist/settings/sections/environments/labels.js +2 -1
- package/dist/settings/sections/extensions/ExtensionConfigRows.d.ts +1 -3
- package/dist/settings/sections/extensions/ExtensionConfigRows.js +20 -19
- package/dist/settings/sections/extensions/ExtensionOptionsSection.js +2 -1
- package/dist/settings/sections/extensions/options-labels.d.ts +2 -1
- package/dist/settings/sections/extensions/options-labels.js +2 -1
- package/dist/settings/sections/index.d.ts +2 -1
- package/dist/settings/sections/index.js +2 -1
- package/dist/settings/sections/logs/LogsSection.d.ts +2 -2
- package/dist/settings/sections/logs/LogsSection.js +2 -2
- package/dist/settings/sections/mcp/McpSection.d.ts +1 -1
- package/dist/settings/sections/mcp/McpSection.js +12 -6
- package/dist/settings/sections/mcp/McpServerRow.js +20 -13
- package/dist/settings/sections/mcp/labels.d.ts +8 -2
- package/dist/settings/sections/mcp/labels.js +8 -2
- package/dist/settings/sections/models/ModelRows.js +1 -1
- package/dist/settings/sections/models/NewChatPlaceRow.d.ts +26 -0
- package/dist/settings/sections/models/NewChatPlaceRow.js +78 -0
- package/dist/settings/sections/models/SpacesDefaultsSection.js +15 -3
- package/dist/settings/sections/models/labels.d.ts +7 -0
- package/dist/settings/sections/models/labels.js +7 -0
- package/dist/settings/sections/models/model-test.js +7 -4
- package/dist/settings/sections/performance/PerformanceSection.js +16 -6
- package/dist/settings/sections/performance/labels.d.ts +1 -1
- package/dist/settings/sections/performance/labels.js +1 -1
- package/dist/settings/sections/providers/ProvidersSection.d.ts +1 -1
- package/dist/settings/sections/providers/ProvidersSection.js +14 -7
- package/dist/settings/sections/providers/ServerProvidersSection.d.ts +1 -1
- package/dist/settings/sections/providers/ServerProvidersSection.js +11 -5
- package/dist/settings/sections/providers/labels.d.ts +2 -2
- package/dist/settings/sections/providers/labels.js +2 -2
- package/dist/settings/sections/skills/SkillList.js +1 -1
- package/dist/settings/sections/skills/SkillsSection.js +1 -1
- package/dist/settings/testing/performance.contract.js +8 -12
- package/dist/styles.css +32 -3
- package/dist/terminal/HostTerminalSurface.js +15 -5
- package/dist/terminal/TerminalPanel.js +30 -17
- package/dist/terminal/TerminalSurface.js +11 -4
- package/dist/terminal/headless/labels.d.ts +5 -0
- package/dist/terminal/headless/labels.js +5 -0
- package/dist/terminal/headless/store.d.ts +1 -1
- package/dist/terminal/headless/store.js +6 -3
- package/dist/workspace/LayoutBudget.d.ts +5 -1
- package/dist/workspace/LayoutBudget.js +14 -1
- package/dist/workspace/PanelContentView.d.ts +1 -1
- package/dist/workspace/PanelContentView.js +17 -6
- package/dist/workspace/WorkspaceProvider.js +3 -2
- package/dist/workspace/headless/labels.d.ts +1 -0
- package/dist/workspace/headless/labels.js +1 -0
- package/package.json +3 -3
- package/src/styles/motion.css +8 -0
- 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
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
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 {
|
|
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(
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
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:
|
|
34
|
-
"aria-live":
|
|
35
|
-
className: `flex flex-col gap-3 px-3 py-2.5 rounded-zg-md text-zg-label
|
|
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)]" }) :
|
|
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
|
-
|
|
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
|
|
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:
|
|
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
|
|
41
|
+
* `error` is a compact error {@link Notice}.
|
|
40
42
|
*/
|
|
41
43
|
kind: 'busy' | 'notice' | 'error';
|
|
42
44
|
/** The feedback text. */
|
package/dist/components/Form.js
CHANGED
|
@@ -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:
|
|
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(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
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
|
|
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 {
|
|
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
|
|
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
|
|
10
|
+
function LoadError({ children, detail, onRetry, className, style }) {
|
|
10
11
|
const labels = useLabels();
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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.
|
|
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(
|
|
19
|
-
|
|
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 ("
|
|
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
|
-
|
|
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:
|
|
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
|
}
|