Merge branch 'mobile-bottom-nav' into ios-pwa-shell
This commit is contained in:
commit
547f12a055
451 changed files with 22947 additions and 10507 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@opencode-ai/ui",
|
||||
"version": "1.17.8",
|
||||
"version": "1.17.9",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"exports": {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { createEffect, For, Match, on, onCleanup, onMount, Show, Switch, type JSX } from "solid-js"
|
||||
import { createEffect, For, Match, on, onCleanup, onMount, Show, Switch, type Accessor, type JSX } from "solid-js"
|
||||
import { animate, type AnimationPlaybackControls } from "motion"
|
||||
import { useI18n } from "../context/i18n"
|
||||
import { createStore } from "solid-js/store"
|
||||
|
|
@ -24,7 +24,7 @@ const isTriggerTitle = (val: any): val is TriggerTitle => {
|
|||
|
||||
export interface BasicToolProps {
|
||||
icon: IconProps["name"]
|
||||
trigger: TriggerTitle | JSX.Element
|
||||
trigger: TriggerTitle | JSX.Element | ((open: Accessor<boolean>) => JSX.Element)
|
||||
children?: JSX.Element
|
||||
status?: string
|
||||
hideDetails?: boolean
|
||||
|
|
@ -89,6 +89,7 @@ export function BasicTool(props: BasicToolProps) {
|
|||
const ready = () => state.ready
|
||||
const pending = () => props.status === "pending" || props.status === "running"
|
||||
const hasChildren = () => (props.defer ? "children" in props : props.children)
|
||||
const dynamicTrigger = typeof props.trigger === "function" ? props.trigger(open) : undefined
|
||||
|
||||
let cancelReady: (() => void) | undefined
|
||||
|
||||
|
|
@ -187,6 +188,7 @@ export function BasicTool(props: BasicToolProps) {
|
|||
<div data-slot="basic-tool-tool-trigger-content">
|
||||
<div data-slot="basic-tool-tool-info">
|
||||
<Switch>
|
||||
<Match when={dynamicTrigger !== undefined}>{dynamicTrigger}</Match>
|
||||
<Match when={isTriggerTitle(props.trigger) && props.trigger}>
|
||||
{(title) => (
|
||||
<div data-slot="basic-tool-tool-info-structured">
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@ export function getToolInfo(
|
|||
return {
|
||||
icon: "console",
|
||||
title: i18n.t("ui.tool.shell"),
|
||||
subtitle: input.description,
|
||||
subtitle: input.command,
|
||||
}
|
||||
case "edit":
|
||||
return {
|
||||
|
|
@ -1905,18 +1905,18 @@ ToolRegistry.register({
|
|||
<BasicTool
|
||||
{...props}
|
||||
icon="console"
|
||||
trigger={
|
||||
trigger={(open) => (
|
||||
<div data-slot="basic-tool-tool-info-structured">
|
||||
<div data-slot="basic-tool-tool-info-main">
|
||||
<span data-slot="basic-tool-tool-title">
|
||||
<TextShimmer text={i18n.t("ui.tool.shell")} active={pending()} />
|
||||
</span>
|
||||
<Show when={!pending() && props.input.description}>
|
||||
<ShellSubmessage text={props.input.description} animate={sawPending} />
|
||||
<Show when={!pending() && !open() && props.input.command}>
|
||||
<ShellSubmessage text={props.input.command} animate={sawPending} />
|
||||
</Show>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
)}
|
||||
>
|
||||
<div data-component="bash-output">
|
||||
<div data-slot="bash-copy">
|
||||
|
|
|
|||
|
|
@ -316,10 +316,10 @@ const TOOL_SAMPLES = {
|
|||
},
|
||||
bash: {
|
||||
tool: "bash",
|
||||
input: { command: "bun test --filter session", description: "Run session tests" },
|
||||
input: { command: "bun test --filter session" },
|
||||
output:
|
||||
"bun test v1.3.14\n\n✓ session-turn.test.tsx (3 tests) 45ms\n✓ message-part.test.tsx (7 tests) 120ms\n\nTest Suites: 2 passed, 2 total\nTests: 10 passed, 10 total\nTime: 0.89s",
|
||||
title: "Run session tests",
|
||||
title: "bun test --filter session",
|
||||
metadata: { command: "bun test --filter session" },
|
||||
},
|
||||
edit: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue