@epam/ai-dial-conversation-panel 1.1.0-dev.52 → 1.1.0-dev.55

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":"ConversationPanel.d.ts","sourceRoot":"","sources":["../../../src/components/ConversationPanel/ConversationPanel.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,EAAE,EAQR,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AA6BlE,sEAAsE;AACtE,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CA0axD,CAAC"}
1
+ {"version":3,"file":"ConversationPanel.d.ts","sourceRoot":"","sources":["../../../src/components/ConversationPanel/ConversationPanel.tsx"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,EAAE,EAQR,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AA6BlE,sEAAsE;AACtE,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAkaxD,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConversationRow.d.ts","sourceRoot":"","sources":["../../../src/components/ConversationRow/ConversationRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAUL,KAAK,YAAY,EAClB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAiD,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE,mCAAmC;AACnC,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,IAAI,EAAE,gBAAgB,CAAC;IACvB,qDAAqD;IACrD,QAAQ,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,oBAAoB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sGAAsG;IACtG,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,YAAY,EAAE,CAAC;IACxD,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,CACjB,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,iBAAiB,KACvB,IAAI,CAAC;IACV,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yFAAyF;IACzF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yEAAyE;IACzE,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,oEAAoE;IACpE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,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,SAAS,CAAC,GAAG,IAAI,CAAC;IAC1C,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,SAAS,EACzB,OAAO,EAAE,MAAM,GAAG,IAAI,KACnB,IAAI,CAAC;CACX;AAED,8GAA8G;AAC9G,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAoLpD,CAAC"}
package/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export { ConversationPanel } from './components/ConversationPanel/ConversationPanel';
2
2
  export type { ConversationMove, ConversationPanelProps, ConversationPanelStyles, ConversationColors, NewChatButtonColors, ConversationPanelTypography, ConversationPanelLabels, ConversationItem, FilterLabels, } from './models/panel-props';
3
- export type { ConversationGroupProps } from './components/ConversationGroup/ConversationGroup';
4
3
  export { FilterTab } from './types/conversation-classification';
5
4
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,uBAAuB,EACvB,gBAAgB,EAChB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAC/F,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kDAAkD,CAAC;AACrF,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,2BAA2B,EAC3B,uBAAuB,EACvB,gBAAgB,EAChB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC"}
package/index.js CHANGED
@@ -1,6 +1,6 @@
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, mergeClasses as y } from "@epam/ai-dial-ui-kit";
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 _, Highlight as v, mergeClasses as y } from "@epam/ai-dial-ui-kit";
4
4
  import { createElement as b, memo as x, useCallback as S, useEffect as C, useId as w, useImperativeHandle as T, useLayoutEffect as E, useMemo as D, useRef as O, useState as k } from "react";
5
5
  import { jsx as A, jsxs as j } from "react/jsx-runtime";
6
6
  import { IconCaretDownFilled as M, IconCaretRightFilled as N, IconDotsVertical as P, IconPlus as F } from "@tabler/icons-react";
@@ -60,7 +60,7 @@ function ee(e) {
60
60
  }, [e]), S((e) => t.current?.(e), [t]);
61
61
  }
62
62
  var z = null;
63
- function B(e = !1) {
63
+ function te(e = !1) {
64
64
  if (z === 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";
@@ -69,8 +69,8 @@ function B(e = !1) {
69
69
  }
70
70
  return z;
71
71
  }
72
- function V({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
- if (t === "horizontal" && n) switch (B()) {
72
+ function B({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
73
+ if (t === "horizontal" && n) switch (te()) {
74
74
  case "negative": return -r;
75
75
  case "positive-descending":
76
76
  if (e) {
@@ -81,26 +81,26 @@ function V({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
81
81
  }
82
82
  return r;
83
83
  }
84
- function H(e, t = "Assertion error") {
84
+ function V(e, t = "Assertion error") {
85
85
  if (!e) throw console.error(t), Error(t);
86
86
  }
87
- function U(e, t) {
87
+ function H(e, t) {
88
88
  if (e === t) return !0;
89
- if (!!e != !!t || (H(e !== void 0), H(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
89
+ if (!!e != !!t || (V(e !== void 0), V(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
90
90
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
91
91
  return !0;
92
92
  }
93
- function te({ cachedBounds: e, itemCount: t, itemSize: n }) {
93
+ function U({ cachedBounds: e, itemCount: t, itemSize: n }) {
94
94
  if (t === 0) return 0;
95
95
  if (typeof n == "number") return t * n;
96
96
  {
97
97
  let n = e.get(e.size === 0 ? 0 : e.size - 1);
98
- return H(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
98
+ return V(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
99
99
  }
100
100
  }
101
101
  function W({ 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
- let s = te({
103
+ let s = U({
104
104
  cachedBounds: t,
105
105
  itemCount: r,
106
106
  itemSize: i
@@ -135,7 +135,7 @@ function K({ itemCount: e, itemProps: t, itemSize: n }) {
135
135
  let r = /* @__PURE__ */ new Map();
136
136
  return {
137
137
  get(i) {
138
- for (H(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
138
+ for (V(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
139
139
  let e = r.size, a;
140
140
  switch (typeof n) {
141
141
  case "function":
@@ -151,14 +151,14 @@ function K({ itemCount: e, itemProps: t, itemSize: n }) {
151
151
  });
152
152
  else {
153
153
  let t = r.get(e - 1);
154
- H(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
154
+ V(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
155
155
  scrollOffset: t.scrollOffset + t.size,
156
156
  size: a
157
157
  });
158
158
  }
159
159
  }
160
160
  let a = r.get(i);
161
- return H(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
161
+ return V(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
162
162
  },
163
163
  set(e, t) {
164
164
  r.set(e, t);
@@ -183,7 +183,7 @@ function J({ containerSize: e, itemSize: t }) {
183
183
  let n;
184
184
  switch (typeof t) {
185
185
  case "string":
186
- H(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), H(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
186
+ V(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), V(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
187
187
  break;
188
188
  default:
189
189
  n = t;
@@ -233,7 +233,7 @@ function ne({ containerElement: e, containerStyle: t, defaultContainerSize: n =
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
- }, w = S(() => te({
236
+ }, w = S(() => U({
237
237
  cachedBounds: h,
238
238
  itemCount: a,
239
239
  itemSize: m
@@ -243,7 +243,7 @@ function ne({ containerElement: e, containerStyle: t, defaultContainerSize: n =
243
243
  m
244
244
  ]), T = S((t) => G({
245
245
  cachedBounds: h,
246
- containerScrollOffset: V({
246
+ containerScrollOffset: B({
247
247
  containerElement: e,
248
248
  direction: r,
249
249
  isRtl: i,
@@ -273,7 +273,7 @@ function ne({ containerElement: e, containerStyle: t, defaultContainerSize: n =
273
273
  v((t) => {
274
274
  let { scrollLeft: n, scrollTop: o } = e, s = G({
275
275
  cachedBounds: h,
276
- containerScrollOffset: V({
276
+ containerScrollOffset: B({
277
277
  containerElement: e,
278
278
  direction: r,
279
279
  isRtl: i,
@@ -283,7 +283,7 @@ function ne({ containerElement: e, containerStyle: t, defaultContainerSize: n =
283
283
  itemCount: a,
284
284
  overscanCount: l
285
285
  });
286
- return U(s, t) ? t : s;
286
+ return H(s, t) ? t : s;
287
287
  });
288
288
  };
289
289
  return e.addEventListener("scroll", t), () => {
@@ -310,14 +310,14 @@ function ne({ containerElement: e, containerStyle: t, defaultContainerSize: n =
310
310
  itemSize: m
311
311
  });
312
312
  if (e) {
313
- if (s = V({
313
+ if (s = B({
314
314
  containerElement: e,
315
315
  direction: r,
316
316
  isRtl: i,
317
317
  scrollOffset: s
318
318
  }), typeof e.scrollTo != "function") {
319
319
  let e = T(s);
320
- U(_, e) || v(e);
320
+ H(_, e) || v(e);
321
321
  }
322
322
  return s;
323
323
  }
@@ -333,7 +333,7 @@ function re(e) {
333
333
  }
334
334
  function ie(e, t) {
335
335
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
336
- return U(n, a) && U(r, o) && U(i, s);
336
+ return H(n, a) && H(r, o) && H(i, s);
337
337
  }
338
338
  function ae(e) {
339
339
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
@@ -485,7 +485,7 @@ var Y = /* @__PURE__ */ function(e) {
485
485
  }, he = {
486
486
  tabContainer: "_tabContainer_rzv03_1",
487
487
  tabActive: "_tabActive_rzv03_13"
488
- }, ge = x(({ tabs: e, activeTabId: t, onTabChange: n, styles: i }) => {
488
+ }, ge = x(({ tabs: e, activeTabId: t, onTabChange: r, styles: i }) => {
489
489
  let { tabClassName: a = "dial-tiny-semi-text" } = i?.typography ?? {};
490
490
  return /* @__PURE__ */ A("div", {
491
491
  className: "flex flex-nowrap gap-1",
@@ -496,11 +496,11 @@ var Y = /* @__PURE__ */ function(e) {
496
496
  role: "tab",
497
497
  "aria-selected": i,
498
498
  className: "contents",
499
- children: /* @__PURE__ */ A(_, {
499
+ children: /* @__PURE__ */ A(g, {
500
500
  label: e.label,
501
501
  selected: i,
502
- onClick: () => n(e.id),
503
- className: r("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", a, he.tabContainer, i && he.tabActive)
502
+ onClick: () => r(e.id),
503
+ className: n("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", a, he.tabContainer, i && he.tabActive)
504
504
  })
505
505
  }, e.id);
506
506
  })
@@ -533,9 +533,9 @@ var Y = /* @__PURE__ */ function(e) {
533
533
  onTabChange: (e) => n(e),
534
534
  styles: { typography: { tabClassName: y(r, "flex-1") } }
535
535
  })
536
- })), ye = { button: "_button_hbyrw_1" }, be = x(({ label: e, onClick: t, labelClassName: i = "dial-small-semi-text", colors: a }) => /* @__PURE__ */ A("div", {
536
+ })), ye = { button: "_button_hbyrw_1" }, be = x(({ label: e, onClick: r, labelClassName: i = "dial-small-semi-text", colors: a }) => /* @__PURE__ */ A("div", {
537
537
  className: "px-3 py-2",
538
- style: n({
538
+ style: t({
539
539
  "--cp-new-chat-bg": a?.background,
540
540
  "--cp-new-chat-hover": a?.hoverBackground,
541
541
  "--cp-new-chat-active": a?.activeBackground,
@@ -548,9 +548,9 @@ var Y = /* @__PURE__ */ function(e) {
548
548
  "--cp-new-chat-shadow-purple-active": a?.shadowPurpleActive
549
549
  }),
550
550
  children: /* @__PURE__ */ j("button", {
551
- onClick: t,
551
+ onClick: r,
552
552
  type: "button",
553
- className: r("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 rounded-full px-3 py-1", ye.button),
553
+ className: n("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 rounded-full px-3 py-1", ye.button),
554
554
  children: [/* @__PURE__ */ A(F, {
555
555
  size: 18,
556
556
  stroke: 2,
@@ -570,115 +570,115 @@ var Y = /* @__PURE__ */ function(e) {
570
570
  trigger: "_trigger_njmps_29",
571
571
  triggerActive: "_triggerActive_njmps_29",
572
572
  triggerIcon: "_triggerIcon_njmps_32"
573
- }, xe = ({ item: n, isActive: i, onSelectConversation: a, searchQuery: o = "", getActions: s, onActionMenuOpen: c, actionsLabel: p = "More actions", itemTitleClassName: _ = "dial-small-text", itemIconBadgeClassName: y, rowGroupKey: b, rows: x, draggingId: C, dragOverId: w, allowedDropGroups: T, onDragStart: E, onDragEnd: D, onDragOver: M, onDragLeave: N, onDrop: F }) => {
573
+ }, xe = ({ label: e, isExpanded: t, onToggle: r, listId: i, className: a = "dial-tiny-semi-text uppercase", dropZoneGroupKey: o, isDragOver: s, onDragOver: c, onDragLeave: l, onDrop: u }) => {
574
+ let d = o != null;
575
+ return /* @__PURE__ */ j("button", {
576
+ type: "button",
577
+ "aria-expanded": t,
578
+ "aria-controls": i,
579
+ onClick: r,
580
+ onDragOver: d ? (e) => {
581
+ d && (e.preventDefault(), c?.(o));
582
+ } : void 0,
583
+ onDragLeave: d ? (e) => {
584
+ d && (e.currentTarget.contains(e.relatedTarget) || l?.());
585
+ } : void 0,
586
+ onDrop: d ? (e) => {
587
+ d && (e.preventDefault(), u?.(o, o, null));
588
+ } : void 0,
589
+ className: n("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", a, Z.groupHeader, s && Z.dropZoneActive),
590
+ children: [t ? /* @__PURE__ */ A(M, {
591
+ stroke: .5,
592
+ size: 12,
593
+ className: "shrink-0",
594
+ "aria-hidden": !0
595
+ }) : /* @__PURE__ */ A(N, {
596
+ stroke: .5,
597
+ size: 12,
598
+ className: "shrink-0 rtl:scale-x-[-1]",
599
+ "aria-hidden": !0
600
+ }), /* @__PURE__ */ A(f, { text: e })]
601
+ });
602
+ }, Se = ({ item: t, isActive: r, onSelectConversation: i, searchQuery: a = "", getActions: o, onActionMenuOpen: s, actionsLabel: f = "More actions", itemTitleClassName: g = "dial-small-text", itemIconBadgeClassName: y, rowGroupKey: b, rows: x, draggingId: C, dragOverId: w, allowedDropGroups: T, onDragStart: E, onDragEnd: D, onDragOver: M, onDragLeave: N, onDrop: F }) => {
574
603
  let [I, L] = k(!1), R = O(null), ee = S((e) => {
575
- L(e), e && R.current && c?.(n, R.current);
576
- }, [n, c]), z = s?.(n) ?? [], B = z.length > 0, V = n.isIconLoading ? /* @__PURE__ */ A(h, {
577
- variant: g.Circular,
578
- width: u.LG,
579
- height: u.LG,
604
+ L(e), e && R.current && s?.(t, R.current);
605
+ }, [t, s]), z = o?.(t) ?? [], te = z.length > 0, B = t.isIconLoading ? /* @__PURE__ */ A(m, {
606
+ variant: h.Circular,
607
+ width: l.LG,
608
+ height: l.LG,
580
609
  color: Z.skeletonColor,
581
610
  "aria-hidden": !0
582
611
  }) : /* @__PURE__ */ A(e, {
583
- src: n.iconUrl,
584
- size: u.LG,
585
- initialsName: n.iconTooltip ?? "",
586
- labels: { tooltip: n.iconTooltip },
612
+ src: t.iconUrl,
613
+ size: l.LG,
614
+ initialsName: t.iconTooltip ?? "",
615
+ labels: { tooltip: t.iconTooltip },
587
616
  styles: { badgeClassName: y }
588
- }), H = le(B, I), U = b != null, te = S((e) => {
617
+ }), V = le(te, I), H = b != null, U = S((e) => {
589
618
  e.currentTarget.contains(e.relatedTarget) || N?.();
590
619
  }, [N]), W = S((e) => {
591
620
  if (!b || !x || !F) return;
592
621
  e.preventDefault();
593
- let t = me(e, n.id, x, b);
594
- F(n.id, b, t);
622
+ let n = me(e, t.id, x, b);
623
+ F(t.id, b, n);
595
624
  }, [
596
- n.id,
625
+ t.id,
597
626
  x,
598
627
  b,
599
628
  F
600
- ]), G = n.id === C, K = n.id === w, q = b != null && (T?.has(b) ?? !1), J = C != null;
629
+ ]), G = t.id === C, K = t.id === w, q = b != null && (T?.has(b) ?? !1), J = C != null;
601
630
  return /* @__PURE__ */ j("li", {
602
- className: r("group/conversation relative", G && "cursor-grabbing opacity-50", K && q && "rounded", K && q && Z.dropZoneActive, J && !G && !q && "cursor-not-allowed"),
603
- draggable: U || void 0,
604
- onDragStart: U ? () => E?.(n.id) : void 0,
605
- onDragEnd: U ? D : void 0,
606
- onDragOver: U ? (e) => {
607
- e.preventDefault(), M?.(n.id);
631
+ className: n("group/conversation relative", G && "cursor-grabbing opacity-50", K && q && "rounded", K && q && Z.dropZoneActive, J && !G && !q && "cursor-not-allowed"),
632
+ draggable: H || void 0,
633
+ onDragStart: H ? () => E?.(t.id) : void 0,
634
+ onDragEnd: H ? D : void 0,
635
+ onDragOver: H ? (e) => {
636
+ e.preventDefault(), M?.(t.id);
608
637
  } : void 0,
609
- onDragLeave: U ? te : void 0,
610
- onDrop: U ? W : void 0,
638
+ onDragLeave: H ? U : void 0,
639
+ onDrop: H ? W : void 0,
611
640
  children: [/* @__PURE__ */ A("a", {
612
- href: n.href,
641
+ href: t.href,
613
642
  className: "contents",
614
643
  onClick: (e) => {
615
- n.href && (e.preventDefault(), a(n.id));
644
+ t.href && (e.preventDefault(), i(t.id));
616
645
  },
617
- children: /* @__PURE__ */ A(d, {
618
- iconBefore: V,
619
- label: /* @__PURE__ */ A(t, {
620
- text: n.title,
621
- query: o,
622
- className: _,
646
+ children: /* @__PURE__ */ A(u, {
647
+ iconBefore: B,
648
+ label: /* @__PURE__ */ A(v, {
649
+ text: t.title,
650
+ query: a,
651
+ className: g,
623
652
  maxLines: 1
624
653
  }),
625
654
  textClassName: "min-w-0",
626
- "aria-current": i ? "page" : void 0,
627
- onClick: n.href ? void 0 : () => a(n.id),
628
- tabIndex: n.href ? -1 : void 0,
629
- className: r("flex h-8 w-full items-center justify-start gap-2 rounded-xl py-2 ps-3", H, Z.item, i && Z.itemActive, I && Z.itemActive)
655
+ "aria-current": r ? "page" : void 0,
656
+ onClick: t.href ? void 0 : () => i(t.id),
657
+ tabIndex: t.href ? -1 : void 0,
658
+ className: n("flex h-8 w-full items-center justify-start gap-2 rounded-xl py-2 ps-3", V, Z.item, r && Z.itemActive, I && Z.itemActive)
630
659
  })
631
- }), B && /* @__PURE__ */ A("div", {
632
- className: r("absolute inset-y-0 end-1 flex items-center", I ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
633
- children: /* @__PURE__ */ A(f, {
660
+ }), te && /* @__PURE__ */ A("div", {
661
+ className: n("absolute inset-y-0 end-1 flex items-center", I ? "opacity-100" : "opacity-0 group-focus-within/conversation:opacity-100 group-hover/conversation:opacity-100"),
662
+ children: /* @__PURE__ */ A(d, {
634
663
  items: z,
635
664
  onOpenChange: ee,
636
665
  matchReferenceWidth: !1,
637
666
  listClassName: "w-[140px] cp-dropdown-overlay",
638
- children: /* @__PURE__ */ A(m, {
667
+ children: /* @__PURE__ */ A(p, {
639
668
  ref: R,
640
669
  icon: /* @__PURE__ */ A(P, {
641
- size: u.SM,
670
+ size: l.SM,
642
671
  className: Z.triggerIcon,
643
672
  "aria-hidden": !0
644
673
  }),
645
- appearance: l.Ghost,
646
- size: v.Small,
647
- "aria-label": p,
648
- className: r("flex items-center justify-center rounded", Z.trigger, I && Z.triggerActive)
674
+ appearance: c.Ghost,
675
+ size: _.Small,
676
+ "aria-label": f,
677
+ className: n("flex items-center justify-center rounded", Z.trigger, I && Z.triggerActive)
649
678
  })
650
679
  })
651
680
  })]
652
681
  });
653
- }, Se = ({ label: e, isExpanded: t, onToggle: n, listId: i, className: a = "dial-tiny-semi-text uppercase", dropZoneGroupKey: o, isDragOver: s, onDragOver: c, onDragLeave: l, onDrop: u }) => {
654
- let d = o != null;
655
- return /* @__PURE__ */ j("button", {
656
- type: "button",
657
- "aria-expanded": t,
658
- "aria-controls": i,
659
- onClick: n,
660
- onDragOver: d ? (e) => {
661
- d && (e.preventDefault(), c?.(o));
662
- } : void 0,
663
- onDragLeave: d ? (e) => {
664
- d && (e.currentTarget.contains(e.relatedTarget) || l?.());
665
- } : void 0,
666
- onDrop: d ? (e) => {
667
- d && (e.preventDefault(), u?.(o, o, null));
668
- } : void 0,
669
- className: r("flex h-6 w-full items-center gap-1 rounded py-1 pe-3 text-start", a, Z.groupHeader, s && Z.dropZoneActive),
670
- children: [t ? /* @__PURE__ */ A(M, {
671
- stroke: .5,
672
- size: 12,
673
- className: "shrink-0",
674
- "aria-hidden": !0
675
- }) : /* @__PURE__ */ A(N, {
676
- stroke: .5,
677
- size: 12,
678
- className: "shrink-0 rtl:scale-x-[-1]",
679
- "aria-hidden": !0
680
- }), /* @__PURE__ */ A(p, { text: e })]
681
- });
682
682
  }, Ce = ({ index: e, style: t, rows: n, expandedGroups: r, onToggleGroup: i, listId: a, activeConversationId: o, searchQuery: s, onSelectConversation: c, getActions: l, onActionMenuOpen: u, actionsLabel: d, styles: f, draggingId: p, dragOverId: m, allowedDropGroups: h, onDragStart: g, onDragEnd: _, onDragOver: v, onDragLeave: y, onDrop: b }) => {
683
683
  let x = n[e];
684
684
  if (x.kind === Y.Header) {
@@ -687,7 +687,7 @@ var Y = /* @__PURE__ */ function(e) {
687
687
  role: "presentation",
688
688
  style: t,
689
689
  className: e === 0 ? "pt-0" : "pt-8",
690
- children: /* @__PURE__ */ A(Se, {
690
+ children: /* @__PURE__ */ A(xe, {
691
691
  label: x.label,
692
692
  isExpanded: r.has(x.groupKey),
693
693
  onToggle: () => i(x.groupKey),
@@ -705,7 +705,7 @@ var Y = /* @__PURE__ */ function(e) {
705
705
  role: "presentation",
706
706
  style: t,
707
707
  className: "pt-1",
708
- children: /* @__PURE__ */ A(xe, {
708
+ children: /* @__PURE__ */ A(Se, {
709
709
  item: x.item,
710
710
  isActive: x.item.id === o,
711
711
  searchQuery: s,
@@ -732,8 +732,8 @@ var Y = /* @__PURE__ */ function(e) {
732
732
  X.MyChats,
733
733
  X.Shared,
734
734
  X.Organization
735
- ]), De = x(({ conversations: e, isLoading: t, isOpen: l, onSelectConversation: u, activeConversationId: d, labels: f, onNewChat: p, styles: m, className: g, getActions: _, onActionMenuOpen: v, onToggle: y, headerActions: b, onMoveConversation: x, activeFilter: T, onActiveFilterChange: E }) => {
736
- let { colors: M, typography: N, newChatButton: P } = m ?? {}, { title: F, emptyLabel: I, noResultsLabel: L, loadingLabel: R = "Loading conversations", newChatLabel: ee, searchPlaceholder: z, searchClearLabel: B, filterLabels: V, groupLabels: H, actionsLabel: U, closeAriaLabel: te } = f, [W, G] = k(""), [K, q] = k(X.All);
735
+ ]), De = x(({ conversations: e, isLoading: c, isOpen: l, onSelectConversation: u, activeConversationId: d, labels: f, onNewChat: p, styles: h, className: g, getActions: _, onActionMenuOpen: v, onToggle: y, headerActions: b, onMoveConversation: x, activeFilter: T, onActiveFilterChange: E }) => {
736
+ let { colors: M, typography: N, newChatButton: P } = h ?? {}, { title: F, emptyLabel: I, noResultsLabel: L, loadingLabel: R = "Loading conversations", newChatLabel: ee, searchPlaceholder: z, searchClearLabel: te, filterLabels: B, groupLabels: V, actionsLabel: H, closeAriaLabel: U } = f, [W, G] = k(""), [K, q] = k(X.All);
737
737
  C(() => {
738
738
  T != null && (q(T), E?.(T));
739
739
  }, [T]);
@@ -762,7 +762,7 @@ var Y = /* @__PURE__ */ function(e) {
762
762
  targetGroupKey: t,
763
763
  afterId: n
764
764
  });
765
- }, [ke, x]), Fe = n({
765
+ }, [ke, x]), Fe = t({
766
766
  "--cp-bg": M?.background,
767
767
  "--sb-border": M?.border,
768
768
  "--cp-item-hover": M?.itemHover,
@@ -791,26 +791,26 @@ var Y = /* @__PURE__ */ function(e) {
791
791
  ]), Ie = D(() => Q.filter((e) => e.isPinned), [Q]), Le = D(() => Q.filter((e) => !e.isPinned && e.source !== X.Shared && e.source !== X.Organization), [Q]), Re = D(() => Q.filter((e) => !e.isPinned && e.source === X.Shared), [Q]), ze = D(() => Q.filter((e) => !e.isPinned && e.source === X.Organization), [Q]), Be = D(() => [
792
792
  {
793
793
  key: X.Pinned,
794
- label: H?.pinned ?? "Pinned",
794
+ label: V?.pinned ?? "Pinned",
795
795
  items: Ie
796
796
  },
797
797
  {
798
798
  key: X.MyChats,
799
- label: H?.myChats ?? "My chats",
799
+ label: V?.myChats ?? "My chats",
800
800
  items: Le
801
801
  },
802
802
  {
803
803
  key: X.Shared,
804
- label: H?.shared ?? "Shared",
804
+ label: V?.shared ?? "Shared",
805
805
  items: Re
806
806
  },
807
807
  {
808
808
  key: X.Organization,
809
- label: H?.organization ?? "Organization",
809
+ label: V?.organization ?? "Organization",
810
810
  items: ze
811
811
  }
812
812
  ], [
813
- H,
813
+ V,
814
814
  Ie,
815
815
  Le,
816
816
  Re,
@@ -829,16 +829,10 @@ var Y = /* @__PURE__ */ function(e) {
829
829
  return e;
830
830
  }, [Be, J]);
831
831
  C(() => {
832
- if (!d) return;
833
- let e = Be.find((e) => e.items.some((e) => e.id === d))?.key;
834
- if (e && !J.has(e)) {
835
- ne((t) => new Set(t).add(e));
836
- return;
837
- }
838
- if (le.current === d) return;
839
- let t = $.findIndex((e) => e.kind === Y.Item && e.item.id === d);
840
- t >= 0 && (oe.current?.scrollToRow({
841
- index: t,
832
+ if (!d || le.current === d) return;
833
+ let e = $.findIndex((e) => e.kind === Y.Item && e.item.id === d);
834
+ e >= 0 && (oe.current?.scrollToRow({
835
+ index: e,
842
836
  align: "smart",
843
837
  behavior: "smooth"
844
838
  }), le.current = d);
@@ -858,11 +852,11 @@ var Y = /* @__PURE__ */ function(e) {
858
852
  onSelectConversation: u,
859
853
  getActions: _,
860
854
  onActionMenuOpen: v,
861
- actionsLabel: U,
855
+ actionsLabel: H,
862
856
  styles: {
863
857
  groupHeaderClassName: N?.groupHeaderClassName,
864
858
  itemTitleClassName: N?.itemTitleClassName,
865
- itemIconBadgeClassName: m?.itemIconBadgeClassName
859
+ itemIconBadgeClassName: h?.itemIconBadgeClassName
866
860
  },
867
861
  draggingId: de,
868
862
  dragOverId: he,
@@ -882,10 +876,10 @@ var Y = /* @__PURE__ */ function(e) {
882
876
  u,
883
877
  _,
884
878
  v,
885
- U,
879
+ H,
886
880
  N?.groupHeaderClassName,
887
881
  N?.itemTitleClassName,
888
- m?.itemIconBadgeClassName,
882
+ h?.itemIconBadgeClassName,
889
883
  de,
890
884
  he,
891
885
  _e,
@@ -895,13 +889,13 @@ var Y = /* @__PURE__ */ function(e) {
895
889
  Ne,
896
890
  Pe
897
891
  ]), He = e.length === 0, Ue = e.length > 0 && Q.length === 0;
898
- return /* @__PURE__ */ j(c, {
892
+ return /* @__PURE__ */ j(s, {
899
893
  isOpen: l,
900
- orientation: s.Left,
894
+ orientation: o.Left,
901
895
  title: F,
902
896
  labels: {
903
897
  ariaLabel: F,
904
- closeLabel: te
898
+ closeLabel: U
905
899
  },
906
900
  onClose: y,
907
901
  styles: {
@@ -914,7 +908,7 @@ var Y = /* @__PURE__ */ function(e) {
914
908
  cssVars: Fe,
915
909
  titleClassName: N?.fontClassName,
916
910
  headerClassName: "h-[64px]",
917
- className: r(l ? "w-[325px] border-s border-e mobile:w-full" : "w-0", g)
911
+ className: n(l ? "w-[325px] border-s border-e mobile:w-full" : "w-0", g)
918
912
  },
919
913
  rightActions: b,
920
914
  children: [
@@ -924,17 +918,17 @@ var Y = /* @__PURE__ */ function(e) {
924
918
  labelClassName: N?.newChatLabelClassName,
925
919
  colors: P
926
920
  }),
927
- /* @__PURE__ */ A(o, {
921
+ /* @__PURE__ */ A(a, {
928
922
  value: W,
929
923
  onChange: G,
930
924
  labels: {
931
925
  placeholder: z,
932
- clearLabel: B
926
+ clearLabel: te
933
927
  }
934
928
  }),
935
929
  /* @__PURE__ */ A(ve, {
936
930
  activeTab: K,
937
- labels: V,
931
+ labels: B,
938
932
  onChange: (e) => {
939
933
  q(e), E?.(e);
940
934
  },
@@ -944,20 +938,20 @@ var Y = /* @__PURE__ */ function(e) {
944
938
  role: "status",
945
939
  "aria-live": "polite",
946
940
  className: "sr-only",
947
- children: t ? R : He ? I : Ue ? L : ""
941
+ children: c ? R : He ? I : Ue ? L : ""
948
942
  }),
949
943
  /* @__PURE__ */ A("div", {
950
944
  className: "flex-1 overflow-hidden px-2 py-1",
951
- children: t ? /* @__PURE__ */ A("div", {
945
+ children: c ? /* @__PURE__ */ A("div", {
952
946
  className: "flex flex-col gap-3 px-2 py-3",
953
- children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ A(h, {
947
+ children: Array.from({ length: 15 }, (e, t) => /* @__PURE__ */ A(m, {
954
948
  avatar: { size: 24 },
955
949
  showTitle: { width: ce(t) },
956
950
  paragraph: !1,
957
951
  active: !0,
958
952
  color: Z.skeletonColor
959
953
  }, t))
960
- }) : He ? /* @__PURE__ */ A(i, { label: I }) : Ue ? /* @__PURE__ */ A(a, { label: L }) : /* @__PURE__ */ A(se, {
954
+ }) : He ? /* @__PURE__ */ A(r, { label: I }) : Ue ? /* @__PURE__ */ A(i, { label: L }) : /* @__PURE__ */ A(se, {
961
955
  listRef: oe,
962
956
  id: ae,
963
957
  role: "list",
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.1.0-dev.52",
4
+ "version": "1.1.0-dev.55",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -18,14 +18,14 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "react-window": "^2.2.7",
21
- "@epam/ai-dial-kit": "1.1.0-dev.52",
22
- "@epam/ai-dial-ui-kit": "^0.13.0-dev.12"
21
+ "@epam/ai-dial-kit": "1.1.0-dev.55",
22
+ "@epam/ai-dial-ui-kit": "^0.13.0-dev.17"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": "^19.0.0",
26
26
  "@tabler/icons-react": "^3.0.0",
27
- "@epam/ai-dial-chat-shared": "1.1.0-dev.52",
28
- "@epam/ai-dial-sidebar": "1.1.0-dev.52"
27
+ "@epam/ai-dial-chat-shared": "1.1.0-dev.55",
28
+ "@epam/ai-dial-sidebar": "1.1.0-dev.55"
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",
@@ -1,27 +0,0 @@
1
- import { DropdownItem } from '@epam/ai-dial-ui-kit';
2
- import { FC } from 'react';
3
- import { ConversationItem } from '../../models/panel-props';
4
- /** Props for `ConversationGroup`. */
5
- export interface ConversationGroupProps {
6
- /** Section heading label. */
7
- label: string;
8
- /** Conversation items belonging to this group. */
9
- items: ConversationItem[];
10
- /** `id` of the currently active conversation. */
11
- activeConversationId?: string;
12
- /** Called when the user selects a conversation row. */
13
- onSelectConversation: (id: string) => void;
14
- /** Builds dropdown actions for a row. When absent or empty, no action trigger is rendered. */
15
- getActions?: (item: ConversationItem) => DropdownItem[];
16
- /** Called when a row action menu opens. */
17
- onActionMenuOpen?: (item: ConversationItem, trigger: HTMLButtonElement) => void;
18
- /** Accessible label for the actions trigger button. Defaults to `"More actions"`. */
19
- actionsLabel?: string;
20
- /** Typography class applied to the group header button. Defaults to `'dial-tiny-semi-text uppercase'`. */
21
- groupHeaderClassName?: string;
22
- /** Typography class applied to the conversation title text. */
23
- itemTitleClassName?: string;
24
- }
25
- /** Collapsible section rendering a labelled group of conversation rows. */
26
- export declare const ConversationGroup: FC<ConversationGroupProps>;
27
- //# sourceMappingURL=ConversationGroup.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConversationGroup.d.ts","sourceRoot":"","sources":["../../../src/components/ConversationGroup/ConversationGroup.tsx"],"names":[],"mappings":"AACA,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,EAAE,KAAK,EAAE,EAAyB,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAIjE,qCAAqC;AACrC,MAAM,WAAW,sBAAsB;IACrC,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,iDAAiD;IACjD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uDAAuD;IACvD,oBAAoB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,8FAA8F;IAC9F,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,YAAY,EAAE,CAAC;IAExD,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,CACjB,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,iBAAiB,KACvB,IAAI,CAAC;IACV,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0GAA0G;IAC1G,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,+DAA+D;IAC/D,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAmExD,CAAC"}
@@ -1 +0,0 @@
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,EAAiD,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE,mCAAmC;AACnC,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,IAAI,EAAE,gBAAgB,CAAC;IACvB,qDAAqD;IACrD,QAAQ,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,oBAAoB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sGAAsG;IACtG,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,YAAY,EAAE,CAAC;IACxD,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,CACjB,IAAI,EAAE,gBAAgB,EACtB,OAAO,EAAE,iBAAiB,KACvB,IAAI,CAAC;IACV,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,yFAAyF;IACzF,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,yEAAyE;IACzE,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,oEAAoE;IACpE,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,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,SAAS,CAAC,GAAG,IAAI,CAAC;IAC1C,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,SAAS,EACzB,OAAO,EAAE,MAAM,GAAG,IAAI,KACnB,IAAI,CAAC;CACX;AAED,8GAA8G;AAC9G,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAoLpD,CAAC"}