@mxmweb/aichat 1.3.1 → 1.3.2

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 (2) hide show
  1. package/index.js +77 -75
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -43101,7 +43101,7 @@ function O2({
43101
43101
  disabledText: "#808080",
43102
43102
  shadow: "#000000",
43103
43103
  appBackground: "transparent"
43104
- }, h = n.map((v, d) => /* @__PURE__ */ k.jsxs("div", { className: "relative flex flex-col gap-2.5 items-center justify-center", children: [
43104
+ }, h = n.map((v, d) => (console.log(v, "fffffffff"), /* @__PURE__ */ k.jsxs("div", { className: "relative flex flex-col gap-2.5 items-center justify-center", children: [
43105
43105
  /* @__PURE__ */ k.jsx("div", { className: "absolute right-1 top-1 z-10", children: /* @__PURE__ */ k.jsx(
43106
43106
  Sh,
43107
43107
  {
@@ -43134,7 +43134,7 @@ function O2({
43134
43134
  kh,
43135
43135
  {
43136
43136
  file_type: Th(v.file.name || v.name),
43137
- file_name: v.file.name,
43137
+ file_name: v.name || v.file.name,
43138
43138
  url: v.url,
43139
43139
  retrieve_tags: [],
43140
43140
  styles: i,
@@ -43143,7 +43143,7 @@ function O2({
43143
43143
  parse_url: v.convertedFilePath
43144
43144
  }
43145
43145
  )
43146
- ] }, v.file.name + d)), p = r.map((v, d) => {
43146
+ ] }, v.file.name + d))), p = r.map((v, d) => {
43147
43147
  const b = v.file.name.split(".").pop() || "", y = El(b, i);
43148
43148
  return /* @__PURE__ */ k.jsx(
43149
43149
  $2,
@@ -45203,7 +45203,26 @@ function F2({
45203
45203
  display: "flex",
45204
45204
  flexDirection: "column"
45205
45205
  }, children: [
45206
- /* @__PURE__ */ k.jsxs(
45206
+ d && /* @__PURE__ */ k.jsx(
45207
+ "div",
45208
+ {
45209
+ style: {
45210
+ position: "absolute",
45211
+ inset: 0,
45212
+ background: H.colors.primary + "14",
45213
+ border: `4px dashed ${H.colors.primary}`,
45214
+ display: "flex",
45215
+ alignItems: "center",
45216
+ justifyContent: "center",
45217
+ zIndex: 50,
45218
+ pointerEvents: "none",
45219
+ userSelect: "none",
45220
+ borderRadius: W
45221
+ },
45222
+ children: /* @__PURE__ */ k.jsx("div", { style: { color: H.colors.primary, fontSize: Gm.lg, fontWeight: 700 }, children: "\u677E\u5F00\u6587\u4EF6\u4EE5\u4E0A\u4F20" })
45223
+ }
45224
+ ),
45225
+ /* @__PURE__ */ k.jsx(
45207
45226
  "div",
45208
45227
  {
45209
45228
  style: {
@@ -45217,73 +45236,52 @@ function F2({
45217
45236
  onDrop: F,
45218
45237
  onDragOver: A,
45219
45238
  onDragLeave: B,
45220
- children: [
45221
- d && /* @__PURE__ */ k.jsx(
45222
- "div",
45223
- {
45224
- style: {
45225
- position: "absolute",
45226
- inset: 0,
45227
- background: H.colors.primary + "14",
45228
- border: `4px dashed ${H.colors.primary}`,
45229
- display: "flex",
45230
- alignItems: "center",
45231
- justifyContent: "center",
45232
- zIndex: 50,
45233
- pointerEvents: "none",
45234
- userSelect: "none",
45235
- borderRadius: W
45236
- },
45237
- children: /* @__PURE__ */ k.jsx("div", { style: { color: H.colors.primary, fontSize: Gm.lg, fontWeight: 700 }, children: "\u677E\u5F00\u6587\u4EF6\u4EE5\u4E0A\u4F20" })
45238
- }
45239
- ),
45240
- /* @__PURE__ */ k.jsx(
45241
- "div",
45242
- {
45243
- style: {
45244
- width: "100%",
45245
- minWidth: 520,
45246
- margin: "0 auto",
45247
- flex: 1,
45248
- display: "flex",
45249
- flexDirection: "column",
45250
- height: "100%",
45251
- overflow: "hidden"
45252
- },
45253
- children: e.isNew ? a != null && a.WelcomeComponent ? /* @__PURE__ */ k.jsx(a.WelcomeComponent, {}) : /* @__PURE__ */ k.jsx(bW, {}) : r.display === "loading" ? a != null && a.DisplayLoading ? /* @__PURE__ */ k.jsx(a.DisplayLoading, {}) : /* @__PURE__ */ k.jsx(vW, {}) : r.display === "error" ? a != null && a.DisplayError ? /* @__PURE__ */ k.jsx(a.DisplayError, {}) : /* @__PURE__ */ k.jsx(hW, {}) : /* @__PURE__ */ k.jsxs(
45254
- "div",
45255
- {
45256
- ref: f,
45257
- className: "relative px-8",
45258
- style: {
45259
- direction: "rtl",
45260
- transform: "rotate(180deg)",
45261
- flex: 1,
45262
- overflowY: "scroll",
45263
- paddingTop: 230,
45264
- paddingBottom: 20,
45265
- display: "flex",
45266
- flexDirection: "column",
45267
- alignItems: "center"
45268
- },
45269
- children: [
45270
- /* @__PURE__ */ k.jsx("div", { style: { flexGrow: 1, flexShrink: 1, flex: 1 } }),
45271
- /* @__PURE__ */ k.jsx("div", { style: { width: "100%", maxWidth: 1200 }, children: /* @__PURE__ */ k.jsx(
45272
- iW,
45273
- {
45274
- status: r.display,
45275
- messages: D,
45276
- eventsEmit: n,
45277
- renderAiChatBox: a == null ? void 0 : a.AiChatBox,
45278
- renderUserChatBox: a == null ? void 0 : a.UserChatBox
45279
- }
45280
- ) })
45281
- ]
45282
- }
45283
- )
45284
- }
45285
- )
45286
- ]
45239
+ children: /* @__PURE__ */ k.jsx(
45240
+ "div",
45241
+ {
45242
+ style: {
45243
+ width: "100%",
45244
+ minWidth: 520,
45245
+ margin: "0 auto",
45246
+ flex: 1,
45247
+ display: "flex",
45248
+ flexDirection: "column",
45249
+ height: "100%",
45250
+ overflow: "hidden"
45251
+ },
45252
+ children: e.isNew ? a != null && a.WelcomeComponent ? /* @__PURE__ */ k.jsx(a.WelcomeComponent, {}) : /* @__PURE__ */ k.jsx(bW, {}) : r.display === "loading" ? a != null && a.DisplayLoading ? /* @__PURE__ */ k.jsx(a.DisplayLoading, {}) : /* @__PURE__ */ k.jsx(vW, {}) : r.display === "error" ? a != null && a.DisplayError ? /* @__PURE__ */ k.jsx(a.DisplayError, {}) : /* @__PURE__ */ k.jsx(hW, {}) : /* @__PURE__ */ k.jsxs(
45253
+ "div",
45254
+ {
45255
+ ref: f,
45256
+ className: "relative px-8",
45257
+ style: {
45258
+ direction: "rtl",
45259
+ transform: "rotate(180deg)",
45260
+ flex: 1,
45261
+ overflowY: "scroll",
45262
+ paddingTop: 230,
45263
+ paddingBottom: 20,
45264
+ display: "flex",
45265
+ flexDirection: "column",
45266
+ alignItems: "center"
45267
+ },
45268
+ children: [
45269
+ /* @__PURE__ */ k.jsx("div", { style: { flexGrow: 1, flexShrink: 1, flex: 1 } }),
45270
+ /* @__PURE__ */ k.jsx("div", { style: { width: "100%", maxWidth: 1200 }, children: /* @__PURE__ */ k.jsx(
45271
+ iW,
45272
+ {
45273
+ status: r.display,
45274
+ messages: D,
45275
+ eventsEmit: n,
45276
+ renderAiChatBox: a == null ? void 0 : a.AiChatBox,
45277
+ renderUserChatBox: a == null ? void 0 : a.UserChatBox
45278
+ }
45279
+ ) })
45280
+ ]
45281
+ }
45282
+ )
45283
+ }
45284
+ )
45287
45285
  }
45288
45286
  ),
45289
45287
  /* @__PURE__ */ k.jsx(
@@ -59563,18 +59561,22 @@ function KQ(e = F2) {
59563
59561
  }, [f]);
59564
59562
  function be(ce, se) {
59565
59563
  const ye = /* @__PURE__ */ new Map();
59566
- return ce.forEach((xe) => ye.set(xe.uid, we(xe))), se.forEach((xe) => ye.set(xe.uid, we(xe))), Array.from(ye.values());
59564
+ return ce.forEach((xe) => ye.set(xe.uid, we(xe))), se.forEach((xe) => ye.set(xe.uid, we(xe))), console.log(Array.from(ye.values()), "``````````````````9929312830918309812903819023890128390"), Array.from(ye.values());
59567
59565
  }
59568
59566
  function we(ce) {
59569
- return !ce || ce.file && ce.file.name ? ce : {
59567
+ if (!ce || ce.file && ce.file.name) return ce;
59568
+ const se = ce.name || ce.fileName || "";
59569
+ return {
59570
59570
  ...ce,
59571
59571
  url: ce.filePath || "",
59572
59572
  uid: ce.uid || "",
59573
59573
  file: {
59574
- name: ce.name || "",
59574
+ name: se,
59575
59575
  size: typeof ce.size == "string" && ce.size.endsWith("MB") ? Number(ce.size.replace("MB", "")) * 1024 * 1024 : ce.size || 0,
59576
59576
  type: ce.type || ""
59577
- }
59577
+ },
59578
+ name: se
59579
+ // 兜底 name 字段,供 UI 使用
59578
59580
  };
59579
59581
  }
59580
59582
  Ct(() => {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "style": "assets/style.css",
6
6
  "types": "index.d.ts",
7
7
  "private": false,
8
- "version": "1.3.1",
8
+ "version": "1.3.2",
9
9
  "author": "hanfeng_Zhang",
10
10
  "type": "module",
11
11
  "scripts": {