@oscloudlab/vgen-agent-assistant 0.0.18 → 0.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.css.br +0 -0
- package/dist/index.css.gz +0 -0
- package/dist/stats.html +1 -1
- package/dist/stats.html.br +0 -0
- package/dist/stats.html.gz +0 -0
- package/dist/types/src/components/VgenAgent/type.d.ts +6 -1
- package/dist/vgen-agent-assistant.es.js +250 -150
- package/dist/vgen-agent-assistant.es.js.br +0 -0
- package/dist/vgen-agent-assistant.es.js.gz +0 -0
- package/dist/vgen-agent-assistant.umd.js +2 -2
- package/dist/vgen-agent-assistant.umd.js.br +0 -0
- package/dist/vgen-agent-assistant.umd.js.gz +0 -0
- package/package.json +1 -1
package/dist/stats.html.br
CHANGED
|
Binary file
|
package/dist/stats.html.gz
CHANGED
|
Binary file
|
|
@@ -382,10 +382,15 @@ export interface BottomChatDockProps {
|
|
|
382
382
|
* (宿主提供挂载槽位,见 KnowledgeCard bottomDockLayout='inline' 布局)
|
|
383
383
|
*/
|
|
384
384
|
export interface BottomChatPanelProps extends BottomChatDockProps {
|
|
385
|
-
/**
|
|
385
|
+
/** 展开态面板初始列宽兼拖拽下限(number 按 px 处理),缺省 320;resizable=true 时展开态可拖拽在
|
|
386
|
+
* [width, 50vw] 区间内自由拉伸;收起态固定为左侧窄竖条,仍在布局内占位 */
|
|
386
387
|
width?: number | string;
|
|
387
388
|
/** 是否支持收起为左侧窄竖条(不提供时缺省 true,收起后仍在布局中占位) */
|
|
388
389
|
collapsible?: boolean;
|
|
390
|
+
/** 展开态右缘是否可拖拽调整宽度(缺省 true);false 时回退纯固定宽(原行为) */
|
|
391
|
+
resizable?: boolean;
|
|
392
|
+
/** 拖拽或键盘(←/→)调整宽度结束时回调最新宽度(px),宿主可据此持久化用户偏好 */
|
|
393
|
+
onWidthChange?: (width: number) => void;
|
|
389
394
|
}
|
|
390
395
|
export interface addTaskProps {
|
|
391
396
|
id?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import require$$0, { memo, useState, useEffect, useMemo, useRef, forwardRef, useImperativeHandle, useCallback } from "react";
|
|
2
2
|
import { message, Spin, Badge, Button, ConfigProvider, Modal, TimePicker, Select, Collapse, Form, Input, Checkbox, Tree, Dropdown, Tooltip, Popconfirm, Popover } from "antd";
|
|
3
|
-
import { FileText, FishSymbol, Target, GraduationCap, Video, BookOpen, Lightbulb, Code2, Search, X, RefreshCw, ArrowRight, Play, Eye, Zap, FileDiff, User, Pencil, Check, Copy, Wand2, RefreshCcw, BookOpenText, Star, GitBranch, FileCode, Trophy, MessageCircleQuestion, Sparkles,
|
|
3
|
+
import { FileText, FishSymbol, Target, GraduationCap, Video, BookOpen, Lightbulb, Code2, Search, X, RefreshCw, ArrowRight, Play, Eye, Zap, FileDiff, User, Pencil, Check, Copy, Wand2, RefreshCcw, BookOpenText, Star, GitBranch, FileCode, Trophy, MessageCircleQuestion, Sparkles, ChevronDown, ChevronUp, Paperclip, StopCircle, Send, PanelLeftClose, PanelLeftOpen, Folder, Trash2, Cookie, Plus, History, Minimize2 } from "lucide-react";
|
|
4
4
|
import pako from "pako";
|
|
5
5
|
import { twMerge } from "tailwind-merge";
|
|
6
6
|
import "moment";
|
|
@@ -15401,6 +15401,13 @@ const ThinkingContent = memo((props) => {
|
|
|
15401
15401
|
}
|
|
15402
15402
|
return content2;
|
|
15403
15403
|
}, [recommendScene]);
|
|
15404
|
+
const thinkContentRef = useRef(null);
|
|
15405
|
+
useEffect(() => {
|
|
15406
|
+
const el = thinkContentRef.current;
|
|
15407
|
+
if (el) {
|
|
15408
|
+
el.scrollTop = el.scrollHeight;
|
|
15409
|
+
}
|
|
15410
|
+
}, [thinkContent]);
|
|
15404
15411
|
const preheatContentMap = useMemo(() => {
|
|
15405
15412
|
let content2 = "";
|
|
15406
15413
|
switch (recommendScene) {
|
|
@@ -15455,7 +15462,14 @@ const ThinkingContent = memo((props) => {
|
|
|
15455
15462
|
) }),
|
|
15456
15463
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1", children: [
|
|
15457
15464
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "text-base font-black italic text-slate-900 tracking-tight", children: createingMap }),
|
|
15458
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15465
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15466
|
+
"p",
|
|
15467
|
+
{
|
|
15468
|
+
ref: thinkContentRef,
|
|
15469
|
+
className: "text-xs font-bold text-primary animate-pulse max-h-[50px] overflow-y-auto max-w-[40vw]",
|
|
15470
|
+
children: thinkContent
|
|
15471
|
+
}
|
|
15472
|
+
)
|
|
15459
15473
|
] })
|
|
15460
15474
|
] }),
|
|
15461
15475
|
preheatContentMap ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-[#FAFBFC] rounded-3xl p-6 border border-border/40 relative group overflow-hidden", children: [
|
|
@@ -18427,17 +18441,17 @@ const GENERAL_CHIPS = [
|
|
|
18427
18441
|
mode: "prefill",
|
|
18428
18442
|
fill: "我想问一下:"
|
|
18429
18443
|
},
|
|
18430
|
-
{
|
|
18431
|
-
|
|
18432
|
-
|
|
18433
|
-
|
|
18434
|
-
|
|
18435
|
-
},
|
|
18444
|
+
// {
|
|
18445
|
+
// icon: ListChecks,
|
|
18446
|
+
// label: '再出几题',
|
|
18447
|
+
// mode: 'prefill',
|
|
18448
|
+
// fill: '再出3道问答题',
|
|
18449
|
+
// },
|
|
18436
18450
|
{
|
|
18437
18451
|
icon: Sparkles,
|
|
18438
18452
|
label: "润色全文",
|
|
18439
18453
|
mode: "prefill",
|
|
18440
|
-
fill: "
|
|
18454
|
+
fill: "帮我润色一下知识文本讲解,改成通俗版"
|
|
18441
18455
|
}
|
|
18442
18456
|
];
|
|
18443
18457
|
const detectIntent = (text2) => {
|
|
@@ -18675,6 +18689,18 @@ const BottomChatDock = (props) => {
|
|
|
18675
18689
|
) });
|
|
18676
18690
|
};
|
|
18677
18691
|
const COLLAPSED_WIDTH = 52;
|
|
18692
|
+
const RESIZE_KEY_STEP = 16;
|
|
18693
|
+
const resolveMinWidth = (width) => {
|
|
18694
|
+
if (typeof width === "number") return width > 0 ? width : null;
|
|
18695
|
+
const w = width.trim();
|
|
18696
|
+
let m = /^(\d+(?:\.\d+)?)px$/.exec(w);
|
|
18697
|
+
if (m) return Number(m[1]);
|
|
18698
|
+
m = /^(\d+(?:\.\d+)?)$/.exec(w);
|
|
18699
|
+
if (m) return Number(m[1]);
|
|
18700
|
+
m = /^(\d+(?:\.\d+)?)%$/.exec(w);
|
|
18701
|
+
if (m) return Number(m[1]) / 100 * window.innerWidth;
|
|
18702
|
+
return null;
|
|
18703
|
+
};
|
|
18678
18704
|
const BottomChatPanel = (props) => {
|
|
18679
18705
|
const {
|
|
18680
18706
|
state = "fresh",
|
|
@@ -18691,10 +18717,57 @@ const BottomChatPanel = (props) => {
|
|
|
18691
18717
|
onClearQuote,
|
|
18692
18718
|
customDiffViewer,
|
|
18693
18719
|
width = 320,
|
|
18694
|
-
collapsible = true
|
|
18720
|
+
collapsible = true,
|
|
18721
|
+
resizable = true,
|
|
18722
|
+
onWidthChange
|
|
18695
18723
|
} = props;
|
|
18696
18724
|
const expandedOpen = collapsible ? open : true;
|
|
18697
|
-
const
|
|
18725
|
+
const [dragWidth, setDragWidth] = useState(null);
|
|
18726
|
+
const [resizing, setResizing] = useState(false);
|
|
18727
|
+
const panelRef = useRef(null);
|
|
18728
|
+
const resizeRef = useRef(null);
|
|
18729
|
+
const panelWidth = dragWidth !== null ? `${Math.round(dragWidth)}px` : typeof width === "number" ? `${width}px` : width;
|
|
18730
|
+
const applyDragWidth = (next) => {
|
|
18731
|
+
var _a;
|
|
18732
|
+
const min = ((_a = resizeRef.current) == null ? void 0 : _a.min) ?? resolveMinWidth(width);
|
|
18733
|
+
const clamped = Math.max(min ?? next, Math.min(next, window.innerWidth / 2));
|
|
18734
|
+
setDragWidth(clamped);
|
|
18735
|
+
if (resizeRef.current) resizeRef.current.applied = clamped;
|
|
18736
|
+
return clamped;
|
|
18737
|
+
};
|
|
18738
|
+
const handleResizeDown = (e) => {
|
|
18739
|
+
var _a;
|
|
18740
|
+
if (e.button !== 0) return;
|
|
18741
|
+
const startWidth = ((_a = panelRef.current) == null ? void 0 : _a.getBoundingClientRect().width) ?? 0;
|
|
18742
|
+
resizeRef.current = { startX: e.clientX, startWidth, min: resolveMinWidth(width), applied: startWidth };
|
|
18743
|
+
setResizing(true);
|
|
18744
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
18745
|
+
document.body.style.userSelect = "none";
|
|
18746
|
+
document.body.style.cursor = "col-resize";
|
|
18747
|
+
};
|
|
18748
|
+
const handleResizeMove = (e) => {
|
|
18749
|
+
const st = resizeRef.current;
|
|
18750
|
+
if (!st) return;
|
|
18751
|
+
applyDragWidth(st.startWidth + (e.clientX - st.startX));
|
|
18752
|
+
};
|
|
18753
|
+
const handleResizeEnd = (e) => {
|
|
18754
|
+
const st = resizeRef.current;
|
|
18755
|
+
if (!st) return;
|
|
18756
|
+
resizeRef.current = null;
|
|
18757
|
+
setResizing(false);
|
|
18758
|
+
if (e.currentTarget.hasPointerCapture(e.pointerId)) e.currentTarget.releasePointerCapture(e.pointerId);
|
|
18759
|
+
document.body.style.userSelect = "";
|
|
18760
|
+
document.body.style.cursor = "";
|
|
18761
|
+
onWidthChange == null ? void 0 : onWidthChange(st.applied);
|
|
18762
|
+
};
|
|
18763
|
+
const handleResizeKeyDown = (e) => {
|
|
18764
|
+
var _a;
|
|
18765
|
+
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
18766
|
+
e.preventDefault();
|
|
18767
|
+
const current = dragWidth ?? ((_a = panelRef.current) == null ? void 0 : _a.getBoundingClientRect().width) ?? 0;
|
|
18768
|
+
const clamped = applyDragWidth(current + (e.key === "ArrowRight" ? RESIZE_KEY_STEP : -RESIZE_KEY_STEP));
|
|
18769
|
+
onWidthChange == null ? void 0 : onWidthChange(clamped);
|
|
18770
|
+
};
|
|
18698
18771
|
const [input, setInput] = useState("");
|
|
18699
18772
|
const scrollRef = useRef(null);
|
|
18700
18773
|
const inputRef = useRef(null);
|
|
@@ -18724,171 +18797,198 @@ const BottomChatPanel = (props) => {
|
|
|
18724
18797
|
};
|
|
18725
18798
|
return (
|
|
18726
18799
|
/* 流内常驻块:左侧竖版面板,高度撑满宿主槽位(h-full),宽度参与动画 */
|
|
18727
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
18800
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18728
18801
|
motion.div,
|
|
18729
18802
|
{
|
|
18803
|
+
ref: panelRef,
|
|
18730
18804
|
initial: false,
|
|
18731
18805
|
animate: { width: expandedOpen ? panelWidth : `${COLLAPSED_WIDTH}px` },
|
|
18732
|
-
transition: { duration: 0.24, ease: "easeOut" },
|
|
18806
|
+
transition: { duration: resizing ? 0 : 0.24, ease: "easeOut" },
|
|
18733
18807
|
className: "relative h-full shrink-0 overflow-hidden border-r border-slate-200/90 bg-white",
|
|
18734
|
-
children:
|
|
18735
|
-
|
|
18736
|
-
|
|
18737
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex
|
|
18738
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
18739
|
-
|
|
18740
|
-
|
|
18741
|
-
|
|
18808
|
+
children: [
|
|
18809
|
+
expandedOpen ? (
|
|
18810
|
+
/* ==================== 展开态:完整侧栏面板(内容固定宽,动画期随外层裁剪显露) ==================== */
|
|
18811
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { width: panelWidth }, className: "flex h-full flex-col", children: [
|
|
18812
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex shrink-0 items-center gap-2.5 px-3.5 py-3", children: [
|
|
18813
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { "aria-hidden": true, className: "h-9 w-9 shrink-0 overflow-hidden rounded-full ring-1 ring-primary/15", children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: COOKIE_AVATAR, alt: "", className: "h-full w-full object-cover" }) }),
|
|
18814
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "min-w-0 flex-1 truncate text-[13px] font-black text-slate-800", children: "饼干 · AI 学伴" }),
|
|
18815
|
+
collapsible && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18816
|
+
"button",
|
|
18817
|
+
{
|
|
18818
|
+
type: "button",
|
|
18819
|
+
onClick: () => onOpenChange(false),
|
|
18820
|
+
title: "收起为窄条",
|
|
18821
|
+
"aria-label": "收起 AI 学伴面板",
|
|
18822
|
+
className: "shrink-0 rounded-lg p-1.5 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600",
|
|
18823
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(PanelLeftClose, { className: "h-4 w-4" })
|
|
18824
|
+
}
|
|
18825
|
+
)
|
|
18826
|
+
] }),
|
|
18827
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18828
|
+
"div",
|
|
18742
18829
|
{
|
|
18743
|
-
|
|
18744
|
-
|
|
18745
|
-
|
|
18746
|
-
|
|
18747
|
-
|
|
18748
|
-
|
|
18830
|
+
ref: scrollRef,
|
|
18831
|
+
className: "no-scrollbar min-h-0 flex-1 space-y-3 overflow-y-auto px-3.5 pb-2 pt-1",
|
|
18832
|
+
children: messages.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2.5 pt-1", children: [
|
|
18833
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18834
|
+
"img",
|
|
18835
|
+
{
|
|
18836
|
+
src: COOKIE_AVATAR,
|
|
18837
|
+
alt: "",
|
|
18838
|
+
"aria-hidden": true,
|
|
18839
|
+
className: "mt-0.5 h-7 w-7 shrink-0 rounded-full object-cover ring-1 ring-primary/15"
|
|
18840
|
+
}
|
|
18841
|
+
),
|
|
18842
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "rounded-2xl rounded-tl-md bg-slate-100 px-3.5 py-2.5 text-[12px] font-bold leading-relaxed text-slate-600", children: "想怎么调整?或者有问题都可以问我~" })
|
|
18843
|
+
] }) : (
|
|
18844
|
+
/* 消息渲染与主聊天统一,全部由 MessageContent 组件承载 */
|
|
18845
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18846
|
+
MessageContent$1,
|
|
18847
|
+
{
|
|
18848
|
+
messages,
|
|
18849
|
+
answerIsDone,
|
|
18850
|
+
isDev,
|
|
18851
|
+
userInfo,
|
|
18852
|
+
handleSend: ({ input: input2 }) => onSend(input2),
|
|
18853
|
+
customDiffViewer
|
|
18854
|
+
}
|
|
18855
|
+
)
|
|
18856
|
+
)
|
|
18749
18857
|
}
|
|
18750
|
-
)
|
|
18751
|
-
|
|
18752
|
-
|
|
18753
|
-
|
|
18858
|
+
),
|
|
18859
|
+
quote && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "shrink-0 px-3.5 pb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 rounded-xl bg-primary/5 px-3 py-2", children: [
|
|
18860
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Paperclip, { className: "h-3 w-3 shrink-0 text-primary" }),
|
|
18861
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "shrink-0 text-[10px] font-black text-primary", children: "引用" }),
|
|
18862
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "min-w-0 flex-1 truncate text-[11px] font-bold text-slate-600", children: [
|
|
18863
|
+
'"',
|
|
18864
|
+
quote,
|
|
18865
|
+
'"'
|
|
18866
|
+
] }),
|
|
18867
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18868
|
+
"button",
|
|
18869
|
+
{
|
|
18870
|
+
type: "button",
|
|
18871
|
+
onClick: onClearQuote,
|
|
18872
|
+
"aria-label": "取消引用",
|
|
18873
|
+
className: "shrink-0 rounded-md p-0.5 text-slate-400 transition-colors hover:text-rose-500",
|
|
18874
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "h-3.5 w-3.5" })
|
|
18875
|
+
}
|
|
18876
|
+
)
|
|
18877
|
+
] }) }),
|
|
18878
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "shrink-0 px-3.5 pb-2", children: [
|
|
18879
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mb-2 text-[10px] font-black uppercase tracking-widest text-muted-foreground", children: "你可以" }),
|
|
18880
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-1.5", children: (quote ? QUOTE_CHIPS : GENERAL_CHIPS).map((c) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18881
|
+
"button",
|
|
18882
|
+
{
|
|
18883
|
+
type: "button",
|
|
18884
|
+
onClick: () => handleChipClick(c),
|
|
18885
|
+
className: "flex items-center gap-2 rounded-xl bg-slate-50 px-2.5 py-1.5 text-[11px] font-bold text-slate-600 ring-1 ring-slate-200/70 transition-colors hover:bg-primary-50 hover:text-primary",
|
|
18886
|
+
children: [
|
|
18887
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(c.icon, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
18888
|
+
c.label
|
|
18889
|
+
]
|
|
18890
|
+
},
|
|
18891
|
+
c.label
|
|
18892
|
+
)) })
|
|
18893
|
+
] }),
|
|
18894
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "shrink-0 px-3.5 pb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-2xl bg-slate-50 p-1.5 ring-1 ring-slate-200/80 transition-shadow focus-within:bg-white focus-within:ring-2 focus-within:ring-primary/30", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-end gap-1.5", children: [
|
|
18895
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18896
|
+
"input",
|
|
18897
|
+
{
|
|
18898
|
+
ref: inputRef,
|
|
18899
|
+
value: input,
|
|
18900
|
+
onChange: (e) => setInput(e.target.value),
|
|
18901
|
+
onKeyDown: (e) => {
|
|
18902
|
+
if (e.key !== "Enter") return;
|
|
18903
|
+
if (e.shiftKey) return;
|
|
18904
|
+
submit();
|
|
18905
|
+
},
|
|
18906
|
+
placeholder: quote ? "针对这段提问,或说想怎么改..." : "描述你想怎么调,或问我任何问题...",
|
|
18907
|
+
"aria-label": "输入你想问的问题或想做的调整",
|
|
18908
|
+
className: "h-9 w-full border-0 bg-transparent px-2.5 text-[12px] font-bold outline-none placeholder:font-bold placeholder:text-slate-400"
|
|
18909
|
+
}
|
|
18910
|
+
),
|
|
18911
|
+
!answerIsDone && onStopAnswer ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18912
|
+
"button",
|
|
18913
|
+
{
|
|
18914
|
+
type: "button",
|
|
18915
|
+
onClick: onStopAnswer,
|
|
18916
|
+
title: "停止回答",
|
|
18917
|
+
"aria-label": "停止回答",
|
|
18918
|
+
className: "h-9 w-9 shrink-0 rounded-xl bg-primary text-white shadow-glow transition-all hover:bg-primary/80",
|
|
18919
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(StopCircle, { className: "mx-auto h-4 w-4" })
|
|
18920
|
+
}
|
|
18921
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18922
|
+
"button",
|
|
18923
|
+
{
|
|
18924
|
+
type: "button",
|
|
18925
|
+
onClick: submit,
|
|
18926
|
+
disabled: !input.trim(),
|
|
18927
|
+
"aria-label": "发送",
|
|
18928
|
+
className: "h-9 w-9 shrink-0 rounded-xl bg-primary text-white shadow-glow transition-all hover:bg-primary-700 disabled:bg-slate-200 disabled:text-slate-400 disabled:shadow-none",
|
|
18929
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "mx-auto h-4 w-4" })
|
|
18930
|
+
}
|
|
18931
|
+
)
|
|
18932
|
+
] }) }) })
|
|
18933
|
+
] })
|
|
18934
|
+
) : (
|
|
18935
|
+
/* ==================== 收起态:左侧窄竖条把手(仍在布局内占位) ==================== */
|
|
18936
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18937
|
+
"button",
|
|
18754
18938
|
{
|
|
18755
|
-
|
|
18756
|
-
|
|
18757
|
-
|
|
18939
|
+
type: "button",
|
|
18940
|
+
onClick: () => onOpenChange(true),
|
|
18941
|
+
title: dockHint(state),
|
|
18942
|
+
"aria-label": "展开 AI 学伴面板",
|
|
18943
|
+
className: "flex h-full w-[52px] flex-col items-center gap-3 py-3 transition-colors hover:bg-slate-50",
|
|
18944
|
+
children: [
|
|
18758
18945
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18759
18946
|
"img",
|
|
18760
18947
|
{
|
|
18761
18948
|
src: COOKIE_AVATAR,
|
|
18762
18949
|
alt: "",
|
|
18763
18950
|
"aria-hidden": true,
|
|
18764
|
-
className: "
|
|
18951
|
+
className: "h-9 w-9 shrink-0 rounded-full object-cover ring-1 ring-primary/15"
|
|
18765
18952
|
}
|
|
18766
18953
|
),
|
|
18767
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18768
|
-
] }) : (
|
|
18769
|
-
/* 消息渲染与主聊天统一,全部由 MessageContent 组件承载 */
|
|
18954
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(PanelLeftOpen, { className: "h-4 w-4 shrink-0 text-slate-400" }),
|
|
18770
18955
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18771
|
-
|
|
18956
|
+
"span",
|
|
18772
18957
|
{
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
userInfo,
|
|
18777
|
-
handleSend: ({ input: input2 }) => onSend(input2),
|
|
18778
|
-
customDiffViewer
|
|
18958
|
+
className: "text-[11px] font-black tracking-widest text-slate-500",
|
|
18959
|
+
style: { writingMode: "vertical-rl" },
|
|
18960
|
+
children: "饼干 · AI 学伴"
|
|
18779
18961
|
}
|
|
18780
18962
|
)
|
|
18781
|
-
|
|
18963
|
+
]
|
|
18782
18964
|
}
|
|
18783
|
-
)
|
|
18784
|
-
|
|
18785
|
-
|
|
18786
|
-
|
|
18787
|
-
|
|
18788
|
-
|
|
18789
|
-
|
|
18790
|
-
|
|
18791
|
-
|
|
18792
|
-
|
|
18793
|
-
|
|
18794
|
-
|
|
18795
|
-
|
|
18796
|
-
|
|
18797
|
-
|
|
18798
|
-
|
|
18799
|
-
|
|
18800
|
-
|
|
18801
|
-
|
|
18802
|
-
] }) }),
|
|
18803
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "shrink-0 px-3.5 pb-2", children: [
|
|
18804
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mb-2 text-[10px] font-black uppercase tracking-widest text-muted-foreground", children: "你可以" }),
|
|
18805
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 gap-1.5", children: (quote ? QUOTE_CHIPS : GENERAL_CHIPS).map((c) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18806
|
-
"button",
|
|
18807
|
-
{
|
|
18808
|
-
type: "button",
|
|
18809
|
-
onClick: () => handleChipClick(c),
|
|
18810
|
-
className: "flex items-center gap-2 rounded-xl bg-slate-50 px-2.5 py-1.5 text-[11px] font-bold text-slate-600 ring-1 ring-slate-200/70 transition-colors hover:bg-primary-50 hover:text-primary",
|
|
18811
|
-
children: [
|
|
18812
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(c.icon, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
18813
|
-
c.label
|
|
18814
|
-
]
|
|
18815
|
-
},
|
|
18816
|
-
c.label
|
|
18817
|
-
)) })
|
|
18818
|
-
] }),
|
|
18819
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "shrink-0 px-3.5 pb-4", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-2xl bg-slate-50 p-1.5 ring-1 ring-slate-200/80 transition-shadow focus-within:bg-white focus-within:ring-2 focus-within:ring-primary/30", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-end gap-1.5", children: [
|
|
18820
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18821
|
-
"input",
|
|
18822
|
-
{
|
|
18823
|
-
ref: inputRef,
|
|
18824
|
-
value: input,
|
|
18825
|
-
onChange: (e) => setInput(e.target.value),
|
|
18826
|
-
onKeyDown: (e) => {
|
|
18827
|
-
if (e.key !== "Enter") return;
|
|
18828
|
-
if (e.shiftKey) return;
|
|
18829
|
-
submit();
|
|
18830
|
-
},
|
|
18831
|
-
placeholder: quote ? "针对这段提问,或说想怎么改..." : "描述你想怎么调,或问我任何问题...",
|
|
18832
|
-
"aria-label": "输入你想问的问题或想做的调整",
|
|
18833
|
-
className: "h-9 w-full border-0 bg-transparent px-2.5 text-[12px] font-bold outline-none placeholder:font-bold placeholder:text-slate-400"
|
|
18834
|
-
}
|
|
18835
|
-
),
|
|
18836
|
-
!answerIsDone && onStopAnswer ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18837
|
-
"button",
|
|
18838
|
-
{
|
|
18839
|
-
type: "button",
|
|
18840
|
-
onClick: onStopAnswer,
|
|
18841
|
-
title: "停止回答",
|
|
18842
|
-
"aria-label": "停止回答",
|
|
18843
|
-
className: "h-9 w-9 shrink-0 rounded-xl bg-primary text-white shadow-glow transition-all hover:bg-primary/80",
|
|
18844
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(StopCircle, { className: "mx-auto h-4 w-4" })
|
|
18845
|
-
}
|
|
18846
|
-
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18847
|
-
"button",
|
|
18965
|
+
)
|
|
18966
|
+
),
|
|
18967
|
+
expandedOpen && resizable && /* ==================== 右缘拖拽把手:4px 命中区,hover/拖动/聚焦竖条转主题色 ==================== */
|
|
18968
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18969
|
+
"div",
|
|
18970
|
+
{
|
|
18971
|
+
role: "separator",
|
|
18972
|
+
"aria-orientation": "vertical",
|
|
18973
|
+
"aria-label": "拖拽调整 AI 学伴面板宽度",
|
|
18974
|
+
title: "拖拽调整面板宽度",
|
|
18975
|
+
tabIndex: 0,
|
|
18976
|
+
className: "group absolute inset-y-0 right-0 z-10 w-1 cursor-col-resize outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
|
|
18977
|
+
onPointerDown: handleResizeDown,
|
|
18978
|
+
onPointerMove: handleResizeMove,
|
|
18979
|
+
onPointerUp: handleResizeEnd,
|
|
18980
|
+
onPointerCancel: handleResizeEnd,
|
|
18981
|
+
onKeyDown: handleResizeKeyDown,
|
|
18982
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18983
|
+
"span",
|
|
18848
18984
|
{
|
|
18849
|
-
|
|
18850
|
-
|
|
18851
|
-
disabled: !input.trim(),
|
|
18852
|
-
"aria-label": "发送",
|
|
18853
|
-
className: "h-9 w-9 shrink-0 rounded-xl bg-primary text-white shadow-glow transition-all hover:bg-primary-700 disabled:bg-slate-200 disabled:text-slate-400 disabled:shadow-none",
|
|
18854
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "mx-auto h-4 w-4" })
|
|
18985
|
+
"aria-hidden": true,
|
|
18986
|
+
className: `absolute inset-y-0 left-1/2 w-0.5 -translate-x-1/2 rounded-full transition-colors ${resizing ? "bg-primary" : "bg-slate-200 group-hover:bg-primary/70 group-focus-visible:bg-primary/70"}`
|
|
18855
18987
|
}
|
|
18856
18988
|
)
|
|
18857
|
-
] }) }) })
|
|
18858
|
-
] })
|
|
18859
|
-
) : (
|
|
18860
|
-
/* ==================== 收起态:左侧窄竖条把手(仍在布局内占位) ==================== */
|
|
18861
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18862
|
-
"button",
|
|
18863
|
-
{
|
|
18864
|
-
type: "button",
|
|
18865
|
-
onClick: () => onOpenChange(true),
|
|
18866
|
-
title: dockHint(state),
|
|
18867
|
-
"aria-label": "展开 AI 学伴面板",
|
|
18868
|
-
className: "flex h-full w-[52px] flex-col items-center gap-3 py-3 transition-colors hover:bg-slate-50",
|
|
18869
|
-
children: [
|
|
18870
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18871
|
-
"img",
|
|
18872
|
-
{
|
|
18873
|
-
src: COOKIE_AVATAR,
|
|
18874
|
-
alt: "",
|
|
18875
|
-
"aria-hidden": true,
|
|
18876
|
-
className: "h-9 w-9 shrink-0 rounded-full object-cover ring-1 ring-primary/15"
|
|
18877
|
-
}
|
|
18878
|
-
),
|
|
18879
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(PanelLeftOpen, { className: "h-4 w-4 shrink-0 text-slate-400" }),
|
|
18880
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18881
|
-
"span",
|
|
18882
|
-
{
|
|
18883
|
-
className: "text-[11px] font-black tracking-widest text-slate-500",
|
|
18884
|
-
style: { writingMode: "vertical-rl" },
|
|
18885
|
-
children: "饼干 · AI 学伴"
|
|
18886
|
-
}
|
|
18887
|
-
)
|
|
18888
|
-
]
|
|
18889
18989
|
}
|
|
18890
18990
|
)
|
|
18891
|
-
|
|
18991
|
+
]
|
|
18892
18992
|
}
|
|
18893
18993
|
)
|
|
18894
18994
|
);
|
|
Binary file
|
|
Binary file
|