@opencode/ui 2.2.2 → 2.2.4
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/components/provider-icons/types.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/image-preview.css +3 -2
- package/src/components/image-preview.tsx +4 -0
- package/src/components/provider-icons/sprite.svg +6 -0
- package/src/components/provider-icons/types.ts +1 -0
- package/src/components/truncated-text.tsx +2 -1
- package/src/feedback/toast/toast.tsx +11 -31
- package/src/forms/select/select.css +0 -28
- package/src/forms/typeahead/typeahead.tsx +9 -2
- package/src/icons/new-icons.ts +2 -1
- package/src/navigation/menu/menu.css +0 -11
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const iconNames: readonly ["zhipuai", "zhipuai-coding-plan", "zenmux", "zai", "zai-coding-plan", "xiaomi", "xai", "wandb", "vultr", "vivgrid", "vercel", "venice", "v0", "upstage", "togetherai", "synthetic", "submodel", "stepfun", "stackit", "siliconflow", "siliconflow-cn", "scaleway", "sap-ai-core", "requesty", "reflection", "qiniu-ai", "qihang-ai", "privatemode-ai", "poe", "perplexity", "ovhcloud", "openrouter", "llmgateway", "opencode", "opencode-go", "openai", "ollama-cloud", "nvidia", "novita-ai", "nova", "nebius", "nano-gpt", "morph", "moonshotai", "moonshotai-cn", "modelscope", "moark", "mistral", "minimax", "minimax-coding-plan", "minimax-cn", "minimax-cn-coding-plan", "meta", "meituan", "meganova", "lucidquery", "lmstudio", "llama", "kuae-cloud-coding-plan", "kimi-for-coding", "kilo", "jiekou", "io-net", "inference", "inception", "iflowcn", "huggingface", "helicone", "groq", "google", "google-vertex", "google-vertex-anthropic", "gitlab", "github-models", "github-copilot", "friendli", "firmware", "fireworks-ai", "fastrouter", "evroc", "digitalocean", "deepseek", "deepinfra", "cortecs", "cohere", "cloudflare-workers-ai", "cloudflare-ai-gateway", "cloudferro-sherlock", "chutes", "cerebras", "berget", "baseten", "bailing", "azure", "azure-cognitive-services", "anthropic", "amazon-bedrock", "alibaba", "alibaba-cn", "aihubmix", "abacus", "302ai"];
|
|
1
|
+
export declare const iconNames: readonly ["zhipuai", "zhipuai-coding-plan", "zenmux", "zai", "zai-coding-plan", "xiaomi", "xai", "wandb", "vultr", "vivgrid", "vercel", "venice", "v0", "upstage", "togetherai", "synthetic", "submodel", "stepfun", "stackit", "siliconflow", "siliconflow-cn", "scaleway", "sap-ai-core", "requesty", "reflection", "qiniu-ai", "qihang-ai", "privatemode-ai", "poe", "perplexity", "ovhcloud", "openrouter", "llmgateway", "opencode", "opencode-go", "openai", "ollama-cloud", "nvidia", "novita-ai", "nova", "nebius", "nano-gpt", "morph", "moonshotai", "moonshotai-cn", "modelscope", "moark", "mistral", "minimax", "minimax-coding-plan", "minimax-cn", "minimax-cn-coding-plan", "meta", "meituan", "meganova", "lucidquery", "lmstudio", "llama", "kuae-cloud-coding-plan", "kimi-for-coding", "kilo", "jiekou", "io-net", "inference", "inception", "iflowcn", "huggingface", "helicone", "groq", "google", "google-vertex", "google-vertex-anthropic", "gitlab", "github-models", "github-copilot", "friendli", "firmware", "fireworks-ai", "fastrouter", "evroc", "digitalocean", "deepseek", "deepinfra", "cortecs", "cohere", "cloudflare-workers-ai", "cloudflare-ai-gateway", "cloudferro-sherlock", "claude-agent", "chutes", "cerebras", "berget", "baseten", "bailing", "azure", "azure-cognitive-services", "anthropic", "amazon-bedrock", "alibaba", "alibaba-cn", "aihubmix", "abacus", "302ai"];
|
|
2
2
|
export type IconName = (typeof iconNames)[number];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencode/ui",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
"dependencies": {
|
|
289
289
|
"@kitlangton/solid-motion": "0.2.2",
|
|
290
290
|
"@kobalte/core": "0.13.13",
|
|
291
|
-
"@opencode/util": "2.2.
|
|
291
|
+
"@opencode/util": "2.2.4",
|
|
292
292
|
"@pierre/diffs": "1.6.1",
|
|
293
293
|
"@pierre/highlights": "0.2.0",
|
|
294
294
|
"@solid-primitives/event-listener": "2.4.6",
|
|
@@ -182,8 +182,9 @@
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
/* A modal Kobalte dialog turns the body's pointer events off and only restores them when its content unmounts, which
|
|
185
|
-
the closing flight above holds back; the page takes clicks again as soon as the close starts.
|
|
186
|
-
body:has(
|
|
185
|
+
the closing flight above holds back; the page takes clicks again as soon as the close starts. The preview marks the
|
|
186
|
+
body itself: a body:has() rule made Chromium restyle the body on every DOM insertion anywhere in the page. */
|
|
187
|
+
body[data-image-preview-closing] {
|
|
187
188
|
pointer-events: auto !important;
|
|
188
189
|
}
|
|
189
190
|
|
|
@@ -405,12 +405,16 @@ export function ImagePreview(props: ImagePreviewProps) {
|
|
|
405
405
|
settle()
|
|
406
406
|
showOrigin()
|
|
407
407
|
giveBack()
|
|
408
|
+
document.body.removeAttribute("data-image-preview-closing")
|
|
408
409
|
})
|
|
409
410
|
|
|
410
411
|
createEffect(
|
|
411
412
|
on(
|
|
412
413
|
() => dialog.isOpen(),
|
|
413
414
|
(open) => {
|
|
415
|
+
// See image-preview.css: the body takes clicks again while the closing flight holds the dialog mounted.
|
|
416
|
+
document.body.toggleAttribute("data-image-preview-closing", !open)
|
|
417
|
+
|
|
414
418
|
if (!open) dismiss()
|
|
415
419
|
},
|
|
416
420
|
{ defer: true },
|
|
@@ -934,6 +934,12 @@
|
|
|
934
934
|
<path d="M9,15l6,-6l-3,-3l-9,9l-3,-3l12,-12l12,12l-3,3l-3,-3l-6,6l-3,-3Z"></path>
|
|
935
935
|
<path d="M0,12L12,0L24,12L12,24L0,12Z" fill="none" stroke="currentColor" stroke-width="0.2"></path>
|
|
936
936
|
</symbol>
|
|
937
|
+
<symbol viewBox="-11.5 -11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
940
|
+
fill="currentColor"
|
|
941
|
+
></path>
|
|
942
|
+
</symbol>
|
|
937
943
|
<symbol viewBox="0 0 24 24" fill="none" id="chutes">
|
|
938
944
|
<path
|
|
939
945
|
shape-rendering="geometricPrecision"
|
|
@@ -17,7 +17,8 @@ export function TruncatedText(props: { text: string; class?: string }) {
|
|
|
17
17
|
<Tooltip
|
|
18
18
|
value={<span dir="auto">{props.text}</span>}
|
|
19
19
|
disabled={!store.truncated}
|
|
20
|
-
|
|
20
|
+
// Focusable only while there is more to reveal; a -1 would still let a click focus the name.
|
|
21
|
+
triggerTabIndex={store.truncated ? 0 : undefined}
|
|
21
22
|
class={`truncated-text ${props.class ?? ""}`}
|
|
22
23
|
contentClass="truncated-text-tooltip"
|
|
23
24
|
>
|
|
@@ -2,7 +2,7 @@ import { Toaster, toast, type ToasterProps } from "solid-sonner"
|
|
|
2
2
|
import { boundToastDescription } from "./description"
|
|
3
3
|
import { isRTL } from "@kobalte/core/i18n"
|
|
4
4
|
import type { ComponentProps, JSX } from "solid-js"
|
|
5
|
-
import { createContext, onCleanup,
|
|
5
|
+
import { createContext, onCleanup, splitProps, useContext } from "solid-js"
|
|
6
6
|
import { Portal } from "solid-js/web"
|
|
7
7
|
import { useI18n } from "../../context/i18n"
|
|
8
8
|
import "../../actions/button/button.css"
|
|
@@ -14,46 +14,26 @@ export interface ToastRegionProps extends ToasterProps {}
|
|
|
14
14
|
function ToastRegion(props: ToastRegionProps) {
|
|
15
15
|
const i18n = useI18n()
|
|
16
16
|
const [local, rest] = splitProps(props, ["class", "className", "style", "toastOptions", "swipeDirections"])
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
// The Portal's container holds the toast region whenever it exists. Watching the container, not the whole body,
|
|
19
|
+
// keeps every DOM change elsewhere in the page (each streamed delta, each mounted row) from scanning the document.
|
|
20
|
+
const observe = (container: HTMLDivElement) => {
|
|
18
21
|
const sync = () => {
|
|
19
|
-
|
|
22
|
+
container.querySelectorAll<HTMLElement>(".toast-v2-region .toast-v2").forEach((element) => {
|
|
20
23
|
const hidden = element.dataset.visible === "false"
|
|
21
24
|
element.inert = hidden
|
|
22
25
|
element.tabIndex = hidden ? -1 : 0
|
|
23
26
|
})
|
|
24
27
|
}
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const regions = document.querySelectorAll(".toast-v2-region")
|
|
30
|
-
|
|
31
|
-
if (!regions.length) return
|
|
32
|
-
observer.disconnect()
|
|
33
|
-
regions.forEach((region) => {
|
|
34
|
-
observer.observe(region, {
|
|
35
|
-
subtree: true,
|
|
36
|
-
childList: true,
|
|
37
|
-
attributes: true,
|
|
38
|
-
attributeFilter: ["data-visible"],
|
|
39
|
-
})
|
|
40
|
-
})
|
|
41
|
-
connected = true
|
|
42
|
-
sync()
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const observer = new MutationObserver(() => {
|
|
46
|
-
if (!connected) connect()
|
|
47
|
-
else sync()
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
observer.observe(document.body, { subtree: true, childList: true })
|
|
51
|
-
queueMicrotask(connect)
|
|
29
|
+
const observer = new MutationObserver(sync)
|
|
30
|
+
observer.observe(container, { subtree: true, childList: true, attributes: true, attributeFilter: ["data-visible"] })
|
|
31
|
+
sync()
|
|
52
32
|
onCleanup(() => observer.disconnect())
|
|
53
|
-
}
|
|
33
|
+
}
|
|
54
34
|
|
|
55
35
|
return (
|
|
56
|
-
<Portal>
|
|
36
|
+
<Portal ref={observe}>
|
|
57
37
|
<Toaster
|
|
58
38
|
position={isRTL(i18n.locale()) ? "bottom-left" : "bottom-right"}
|
|
59
39
|
offset={isRTL(i18n.locale()) ? { left: 32, bottom: 48 } : { right: 32, bottom: 48 }}
|
|
@@ -16,34 +16,6 @@
|
|
|
16
16
|
background: var(--v2-background-bg-layer-01);
|
|
17
17
|
border-radius: 6px;
|
|
18
18
|
box-shadow: var(--v2-elevation-floating);
|
|
19
|
-
transform-origin: top center;
|
|
20
|
-
animation: select-v2-content-in 120ms ease-out;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
[data-component="menu-v2-content"][data-slot="select-v2-content"][data-closed] {
|
|
24
|
-
animation: select-v2-content-out 80ms ease-in forwards;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@keyframes select-v2-content-in {
|
|
28
|
-
from {
|
|
29
|
-
opacity: 0;
|
|
30
|
-
transform: translateY(-2px);
|
|
31
|
-
}
|
|
32
|
-
to {
|
|
33
|
-
opacity: 1;
|
|
34
|
-
transform: translateY(0);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@keyframes select-v2-content-out {
|
|
39
|
-
from {
|
|
40
|
-
opacity: 1;
|
|
41
|
-
transform: translateY(0);
|
|
42
|
-
}
|
|
43
|
-
to {
|
|
44
|
-
opacity: 0;
|
|
45
|
-
transform: translateY(-2px);
|
|
46
|
-
}
|
|
47
19
|
}
|
|
48
20
|
|
|
49
21
|
/* Shared trigger structure for the inline control. */
|
|
@@ -152,6 +152,7 @@ export function Typeahead<T>(props: {
|
|
|
152
152
|
</button>
|
|
153
153
|
</Show>
|
|
154
154
|
</div>
|
|
155
|
+
<div aria-hidden="true" class="h-[0.5px] shrink-0 bg-v2-border-border-base" />
|
|
155
156
|
{/* Initial results and the empty state snap into place; other search resizing animates. */}
|
|
156
157
|
<div
|
|
157
158
|
class="overflow-hidden duration-[200ms] ease-[cubic-bezier(0.645,0.045,0.355,1)] motion-reduce:transition-none"
|
|
@@ -164,7 +165,13 @@ export function Typeahead<T>(props: {
|
|
|
164
165
|
)
|
|
165
166
|
}
|
|
166
167
|
>
|
|
167
|
-
|
|
168
|
+
{/* A stable gutter keeps rows from shifting when the list overflows; the end padding gives way to it. */}
|
|
169
|
+
<div
|
|
170
|
+
id={typeahead.listID}
|
|
171
|
+
role="listbox"
|
|
172
|
+
data-scrollable
|
|
173
|
+
class="max-h-56 overflow-y-auto py-1 ps-1 pe-[max(0px,calc(4px-var(--scrollbar-size,0px)))] [scrollbar-gutter:stable] empty:hidden"
|
|
174
|
+
>
|
|
168
175
|
<For each={results().items}>
|
|
169
176
|
{(item) => (
|
|
170
177
|
<div
|
|
@@ -192,7 +199,7 @@ export function Typeahead<T>(props: {
|
|
|
192
199
|
{/* Stays mounted while a retry or a newer query is pending, so the list never collapses to nothing. */}
|
|
193
200
|
<Show when={results().items.length === 0}>
|
|
194
201
|
<div
|
|
195
|
-
class="mx-1 flex h-
|
|
202
|
+
class="mx-1 flex h-9 items-center px-2 py-1 text-v2-text-text-faint"
|
|
196
203
|
classList={{ invisible: store.answered === undefined }}
|
|
197
204
|
>
|
|
198
205
|
<Show when={failed()} fallback={props.emptyLabel}>
|
package/src/icons/new-icons.ts
CHANGED
|
@@ -90,6 +90,7 @@ const replacements: Partial<Record<IconName, { name: NewIconName; rotate?: numbe
|
|
|
90
90
|
"select-element": { name: "annotate" },
|
|
91
91
|
download: { name: "download" },
|
|
92
92
|
"post-skill": { name: "skill" },
|
|
93
|
+
"graduation-cap": { name: "skill" },
|
|
93
94
|
eye: { name: "eye-open" },
|
|
94
95
|
"outline-eye": { name: "eye-open" },
|
|
95
96
|
"outline-eye-slash": { name: "eye-closed" },
|
|
@@ -131,7 +132,7 @@ const replacements: Partial<Record<IconName, { name: NewIconName; rotate?: numbe
|
|
|
131
132
|
// Status: circle-xmark (10) / circle-x (1), outline-hexagonal-warning (7) / warning (6), status / status-active (4),
|
|
132
133
|
// help (3), info (2)
|
|
133
134
|
// Features: terminal (6), mcp (5), branch (5, held back), console / outline-console (2), stop, models,
|
|
134
|
-
// link, share, brain / outline-brain, shield
|
|
135
|
+
// link, share, brain / outline-brain, shield
|
|
135
136
|
// Arrows: arrow-up-right (5) / outline-arrow-up-right (3), arrow-down-to-line (2), arrow-undo-down
|
|
136
137
|
// Layout: layout-left / layout-left-full (4), layout-right / layout-right-full (2), chevron-grabber-vertical (4),
|
|
137
138
|
// fill-triangle-down (3), menu (2), expand / collapse, split / unified, dot-grid
|