@arbidocs/blocks 0.4.156 → 0.4.157
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/dist/ConnectedNativeDocxComparison-2PLOOXSH.js +1 -1
- package/dist/ConnectedNativeDocxComparison-S25BPUH5.cjs +1 -1
- package/dist/ConnectedNativeDocxEditor-JJAGMHZC.js +1 -1
- package/dist/ConnectedNativeDocxEditor-YA4HWLY4.cjs +1 -1
- package/dist/ConnectedStreamedWordArtifact-EXYZAU4Y.cjs +1 -1
- package/dist/ConnectedStreamedWordArtifact-YAAXY5KY.js +1 -1
- package/dist/agents/index.cjs +238 -238
- package/dist/agents/index.js +4 -4
- package/dist/chat/index.cjs +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/{chunk-6HMCF4AJ.js → chunk-5ZIYPZYE.js} +1033 -5
- package/dist/chunk-5ZIYPZYE.js.map +1 -0
- package/dist/{chunk-O3FB62T5.cjs → chunk-6QAAIDQQ.cjs} +47 -47
- package/dist/{chunk-O3FB62T5.cjs.map → chunk-6QAAIDQQ.cjs.map} +1 -1
- package/dist/{chunk-UKT3WH5Z.cjs → chunk-B3FMUFAW.cjs} +3 -3
- package/dist/{chunk-UKT3WH5Z.cjs.map → chunk-B3FMUFAW.cjs.map} +1 -1
- package/dist/{chunk-W7CWGURO.js → chunk-FTZ45WHY.js} +6 -685
- package/dist/chunk-FTZ45WHY.js.map +1 -0
- package/dist/{chunk-HDJRSCRE.cjs → chunk-GC2FSPSQ.cjs} +6 -6
- package/dist/{chunk-HDJRSCRE.cjs.map → chunk-GC2FSPSQ.cjs.map} +1 -1
- package/dist/{chunk-UKCCV63X.js → chunk-MNG7N6M2.js} +4 -4
- package/dist/{chunk-UKCCV63X.js.map → chunk-MNG7N6M2.js.map} +1 -1
- package/dist/{chunk-MUDEL7UL.cjs → chunk-NPLGB4LI.cjs} +4 -703
- package/dist/chunk-NPLGB4LI.cjs.map +1 -0
- package/dist/{chunk-UPMADXDU.js → chunk-P6RIBIVN.js} +3 -3
- package/dist/{chunk-UPMADXDU.js.map → chunk-P6RIBIVN.js.map} +1 -1
- package/dist/{chunk-WV4TD2HZ.cjs → chunk-QJFJ5JBF.cjs} +1055 -2
- package/dist/chunk-QJFJ5JBF.cjs.map +1 -0
- package/dist/{chunk-6HG56GCT.js → chunk-QKR5LWDO.js} +4 -4
- package/dist/{chunk-6HG56GCT.js.map → chunk-QKR5LWDO.js.map} +1 -1
- package/dist/{chunk-YMQDDUKW.js → chunk-WU34CHU5.js} +3 -3
- package/dist/{chunk-YMQDDUKW.js.map → chunk-WU34CHU5.js.map} +1 -1
- package/dist/{chunk-FEGXFABZ.cjs → chunk-YF3QUHKN.cjs} +3 -3
- package/dist/{chunk-FEGXFABZ.cjs.map → chunk-YF3QUHKN.cjs.map} +1 -1
- package/dist/connect/docx.cjs +1 -1
- package/dist/connect/docx.js +1 -1
- package/dist/connect/index.cjs +730 -170
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +571 -16
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/viewer.cjs +45 -45
- package/dist/connect/viewer.js +7 -7
- package/dist/connection/files/index.d.ts +5 -0
- package/dist/connection/files/support.d.ts +2 -0
- package/dist/connection/files/upload/AddFromAccountsButton.d.ts +16 -0
- package/dist/connection/files/upload/ConnectedUpload.d.ts +36 -0
- package/dist/connection/files/upload/ConnectedUploadDropzone.d.ts +36 -0
- package/dist/connection/files/upload/EmptyWorkspaceUpload.d.ts +13 -0
- package/dist/connection/files/upload/useAddFromUrls.d.ts +13 -0
- package/dist/document-tools/index.cjs +1 -1
- package/dist/document-tools/index.js +1 -1
- package/dist/facts/index.cjs +54 -54
- package/dist/facts/index.js +4 -4
- package/dist/files/PrivacyExplainerModal.d.ts +8 -0
- package/dist/files/ShareToggle.d.ts +8 -0
- package/dist/files/UrlInputDialog.d.ts +24 -0
- package/dist/files/index.cjs +298 -278
- package/dist/files/index.d.ts +4 -0
- package/dist/files/index.js +2 -2
- package/dist/files/media-preview.d.ts +24 -0
- package/dist/index.cjs +347 -347
- package/dist/index.js +8 -8
- package/dist/studio/index.cjs +1 -1
- package/dist/studio/index.js +1 -1
- package/dist/workflow-canvas/index.cjs +16 -16
- package/dist/workflow-canvas/index.js +4 -4
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/chunk-6HMCF4AJ.js.map +0 -1
- package/dist/chunk-MUDEL7UL.cjs.map +0 -1
- package/dist/chunk-W7CWGURO.js.map +0 -1
- package/dist/chunk-WV4TD2HZ.cjs.map +0 -1
package/dist/connect/index.cjs
CHANGED
|
@@ -11,47 +11,49 @@ var chunkSN2GZ4ZM_cjs = require('../chunk-SN2GZ4ZM.cjs');
|
|
|
11
11
|
var chunkKBO75NLM_cjs = require('../chunk-KBO75NLM.cjs');
|
|
12
12
|
var chunkIJEISII2_cjs = require('../chunk-IJEISII2.cjs');
|
|
13
13
|
var chunk6I6CVX5G_cjs = require('../chunk-6I6CVX5G.cjs');
|
|
14
|
+
var chunkQJFJ5JBF_cjs = require('../chunk-QJFJ5JBF.cjs');
|
|
15
|
+
require('../chunk-223D4727.cjs');
|
|
14
16
|
var chunkCB4TIDEX_cjs = require('../chunk-CB4TIDEX.cjs');
|
|
15
17
|
var chunkFM3IRQJW_cjs = require('../chunk-FM3IRQJW.cjs');
|
|
16
18
|
var chunkJH6JTI76_cjs = require('../chunk-JH6JTI76.cjs');
|
|
17
19
|
require('../chunk-464YPRAE.cjs');
|
|
18
20
|
require('../chunk-JSQEAPTC.cjs');
|
|
19
|
-
var
|
|
20
|
-
var chunk5FYU7ZIU_cjs = require('../chunk-5FYU7ZIU.cjs');
|
|
21
|
-
var chunkWV4TD2HZ_cjs = require('../chunk-WV4TD2HZ.cjs');
|
|
22
|
-
require('../chunk-223D4727.cjs');
|
|
21
|
+
var chunkB3FMUFAW_cjs = require('../chunk-B3FMUFAW.cjs');
|
|
23
22
|
var chunk2WLXQGWC_cjs = require('../chunk-2WLXQGWC.cjs');
|
|
24
|
-
var
|
|
23
|
+
var chunk5FYU7ZIU_cjs = require('../chunk-5FYU7ZIU.cjs');
|
|
24
|
+
var chunkGC2FSPSQ_cjs = require('../chunk-GC2FSPSQ.cjs');
|
|
25
25
|
var chunkXAJIKT6Y_cjs = require('../chunk-XAJIKT6Y.cjs');
|
|
26
|
-
require('../chunk-D54JXTPG.cjs');
|
|
27
26
|
var chunkGOWXP5KT_cjs = require('../chunk-GOWXP5KT.cjs');
|
|
28
27
|
var chunkQZTNTP75_cjs = require('../chunk-QZTNTP75.cjs');
|
|
29
28
|
require('../chunk-PCB2BPN3.cjs');
|
|
30
29
|
require('../chunk-NWNVWO6L.cjs');
|
|
31
30
|
var chunkCROGFB46_cjs = require('../chunk-CROGFB46.cjs');
|
|
32
31
|
require('../chunk-7G2LJMUG.cjs');
|
|
32
|
+
require('../chunk-FAXXN7KI.cjs');
|
|
33
33
|
var chunkV46W7YLI_cjs = require('../chunk-V46W7YLI.cjs');
|
|
34
34
|
var chunkLJJJ6CYH_cjs = require('../chunk-LJJJ6CYH.cjs');
|
|
35
|
+
require('../chunk-D54JXTPG.cjs');
|
|
35
36
|
var chunkQT3A4PFC_cjs = require('../chunk-QT3A4PFC.cjs');
|
|
36
37
|
var chunk4RPBUMHB_cjs = require('../chunk-4RPBUMHB.cjs');
|
|
37
38
|
var chunkVPPX5XUF_cjs = require('../chunk-VPPX5XUF.cjs');
|
|
38
39
|
var chunkRC25WMVB_cjs = require('../chunk-RC25WMVB.cjs');
|
|
39
|
-
require('../chunk-
|
|
40
|
-
var chunkFEGXFABZ_cjs = require('../chunk-FEGXFABZ.cjs');
|
|
40
|
+
var chunkYF3QUHKN_cjs = require('../chunk-YF3QUHKN.cjs');
|
|
41
41
|
var chunkRFIBUWLF_cjs = require('../chunk-RFIBUWLF.cjs');
|
|
42
42
|
var chunkYBJ4QGNH_cjs = require('../chunk-YBJ4QGNH.cjs');
|
|
43
43
|
var chunkOALEDG67_cjs = require('../chunk-OALEDG67.cjs');
|
|
44
44
|
var chunk2VHYOTWW_cjs = require('../chunk-2VHYOTWW.cjs');
|
|
45
45
|
require('../chunk-ZW6FPIFC.cjs');
|
|
46
|
-
require('../chunk-AHDJXIUB.cjs');
|
|
47
46
|
require('../chunk-SIB6C7P7.cjs');
|
|
48
47
|
require('../chunk-DVUZTGVL.cjs');
|
|
48
|
+
require('../chunk-AHDJXIUB.cjs');
|
|
49
49
|
require('../chunk-3VULDTNL.cjs');
|
|
50
50
|
var chunkV4ISCZJ7_cjs = require('../chunk-V4ISCZJ7.cjs');
|
|
51
51
|
var chunk2EI7NCUA_cjs = require('../chunk-2EI7NCUA.cjs');
|
|
52
52
|
var chunkC2CWWEHO_cjs = require('../chunk-C2CWWEHO.cjs');
|
|
53
53
|
var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
|
|
54
54
|
require('../chunk-ADOKTJHV.cjs');
|
|
55
|
+
var chunkLLYZGH3L_cjs = require('../chunk-LLYZGH3L.cjs');
|
|
56
|
+
var chunkBIXHB4LV_cjs = require('../chunk-BIXHB4LV.cjs');
|
|
55
57
|
var chunkDWZXSPMB_cjs = require('../chunk-DWZXSPMB.cjs');
|
|
56
58
|
var chunk7RGLTF76_cjs = require('../chunk-7RGLTF76.cjs');
|
|
57
59
|
var chunk5A2QQAF5_cjs = require('../chunk-5A2QQAF5.cjs');
|
|
@@ -59,13 +61,11 @@ require('../chunk-B6MVQCXW.cjs');
|
|
|
59
61
|
var chunkJKB7WT7L_cjs = require('../chunk-JKB7WT7L.cjs');
|
|
60
62
|
var chunkJSTKEZBS_cjs = require('../chunk-JSTKEZBS.cjs');
|
|
61
63
|
require('../chunk-76L6LOP3.cjs');
|
|
62
|
-
require('../chunk-7UTB4PHM.cjs');
|
|
63
64
|
require('../chunk-32HW2Q33.cjs');
|
|
65
|
+
require('../chunk-7UTB4PHM.cjs');
|
|
64
66
|
var chunkFX3K6LNZ_cjs = require('../chunk-FX3K6LNZ.cjs');
|
|
65
67
|
require('../chunk-PPCATBOY.cjs');
|
|
66
68
|
require('../chunk-MHVNT4J3.cjs');
|
|
67
|
-
var chunkLLYZGH3L_cjs = require('../chunk-LLYZGH3L.cjs');
|
|
68
|
-
var chunkBIXHB4LV_cjs = require('../chunk-BIXHB4LV.cjs');
|
|
69
69
|
var chunkQ7CQYYZW_cjs = require('../chunk-Q7CQYYZW.cjs');
|
|
70
70
|
var chunkCNHUJRQ4_cjs = require('../chunk-CNHUJRQ4.cjs');
|
|
71
71
|
var chunkULWRNGGE_cjs = require('../chunk-ULWRNGGE.cjs');
|
|
@@ -164,7 +164,7 @@ function ConnectedWorkspaceActivity({
|
|
|
164
164
|
[feed.data]
|
|
165
165
|
);
|
|
166
166
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
167
|
-
|
|
167
|
+
chunkGC2FSPSQ_cjs.WorkspaceActivityList,
|
|
168
168
|
{
|
|
169
169
|
...listProps,
|
|
170
170
|
items,
|
|
@@ -842,7 +842,7 @@ function ConnectedWorkspaceNotificationMenu({
|
|
|
842
842
|
}, [error, notify14]);
|
|
843
843
|
if (!workspaceId) return null;
|
|
844
844
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
845
|
-
|
|
845
|
+
chunkGC2FSPSQ_cjs.WorkspaceNotificationMenu,
|
|
846
846
|
{
|
|
847
847
|
...menuProps,
|
|
848
848
|
level,
|
|
@@ -861,7 +861,7 @@ function ConnectedThreadFollow({
|
|
|
861
861
|
enabled: live
|
|
862
862
|
});
|
|
863
863
|
if (!conversationId) return null;
|
|
864
|
-
const Control = as === "menu-item" ?
|
|
864
|
+
const Control = as === "menu-item" ? chunkGC2FSPSQ_cjs.ThreadFollowMenuItem : chunkGC2FSPSQ_cjs.ThreadFollowButton;
|
|
865
865
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
866
866
|
Control,
|
|
867
867
|
{
|
|
@@ -934,7 +934,7 @@ function ConnectedSkillUpload({ onDone, labels, className }) {
|
|
|
934
934
|
onChange: (e) => {
|
|
935
935
|
const file = e.target.files?.[0];
|
|
936
936
|
e.target.value = "";
|
|
937
|
-
if (file) void add(() =>
|
|
937
|
+
if (file) void add(() => chunkYF3QUHKN_cjs.importSkillFile(file));
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
940
|
),
|
|
@@ -959,7 +959,7 @@ function ConnectedSkillUpload({ onDone, labels, className }) {
|
|
|
959
959
|
className: "space-y-2",
|
|
960
960
|
onSubmit: (e) => {
|
|
961
961
|
e.preventDefault();
|
|
962
|
-
if (url.trim()) void add(() =>
|
|
962
|
+
if (url.trim()) void add(() => chunkYF3QUHKN_cjs.importSkillFromUrl(url));
|
|
963
963
|
},
|
|
964
964
|
children: [
|
|
965
965
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { htmlFor: "skills-add-url", children: l.fromLink }),
|
|
@@ -1023,9 +1023,9 @@ function ConnectedSkillsLibrary({
|
|
|
1023
1023
|
const [type, setType] = react.useState("all");
|
|
1024
1024
|
const [view, setView] = react.useState("gallery");
|
|
1025
1025
|
const [isBusy, setIsBusy] = react.useState(false);
|
|
1026
|
-
const all = react.useMemo(() =>
|
|
1026
|
+
const all = react.useMemo(() => chunkYF3QUHKN_cjs.buildLibrarySkills(builtins, listings ?? []), [builtins, listings]);
|
|
1027
1027
|
const shown = react.useMemo(
|
|
1028
|
-
() =>
|
|
1028
|
+
() => chunkYF3QUHKN_cjs.filterLibrarySkills(all, { query, source, type }),
|
|
1029
1029
|
[all, query, source, type]
|
|
1030
1030
|
);
|
|
1031
1031
|
const current = all.find((s) => s.slug === selected) ?? null;
|
|
@@ -1036,21 +1036,21 @@ function ConnectedSkillsLibrary({
|
|
|
1036
1036
|
const count = (s) => all.filter((x) => x.source === s).length;
|
|
1037
1037
|
const sourceOptions = [
|
|
1038
1038
|
{ id: "all", label: "All", count: all.length },
|
|
1039
|
-
{ id: "builtin", label:
|
|
1040
|
-
{ id: "mine", label:
|
|
1041
|
-
{ id: "shared", label:
|
|
1039
|
+
{ id: "builtin", label: chunkYF3QUHKN_cjs.SKILL_SOURCE_LABELS.builtin, count: count("builtin") },
|
|
1040
|
+
{ id: "mine", label: chunkYF3QUHKN_cjs.SKILL_SOURCE_LABELS.mine, count: count("mine") },
|
|
1041
|
+
{ id: "shared", label: chunkYF3QUHKN_cjs.SKILL_SOURCE_LABELS.shared, count: count("shared") }
|
|
1042
1042
|
];
|
|
1043
1043
|
const types = [...new Set(all.map((s) => s.type))];
|
|
1044
1044
|
const typeOptions = [
|
|
1045
1045
|
{ id: "all", label: "Any kind" },
|
|
1046
|
-
...types.map((t) => ({ id: t, label:
|
|
1046
|
+
...types.map((t) => ({ id: t, label: chunkYF3QUHKN_cjs.SKILL_TYPE_LABELS[t] ?? t }))
|
|
1047
1047
|
];
|
|
1048
1048
|
const pick = (slug) => {
|
|
1049
1049
|
setSelected(slug);
|
|
1050
1050
|
setMode("detail");
|
|
1051
1051
|
};
|
|
1052
1052
|
const markdownOf = async (skill) => {
|
|
1053
|
-
if (!skill.docExtId) return
|
|
1053
|
+
if (!skill.docExtId) return chunkYF3QUHKN_cjs.workflowToSkillMarkdown(skill.workflow);
|
|
1054
1054
|
const response = await arbi.documents.download(skill.docExtId);
|
|
1055
1055
|
if (!response.ok) throw new Error(`Could not read the skill (${response.status})`);
|
|
1056
1056
|
return response.text();
|
|
@@ -1058,7 +1058,7 @@ function ConnectedSkillsLibrary({
|
|
|
1058
1058
|
const saveAs = (slug, markdown, shared = false) => upload.mutateAsync([
|
|
1059
1059
|
{
|
|
1060
1060
|
folder: `${SKILL_FOLDER}${slug}`,
|
|
1061
|
-
fileName:
|
|
1061
|
+
fileName: chunkYF3QUHKN_cjs.SKILL_MAIN_FILENAME,
|
|
1062
1062
|
content: new Blob([markdown], { type: "text/markdown" }),
|
|
1063
1063
|
shared
|
|
1064
1064
|
}
|
|
@@ -1121,7 +1121,7 @@ function ConnectedSkillsLibrary({
|
|
|
1121
1121
|
try {
|
|
1122
1122
|
documentTools.downloadBlob(
|
|
1123
1123
|
new Blob([await markdownOf(skill)], { type: "text/markdown" }),
|
|
1124
|
-
|
|
1124
|
+
chunkYF3QUHKN_cjs.SKILL_MAIN_FILENAME
|
|
1125
1125
|
);
|
|
1126
1126
|
} catch (error) {
|
|
1127
1127
|
notify14(errorText(error, "Could not export the skill"), "error");
|
|
@@ -1162,10 +1162,10 @@ function ConnectedSkillsLibrary({
|
|
|
1162
1162
|
}
|
|
1163
1163
|
)
|
|
1164
1164
|
] }),
|
|
1165
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1165
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkYF3QUHKN_cjs.SkillViewToggle, { value: view, onChange: setView })
|
|
1166
1166
|
] }),
|
|
1167
1167
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1168
|
-
|
|
1168
|
+
chunkYF3QUHKN_cjs.SkillFilterChips,
|
|
1169
1169
|
{
|
|
1170
1170
|
label: "Show",
|
|
1171
1171
|
value: source,
|
|
@@ -1174,7 +1174,7 @@ function ConnectedSkillsLibrary({
|
|
|
1174
1174
|
}
|
|
1175
1175
|
),
|
|
1176
1176
|
types.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1177
|
-
|
|
1177
|
+
chunkYF3QUHKN_cjs.SkillFilterChips,
|
|
1178
1178
|
{
|
|
1179
1179
|
label: "Kind",
|
|
1180
1180
|
value: type,
|
|
@@ -1221,12 +1221,12 @@ function ConnectedSkillsLibrary({
|
|
|
1221
1221
|
view === "gallery" ? "grid grid-cols-[repeat(auto-fill,minmax(9.5rem,1fr))]" : "flex flex-col"
|
|
1222
1222
|
),
|
|
1223
1223
|
children: shown.map((skill) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1224
|
-
|
|
1224
|
+
chunkYF3QUHKN_cjs.SkillTile,
|
|
1225
1225
|
{
|
|
1226
1226
|
name: skill.title,
|
|
1227
1227
|
testId: `skill-tile-${skill.slug}`,
|
|
1228
1228
|
description: skill.description,
|
|
1229
|
-
sourceLabel: skill.isShared ? `${
|
|
1229
|
+
sourceLabel: skill.isShared ? `${chunkYF3QUHKN_cjs.SKILL_SOURCE_LABELS.mine}, shared` : chunkYF3QUHKN_cjs.SKILL_SOURCE_LABELS[skill.source],
|
|
1230
1230
|
type: skill.type,
|
|
1231
1231
|
icon,
|
|
1232
1232
|
layout: view,
|
|
@@ -1261,7 +1261,7 @@ function ConnectedSkillsLibrary({
|
|
|
1261
1261
|
}
|
|
1262
1262
|
),
|
|
1263
1263
|
mode === "new" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1264
|
-
|
|
1264
|
+
chunkYF3QUHKN_cjs.SkillGenerateForm,
|
|
1265
1265
|
{
|
|
1266
1266
|
icon,
|
|
1267
1267
|
onGenerate: (desc) => {
|
|
@@ -1288,11 +1288,11 @@ function ConnectedSkillsLibrary({
|
|
|
1288
1288
|
),
|
|
1289
1289
|
mode === "add" && /* @__PURE__ */ jsxRuntime.jsx(ConnectedSkillUpload, { onDone: done }),
|
|
1290
1290
|
mode === "detail" && current && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1291
|
-
|
|
1291
|
+
chunkYF3QUHKN_cjs.SkillLibraryDetail,
|
|
1292
1292
|
{
|
|
1293
1293
|
skill: current,
|
|
1294
1294
|
icon,
|
|
1295
|
-
instructions: current.docExtId ? currentText ?
|
|
1295
|
+
instructions: current.docExtId ? currentText ? chunkYF3QUHKN_cjs.parseSkillFrontmatter(currentText, chunkYF3QUHKN_cjs.SKILL_MAIN_FILENAME).content : "" : current.workflow.run.kind === "prompt" ? current.workflow.run.promptTemplate : "",
|
|
1296
1296
|
isLoading: !!current.docExtId && textLoading,
|
|
1297
1297
|
actions: {
|
|
1298
1298
|
onRun: () => onRun(current.slug),
|
|
@@ -1327,7 +1327,7 @@ function SkillEditor({
|
|
|
1327
1327
|
const [seeded, setSeeded] = react.useState(!isEditing);
|
|
1328
1328
|
const [nameError, setNameError] = react.useState(null);
|
|
1329
1329
|
if (isEditing && !seeded && text !== void 0) {
|
|
1330
|
-
const parsed =
|
|
1330
|
+
const parsed = chunkYF3QUHKN_cjs.parseSkillFrontmatter(text, chunkYF3QUHKN_cjs.SKILL_MAIN_FILENAME);
|
|
1331
1331
|
setDescription(parsed.description ?? "");
|
|
1332
1332
|
setBody(parsed.content ?? "");
|
|
1333
1333
|
setSeeded(true);
|
|
@@ -1341,15 +1341,15 @@ function SkillEditor({
|
|
|
1341
1341
|
notify14("Add a short description.", "error");
|
|
1342
1342
|
return;
|
|
1343
1343
|
}
|
|
1344
|
-
const slug =
|
|
1344
|
+
const slug = chunkYF3QUHKN_cjs.skillSlug(name);
|
|
1345
1345
|
try {
|
|
1346
|
-
await onSave(slug,
|
|
1346
|
+
await onSave(slug, chunkYF3QUHKN_cjs.serializeSkill({ name: slug, description, body }), isEditing);
|
|
1347
1347
|
} catch (err) {
|
|
1348
1348
|
notify14(errorText(err, "Could not save the skill"), "error");
|
|
1349
1349
|
}
|
|
1350
1350
|
};
|
|
1351
1351
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1352
|
-
|
|
1352
|
+
chunkYF3QUHKN_cjs.SkillEditForm,
|
|
1353
1353
|
{
|
|
1354
1354
|
name,
|
|
1355
1355
|
onNameChange: setName,
|
|
@@ -1385,9 +1385,9 @@ function ConnectedAgentCreator({
|
|
|
1385
1385
|
agent,
|
|
1386
1386
|
initialName,
|
|
1387
1387
|
onSaved,
|
|
1388
|
-
capabilities =
|
|
1389
|
-
templates =
|
|
1390
|
-
types =
|
|
1388
|
+
capabilities = chunkYF3QUHKN_cjs.DEFAULT_AGENT_CAPABILITIES,
|
|
1389
|
+
templates = chunkYF3QUHKN_cjs.DEFAULT_AGENT_TEMPLATES,
|
|
1390
|
+
types = chunkYF3QUHKN_cjs.DEFAULT_AGENT_TYPES,
|
|
1391
1391
|
canRevokeWorkspaces = false,
|
|
1392
1392
|
labels
|
|
1393
1393
|
}) {
|
|
@@ -1429,7 +1429,7 @@ function ConnectedAgentCreator({
|
|
|
1429
1429
|
const initialValues = react.useMemo(
|
|
1430
1430
|
() => ({
|
|
1431
1431
|
name: agent?.given_name ?? initialName ?? "",
|
|
1432
|
-
persona: isEdit ?
|
|
1432
|
+
persona: isEdit ? chunkYF3QUHKN_cjs.stripPersonaPreamble(String(agents.PERSONA ?? "")) : "",
|
|
1433
1433
|
modelName: String(agents.AGENT_MODEL_NAME ?? ""),
|
|
1434
1434
|
capabilities: Object.fromEntries(capabilities.map(({ key }) => [key, Boolean(agents[key])])),
|
|
1435
1435
|
type: "builtin",
|
|
@@ -1448,7 +1448,7 @@ function ConnectedAgentCreator({
|
|
|
1448
1448
|
try {
|
|
1449
1449
|
let agentExtId = agent?.external_id ?? early?.id ?? "";
|
|
1450
1450
|
if (!agentExtId) {
|
|
1451
|
-
if (!
|
|
1451
|
+
if (!chunkYF3QUHKN_cjs.isValidAgentName(values.name)) {
|
|
1452
1452
|
notify14("Give the agent a name first.", "error");
|
|
1453
1453
|
return;
|
|
1454
1454
|
}
|
|
@@ -1484,7 +1484,7 @@ function ConnectedAgentCreator({
|
|
|
1484
1484
|
title: `agent-${name}`,
|
|
1485
1485
|
sections: {
|
|
1486
1486
|
Agents: {
|
|
1487
|
-
PERSONA:
|
|
1487
|
+
PERSONA: chunkYF3QUHKN_cjs.composePersona(name, values.persona),
|
|
1488
1488
|
...values.modelName ? { AGENT_MODEL_NAME: values.modelName } : {},
|
|
1489
1489
|
...Object.fromEntries(capabilities.map(({ key }) => [key, !!values.capabilities[key]])),
|
|
1490
1490
|
ENABLED_SKILLS: values.capabilities.SKILLS_ENABLED && skills.length ? skills : null,
|
|
@@ -1507,7 +1507,7 @@ function ConnectedAgentCreator({
|
|
|
1507
1507
|
};
|
|
1508
1508
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1509
1509
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1510
|
-
|
|
1510
|
+
chunkYF3QUHKN_cjs.AgentCreator,
|
|
1511
1511
|
{
|
|
1512
1512
|
open: ready,
|
|
1513
1513
|
onOpenChange,
|
|
@@ -1523,11 +1523,11 @@ function ConnectedAgentCreator({
|
|
|
1523
1523
|
) : void 0,
|
|
1524
1524
|
revokingWorkspaceId: revokeAccess.isPending ? revokeAccess.variables?.workspaceId : void 0,
|
|
1525
1525
|
avatar: (values) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1526
|
-
|
|
1526
|
+
chunkYF3QUHKN_cjs.AgentAvatarField,
|
|
1527
1527
|
{
|
|
1528
1528
|
picture,
|
|
1529
1529
|
isBusy: avatarBusy,
|
|
1530
|
-
canGenerate: isEdit ||
|
|
1530
|
+
canGenerate: isEdit || chunkYF3QUHKN_cjs.isValidAgentName(values.name),
|
|
1531
1531
|
onGenerate: () => handleGenerateAvatar(values)
|
|
1532
1532
|
}
|
|
1533
1533
|
),
|
|
@@ -1579,7 +1579,7 @@ function ConnectedAgentCreator({
|
|
|
1579
1579
|
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogTitle, { children: "Connect your agent" }),
|
|
1580
1580
|
/* @__PURE__ */ jsxRuntime.jsx(ui.DialogDescription, { children: "This key is shown once. Run the script on the machine that will host the agent." })
|
|
1581
1581
|
] }),
|
|
1582
|
-
connect && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1582
|
+
connect && /* @__PURE__ */ jsxRuntime.jsx(chunkYF3QUHKN_cjs.AgentConnectInstructions, { email: connect.email, signingKey: connect.signingKey })
|
|
1583
1583
|
]
|
|
1584
1584
|
}
|
|
1585
1585
|
) })
|
|
@@ -1616,7 +1616,7 @@ function ConnectedWorkflowHistory({
|
|
|
1616
1616
|
const { openConversation } = chunkCNHUJRQ4_cjs.useBlocksEnvironment();
|
|
1617
1617
|
const { data: runs = [], isLoading } = react$1.useWorkflowRuns(workflow?.external_id);
|
|
1618
1618
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1619
|
-
|
|
1619
|
+
chunkYF3QUHKN_cjs.TaskRunsDialog,
|
|
1620
1620
|
{
|
|
1621
1621
|
inline,
|
|
1622
1622
|
hideHeader,
|
|
@@ -1668,7 +1668,7 @@ function ConnectedTaskActivityDialog({
|
|
|
1668
1668
|
[agents]
|
|
1669
1669
|
);
|
|
1670
1670
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1671
|
-
|
|
1671
|
+
chunkYF3QUHKN_cjs.TaskActivityDialog,
|
|
1672
1672
|
{
|
|
1673
1673
|
open: true,
|
|
1674
1674
|
onOpenChange: (open) => !open && onClose(),
|
|
@@ -1814,7 +1814,7 @@ function useWorkflowThread(workflow, options2 = {}) {
|
|
|
1814
1814
|
);
|
|
1815
1815
|
const conversation = conversations.data?.find((c) => c.external_id === threadId);
|
|
1816
1816
|
const steps = react.useMemo(
|
|
1817
|
-
() => chunkJSTKEZBS_cjs.workflowSteps(workflow).length > 0 ? chunkJSTKEZBS_cjs.workflowSteps(workflow) :
|
|
1817
|
+
() => chunkJSTKEZBS_cjs.workflowSteps(workflow).length > 0 ? chunkJSTKEZBS_cjs.workflowSteps(workflow) : chunkYF3QUHKN_cjs.fromPlanSteps(conversation?.plan?.steps ?? []),
|
|
1818
1818
|
[workflow, conversation?.plan?.steps]
|
|
1819
1819
|
);
|
|
1820
1820
|
const activity = react$1.useConversationActivity(threadId, { live: !!threadId });
|
|
@@ -1874,7 +1874,7 @@ function useWorkflowThread(workflow, options2 = {}) {
|
|
|
1874
1874
|
criteria: [],
|
|
1875
1875
|
max_passes: 3,
|
|
1876
1876
|
documents: [],
|
|
1877
|
-
steps:
|
|
1877
|
+
steps: chunkYF3QUHKN_cjs.toPlanSteps(workflow, {
|
|
1878
1878
|
inputs: values,
|
|
1879
1879
|
resolveWorkflow: options2.resolveWorkflow,
|
|
1880
1880
|
compose: options2.compose
|
|
@@ -1961,7 +1961,7 @@ function useWorkflowThread(workflow, options2 = {}) {
|
|
|
1961
1961
|
const anyRunning = Object.values(states).some((s) => s.status === "running");
|
|
1962
1962
|
const needsStart = !threadId || idle && !anyRunning;
|
|
1963
1963
|
const runError = idle ? conversation?.last_error ?? null : null;
|
|
1964
|
-
const view =
|
|
1964
|
+
const view = chunkYF3QUHKN_cjs.useWorkflowView({
|
|
1965
1965
|
steps,
|
|
1966
1966
|
states,
|
|
1967
1967
|
inputs,
|
|
@@ -2438,7 +2438,7 @@ function ConnectedWorkflowRunner({
|
|
|
2438
2438
|
);
|
|
2439
2439
|
};
|
|
2440
2440
|
const runner = (compact) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2441
|
-
|
|
2441
|
+
chunkYF3QUHKN_cjs.WorkflowRunner,
|
|
2442
2442
|
{
|
|
2443
2443
|
people,
|
|
2444
2444
|
...runnerProps,
|
|
@@ -2484,7 +2484,7 @@ function ConnectedWorkflowRunner({
|
|
|
2484
2484
|
) }),
|
|
2485
2485
|
inThread && conversationId ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2486
2486
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2487
|
-
|
|
2487
|
+
chunkYF3QUHKN_cjs.WorkflowStepBar,
|
|
2488
2488
|
{
|
|
2489
2489
|
run: view,
|
|
2490
2490
|
levels: chunkJSTKEZBS_cjs.stepLevels(view.steps),
|
|
@@ -2775,7 +2775,7 @@ function ConnectedTagTable({
|
|
|
2775
2775
|
const fail = (fallback) => (e) => notify14(browser.refusalReason(e, fallback), "error");
|
|
2776
2776
|
const snapshot2 = (data) => {
|
|
2777
2777
|
const title = exportTitle ?? ui.tagKindTitle(kind, { plural: true });
|
|
2778
|
-
const bytes =
|
|
2778
|
+
const bytes = chunkGC2FSPSQ_cjs.tagTableDocx(data, {
|
|
2779
2779
|
title,
|
|
2780
2780
|
nameOf: (id) => people.find((p) => p.value === id)?.label
|
|
2781
2781
|
});
|
|
@@ -2784,7 +2784,7 @@ function ConnectedTagTable({
|
|
|
2784
2784
|
return { blob: new Blob([bytes], { type: chunkQT3A4PFC_cjs.DOCX_MIME_TYPE }), name };
|
|
2785
2785
|
};
|
|
2786
2786
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2787
|
-
|
|
2787
|
+
chunkGC2FSPSQ_cjs.TagTable,
|
|
2788
2788
|
{
|
|
2789
2789
|
...props,
|
|
2790
2790
|
table,
|
|
@@ -2825,7 +2825,7 @@ function DocTagPassages({ docId, tagId, label, docOf, testId }) {
|
|
|
2825
2825
|
const [open, setOpen] = react.useState(false);
|
|
2826
2826
|
const doctag = docOf(docId)?.doctags?.find((dt) => dt.tag_ext_id === tagId);
|
|
2827
2827
|
const citations = react.useMemo(
|
|
2828
|
-
() =>
|
|
2828
|
+
() => chunkB3FMUFAW_cjs.toFactCitations(doctag?.citations) ?? [],
|
|
2829
2829
|
[doctag?.citations]
|
|
2830
2830
|
);
|
|
2831
2831
|
const { quoteFor, orderOf } = react$1.usePassageQuotes(
|
|
@@ -2834,7 +2834,7 @@ function DocTagPassages({ docId, tagId, label, docOf, testId }) {
|
|
|
2834
2834
|
const { openDocument } = chunkCNHUJRQ4_cjs.useBlocksEnvironment();
|
|
2835
2835
|
const viewingPassageId = react$1.useArbiSessionState((s) => s.viewingDocument?.passageId ?? null);
|
|
2836
2836
|
const id = testId ?? `doctag-passages-${docId}`;
|
|
2837
|
-
const refOf = (cited) =>
|
|
2837
|
+
const refOf = (cited) => chunkB3FMUFAW_cjs.citedVersionRef(cited.doc_ext_id, cited.version, docOf(cited.doc_ext_id)?.current_version);
|
|
2838
2838
|
const ordered = (cited) => [...cited.chunks].sort((a, b) => {
|
|
2839
2839
|
const oa = orderOf(a.chunk_id);
|
|
2840
2840
|
const ob = orderOf(b.chunk_id);
|
|
@@ -2865,7 +2865,7 @@ function DocTagPassages({ docId, tagId, label, docOf, testId }) {
|
|
|
2865
2865
|
const doc = docOf(cited.doc_ext_id);
|
|
2866
2866
|
const passages = ordered(cited);
|
|
2867
2867
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2868
|
-
|
|
2868
|
+
chunkB3FMUFAW_cjs.FactSourceGroup,
|
|
2869
2869
|
{
|
|
2870
2870
|
docId: cited.doc_ext_id,
|
|
2871
2871
|
hasPassages: passages.length > 0,
|
|
@@ -2922,9 +2922,9 @@ function GlossaryExport({ labelId, nameOf }) {
|
|
|
2922
2922
|
const narrowed = agreements.find((a) => a.id === narrowTo);
|
|
2923
2923
|
const title = narrowed ? `Glossary - ${narrowed.name}` : "Glossary";
|
|
2924
2924
|
const download = (format) => {
|
|
2925
|
-
const entries =
|
|
2926
|
-
const blob = format === "docx" ? new Blob([
|
|
2927
|
-
documentTools.downloadBlob(blob,
|
|
2925
|
+
const entries = chunkGC2FSPSQ_cjs.glossaryEntries(sources, { labelId: narrowed?.id });
|
|
2926
|
+
const blob = format === "docx" ? new Blob([chunkGC2FSPSQ_cjs.glossaryDocx(entries, { title })], { type: chunkQT3A4PFC_cjs.DOCX_MIME_TYPE }) : new Blob([chunkGC2FSPSQ_cjs.glossaryMarkdown(entries, { title })], { type: "text/markdown" });
|
|
2927
|
+
documentTools.downloadBlob(blob, chunkGC2FSPSQ_cjs.glossaryFileName(title, format));
|
|
2928
2928
|
};
|
|
2929
2929
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", "data-testid": "tags-glossary", children: [
|
|
2930
2930
|
agreements.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3143,7 +3143,7 @@ function KindSection({
|
|
|
3143
3143
|
{
|
|
3144
3144
|
testId: `tags-kind-${kind}`,
|
|
3145
3145
|
title: ui.tagKindTitle(kind, { plural: true }),
|
|
3146
|
-
description:
|
|
3146
|
+
description: chunkGC2FSPSQ_cjs.tagKindDescription(kind),
|
|
3147
3147
|
actions: picker,
|
|
3148
3148
|
children: [
|
|
3149
3149
|
browser.isEntityTag({ kind }) && extractingCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3154,9 +3154,9 @@ function KindSection({
|
|
|
3154
3154
|
children: [
|
|
3155
3155
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "size-4 animate-spin" }),
|
|
3156
3156
|
"Extracting ",
|
|
3157
|
-
|
|
3157
|
+
chunkGC2FSPSQ_cjs.entitiesPhrase().toLowerCase(),
|
|
3158
3158
|
" from ",
|
|
3159
|
-
|
|
3159
|
+
chunkGC2FSPSQ_cjs.documentCount(extractingCount),
|
|
3160
3160
|
"\u2026"
|
|
3161
3161
|
]
|
|
3162
3162
|
}
|
|
@@ -3174,7 +3174,7 @@ function KindSection({
|
|
|
3174
3174
|
onOpenDocument: (id) => openDocument(id),
|
|
3175
3175
|
onOpenFact: ctx.onOpenFact,
|
|
3176
3176
|
onOpenThread: (id) => openConversation(id),
|
|
3177
|
-
labels:
|
|
3177
|
+
labels: chunkGC2FSPSQ_cjs.tagTableLabels(kind),
|
|
3178
3178
|
testId: `tags-table-${kind}`
|
|
3179
3179
|
}
|
|
3180
3180
|
)
|
|
@@ -3276,12 +3276,12 @@ function TagSection({
|
|
|
3276
3276
|
onOpenDocument: (id) => openDocument(id),
|
|
3277
3277
|
onOpenFact: ctx.onOpenFact,
|
|
3278
3278
|
onOpenThread: (id) => openConversation(id),
|
|
3279
|
-
labels:
|
|
3279
|
+
labels: chunkGC2FSPSQ_cjs.tagTableLabels(tag.kind),
|
|
3280
3280
|
testId: "tags-rows"
|
|
3281
3281
|
}
|
|
3282
3282
|
),
|
|
3283
3283
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3284
|
-
|
|
3284
|
+
chunkGC2FSPSQ_cjs.TagDetail,
|
|
3285
3285
|
{
|
|
3286
3286
|
row: detailRow && narrowTagRow(detailRow, ctx.filter.matches),
|
|
3287
3287
|
fields: schema.data?.fields ?? [],
|
|
@@ -3293,10 +3293,10 @@ function TagSection({
|
|
|
3293
3293
|
onOpenDocument: (id) => openDocument(id),
|
|
3294
3294
|
onOpenFact: ctx.onOpenFact,
|
|
3295
3295
|
onOpenThread: (id) => openConversation(id),
|
|
3296
|
-
noteLabel:
|
|
3296
|
+
noteLabel: chunkGC2FSPSQ_cjs.tagNoteLabel(tag.kind),
|
|
3297
3297
|
noteIsValue: tag.kind === "annotation",
|
|
3298
3298
|
renderPassages: (d, label) => renderPassages(d.doc_ext_id, label),
|
|
3299
|
-
labels:
|
|
3299
|
+
labels: chunkGC2FSPSQ_cjs.tagDetailLabels(),
|
|
3300
3300
|
testId: "tags-detail"
|
|
3301
3301
|
}
|
|
3302
3302
|
)
|
|
@@ -3385,7 +3385,7 @@ function ConnectedTagsPage({
|
|
|
3385
3385
|
const onDelete = async (t) => {
|
|
3386
3386
|
const nested = browser.getChildTags([...tags], t.external_id);
|
|
3387
3387
|
const uses = browser.tagUseCount(t);
|
|
3388
|
-
const n2 =
|
|
3388
|
+
const n2 = chunkGC2FSPSQ_cjs.tagsPageNouns();
|
|
3389
3389
|
const tagNoun = (count) => (count === 1 ? n2.tag : n2.tags).toLowerCase();
|
|
3390
3390
|
const carriers = uses === 1 ? `${n2.document}, ${n2.fact} or ${n2.thread}` : `${n2.documents}, ${n2.facts} and ${n2.threads}`;
|
|
3391
3391
|
const message = `Delete ${ui.tagKindNouns(t.kind).singular} "${t.name}"?` + (uses > 0 ? `
|
|
@@ -3406,16 +3406,16 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
|
|
|
3406
3406
|
try {
|
|
3407
3407
|
await extract.mutateAsync(docIds);
|
|
3408
3408
|
notify14(
|
|
3409
|
-
`Extracting ${
|
|
3409
|
+
`Extracting ${chunkGC2FSPSQ_cjs.entitiesPhrase().toLowerCase()} from ${chunkGC2FSPSQ_cjs.documentCount(docIds.length)}. You will be notified when it is done.`,
|
|
3410
3410
|
"info"
|
|
3411
3411
|
);
|
|
3412
3412
|
} catch (error) {
|
|
3413
|
-
notify14(browser.refusalReason(error, `Could not extract ${
|
|
3413
|
+
notify14(browser.refusalReason(error, `Could not extract ${chunkGC2FSPSQ_cjs.entitiesPhrase().toLowerCase()}`), "error");
|
|
3414
3414
|
throw error;
|
|
3415
3415
|
}
|
|
3416
3416
|
};
|
|
3417
3417
|
const picker = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3418
|
-
|
|
3418
|
+
chunkGC2FSPSQ_cjs.TagPicker,
|
|
3419
3419
|
{
|
|
3420
3420
|
tags: viewTags,
|
|
3421
3421
|
selectedId: tag?.external_id,
|
|
@@ -3429,10 +3429,10 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
|
|
|
3429
3429
|
onOpenTag: openTag,
|
|
3430
3430
|
onOpenFact
|
|
3431
3431
|
};
|
|
3432
|
-
const n =
|
|
3432
|
+
const n = chunkGC2FSPSQ_cjs.tagsPageNouns();
|
|
3433
3433
|
const action = view === "person" || view === "organisation" ? {
|
|
3434
3434
|
label: "Extract",
|
|
3435
|
-
title: `Extract ${
|
|
3435
|
+
title: `Extract ${chunkGC2FSPSQ_cjs.entitiesPhrase().toLowerCase()} from ${n.documents.toLowerCase()}`,
|
|
3436
3436
|
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { className: "h-4 w-4" }),
|
|
3437
3437
|
run: () => setExtracting(true),
|
|
3438
3438
|
testId: "tags-extract-entities"
|
|
@@ -3472,7 +3472,7 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
|
|
|
3472
3472
|
onTabChange: () => {
|
|
3473
3473
|
},
|
|
3474
3474
|
variant: "underline",
|
|
3475
|
-
firstTabContent: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3475
|
+
firstTabContent: /* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.FilesFilterBar, { className: "flex-none", "data-testid": "tags-header-actions", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3476
3476
|
chunk2EI7NCUA_cjs.FilterInput,
|
|
3477
3477
|
{
|
|
3478
3478
|
value: filterText,
|
|
@@ -3500,7 +3500,7 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
|
|
|
3500
3500
|
)
|
|
3501
3501
|
}
|
|
3502
3502
|
) }),
|
|
3503
|
-
centerContent: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3503
|
+
centerContent: /* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.FilesViewCenter, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3504
3504
|
chunk2WLXQGWC_cjs.ViewToggle,
|
|
3505
3505
|
{
|
|
3506
3506
|
options: browser.TAG_KINDS.map((k) => ({
|
|
@@ -3579,7 +3579,7 @@ ${nested.length} nested ${tagNoun(nested.length)} ${nested.length === 1 ? "moves
|
|
|
3579
3579
|
onCreated: openTag
|
|
3580
3580
|
}),
|
|
3581
3581
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3582
|
-
|
|
3582
|
+
chunkGC2FSPSQ_cjs.ExtractEntitiesDialog,
|
|
3583
3583
|
{
|
|
3584
3584
|
open: extracting,
|
|
3585
3585
|
onOpenChange: setExtracting,
|
|
@@ -3640,7 +3640,7 @@ function FactSourcesPopover({
|
|
|
3640
3640
|
reset();
|
|
3641
3641
|
}
|
|
3642
3642
|
};
|
|
3643
|
-
const refOf = (docId) =>
|
|
3643
|
+
const refOf = (docId) => chunkB3FMUFAW_cjs.citedVersionRef(
|
|
3644
3644
|
docId,
|
|
3645
3645
|
citations.find((d) => d.doc_ext_id === docId)?.version,
|
|
3646
3646
|
citedDocs?.[docId]?.current_version
|
|
@@ -3670,7 +3670,7 @@ function FactSourcesPopover({
|
|
|
3670
3670
|
const olderVersion = refOf(docId) !== docId ? refOf(docId).split("@v")[1] : null;
|
|
3671
3671
|
const cited = passagesOf(docId);
|
|
3672
3672
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3673
|
-
|
|
3673
|
+
chunkB3FMUFAW_cjs.FactSourceGroup,
|
|
3674
3674
|
{
|
|
3675
3675
|
docId,
|
|
3676
3676
|
isViewing,
|
|
@@ -3739,8 +3739,8 @@ function FactMarkdownEditor({
|
|
|
3739
3739
|
citationContainer,
|
|
3740
3740
|
"data-testid": dataTestId
|
|
3741
3741
|
}) {
|
|
3742
|
-
const sources = react.useMemo(() =>
|
|
3743
|
-
const docIds =
|
|
3742
|
+
const sources = react.useMemo(() => chunkB3FMUFAW_cjs.toFactCitations(citations) ?? [], [citations]);
|
|
3743
|
+
const docIds = chunkB3FMUFAW_cjs.docIdsOf(sources);
|
|
3744
3744
|
const hasSources = docIds.length > 0;
|
|
3745
3745
|
const { quoteFor, orderOf } = react$1.usePassageQuotes(
|
|
3746
3746
|
react.useMemo(() => sources.filter((d) => d.chunks.length > 0).map((d) => d.doc_ext_id), [sources])
|
|
@@ -3759,7 +3759,7 @@ function FactMarkdownEditor({
|
|
|
3759
3759
|
const editorRef = react.useRef(null);
|
|
3760
3760
|
react.useEffect(() => {
|
|
3761
3761
|
if (!editorRef.current) return;
|
|
3762
|
-
return
|
|
3762
|
+
return chunkB3FMUFAW_cjs.enableFactTableColumnResize(editorRef.current);
|
|
3763
3763
|
}, []);
|
|
3764
3764
|
react.useEffect(() => {
|
|
3765
3765
|
if (!editing) return;
|
|
@@ -3774,14 +3774,14 @@ function FactMarkdownEditor({
|
|
|
3774
3774
|
return () => document.removeEventListener("pointerdown", onPointerDown, true);
|
|
3775
3775
|
}, [editing]);
|
|
3776
3776
|
const removeDoc = (docExtId) => {
|
|
3777
|
-
const remaining =
|
|
3777
|
+
const remaining = chunkB3FMUFAW_cjs.withoutDoc(sources, docExtId);
|
|
3778
3778
|
if (!remaining) setSourcesOpen(false);
|
|
3779
3779
|
onChange(value, remaining);
|
|
3780
3780
|
};
|
|
3781
3781
|
const citeDocument = (docExtId) => onCiteDocument(docExtId, { toggle: false });
|
|
3782
3782
|
const handleToggleDoc = (docExtId) => {
|
|
3783
3783
|
if (docIds.includes(docExtId)) removeDoc(docExtId);
|
|
3784
|
-
else onChange(value,
|
|
3784
|
+
else onChange(value, chunkB3FMUFAW_cjs.withDoc(sources, docExtId));
|
|
3785
3785
|
};
|
|
3786
3786
|
const expandToggle = /* @__PURE__ */ jsxRuntime.jsx(
|
|
3787
3787
|
"button",
|
|
@@ -4000,7 +4000,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
|
|
|
4000
4000
|
const [composing, setComposing] = react.useState(false);
|
|
4001
4001
|
const [draft, setDraft] = react.useState("");
|
|
4002
4002
|
const [baselineText, setBaselineText] = react.useState("");
|
|
4003
|
-
const [draftDateFields, setDraftDateFields] = react.useState(
|
|
4003
|
+
const [draftDateFields, setDraftDateFields] = react.useState(chunkB3FMUFAW_cjs.EMPTY_FACT_DATE_FIELDS);
|
|
4004
4004
|
const [composerError, setComposerError] = react.useState(null);
|
|
4005
4005
|
const [editingId, setEditingId] = react.useState(null);
|
|
4006
4006
|
const [draftShared, setDraftShared] = react.useState(false);
|
|
@@ -4057,9 +4057,9 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
|
|
|
4057
4057
|
if (!collector || !picked?.length || !collectingFor || !docBeingCollected) return;
|
|
4058
4058
|
const docExtId = docBeingCollected;
|
|
4059
4059
|
const apply = (prev) => {
|
|
4060
|
-
let next =
|
|
4060
|
+
let next = chunkB3FMUFAW_cjs.toFactCitations(prev);
|
|
4061
4061
|
for (const pending of picked) {
|
|
4062
|
-
next =
|
|
4062
|
+
next = chunkB3FMUFAW_cjs.withChunk(next, docExtId, { chunk_id: pending.chunk_id, page: pending.page ?? null });
|
|
4063
4063
|
}
|
|
4064
4064
|
return next ?? [];
|
|
4065
4065
|
};
|
|
@@ -4070,8 +4070,8 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
|
|
|
4070
4070
|
react.useEffect(() => {
|
|
4071
4071
|
if (!collector || !unpicked?.length || !collectingFor) return;
|
|
4072
4072
|
setDraftCitations((prev) => {
|
|
4073
|
-
let next =
|
|
4074
|
-
for (const chunkId of unpicked) next =
|
|
4073
|
+
let next = chunkB3FMUFAW_cjs.toFactCitations(prev);
|
|
4074
|
+
for (const chunkId of unpicked) next = chunkB3FMUFAW_cjs.withoutChunk(next, chunkId);
|
|
4075
4075
|
return next;
|
|
4076
4076
|
});
|
|
4077
4077
|
collector.consumeUnpicked();
|
|
@@ -4081,7 +4081,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
|
|
|
4081
4081
|
setBaselineText("");
|
|
4082
4082
|
setDraftCitations(null);
|
|
4083
4083
|
setDraftTagIds([]);
|
|
4084
|
-
setDraftDateFields(
|
|
4084
|
+
setDraftDateFields(chunkB3FMUFAW_cjs.EMPTY_FACT_DATE_FIELDS);
|
|
4085
4085
|
setDraftShared(false);
|
|
4086
4086
|
setDraftConfirmed(true);
|
|
4087
4087
|
setComposerError(null);
|
|
@@ -4095,7 +4095,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
|
|
|
4095
4095
|
setBaselineText("");
|
|
4096
4096
|
setDraftCitations(null);
|
|
4097
4097
|
setDraftTagIds([]);
|
|
4098
|
-
setDraftDateFields(
|
|
4098
|
+
setDraftDateFields(chunkB3FMUFAW_cjs.EMPTY_FACT_DATE_FIELDS);
|
|
4099
4099
|
setDraftShared(false);
|
|
4100
4100
|
setDraftConfirmed(true);
|
|
4101
4101
|
setComposerError(null);
|
|
@@ -4106,7 +4106,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
|
|
|
4106
4106
|
const content = chunkRC25WMVB_cjs.decodeWhitespaceEntities(draft).trim();
|
|
4107
4107
|
if (!content) return;
|
|
4108
4108
|
setComposerError(null);
|
|
4109
|
-
const span =
|
|
4109
|
+
const span = chunkB3FMUFAW_cjs.factDateFieldsToSpan(draftDateFields);
|
|
4110
4110
|
try {
|
|
4111
4111
|
let saved;
|
|
4112
4112
|
if (editingId) {
|
|
@@ -4144,7 +4144,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
|
|
|
4144
4144
|
setBaselineText(draft);
|
|
4145
4145
|
setDraftCitations(saved.citations ?? null);
|
|
4146
4146
|
setDraftTagIds(saved.tags.map((t) => t.tag_ext_id));
|
|
4147
|
-
setDraftDateFields(
|
|
4147
|
+
setDraftDateFields(chunkB3FMUFAW_cjs.factDateSpanToFields(saved.date_start, saved.date_end, saved.timezone));
|
|
4148
4148
|
setDraftShared(saved.shared ?? false);
|
|
4149
4149
|
setDraftConfirmed(saved.confirmed ?? true);
|
|
4150
4150
|
}
|
|
@@ -4169,7 +4169,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
|
|
|
4169
4169
|
setBaselineText(m.text);
|
|
4170
4170
|
setDraftCitations(m.citations ?? null);
|
|
4171
4171
|
setDraftTagIds(m.tags.map((t) => t.tag_ext_id));
|
|
4172
|
-
setDraftDateFields(
|
|
4172
|
+
setDraftDateFields(chunkB3FMUFAW_cjs.factDateSpanToFields(m.date_start, m.date_end, m.timezone));
|
|
4173
4173
|
setDraftShared(m.shared ?? false);
|
|
4174
4174
|
setDraftConfirmed(m.confirmed ?? true);
|
|
4175
4175
|
setComposerError(null);
|
|
@@ -4183,7 +4183,7 @@ function useFactComposer(notes, remove, gridApiRef, collector, composeRequested,
|
|
|
4183
4183
|
const textChanged = draft.trim() !== baselineText.trim();
|
|
4184
4184
|
const citationsChanged = JSON.stringify(draftCitations ?? null) !== JSON.stringify(f.citations ?? null);
|
|
4185
4185
|
const tagsChanged = JSON.stringify([...draftTagIds].sort()) !== JSON.stringify(f.tags.map((t) => t.tag_ext_id).sort());
|
|
4186
|
-
const dateChanged = JSON.stringify(draftDateFields) !== JSON.stringify(
|
|
4186
|
+
const dateChanged = JSON.stringify(draftDateFields) !== JSON.stringify(chunkB3FMUFAW_cjs.factDateSpanToFields(f.date_start, f.date_end, f.timezone));
|
|
4187
4187
|
const sharedChanged = draftShared !== (f.shared ?? false);
|
|
4188
4188
|
const confirmedChanged = draftConfirmed !== (f.confirmed ?? true);
|
|
4189
4189
|
return textChanged || citationsChanged || tagsChanged || dateChanged || sharedChanged || confirmedChanged;
|
|
@@ -4357,8 +4357,8 @@ function useFactFilters(notes, view, chat) {
|
|
|
4357
4357
|
const makeTagPicker = react.useCallback(
|
|
4358
4358
|
(selected, setSelected, opts) => {
|
|
4359
4359
|
const applied = new Set(selected);
|
|
4360
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4361
|
-
|
|
4360
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkB3FMUFAW_cjs.FactFieldRow, { label: "Labels", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4361
|
+
chunkQJFJ5JBF_cjs.FieldLabelsSelect,
|
|
4362
4362
|
{
|
|
4363
4363
|
options: labelOptions,
|
|
4364
4364
|
appliedIds: applied,
|
|
@@ -4548,14 +4548,14 @@ function useFactSelection(notes, gridApiRef, setFactTags, chat) {
|
|
|
4548
4548
|
}
|
|
4549
4549
|
function renderSourcesCell(params) {
|
|
4550
4550
|
const fact = params.data;
|
|
4551
|
-
const count =
|
|
4551
|
+
const count = chunkB3FMUFAW_cjs.sourceDocCount(fact);
|
|
4552
4552
|
if (!fact || count === 0) return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/40", children: "\u2014" });
|
|
4553
4553
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4554
4554
|
"button",
|
|
4555
4555
|
{
|
|
4556
4556
|
type: "button",
|
|
4557
4557
|
onClick: () => params.context?.openEdit?.(fact),
|
|
4558
|
-
title:
|
|
4558
|
+
title: chunkB3FMUFAW_cjs.DEFAULT_FACT_COLUMN_LABELS.sourcedFrom(count),
|
|
4559
4559
|
"data-testid": `facts-grid-sources-${fact.external_id}`,
|
|
4560
4560
|
className: "inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",
|
|
4561
4561
|
children: [
|
|
@@ -4584,7 +4584,7 @@ var FactHeader = react.memo(function FactHeader2({
|
|
|
4584
4584
|
if (params.enableSorting) params.progressSort(e.shiftKey);
|
|
4585
4585
|
},
|
|
4586
4586
|
children: [
|
|
4587
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4587
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.FilterButton, { params, colId }),
|
|
4588
4588
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "order-2 min-w-0 flex-1 truncate", children: params.displayName }),
|
|
4589
4589
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "ag-sort-indicator-container order-2 flex-shrink-0", "aria-hidden": "true", children: [
|
|
4590
4590
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4612,14 +4612,14 @@ function createFactPageColumns({
|
|
|
4612
4612
|
onToggleConfirmed,
|
|
4613
4613
|
onToggleShared
|
|
4614
4614
|
}) {
|
|
4615
|
-
const columns =
|
|
4615
|
+
const columns = chunkB3FMUFAW_cjs.createFactColumns({
|
|
4616
4616
|
onToggleInChat,
|
|
4617
4617
|
isInChat,
|
|
4618
4618
|
renderHeader: (params, colId) => /* @__PURE__ */ jsxRuntime.jsx(FactHeader, { params, colId }),
|
|
4619
4619
|
renderRowActions: (fact, params) => {
|
|
4620
4620
|
const ctx = params.context;
|
|
4621
4621
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4622
|
-
|
|
4622
|
+
chunkB3FMUFAW_cjs.FactRowActions,
|
|
4623
4623
|
{
|
|
4624
4624
|
onEdit: () => ctx?.openEdit?.(fact),
|
|
4625
4625
|
canEdit: ctx?.canRewrite?.(fact) !== false,
|
|
@@ -4749,7 +4749,7 @@ function useFactsGrid({
|
|
|
4749
4749
|
);
|
|
4750
4750
|
const renderFactTags = react.useCallback(
|
|
4751
4751
|
(fact, rowHeight) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4752
|
-
|
|
4752
|
+
chunkB3FMUFAW_cjs.FactLabelsCell,
|
|
4753
4753
|
{
|
|
4754
4754
|
options: labelOptions,
|
|
4755
4755
|
selectedIds: fact.tags.map((t) => t.tag_ext_id),
|
|
@@ -4848,7 +4848,7 @@ function useFactsGrid({
|
|
|
4848
4848
|
var DEFAULT_TIMELINE_LABEL_WIDTH = 240;
|
|
4849
4849
|
function useFactsPageView() {
|
|
4850
4850
|
const [view, setView] = react.useState("table");
|
|
4851
|
-
const [rowHeight, setRowHeight] = react.useState(
|
|
4851
|
+
const [rowHeight, setRowHeight] = react.useState(chunkQJFJ5JBF_cjs.ROW_MIN);
|
|
4852
4852
|
const [labelWidth, setLabelWidth] = react.useState(DEFAULT_TIMELINE_LABEL_WIDTH);
|
|
4853
4853
|
const [zoom, setZoom] = react.useState(1);
|
|
4854
4854
|
const [filterText, setFilterText] = react.useState("");
|
|
@@ -4881,7 +4881,7 @@ var citedDocIdsCache = /* @__PURE__ */ new WeakMap();
|
|
|
4881
4881
|
function citedDocIds(m) {
|
|
4882
4882
|
const cached = citedDocIdsCache.get(m);
|
|
4883
4883
|
if (cached) return cached;
|
|
4884
|
-
const ids =
|
|
4884
|
+
const ids = chunkB3FMUFAW_cjs.docIdsOf(chunkB3FMUFAW_cjs.toFactCitations(m.citations));
|
|
4885
4885
|
citedDocIdsCache.set(m, ids);
|
|
4886
4886
|
return ids;
|
|
4887
4887
|
}
|
|
@@ -4973,7 +4973,7 @@ function ConnectedFactsPage({
|
|
|
4973
4973
|
const citedDocs = react.useMemo(() => {
|
|
4974
4974
|
const wanted = /* @__PURE__ */ new Set([
|
|
4975
4975
|
...notes.flatMap((n) => citedDocIds(n)),
|
|
4976
|
-
...
|
|
4976
|
+
...chunkB3FMUFAW_cjs.docIdsOf(chunkB3FMUFAW_cjs.toFactCitations(composer.draftCitations))
|
|
4977
4977
|
]);
|
|
4978
4978
|
return Object.fromEntries(
|
|
4979
4979
|
documents.filter((d) => wanted.has(d.external_id)).map((d) => [d.external_id, d])
|
|
@@ -5002,7 +5002,7 @@ function ConnectedFactsPage({
|
|
|
5002
5002
|
setView(request.view === "list" ? "table" : request.view);
|
|
5003
5003
|
onRequestHandled?.("view");
|
|
5004
5004
|
}, [request?.view]);
|
|
5005
|
-
const factsRowHeight = pageView.rowHeight ===
|
|
5005
|
+
const factsRowHeight = pageView.rowHeight === chunkQJFJ5JBF_cjs.ROW_MIN ? chunkQJFJ5JBF_cjs.ROW_MIN : chunkQJFJ5JBF_cjs.rowHeightForLines(chunkQJFJ5JBF_cjs.linesForRowHeight(pageView.rowHeight));
|
|
5006
5006
|
const [isExportOpen, setIsExportOpen] = react.useState(false);
|
|
5007
5007
|
const [filterOpen, setFilterOpen] = react.useState(false);
|
|
5008
5008
|
const [factSection, setFactSection] = react.useState(null);
|
|
@@ -5027,7 +5027,7 @@ function ConnectedFactsPage({
|
|
|
5027
5027
|
};
|
|
5028
5028
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: setFactSection, className: "relative flex h-full flex-col", "data-testid": "facts-page", children: [
|
|
5029
5029
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5030
|
-
|
|
5030
|
+
chunkB3FMUFAW_cjs.FactsToolbar,
|
|
5031
5031
|
{
|
|
5032
5032
|
count: filteredNotes.length,
|
|
5033
5033
|
hasActiveFilters: filters.hasActiveFilters,
|
|
@@ -5056,7 +5056,7 @@ function ConnectedFactsPage({
|
|
|
5056
5056
|
onNewFact: composing && !editingId ? () => void 0 : composer.startNewFact,
|
|
5057
5057
|
navSlotRef: setNavSlot,
|
|
5058
5058
|
navigator: view === "table" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5059
|
-
|
|
5059
|
+
chunkGC2FSPSQ_cjs.GridRowNavigator,
|
|
5060
5060
|
{
|
|
5061
5061
|
gridApi,
|
|
5062
5062
|
selectedId: editingId,
|
|
@@ -5067,9 +5067,9 @@ function ConnectedFactsPage({
|
|
|
5067
5067
|
) : null,
|
|
5068
5068
|
showToolbarRow: view !== "smart_search",
|
|
5069
5069
|
tools: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5070
|
-
view === "table" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5070
|
+
view === "table" && /* @__PURE__ */ jsxRuntime.jsx(chunkB3FMUFAW_cjs.FactsFieldsButton, { getGridApi: () => gridApiRef.current }),
|
|
5071
5071
|
view === "table" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5072
|
-
|
|
5072
|
+
chunkQJFJ5JBF_cjs.RowDensityControl,
|
|
5073
5073
|
{
|
|
5074
5074
|
rowHeight: factsRowHeight,
|
|
5075
5075
|
onRowHeightChange: pageView.setRowHeight,
|
|
@@ -5088,7 +5088,7 @@ function ConnectedFactsPage({
|
|
|
5088
5088
|
}
|
|
5089
5089
|
),
|
|
5090
5090
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5091
|
-
|
|
5091
|
+
chunkB3FMUFAW_cjs.FactComposer,
|
|
5092
5092
|
{
|
|
5093
5093
|
isOpen: composing,
|
|
5094
5094
|
isEditing: !!editingId,
|
|
@@ -5121,7 +5121,7 @@ function ConnectedFactsPage({
|
|
|
5121
5121
|
reserveSourcesSpace: view === "gantt" || view === "calendar",
|
|
5122
5122
|
citationContainer: factSection,
|
|
5123
5123
|
renderDocumentPicker: (onSelect, selectedIds, onOpen, sourcesToggle, sourcesOpen) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5124
|
-
|
|
5124
|
+
chunkB3FMUFAW_cjs.FactSourcesRow,
|
|
5125
5125
|
{
|
|
5126
5126
|
toggle: sourcesToggle,
|
|
5127
5127
|
picker: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5167,7 +5167,7 @@ function ConnectedFactsPage({
|
|
|
5167
5167
|
}
|
|
5168
5168
|
),
|
|
5169
5169
|
dateInput: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5170
|
-
|
|
5170
|
+
chunkB3FMUFAW_cjs.FactDateInput,
|
|
5171
5171
|
{
|
|
5172
5172
|
value: composer.draftDateFields,
|
|
5173
5173
|
onChange: composer.setDraftDateFields,
|
|
@@ -5177,13 +5177,13 @@ function ConnectedFactsPage({
|
|
|
5177
5177
|
}
|
|
5178
5178
|
),
|
|
5179
5179
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "scrollbar-subtle flex-1 overflow-y-auto pb-2", children: [
|
|
5180
|
-
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5180
|
+
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(chunkB3FMUFAW_cjs.FactsLoading, {}) : isError ? /* @__PURE__ */ jsxRuntime.jsx(chunkB3FMUFAW_cjs.FactsLoadError, { onRetry: () => refetch() }) : smartSearch ? (
|
|
5181
5181
|
// Searches facts only (never documents). Kept before the empty-state guard so the
|
|
5182
5182
|
// search UI is reachable even in an empty workspace.
|
|
5183
5183
|
smartSearch({ selectedFactId: editingId, onOpenFact: openFactById })
|
|
5184
5184
|
) : notes.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-full flex-col items-center justify-center", children: [
|
|
5185
5185
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5186
|
-
|
|
5186
|
+
chunkB3FMUFAW_cjs.FactsEmptyState,
|
|
5187
5187
|
{
|
|
5188
5188
|
onUseExample: (text) => {
|
|
5189
5189
|
composer.setDraft(text);
|
|
@@ -5194,7 +5194,7 @@ function ConnectedFactsPage({
|
|
|
5194
5194
|
),
|
|
5195
5195
|
emptyStateExtra
|
|
5196
5196
|
] }) : view === "calendar" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5197
|
-
|
|
5197
|
+
chunkB3FMUFAW_cjs.FactsCalendar,
|
|
5198
5198
|
{
|
|
5199
5199
|
facts: filteredNotes,
|
|
5200
5200
|
onSelect: (n) => openEditIfAllowed(n),
|
|
@@ -5203,7 +5203,7 @@ function ConnectedFactsPage({
|
|
|
5203
5203
|
navigatorTotal: filteredNotes.length
|
|
5204
5204
|
}
|
|
5205
5205
|
) : view === "gantt" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5206
|
-
|
|
5206
|
+
chunkB3FMUFAW_cjs.FactsGanttPane,
|
|
5207
5207
|
{
|
|
5208
5208
|
items: ganttItems,
|
|
5209
5209
|
labelWidth: pageView.labelWidth,
|
|
@@ -5253,7 +5253,7 @@ function ConnectedFactsPage({
|
|
|
5253
5253
|
)
|
|
5254
5254
|
] }),
|
|
5255
5255
|
selectable && notes.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5256
|
-
|
|
5256
|
+
chunkB3FMUFAW_cjs.FactsBulkBar,
|
|
5257
5257
|
{
|
|
5258
5258
|
count: selection.selectedFacts.length,
|
|
5259
5259
|
onClear: selection.clearSelection,
|
|
@@ -6960,13 +6960,13 @@ function ConnectedWorkspaceSettings({
|
|
|
6960
6960
|
const [membersExpanded, setMembersExpanded] = react.useState(false);
|
|
6961
6961
|
const [shareOpen, setShareOpen] = react.useState(false);
|
|
6962
6962
|
if (!workspace) {
|
|
6963
|
-
return /* @__PURE__ */ jsxRuntime.jsx(chunkMSFQDELO_cjs.PageLoading, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6963
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkMSFQDELO_cjs.PageLoading, { children: /* @__PURE__ */ jsxRuntime.jsx(chunkGC2FSPSQ_cjs.LoadingIndicator, { message: "Loading workspace..." }) });
|
|
6964
6964
|
}
|
|
6965
6965
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
6966
6966
|
/* @__PURE__ */ jsxRuntime.jsxs(chunkMSFQDELO_cjs.WorkspacePageFrame, { testId, children: [
|
|
6967
6967
|
/* @__PURE__ */ jsxRuntime.jsxs(chunkMSFQDELO_cjs.WorkspaceIdentityPanel, { children: [
|
|
6968
6968
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6969
|
-
|
|
6969
|
+
chunkGC2FSPSQ_cjs.EntityIdentityBar,
|
|
6970
6970
|
{
|
|
6971
6971
|
testId: "workspace-identity-bar",
|
|
6972
6972
|
canEdit: isOwner,
|
|
@@ -6983,7 +6983,7 @@ function ConnectedWorkspaceSettings({
|
|
|
6983
6983
|
label: "Name",
|
|
6984
6984
|
value: workspace.name,
|
|
6985
6985
|
placeholder: "Untitled",
|
|
6986
|
-
maxLength:
|
|
6986
|
+
maxLength: chunkGC2FSPSQ_cjs.IDENTITY_NAME_MAX_LENGTH,
|
|
6987
6987
|
valueClassName: "truncate text-base font-semibold",
|
|
6988
6988
|
testId: "workspace-home-title",
|
|
6989
6989
|
hideLabel: true,
|
|
@@ -10817,7 +10817,7 @@ function ConnectedWorkspaceList({
|
|
|
10817
10817
|
};
|
|
10818
10818
|
const open = (workspace) => void openWorkspace(workspace.external_id, { name: workspace.name });
|
|
10819
10819
|
const createDisabledReason = list.canCreateProjects === false ? react$1.PROJECT_CREATION_DENIED_REASON : void 0;
|
|
10820
|
-
if (list.isLoading) return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10820
|
+
if (list.isLoading) return /* @__PURE__ */ jsxRuntime.jsx(chunkGC2FSPSQ_cjs.LoadingIndicator, { message: "Loading workspaces..." });
|
|
10821
10821
|
if (list.error) {
|
|
10822
10822
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10823
10823
|
chunkOOU4QLRK_cjs.HomeLoadError,
|
|
@@ -10889,7 +10889,7 @@ function ConnectedWorkspaceList({
|
|
|
10889
10889
|
createDisabledReason
|
|
10890
10890
|
}
|
|
10891
10891
|
) })
|
|
10892
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10892
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(chunkGC2FSPSQ_cjs.LoadingIndicator, { message: "Loading grid..." }), children: /* @__PURE__ */ jsxRuntime.jsx(chunkOOU4QLRK_cjs.HomeCenteredColumn, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10893
10893
|
WorkspaceTableView,
|
|
10894
10894
|
{
|
|
10895
10895
|
list,
|
|
@@ -11045,7 +11045,7 @@ function recentConversations(conversations) {
|
|
|
11045
11045
|
return [...conversations].sort((a, b) => time(b.updated_at) - time(a.updated_at)).slice(0, RECENT_ROWS).map((c) => ({
|
|
11046
11046
|
id: c.external_id,
|
|
11047
11047
|
title: c.title?.trim() || "Untitled thread",
|
|
11048
|
-
subtitle: c.status ? [
|
|
11048
|
+
subtitle: c.status ? [chunkYF3QUHKN_cjs.STATUS_LABELS[chunkYF3QUHKN_cjs.asTaskStatus(c.status)], c.due_at ? `due ${shortDate(c.due_at)}` : null].filter(Boolean).join(" \xB7 ") : `${c.message_count} ${c.message_count === 1 ? "message" : "messages"}`,
|
|
11049
11049
|
time: timeAndDate(c.updated_at)
|
|
11050
11050
|
}));
|
|
11051
11051
|
}
|
|
@@ -13137,7 +13137,7 @@ function ConnectedMailbox({
|
|
|
13137
13137
|
onTabChange: () => {
|
|
13138
13138
|
},
|
|
13139
13139
|
compactBreakpoint: 360,
|
|
13140
|
-
firstTabContent: account ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
13140
|
+
firstTabContent: account ? /* @__PURE__ */ jsxRuntime.jsxs(chunkQJFJ5JBF_cjs.FilesFilterBar, { children: [
|
|
13141
13141
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
13142
13142
|
chunk2EI7NCUA_cjs.FilterInput,
|
|
13143
13143
|
{
|
|
@@ -13172,7 +13172,7 @@ function ConnectedMailbox({
|
|
|
13172
13172
|
}
|
|
13173
13173
|
),
|
|
13174
13174
|
folderList && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
13175
|
-
|
|
13175
|
+
chunkQJFJ5JBF_cjs.FolderFilterButton,
|
|
13176
13176
|
{
|
|
13177
13177
|
label: folderList.find((f) => f.id === folderId)?.name ?? "Folders",
|
|
13178
13178
|
isActive: false,
|
|
@@ -13180,7 +13180,7 @@ function ConnectedMailbox({
|
|
|
13180
13180
|
onOpenChange: setFolderMenuOpen,
|
|
13181
13181
|
testId: "mail-folder-button",
|
|
13182
13182
|
children: folderList.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
13183
|
-
|
|
13183
|
+
chunkQJFJ5JBF_cjs.FolderPickerRow,
|
|
13184
13184
|
{
|
|
13185
13185
|
label: item.name,
|
|
13186
13186
|
count: item.unread > 0 ? item.unread : void 0,
|
|
@@ -16931,7 +16931,7 @@ function TileStatusBadge({ doc, status }) {
|
|
|
16931
16931
|
case "failed":
|
|
16932
16932
|
tone = "danger";
|
|
16933
16933
|
icon2 = /* @__PURE__ */ jsxRuntime.jsx(
|
|
16934
|
-
|
|
16934
|
+
chunkQJFJ5JBF_cjs.FailedStageIcon,
|
|
16935
16935
|
{
|
|
16936
16936
|
stage: doc.failed_stage ?? null,
|
|
16937
16937
|
errorMessage: doc.error_message,
|
|
@@ -16958,7 +16958,7 @@ function TileStatusBadge({ doc, status }) {
|
|
|
16958
16958
|
return null;
|
|
16959
16959
|
}
|
|
16960
16960
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16961
|
-
|
|
16961
|
+
chunkQJFJ5JBF_cjs.StatusPill,
|
|
16962
16962
|
{
|
|
16963
16963
|
tone,
|
|
16964
16964
|
icon: icon2,
|
|
@@ -16970,11 +16970,11 @@ function TileStatusBadge({ doc, status }) {
|
|
|
16970
16970
|
function TileVisibilityBadge({ doc }) {
|
|
16971
16971
|
const shared = !!doc.shared;
|
|
16972
16972
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
16973
|
-
|
|
16973
|
+
chunkQJFJ5JBF_cjs.StatusPill,
|
|
16974
16974
|
{
|
|
16975
16975
|
icon: /* @__PURE__ */ jsxRuntime.jsx(ui.VisibilityIcon, { isShared: shared, className: "size-3.5", "aria-hidden": true }),
|
|
16976
16976
|
label: shared ? ui.getEntityLabel("WORKSPACE") : "Only you",
|
|
16977
|
-
title:
|
|
16977
|
+
title: chunkQJFJ5JBF_cjs.visibilityAudience(shared),
|
|
16978
16978
|
testId: `explorer-file-visibility-${doc.external_id}`
|
|
16979
16979
|
}
|
|
16980
16980
|
);
|
|
@@ -17001,7 +17001,7 @@ function FileTooltipContent({
|
|
|
17001
17001
|
}) {
|
|
17002
17002
|
const labels = (doc.doctags ?? []).map((dt) => tagNameById.get(dt.tag_ext_id)).filter((name) => !!name);
|
|
17003
17003
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17004
|
-
|
|
17004
|
+
chunkQJFJ5JBF_cjs.ExplorerFileTooltip,
|
|
17005
17005
|
{
|
|
17006
17006
|
title: ui.getDocumentTitle(doc, doc.file_name ?? ""),
|
|
17007
17007
|
summary: react$1.getDocumentSubject(doc),
|
|
@@ -17010,7 +17010,7 @@ function FileTooltipContent({
|
|
|
17010
17010
|
shared: !!doc.shared,
|
|
17011
17011
|
visibilityIcon: /* @__PURE__ */ jsxRuntime.jsx(ui.VisibilityIcon, { isShared: !!doc.shared, className: "h-3 w-3" }),
|
|
17012
17012
|
labels,
|
|
17013
|
-
uiLabels: { shared:
|
|
17013
|
+
uiLabels: { shared: chunkQJFJ5JBF_cjs.visibilityAudience(true), private: chunkQJFJ5JBF_cjs.visibilityAudience(false) }
|
|
17014
17014
|
}
|
|
17015
17015
|
);
|
|
17016
17016
|
}
|
|
@@ -17121,7 +17121,7 @@ var FileTile = react.memo(function FileTile2({
|
|
|
17121
17121
|
];
|
|
17122
17122
|
const tooltip = renaming || dndActive ? void 0 : /* @__PURE__ */ jsxRuntime.jsx(FileTooltipContent, { doc, modifiedBy, tagNameById });
|
|
17123
17123
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17124
|
-
|
|
17124
|
+
chunkQJFJ5JBF_cjs.ExplorerFileTile,
|
|
17125
17125
|
{
|
|
17126
17126
|
id: doc.external_id,
|
|
17127
17127
|
title: ui.getDocumentTitle(doc, doc.file_name ?? ""),
|
|
@@ -17214,17 +17214,17 @@ var FolderTile = react.memo(function FolderTile2({
|
|
|
17214
17214
|
}
|
|
17215
17215
|
] : []
|
|
17216
17216
|
];
|
|
17217
|
-
const displayName = folder.path.length === 1 ?
|
|
17218
|
-
const providerIcon = folder.path.length === 1 &&
|
|
17217
|
+
const displayName = folder.path.length === 1 ? chunkQJFJ5JBF_cjs.formatFolderSegment(folder.name) : folder.name;
|
|
17218
|
+
const providerIcon = folder.path.length === 1 && chunkQJFJ5JBF_cjs.hasFolderProviderIcon(folder.name) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17219
17219
|
"span",
|
|
17220
17220
|
{
|
|
17221
17221
|
className: "flex items-center justify-center drop-shadow-sm",
|
|
17222
17222
|
style: { width: iconSize, height: iconSize },
|
|
17223
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
17223
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.FolderProviderIcon, { folderPath: folder.name, className: "h-full w-full" })
|
|
17224
17224
|
}
|
|
17225
17225
|
) : void 0;
|
|
17226
17226
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17227
|
-
|
|
17227
|
+
chunkQJFJ5JBF_cjs.ExplorerFolderTile,
|
|
17228
17228
|
{
|
|
17229
17229
|
name: folder.name,
|
|
17230
17230
|
displayName: displayName === "" ? null : displayName,
|
|
@@ -17330,8 +17330,8 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17330
17330
|
const { folders, files } = react.useMemo(() => {
|
|
17331
17331
|
const result = isSearching ? {
|
|
17332
17332
|
folders: [],
|
|
17333
|
-
files:
|
|
17334
|
-
} :
|
|
17333
|
+
files: chunkQJFJ5JBF_cjs.searchExplorerDocuments(documents, search, sort)
|
|
17334
|
+
} : chunkQJFJ5JBF_cjs.buildExplorerEntries(documents, currentPath, sort, [...pendingFolders]);
|
|
17335
17335
|
if (sortReversed) result.files = [...result.files].reverse();
|
|
17336
17336
|
return result;
|
|
17337
17337
|
}, [documents, currentPath, sort, isSearching, search, sortReversed, pendingFolders]);
|
|
@@ -17342,7 +17342,7 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17342
17342
|
const orderedFileIds = react.useMemo(() => files.map((d) => d.external_id), [files]);
|
|
17343
17343
|
const folderDocs = react.useMemo(() => {
|
|
17344
17344
|
const map = /* @__PURE__ */ new Map();
|
|
17345
|
-
for (const f of folders) map.set(f.path.join("/"),
|
|
17345
|
+
for (const f of folders) map.set(f.path.join("/"), chunkQJFJ5JBF_cjs.collectFolderDocs(documents, f.path));
|
|
17346
17346
|
return map;
|
|
17347
17347
|
}, [folders, documents]);
|
|
17348
17348
|
const folderSelection = react.useMemo(() => {
|
|
@@ -17490,7 +17490,7 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17490
17490
|
let name = base;
|
|
17491
17491
|
let i = 2;
|
|
17492
17492
|
while (siblings.has(name.toLowerCase())) name = `${base} ${i++}`;
|
|
17493
|
-
const path =
|
|
17493
|
+
const path = chunkQJFJ5JBF_cjs.joinFolderPath([...currentPath, name]);
|
|
17494
17494
|
if (!path) return;
|
|
17495
17495
|
addPendingFolder(wsId, path);
|
|
17496
17496
|
setEditingFolderPath(path);
|
|
@@ -17526,10 +17526,10 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17526
17526
|
notify14(`A folder named "${name}" already exists here.`, "error");
|
|
17527
17527
|
return;
|
|
17528
17528
|
}
|
|
17529
|
-
const oldPath =
|
|
17529
|
+
const oldPath = chunkQJFJ5JBF_cjs.joinFolderPath(folder.path);
|
|
17530
17530
|
const newPrefix = [...folder.path.slice(0, -1), name];
|
|
17531
|
-
const newPath =
|
|
17532
|
-
const docs =
|
|
17531
|
+
const newPath = chunkQJFJ5JBF_cjs.joinFolderPath(newPrefix);
|
|
17532
|
+
const docs = chunkQJFJ5JBF_cjs.collectFolderDocs(documents, folder.path);
|
|
17533
17533
|
try {
|
|
17534
17534
|
if (await renameFolder(docs, folder.path, newPrefix) > 0) {
|
|
17535
17535
|
notify14(`Renamed folder to "${name}"`, "success");
|
|
@@ -17588,7 +17588,7 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17588
17588
|
const handleToggleFolder = react.useCallback(
|
|
17589
17589
|
(folder, e) => {
|
|
17590
17590
|
e.stopPropagation();
|
|
17591
|
-
const ids =
|
|
17591
|
+
const ids = chunkQJFJ5JBF_cjs.collectFolderDocs(documents, folder.path).map((d) => d.external_id);
|
|
17592
17592
|
if (ids.length === 0) return;
|
|
17593
17593
|
if (ids.every((id) => selectedSet.has(id))) {
|
|
17594
17594
|
const remove = new Set(ids);
|
|
@@ -17649,9 +17649,9 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17649
17649
|
);
|
|
17650
17650
|
const handleDelete = react.useCallback(
|
|
17651
17651
|
async (doc) => {
|
|
17652
|
-
const name =
|
|
17652
|
+
const name = chunkQJFJ5JBF_cjs.getExplorerDisplayName(doc);
|
|
17653
17653
|
const confirmed = await confirm({
|
|
17654
|
-
message: `Delete "${name}"? ${
|
|
17654
|
+
message: `Delete "${name}"? ${chunkQJFJ5JBF_cjs.RECENTLY_DELETED_HINT}`,
|
|
17655
17655
|
title: "Delete file"
|
|
17656
17656
|
});
|
|
17657
17657
|
if (!confirmed) return;
|
|
@@ -17671,7 +17671,7 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17671
17671
|
);
|
|
17672
17672
|
const handleFolderDownload = react.useCallback(
|
|
17673
17673
|
(folder) => {
|
|
17674
|
-
const docs =
|
|
17674
|
+
const docs = chunkQJFJ5JBF_cjs.collectFolderDocs(documents, folder.path);
|
|
17675
17675
|
if (docs.length > 0) void downloadDocuments(docs);
|
|
17676
17676
|
},
|
|
17677
17677
|
[documents, downloadDocuments]
|
|
@@ -17680,7 +17680,7 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17680
17680
|
if (onFolderMove) return onFolderMove;
|
|
17681
17681
|
if (!onMoveSelected) return void 0;
|
|
17682
17682
|
return (folder) => {
|
|
17683
|
-
const ids =
|
|
17683
|
+
const ids = chunkQJFJ5JBF_cjs.collectFolderDocs(documents, folder.path).map((d) => d.external_id);
|
|
17684
17684
|
if (ids.length === 0) return;
|
|
17685
17685
|
onSelectionChange(ids);
|
|
17686
17686
|
onMoveSelected();
|
|
@@ -17688,14 +17688,14 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17688
17688
|
}, [documents, onFolderMove, onMoveSelected, onSelectionChange]);
|
|
17689
17689
|
const handleFolderDelete = react.useCallback(
|
|
17690
17690
|
async (folder) => {
|
|
17691
|
-
const docs =
|
|
17691
|
+
const docs = chunkQJFJ5JBF_cjs.collectFolderDocs(documents, folder.path);
|
|
17692
17692
|
if (docs.length === 0) {
|
|
17693
|
-
const path =
|
|
17693
|
+
const path = chunkQJFJ5JBF_cjs.joinFolderPath(folder.path);
|
|
17694
17694
|
if (wsId && path) removePendingFolder(wsId, path);
|
|
17695
17695
|
return;
|
|
17696
17696
|
}
|
|
17697
17697
|
const confirmed = await confirm({
|
|
17698
|
-
message: `Delete folder "${folder.name}" and its ${docs.length} item${docs.length === 1 ? "" : "s"}? ${
|
|
17698
|
+
message: `Delete folder "${folder.name}" and its ${docs.length} item${docs.length === 1 ? "" : "s"}? ${chunkQJFJ5JBF_cjs.RECENTLY_DELETED_HINT_PLURAL}`,
|
|
17699
17699
|
title: "Delete folder"
|
|
17700
17700
|
});
|
|
17701
17701
|
if (!confirmed) return;
|
|
@@ -17712,8 +17712,8 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17712
17712
|
[confirm, documents, deleteDocuments, onSelectionChange, removePendingFolder, wsId, notify14]
|
|
17713
17713
|
);
|
|
17714
17714
|
const canDeleteFolder = react.useCallback(
|
|
17715
|
-
(folder) => canUpload &&
|
|
17716
|
-
(doc) =>
|
|
17715
|
+
(folder) => canUpload && chunkQJFJ5JBF_cjs.collectFolderDocs(documents, folder.path).every(
|
|
17716
|
+
(doc) => chunkQJFJ5JBF_cjs.canDeleteDocument(doc, userId, role)
|
|
17717
17717
|
),
|
|
17718
17718
|
[canUpload, documents, userId, role]
|
|
17719
17719
|
);
|
|
@@ -17772,7 +17772,7 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17772
17772
|
setActiveDragId(null);
|
|
17773
17773
|
const data = event.over?.data.current;
|
|
17774
17774
|
if (data?.type === "folder" && data.path) {
|
|
17775
|
-
const targetFolder =
|
|
17775
|
+
const targetFolder = chunkQJFJ5JBF_cjs.joinFolderPath(data.path);
|
|
17776
17776
|
const moving = dragIdsRef.current.filter((id) => {
|
|
17777
17777
|
const doc = documents.find((d) => d.external_id === id);
|
|
17778
17778
|
return doc && (doc.folder ?? null) !== targetFolder;
|
|
@@ -17812,7 +17812,7 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17812
17812
|
const dropped = Array.from(e.dataTransfer.files ?? []);
|
|
17813
17813
|
if (dropped.length > 0) {
|
|
17814
17814
|
e.preventDefault();
|
|
17815
|
-
onUploadFiles(dropped,
|
|
17815
|
+
onUploadFiles(dropped, chunkQJFJ5JBF_cjs.joinFolderPath(currentPath));
|
|
17816
17816
|
}
|
|
17817
17817
|
},
|
|
17818
17818
|
[canUpload, currentPath, onUploadFiles]
|
|
@@ -17829,9 +17829,9 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17829
17829
|
onDragEnd: handleDragEnd,
|
|
17830
17830
|
onDragCancel: () => setActiveDragId(null),
|
|
17831
17831
|
children: [
|
|
17832
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17832
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.ExplorerFrame, { "data-testid": "documents-explorer", children: /* @__PURE__ */ jsxRuntime.jsxs(chunkQJFJ5JBF_cjs.ExplorerStage, { children: [
|
|
17833
17833
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17834
|
-
|
|
17834
|
+
chunkQJFJ5JBF_cjs.ExplorerScroller,
|
|
17835
17835
|
{
|
|
17836
17836
|
ref: scrollRef,
|
|
17837
17837
|
onClick: handleBackgroundClick,
|
|
@@ -17841,15 +17841,15 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17841
17841
|
onDragLeave: handleNativeDragLeave,
|
|
17842
17842
|
onDrop: handleNativeDrop,
|
|
17843
17843
|
"data-testid": "explorer-scroll",
|
|
17844
|
-
children: isLoading && documents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17845
|
-
|
|
17844
|
+
children: isLoading && documents.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.ExplorerLoadingTiles, {}) : entries.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
17845
|
+
chunkQJFJ5JBF_cjs.ExplorerEmpty,
|
|
17846
17846
|
{
|
|
17847
17847
|
title: isSearching ? `No files match "${search.trim()}"` : "This folder is empty",
|
|
17848
17848
|
description: isSearching ? "Try a different search." : canUpload ? "Drop files here or use Upload to add documents." : "No documents here yet."
|
|
17849
17849
|
}
|
|
17850
17850
|
) : containerWidth === 0 ? (
|
|
17851
17851
|
// Not measured yet: rendering now would flash one stretched column.
|
|
17852
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17852
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.ExplorerLoadingTiles, {})
|
|
17853
17853
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
17854
17854
|
"div",
|
|
17855
17855
|
{
|
|
@@ -17909,7 +17909,7 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17909
17909
|
dragging: activeDragId === doc.external_id,
|
|
17910
17910
|
dndActive: activeDragId !== null,
|
|
17911
17911
|
renaming: renamingId === doc.external_id,
|
|
17912
|
-
canDelete:
|
|
17912
|
+
canDelete: chunkQJFJ5JBF_cjs.canDeleteDocument(doc, userId, role),
|
|
17913
17913
|
thumbnailUrl: thumbnailsById.get(doc.external_id),
|
|
17914
17914
|
modifiedBy: userById.get(
|
|
17915
17915
|
doc.updated_by_ext_id ?? doc.created_by_ext_id
|
|
@@ -17937,9 +17937,9 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17937
17937
|
)
|
|
17938
17938
|
}
|
|
17939
17939
|
),
|
|
17940
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
17940
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.ExplorerMarquee, { ref: marqueeOverlayRef, "data-testid": "explorer-marquee" }),
|
|
17941
17941
|
isFileDragOver && /* @__PURE__ */ jsxRuntime.jsx(
|
|
17942
|
-
|
|
17942
|
+
chunkQJFJ5JBF_cjs.ExplorerDropOverlay,
|
|
17943
17943
|
{
|
|
17944
17944
|
label: `Drop to upload${currentPath.length > 0 ? ` to "${currentPath[currentPath.length - 1]}"` : ""}`
|
|
17945
17945
|
}
|
|
@@ -17953,7 +17953,7 @@ var ConnectedFilesExplorer = react.forwardRef(function ConnectedFilesExplorer2({
|
|
|
17953
17953
|
function DragPreview({ doc, count }) {
|
|
17954
17954
|
const Icon = ui.getFileTypeIcon(doc.file_name, { mime: doc.file_type });
|
|
17955
17955
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17956
|
-
|
|
17956
|
+
chunkQJFJ5JBF_cjs.ExplorerDragPreview,
|
|
17957
17957
|
{
|
|
17958
17958
|
icon: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 20 }),
|
|
17959
17959
|
title: ui.getDocumentTitle(doc, doc.file_name ?? "Untitled"),
|
|
@@ -17961,6 +17961,561 @@ function DragPreview({ doc, count }) {
|
|
|
17961
17961
|
}
|
|
17962
17962
|
);
|
|
17963
17963
|
}
|
|
17964
|
+
function ConnectedUploadDropzone({
|
|
17965
|
+
onFilesSelected,
|
|
17966
|
+
onFilesRejected,
|
|
17967
|
+
onUrlsSubmit,
|
|
17968
|
+
disabled = false,
|
|
17969
|
+
className = "",
|
|
17970
|
+
maxFileSize = react$1.UPLOAD_MAX_FILE_SIZE,
|
|
17971
|
+
title = "Drag & Drop Files, Folders, or Zip Archives Here",
|
|
17972
|
+
subtitle = "or click to browse files (zip files will be extracted)",
|
|
17973
|
+
compact = false,
|
|
17974
|
+
onOpenUpload,
|
|
17975
|
+
workspaceName = "this workspace",
|
|
17976
|
+
source = null,
|
|
17977
|
+
onPickSource,
|
|
17978
|
+
accounts,
|
|
17979
|
+
compactLeadingAction
|
|
17980
|
+
}) {
|
|
17981
|
+
const { extractZip } = react$1.useDocumentsSupport();
|
|
17982
|
+
const [dragActive, setDragActive] = react.useState(false);
|
|
17983
|
+
const [processingMessage, setProcessingMessage] = react.useState(null);
|
|
17984
|
+
const fileInputRef = react.useRef(null);
|
|
17985
|
+
const folderInputRef = react.useRef(null);
|
|
17986
|
+
const take = react.useCallback(
|
|
17987
|
+
async (chosen) => {
|
|
17988
|
+
if (disabled || chosen.length === 0) return;
|
|
17989
|
+
setProcessingMessage(
|
|
17990
|
+
chosen.some(react$1.isZipFile) ? "Extracting zip contents..." : "Processing files..."
|
|
17991
|
+
);
|
|
17992
|
+
try {
|
|
17993
|
+
const { accepted, refused } = await react$1.prepareUploadFiles(chosen, { maxFileSize, extractZip });
|
|
17994
|
+
if (refused.length > 0) onFilesRejected?.(refused);
|
|
17995
|
+
if (accepted.length > 0) onFilesSelected(accepted);
|
|
17996
|
+
} finally {
|
|
17997
|
+
setProcessingMessage(null);
|
|
17998
|
+
}
|
|
17999
|
+
},
|
|
18000
|
+
[disabled, maxFileSize, extractZip, onFilesRejected, onFilesSelected]
|
|
18001
|
+
);
|
|
18002
|
+
const handleDrag = react.useCallback(
|
|
18003
|
+
(e) => {
|
|
18004
|
+
e.preventDefault();
|
|
18005
|
+
e.stopPropagation();
|
|
18006
|
+
if (disabled) return;
|
|
18007
|
+
if (e.type === "dragenter" || e.type === "dragover") setDragActive(true);
|
|
18008
|
+
else if (e.type === "dragleave") setDragActive(false);
|
|
18009
|
+
},
|
|
18010
|
+
[disabled]
|
|
18011
|
+
);
|
|
18012
|
+
const handleDrop = react.useCallback(
|
|
18013
|
+
async (e) => {
|
|
18014
|
+
e.preventDefault();
|
|
18015
|
+
e.stopPropagation();
|
|
18016
|
+
setDragActive(false);
|
|
18017
|
+
if (disabled) return;
|
|
18018
|
+
await take(await react$1.filesFromDrop(e.dataTransfer));
|
|
18019
|
+
},
|
|
18020
|
+
[disabled, take]
|
|
18021
|
+
);
|
|
18022
|
+
const handleFileSelect = react.useCallback(
|
|
18023
|
+
async (e) => {
|
|
18024
|
+
const chosen = Array.from(e.target.files ?? []);
|
|
18025
|
+
e.target.value = "";
|
|
18026
|
+
await take(chosen);
|
|
18027
|
+
},
|
|
18028
|
+
[take]
|
|
18029
|
+
);
|
|
18030
|
+
const browse = react.useCallback(
|
|
18031
|
+
(input) => (e) => {
|
|
18032
|
+
if (disabled) return;
|
|
18033
|
+
e?.stopPropagation();
|
|
18034
|
+
if (onOpenUpload) onOpenUpload();
|
|
18035
|
+
else input.current?.click();
|
|
18036
|
+
},
|
|
18037
|
+
[disabled, onOpenUpload]
|
|
18038
|
+
);
|
|
18039
|
+
const onFiles = browse(fileInputRef);
|
|
18040
|
+
const onFolder = browse(folderInputRef);
|
|
18041
|
+
const dropTarget = /* @__PURE__ */ jsxRuntime.jsx(
|
|
18042
|
+
chunkQJFJ5JBF_cjs.UploadDropArea,
|
|
18043
|
+
{
|
|
18044
|
+
isActive: dragActive,
|
|
18045
|
+
isDisabled: disabled,
|
|
18046
|
+
isProcessing: processingMessage !== null,
|
|
18047
|
+
processingMessage: processingMessage ?? "Processing files...",
|
|
18048
|
+
isCompact: compact,
|
|
18049
|
+
title,
|
|
18050
|
+
subtitle,
|
|
18051
|
+
onDrag: handleDrag,
|
|
18052
|
+
onDrop: handleDrop,
|
|
18053
|
+
onClick: (e) => {
|
|
18054
|
+
if (e.target === e.currentTarget) onFiles();
|
|
18055
|
+
},
|
|
18056
|
+
actions: compact ? /* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.UploadBrowseButtons, { onFiles, onFolder, isDisabled: disabled }) : void 0
|
|
18057
|
+
}
|
|
18058
|
+
);
|
|
18059
|
+
const urlDialog = (trigger) => onUrlsSubmit ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
18060
|
+
chunkQJFJ5JBF_cjs.UrlInputDialog,
|
|
18061
|
+
{
|
|
18062
|
+
onUrlsSubmit,
|
|
18063
|
+
processing: disabled,
|
|
18064
|
+
titleWorkspaceName: workspaceName,
|
|
18065
|
+
trigger
|
|
18066
|
+
}
|
|
18067
|
+
) : null;
|
|
18068
|
+
const body = (() => {
|
|
18069
|
+
if (compact) {
|
|
18070
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
18071
|
+
dropTarget,
|
|
18072
|
+
compactLeadingAction,
|
|
18073
|
+
onUrlsSubmit && /* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.UploadSourceSection, { isIsolated: true, className: "flex flex-wrap justify-center gap-2", children: urlDialog(/* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.UploadUrlButton, { isDisabled: disabled, isCompact: true })) })
|
|
18074
|
+
] });
|
|
18075
|
+
}
|
|
18076
|
+
if (!source) {
|
|
18077
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18078
|
+
chunkQJFJ5JBF_cjs.UploadSourcePicker,
|
|
18079
|
+
{
|
|
18080
|
+
isDisabled: disabled,
|
|
18081
|
+
options: [
|
|
18082
|
+
{
|
|
18083
|
+
key: "computer",
|
|
18084
|
+
label: "From your computer",
|
|
18085
|
+
description: "Upload files or folders",
|
|
18086
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.HardDrive, {}),
|
|
18087
|
+
onClick: () => onPickSource?.("computer")
|
|
18088
|
+
},
|
|
18089
|
+
...accounts ? [
|
|
18090
|
+
{
|
|
18091
|
+
key: "email",
|
|
18092
|
+
label: "From accounts",
|
|
18093
|
+
description: "Sync email and files from your connected accounts",
|
|
18094
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, {}),
|
|
18095
|
+
onClick: () => onPickSource?.("email")
|
|
18096
|
+
}
|
|
18097
|
+
] : [],
|
|
18098
|
+
// The internet opens its dialog directly, not a scoped view of its own.
|
|
18099
|
+
...onUrlsSubmit ? [
|
|
18100
|
+
{
|
|
18101
|
+
key: "internet",
|
|
18102
|
+
label: "From URL",
|
|
18103
|
+
description: "Import from a URL or link",
|
|
18104
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Globe, {}),
|
|
18105
|
+
wrap: (button) => urlDialog(button)
|
|
18106
|
+
}
|
|
18107
|
+
] : []
|
|
18108
|
+
]
|
|
18109
|
+
}
|
|
18110
|
+
);
|
|
18111
|
+
}
|
|
18112
|
+
if (source === "computer") {
|
|
18113
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18114
|
+
chunkQJFJ5JBF_cjs.UploadSourceSection,
|
|
18115
|
+
{
|
|
18116
|
+
testId: "upload-source-computer",
|
|
18117
|
+
className: "flex w-full flex-col gap-3 pointer-coarse:flex-col-reverse",
|
|
18118
|
+
children: [
|
|
18119
|
+
dropTarget,
|
|
18120
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18121
|
+
chunkQJFJ5JBF_cjs.UploadBrowseButtons,
|
|
18122
|
+
{
|
|
18123
|
+
layout: "grid",
|
|
18124
|
+
onFiles,
|
|
18125
|
+
onFolder,
|
|
18126
|
+
isDisabled: disabled
|
|
18127
|
+
}
|
|
18128
|
+
)
|
|
18129
|
+
]
|
|
18130
|
+
}
|
|
18131
|
+
);
|
|
18132
|
+
}
|
|
18133
|
+
if (source === "internet" && onUrlsSubmit) {
|
|
18134
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.UploadSourceSection, { testId: "upload-source-internet", className: "flex flex-wrap gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.UploadSourceSection, { isIsolated: true, children: urlDialog(/* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.UploadUrlButton, { isDisabled: disabled })) }) });
|
|
18135
|
+
}
|
|
18136
|
+
if (source === "email" && accounts) {
|
|
18137
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.UploadSourceSection, { testId: "upload-source-email", isIsolated: true, children: accounts });
|
|
18138
|
+
}
|
|
18139
|
+
return null;
|
|
18140
|
+
})();
|
|
18141
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18142
|
+
chunkQJFJ5JBF_cjs.UploadFrame,
|
|
18143
|
+
{
|
|
18144
|
+
isCompact: compact,
|
|
18145
|
+
isDimmed: disabled || processingMessage !== null,
|
|
18146
|
+
className,
|
|
18147
|
+
children: [
|
|
18148
|
+
!onOpenUpload && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
18149
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18150
|
+
"input",
|
|
18151
|
+
{
|
|
18152
|
+
ref: fileInputRef,
|
|
18153
|
+
type: "file",
|
|
18154
|
+
multiple: true,
|
|
18155
|
+
accept: react$1.UPLOAD_ACCEPT,
|
|
18156
|
+
onChange: handleFileSelect,
|
|
18157
|
+
className: "hidden",
|
|
18158
|
+
disabled
|
|
18159
|
+
}
|
|
18160
|
+
),
|
|
18161
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18162
|
+
"input",
|
|
18163
|
+
{
|
|
18164
|
+
ref: folderInputRef,
|
|
18165
|
+
type: "file",
|
|
18166
|
+
multiple: true,
|
|
18167
|
+
...{ webkitdirectory: "", directory: "" },
|
|
18168
|
+
onChange: handleFileSelect,
|
|
18169
|
+
className: "hidden",
|
|
18170
|
+
disabled
|
|
18171
|
+
}
|
|
18172
|
+
)
|
|
18173
|
+
] }),
|
|
18174
|
+
body
|
|
18175
|
+
]
|
|
18176
|
+
}
|
|
18177
|
+
);
|
|
18178
|
+
}
|
|
18179
|
+
var plural = (count, one, many = `${one}s`) => count === 1 ? one : many;
|
|
18180
|
+
function useAddFromUrls({
|
|
18181
|
+
shared = true,
|
|
18182
|
+
configExtId,
|
|
18183
|
+
onZipFiles
|
|
18184
|
+
} = {}) {
|
|
18185
|
+
const { notify: notify14 } = chunkCNHUJRQ4_cjs.useBlocksEnvironment();
|
|
18186
|
+
const { workspaceId } = chunkFM3IRQJW_cjs.useConnectedWorkspace();
|
|
18187
|
+
const uploadFromUrls = react$1.useUploadFromUrls();
|
|
18188
|
+
return react.useCallback(
|
|
18189
|
+
async (urls) => {
|
|
18190
|
+
if (urls.length === 0 || !workspaceId) return false;
|
|
18191
|
+
let result;
|
|
18192
|
+
try {
|
|
18193
|
+
result = await uploadFromUrls({ urls, shared, configExtId });
|
|
18194
|
+
} catch {
|
|
18195
|
+
return false;
|
|
18196
|
+
}
|
|
18197
|
+
const { docIds, skipped, zipFiles, oversizedInZips, failedZipUrls } = result;
|
|
18198
|
+
if (zipFiles.length > 0) {
|
|
18199
|
+
onZipFiles?.(zipFiles);
|
|
18200
|
+
notify14(
|
|
18201
|
+
`Extracted ${zipFiles.length} ${plural(zipFiles.length, "file")} from ZIP. Click Add files to send.`,
|
|
18202
|
+
"success"
|
|
18203
|
+
);
|
|
18204
|
+
}
|
|
18205
|
+
if (oversizedInZips.length > 0)
|
|
18206
|
+
notify14(
|
|
18207
|
+
`Skipped ${oversizedInZips.length} oversized ${plural(oversizedInZips.length, "file")} inside ZIP archives.`,
|
|
18208
|
+
"warning"
|
|
18209
|
+
);
|
|
18210
|
+
if (failedZipUrls.length > 0)
|
|
18211
|
+
notify14(
|
|
18212
|
+
`Failed to fetch ${failedZipUrls.length} ZIP ${plural(failedZipUrls.length, "URL")}. Browser CORS may block third-party hosts \u2014 try a CORS-enabled URL.`,
|
|
18213
|
+
"error"
|
|
18214
|
+
);
|
|
18215
|
+
if (skipped.length > 0)
|
|
18216
|
+
notify14(
|
|
18217
|
+
`${skipped.length} ${plural(skipped.length, "URL was", "URLs were")} skipped:
|
|
18218
|
+
${skipped.map((s) => `${s.file_name}: ${s.reason}`).join("\n")}`,
|
|
18219
|
+
"warning"
|
|
18220
|
+
);
|
|
18221
|
+
if (docIds.length > 0)
|
|
18222
|
+
notify14(
|
|
18223
|
+
`Upload complete (${docIds.length} ${plural(docIds.length, "document")}). Indexing in the background...`,
|
|
18224
|
+
"success",
|
|
18225
|
+
{ workspaceId }
|
|
18226
|
+
);
|
|
18227
|
+
return true;
|
|
18228
|
+
},
|
|
18229
|
+
[workspaceId, uploadFromUrls, shared, configExtId, onZipFiles, notify14]
|
|
18230
|
+
);
|
|
18231
|
+
}
|
|
18232
|
+
function formatFileSize(bytes) {
|
|
18233
|
+
if (bytes === 0) return "0 Bytes";
|
|
18234
|
+
const k = 1024;
|
|
18235
|
+
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
18236
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
18237
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
|
|
18238
|
+
}
|
|
18239
|
+
function renderFileIcon(fileName) {
|
|
18240
|
+
const Icon = ui.getFileTypeIcon(fileName);
|
|
18241
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 20 });
|
|
18242
|
+
}
|
|
18243
|
+
function plural2(count) {
|
|
18244
|
+
return ui.getEntityLabel("DOCUMENT", count === 1 ? "SINGULAR" : "PLURAL");
|
|
18245
|
+
}
|
|
18246
|
+
function DefaultFooter({ submit, shared, onSharedChange }) {
|
|
18247
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center justify-end gap-4 border-t border-border px-4 py-3 sm:px-6", children: [
|
|
18248
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18249
|
+
chunkQJFJ5JBF_cjs.ShareToggle,
|
|
18250
|
+
{
|
|
18251
|
+
isVisible: shared,
|
|
18252
|
+
onToggle: onSharedChange,
|
|
18253
|
+
workspaceEntityLabel: ui.getEntityLabel("WORKSPACE"),
|
|
18254
|
+
compact: true
|
|
18255
|
+
}
|
|
18256
|
+
),
|
|
18257
|
+
submit
|
|
18258
|
+
] });
|
|
18259
|
+
}
|
|
18260
|
+
function ConnectedUpload({
|
|
18261
|
+
initialFiles,
|
|
18262
|
+
initialUrls,
|
|
18263
|
+
folder = null,
|
|
18264
|
+
source = null,
|
|
18265
|
+
onPickSource,
|
|
18266
|
+
configExtId,
|
|
18267
|
+
closeOnUpload = true,
|
|
18268
|
+
onClose,
|
|
18269
|
+
onUploadComplete,
|
|
18270
|
+
accounts,
|
|
18271
|
+
renderFooter = DefaultFooter
|
|
18272
|
+
}) {
|
|
18273
|
+
const { notify: notify14 } = chunkCNHUJRQ4_cjs.useBlocksEnvironment();
|
|
18274
|
+
const { openUpgrade } = useFilesSupport();
|
|
18275
|
+
const { workspaceId, live } = chunkFM3IRQJW_cjs.useConnectedWorkspace();
|
|
18276
|
+
const { data: workspaces } = react$1.useWorkspaces({ enabled: live });
|
|
18277
|
+
const workspaceName = workspaces?.find((w) => w.external_id === workspaceId)?.name ?? "this workspace";
|
|
18278
|
+
const uploadFiles = react$1.useUploadFiles();
|
|
18279
|
+
const [files, setFiles] = react.useState(initialFiles ?? []);
|
|
18280
|
+
const [refused, setRefused] = react.useState([]);
|
|
18281
|
+
const [error, setError] = react.useState(null);
|
|
18282
|
+
const [shared, setShared] = react.useState(true);
|
|
18283
|
+
const [uploading, setUploading] = react.useState(null);
|
|
18284
|
+
const [progress, setProgress] = react.useState(null);
|
|
18285
|
+
const { data: tags = [] } = react$1.useTags();
|
|
18286
|
+
const generateTagIds = react.useMemo(
|
|
18287
|
+
() => browser.filterDocumentTags(tags).filter((tag) => tag.instruction && tag.shared).map((tag) => tag.external_id),
|
|
18288
|
+
[tags]
|
|
18289
|
+
);
|
|
18290
|
+
const addFiles = react.useCallback(
|
|
18291
|
+
(chosen) => setFiles((current) => {
|
|
18292
|
+
if (current.length === 0) return chosen;
|
|
18293
|
+
const names = new Set(current.map((file) => file.name));
|
|
18294
|
+
const fresh = chosen.filter((file) => !names.has(file.name));
|
|
18295
|
+
const duplicates = chosen.length - fresh.length;
|
|
18296
|
+
if (duplicates > 0)
|
|
18297
|
+
notify14(`Skipped ${duplicates} duplicate file${duplicates > 1 ? "s" : ""}`, "info");
|
|
18298
|
+
return [...current, ...fresh];
|
|
18299
|
+
}),
|
|
18300
|
+
[notify14]
|
|
18301
|
+
);
|
|
18302
|
+
const fail = react.useCallback(
|
|
18303
|
+
(message, toast = true) => {
|
|
18304
|
+
setError(message);
|
|
18305
|
+
if (toast) notify14(message, "error");
|
|
18306
|
+
setUploading(null);
|
|
18307
|
+
setProgress(null);
|
|
18308
|
+
},
|
|
18309
|
+
[notify14]
|
|
18310
|
+
);
|
|
18311
|
+
const handleUpload = react.useCallback(async () => {
|
|
18312
|
+
if (files.length === 0 || !workspaceId) return;
|
|
18313
|
+
setUploading(files.length);
|
|
18314
|
+
setError(null);
|
|
18315
|
+
try {
|
|
18316
|
+
const { docIds, skipped } = await uploadFiles(
|
|
18317
|
+
{ files, folder, shared, configExtId, generateTagIds },
|
|
18318
|
+
setProgress
|
|
18319
|
+
);
|
|
18320
|
+
if (skipped.length > 0) {
|
|
18321
|
+
const summary = skipped.map((s) => `${s.file_name}: ${s.reason}`).join("\n");
|
|
18322
|
+
const quota = skipped.some((s) => /quota|limit/i.test(s.reason ?? ""));
|
|
18323
|
+
notify14(
|
|
18324
|
+
`${skipped.length} ${skipped.length === 1 ? "file was" : "files were"} skipped:
|
|
18325
|
+
${summary}`,
|
|
18326
|
+
"warning",
|
|
18327
|
+
quota && openUpgrade ? { action: { label: "Upgrade", onClick: openUpgrade }, duration: 8e3 } : void 0
|
|
18328
|
+
);
|
|
18329
|
+
}
|
|
18330
|
+
setFiles([]);
|
|
18331
|
+
if (docIds.length > 0) {
|
|
18332
|
+
const ai = generateTagIds.length > 0 ? " AI annotations queued." : "";
|
|
18333
|
+
notify14(
|
|
18334
|
+
`Uploaded ${docIds.length} ${docIds.length === 1 ? "file" : "files"}. Processing in background...${ai}`,
|
|
18335
|
+
"success",
|
|
18336
|
+
{ workspaceId }
|
|
18337
|
+
);
|
|
18338
|
+
}
|
|
18339
|
+
setUploading(null);
|
|
18340
|
+
setProgress(null);
|
|
18341
|
+
onUploadComplete?.();
|
|
18342
|
+
if (closeOnUpload) onClose?.();
|
|
18343
|
+
} catch (err) {
|
|
18344
|
+
const status = err.status;
|
|
18345
|
+
if (status === 402) {
|
|
18346
|
+
fail(err.detail || "Quota exceeded", false);
|
|
18347
|
+
} else {
|
|
18348
|
+
fail("Failed to upload documents. Please try again.");
|
|
18349
|
+
}
|
|
18350
|
+
}
|
|
18351
|
+
}, [
|
|
18352
|
+
files,
|
|
18353
|
+
workspaceId,
|
|
18354
|
+
uploadFiles,
|
|
18355
|
+
folder,
|
|
18356
|
+
shared,
|
|
18357
|
+
configExtId,
|
|
18358
|
+
generateTagIds,
|
|
18359
|
+
notify14,
|
|
18360
|
+
openUpgrade,
|
|
18361
|
+
onUploadComplete,
|
|
18362
|
+
closeOnUpload,
|
|
18363
|
+
onClose,
|
|
18364
|
+
fail
|
|
18365
|
+
]);
|
|
18366
|
+
const zipFilesAdded = react.useRef(false);
|
|
18367
|
+
const addFromUrls = useAddFromUrls({
|
|
18368
|
+
shared,
|
|
18369
|
+
configExtId,
|
|
18370
|
+
onZipFiles: (zipFiles) => {
|
|
18371
|
+
zipFilesAdded.current = true;
|
|
18372
|
+
addFiles(zipFiles);
|
|
18373
|
+
}
|
|
18374
|
+
});
|
|
18375
|
+
const handleUrls = react.useCallback(
|
|
18376
|
+
async (urls) => {
|
|
18377
|
+
if (urls.length === 0) return false;
|
|
18378
|
+
setUploading(urls.length);
|
|
18379
|
+
setError(null);
|
|
18380
|
+
zipFilesAdded.current = false;
|
|
18381
|
+
const ok = await addFromUrls(urls);
|
|
18382
|
+
setUploading(null);
|
|
18383
|
+
if (ok) {
|
|
18384
|
+
if (closeOnUpload && !zipFilesAdded.current) onClose?.();
|
|
18385
|
+
onUploadComplete?.();
|
|
18386
|
+
}
|
|
18387
|
+
return ok;
|
|
18388
|
+
},
|
|
18389
|
+
[addFromUrls, closeOnUpload, onClose, onUploadComplete]
|
|
18390
|
+
);
|
|
18391
|
+
const handedUrls = react.useRef(false);
|
|
18392
|
+
react.useEffect(() => {
|
|
18393
|
+
if (handedUrls.current || !initialUrls?.length) return;
|
|
18394
|
+
handedUrls.current = true;
|
|
18395
|
+
void handleUrls(initialUrls);
|
|
18396
|
+
}, [initialUrls, handleUrls]);
|
|
18397
|
+
const count = files.length || uploading || 0;
|
|
18398
|
+
const submit = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18399
|
+
ui.Button,
|
|
18400
|
+
{
|
|
18401
|
+
onClick: handleUpload,
|
|
18402
|
+
disabled: files.length === 0,
|
|
18403
|
+
size: "default",
|
|
18404
|
+
"data-testid": "upload-submit-button",
|
|
18405
|
+
children: [
|
|
18406
|
+
"Add ",
|
|
18407
|
+
files.length,
|
|
18408
|
+
" ",
|
|
18409
|
+
plural2(files.length)
|
|
18410
|
+
]
|
|
18411
|
+
}
|
|
18412
|
+
);
|
|
18413
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-0 flex-1 flex-col", "data-testid": "upload-documents", children: [
|
|
18414
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1 overflow-y-auto pb-2", children: uploading === null ? /* @__PURE__ */ jsxRuntime.jsxs(chunkQJFJ5JBF_cjs.UploadContainer, { className: "w-full px-4 pb-4 pt-2 sm:px-6", children: [
|
|
18415
|
+
files.length === 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
18416
|
+
ConnectedUploadDropzone,
|
|
18417
|
+
{
|
|
18418
|
+
onFilesSelected: addFiles,
|
|
18419
|
+
onFilesRejected: (more) => setRefused((current) => [...current, ...more]),
|
|
18420
|
+
onUrlsSubmit: handleUrls,
|
|
18421
|
+
title: "Drag & drop files or folders",
|
|
18422
|
+
subtitle: "",
|
|
18423
|
+
workspaceName,
|
|
18424
|
+
source,
|
|
18425
|
+
onPickSource,
|
|
18426
|
+
accounts
|
|
18427
|
+
}
|
|
18428
|
+
),
|
|
18429
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18430
|
+
chunkQJFJ5JBF_cjs.SelectedFilesList,
|
|
18431
|
+
{
|
|
18432
|
+
renderFileIcon,
|
|
18433
|
+
files,
|
|
18434
|
+
onRemoveFile: (index) => setFiles((current) => current.filter((_, i) => i !== index)),
|
|
18435
|
+
onClearAll: () => setFiles([]),
|
|
18436
|
+
formatFileSize
|
|
18437
|
+
}
|
|
18438
|
+
),
|
|
18439
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.RejectedFilesList, { files: refused, onClear: () => setRefused([]) }),
|
|
18440
|
+
error && /* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.UploadErrorMessage, { message: error })
|
|
18441
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.UploadContainer, { className: "w-full p-4 sm:p-6", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
18442
|
+
chunkQJFJ5JBF_cjs.UploadProgress,
|
|
18443
|
+
{
|
|
18444
|
+
fileCount: count,
|
|
18445
|
+
entityLabel: plural2(count),
|
|
18446
|
+
percentage: progress?.percentage ?? 0,
|
|
18447
|
+
batchInfo: progress?.batches ?? null
|
|
18448
|
+
}
|
|
18449
|
+
) }) }),
|
|
18450
|
+
uploading === null && files.length > 0 && renderFooter({ submit, shared, onSharedChange: setShared })
|
|
18451
|
+
] });
|
|
18452
|
+
}
|
|
18453
|
+
var VENDOR_PRODUCTS = {
|
|
18454
|
+
microsoft: [{ key: "outlook" }, { key: "onedrive", product: "onedrive" }],
|
|
18455
|
+
gmail: [{ key: "gmail" }, { key: "googledrive", product: "googledrive" }],
|
|
18456
|
+
gdrive: [{ key: "googledrive", product: "googledrive" }]
|
|
18457
|
+
};
|
|
18458
|
+
function AddFromAccountsButton({
|
|
18459
|
+
onImportFromEmail,
|
|
18460
|
+
"data-testid": dataTestId = "empty-import-from-email"
|
|
18461
|
+
}) {
|
|
18462
|
+
const { data: catalog = [] } = react$1.useConnectorCatalog();
|
|
18463
|
+
const isVendorVisible = react$1.useConnectorVendorVisibility();
|
|
18464
|
+
const vendors = catalog.filter((c) => isVendorVisible(c.vendor_key));
|
|
18465
|
+
if (vendors.length === 0) return null;
|
|
18466
|
+
const seen = /* @__PURE__ */ new Set();
|
|
18467
|
+
const marks = [];
|
|
18468
|
+
for (const v of vendors) {
|
|
18469
|
+
const products = VENDOR_PRODUCTS[v.vendor_key] ?? [{ key: v.vendor_key }];
|
|
18470
|
+
for (const p of products) {
|
|
18471
|
+
if (seen.has(p.key)) continue;
|
|
18472
|
+
seen.add(p.key);
|
|
18473
|
+
marks.push({ key: p.key, vendorKey: v.vendor_key, product: p.product });
|
|
18474
|
+
}
|
|
18475
|
+
}
|
|
18476
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
18477
|
+
ui.Button,
|
|
18478
|
+
{
|
|
18479
|
+
variant: "outline",
|
|
18480
|
+
onClick: onImportFromEmail,
|
|
18481
|
+
className: "gap-2",
|
|
18482
|
+
"data-testid": dataTestId,
|
|
18483
|
+
children: [
|
|
18484
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex items-center gap-1", children: marks.map((m) => /* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.VendorLogo, { vendorKey: m.vendorKey, product: m.product, className: "h-4 w-4" }, m.key)) }),
|
|
18485
|
+
"Add from accounts"
|
|
18486
|
+
]
|
|
18487
|
+
}
|
|
18488
|
+
);
|
|
18489
|
+
}
|
|
18490
|
+
function EmptyWorkspaceUpload({
|
|
18491
|
+
onFilesSelected,
|
|
18492
|
+
onUrlsSubmit,
|
|
18493
|
+
onImportFromEmail,
|
|
18494
|
+
"data-testid": dataTestId
|
|
18495
|
+
}) {
|
|
18496
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
18497
|
+
"div",
|
|
18498
|
+
{
|
|
18499
|
+
className: "flex h-full flex-col items-center gap-3 overflow-y-auto p-8 max-sm:p-4",
|
|
18500
|
+
"data-testid": dataTestId,
|
|
18501
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-auto flex w-full flex-col items-center gap-3", children: [
|
|
18502
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
18503
|
+
ConnectedUploadDropzone,
|
|
18504
|
+
{
|
|
18505
|
+
onFilesSelected,
|
|
18506
|
+
onUrlsSubmit,
|
|
18507
|
+
title: "Drag & Drop Files or Folders Here",
|
|
18508
|
+
subtitle: "or click to browse from your computer",
|
|
18509
|
+
compact: true,
|
|
18510
|
+
className: "w-full max-w-2xl",
|
|
18511
|
+
compactLeadingAction: onImportFromEmail && /* @__PURE__ */ jsxRuntime.jsx(AddFromAccountsButton, { onImportFromEmail })
|
|
18512
|
+
}
|
|
18513
|
+
),
|
|
18514
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkQJFJ5JBF_cjs.PrivacyExplainerModal, {})
|
|
18515
|
+
] })
|
|
18516
|
+
}
|
|
18517
|
+
);
|
|
18518
|
+
}
|
|
17964
18519
|
function ActiveChat({ agentId, workspaceId }) {
|
|
17965
18520
|
const chat = react$1.useArbiChat({
|
|
17966
18521
|
agentId,
|
|
@@ -18201,6 +18756,7 @@ Object.defineProperty(exports, "useConnection", {
|
|
|
18201
18756
|
get: function () { return chunkFM3IRQJW_cjs.useConnection; }
|
|
18202
18757
|
});
|
|
18203
18758
|
exports.AddAddonDialog = AddAddonDialog;
|
|
18759
|
+
exports.AddFromAccountsButton = AddFromAccountsButton;
|
|
18204
18760
|
exports.ArbiAppProvider = ArbiAppProvider;
|
|
18205
18761
|
exports.BACKFILL_OPTIONS = BACKFILL_OPTIONS;
|
|
18206
18762
|
exports.BillingProjectEntity = BillingProjectEntity;
|
|
@@ -18245,6 +18801,8 @@ exports.ConnectedTaskAccessRequest = ConnectedTaskAccessRequest;
|
|
|
18245
18801
|
exports.ConnectedTaskActivityDialog = ConnectedTaskActivityDialog;
|
|
18246
18802
|
exports.ConnectedThreadFollow = ConnectedThreadFollow;
|
|
18247
18803
|
exports.ConnectedUpcomingEvents = ConnectedUpcomingEvents;
|
|
18804
|
+
exports.ConnectedUpload = ConnectedUpload;
|
|
18805
|
+
exports.ConnectedUploadDropzone = ConnectedUploadDropzone;
|
|
18248
18806
|
exports.ConnectedWorkflowHistory = ConnectedWorkflowHistory;
|
|
18249
18807
|
exports.ConnectedWorkflowRunner = ConnectedWorkflowRunner;
|
|
18250
18808
|
exports.ConnectedWorkspaceActivity = ConnectedWorkspaceActivity;
|
|
@@ -18261,6 +18819,7 @@ exports.DEFAULT_SETTINGS_SECTIONS = DEFAULT_SETTINGS_SECTIONS;
|
|
|
18261
18819
|
exports.DEFAULT_TIMELINE_LABEL_WIDTH = DEFAULT_TIMELINE_LABEL_WIDTH;
|
|
18262
18820
|
exports.DEFAULT_WORKSPACE_LIST_LABELS = DEFAULT_WORKSPACE_LIST_LABELS;
|
|
18263
18821
|
exports.DocumentSyncGlyph = DocumentSyncGlyph;
|
|
18822
|
+
exports.EmptyWorkspaceUpload = EmptyWorkspaceUpload;
|
|
18264
18823
|
exports.FACTS_GRID_ID = FACTS_GRID_ID;
|
|
18265
18824
|
exports.FileTooltipContent = FileTooltipContent;
|
|
18266
18825
|
exports.FilesSupportProvider = FilesSupportProvider;
|
|
@@ -18301,6 +18860,7 @@ exports.requestProjectBillingFocus = requestProjectBillingFocus;
|
|
|
18301
18860
|
exports.resolveMailbox = resolveMailbox;
|
|
18302
18861
|
exports.startMenuItem = startMenuItem;
|
|
18303
18862
|
exports.toWorkspaceSummary = toWorkspaceSummary;
|
|
18863
|
+
exports.useAddFromUrls = useAddFromUrls;
|
|
18304
18864
|
exports.useAutoRefreshPendingProjects = useAutoRefreshPendingProjects;
|
|
18305
18865
|
exports.useCalendarViewStore = useCalendarViewStore;
|
|
18306
18866
|
exports.useConnectedDocxNotifications = useConnectedDocxNotifications;
|