@epam/ai-dial-conversation-panel 1.3.0-dev.124 → 1.3.0-dev.126
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.
- package/index.js +62 -60
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -15,9 +15,7 @@ var W = {
|
|
|
15
15
|
function K(e) {
|
|
16
16
|
if (e !== void 0) switch (typeof e) {
|
|
17
17
|
case "number": return e;
|
|
18
|
-
case "string":
|
|
19
|
-
if (e.endsWith("px")) return parseFloat(e);
|
|
20
|
-
break;
|
|
18
|
+
case "string": if (e.endsWith("px")) return parseFloat(e);
|
|
21
19
|
}
|
|
22
20
|
}
|
|
23
21
|
function ce({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
@@ -78,12 +76,10 @@ function ue(e = !1) {
|
|
|
78
76
|
function de({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
79
77
|
if (t === "horizontal" && n) switch (ue()) {
|
|
80
78
|
case "negative": return -r;
|
|
81
|
-
case "positive-descending":
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
break;
|
|
79
|
+
case "positive-descending": if (e) {
|
|
80
|
+
let { clientWidth: t, scrollLeft: n, scrollWidth: r } = e;
|
|
81
|
+
return r - t - n;
|
|
82
|
+
}
|
|
87
83
|
}
|
|
88
84
|
return r;
|
|
89
85
|
}
|
|
@@ -147,9 +143,7 @@ function he({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
147
143
|
case "function":
|
|
148
144
|
a = n(e, t);
|
|
149
145
|
break;
|
|
150
|
-
case "number":
|
|
151
|
-
a = n;
|
|
152
|
-
break;
|
|
146
|
+
case "number": a = n;
|
|
153
147
|
}
|
|
154
148
|
if (e === 0) r.set(e, {
|
|
155
149
|
size: a,
|
|
@@ -191,9 +185,7 @@ function _e({ containerSize: e, itemSize: t }) {
|
|
|
191
185
|
case "string":
|
|
192
186
|
J(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), J(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
|
|
193
187
|
break;
|
|
194
|
-
default:
|
|
195
|
-
n = t;
|
|
196
|
-
break;
|
|
188
|
+
default: n = t;
|
|
197
189
|
}
|
|
198
190
|
return n;
|
|
199
191
|
}
|
|
@@ -247,18 +239,21 @@ function ve({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
247
239
|
h,
|
|
248
240
|
a,
|
|
249
241
|
m
|
|
250
|
-
]), w = M((t) =>
|
|
251
|
-
|
|
252
|
-
containerScrollOffset: de({
|
|
242
|
+
]), w = M((t) => {
|
|
243
|
+
let n = de({
|
|
253
244
|
containerElement: e,
|
|
254
245
|
direction: r,
|
|
255
246
|
isRtl: i,
|
|
256
247
|
scrollOffset: t
|
|
257
|
-
})
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
248
|
+
});
|
|
249
|
+
return Y({
|
|
250
|
+
cachedBounds: h,
|
|
251
|
+
containerScrollOffset: n,
|
|
252
|
+
containerSize: p,
|
|
253
|
+
itemCount: a,
|
|
254
|
+
overscanCount: l
|
|
255
|
+
});
|
|
256
|
+
}, [
|
|
262
257
|
h,
|
|
263
258
|
e,
|
|
264
259
|
p,
|
|
@@ -268,7 +263,8 @@ function ve({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
268
263
|
l
|
|
269
264
|
]);
|
|
270
265
|
return G(() => {
|
|
271
|
-
|
|
266
|
+
let t = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
|
|
267
|
+
v(w(t));
|
|
272
268
|
}, [
|
|
273
269
|
e,
|
|
274
270
|
r,
|
|
@@ -277,19 +273,19 @@ function ve({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
277
273
|
if (!e) return;
|
|
278
274
|
let t = () => {
|
|
279
275
|
v((t) => {
|
|
280
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
276
|
+
let { scrollLeft: n, scrollTop: o } = e, s = de({
|
|
277
|
+
containerElement: e,
|
|
278
|
+
direction: r,
|
|
279
|
+
isRtl: i,
|
|
280
|
+
scrollOffset: r === "vertical" ? o : n
|
|
281
|
+
}), c = Y({
|
|
281
282
|
cachedBounds: h,
|
|
282
|
-
containerScrollOffset:
|
|
283
|
-
containerElement: e,
|
|
284
|
-
direction: r,
|
|
285
|
-
isRtl: i,
|
|
286
|
-
scrollOffset: r === "vertical" ? o : n
|
|
287
|
-
}),
|
|
283
|
+
containerScrollOffset: s,
|
|
288
284
|
containerSize: p,
|
|
289
285
|
itemCount: a,
|
|
290
286
|
overscanCount: l
|
|
291
287
|
});
|
|
292
|
-
return fe(
|
|
288
|
+
return fe(c, t) ? t : c;
|
|
293
289
|
});
|
|
294
290
|
};
|
|
295
291
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -460,7 +456,7 @@ var Z = /* @__PURE__ */ function(e) {
|
|
|
460
456
|
return e.Avatar = "avatar", e.Indicator = "indicator", e;
|
|
461
457
|
}({}), Q = /* @__PURE__ */ function(e) {
|
|
462
458
|
return e.Header = "header", e.Item = "item", e;
|
|
463
|
-
}({}), Ce = (e, n) => n === t.All
|
|
459
|
+
}({}), Ce = (e, n) => n === t.All || e.source === n, we = (e, t) => !t || e.title.toLowerCase().includes(t.toLowerCase()), Te = (e) => `${60 + e * 23 % 35}%`, Ee = (e, t) => e ? t ? "pe-9" : "pe-2 group-focus-within/conversation:pe-9 group-hover/conversation:pe-9" : "pe-3", De = (e, t) => {
|
|
464
460
|
let n = t.rows[e];
|
|
465
461
|
return t.rowVariant === Z.Indicator ? n.kind === Q.Item ? 34 : e === 0 ? 32 : 40 : n.kind === Q.Item ? 36 : e === 0 ? 24 : 56;
|
|
466
462
|
}, Oe = 5, ke = (e) => Math.max(Oe, Math.ceil(Math.ceil(e / 36) / 2)), Ae = (e) => {
|
|
@@ -701,7 +697,7 @@ var Z = /* @__PURE__ */ function(e) {
|
|
|
701
697
|
onDrop: C
|
|
702
698
|
})
|
|
703
699
|
});
|
|
704
|
-
}, Re = new Set([
|
|
700
|
+
}, Re = /* @__PURE__ */ new Set([
|
|
705
701
|
t.Pinned,
|
|
706
702
|
t.MyChats,
|
|
707
703
|
t.Shared,
|
|
@@ -1093,37 +1089,43 @@ var Z = /* @__PURE__ */ function(e) {
|
|
|
1093
1089
|
value: t.Organization,
|
|
1094
1090
|
labelKey: "organization"
|
|
1095
1091
|
}
|
|
1096
|
-
], Ke = j(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) =>
|
|
1097
|
-
|
|
1092
|
+
], Ke = j(({ activeTab: e, labels: t, onChange: n, tabClassName: r = "dial-tiny-semi-text", hiddenSources: i }) => {
|
|
1093
|
+
let a = L(() => Ge.filter(({ value: e }) => !i?.includes(e)).map(({ value: e, labelKey: n }) => ({
|
|
1098
1094
|
value: e,
|
|
1099
1095
|
label: t[n]
|
|
1100
|
-
})), [t, i])
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1096
|
+
})), [t, i]);
|
|
1097
|
+
return /* @__PURE__ */ B(v, {
|
|
1098
|
+
items: a,
|
|
1099
|
+
value: e,
|
|
1100
|
+
onChange: n,
|
|
1101
|
+
stretch: !0,
|
|
1102
|
+
"aria-label": t.groupAriaLabel ?? "Filter chats",
|
|
1103
|
+
className: "px-3 py-2",
|
|
1104
|
+
chipClassName: k("!px-2", r)
|
|
1105
|
+
});
|
|
1106
|
+
}), qe = { button: "_button_vjird_1" }, Je = j(({ label: e, onClick: t, labelClassName: r = "dial-small-semi-text", colors: a, className: o }) => {
|
|
1107
|
+
let s = n({
|
|
1110
1108
|
"--cp-new-chat-bg": a?.background,
|
|
1111
1109
|
"--cp-new-chat-text": a?.text,
|
|
1112
1110
|
"--cp-new-chat-focus-outline": a?.focusOutline
|
|
1113
|
-
})
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1111
|
+
});
|
|
1112
|
+
return /* @__PURE__ */ B("div", {
|
|
1113
|
+
className: "px-3 py-2",
|
|
1114
|
+
style: s,
|
|
1115
|
+
children: /* @__PURE__ */ B(d, {
|
|
1116
|
+
label: e,
|
|
1117
|
+
textClassName: r,
|
|
1118
|
+
iconBefore: /* @__PURE__ */ B(ie, {
|
|
1119
|
+
size: 18,
|
|
1120
|
+
stroke: m,
|
|
1121
|
+
className: "shrink-0",
|
|
1122
|
+
"aria-hidden": !0
|
|
1123
|
+
}),
|
|
1124
|
+
onClick: t,
|
|
1125
|
+
className: i("h-[36px] w-full gap-2 px-3 py-1 shadow-chat-button hover:shadow-xs focus-visible:shadow-xs active:shadow-xs", qe.button, o, W.newChatButton)
|
|
1126
|
+
})
|
|
1127
|
+
});
|
|
1128
|
+
}), Ye = j(({ conversations: e, isLoading: r, isOpen: a, onSelectConversation: o, activeConversationId: s, labels: c, onNewChat: d, styles: f, className: p, isOverlay: m = !1, getActions: h, onActionMenuOpen: g, onToggle: _, headerActions: v, onMoveConversation: y, activeFilter: b, onActiveFilterChange: x, isFilterTabsHidden: S = !1, hiddenSources: C }) => {
|
|
1127
1129
|
let { colors: w, typography: E, newChatButton: D, searchWrapperClassName: O, headerClassName: k, headerActionsClassName: A, newChatButtonClassName: j } = f ?? {}, { title: P, emptyLabel: F, noResultsLabel: I, loadingLabel: R, newChatLabel: ee, searchPlaceholder: H, searchClearLabel: te, filterLabels: ne, groupLabels: re, actionsLabel: U, unreadIndicatorLabel: ie, closeAriaLabel: ae } = c, [oe, se] = z(""), [G, K] = z(t.All);
|
|
1128
1130
|
N(() => {
|
|
1129
1131
|
b != null && K(b);
|
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.3.0-dev.
|
|
4
|
+
"version": "1.3.0-dev.126",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"react-window": "^2.2.7",
|
|
21
21
|
"@tabler/icons-react": "^3.44.0",
|
|
22
|
-
"@epam/ai-dial-sidebar": "1.3.0-dev.
|
|
22
|
+
"@epam/ai-dial-sidebar": "1.3.0-dev.126"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^19.2.8",
|
|
26
|
-
"@epam/ai-dial-chat-shared": "1.3.0-dev.
|
|
26
|
+
"@epam/ai-dial-chat-shared": "1.3.0-dev.126",
|
|
27
27
|
"@epam/ai-dial-ui-kit": "^0.16.0-dev.20"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|