vlite3 1.0.4 → 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.
Files changed (49) hide show
  1. package/components/AttachmentsList/AttachmentsList.vue.d.ts +19 -3
  2. package/components/AttachmentsList/AttachmentsList.vue.js +274 -111
  3. package/components/AttachmentsList/fileTypeIcon.d.ts +16 -0
  4. package/components/AttachmentsList/fileTypeIcon.js +127 -0
  5. package/components/AttachmentsList/index.d.ts +1 -0
  6. package/components/AttachmentsList/types.d.ts +74 -2
  7. package/components/Avatar.vue.js +2 -2
  8. package/components/Badge.vue.js +7 -7
  9. package/components/Button.vue.js +36 -43
  10. package/components/ButtonGroup.vue.js +2 -2
  11. package/components/ButtonGroup.vue2.js +8 -8
  12. package/components/CategoryManager/CategoryManager.vue.d.ts +36 -0
  13. package/components/CategoryManager/CategoryNode.vue.d.ts +15 -0
  14. package/components/CategoryManager/index.d.ts +2 -0
  15. package/components/CategoryManager/types.d.ts +43 -0
  16. package/components/Chat/ChatBubble.vue.js +70 -56
  17. package/components/Chat/ChatInterface.vue.js +182 -142
  18. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  19. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  20. package/components/Dropdown/DropdownMenu.vue.js +2 -2
  21. package/components/Dropdown/DropdownMenu.vue2.js +1 -0
  22. package/components/FilePicker/FilePicker.vue.js +117 -122
  23. package/components/Input.vue.js +28 -26
  24. package/components/Kanban/Kanban.vue.d.ts +7 -16
  25. package/components/Kanban/Kanban.vue.js +1 -1
  26. package/components/Kanban/Kanban.vue2.js +79 -47
  27. package/components/Kanban/KanbanBoard.vue.js +2 -2
  28. package/components/Kanban/KanbanBoard.vue2.js +21 -21
  29. package/components/Kanban/types.d.ts +3 -0
  30. package/components/List/List.vue.js +89 -85
  31. package/components/Navbar/Navbar.vue.d.ts +4 -0
  32. package/components/Navbar/Navbar.vue.js +196 -173
  33. package/components/Navbar/NavbarTabs.vue.js +72 -66
  34. package/components/NavbarCommandPalette.vue.js +11 -11
  35. package/components/NumberInput.vue.js +2 -2
  36. package/components/NumberInput.vue2.js +144 -104
  37. package/components/Screen/Screen.vue.d.ts +12 -29
  38. package/components/Screen/Screen.vue.js +228 -195
  39. package/components/Screen/components/ScreenViewToggle.vue.d.ts +6 -3
  40. package/components/Screen/components/ScreenViewToggle.vue.js +29 -34
  41. package/components/Screen/types.d.ts +59 -7
  42. package/components/Stats/Stats.vue.d.ts +1 -0
  43. package/components/Stats/Stats.vue.js +184 -156
  44. package/components/Stats/types.d.ts +1 -0
  45. package/components/Workbook/Sheet.vue.d.ts +1 -1
  46. package/directives/vRipple.js +28 -9
  47. package/index.js +87 -85
  48. package/package.json +1 -1
  49. package/style.css +1 -1
@@ -1,7 +1,23 @@
1
- import { AttachmentsListProps } from './types';
1
+ import { AttachmentsListProps } from './';
2
2
  declare const _default: import('vue').DefineComponent<AttachmentsListProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<AttachmentsListProps> & Readonly<{}>, {
3
- variant: "default" | "inline";
3
+ variant: "default" | "list" | "inline" | "card";
4
+ size: "sm" | "md" | "lg";
5
+ itemClass: string;
6
+ gridClass: string;
4
7
  canDownload: boolean;
5
8
  canView: boolean;
6
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
9
+ clickToPreview: boolean;
10
+ showDownloadInList: boolean;
11
+ rootClass: string;
12
+ cardClass: string;
13
+ cardThumbnailClass: string;
14
+ cardInfoClass: string;
15
+ cardActionsClass: string;
16
+ listClass: string;
17
+ itemIconBoxClass: string;
18
+ itemNameClass: string;
19
+ itemSizeClass: string;
20
+ itemActionsClass: string;
21
+ emptyClass: string;
22
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
7
23
  export default _default;
@@ -1,128 +1,291 @@
1
- import { defineComponent as C, computed as _, openBlock as n, createElementBlock as a, Fragment as f, renderList as z, normalizeClass as l, createElementVNode as i, createVNode as m, toDisplayString as w, createBlock as y, unref as r, withCtx as g, createCommentVNode as u } from "vue";
2
- import p from "../Modal.vue.js";
3
- import x from "../Icon.vue.js";
4
- import k from "../Button.vue.js";
5
- import { $t as s } from "../../utils/i18n.js";
6
- import { downloadFile as P } from "../../utils/functions.js";
7
- import N from "../FilePreview/FilePreview.vue.js";
8
- const M = { class: "w-full" }, V = {
9
- key: 0,
10
- class: "flex flex-col gap-1.5"
11
- }, $ = { class: "flex items-center gap-2 overflow-hidden min-w-0" }, A = { class: "flex flex-col overflow-hidden leading-tight min-w-0" }, F = ["title"], U = { class: "flex items-center gap-0.5 shrink-0" }, j = ["aria-label"], S = ["aria-label", "onClick"], E = {
12
- key: 1,
13
- class: "text-sm text-muted-foreground italic bg-muted/10 p-4 rounded-lg border border-dashed border-border text-center"
14
- }, O = /* @__PURE__ */ C({
1
+ import { defineComponent as S, ref as L, computed as f, openBlock as a, createElementBlock as o, normalizeClass as l, Fragment as v, renderList as U, createElementVNode as d, createBlock as u, unref as i, withCtx as T, createVNode as p, createCommentVNode as m, withModifiers as j, toDisplayString as y } from "vue";
2
+ import x from "../Modal.vue.js";
3
+ import P from "../Icon.vue.js";
4
+ import N from "../Button.vue.js";
5
+ import { $t as w } from "../../utils/i18n.js";
6
+ import { downloadFile as E } from "../../utils/functions.js";
7
+ import b from "../FilePreview/FilePreview.vue.js";
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 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({
15
10
  __name: "AttachmentsList",
16
11
  props: {
17
12
  attachments: {},
18
13
  canView: { type: Boolean, default: !0 },
19
14
  canDownload: { type: Boolean, default: !0 },
20
- variant: { default: "default" }
15
+ variant: { default: "default" },
16
+ size: { default: "md" },
17
+ clickToPreview: { type: Boolean, default: !1 },
18
+ showDownloadInList: { type: Boolean, default: !0 },
19
+ rootClass: { default: "" },
20
+ gridClass: { default: "" },
21
+ cardClass: { default: "" },
22
+ cardThumbnailClass: { default: "" },
23
+ cardInfoClass: { default: "" },
24
+ cardActionsClass: { default: "" },
25
+ listClass: { default: "" },
26
+ itemClass: { default: "" },
27
+ itemIconBoxClass: { default: "" },
28
+ itemNameClass: { default: "" },
29
+ itemSizeClass: { default: "" },
30
+ itemActionsClass: { default: "" },
31
+ emptyClass: { default: "" }
21
32
  },
22
- setup(e) {
23
- const c = e, v = _(() => c.attachments ? Array.isArray(c.attachments) ? c.attachments : [c.attachments] : []), B = (o) => {
24
- if (!o) return "0 Bytes";
25
- const h = 1024, t = ["Bytes", "KB", "MB", "GB"], d = Math.floor(Math.log(o) / Math.log(h));
26
- return parseFloat((o / Math.pow(h, d)).toFixed(2)) + " " + t[d];
27
- }, b = async (o) => {
28
- o.fileUrl && await P(o.fileUrl, o.fileName || "attachment");
29
- };
30
- return (o, h) => (n(), a("div", M, [
31
- v.value.length > 0 ? (n(), a("div", V, [
32
- (n(!0), a(f, null, z(v.value, (t, d) => (n(), a("div", {
33
- key: d,
34
- class: l([
35
- "flex items-center justify-between gap-2 px-2.5 py-2 rounded-lg transition-colors",
36
- e.variant === "inline" ? "bg-[#79797924] hover:bg-[#7979793f]" : "border border-border bg-muted/20 hover:bg-muted/40"
37
- ])
33
+ setup(t) {
34
+ const c = t, g = L(null), k = f(() => c.attachments ? Array.isArray(c.attachments) ? c.attachments : [c.attachments] : []), I = (n) => {
35
+ if (!n) return "0 Bytes";
36
+ const h = 1024, e = ["Bytes", "KB", "MB", "GB"], s = Math.floor(Math.log(n) / Math.log(h));
37
+ return parseFloat((n / Math.pow(h, s)).toFixed(2)) + " " + e[s];
38
+ }, D = async (n) => {
39
+ n.fileUrl && n.fileUrl !== "#" && await E(n.fileUrl, n.fileName || "attachment");
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 && (g.value = n);
42
+ }, $ = () => {
43
+ g.value = null;
44
+ }, r = f(() => {
45
+ switch (c.size) {
46
+ case "sm":
47
+ return {
48
+ item: "pl-2 pr-2.5 py-1.5 gap-1.5",
49
+ iconBox: "w-7 h-7 rounded",
50
+ icon: "w-3 h-3",
51
+ text: "text-[12px]",
52
+ subtext: "text-[9px]",
53
+ actions: "w-5 h-5 !min-w-[16px] !min-h-[16px]",
54
+ actionIcon: "w-3.5 h-3.5"
55
+ };
56
+ case "lg":
57
+ return {
58
+ item: "pl-3.5 pr-3 py-3 gap-3",
59
+ iconBox: "w-11 h-11 rounded-lg",
60
+ icon: "w-5 h-5",
61
+ text: "text-sm",
62
+ subtext: "-text-fs-3.5",
63
+ actions: "w-7.5 h-8",
64
+ actionIcon: "w-4 h-4"
65
+ };
66
+ default:
67
+ return {
68
+ item: "px-2.5 py-2.5 gap-2",
69
+ iconBox: "w-9 h-9 rounded-md",
70
+ icon: "w-4 h-4",
71
+ text: "-text-fs-2",
72
+ subtext: "text-[10px]",
73
+ actions: "w-7 h-7 !min-w-[20px] !min-h-[20px]",
74
+ actionIcon: "w-4 h-4"
75
+ };
76
+ }
77
+ }), z = f(() => c.canView && !c.clickToPreview), B = f(() => c.canDownload && c.showDownloadInList), M = f(() => z.value || B.value);
78
+ return (n, h) => (a(), o("div", {
79
+ class: l(["vl-attachments-list w-full", t.rootClass])
80
+ }, [
81
+ k.value.length > 0 ? (a(), o(v, { key: 0 }, [
82
+ t.variant === "card" ? (a(), o("div", {
83
+ key: 0,
84
+ class: l(["vl-attachments-list__grid grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", t.gridClass])
38
85
  }, [
39
- i("div", $, [
40
- i("div", {
41
- class: l(["w-7 h-7 rounded flex items-center justify-center shrink-0", e.variant === "inline" ? "bg-[#79797924] hover:bg-[#7979793f]" : "bg-primary/10"])
86
+ (a(!0), o(v, null, U(k.value, (e, s) => (a(), o("div", {
87
+ key: s,
88
+ class: l(["vl-attachments-list__card relative group rounded-xl border border-border bg-body overflow-hidden hover:shadow-md transition-all flex flex-col", [{ "cursor-pointer": t.clickToPreview && t.canView }, t.cardClass]]),
89
+ onClick: (C) => V(s)
90
+ }, [
91
+ d("div", {
92
+ class: l(["vl-attachments-list__card-thumbnail h-40 w-full bg-muted/30 flex items-center justify-center overflow-hidden relative border-b border-border", t.cardThumbnailClass])
42
93
  }, [
43
- m(x, {
44
- icon: "lucide:file-text",
45
- class: l(["w-3.5 h-3.5", e.variant === "inline" ? "opacity-75" : "text-primary"])
46
- }, null, 8, ["class"])
47
- ], 2),
48
- i("div", A, [
49
- i("span", {
50
- class: l(["text-xs font-medium truncate", e.variant === "inline" ? "" : "text-foreground"]),
51
- title: t.fileName
52
- }, w(t.fileName || "Unnamed File"), 11, F),
53
- i("span", {
54
- class: l(["text-[10px]", e.variant === "inline" ? "opacity-50" : "text-muted-foreground"])
55
- }, w(B(t.fileSize)), 3)
56
- ])
57
- ]),
58
- i("div", U, [
59
- e.variant === "inline" ? (n(), a(f, { key: 0 }, [
60
- e.canView ? (n(), y(p, {
94
+ A(e) ? (a(), o("img", {
61
95
  key: 0,
62
- title: t.fileName || r(s)("common.words.preview", "Preview"),
63
- "max-width": "max-w-3xl",
64
- body: r(N),
65
- bodyProps: { url: t.fileUrl, name: t.fileName, canDownload: e.canDownload }
66
- }, {
67
- trigger: g(() => [
68
- i("button", {
69
- type: "button",
70
- class: "inline-flex items-center justify-center w-6 h-6 rounded opacity-60 hover:opacity-100 bg-transparent! transition-all",
71
- "aria-label": r(s)("common.words.preview", "Preview")
72
- }, [
73
- m(x, {
96
+ src: e.thumbnailUrl || e.fileUrl,
97
+ class: "w-full h-full object-cover transition-transform group-hover:scale-105"
98
+ }, null, 8, K)) : (a(), u(P, {
99
+ key: 1,
100
+ icon: i(F)(e.fileName, e.fileUrl, e.fileType),
101
+ class: "w-12 h-12 text-muted-foreground/40 transition-transform group-hover:scale-110"
102
+ }, null, 8, ["icon"])),
103
+ t.clickToPreview ? m("", !0) : (a(), o("div", {
104
+ key: 2,
105
+ class: l(["vl-attachments-list__card-actions absolute top-2 right-2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity", t.cardActionsClass])
106
+ }, [
107
+ t.canView ? (a(), u(x, {
108
+ key: 0,
109
+ title: e.fileName || i(w)("common.words.preview", "Preview"),
110
+ "max-width": "max-w-3xl",
111
+ body: i(b),
112
+ bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload }
113
+ }, {
114
+ trigger: T(() => [
115
+ p(N, {
116
+ variant: "secondary",
117
+ size: "xs",
74
118
  icon: "lucide:eye",
75
- class: "w-3.5 h-3.5"
119
+ class: "h-7 w-7 px-0 rounded-md shadow-sm"
76
120
  })
77
- ], 8, j)
78
- ]),
79
- _: 1
80
- }, 8, ["title", "body", "bodyProps"])) : u("", !0),
81
- e.canDownload ? (n(), a("button", {
82
- key: 1,
83
- type: "button",
84
- class: "inline-flex items-center justify-center w-6 h-6 rounded opacity-60 hover:opacity-100 bg-transparent! transition-all",
85
- "aria-label": r(s)("common.words.download", "Download"),
86
- onClick: (D) => b(t)
121
+ ]),
122
+ _: 1
123
+ }, 8, ["title", "body", "bodyProps"])) : m("", !0),
124
+ t.canDownload ? (a(), u(N, {
125
+ key: 1,
126
+ variant: "secondary",
127
+ size: "xs",
128
+ icon: "lucide:download",
129
+ class: "h-7 w-7 px-0 rounded-md shadow-sm",
130
+ onClick: j((C) => D(e), ["stop"])
131
+ }, null, 8, ["onClick"])) : m("", !0)
132
+ ], 2))
133
+ ], 2),
134
+ d("div", {
135
+ class: l(["vl-attachments-list__card-info p-3 flex flex-col min-w-0", t.cardInfoClass])
136
+ }, [
137
+ d("span", {
138
+ class: "vl-attachments-list__item-name text-sm font-medium truncate",
139
+ title: e.fileName
140
+ }, y(e.fileName || "Unnamed File"), 9, W),
141
+ d("span", q, y(I(e.fileSize)), 1)
142
+ ], 2),
143
+ t.clickToPreview && t.canView ? (a(), u(x, {
144
+ key: 0,
145
+ show: g.value === s,
146
+ title: e.fileName || i(w)("common.words.preview", "Preview"),
147
+ "max-width": "max-w-3xl",
148
+ body: i(b),
149
+ bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload },
150
+ onClose: $
151
+ }, null, 8, ["show", "title", "body", "bodyProps"])) : m("", !0)
152
+ ], 10, G))), 128))
153
+ ], 2)) : (a(), o("div", {
154
+ key: 1,
155
+ class: l(["vl-attachments-list__list flex flex-col gap-1.5", t.listClass])
156
+ }, [
157
+ (a(!0), o(v, null, U(k.value, (e, s) => (a(), o("div", {
158
+ key: s,
159
+ class: l(["vl-attachments-list__item flex items-center justify-between transition-colors rounded-lg", [
160
+ t.variant === "inline" ? "bg-[#79797924] hover:bg-[#7979793f]" : "border border-border bg-muted/20 hover:bg-muted/40",
161
+ r.value.item,
162
+ t.clickToPreview && t.canView ? "cursor-pointer select-none" : "",
163
+ t.itemClass
164
+ ]]),
165
+ onClick: (C) => V(s)
166
+ }, [
167
+ d("div", J, [
168
+ d("div", {
169
+ class: l(["vl-attachments-list__item-icon-box flex items-center justify-center shrink-0 overflow-hidden relative", [
170
+ r.value.iconBox,
171
+ t.variant === "inline" ? "bg-[#79797924] hover:bg-[#7979793f]" : "bg-primary/10",
172
+ t.itemIconBoxClass
173
+ ]])
87
174
  }, [
88
- m(x, {
175
+ A(e) ? (a(), o("img", {
176
+ key: 0,
177
+ src: e.thumbnailUrl || e.fileUrl,
178
+ class: "w-full h-full object-cover"
179
+ }, null, 8, O)) : (a(), u(P, {
180
+ key: 1,
181
+ icon: i(F)(e.fileName, e.fileUrl, e.fileType),
182
+ class: l([r.value.icon, t.variant === "inline" ? "opacity-75" : "text-primary"])
183
+ }, null, 8, ["icon", "class"]))
184
+ ], 2),
185
+ d("div", Q, [
186
+ d("span", {
187
+ class: l(["vl-attachments-list__item-name font-medium truncate block", [
188
+ r.value.text,
189
+ t.variant === "inline" ? "" : "text-foreground",
190
+ t.itemNameClass
191
+ ]]),
192
+ title: e.fileName
193
+ }, y(e.fileName || "Unnamed File"), 11, R),
194
+ d("span", {
195
+ class: l(["vl-attachments-list__item-size mt-0.5", [
196
+ r.value.subtext,
197
+ t.variant === "inline" ? "opacity-50" : "text-muted-foreground",
198
+ t.itemSizeClass
199
+ ]])
200
+ }, y(I(e.fileSize)), 3)
201
+ ])
202
+ ]),
203
+ M.value ? (a(), o("div", {
204
+ key: 0,
205
+ class: l(["vl-attachments-list__item-actions flex items-center shrink-0 ml-2", [t.size !== "lg" ? "gap-0.5" : "gap-0", t.itemActionsClass]]),
206
+ onClick: h[0] || (h[0] = j(() => {
207
+ }, ["stop"]))
208
+ }, [
209
+ t.variant === "inline" ? (a(), o(v, { key: 0 }, [
210
+ z.value ? (a(), u(x, {
211
+ key: 0,
212
+ title: e.fileName || i(w)("common.words.preview", "Preview"),
213
+ "max-width": "max-w-3xl",
214
+ body: i(b),
215
+ bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload }
216
+ }, {
217
+ trigger: T(() => [
218
+ d("button", {
219
+ type: "button",
220
+ class: l(["inline-flex items-center justify-center rounded opacity-60 hover:opacity-100 bg-transparent! transition-all", r.value.actions]),
221
+ "aria-label": i(w)("common.words.preview", "Preview")
222
+ }, [
223
+ p(P, {
224
+ icon: "lucide:eye",
225
+ class: l(r.value.actionIcon)
226
+ }, null, 8, ["class"])
227
+ ], 10, X)
228
+ ]),
229
+ _: 1
230
+ }, 8, ["title", "body", "bodyProps"])) : m("", !0),
231
+ B.value ? (a(), o("button", {
232
+ key: 1,
233
+ type: "button",
234
+ class: l(["inline-flex items-center justify-center rounded opacity-60 hover:opacity-100 bg-transparent! transition-all", r.value.actions]),
235
+ "aria-label": i(w)("common.words.download", "Download"),
236
+ onClick: (C) => D(e)
237
+ }, [
238
+ p(P, {
239
+ icon: "lucide:download",
240
+ class: l(r.value.actionIcon)
241
+ }, null, 8, ["class"])
242
+ ], 10, Y)) : m("", !0)
243
+ ], 64)) : (a(), o(v, { key: 1 }, [
244
+ z.value ? (a(), u(x, {
245
+ key: 0,
246
+ title: e.fileName || i(w)("common.words.preview", "Preview"),
247
+ "max-width": "max-w-3xl",
248
+ body: i(b),
249
+ bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload }
250
+ }, {
251
+ trigger: T(() => [
252
+ p(N, {
253
+ variant: "ghost",
254
+ size: "xs",
255
+ class: l([r.value.actions, "px-0"]),
256
+ icon: "lucide:eye"
257
+ }, null, 8, ["class"])
258
+ ]),
259
+ _: 1
260
+ }, 8, ["title", "body", "bodyProps"])) : m("", !0),
261
+ B.value ? (a(), u(N, {
262
+ key: 1,
263
+ variant: "ghost",
264
+ size: "xs",
265
+ class: l([r.value.actions, "px-0"]),
89
266
  icon: "lucide:download",
90
- class: "w-3.5 h-3.5"
91
- })
92
- ], 8, S)) : u("", !0)
93
- ], 64)) : (n(), a(f, { key: 1 }, [
94
- e.canView ? (n(), y(p, {
95
- key: 0,
96
- title: t.fileName || r(s)("common.words.preview", "Preview"),
97
- "max-width": "max-w-3xl",
98
- body: r(N),
99
- bodyProps: { url: t.fileUrl, name: t.fileName, canDownload: e.canDownload }
100
- }, {
101
- trigger: g(() => [
102
- m(k, {
103
- variant: "ghost",
104
- size: "xs",
105
- icon: "lucide:eye",
106
- class: "h-6 w-6 px-0"
107
- })
108
- ]),
109
- _: 1
110
- }, 8, ["title", "body", "bodyProps"])) : u("", !0),
111
- e.canDownload ? (n(), y(k, {
112
- key: 1,
113
- variant: "ghost",
114
- size: "xs",
115
- icon: "lucide:download",
116
- class: "h-6 w-6 px-0",
117
- onClick: (D) => b(t)
118
- }, null, 8, ["onClick"])) : u("", !0)
119
- ], 64))
120
- ])
121
- ], 2))), 128))
122
- ])) : (n(), a("div", E, w(r(s)("common.words.noAttachments", "No attachments found.")), 1))
123
- ]));
267
+ onClick: (C) => D(e)
268
+ }, null, 8, ["class", "onClick"])) : m("", !0)
269
+ ], 64))
270
+ ], 2)) : m("", !0)
271
+ ], 10, H))), 128)),
272
+ t.clickToPreview && t.canView ? (a(!0), o(v, { key: 0 }, U(k.value, (e, s) => (a(), u(x, {
273
+ key: `preview-${s}`,
274
+ show: g.value === s,
275
+ title: e.fileName || i(w)("common.words.preview", "Preview"),
276
+ "max-width": "max-w-3xl",
277
+ body: i(b),
278
+ bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload },
279
+ onClose: $
280
+ }, null, 8, ["show", "title", "body", "bodyProps"]))), 128)) : m("", !0)
281
+ ], 2))
282
+ ], 64)) : (a(), o("div", {
283
+ key: 1,
284
+ class: l(["vl-attachments-list__empty text-sm text-muted-foreground italic bg-muted/10 p-4 rounded-lg border border-dashed border-border text-center", t.emptyClass])
285
+ }, y(i(w)("common.words.noAttachments", "No attachments found.")), 3))
286
+ ], 2));
124
287
  }
125
288
  });
126
289
  export {
127
- O as default
290
+ ie as default
128
291
  };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Maps a file's name or MIME type to the most descriptive Lucide/Iconify icon string.
3
+ * Returns a fallback generic file icon when no match is found.
4
+ *
5
+ * Priority: explicit fileType (MIME) → file extension from fileName/fileUrl
6
+ */
7
+ /**
8
+ * Returns the best Iconify icon string for a given file.
9
+ *
10
+ * Resolution order:
11
+ * 1. Extension from fileName
12
+ * 2. Extension from fileUrl
13
+ * 3. MIME type prefix match (fileType)
14
+ * 4. Generic fallback
15
+ */
16
+ export declare function getFileTypeIcon(fileName?: string, fileUrl?: string, fileType?: string): string;
@@ -0,0 +1,127 @@
1
+ const c = {
2
+ // ── PDFs ──────────────────────────────────────────────────────────────────
3
+ pdf: "lucide:file-text",
4
+ // ── Word / rich text ──────────────────────────────────────────────────────
5
+ doc: "lucide:file-text",
6
+ docx: "lucide:file-text",
7
+ odt: "lucide:file-text",
8
+ rtf: "lucide:file-text",
9
+ // ── Spreadsheets ──────────────────────────────────────────────────────────
10
+ xls: "lucide:file-spreadsheet",
11
+ xlsx: "lucide:file-spreadsheet",
12
+ ods: "lucide:file-spreadsheet",
13
+ csv: "lucide:file-spreadsheet",
14
+ tsv: "lucide:file-spreadsheet",
15
+ // ── Presentations ─────────────────────────────────────────────────────────
16
+ ppt: "lucide:presentation",
17
+ pptx: "lucide:presentation",
18
+ odp: "lucide:presentation",
19
+ key: "lucide:presentation",
20
+ // ── Plain text / markdown / config ────────────────────────────────────────
21
+ txt: "lucide:file-text",
22
+ md: "lucide:file-text",
23
+ mdx: "lucide:file-text",
24
+ rst: "lucide:file-text",
25
+ log: "lucide:scroll-text",
26
+ // ── Code ──────────────────────────────────────────────────────────────────
27
+ js: "lucide:file-code",
28
+ jsx: "lucide:file-code",
29
+ ts: "lucide:file-code",
30
+ tsx: "lucide:file-code",
31
+ vue: "lucide:file-code",
32
+ py: "lucide:file-code",
33
+ rb: "lucide:file-code",
34
+ php: "lucide:file-code",
35
+ go: "lucide:file-code",
36
+ rs: "lucide:file-code",
37
+ cpp: "lucide:file-code",
38
+ c: "lucide:file-code",
39
+ cs: "lucide:file-code",
40
+ java: "lucide:file-code",
41
+ kt: "lucide:file-code",
42
+ swift: "lucide:file-code",
43
+ html: "lucide:file-code",
44
+ css: "lucide:file-code",
45
+ scss: "lucide:file-code",
46
+ less: "lucide:file-code",
47
+ sh: "lucide:terminal",
48
+ bash: "lucide:terminal",
49
+ sql: "lucide:database",
50
+ json: "lucide:braces",
51
+ yaml: "lucide:braces",
52
+ yml: "lucide:braces",
53
+ toml: "lucide:braces",
54
+ xml: "lucide:code-xml",
55
+ // ── Archives ──────────────────────────────────────────────────────────────
56
+ zip: "lucide:file-archive",
57
+ rar: "lucide:file-archive",
58
+ "7z": "lucide:file-archive",
59
+ tar: "lucide:file-archive",
60
+ gz: "lucide:file-archive",
61
+ bz2: "lucide:file-archive",
62
+ // ── Audio ─────────────────────────────────────────────────────────────────
63
+ mp3: "lucide:file-audio",
64
+ wav: "lucide:file-audio",
65
+ ogg: "lucide:file-audio",
66
+ flac: "lucide:file-audio",
67
+ aac: "lucide:file-audio",
68
+ m4a: "lucide:file-audio",
69
+ wma: "lucide:file-audio",
70
+ opus: "lucide:file-audio",
71
+ // ── Video ─────────────────────────────────────────────────────────────────
72
+ mp4: "lucide:file-video",
73
+ mov: "lucide:file-video",
74
+ avi: "lucide:file-video",
75
+ mkv: "lucide:file-video",
76
+ webm: "lucide:file-video",
77
+ flv: "lucide:file-video",
78
+ wmv: "lucide:file-video",
79
+ m4v: "lucide:file-video",
80
+ "3gp": "lucide:file-video",
81
+ // ── Fonts ─────────────────────────────────────────────────────────────────
82
+ ttf: "lucide:type",
83
+ otf: "lucide:type",
84
+ woff: "lucide:type",
85
+ woff2: "lucide:type",
86
+ // ── Executables / binaries ────────────────────────────────────────────────
87
+ exe: "lucide:cog",
88
+ dmg: "lucide:disc",
89
+ apk: "lucide:smartphone",
90
+ deb: "lucide:package",
91
+ rpm: "lucide:package",
92
+ // ── eBooks ────────────────────────────────────────────────────────────────
93
+ epub: "lucide:book-open",
94
+ mobi: "lucide:book-open"
95
+ }, p = [
96
+ { prefix: "video/", icon: "lucide:file-video" },
97
+ { prefix: "audio/", icon: "lucide:file-audio" },
98
+ { prefix: "text/", icon: "lucide:file-text" },
99
+ { prefix: "application/pdf", icon: "lucide:file-text" },
100
+ { prefix: "application/zip", icon: "lucide:file-archive" },
101
+ { prefix: "application/vnd.ms-excel", icon: "lucide:file-spreadsheet" },
102
+ { prefix: "application/vnd.openxmlformats-officedocument.spreadsheetml", icon: "lucide:file-spreadsheet" },
103
+ { prefix: "application/vnd.ms-powerpoint", icon: "lucide:presentation" },
104
+ { prefix: "application/vnd.openxmlformats-officedocument.presentationml", icon: "lucide:presentation" },
105
+ { prefix: "application/msword", icon: "lucide:file-text" },
106
+ { prefix: "application/vnd.openxmlformats-officedocument.wordprocessingml", icon: "lucide:file-text" }
107
+ ], s = "lucide:file";
108
+ function t(i) {
109
+ if (!i) return "";
110
+ const l = i.split("?")[0].split("#")[0], e = l.lastIndexOf(".");
111
+ return e === -1 ? "" : l.slice(e + 1).toLowerCase();
112
+ }
113
+ function r(i, l, e) {
114
+ const d = t(i);
115
+ if (d && c[d]) return c[d];
116
+ const o = t(l);
117
+ if (o && c[o]) return c[o];
118
+ if (e) {
119
+ const u = e.toLowerCase();
120
+ for (const { prefix: f, icon: a } of p)
121
+ if (u.startsWith(f)) return a;
122
+ }
123
+ return s;
124
+ }
125
+ export {
126
+ r as getFileTypeIcon
127
+ };
@@ -1,2 +1,3 @@
1
1
  export { default as AttachmentsList } from './AttachmentsList.vue';
2
2
  export * from './types';
3
+ export { getFileTypeIcon } from './fileTypeIcon';