@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. `all` is never offered. */
1195
+ /** Tab ids the host's configuration allows. `undefined` allows every tab. */
1196
1196
  allowedTabs?: string[];
1197
- /** Initial active tab. Defaults to `DialFileManagerTabs.MyFiles`; `All` is treated as the default. */
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 { DialFileManagerVariant as t } from "../file-manager-variant.js";
3
- import { useDialFileManager as n } from "../useDialFileManager/useDialFileManager.js";
4
- import { useDialFileManagerTabConfig as r } from "../useDialFileManagerTabConfig/useDialFileManagerTabConfig.js";
5
- import { isHiddenPath as i } from "@epam/ai-dial-chat-shared";
6
- import { useCallback as a, useMemo as o, useState as s } from "react";
7
- import { isMimeTypeAllowed as c } from "@epam/ai-dial-attachment-input";
8
- import { DialFileManagerTabs as l, DialFileNodeType as u, useDialFileManagerTabs as d } from "@epam/ai-dial-react-file-manager";
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, _ === l.All ? void 0 : _), w = o(() => (g ?? Object.values(l)).filter((e) => e !== l.All), [g]), [T, E] = s(() => /* @__PURE__ */ new Set()), D = a((e) => {
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 = a((e) => {
17
+ }, []), O = o((e) => {
14
18
  E(/* @__PURE__ */ new Set()), S(e);
15
- }, [S]), { tabs: k } = r(x, O, C, w), A = h[x] || h[l.MyFiles], j = n({
19
+ }, [S]), { tabs: k } = i(x, O, C, g), A = r({
16
20
  ...f,
17
21
  bucket: p,
18
22
  activeTab: x,
19
- rootLabel: A,
20
- variant: t.Attach,
23
+ sections: w,
24
+ variant: n.Attach,
21
25
  forbiddenSymbolsRegExp: m
22
- }), M = a((e) => v == null || v.length === 0 ? !0 : c(e, v), [v]);
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: j,
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: a((e) => {
36
+ isRowSelectable: o((e) => {
31
37
  let t = e.data;
32
- return t == null || i(t.path) ? !1 : t.nodeType === u.FOLDER ? b : t.nodeType === u.ITEM ? !(t.contentType != null && !M(t.contentType) || y != null && t.contentLength != null && t.contentLength > y) : !1;
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
- M,
41
+ N,
36
42
  y
37
43
  ]),
38
- isFileTypeAllowed: M,
39
- allowedFileTypes: o(() => e(v), [v])
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. `all` is never offered. */
5807
+ /** Tab ids the host's configuration allows. `undefined` allows every tab. */
5808
5808
  allowedTabs?: string[];
5809
- /** Initial active tab. Defaults to `DialFileManagerTabs.MyFiles`; `All` is treated as the default. */
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.241",
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.241",
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.241",
124
- "@epam/ai-dial-attachment-input": "1.2.0-dev.241",
125
- "@epam/ai-dial-catalog": "1.2.0-dev.241",
126
- "@epam/ai-dial-chat-overlay": "1.2.0-dev.241",
127
- "@epam/ai-dial-chat-shared": "1.2.0-dev.241",
128
- "@epam/ai-dial-mcp-apps": "1.2.0-dev.241",
129
- "@epam/ai-dial-publish-panel": "1.2.0-dev.241",
130
- "@epam/ai-dial-quotations": "1.2.0-dev.241",
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.241",
133
- "@epam/ai-dial-share": "1.2.0-dev.241",
134
- "@epam/ai-dial-skill-editor": "1.2.0-dev.241",
135
- "@epam/ai-dial-source-panel": "1.2.0-dev.241",
136
- "@epam/ai-dial-ui-kit": "^0.15.0-dev.30",
137
- "@epam/ai-dial-usage-dashboard": "1.2.0-dev.241",
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"