@leeoohoo/aichat 1.0.8-4 → 1.0.8-5

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.esm.js CHANGED
@@ -15366,11 +15366,10 @@ const Tp = {
15366
15366
  verificationPlaceholder: g,
15367
15367
  verificationHint: h
15368
15368
  }) => {
15369
- if (!r) return null;
15370
15369
  const [p, v] = J("");
15371
- le(() => {
15370
+ if (le(() => {
15372
15371
  r && v("");
15373
- }, [r, d]);
15372
+ }, [r, d]), !r) return null;
15374
15373
  const m = !!d, f = m && p.trim() !== (d == null ? void 0 : d.trim());
15375
15374
  return /* @__PURE__ */ i("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ i("div", { className: "bg-card rounded-lg shadow-lg w-full max-w-sm border border-border animate-breathing-border", children: /* @__PURE__ */ w("div", { className: "p-6", children: [
15376
15375
  /* @__PURE__ */ i("h3", { className: "text-lg font-medium text-foreground mb-2", children: e }),
@@ -17953,17 +17952,19 @@ const Tp = {
17953
17952
  const e = Eg(r), t = e.prompt_text ?? e.promptText ?? e.session_prompt ?? e.sessionPrompt ?? null;
17954
17953
  return typeof t == "string" ? t : "";
17955
17954
  }, ac = ({ className: r }) => {
17956
- const { currentSession: e, updateSessionConfig: t } = at(), n = ut(() => Ig(e), [e]), [s, o] = J(!1), [a, l] = J(""), [d, u] = J(!1);
17957
- if (le(() => {
17958
- s && l(n);
17959
- }, [s, n]), !e) return null;
17960
- const g = n.trim().length > 0, h = ut(() => n.replace(/\s+/g, " ").trim(), [n]), p = async () => {
17955
+ const { currentSession: e, updateSessionConfig: t } = at(), n = ut(() => Ig(e), [e]), s = ut(() => n.replace(/\s+/g, " ").trim(), [n]), [o, a] = J(!1), [l, d] = J(""), [u, g] = J(!1);
17956
+ le(() => {
17957
+ o && d(n);
17958
+ }, [o, n]);
17959
+ const h = n.trim().length > 0;
17960
+ if (!e) return null;
17961
+ const p = async () => {
17961
17962
  if (e) {
17962
- u(!0);
17963
+ g(!0);
17963
17964
  try {
17964
- await t(e.id, { promptText: a }), o(!1);
17965
+ await t(e.id, { promptText: l }), a(!1);
17965
17966
  } finally {
17966
- u(!1);
17967
+ g(!1);
17967
17968
  }
17968
17969
  }
17969
17970
  };
@@ -17972,27 +17973,27 @@ const Tp = {
17972
17973
  "button",
17973
17974
  {
17974
17975
  type: "button",
17975
- onClick: () => o(!0),
17976
+ onClick: () => a(!0),
17976
17977
  className: Me(
17977
17978
  "inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-border bg-muted/10 hover:bg-accent",
17978
17979
  "text-xs text-foreground max-w-[520px] min-w-0",
17979
17980
  r
17980
17981
  ),
17981
- title: g ? n : "未设置会话 Prompt(点击编辑)",
17982
+ title: h ? n : "未设置会话 Prompt(点击编辑)",
17982
17983
  children: [
17983
17984
  /* @__PURE__ */ i("span", { className: "shrink-0 text-muted-foreground", children: "Prompt" }),
17984
- /* @__PURE__ */ i("span", { className: Me("truncate min-w-0", g ? "text-foreground" : "text-muted-foreground"), children: g ? h : "未设置" })
17985
+ /* @__PURE__ */ i("span", { className: Me("truncate min-w-0", h ? "text-foreground" : "text-muted-foreground"), children: h ? s : "未设置" })
17985
17986
  ]
17986
17987
  }
17987
17988
  ),
17988
- s && /* @__PURE__ */ i("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ i("div", { className: "bg-card rounded-lg shadow-lg w-full max-w-3xl border border-border", children: /* @__PURE__ */ w("div", { className: "p-6", children: [
17989
+ o && /* @__PURE__ */ i("div", { className: "fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ i("div", { className: "bg-card rounded-lg shadow-lg w-full max-w-3xl border border-border", children: /* @__PURE__ */ w("div", { className: "p-6", children: [
17989
17990
  /* @__PURE__ */ w("div", { className: "flex items-center justify-between gap-4", children: [
17990
17991
  /* @__PURE__ */ i("h3", { className: "text-lg font-medium text-foreground", children: "编辑会话 Prompt" }),
17991
17992
  /* @__PURE__ */ i(
17992
17993
  "button",
17993
17994
  {
17994
17995
  type: "button",
17995
- onClick: () => !d && o(!1),
17996
+ onClick: () => !u && a(!1),
17996
17997
  className: "p-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded-lg transition-colors",
17997
17998
  "aria-label": "关闭",
17998
17999
  children: /* @__PURE__ */ i("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ i("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
@@ -18003,11 +18004,11 @@ const Tp = {
18003
18004
  /* @__PURE__ */ i(
18004
18005
  "textarea",
18005
18006
  {
18006
- value: a,
18007
- onChange: (v) => l(v.target.value),
18007
+ value: l,
18008
+ onChange: (v) => d(v.target.value),
18008
18009
  className: "mt-4 w-full min-h-[220px] px-3 py-2 border border-input bg-background text-foreground rounded-md focus:outline-none focus:ring-2 focus:ring-ring",
18009
18010
  placeholder: "输入会话 Prompt...",
18010
- disabled: d
18011
+ disabled: u
18011
18012
  }
18012
18013
  ),
18013
18014
  /* @__PURE__ */ w("div", { className: "flex gap-3 mt-4", children: [
@@ -18015,8 +18016,8 @@ const Tp = {
18015
18016
  "button",
18016
18017
  {
18017
18018
  type: "button",
18018
- onClick: () => o(!1),
18019
- disabled: d,
18019
+ onClick: () => a(!1),
18020
+ disabled: u,
18020
18021
  className: "flex-1 px-4 py-2 text-sm border border-border rounded-md hover:bg-accent transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
18021
18022
  children: "取消"
18022
18023
  }
@@ -18026,9 +18027,9 @@ const Tp = {
18026
18027
  {
18027
18028
  type: "button",
18028
18029
  onClick: p,
18029
- disabled: d,
18030
+ disabled: u,
18030
18031
  className: "flex-1 px-4 py-2 text-sm bg-primary text-primary-foreground rounded-md hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
18031
- children: d ? "保存中..." : "保存"
18032
+ children: u ? "保存中..." : "保存"
18032
18033
  }
18033
18034
  )
18034
18035
  ] })