@deep-eye/core 1.2.46 → 1.2.47

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.js CHANGED
@@ -2672,10 +2672,10 @@ function R3(t) {
2672
2672
  }
2673
2673
  function aG(t) {
2674
2674
  return {
2675
- fileName: t.fileName,
2676
- fileType: t.fileType,
2675
+ filename: t.fileName,
2676
+ url_type: t.fileType,
2677
2677
  size: t.size,
2678
- url: t.url
2678
+ original_url: t.url
2679
2679
  };
2680
2680
  }
2681
2681
  function Xv(t, A) {
@@ -2696,10 +2696,10 @@ function Xv(t, A) {
2696
2696
  };
2697
2697
  }
2698
2698
  function oG(t) {
2699
- const A = t.fileType.toLowerCase();
2700
- return x3.has(A) ? { type: "image_url", image_url: { url: t.url } } : M3.has(A) ? { type: "video_url", video_url: { url: t.url } } : _3.has(A) ? { type: "input_audio", input_audio: { url: t.url } } : {
2699
+ const A = t.url_type.toLowerCase();
2700
+ return x3.has(A) ? { type: "image_url", image_url: { url: t.original_url } } : M3.has(A) ? { type: "video_url", video_url: { url: t.original_url } } : _3.has(A) ? { type: "input_audio", input_audio: { url: t.original_url } } : {
2701
2701
  type: "file",
2702
- file: { file_url: t.url, filename: t.fileName }
2702
+ file: { file_url: t.original_url, filename: t.filename }
2703
2703
  };
2704
2704
  }
2705
2705
  function G3() {
@@ -2714,7 +2714,7 @@ function gB(t) {
2714
2714
  }
2715
2715
  const wl = Pu(/* @__PURE__ */ new Map()), gG = /* @__PURE__ */ new Set(["avif", "bmp", "gif", "heic", "jpeg", "jpg", "png", "svg", "webp"]), lG = /* @__PURE__ */ new Set(["aac", "flac", "m4a", "mp3", "oga", "ogg", "wav"]), cG = /* @__PURE__ */ new Set(["avi", "m4v", "mkv", "mov", "mp4", "webm"]), uG = /* @__PURE__ */ new Set(["csv", "json", "markdown", "md", "txt"]);
2716
2716
  function Up(t) {
2717
- const A = (t.fileType || mc(t.fileName)).toLowerCase();
2717
+ const A = (t.url_type || mc(t.filename)).toLowerCase();
2718
2718
  return gG.has(A) ? "image" : A === "pdf" ? "pdf" : A === "docx" ? "docx" : A === "xls" || A === "xlsx" ? "excel" : A === "pptx" ? "pptx" : A === "html" || A === "htm" ? "html" : uG.has(A) ? "text" : lG.has(A) ? "audio" : cG.has(A) ? "video" : "unsupported";
2719
2719
  }
2720
2720
  function KdA(t, A) {
@@ -2863,8 +2863,8 @@ const xG = ["src", "alt"], _G = /* @__PURE__ */ oe({
2863
2863
  })
2864
2864
  ])) : DA("", !0),
2865
2865
  M("img", {
2866
- src: (u = t.images[t.index ?? 0]) == null ? void 0 : u.url,
2867
- alt: (C = t.images[t.index ?? 0]) == null ? void 0 : C.fileName
2866
+ src: (u = t.images[t.index ?? 0]) == null ? void 0 : u.original_url,
2867
+ alt: (C = t.images[t.index ?? 0]) == null ? void 0 : C.filename
2868
2868
  }, null, 8, xG),
2869
2869
  t.images.length > 1 ? (Y(), P("button", {
2870
2870
  key: 1,
@@ -2883,7 +2883,7 @@ const xG = ["src", "alt"], _G = /* @__PURE__ */ oe({
2883
2883
  ]);
2884
2884
  };
2885
2885
  }
2886
- }), MG = /* @__PURE__ */ Me(_G, [["__scopeId", "data-v-c4acf66f"]]), RG = {
2886
+ }), MG = /* @__PURE__ */ Me(_G, [["__scopeId", "data-v-7344bd69"]]), RG = {
2887
2887
  class: "chat-attachments",
2888
2888
  "aria-label": "消息附件"
2889
2889
  }, GG = ["aria-label", "onClick"], LG = ["src", "alt"], TG = ["aria-label", "onClick"], YG = ["src"], UG = { class: "chat-attachments__file-info" }, JG = { class: "chat-attachments__name" }, OG = { class: "chat-attachments__meta" }, HG = { class: "chat-attachments__type" }, ZG = 200, KG = /* @__PURE__ */ oe({
@@ -2900,48 +2900,50 @@ const xG = ["src", "alt"], _G = /* @__PURE__ */ oe({
2900
2900
  return Up(c) === "image";
2901
2901
  }
2902
2902
  function s(c) {
2903
- return rc(c.url, { width: ZG });
2903
+ return rc(c.original_url, { width: ZG });
2904
2904
  }
2905
2905
  function g(c) {
2906
- a.value = r.value.findIndex((h) => h.url === c.url), n.value = !0;
2906
+ a.value = r.value.findIndex(
2907
+ (h) => h.original_url === c.original_url
2908
+ ), n.value = !0;
2907
2909
  }
2908
2910
  function l(c) {
2909
2911
  return c < 1024 ? `${c} B` : c < 1024 * 1024 ? `${(c / 1024).toFixed(1)} KB` : `${(c / (1024 * 1024)).toFixed(1)} MB`;
2910
2912
  }
2911
2913
  return (c, h) => (Y(), P("section", RG, [
2912
2914
  (Y(!0), P(Ge, null, Qt(t.resources, (u) => (Y(), P(Ge, {
2913
- key: u.url
2915
+ key: u.original_url
2914
2916
  }, [
2915
2917
  o(u) ? (Y(), P("button", {
2916
2918
  key: 0,
2917
2919
  type: "button",
2918
2920
  class: "chat-attachments__item chat-attachments__image",
2919
- "aria-label": `预览 ${u.fileName}`,
2921
+ "aria-label": `预览 ${u.filename}`,
2920
2922
  onClick: (C) => g(u)
2921
2923
  }, [
2922
2924
  M("img", {
2923
2925
  src: s(u),
2924
- alt: u.fileName,
2926
+ alt: u.filename,
2925
2927
  loading: "lazy"
2926
2928
  }, null, 8, LG)
2927
2929
  ], 8, GG)) : (Y(), P("button", {
2928
2930
  key: 1,
2929
2931
  type: "button",
2930
2932
  class: "chat-attachments__item chat-attachments__file",
2931
- "aria-label": `预览 ${u.fileName}`,
2933
+ "aria-label": `预览 ${u.filename}`,
2932
2934
  onClick: (C) => i("preview", u)
2933
2935
  }, [
2934
2936
  M("img", {
2935
2937
  class: "chat-attachments__file-icon",
2936
- src: _A(L3)(u.fileType || u.fileName, u.url),
2938
+ src: _A(L3)(u.url_type || u.filename, u.original_url),
2937
2939
  alt: "",
2938
2940
  "aria-hidden": "true"
2939
2941
  }, null, 8, YG),
2940
2942
  M("span", UG, [
2941
- M("span", JG, EA(u.fileName), 1),
2943
+ M("span", JG, EA(u.filename), 1),
2942
2944
  M("span", OG, EA(l(u.size)), 1)
2943
2945
  ]),
2944
- M("span", HG, EA(u.fileType.toUpperCase()), 1)
2946
+ M("span", HG, EA(u.url_type.toUpperCase()), 1)
2945
2947
  ], 8, TG))
2946
2948
  ], 64))), 128)),
2947
2949
  De(MG, {
@@ -2953,7 +2955,7 @@ const xG = ["src", "alt"], _G = /* @__PURE__ */ oe({
2953
2955
  }, null, 8, ["open", "index", "images"])
2954
2956
  ]));
2955
2957
  }
2956
- }), qG = /* @__PURE__ */ Me(KG, [["__scopeId", "data-v-d1f4e77b"]]), PG = {
2958
+ }), qG = /* @__PURE__ */ Me(KG, [["__scopeId", "data-v-9a79734c"]]), PG = {
2957
2959
  key: 0,
2958
2960
  class: "chat-follow-ups",
2959
2961
  role: "group",
@@ -59949,17 +59951,17 @@ const NCA = {
59949
59951
  lA.retry(J);
59950
59952
  }
59951
59953
  function Lt(J) {
59952
- return J.status === "uploaded" ? J.resource.fileName : J.file.name;
59954
+ return J.status === "uploaded" ? J.resource.filename : J.file.name;
59953
59955
  }
59954
59956
  function dh(J) {
59955
59957
  const j = Lt(J);
59956
59958
  return mc(j) || "file";
59957
59959
  }
59958
59960
  function rB(J) {
59959
- return J.status === "uploaded" ? DI({ name: J.resource.fileName, type: "" }) === "image" : DI(J.file) === "image";
59961
+ return J.status === "uploaded" ? DI({ name: J.resource.filename, type: "" }) === "image" : DI(J.file) === "image";
59960
59962
  }
59961
59963
  function YR(J) {
59962
- return J.previewUrl ? J.previewUrl : J.status === "uploaded" ? rc(J.resource.url, { width: FIA }) : "";
59964
+ return J.previewUrl ? J.previewUrl : J.status === "uploaded" ? rc(J.resource.original_url, { width: FIA }) : "";
59963
59965
  }
59964
59966
  function nB(J) {
59965
59967
  return J.status === "uploading" ? `上传中 ${J.progress}%` : J.status === "error" ? J.error.message : UR(J.resource.size);
@@ -60534,7 +60536,7 @@ const NCA = {
60534
60536
  }, null, 544)
60535
60537
  ], 38));
60536
60538
  }
60537
- }), xIA = /* @__PURE__ */ Me(NIA, [["__scopeId", "data-v-1e93934d"]]), _IA = {
60539
+ }), xIA = /* @__PURE__ */ Me(NIA, [["__scopeId", "data-v-8cc4305c"]]), _IA = {
60538
60540
  class: "chat-empty",
60539
60541
  role: "status"
60540
60542
  }, MIA = { class: "chat-empty__title" }, RIA = { class: "chat-empty__description" }, GIA = /* @__PURE__ */ oe({
@@ -62609,8 +62611,8 @@ const lfA = ["aria-busy"], cfA = {
62609
62611
  }, [
62610
62612
  A.value ? (Y(), se(Jn("media-player"), {
62611
62613
  key: 0,
62612
- src: t.resource.url,
62613
- title: t.resource.fileName,
62614
+ src: t.resource.original_url,
62615
+ title: t.resource.filename,
62614
62616
  controls: "",
62615
62617
  crossorigin: ""
62616
62618
  }, {
@@ -62622,7 +62624,7 @@ const lfA = ["aria-busy"], cfA = {
62622
62624
  }, 8, ["src", "title"])) : (Y(), P("div", tdA, "正在加载播放器..."))
62623
62625
  ], 2));
62624
62626
  }
62625
- }), rdA = /* @__PURE__ */ Me(idA, [["__scopeId", "data-v-003e1844"]]), ndA = /* @__PURE__ */ oe({
62627
+ }), rdA = /* @__PURE__ */ Me(idA, [["__scopeId", "data-v-1b216acf"]]), ndA = /* @__PURE__ */ oe({
62626
62628
  __name: "ChatOfficePreview",
62627
62629
  props: {
62628
62630
  resource: {},
@@ -62644,14 +62646,14 @@ const lfA = ["aria-busy"], cfA = {
62644
62646
  ])]),
62645
62647
  default: Je(() => [
62646
62648
  (Y(), se(Jn(i.value), {
62647
- src: t.resource.url,
62649
+ src: t.resource.original_url,
62648
62650
  class: "chat-office-preview"
62649
62651
  }, null, 8, ["src"]))
62650
62652
  ]),
62651
62653
  _: 1
62652
62654
  }));
62653
62655
  }
62654
- }), adA = /* @__PURE__ */ Me(ndA, [["__scopeId", "data-v-e422d916"]]), odA = ["data-preview-kind"], sdA = {
62656
+ }), adA = /* @__PURE__ */ Me(ndA, [["__scopeId", "data-v-f0923a58"]]), odA = ["data-preview-kind"], sdA = {
62655
62657
  key: 1,
62656
62658
  class: "chat-file-preview__unsupported"
62657
62659
  }, gdA = ["href"], ldA = /* @__PURE__ */ oe({
@@ -62667,8 +62669,8 @@ const lfA = ["aria-busy"], cfA = {
62667
62669
  setup(l) {
62668
62670
  return () => eo("img", {
62669
62671
  class: "chat-file-preview__image",
62670
- src: l.resource.url,
62671
- alt: l.resource.fileName
62672
+ src: l.resource.original_url,
62673
+ alt: l.resource.filename
62672
62674
  });
62673
62675
  }
62674
62676
  }), n = oe({
@@ -62676,8 +62678,8 @@ const lfA = ["aria-busy"], cfA = {
62676
62678
  setup(l) {
62677
62679
  return () => eo("iframe", {
62678
62680
  class: "chat-file-preview__frame",
62679
- src: l.resource.url,
62680
- title: l.resource.fileName,
62681
+ src: l.resource.original_url,
62682
+ title: l.resource.filename,
62681
62683
  sandbox: "",
62682
62684
  referrerpolicy: "no-referrer"
62683
62685
  });
@@ -62706,7 +62708,7 @@ const lfA = ["aria-busy"], cfA = {
62706
62708
  s.value ? (Y(), se(Jn(s.value), Xr(Vo({ key: 0 }, g.value)), null, 16)) : (Y(), P("div", sdA, [
62707
62709
  c[0] || (c[0] = M("p", null, "此文件暂不支持在线预览", -1)),
62708
62710
  M("a", {
62709
- href: t.resource.url,
62711
+ href: t.resource.original_url,
62710
62712
  target: "_blank",
62711
62713
  rel: "noopener noreferrer"
62712
62714
  }, "下载文件", 8, gdA)
@@ -62714,7 +62716,7 @@ const lfA = ["aria-busy"], cfA = {
62714
62716
  ], !0)
62715
62717
  ], 8, odA));
62716
62718
  }
62717
- }), cdA = /* @__PURE__ */ Me(ldA, [["__scopeId", "data-v-e956d790"]]), udA = ["aria-label"], hdA = { class: "chat-file-preview-panel__header" }, CdA = ["href"], IdA = { class: "chat-file-preview-panel__body" }, fdA = /* @__PURE__ */ oe({
62719
+ }), cdA = /* @__PURE__ */ Me(ldA, [["__scopeId", "data-v-7e9dbdd7"]]), udA = ["aria-label"], hdA = { class: "chat-file-preview-panel__header" }, CdA = ["href"], IdA = { class: "chat-file-preview-panel__body" }, fdA = /* @__PURE__ */ oe({
62718
62720
  __name: "ChatFilePreviewPanel",
62719
62721
  props: {
62720
62722
  resource: {}
@@ -62738,16 +62740,16 @@ const lfA = ["aria-busy"], cfA = {
62738
62740
  ref: i,
62739
62741
  class: "chat-file-preview-panel",
62740
62742
  role: "region",
62741
- "aria-label": `${t.resource.fileName} 预览`,
62743
+ "aria-label": `${t.resource.filename} 预览`,
62742
62744
  onKeydown: a
62743
62745
  }, [
62744
62746
  M("header", hdA, [
62745
62747
  M("div", null, [
62746
- M("strong", null, EA(t.resource.fileName), 1),
62747
- M("span", null, EA(t.resource.fileType.toUpperCase()), 1)
62748
+ M("strong", null, EA(t.resource.filename), 1),
62749
+ M("span", null, EA(t.resource.url_type.toUpperCase()), 1)
62748
62750
  ]),
62749
62751
  M("a", {
62750
- href: t.resource.url,
62752
+ href: t.resource.original_url,
62751
62753
  target: "_blank",
62752
62754
  rel: "noopener noreferrer",
62753
62755
  "aria-label": "在新窗口打开文件"
@@ -62779,7 +62781,7 @@ const lfA = ["aria-busy"], cfA = {
62779
62781
  ])
62780
62782
  ], 40, udA));
62781
62783
  }
62782
- }), ddA = /* @__PURE__ */ Me(fdA, [["__scopeId", "data-v-6f031562"]]), BdA = ["aria-label"], QdA = /* @__PURE__ */ oe({
62784
+ }), ddA = /* @__PURE__ */ Me(fdA, [["__scopeId", "data-v-8e55677a"]]), BdA = ["aria-label"], QdA = /* @__PURE__ */ oe({
62783
62785
  __name: "ChatSidebarResizeHandle",
62784
62786
  props: {
62785
62787
  ariaLabel: { default: "调整预览宽度" }