@opencode/ui 2.2.1 → 2.2.3
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/context/helper.d.ts +1 -0
- package/dist/data-display/keybind/keybind.d.ts +1 -1
- package/dist/data-display/line-comment/line-comment.d.ts +4 -2
- package/dist/i18n/am.d.ts +246 -1
- package/dist/i18n/ar.d.ts +0 -3
- package/dist/i18n/az.d.ts +246 -1
- package/dist/i18n/bg.d.ts +0 -3
- package/dist/i18n/bn.d.ts +246 -1
- package/dist/i18n/br.d.ts +0 -3
- package/dist/i18n/bs.d.ts +0 -3
- package/dist/i18n/ca.d.ts +260 -1
- package/dist/i18n/cs.d.ts +274 -1
- package/dist/i18n/da.d.ts +0 -3
- package/dist/i18n/de.d.ts +0 -3
- package/dist/i18n/dv.d.ts +246 -1
- package/dist/i18n/dz.d.ts +246 -1
- package/dist/i18n/el.d.ts +246 -1
- package/dist/i18n/en.d.ts +5 -3
- package/dist/i18n/es.d.ts +0 -3
- package/dist/i18n/et.d.ts +246 -1
- package/dist/i18n/fa.d.ts +246 -1
- package/dist/i18n/fi.d.ts +246 -1
- package/dist/i18n/fo.d.ts +246 -1
- package/dist/i18n/fr.d.ts +0 -3
- package/dist/i18n/he.d.ts +0 -3
- package/dist/i18n/hi.d.ts +246 -1
- package/dist/i18n/hr.d.ts +260 -1
- package/dist/i18n/hu.d.ts +246 -1
- package/dist/i18n/hy.d.ts +246 -1
- package/dist/i18n/id.d.ts +246 -1
- package/dist/i18n/is.d.ts +246 -1
- package/dist/i18n/it.d.ts +260 -1
- package/dist/i18n/ja.d.ts +0 -3
- package/dist/i18n/ka.d.ts +246 -1
- package/dist/i18n/km.d.ts +0 -3
- package/dist/i18n/ko.d.ts +0 -3
- package/dist/i18n/lo.d.ts +0 -3
- package/dist/i18n/lt.d.ts +274 -1
- package/dist/i18n/lv.d.ts +260 -1
- package/dist/i18n/mk.d.ts +0 -3
- package/dist/i18n/mn.d.ts +0 -3
- package/dist/i18n/ms.d.ts +246 -1
- package/dist/i18n/my.d.ts +0 -3
- package/dist/i18n/ne.d.ts +246 -1
- package/dist/i18n/nl.d.ts +246 -1
- package/dist/i18n/pa.d.ts +246 -1
- package/dist/i18n/pl.d.ts +0 -3
- package/dist/i18n/ro.d.ts +260 -1
- package/dist/i18n/ru.d.ts +0 -3
- package/dist/i18n/si.d.ts +246 -1
- package/dist/i18n/sk.d.ts +274 -1
- package/dist/i18n/sl.d.ts +274 -1
- package/dist/i18n/sq.d.ts +246 -1
- package/dist/i18n/sr.d.ts +0 -3
- package/dist/i18n/sv.d.ts +246 -1
- package/dist/i18n/tg.d.ts +0 -3
- package/dist/i18n/th.d.ts +0 -3
- package/dist/i18n/tk.d.ts +246 -1
- package/dist/i18n/tr.d.ts +0 -3
- package/dist/i18n/uk.d.ts +274 -1
- package/dist/i18n/ur.d.ts +246 -1
- package/dist/i18n/uz.d.ts +246 -1
- package/dist/i18n/vi.d.ts +246 -1
- package/dist/i18n/zh.d.ts +0 -3
- package/dist/i18n/zht.d.ts +0 -3
- package/dist/theme/context.d.ts +16 -0
- package/package.json +3 -2
- package/src/components/image-preview.css +3 -2
- package/src/components/image-preview.tsx +4 -0
- package/src/components/truncated-text.tsx +2 -1
- package/src/context/helper.tsx +4 -3
- package/src/context/marked-base.tsx +5 -1
- package/src/data-display/keybind/keybind.css +11 -3
- package/src/data-display/keybind/keybind.tsx +1 -1
- package/src/data-display/line-comment/line-comment.css +91 -0
- package/src/data-display/line-comment/line-comment.tsx +199 -95
- package/src/data-display/line-comment/quote-check.svg +3 -0
- 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/i18n/am.ts +1 -5
- package/src/i18n/ar.ts +0 -4
- package/src/i18n/az.ts +1 -5
- package/src/i18n/bg.ts +0 -4
- package/src/i18n/bn.ts +1 -5
- package/src/i18n/br.ts +0 -4
- package/src/i18n/bs.ts +0 -4
- package/src/i18n/ca.ts +1 -5
- package/src/i18n/cs.ts +1 -5
- package/src/i18n/da.ts +0 -4
- package/src/i18n/de.ts +0 -4
- package/src/i18n/dv.ts +1 -5
- package/src/i18n/dz.ts +1 -5
- package/src/i18n/el.ts +1 -5
- package/src/i18n/en.ts +5 -4
- package/src/i18n/es.ts +0 -4
- package/src/i18n/et.ts +1 -5
- package/src/i18n/fa.ts +1 -5
- package/src/i18n/fi.ts +1 -5
- package/src/i18n/fo.ts +1 -5
- package/src/i18n/fr.ts +0 -4
- package/src/i18n/he.ts +0 -4
- package/src/i18n/hi.ts +1 -5
- package/src/i18n/hr.ts +1 -5
- package/src/i18n/hu.ts +1 -5
- package/src/i18n/hy.ts +1 -5
- package/src/i18n/id.ts +1 -5
- package/src/i18n/is.ts +1 -5
- package/src/i18n/it.ts +1 -5
- package/src/i18n/ja.ts +0 -4
- package/src/i18n/ka.ts +1 -5
- package/src/i18n/km.ts +0 -4
- package/src/i18n/ko.ts +0 -4
- package/src/i18n/lo.ts +0 -4
- package/src/i18n/lt.ts +1 -5
- package/src/i18n/lv.ts +1 -5
- package/src/i18n/mk.ts +0 -4
- package/src/i18n/mn.ts +0 -4
- package/src/i18n/ms.ts +1 -5
- package/src/i18n/my.ts +0 -4
- package/src/i18n/ne.ts +1 -5
- package/src/i18n/nl.ts +1 -5
- package/src/i18n/no.ts +0 -4
- package/src/i18n/pa.ts +1 -5
- package/src/i18n/pl.ts +0 -4
- package/src/i18n/ro.ts +1 -5
- package/src/i18n/ru.ts +0 -4
- package/src/i18n/si.ts +1 -5
- package/src/i18n/sk.ts +1 -5
- package/src/i18n/sl.ts +1 -5
- package/src/i18n/sq.ts +1 -5
- package/src/i18n/sr.ts +0 -4
- package/src/i18n/sv.ts +1 -5
- package/src/i18n/tg.ts +0 -4
- package/src/i18n/th.ts +0 -4
- package/src/i18n/tk.ts +1 -5
- package/src/i18n/tr.ts +0 -4
- package/src/i18n/uk.ts +1 -5
- package/src/i18n/ur.ts +1 -5
- package/src/i18n/uz.ts +1 -5
- package/src/i18n/vi.ts +1 -5
- package/src/i18n/zh.ts +0 -3
- package/src/i18n/zht.ts +0 -3
- package/src/icons/new-icons.ts +2 -1
- package/src/navigation/menu/menu.css +0 -11
- package/src/navigation/tabs/tabs.css +19 -0
|
@@ -1,8 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
For,
|
|
3
|
+
Show,
|
|
4
|
+
createEffect,
|
|
5
|
+
createSignal,
|
|
6
|
+
on,
|
|
7
|
+
onCleanup,
|
|
8
|
+
onMount,
|
|
9
|
+
splitProps,
|
|
10
|
+
type ComponentProps,
|
|
11
|
+
type JSX,
|
|
12
|
+
} from "solid-js"
|
|
2
13
|
import { FileIcon } from "@opencode/ui/file-icon"
|
|
3
14
|
import { useI18n } from "../../context/i18n"
|
|
4
15
|
import { useFilteredList } from "../../hooks"
|
|
5
16
|
import { Button } from "@opencode/ui/button"
|
|
17
|
+
import { Icon } from "@opencode/ui/icon"
|
|
18
|
+
import { IconButton } from "@opencode/ui/icon-button"
|
|
19
|
+
import { Keybind } from "@opencode/ui/keybind"
|
|
20
|
+
import { Tooltip } from "@opencode/ui/tooltip"
|
|
21
|
+
import check from "./quote-check.svg"
|
|
6
22
|
import "./line-comment.css"
|
|
7
23
|
|
|
8
24
|
/** Horizontal “more” glyph for the display-card overflow control (Figma outline-dots). */
|
|
@@ -72,14 +88,16 @@ export interface LineCommentEditorProps extends Omit<ComponentProps<"div">, "chi
|
|
|
72
88
|
onInput: (value: string) => void
|
|
73
89
|
onCancel: () => void
|
|
74
90
|
onSubmit: (value: string) => void
|
|
75
|
-
/** Optional context in the footer,
|
|
91
|
+
/** Optional context in the footer, or above the input in the compact variant. */
|
|
76
92
|
selection?: JSX.Element
|
|
93
|
+
/** Compact layout with a growing input and inline action. */
|
|
94
|
+
variant?: "default" | "compact"
|
|
77
95
|
placeholder?: string
|
|
78
96
|
rows?: number
|
|
79
97
|
cancelLabel?: string
|
|
80
98
|
submitLabel?: string
|
|
81
99
|
autofocus?: boolean
|
|
82
|
-
/** Submit an empty value too, such as to clear a comment that exists (default: false). */
|
|
100
|
+
/** Submit an empty value too, such as to clear a comment that exists (default: false). Compact empty actions otherwise cancel. */
|
|
83
101
|
allowEmpty?: boolean
|
|
84
102
|
mention?: LineCommentEditorMention
|
|
85
103
|
}
|
|
@@ -108,6 +126,7 @@ export function LineCommentEditor(props: LineCommentEditorProps) {
|
|
|
108
126
|
"onCancel",
|
|
109
127
|
"onSubmit",
|
|
110
128
|
"selection",
|
|
129
|
+
"variant",
|
|
111
130
|
"placeholder",
|
|
112
131
|
"rows",
|
|
113
132
|
"cancelLabel",
|
|
@@ -120,6 +139,12 @@ export function LineCommentEditor(props: LineCommentEditorProps) {
|
|
|
120
139
|
])
|
|
121
140
|
|
|
122
141
|
const canSubmit = () => !!local.allowEmpty || local.value.trim().length > 0
|
|
142
|
+
const compactCancel = () => !canSubmit()
|
|
143
|
+
|
|
144
|
+
const compactLabel = () =>
|
|
145
|
+
compactCancel()
|
|
146
|
+
? (local.cancelLabel ?? i18n.t("ui.lineComment.cancel"))
|
|
147
|
+
: (local.submitLabel ?? i18n.t("ui.lineComment.submit"))
|
|
123
148
|
|
|
124
149
|
const closeMention = () => {
|
|
125
150
|
setMentionOpen(false)
|
|
@@ -215,124 +240,203 @@ export function LineCommentEditor(props: LineCommentEditorProps) {
|
|
|
215
240
|
requestAnimationFrame(() => textareaRef?.focus())
|
|
216
241
|
})
|
|
217
242
|
|
|
243
|
+
onMount(() => {
|
|
244
|
+
if (CSS.supports("field-sizing", "content")) return
|
|
245
|
+
|
|
246
|
+
createEffect(() => {
|
|
247
|
+
const textarea = textareaRef
|
|
248
|
+
|
|
249
|
+
if (local.variant !== "compact" || !textarea) return
|
|
250
|
+
|
|
251
|
+
const resize = () => {
|
|
252
|
+
// Reset before measuring so the field can shrink as well as grow.
|
|
253
|
+
textarea.style.height = "0px"
|
|
254
|
+
textarea.style.height = `${textarea.scrollHeight}px`
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
createEffect(on(() => local.value, resize))
|
|
258
|
+
|
|
259
|
+
let width = 0
|
|
260
|
+
|
|
261
|
+
const observer = new ResizeObserver(([entry]) => {
|
|
262
|
+
if (!entry || entry.contentRect.width === width) return
|
|
263
|
+
width = entry.contentRect.width
|
|
264
|
+
resize()
|
|
265
|
+
})
|
|
266
|
+
|
|
267
|
+
observer.observe(textarea)
|
|
268
|
+
onCleanup(() => {
|
|
269
|
+
observer.disconnect()
|
|
270
|
+
textarea.style.removeProperty("height")
|
|
271
|
+
})
|
|
272
|
+
})
|
|
273
|
+
})
|
|
274
|
+
|
|
218
275
|
return (
|
|
219
276
|
<div
|
|
220
277
|
{...rest}
|
|
221
278
|
data-component="line-comment-v2"
|
|
222
279
|
data-variant="editor"
|
|
280
|
+
data-layout={local.variant ?? "default"}
|
|
223
281
|
classList={{
|
|
224
282
|
...local.classList,
|
|
225
283
|
[local.class ?? ""]: !!local.class,
|
|
226
284
|
}}
|
|
227
285
|
>
|
|
228
286
|
<div data-slot="line-comment-v2-shell">
|
|
229
|
-
<
|
|
230
|
-
<
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
local.
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
287
|
+
<Show when={local.variant === "compact" && local.selection}>
|
|
288
|
+
{(selection) => <div data-slot="line-comment-v2-preview">{selection()}</div>}
|
|
289
|
+
</Show>
|
|
290
|
+
<div data-slot="line-comment-v2-input">
|
|
291
|
+
<div data-slot="line-comment-v2-field">
|
|
292
|
+
<textarea
|
|
293
|
+
ref={(el) => {
|
|
294
|
+
textareaRef = el
|
|
295
|
+
}}
|
|
296
|
+
data-slot="line-comment-v2-textarea"
|
|
297
|
+
data-scrollable
|
|
298
|
+
aria-label={local.label ?? i18n.t("ui.lineComment.submit")}
|
|
299
|
+
dir="auto"
|
|
300
|
+
rows={local.rows ?? (local.variant === "compact" ? 1 : 4)}
|
|
301
|
+
placeholder={local.placeholder ?? i18n.t("ui.lineComment.contextPlaceholder")}
|
|
302
|
+
value={local.value}
|
|
303
|
+
style={{ "unicode-bidi": "plaintext", "text-align": "start" }}
|
|
304
|
+
onInput={(e) => {
|
|
305
|
+
local.onInput(e.currentTarget.value)
|
|
306
|
+
syncMention()
|
|
307
|
+
}}
|
|
308
|
+
onClick={() => syncMention()}
|
|
309
|
+
onSelect={() => syncMention()}
|
|
310
|
+
onKeyDown={(e) => {
|
|
311
|
+
e.stopPropagation()
|
|
312
|
+
|
|
313
|
+
if (e.isComposing || e.keyCode === 229) return
|
|
314
|
+
|
|
315
|
+
if (mentionOpen()) {
|
|
316
|
+
if (e.key === "Escape") {
|
|
317
|
+
e.preventDefault()
|
|
318
|
+
closeMention()
|
|
319
|
+
|
|
320
|
+
return
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (e.key === "Tab") {
|
|
324
|
+
if (mention.flat().length === 0) return
|
|
325
|
+
e.preventDefault()
|
|
326
|
+
selectActiveMention()
|
|
327
|
+
|
|
328
|
+
return
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
const nav = e.key === "ArrowUp" || e.key === "ArrowDown" || e.key === "Enter"
|
|
332
|
+
|
|
333
|
+
const ctrlNav =
|
|
334
|
+
e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey && (e.key === "n" || e.key === "p")
|
|
335
|
+
|
|
336
|
+
if ((nav || ctrlNav) && mention.flat().length > 0) {
|
|
337
|
+
mention.onKeyDown(e)
|
|
338
|
+
e.preventDefault()
|
|
339
|
+
|
|
340
|
+
return
|
|
341
|
+
}
|
|
258
342
|
}
|
|
259
343
|
|
|
260
|
-
if (e.key === "
|
|
261
|
-
if (mention.flat().length === 0) return
|
|
344
|
+
if (e.key === "Escape") {
|
|
262
345
|
e.preventDefault()
|
|
263
|
-
|
|
346
|
+
e.currentTarget.blur()
|
|
347
|
+
local.onCancel()
|
|
264
348
|
|
|
265
349
|
return
|
|
266
350
|
}
|
|
267
351
|
|
|
268
|
-
|
|
269
|
-
const ctrlNav = e.ctrlKey && !e.metaKey && !e.altKey && !e.shiftKey && (e.key === "n" || e.key === "p")
|
|
270
|
-
|
|
271
|
-
if ((nav || ctrlNav) && mention.flat().length > 0) {
|
|
272
|
-
mention.onKeyDown(e)
|
|
352
|
+
if (e.key === "Enter" && !e.shiftKey) {
|
|
273
353
|
e.preventDefault()
|
|
274
|
-
|
|
275
|
-
return
|
|
354
|
+
submit()
|
|
276
355
|
}
|
|
356
|
+
}}
|
|
357
|
+
/>
|
|
358
|
+
<Show when={mentionOpen() && mention.flat().length > 0}>
|
|
359
|
+
<div data-slot="line-comment-v2-mention-list">
|
|
360
|
+
<For each={mention.flat().slice(0, 10)}>
|
|
361
|
+
{(item) => {
|
|
362
|
+
const directory = item.path.endsWith("/") ? item.path : pathDirectory(item.path)
|
|
363
|
+
const name = item.path.endsWith("/") ? "" : pathFilename(item.path)
|
|
364
|
+
|
|
365
|
+
return (
|
|
366
|
+
<button
|
|
367
|
+
type="button"
|
|
368
|
+
data-slot="line-comment-v2-mention-item"
|
|
369
|
+
data-active={mention.active() === item.path ? "" : undefined}
|
|
370
|
+
onMouseDown={(event) => event.preventDefault()}
|
|
371
|
+
onMouseEnter={() => mention.setActive(item.path)}
|
|
372
|
+
onClick={() => selectMention(item)}
|
|
373
|
+
>
|
|
374
|
+
<FileIcon node={{ path: item.path, type: "file" }} class="shrink-0 size-4" />
|
|
375
|
+
<div data-slot="line-comment-v2-mention-path">
|
|
376
|
+
<span data-slot="line-comment-v2-mention-dir">{directory}</span>
|
|
377
|
+
<Show when={name}>
|
|
378
|
+
<span data-slot="line-comment-v2-mention-file">{name}</span>
|
|
379
|
+
</Show>
|
|
380
|
+
</div>
|
|
381
|
+
</button>
|
|
382
|
+
)
|
|
383
|
+
}}
|
|
384
|
+
</For>
|
|
385
|
+
</div>
|
|
386
|
+
</Show>
|
|
387
|
+
</div>
|
|
388
|
+
<Show when={local.variant === "compact"}>
|
|
389
|
+
<Tooltip
|
|
390
|
+
value={
|
|
391
|
+
<>
|
|
392
|
+
{compactLabel()} <Keybind keys={[compactCancel() ? "Esc" : "⏎"]} variant="neutral" />
|
|
393
|
+
</>
|
|
277
394
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
<div data-slot="line-comment-v2-mention-list">
|
|
295
|
-
<For each={mention.flat().slice(0, 10)}>
|
|
296
|
-
{(item) => {
|
|
297
|
-
const directory = item.path.endsWith("/") ? item.path : pathDirectory(item.path)
|
|
298
|
-
const name = item.path.endsWith("/") ? "" : pathFilename(item.path)
|
|
299
|
-
|
|
300
|
-
return (
|
|
301
|
-
<button
|
|
302
|
-
type="button"
|
|
303
|
-
data-slot="line-comment-v2-mention-item"
|
|
304
|
-
data-active={mention.active() === item.path ? "" : undefined}
|
|
305
|
-
onMouseDown={(event) => event.preventDefault()}
|
|
306
|
-
onMouseEnter={() => mention.setActive(item.path)}
|
|
307
|
-
onClick={() => selectMention(item)}
|
|
308
|
-
>
|
|
309
|
-
<FileIcon node={{ path: item.path, type: "file" }} class="shrink-0 size-4" />
|
|
310
|
-
<div data-slot="line-comment-v2-mention-path">
|
|
311
|
-
<span data-slot="line-comment-v2-mention-dir">{directory}</span>
|
|
312
|
-
<Show when={name}>
|
|
313
|
-
<span data-slot="line-comment-v2-mention-file">{name}</span>
|
|
314
|
-
</Show>
|
|
315
|
-
</div>
|
|
316
|
-
</button>
|
|
395
|
+
placement="top"
|
|
396
|
+
>
|
|
397
|
+
<IconButton
|
|
398
|
+
data-slot="line-comment-v2-submit"
|
|
399
|
+
type="button"
|
|
400
|
+
size="small"
|
|
401
|
+
variant={local.value.trim() ? "neutral" : "ghost-muted"}
|
|
402
|
+
icon={
|
|
403
|
+
compactCancel() ? (
|
|
404
|
+
<Icon name="close" />
|
|
405
|
+
) : (
|
|
406
|
+
<span
|
|
407
|
+
aria-hidden="true"
|
|
408
|
+
data-slot="line-comment-v2-submit-icon"
|
|
409
|
+
style={{ mask: `url("${check}") center / contain no-repeat` }}
|
|
410
|
+
/>
|
|
317
411
|
)
|
|
412
|
+
}
|
|
413
|
+
aria-label={compactLabel()}
|
|
414
|
+
onClick={() => (compactCancel() ? local.onCancel() : submit())}
|
|
415
|
+
onKeyDown={(event) => {
|
|
416
|
+
if (event.key !== "Escape" || event.isComposing) return
|
|
417
|
+
event.preventDefault()
|
|
418
|
+
event.stopPropagation()
|
|
419
|
+
local.onCancel()
|
|
318
420
|
}}
|
|
319
|
-
|
|
320
|
-
</
|
|
421
|
+
/>
|
|
422
|
+
</Tooltip>
|
|
321
423
|
</Show>
|
|
322
424
|
</div>
|
|
323
|
-
<
|
|
324
|
-
<
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
<
|
|
329
|
-
{
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
425
|
+
<Show when={local.variant !== "compact"}>
|
|
426
|
+
<div data-slot="line-comment-v2-footer">
|
|
427
|
+
<Show when={local.selection}>
|
|
428
|
+
{(selection) => <div data-slot="line-comment-v2-footer-meta">{selection()}</div>}
|
|
429
|
+
</Show>
|
|
430
|
+
<div data-slot="line-comment-v2-footer-actions">
|
|
431
|
+
<Button type="button" size="small" variant="ghost" onClick={() => local.onCancel()}>
|
|
432
|
+
{local.cancelLabel ?? i18n.t("ui.lineComment.cancel")}
|
|
433
|
+
</Button>
|
|
434
|
+
<Button type="button" size="small" variant="contrast" disabled={!canSubmit()} onClick={submit}>
|
|
435
|
+
{local.submitLabel ?? i18n.t("ui.lineComment.submit")}
|
|
436
|
+
</Button>
|
|
437
|
+
</div>
|
|
334
438
|
</div>
|
|
335
|
-
</
|
|
439
|
+
</Show>
|
|
336
440
|
</div>
|
|
337
441
|
</div>
|
|
338
442
|
)
|
|
@@ -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/i18n/am.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const dict
|
|
1
|
+
export const dict = {
|
|
2
2
|
"ui.sessionReview.title": "የክፍለ ጊዜ ለውጦች",
|
|
3
3
|
"ui.sessionReview.title.git": "Gitይለውጣል",
|
|
4
4
|
"ui.sessionReview.title.branch": "ቅርንጫፍ ለውጦች",
|
|
@@ -70,10 +70,6 @@ export const dict: Record<string, string> = {
|
|
|
70
70
|
"dialog.usageExceeded.freeTier.title": "ነፃ ገደብ ላይ ደርሷል",
|
|
71
71
|
"dialog.usageExceeded.freeTier.description": "ለምርጥ ክፍት ምንጭ ሞዴሎች ታማኝ መዳረሻ ለማግኘት በወር $10 ለOpenCode Go ይመዝገቡ።",
|
|
72
72
|
"dialog.usageExceeded.freeTier.actionLabel": "ለደንበኝነት ይመዝገቡ",
|
|
73
|
-
"dialog.usageExceeded.accountRateLimit.title": "የሂድ ገደብ ላይ ደርሷል",
|
|
74
|
-
"dialog.usageExceeded.accountRateLimit.description":
|
|
75
|
-
"የአጠቃቀም ገደብ ላይ ደርሷል። ይህን ሞዴል አሁን መጠቀሙን ለመቀጠል ካለው ቀሪ ሒሳብ መጠቀምን ያንቁ",
|
|
76
|
-
"dialog.usageExceeded.accountRateLimit.actionLabel": "ክፍት ቅንብሮች",
|
|
77
73
|
"ui.sessionTurn.status.delegating": "ሥራን በውክልና መስጠት",
|
|
78
74
|
"ui.sessionTurn.status.planning": "ቀጣዮቹን ደረጃዎች ማቀድ",
|
|
79
75
|
"ui.sessionTurn.status.gatheringContext": "ማሰስ",
|
package/src/i18n/ar.ts
CHANGED
|
@@ -79,10 +79,6 @@ export const dict = {
|
|
|
79
79
|
"dialog.usageExceeded.freeTier.description":
|
|
80
80
|
"اشترك في OpenCode Go مقابل $10/شهر للحصول على وصول موثوق إلى أفضل النماذج مفتوحة المصدر.",
|
|
81
81
|
"dialog.usageExceeded.freeTier.actionLabel": "اشترك",
|
|
82
|
-
"dialog.usageExceeded.accountRateLimit.title": "تم الوصول إلى حد Go",
|
|
83
|
-
"dialog.usageExceeded.accountRateLimit.description":
|
|
84
|
-
"تم الوصول إلى حد الاستخدام. لمتابعة استخدام هذا النموذج الآن، قم بتفعيل الاستخدام من رصيدك المتاح",
|
|
85
|
-
"dialog.usageExceeded.accountRateLimit.actionLabel": "فتح الإعدادات",
|
|
86
82
|
|
|
87
83
|
"ui.sessionTurn.status.delegating": "جارٍ تفويض العمل",
|
|
88
84
|
"ui.sessionTurn.status.planning": "تخطيط الخطوات التالية",
|
package/src/i18n/az.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const dict
|
|
1
|
+
export const dict = {
|
|
2
2
|
"ui.sessionReview.title": "Sessiya dəyişiklikləri",
|
|
3
3
|
"ui.sessionReview.title.git": "Git dəyişiklikləri",
|
|
4
4
|
"ui.sessionReview.title.branch": "Branch dəyişiklikləri",
|
|
@@ -71,10 +71,6 @@ export const dict: Record<string, string> = {
|
|
|
71
71
|
"dialog.usageExceeded.freeTier.description":
|
|
72
72
|
"Ayda $10 olan OpenCode Go abunəliyi ilə ən yaxşı açıq mənbəli modellərə etibarlı giriş əldə edin.",
|
|
73
73
|
"dialog.usageExceeded.freeTier.actionLabel": "Abunə ol",
|
|
74
|
-
"dialog.usageExceeded.accountRateLimit.title": "Go limitinə çatdınız",
|
|
75
|
-
"dialog.usageExceeded.accountRateLimit.description":
|
|
76
|
-
"İstifadə limitinə çatdınız. Bu modeldən indi istifadə etməyə davam etmək üçün mövcud balansınızdan istifadəni aktivləşdirin",
|
|
77
|
-
"dialog.usageExceeded.accountRateLimit.actionLabel": "Tənzimləmələri aç",
|
|
78
74
|
"ui.sessionTurn.status.delegating": "İş həvalə edilir",
|
|
79
75
|
"ui.sessionTurn.status.planning": "Növbəti addımlar planlanır",
|
|
80
76
|
"ui.sessionTurn.status.gatheringContext": "Araşdırılır",
|
package/src/i18n/bg.ts
CHANGED
|
@@ -71,10 +71,6 @@ export const dict = {
|
|
|
71
71
|
"dialog.usageExceeded.freeTier.description":
|
|
72
72
|
"Абонирайте се за OpenCode Go за надежден достъп до най-добрите модели с отворен код за $10/месец.",
|
|
73
73
|
"dialog.usageExceeded.freeTier.actionLabel": "Абонирайте се",
|
|
74
|
-
"dialog.usageExceeded.accountRateLimit.title": "Лимитът за движение е достигнат",
|
|
75
|
-
"dialog.usageExceeded.accountRateLimit.description":
|
|
76
|
-
"Лимитът за използване е достигнат. За да продължите да използвате този модел сега, активирайте използването от вашия наличен баланс",
|
|
77
|
-
"dialog.usageExceeded.accountRateLimit.actionLabel": "Отворете настройките",
|
|
78
74
|
"ui.sessionTurn.status.delegating": "Делегиране на работа",
|
|
79
75
|
"ui.sessionTurn.status.planning": "Планиране на следващите стъпки",
|
|
80
76
|
"ui.sessionTurn.status.gatheringContext": "Изследване",
|
package/src/i18n/bn.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const dict
|
|
1
|
+
export const dict = {
|
|
2
2
|
"ui.sessionReview.title": "সেশন পরিবর্তন",
|
|
3
3
|
"ui.sessionReview.title.git": "Git পরিবর্তন",
|
|
4
4
|
"ui.sessionReview.title.branch": "শাখা পরিবর্তন",
|
|
@@ -73,10 +73,6 @@ export const dict: Record<string, string> = {
|
|
|
73
73
|
"dialog.usageExceeded.freeTier.description":
|
|
74
74
|
"সেরা ওপেন-সোর্স মডেলগুলিতে নির্ভরযোগ্য অ্যাক্সেসের জন্য $10/মাসে OpenCode Go-তে সদস্যতা নিন৷",
|
|
75
75
|
"dialog.usageExceeded.freeTier.actionLabel": "সদস্যতা",
|
|
76
|
-
"dialog.usageExceeded.accountRateLimit.title": "যাওয়ার সীমা পৌঁছে গেছে",
|
|
77
|
-
"dialog.usageExceeded.accountRateLimit.description":
|
|
78
|
-
"ব্যবহারের সীমা পৌঁছেছে। এখন এই মডেল ব্যবহার চালিয়ে যেতে, আপনার উপলব্ধ ব্যালেন্স থেকে ব্যবহার সক্ষম করুন",
|
|
79
|
-
"dialog.usageExceeded.accountRateLimit.actionLabel": "সেটিংস খুলুন",
|
|
80
76
|
"ui.sessionTurn.status.delegating": "কাজ অর্পণ",
|
|
81
77
|
"ui.sessionTurn.status.planning": "পরবর্তী পদক্ষেপের পরিকল্পনা",
|
|
82
78
|
"ui.sessionTurn.status.gatheringContext": "অন্বেষণ",
|
package/src/i18n/br.ts
CHANGED
|
@@ -120,10 +120,6 @@ export const dict = {
|
|
|
120
120
|
"dialog.usageExceeded.freeTier.description":
|
|
121
121
|
"Assine o OpenCode Go por $10/mês para ter acesso confiável aos melhores modelos de código aberto.",
|
|
122
122
|
"dialog.usageExceeded.freeTier.actionLabel": "Assinar",
|
|
123
|
-
"dialog.usageExceeded.accountRateLimit.title": "Limite do Go atingido",
|
|
124
|
-
"dialog.usageExceeded.accountRateLimit.description":
|
|
125
|
-
"Limite de uso atingido. Para continuar usando este modelo agora, ative o uso a partir do seu saldo disponível",
|
|
126
|
-
"dialog.usageExceeded.accountRateLimit.actionLabel": "Abrir configurações",
|
|
127
123
|
|
|
128
124
|
"ui.sessionTurn.status.delegating": "Delegando trabalho",
|
|
129
125
|
"ui.sessionTurn.status.planning": "Planejando próximos passos",
|
package/src/i18n/bs.ts
CHANGED
|
@@ -80,10 +80,6 @@ export const dict = {
|
|
|
80
80
|
"dialog.usageExceeded.freeTier.description":
|
|
81
81
|
"Pretplati se na OpenCode Go za $10/mjesec i ostvari pouzdan pristup najboljim modelima otvorenog koda.",
|
|
82
82
|
"dialog.usageExceeded.freeTier.actionLabel": "Pretplati se",
|
|
83
|
-
"dialog.usageExceeded.accountRateLimit.title": "Dostignut Go limit",
|
|
84
|
-
"dialog.usageExceeded.accountRateLimit.description":
|
|
85
|
-
"Dostignut je limit korištenja. Da sada nastaviš koristiti ovaj model, omogući korištenje raspoloživog salda",
|
|
86
|
-
"dialog.usageExceeded.accountRateLimit.actionLabel": "Otvori postavke",
|
|
87
83
|
|
|
88
84
|
"ui.sessionTurn.status.delegating": "Delegiranje posla",
|
|
89
85
|
"ui.sessionTurn.status.planning": "Planiranje sljedećih koraka",
|
package/src/i18n/ca.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const dict
|
|
1
|
+
export const dict = {
|
|
2
2
|
"ui.sessionReview.title": "Canvis de sessió",
|
|
3
3
|
"ui.sessionReview.title.git": "Canvis de Git",
|
|
4
4
|
"ui.sessionReview.title.branch": "Canvis de branca",
|
|
@@ -72,10 +72,6 @@ export const dict: Record<string, string> = {
|
|
|
72
72
|
"dialog.usageExceeded.freeTier.description":
|
|
73
73
|
"Subscriviu-vos a OpenCode Go per 10 dòlars al mes i obteniu accés fiable als millors models de codi obert.",
|
|
74
74
|
"dialog.usageExceeded.freeTier.actionLabel": "Subscriu-te",
|
|
75
|
-
"dialog.usageExceeded.accountRateLimit.title": "S'ha assolit el límit de Go",
|
|
76
|
-
"dialog.usageExceeded.accountRateLimit.description":
|
|
77
|
-
"S'ha arribat al límit d'ús. Per continuar utilitzant aquest model ara, activeu l'ús des del vostre saldo disponible",
|
|
78
|
-
"dialog.usageExceeded.accountRateLimit.actionLabel": "Obre la configuració",
|
|
79
75
|
"ui.sessionTurn.status.delegating": "Delegació de feina",
|
|
80
76
|
"ui.sessionTurn.status.planning": "Planificant els propers passos",
|
|
81
77
|
"ui.sessionTurn.status.gatheringContext": "Explorant",
|
package/src/i18n/cs.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const dict
|
|
1
|
+
export const dict = {
|
|
2
2
|
"ui.sessionReview.title": "Změny relace",
|
|
3
3
|
"ui.sessionReview.title.git": "Git změny",
|
|
4
4
|
"ui.sessionReview.title.branch": "Změny ve větvi",
|
|
@@ -73,10 +73,6 @@ export const dict: Record<string, string> = {
|
|
|
73
73
|
"dialog.usageExceeded.freeTier.description":
|
|
74
74
|
"Předplaťte si OpenCode Go za 10 USD měsíčně a získejte spolehlivý přístup k nejlepším modelům s otevřeným zdrojovým kódem.",
|
|
75
75
|
"dialog.usageExceeded.freeTier.actionLabel": "Přihlásit se k odběru",
|
|
76
|
-
"dialog.usageExceeded.accountRateLimit.title": "Dosažen limit služby Go",
|
|
77
|
-
"dialog.usageExceeded.accountRateLimit.description":
|
|
78
|
-
"Bylo dosaženo limitu využití. Chcete-li nyní tento model nadále používat, povolte používání ze svého dostupného zůstatku",
|
|
79
|
-
"dialog.usageExceeded.accountRateLimit.actionLabel": "Otevřete nastavení",
|
|
80
76
|
"ui.sessionTurn.status.delegating": "Delegování práce",
|
|
81
77
|
"ui.sessionTurn.status.planning": "Plánování dalších kroků",
|
|
82
78
|
"ui.sessionTurn.status.gatheringContext": "Zkoumání",
|
package/src/i18n/da.ts
CHANGED
|
@@ -110,10 +110,6 @@ export const dict = {
|
|
|
110
110
|
"dialog.usageExceeded.freeTier.description":
|
|
111
111
|
"Abonnér på OpenCode Go for $10/måned, og få pålidelig adgang til de bedste open source-modeller.",
|
|
112
112
|
"dialog.usageExceeded.freeTier.actionLabel": "Abonnér",
|
|
113
|
-
"dialog.usageExceeded.accountRateLimit.title": "Go-grænse nået",
|
|
114
|
-
"dialog.usageExceeded.accountRateLimit.description":
|
|
115
|
-
"Forbrugsgrænse nået. For at fortsætte med at bruge denne model nu, aktivér forbrug fra din tilgængelige saldo",
|
|
116
|
-
"dialog.usageExceeded.accountRateLimit.actionLabel": "Åbn indstillinger",
|
|
117
113
|
|
|
118
114
|
"ui.sessionTurn.status.delegating": "Delegerer arbejde",
|
|
119
115
|
"ui.sessionTurn.status.planning": "Planlægger næste trin",
|