@epam/ai-dial-conversation-panel 1.0.0-dev.478 → 1.0.0-dev.481
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/components/ConversationGroup/ConversationGroup.d.ts +4 -8
- package/components/ConversationGroup/ConversationGroup.d.ts.map +1 -1
- package/components/ConversationGroup/ConversationRow.d.ts +7 -7
- package/components/ConversationGroup/ConversationRow.d.ts.map +1 -1
- package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts +5 -3
- package/components/ConversationGroupHeader/ConversationGroupHeader.d.ts.map +1 -1
- package/components/ConversationPanel/ConversationPanel.d.ts +1 -1
- package/components/ConversationPanel/ConversationPanel.d.ts.map +1 -1
- package/components/ConversationPanel/utils.d.ts +4 -4
- package/components/ConversationPanel/utils.d.ts.map +1 -1
- package/components/FilterTabs/FilterTabs.d.ts +2 -5
- package/components/FilterTabs/FilterTabs.d.ts.map +1 -1
- package/components/RowRenderer/RowRenderer.d.ts +1 -1
- package/components/RowRenderer/RowRenderer.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.d.ts +2 -4
- package/index.d.ts.map +1 -1
- package/index.js +362 -328
- package/models/panel-props.d.ts +64 -60
- package/models/panel-props.d.ts.map +1 -1
- package/models/virtual-row.d.ts +22 -15
- package/models/virtual-row.d.ts.map +1 -1
- package/package.json +4 -4
- package/types/conversation-classification.d.ts +12 -0
- package/types/conversation-classification.d.ts.map +1 -0
- package/utils/drag.d.ts +8 -9
- package/utils/drag.d.ts.map +1 -1
- package/types/conversation-group-key.d.ts +0 -8
- package/types/conversation-group-key.d.ts.map +0 -1
- package/types/conversation-source.d.ts +0 -7
- package/types/conversation-source.d.ts.map +0 -1
- package/types/filter-tab.d.ts +0 -8
- package/types/filter-tab.d.ts.map +0 -1
package/models/panel-props.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { DropdownItem } from '@epam/ai-dial-ui-kit';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
import { ConversationSource } from '../types/conversation-source';
|
|
5
|
-
import { FilterTab } from '../types/filter-tab';
|
|
3
|
+
import { FilterTab } from '../types/conversation-classification';
|
|
6
4
|
/** Labels for each filter tab — provided as props so the app supplies i18n strings. */
|
|
7
5
|
export interface FilterLabels {
|
|
8
6
|
/** Label for the "All" tab. */
|
|
@@ -15,7 +13,7 @@ export interface FilterLabels {
|
|
|
15
13
|
organization: string;
|
|
16
14
|
}
|
|
17
15
|
/** A single conversation entry shown in the history panel. */
|
|
18
|
-
export interface
|
|
16
|
+
export interface ConversationItem {
|
|
19
17
|
/** Unique conversation identifier (path or UUID). */
|
|
20
18
|
id: string;
|
|
21
19
|
/** Human-readable title — typically the first user message. */
|
|
@@ -23,7 +21,7 @@ export interface ConversationHistoryItem {
|
|
|
23
21
|
/** When true the item is shown in the Pinned section. */
|
|
24
22
|
isPinned?: boolean;
|
|
25
23
|
/** Ownership/share source — used to filter by tab. */
|
|
26
|
-
source?:
|
|
24
|
+
source?: FilterTab;
|
|
27
25
|
/** URL of the model or conversation icon. When absent a default icon is shown. */
|
|
28
26
|
iconUrl?: string;
|
|
29
27
|
/** Tooltip text shown on the deployment icon. Typically the agent or model display name. */
|
|
@@ -38,19 +36,8 @@ export interface ConversationHistoryItem {
|
|
|
38
36
|
href?: string;
|
|
39
37
|
}
|
|
40
38
|
/** Font overrides for the header title in `ConversationPanel`. */
|
|
41
|
-
export interface
|
|
42
|
-
/**
|
|
43
|
-
fontFamily?: string;
|
|
44
|
-
/** Font size applied to the panel title. */
|
|
45
|
-
fontSize?: string;
|
|
46
|
-
/** Font weight applied to the panel title. */
|
|
47
|
-
fontWeight?: string | number;
|
|
48
|
-
/** Line height applied to the panel title. */
|
|
49
|
-
lineHeight?: string;
|
|
50
|
-
/**
|
|
51
|
-
* A single utility class (e.g. `'dial-body-semi-text'`) applied to the title span.
|
|
52
|
-
* When provided, individual font CSS vars are ignored in favour of this class.
|
|
53
|
-
*/
|
|
39
|
+
export interface ConversationPanelTypography {
|
|
40
|
+
/** A single utility class (e.g. `'dial-body-semi-text'`) applied to the title span. */
|
|
54
41
|
fontClassName?: string;
|
|
55
42
|
/** Typography class applied to collapsible group header buttons. Defaults to `'text-xs font-semibold'`. */
|
|
56
43
|
groupHeaderClassName?: string;
|
|
@@ -60,13 +47,9 @@ export interface ConversationHistoryTypography {
|
|
|
60
47
|
newChatLabelClassName?: string;
|
|
61
48
|
/** Class applied to each filter tab. Defaults to `'flex-1 dial-tiny-semi-text'`. */
|
|
62
49
|
tabClassName?: string;
|
|
63
|
-
/** Text color class applied to each filter tab label. Defaults to `'text-primary'`. */
|
|
64
|
-
tabColorClassName?: string;
|
|
65
|
-
/** CSS class applied to the icon badge in each conversation row. Defaults to `'rounded-full'`. */
|
|
66
|
-
itemIconBadgeClassName?: string;
|
|
67
50
|
}
|
|
68
51
|
/** CSS custom-property overrides for `ConversationPanel`. */
|
|
69
|
-
export interface
|
|
52
|
+
export interface ConversationColors {
|
|
70
53
|
/** Panel background color. */
|
|
71
54
|
background?: string;
|
|
72
55
|
/** Inner-edge divider border color. */
|
|
@@ -85,34 +68,52 @@ export interface ConversationHistoryColors {
|
|
|
85
68
|
newChatActiveBackground?: string;
|
|
86
69
|
/** Background of the New chat button. */
|
|
87
70
|
newChatBackground?: string;
|
|
71
|
+
/** Label/icon text color of the New chat button. */
|
|
72
|
+
newChatText?: string;
|
|
73
|
+
/** Blue shadow color of the New chat button in the default state. */
|
|
74
|
+
newChatShadowBlue?: string;
|
|
75
|
+
/** Blue shadow color of the New chat button on hover. */
|
|
76
|
+
newChatShadowBlueHover?: string;
|
|
77
|
+
/** Blue shadow color of the New chat button while active/pressed. */
|
|
78
|
+
newChatShadowBlueActive?: string;
|
|
79
|
+
/** Purple shadow color of the New chat button in the default state. */
|
|
80
|
+
newChatShadowPurple?: string;
|
|
81
|
+
/** Purple shadow color of the New chat button on hover. */
|
|
82
|
+
newChatShadowPurpleHover?: string;
|
|
83
|
+
/** Purple shadow color of the New chat button while active/pressed. */
|
|
84
|
+
newChatShadowPurpleActive?: string;
|
|
85
|
+
/** Ring color shown around a group header acting as a drag-and-drop target. */
|
|
86
|
+
dropZoneRing?: string;
|
|
87
|
+
/** Background color of the active row actions trigger button. */
|
|
88
|
+
triggerBackground?: string;
|
|
89
|
+
/** Icon color of the row actions trigger button while active. */
|
|
90
|
+
triggerIcon?: string;
|
|
91
|
+
/** Icon color of the row actions trigger button in its idle state. */
|
|
92
|
+
triggerIconIdle?: string;
|
|
93
|
+
/** Shimmer color of the loading skeleton avatar. */
|
|
94
|
+
skeletonColor?: string;
|
|
88
95
|
}
|
|
89
96
|
/** Combined style overrides (colors and typography) for `ConversationPanel`. */
|
|
90
97
|
export interface ConversationPanelStyles {
|
|
91
98
|
/** Color overrides applied as CSS custom properties. */
|
|
92
|
-
colors?:
|
|
99
|
+
colors?: ConversationColors;
|
|
93
100
|
/** Typography overrides for the panel and its children. */
|
|
94
|
-
typography?:
|
|
101
|
+
typography?: ConversationPanelTypography;
|
|
102
|
+
/** Text color class applied to each filter tab label. Defaults to `'text-primary'`. */
|
|
103
|
+
tabColorClassName?: string;
|
|
104
|
+
/** CSS class applied to the icon badge in each conversation row. Defaults to `'rounded-full'`. */
|
|
105
|
+
itemIconBadgeClassName?: string;
|
|
95
106
|
}
|
|
96
|
-
/**
|
|
97
|
-
export interface
|
|
98
|
-
/** Ordered list of conversations to display. */
|
|
99
|
-
conversations: ConversationHistoryItem[];
|
|
100
|
-
/** When true, renders skeleton rows instead of the conversation list. */
|
|
101
|
-
isLoading?: boolean;
|
|
102
|
-
/** Whether the panel is currently expanded. */
|
|
103
|
-
isOpen: boolean;
|
|
104
|
-
/** Called with the conversation `id` when a row is clicked. */
|
|
105
|
-
onSelectConversation: (id: string) => void;
|
|
106
|
-
/** `id` of the currently viewed conversation; that row gets `aria-current="page"`. */
|
|
107
|
-
activeConversationId?: string;
|
|
107
|
+
/** Localised labels and text content for `ConversationPanel`. */
|
|
108
|
+
export interface ConversationPanelLabels {
|
|
108
109
|
/** Panel heading text (e.g. `"Chats"`). */
|
|
109
110
|
title: string;
|
|
110
111
|
/** Message shown when `conversations` is empty. */
|
|
111
112
|
emptyLabel: string;
|
|
112
113
|
/** Message shown when conversations exist but none match the active filter. */
|
|
113
114
|
noResultsLabel: string;
|
|
114
|
-
/**
|
|
115
|
-
|
|
115
|
+
/** Status message announced to assistive tech while conversations are loading. Defaults to `'Loading conversations'`. */
|
|
116
|
+
loadingLabel?: string;
|
|
116
117
|
/** Label for the New chat button (e.g. `"New chat"`). */
|
|
117
118
|
newChatLabel: string;
|
|
118
119
|
/** Placeholder text for the search input (e.g. `"Search chat…"`). */
|
|
@@ -132,6 +133,27 @@ export interface ConversationPanelProps {
|
|
|
132
133
|
/** Heading for the Organization section. Defaults to `"Organization"`. */
|
|
133
134
|
organization?: string;
|
|
134
135
|
};
|
|
136
|
+
/** Accessible label for the row actions trigger button. Defaults to `"More actions"`. */
|
|
137
|
+
actionsLabel?: string;
|
|
138
|
+
/** Accessible label for the sidebar toggle icon button. Required when `onToggle` is provided. */
|
|
139
|
+
closeAriaLabel?: string;
|
|
140
|
+
}
|
|
141
|
+
/** Props accepted by `ConversationPanel`. */
|
|
142
|
+
export interface ConversationPanelProps {
|
|
143
|
+
/** Ordered list of conversations to display. */
|
|
144
|
+
conversations: ConversationItem[];
|
|
145
|
+
/** When true, renders skeleton rows instead of the conversation list. */
|
|
146
|
+
isLoading?: boolean;
|
|
147
|
+
/** Whether the panel is currently expanded. */
|
|
148
|
+
isOpen: boolean;
|
|
149
|
+
/** Called with the conversation `id` when a row is clicked. */
|
|
150
|
+
onSelectConversation: (id: string) => void;
|
|
151
|
+
/** `id` of the currently viewed conversation; that row gets `aria-current="page"`. */
|
|
152
|
+
activeConversationId?: string;
|
|
153
|
+
/** Localised labels and text content for the panel. */
|
|
154
|
+
labels: ConversationPanelLabels;
|
|
155
|
+
/** Called when the New chat button is clicked. */
|
|
156
|
+
onNewChat: () => void;
|
|
135
157
|
/** Color and typography overrides applied as CSS custom properties. */
|
|
136
158
|
styles?: ConversationPanelStyles;
|
|
137
159
|
/** Extra class name(s) merged onto the panel root element. */
|
|
@@ -141,33 +163,15 @@ export interface ConversationPanelProps {
|
|
|
141
163
|
* Receives the full item so actions can reflect per-item state (e.g. `isPinned` toggle).
|
|
142
164
|
* When omitted or returns an empty array, no actions trigger is rendered on rows.
|
|
143
165
|
*/
|
|
144
|
-
getActions?: (item:
|
|
145
|
-
/** Accessible label for the row actions trigger button. Defaults to `"More actions"`. */
|
|
146
|
-
actionsLabel?: string;
|
|
166
|
+
getActions?: (item: ConversationItem) => DropdownItem[];
|
|
147
167
|
/**
|
|
148
168
|
* Called when the mobile sidebar toggle icon in the panel header is clicked.
|
|
149
169
|
* When provided, the toggle button becomes visible on mobile screens.
|
|
150
170
|
* The parent is responsible for managing `isOpen` state in response to this callback.
|
|
151
171
|
*/
|
|
152
172
|
onToggle?: () => void;
|
|
153
|
-
/** Accessible label for the sidebar toggle icon button. Required when `onToggle` is provided. */
|
|
154
|
-
closeAriaLabel?: string;
|
|
155
|
-
/**
|
|
156
|
-
* Enables the drag-to-resize handle on the panel's right edge.
|
|
157
|
-
* When false (default) the panel renders at a fixed width.
|
|
158
|
-
* Pass `false` on mobile to disable resizing.
|
|
159
|
-
*/
|
|
160
|
-
resizable?: boolean;
|
|
161
|
-
/** Initial panel width in px used when `resizable` is true. Defaults to 325. */
|
|
162
|
-
defaultPanelWidth?: number;
|
|
163
|
-
/** Minimum panel width in px used when `resizable` is true. Defaults to 312. */
|
|
164
|
-
minPanelWidth?: number;
|
|
165
|
-
/** Maximum panel width in px used when `resizable` is true. Defaults to 600. */
|
|
166
|
-
maxPanelWidth?: number;
|
|
167
|
-
/** Called with the new width in px when the user finishes a resize drag. */
|
|
168
|
-
onPanelResizeStop?: (width: number) => void;
|
|
169
173
|
/**
|
|
170
|
-
* Content rendered in the
|
|
174
|
+
* Content rendered in the end action group of the panel header bar.
|
|
171
175
|
* The app supplies any ReactNode — the library does not prescribe its content.
|
|
172
176
|
*/
|
|
173
177
|
headerActions?: ReactNode;
|
|
@@ -201,7 +205,7 @@ export interface ConversationMove {
|
|
|
201
205
|
/** Id of the conversation that was dragged. */
|
|
202
206
|
draggedId: string;
|
|
203
207
|
/** The group the item was dropped into. */
|
|
204
|
-
targetGroupKey:
|
|
208
|
+
targetGroupKey: FilterTab;
|
|
205
209
|
/**
|
|
206
210
|
* Id of the item the dragged conversation should be placed after.
|
|
207
211
|
* `null` means the item was dropped at the top of the target group.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel-props.d.ts","sourceRoot":"","sources":["../../src/models/panel-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"panel-props.d.ts","sourceRoot":"","sources":["../../src/models/panel-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,uFAAuF;AACvF,MAAM,WAAW,YAAY;IAC3B,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,8DAA8D;AAC9D,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,yDAAyD;IACzD,QAAQ,CAAC,EAAE,OAAO,C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I,CAAC;CACjD;AAED,0EAA0E;AAC1E,MAAM,WAAW,gBAAgB;IAC/B,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,2CAA2C;IAC3C,cAAc,EAAE,SAAS,CAAC;IAC1B;;;OAGG;IACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB"}
|
package/models/virtual-row.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { DropdownItem } from '@epam/ai-dial-ui-kit';
|
|
2
|
-
import {
|
|
2
|
+
import { FilterTab } from '../types/conversation-classification';
|
|
3
3
|
import { VirtualRowKind } from '../types/virtual-row';
|
|
4
|
-
import {
|
|
4
|
+
import { ConversationItem } from './panel-props';
|
|
5
5
|
export { VirtualRowKind };
|
|
6
6
|
/** A collapsible group header row in the virtual list. */
|
|
7
7
|
export interface GroupHeaderRow {
|
|
8
8
|
/** Row discriminant. */
|
|
9
9
|
kind: VirtualRowKind.Header;
|
|
10
10
|
/** Identifies which group this header belongs to. */
|
|
11
|
-
groupKey:
|
|
11
|
+
groupKey: FilterTab;
|
|
12
12
|
/** Visible section heading text. */
|
|
13
13
|
label: string;
|
|
14
14
|
}
|
|
@@ -17,12 +17,21 @@ export interface ConversationItemRow {
|
|
|
17
17
|
/** Row discriminant. */
|
|
18
18
|
kind: VirtualRowKind.Item;
|
|
19
19
|
/** The conversation to render. */
|
|
20
|
-
item:
|
|
20
|
+
item: ConversationItem;
|
|
21
21
|
/** The group this item belongs to — used for drag-and-drop validation. */
|
|
22
|
-
groupKey:
|
|
22
|
+
groupKey: FilterTab;
|
|
23
23
|
}
|
|
24
24
|
/** Union of all possible virtual row shapes. */
|
|
25
25
|
export type VirtualRow = GroupHeaderRow | ConversationItemRow;
|
|
26
|
+
/** Typography/class overrides applied to virtual row elements. */
|
|
27
|
+
export interface RowStyles {
|
|
28
|
+
/** Typography class applied to group header buttons. */
|
|
29
|
+
groupHeaderClassName?: string;
|
|
30
|
+
/** Typography class applied to conversation title text. */
|
|
31
|
+
itemTitleClassName?: string;
|
|
32
|
+
/** CSS class applied to the icon badge in each conversation row. */
|
|
33
|
+
itemIconBadgeClassName?: string;
|
|
34
|
+
}
|
|
26
35
|
/** Data passed to every virtual row renderer via `react-window`'s `rowProps`. */
|
|
27
36
|
export interface RowRendererData {
|
|
28
37
|
/** The full flat row array, indexed by the virtual list. */
|
|
@@ -31,6 +40,8 @@ export interface RowRendererData {
|
|
|
31
40
|
expandedGroups: Set<string>;
|
|
32
41
|
/** Toggles the expanded state of the given group. */
|
|
33
42
|
onToggleGroup: (key: string) => void;
|
|
43
|
+
/** `id` of the virtualized list container, referenced by each group header's `aria-controls`. */
|
|
44
|
+
listId: string;
|
|
34
45
|
/** `id` of the currently active conversation. */
|
|
35
46
|
activeConversationId?: string;
|
|
36
47
|
/** Current search query — used to highlight matches in conversation titles. */
|
|
@@ -38,21 +49,17 @@ export interface RowRendererData {
|
|
|
38
49
|
/** Called when the user selects a conversation row. */
|
|
39
50
|
onSelectConversation: (id: string) => void;
|
|
40
51
|
/** Builds dropdown actions for a conversation item. */
|
|
41
|
-
getActions?: (item:
|
|
52
|
+
getActions?: (item: ConversationItem) => DropdownItem[];
|
|
42
53
|
/** Accessible label for the actions trigger button. */
|
|
43
54
|
actionsLabel?: string;
|
|
44
|
-
/** Typography
|
|
45
|
-
|
|
46
|
-
/** Typography class applied to conversation title text. */
|
|
47
|
-
itemTitleClassName?: string;
|
|
48
|
-
/** CSS class applied to the icon badge in each conversation row. */
|
|
49
|
-
itemIconBadgeClassName?: string;
|
|
55
|
+
/** Typography/class overrides applied to virtual row elements. */
|
|
56
|
+
styles?: RowStyles;
|
|
50
57
|
/** Id of the conversation currently being dragged. `null` when no drag is in progress. */
|
|
51
58
|
draggingId: string | null;
|
|
52
59
|
/** Id of the row (item or group header sentinel) currently under the drag cursor. */
|
|
53
60
|
dragOverId: string | null;
|
|
54
61
|
/** Groups that are valid drop targets for the current drag. `null` when no drag is in progress. */
|
|
55
|
-
allowedDropGroups: Set<
|
|
62
|
+
allowedDropGroups: Set<FilterTab> | null;
|
|
56
63
|
/** Called when the user starts dragging a conversation row. */
|
|
57
64
|
onDragStart: (id: string) => void;
|
|
58
65
|
/** Called when the drag ends (drop or cancel). */
|
|
@@ -63,10 +70,10 @@ export interface RowRendererData {
|
|
|
63
70
|
onDragLeave: () => void;
|
|
64
71
|
/**
|
|
65
72
|
* Called when the user drops onto a target row or group header.
|
|
66
|
-
* `targetId` is the item id or `
|
|
73
|
+
* `targetId` is the item id or `FilterTab` sentinel for header drops.
|
|
67
74
|
* `targetGroupKey` is the group the item was dropped into.
|
|
68
75
|
* `afterId` is the id of the item to insert after, or `null` for top of group.
|
|
69
76
|
*/
|
|
70
|
-
onDrop: (targetId: string, targetGroupKey:
|
|
77
|
+
onDrop: (targetId: string, targetGroupKey: FilterTab, afterId: string | null) => void;
|
|
71
78
|
}
|
|
72
79
|
//# sourceMappingURL=virtual-row.d.ts.map
|
|
@@ -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,
|
|
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,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,0DAA0D;AAC1D,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;IAC5B,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,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,qFAAqF;IACrF,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,mGAAmG;IACnG,iBAAiB,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IACzC,+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,SAAS,EACzB,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.
|
|
4
|
+
"version": "1.0.0-dev.481",
|
|
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.0.0-dev.
|
|
21
|
+
"@epam/ai-dial-kit": "1.0.0-dev.481"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^19.0.0",
|
|
25
25
|
"@tabler/icons-react": "^3.0.0",
|
|
26
|
-
"@epam/ai-dial-chat-shared": "1.0.0-dev.
|
|
26
|
+
"@epam/ai-dial-chat-shared": "1.0.0-dev.481",
|
|
27
27
|
"@epam/ai-dial-ui-kit": "0.12.0-dev.28",
|
|
28
|
-
"@epam/ai-dial-sidebar": "1.0.0-dev.
|
|
28
|
+
"@epam/ai-dial-sidebar": "1.0.0-dev.481"
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Active filter tab value; also used as the source/ownership of a conversation
|
|
3
|
+
* and to identify one of the collapsible groups in the conversation panel.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum FilterTab {
|
|
6
|
+
All = "all",
|
|
7
|
+
Pinned = "pinned",
|
|
8
|
+
MyChats = "my-chats",
|
|
9
|
+
Shared = "shared",
|
|
10
|
+
Organization = "organization"
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=conversation-classification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-classification.d.ts","sourceRoot":"","sources":["../../src/types/conversation-classification.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,SAAS;IACnB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,OAAO,aAAa;IACpB,MAAM,WAAW;IACjB,YAAY,iBAAiB;CAC9B"}
|
package/utils/drag.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { DragEvent } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ConversationItem } from '../models/panel-props';
|
|
3
3
|
import { VirtualRow } from '../models/virtual-row';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export declare const findGroupKeyForItem: (rows: VirtualRow[], id: string) => ConversationGroupKey | null;
|
|
4
|
+
import { FilterTab } from '../types/conversation-classification';
|
|
5
|
+
/** Resolves a conversation's `source` to its group, defaulting to `MyChats` when unset. */
|
|
6
|
+
export declare const sourceToGroupKey: (source?: FilterTab) => FilterTab;
|
|
7
|
+
/** Returns the `FilterTab` of the virtual row containing the given item id. */
|
|
8
|
+
export declare const findGroupKeyForItem: (rows: VirtualRow[], id: string) => FilterTab | null;
|
|
10
9
|
/**
|
|
11
10
|
* Returns the set of groups that are valid drop targets for the given dragged item.
|
|
12
11
|
*
|
|
@@ -15,12 +14,12 @@ export declare const findGroupKeyForItem: (rows: VirtualRow[], id: string) => Co
|
|
|
15
14
|
* - Any non-Pinned group → Pinned is allowed (pin action).
|
|
16
15
|
* - Pinned → non-Pinned is allowed only when the item's `source` matches the target group (unpin action).
|
|
17
16
|
*/
|
|
18
|
-
export declare const computeAllowedDropGroups: (draggedId: string, draggingGroupKey:
|
|
17
|
+
export declare const computeAllowedDropGroups: (draggedId: string, draggingGroupKey: FilterTab | null, conversations: ConversationItem[]) => Set<FilterTab>;
|
|
19
18
|
/**
|
|
20
19
|
* Computes the `afterId` for a drop based on cursor vertical position within a row.
|
|
21
20
|
*
|
|
22
21
|
* - Bottom half of the row → insert after the item (`afterId = itemId`).
|
|
23
22
|
* - Top half → insert before the item (`afterId` = id of the preceding item in the group, or `null` for first).
|
|
24
23
|
*/
|
|
25
|
-
export declare const getDropAfterId: (e: Pick<DragEvent, "currentTarget" | "clientY">, itemId: string, rows: VirtualRow[], targetGroupKey:
|
|
24
|
+
export declare const getDropAfterId: (e: Pick<DragEvent, "currentTarget" | "clientY">, itemId: string, rows: VirtualRow[], targetGroupKey: FilterTab) => string | null;
|
|
26
25
|
//# sourceMappingURL=drag.d.ts.map
|
package/utils/drag.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drag.d.ts","sourceRoot":"","sources":["../../src/utils/drag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"drag.d.ts","sourceRoot":"","sources":["../../src/utils/drag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAGjE,2FAA2F;AAC3F,eAAO,MAAM,gBAAgB,GAAI,SAAS,SAAS,KAAG,SASrD,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,mBAAmB,GAC9B,MAAM,UAAU,EAAE,EAClB,IAAI,MAAM,KACT,SAAS,GAAG,IAUd,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB,GACnC,WAAW,MAAM,EACjB,kBAAkB,SAAS,GAAG,IAAI,EAClC,eAAe,gBAAgB,EAAE,KAChC,GAAG,CAAC,SAAS,CAiBf,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,GAAG,IAAI,CAAC,SAAS,EAAE,eAAe,GAAG,SAAS,CAAC,EAC/C,QAAQ,MAAM,EACd,MAAM,UAAU,EAAE,EAClB,gBAAgB,SAAS,KACxB,MAAM,GAAG,IAkBX,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/** Identifies one of the four collapsible groups in the conversation panel. */
|
|
2
|
-
export declare enum ConversationGroupKey {
|
|
3
|
-
Pinned = "pinned",
|
|
4
|
-
MyChats = "myChats",
|
|
5
|
-
Shared = "shared",
|
|
6
|
-
Organization = "organization"
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=conversation-group-key.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-group-key.d.ts","sourceRoot":"","sources":["../../src/types/conversation-group-key.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,oBAAY,oBAAoB;IAC9B,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,YAAY,iBAAiB;CAC9B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversation-source.d.ts","sourceRoot":"","sources":["../../src/types/conversation-source.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,oBAAY,kBAAkB;IAC5B,OAAO,aAAa;IACpB,MAAM,WAAW;IACjB,YAAY,iBAAiB;CAC9B"}
|
package/types/filter-tab.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filter-tab.d.ts","sourceRoot":"","sources":["../../src/types/filter-tab.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,oBAAY,SAAS;IACnB,GAAG,QAAQ;IACX,OAAO,aAAa;IACpB,MAAM,WAAW;IACjB,YAAY,iBAAiB;CAC9B"}
|