@agents24/chat-react 0.5.34 → 0.5.36
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/compatibility.json +5 -5
- package/dist/registry/agents24-chat.json +9 -9
- package/dist/scaffold/index.cjs +5 -4
- package/dist/scaffold/index.cjs.map +1 -1
- package/dist/scaffold/index.js +6 -5
- package/dist/scaffold/index.js.map +1 -1
- package/dist/styles.css +48 -0
- package/dist/ui/bubble.d.ts +1 -1
- package/dist/ui/code-block.d.ts +33 -0
- package/dist/ui/code-highlighter.d.ts +8 -0
- package/dist/ui/index.cjs +690 -183
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +678 -180
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/message-code.d.ts +21 -0
- package/dist/ui/use-highlighted-code.d.ts +2 -0
- package/package.json +4 -3
- package/scaffold/src/components/chat/thread-sidebar.tsx +6 -5
package/dist/styles.css
CHANGED
|
@@ -284,6 +284,54 @@ button.a24-tool-trigger:focus-visible { outline: 2px solid var(--a24-focus); out
|
|
|
284
284
|
.a24-message-response > :last-child { margin-bottom: 0; }
|
|
285
285
|
.a24-message-response :is(pre, table) { max-width: 100%; overflow-x: auto; }
|
|
286
286
|
.a24-message-response :is(p, li, blockquote, code) { overflow-wrap: anywhere; }
|
|
287
|
+
/* shadcn/ui Code Block: package-owned styles, independent of host Tailwind scanning. */
|
|
288
|
+
.a24-inline-code { background: var(--a24-surface); border-radius: .25rem; font-family: var(--font-mono, ui-monospace, monospace); font-size: .875em; padding: .125rem .375rem; }
|
|
289
|
+
.a24-code-block { --a24-code-inset: 1rem; background: color-mix(in srgb, var(--a24-text) 4%, var(--a24-background)); border: 0; border-radius: 1.25rem; box-sizing: border-box; color: var(--a24-text); display: flex; flex-direction: column; font-size: .8125rem; margin-block: 1rem; max-width: 100%; min-width: 0; overflow: hidden; position: relative; width: 100%; }
|
|
290
|
+
.a24-code-block[data-size="sm"] { --a24-code-inset: .625rem; font-size: .75rem; }
|
|
291
|
+
.a24-code-block--destructive { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--a24-danger) 35%, transparent); color: var(--a24-danger); }
|
|
292
|
+
.a24-code-block__header, .a24-code-block__footer { align-items: center; color: var(--a24-muted); display: flex; flex-shrink: 0; gap: .5rem; min-width: 0; padding: var(--a24-code-inset); }
|
|
293
|
+
.a24-code-block__header { padding-bottom: 0; }
|
|
294
|
+
.a24-code-block__footer { padding-top: 0; }
|
|
295
|
+
.a24-code-block__title { align-items: center; display: flex; gap: .375rem; color: var(--a24-text); font-family: var(--font-sans, system-ui, sans-serif); font-size: inherit; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
296
|
+
.a24-code-block__title > svg { flex-shrink: 0; height: .875rem; width: .875rem; }
|
|
297
|
+
.a24-code-block__title > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
|
|
298
|
+
.a24-code-block__actions { align-items: center; display: flex; flex-shrink: 0; gap: .25rem; margin-block: -.25rem; margin-inline-start: auto; }
|
|
299
|
+
.a24-code-block > .a24-code-block__actions { background: var(--a24-background); border-radius: .375rem; inset-inline-end: .5rem; margin: 0; opacity: 0; position: absolute; top: .5rem; z-index: 1; }
|
|
300
|
+
.a24-code-block:hover > .a24-code-block__actions, .a24-code-block:focus-within > .a24-code-block__actions { opacity: 1; }
|
|
301
|
+
.a24-code-block__action { align-items: center; appearance: none; background: transparent; border: 0; border-radius: .375rem; color: color-mix(in srgb, var(--a24-muted) 70%, transparent); cursor: pointer; display: inline-flex; flex-shrink: 0; height: 1.5rem; justify-content: center; padding: 0; width: 1.5rem; }
|
|
302
|
+
.a24-code-block__action:hover, .a24-code-block__action:focus-visible { background: var(--a24-surface-hover); color: var(--a24-text); }
|
|
303
|
+
.a24-code-block__action:focus-visible { outline: 2px solid var(--a24-focus); outline-offset: -2px; }
|
|
304
|
+
.a24-code-block__action[aria-pressed="true"] { background: var(--a24-surface-hover); color: var(--a24-text); }
|
|
305
|
+
.a24-code-block__action:disabled { cursor: default; opacity: .5; }
|
|
306
|
+
.a24-code-block__action svg { flex-shrink: 0; height: .75rem; pointer-events: none; width: .75rem; }
|
|
307
|
+
.a24-code-block__announcement { clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }
|
|
308
|
+
.a24-code-block .a24-code-block__content { background: transparent; border: 0; border-radius: 0; color: inherit; font-family: var(--font-mono, ui-monospace, monospace); font-size: inherit; line-height: 1.65; margin: 0; max-height: 32rem; max-width: 100%; min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; padding: var(--a24-code-inset); scrollbar-width: thin; text-align: start; white-space: pre; }
|
|
309
|
+
.a24-code-block__content:focus-visible { outline: 2px solid var(--a24-focus); outline-offset: -2px; }
|
|
310
|
+
.a24-code-block .a24-code-block__content { scrollbar-color: color-mix(in srgb, var(--a24-muted) 40%, transparent) transparent; }
|
|
311
|
+
.a24-code-block__content::-webkit-scrollbar { display: block; height: 6px; width: 6px; background: transparent; }
|
|
312
|
+
.a24-code-block__content::-webkit-scrollbar-track, .a24-code-block__content::-webkit-scrollbar-corner { background: transparent; border: 0; box-shadow: none; }
|
|
313
|
+
.a24-code-block__content::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--a24-muted) 40%, transparent); border: 0; border-radius: 999px; }
|
|
314
|
+
.a24-code-block__content::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--a24-muted) 60%, transparent); }
|
|
315
|
+
.a24-code-block__content::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
|
|
316
|
+
.a24-code-block:has(> .a24-code-block__header) .a24-code-block__content { padding-top: .5rem; }
|
|
317
|
+
.a24-code-block .a24-code-block__code { background: transparent; border: 0; border-radius: 0; color: inherit; content-visibility: visible; display: grid; font: inherit; min-height: 1lh; min-width: max-content; overflow-wrap: normal; padding: 0; }
|
|
318
|
+
.a24-code-block__content[data-numbered] .a24-code-block__code { grid-template-columns: auto minmax(0, 1fr); }
|
|
319
|
+
.a24-code-block__content[data-wrap] { overflow-wrap: anywhere; white-space: pre-wrap; }
|
|
320
|
+
.a24-code-block__content[data-wrap] .a24-code-block__code { min-width: 0; overflow-wrap: anywhere; }
|
|
321
|
+
.a24-code-block__line { display: block; min-height: 1lh; position: relative; }
|
|
322
|
+
.a24-code-block__line-content { min-width: 0; }
|
|
323
|
+
.a24-code-block__content[data-numbered] .a24-code-block__line { column-gap: 1rem; counter-increment: line; display: grid; grid-column: span 2; grid-template-columns: subgrid; }
|
|
324
|
+
.a24-code-block__content[data-numbered] .a24-code-block__line::before { color: var(--a24-muted); content: counter(line); min-width: 1.5rem; text-align: end; user-select: none; }
|
|
325
|
+
@supports (content: counter(line) / "") { .a24-code-block__content[data-numbered] .a24-code-block__line::before { content: counter(line) / ""; } }
|
|
326
|
+
.a24-code-block__line--added, .a24-code-block__line--highlighted { background: var(--a24-surface-hover); }
|
|
327
|
+
.a24-code-block__line--removed { background: color-mix(in srgb, var(--a24-danger) 10%, transparent); }
|
|
328
|
+
.a24-code-block__line--added::after, .a24-code-block__line--removed::after { inset-inline-start: 0; position: absolute; user-select: none; }
|
|
329
|
+
.a24-code-block__line--added::after { content: "+"; }
|
|
330
|
+
.a24-code-block__line--removed::after { color: var(--a24-danger); content: "−"; }
|
|
331
|
+
.a24-code-token { color: var(--shiki-light); }
|
|
332
|
+
:root.dark .a24-code-token, [data-agents24-color-mode="dark"] .a24-code-token, [data-agents24-theme-root].dark .a24-code-token { color: var(--shiki-dark); }
|
|
333
|
+
@media (prefers-color-scheme: dark) { :root:not(.light):not([data-agents24-color-mode="light"]):not(:has([data-agents24-color-mode="light"])) .a24-code-token { color: var(--shiki-dark); } }
|
|
334
|
+
@media (pointer: coarse) { .a24-code-block > .a24-code-block__actions { opacity: 1; } }
|
|
287
335
|
.a24-source-link,
|
|
288
336
|
.a24-citation { color: #075f9a; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .18em; }
|
|
289
337
|
.a24-output-attachment { background: var(--a24-surface); border: 1px solid var(--a24-border); border-radius: .5rem; display: inline-flex; font-size: .8rem; padding: .45rem .65rem; }
|
package/dist/ui/bubble.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as React from "react";
|
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare function BubbleGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
declare const bubbleVariants: (props?: ({
|
|
5
|
-
variant?: "default" | "secondary" | "muted" | "tinted" | "outline" | "ghost" |
|
|
5
|
+
variant?: "default" | "destructive" | "secondary" | "muted" | "tinted" | "outline" | "ghost" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
declare function Bubble({ variant, align, className, ...props }: React.ComponentProps<"div"> & VariantProps<typeof bubbleVariants> & {
|
|
8
8
|
align?: "start" | "end";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const codeBlockVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
declare function CodeBlock({ className, variant, size, ...props }: React.ComponentProps<"div"> & VariantProps<typeof codeBlockVariants> & {
|
|
7
|
+
size?: "default" | "sm";
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function CodeBlockHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function CodeBlockTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function CodeBlockActions({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function CodeBlockCopyButton({ value, className, onClick, ...props }: React.ComponentProps<"button"> & {
|
|
13
|
+
value: string;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function CodeBlockWrapButton({ wrap, onWrapChange, className, onClick, ...props }: React.ComponentProps<"button"> & {
|
|
16
|
+
wrap: boolean;
|
|
17
|
+
onWrapChange: (wrap: boolean) => void;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function CodeBlockDownloadButton({ value, filename, className, onClick, ...props }: React.ComponentProps<"button"> & {
|
|
20
|
+
value: string;
|
|
21
|
+
filename?: string;
|
|
22
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
declare function CodeBlockContent({ className, children, style, wrap, lineNumbers, startLine, ...props }: React.ComponentProps<"pre"> & {
|
|
24
|
+
wrap?: boolean;
|
|
25
|
+
lineNumbers?: boolean;
|
|
26
|
+
startLine?: number;
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare const codeBlockLineVariants: (props?: ({
|
|
29
|
+
variant?: "default" | "added" | "removed" | "highlighted" | null | undefined;
|
|
30
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
31
|
+
declare function CodeBlockLine({ className, variant, children, ...props }: React.ComponentProps<"span"> & VariantProps<typeof codeBlockLineVariants>): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
declare function CodeBlockFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export { CodeBlock, CodeBlockHeader, CodeBlockTitle, CodeBlockActions, CodeBlockCopyButton, CodeBlockWrapButton, CodeBlockDownloadButton, CodeBlockContent, CodeBlockLine, CodeBlockFooter, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type GrammarState } from "shiki/core";
|
|
2
|
+
export declare function loadHighlighter(language: string): Promise<{
|
|
3
|
+
highlight(code: string, state?: GrammarState): {
|
|
4
|
+
lines: import("react/jsx-runtime").JSX.Element[][];
|
|
5
|
+
state: GrammarState | undefined;
|
|
6
|
+
};
|
|
7
|
+
} | null>;
|
|
8
|
+
export declare function highlightCode(code: string, language: string): Promise<import("react/jsx-runtime").JSX.Element[][] | null>;
|