@epam/ai-dial-conversation-panel 1.0.0-dev.456 → 1.0.0-dev.460

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.
@@ -10,6 +10,8 @@ export interface ConversationRowProps {
10
10
  isActive: boolean;
11
11
  /** Called when the user clicks the row to select the conversation. */
12
12
  onSelectConversation: (id: string) => void;
13
+ /** Current search query — matched text in the title is highlighted. */
14
+ searchQuery?: string;
13
15
  /**
14
16
  * Builds the dropdown menu items for this row.
15
17
  * Receives the item so actions can reflect per-item state (e.g. pin toggle).
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationRow.d.ts","sourceRoot":"","sources":["../../../src/components/ConversationGroup/ConversationRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAUL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAyC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAK1E,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,qDAAqD;IACrD,QAAQ,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,oBAAoB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,uBAAuB,KAAK,YAAY,EAAE,CAAC;IAC/D,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yFAAyF;IACzF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yEAAyE;IACzE,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC;IACnC,mEAAmE;IACnE,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC;IACpB,qFAAqF;IACrF,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,8FAA8F;IAC9F,iBAAiB,CAAC,EAAE,GAAG,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;IACrD,qDAAqD;IACrD,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,mDAAmD;IACnD,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,gDAAgD;IAChD,MAAM,CAAC,EAAE,CACP,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,oBAAoB,EACpC,OAAO,EAAE,MAAM,GAAG,IAAI,KACnB,IAAI,CAAC;CACX;AAED,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAgKpD,CAAC"}
1
+ {"version":3,"file":"ConversationRow.d.ts","sourceRoot":"","sources":["../../../src/components/ConversationGroup/ConversationRow.tsx"],"names":[],"mappings":"AAKA,OAAO,EASL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAyC,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAK1E,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,qDAAqD;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
1
- {"version":3,"file":"ConversationPanel.d.ts","sourceRoot":"","sources":["../../../src/components/ConversationPanel/ConversationPanel.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,EAAE,EAOR,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAyBlE,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CA+WxD,CAAC"}
1
+ {"version":3,"file":"ConversationPanel.d.ts","sourceRoot":"","sources":["../../../src/components/ConversationPanel/ConversationPanel.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,EAAE,EAOR,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAyBlE,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAgZxD,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { RowComponentProps } from 'react-window';
2
2
  import { RowRendererData } from '../../models/virtual-row';
3
3
  /** Renders a single virtual row — either a collapsible group header or a conversation item. */
4
- export declare const RowRenderer: ({ index, style, rows, expandedGroups, onToggleGroup, activeConversationId, onSelectConversation, getActions, actionsLabel, groupHeaderClassName, itemTitleClassName, itemIconBadgeClassName, draggingId, dragOverId, allowedDropGroups, onDragStart, onDragEnd, onDragOver, onDragLeave, onDrop, }: RowComponentProps<RowRendererData>) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const RowRenderer: ({ index, style, rows, expandedGroups, onToggleGroup, activeConversationId, searchQuery, onSelectConversation, getActions, actionsLabel, groupHeaderClassName, itemTitleClassName, itemIconBadgeClassName, draggingId, dragOverId, allowedDropGroups, onDragStart, onDragEnd, onDragOver, onDragLeave, onDrop, }: RowComponentProps<RowRendererData>) => import("react/jsx-runtime").JSX.Element;
5
5
  //# sourceMappingURL=RowRenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RowRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/RowRenderer/RowRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,0BAA0B,CAAC;AAKhF,+FAA+F;AAC/F,eAAO,MAAM,WAAW,GAAI,oSAqBzB,iBAAiB,CAAC,eAAe,CAAC,4CAiDpC,CAAC"}
1
+ {"version":3,"file":"RowRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/RowRenderer/RowRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,0BAA0B,CAAC;AAKhF,+FAA+F;AAC/F,eAAO,MAAM,WAAW,GAAI,iTAsBzB,iBAAiB,CAAC,eAAe,CAAC,4CAkDpC,CAAC"}
package/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { DeploymentIcon as e, buildCssVars as t, mergeClasses as n } from "@epam/ai-dial-chat-shared";
2
- import { PanelEmpty as r, PanelNoResults as i, SearchInput as a, SidebarOrientation as o, SidebarPanel as s } from "@epam/ai-dial-sidebar";
3
- import { ButtonAppearance as c, DIAL_ICON_SIZE as l, DialButton as u, DialDropdown as d, DialEllipsisTooltip as f, DialIconButton as p, DialSkeleton as m, DialSkeletonVariant as h, DialTag as g, ElementSize as _ } from "@epam/ai-dial-ui-kit";
4
- import { createElement as v, memo as y, useCallback as b, useEffect as x, useImperativeHandle as S, useLayoutEffect as C, useMemo as w, useRef as T, useState as E } from "react";
5
- import { jsx as D, jsxs as O } from "react/jsx-runtime";
6
- import { IconCaretDownFilled as k, IconCaretRightFilled as A, IconDotsVertical as j, IconPlus as M } from "@tabler/icons-react";
1
+ import { DeploymentIcon as e, Highlight as t, buildCssVars as n, mergeClasses as r } from "@epam/ai-dial-chat-shared";
2
+ import { PanelEmpty as i, PanelNoResults as a, SearchInput as o, SidebarOrientation as s, SidebarPanel as c } from "@epam/ai-dial-sidebar";
3
+ import { ButtonAppearance as l, DIAL_ICON_SIZE as u, DialButton as d, DialDropdown as f, DialEllipsisTooltip as p, DialIconButton as m, DialSkeleton as h, DialSkeletonVariant as g, DialTag as _, ElementSize as v } from "@epam/ai-dial-ui-kit";
4
+ import { createElement as y, memo as b, useCallback as x, useEffect as S, useImperativeHandle as C, useLayoutEffect as w, useMemo as T, useRef as E, useState as D } from "react";
5
+ import { jsx as O, jsxs as k } from "react/jsx-runtime";
6
+ import { IconCaretDownFilled as A, IconCaretRightFilled as j, IconDotsVertical as M, IconPlus as N } from "@tabler/icons-react";
7
7
  //#region ../../node_modules/react-window/dist/react-window.js
8
- var N = typeof window < "u" ? C : x;
9
- function P(e) {
8
+ var P = typeof window < "u" ? w : S;
9
+ function F(e) {
10
10
  if (e !== void 0) switch (typeof e) {
11
11
  case "number": return e;
12
12
  case "string":
@@ -14,15 +14,15 @@ function P(e) {
14
14
  break;
15
15
  }
16
16
  }
17
- function F({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
18
- let { styleHeight: s, styleWidth: c } = w(() => ({
19
- styleHeight: P(o?.height),
20
- styleWidth: P(o?.width)
21
- }), [o?.height, o?.width]), [l, u] = E({
17
+ function ee({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
18
+ let { styleHeight: s, styleWidth: c } = T(() => ({
19
+ styleHeight: F(o?.height),
20
+ styleWidth: F(o?.width)
21
+ }), [o?.height, o?.width]), [l, u] = D({
22
22
  height: t,
23
23
  width: n
24
24
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
25
- return N(() => {
25
+ return P(() => {
26
26
  if (i === null || d) return;
27
27
  let t = new ResizeObserver((e) => {
28
28
  for (let t of e) {
@@ -42,7 +42,7 @@ function F({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
42
42
  i,
43
43
  s,
44
44
  c
45
- ]), w(() => ({
45
+ ]), T(() => ({
46
46
  height: s ?? l.height,
47
47
  width: c ?? l.width
48
48
  }), [
@@ -51,16 +51,16 @@ function F({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
51
51
  c
52
52
  ]);
53
53
  }
54
- function ee(e) {
55
- let t = T(() => {
54
+ function te(e) {
55
+ let t = E(() => {
56
56
  throw Error("Cannot call during render.");
57
57
  });
58
- return N(() => {
58
+ return P(() => {
59
59
  t.current = e;
60
- }, [e]), b((e) => t.current?.(e), [t]);
60
+ }, [e]), x((e) => t.current?.(e), [t]);
61
61
  }
62
62
  var I = null;
63
- function te(e = !1) {
63
+ function ne(e = !1) {
64
64
  if (I === null || e) {
65
65
  let e = document.createElement("div"), t = e.style;
66
66
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
@@ -70,7 +70,7 @@ function te(e = !1) {
70
70
  return I;
71
71
  }
72
72
  function L({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
- if (t === "horizontal" && n) switch (te()) {
73
+ if (t === "horizontal" && n) switch (ne()) {
74
74
  case "negative": return -r;
75
75
  case "positive-descending":
76
76
  if (e) {
@@ -98,7 +98,7 @@ function B({ cachedBounds: e, itemCount: t, itemSize: n }) {
98
98
  return R(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
99
99
  }
100
100
  }
101
- function ne({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
101
+ function V({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
102
102
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
103
103
  let s = B({
104
104
  cachedBounds: t,
@@ -112,7 +112,7 @@ function ne({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
112
112
  default: return a >= u && a <= l ? a : a < u ? u : l;
113
113
  }
114
114
  }
115
- function V({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
115
+ function H({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
116
116
  let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
117
117
  for (; u < a;) {
118
118
  let n = e.get(u);
@@ -131,7 +131,7 @@ function V({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCo
131
131
  stopIndexOverscan: l
132
132
  };
133
133
  }
134
- function H({ itemCount: e, itemProps: t, itemSize: n }) {
134
+ function U({ itemCount: e, itemProps: t, itemSize: n }) {
135
135
  let r = /* @__PURE__ */ new Map();
136
136
  return {
137
137
  get(i) {
@@ -168,8 +168,8 @@ function H({ itemCount: e, itemProps: t, itemSize: n }) {
168
168
  }
169
169
  };
170
170
  }
171
- function U({ itemCount: e, itemProps: t, itemSize: n }) {
172
- return w(() => H({
171
+ function re({ itemCount: e, itemProps: t, itemSize: n }) {
172
+ return T(() => U({
173
173
  itemCount: e,
174
174
  itemProps: t,
175
175
  itemSize: n
@@ -179,7 +179,7 @@ function U({ itemCount: e, itemProps: t, itemSize: n }) {
179
179
  n
180
180
  ]);
181
181
  }
182
- function re({ containerSize: e, itemSize: t }) {
182
+ function W({ containerSize: e, itemSize: t }) {
183
183
  let n;
184
184
  switch (typeof t) {
185
185
  case "string":
@@ -191,21 +191,21 @@ function re({ containerSize: e, itemSize: t }) {
191
191
  }
192
192
  return n;
193
193
  }
194
- function W({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
195
- let { height: u = n, width: d = n } = F({
194
+ function ie({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
195
+ let { height: u = n, width: d = n } = ee({
196
196
  defaultHeight: r === "vertical" ? n : void 0,
197
197
  defaultWidth: r === "horizontal" ? n : void 0,
198
198
  element: e,
199
199
  mode: r === "vertical" ? "only-height" : "only-width",
200
200
  style: t
201
- }), f = T({
201
+ }), f = E({
202
202
  height: 0,
203
203
  width: 0
204
- }), p = r === "vertical" ? u : d, m = re({
204
+ }), p = r === "vertical" ? u : d, m = W({
205
205
  containerSize: p,
206
206
  itemSize: s
207
207
  });
208
- C(() => {
208
+ w(() => {
209
209
  if (typeof c == "function") {
210
210
  let e = f.current;
211
211
  (e.height !== u || e.width !== d) && (c({
@@ -218,22 +218,22 @@ function W({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
218
218
  c,
219
219
  d
220
220
  ]);
221
- let h = U({
221
+ let h = re({
222
222
  itemCount: a,
223
223
  itemProps: o,
224
224
  itemSize: m
225
- }), g = b((e) => h.get(e), [h]), [_, v] = E(() => V({
225
+ }), g = x((e) => h.get(e), [h]), [_, v] = D(() => H({
226
226
  cachedBounds: h,
227
227
  containerScrollOffset: 0,
228
228
  containerSize: p,
229
229
  itemCount: a,
230
230
  overscanCount: l
231
- })), { startIndexVisible: y, startIndexOverscan: x, stopIndexVisible: S, stopIndexOverscan: w } = {
231
+ })), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible: S, stopIndexOverscan: C } = {
232
232
  startIndexVisible: Math.min(a - 1, _.startIndexVisible),
233
233
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
234
234
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
235
235
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
236
- }, D = b(() => B({
236
+ }, T = x(() => B({
237
237
  cachedBounds: h,
238
238
  itemCount: a,
239
239
  itemSize: m
@@ -241,7 +241,7 @@ function W({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
241
241
  h,
242
242
  a,
243
243
  m
244
- ]), O = b((t) => V({
244
+ ]), O = x((t) => H({
245
245
  cachedBounds: h,
246
246
  containerScrollOffset: L({
247
247
  containerElement: e,
@@ -261,17 +261,17 @@ function W({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
261
261
  a,
262
262
  l
263
263
  ]);
264
- return N(() => {
264
+ return P(() => {
265
265
  v(O((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
266
266
  }, [
267
267
  e,
268
268
  r,
269
269
  O
270
- ]), N(() => {
270
+ ]), P(() => {
271
271
  if (!e) return;
272
272
  let t = () => {
273
273
  v((t) => {
274
- let { scrollLeft: n, scrollTop: o } = e, s = V({
274
+ let { scrollLeft: n, scrollTop: o } = e, s = H({
275
275
  cachedBounds: h,
276
276
  containerScrollOffset: L({
277
277
  containerElement: e,
@@ -298,9 +298,9 @@ function W({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
298
298
  l
299
299
  ]), {
300
300
  getCellBounds: g,
301
- getEstimatedSize: D,
302
- scrollToIndex: ee(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
303
- let s = ne({
301
+ getEstimatedSize: T,
302
+ scrollToIndex: te(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
303
+ let s = V({
304
304
  align: t,
305
305
  cachedBounds: h,
306
306
  containerScrollOffset: n,
@@ -322,41 +322,41 @@ function W({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
322
322
  return s;
323
323
  }
324
324
  }),
325
- startIndexOverscan: x,
325
+ startIndexOverscan: b,
326
326
  startIndexVisible: y,
327
- stopIndexOverscan: w,
327
+ stopIndexOverscan: C,
328
328
  stopIndexVisible: S
329
329
  };
330
330
  }
331
- function ie(e) {
332
- return w(() => e, Object.values(e));
331
+ function G(e) {
332
+ return T(() => e, Object.values(e));
333
333
  }
334
- function G(e, t) {
334
+ function ae(e, t) {
335
335
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
336
336
  return z(n, a) && z(r, o) && z(i, s);
337
337
  }
338
- function ae(e) {
338
+ function oe(e) {
339
339
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
340
340
  }
341
- var oe = "data-react-window-index";
342
- function se({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
343
- let m = ie(u), h = w(() => y(s, G), [s]), [g, _] = E(null), b = ae(l), { getCellBounds: C, getEstimatedSize: T, scrollToIndex: O, startIndexOverscan: k, startIndexVisible: A, stopIndexOverscan: j, stopIndexVisible: M } = W({
341
+ var se = "data-react-window-index";
342
+ function ce({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
343
+ let m = G(u), h = T(() => b(s, ae), [s]), [g, _] = D(null), v = oe(l), { getCellBounds: x, getEstimatedSize: w, scrollToIndex: E, startIndexOverscan: k, startIndexVisible: A, stopIndexOverscan: j, stopIndexVisible: M } = ie({
344
344
  containerElement: g,
345
345
  containerStyle: f,
346
346
  defaultContainerSize: n,
347
347
  direction: "vertical",
348
348
  itemCount: c,
349
349
  itemProps: m,
350
- itemSize: w(() => b ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [b, l]),
350
+ itemSize: T(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
351
351
  onResize: i,
352
352
  overscanCount: o
353
353
  });
354
- S(r, () => ({
354
+ C(r, () => ({
355
355
  get element() {
356
356
  return g;
357
357
  },
358
358
  scrollToRow({ align: e = "auto", behavior: t = "auto", index: n }) {
359
- let r = O({
359
+ let r = E({
360
360
  align: e,
361
361
  containerScrollOffset: g?.scrollTop ?? 0,
362
362
  index: n
@@ -366,21 +366,21 @@ function se({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
366
366
  top: r
367
367
  });
368
368
  }
369
- }), [g, O]), N(() => {
369
+ }), [g, E]), P(() => {
370
370
  if (!g) return;
371
371
  let e = Array.from(g.children).filter((e, t) => {
372
372
  if (e.hasAttribute("aria-hidden")) return !1;
373
373
  let n = `${k + t}`;
374
- return e.setAttribute(oe, n), !0;
374
+ return e.setAttribute(se, n), !0;
375
375
  });
376
- if (b) return l.observeRowElements(e);
376
+ if (v) return l.observeRowElements(e);
377
377
  }, [
378
378
  g,
379
- b,
379
+ v,
380
380
  l,
381
381
  k,
382
382
  j
383
- ]), x(() => {
383
+ ]), S(() => {
384
384
  k >= 0 && j >= 0 && a && a({
385
385
  startIndex: A,
386
386
  stopIndex: M
@@ -395,11 +395,11 @@ function se({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
395
395
  j,
396
396
  M
397
397
  ]);
398
- let P = w(() => {
398
+ let N = T(() => {
399
399
  let e = [];
400
400
  if (c > 0) for (let t = k; t <= j; t++) {
401
- let n = C(t);
402
- e.push(/* @__PURE__ */ v(h, {
401
+ let n = x(t);
402
+ e.push(/* @__PURE__ */ y(h, {
403
403
  ...m,
404
404
  ariaAttributes: {
405
405
  "aria-posinset": t + 1,
@@ -412,7 +412,7 @@ function se({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
412
412
  position: "absolute",
413
413
  left: 0,
414
414
  transform: `translateY(${n.scrollOffset}px)`,
415
- height: b ? void 0 : n.size,
415
+ height: v ? void 0 : n.size,
416
416
  width: "100%"
417
417
  }
418
418
  }));
@@ -420,21 +420,21 @@ function se({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
420
420
  return e;
421
421
  }, [
422
422
  h,
423
- C,
424
- b,
423
+ x,
424
+ v,
425
425
  c,
426
426
  m,
427
427
  k,
428
428
  j
429
- ]), F = /* @__PURE__ */ D("div", {
429
+ ]), F = /* @__PURE__ */ O("div", {
430
430
  "aria-hidden": !0,
431
431
  style: {
432
- height: T(),
432
+ height: w(),
433
433
  width: "100%",
434
434
  zIndex: -1
435
435
  }
436
436
  });
437
- return v(d, {
437
+ return y(d, {
438
438
  role: "list",
439
439
  ...p,
440
440
  className: t,
@@ -446,7 +446,7 @@ function se({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
446
446
  overflowY: "auto",
447
447
  ...f
448
448
  }
449
- }, P, e, F);
449
+ }, N, e, F);
450
450
  }
451
451
  //#endregion
452
452
  //#region src/types/virtual-row.ts
@@ -458,25 +458,25 @@ var K = /* @__PURE__ */ function(e) {
458
458
  return e.MyChats = "my-chats", e.Shared = "shared", e.Organization = "organization", e;
459
459
  }({}), Y = /* @__PURE__ */ function(e) {
460
460
  return e.All = "all", e.MyChats = "my-chats", e.Shared = "shared", e.Organization = "organization", e;
461
- }({}), ce = (e) => `${60 + e * 23 % 35}%`, le = (e, t) => e ? t ? "pe-9" : "pe-2 group-hover/conversation:pe-9" : "pe-3", ue = (e, t) => t.rows[e].kind === K.Item ? 36 : e === 0 ? 24 : 56, de = (e) => {
461
+ }({}), le = (e) => `${60 + e * 23 % 35}%`, ue = (e, t) => e ? t ? "pe-9" : "pe-2 group-hover/conversation:pe-9" : "pe-3", de = (e, t) => t.rows[e].kind === K.Item ? 36 : e === 0 ? 24 : 56, fe = (e) => {
462
462
  switch (e) {
463
463
  case J.Shared: return q.Shared;
464
464
  case J.Organization: return q.Organization;
465
465
  default: return q.MyChats;
466
466
  }
467
- }, fe = (e, t) => {
467
+ }, pe = (e, t) => {
468
468
  let n = null;
469
469
  for (let r of e) if (r.kind === K.Header) n = r.groupKey;
470
470
  else if (r.item.id === t) return n;
471
471
  return null;
472
- }, pe = (e, t, n) => {
472
+ }, me = (e, t, n) => {
473
473
  let r = /* @__PURE__ */ new Set();
474
474
  if (t != null && r.add(t), t === q.Pinned) {
475
475
  let t = n.find((t) => t.id === e);
476
- t && r.add(de(t.source));
476
+ t && r.add(fe(t.source));
477
477
  } else r.add(q.Pinned);
478
478
  return r;
479
- }, me = (e, t, n, r) => {
479
+ }, he = (e, t, n, r) => {
480
480
  let i = e.currentTarget.getBoundingClientRect();
481
481
  if (e.clientY >= i.top + i.height / 2) return t;
482
482
  let a = null, o = !1;
@@ -490,7 +490,7 @@ var K = /* @__PURE__ */ function(e) {
490
490
  filterTabs: "_filterTabs_3jujg_1",
491
491
  tab: "_tab_3jujg_4",
492
492
  tabActive: "_tabActive_3jujg_16"
493
- }, he = [
493
+ }, ge = [
494
494
  {
495
495
  value: Y.All,
496
496
  labelKey: "all"
@@ -507,26 +507,26 @@ var K = /* @__PURE__ */ function(e) {
507
507
  value: Y.Organization,
508
508
  labelKey: "organization"
509
509
  }
510
- ], ge = y(({ activeTab: e, labels: t, onChange: r, tabClassName: i = "dial-tiny-semi-text" }) => /* @__PURE__ */ D("div", {
511
- className: n("mx-3 my-2 flex flex-nowrap gap-1", X.filterTabs),
512
- children: he.map(({ value: a, labelKey: o }) => /* @__PURE__ */ D(g, {
510
+ ], _e = b(({ activeTab: e, labels: t, onChange: n, tabClassName: i = "dial-tiny-semi-text" }) => /* @__PURE__ */ O("div", {
511
+ className: r("mx-3 my-2 flex flex-nowrap gap-1", X.filterTabs),
512
+ children: ge.map(({ value: a, labelKey: o }) => /* @__PURE__ */ O(_, {
513
513
  label: t[o],
514
514
  selected: e === a,
515
- onClick: () => r(a),
516
- className: n("box-border h-auto flex-1 justify-center rounded-full p-2 text-center", i, X.tab, e === a && X.tabActive)
515
+ onClick: () => n(a),
516
+ className: r("box-border h-auto flex-1 justify-center rounded-full p-2 text-center", i, X.tab, e === a && X.tabActive)
517
517
  }, a))
518
- })), _e = { button: "_button_1blz1_1" }, ve = y(({ label: e, onClick: t, labelClassName: r = "dial-small-semi-text" }) => /* @__PURE__ */ D("div", {
518
+ })), ve = { button: "_button_1blz1_1" }, ye = b(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text" }) => /* @__PURE__ */ O("div", {
519
519
  className: "px-3 py-2",
520
- children: /* @__PURE__ */ O("button", {
520
+ children: /* @__PURE__ */ k("button", {
521
521
  onClick: t,
522
522
  type: "button",
523
- className: n("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 px-3 py-1", _e.button),
524
- children: [/* @__PURE__ */ D(M, {
523
+ className: r("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 px-3 py-1", ve.button),
524
+ children: [/* @__PURE__ */ O(N, {
525
525
  size: 18,
526
526
  stroke: 2,
527
527
  className: "shrink-0"
528
- }), /* @__PURE__ */ D("span", {
529
- className: r,
528
+ }), /* @__PURE__ */ O("span", {
529
+ className: n,
530
530
  children: e
531
531
  })]
532
532
  })
@@ -538,84 +538,86 @@ var K = /* @__PURE__ */ function(e) {
538
538
  trigger: "_trigger_1o9mn_21",
539
539
  triggerActive: "_triggerActive_1o9mn_21",
540
540
  triggerIcon: "_triggerIcon_1o9mn_24"
541
- }, ye = ({ item: t, isActive: r, onSelectConversation: i, getActions: a, actionsLabel: o = "More actions", itemTitleClassName: s = "dial-small-text", itemIconBadgeClassName: g, rowGroupKey: v, rows: y, draggingId: x, dragOverId: S, allowedDropGroups: C, onDragStart: w, onDragEnd: T, onDragOver: k, onDragLeave: A, onDrop: M }) => {
542
- let [N, P] = E(!1), F = a?.(t) ?? [], ee = F.length > 0, I = t.isIconLoading ? /* @__PURE__ */ D(m, {
543
- variant: h.Circular,
544
- width: l.LG,
545
- height: l.LG,
541
+ }, be = ({ item: n, isActive: i, onSelectConversation: a, searchQuery: o = "", getActions: s, actionsLabel: c = "More actions", itemTitleClassName: p = "dial-small-text", itemIconBadgeClassName: _, rowGroupKey: y, rows: b, draggingId: S, dragOverId: C, allowedDropGroups: w, onDragStart: T, onDragEnd: E, onDragOver: A, onDragLeave: j, onDrop: N }) => {
542
+ let [P, F] = D(!1), ee = s?.(n) ?? [], te = ee.length > 0, I = n.isIconLoading ? /* @__PURE__ */ O(h, {
543
+ variant: g.Circular,
544
+ width: u.LG,
545
+ height: u.LG,
546
546
  color: "var(--bg-layer-4)",
547
547
  "aria-hidden": !0
548
- }) : /* @__PURE__ */ D(e, {
549
- src: t.iconUrl,
550
- size: l.LG,
551
- initialsName: t.iconTooltip ?? "",
552
- tooltip: t.iconTooltip,
553
- badgeClassName: g
554
- }), te = le(ee, N), L = v != null, R = b((e) => {
555
- e.currentTarget.contains(e.relatedTarget) || A?.();
556
- }, [A]), z = b((e) => {
557
- if (!v || !y || !M) return;
548
+ }) : /* @__PURE__ */ O(e, {
549
+ src: n.iconUrl,
550
+ size: u.LG,
551
+ initialsName: n.iconTooltip ?? "",
552
+ tooltip: n.iconTooltip,
553
+ badgeClassName: _
554
+ }), ne = ue(te, P), L = y != null, R = x((e) => {
555
+ e.currentTarget.contains(e.relatedTarget) || j?.();
556
+ }, [j]), z = x((e) => {
557
+ if (!y || !b || !N) return;
558
558
  e.preventDefault();
559
- let n = me(e, t.id, y, v);
560
- M(t.id, v, n);
559
+ let t = he(e, n.id, b, y);
560
+ N(n.id, y, t);
561
561
  }, [
562
- t.id,
562
+ n.id,
563
+ b,
563
564
  y,
564
- v,
565
- M
566
- ]), B = t.id === x, ne = t.id === S, V = v != null && (C?.has(v) ?? !1);
567
- return /* @__PURE__ */ O("li", {
568
- className: n("group/conversation relative", B && "cursor-grabbing opacity-50", ne && V && "ring-accent-secondary rounded ring-1 ring-inset", x != null && !B && !V && "cursor-not-allowed"),
565
+ N
566
+ ]), B = n.id === S, V = n.id === C, H = y != null && (w?.has(y) ?? !1);
567
+ return /* @__PURE__ */ k("li", {
568
+ className: r("group/conversation relative", B && "cursor-grabbing opacity-50", V && H && "ring-accent-secondary rounded ring-1 ring-inset", S != null && !B && !H && "cursor-not-allowed"),
569
569
  draggable: L || void 0,
570
- onDragStart: L ? () => w?.(t.id) : void 0,
571
- onDragEnd: L ? T : void 0,
570
+ onDragStart: L ? () => T?.(n.id) : void 0,
571
+ onDragEnd: L ? E : void 0,
572
572
  onDragOver: L ? (e) => {
573
- e.preventDefault(), k?.(t.id);
573
+ e.preventDefault(), A?.(n.id);
574
574
  } : void 0,
575
575
  onDragLeave: L ? R : void 0,
576
576
  onDrop: L ? z : void 0,
577
- children: [/* @__PURE__ */ D("a", {
578
- href: t.href,
577
+ children: [/* @__PURE__ */ O("a", {
578
+ href: n.href,
579
579
  className: "contents",
580
580
  onClick: (e) => e.preventDefault(),
581
- children: /* @__PURE__ */ D(u, {
581
+ children: /* @__PURE__ */ O(d, {
582
582
  iconBefore: I,
583
- label: /* @__PURE__ */ D(f, {
584
- text: t.title,
585
- className: s
583
+ label: /* @__PURE__ */ O(t, {
584
+ text: n.title,
585
+ query: o,
586
+ className: p,
587
+ maxLines: 1
586
588
  }),
587
589
  textClassName: "min-w-0",
588
- "aria-current": r ? "page" : void 0,
589
- onClick: () => i(t.id),
590
- tabIndex: t.href ? -1 : void 0,
591
- className: n("flex h-8 w-full items-center justify-start gap-2 rounded-xl py-2 ps-3", te, Z.item, r && Z.itemActive, N && Z.itemActive)
590
+ "aria-current": i ? "page" : void 0,
591
+ onClick: () => a(n.id),
592
+ tabIndex: n.href ? -1 : void 0,
593
+ className: r("flex h-8 w-full items-center justify-start gap-2 rounded-xl py-2 ps-3", ne, Z.item, i && Z.itemActive, P && Z.itemActive)
592
594
  })
593
- }), ee && /* @__PURE__ */ D("div", {
594
- className: n("absolute inset-y-0 end-1 flex items-center", N ? "opacity-100" : "opacity-0 group-hover/conversation:opacity-100"),
595
- children: /* @__PURE__ */ D(d, {
596
- items: F,
597
- onOpenChange: P,
595
+ }), te && /* @__PURE__ */ O("div", {
596
+ className: r("absolute inset-y-0 end-1 flex items-center", P ? "opacity-100" : "opacity-0 group-hover/conversation:opacity-100"),
597
+ children: /* @__PURE__ */ O(f, {
598
+ items: ee,
599
+ onOpenChange: F,
598
600
  matchReferenceWidth: !1,
599
601
  listClassName: "w-[140px] cp-dropdown-overlay",
600
- children: /* @__PURE__ */ D(p, {
601
- icon: /* @__PURE__ */ D(j, {
602
- size: l.SM,
602
+ children: /* @__PURE__ */ O(m, {
603
+ icon: /* @__PURE__ */ O(M, {
604
+ size: u.SM,
603
605
  className: Z.triggerIcon
604
606
  }),
605
- appearance: c.Ghost,
606
- size: _.Small,
607
- "aria-label": o,
608
- className: n("flex items-center justify-center rounded", Z.trigger, N && Z.triggerActive)
607
+ appearance: l.Ghost,
608
+ size: v.Small,
609
+ "aria-label": c,
610
+ className: r("flex items-center justify-center rounded", Z.trigger, P && Z.triggerActive)
609
611
  })
610
612
  })
611
613
  })]
612
614
  });
613
- }, be = ({ label: e, isExpanded: t, onToggle: r, className: i = "dial-tiny-semi-text uppercase", dropZoneGroupKey: a, isDragOver: o, onDragOver: s, onDragLeave: c, onDrop: l }) => {
615
+ }, xe = ({ label: e, isExpanded: t, onToggle: n, className: i = "dial-tiny-semi-text uppercase", dropZoneGroupKey: a, isDragOver: o, onDragOver: s, onDragLeave: c, onDrop: l }) => {
614
616
  let u = a != null;
615
- return /* @__PURE__ */ O("button", {
617
+ return /* @__PURE__ */ k("button", {
616
618
  type: "button",
617
619
  "aria-expanded": t,
618
- onClick: r,
620
+ onClick: n,
619
621
  onDragOver: u ? (e) => {
620
622
  u && (e.preventDefault(), s?.(a));
621
623
  } : void 0,
@@ -625,87 +627,88 @@ var K = /* @__PURE__ */ function(e) {
625
627
  onDrop: u ? (e) => {
626
628
  u && (e.preventDefault(), l?.(a, a, null));
627
629
  } : void 0,
628
- className: n("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", i, Z.groupHeader, o && "ring-accent-secondary ring-1 ring-inset"),
629
- children: [D(t ? k : A, {
630
+ className: r("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", i, Z.groupHeader, o && "ring-accent-secondary ring-1 ring-inset"),
631
+ children: [O(t ? A : j, {
630
632
  stroke: .5,
631
633
  size: 12,
632
634
  className: "shrink-0"
633
- }), /* @__PURE__ */ D(f, { text: e })]
635
+ }), /* @__PURE__ */ O(p, { text: e })]
634
636
  });
635
- }, xe = ({ index: e, style: t, rows: n, expandedGroups: r, onToggleGroup: i, activeConversationId: a, onSelectConversation: o, getActions: s, actionsLabel: c, groupHeaderClassName: l, itemTitleClassName: u, itemIconBadgeClassName: d, draggingId: f, dragOverId: p, allowedDropGroups: m, onDragStart: h, onDragEnd: g, onDragOver: _, onDragLeave: v, onDrop: y }) => {
636
- let b = n[e];
637
- if (b.kind === K.Header) {
638
- let n = b.groupKey === q.Pinned;
639
- return /* @__PURE__ */ D("div", {
637
+ }, Se = ({ index: e, style: t, rows: n, expandedGroups: r, onToggleGroup: i, activeConversationId: a, searchQuery: o, onSelectConversation: s, getActions: c, actionsLabel: l, groupHeaderClassName: u, itemTitleClassName: d, itemIconBadgeClassName: f, draggingId: p, dragOverId: m, allowedDropGroups: h, onDragStart: g, onDragEnd: _, onDragOver: v, onDragLeave: y, onDrop: b }) => {
638
+ let x = n[e];
639
+ if (x.kind === K.Header) {
640
+ let n = x.groupKey === q.Pinned;
641
+ return /* @__PURE__ */ O("div", {
640
642
  style: t,
641
643
  className: e === 0 ? "pt-0" : "pt-8",
642
- children: /* @__PURE__ */ D(be, {
643
- label: b.label,
644
- isExpanded: r.has(b.groupKey),
645
- onToggle: () => i(b.groupKey),
646
- className: l,
644
+ children: /* @__PURE__ */ O(xe, {
645
+ label: x.label,
646
+ isExpanded: r.has(x.groupKey),
647
+ onToggle: () => i(x.groupKey),
648
+ className: u,
647
649
  dropZoneGroupKey: n ? q.Pinned : void 0,
648
- isDragOver: n && p === q.Pinned,
649
- onDragOver: n ? _ : void 0,
650
- onDragLeave: n ? v : void 0,
651
- onDrop: n ? y : void 0
650
+ isDragOver: n && m === q.Pinned,
651
+ onDragOver: n ? v : void 0,
652
+ onDragLeave: n ? y : void 0,
653
+ onDrop: n ? b : void 0
652
654
  })
653
655
  });
654
656
  }
655
- return /* @__PURE__ */ D("div", {
657
+ return /* @__PURE__ */ O("div", {
656
658
  style: t,
657
659
  className: "pt-1",
658
- children: /* @__PURE__ */ D(ye, {
659
- item: b.item,
660
- isActive: b.item.id === a,
661
- onSelectConversation: o,
662
- getActions: s,
663
- actionsLabel: c,
664
- itemTitleClassName: u,
665
- itemIconBadgeClassName: d,
666
- rowGroupKey: b.groupKey,
660
+ children: /* @__PURE__ */ O(be, {
661
+ item: x.item,
662
+ isActive: x.item.id === a,
663
+ searchQuery: o,
664
+ onSelectConversation: s,
665
+ getActions: c,
666
+ actionsLabel: l,
667
+ itemTitleClassName: d,
668
+ itemIconBadgeClassName: f,
669
+ rowGroupKey: x.groupKey,
667
670
  rows: n,
668
- draggingId: f,
669
- dragOverId: p,
670
- allowedDropGroups: m,
671
- onDragStart: h,
672
- onDragEnd: g,
673
- onDragOver: _,
674
- onDragLeave: v,
675
- onDrop: y
671
+ draggingId: p,
672
+ dragOverId: m,
673
+ allowedDropGroups: h,
674
+ onDragStart: g,
675
+ onDragEnd: _,
676
+ onDragOver: v,
677
+ onDragLeave: y,
678
+ onDrop: b
676
679
  })
677
680
  });
678
- }, Se = (e, t) => t === Y.All ? !0 : e.source === t, Ce = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, we = new Set(Object.values(q)), Te = y(({ conversations: e, isLoading: c, isOpen: l, onSelectConversation: u, activeConversationId: d, title: f, emptyLabel: p, noResultsLabel: h, onNewChat: g, newChatLabel: _, searchPlaceholder: v, searchClearLabel: y, filterLabels: S, groupLabels: C, styles: k, className: A, getActions: j, actionsLabel: M, onToggle: N, closeAriaLabel: P, resizable: F, defaultPanelWidth: ee = 325, minPanelWidth: I = 312, maxPanelWidth: te = 600, onPanelResizeStop: L, headerActions: R, onMoveConversation: z, activeFilter: B, onActiveFilterChange: ne }) => {
679
- let { colors: V, typography: H } = k ?? {}, [U, re] = E(""), [W, ie] = E(Y.All);
680
- x(() => {
681
- B != null && (ie(B), ne?.(B));
682
- }, [B]);
683
- let [G, ae] = E(() => we), [oe, le] = E(5), [de, me] = E(null), [X, he] = E(null), [_e, Z] = E(null), ye = T(null), be = T(null), Te = b(({ height: e }) => {
684
- le(Math.ceil(e / 36 * 2));
685
- }, []), Ee = b((e) => {
681
+ }, Ce = (e, t) => t === Y.All ? !0 : e.source === t, we = (e, t) => t ? e.title.toLowerCase().includes(t.toLowerCase()) : !0, Te = new Set(Object.values(q)), Ee = b(({ conversations: e, isLoading: t, isOpen: l, onSelectConversation: u, activeConversationId: d, title: f, emptyLabel: p, noResultsLabel: m, onNewChat: g, newChatLabel: _, searchPlaceholder: v, searchClearLabel: y, filterLabels: b, groupLabels: C, styles: w, className: A, getActions: j, actionsLabel: M, onToggle: N, closeAriaLabel: P, resizable: F, defaultPanelWidth: ee = 325, minPanelWidth: te = 312, maxPanelWidth: I = 600, onPanelResizeStop: ne, headerActions: L, onMoveConversation: R, activeFilter: z, onActiveFilterChange: B }) => {
682
+ let { colors: V, typography: H } = w ?? {}, [U, re] = D(""), [W, ie] = D(Y.All);
683
+ S(() => {
684
+ z != null && (ie(z), B?.(z));
685
+ }, [z]);
686
+ let [G, ae] = D(() => Te), [oe, se] = D(5), ue = E(null), fe = E(null), [he, X] = D(null), [ge, ve] = D(null), [Z, be] = D(null), xe = E(null), Ee = E(null), De = x(({ height: e }) => {
687
+ se(Math.ceil(e / 36 * 2));
688
+ }, []), Oe = x((e) => {
686
689
  ae((t) => {
687
690
  let n = new Set(t);
688
691
  return n.has(e) ? n.delete(e) : n.add(e), n;
689
692
  });
690
- }, []), De = b(() => {
691
- ye.current = null, be.current = null, me(null), he(null), Z(null);
692
- }, []), Oe = b((t, n) => {
693
- let r = pe(t, fe(n, t), e);
694
- ye.current = t, be.current = r, me(t), Z(r);
695
- }, [e]), ke = b(() => {
696
- De();
697
- }, [De]), Ae = b((e) => {
698
- he(e);
699
- }, []), je = b(() => {
700
- he(null);
701
- }, []), Me = b((e, t, n) => {
702
- let r = ye.current, i = be.current;
703
- De(), r != null && r !== e && i?.has(t) && z?.({
693
+ }, []), ke = x(() => {
694
+ xe.current = null, Ee.current = null, X(null), ve(null), be(null);
695
+ }, []), Ae = x((t, n) => {
696
+ let r = me(t, pe(n, t), e);
697
+ xe.current = t, Ee.current = r, X(t), be(r);
698
+ }, [e]), je = x(() => {
699
+ ke();
700
+ }, [ke]), Me = x((e) => {
701
+ ve(e);
702
+ }, []), Ne = x(() => {
703
+ ve(null);
704
+ }, []), Pe = x((e, t, n) => {
705
+ let r = xe.current, i = Ee.current;
706
+ ke(), r != null && r !== e && i?.has(t) && R?.({
704
707
  draggedId: r,
705
708
  targetGroupKey: t,
706
709
  afterId: n
707
710
  });
708
- }, [De, z]), Ne = t({
711
+ }, [ke, R]), Fe = n({
709
712
  "--cp-bg": V?.background,
710
713
  "--sb-border": V?.border,
711
714
  "--cp-item-hover": V?.itemHover,
@@ -715,40 +718,40 @@ var K = /* @__PURE__ */ function(e) {
715
718
  "--cp-new-chat-hover": V?.newChatHoverBackground,
716
719
  "--cp-new-chat-active": V?.newChatActiveBackground,
717
720
  "--cp-new-chat-bg": V?.newChatBackground
718
- }), Q = w(() => e.filter((e) => Se(e, W) && Ce(e, U)), [
721
+ }), Q = T(() => e.filter((e) => Ce(e, W) && we(e, U)), [
719
722
  e,
720
723
  W,
721
724
  U
722
- ]), Pe = w(() => Q.filter((e) => e.isPinned), [Q]), Fe = w(() => Q.filter((e) => !e.isPinned && e.source !== J.Shared && e.source !== J.Organization), [Q]), Ie = w(() => Q.filter((e) => !e.isPinned && e.source === J.Shared), [Q]), Le = w(() => Q.filter((e) => !e.isPinned && e.source === J.Organization), [Q]), Re = w(() => [
725
+ ]), Ie = T(() => Q.filter((e) => e.isPinned), [Q]), Le = T(() => Q.filter((e) => !e.isPinned && e.source !== J.Shared && e.source !== J.Organization), [Q]), Re = T(() => Q.filter((e) => !e.isPinned && e.source === J.Shared), [Q]), ze = T(() => Q.filter((e) => !e.isPinned && e.source === J.Organization), [Q]), Be = T(() => [
723
726
  {
724
727
  key: q.Pinned,
725
728
  label: C?.pinned ?? "Pinned",
726
- items: Pe
729
+ items: Ie
727
730
  },
728
731
  {
729
732
  key: q.MyChats,
730
733
  label: C?.myChats ?? "My chats",
731
- items: Fe
734
+ items: Le
732
735
  },
733
736
  {
734
737
  key: q.Shared,
735
738
  label: C?.shared ?? "Shared",
736
- items: Ie
739
+ items: Re
737
740
  },
738
741
  {
739
742
  key: q.Organization,
740
743
  label: C?.organization ?? "Organization",
741
- items: Le
744
+ items: ze
742
745
  }
743
746
  ], [
744
747
  C,
745
- Pe,
746
- Fe,
747
748
  Ie,
748
- Le
749
- ]), $ = w(() => {
749
+ Le,
750
+ Re,
751
+ ze
752
+ ]), $ = T(() => {
750
753
  let e = [];
751
- for (let t of Re) if (t.items.length !== 0 && (e.push({
754
+ for (let t of Be) if (t.items.length !== 0 && (e.push({
752
755
  kind: K.Header,
753
756
  groupKey: t.key,
754
757
  label: t.label
@@ -758,48 +761,71 @@ var K = /* @__PURE__ */ function(e) {
758
761
  groupKey: t.key
759
762
  });
760
763
  return e;
761
- }, [Re, G]), ze = w(() => ({
764
+ }, [Be, G]);
765
+ S(() => {
766
+ if (!d) return;
767
+ let e = Be.find((e) => e.items.some((e) => e.id === d))?.key;
768
+ if (e && !G.has(e)) {
769
+ ae((t) => new Set(t).add(e));
770
+ return;
771
+ }
772
+ if (fe.current === d) return;
773
+ let t = $.findIndex((e) => e.kind === K.Item && e.item.id === d);
774
+ t >= 0 && (ue.current?.scrollToRow({
775
+ index: t,
776
+ align: "smart",
777
+ behavior: "smooth"
778
+ }), fe.current = d);
779
+ }, [
780
+ d,
781
+ Be,
782
+ G,
783
+ $
784
+ ]);
785
+ let Ve = T(() => ({
762
786
  rows: $,
763
787
  expandedGroups: G,
764
- onToggleGroup: Ee,
788
+ onToggleGroup: Oe,
765
789
  activeConversationId: d,
790
+ searchQuery: U,
766
791
  onSelectConversation: u,
767
792
  getActions: j,
768
793
  actionsLabel: M,
769
794
  groupHeaderClassName: H?.groupHeaderClassName,
770
795
  itemTitleClassName: H?.itemTitleClassName,
771
796
  itemIconBadgeClassName: H?.itemIconBadgeClassName,
772
- draggingId: de,
773
- dragOverId: X,
774
- allowedDropGroups: _e,
775
- onDragStart: (e) => Oe(e, $),
776
- onDragEnd: ke,
777
- onDragOver: Ae,
778
- onDragLeave: je,
779
- onDrop: Me
797
+ draggingId: he,
798
+ dragOverId: ge,
799
+ allowedDropGroups: Z,
800
+ onDragStart: (e) => Ae(e, $),
801
+ onDragEnd: je,
802
+ onDragOver: Me,
803
+ onDragLeave: Ne,
804
+ onDrop: Pe
780
805
  }), [
781
806
  $,
782
807
  G,
783
- Ee,
808
+ Oe,
784
809
  d,
810
+ U,
785
811
  u,
786
812
  j,
787
813
  M,
788
814
  H?.groupHeaderClassName,
789
815
  H?.itemTitleClassName,
790
816
  H?.itemIconBadgeClassName,
791
- de,
792
- X,
793
- _e,
794
- Oe,
795
- ke,
817
+ he,
818
+ ge,
819
+ Z,
796
820
  Ae,
797
821
  je,
798
- Me
799
- ]), Be = e.length === 0, Ve = e.length > 0 && Q.length === 0;
800
- return /* @__PURE__ */ O(s, {
822
+ Me,
823
+ Ne,
824
+ Pe
825
+ ]), He = e.length === 0, Ue = e.length > 0 && Q.length === 0;
826
+ return /* @__PURE__ */ k(c, {
801
827
  isOpen: l,
802
- orientation: o.Left,
828
+ orientation: s.Left,
803
829
  title: f,
804
830
  ariaLabel: f,
805
831
  onClose: N,
@@ -812,60 +838,61 @@ var K = /* @__PURE__ */ function(e) {
812
838
  },
813
839
  typography: { fontClassName: H?.fontClassName },
814
840
  bodyClassName: "flex flex-col overflow-hidden p-0 gap-3",
815
- cssVars: Ne,
841
+ cssVars: Fe,
816
842
  titleClassName: H?.fontClassName
817
843
  },
818
- className: n(l ? F ? "border-l border-r mobile:w-full" : "w-[325px] border-l border-r mobile:w-full" : "w-0", A),
844
+ className: r(l ? F ? "border-l border-r mobile:w-full" : "w-[325px] border-l border-r mobile:w-full" : "w-0", A),
819
845
  resizable: F,
820
846
  defaultWidth: ee,
821
- minWidth: I,
822
- maxWidth: te,
823
- onResizeStop: L,
824
- rightActions: R,
847
+ minWidth: te,
848
+ maxWidth: I,
849
+ onResizeStop: ne,
850
+ rightActions: L,
825
851
  children: [
826
- /* @__PURE__ */ D(ve, {
852
+ /* @__PURE__ */ O(ye, {
827
853
  label: _,
828
854
  onClick: g,
829
855
  labelClassName: H?.newChatLabelClassName
830
856
  }),
831
- /* @__PURE__ */ D(a, {
857
+ /* @__PURE__ */ O(o, {
832
858
  placeholder: v,
833
859
  value: U,
834
860
  onChange: re,
835
861
  clearLabel: y
836
862
  }),
837
- /* @__PURE__ */ D(ge, {
863
+ /* @__PURE__ */ O(_e, {
838
864
  activeTab: W,
839
- labels: S,
865
+ labels: b,
840
866
  onChange: (e) => {
841
- ie(e), ne?.(e);
867
+ ie(e), B?.(e);
842
868
  },
843
869
  tabClassName: H?.tabClassName
844
870
  }),
845
- /* @__PURE__ */ D("div", {
871
+ /* @__PURE__ */ O("div", {
846
872
  className: "flex-1 overflow-hidden px-2 py-1",
847
- children: c ? /* @__PURE__ */ D("div", {
873
+ children: t ? /* @__PURE__ */ O("div", {
848
874
  className: "flex flex-col gap-3 px-2 py-3",
849
- children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ D(m, {
875
+ children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ O(h, {
850
876
  avatar: { size: 24 },
851
- showTitle: { width: ce(t) },
877
+ showTitle: { width: le(t) },
852
878
  paragraph: !1,
853
879
  active: !0,
854
880
  color: "var(--bg-layer-4)"
855
881
  }, t))
856
- }) : Be ? /* @__PURE__ */ D(r, { label: p }) : Ve ? /* @__PURE__ */ D(i, { label: h }) : /* @__PURE__ */ D(se, {
882
+ }) : He ? /* @__PURE__ */ O(i, { label: p }) : Ue ? /* @__PURE__ */ O(a, { label: m }) : /* @__PURE__ */ O(ce, {
883
+ listRef: ue,
857
884
  role: "list",
858
885
  style: { height: "100%" },
859
- rowComponent: xe,
886
+ rowComponent: Se,
860
887
  rowCount: $.length,
861
- rowHeight: ue,
888
+ rowHeight: de,
862
889
  overscanCount: oe,
863
- onResize: Te,
864
- rowProps: ze
890
+ onResize: De,
891
+ rowProps: Ve
865
892
  })
866
893
  })
867
894
  ]
868
895
  });
869
896
  });
870
897
  //#endregion
871
- export { q as ConversationGroupKey, Te as ConversationPanel, J as ConversationSource, Y as FilterTab };
898
+ export { q as ConversationGroupKey, Ee as ConversationPanel, J as ConversationSource, Y as FilterTab };
@@ -33,6 +33,8 @@ export interface RowRendererData {
33
33
  onToggleGroup: (key: string) => void;
34
34
  /** `id` of the currently active conversation. */
35
35
  activeConversationId?: string;
36
+ /** Current search query — used to highlight matches in conversation titles. */
37
+ searchQuery: string;
36
38
  /** Called when the user selects a conversation row. */
37
39
  onSelectConversation: (id: string) => void;
38
40
  /** Builds dropdown actions for a conversation item. */
@@ -1 +1 @@
1
- {"version":3,"file":"virtual-row.d.ts","sourceRoot":"","sources":["../../src/models/virtual-row.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,0DAA0D;AAC1D,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;IAC5B,qDAAqD;IACrD,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,0DAA0D;AAC1D,MAAM,WAAW,mBAAmB;IAClC,wBAAwB;IACxB,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC;IAC1B,kCAAkC;IAClC,IAAI,EAAE,uBAAuB,CAAC;IAC9B,0EAA0E;IAC1E,QAAQ,EAAE,oBAAoB,CAAC;CAChC;AAED,gDAAgD;AAChD,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,mBAAmB,CAAC;AAE9D,iFAAiF;AACjF,MAAM,WAAW,eAAe;IAC9B,4DAA4D;IAC5D,IAAI,EAAE,UAAU,EA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K,YAAY,EAAE,CAAC;IAC/D,uDAAuD;IACvD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,2DAA2D;IAC3D,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,oEAAoE;IACpE,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,0FAA0F;IAC1F,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,qFAAqF;IACrF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,mGAAmG;IACnG,iBAAiB,EAAE,GAAG,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;IACpD,+DAA+D;IAC/D,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kDAAkD;IAClD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,gDAAgD;IAChD,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,gDAAgD;IAChD,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB;;;;;OAKG;IACH,MAAM,EAAE,CACN,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,oBAAoB,EACpC,OAAO,EAAE,MAAM,GAAG,IAAI,KACnB,IAAI,CAAC;CACX"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-conversation-panel",
3
3
  "description": "Virtualized sidebar panel for browsing conversation history with grouping, tabs, and search",
4
- "version": "1.0.0-dev.456",
4
+ "version": "1.0.0-dev.460",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -22,9 +22,9 @@
22
22
  "peerDependencies": {
23
23
  "react": "^19.0.0",
24
24
  "@tabler/icons-react": "^3.0.0",
25
- "@epam/ai-dial-chat-shared": "1.0.0-dev.456",
25
+ "@epam/ai-dial-chat-shared": "1.0.0-dev.460",
26
26
  "@epam/ai-dial-ui-kit": "0.12.0-dev.25",
27
- "@epam/ai-dial-sidebar": "1.0.0-dev.456"
27
+ "@epam/ai-dial-sidebar": "1.0.0-dev.460"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",