@epam/ai-dial-chat-hooks 1.2.0-dev.241 → 1.2.0-dev.250
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/file-manager.d.ts
CHANGED
|
@@ -1192,9 +1192,9 @@ export declare interface UseFileAttachmentPickerOptions {
|
|
|
1192
1192
|
forbiddenSymbolsRegExp?: RegExp;
|
|
1193
1193
|
/** Host-translated label per tab; also supplies the active tab's root-folder label. */
|
|
1194
1194
|
tabLabels: Record<DialFileManagerTabs, string>;
|
|
1195
|
-
/** Tab ids the host's configuration allows. `undefined` allows every tab.
|
|
1195
|
+
/** Tab ids the host's configuration allows. `undefined` allows every tab. */
|
|
1196
1196
|
allowedTabs?: string[];
|
|
1197
|
-
/** Initial active tab. Defaults to `DialFileManagerTabs.MyFiles
|
|
1197
|
+
/** Initial active tab. Defaults to `DialFileManagerTabs.MyFiles`. */
|
|
1198
1198
|
initialTab?: DialFileManagerTabs;
|
|
1199
1199
|
/** MIME types eligible for selection/upload. Empty or absent allows every type. */
|
|
1200
1200
|
allowedTypes?: string[];
|
|
@@ -1,42 +1,48 @@
|
|
|
1
1
|
import { mimeTypesToDialFileAcceptTypes as e } from "../attachment-types.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
2
|
+
import { DIAL_FILE_MANAGER_SECTION_TABS as t } from "../dial-file-manager.model.js";
|
|
3
|
+
import { DialFileManagerVariant as n } from "../file-manager-variant.js";
|
|
4
|
+
import { useDialFileManagerSections as r } from "../useDialFileManagerSections/useDialFileManagerSections.js";
|
|
5
|
+
import { useDialFileManagerTabConfig as i } from "../useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
|
|
6
|
+
import { isHiddenPath as a } from "@epam/ai-dial-chat-shared";
|
|
7
|
+
import { useCallback as o, useMemo as s, useState as c } from "react";
|
|
8
|
+
import { isMimeTypeAllowed as l } from "@epam/ai-dial-attachment-input";
|
|
9
|
+
import { DialFileNodeType as u, useDialFileManagerTabs as d } from "@epam/ai-dial-react-file-manager";
|
|
9
10
|
//#region src/files/useFileAttachmentPicker/useFileAttachmentPicker.ts
|
|
10
11
|
var f = ({ fileManagerOptions: f, bucket: p, forbiddenSymbolsRegExp: m, tabLabels: h, allowedTabs: g, initialTab: _, allowedTypes: v, maxSelectableFileSize: y, canAttachFolders: b = !1 }) => {
|
|
11
|
-
let { activeTab: x, handleTabChange: S, tabs: C } = d(h, _
|
|
12
|
+
let { activeTab: x, handleTabChange: S, tabs: C } = d(h, _), w = s(() => t.filter((e) => g == null || g.includes(e)).map((e) => ({
|
|
13
|
+
tab: e,
|
|
14
|
+
rootLabel: h[e]
|
|
15
|
+
})), [g, h]), [T, E] = c(() => /* @__PURE__ */ new Set()), D = o((e) => {
|
|
12
16
|
E(new Set(e));
|
|
13
|
-
}, []), O =
|
|
17
|
+
}, []), O = o((e) => {
|
|
14
18
|
E(/* @__PURE__ */ new Set()), S(e);
|
|
15
|
-
}, [S]), { tabs: k } =
|
|
19
|
+
}, [S]), { tabs: k } = i(x, O, C, g), A = r({
|
|
16
20
|
...f,
|
|
17
21
|
bucket: p,
|
|
18
22
|
activeTab: x,
|
|
19
|
-
|
|
20
|
-
variant:
|
|
23
|
+
sections: w,
|
|
24
|
+
variant: n.Attach,
|
|
21
25
|
forbiddenSymbolsRegExp: m
|
|
22
|
-
}), M =
|
|
26
|
+
}), [j, M] = c(A.sectionTab);
|
|
27
|
+
j !== A.sectionTab && (M(A.sectionTab), E(/* @__PURE__ */ new Set()));
|
|
28
|
+
let N = o((e) => v == null || v.length === 0 ? !0 : l(e, v), [v]);
|
|
23
29
|
return {
|
|
24
|
-
controller:
|
|
30
|
+
controller: A,
|
|
25
31
|
activeTab: x,
|
|
26
32
|
tabs: k,
|
|
27
33
|
onTabChange: O,
|
|
28
34
|
selectedPaths: T,
|
|
29
35
|
onSelectedPathsChange: D,
|
|
30
|
-
isRowSelectable:
|
|
36
|
+
isRowSelectable: o((e) => {
|
|
31
37
|
let t = e.data;
|
|
32
|
-
return t == null ||
|
|
38
|
+
return t == null || a(t.path) ? !1 : t.nodeType === u.FOLDER ? b : t.nodeType === u.ITEM ? !(t.contentType != null && !N(t.contentType) || y != null && t.contentLength != null && t.contentLength > y) : !1;
|
|
33
39
|
}, [
|
|
34
40
|
b,
|
|
35
|
-
|
|
41
|
+
N,
|
|
36
42
|
y
|
|
37
43
|
]),
|
|
38
|
-
isFileTypeAllowed:
|
|
39
|
-
allowedFileTypes:
|
|
44
|
+
isFileTypeAllowed: N,
|
|
45
|
+
allowedFileTypes: s(() => e(v), [v])
|
|
40
46
|
};
|
|
41
47
|
};
|
|
42
48
|
//#endregion
|
package/index.d.ts
CHANGED
|
@@ -5804,9 +5804,9 @@ export declare interface UseFileAttachmentPickerOptions {
|
|
|
5804
5804
|
forbiddenSymbolsRegExp?: RegExp;
|
|
5805
5805
|
/** Host-translated label per tab; also supplies the active tab's root-folder label. */
|
|
5806
5806
|
tabLabels: Record<DialFileManagerTabs, string>;
|
|
5807
|
-
/** Tab ids the host's configuration allows. `undefined` allows every tab.
|
|
5807
|
+
/** Tab ids the host's configuration allows. `undefined` allows every tab. */
|
|
5808
5808
|
allowedTabs?: string[];
|
|
5809
|
-
/** Initial active tab. Defaults to `DialFileManagerTabs.MyFiles
|
|
5809
|
+
/** Initial active tab. Defaults to `DialFileManagerTabs.MyFiles`. */
|
|
5810
5810
|
initialTab?: DialFileManagerTabs;
|
|
5811
5811
|
/** MIME types eligible for selection/upload. Empty or absent allows every type. */
|
|
5812
5812
|
allowedTypes?: string[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-chat-hooks",
|
|
3
3
|
"description": "Framework-level React hooks extracted from AI DIAL Chat for building custom chat interfaces",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.250",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./index.js",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
}
|
|
112
112
|
},
|
|
113
113
|
"dependencies": {
|
|
114
|
-
"@epam/ai-dial-chat-api-client": "1.2.0-dev.
|
|
114
|
+
"@epam/ai-dial-chat-api-client": "1.2.0-dev.250",
|
|
115
115
|
"dompurify": "3.4.16",
|
|
116
116
|
"fflate": "^0.8.3",
|
|
117
117
|
"lru-cache": "^10.4.3",
|
|
@@ -120,21 +120,21 @@
|
|
|
120
120
|
},
|
|
121
121
|
"peerDependencies": {
|
|
122
122
|
"react": "^19.2.8",
|
|
123
|
-
"@epam/ai-dial-attachment-canvas": "1.2.0-dev.
|
|
124
|
-
"@epam/ai-dial-attachment-input": "1.2.0-dev.
|
|
125
|
-
"@epam/ai-dial-catalog": "1.2.0-dev.
|
|
126
|
-
"@epam/ai-dial-chat-overlay": "1.2.0-dev.
|
|
127
|
-
"@epam/ai-dial-chat-shared": "1.2.0-dev.
|
|
128
|
-
"@epam/ai-dial-mcp-apps": "1.2.0-dev.
|
|
129
|
-
"@epam/ai-dial-publish-panel": "1.2.0-dev.
|
|
130
|
-
"@epam/ai-dial-quotations": "1.2.0-dev.
|
|
123
|
+
"@epam/ai-dial-attachment-canvas": "1.2.0-dev.250",
|
|
124
|
+
"@epam/ai-dial-attachment-input": "1.2.0-dev.250",
|
|
125
|
+
"@epam/ai-dial-catalog": "1.2.0-dev.250",
|
|
126
|
+
"@epam/ai-dial-chat-overlay": "1.2.0-dev.250",
|
|
127
|
+
"@epam/ai-dial-chat-shared": "1.2.0-dev.250",
|
|
128
|
+
"@epam/ai-dial-mcp-apps": "1.2.0-dev.250",
|
|
129
|
+
"@epam/ai-dial-publish-panel": "1.2.0-dev.250",
|
|
130
|
+
"@epam/ai-dial-quotations": "1.2.0-dev.250",
|
|
131
131
|
"@epam/ai-dial-react-file-manager": "^0.3.0-dev.20",
|
|
132
|
-
"@epam/ai-dial-scheduled-tasks": "1.2.0-dev.
|
|
133
|
-
"@epam/ai-dial-share": "1.2.0-dev.
|
|
134
|
-
"@epam/ai-dial-skill-editor": "1.2.0-dev.
|
|
135
|
-
"@epam/ai-dial-source-panel": "1.2.0-dev.
|
|
136
|
-
"@epam/ai-dial-ui-kit": "^0.15.0-dev.
|
|
137
|
-
"@epam/ai-dial-usage-dashboard": "1.2.0-dev.
|
|
132
|
+
"@epam/ai-dial-scheduled-tasks": "1.2.0-dev.250",
|
|
133
|
+
"@epam/ai-dial-share": "1.2.0-dev.250",
|
|
134
|
+
"@epam/ai-dial-skill-editor": "1.2.0-dev.250",
|
|
135
|
+
"@epam/ai-dial-source-panel": "1.2.0-dev.250",
|
|
136
|
+
"@epam/ai-dial-ui-kit": "^0.15.0-dev.35",
|
|
137
|
+
"@epam/ai-dial-usage-dashboard": "1.2.0-dev.250",
|
|
138
138
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
139
139
|
"@epam/pdf-highlighter-kit": "^0.0.19",
|
|
140
140
|
"@mcp-ui/client": "^7.1.1"
|