@epam/ai-dial-source-panel 1.1.0-dev.119 → 1.1.0-dev.121

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.
@@ -1 +1 @@
1
- {"version":3,"file":"FilesSection.d.ts","sourceRoot":"","sources":["../../../src/components/FilesSection/FilesSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAKnE,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qFAAqF;IACrF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5D,uFAAuF;IACvF,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;;AA6CD,wBAAkC"}
1
+ {"version":3,"file":"FilesSection.d.ts","sourceRoot":"","sources":["../../../src/components/FilesSection/FilesSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAKnE,4CAA4C;AAC5C,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qFAAqF;IACrF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC5D,uFAAuF;IACvF,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;;AAuCD,wBAAkC"}
package/index.js CHANGED
@@ -1,85 +1,84 @@
1
- import { AttachmentType as e, BASE_LG_ICON_PROPS as t, MarkdownRenderer as n, buildCssVars as r, mergeClasses as i } from "@epam/ai-dial-chat-shared";
2
- import { PanelNoResults as a, SearchInput as o, SidebarOrientation as s, SidebarPanel as c } from "@epam/ai-dial-sidebar";
3
- import { DIAL_ICON_SIZE as l, DialNoDataContent as u, ElementSize as d, GhostIconButton as f, Highlight as p } from "@epam/ai-dial-ui-kit";
4
- import { IconCopy as m, IconDownload as h } from "@tabler/icons-react";
5
- import { memo as g, useLayoutEffect as _, useMemo as v, useState as y } from "react";
6
- import { AttachmentCard as b } from "@epam/ai-dial-conversation-input";
7
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
8
- var w = g(({ attachments: t, title: n, searchQuery: r, titleClassName: a = "dial-body-semi-text", onAttachmentClick: o, attachmentClickLabel: s }) => t.length === 0 ? null : /* @__PURE__ */ C("section", {
1
+ import { BASE_LG_ICON_PROPS as e, MarkdownRenderer as t, buildCssVars as n, mergeClasses as r } from "@epam/ai-dial-chat-shared";
2
+ import { PanelNoResults as i, SearchInput as a, SidebarOrientation as o, SidebarPanel as s } from "@epam/ai-dial-sidebar";
3
+ import { DIAL_ICON_SIZE as c, DialNoDataContent as l, ElementSize as u, GhostIconButton as d, Highlight as f } from "@epam/ai-dial-ui-kit";
4
+ import { IconCopy as p, IconDownload as m } from "@tabler/icons-react";
5
+ import { memo as h, useLayoutEffect as g, useMemo as _, useState as v } from "react";
6
+ import { AttachmentCard as y } from "@epam/ai-dial-conversation-input";
7
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
8
+ var C = h(({ attachments: e, title: t, searchQuery: n, titleClassName: i = "dial-body-semi-text", onAttachmentClick: a, attachmentClickLabel: o }) => e.length === 0 ? null : /* @__PURE__ */ S("section", {
9
9
  className: "mb-6",
10
- children: [/* @__PURE__ */ S("h2", {
11
- className: i(a, "mb-3"),
12
- children: n
13
- }), /* @__PURE__ */ S("div", {
10
+ children: [/* @__PURE__ */ x("h2", {
11
+ className: r(i, "mb-3"),
12
+ children: t
13
+ }), /* @__PURE__ */ x("div", {
14
14
  role: "list",
15
15
  className: "grid grid-cols-[repeat(auto-fill,minmax(84px,1fr))] gap-3",
16
- children: t.map((t, n) => /* @__PURE__ */ S("div", {
16
+ children: e.map((e, t) => /* @__PURE__ */ x("div", {
17
17
  role: "listitem",
18
- className: t.type === e.Audio ? "col-span-full" : void 0,
19
- children: /* @__PURE__ */ S(b, {
20
- attachment: t,
21
- searchQuery: r,
22
- onClick: o ? () => o(t) : void 0,
23
- labels: { clickLabel: s }
18
+ children: /* @__PURE__ */ x(y, {
19
+ attachment: e,
20
+ searchQuery: n,
21
+ onClick: a ? () => a(e) : void 0,
22
+ labels: { clickLabel: o }
24
23
  })
25
- }, `${t.id}-${n}`))
24
+ }, `${e.id}-${t}`))
26
25
  })]
27
- })), T = {
26
+ })), w = {
28
27
  link: "_link_viope_1",
29
28
  quote: "_quote_viope_5"
30
- }, E = g(({ title: e, sources: t, copyLabel: a, copiedLabel: o = "Link copied to clipboard", searchQuery: s = "", typography: c, colors: u, onSourceClick: h }) => {
31
- let [g, _] = y(""), b = c?.sectionTitleClassName ?? "dial-body-semi-text", x = c?.sourceLinkClassName ?? "dial-small-text", w = c?.sourceQuoteClassName ?? "dial-tiny-text", E = v(() => r({
32
- "--sp-source-link": u?.sourceLink,
33
- "--sp-source-quote": u?.sourceQuote
34
- }), [u]);
35
- if (t.length === 0) return null;
29
+ }, T = h(({ title: e, sources: i, copyLabel: a, copiedLabel: o = "Link copied to clipboard", searchQuery: s = "", typography: l, colors: m, onSourceClick: h }) => {
30
+ let [g, y] = v(""), b = l?.sectionTitleClassName ?? "dial-body-semi-text", C = l?.sourceLinkClassName ?? "dial-small-text", T = l?.sourceQuoteClassName ?? "dial-tiny-text", E = _(() => n({
31
+ "--sp-source-link": m?.sourceLink,
32
+ "--sp-source-quote": m?.sourceQuote
33
+ }), [m]);
34
+ if (i.length === 0) return null;
36
35
  let D = async (e) => {
37
- await navigator.clipboard.writeText(e), _(o);
36
+ await navigator.clipboard.writeText(e), y(o);
38
37
  };
39
- return /* @__PURE__ */ C("section", {
38
+ return /* @__PURE__ */ S("section", {
40
39
  className: "mb-6",
41
40
  style: E,
42
41
  children: [
43
- /* @__PURE__ */ S("h2", {
44
- className: i(b, "mb-3"),
42
+ /* @__PURE__ */ x("h2", {
43
+ className: r(b, "mb-3"),
45
44
  children: e
46
45
  }),
47
- /* @__PURE__ */ S("ul", {
46
+ /* @__PURE__ */ x("ul", {
48
47
  className: "flex flex-col gap-3",
49
- children: t.map((e) => /* @__PURE__ */ C("li", {
48
+ children: i.map((e) => /* @__PURE__ */ S("li", {
50
49
  className: "flex flex-col gap-1",
51
- children: [/* @__PURE__ */ C("div", {
50
+ children: [/* @__PURE__ */ S("div", {
52
51
  className: "flex min-w-0 items-center justify-between gap-2",
53
- children: [/* @__PURE__ */ S("a", {
52
+ children: [/* @__PURE__ */ x("a", {
54
53
  href: e.url,
55
54
  target: "_blank",
56
55
  rel: "noopener noreferrer",
57
- className: i(x, T.link, "min-w-0 flex-1 truncate"),
56
+ className: r(C, w.link, "min-w-0 flex-1 truncate"),
58
57
  onClick: h ? (t) => {
59
58
  t.preventDefault(), h(e);
60
59
  } : void 0,
61
- children: s ? /* @__PURE__ */ S(p, {
60
+ children: s ? /* @__PURE__ */ x(f, {
62
61
  text: e.title,
63
62
  query: s,
64
63
  maxLines: 1
65
64
  }) : e.title
66
- }), /* @__PURE__ */ S(f, {
67
- size: d.Small,
68
- icon: /* @__PURE__ */ S(m, {
69
- size: l.SM,
65
+ }), /* @__PURE__ */ x(d, {
66
+ size: u.Small,
67
+ icon: /* @__PURE__ */ x(p, {
68
+ size: c.SM,
70
69
  stroke: 1.5,
71
70
  "aria-hidden": !0
72
71
  }),
73
72
  "aria-label": a,
74
73
  onClick: () => void D(e.url)
75
74
  })]
76
- }), e.quote && /* @__PURE__ */ S("div", {
77
- className: i(w, T.quote, "line-clamp-5 [&>div>*+*]:mt-1"),
78
- children: /* @__PURE__ */ S(n, { content: e.quote })
75
+ }), e.quote && /* @__PURE__ */ x("div", {
76
+ className: r(T, w.quote, "line-clamp-5 [&>div>*+*]:mt-1"),
77
+ children: /* @__PURE__ */ x(t, { content: e.quote })
79
78
  })]
80
79
  }, e.url))
81
80
  }),
82
- /* @__PURE__ */ S("span", {
81
+ /* @__PURE__ */ x("span", {
83
82
  role: "status",
84
83
  "aria-live": "polite",
85
84
  className: "sr-only",
@@ -87,33 +86,33 @@ var w = g(({ attachments: t, title: n, searchQuery: r, titleClassName: a = "dial
87
86
  })
88
87
  ]
89
88
  });
90
- }), D = (e, t) => e.toLowerCase().includes(t.toLowerCase()), O = g(({ isOpen: e, onClose: n, uploaded: r, generated: i, sources: l, onAttachmentClick: d, onSourceClick: p, onDownloadAll: m, isMobile: g, defaultWidth: b, minWidth: T, maxWidth: O, onResizeStop: k, labels: A, styles: j }) => {
91
- let [M, N] = y("");
92
- _(() => {
93
- e || N("");
94
- }, [e]);
95
- let P = v(() => M ? r.filter((e) => D(e.name, M)) : r, [r, M]), F = v(() => M ? i.filter((e) => D(e.name, M)) : i, [i, M]), I = v(() => M ? l.filter((e) => D(e.title, M) || D(e.url, M) || e.quote != null && D(e.quote, M)) : l, [l, M]), L = r.length === 0 && i.length === 0 && l.length === 0, R = M !== "" && P.length === 0 && F.length === 0 && I.length === 0, z;
96
- return z = L ? /* @__PURE__ */ S("div", {
89
+ }), E = (e, t) => e.toLowerCase().includes(t.toLowerCase()), D = h(({ isOpen: t, onClose: n, uploaded: r, generated: c, sources: u, onAttachmentClick: f, onSourceClick: p, onDownloadAll: h, isMobile: y, defaultWidth: w, minWidth: D, maxWidth: O, onResizeStop: k, labels: A, styles: j }) => {
90
+ let [M, N] = v("");
91
+ g(() => {
92
+ t || N("");
93
+ }, [t]);
94
+ let P = _(() => M ? r.filter((e) => E(e.name, M)) : r, [r, M]), F = _(() => M ? c.filter((e) => E(e.name, M)) : c, [c, M]), I = _(() => M ? u.filter((e) => E(e.title, M) || E(e.url, M) || e.quote != null && E(e.quote, M)) : u, [u, M]), L = r.length === 0 && c.length === 0 && u.length === 0, R = M !== "" && P.length === 0 && F.length === 0 && I.length === 0, z;
95
+ return z = L ? /* @__PURE__ */ x("div", {
97
96
  className: "flex h-full items-center justify-center",
98
- children: /* @__PURE__ */ S(u, { title: A.noDataLabel })
99
- }) : R ? /* @__PURE__ */ S(a, { label: A.noResultsLabel }) : /* @__PURE__ */ C(x, { children: [
100
- /* @__PURE__ */ S(w, {
97
+ children: /* @__PURE__ */ x(l, { title: A.noDataLabel })
98
+ }) : R ? /* @__PURE__ */ x(i, { label: A.noResultsLabel }) : /* @__PURE__ */ S(b, { children: [
99
+ /* @__PURE__ */ x(C, {
101
100
  attachments: P,
102
101
  title: A.uploadedSectionTitle,
103
102
  searchQuery: M,
104
103
  titleClassName: j?.typography?.sectionTitleClassName,
105
- onAttachmentClick: d,
104
+ onAttachmentClick: f,
106
105
  attachmentClickLabel: A.attachmentClickLabel
107
106
  }),
108
- /* @__PURE__ */ S(w, {
107
+ /* @__PURE__ */ x(C, {
109
108
  attachments: F,
110
109
  title: A.generatedSectionTitle,
111
110
  searchQuery: M,
112
111
  titleClassName: j?.typography?.sectionTitleClassName,
113
- onAttachmentClick: d,
112
+ onAttachmentClick: f,
114
113
  attachmentClickLabel: A.attachmentClickLabel
115
114
  }),
116
- /* @__PURE__ */ S(E, {
115
+ /* @__PURE__ */ x(T, {
117
116
  sources: I,
118
117
  title: A.sourcesSectionTitle,
119
118
  searchQuery: M,
@@ -123,29 +122,29 @@ var w = g(({ attachments: t, title: n, searchQuery: r, titleClassName: a = "dial
123
122
  copiedLabel: A.sourceCopiedLabel,
124
123
  onSourceClick: p
125
124
  })
126
- ] }), /* @__PURE__ */ C(c, {
127
- isOpen: e,
128
- orientation: s.Right,
125
+ ] }), /* @__PURE__ */ S(s, {
126
+ isOpen: t,
127
+ orientation: o.Right,
129
128
  styles: {
130
- className: g && e ? "w-full" : void 0,
129
+ className: y && t ? "w-full" : void 0,
131
130
  bodyClassName: "flex flex-col overflow-hidden p-0"
132
131
  },
133
132
  labels: A,
134
133
  onClose: n,
135
- resizable: !g,
136
- defaultWidth: b,
137
- minWidth: T,
134
+ resizable: !y,
135
+ defaultWidth: w,
136
+ minWidth: D,
138
137
  maxWidth: O,
139
138
  onResizeStop: k,
140
- rightActions: !L && /* @__PURE__ */ S(f, {
141
- icon: /* @__PURE__ */ S(h, { ...t }),
139
+ rightActions: !L && /* @__PURE__ */ x(d, {
140
+ icon: /* @__PURE__ */ x(m, { ...e }),
142
141
  "aria-label": A.downloadAllLabel,
143
142
  tooltipProps: { tooltip: A.downloadAllLabel },
144
- onClick: m,
145
- disabled: !m
143
+ onClick: h,
144
+ disabled: !h
146
145
  }),
147
146
  children: [
148
- !L && /* @__PURE__ */ S(o, {
147
+ !L && /* @__PURE__ */ x(a, {
149
148
  value: M,
150
149
  onChange: N,
151
150
  labels: {
@@ -153,13 +152,13 @@ var w = g(({ attachments: t, title: n, searchQuery: r, titleClassName: a = "dial
153
152
  clearLabel: A.searchClearLabel
154
153
  }
155
154
  }),
156
- /* @__PURE__ */ S("span", {
155
+ /* @__PURE__ */ x("span", {
157
156
  role: "status",
158
157
  "aria-live": "polite",
159
158
  className: "sr-only",
160
159
  children: R ? A.noResultsLabel : ""
161
160
  }),
162
- /* @__PURE__ */ S("div", {
161
+ /* @__PURE__ */ x("div", {
163
162
  className: "flex-1 overflow-y-auto p-4",
164
163
  children: z
165
164
  })
@@ -167,4 +166,4 @@ var w = g(({ attachments: t, title: n, searchQuery: r, titleClassName: a = "dial
167
166
  });
168
167
  });
169
168
  //#endregion
170
- export { O as ConversationSourcesPanel };
169
+ export { D as ConversationSourcesPanel };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-source-panel",
3
3
  "description": "Panel for displaying conversation sources — uploaded files and generated citations",
4
- "version": "1.1.0-dev.119",
4
+ "version": "1.1.0-dev.121",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -19,9 +19,9 @@
19
19
  "peerDependencies": {
20
20
  "react": "^19.0.0",
21
21
  "@tabler/icons-react": "^3.0.0",
22
- "@epam/ai-dial-chat-shared": "1.1.0-dev.119",
23
- "@epam/ai-dial-sidebar": "1.1.0-dev.119",
24
- "@epam/ai-dial-conversation-input": "1.1.0-dev.119",
22
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.121",
23
+ "@epam/ai-dial-sidebar": "1.1.0-dev.121",
24
+ "@epam/ai-dial-conversation-input": "1.1.0-dev.121",
25
25
  "@epam/ai-dial-ui-kit": "^0.13.0-dev.26"
26
26
  },
27
27
  "repository": {