@epam/ai-dial-chat-hooks 1.4.0-dev.95 → 1.4.0-rc.0
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/api-error/map-api-error.d.ts +10 -0
- package/api-error/map-api-error.d.ts.map +1 -0
- package/api-error/map-api-error.js +11 -0
- package/catalog/create-publish-api.d.ts +14 -10
- package/catalog/create-publish-api.d.ts.map +1 -1
- package/catalog/create-publish-api.js +8 -9
- package/catalog/map-deployment-to-catalog-item.d.ts.map +1 -1
- package/catalog/map-deployment-to-catalog-item.js +1 -0
- package/catalog/publish-target-taken.d.ts +31 -0
- package/catalog/publish-target-taken.d.ts.map +1 -0
- package/catalog/publish-target-taken.js +14 -0
- package/catalog/resource-name-conflict.d.ts.map +1 -1
- package/catalog/resource-name-conflict.js +19 -22
- package/catalog/resource-save.d.ts +2 -4
- package/catalog/resource-save.d.ts.map +1 -1
- package/catalog/resource-save.js +38 -32
- package/catalog/use-publish-target-guard.d.ts +45 -0
- package/catalog/use-publish-target-guard.d.ts.map +1 -0
- package/catalog/use-publish-target-guard.js +18 -0
- package/catalog/usePublishFolders/usePublishFolders.d.ts +11 -3
- package/catalog/usePublishFolders/usePublishFolders.d.ts.map +1 -1
- package/catalog/usePublishFolders/usePublishFolders.js +41 -31
- package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts +27 -11
- package/catalog/useResourceSavePanel/useResourceSavePanel.d.ts.map +1 -1
- package/catalog/useResourceSavePanel/useResourceSavePanel.js +163 -138
- package/catalog.js +51 -49
- package/conversation/conversation-list.d.ts +7 -1
- package/conversation/conversation-list.d.ts.map +1 -1
- package/conversation/conversation-list.js +11 -2
- package/conversation/conversation-transfer/zip-export.d.ts +1 -1
- package/conversation/conversation-transfer/zip-export.d.ts.map +1 -1
- package/conversation/conversation-transfer/zip-export.js +7 -8
- package/conversation/conversation-transfer/zip-import.d.ts.map +1 -1
- package/conversation/conversation-transfer/zip-import.js +8 -9
- package/conversation/useConversationExport/useConversationExport.d.ts.map +1 -1
- package/conversation/useConversationExport/useConversationExport.js +3 -1
- package/conversation.js +3 -3
- package/entry-points/catalog.d.ts +2 -0
- package/entry-points/catalog.d.ts.map +1 -1
- package/entry-points/scheduled-tasks.d.ts +1 -0
- package/entry-points/scheduled-tasks.d.ts.map +1 -1
- package/entry-points/skill-editor.d.ts +1 -0
- package/entry-points/skill-editor.d.ts.map +1 -1
- package/entry-points/utils.d.ts +1 -0
- package/entry-points/utils.d.ts.map +1 -1
- package/file-manager.js +33 -33
- package/files/dial-file-manager.types.d.ts +4 -2
- package/files/dial-file-manager.types.d.ts.map +1 -1
- package/files/dial-file.d.ts +6 -0
- package/files/dial-file.d.ts.map +1 -1
- package/files/dial-file.js +17 -12
- package/files/useDialFileListing/useDialFileListing.d.ts +9 -1
- package/files/useDialFileListing/useDialFileListing.d.ts.map +1 -1
- package/files/useDialFileListing/useDialFileListing.js +205 -183
- package/files/useDialFileManager/useDialFileManager.d.ts +1 -1
- package/files/useDialFileManager/useDialFileManager.d.ts.map +1 -1
- package/files/useDialFileManager/useDialFileManager.js +114 -113
- package/files/useDialFileMutations/useDialFileMutations.d.ts +2 -1
- package/files/useDialFileMutations/useDialFileMutations.d.ts.map +1 -1
- package/files/useDialFileMutations/useDialFileMutations.js +5 -5
- package/index.d.ts +5 -0
- package/index.d.ts.map +1 -1
- package/index.js +267 -262
- package/org-units/org-unit-guards.d.ts +95 -1
- package/org-units/org-unit-guards.d.ts.map +1 -1
- package/org-units/org-unit-guards.js +51 -16
- package/org-units/useOrgUnits/useOrgUnits.d.ts +12 -4
- package/org-units/useOrgUnits/useOrgUnits.d.ts.map +1 -1
- package/org-units/useOrgUnits/useOrgUnits.js +44 -35
- package/package.json +20 -20
- package/project/project-conversation-data-source.js +4 -4
- package/project/project-refresh.d.ts +2 -0
- package/project/project-refresh.d.ts.map +1 -1
- package/project/project-refresh.js +1 -1
- package/project/use-project-actions.d.ts +3 -1
- package/project/use-project-actions.d.ts.map +1 -1
- package/project/use-project-actions.js +39 -38
- package/project/use-project.d.ts +3 -1
- package/project/use-project.d.ts.map +1 -1
- package/project/use-project.js +57 -44
- package/scheduled-task/scheduled-task-display.d.ts +51 -4
- package/scheduled-task/scheduled-task-display.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-display.js +53 -46
- package/scheduled-task/scheduled-task-next-occurrence.d.ts +2 -0
- package/scheduled-task/scheduled-task-next-occurrence.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-next-occurrence.js +2 -2
- package/scheduled-task/scheduled-task-time-format.d.ts +36 -0
- package/scheduled-task/scheduled-task-time-format.d.ts.map +1 -0
- package/scheduled-task/scheduled-task-time-format.js +34 -0
- package/scheduled-task/scheduled-task-trigger.d.ts.map +1 -1
- package/scheduled-task/scheduled-task-trigger.js +13 -14
- package/scheduled-tasks.js +14 -13
- package/skill/skill-archive.d.ts.map +1 -1
- package/skill/skill-archive.js +6 -7
- package/skill/skill-file-batch-validation.d.ts +6 -0
- package/skill/skill-file-batch-validation.d.ts.map +1 -1
- package/skill/skill-file-batch-validation.js +39 -37
- package/skill/skill-types.d.ts +0 -6
- package/skill/skill-types.d.ts.map +1 -1
- package/skill/skill-types.js +7 -8
- package/skill/skill.d.ts +2 -9
- package/skill/skill.d.ts.map +1 -1
- package/skill/skill.js +33 -34
- package/skill/types/skill-editor-submit.d.ts +8 -0
- package/skill/types/skill-editor-submit.d.ts.map +1 -0
- package/skill/types/skill-editor-submit.js +6 -0
- package/skill/useSkillEditorLoad.js +1 -1
- package/skill/useSkillEditorSubmit.d.ts +2 -3
- package/skill/useSkillEditorSubmit.d.ts.map +1 -1
- package/skill/useSkillEditorSubmit.js +103 -102
- package/skill/useSkillFileActions.d.ts +7 -1
- package/skill/useSkillFileActions.d.ts.map +1 -1
- package/skill/useSkillFileActions.js +55 -49
- package/skill-editor.js +7 -6
- package/utils.js +28 -27
|
@@ -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
|
|
6
|
-
import { ListFilesItemDtoNodeTypeEnum as
|
|
7
|
-
import { getParentFolderPath as
|
|
8
|
-
import { useCallback as
|
|
9
|
-
import { NotificationVariant as
|
|
10
|
-
import { DialFileManagerTabs as
|
|
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
|
|
13
|
-
let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
|
31
|
-
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(
|
|
34
|
-
}),
|
|
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 || (
|
|
57
|
+
t || (D !== "" && e(n) === 404 ? O(ie(D)) : de("dialFileManager.error"));
|
|
40
58
|
}).finally(() => {
|
|
41
|
-
t ||
|
|
59
|
+
t || F(!1);
|
|
42
60
|
}), () => {
|
|
43
61
|
t = !0;
|
|
44
62
|
};
|
|
45
63
|
}, [
|
|
46
|
-
b,
|
|
47
|
-
v,
|
|
48
|
-
_,
|
|
49
64
|
C,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
|
60
|
-
e ||
|
|
61
|
-
let t = r(e.path,
|
|
62
|
-
return n(t,
|
|
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 ||
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
115
|
+
O("");
|
|
94
116
|
return;
|
|
95
117
|
}
|
|
96
|
-
let t = `/${
|
|
97
|
-
if (e === `/${
|
|
98
|
-
|
|
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
|
-
|
|
109
|
-
}, [
|
|
110
|
-
|
|
111
|
-
}, []),
|
|
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([...
|
|
114
|
-
i.length > 0 && (
|
|
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
|
-
}),
|
|
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(
|
|
124
|
-
|
|
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
|
-
|
|
127
|
-
variant:
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
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
|
-
}),
|
|
152
|
-
}, [
|
|
153
|
-
if (!
|
|
154
|
-
let n = e == null ? "" : o(e,
|
|
155
|
-
|
|
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
|
-
}), !
|
|
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
|
-
}) : (
|
|
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(
|
|
168
|
-
|
|
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
|
-
|
|
171
|
-
variant:
|
|
192
|
+
w?.({
|
|
193
|
+
variant: g.Error,
|
|
172
194
|
reason: t.FolderLoadFailed
|
|
173
195
|
});
|
|
174
196
|
} finally {
|
|
175
|
-
|
|
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
|
-
|
|
183
|
-
v,
|
|
184
|
-
_,
|
|
185
|
-
S,
|
|
204
|
+
C,
|
|
186
205
|
x,
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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,
|
|
192
|
-
|
|
213
|
+
let t = o(n, S);
|
|
214
|
+
A.has(t) && e.add(n);
|
|
193
215
|
}
|
|
194
216
|
return e;
|
|
195
217
|
}, [
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
]),
|
|
201
|
-
|
|
202
|
-
e.has(t) ||
|
|
203
|
-
}),
|
|
204
|
-
let t = o(e,
|
|
205
|
-
return !
|
|
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,
|
|
208
|
-
|
|
229
|
+
let n = o(e, S);
|
|
230
|
+
K.current.add(n), (async () => {
|
|
209
231
|
try {
|
|
210
|
-
let { items: e, permissions: t } = await c(
|
|
211
|
-
|
|
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
|
-
|
|
214
|
-
variant:
|
|
235
|
+
q.current.add(n), w?.({
|
|
236
|
+
variant: g.Error,
|
|
215
237
|
reason: t.FolderLoadFailed
|
|
216
238
|
});
|
|
217
239
|
} finally {
|
|
218
|
-
|
|
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
|
-
|
|
227
|
-
v,
|
|
228
|
-
_,
|
|
229
|
-
W,
|
|
230
|
-
S,
|
|
248
|
+
C,
|
|
231
249
|
x,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
S
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
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
|
-
|
|
266
|
+
G.current = () => {
|
|
245
267
|
e = !0;
|
|
246
|
-
},
|
|
268
|
+
}, V(!0), (async () => {
|
|
247
269
|
try {
|
|
248
|
-
let { items: t } = await te(
|
|
270
|
+
let { items: t } = await te(b, C, x, D, B.current);
|
|
249
271
|
if (e) return;
|
|
250
|
-
let n =
|
|
251
|
-
|
|
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 ||
|
|
275
|
+
e || U([]);
|
|
254
276
|
} finally {
|
|
255
|
-
e ||
|
|
277
|
+
e || V(!1);
|
|
256
278
|
}
|
|
257
279
|
})();
|
|
258
|
-
}, 300) : (
|
|
280
|
+
}, 300) : (U(null), V(!1)));
|
|
259
281
|
}, [
|
|
282
|
+
C,
|
|
283
|
+
x,
|
|
284
|
+
A,
|
|
260
285
|
b,
|
|
261
|
-
|
|
286
|
+
D,
|
|
262
287
|
T,
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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
|
-
|
|
293
|
+
Q,
|
|
272
294
|
$,
|
|
273
|
-
|
|
295
|
+
S
|
|
274
296
|
]);
|
|
275
297
|
return {
|
|
276
|
-
items:
|
|
277
|
-
isLoading:
|
|
278
|
-
error:
|
|
298
|
+
items: Q,
|
|
299
|
+
isLoading: se,
|
|
300
|
+
error: ue,
|
|
279
301
|
path: $,
|
|
280
|
-
folderPath:
|
|
281
|
-
onPathChange:
|
|
282
|
-
retry:
|
|
283
|
-
onSearchFiles:
|
|
284
|
-
isSearching:
|
|
285
|
-
searchResults:
|
|
286
|
-
clearSearchResults:
|
|
287
|
-
expandedPaths:
|
|
288
|
-
loadedPaths:
|
|
289
|
-
onExpandedPathsChange:
|
|
290
|
-
onFolderPopupPathChange:
|
|
291
|
-
folderPopupLoadingPaths:
|
|
292
|
-
sharedWithMeIds:
|
|
293
|
-
sharedByMePaths:
|
|
294
|
-
currentFolder:
|
|
295
|
-
cache:
|
|
296
|
-
listingPermissionsCache:
|
|
297
|
-
sharedRootMetaRef:
|
|
298
|
-
setFolderPath:
|
|
299
|
-
invalidateFolders:
|
|
300
|
-
mergeCreatedFolder:
|
|
301
|
-
bumpRetry:
|
|
302
|
-
removeSharedRootItems:
|
|
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 {
|
|
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,
|
|
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"}
|