@epam/ai-dial-conversation-panel 1.1.16 → 1.1.17
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 +53 -57
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -4,14 +4,12 @@ import { Button as f, ButtonVariant as p, ConfirmationPopup as m, ConfirmationPo
|
|
|
4
4
|
import { createElement as te, memo as P, useCallback as F, useEffect as I, useId as ne, useImperativeHandle as re, useLayoutEffect as ie, useMemo as L, useRef as R, useState as z } from "react";
|
|
5
5
|
import { Fragment as ae, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
6
6
|
import { IconAlertCircleFilled as H, IconAlertTriangleFilled as oe, IconCaretDownFilled as se, IconCaretRightFilled as ce, IconCheck as U, IconChevronDown as le, IconChevronUp as ue, IconClock as de, IconDotsVertical as W, IconFile as fe, IconFileZip as pe, IconJson as me, IconPlus as he, IconSparkles as ge, IconX as _e } from "@tabler/icons-react";
|
|
7
|
-
|
|
7
|
+
// ../../node_modules/react-window/dist/react-window.js
|
|
8
8
|
var G = typeof window < "u" ? ie : I;
|
|
9
9
|
function ve(e) {
|
|
10
10
|
if (e !== void 0) switch (typeof e) {
|
|
11
11
|
case "number": return e;
|
|
12
|
-
case "string":
|
|
13
|
-
if (e.endsWith("px")) return parseFloat(e);
|
|
14
|
-
break;
|
|
12
|
+
case "string": if (e.endsWith("px")) return parseFloat(e);
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
15
|
function ye({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
@@ -72,12 +70,10 @@ function xe(e = !1) {
|
|
|
72
70
|
function Se({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
73
71
|
if (t === "horizontal" && n) switch (xe()) {
|
|
74
72
|
case "negative": return -r;
|
|
75
|
-
case "positive-descending":
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
break;
|
|
73
|
+
case "positive-descending": if (e) {
|
|
74
|
+
let { clientWidth: t, scrollLeft: n, scrollWidth: r } = e;
|
|
75
|
+
return r - t - n;
|
|
76
|
+
}
|
|
81
77
|
}
|
|
82
78
|
return r;
|
|
83
79
|
}
|
|
@@ -141,9 +137,7 @@ function Ee({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
141
137
|
case "function":
|
|
142
138
|
a = n(e, t);
|
|
143
139
|
break;
|
|
144
|
-
case "number":
|
|
145
|
-
a = n;
|
|
146
|
-
break;
|
|
140
|
+
case "number": a = n;
|
|
147
141
|
}
|
|
148
142
|
if (e === 0) r.set(e, {
|
|
149
143
|
size: a,
|
|
@@ -185,9 +179,7 @@ function Oe({ containerSize: e, itemSize: t }) {
|
|
|
185
179
|
case "string":
|
|
186
180
|
q(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), q(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
|
|
187
181
|
break;
|
|
188
|
-
default:
|
|
189
|
-
n = t;
|
|
190
|
-
break;
|
|
182
|
+
default: n = t;
|
|
191
183
|
}
|
|
192
184
|
return n;
|
|
193
185
|
}
|
|
@@ -241,18 +233,21 @@ function ke({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
241
233
|
h,
|
|
242
234
|
a,
|
|
243
235
|
m
|
|
244
|
-
]), w = F((t) =>
|
|
245
|
-
|
|
246
|
-
containerScrollOffset: Se({
|
|
236
|
+
]), w = F((t) => {
|
|
237
|
+
let n = Se({
|
|
247
238
|
containerElement: e,
|
|
248
239
|
direction: r,
|
|
249
240
|
isRtl: i,
|
|
250
241
|
scrollOffset: t
|
|
251
|
-
})
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
242
|
+
});
|
|
243
|
+
return Te({
|
|
244
|
+
cachedBounds: h,
|
|
245
|
+
containerScrollOffset: n,
|
|
246
|
+
containerSize: p,
|
|
247
|
+
itemCount: a,
|
|
248
|
+
overscanCount: l
|
|
249
|
+
});
|
|
250
|
+
}, [
|
|
256
251
|
h,
|
|
257
252
|
e,
|
|
258
253
|
p,
|
|
@@ -262,7 +257,8 @@ function ke({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
262
257
|
l
|
|
263
258
|
]);
|
|
264
259
|
return G(() => {
|
|
265
|
-
|
|
260
|
+
let t = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
|
|
261
|
+
v(w(t));
|
|
266
262
|
}, [
|
|
267
263
|
e,
|
|
268
264
|
r,
|
|
@@ -271,19 +267,19 @@ function ke({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
271
267
|
if (!e) return;
|
|
272
268
|
let t = () => {
|
|
273
269
|
v((t) => {
|
|
274
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
270
|
+
let { scrollLeft: n, scrollTop: o } = e, s = Se({
|
|
271
|
+
containerElement: e,
|
|
272
|
+
direction: r,
|
|
273
|
+
isRtl: i,
|
|
274
|
+
scrollOffset: r === "vertical" ? o : n
|
|
275
|
+
}), c = Te({
|
|
275
276
|
cachedBounds: h,
|
|
276
|
-
containerScrollOffset:
|
|
277
|
-
containerElement: e,
|
|
278
|
-
direction: r,
|
|
279
|
-
isRtl: i,
|
|
280
|
-
scrollOffset: r === "vertical" ? o : n
|
|
281
|
-
}),
|
|
277
|
+
containerScrollOffset: s,
|
|
282
278
|
containerSize: p,
|
|
283
279
|
itemCount: a,
|
|
284
280
|
overscanCount: l
|
|
285
281
|
});
|
|
286
|
-
return J(
|
|
282
|
+
return J(c, t) ? t : c;
|
|
287
283
|
});
|
|
288
284
|
};
|
|
289
285
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -448,8 +444,7 @@ function Ne({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
448
444
|
}
|
|
449
445
|
}, E, e, D);
|
|
450
446
|
}
|
|
451
|
-
|
|
452
|
-
//#region src/types/virtual-row.ts
|
|
447
|
+
// src/types/virtual-row.ts
|
|
453
448
|
var X = /* @__PURE__ */ function(e) {
|
|
454
449
|
return e.Header = "header", e.Item = "item", e;
|
|
455
450
|
}({}), Pe = (e) => `${60 + e * 23 % 35}%`, Fe = (e, t) => e ? t ? "pe-9" : "pe-2 group-focus-within/conversation:pe-9 group-hover/conversation:pe-9" : "pe-3", Ie = (e, t) => t.rows[e].kind === X.Item ? 36 : e === 0 ? 24 : 56, Le = (e) => {
|
|
@@ -511,27 +506,30 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
511
506
|
className: N("flex-1 justify-center rounded-full", r)
|
|
512
507
|
}, i))
|
|
513
508
|
});
|
|
514
|
-
}), Ue = { button: "_button_1vksy_1" }, We = P(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: i }) =>
|
|
515
|
-
|
|
516
|
-
style: r({
|
|
509
|
+
}), Ue = { button: "_button_1vksy_1" }, We = P(({ label: e, onClick: t, labelClassName: n = "dial-small-semi-text", colors: i }) => {
|
|
510
|
+
let o = r({
|
|
517
511
|
"--cp-new-chat-bg": i?.background,
|
|
518
512
|
"--cp-new-chat-text": i?.text,
|
|
519
513
|
"--cp-new-chat-focus-outline": i?.focusOutline
|
|
520
|
-
})
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
514
|
+
});
|
|
515
|
+
return /* @__PURE__ */ B("div", {
|
|
516
|
+
className: "px-3 py-2",
|
|
517
|
+
style: o,
|
|
518
|
+
children: /* @__PURE__ */ V("button", {
|
|
519
|
+
onClick: t,
|
|
520
|
+
type: "button",
|
|
521
|
+
className: a("flex h-[36px] w-full cursor-pointer items-center justify-center gap-2 px-3 py-1 shadow-chat-button hover:shadow-xs focus-visible:shadow-xs active:shadow-xs", Ue.button),
|
|
522
|
+
children: [/* @__PURE__ */ B(he, {
|
|
523
|
+
size: 18,
|
|
524
|
+
stroke: _,
|
|
525
|
+
className: "shrink-0"
|
|
526
|
+
}), /* @__PURE__ */ B("span", {
|
|
527
|
+
className: n,
|
|
528
|
+
children: e
|
|
529
|
+
})]
|
|
530
|
+
})
|
|
531
|
+
});
|
|
532
|
+
}), Z = {
|
|
535
533
|
skeletonColor: "var(--cp-skeleton-color, var(--bg-control-disable-primary, #dce0e8))",
|
|
536
534
|
item: "_item_i3lsf_2",
|
|
537
535
|
itemActive: "_itemActive_i3lsf_15",
|
|
@@ -719,7 +717,7 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
719
717
|
onDrop: S
|
|
720
718
|
})
|
|
721
719
|
});
|
|
722
|
-
}, qe = (e, t) => t === n.All
|
|
720
|
+
}, qe = (e, t) => t === n.All || e.source === t, Je = (e, t) => !t || e.title.toLowerCase().includes(t.toLowerCase()), Ye = /* @__PURE__ */ new Set([
|
|
723
721
|
n.Pinned,
|
|
724
722
|
n.MyChats,
|
|
725
723
|
n.Shared,
|
|
@@ -1178,8 +1176,7 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
1178
1176
|
});
|
|
1179
1177
|
});
|
|
1180
1178
|
ot.displayName = "ImportExportQueue";
|
|
1181
|
-
|
|
1182
|
-
//#region src/components/RenameConversationPopup/RenameConversationPopup.tsx
|
|
1179
|
+
// src/components/RenameConversationPopup/RenameConversationPopup.tsx
|
|
1183
1180
|
var st = P(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCancel: c, onGenerateWithAi: l, labels: u, styles: d }) => {
|
|
1184
1181
|
let [f, m] = z(t), [h, v] = z(!1), [y, b] = z(null), S = R(null), E = R(!1), D = R(0);
|
|
1185
1182
|
I(() => {
|
|
@@ -1269,5 +1266,4 @@ var st = P(({ isOpen: e, currentTitle: t, isSaving: n, error: r, onSave: a, onCa
|
|
|
1269
1266
|
});
|
|
1270
1267
|
});
|
|
1271
1268
|
st.displayName = "RenameConversationPopup";
|
|
1272
|
-
//#endregion
|
|
1273
1269
|
export { Xe as ConversationPanel, ot as ImportExportQueue, st as RenameConversationPopup, tt as getTransferFileIcon };
|
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.
|
|
4
|
+
"version": "1.1.17",
|
|
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.1.
|
|
22
|
+
"@epam/ai-dial-sidebar": "1.1.17"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^19.2.8",
|
|
26
|
-
"@epam/ai-dial-chat-shared": "1.1.
|
|
26
|
+
"@epam/ai-dial-chat-shared": "1.1.17",
|
|
27
27
|
"@epam/ai-dial-ui-kit": "^0.14.2"
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|