@epam/ai-dial-chat-hooks 1.4.0-dev.178 → 1.4.0-dev.182

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.
@@ -33,6 +33,13 @@ export interface UsePublishFoldersParams {
33
33
  * not loaded) so the placeholder stays the fallback.
34
34
  */
35
35
  canPublishTo?: (folderPath: string[]) => boolean;
36
+ /**
37
+ * Host rule for whether a folder is listed at all. A folder it refuses is
38
+ * dropped with its whole subtree — also when it comes from
39
+ * `rememberedFolderKeys` or a folder created in this session — so a hidden
40
+ * folder never comes back through them. Omit it to list every folder.
41
+ */
42
+ isFolderVisible?: (folderPath: string[]) => boolean;
36
43
  }
37
44
  /** Result returned by {@link usePublishFolders}. */
38
45
  export interface UsePublishFoldersResult {
@@ -84,5 +91,5 @@ export interface UsePublishFoldersResult {
84
91
  * Takes `listPublicFiles` as a parameter and hands remembered destinations
85
92
  * back through a callback, so it imports no app context and no storage API.
86
93
  */
87
- export declare const usePublishFolders: ({ listPublicFiles, rememberedFolderKeys, onRememberedFolderKeysChange, canPublishTo, }: UsePublishFoldersParams) => UsePublishFoldersResult;
94
+ export declare const usePublishFolders: ({ listPublicFiles, rememberedFolderKeys, onRememberedFolderKeysChange, canPublishTo, isFolderVisible, }: UsePublishFoldersParams) => UsePublishFoldersResult;
88
95
  //# sourceMappingURL=usePublishFolders.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePublishFolders.d.ts","sourceRoot":"","sources":["../../../src/catalog/usePublishFolders/usePublishFolders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AAgBrC,gHAAgH;AAChH,eAAO,MAAM,2BAA2B,GAAI,YAAY,MAAM,EAAE,KAAG,OAClB,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GACnC,YAAY,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B,uBAAuB,KAAG,uBA8H5B,CAAC"}
1
+ {"version":3,"file":"usePublishFolders.d.ts","sourceRoot":"","sources":["../../../src/catalog/usePublishFolders/usePublishFolders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,oBAAoB,EACrB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,6BAA6B,CAAC;AAgBrC,gHAAgH;AAChH,eAAO,MAAM,2BAA2B,GAAI,YAAY,MAAM,EAAE,KAAG,OAClB,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GACnC,YAAY,OAAO,EACnB,WAAW,MAAM,KAChB,MAAM,EAAE,GAAG,SAUb,CAAC;AA8CF,gDAAgD;AAChD,MAAM,WAAW,uBAAuB;IACtC,sEAAsE;IACtE,eAAe,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC9E;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC;;;;OAIG;IACH,4BAA4B,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9D;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC;IACjD;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC;CACrD;AAED,oDAAoD;AACpD,MAAM,WAAW,uBAAuB;IACtC,qEAAqE;IACrE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IACjC,uDAAuD;IACvD,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,iEAAiE;IACjE,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,gDAAgD;IAChD,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC1B,0EAA0E;IAC1E,qBAAqB,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACpD;;;;;;;;;;OAUG;IACH,qBAAqB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7E;;;;OAIG;IACH,qBAAqB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACtD,6IAA6I;IAC7I,qBAAqB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,GAAI,yGAM/B,uBAAuB,KAAG,uBAsI5B,CAAC"}
@@ -15,62 +15,71 @@ var c = "Production", l = 50, u = (e) => !e.includes(c), d = (e, t) => {
15
15
  children: t.has(o) ? f(t, o, a) : void 0
16
16
  };
17
17
  });
18
- }, p = ({ listPublicFiles: e, rememberedFolderKeys: c, onRememberedFolderKeysChange: l, canPublishTo: p }) => {
19
- let [m, h] = i(() => /* @__PURE__ */ new Map()), [g, _] = i(() => /* @__PURE__ */ new Set()), [v, y] = i(() => /* @__PURE__ */ new Set()), [b, x] = i([]), S = r(() => {
18
+ }, p = (e, t) => e.reduce((e, n) => {
19
+ if (!t(n.path)) return e;
20
+ if (!n.children) return e.push(n), e;
21
+ let r = p(n.children, t);
22
+ return e.push(r.length === n.children.length && r.every((e, t) => e === n.children?.[t]) ? n : {
23
+ ...n,
24
+ children: r
25
+ }), e;
26
+ }, []), m = ({ listPublicFiles: e, rememberedFolderKeys: c, onRememberedFolderKeysChange: l, canPublishTo: m, isFolderVisible: h }) => {
27
+ let [g, _] = i(() => /* @__PURE__ */ new Map()), [v, y] = i(() => /* @__PURE__ */ new Set()), [b, x] = i(() => /* @__PURE__ */ new Set()), [S, C] = i([]), w = r(() => {
20
28
  let e = /* @__PURE__ */ new Set();
21
- return g.forEach((t) => {
29
+ return v.forEach((t) => {
22
30
  let n = t ? `${t}/` : "";
23
- m.has(n) && e.add(t);
31
+ g.has(n) && e.add(t);
24
32
  }), e;
25
- }, [g, m]), C = t(async (t) => {
26
- y((e) => new Set(e).add(t));
33
+ }, [v, g]), T = t(async (t) => {
34
+ x((e) => new Set(e).add(t));
27
35
  try {
28
36
  let { items: n } = await e({ path: t || void 0 });
29
- h((e) => new Map(e).set(t, n));
37
+ _((e) => new Map(e).set(t, n));
30
38
  } finally {
31
- y((e) => {
39
+ x((e) => {
32
40
  let n = new Set(e);
33
41
  return n.delete(t), n;
34
42
  });
35
43
  }
36
44
  }, [e]);
37
45
  n(() => {
38
- C("");
46
+ T("");
39
47
  }, []);
40
- let w = t((e) => {
41
- _(e), e.forEach((e) => {
48
+ let E = t((e) => {
49
+ y(e), e.forEach((e) => {
42
50
  let t = `${e}/`;
43
- !m.has(t) && !v.has(t) && C(t);
51
+ !g.has(t) && !b.has(t) && T(t);
44
52
  });
45
53
  }, [
46
- m,
47
- v,
48
- C
49
- ]), T = t((e, t) => {
54
+ g,
55
+ b,
56
+ T
57
+ ]), D = t((e, t) => {
50
58
  let n = s([...e, t]);
51
- return x((e) => e.includes(n) ? e : [...e, n]), Promise.resolve();
52
- }, []), E = t((e) => {
59
+ return C((e) => e.includes(n) ? e : [...e, n]), Promise.resolve();
60
+ }, []), O = t((e) => {
53
61
  let t = d(c, s(e));
54
62
  t && l?.(t);
55
- }, [c, l]), D = p ?? u;
63
+ }, [c, l]), k = m ?? u;
56
64
  return {
57
65
  folderItems: r(() => {
58
- let e = (Array.isArray(c) ? c.filter((e) => typeof e == "string") : []).map(a).filter((e) => p == null || p(e));
59
- return o(f(m, "", []), [...e, ...b.map(a)]);
66
+ let e = (Array.isArray(c) ? c.filter((e) => typeof e == "string") : []).map(a).filter((e) => m == null || m(e)), t = o(f(g, "", []), [...e, ...S.map(a)]);
67
+ return h ? p(t, h) : t;
60
68
  }, [
61
- m,
69
+ g,
62
70
  c,
63
- b,
64
- p
71
+ S,
72
+ m,
73
+ h
65
74
  ]),
66
- expandedPaths: g,
67
- loadedPaths: S,
68
- loadingPaths: r(() => new Set([...v].map((e) => e.replace(/\/$/, ""))), [v]),
69
- onExpandedPathsChange: w,
70
- onCreatePublishFolder: T,
71
- rememberPublishFolder: E,
72
- hasPublishWriteAccess: D
75
+ expandedPaths: v,
76
+ loadedPaths: w,
77
+ loadingPaths: r(() => new Set([...b].map((e) => e.replace(/\/$/, ""))), [b]),
78
+ onExpandedPathsChange: E,
79
+ onCreatePublishFolder: D,
80
+ rememberPublishFolder: O,
81
+ hasPublishWriteAccess: k
73
82
  };
74
83
  };
75
84
  //#endregion
76
- export { u as hasPublishFolderWriteAccess, d as rememberPublishFolderKey, p as usePublishFolders };
85
+ export { u as hasPublishFolderWriteAccess, d as rememberPublishFolderKey, m as usePublishFolders };
@@ -170,6 +170,8 @@ export interface UseDialFileManagerOptions {
170
170
  isActive?: boolean;
171
171
  /** Changing this value resets cache and navigation exactly like an `activeTab` change. Defaults to `undefined`. */
172
172
  sessionKey?: string;
173
+ /** Host rule for whether a public folder (decoded, public-relative path such as `Acme/Reports`) is listed; applies only to the Organization tab, where a refused folder disappears from the tree, the grid, the Copy/Move destination and search, and a current folder inside it falls back to the root. Omit it to list every folder. */
174
+ isPublicFolderVisible?: (publicPath: string) => boolean;
173
175
  /** Called when a file-manager action should surface a toast notification. */
174
176
  onNotification?: (notification: FileManagerNotification) => void;
175
177
  /** Called when a mutation succeeds, instead of invoking an application notification service directly. */
@@ -1 +1 @@
1
- {"version":3,"file":"dial-file-manager.types.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-manager.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,cAAc,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AE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAC5C,kDAAkD;IAClD,WAAW,EAAE,OAAO,CAAC;IACrB,kGAAkG;IAClG,mBAAmB,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IACjD,uDAAuD;IACvD,gBAAgB,EAAE,OAAO,CAAC;IAE1B,oGAAoG;IACpG,YAAY,EAAE,QAAQ,GAAG,SAAS,CAAC;IACnC,kDAAkD;IAClD,qBAAqB,EAAE,OAAO,CAAC;IAC/B,2FAA2F;IAC3F,SAAS,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACpC,6GAA6G;IAC7G,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B;;;;;;;;;;OAUG;IACH,wBAAwB,EAAE,OAAO,CAAC;CACnC"}
1
+ {"version":3,"file":"dial-file-manager.types.d.ts","sourceRoot":"","sources":["../../src/files/dial-file-manager.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,sBAAsB,EACtB,0BAA0B,EAC1B,sBAAsB,EACtB,oBAAoB,EACpB,uBAAuB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,QAAQ,EACR,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAE1E;;;;GAIG;AACH,oBAAY,6BAA6B;IACvC,kGAAkG;IAClG,gBAAgB,qBAAqB;IACrC,gEAAgE;IAChE,kBAAkB,uBAAuB;IACzC,qDAAqD;IACrD,kBAAkB,uBAAuB;IACzC,mEAAmE;IACnE,kBAAkB,uBAAuB;IACz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I,CAAC;IACpC,6GAA6G;IAC7G,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B;;;;;;;;;;OAUG;IACH,wBAAwB,EAAE,OAAO,CAAC;CACnC"}
@@ -19,6 +19,14 @@ export interface UseDialFileListingOptions {
19
19
  isActive?: boolean;
20
20
  /** Changing this value resets cache and navigation exactly like an `activeTab` change. Defaults to `undefined`. */
21
21
  sessionKey?: string;
22
+ /**
23
+ * Host rule for whether a public folder is listed, given its decoded path
24
+ * relative to the public bucket (`Acme/Reports`). Applies only to the
25
+ * Organization tab: a refused folder is dropped from `items` with its
26
+ * subtree, search results inside it are dropped, and a current folder inside
27
+ * it falls back to the root. Omit it to list every folder.
28
+ */
29
+ isPublicFolderVisible?: (publicPath: string) => boolean;
22
30
  }
23
31
  /** Values returned by `useDialFileListing`. */
24
32
  export interface UseDialFileListingResult {
@@ -78,5 +86,5 @@ export interface UseDialFileListingResult {
78
86
  * - shared: files shared with the user via `DialFilesApi.listSharedFiles`
79
87
  * - organization: public bucket via `DialFilesApi.listPublicFiles`
80
88
  */
81
- export declare const useDialFileListing: ({ filesApi, bucket, rootLabel, activeTab, onNotification, isActive, sessionKey, }: UseDialFileListingOptions) => UseDialFileListingResult;
89
+ export declare const useDialFileListing: ({ filesApi, bucket, rootLabel, activeTab, onNotification, isActive, sessionKey, isPublicFolderVisible, }: UseDialFileListingOptions) => UseDialFileListingResult;
82
90
  //# sourceMappingURL=useDialFileListing.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDialFileListing.d.ts","sourceRoot":"","sources":["../../../src/files/useDialFileListing/useDialFileListing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EACL,mBAAmB,EAEpB,MAAM,kCAAkC,CAAC;AAmB1C,OAAO,KAAK,EAAE,cAAc,EAAE,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AAI,CAAC;IACV,0EAA0E;IAC1E,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB;;;OAGG;IACH,qBAAqB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAClD;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,GAAI,0GAShC,yBAAyB,KAAG,wBAutB9B,CAAC"}
@@ -2,100 +2,122 @@ import { getApiErrorStatus as e } from "../../api-error/api-error.js";
2
2
  import { FileManagerNotificationReason as t } from "../dial-file-manager.types.js";
3
3
  import { buildSharedItemVirtualPath as n, dialCorePathToRelative as r, findFolderByVirtualPath as i, normalizeVirtualPath as a } from "../dial-file-manager-path.util.js";
4
4
  import { virtualPathToApiPath as o } from "../resolve-dial-file-api-path.js";
5
- import { buildFromCache as ee, buildSharedSearchScope as s, fetchByTab as c, fetchForSearch as te, mapCorePermissions as ne, mapSearchItem as re, mergeCreatedFolderIntoCache as ie } from "../dial-file-manager-mapping.util.js";
6
- import { ListFilesItemDtoNodeTypeEnum as l } from "@epam/ai-dial-chat-api-client";
7
- import { getParentFolderPath as ae } from "@epam/ai-dial-chat-shared";
8
- import { useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
9
- import { NotificationVariant as h } from "@epam/ai-dial-ui-kit";
10
- import { DialFileManagerTabs as g, DialFileNodeType as oe } from "@epam/ai-dial-react-file-manager";
5
+ import { buildFromCache as ee, buildSharedSearchScope as s, fetchByTab as c, fetchForSearch as te, mapCorePermissions as ne, mapSearchItem as l, mergeCreatedFolderIntoCache as re } from "../dial-file-manager-mapping.util.js";
6
+ import { ListFilesItemDtoNodeTypeEnum as u } from "@epam/ai-dial-chat-api-client";
7
+ import { getParentFolderPath as ie } from "@epam/ai-dial-chat-shared";
8
+ import { useCallback as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
9
+ import { NotificationVariant as g } from "@epam/ai-dial-ui-kit";
10
+ import { DialFileManagerTabs as _, DialFileNodeType as v } from "@epam/ai-dial-react-file-manager";
11
11
  //#region src/files/useDialFileListing/useDialFileListing.ts
12
- var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x, isActive: S = !0, sessionKey: se }) => {
13
- let [C, w] = m(""), [T, E] = m(() => /* @__PURE__ */ new Map()), D = p(T);
14
- d(() => {
15
- D.current = T;
16
- }, [T]);
17
- let [O, k] = m(() => /* @__PURE__ */ new Map()), [ce, A] = m(S), [le, ue] = m(S);
18
- le !== S && (ue(S), A(S));
19
- let [de, j] = m(null), [M, N] = m(0), [P, F] = m(void 0), [fe, I] = m(() => /* @__PURE__ */ new Set()), L = p(/* @__PURE__ */ new Map()), [pe, R] = m(!1), [me, z] = m(null), B = p(null), V = p(null), H = p(/* @__PURE__ */ new Set()), U = p(/* @__PURE__ */ new Set()), [W, G] = m(() => /* @__PURE__ */ new Set()), [he, K] = m(() => /* @__PURE__ */ new Set()), [q, J] = m(() => /* @__PURE__ */ new Set()), Y = `${b}|${se ?? ""}`, X = p(Y);
20
- d(() => {
21
- X.current !== Y && (X.current = Y, E(/* @__PURE__ */ new Map()), k(/* @__PURE__ */ new Map()), w(""), F(void 0), L.current = /* @__PURE__ */ new Map(), H.current = /* @__PURE__ */ new Set(), U.current = /* @__PURE__ */ new Set(), K(/* @__PURE__ */ new Set()), J(/* @__PURE__ */ new Set()), B.current != null && (clearTimeout(B.current), B.current = null), V.current?.(), V.current = null, z(null), R(!1), G(/* @__PURE__ */ new Set()), N((e) => e + 1));
22
- }, [Y]), d(() => () => {
23
- B.current != null && clearTimeout(B.current), V.current?.();
24
- }, []), d(() => {
25
- if (!S) {
26
- A(!1);
12
+ var ae = (e, t) => {
13
+ let n = e.replace(/^\/+|\/+$/g, "");
14
+ return n === t ? "" : n.startsWith(`${t}/`) ? n.slice(t.length + 1) : n;
15
+ }, y = (e, t) => e.reduce((e, n) => {
16
+ if (n.nodeType !== v.FOLDER) return e.push(n), e;
17
+ if (!t(n.path)) return e;
18
+ if (!n.items) return e.push(n), e;
19
+ let r = y(n.items, t);
20
+ return e.push(r.length === n.items.length && r.every((e, t) => e === n.items?.[t]) ? n : {
21
+ ...n,
22
+ items: r
23
+ }), e;
24
+ }, []), b = ({ filesApi: b, bucket: x, rootLabel: S, activeTab: C, onNotification: w, isActive: T = !0, sessionKey: oe, isPublicFolderVisible: E }) => {
25
+ let [D, O] = h(""), k = p(() => C === _.Organization && E ? (e) => E(ae(e, S)) : void 0, [
26
+ C,
27
+ E,
28
+ S
29
+ ]);
30
+ k && D !== "" && !k(`/${S}/${D}`) && O("");
31
+ let [A, j] = h(() => /* @__PURE__ */ new Map()), M = m(A);
32
+ f(() => {
33
+ M.current = A;
34
+ }, [A]);
35
+ let [N, P] = h(() => /* @__PURE__ */ new Map()), [se, F] = h(T), [ce, le] = h(T);
36
+ ce !== T && (le(T), F(T));
37
+ let [ue, de] = h(null), [fe, I] = h(0), [L, R] = h(void 0), [pe, z] = h(() => /* @__PURE__ */ new Set()), B = m(/* @__PURE__ */ new Map()), [me, V] = h(!1), [H, U] = h(null), W = m(null), G = m(null), K = m(/* @__PURE__ */ new Set()), q = m(/* @__PURE__ */ new Set()), [J, he] = h(() => /* @__PURE__ */ new Set()), [ge, Y] = h(() => /* @__PURE__ */ new Set()), [_e, ve] = h(() => /* @__PURE__ */ new Set()), X = `${C}|${oe ?? ""}`, Z = m(X);
38
+ f(() => {
39
+ Z.current !== X && (Z.current = X, j(/* @__PURE__ */ new Map()), P(/* @__PURE__ */ new Map()), O(""), R(void 0), B.current = /* @__PURE__ */ new Map(), K.current = /* @__PURE__ */ new Set(), q.current = /* @__PURE__ */ new Set(), Y(/* @__PURE__ */ new Set()), ve(/* @__PURE__ */ new Set()), W.current != null && (clearTimeout(W.current), W.current = null), G.current?.(), G.current = null, U(null), V(!1), he(/* @__PURE__ */ new Set()), I((e) => e + 1));
40
+ }, [X]), f(() => () => {
41
+ W.current != null && clearTimeout(W.current), G.current?.();
42
+ }, []), f(() => {
43
+ if (!T) {
44
+ F(!1);
27
45
  return;
28
46
  }
29
47
  let t = !1;
30
- return A(!0), j(null), c(_, b, v, C, L.current).then(({ items: e, permissions: n }) => {
31
- t || (E((t) => {
48
+ return F(!0), de(null), c(b, C, x, D, B.current).then(({ items: e, permissions: n }) => {
49
+ t || (j((t) => {
32
50
  let n = new Map(t);
33
- return n.set(C, e), n;
34
- }), k((e) => new Map(e).set(C, n)), b === g.Shared && C === "" && (F(e.map((e) => e.nodeType === l.Folder ? `/${y}/${e.name}/` : `/${y}/${e.name}`)), L.current = new Map(e.map((e) => [e.name, {
51
+ return n.set(D, e), n;
52
+ }), P((e) => new Map(e).set(D, n)), C === _.Shared && D === "" && (R(e.map((e) => e.nodeType === u.Folder ? `/${S}/${e.name}/` : `/${S}/${e.name}`)), B.current = new Map(e.map((e) => [e.name, {
35
53
  bucket: e.bucket ?? "",
36
54
  dialCorePath: e.path
37
55
  }]))));
38
56
  }).catch((n) => {
39
- t || (C !== "" && e(n) === 404 ? w(ae(C)) : j("dialFileManager.error"));
57
+ t || (D !== "" && e(n) === 404 ? O(ie(D)) : de("dialFileManager.error"));
40
58
  }).finally(() => {
41
- t || A(!1);
59
+ t || F(!1);
42
60
  }), () => {
43
61
  t = !0;
44
62
  };
45
63
  }, [
46
- b,
47
- v,
48
- _,
49
64
  C,
50
- S,
51
- M,
52
- y
53
- ]), d(() => {
54
- if (!S || b !== g.MyFiles) {
55
- I(/* @__PURE__ */ new Set());
65
+ x,
66
+ b,
67
+ D,
68
+ T,
69
+ fe,
70
+ S
71
+ ]), f(() => {
72
+ if (!T || C !== _.MyFiles) {
73
+ z(/* @__PURE__ */ new Set());
56
74
  return;
57
75
  }
58
76
  let e = !1;
59
- return _.listSharedByMe(v).then((t) => {
60
- e || I(new Set(t.items.map((e) => {
61
- let t = r(e.path, v);
62
- return n(t, y, e.nodeType === l.Folder);
77
+ return b.listSharedByMe(x).then((t) => {
78
+ e || z(new Set(t.items.map((e) => {
79
+ let t = r(e.path, x);
80
+ return n(t, S, e.nodeType === u.Folder);
63
81
  })));
64
82
  }).catch(() => {
65
- e || I(/* @__PURE__ */ new Set());
83
+ e || z(/* @__PURE__ */ new Set());
66
84
  }), () => {
67
85
  e = !0;
68
86
  };
69
87
  }, [
88
+ C,
89
+ x,
70
90
  b,
71
- v,
72
- _,
73
- S,
74
- M,
75
- y
76
- ]);
77
- let Z = f(() => [{
78
- id: v,
79
- name: y,
80
- path: `/${y}`,
81
- parentPath: "",
82
- nodeType: oe.FOLDER,
83
- folderId: v,
84
- permissions: ne(O.get("")),
85
- items: ee(T, O, "", `/${y}`, v)
86
- }], [
87
91
  T,
88
- O,
89
- y,
90
- v
91
- ]), ge = u((e) => {
92
+ fe,
93
+ S
94
+ ]);
95
+ let Q = p(() => {
96
+ let e = ee(A, N, "", `/${S}`, x);
97
+ return [{
98
+ id: x,
99
+ name: S,
100
+ path: `/${S}`,
101
+ parentPath: "",
102
+ nodeType: v.FOLDER,
103
+ folderId: x,
104
+ permissions: ne(N.get("")),
105
+ items: k ? y(e, k) : e
106
+ }];
107
+ }, [
108
+ A,
109
+ N,
110
+ S,
111
+ x,
112
+ k
113
+ ]), ye = p(() => H && k ? H.filter((e) => k(e.nodeType === v.FOLDER ? e.path : e.parentPath ?? "")) : H, [H, k]), be = d((e) => {
92
114
  if (e == null) {
93
- w("");
115
+ O("");
94
116
  return;
95
117
  }
96
- let t = `/${y}/`, n = `${y}/`;
97
- if (e === `/${y}` || e === t || e === y || e === n) {
98
- w("");
118
+ let t = `/${S}/`, n = `${S}/`;
119
+ if (e === `/${S}` || e === t || e === S || e === n) {
120
+ O("");
99
121
  return;
100
122
  }
101
123
  let r;
@@ -105,117 +127,117 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
105
127
  let t = e.replace(/^\//, "");
106
128
  r = t.startsWith(n) ? t.slice(n.length) : t;
107
129
  }
108
- w(r && !r.endsWith("/") ? `${r}/` : r);
109
- }, [y]), Q = u(() => {
110
- N((e) => e + 1);
111
- }, []), _e = Q, ve = u((e) => {
130
+ O(r && !r.endsWith("/") ? `${r}/` : r);
131
+ }, [S]), xe = d(() => {
132
+ I((e) => e + 1);
133
+ }, []), Se = xe, Ce = d((e) => {
112
134
  if (e.length === 0) return;
113
- let n = new Set([...W].map((e) => o(e, y))), r = (e) => e === C || C.startsWith(e) || n.has(e), i = e.filter((e) => !r(e)), a = e.filter((e) => r(e) && e !== C);
114
- i.length > 0 && (E((e) => {
135
+ let n = new Set([...J].map((e) => o(e, S))), r = (e) => e === D || D.startsWith(e) || n.has(e), i = e.filter((e) => !r(e)), a = e.filter((e) => r(e) && e !== D);
136
+ i.length > 0 && (j((e) => {
115
137
  let t = new Map(e);
116
138
  return i.forEach((e) => t.delete(e)), t;
117
- }), k((e) => {
139
+ }), P((e) => {
118
140
  let t = new Map(e);
119
141
  return i.forEach((e) => t.delete(e)), t;
120
142
  })), a.forEach((e) => {
121
143
  (async () => {
122
144
  try {
123
- let { items: t, permissions: n } = await c(_, b, v, e, L.current);
124
- E((n) => new Map(n).set(e, t)), n != null && k((t) => new Map(t).set(e, n));
145
+ let { items: t, permissions: n } = await c(b, C, x, e, B.current);
146
+ j((n) => new Map(n).set(e, t)), n != null && P((t) => new Map(t).set(e, n));
125
147
  } catch {
126
- x?.({
127
- variant: h.Error,
148
+ w?.({
149
+ variant: g.Error,
128
150
  reason: t.FolderLoadFailed
129
151
  });
130
152
  }
131
153
  })();
132
154
  });
133
155
  }, [
134
- b,
135
- v,
136
- _,
137
156
  C,
138
- W,
139
- y,
140
- x
141
- ]), ye = u((e, t, n) => {
142
- E((r) => ie(r, e, t, n));
143
- }, []), be = u((e) => {
157
+ x,
158
+ b,
159
+ D,
160
+ J,
161
+ S,
162
+ w
163
+ ]), we = d((e, t, n) => {
164
+ j((r) => re(r, e, t, n));
165
+ }, []), Te = d((e) => {
144
166
  if (e.length === 0) return;
145
167
  let t = new Set(e);
146
- E((e) => {
168
+ j((e) => {
147
169
  let n = e.get("");
148
170
  if (n == null) return e;
149
171
  let r = new Map(e);
150
172
  return r.set("", n.filter((e) => !t.has(e.name))), r;
151
- }), F((t) => t?.filter((t) => !e.some((e) => t === `/${y}/${e}`)));
152
- }, [y]), xe = u((e) => {
153
- if (!S) return;
154
- let n = e == null ? "" : o(e, y), r = e ?? `/${y}`;
155
- J((e) => {
173
+ }), R((t) => t?.filter((t) => !e.some((e) => t === `/${S}/${e}`)));
174
+ }, [S]), Ee = d((e) => {
175
+ if (!T) return;
176
+ let n = e == null ? "" : o(e, S), r = e ?? `/${S}`;
177
+ ve((e) => {
156
178
  if (e.has(r)) return e;
157
179
  let t = new Set(e);
158
180
  return t.add(r), t;
159
- }), !D.current.has(n) && (H.current.has(n) ? K((e) => {
181
+ }), !M.current.has(n) && (K.current.has(n) ? Y((e) => {
160
182
  let t = new Set(e);
161
183
  return t.add(r), t;
162
- }) : (H.current.add(n), K((e) => {
184
+ }) : (K.current.add(n), Y((e) => {
163
185
  let t = new Set(e);
164
186
  return t.add(r), t;
165
187
  }), (async () => {
166
188
  try {
167
- let { items: e, permissions: t } = await c(_, b, v, n, L.current);
168
- E((t) => new Map(t).set(n, e)), t != null && k((e) => new Map(e).set(n, t)), U.current.delete(n);
189
+ let { items: e, permissions: t } = await c(b, C, x, n, B.current);
190
+ j((t) => new Map(t).set(n, e)), t != null && P((e) => new Map(e).set(n, t)), q.current.delete(n);
169
191
  } catch {
170
- x?.({
171
- variant: h.Error,
192
+ w?.({
193
+ variant: g.Error,
172
194
  reason: t.FolderLoadFailed
173
195
  });
174
196
  } finally {
175
- H.current.delete(n), K((e) => {
197
+ K.current.delete(n), Y((e) => {
176
198
  let t = new Set(e);
177
199
  return t.delete(r), t;
178
200
  });
179
201
  }
180
202
  })()));
181
203
  }, [
182
- b,
183
- v,
184
- _,
185
- S,
204
+ C,
186
205
  x,
187
- y
188
- ]), Se = f(() => {
189
- let e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set([...W, ...q]);
206
+ b,
207
+ T,
208
+ w,
209
+ S
210
+ ]), De = p(() => {
211
+ let e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set([...J, ..._e]);
190
212
  for (let n of t) {
191
- let t = o(n, y);
192
- T.has(t) && e.add(n);
213
+ let t = o(n, S);
214
+ A.has(t) && e.add(n);
193
215
  }
194
216
  return e;
195
217
  }, [
196
- W,
197
- q,
198
- T,
199
- y
200
- ]), Ce = u((e) => {
201
- S && (W.forEach((t) => {
202
- e.has(t) || U.current.delete(o(t, y));
203
- }), G(e), [...e].filter((e) => {
204
- let t = o(e, y);
205
- return !D.current.has(t) && !H.current.has(t) && !U.current.has(t);
218
+ J,
219
+ _e,
220
+ A,
221
+ S
222
+ ]), Oe = d((e) => {
223
+ T && (J.forEach((t) => {
224
+ e.has(t) || q.current.delete(o(t, S));
225
+ }), he(e), [...e].filter((e) => {
226
+ let t = o(e, S);
227
+ return !M.current.has(t) && !K.current.has(t) && !q.current.has(t);
206
228
  }).forEach((e) => {
207
- let n = o(e, y);
208
- H.current.add(n), (async () => {
229
+ let n = o(e, S);
230
+ K.current.add(n), (async () => {
209
231
  try {
210
- let { items: e, permissions: t } = await c(_, b, v, n, L.current);
211
- E((t) => new Map(t).set(n, e)), t != null && k((e) => new Map(e).set(n, t));
232
+ let { items: e, permissions: t } = await c(b, C, x, n, B.current);
233
+ j((t) => new Map(t).set(n, e)), t != null && P((e) => new Map(e).set(n, t));
212
234
  } catch {
213
- U.current.add(n), x?.({
214
- variant: h.Error,
235
+ q.current.add(n), w?.({
236
+ variant: g.Error,
215
237
  reason: t.FolderLoadFailed
216
238
  });
217
239
  } finally {
218
- H.current.delete(n), K((t) => {
240
+ K.current.delete(n), Y((t) => {
219
241
  let n = new Set(t);
220
242
  return n.delete(e), n;
221
243
  });
@@ -223,84 +245,84 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
223
245
  })();
224
246
  }));
225
247
  }, [
226
- b,
227
- v,
228
- _,
229
- W,
230
- S,
248
+ C,
231
249
  x,
232
- y
233
- ]), we = u(() => {
234
- B.current != null && (clearTimeout(B.current), B.current = null), V.current?.(), V.current = null, z(null), R(!1);
235
- }, []), Te = u((e, t) => {
236
- S && (B.current != null && (clearTimeout(B.current), B.current = null), V.current?.(), V.current = null, t.trim() ? B.current = setTimeout(() => {
237
- if (B.current = null, b === g.Shared && C === "") {
238
- V.current?.(), V.current = null, R(!0);
239
- let e = T.get("") ?? [], t = s(y, "", /* @__PURE__ */ new Map());
240
- z(e.map((e) => re(e, e.bucket ?? v, y, t))), R(!1);
250
+ b,
251
+ J,
252
+ T,
253
+ w,
254
+ S
255
+ ]), ke = d(() => {
256
+ W.current != null && (clearTimeout(W.current), W.current = null), G.current?.(), G.current = null, U(null), V(!1);
257
+ }, []), Ae = d((e, t) => {
258
+ T && (W.current != null && (clearTimeout(W.current), W.current = null), G.current?.(), G.current = null, t.trim() ? W.current = setTimeout(() => {
259
+ if (W.current = null, C === _.Shared && D === "") {
260
+ G.current?.(), G.current = null, V(!0);
261
+ let e = A.get("") ?? [], t = s(S, "", /* @__PURE__ */ new Map());
262
+ U(e.map((e) => l(e, e.bucket ?? x, S, t))), V(!1);
241
263
  return;
242
264
  }
243
265
  let e = !1;
244
- V.current = () => {
266
+ G.current = () => {
245
267
  e = !0;
246
- }, R(!0), (async () => {
268
+ }, V(!0), (async () => {
247
269
  try {
248
- let { items: t } = await te(_, b, v, C, L.current);
270
+ let { items: t } = await te(b, C, x, D, B.current);
249
271
  if (e) return;
250
- let n = b === g.Shared ? s(y, C, L.current) : void 0;
251
- z(t.map((e) => re(e, e.bucket ?? v, y, n)));
272
+ let n = C === _.Shared ? s(S, D, B.current) : void 0;
273
+ U(t.map((e) => l(e, e.bucket ?? x, S, n)));
252
274
  } catch {
253
- e || z([]);
275
+ e || U([]);
254
276
  } finally {
255
- e || R(!1);
277
+ e || V(!1);
256
278
  }
257
279
  })();
258
- }, 300) : (z(null), R(!1)));
280
+ }, 300) : (U(null), V(!1)));
259
281
  }, [
282
+ C,
283
+ x,
284
+ A,
260
285
  b,
261
- v,
286
+ D,
262
287
  T,
263
- _,
264
- C,
265
- S,
266
- y
267
- ]), $ = C ? `/${y}/${C}` : `/${y}`, Ee = f(() => {
268
- let e = Z[0];
269
- if (e) return a($) === a(`/${y}`) ? e : i(e.items ?? [], $);
288
+ S
289
+ ]), $ = D ? `/${S}/${D}` : `/${S}`, je = p(() => {
290
+ let e = Q[0];
291
+ if (e) return a($) === a(`/${S}`) ? e : i(e.items ?? [], $);
270
292
  }, [
271
- Z,
293
+ Q,
272
294
  $,
273
- y
295
+ S
274
296
  ]);
275
297
  return {
276
- items: Z,
277
- isLoading: ce,
278
- error: de,
298
+ items: Q,
299
+ isLoading: se,
300
+ error: ue,
279
301
  path: $,
280
- folderPath: C,
281
- onPathChange: ge,
282
- retry: Q,
283
- onSearchFiles: Te,
284
- isSearching: pe,
285
- searchResults: me,
286
- clearSearchResults: we,
287
- expandedPaths: W,
288
- loadedPaths: Se,
289
- onExpandedPathsChange: Ce,
290
- onFolderPopupPathChange: xe,
291
- folderPopupLoadingPaths: he,
292
- sharedWithMeIds: f(() => b === g.Shared ? P : void 0, [b, P]),
293
- sharedByMePaths: fe,
294
- currentFolder: Ee,
295
- cache: T,
296
- listingPermissionsCache: O,
297
- sharedRootMetaRef: L,
298
- setFolderPath: w,
299
- invalidateFolders: ve,
300
- mergeCreatedFolder: ye,
301
- bumpRetry: _e,
302
- removeSharedRootItems: be
302
+ folderPath: D,
303
+ onPathChange: be,
304
+ retry: xe,
305
+ onSearchFiles: Ae,
306
+ isSearching: me,
307
+ searchResults: ye,
308
+ clearSearchResults: ke,
309
+ expandedPaths: J,
310
+ loadedPaths: De,
311
+ onExpandedPathsChange: Oe,
312
+ onFolderPopupPathChange: Ee,
313
+ folderPopupLoadingPaths: ge,
314
+ sharedWithMeIds: p(() => C === _.Shared ? L : void 0, [C, L]),
315
+ sharedByMePaths: pe,
316
+ currentFolder: je,
317
+ cache: A,
318
+ listingPermissionsCache: N,
319
+ sharedRootMetaRef: B,
320
+ setFolderPath: O,
321
+ invalidateFolders: Ce,
322
+ mergeCreatedFolder: we,
323
+ bumpRetry: Se,
324
+ removeSharedRootItems: Te
303
325
  };
304
326
  };
305
327
  //#endregion
306
- export { _ as useDialFileListing };
328
+ export { b as useDialFileListing };
@@ -12,5 +12,5 @@ export type { UseDialFileManagerOptions, UseDialFileManagerResult, } from '../di
12
12
  * every translated string reaches it through `labels`,
13
13
  * `disabledNewButtonTooltip`, and `buildValidationErrorMessage`.
14
14
  */
15
- export declare const useDialFileManager: ({ filesApi, bucket, rootLabel, activeTab, isActive, sessionKey, onNotification, onOperationSuccess, forbiddenSymbolsRegExp, variant, actionProfile, labels, locale, disabledNewButtonTooltip, downloadDestination, buildValidationErrorMessage, }: UseDialFileManagerOptions) => UseDialFileManagerResult;
15
+ export declare const useDialFileManager: ({ filesApi, bucket, rootLabel, activeTab, isActive, sessionKey, isPublicFolderVisible, onNotification, onOperationSuccess, forbiddenSymbolsRegExp, variant, actionProfile, labels, locale, disabledNewButtonTooltip, downloadDestination, buildValidationErrorMessage, }: UseDialFileManagerOptions) => UseDialFileManagerResult;
16
16
  //# sourceMappingURL=useDialFileManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useDialFileManager.d.ts","sourceRoot":"","sources":["../../../src/files/useDialFileManager/useDialFileManager.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AAQpC,YAAY,EACV,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,GAAI,mPAiBhC,yBAAyB,KAAG,wBAwN9B,CAAC"}
1
+ {"version":3,"file":"useDialFileManager.d.ts","sourceRoot":"","sources":["../../../src/files/useDialFileManager/useDialFileManager.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AAQpC,YAAY,EACV,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AAEpC;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kBAAkB,GAAI,0QAkBhC,yBAAyB,KAAG,wBAyN9B,CAAC"}
@@ -10,151 +10,152 @@ import { DialFileManagerActionProfile as p, DialFileManagerVariant as m, isUploa
10
10
  import { useCallback as g, useMemo as _ } from "react";
11
11
  import { DialFileManagerActions as v, DialFileManagerTabs as y } from "@epam/ai-dial-react-file-manager";
12
12
  //#region src/files/useDialFileManager/useDialFileManager.ts
13
- var b = ({ filesApi: b, bucket: x, rootLabel: S = "My files", activeTab: C = y.MyFiles, isActive: w, sessionKey: T, onNotification: E, onOperationSuccess: D, forbiddenSymbolsRegExp: O, variant: k = m.Attach, actionProfile: A, labels: j, locale: M, disabledNewButtonTooltip: N, downloadDestination: P, buildValidationErrorMessage: F }) => {
14
- let I = A ?? s(k), L = c({
13
+ var b = ({ filesApi: b, bucket: x, rootLabel: S = "My files", activeTab: C = y.MyFiles, isActive: w, sessionKey: T, isPublicFolderVisible: E, onNotification: D, onOperationSuccess: O, forbiddenSymbolsRegExp: k, variant: A = m.Attach, actionProfile: j, labels: M, locale: N, disabledNewButtonTooltip: P, downloadDestination: F, buildValidationErrorMessage: I }) => {
14
+ let L = j ?? s(A), R = c({
15
15
  filesApi: b,
16
16
  bucket: x,
17
17
  rootLabel: S,
18
18
  activeTab: C,
19
- onNotification: E,
19
+ onNotification: D,
20
20
  isActive: w,
21
- sessionKey: T
22
- }), R = f({
21
+ sessionKey: T,
22
+ isPublicFolderVisible: E
23
+ }), z = f({
23
24
  filesApi: b,
24
25
  bucket: x,
25
26
  rootLabel: S,
26
27
  activeTab: C,
27
- cache: L.cache,
28
- sharedRootMetaRef: L.sharedRootMetaRef,
29
- invalidateFolders: L.invalidateFolders,
30
- bumpRetry: L.bumpRetry,
31
- onNotification: E
32
- }), z = u({
28
+ cache: R.cache,
29
+ sharedRootMetaRef: R.sharedRootMetaRef,
30
+ invalidateFolders: R.invalidateFolders,
31
+ bumpRetry: R.bumpRetry,
32
+ onNotification: D
33
+ }), B = u({
33
34
  filesApi: b,
34
35
  bucket: x,
35
36
  rootLabel: S,
36
37
  activeTab: C,
37
- folderPath: L.folderPath,
38
- currentFolder: L.currentFolder,
39
- sharedRootMetaRef: L.sharedRootMetaRef,
40
- listingPermissionsCache: L.listingPermissionsCache,
41
- invalidateFolders: L.invalidateFolders,
42
- bumpRetry: L.bumpRetry,
43
- mergeCreatedFolder: L.mergeCreatedFolder,
44
- setFolderPath: L.setFolderPath,
45
- onNotification: E,
46
- onOperationSuccess: D,
47
- downloadDestination: P,
48
- forbiddenSymbolsRegExp: O
49
- }), B = d({
38
+ folderPath: R.folderPath,
39
+ currentFolder: R.currentFolder,
40
+ sharedRootMetaRef: R.sharedRootMetaRef,
41
+ listingPermissionsCache: R.listingPermissionsCache,
42
+ invalidateFolders: R.invalidateFolders,
43
+ bumpRetry: R.bumpRetry,
44
+ mergeCreatedFolder: R.mergeCreatedFolder,
45
+ setFolderPath: R.setFolderPath,
46
+ onNotification: D,
47
+ onOperationSuccess: O,
48
+ downloadDestination: F,
49
+ forbiddenSymbolsRegExp: k
50
+ }), V = d({
50
51
  filesApi: b,
51
52
  bucket: x,
52
53
  rootLabel: S,
53
- bumpRetry: L.bumpRetry,
54
- onNotification: E,
55
- onOperationSuccess: D,
56
- removeSharedRootItems: L.removeSharedRootItems
57
- }), V = l({
54
+ bumpRetry: R.bumpRetry,
55
+ onNotification: D,
56
+ onOperationSuccess: O,
57
+ removeSharedRootItems: R.removeSharedRootItems
58
+ }), H = l({
58
59
  filesApi: b,
59
60
  bucket: x,
60
61
  rootLabel: S,
61
- onNotification: E
62
- }), H = i(L.currentFolder), U = _(() => C === y.Organization || C === y.Shared && L.folderPath === "" ? !1 : H, [
62
+ onNotification: D
63
+ }), U = i(R.currentFolder), W = _(() => C === y.Organization || C === y.Shared && R.folderPath === "" ? !1 : U, [
63
64
  C,
64
- L.folderPath,
65
- H
66
- ]), W = _(() => {
65
+ R.folderPath,
66
+ U
67
+ ]), G = _(() => {
67
68
  switch (C) {
68
69
  case y.Shared: return n;
69
70
  case y.Organization: return t;
70
71
  default: return e;
71
72
  }
72
- }, [C]), G = _(() => {
73
+ }, [C]), K = _(() => {
73
74
  let e = {}, t = (t) => {
74
- let n = j[t];
75
+ let n = M[t];
75
76
  n != null && (e[t] = n);
76
77
  };
77
- return t(v.Download), C === y.MyFiles ? (t(v.Delete), U && (t(v.Rename), a(I) && (t(v.Copy), t(v.Move), t(v.Duplicate))), o(I) && t(v.RemoveAccess)) : C === y.Shared && o(I) && t(v.Unshare), I === p.Full && t(v.Info), e;
78
+ return t(v.Download), C === y.MyFiles ? (t(v.Delete), W && (t(v.Rename), a(L) && (t(v.Copy), t(v.Move), t(v.Duplicate))), o(L) && t(v.RemoveAccess)) : C === y.Shared && o(L) && t(v.Unshare), L === p.Full && t(v.Info), e;
78
79
  }, [
79
80
  C,
80
- U,
81
- I,
82
- j
83
- ]), K = _(() => z.isCreatingFolder || z.isDeleting || z.isRenaming || z.isCopying || z.isMoving || B.isUnsharing || B.isRemovingAccess || h(R.uploadBatchState), [
84
- z.isCreatingFolder,
85
- z.isDeleting,
86
- z.isRenaming,
87
- z.isCopying,
88
- z.isMoving,
89
- B.isUnsharing,
90
- B.isRemovingAccess,
91
- R.uploadBatchState
92
- ]), q = g((e, t) => {
93
- let n = z.onCreateFolderValidate(e, t);
94
- return n ? F(n) : null;
95
- }, [z, F]), J = g((e, t) => {
96
- let n = z.onRenameValidate(e, t);
97
- return n ? F(n, t) : null;
98
- }, [z, F]);
81
+ W,
82
+ L,
83
+ M
84
+ ]), q = _(() => B.isCreatingFolder || B.isDeleting || B.isRenaming || B.isCopying || B.isMoving || V.isUnsharing || V.isRemovingAccess || h(z.uploadBatchState), [
85
+ B.isCreatingFolder,
86
+ B.isDeleting,
87
+ B.isRenaming,
88
+ B.isCopying,
89
+ B.isMoving,
90
+ V.isUnsharing,
91
+ V.isRemovingAccess,
92
+ z.uploadBatchState
93
+ ]), J = g((e, t) => {
94
+ let n = B.onCreateFolderValidate(e, t);
95
+ return n ? I(n) : null;
96
+ }, [B, I]), Y = g((e, t) => {
97
+ let n = B.onRenameValidate(e, t);
98
+ return n ? I(n, t) : null;
99
+ }, [B, I]);
99
100
  return {
100
- items: L.items,
101
- isLoading: L.isLoading,
102
- error: L.error,
103
- path: L.path,
104
- onPathChange: L.onPathChange,
105
- retry: L.retry,
106
- onSearchFiles: L.onSearchFiles,
107
- isSearching: L.isSearching,
108
- searchResults: L.searchResults,
109
- clearSearchResults: L.clearSearchResults,
110
- expandedPaths: L.expandedPaths,
111
- loadedPaths: L.loadedPaths,
112
- onExpandedPathsChange: L.onExpandedPathsChange,
113
- onFolderPopupPathChange: L.onFolderPopupPathChange,
114
- folderPopupLoadingPaths: L.folderPopupLoadingPaths,
115
- onUploadFiles: R.onUploadFiles,
116
- onUploadArchive: R.onUploadArchive,
117
- onValidateUpload: R.onValidateUpload,
118
- uploadBatchState: R.uploadBatchState,
119
- cancelUpload: R.cancelUpload,
120
- cancelUploadFile: R.cancelUploadFile,
121
- clearUploadBatch: R.clearUploadBatch,
122
- onCreateFolder: z.onCreateFolder,
123
- onCreateFolderValidate: q,
124
- isCreatingFolder: z.isCreatingFolder,
125
- onDownloadFiles: z.onDownloadFiles,
126
- isDownloading: z.isDownloading,
127
- downloadBatchState: z.downloadBatchState,
128
- cancelDownloadFile: z.cancelDownloadFile,
129
- cancelAllDownloads: z.cancelAllDownloads,
130
- clearDownloadBatch: z.clearDownloadBatch,
131
- onDeleteFiles: z.onDeleteFiles,
132
- isDeleting: z.isDeleting,
133
- onRenameValidate: J,
134
- onMoveToFiles: z.onMoveToFiles,
135
- isRenaming: z.isRenaming,
136
- onCopyFiles: z.onCopyFiles,
137
- isCopying: z.isCopying,
138
- isMoving: z.isMoving,
139
- cancelCopyMove: z.cancelCopyMove,
140
- uploadEnabled: U,
141
- isNewButtonDisabled: !U,
142
- disabledNewButtonTooltip: N,
143
- visibleColumns: W,
144
- dateLocale: M,
101
+ items: R.items,
102
+ isLoading: R.isLoading,
103
+ error: R.error,
104
+ path: R.path,
105
+ onPathChange: R.onPathChange,
106
+ retry: R.retry,
107
+ onSearchFiles: R.onSearchFiles,
108
+ isSearching: R.isSearching,
109
+ searchResults: R.searchResults,
110
+ clearSearchResults: R.clearSearchResults,
111
+ expandedPaths: R.expandedPaths,
112
+ loadedPaths: R.loadedPaths,
113
+ onExpandedPathsChange: R.onExpandedPathsChange,
114
+ onFolderPopupPathChange: R.onFolderPopupPathChange,
115
+ folderPopupLoadingPaths: R.folderPopupLoadingPaths,
116
+ onUploadFiles: z.onUploadFiles,
117
+ onUploadArchive: z.onUploadArchive,
118
+ onValidateUpload: z.onValidateUpload,
119
+ uploadBatchState: z.uploadBatchState,
120
+ cancelUpload: z.cancelUpload,
121
+ cancelUploadFile: z.cancelUploadFile,
122
+ clearUploadBatch: z.clearUploadBatch,
123
+ onCreateFolder: B.onCreateFolder,
124
+ onCreateFolderValidate: J,
125
+ isCreatingFolder: B.isCreatingFolder,
126
+ onDownloadFiles: B.onDownloadFiles,
127
+ isDownloading: B.isDownloading,
128
+ downloadBatchState: B.downloadBatchState,
129
+ cancelDownloadFile: B.cancelDownloadFile,
130
+ cancelAllDownloads: B.cancelAllDownloads,
131
+ clearDownloadBatch: B.clearDownloadBatch,
132
+ onDeleteFiles: B.onDeleteFiles,
133
+ isDeleting: B.isDeleting,
134
+ onRenameValidate: Y,
135
+ onMoveToFiles: B.onMoveToFiles,
136
+ isRenaming: B.isRenaming,
137
+ onCopyFiles: B.onCopyFiles,
138
+ isCopying: B.isCopying,
139
+ isMoving: B.isMoving,
140
+ cancelCopyMove: B.cancelCopyMove,
141
+ uploadEnabled: W,
142
+ isNewButtonDisabled: !W,
143
+ disabledNewButtonTooltip: P,
144
+ visibleColumns: G,
145
+ dateLocale: N,
145
146
  dateOptions: r,
146
- actionLabels: G,
147
- sharedWithMeIds: L.sharedWithMeIds,
148
- sharedByMePaths: L.sharedByMePaths,
149
- onUnshareFiles: B.onUnshareFiles,
150
- isUnsharing: B.isUnsharing,
151
- onRemoveFilesAccess: B.onRemoveFilesAccess,
152
- isRemovingAccess: B.isRemovingAccess,
153
- fileMetadata: V.fileMetadata,
154
- isFileMetadataLoading: V.isFileMetadataLoading,
155
- onGetInfo: V.onGetInfo,
156
- clearMetadata: V.clearMetadata,
157
- isAnyOperationInProgress: K
147
+ actionLabels: K,
148
+ sharedWithMeIds: R.sharedWithMeIds,
149
+ sharedByMePaths: R.sharedByMePaths,
150
+ onUnshareFiles: V.onUnshareFiles,
151
+ isUnsharing: V.isUnsharing,
152
+ onRemoveFilesAccess: V.onRemoveFilesAccess,
153
+ isRemovingAccess: V.isRemovingAccess,
154
+ fileMetadata: H.fileMetadata,
155
+ isFileMetadataLoading: H.isFileMetadataLoading,
156
+ onGetInfo: H.onGetInfo,
157
+ clearMetadata: H.clearMetadata,
158
+ isAnyOperationInProgress: q
158
159
  };
159
160
  };
160
161
  //#endregion
@@ -26,6 +26,10 @@ export interface UseOrgUnitsResult {
26
26
  hasAdminAccess: boolean;
27
27
  /** Whether a publish panel may write straight into the path instead of filing a request: it lies inside an org unit, the user may write the namespace there and may approve publications (`read` and `write` on `publications`, or DIAL admin). `false` until the status is `Ready`. */
28
28
  canPublishDirectlyAt: OrgUnitRightCheck;
29
+ /** Whether a public folder stays listed: it is a unit, lies inside one or is an ancestor of one. `true` until the status is `Ready`, so missing data never hides a folder. */
30
+ isPublicFolderVisible: (publicPath: string) => boolean;
31
+ /** Whether a new public folder created inside the path would stay listed by `isPublicFolderVisible`: the path lies inside an org unit. `false` for the public root and an ancestor-only folder once the status is `Ready`; `true` until then. */
32
+ canCreatePublicFolderIn: (publicPath: string) => boolean;
29
33
  }
30
34
  /**
31
35
  * Loads the current user's org units once, on demand, and answers save, direct-save,
@@ -1 +1 @@
1
- {"version":3,"file":"useOrgUnits.d.ts","sourceRoot":"","sources":["../../../src/org-units/useOrgUnits/useOrgUnits.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,YAAY,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACjD;AAED,mGAAmG;AACnG,MAAM,MAAM,iBAAiB,GAAG,CAC9B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,gBAAgB,KACxB,OAAO,CAAC;AAEb,6CAA6C;AAC7C,MAAM,WAAW,iBAAiB;IAChC,+BAA+B;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,gGAAgG;IAChG,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,mHAAmH;IACnH,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,6IAA6I;IAC7I,SAAS,EAAE,iBAAiB,CAAC;IAC7B,4LAA4L;IAC5L,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,mGAAmG;IACnG,YAAY,EAAE,iBAAiB,CAAC;IAChC,wIAAwI;IACxI,cAAc,EAAE,OAAO,CAAC;IACxB,wRAAwR;IACxR,oBAAoB,EAAE,iBAAiB,CAAC;CACzC;AAID;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,mBAEzB,kBAAkB,KAAG,iBA8GvB,CAAC"}
1
+ {"version":3,"file":"useOrgUnits.d.ts","sourceRoot":"","sources":["../../../src/org-units/useOrgUnits/useOrgUnits.ts"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,gBAAgB,EACtB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IACjC,6EAA6E;IAC7E,YAAY,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACjD;AAED,mGAAmG;AACnG,MAAM,MAAM,iBAAiB,GAAG,CAC9B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,gBAAgB,KACxB,OAAO,CAAC;AAEb,6CAA6C;AAC7C,MAAM,WAAW,iBAAiB;IAChC,+BAA+B;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,gGAAgG;IAChG,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,mHAAmH;IACnH,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,6IAA6I;IAC7I,SAAS,EAAE,iBAAiB,CAAC;IAC7B,4LAA4L;IAC5L,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,mGAAmG;IACnG,YAAY,EAAE,iBAAiB,CAAC;IAChC,wIAAwI;IACxI,cAAc,EAAE,OAAO,CAAC;IACxB,wRAAwR;IACxR,oBAAoB,EAAE,iBAAiB,CAAC;IACxC,8KAA8K;IAC9K,qBAAqB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IACvD,iPAAiP;IACjP,uBAAuB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;CAC1D;AAID;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,GAAI,mBAEzB,kBAAkB,KAAG,iBA8HvB,CAAC"}
@@ -1,59 +1,63 @@
1
1
  import { OrgUnitsStatus as e } from "../types.js";
2
- import { canApprovePublicationsAt as t, canRequestPublicationAt as n, canSaveToFolderAt as r, canWriteIntoOrgUnitAt as i } from "@epam/ai-dial-chat-shared";
3
- import { useCallback as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
2
+ import { canApprovePublicationsAt as t, canRequestPublicationAt as n, canSaveToFolderAt as r, canWriteIntoOrgUnitAt as i, findOwningOrgUnit as a, isOrgUnitTreeFolder as o } from "@epam/ai-dial-chat-shared";
3
+ import { useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
4
4
  //#region src/org-units/useOrgUnits/useOrgUnits.ts
5
- var u = {
5
+ var f = {
6
6
  hasAdminAccess: !1,
7
7
  units: []
8
- }, d = ({ listOrgUnits: d }) => {
9
- let [f, p] = l(u), [m, h] = l(e.Idle), g = c(!1), _ = c(m);
10
- _.current = m;
11
- let v = c(!0), y = c(d);
12
- y.current = d, o(() => (v.current = !0, () => {
13
- v.current = !1;
8
+ }, p = ({ listOrgUnits: p }) => {
9
+ let [m, h] = d(f), [g, _] = d(e.Idle), v = u(!1), y = u(g);
10
+ y.current = g;
11
+ let b = u(!0), x = u(p);
12
+ x.current = p, c(() => (b.current = !0, () => {
13
+ b.current = !1;
14
14
  }), []);
15
- let b = a(async (t) => {
16
- t || h(e.Loading);
15
+ let S = s(async (t) => {
16
+ t || _(e.Loading);
17
17
  try {
18
- let t = await y.current();
19
- if (!v.current) return;
18
+ let t = await x.current();
19
+ if (!b.current) return;
20
20
  if (!t.enabled) {
21
- p(u), h(e.Disabled);
21
+ h(f), _(e.Disabled);
22
22
  return;
23
23
  }
24
- p({
24
+ h({
25
25
  hasAdminAccess: t.hasAdminAccess,
26
26
  units: t.units
27
- }), h(e.Ready);
27
+ }), _(e.Ready);
28
28
  } catch {
29
- if (t || (g.current = !1, !v.current)) return;
30
- p(u), h(e.Error);
29
+ if (t || (v.current = !1, !b.current)) return;
30
+ h(f), _(e.Error);
31
31
  }
32
- }, []), x = a(() => {
33
- g.current || (g.current = !0, b(!1));
34
- }, [b]), S = a(() => {
35
- _.current !== e.Disabled && (_.current === e.Ready ? b(!0) : x());
36
- }, [x, b]), C = m === e.Ready, w = a((e, t) => !C || r(f, e, t), [C, f]), T = a((e, t) => C && i(f, e, t), [C, f]), E = a((e, t) => !C || n(f, e, t), [C, f]), D = a((e, n) => C && i(f, e, n) && t(f, e), [C, f]);
37
- return s(() => ({
38
- status: m,
39
- ensureUnits: x,
40
- refreshUnits: S,
41
- canSaveAt: w,
42
- canSaveDirectlyAt: T,
43
- canPublishAt: E,
44
- canPublishDirectlyAt: D,
45
- hasAdminAccess: C && f.hasAdminAccess
32
+ }, []), C = s(() => {
33
+ v.current || (v.current = !0, S(!1));
34
+ }, [S]), w = s(() => {
35
+ y.current !== e.Disabled && (y.current === e.Ready ? S(!0) : C());
36
+ }, [C, S]), T = g === e.Ready, E = s((e, t) => !T || r(m, e, t), [T, m]), D = s((e, t) => T && i(m, e, t), [T, m]), O = s((e, t) => !T || n(m, e, t), [T, m]), k = s((e, n) => T && i(m, e, n) && t(m, e), [T, m]), A = s((e) => !T || o(m.units, e), [T, m]), j = s((e) => !T || a(m.units, e) != null, [T, m]);
37
+ return l(() => ({
38
+ status: g,
39
+ ensureUnits: C,
40
+ refreshUnits: w,
41
+ canSaveAt: E,
42
+ canSaveDirectlyAt: D,
43
+ canPublishAt: O,
44
+ canPublishDirectlyAt: k,
45
+ hasAdminAccess: T && m.hasAdminAccess,
46
+ isPublicFolderVisible: A,
47
+ canCreatePublicFolderIn: j
46
48
  }), [
47
- m,
48
- x,
49
- S,
49
+ g,
50
+ C,
50
51
  w,
51
- T,
52
52
  E,
53
53
  D,
54
- C,
55
- f.hasAdminAccess
54
+ O,
55
+ k,
56
+ T,
57
+ m.hasAdminAccess,
58
+ A,
59
+ j
56
60
  ]);
57
61
  };
58
62
  //#endregion
59
- export { d as useOrgUnits };
63
+ export { p as useOrgUnits };
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.4.0-dev.178",
4
+ "version": "1.4.0-dev.182",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -131,7 +131,7 @@
131
131
  }
132
132
  },
133
133
  "dependencies": {
134
- "@epam/ai-dial-chat-api-client": "1.4.0-dev.178",
134
+ "@epam/ai-dial-chat-api-client": "1.4.0-dev.182",
135
135
  "dompurify": "3.4.17",
136
136
  "fflate": "^0.8.3",
137
137
  "lru-cache": "^10.4.3",
@@ -140,23 +140,23 @@
140
140
  },
141
141
  "peerDependencies": {
142
142
  "react": "^19.2.8",
143
- "@epam/ai-dial-attachment-canvas": "1.4.0-dev.178",
144
- "@epam/ai-dial-attachment-input": "1.4.0-dev.178",
145
- "@epam/ai-dial-catalog": "1.4.0-dev.178",
146
- "@epam/ai-dial-chat-overlay": "1.4.0-dev.178",
147
- "@epam/ai-dial-chat-shared": "1.4.0-dev.178",
148
- "@epam/ai-dial-conversation-input": "1.4.0-dev.178",
149
- "@epam/ai-dial-mcp-apps": "1.4.0-dev.178",
150
- "@epam/ai-dial-projects": "1.4.0-dev.178",
151
- "@epam/ai-dial-publish-panel": "1.4.0-dev.178",
152
- "@epam/ai-dial-quotations": "1.4.0-dev.178",
143
+ "@epam/ai-dial-attachment-canvas": "1.4.0-dev.182",
144
+ "@epam/ai-dial-attachment-input": "1.4.0-dev.182",
145
+ "@epam/ai-dial-catalog": "1.4.0-dev.182",
146
+ "@epam/ai-dial-chat-overlay": "1.4.0-dev.182",
147
+ "@epam/ai-dial-chat-shared": "1.4.0-dev.182",
148
+ "@epam/ai-dial-conversation-input": "1.4.0-dev.182",
149
+ "@epam/ai-dial-mcp-apps": "1.4.0-dev.182",
150
+ "@epam/ai-dial-projects": "1.4.0-dev.182",
151
+ "@epam/ai-dial-publish-panel": "1.4.0-dev.182",
152
+ "@epam/ai-dial-quotations": "1.4.0-dev.182",
153
153
  "@epam/ai-dial-react-file-manager": "^0.5.0",
154
- "@epam/ai-dial-scheduled-tasks": "1.4.0-dev.178",
155
- "@epam/ai-dial-share": "1.4.0-dev.178",
156
- "@epam/ai-dial-skill-editor": "1.4.0-dev.178",
157
- "@epam/ai-dial-source-panel": "1.4.0-dev.178",
154
+ "@epam/ai-dial-scheduled-tasks": "1.4.0-dev.182",
155
+ "@epam/ai-dial-share": "1.4.0-dev.182",
156
+ "@epam/ai-dial-skill-editor": "1.4.0-dev.182",
157
+ "@epam/ai-dial-source-panel": "1.4.0-dev.182",
158
158
  "@epam/ai-dial-ui-kit": "^0.17.0",
159
- "@epam/ai-dial-usage-dashboard": "1.4.0-dev.178",
159
+ "@epam/ai-dial-usage-dashboard": "1.4.0-dev.182",
160
160
  "@modelcontextprotocol/sdk": "^1.32.2",
161
161
  "@epam/pdf-highlighter-kit": "^0.0.23"
162
162
  },