vlite3 1.0.5 → 1.0.6

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.
@@ -4,9 +4,9 @@ import P from "../Icon.vue.js";
4
4
  import N from "../Button.vue.js";
5
5
  import { $t as w } from "../../utils/i18n.js";
6
6
  import { downloadFile as E } from "../../utils/functions.js";
7
- import g from "../FilePreview/FilePreview.vue.js";
7
+ import b from "../FilePreview/FilePreview.vue.js";
8
8
  import { getFileTypeIcon as F } from "./fileTypeIcon.js";
9
- const G = ["onClick"], K = ["src"], W = ["title"], q = { class: "vl-attachments-list__item-size text-xs text-muted-foreground mt-0.5" }, H = ["onClick"], J = { class: "flex items-center gap-3 overflow-hidden min-w-0" }, O = ["src"], Q = { class: "flex flex-col overflow-hidden leading-tight min-w-0" }, R = ["title"], X = ["aria-label"], Y = ["aria-label", "onClick"], ie = /* @__PURE__ */ S({
9
+ const G = ["onClick"], K = ["src"], W = ["title"], q = { class: "vl-attachments-list__item-size text-xs text-muted-foreground mt-0.5" }, H = ["onClick"], J = { class: "flex items-center gap-3 overflow-hidden min-w-0 flex-1" }, O = ["src"], Q = { class: "flex flex-col overflow-hidden leading-tight min-w-0" }, R = ["title"], X = ["aria-label"], Y = ["aria-label", "onClick"], ie = /* @__PURE__ */ S({
10
10
  __name: "AttachmentsList",
11
11
  props: {
12
12
  attachments: {},
@@ -31,16 +31,16 @@ const G = ["onClick"], K = ["src"], W = ["title"], q = { class: "vl-attachments-
31
31
  emptyClass: { default: "" }
32
32
  },
33
33
  setup(t) {
34
- const c = t, b = L(null), k = f(() => c.attachments ? Array.isArray(c.attachments) ? c.attachments : [c.attachments] : []), I = (n) => {
34
+ const c = t, g = L(null), k = f(() => c.attachments ? Array.isArray(c.attachments) ? c.attachments : [c.attachments] : []), I = (n) => {
35
35
  if (!n) return "0 Bytes";
36
36
  const h = 1024, e = ["Bytes", "KB", "MB", "GB"], s = Math.floor(Math.log(n) / Math.log(h));
37
37
  return parseFloat((n / Math.pow(h, s)).toFixed(2)) + " " + e[s];
38
38
  }, D = async (n) => {
39
39
  n.fileUrl && n.fileUrl !== "#" && await E(n.fileUrl, n.fileName || "attachment");
40
40
  }, A = (n) => n.fileType && n.fileType.startsWith("image/") ? !0 : /\.(jpg|jpeg|png|gif|webp|svg|bmp)(\?.*)?$/i.test(n.fileUrl || ""), V = (n) => {
41
- c.clickToPreview && c.canView && (b.value = n);
41
+ c.clickToPreview && c.canView && (g.value = n);
42
42
  }, $ = () => {
43
- b.value = null;
43
+ g.value = null;
44
44
  }, r = f(() => {
45
45
  switch (c.size) {
46
46
  case "sm":
@@ -108,7 +108,7 @@ const G = ["onClick"], K = ["src"], W = ["title"], q = { class: "vl-attachments-
108
108
  key: 0,
109
109
  title: e.fileName || i(w)("common.words.preview", "Preview"),
110
110
  "max-width": "max-w-3xl",
111
- body: i(g),
111
+ body: i(b),
112
112
  bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload }
113
113
  }, {
114
114
  trigger: T(() => [
@@ -142,10 +142,10 @@ const G = ["onClick"], K = ["src"], W = ["title"], q = { class: "vl-attachments-
142
142
  ], 2),
143
143
  t.clickToPreview && t.canView ? (a(), u(x, {
144
144
  key: 0,
145
- show: b.value === s,
145
+ show: g.value === s,
146
146
  title: e.fileName || i(w)("common.words.preview", "Preview"),
147
147
  "max-width": "max-w-3xl",
148
- body: i(g),
148
+ body: i(b),
149
149
  bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload },
150
150
  onClose: $
151
151
  }, null, 8, ["show", "title", "body", "bodyProps"])) : m("", !0)
@@ -184,7 +184,7 @@ const G = ["onClick"], K = ["src"], W = ["title"], q = { class: "vl-attachments-
184
184
  ], 2),
185
185
  d("div", Q, [
186
186
  d("span", {
187
- class: l(["vl-attachments-list__item-name font-medium truncate", [
187
+ class: l(["vl-attachments-list__item-name font-medium truncate block", [
188
188
  r.value.text,
189
189
  t.variant === "inline" ? "" : "text-foreground",
190
190
  t.itemNameClass
@@ -211,7 +211,7 @@ const G = ["onClick"], K = ["src"], W = ["title"], q = { class: "vl-attachments-
211
211
  key: 0,
212
212
  title: e.fileName || i(w)("common.words.preview", "Preview"),
213
213
  "max-width": "max-w-3xl",
214
- body: i(g),
214
+ body: i(b),
215
215
  bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload }
216
216
  }, {
217
217
  trigger: T(() => [
@@ -245,7 +245,7 @@ const G = ["onClick"], K = ["src"], W = ["title"], q = { class: "vl-attachments-
245
245
  key: 0,
246
246
  title: e.fileName || i(w)("common.words.preview", "Preview"),
247
247
  "max-width": "max-w-3xl",
248
- body: i(g),
248
+ body: i(b),
249
249
  bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload }
250
250
  }, {
251
251
  trigger: T(() => [
@@ -271,10 +271,10 @@ const G = ["onClick"], K = ["src"], W = ["title"], q = { class: "vl-attachments-
271
271
  ], 10, H))), 128)),
272
272
  t.clickToPreview && t.canView ? (a(!0), o(v, { key: 0 }, U(k.value, (e, s) => (a(), u(x, {
273
273
  key: `preview-${s}`,
274
- show: b.value === s,
274
+ show: g.value === s,
275
275
  title: e.fileName || i(w)("common.words.preview", "Preview"),
276
276
  "max-width": "max-w-3xl",
277
- body: i(g),
277
+ body: i(b),
278
278
  bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload },
279
279
  onClose: $
280
280
  }, null, 8, ["show", "title", "body", "bodyProps"]))), 128)) : m("", !0)
@@ -29,11 +29,11 @@ const y = ["src", "alt"], z = { key: 0 }, A = /* @__PURE__ */ k({
29
29
  return l.length === 1 ? l[0].slice(0, 2).toUpperCase() : (l[0][0] + l[l.length - 1][0]).toUpperCase();
30
30
  }), x = {
31
31
  xs: "h-6 w-6 text-[10px]",
32
- sm: "h-8 w-8 text-xs",
32
+ sm: "h-7.5 w-7.5 text-xs",
33
33
  md: "h-10 w-10 text-sm",
34
34
  lg: "h-14 w-14 text-base",
35
35
  xl: "h-18 w-18 text-lg",
36
- "2xl": "h-20 w-20 text-xl"
36
+ "2xl": "h-22 w-22 text-xl"
37
37
  }, h = {
38
38
  none: "rounded-none",
39
39
  sm: "rounded-sm",
@@ -11,9 +11,9 @@ const p = /* @__PURE__ */ b({
11
11
  const e = o, s = d(() => {
12
12
  const r = {
13
13
  xs: "px-1.5 h-4 text-[9.8px] font-medium leading-none",
14
- sm: "px-2 h-5.5 text-xs font-medium",
15
- md: "px-2.5 h-6.5 text-xs font-semibold",
16
- lg: "px-3 h-7.5 text-sm font-semibold"
14
+ sm: "px-2 h-5 text-xs font-medium",
15
+ md: "px-2.5 h-6 text-xs font-semibold",
16
+ lg: "px-2.5 h-7 text-sm font-semibold"
17
17
  }, l = `inline-flex items-center ${e.rounded === "none" ? "rounded-none" : `rounded-${e.rounded}`} border ${r[e.size] || r.md} focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2`, t = {
18
18
  default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
19
19
  outline: "text-foreground border-border",
@@ -1,23 +1,20 @@
1
- import { defineComponent as y, computed as b, ref as k, openBlock as t, createElementBlock as s, normalizeClass as o, createVNode as u, createCommentVNode as l, createElementVNode as n, toDisplayString as c, unref as B, createBlock as C, withModifiers as S } from "vue";
1
+ import { defineComponent as h, computed as b, ref as k, openBlock as t, createElementBlock as a, normalizeClass as l, createVNode as u, createCommentVNode as s, createElementVNode as r, toDisplayString as c, unref as S, createBlock as B, withModifiers as C } from "vue";
2
2
  import D from "../Avatar.vue.js";
3
3
  import f from "../Button.vue.js";
4
- import T from "../AttachmentsList/AttachmentsList.vue.js";
5
- const p = {
4
+ import E from "../AttachmentsList/AttachmentsList.vue.js";
5
+ const T = {
6
6
  key: 0,
7
7
  class: "flex-shrink-0 flex flex-col justify-end pb-1"
8
- }, A = {
9
- key: 0,
10
- class: "mb-1 text-xs text-muted-foreground ml-1"
11
- }, E = {
8
+ }, z = {
12
9
  key: 0,
13
- class: "text-sm whitespace-pre-wrap leading-relaxed"
14
- }, N = { class: "opacity-0 group-hover/bubble:opacity-100 focus-within:opacity-100 transition-opacity flex gap-1 px-2 pointer-events-none group-hover/bubble:pointer-events-auto focus-within:pointer-events-auto" }, z = {
10
+ class: "mb-0.5 text-[9px] font-medium tracking-wide uppercase opacity-80 truncate text-gray-900/80"
11
+ }, A = {
15
12
  key: 1,
16
- class: "relative flex items-center"
17
- }, $ = {
13
+ class: "text-sm whitespace-pre-wrap leading-relaxed break-words"
14
+ }, N = {
18
15
  key: 1,
19
- class: "mt-1 text-[10px] text-muted-foreground mx-1"
20
- }, M = /* @__PURE__ */ y({
16
+ class: "relative flex items-center"
17
+ }, V = /* @__PURE__ */ h({
21
18
  __name: "ChatBubble",
22
19
  props: {
23
20
  message: {},
@@ -31,47 +28,47 @@ const p = {
31
28
  },
32
29
  emits: ["delete", "edit"],
33
30
  setup(e, { emit: g }) {
34
- const r = e, m = g, x = b(() => r.message.timestamp ? new Date(r.message.timestamp).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : ""), a = k(!1);
35
- let i = null;
36
- const v = () => {
37
- if (r.confirmDelete === !1) {
38
- m("delete", r.message.id);
31
+ const o = e, m = g, x = b(() => o.message.timestamp ? new Date(o.message.timestamp).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : ""), i = k(!1);
32
+ let n = null;
33
+ const w = () => {
34
+ if (o.confirmDelete === !1) {
35
+ m("delete", o.message.id);
39
36
  return;
40
37
  }
41
- a.value ? (a.value = !1, i && (clearTimeout(i), i = null), m("delete", r.message.id)) : (a.value = !0, i = setTimeout(() => {
42
- a.value = !1, i = null;
38
+ i.value ? (i.value = !1, n && (clearTimeout(n), n = null), m("delete", o.message.id)) : (i.value = !0, n = setTimeout(() => {
39
+ i.value = !1, n = null;
43
40
  }, 3e3));
44
- }, h = () => {
45
- a.value = !1, i && (clearTimeout(i), i = null);
41
+ }, v = () => {
42
+ i.value = !1, n && (clearTimeout(n), n = null);
46
43
  };
47
- return (w, d) => (t(), s("div", {
48
- class: o(["flex w-full gap-3 group", e.isSender ? "flex-row-reverse" : "flex-row"])
44
+ return (y, d) => (t(), a("div", {
45
+ class: l(["flex w-full min-w-0 gap-3 group", e.isSender ? "flex-row-reverse" : "flex-row"])
49
46
  }, [
50
- e.showAvatar ? (t(), s("div", p, [
47
+ e.showAvatar ? (t(), a("div", T, [
51
48
  u(D, {
52
49
  src: e.message.avatar,
53
50
  alt: e.message.senderName,
54
51
  size: "sm"
55
52
  }, null, 8, ["src", "alt"])
56
- ])) : l("", !0),
57
- n("div", {
58
- class: o(["flex flex-col max-w-[85%] md:max-w-[75%]", e.isSender ? "items-end" : "items-start"])
53
+ ])) : s("", !0),
54
+ r("div", {
55
+ class: l(["flex flex-col min-w-0 overflow-hidden max-w-[85%]", e.isSender ? "items-end" : "items-start"])
59
56
  }, [
60
- e.showUserInfo && e.message.senderName && !e.isSender ? (t(), s("div", A, c(e.message.senderName), 1)) : l("", !0),
61
- n("div", {
62
- class: o(["relative flex items-center group/bubble", e.isSender ? "flex-row-reverse" : "flex-row"])
57
+ r("div", {
58
+ class: l(["relative flex items-center min-w-0 max-w-full group/bubble", e.isSender ? "flex-row-reverse" : "flex-row"])
63
59
  }, [
64
- n("div", {
65
- class: o(["px-3.5 py-2.5 rounded-2xl break-words relative min-w-[60px]", [
60
+ r("div", {
61
+ class: l(["px-3.5 py-2.5 rounded-2xl break-words relative min-w-[60px] max-w-full min-w-0 overflow-hidden", [
66
62
  e.isSender ? "bg-primary text-primary-foreground rounded-br-sm" : "bg-muted text-foreground rounded-bl-sm"
67
63
  ]])
68
64
  }, [
69
- e.message.text ? (t(), s("p", E, c(e.message.text), 1)) : l("", !0),
70
- e.message.attachments && e.message.attachments.length > 0 ? (t(), s("div", {
71
- key: 1,
72
- class: o({ "mt-2": e.message.text })
65
+ e.showUserInfo && e.message.senderName && !e.isSender ? (t(), a("div", z, c(e.message.senderName), 1)) : s("", !0),
66
+ e.message.text ? (t(), a("p", A, c(e.message.text), 1)) : s("", !0),
67
+ e.message.attachments && e.message.attachments.length > 0 ? (t(), a("div", {
68
+ key: 2,
69
+ class: l({ "mt-2": e.message.text || e.showUserInfo && !e.isSender })
73
70
  }, [
74
- u(B(T), {
71
+ u(S(E), {
75
72
  attachments: e.message.attachments,
76
73
  variant: "inline",
77
74
  size: "sm",
@@ -80,14 +77,29 @@ const p = {
80
77
  "click-to-preview": !0,
81
78
  "show-download-in-list": !1
82
79
  }, null, 8, ["attachments"])
83
- ], 2)) : l("", !0),
84
- e.message.isEdited ? (t(), s("div", {
85
- key: 2,
86
- class: o(["text-[10px] opacity-70 mt-0.5 text-right", e.isSender ? "text-primary-foreground" : "text-muted-foreground"])
87
- }, " (edited) ", 2)) : l("", !0)
80
+ ], 2)) : s("", !0),
81
+ e.showTimestamp && (e.message.timestamp || e.message.isEdited) ? (t(), a("div", {
82
+ key: 3,
83
+ class: l(["mt-1 flex items-center gap-1", e.isSender ? "justify-end" : "justify-start"])
84
+ }, [
85
+ e.message.isEdited ? (t(), a("span", {
86
+ key: 0,
87
+ class: l(["text-[10px] opacity-60", e.isSender ? "text-primary-foreground" : "text-muted-foreground"])
88
+ }, " edited ", 2)) : s("", !0),
89
+ e.message.isEdited && e.message.timestamp ? (t(), a("span", {
90
+ key: 1,
91
+ class: l(["text-[10px] opacity-40", e.isSender ? "text-primary-foreground" : "text-muted-foreground"])
92
+ }, " · ", 2)) : s("", !0),
93
+ e.message.timestamp ? (t(), a("span", {
94
+ key: 2,
95
+ class: l(["text-[10px] opacity-60 tabular-nums", e.isSender ? "text-primary-foreground" : "text-muted-foreground"])
96
+ }, c(x.value), 3)) : s("", !0)
97
+ ], 2)) : s("", !0)
88
98
  ], 2),
89
- n("div", N, [
90
- (e.isSender || e.allowEditAll) && e.message.text?.trim() ? (t(), C(f, {
99
+ r("div", {
100
+ class: l(["opacity-0 group-hover/bubble:opacity-100 focus-within:opacity-100 transition-opacity flex gap-0 pointer-events-none group-hover/bubble:pointer-events-auto focus-within:pointer-events-auto z-10", e.isSender ? "right-full pr-1" : "left-full pl-1"])
101
+ }, [
102
+ (e.isSender || e.allowEditAll) && e.message.text?.trim() ? (t(), B(f, {
91
103
  key: 0,
92
104
  variant: "ghost",
93
105
  size: "xs",
@@ -96,24 +108,24 @@ const p = {
96
108
  class: "text-muted-foreground hover:text-foreground h-7 w-7",
97
109
  onClick: d[0] || (d[0] = (j) => m("edit", e.message)),
98
110
  "aria-label": "Edit message"
99
- })) : l("", !0),
100
- e.isSender || e.allowDeleteAll ? (t(), s("div", z, [
111
+ })) : s("", !0),
112
+ e.isSender || e.allowDeleteAll ? (t(), a("div", N, [
101
113
  u(f, {
102
114
  variant: "ghost",
103
115
  size: "xs",
104
- icon: a.value ? "lucide:check" : "lucide:trash-2",
116
+ icon: i.value ? "lucide:check" : "lucide:trash-2",
105
117
  rounded: "full",
106
118
  class: "h-7 w-7 transition-colors",
107
- onClick: v,
108
- "aria-label": a.value ? "Confirm delete" : "Delete message"
119
+ onClick: w,
120
+ "aria-label": i.value ? "Confirm delete" : "Delete message"
109
121
  }, null, 8, ["icon", "aria-label"]),
110
- a.value ? (t(), s("button", {
122
+ i.value ? (t(), a("button", {
111
123
  key: 0,
112
124
  class: "absolute -top-1.5 -right-1.5 w-3.5 h-3.5 rounded-full bg-muted border border-border flex items-center justify-center text-muted-foreground hover:text-foreground transition-colors",
113
- onClick: S(h, ["stop"]),
125
+ onClick: C(v, ["stop"]),
114
126
  "aria-label": "Cancel delete"
115
127
  }, [...d[1] || (d[1] = [
116
- n("svg", {
128
+ r("svg", {
117
129
  xmlns: "http://www.w3.org/2000/svg",
118
130
  viewBox: "0 0 24 24",
119
131
  fill: "none",
@@ -123,28 +135,27 @@ const p = {
123
135
  "stroke-linejoin": "round",
124
136
  class: "w-2 h-2"
125
137
  }, [
126
- n("line", {
138
+ r("line", {
127
139
  x1: "18",
128
140
  y1: "6",
129
141
  x2: "6",
130
142
  y2: "18"
131
143
  }),
132
- n("line", {
144
+ r("line", {
133
145
  x1: "6",
134
146
  y1: "6",
135
147
  x2: "18",
136
148
  y2: "18"
137
149
  })
138
150
  ], -1)
139
- ])])) : l("", !0)
140
- ])) : l("", !0)
141
- ])
142
- ], 2),
143
- e.showTimestamp && e.message.timestamp ? (t(), s("div", $, c(x.value), 1)) : l("", !0)
151
+ ])])) : s("", !0)
152
+ ])) : s("", !0)
153
+ ], 2)
154
+ ], 2)
144
155
  ], 2)
145
156
  ], 2));
146
157
  }
147
158
  });
148
159
  export {
149
- M as default
160
+ V as default
150
161
  };