@nexface/chat 0.1.3 → 0.1.4-alpha.1

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.
Files changed (84) hide show
  1. package/dist/assistant-attachments.js +6 -2
  2. package/dist/assistant-attachments.js.map +1 -1
  3. package/dist/assistant-components.d.ts +7 -3
  4. package/dist/assistant-components.js +30 -16
  5. package/dist/assistant-components.js.map +1 -1
  6. package/dist/assistant-runtime.d.ts +3 -1
  7. package/dist/assistant-runtime.js +45 -4
  8. package/dist/assistant-runtime.js.map +1 -1
  9. package/dist/default-chat.js +49 -65
  10. package/dist/default-chat.js.map +1 -1
  11. package/dist/fonts/JetBrainsMono-OFL.txt +93 -0
  12. package/dist/fonts/PublicSans-OFL.txt +93 -0
  13. package/dist/fonts/jetbrains-mono.ttf +0 -0
  14. package/dist/fonts/public-sans.ttf +0 -0
  15. package/dist/messages.d.ts +3 -0
  16. package/dist/messages.js.map +1 -1
  17. package/dist/protocol-messages.js +39 -8
  18. package/dist/protocol-messages.js.map +1 -1
  19. package/dist/storage.js +2 -2
  20. package/dist/storage.js.map +1 -1
  21. package/dist/styles.css +1167 -325
  22. package/dist/ui/button.js +1 -1
  23. package/dist/ui/button.js.map +1 -1
  24. package/dist/ui/code-block.d.ts +22 -0
  25. package/dist/ui/code-block.js +49 -0
  26. package/dist/ui/code-block.js.map +1 -0
  27. package/dist/ui/collapsible.d.ts +5 -0
  28. package/dist/ui/collapsible.js +15 -0
  29. package/dist/ui/collapsible.js.map +1 -0
  30. package/dist/ui/dropdown-menu.js +4 -3
  31. package/dist/ui/dropdown-menu.js.map +1 -1
  32. package/dist/ui/home-demo/action-bar.d.ts +2 -0
  33. package/dist/ui/home-demo/action-bar.js +10 -0
  34. package/dist/ui/home-demo/action-bar.js.map +1 -0
  35. package/dist/ui/home-demo/composer.d.ts +11 -0
  36. package/dist/ui/home-demo/composer.js +12 -0
  37. package/dist/ui/home-demo/composer.js.map +1 -0
  38. package/dist/ui/home-demo/greeting.d.ts +5 -0
  39. package/dist/ui/home-demo/greeting.js +8 -0
  40. package/dist/ui/home-demo/greeting.js.map +1 -0
  41. package/dist/ui/home-demo/messages.d.ts +9 -0
  42. package/dist/ui/home-demo/messages.js +15 -0
  43. package/dist/ui/home-demo/messages.js.map +1 -0
  44. package/dist/ui/home-demo/styles.d.ts +3 -0
  45. package/dist/ui/home-demo/styles.js +4 -0
  46. package/dist/ui/home-demo/styles.js.map +1 -0
  47. package/dist/ui/home-demo/suggestions.d.ts +13 -0
  48. package/dist/ui/home-demo/suggestions.js +21 -0
  49. package/dist/ui/home-demo/suggestions.js.map +1 -0
  50. package/dist/ui/home-demo/surfaces.d.ts +4 -0
  51. package/dist/ui/home-demo/surfaces.js +4 -0
  52. package/dist/ui/home-demo/surfaces.js.map +1 -0
  53. package/dist/ui/home-demo/thread.d.ts +13 -0
  54. package/dist/ui/home-demo/thread.js +12 -0
  55. package/dist/ui/home-demo/thread.js.map +1 -0
  56. package/dist/ui/home-demo/trace-line.d.ts +19 -0
  57. package/dist/ui/home-demo/trace-line.js +38 -0
  58. package/dist/ui/home-demo/trace-line.js.map +1 -0
  59. package/dist/ui/home-demo/trace.d.ts +11 -0
  60. package/dist/ui/home-demo/trace.js +20 -0
  61. package/dist/ui/home-demo/trace.js.map +1 -0
  62. package/dist/ui/home-demo/type.d.ts +5 -0
  63. package/dist/ui/home-demo/type.js +6 -0
  64. package/dist/ui/home-demo/type.js.map +1 -0
  65. package/dist/ui/input.js +2 -2
  66. package/dist/ui/input.js.map +1 -1
  67. package/dist/ui/markdown-text.js +32 -12
  68. package/dist/ui/markdown-text.js.map +1 -1
  69. package/dist/ui/reasoning.aui.d.ts +21 -0
  70. package/dist/ui/reasoning.aui.js +56 -0
  71. package/dist/ui/reasoning.aui.js.map +1 -0
  72. package/dist/ui/reasoning.d.ts +34 -0
  73. package/dist/ui/reasoning.js +112 -0
  74. package/dist/ui/reasoning.js.map +1 -0
  75. package/dist/ui/thread-list.aui.d.ts +7 -4
  76. package/dist/ui/thread-list.aui.js +53 -5
  77. package/dist/ui/thread-list.aui.js.map +1 -1
  78. package/dist/ui/tool-group.aui.d.ts +34 -0
  79. package/dist/ui/tool-group.aui.js +60 -0
  80. package/dist/ui/tool-group.aui.js.map +1 -0
  81. package/package.json +4 -4
  82. package/dist/ui/thread.aui.d.ts +0 -29
  83. package/dist/ui/thread.aui.js +0 -26
  84. package/dist/ui/thread.aui.js.map +0 -1
package/dist/ui/button.js CHANGED
@@ -9,7 +9,7 @@ const buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap
9
9
  variant: {
10
10
  default: "bg-primary text-primary-foreground hover:bg-primary/90",
11
11
  destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
12
- outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
12
+ outline: "border border-border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
13
13
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
14
14
  ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
15
15
  link: "text-primary underline-offset-4 hover:underline",
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,MAAM,cAAc,GAAG,GAAG,CAAC,6bAA6b,EAAE;IACxd,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,wDAAwD;YACjE,WAAW,EAAE,mJAAmJ;YAChK,OAAO,EAAE,uIAAuI;YAChJ,SAAS,EAAE,8DAA8D;YACzE,KAAK,EAAE,sEAAsE;YAC7E,IAAI,EAAE,iDAAiD;SACxD;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,+BAA+B;YACxC,EAAE,EAAE,0FAA0F;YAC9F,EAAE,EAAE,+CAA+C;YACnD,EAAE,EAAE,sCAAsC;YAC1C,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,wDAAwD;YACnE,SAAS,EAAE,QAAQ;YACnB,SAAS,EAAE,SAAS;SACrB;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;KAChB;CACF,CAAC,CAAC;AACH,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAE5B,SAAS,MAAM,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,IAAI,GAAG,SAAS,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;IACrG,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC5C,OAAO,CAAC,KAAC,IAAI,IAAC,GAAG,EAAE,GAAG,eAAY,QAAQ,kBAAe,OAAO,eAAa,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KAAM,KAAK,GAAG,CAAC,CAAC;AAChK,CAAC,CAAC,CAAC;AACH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC","sourcesContent":["\"use client\";\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"./utils.js\";\nimport { Slot } from \"radix-ui\";\nconst buttonVariants = cva(\"inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\", {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive: \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40\",\n outline: \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n xs: \"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n \"icon-xs\": \"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n});\nconst Button = React.forwardRef<HTMLButtonElement, React.ComponentPropsWithoutRef<\"button\"> & VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n}>(function Button({ className, variant = \"default\", size = \"default\", asChild = false, ...props }, ref) {\n const Comp = asChild ? Slot.Root : \"button\";\n return (<Comp ref={ref} data-slot=\"button\" data-variant={variant} data-size={size} className={cn(buttonVariants({ variant, size, className }))} {...props}/>);\n});\nexport { Button, buttonVariants };\n"]}
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings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,EAAE,SAAS,EAAE,CAAC,CAAC,KAAM,KAAK,GAAG,CAAC,CAAC;AAChK,CAAC,CAAC,CAAC;AACH,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC","sourcesContent":["\"use client\";\nimport * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"./utils.js\";\nimport { Slot } from \"radix-ui\";\nconst buttonVariants = cva(\"inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\", {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n destructive: \"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40\",\n outline: \"border border-border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\",\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n xs: \"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3\",\n sm: \"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\",\n \"icon-xs\": \"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3\",\n \"icon-sm\": \"size-8\",\n \"icon-lg\": \"size-10\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n});\nconst Button = React.forwardRef<HTMLButtonElement, React.ComponentPropsWithoutRef<\"button\"> & VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n}>(function Button({ className, variant = \"default\", size = \"default\", asChild = false, ...props }, ref) {\n const Comp = asChild ? Slot.Root : \"button\";\n return (<Comp ref={ref} data-slot=\"button\" data-variant={variant} data-size={size} className={cn(buttonVariants({ variant, size, className }))} {...props}/>);\n});\nexport { Button, buttonVariants };\n"]}
@@ -0,0 +1,22 @@
1
+ import { type ComponentProps, type ReactNode } from "react";
2
+ export interface CodeBlockProps extends Omit<ComponentProps<"figure">, "title"> {
3
+ /** Label in the header, usually the file name. */
4
+ title?: ReactNode;
5
+ /** Classes for the scrollable code region, e.g. a max height. */
6
+ viewportClassName?: string;
7
+ /** Text for the copy button; defaults to the rendered code's text. */
8
+ copyText?: string;
9
+ /** Called after the copy button writes the clipboard. */
10
+ onCopied?: () => void;
11
+ /** Numbers the lines when the `pre` does not carry `data-line-numbers` itself. */
12
+ lineNumbers?: boolean;
13
+ }
14
+ /**
15
+ * Chrome for highlighted code: a hairline field panel with an optional title
16
+ * header and a copy button. Children carry the `pre` element; tokens read
17
+ * shiki's inline colors or `--shiki-light`, and in dark mode fall back to
18
+ * `--shiki-dark`. Lines render as blocks on a `w-max` surface so
19
+ * highlighted rows paint past the scroll fold, and `data-line-numbers` on the
20
+ * `pre` (or the `lineNumbers` prop) turns on a CSS counter gutter.
21
+ */
22
+ export declare function CodeBlock({ title, viewportClassName, copyText, onCopied, lineNumbers, className, children, ...props }: CodeBlockProps): import("react").JSX.Element;
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useState, } from "react";
4
+ import { CheckIcon, CopyIcon } from "lucide-react";
5
+ import { cn } from "./utils.js";
6
+ function CopyButton({ getText, onCopied, className, }) {
7
+ const [copied, setCopied] = useState(false);
8
+ const copyTimer = useRef(undefined);
9
+ const unmounted = useRef(false);
10
+ useEffect(() => {
11
+ unmounted.current = false;
12
+ return () => {
13
+ unmounted.current = true;
14
+ clearTimeout(copyTimer.current);
15
+ setCopied(false);
16
+ };
17
+ }, []);
18
+ return (_jsx("button", { type: "button", "aria-label": "\u590D\u5236\u4EE3\u7801", onClick: async () => {
19
+ try {
20
+ await navigator.clipboard.writeText(getText());
21
+ }
22
+ catch {
23
+ return;
24
+ }
25
+ onCopied?.();
26
+ // The write can settle after the button is gone, and a confirmation
27
+ // started then would outlive the cleanup that was meant to cancel it.
28
+ if (unmounted.current)
29
+ return;
30
+ setCopied(true);
31
+ clearTimeout(copyTimer.current);
32
+ copyTimer.current = setTimeout(() => setCopied(false), 1500);
33
+ }, className: cn("text-muted-foreground hover:text-foreground grid size-6 shrink-0 place-items-center rounded-sm transition-colors", className), children: copied ? (_jsx(CheckIcon, { className: cn("size-3.5") })) : (_jsx(CopyIcon, { className: cn("size-3.5") })) }));
34
+ }
35
+ /**
36
+ * Chrome for highlighted code: a hairline field panel with an optional title
37
+ * header and a copy button. Children carry the `pre` element; tokens read
38
+ * shiki's inline colors or `--shiki-light`, and in dark mode fall back to
39
+ * `--shiki-dark`. Lines render as blocks on a `w-max` surface so
40
+ * highlighted rows paint past the scroll fold, and `data-line-numbers` on the
41
+ * `pre` (or the `lineNumbers` prop) turns on a CSS counter gutter.
42
+ */
43
+ export function CodeBlock({ title, viewportClassName, copyText, onCopied, lineNumbers, className, children, ...props }) {
44
+ const viewportRef = useRef(null);
45
+ const getText = () => copyText ?? viewportRef.current?.querySelector("pre")?.textContent ?? "";
46
+ return (_jsxs("figure", { className: cn("not-prose not-fumadocs-codeblock border-foreground/10 bg-foreground/[0.025] dark:bg-foreground/[0.04] group/code relative my-6 flex min-w-0 flex-col overflow-hidden rounded-sm border", className), ...props, children: [title ? (_jsxs("figcaption", { className: cn("border-foreground/10 flex h-9 shrink-0 items-center justify-between gap-2 border-b py-0 ps-3.5 pe-2"), children: [_jsx("span", { className: cn("text-muted-foreground min-w-0 truncate font-mono text-[11px] font-medium tracking-wide"), children: title }), _jsx(CopyButton, { getText: getText, onCopied: onCopied })] })) : (_jsx(CopyButton, { getText: getText, onCopied: onCopied, className: cn("bg-background/80 absolute top-2 right-2 z-10 opacity-0 backdrop-blur-sm transition-opacity group-hover/code:opacity-100 focus-visible:opacity-100 [@media(pointer:coarse)]:opacity-100") })), _jsx("div", { ref: viewportRef, role: "region", "aria-label": "\u4EE3\u7801", tabIndex: 0, className: cn("focus-visible:outline-foreground/20 min-w-0 overflow-x-auto py-3.5 font-mono text-[12.5px] leading-relaxed [font-variant-ligatures:none] focus-visible:outline-1 focus-visible:-outline-offset-1", "[&_code]:bg-transparent! [&_pre]:w-max [&_pre]:min-w-full [&_pre]:bg-transparent! [&_pre]:px-3.5", "[&_.line]:inline-block [&_.line]:min-h-[1lh] [&_.line]:w-full", "[&_code_span]:[color:var(--shiki-light,inherit)]", "dark:[&_code_span]:[color:var(--shiki-dark)]!", "[&_.highlighted]:bg-blue-500/8 [&_.highlighted]:shadow-[inset_2px_0_0_#3b82f6] dark:[&_.highlighted]:bg-blue-500/15", "[&_pre[data-line-numbers]]:[counter-reset:line]", "[&_pre[data-line-numbers]_.line]:relative [&_pre[data-line-numbers]_.line]:pl-8 [&_pre[data-line-numbers]_.line]:[counter-increment:line]", "[&_pre[data-line-numbers]_.line]:before:text-muted-foreground/40 [&_pre[data-line-numbers]_.line]:before:absolute [&_pre[data-line-numbers]_.line]:before:left-0 [&_pre[data-line-numbers]_.line]:before:w-5 [&_pre[data-line-numbers]_.line]:before:text-right [&_pre[data-line-numbers]_.line]:before:tabular-nums [&_pre[data-line-numbers]_.line]:before:[content:counter(line)]", lineNumbers &&
47
+ "[&_.line]:before:text-muted-foreground/40 [counter-reset:line] [&_.line]:relative [&_.line]:pl-8 [&_.line]:[counter-increment:line] [&_.line]:before:absolute [&_.line]:before:left-0 [&_.line]:before:w-5 [&_.line]:before:text-right [&_.line]:before:tabular-nums [&_.line]:before:[content:counter(line)]", viewportClassName), children: children })] }));
48
+ }
49
+ //# sourceMappingURL=code-block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"code-block.js","sourceRoot":"","sources":["../../src/ui/code-block.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EACL,SAAS,EACT,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAkBhC,SAAS,UAAU,CAAC,EAClB,OAAO,EACP,QAAQ,EACR,SAAS,GAKV;IACC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,SAAS,GAAG,MAAM,CACtB,SAAS,CACV,CAAC;IACF,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAEhC,SAAS,CAAC,GAAG,EAAE;QACb,SAAS,CAAC,OAAO,GAAG,KAAK,CAAC;QAC1B,OAAO,GAAG,EAAE;YACV,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;YACzB,YAAY,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YAChC,SAAS,CAAC,KAAK,CAAC,CAAC;QACnB,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,iBACE,IAAI,EAAC,QAAQ,gBACF,0BAAM,EACjB,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,CAAC;gBACH,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;YACjD,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO;YACT,CAAC;YACD,QAAQ,EAAE,EAAE,CAAC;YACb,oEAAoE;YACpE,sEAAsE;YACtE,IAAI,SAAS,CAAC,OAAO;gBAAE,OAAO;YAC9B,SAAS,CAAC,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LAAwL,CAAC,GACvM,CACH,EACD,cACE,GAAG,EAAE,WAAW,EAChB,IAAI,EAAC,QAAQ,gBACF,cAAI,EACf,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,EAAE,CACX,kMAAkM,EAClM,kGAAkG,EAClG,+DAA+D,EAC/D,kDAAkD,EAClD,+CAA+C,EAC/C,qHAAqH,EACrH,iDAAiD,EACjD,2IAA2I,EAC3I,sXAAsX,EACtX,WAAW;oBACT,+SAA+S,EACjT,iBAAiB,CAClB,YAEA,QAAQ,GACL,IACC,CACV,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport {\n useEffect,\n useRef,\n useState,\n type ComponentProps,\n type ReactNode,\n} from \"react\";\nimport { CheckIcon, CopyIcon } from \"lucide-react\";\nimport { cn } from \"./utils.js\";\n\nexport interface CodeBlockProps extends Omit<\n ComponentProps<\"figure\">,\n \"title\"\n> {\n /** Label in the header, usually the file name. */\n title?: ReactNode;\n /** Classes for the scrollable code region, e.g. a max height. */\n viewportClassName?: string;\n /** Text for the copy button; defaults to the rendered code's text. */\n copyText?: string;\n /** Called after the copy button writes the clipboard. */\n onCopied?: () => void;\n /** Numbers the lines when the `pre` does not carry `data-line-numbers` itself. */\n lineNumbers?: boolean;\n}\n\nfunction CopyButton({\n getText,\n onCopied,\n className,\n}: {\n getText: () => string;\n onCopied?: (() => void) | undefined;\n className?: string;\n}) {\n const [copied, setCopied] = useState(false);\n const copyTimer = useRef<ReturnType<typeof setTimeout> | undefined>(\n undefined,\n );\n const unmounted = useRef(false);\n\n useEffect(() => {\n unmounted.current = false;\n return () => {\n unmounted.current = true;\n clearTimeout(copyTimer.current);\n setCopied(false);\n };\n }, []);\n\n return (\n <button\n type=\"button\"\n aria-label=\"复制代码\"\n onClick={async () => {\n try {\n await navigator.clipboard.writeText(getText());\n } catch {\n return;\n }\n onCopied?.();\n // The write can settle after the button is gone, and a confirmation\n // started then would outlive the cleanup that was meant to cancel it.\n if (unmounted.current) return;\n setCopied(true);\n clearTimeout(copyTimer.current);\n copyTimer.current = setTimeout(() => setCopied(false), 1500);\n }}\n className={cn(\n \"text-muted-foreground hover:text-foreground grid size-6 shrink-0 place-items-center rounded-sm transition-colors\",\n className,\n )}\n >\n {copied ? (\n <CheckIcon className={cn(\"size-3.5\")} />\n ) : (\n <CopyIcon className={cn(\"size-3.5\")} />\n )}\n </button>\n );\n}\n\n/**\n * Chrome for highlighted code: a hairline field panel with an optional title\n * header and a copy button. Children carry the `pre` element; tokens read\n * shiki's inline colors or `--shiki-light`, and in dark mode fall back to\n * `--shiki-dark`. Lines render as blocks on a `w-max` surface so\n * highlighted rows paint past the scroll fold, and `data-line-numbers` on the\n * `pre` (or the `lineNumbers` prop) turns on a CSS counter gutter.\n */\nexport function CodeBlock({\n title,\n viewportClassName,\n copyText,\n onCopied,\n lineNumbers,\n className,\n children,\n ...props\n}: CodeBlockProps) {\n const viewportRef = useRef<HTMLDivElement>(null);\n const getText = () =>\n copyText ?? viewportRef.current?.querySelector(\"pre\")?.textContent ?? \"\";\n\n return (\n <figure\n className={cn(\n \"not-prose not-fumadocs-codeblock border-foreground/10 bg-foreground/[0.025] dark:bg-foreground/[0.04] group/code relative my-6 flex min-w-0 flex-col overflow-hidden rounded-sm border\",\n className,\n )}\n {...props}\n >\n {title ? (\n <figcaption className={cn(\"border-foreground/10 flex h-9 shrink-0 items-center justify-between gap-2 border-b py-0 ps-3.5 pe-2\")}>\n <span className={cn(\"text-muted-foreground min-w-0 truncate font-mono text-[11px] font-medium tracking-wide\")}>\n {title}\n </span>\n <CopyButton getText={getText} onCopied={onCopied} />\n </figcaption>\n ) : (\n <CopyButton\n getText={getText}\n onCopied={onCopied}\n className={cn(\"bg-background/80 absolute top-2 right-2 z-10 opacity-0 backdrop-blur-sm transition-opacity group-hover/code:opacity-100 focus-visible:opacity-100 [@media(pointer:coarse)]:opacity-100\")}\n />\n )}\n <div\n ref={viewportRef}\n role=\"region\"\n aria-label=\"代码\"\n tabIndex={0}\n className={cn(\n \"focus-visible:outline-foreground/20 min-w-0 overflow-x-auto py-3.5 font-mono text-[12.5px] leading-relaxed [font-variant-ligatures:none] focus-visible:outline-1 focus-visible:-outline-offset-1\",\n \"[&_code]:bg-transparent! [&_pre]:w-max [&_pre]:min-w-full [&_pre]:bg-transparent! [&_pre]:px-3.5\",\n \"[&_.line]:inline-block [&_.line]:min-h-[1lh] [&_.line]:w-full\",\n \"[&_code_span]:[color:var(--shiki-light,inherit)]\",\n \"dark:[&_code_span]:[color:var(--shiki-dark)]!\",\n \"[&_.highlighted]:bg-blue-500/8 [&_.highlighted]:shadow-[inset_2px_0_0_#3b82f6] dark:[&_.highlighted]:bg-blue-500/15\",\n \"[&_pre[data-line-numbers]]:[counter-reset:line]\",\n \"[&_pre[data-line-numbers]_.line]:relative [&_pre[data-line-numbers]_.line]:pl-8 [&_pre[data-line-numbers]_.line]:[counter-increment:line]\",\n \"[&_pre[data-line-numbers]_.line]:before:text-muted-foreground/40 [&_pre[data-line-numbers]_.line]:before:absolute [&_pre[data-line-numbers]_.line]:before:left-0 [&_pre[data-line-numbers]_.line]:before:w-5 [&_pre[data-line-numbers]_.line]:before:text-right [&_pre[data-line-numbers]_.line]:before:tabular-nums [&_pre[data-line-numbers]_.line]:before:[content:counter(line)]\",\n lineNumbers &&\n \"[&_.line]:before:text-muted-foreground/40 [counter-reset:line] [&_.line]:relative [&_.line]:pl-8 [&_.line]:[counter-increment:line] [&_.line]:before:absolute [&_.line]:before:left-0 [&_.line]:before:w-5 [&_.line]:before:text-right [&_.line]:before:tabular-nums [&_.line]:before:[content:counter(line)]\",\n viewportClassName,\n )}\n >\n {children}\n </div>\n </figure>\n );\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
2
+ declare const Collapsible: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react/collapsible").CollapsibleRootProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
3
+ declare function CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props): import("react").JSX.Element;
4
+ declare function CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props): import("react").JSX.Element;
5
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent };
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { forwardRef } from "react";
4
+ import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
5
+ const Collapsible = forwardRef(function Collapsible(props, ref) {
6
+ return _jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ref: ref, ...props });
7
+ });
8
+ function CollapsibleTrigger({ ...props }) {
9
+ return (_jsx(CollapsiblePrimitive.Trigger, { "data-slot": "collapsible-trigger", ...props }));
10
+ }
11
+ function CollapsibleContent({ ...props }) {
12
+ return (_jsx(CollapsiblePrimitive.Panel, { "data-slot": "collapsible-content", ...props }));
13
+ }
14
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent };
15
+ //# sourceMappingURL=collapsible.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collapsible.js","sourceRoot":"","sources":["../../src/ui/collapsible.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAEjF,MAAM,WAAW,GAAG,UAAU,CAAkD,SAAS,WAAW,CAAC,KAAK,EAAE,GAAG;IAC7G,OAAO,KAAC,oBAAoB,CAAC,IAAI,iBAAW,aAAa,EAAC,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CAAC;AACpF,CAAC,CAAC,CAAC;AAEH,SAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAsC;IAC1E,OAAO,CACL,KAAC,oBAAoB,CAAC,OAAO,iBAAW,qBAAqB,KAAK,KAAK,GAAI,CAC5E,CAAC;AACJ,CAAC;AAED,SAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAAoC;IACxE,OAAO,CACL,KAAC,oBAAoB,CAAC,KAAK,iBAAW,qBAAqB,KAAK,KAAK,GAAI,CAC1E,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\nimport { Collapsible as CollapsiblePrimitive } from \"@base-ui/react/collapsible\";\n\nconst Collapsible = forwardRef<HTMLDivElement, CollapsiblePrimitive.Root.Props>(function Collapsible(props, ref) {\n return <CollapsiblePrimitive.Root data-slot=\"collapsible\" ref={ref} {...props} />;\n});\n\nfunction CollapsibleTrigger({ ...props }: CollapsiblePrimitive.Trigger.Props) {\n return (\n <CollapsiblePrimitive.Trigger data-slot=\"collapsible-trigger\" {...props} />\n );\n}\n\nfunction CollapsibleContent({ ...props }: CollapsiblePrimitive.Panel.Props) {\n return (\n <CollapsiblePrimitive.Panel data-slot=\"collapsible-content\" {...props} />\n );\n}\n\nexport { Collapsible, CollapsibleTrigger, CollapsibleContent };\n"]}
@@ -1,5 +1,6 @@
1
- "use client";
2
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { menuContentClass, menuItemClass } from "./home-demo/styles.js";
3
+ "use client";
3
4
  import { usePortalContainer, PortalThemeSync } from "./surface.js";
4
5
  import * as React from "react";
5
6
  import { cn } from "./utils.js";
@@ -21,13 +22,13 @@ function DropdownMenuContent({ children, className, sideOffset = 4, ...props })
21
22
  const container = usePortalContainer();
22
23
  if (!container)
23
24
  return null;
24
- return (_jsx(DropdownMenuPrimitive.Portal, { container: container, children: _jsxs(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn("z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[9rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_4px_16px_#00000014] outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", className), ...props, children: [_jsx(PortalThemeSync, {}), children] }) }));
25
+ return (_jsx(DropdownMenuPrimitive.Portal, { container: container, children: _jsxs(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn(menuContentClass, className), ...props, children: [_jsx(PortalThemeSync, {}), children] }) }));
25
26
  }
26
27
  function DropdownMenuGroup({ ...props }) {
27
28
  return (_jsx(DropdownMenuPrimitive.Group, { "data-slot": "dropdown-menu-group", ...props }));
28
29
  }
29
30
  function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
30
- return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn("relative flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-2 text-sm leading-5 outline-none select-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:data-[highlighted]:bg-destructive/10 data-[variant=destructive]:data-[highlighted]:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!", className), ...props }));
31
+ return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-inset": inset, "data-variant": variant, className: cn(menuItemClass, "data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[variant=destructive]:text-destructive", className), ...props }));
31
32
  }
32
33
  function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
33
34
  return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), checked: checked ?? false, ...props, children: [_jsx("span", { className: cn("pointer-events-none absolute left-2 flex size-3.5 items-center justify-center"), children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(CheckIcon, { className: cn("size-4") }) }) }), children] }));
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../src/ui/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACvE,OAAO,EAAE,YAAY,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjE,SAAS,YAAY,CAAC,EAAE,GAAG,KAAK,EAA2D;IACzF,OAAO,KAAC,qBAAqB,CAAC,IAAI,iBAAW,eAAe,KAAK,KAAK,GAAG,CAAC;AAC5E,CAAC;AACD,SAAS,kBAAkB,CAAC,EAAE,GAAG,KAAK,EAA6D;IACjG,MAAM,SAAS,GAAG,kBAAkB,EAAE,CAAC;IACvC,IAAI,CAAC,SAAS;QACZ,OAAO,IAAI,CAAC;IACd,OAAO,CAAC,KAAC,qBAAqB,CAAC,MAAM,IAAC,SAAS,EAAE,SAAS,eAAY,sBAAsB,KAAK,KAAK,GAAG,CAAC,CAAC;AAC7G,CAAC;AACD,MAAM,mB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AE,qBAAqB,EAAE,oBAAoB,EAAE,eAAe,EAAE,sBAAsB,EAAE,sBAAsB,GAAG,CAAC","sourcesContent":["\"use client\";\nimport { usePortalContainer, PortalThemeSync } from \"./surface.js\";\nimport * as React from \"react\";\nimport { cn } from \"./utils.js\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props}/>;\n}\nfunction DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n const container = usePortalContainer();\n if (!container)\n return null;\n return (<DropdownMenuPrimitive.Portal container={container} data-slot=\"dropdown-menu-portal\" {...props}/>);\n}\nconst DropdownMenuTrigger = React.forwardRef<HTMLButtonElement, React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>>(function DropdownMenuTrigger({ ...props }, ref) {\n return (<DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" ref={ref} {...props}/>);\n});\nfunction DropdownMenuContent({ children, className, sideOffset = 4, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n const container = usePortalContainer();\n if (!container)\n return null;\n return (<DropdownMenuPrimitive.Portal container={container}>\n <DropdownMenuPrimitive.Content data-slot=\"dropdown-menu-content\" sideOffset={sideOffset} className={cn(\"z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[9rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl border border-border bg-popover p-1.5 text-popover-foreground shadow-[0_4px_16px_#00000014] outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\", className)} {...props}><PortalThemeSync />{children}</DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>);\n}\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return (<DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props}/>);\n}\nfunction DropdownMenuItem({ className, inset, variant = \"default\", ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (<DropdownMenuPrimitive.Item data-slot=\"dropdown-menu-item\" data-inset={inset} data-variant={variant} className={cn(\"relative flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-2 text-sm leading-5 outline-none select-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:data-[highlighted]:bg-destructive/10 data-[variant=destructive]:data-[highlighted]:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!\", className)} {...props}/>);\n}\nfunction DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (<DropdownMenuPrimitive.CheckboxItem data-slot=\"dropdown-menu-checkbox-item\" className={cn(\"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\", className)} checked={checked ?? false} {...props}>\n <span className={cn(\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\")}>\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className={cn(\"size-4\")}/>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>);\n}\nfunction DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return (<DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props}/>);\n}\nfunction DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (<DropdownMenuPrimitive.RadioItem data-slot=\"dropdown-menu-radio-item\" className={cn(\"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\", className)} {...props}>\n <span className={cn(\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\")}>\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className={cn(\"size-2 fill-current\")}/>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>);\n}\nfunction DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (<DropdownMenuPrimitive.Label data-slot=\"dropdown-menu-label\" data-inset={inset} className={cn(\"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)} {...props}/>);\n}\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (<DropdownMenuPrimitive.Separator data-slot=\"dropdown-menu-separator\" className={cn(\"-mx-1 my-1 h-px bg-border\", className)} {...props}/>);\n}\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (<span data-slot=\"dropdown-menu-shortcut\" className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)} {...props}/>);\n}\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props}/>;\n}\nfunction DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (<DropdownMenuPrimitive.SubTrigger data-slot=\"dropdown-menu-sub-trigger\" data-inset={inset} className={cn(\"flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\", className)} {...props}>\n {children}\n <ChevronRightIcon className={cn(\"ml-auto size-4\")}/>\n </DropdownMenuPrimitive.SubTrigger>);\n}\nfunction DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (<DropdownMenuPrimitive.SubContent data-slot=\"dropdown-menu-sub-content\" className={cn(\"z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\", className)} {...props}/>);\n}\nexport { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, Drop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C,uDAAuD,EAAE,SAAS,CAAC,KAAM,KAAK,GAAG,CAAC,CAAC;AACpJ,CAAC;AACD,SAAS,eAAe,CAAC,EAAE,GAAG,KAAK,EAA0D;IAC3F,OAAO,KAAC,qBAAqB,CAAC,GAAG,iBAAW,mBAAmB,KAAK,KAAK,GAAG,CAAC;AAC/E,CAAC;AACD,SAAS,sBAAsB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,EAErE;IACC,OAAO,CAAC,MAAC,qBAAqB,CAAC,UAAU,iBAAW,2BAA2B,gBAAa,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,4WAA4W,EAAE,SAAS,CAAC,KAAM,KAAK,aAClf,QAAQ,EACT,KAAC,gBAAgB,IAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,CAAC,GAAG,IAClB,CAAC,CAAC;AACvC,CAAC;AACD,SAAS,sBAAsB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAiE;IACpH,OAAO,CAAC,KAAC,qBAAqB,CAAC,UAAU,iBAAW,2BAA2B,EAAC,SAAS,EAAE,EAAE,CAAC,+eAA+e,EAAE,SAAS,CAAC,KAAM,KAAK,GAAG,CAAC,CAAC;AAC3mB,CAAC;AACD,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,eAAe,EAAE,sBAAsB,EAAE,sBAAsB,GAAG,CAAC","sourcesContent":["import { menuContentClass, menuItemClass } from \"./home-demo/styles.js\";\n\"use client\";\nimport { usePortalContainer, PortalThemeSync } from \"./surface.js\";\nimport * as React from \"react\";\nimport { cn } from \"./utils.js\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"lucide-react\";\nimport { DropdownMenu as DropdownMenuPrimitive } from \"radix-ui\";\nfunction DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {\n return <DropdownMenuPrimitive.Root data-slot=\"dropdown-menu\" {...props}/>;\n}\nfunction DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {\n const container = usePortalContainer();\n if (!container)\n return null;\n return (<DropdownMenuPrimitive.Portal container={container} data-slot=\"dropdown-menu-portal\" {...props}/>);\n}\nconst DropdownMenuTrigger = React.forwardRef<HTMLButtonElement, React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Trigger>>(function DropdownMenuTrigger({ ...props }, ref) {\n return (<DropdownMenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" ref={ref} {...props}/>);\n});\nfunction DropdownMenuContent({ children, className, sideOffset = 4, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {\n const container = usePortalContainer();\n if (!container)\n return null;\n return (<DropdownMenuPrimitive.Portal container={container}>\n <DropdownMenuPrimitive.Content data-slot=\"dropdown-menu-content\" sideOffset={sideOffset} className={cn(menuContentClass, className)} {...props}><PortalThemeSync />{children}</DropdownMenuPrimitive.Content>\n </DropdownMenuPrimitive.Portal>);\n}\nfunction DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {\n return (<DropdownMenuPrimitive.Group data-slot=\"dropdown-menu-group\" {...props}/>);\n}\nfunction DropdownMenuItem({ className, inset, variant = \"default\", ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean;\n variant?: \"default\" | \"destructive\";\n}) {\n return (<DropdownMenuPrimitive.Item data-slot=\"dropdown-menu-item\" data-inset={inset} data-variant={variant} className={cn(menuItemClass, \"data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[variant=destructive]:text-destructive\", className)} {...props}/>);\n}\nfunction DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {\n return (<DropdownMenuPrimitive.CheckboxItem data-slot=\"dropdown-menu-checkbox-item\" className={cn(\"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\", className)} checked={checked ?? false} {...props}>\n <span className={cn(\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\")}>\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className={cn(\"size-4\")}/>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>);\n}\nfunction DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {\n return (<DropdownMenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props}/>);\n}\nfunction DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {\n return (<DropdownMenuPrimitive.RadioItem data-slot=\"dropdown-menu-radio-item\" className={cn(\"relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\", className)} {...props}>\n <span className={cn(\"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center\")}>\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className={cn(\"size-2 fill-current\")}/>\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>);\n}\nfunction DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean;\n}) {\n return (<DropdownMenuPrimitive.Label data-slot=\"dropdown-menu-label\" data-inset={inset} className={cn(\"px-2 py-1.5 text-sm font-medium data-[inset]:pl-8\", className)} {...props}/>);\n}\nfunction DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {\n return (<DropdownMenuPrimitive.Separator data-slot=\"dropdown-menu-separator\" className={cn(\"-mx-1 my-1 h-px bg-border\", className)} {...props}/>);\n}\nfunction DropdownMenuShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n return (<span data-slot=\"dropdown-menu-shortcut\" className={cn(\"ml-auto text-xs tracking-widest text-muted-foreground\", className)} {...props}/>);\n}\nfunction DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {\n return <DropdownMenuPrimitive.Sub data-slot=\"dropdown-menu-sub\" {...props}/>;\n}\nfunction DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean;\n}) {\n return (<DropdownMenuPrimitive.SubTrigger data-slot=\"dropdown-menu-sub-trigger\" data-inset={inset} className={cn(\"flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\", className)} {...props}>\n {children}\n <ChevronRightIcon className={cn(\"ml-auto size-4\")}/>\n </DropdownMenuPrimitive.SubTrigger>);\n}\nfunction DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {\n return (<DropdownMenuPrimitive.SubContent data-slot=\"dropdown-menu-sub-content\" className={cn(\"z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95\", className)} {...props}/>);\n}\nexport { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };\n"]}
@@ -0,0 +1,2 @@
1
+ import type { ReactNode } from "react";
2
+ export declare function AssistantActionBar(): ReactNode;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Adapted from the pinned official homepage Demo; see vendor/assistant-ui/home-demo/ADAPTATIONS.md.
3
+ import { cn } from "../utils.js";
4
+ import { ActionBarPrimitive, AuiIf } from "@assistant-ui/react";
5
+ import { CheckIcon, CopyIcon } from "lucide-react";
6
+ import { actionButtonClass } from "./styles.js";
7
+ export function AssistantActionBar() {
8
+ return (_jsx(ActionBarPrimitive.Root, { hideWhenRunning: true, autohide: "not-last", className: cn("flex items-center gap-1.5"), children: _jsxs(ActionBarPrimitive.Copy, { "aria-label": "\u590D\u5236\u56DE\u590D", className: cn(actionButtonClass), children: [_jsx(AuiIf, { condition: (s) => s.message.isCopied, children: _jsx(CheckIcon, { className: cn("size-4") }) }), _jsx(AuiIf, { condition: (s) => !s.message.isCopied, children: _jsx(CopyIcon, { className: cn("size-4") }) })] }) }));
9
+ }
10
+ //# sourceMappingURL=action-bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-bar.js","sourceRoot":"","sources":["../../../src/ui/home-demo/action-bar.tsx"],"names":[],"mappings":";AAAA,oGAAoG;AACpG,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,MAAM,UAAU,kBAAkB;IAEhC,OAAO,CACL,KAAC,kBAAkB,CAAC,IAAI,IACtB,eAAe,QACf,QAAQ,EAAC,UAAU,EACnB,SAAS,EAAE,EAAE,CAAC,2BAA2B,CAAC,YAE1C,MAAC,kBAAkB,CAAC,IAAI,kBACX,0BAAM,EACjB,SAAS,EAAE,EAAE,CAAC,iBAAiB,CAAC,aAEhC,KAAC,KAAK,IAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,YACzC,KAAC,SAAS,IAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAK,GACjC,EACR,KAAC,KAAK,IAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,YAC1C,KAAC,QAAQ,IAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAK,GAChC,IACgB,GACF,CAC3B,CAAC;AACJ,CAAC","sourcesContent":["// Adapted from the pinned official homepage Demo; see vendor/assistant-ui/home-demo/ADAPTATIONS.md.\nimport { cn } from \"../utils.js\";\nimport type { ReactNode } from \"react\";\nimport { ActionBarPrimitive, AuiIf } from \"@assistant-ui/react\";\nimport { CheckIcon, CopyIcon } from \"lucide-react\";\nimport { actionButtonClass } from \"./styles.js\";\nexport function AssistantActionBar(): ReactNode {\n\n return (\n <ActionBarPrimitive.Root\n hideWhenRunning\n autohide=\"not-last\"\n className={cn(\"flex items-center gap-1.5\")}\n >\n <ActionBarPrimitive.Copy\n aria-label=\"复制回复\"\n className={cn(actionButtonClass)}\n >\n <AuiIf condition={(s) => s.message.isCopied}>\n <CheckIcon className={cn(\"size-4\")} />\n </AuiIf>\n <AuiIf condition={(s) => !s.message.isCopied}>\n <CopyIcon className={cn(\"size-4\")} />\n </AuiIf>\n </ActionBarPrimitive.Copy>\n </ActionBarPrimitive.Root>\n );\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import { ComposerPrimitive } from "@assistant-ui/react";
3
+ export declare function Composer({ children, inputProps, actions, ...props }: ComponentProps<typeof ComposerPrimitive.Root> & {
4
+ inputProps: ComponentProps<typeof ComposerPrimitive.Input>;
5
+ actions: ReactNode;
6
+ }): import("react").JSX.Element;
7
+ export declare function EditComposer({ children, inputProps, cancelProps, sendProps, ...props }: ComponentProps<typeof ComposerPrimitive.Root> & {
8
+ inputProps: ComponentProps<typeof ComposerPrimitive.Input>;
9
+ cancelProps: ComponentProps<"button">;
10
+ sendProps: ComponentProps<"button">;
11
+ }): ReactNode;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ComposerPrimitive, MessagePrimitive } from "@assistant-ui/react";
3
+ import { cn } from "../utils.js";
4
+ export function Composer({ children, inputProps, actions, ...props }) {
5
+ return (_jsx(ComposerPrimitive.Root, { className: cn("relative w-full"), ...props, children: _jsx(ComposerPrimitive.AttachmentDropzone, { asChild: true, disabled: inputProps.disabled, onDropCapture: (event) => { if (inputProps.disabled)
6
+ event.preventDefault(); }, onDragOverCapture: (event) => { if (inputProps.disabled)
7
+ event.preventDefault(); }, children: _jsxs("div", { "data-slot": "aui_composer-shell", className: cn("border-foreground/10 bg-muted/30 focus-within:border-foreground/25 data-[dragging=true]:border-foreground/40 rounded-thread flex flex-col border transition-colors data-[dragging=true]:border-dashed"), children: [_jsx("div", { className: cn("has-[.aui-attachment-root]:px-3 has-[.aui-attachment-root]:pt-3"), children: children }), _jsx(ComposerPrimitive.Input, { asChild: true, ...inputProps, children: _jsx("textarea", { "data-composer-input": true, rows: 1, className: cn("placeholder:text-muted-foreground field-sizing-content max-h-48 w-full resize-none bg-transparent px-4 pt-3 pb-2 text-base leading-6 focus:outline-none") }) }), _jsx("div", { className: cn("flex items-center justify-between gap-2 px-2 pb-2"), children: actions })] }) }) }));
8
+ }
9
+ export function EditComposer({ children, inputProps, cancelProps, sendProps, ...props }) {
10
+ return (_jsx(MessagePrimitive.Root, { "data-role": "user", "data-slot": "aui_edit-composer-wrapper", className: cn("mx-auto flex w-full max-w-(--nxf-thread-max-width) flex-col items-end"), children: _jsxs(ComposerPrimitive.Root, { className: cn("border-foreground/10 bg-muted/30 focus-within:border-foreground/25 rounded-thread flex w-full max-w-[85%] flex-col border transition-colors"), ...props, children: [_jsx(ComposerPrimitive.Input, { asChild: true, ...inputProps, children: _jsx("textarea", { autoFocus: true, rows: 1, className: cn("field-sizing-content max-h-48 min-h-12 w-full resize-none bg-transparent px-4 pt-3.5 pb-1 text-[15px] leading-6 focus:outline-none") }) }), children, _jsxs("div", { className: cn("flex items-center justify-end gap-1.5 px-2.5 pb-2.5"), children: [_jsx(ComposerPrimitive.Cancel, { asChild: true, children: _jsx("button", { type: "button", ...cancelProps, className: cn("text-muted-foreground hover:text-foreground rounded-control h-8 px-3 text-[13px] transition-colors"), children: "\u53D6\u6D88" }) }), _jsx(ComposerPrimitive.Send, { asChild: true, children: _jsx("button", { type: "button", ...sendProps, className: cn("bg-primary text-primary-foreground rounded-control h-8 px-3 text-[13px] font-medium transition-opacity disabled:opacity-40"), children: "\u4FDD\u5B58\u5E76\u91CD\u65B0\u53D1\u9001" }) })] })] }) }));
11
+ }
12
+ //# sourceMappingURL=composer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composer.js","sourceRoot":"","sources":["../../../src/ui/home-demo/composer.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,MAAM,UAAU,QAAQ,CA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,KAAK,IAAC,OAAO,WAAK,UAAU,YAC7C,mBACE,SAAS,QAET,IAAI,EAAE,CAAC,EACP,SAAS,EAAE,EAAE,CAAC,oIAAoI,CAAC,GACnJ,GACsB,EACzB,QAAQ,EACT,eAAK,SAAS,EAAE,EAAE,CAAC,qDAAqD,CAAC,aACvE,KAAC,iBAAiB,CAAC,MAAM,IAAC,OAAO,kBAC/B,iBACE,IAAI,EAAC,QAAQ,KACT,WAAW,EACf,SAAS,EAAE,EAAE,CAAC,oGAAoG,CAAC,6BAG5G,GACgB,EAC3B,KAAC,iBAAiB,CAAC,IAAI,IAAC,OAAO,kBAC7B,iBACE,IAAI,EAAC,QAAQ,KACT,SAAS,EACb,SAAS,EAAE,EAAE,CAAC,4HAA4H,CAAC,2DAGpI,GACc,IACrB,IACiB,GACH,CACzB,CAAC;AACJ,CAAC","sourcesContent":["// Adapted from the pinned official homepage Demo; see vendor/assistant-ui/home-demo/ADAPTATIONS.md.\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { ComposerPrimitive, MessagePrimitive } from \"@assistant-ui/react\";\nimport { cn } from \"../utils.js\";\nexport function Composer({ children, inputProps, actions, ...props }: ComponentProps<typeof ComposerPrimitive.Root> & {\n inputProps: ComponentProps<typeof ComposerPrimitive.Input>; actions: ReactNode;\n}) {\n return (\n <ComposerPrimitive.Root className={cn(\"relative w-full\")} {...props}>\n <ComposerPrimitive.AttachmentDropzone asChild disabled={inputProps.disabled}\n onDropCapture={(event) => { if (inputProps.disabled) event.preventDefault(); }}\n onDragOverCapture={(event) => { if (inputProps.disabled) event.preventDefault(); }}>\n <div data-slot=\"aui_composer-shell\" className={cn(\"border-foreground/10 bg-muted/30 focus-within:border-foreground/25 data-[dragging=true]:border-foreground/40 rounded-thread flex flex-col border transition-colors data-[dragging=true]:border-dashed\")} >\n <div className={cn(\"has-[.aui-attachment-root]:px-3 has-[.aui-attachment-root]:pt-3\")} >{children}</div>\n <ComposerPrimitive.Input asChild {...inputProps}>\n <textarea data-composer-input rows={1} className={cn(\"placeholder:text-muted-foreground field-sizing-content max-h-48 w-full resize-none bg-transparent px-4 pt-3 pb-2 text-base leading-6 focus:outline-none\")} />\n </ComposerPrimitive.Input>\n <div className={cn(\"flex items-center justify-between gap-2 px-2 pb-2\")} >{actions}</div>\n </div>\n </ComposerPrimitive.AttachmentDropzone>\n </ComposerPrimitive.Root>\n );\n}\n\nexport function EditComposer({ children, inputProps, cancelProps, sendProps, ...props }: ComponentProps<typeof ComposerPrimitive.Root> & {\n inputProps: ComponentProps<typeof ComposerPrimitive.Input>;\n cancelProps: ComponentProps<\"button\">; sendProps: ComponentProps<\"button\">;\n}): ReactNode {\n return (\n <MessagePrimitive.Root\n data-role=\"user\" data-slot=\"aui_edit-composer-wrapper\"\n className={cn(\"mx-auto flex w-full max-w-(--nxf-thread-max-width) flex-col items-end\")}\n >\n <ComposerPrimitive.Root className={cn(\"border-foreground/10 bg-muted/30 focus-within:border-foreground/25 rounded-thread flex w-full max-w-[85%] flex-col border transition-colors\")} {...props}>\n <ComposerPrimitive.Input asChild {...inputProps}>\n <textarea\n autoFocus\n\n rows={1}\n className={cn(\"field-sizing-content max-h-48 min-h-12 w-full resize-none bg-transparent px-4 pt-3.5 pb-1 text-[15px] leading-6 focus:outline-none\")}\n />\n </ComposerPrimitive.Input>\n {children}\n <div className={cn(\"flex items-center justify-end gap-1.5 px-2.5 pb-2.5\")} >\n <ComposerPrimitive.Cancel asChild>\n <button\n type=\"button\"\n {...cancelProps}\n className={cn(\"text-muted-foreground hover:text-foreground rounded-control h-8 px-3 text-[13px] transition-colors\")}\n >\n 取消\n </button>\n </ComposerPrimitive.Cancel>\n <ComposerPrimitive.Send asChild>\n <button\n type=\"button\"\n {...sendProps}\n className={cn(\"bg-primary text-primary-foreground rounded-control h-8 px-3 text-[13px] font-medium transition-opacity disabled:opacity-40\")}\n >\n 保存并重新发送\n </button>\n </ComposerPrimitive.Send>\n </div>\n </ComposerPrimitive.Root>\n </MessagePrimitive.Root>\n );\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { ReactNode } from "react";
2
+ export declare function Greeting({ title, description }: {
3
+ title: string;
4
+ description?: string | undefined;
5
+ }): ReactNode;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Adapted from the pinned official homepage Demo; see vendor/assistant-ui/home-demo/ADAPTATIONS.md.
3
+ import { cn } from "../utils.js";
4
+ import { typeSection, typeDeck } from "./type.js";
5
+ export function Greeting({ title, description }) {
6
+ return (_jsxs("div", { className: cn("animate-in fade-in slide-in-from-bottom-1 mx-auto mb-8 flex w-full max-w-(--nxf-thread-max-width) flex-col items-center text-center duration-200"), children: [_jsx("p", { className: cn(typeSection), children: title }), description ? _jsx("p", { className: cn(typeDeck), children: description }) : null] }));
7
+ }
8
+ //# sourceMappingURL=greeting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"greeting.js","sourceRoot":"","sources":["../../../src/ui/home-demo/greeting.tsx"],"names":[],"mappings":";AAAA,oGAAoG;AACpG,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAClD,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,WAAW,EAAuD;IAElG,OAAO,CACL,eAAK,SAAS,EAAE,EAAE,CAAC,kJAAkJ,CAAC,aACpK,YAAG,SAAS,EAAE,EAAE,CAAC,WAAW,CAAC,YAC1B,KAAK,GACJ,EACH,WAAW,CAAC,CAAC,CAAC,YAAG,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,YAAG,WAAW,GAAK,CAAC,CAAC,CAAC,IAAI,IAC/D,CACP,CAAC;AACJ,CAAC","sourcesContent":["// Adapted from the pinned official homepage Demo; see vendor/assistant-ui/home-demo/ADAPTATIONS.md.\nimport { cn } from \"../utils.js\";\nimport type { ReactNode } from \"react\";\nimport { typeSection, typeDeck } from \"./type.js\";\nexport function Greeting({ title, description }: { title: string; description?: string | undefined }): ReactNode {\n\n return (\n <div className={cn(\"animate-in fade-in slide-in-from-bottom-1 mx-auto mb-8 flex w-full max-w-(--nxf-thread-max-width) flex-col items-center text-center duration-200\")} >\n <p className={cn(typeSection)}>\n {title}\n </p>\n {description ? <p className={cn(typeDeck)}>{description}</p> : null}\n </div>\n );\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from "react";
2
+ export declare function UserMessage({ children, attachments, actions }: {
3
+ children: ReactNode;
4
+ attachments: ReactNode;
5
+ actions: ReactNode;
6
+ }): ReactNode;
7
+ export declare function AssistantMessage({ children }: {
8
+ children: ReactNode;
9
+ }): ReactNode;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Adapted from the pinned official homepage Demo; see vendor/assistant-ui/home-demo/ADAPTATIONS.md.
3
+ import { cn } from "../utils.js";
4
+ import { ActionBarPrimitive, ErrorPrimitive, MessagePrimitive } from "@assistant-ui/react";
5
+ import { AssistantActionBar } from "./action-bar.js";
6
+ export function UserMessage({ children, attachments, actions }) {
7
+ return (_jsxs(MessagePrimitive.Root, { "data-role": "user", "data-slot": "aui_user-message-root", className: cn("animate-in fade-in slide-in-from-bottom-1 mx-auto flex w-full max-w-(--nxf-thread-max-width) flex-col items-end duration-150"), children: [_jsx("div", { className: cn("w-full has-[.aui-attachment-root]:mb-2"), children: attachments }), _jsxs("div", { className: cn("relative max-w-[80%]"), children: [_jsx("div", { className: cn("peer bg-muted rounded-thread px-4 py-2 text-[15px] wrap-break-word empty:hidden"), children: children }), _jsx(ActionBarPrimitive.Root, { hideWhenRunning: true, autohide: "not-last", className: cn("absolute start-0 top-1/2 -translate-x-full -translate-y-1/2 pe-1.5 peer-empty:hidden"), children: actions })] })] }));
8
+ }
9
+ export function AssistantMessage({ children }) {
10
+ return (_jsxs(MessagePrimitive.Root, { "data-role": "assistant", "data-slot": "aui_assistant-message-root", className: cn("animate-in fade-in slide-in-from-bottom-1 mx-auto w-full max-w-(--nxf-thread-max-width) duration-150"), children: [_jsxs("div", { "data-slot": "aui_assistant-message-content", className: cn("text-[15px] leading-relaxed wrap-break-word"), children: [children, _jsx(MessageError, {})] }), _jsx("div", { className: cn("mt-2 flex items-center gap-1.5 empty:hidden"), children: _jsx(AssistantActionBar, {}) })] }));
11
+ }
12
+ function MessageError() {
13
+ return _jsx(MessagePrimitive.Error, { children: _jsx(ErrorPrimitive.Root, { className: cn("mt-2 border-l-2 pl-3 text-[13px] border-destructive/60 text-destructive"), children: _jsx(ErrorPrimitive.Message, { className: cn("line-clamp-2") }) }) });
14
+ }
15
+ //# sourceMappingURL=messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/ui/home-demo/messages.tsx"],"names":[],"mappings":";AAAA,oGAAoG;AACpG,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,MAAM,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,EAAuE;IACjI,OAAO,CACL,MAAC,gBAAgB,CAAC,IAAI,iBACV,MAAM,eAAW,uBAAuB,EAClD,SAAS,EAAE,EAAE,CAAC,8HAA8H,CAAC,aAE7I,cAAK,SAAS,EAAE,EAAE,CAAC,wCAAwC,CAAC,YACzD,WAAW,GACR,EACN,eAAK,SAAS,EAAE,EAAE,CAAC,sBAAsB,CAAC,aACxC,cAAK,SAAS,EAAE,EAAE,CAAC,iFAAiF,CAAC,YAClG,QAAQ,GACL,EACN,KAAC,kBAAkB,CAAC,IAAI,IACtB,eAAe,QACf,QAAQ,EAAC,UAAU,EACnB,SAAS,EAAE,EAAE,CAAC,sFAAsF,CAAC,YAEpG,OAAO,GACgB,IACtB,IACgB,CACzB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,EAAE,QAAQ,EAA2B;IACpE,OAAO,CACL,MAAC,gBAAgB,CAAC,IAAI,iBACV,WAAW,eAAW,4BAA4B,EAC5D,SAAS,EAAE,EAAE,CAAC,sGAAsG,CAAC,aAErH,4BAAe,+BAA+B,EAAC,SAAS,EAAE,EAAE,CAAC,6CAA6C,CAAC,aACxG,QAAQ,EACT,KAAC,YAAY,KAAG,IACZ,EACN,cAAK,SAAS,EAAE,EAAE,CAAC,6CAA6C,CAAC,YAC/D,KAAC,kBAAkB,KAAG,GAClB,IACgB,CACzB,CAAC;AACJ,CAAC;AAED,SAAS,YAAY;IACnB,OAAO,KAAC,gBAAgB,CAAC,KAAK,cAAC,KAAC,cAAc,CAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,yEAAyE,CAAC,YAAE,KAAC,cAAc,CAAC,OAAO,IAAC,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,GAAI,GAAsB,GAAyB,CAAC;AACzP,CAAC","sourcesContent":["// Adapted from the pinned official homepage Demo; see vendor/assistant-ui/home-demo/ADAPTATIONS.md.\nimport { cn } from \"../utils.js\";\nimport type { ReactNode } from \"react\";\nimport { ActionBarPrimitive, ErrorPrimitive, MessagePrimitive } from \"@assistant-ui/react\";\nimport { AssistantActionBar } from \"./action-bar.js\";\nexport function UserMessage({ children, attachments, actions }: { children: ReactNode; attachments: ReactNode; actions: ReactNode }): ReactNode {\n return (\n <MessagePrimitive.Root\n data-role=\"user\" data-slot=\"aui_user-message-root\"\n className={cn(\"animate-in fade-in slide-in-from-bottom-1 mx-auto flex w-full max-w-(--nxf-thread-max-width) flex-col items-end duration-150\")}\n >\n <div className={cn(\"w-full has-[.aui-attachment-root]:mb-2\")} >\n {attachments}\n </div>\n <div className={cn(\"relative max-w-[80%]\")} >\n <div className={cn(\"peer bg-muted rounded-thread px-4 py-2 text-[15px] wrap-break-word empty:hidden\")} >\n {children}\n </div>\n <ActionBarPrimitive.Root\n hideWhenRunning\n autohide=\"not-last\"\n className={cn(\"absolute start-0 top-1/2 -translate-x-full -translate-y-1/2 pe-1.5 peer-empty:hidden\")}\n >\n {actions}\n </ActionBarPrimitive.Root>\n </div>\n </MessagePrimitive.Root>\n );\n}\n\nexport function AssistantMessage({ children }: { children: ReactNode }): ReactNode {\n return (\n <MessagePrimitive.Root\n data-role=\"assistant\" data-slot=\"aui_assistant-message-root\"\n className={cn(\"animate-in fade-in slide-in-from-bottom-1 mx-auto w-full max-w-(--nxf-thread-max-width) duration-150\")}\n >\n <div data-slot=\"aui_assistant-message-content\" className={cn(\"text-[15px] leading-relaxed wrap-break-word\")} >\n {children}\n <MessageError />\n </div>\n <div className={cn(\"mt-2 flex items-center gap-1.5 empty:hidden\")} >\n <AssistantActionBar />\n </div>\n </MessagePrimitive.Root>\n );\n}\n\nfunction MessageError() {\n return <MessagePrimitive.Error><ErrorPrimitive.Root className={cn(\"mt-2 border-l-2 pl-3 text-[13px] border-destructive/60 text-destructive\")}><ErrorPrimitive.Message className={cn(\"line-clamp-2\")} /></ErrorPrimitive.Root></MessagePrimitive.Error>;\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export declare const actionButtonClass = "text-muted-foreground/70 hover:text-foreground disabled:pointer-events-none disabled:opacity-40 p-1 transition-colors";
2
+ export declare const menuContentClass = "bg-popover text-popover-foreground border-foreground/10 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out rounded-surface z-50 min-w-28 overflow-hidden border p-1";
3
+ export declare const menuItemClass = "hover:bg-muted focus:bg-muted flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-[13px] outline-none select-none";
@@ -0,0 +1,4 @@
1
+ export const actionButtonClass = "text-muted-foreground/70 hover:text-foreground disabled:pointer-events-none disabled:opacity-40 p-1 transition-colors";
2
+ export const menuContentClass = "bg-popover text-popover-foreground border-foreground/10 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out rounded-surface z-50 min-w-28 overflow-hidden border p-1";
3
+ export const menuItemClass = "hover:bg-muted focus:bg-muted flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-[13px] outline-none select-none";
4
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/ui/home-demo/styles.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAC5B,uHAAuH,CAAC;AAE1H,MAAM,CAAC,MAAM,gBAAgB,GAC3B,uSAAuS,CAAC;AAE1S,MAAM,CAAC,MAAM,aAAa,GACxB,kIAAkI,CAAC","sourcesContent":["export const actionButtonClass =\n \"text-muted-foreground/70 hover:text-foreground disabled:pointer-events-none disabled:opacity-40 p-1 transition-colors\";\n\nexport const menuContentClass =\n \"bg-popover text-popover-foreground border-foreground/10 data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:animate-out rounded-surface z-50 min-w-28 overflow-hidden border p-1\";\n\nexport const menuItemClass =\n \"hover:bg-muted focus:bg-muted flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-[13px] outline-none select-none\";\n"]}
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from "react";
2
+ export declare function Suggestions({ suggestions, disabled, onSend }: {
3
+ suggestions: readonly {
4
+ label: string;
5
+ prompt: string;
6
+ }[];
7
+ disabled: boolean;
8
+ onSend(prompt: string): void;
9
+ }): ReactNode;
10
+ export declare function FollowUps({ disabled, onSend }: {
11
+ disabled: boolean;
12
+ onSend(prompt: string): void;
13
+ }): ReactNode;
@@ -0,0 +1,21 @@
1
+ // Adapted from the pinned official homepage Demo; see vendor/assistant-ui/home-demo/ADAPTATIONS.md.
2
+ "use client";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { AuiIf, ThreadPrimitive, useAuiState } from "@assistant-ui/react";
5
+ import { cn } from "../utils.js";
6
+ const suggestionChipClass = "border-foreground/10 bg-background text-muted-foreground hover:border-foreground/25 hover:text-foreground rounded-control h-8 border px-3 text-[13px] transition-colors";
7
+ export function Suggestions({ suggestions, disabled, onSend }) {
8
+ const isComposerEmpty = useAuiState((s) => s.composer.isEmpty);
9
+ return (
10
+ // Typing hides the suggestions without unmounting them: the empty view is
11
+ // centred, so collapsing a block this tall moves the composer out from
12
+ // under the cursor. inert keeps the hidden chips out of the tab order.
13
+ _jsx("div", { inert: !isComposerEmpty || disabled, "aria-hidden": !isComposerEmpty || disabled, className: cn("animate-in fade-in mx-auto flex max-w-[34rem] flex-wrap items-center justify-center gap-2 transition-opacity duration-200 motion-reduce:animate-none", (!isComposerEmpty || disabled) && "opacity-0"), children: suggestions.map((suggestion) => (_jsx(ThreadPrimitive.Suggestion, { prompt: suggestion.prompt, send: true, disabled: disabled, onClick: (event) => { event.preventDefault(); onSend(suggestion.prompt); }, className: cn(suggestionChipClass), children: suggestion.label }, suggestion.prompt))) }));
14
+ }
15
+ export function FollowUps({ disabled, onSend }) {
16
+ const suggestions = useAuiState((s) => s.thread.suggestions);
17
+ return (_jsx(AuiIf, { condition: (s) => !s.thread.isEmpty &&
18
+ !s.thread.isRunning &&
19
+ s.thread.suggestions.length > 0, children: _jsx("div", { className: cn("animate-in fade-in flex [scrollbar-width:none] gap-2 overflow-x-auto duration-200 motion-reduce:animate-none [&::-webkit-scrollbar]:hidden"), children: suggestions.map((suggestion) => (_jsx(ThreadPrimitive.Suggestion, { prompt: suggestion.prompt, send: true, disabled: disabled, onClick: (event) => { event.preventDefault(); onSend(suggestion.prompt); }, className: cn(suggestionChipClass, "shrink-0 whitespace-nowrap"), children: suggestion.prompt }, suggestion.prompt))) }) }));
20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C,EAAE,QAAQ,EAAE,MAAM,EAAuD;IACjG,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAE7D,OAAO,CACL,KAAC,KAAK,IACJ,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CACf,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO;YACjB,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS;YACnB,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,YAGjC,cAAK,SAAS,EAAE,EAAE,CAAC,4IAA4I,CAAC,YAC7J,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAC/B,KAAC,eAAe,CAAC,UAAU,IAEzB,MAAM,EAAE,UAAU,CAAC,MAAM,EACzB,IAAI,QACJ,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAC1E,SAAS,EAAE,EAAE,CAAC,mBAAmB,EAAE,4BAA4B,CAAC,YAE/D,UAAU,CAAC,MAAM,IAPb,UAAU,CAAC,MAAM,CAQK,CAC9B,CAAC,GACE,GACA,CACT,CAAC;AACJ,CAAC","sourcesContent":["// Adapted from the pinned official homepage Demo; see vendor/assistant-ui/home-demo/ADAPTATIONS.md.\n\"use client\";\n\nimport { AuiIf, ThreadPrimitive, useAuiState } from \"@assistant-ui/react\";\nimport type { ReactNode } from \"react\";\nimport { cn } from \"../utils.js\";\n\nconst suggestionChipClass =\n \"border-foreground/10 bg-background text-muted-foreground hover:border-foreground/25 hover:text-foreground rounded-control h-8 border px-3 text-[13px] transition-colors\";\n\nexport function Suggestions({ suggestions, disabled, onSend }: {\n suggestions: readonly { label: string; prompt: string }[];\n disabled: boolean; onSend(prompt: string): void;\n}): ReactNode {\n const isComposerEmpty = useAuiState((s) => s.composer.isEmpty);\n\n return (\n // Typing hides the suggestions without unmounting them: the empty view is\n // centred, so collapsing a block this tall moves the composer out from\n // under the cursor. inert keeps the hidden chips out of the tab order.\n <div\n inert={!isComposerEmpty || disabled}\n aria-hidden={!isComposerEmpty || disabled}\n className={cn(\n \"animate-in fade-in mx-auto flex max-w-[34rem] flex-wrap items-center justify-center gap-2 transition-opacity duration-200 motion-reduce:animate-none\",\n (!isComposerEmpty || disabled) && \"opacity-0\",\n )}\n >\n {suggestions.map((suggestion) => (\n <ThreadPrimitive.Suggestion\n key={suggestion.prompt}\n prompt={suggestion.prompt}\n send\n disabled={disabled}\n onClick={(event) => { event.preventDefault(); onSend(suggestion.prompt); }}\n className={cn(suggestionChipClass)}\n >\n {suggestion.label}\n </ThreadPrimitive.Suggestion>\n ))}\n </div>\n );\n}\n\nexport function FollowUps({ disabled, onSend }: { disabled: boolean; onSend(prompt: string): void }): ReactNode {\n const suggestions = useAuiState((s) => s.thread.suggestions);\n\n return (\n <AuiIf\n condition={(s) =>\n !s.thread.isEmpty &&\n !s.thread.isRunning &&\n s.thread.suggestions.length > 0\n }\n >\n <div className={cn(\"animate-in fade-in flex [scrollbar-width:none] gap-2 overflow-x-auto duration-200 motion-reduce:animate-none [&::-webkit-scrollbar]:hidden\")} >\n {suggestions.map((suggestion) => (\n <ThreadPrimitive.Suggestion\n key={suggestion.prompt}\n prompt={suggestion.prompt}\n send\n disabled={disabled}\n onClick={(event) => { event.preventDefault(); onSend(suggestion.prompt); }}\n className={cn(suggestionChipClass, \"shrink-0 whitespace-nowrap\")}\n >\n {suggestion.prompt}\n </ThreadPrimitive.Suggestion>\n ))}\n </div>\n </AuiIf>\n );\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { ComponentProps } from "react";
2
+ export declare function ShimmerLabel({ active, className, ...props }: ComponentProps<"span"> & {
3
+ active?: boolean;
4
+ }): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from "../utils.js";
3
+ export function ShimmerLabel({ active = true, className, ...props }) { return _jsx("span", { className: cn(active && "shimmer motion-reduce:animate-none", className), ...props }); }
4
+ //# sourceMappingURL=surfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surfaces.js","sourceRoot":"","sources":["../../../src/ui/home-demo/surfaces.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,MAAM,UAAU,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAiD,IAAI,OAAO,eAAM,SAAS,EAAE,EAAE,CAAC,MAAM,IAAI,oCAAoC,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC,CAAC,CAAC","sourcesContent":["import type { ComponentProps } from \"react\";\nimport { cn } from \"../utils.js\";\nexport function ShimmerLabel({ active = true, className, ...props }: ComponentProps<\"span\"> & { active?: boolean }) { return <span className={cn(active && \"shimmer motion-reduce:animate-none\", className)} {...props} />; }\n"]}
@@ -0,0 +1,13 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import { ThreadPrimitive } from "@assistant-ui/react";
3
+ type ThreadProps = {
4
+ empty: boolean;
5
+ welcome: ReactNode;
6
+ suggestions: ReactNode;
7
+ composer: ReactNode;
8
+ footer: ReactNode;
9
+ children?: ReactNode;
10
+ renderMessage: NonNullable<ComponentProps<typeof ThreadPrimitive.Messages>["children"]>;
11
+ };
12
+ export declare function Thread({ empty: isEmpty, welcome, suggestions, composer, footer, children, renderMessage }: ThreadProps): import("react").JSX.Element;
13
+ export {};
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ThreadPrimitive } from "@assistant-ui/react";
3
+ import { cn } from "../utils.js";
4
+ export function Thread({ empty: isEmpty, welcome, suggestions, composer, footer, children, renderMessage }) {
5
+ return (_jsx(ThreadPrimitive.Root, { className: cn("flex h-full min-h-0 min-w-0 flex-1 flex-col"), style: { ["--nxf-thread-max-width"]: "42rem" }, children: _jsxs(ThreadPrimitive.Viewport, { turnAnchor: "top", "data-slot": "aui_thread-viewport", role: "log", "aria-live": "polite", className: cn(
6
+ // The gutter is reserved whether or not a scrollbar is showing, so the
7
+ // thread and its composer do not shift sideways on the first reply
8
+ // that overflows. Only classic scrollbars take layout space, so the
9
+ // jump appears on Windows and on macOS set to always show them.
10
+ "relative flex flex-1 [scrollbar-gutter:stable_both-edges] flex-col overflow-y-auto px-4 pt-6 md:px-6", isEmpty && "justify-center"), children: [isEmpty ? welcome : null, _jsxs("div", { className: cn("mx-auto mb-12 flex w-full max-w-(--nxf-thread-max-width) flex-col gap-y-6 empty:hidden"), children: [_jsx(ThreadPrimitive.Messages, { children: renderMessage }), children] }), _jsxs(ThreadPrimitive.ViewportFooter, { className: cn("bg-background mx-auto flex w-full max-w-(--nxf-thread-max-width) flex-col gap-3 overflow-visible pb-5", !isEmpty && "sticky bottom-0 mt-auto"), children: [footer, composer, isEmpty ? suggestions : null] })] }) }));
11
+ }
12
+ //# sourceMappingURL=thread.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thread.js","sourceRoot":"","sources":["../../../src/ui/home-demo/thread.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAOjC,MAAM,UAAU,MAAM,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAe;IACrH,OAAO,CACL,KAAC,eAAe,CAAC,IAAI,IAAC,SAAS,EAAE,EAAE,CAAC,6CAA6C,CAAC,EAAG,KAAK,EAAE,EAAE,CAAC,wBAAkC,CAAC,EAAE,OAAO,EAAE,YAC3I,MAAC,eAAe,CAAC,QAAQ,IACvB,UAAU,EAAC,KAAK,eAAW,qBAAqB,EAAC,IAAI,EAAC,KAAK,eAAW,QAAQ,EAC9E,SAAS,EAAE,EAAE;YACX,uEAAuE;YACvE,mEAAmE;YACnE,oEAAoE;YACpE,gEAAgE;YAChE,sGAAsG,EACtG,OAAO,IAAI,gBAAgB,CAC5B,aAEA,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAEzB,eAAK,SAAS,EAAE,EAAE,CAAC,wFAAwF,CAAC,aAC1G,KAAC,eAAe,CAAC,QAAQ,cAAE,aAAa,GAA4B,EACnE,QAAQ,IACL,EAEN,MAAC,eAAe,CAAC,cAAc,IAC7B,SAAS,EAAE,EAAE,CACX,uGAAuG,EACvG,CAAC,OAAO,IAAI,yBAAyB,CACtC,aAEA,MAAM,EACN,QAAQ,EACR,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,IACE,IACR,GACN,CACxB,CAAC;AACJ,CAAC","sourcesContent":["// Adapted from the pinned official homepage Demo; see vendor/assistant-ui/home-demo/ADAPTATIONS.md.\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { ThreadPrimitive } from \"@assistant-ui/react\";\nimport { cn } from \"../utils.js\";\n\ntype ThreadProps = {\n empty: boolean; welcome: ReactNode; suggestions: ReactNode; composer: ReactNode;\n footer: ReactNode; children?: ReactNode;\n renderMessage: NonNullable<ComponentProps<typeof ThreadPrimitive.Messages>[\"children\"]>;\n};\nexport function Thread({ empty: isEmpty, welcome, suggestions, composer, footer, children, renderMessage }: ThreadProps) {\n return (\n <ThreadPrimitive.Root className={cn(\"flex h-full min-h-0 min-w-0 flex-1 flex-col\")} style={{ [\"--nxf-thread-max-width\" as string]: \"42rem\" }}>\n <ThreadPrimitive.Viewport\n turnAnchor=\"top\" data-slot=\"aui_thread-viewport\" role=\"log\" aria-live=\"polite\"\n className={cn(\n // The gutter is reserved whether or not a scrollbar is showing, so the\n // thread and its composer do not shift sideways on the first reply\n // that overflows. Only classic scrollbars take layout space, so the\n // jump appears on Windows and on macOS set to always show them.\n \"relative flex flex-1 [scrollbar-gutter:stable_both-edges] flex-col overflow-y-auto px-4 pt-6 md:px-6\",\n isEmpty && \"justify-center\",\n )}\n >\n {isEmpty ? welcome : null}\n\n <div className={cn(\"mx-auto mb-12 flex w-full max-w-(--nxf-thread-max-width) flex-col gap-y-6 empty:hidden\")} >\n <ThreadPrimitive.Messages>{renderMessage}</ThreadPrimitive.Messages>\n {children}\n </div>\n\n <ThreadPrimitive.ViewportFooter\n className={cn(\n \"bg-background mx-auto flex w-full max-w-(--nxf-thread-max-width) flex-col gap-3 overflow-visible pb-5\",\n !isEmpty && \"sticky bottom-0 mt-auto\",\n )}\n >\n {footer}\n {composer}\n {isEmpty ? suggestions : null}\n </ThreadPrimitive.ViewportFooter>\n </ThreadPrimitive.Viewport>\n </ThreadPrimitive.Root>\n );\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { type ReactNode } from "react";
2
+ /**
3
+ * The mark every trace line carries. A disclosure rotates it and a plain line
4
+ * does not, so the two read as the same grammar rather than two symbols; it
5
+ * stays a glyph rather than an icon because an icon on a line that cannot open
6
+ * reads as an affordance.
7
+ */
8
+ export declare function TraceMarker({ live, className, }: {
9
+ live: boolean;
10
+ className?: string;
11
+ }): ReactNode;
12
+ export declare function useToolDuration(isRunning: boolean): number | null;
13
+ export declare function formatDuration(ms: number): string;
14
+ export declare function TraceLine({ live, label, detail, meta, }: {
15
+ live: boolean;
16
+ label: string;
17
+ detail?: string;
18
+ meta?: string;
19
+ }): ReactNode;
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { ShimmerLabel } from "./surfaces.js";
5
+ import { cn } from "../utils.js";
6
+ /**
7
+ * The mark every trace line carries. A disclosure rotates it and a plain line
8
+ * does not, so the two read as the same grammar rather than two symbols; it
9
+ * stays a glyph rather than an icon because an icon on a line that cannot open
10
+ * reads as an affordance.
11
+ */
12
+ export function TraceMarker({ live, className, }) {
13
+ return (_jsx("span", { "aria-hidden": true, className: cn("inline-block shrink-0 transition-transform", live ? "text-blue-500" : "text-muted-foreground/50", className), children: ">" }));
14
+ }
15
+ export function useToolDuration(isRunning) {
16
+ const startTimeRef = useRef(null);
17
+ const [duration, setDuration] = useState(null);
18
+ useEffect(() => {
19
+ if (isRunning && startTimeRef.current === null) {
20
+ startTimeRef.current = Date.now();
21
+ setDuration(null);
22
+ }
23
+ else if (!isRunning && startTimeRef.current !== null) {
24
+ setDuration(Date.now() - startTimeRef.current);
25
+ startTimeRef.current = null;
26
+ }
27
+ }, [isRunning]);
28
+ return duration;
29
+ }
30
+ export function formatDuration(ms) {
31
+ if (ms < 1000)
32
+ return `${ms}ms`;
33
+ return `${(ms / 1000).toFixed(1)}s`;
34
+ }
35
+ export function TraceLine({ live, label, detail, meta, }) {
36
+ return (_jsxs("div", { className: cn("my-1 flex items-baseline gap-2 font-mono text-[12px] [font-variant-ligatures:none]"), children: [_jsx(TraceMarker, { live: live }), _jsx("span", { className: cn("text-muted-foreground min-w-0 flex-1 truncate"), children: live ? (_jsxs(ShimmerLabel, { children: [label, detail ? ` ${detail}` : null] })) : (_jsxs(_Fragment, { children: [label, detail ? ` ${detail}` : null] })) }), meta ? (_jsx("span", { className: cn("text-muted-foreground/50 shrink-0"), children: meta })) : null] }));
37
+ }
38
+ //# sourceMappingURL=trace-line.js.map