@oscloudlab/vgen-agent-assistant 0.0.18 → 0.0.19
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 +235 -149
- 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";
|
|
@@ -18427,17 +18427,17 @@ const GENERAL_CHIPS = [
|
|
|
18427
18427
|
mode: "prefill",
|
|
18428
18428
|
fill: "我想问一下:"
|
|
18429
18429
|
},
|
|
18430
|
-
{
|
|
18431
|
-
|
|
18432
|
-
|
|
18433
|
-
|
|
18434
|
-
|
|
18435
|
-
},
|
|
18430
|
+
// {
|
|
18431
|
+
// icon: ListChecks,
|
|
18432
|
+
// label: '再出几题',
|
|
18433
|
+
// mode: 'prefill',
|
|
18434
|
+
// fill: '再出3道问答题',
|
|
18435
|
+
// },
|
|
18436
18436
|
{
|
|
18437
18437
|
icon: Sparkles,
|
|
18438
18438
|
label: "润色全文",
|
|
18439
18439
|
mode: "prefill",
|
|
18440
|
-
fill: "
|
|
18440
|
+
fill: "帮我润色一下知识文本讲解,改成通俗版"
|
|
18441
18441
|
}
|
|
18442
18442
|
];
|
|
18443
18443
|
const detectIntent = (text2) => {
|
|
@@ -18675,6 +18675,18 @@ const BottomChatDock = (props) => {
|
|
|
18675
18675
|
) });
|
|
18676
18676
|
};
|
|
18677
18677
|
const COLLAPSED_WIDTH = 52;
|
|
18678
|
+
const RESIZE_KEY_STEP = 16;
|
|
18679
|
+
const resolveMinWidth = (width) => {
|
|
18680
|
+
if (typeof width === "number") return width > 0 ? width : null;
|
|
18681
|
+
const w = width.trim();
|
|
18682
|
+
let m = /^(\d+(?:\.\d+)?)px$/.exec(w);
|
|
18683
|
+
if (m) return Number(m[1]);
|
|
18684
|
+
m = /^(\d+(?:\.\d+)?)$/.exec(w);
|
|
18685
|
+
if (m) return Number(m[1]);
|
|
18686
|
+
m = /^(\d+(?:\.\d+)?)%$/.exec(w);
|
|
18687
|
+
if (m) return Number(m[1]) / 100 * window.innerWidth;
|
|
18688
|
+
return null;
|
|
18689
|
+
};
|
|
18678
18690
|
const BottomChatPanel = (props) => {
|
|
18679
18691
|
const {
|
|
18680
18692
|
state = "fresh",
|
|
@@ -18691,10 +18703,57 @@ const BottomChatPanel = (props) => {
|
|
|
18691
18703
|
onClearQuote,
|
|
18692
18704
|
customDiffViewer,
|
|
18693
18705
|
width = 320,
|
|
18694
|
-
collapsible = true
|
|
18706
|
+
collapsible = true,
|
|
18707
|
+
resizable = true,
|
|
18708
|
+
onWidthChange
|
|
18695
18709
|
} = props;
|
|
18696
18710
|
const expandedOpen = collapsible ? open : true;
|
|
18697
|
-
const
|
|
18711
|
+
const [dragWidth, setDragWidth] = useState(null);
|
|
18712
|
+
const [resizing, setResizing] = useState(false);
|
|
18713
|
+
const panelRef = useRef(null);
|
|
18714
|
+
const resizeRef = useRef(null);
|
|
18715
|
+
const panelWidth = dragWidth !== null ? `${Math.round(dragWidth)}px` : typeof width === "number" ? `${width}px` : width;
|
|
18716
|
+
const applyDragWidth = (next) => {
|
|
18717
|
+
var _a;
|
|
18718
|
+
const min = ((_a = resizeRef.current) == null ? void 0 : _a.min) ?? resolveMinWidth(width);
|
|
18719
|
+
const clamped = Math.max(min ?? next, Math.min(next, window.innerWidth / 2));
|
|
18720
|
+
setDragWidth(clamped);
|
|
18721
|
+
if (resizeRef.current) resizeRef.current.applied = clamped;
|
|
18722
|
+
return clamped;
|
|
18723
|
+
};
|
|
18724
|
+
const handleResizeDown = (e) => {
|
|
18725
|
+
var _a;
|
|
18726
|
+
if (e.button !== 0) return;
|
|
18727
|
+
const startWidth = ((_a = panelRef.current) == null ? void 0 : _a.getBoundingClientRect().width) ?? 0;
|
|
18728
|
+
resizeRef.current = { startX: e.clientX, startWidth, min: resolveMinWidth(width), applied: startWidth };
|
|
18729
|
+
setResizing(true);
|
|
18730
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
18731
|
+
document.body.style.userSelect = "none";
|
|
18732
|
+
document.body.style.cursor = "col-resize";
|
|
18733
|
+
};
|
|
18734
|
+
const handleResizeMove = (e) => {
|
|
18735
|
+
const st = resizeRef.current;
|
|
18736
|
+
if (!st) return;
|
|
18737
|
+
applyDragWidth(st.startWidth + (e.clientX - st.startX));
|
|
18738
|
+
};
|
|
18739
|
+
const handleResizeEnd = (e) => {
|
|
18740
|
+
const st = resizeRef.current;
|
|
18741
|
+
if (!st) return;
|
|
18742
|
+
resizeRef.current = null;
|
|
18743
|
+
setResizing(false);
|
|
18744
|
+
if (e.currentTarget.hasPointerCapture(e.pointerId)) e.currentTarget.releasePointerCapture(e.pointerId);
|
|
18745
|
+
document.body.style.userSelect = "";
|
|
18746
|
+
document.body.style.cursor = "";
|
|
18747
|
+
onWidthChange == null ? void 0 : onWidthChange(st.applied);
|
|
18748
|
+
};
|
|
18749
|
+
const handleResizeKeyDown = (e) => {
|
|
18750
|
+
var _a;
|
|
18751
|
+
if (e.key !== "ArrowLeft" && e.key !== "ArrowRight") return;
|
|
18752
|
+
e.preventDefault();
|
|
18753
|
+
const current = dragWidth ?? ((_a = panelRef.current) == null ? void 0 : _a.getBoundingClientRect().width) ?? 0;
|
|
18754
|
+
const clamped = applyDragWidth(current + (e.key === "ArrowRight" ? RESIZE_KEY_STEP : -RESIZE_KEY_STEP));
|
|
18755
|
+
onWidthChange == null ? void 0 : onWidthChange(clamped);
|
|
18756
|
+
};
|
|
18698
18757
|
const [input, setInput] = useState("");
|
|
18699
18758
|
const scrollRef = useRef(null);
|
|
18700
18759
|
const inputRef = useRef(null);
|
|
@@ -18724,171 +18783,198 @@ const BottomChatPanel = (props) => {
|
|
|
18724
18783
|
};
|
|
18725
18784
|
return (
|
|
18726
18785
|
/* 流内常驻块:左侧竖版面板,高度撑满宿主槽位(h-full),宽度参与动画 */
|
|
18727
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
18786
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18728
18787
|
motion.div,
|
|
18729
18788
|
{
|
|
18789
|
+
ref: panelRef,
|
|
18730
18790
|
initial: false,
|
|
18731
18791
|
animate: { width: expandedOpen ? panelWidth : `${COLLAPSED_WIDTH}px` },
|
|
18732
|
-
transition: { duration: 0.24, ease: "easeOut" },
|
|
18792
|
+
transition: { duration: resizing ? 0 : 0.24, ease: "easeOut" },
|
|
18733
18793
|
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
|
-
|
|
18794
|
+
children: [
|
|
18795
|
+
expandedOpen ? (
|
|
18796
|
+
/* ==================== 展开态:完整侧栏面板(内容固定宽,动画期随外层裁剪显露) ==================== */
|
|
18797
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { width: panelWidth }, className: "flex h-full flex-col", children: [
|
|
18798
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex shrink-0 items-center gap-2.5 px-3.5 py-3", children: [
|
|
18799
|
+
/* @__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" }) }),
|
|
18800
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "min-w-0 flex-1 truncate text-[13px] font-black text-slate-800", children: "饼干 · AI 学伴" }),
|
|
18801
|
+
collapsible && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18802
|
+
"button",
|
|
18803
|
+
{
|
|
18804
|
+
type: "button",
|
|
18805
|
+
onClick: () => onOpenChange(false),
|
|
18806
|
+
title: "收起为窄条",
|
|
18807
|
+
"aria-label": "收起 AI 学伴面板",
|
|
18808
|
+
className: "shrink-0 rounded-lg p-1.5 text-slate-400 transition-colors hover:bg-slate-100 hover:text-slate-600",
|
|
18809
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(PanelLeftClose, { className: "h-4 w-4" })
|
|
18810
|
+
}
|
|
18811
|
+
)
|
|
18812
|
+
] }),
|
|
18813
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18814
|
+
"div",
|
|
18742
18815
|
{
|
|
18743
|
-
|
|
18744
|
-
|
|
18745
|
-
|
|
18746
|
-
|
|
18747
|
-
|
|
18748
|
-
|
|
18816
|
+
ref: scrollRef,
|
|
18817
|
+
className: "no-scrollbar min-h-0 flex-1 space-y-3 overflow-y-auto px-3.5 pb-2 pt-1",
|
|
18818
|
+
children: messages.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2.5 pt-1", children: [
|
|
18819
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18820
|
+
"img",
|
|
18821
|
+
{
|
|
18822
|
+
src: COOKIE_AVATAR,
|
|
18823
|
+
alt: "",
|
|
18824
|
+
"aria-hidden": true,
|
|
18825
|
+
className: "mt-0.5 h-7 w-7 shrink-0 rounded-full object-cover ring-1 ring-primary/15"
|
|
18826
|
+
}
|
|
18827
|
+
),
|
|
18828
|
+
/* @__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: "想怎么调整?或者有问题都可以问我~" })
|
|
18829
|
+
] }) : (
|
|
18830
|
+
/* 消息渲染与主聊天统一,全部由 MessageContent 组件承载 */
|
|
18831
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18832
|
+
MessageContent$1,
|
|
18833
|
+
{
|
|
18834
|
+
messages,
|
|
18835
|
+
answerIsDone,
|
|
18836
|
+
isDev,
|
|
18837
|
+
userInfo,
|
|
18838
|
+
handleSend: ({ input: input2 }) => onSend(input2),
|
|
18839
|
+
customDiffViewer
|
|
18840
|
+
}
|
|
18841
|
+
)
|
|
18842
|
+
)
|
|
18749
18843
|
}
|
|
18750
|
-
)
|
|
18751
|
-
|
|
18752
|
-
|
|
18753
|
-
|
|
18844
|
+
),
|
|
18845
|
+
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: [
|
|
18846
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Paperclip, { className: "h-3 w-3 shrink-0 text-primary" }),
|
|
18847
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "shrink-0 text-[10px] font-black text-primary", children: "引用" }),
|
|
18848
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "min-w-0 flex-1 truncate text-[11px] font-bold text-slate-600", children: [
|
|
18849
|
+
'"',
|
|
18850
|
+
quote,
|
|
18851
|
+
'"'
|
|
18852
|
+
] }),
|
|
18853
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18854
|
+
"button",
|
|
18855
|
+
{
|
|
18856
|
+
type: "button",
|
|
18857
|
+
onClick: onClearQuote,
|
|
18858
|
+
"aria-label": "取消引用",
|
|
18859
|
+
className: "shrink-0 rounded-md p-0.5 text-slate-400 transition-colors hover:text-rose-500",
|
|
18860
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "h-3.5 w-3.5" })
|
|
18861
|
+
}
|
|
18862
|
+
)
|
|
18863
|
+
] }) }),
|
|
18864
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "shrink-0 px-3.5 pb-2", children: [
|
|
18865
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mb-2 text-[10px] font-black uppercase tracking-widest text-muted-foreground", children: "你可以" }),
|
|
18866
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-1.5", children: (quote ? QUOTE_CHIPS : GENERAL_CHIPS).map((c) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18867
|
+
"button",
|
|
18868
|
+
{
|
|
18869
|
+
type: "button",
|
|
18870
|
+
onClick: () => handleChipClick(c),
|
|
18871
|
+
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",
|
|
18872
|
+
children: [
|
|
18873
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(c.icon, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
18874
|
+
c.label
|
|
18875
|
+
]
|
|
18876
|
+
},
|
|
18877
|
+
c.label
|
|
18878
|
+
)) })
|
|
18879
|
+
] }),
|
|
18880
|
+
/* @__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: [
|
|
18881
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18882
|
+
"input",
|
|
18883
|
+
{
|
|
18884
|
+
ref: inputRef,
|
|
18885
|
+
value: input,
|
|
18886
|
+
onChange: (e) => setInput(e.target.value),
|
|
18887
|
+
onKeyDown: (e) => {
|
|
18888
|
+
if (e.key !== "Enter") return;
|
|
18889
|
+
if (e.shiftKey) return;
|
|
18890
|
+
submit();
|
|
18891
|
+
},
|
|
18892
|
+
placeholder: quote ? "针对这段提问,或说想怎么改..." : "描述你想怎么调,或问我任何问题...",
|
|
18893
|
+
"aria-label": "输入你想问的问题或想做的调整",
|
|
18894
|
+
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"
|
|
18895
|
+
}
|
|
18896
|
+
),
|
|
18897
|
+
!answerIsDone && onStopAnswer ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18898
|
+
"button",
|
|
18899
|
+
{
|
|
18900
|
+
type: "button",
|
|
18901
|
+
onClick: onStopAnswer,
|
|
18902
|
+
title: "停止回答",
|
|
18903
|
+
"aria-label": "停止回答",
|
|
18904
|
+
className: "h-9 w-9 shrink-0 rounded-xl bg-primary text-white shadow-glow transition-all hover:bg-primary/80",
|
|
18905
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(StopCircle, { className: "mx-auto h-4 w-4" })
|
|
18906
|
+
}
|
|
18907
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18908
|
+
"button",
|
|
18909
|
+
{
|
|
18910
|
+
type: "button",
|
|
18911
|
+
onClick: submit,
|
|
18912
|
+
disabled: !input.trim(),
|
|
18913
|
+
"aria-label": "发送",
|
|
18914
|
+
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",
|
|
18915
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "mx-auto h-4 w-4" })
|
|
18916
|
+
}
|
|
18917
|
+
)
|
|
18918
|
+
] }) }) })
|
|
18919
|
+
] })
|
|
18920
|
+
) : (
|
|
18921
|
+
/* ==================== 收起态:左侧窄竖条把手(仍在布局内占位) ==================== */
|
|
18922
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
18923
|
+
"button",
|
|
18754
18924
|
{
|
|
18755
|
-
|
|
18756
|
-
|
|
18757
|
-
|
|
18925
|
+
type: "button",
|
|
18926
|
+
onClick: () => onOpenChange(true),
|
|
18927
|
+
title: dockHint(state),
|
|
18928
|
+
"aria-label": "展开 AI 学伴面板",
|
|
18929
|
+
className: "flex h-full w-[52px] flex-col items-center gap-3 py-3 transition-colors hover:bg-slate-50",
|
|
18930
|
+
children: [
|
|
18758
18931
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18759
18932
|
"img",
|
|
18760
18933
|
{
|
|
18761
18934
|
src: COOKIE_AVATAR,
|
|
18762
18935
|
alt: "",
|
|
18763
18936
|
"aria-hidden": true,
|
|
18764
|
-
className: "
|
|
18937
|
+
className: "h-9 w-9 shrink-0 rounded-full object-cover ring-1 ring-primary/15"
|
|
18765
18938
|
}
|
|
18766
18939
|
),
|
|
18767
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18768
|
-
] }) : (
|
|
18769
|
-
/* 消息渲染与主聊天统一,全部由 MessageContent 组件承载 */
|
|
18940
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(PanelLeftOpen, { className: "h-4 w-4 shrink-0 text-slate-400" }),
|
|
18770
18941
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18771
|
-
|
|
18942
|
+
"span",
|
|
18772
18943
|
{
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
userInfo,
|
|
18777
|
-
handleSend: ({ input: input2 }) => onSend(input2),
|
|
18778
|
-
customDiffViewer
|
|
18944
|
+
className: "text-[11px] font-black tracking-widest text-slate-500",
|
|
18945
|
+
style: { writingMode: "vertical-rl" },
|
|
18946
|
+
children: "饼干 · AI 学伴"
|
|
18779
18947
|
}
|
|
18780
18948
|
)
|
|
18781
|
-
|
|
18949
|
+
]
|
|
18782
18950
|
}
|
|
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",
|
|
18951
|
+
)
|
|
18952
|
+
),
|
|
18953
|
+
expandedOpen && resizable && /* ==================== 右缘拖拽把手:4px 命中区,hover/拖动/聚焦竖条转主题色 ==================== */
|
|
18954
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18955
|
+
"div",
|
|
18956
|
+
{
|
|
18957
|
+
role: "separator",
|
|
18958
|
+
"aria-orientation": "vertical",
|
|
18959
|
+
"aria-label": "拖拽调整 AI 学伴面板宽度",
|
|
18960
|
+
title: "拖拽调整面板宽度",
|
|
18961
|
+
tabIndex: 0,
|
|
18962
|
+
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",
|
|
18963
|
+
onPointerDown: handleResizeDown,
|
|
18964
|
+
onPointerMove: handleResizeMove,
|
|
18965
|
+
onPointerUp: handleResizeEnd,
|
|
18966
|
+
onPointerCancel: handleResizeEnd,
|
|
18967
|
+
onKeyDown: handleResizeKeyDown,
|
|
18968
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
18969
|
+
"span",
|
|
18848
18970
|
{
|
|
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" })
|
|
18971
|
+
"aria-hidden": true,
|
|
18972
|
+
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
18973
|
}
|
|
18856
18974
|
)
|
|
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
18975
|
}
|
|
18890
18976
|
)
|
|
18891
|
-
|
|
18977
|
+
]
|
|
18892
18978
|
}
|
|
18893
18979
|
)
|
|
18894
18980
|
);
|
|
Binary file
|
|
Binary file
|