@epam/ai-dial-chat-hooks 1.3.0-dev.124 → 1.3.0-dev.126
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/api-error.js +2 -2
- package/api-transport/create-unauthorized-middleware.js +4 -1
- package/attachment/useAttachmentAction/useAttachmentAction.js +5 -8
- package/catalog/map-entity-details-to-catalog.js +1 -1
- package/catalog/map-skill-to-catalog-item.js +1 -5
- package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js +1 -1
- package/catalog/usePublishFolders/usePublishFolders.js +1 -1
- package/catalog/useSkillItemDetails.js +3 -3
- package/conversation/conversation-draft/conversation-draft-store.js +40 -40
- package/conversation/conversation-transfer/import-conversation.js +7 -8
- package/conversation/conversation-transfer/progress.js +1 -1
- package/conversation/conversation-transfer/zip-export.js +1 -7
- package/conversation/conversation-transfer/zip-import.js +1 -1
- package/conversation/create-chat-stream-api.js +1 -5
- package/conversation/useAttachmentUpload/useAttachmentUpload.js +4 -1
- package/conversation/useConversationComposerDraft/useConversationComposerDraft.js +1 -5
- package/conversation/useConversationExport/useConversationExport.js +11 -12
- package/conversation/useConversationHandlers/message-utils.js +2 -2
- package/conversation/useConversationHandlers/useConversationHandlers.js +2 -2
- package/conversation/useConversationImport/useConversationImport.js +24 -24
- package/conversation/useConversationScroll/useConversationScroll.js +2 -6
- package/conversation/useConversationStream/conversation-path.js +2 -2
- package/conversation/useConversationStream/frame-scheduler.js +17 -17
- package/conversation/useConversationStream/generation-resume.js +11 -21
- package/conversation/useConversationStream/useConversationStream.js +39 -60
- package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +4 -10
- package/conversation-overlay.js +1 -2
- package/conversation-sources.js +1 -2
- package/file-manager-canvas.js +1 -2
- package/files/attachment-types.js +1 -1
- package/files/create-upload-file-with-progress.js +5 -12
- package/files/dial-file-manager-mapping.util.js +7 -7
- package/files/dial-file-to-attachment.js +3 -3
- package/files/source-content.js +1 -1
- package/files/useDialFileListing/useDialFileListing.js +46 -61
- package/files/useDialFileManagerSections/useDialFileManagerSections.js +70 -86
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +1 -1
- package/files/useDialFileMetadata/useDialFileMetadata.js +3 -3
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +1 -1
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +2 -2
- package/mcp-apps/useMcpAppTools/useMcpAppTools.js +3 -6
- package/oauth/authorize-url.js +1 -1
- package/oauth/handshake.js +3 -10
- package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js +2 -5
- package/oauth/useToolsetLogin/useToolsetLogin.js +2 -1
- package/offline-credentials/useOfflineCredentialsGate/useOfflineCredentialsGate.js +1 -1
- package/offline-credentials/useOfflineCredentialsLogin/useOfflineCredentialsLogin.js +13 -13
- package/package.json +16 -16
- package/scheduled-task/scheduled-task-description.js +1 -1
- package/scheduled-task/scheduled-task-trigger.js +1 -1
- package/scheduled-task/use-scheduled-task-runs.js +6 -18
- package/scheduled-task/use-scheduled-tasks.js +1 -1
- package/scroll-anchoring.js +1 -2
- package/shared/application-schema.js +3 -3
- package/shared/cron-day-of-month.js +10 -10
- package/shared/locale.js +2 -2
- package/skill/skill-file-batch-validation.js +18 -17
- package/skill/skill-types.js +1 -1
- package/skill/skill.js +12 -15
- package/skill/useSkillArchiveImport/useSkillArchiveImport.js +1 -7
- package/skill/useSkillEditorSubmit.js +1 -5
- package/skills-state.js +1 -2
- package/source-content.js +1 -2
- package/usage/useUsageLimitBanner/useUsageLimitBanner.js +1 -1
- package/usage/useUsageLimitBannerDismissal/useUsageLimitBannerDismissal.js +1 -1
- package/usePageFileDrag/usePageFileDrag.js +3 -3
|
@@ -12,7 +12,7 @@ var c = (e) => {
|
|
|
12
12
|
if (l(e) !== -1) return !0;
|
|
13
13
|
let t = e.messages[e.messages.length - 1];
|
|
14
14
|
return !!t && t.role === s.Assistant && !c(t) && t.streamErrorMessage == null && !t.wasStoppedByUser;
|
|
15
|
-
}, d =
|
|
15
|
+
}, d = 3e5, f = "awaiting-resume", p = [
|
|
16
16
|
1e3,
|
|
17
17
|
2e3,
|
|
18
18
|
4e3,
|
|
@@ -81,18 +81,14 @@ var c = (e) => {
|
|
|
81
81
|
if (x?.flush(D), N != null && S?.current.delete(N), !M()) return;
|
|
82
82
|
m.current.delete(D), v(D);
|
|
83
83
|
let n = !k && e && e.messages.length - 1 === A && u(e) && c(j.message);
|
|
84
|
-
|
|
85
|
-
j.message
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
});
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
h.current.delete(D), e && y(D) && (s(e), p.current = e);
|
|
84
|
+
t || n ? (j.message = {
|
|
85
|
+
...j.message,
|
|
86
|
+
streamErrorMessage: b
|
|
87
|
+
}, y(D) && s((e) => {
|
|
88
|
+
if (!e || !M() || !y(D)) return e;
|
|
89
|
+
let t = a(e, j);
|
|
90
|
+
return p.current = t, t;
|
|
91
|
+
})) : (h.current.delete(D), e && y(D) && (s(e), p.current = e));
|
|
96
92
|
}, I = async () => {
|
|
97
93
|
if (M()) try {
|
|
98
94
|
let n = await o.getConversation(e(t));
|
|
@@ -115,13 +111,7 @@ var c = (e) => {
|
|
|
115
111
|
}), z = (e) => {
|
|
116
112
|
if (!M() || P()) return;
|
|
117
113
|
let t = i([j.message], 0, e);
|
|
118
|
-
|
|
119
|
-
if (x) {
|
|
120
|
-
x.schedule(D, R);
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
R();
|
|
124
|
-
}
|
|
114
|
+
t && (j.message = t[0]), y(D) && (x ? x.schedule(D, R) : R());
|
|
125
115
|
}, B = async () => {
|
|
126
116
|
let n = new AbortController(), r;
|
|
127
117
|
try {
|
|
@@ -181,4 +171,4 @@ var c = (e) => {
|
|
|
181
171
|
})();
|
|
182
172
|
};
|
|
183
173
|
//#endregion
|
|
184
|
-
export { _ as createResumeIfAwaitingGeneration, h as fetchConversationForRecovery, l as findPendingBackgroundMessageIndex, c as hasGeneratedPayload, u as isAwaitingGenerationResume };
|
|
174
|
+
export { p as RECOVERY_REFETCH_DELAYS_MS, _ as createResumeIfAwaitingGeneration, h as fetchConversationForRecovery, l as findPendingBackgroundMessageIndex, c as hasGeneratedPayload, u as isAwaitingGenerationResume };
|
|
@@ -42,7 +42,7 @@ var ae = 2e4, oe = 401, b = 404, x = 2e3, S = 100, se = (e, t, n) => e instanceo
|
|
|
42
42
|
}, []), ye = m(async () => {
|
|
43
43
|
if (!s) return;
|
|
44
44
|
let e = U.current.get(c(s));
|
|
45
|
-
if (
|
|
45
|
+
if (e && e.isCurrent() && !G.current.has(e)) {
|
|
46
46
|
G.current.add(e), ve(new Set(G.current));
|
|
47
47
|
try {
|
|
48
48
|
await e.retry();
|
|
@@ -112,7 +112,7 @@ var ae = 2e4, oe = 401, b = 404, x = 2e3, S = 100, se = (e, t, n) => e instanceo
|
|
|
112
112
|
}, ue = () => {
|
|
113
113
|
if (b()) return;
|
|
114
114
|
let e = z.current.get(_);
|
|
115
|
-
|
|
115
|
+
e && e.generationId === g && (e.message = {
|
|
116
116
|
...e.message,
|
|
117
117
|
streamErrorMessage: k
|
|
118
118
|
}, fe.current?.(new i()), J(_) && w((t) => {
|
|
@@ -122,11 +122,8 @@ var ae = 2e4, oe = 401, b = 404, x = 2e3, S = 100, se = (e, t, n) => e instanceo
|
|
|
122
122
|
}));
|
|
123
123
|
}, A = z.current.get(_), j = () => H.current && !b() && z.current.get(_) === A, N = async () => {
|
|
124
124
|
if (j()) {
|
|
125
|
-
if (!J(_))
|
|
126
|
-
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
try {
|
|
125
|
+
if (!J(_)) A && z.current.delete(_);
|
|
126
|
+
else try {
|
|
130
127
|
let n = await E.getConversation(e(t));
|
|
131
128
|
if (!j()) return;
|
|
132
129
|
if (K(_), !J(_)) {
|
|
@@ -155,57 +152,39 @@ var ae = 2e4, oe = 401, b = 404, x = 2e3, S = 100, se = (e, t, n) => e instanceo
|
|
|
155
152
|
let n = l([t.message], 0, e);
|
|
156
153
|
n && (t.message = n[0]);
|
|
157
154
|
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
let n = u(e, t);
|
|
167
|
-
return T.current = n, n;
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
w((t) => {
|
|
173
|
-
if (!t) return t;
|
|
174
|
-
let n = z.current.get(_), r;
|
|
175
|
-
if (n?.generationId === g) r = u(t, n);
|
|
176
|
-
else {
|
|
177
|
-
let n = l(t.messages, a, e);
|
|
178
|
-
if (!n) return t;
|
|
179
|
-
r = {
|
|
180
|
-
...t,
|
|
181
|
-
messages: n
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
return T.current = r, r;
|
|
155
|
+
J(_) && (pe.current && t?.generationId === g ? M.schedule(_, () => {
|
|
156
|
+
let e = z.current.get(_);
|
|
157
|
+
if (b() || !J(_) || e?.generationId !== g) return;
|
|
158
|
+
let t = { ...e };
|
|
159
|
+
w((e) => {
|
|
160
|
+
if (!e) return e;
|
|
161
|
+
let n = u(e, t);
|
|
162
|
+
return T.current = n, n;
|
|
185
163
|
});
|
|
186
|
-
}
|
|
164
|
+
}) : w((t) => {
|
|
165
|
+
if (!t) return t;
|
|
166
|
+
let n = z.current.get(_), r;
|
|
167
|
+
if (n?.generationId === g) r = u(t, n);
|
|
168
|
+
else {
|
|
169
|
+
let n = l(t.messages, a, e);
|
|
170
|
+
if (!n) return t;
|
|
171
|
+
r = {
|
|
172
|
+
...t,
|
|
173
|
+
messages: n
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
return T.current = r, r;
|
|
177
|
+
}));
|
|
187
178
|
},
|
|
188
179
|
onComplete: async () => {
|
|
189
180
|
M.flush(_), C(), B.current.has(g) ? B.current.delete(g) : b() || O?.notifyGenerationEnd?.(), await N();
|
|
190
181
|
},
|
|
191
182
|
onError: (e) => {
|
|
192
|
-
|
|
193
|
-
U(e);
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
if (e instanceof r && h.resumeOnConflict && !b()) {
|
|
197
|
-
ge(e);
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
F(e);
|
|
183
|
+
M.flush(_), fe.current?.(e), e instanceof o && !b() ? U(e) : e instanceof r && h.resumeOnConflict && !b() ? ge(e) : F(e);
|
|
201
184
|
}
|
|
202
185
|
}, F = (e) => {
|
|
203
186
|
let t = z.current.get(_), n = t?.generationId === g ? t : void 0;
|
|
204
|
-
|
|
205
|
-
me(e, n, E.saveConversation.bind(E));
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
I(e, n);
|
|
187
|
+
n && !(e instanceof i) && z.current.delete(_), C(), n && E.saveConversation && e instanceof i && e.status === oe ? me(e, n, E.saveConversation.bind(E)) : I(e, n);
|
|
209
188
|
}, I = (e, t) => {
|
|
210
189
|
if (t && e instanceof i && (t.message = {
|
|
211
190
|
...t.message,
|
|
@@ -241,9 +220,13 @@ var ae = 2e4, oe = 401, b = 404, x = 2e3, S = 100, se = (e, t, n) => e instanceo
|
|
|
241
220
|
}, V = () => {
|
|
242
221
|
C(), B.current.has(g) ? B.current.delete(g) : b() || O?.notifyGenerationEnd?.();
|
|
243
222
|
}, U = async (n) => {
|
|
244
|
-
R.current.add(_)
|
|
223
|
+
R.current.add(_);
|
|
224
|
+
let r = await te(() => E.getConversation(e(t)), b);
|
|
225
|
+
W(r, n, !1);
|
|
245
226
|
}, ge = async (n) => {
|
|
246
|
-
L.current.get(_) === g && Z(_, !1), R.current.add(_)
|
|
227
|
+
L.current.get(_) === g && Z(_, !1), R.current.add(_);
|
|
228
|
+
let r = await te(() => E.getConversation(e(t)), b, (e) => e.messages.length === a && e.messages.at(-1)?.role === p.User);
|
|
229
|
+
W(r, n, !0);
|
|
247
230
|
}, W = (e, n, r) => {
|
|
248
231
|
if (b()) {
|
|
249
232
|
C();
|
|
@@ -255,15 +238,11 @@ var ae = 2e4, oe = 401, b = 404, x = 2e3, S = 100, se = (e, t, n) => e instanceo
|
|
|
255
238
|
return;
|
|
256
239
|
}
|
|
257
240
|
let c = z.current.get(_), l = c?.generationId === g ? c : void 0;
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
});
|
|
264
|
-
return;
|
|
265
|
-
}
|
|
266
|
-
R.current.delete(_), l && z.current.delete(_), J(_) && (w(e), T.current = e), V();
|
|
241
|
+
f(e) ? Q(t, e, {
|
|
242
|
+
seedMessage: o ? l?.message : void 0,
|
|
243
|
+
skipDedupe: !0,
|
|
244
|
+
onSettled: V
|
|
245
|
+
}) : (R.current.delete(_), l && z.current.delete(_), J(_) && (w(e), T.current = e), V());
|
|
267
246
|
};
|
|
268
247
|
(async () => {
|
|
269
248
|
try {
|
|
@@ -112,16 +112,10 @@ var o = "button,input,textarea,select,iframe,[role=\"button\"],[contenteditable=
|
|
|
112
112
|
"End",
|
|
113
113
|
"PageUp",
|
|
114
114
|
"PageDown"
|
|
115
|
-
].includes(e.key) || (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "a"))
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (g.current) {
|
|
120
|
-
if (e.key === "Escape") {
|
|
121
|
-
O();
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
if (e.key === "Tab" && !e.shiftKey && !h.current?.contains(document.activeElement)) {
|
|
115
|
+
].includes(e.key) || (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "a")) r = !0, O(), _.current = null;
|
|
116
|
+
else if (g.current) {
|
|
117
|
+
if (e.key === "Escape") O();
|
|
118
|
+
else if (e.key === "Tab" && !e.shiftKey && !h.current?.contains(document.activeElement)) {
|
|
125
119
|
let t = h.current?.querySelector("button");
|
|
126
120
|
t && (e.preventDefault(), t.focus());
|
|
127
121
|
}
|
package/conversation-overlay.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as toOverlayMessages };
|
|
1
|
+
export { toOverlayMessages } from "./conversation/overlay-messages.js";
|
package/conversation-sources.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as useConversationSources };
|
|
1
|
+
export { useConversationSources } from "./conversation-sources/useConversationSources/useConversationSources.js";
|
package/file-manager-canvas.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { e as annotationToOoxmlCanvasContent, t as annotationToPdfCanvasContent, n as clearAttachmentCache, r as hasAttachmentTextSource, i as referenceAttachmentToPdfCanvasContent, a as resolveCodeCanvasContent, o as resolveGroupedVisualizerCanvasContent, s as resolveHtmlCanvasContent, c as resolveImageCanvasContent, l as resolveJsonCanvasContent, u as resolveMarkdownCanvasContent, d as resolveOoxmlCanvasContent, f as resolvePdfCanvasContent, p as resolveTextCanvasContent, m as resolveVisualizerCanvasContent };
|
|
1
|
+
export { annotationToOoxmlCanvasContent, annotationToPdfCanvasContent, clearAttachmentCache, hasAttachmentTextSource, referenceAttachmentToPdfCanvasContent, resolveCodeCanvasContent, resolveGroupedVisualizerCanvasContent, resolveHtmlCanvasContent, resolveImageCanvasContent, resolveJsonCanvasContent, resolveMarkdownCanvasContent, resolveOoxmlCanvasContent, resolvePdfCanvasContent, resolveTextCanvasContent, resolveVisualizerCanvasContent } from "./files/attachment-canvas.js";
|
|
@@ -5,7 +5,7 @@ var n = "*/*", r = (e) => e.startsWith(".") || e.includes("/"), i = (t) => {
|
|
|
5
5
|
if (t != null) return t.map((t) => t === "*" ? n : t.startsWith(".") ? t : e(t)).filter(r);
|
|
6
6
|
}, a = (e) => {
|
|
7
7
|
let t = i(e);
|
|
8
|
-
if (
|
|
8
|
+
if (t != null && t.length !== 0 && !t.some((e) => e === n)) return t.join(",");
|
|
9
9
|
}, o = (n) => n.map((n) => {
|
|
10
10
|
if (n.endsWith("/*")) return n;
|
|
11
11
|
let r = e(n), i = t(r);
|
|
@@ -26,19 +26,12 @@ var e = class extends Error {
|
|
|
26
26
|
!l || !e.lengthComputable || e.total <= 0 || l(Math.min(100, Math.round(e.loaded / e.total * 100)));
|
|
27
27
|
}), p.addEventListener("load", () => {
|
|
28
28
|
let t = p.getResponseHeader("x-csrf-token");
|
|
29
|
-
if (t && n.setCsrfToken(t), p.status >= 200 && p.status < 300) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
f(/* @__PURE__ */ Error("Upload response was not valid JSON"));
|
|
34
|
-
}
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (p.status === 401) {
|
|
38
|
-
n.notifyUnauthorized(r), f(n.createUnauthorizedError(r));
|
|
39
|
-
return;
|
|
29
|
+
if (t && n.setCsrfToken(t), p.status >= 200 && p.status < 300) try {
|
|
30
|
+
d(JSON.parse(p.responseText));
|
|
31
|
+
} catch {
|
|
32
|
+
f(/* @__PURE__ */ Error("Upload response was not valid JSON"));
|
|
40
33
|
}
|
|
41
|
-
f(new e(p));
|
|
34
|
+
else p.status === 401 ? (n.notifyUnauthorized(r), f(n.createUnauthorizedError(r))) : f(new e(p));
|
|
42
35
|
}), p.addEventListener("error", () => {
|
|
43
36
|
f(new t());
|
|
44
37
|
}), p.addEventListener("abort", () => {
|
|
@@ -134,18 +134,18 @@ var u = (e) => {
|
|
|
134
134
|
apiRoot: i(o.dialCorePath, o.bucket) + s
|
|
135
135
|
};
|
|
136
136
|
}, S = (e) => e.split("/").filter(Boolean).map(t), C = (e, t, n, a) => {
|
|
137
|
-
let o = e.nodeType === s.Folder, c = e.name, u = e.bucket ?? t, d =
|
|
137
|
+
let o = e.nodeType === s.Folder, c = e.name, u = e.bucket ?? t, d = e.url ?? e.path ?? "", f = i(d, u).replace(/\/$/, ""), p = f.lastIndexOf("/"), m = p > 0 ? f.slice(0, p) : "", h;
|
|
138
138
|
if (a) {
|
|
139
|
-
let e = a.apiRoot ? S(
|
|
140
|
-
|
|
141
|
-
} else
|
|
142
|
-
let
|
|
139
|
+
let e = a.apiRoot ? S(m).slice(S(a.apiRoot).length) : [];
|
|
140
|
+
h = [a.virtualRoot, ...e].join("/");
|
|
141
|
+
} else h = r(m, n, !1);
|
|
142
|
+
let g = o ? `${h}/${c}/` : `${h}/${c}`;
|
|
143
143
|
return {
|
|
144
144
|
id: e.path,
|
|
145
145
|
name: c,
|
|
146
|
-
path:
|
|
146
|
+
path: g,
|
|
147
147
|
url: e.url,
|
|
148
|
-
parentPath:
|
|
148
|
+
parentPath: h,
|
|
149
149
|
nodeType: o ? l.FOLDER : l.ITEM,
|
|
150
150
|
folderId: e.folderId,
|
|
151
151
|
bucket: u,
|
|
@@ -22,15 +22,15 @@ var a = (e, n) => {
|
|
|
22
22
|
...u == null ? {} : { previewUrl: u }
|
|
23
23
|
};
|
|
24
24
|
}, s = (e, t, n) => e.map((e) => o(e, t, n)).filter((e) => e != null), c = (t) => {
|
|
25
|
-
let i =
|
|
25
|
+
let i = t.replace(/\/$/, "").split("/").filter(Boolean).pop() ?? "", a = e(i);
|
|
26
26
|
return {
|
|
27
27
|
id: t,
|
|
28
|
-
name:
|
|
28
|
+
name: a,
|
|
29
29
|
contentType: "application/octet-stream",
|
|
30
30
|
type: n.File,
|
|
31
31
|
status: r.Idle,
|
|
32
32
|
url: t,
|
|
33
|
-
file: new File([],
|
|
33
|
+
file: new File([], a)
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
package/files/source-content.js
CHANGED
|
@@ -4,7 +4,7 @@ var e = {
|
|
|
4
4
|
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
5
5
|
pptx: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
6
6
|
csv: "text/csv"
|
|
7
|
-
}, t = new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), n = new Set(["html", "htm"]), r = "pdf", i = "application/pdf", a = (e) => e.split(/[?#]/)[0], o = (e) => {
|
|
7
|
+
}, t = /* @__PURE__ */ new Set(/* @__PURE__ */ "txt.md.markdown.json.jsonl.ndjson.xml.csv.tsv.yaml.yml.toml.ini.conf.cfg.css.scss.sass.less.js.jsx.ts.tsx.mjs.cjs.mts.cts.py.rb.go.rs.java.kt.swift.c.h.cpp.cs.sh.bash.zsh.fish.ps1.log.env.gitignore.dockerfile.makefile.sql".split(".")), n = /* @__PURE__ */ new Set(["html", "htm"]), r = "pdf", i = "application/pdf", a = (e) => e.split(/[?#]/)[0], o = (e) => {
|
|
8
8
|
let t = e.lastIndexOf(".");
|
|
9
9
|
return t === -1 ? "" : e.slice(t + 1).toLowerCase();
|
|
10
10
|
}, s = (e) => {
|
|
@@ -36,13 +36,7 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
36
36
|
dialCorePath: e.path
|
|
37
37
|
}]))));
|
|
38
38
|
}).catch((n) => {
|
|
39
|
-
|
|
40
|
-
if (C !== "" && e(n) === 404) {
|
|
41
|
-
w(ie(C));
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
j("dialFileManager.error");
|
|
45
|
-
}
|
|
39
|
+
t || (C !== "" && e(n) === 404 ? w(ie(C)) : j("dialFileManager.error"));
|
|
46
40
|
}).finally(() => {
|
|
47
41
|
t || A(!1);
|
|
48
42
|
}), () => {
|
|
@@ -63,7 +57,10 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
63
57
|
}
|
|
64
58
|
let e = !1;
|
|
65
59
|
return _.listSharedByMe(v).then((t) => {
|
|
66
|
-
e || I(new Set(t.items.map((e) =>
|
|
60
|
+
e || I(new Set(t.items.map((e) => {
|
|
61
|
+
let t = r(e.path, v);
|
|
62
|
+
return n(t, y, e.nodeType === ae.Folder);
|
|
63
|
+
})));
|
|
67
64
|
}).catch(() => {
|
|
68
65
|
e || I(/* @__PURE__ */ new Set());
|
|
69
66
|
}), () => {
|
|
@@ -155,38 +152,32 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
155
152
|
}, [y]), xe = u((e) => {
|
|
156
153
|
if (!S) return;
|
|
157
154
|
let n = e == null ? "" : o(e, y), r = e ?? `/${y}`;
|
|
158
|
-
|
|
155
|
+
J((e) => {
|
|
159
156
|
if (e.has(r)) return e;
|
|
160
157
|
let t = new Set(e);
|
|
161
158
|
return t.add(r), t;
|
|
162
|
-
}), !D.current.has(n)) {
|
|
163
|
-
|
|
164
|
-
|
|
159
|
+
}), !D.current.has(n) && (H.current.has(n) ? K((e) => {
|
|
160
|
+
let t = new Set(e);
|
|
161
|
+
return t.add(r), t;
|
|
162
|
+
}) : (H.current.add(n), K((e) => {
|
|
163
|
+
let t = new Set(e);
|
|
164
|
+
return t.add(r), t;
|
|
165
|
+
}), (async () => {
|
|
166
|
+
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);
|
|
169
|
+
} catch {
|
|
170
|
+
x?.({
|
|
171
|
+
variant: h.Error,
|
|
172
|
+
reason: t.FolderLoadFailed
|
|
173
|
+
});
|
|
174
|
+
} finally {
|
|
175
|
+
H.current.delete(n), K((e) => {
|
|
165
176
|
let t = new Set(e);
|
|
166
|
-
return t.
|
|
177
|
+
return t.delete(r), t;
|
|
167
178
|
});
|
|
168
|
-
return;
|
|
169
179
|
}
|
|
170
|
-
|
|
171
|
-
let t = new Set(e);
|
|
172
|
-
return t.add(r), t;
|
|
173
|
-
}), (async () => {
|
|
174
|
-
try {
|
|
175
|
-
let { items: e, permissions: t } = await c(_, b, v, n, L.current);
|
|
176
|
-
E((t) => new Map(t).set(n, e)), t != null && k((e) => new Map(e).set(n, t)), U.current.delete(n);
|
|
177
|
-
} catch {
|
|
178
|
-
x?.({
|
|
179
|
-
variant: h.Error,
|
|
180
|
-
reason: t.FolderLoadFailed
|
|
181
|
-
});
|
|
182
|
-
} finally {
|
|
183
|
-
H.current.delete(n), K((e) => {
|
|
184
|
-
let t = new Set(e);
|
|
185
|
-
return t.delete(r), t;
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
})();
|
|
189
|
-
}
|
|
180
|
+
})()));
|
|
190
181
|
}, [
|
|
191
182
|
b,
|
|
192
183
|
v,
|
|
@@ -195,7 +186,7 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
195
186
|
x,
|
|
196
187
|
y
|
|
197
188
|
]), Se = f(() => {
|
|
198
|
-
let e = /* @__PURE__ */ new Set(), t = new Set([...W, ...q]);
|
|
189
|
+
let e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set([...W, ...q]);
|
|
199
190
|
for (let n of t) {
|
|
200
191
|
let t = o(n, y);
|
|
201
192
|
T.has(t) && e.add(n);
|
|
@@ -242,35 +233,29 @@ var _ = ({ filesApi: _, bucket: v, rootLabel: y, activeTab: b, onNotification: x
|
|
|
242
233
|
]), we = u(() => {
|
|
243
234
|
B.current != null && (clearTimeout(B.current), B.current = null), V.current?.(), V.current = null, z(null), R(!1);
|
|
244
235
|
}, []), Te = u((e, t) => {
|
|
245
|
-
|
|
246
|
-
if (B.current
|
|
247
|
-
|
|
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) => l(e, e.bucket ?? v, y, t))), R(!1);
|
|
248
241
|
return;
|
|
249
242
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
243
|
+
let e = !1;
|
|
244
|
+
V.current = () => {
|
|
245
|
+
e = !0;
|
|
246
|
+
}, R(!0), (async () => {
|
|
247
|
+
try {
|
|
248
|
+
let { items: t } = await te(_, b, v, C, L.current);
|
|
249
|
+
if (e) return;
|
|
250
|
+
let n = b === g.Shared ? s(y, C, L.current) : void 0;
|
|
251
|
+
z(t.map((e) => l(e, e.bucket ?? v, y, n)));
|
|
252
|
+
} catch {
|
|
253
|
+
e || z([]);
|
|
254
|
+
} finally {
|
|
255
|
+
e || R(!1);
|
|
256
256
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
e = !0;
|
|
260
|
-
}, R(!0), (async () => {
|
|
261
|
-
try {
|
|
262
|
-
let { items: t } = await te(_, b, v, C, L.current);
|
|
263
|
-
if (e) return;
|
|
264
|
-
let n = b === g.Shared ? s(y, C, L.current) : void 0;
|
|
265
|
-
z(t.map((e) => l(e, e.bucket ?? v, y, n)));
|
|
266
|
-
} catch {
|
|
267
|
-
e || z([]);
|
|
268
|
-
} finally {
|
|
269
|
-
e || R(!1);
|
|
270
|
-
}
|
|
271
|
-
})();
|
|
272
|
-
}, 300);
|
|
273
|
-
}
|
|
257
|
+
})();
|
|
258
|
+
}, 300) : (z(null), R(!1)));
|
|
274
259
|
}, [
|
|
275
260
|
b,
|
|
276
261
|
v,
|