@epam/ai-dial-source-panel 1.0.0-dev.456 → 1.0.0-dev.459

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":"ConversationSourcesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/ConversationSourcesPanel/ConversationSourcesPanel.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAGnG,YAAY,EACV,8BAA8B,EAC9B,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,+CAA+C,CAAC;;AAyIvD,wBAA8C"}
1
+ {"version":3,"file":"ConversationSourcesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/ConversationSourcesPanel/ConversationSourcesPanel.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,+CAA+C,CAAC;AAGnG,YAAY,EACV,8BAA8B,EAC9B,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,+CAA+C,CAAC;;AA4IvD,wBAA8C"}
@@ -5,6 +5,8 @@ interface FilesSectionProps {
5
5
  attachments: DisplayAttachment[];
6
6
  /** Heading text rendered above the attachment grid. */
7
7
  title: string;
8
+ /** Current search query — used to highlight matches in attachment names. */
9
+ searchQuery?: string;
8
10
  /** CSS class applied to the section heading. Defaults to `'dial-body-semi-text'`. */
9
11
  titleClassName?: string;
10
12
  /** Called when the user clicks an attachment card. */
@@ -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,UAAU,iBAAiB;IACzB,kEAAkE;IAClE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,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;;AA2CD,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,UAAU,iBAAiB;IACzB,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"}
@@ -6,6 +6,8 @@ interface SourcesSectionProps {
6
6
  sources: QuotationSource[];
7
7
  /** Accessible label for each source's copy-URL button. */
8
8
  copyLabel: string;
9
+ /** Current search query — used to highlight matches in source titles and quotes. */
10
+ searchQuery?: string;
9
11
  /** CSS class applied to the section heading. Defaults to `'dial-body-semi-text'`. */
10
12
  titleClassName?: string;
11
13
  /** CSS class applied to each source link. Defaults to `'dial-small-text !text-accent-primary'`. */
@@ -1 +1 @@
1
- {"version":3,"file":"SourcesSection.d.ts","sourceRoot":"","sources":["../../../src/components/SourcesSection/SourcesSection.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,UAAU,mBAAmB;IAC3B,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mGAAmG;IACnG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0FAA0F;IAC1F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CACnD;;AAiED,wBAAoC"}
1
+ {"version":3,"file":"SourcesSection.d.ts","sourceRoot":"","sources":["../../../src/components/SourcesSection/SourcesSection.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,UAAU,mBAAmB;IAC3B,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qFAAqF;IACrF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mGAAmG;IACnG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0FAA0F;IAC1F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;CACnD;;AA0ED,wBAAoC"}
package/index.js CHANGED
@@ -2,70 +2,75 @@ import { PanelEmpty as e, PanelNoResults as t, SearchInput as n, SidebarOrientat
2
2
  import { DIAL_ICON_SIZE as a, DialGhostIconButton as o, ElementSize as s } from "@epam/ai-dial-ui-kit";
3
3
  import { IconCopy as c, IconDownload as l } from "@tabler/icons-react";
4
4
  import { memo as u, useLayoutEffect as d, useMemo as f, useState as p } from "react";
5
- import { AttachmentType as m, mergeClasses as h } from "@epam/ai-dial-chat-shared";
6
- import { AttachmentCard as g } from "@epam/ai-dial-conversation-input";
7
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
8
- var b = u(({ attachments: e, title: t, titleClassName: n = "dial-body-semi-text", onAttachmentClick: r, attachmentClickLabel: i }) => e.length === 0 ? null : /* @__PURE__ */ y("section", {
5
+ import { AttachmentType as m, Highlight as h, mergeClasses as g } from "@epam/ai-dial-chat-shared";
6
+ import { AttachmentCard as _ } from "@epam/ai-dial-conversation-input";
7
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
8
+ var x = u(({ attachments: e, title: t, searchQuery: n, titleClassName: r = "dial-body-semi-text", onAttachmentClick: i, attachmentClickLabel: a }) => e.length === 0 ? null : /* @__PURE__ */ b("section", {
9
9
  className: "mb-6",
10
- children: [/* @__PURE__ */ v("h2", {
11
- className: h(n, "mb-3"),
10
+ children: [/* @__PURE__ */ y("h2", {
11
+ className: g(r, "mb-3"),
12
12
  children: t
13
- }), /* @__PURE__ */ v("div", {
13
+ }), /* @__PURE__ */ y("div", {
14
14
  role: "list",
15
15
  className: "grid grid-cols-[repeat(auto-fill,minmax(100px,1fr))] gap-3",
16
- children: e.map((e) => /* @__PURE__ */ v("div", {
16
+ children: e.map((e) => /* @__PURE__ */ y("div", {
17
17
  role: "listitem",
18
18
  className: e.type === m.Audio ? "col-span-full" : void 0,
19
- children: /* @__PURE__ */ v(g, {
19
+ children: /* @__PURE__ */ y(_, {
20
20
  attachment: e,
21
+ searchQuery: n,
21
22
  className: "w-full",
22
- onClick: r ? () => r(e) : void 0,
23
- clickLabel: i
23
+ onClick: i ? () => i(e) : void 0,
24
+ clickLabel: a
24
25
  })
25
26
  }, e.id))
26
27
  })]
27
- })), x = u(({ title: e, sources: t, copyLabel: n, titleClassName: r = "dial-body-semi-text", linkClassName: i = "dial-small-text !text-accent-primary", quoteClassName: l = "dial-tiny-text text-secondary", onSourceClick: u }) => t.length === 0 ? null : /* @__PURE__ */ y("section", {
28
+ })), S = u(({ title: e, sources: t, copyLabel: n, searchQuery: r = "", titleClassName: i = "dial-body-semi-text", linkClassName: l = "dial-small-text !text-accent-primary", quoteClassName: u = "dial-tiny-text text-secondary", onSourceClick: d }) => t.length === 0 ? null : /* @__PURE__ */ b("section", {
28
29
  className: "mb-6",
29
- children: [/* @__PURE__ */ v("h2", {
30
- className: h(r, "mb-3"),
30
+ children: [/* @__PURE__ */ y("h2", {
31
+ className: g(i, "mb-3"),
31
32
  children: e
32
- }), /* @__PURE__ */ v("ul", {
33
+ }), /* @__PURE__ */ y("ul", {
33
34
  className: "flex flex-col gap-3",
34
- children: t.map((e) => /* @__PURE__ */ y("li", {
35
+ children: t.map((e) => /* @__PURE__ */ b("li", {
35
36
  className: "flex flex-col gap-1",
36
- children: [/* @__PURE__ */ y("div", {
37
+ children: [/* @__PURE__ */ b("div", {
37
38
  className: "flex min-w-0 items-center justify-between gap-2",
38
- children: [/* @__PURE__ */ v("a", {
39
+ children: [/* @__PURE__ */ y("a", {
39
40
  href: e.url,
40
41
  target: "_blank",
41
42
  rel: "noopener noreferrer",
42
- className: h(i, "min-w-0 flex-1 truncate"),
43
- onClick: u ? (t) => {
44
- t.preventDefault(), u(e);
43
+ className: g(l, "min-w-0 flex-1 truncate"),
44
+ onClick: d ? (t) => {
45
+ t.preventDefault(), d(e);
45
46
  } : void 0,
46
- children: e.title
47
- }), /* @__PURE__ */ v(o, {
47
+ children: r ? /* @__PURE__ */ y(h, {
48
+ text: e.title,
49
+ query: r,
50
+ maxLines: 1
51
+ }) : e.title
52
+ }), /* @__PURE__ */ y(o, {
48
53
  size: s.Small,
49
- icon: /* @__PURE__ */ v(c, {
54
+ icon: /* @__PURE__ */ y(c, {
50
55
  size: a.SM,
51
56
  stroke: 1.5
52
57
  }),
53
58
  "aria-label": n,
54
59
  onClick: () => navigator.clipboard.writeText(e.url)
55
60
  })]
56
- }), e.quote && /* @__PURE__ */ v("p", {
57
- className: h(l, "line-clamp-5 max-h-[80px] overflow-hidden"),
61
+ }), e.quote && /* @__PURE__ */ y("p", {
62
+ className: g(u, "line-clamp-5 max-h-[80px] overflow-hidden"),
58
63
  children: e.quote
59
64
  })]
60
65
  }, e.url))
61
66
  })]
62
- })), S = (e, t) => e.toLowerCase().includes(t.toLowerCase()), C = u(({ isOpen: s, onClose: c, uploaded: u, generated: m, sources: h, onAttachmentClick: g, onSourceClick: C, isMobile: w, defaultWidth: T, minWidth: E, maxWidth: D, onResizeStop: O, labels: k, styles: A }) => {
67
+ })), C = (e, t) => e.toLowerCase().includes(t.toLowerCase()), w = u(({ isOpen: s, onClose: c, uploaded: u, generated: m, sources: h, onAttachmentClick: g, onSourceClick: _, isMobile: w, defaultWidth: T, minWidth: E, maxWidth: D, onResizeStop: O, labels: k, styles: A }) => {
63
68
  let [j, M] = p("");
64
69
  d(() => {
65
70
  s || M("");
66
71
  }, [s]);
67
- let N = f(() => j ? u.filter((e) => S(e.name, j)) : u, [u, j]), P = f(() => j ? m.filter((e) => S(e.name, j)) : m, [m, j]), F = f(() => j ? h.filter((e) => S(e.title, j) || S(e.url, j) || e.quote != null && S(e.quote, j)) : h, [h, j]), I = u.length === 0 && m.length === 0 && h.length === 0, L = j !== "" && N.length === 0 && P.length === 0 && F.length === 0;
68
- return /* @__PURE__ */ y(i, {
72
+ let N = f(() => j ? u.filter((e) => C(e.name, j)) : u, [u, j]), P = f(() => j ? m.filter((e) => C(e.name, j)) : m, [m, j]), F = f(() => j ? h.filter((e) => C(e.title, j) || C(e.url, j) || e.quote != null && C(e.quote, j)) : h, [h, j]), I = u.length === 0 && m.length === 0 && h.length === 0, L = j !== "" && N.length === 0 && P.length === 0 && F.length === 0;
73
+ return /* @__PURE__ */ b(i, {
69
74
  isOpen: s,
70
75
  orientation: r.Right,
71
76
  className: s ? "mobile:w-full" : "w-0",
@@ -78,48 +83,51 @@ var b = u(({ attachments: e, title: t, titleClassName: n = "dial-body-semi-text"
78
83
  minWidth: E,
79
84
  maxWidth: D,
80
85
  onResizeStop: O,
81
- rightActions: !I && /* @__PURE__ */ v(o, {
82
- icon: /* @__PURE__ */ v(l, {
86
+ rightActions: !I && /* @__PURE__ */ y(o, {
87
+ icon: /* @__PURE__ */ y(l, {
83
88
  size: a.LG,
84
89
  stroke: 1.5
85
90
  }),
86
91
  "aria-label": k.downloadAllLabel,
87
92
  disabled: !0
88
93
  }),
89
- children: [!I && /* @__PURE__ */ v(n, {
94
+ children: [!I && /* @__PURE__ */ y(n, {
90
95
  placeholder: k.searchPlaceholder,
91
96
  value: j,
92
97
  onChange: M,
93
98
  clearLabel: k.searchClearLabel
94
- }), /* @__PURE__ */ v("div", {
99
+ }), /* @__PURE__ */ y("div", {
95
100
  className: "flex-1 overflow-y-auto p-4",
96
- children: I ? /* @__PURE__ */ v(e, { label: k.emptyLabel }) : L ? /* @__PURE__ */ v(t, { label: k.noResultsLabel }) : /* @__PURE__ */ y(_, { children: [
97
- /* @__PURE__ */ v(b, {
101
+ children: I ? /* @__PURE__ */ y(e, { label: k.emptyLabel }) : L ? /* @__PURE__ */ y(t, { label: k.noResultsLabel }) : /* @__PURE__ */ b(v, { children: [
102
+ /* @__PURE__ */ y(x, {
98
103
  attachments: N,
99
104
  title: k.uploadedSectionTitle,
105
+ searchQuery: j,
100
106
  titleClassName: A?.sectionTitleClassName,
101
107
  onAttachmentClick: g,
102
108
  attachmentClickLabel: k.attachmentClickLabel
103
109
  }),
104
- /* @__PURE__ */ v(b, {
110
+ /* @__PURE__ */ y(x, {
105
111
  attachments: P,
106
112
  title: k.generatedSectionTitle,
113
+ searchQuery: j,
107
114
  titleClassName: A?.sectionTitleClassName,
108
115
  onAttachmentClick: g,
109
116
  attachmentClickLabel: k.attachmentClickLabel
110
117
  }),
111
- /* @__PURE__ */ v(x, {
118
+ /* @__PURE__ */ y(S, {
112
119
  sources: F,
113
120
  title: k.sourcesSectionTitle,
121
+ searchQuery: j,
114
122
  titleClassName: A?.sectionTitleClassName,
115
123
  linkClassName: A?.sourceLinkClassName,
116
124
  quoteClassName: A?.sourceQuoteClassName,
117
125
  copyLabel: k.copySourceLabel,
118
- onSourceClick: C
126
+ onSourceClick: _
119
127
  })
120
128
  ] })
121
129
  })]
122
130
  });
123
131
  });
124
132
  //#endregion
125
- export { C as ConversationSourcesPanel };
133
+ export { w as ConversationSourcesPanel };
@@ -1,8 +1,12 @@
1
+ /** A source document or attachment referenced in a conversation quotation. */
1
2
  export interface QuotationSource {
3
+ /** URL of the source resource. */
2
4
  url: string;
5
+ /** Human-readable title of the source. */
3
6
  title: string;
4
7
  /** MIME type of the source attachment (e.g. `'application/pdf'`). */
5
8
  contentType: string;
9
+ /** Excerpt from the source that was quoted. */
6
10
  quote?: string;
7
11
  }
8
12
  //# sourceMappingURL=quotation-source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"quotation-source.d.ts","sourceRoot":"","sources":["../../src/models/quotation-source.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
1
+ {"version":3,"file":"quotation-source.d.ts","sourceRoot":"","sources":["../../src/models/quotation-source.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,0CAA0C;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,WAAW,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
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.0.0-dev.456",
4
+ "version": "1.0.0-dev.459",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -19,10 +19,10 @@
19
19
  "peerDependencies": {
20
20
  "react": "^19.0.0",
21
21
  "@tabler/icons-react": "^3.0.0",
22
- "@epam/ai-dial-chat-shared": "1.0.0-dev.456",
22
+ "@epam/ai-dial-chat-shared": "1.0.0-dev.459",
23
23
  "@epam/ai-dial-ui-kit": "0.12.0-dev.25",
24
- "@epam/ai-dial-sidebar": "1.0.0-dev.456",
25
- "@epam/ai-dial-conversation-input": "1.0.0-dev.456"
24
+ "@epam/ai-dial-sidebar": "1.0.0-dev.459",
25
+ "@epam/ai-dial-conversation-input": "1.0.0-dev.459"
26
26
  },
27
27
  "repository": {
28
28
  "type": "git",