@arbidocs/blocks 0.4.155 → 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-OLWRQSRS.js → ConnectedNativeDocxComparison-2PLOOXSH.js} +6 -6
- package/dist/{ConnectedNativeDocxComparison-OLWRQSRS.js.map → ConnectedNativeDocxComparison-2PLOOXSH.js.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-YORMOPPN.cjs → ConnectedNativeDocxComparison-S25BPUH5.cjs} +7 -7
- package/dist/{ConnectedNativeDocxComparison-YORMOPPN.cjs.map → ConnectedNativeDocxComparison-S25BPUH5.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-34EBIIFS.js → ConnectedNativeDocxEditor-JJAGMHZC.js} +4 -4
- package/dist/{ConnectedNativeDocxEditor-34EBIIFS.js.map → ConnectedNativeDocxEditor-JJAGMHZC.js.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-EHTWGGX3.cjs → ConnectedNativeDocxEditor-YA4HWLY4.cjs} +6 -6
- package/dist/{ConnectedNativeDocxEditor-EHTWGGX3.cjs.map → ConnectedNativeDocxEditor-YA4HWLY4.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-5DK6QGYN.cjs → ConnectedStreamedWordArtifact-EXYZAU4Y.cjs} +7 -7
- package/dist/ConnectedStreamedWordArtifact-EXYZAU4Y.cjs.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-GLIDLSAS.js → ConnectedStreamedWordArtifact-YAAXY5KY.js} +6 -6
- package/dist/{ConnectedStreamedWordArtifact-GLIDLSAS.js.map → ConnectedStreamedWordArtifact-YAAXY5KY.js.map} +1 -1
- package/dist/{NativeDocxEditor-XT5ZLFGU.js → NativeDocxEditor-JBQMH3MP.js} +3 -3
- package/dist/{NativeDocxEditor-XT5ZLFGU.js.map → NativeDocxEditor-JBQMH3MP.js.map} +1 -1
- package/dist/{NativeDocxEditor-5VBNM5I7.cjs → NativeDocxEditor-M3I776GD.cjs} +7 -7
- package/dist/{NativeDocxEditor-5VBNM5I7.cjs.map → NativeDocxEditor-M3I776GD.cjs.map} +1 -1
- package/dist/{chunk-MF5KQ4PS.js → chunk-2CWM2CFZ.js} +4 -4
- package/dist/{chunk-MF5KQ4PS.js.map → chunk-2CWM2CFZ.js.map} +1 -1
- package/dist/{chunk-6HMCF4AJ.js → chunk-5ZIYPZYE.js} +1033 -5
- package/dist/chunk-5ZIYPZYE.js.map +1 -0
- package/dist/{chunk-KHXEIEXN.js → chunk-7IRSCMNK.js} +3 -3
- package/dist/{chunk-KHXEIEXN.js.map → chunk-7IRSCMNK.js.map} +1 -1
- package/dist/{chunk-TZOQKV64.js → chunk-EWCJXUBP.js} +3 -3
- package/dist/{chunk-TZOQKV64.js.map → chunk-EWCJXUBP.js.map} +1 -1
- package/dist/{chunk-CU6LDQ57.js → chunk-F3EZDBDJ.js} +4 -4
- package/dist/{chunk-CU6LDQ57.js.map → chunk-F3EZDBDJ.js.map} +1 -1
- package/dist/{chunk-W7CWGURO.js → chunk-FTZ45WHY.js} +6 -685
- package/dist/chunk-FTZ45WHY.js.map +1 -0
- package/dist/{chunk-CQCNU5KT.cjs → chunk-IJEISII2.cjs} +6 -6
- package/dist/{chunk-CQCNU5KT.cjs.map → chunk-IJEISII2.cjs.map} +1 -1
- package/dist/{chunk-NPR5BGFF.cjs → chunk-JSQEAPTC.cjs} +26 -14
- package/dist/chunk-JSQEAPTC.cjs.map +1 -0
- package/dist/{chunk-MUDEL7UL.cjs → chunk-NPLGB4LI.cjs} +4 -703
- package/dist/chunk-NPLGB4LI.cjs.map +1 -0
- package/dist/{chunk-265GOG4W.js → chunk-ONTUMV74.js} +26 -14
- package/dist/chunk-ONTUMV74.js.map +1 -0
- package/dist/chunk-OTU5KGQ6.cjs +18 -0
- package/dist/{chunk-HUATKA3M.cjs.map → chunk-OTU5KGQ6.cjs.map} +1 -1
- package/dist/{chunk-GO3BN76C.js → chunk-PGOSIJ2I.js} +3 -3
- package/dist/{chunk-GO3BN76C.js.map → chunk-PGOSIJ2I.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-S74QMZVZ.cjs +18 -0
- package/dist/{chunk-C3SMTA3C.cjs.map → chunk-S74QMZVZ.cjs.map} +1 -1
- package/dist/{chunk-KUT2Y7JF.cjs → chunk-TQIY2SVY.cjs} +5 -5
- package/dist/{chunk-KUT2Y7JF.cjs.map → chunk-TQIY2SVY.cjs.map} +1 -1
- package/dist/{chunk-757OYF6G.cjs → chunk-VY4UFXTM.cjs} +4 -4
- package/dist/{chunk-757OYF6G.cjs.map → chunk-VY4UFXTM.cjs.map} +1 -1
- package/dist/connect/docx.cjs +10 -10
- package/dist/connect/docx.js +6 -6
- package/dist/connect/index.cjs +626 -66
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +564 -9
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/viewer.cjs +43 -43
- package/dist/connect/viewer.js +5 -5
- 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/docx/index.cjs +47 -47
- package/dist/docx/index.js +3 -3
- 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/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs +96 -29
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.cts +1 -1
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.d.ts +1 -1
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.js +98 -31
- package/node_modules/@arbidocs/coedit/dist/hocuspocus.js.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/index.cjs +96 -29
- package/node_modules/@arbidocs/coedit/dist/index.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/index.d.cts +1 -1
- package/node_modules/@arbidocs/coedit/dist/index.d.ts +1 -1
- package/node_modules/@arbidocs/coedit/dist/index.js +98 -31
- package/node_modules/@arbidocs/coedit/dist/index.js.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.cjs +98 -33
- package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.d.cts +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.d.ts +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.js +99 -34
- package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/{session-Cf9iu1Vt.d.cts → session-WGvWs6yO.d.cts} +22 -4
- package/node_modules/@arbidocs/coedit/dist/{session-Cf9iu1Vt.d.ts → session-WGvWs6yO.d.ts} +22 -4
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ConnectedStreamedWordArtifact-5DK6QGYN.cjs.map +0 -1
- package/dist/chunk-265GOG4W.js.map +0 -1
- package/dist/chunk-6HMCF4AJ.js.map +0 -1
- package/dist/chunk-C3SMTA3C.cjs +0 -18
- package/dist/chunk-HUATKA3M.cjs +0 -18
- package/dist/chunk-MUDEL7UL.cjs.map +0 -1
- package/dist/chunk-NPR5BGFF.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
|
@@ -9,15 +9,15 @@ var chunkOU3RGQFX_cjs = require('../chunk-OU3RGQFX.cjs');
|
|
|
9
9
|
require('../chunk-REH7PX3N.cjs');
|
|
10
10
|
var chunkSN2GZ4ZM_cjs = require('../chunk-SN2GZ4ZM.cjs');
|
|
11
11
|
var chunkKBO75NLM_cjs = require('../chunk-KBO75NLM.cjs');
|
|
12
|
-
var
|
|
12
|
+
var chunkIJEISII2_cjs = require('../chunk-IJEISII2.cjs');
|
|
13
13
|
var chunk6I6CVX5G_cjs = require('../chunk-6I6CVX5G.cjs');
|
|
14
|
-
var
|
|
14
|
+
var chunkQJFJ5JBF_cjs = require('../chunk-QJFJ5JBF.cjs');
|
|
15
15
|
require('../chunk-223D4727.cjs');
|
|
16
16
|
var chunkCB4TIDEX_cjs = require('../chunk-CB4TIDEX.cjs');
|
|
17
17
|
var chunkFM3IRQJW_cjs = require('../chunk-FM3IRQJW.cjs');
|
|
18
18
|
var chunkJH6JTI76_cjs = require('../chunk-JH6JTI76.cjs');
|
|
19
19
|
require('../chunk-464YPRAE.cjs');
|
|
20
|
-
require('../chunk-
|
|
20
|
+
require('../chunk-JSQEAPTC.cjs');
|
|
21
21
|
var chunkB3FMUFAW_cjs = require('../chunk-B3FMUFAW.cjs');
|
|
22
22
|
var chunk2WLXQGWC_cjs = require('../chunk-2WLXQGWC.cjs');
|
|
23
23
|
var chunk5FYU7ZIU_cjs = require('../chunk-5FYU7ZIU.cjs');
|
|
@@ -1652,7 +1652,7 @@ function ConnectedTaskActivityDialog({
|
|
|
1652
1652
|
const activity = react$1.useConversationActivity(conversationId, { live });
|
|
1653
1653
|
const { data: agents = [] } = react$1.useAgents();
|
|
1654
1654
|
const { userId } = chunkFM3IRQJW_cjs.useConnectedWorkspace();
|
|
1655
|
-
const { members } =
|
|
1655
|
+
const { members } = chunkIJEISII2_cjs.useConnectedWorkspaceRole();
|
|
1656
1656
|
const renderPerson = react.useCallback(
|
|
1657
1657
|
(id) => {
|
|
1658
1658
|
const isMe = !!id && id === userId;
|
|
@@ -2129,7 +2129,7 @@ function WorkflowWordDialog({
|
|
|
2129
2129
|
title: title ?? labels.wordTitle,
|
|
2130
2130
|
size: "xl",
|
|
2131
2131
|
testId: "workflow-word-dialog",
|
|
2132
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2132
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkULWRNGGE_cjs.ModalScaffold.Body, { className: "h-[70dvh] p-0", children: /* @__PURE__ */ jsxRuntime.jsx(chunkIJEISII2_cjs.ConnectedNativeDocxEditor, { documentId: id, title: title ?? labels.wordTitle }) })
|
|
2133
2133
|
}
|
|
2134
2134
|
);
|
|
2135
2135
|
}
|
|
@@ -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) => ({
|
|
@@ -4358,7 +4358,7 @@ function useFactFilters(notes, view, chat) {
|
|
|
4358
4358
|
(selected, setSelected, opts) => {
|
|
4359
4359
|
const applied = new Set(selected);
|
|
4360
4360
|
return /* @__PURE__ */ jsxRuntime.jsx(chunkB3FMUFAW_cjs.FactFieldRow, { label: "Labels", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4361
|
-
|
|
4361
|
+
chunkQJFJ5JBF_cjs.FieldLabelsSelect,
|
|
4362
4362
|
{
|
|
4363
4363
|
options: labelOptions,
|
|
4364
4364
|
appliedIds: applied,
|
|
@@ -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(
|
|
@@ -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("");
|
|
@@ -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);
|
|
@@ -5069,7 +5069,7 @@ function ConnectedFactsPage({
|
|
|
5069
5069
|
tools: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5070
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,
|
|
@@ -11962,7 +11962,7 @@ var MailBodyEditor = react.lazy(
|
|
|
11962
11962
|
}))
|
|
11963
11963
|
);
|
|
11964
11964
|
var NativeDocxEditor = react.lazy(
|
|
11965
|
-
() => import('../NativeDocxEditor-
|
|
11965
|
+
() => import('../NativeDocxEditor-M3I776GD.cjs').then((m) => ({ default: m.NativeDocxEditor }))
|
|
11966
11966
|
);
|
|
11967
11967
|
var NO_WORD = {
|
|
11968
11968
|
adapter: {
|
|
@@ -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,
|
|
@@ -17256,7 +17256,7 @@ var COMPACT_BELOW = 132;
|
|
|
17256
17256
|
var NO_DOCUMENTS = [];
|
|
17257
17257
|
function useFilesWorkspace() {
|
|
17258
17258
|
const { workspaceId, userId, live } = chunkFM3IRQJW_cjs.useConnectedWorkspace();
|
|
17259
|
-
const { members, role } =
|
|
17259
|
+
const { members, role } = chunkIJEISII2_cjs.useConnectedWorkspaceRole();
|
|
17260
17260
|
const { data: workspaces } = react$1.useWorkspaces({ enabled: live });
|
|
17261
17261
|
const workspaceName = workspaces?.find((w) => w.external_id === workspaceId)?.name;
|
|
17262
17262
|
return {
|
|
@@ -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,
|
|
@@ -18118,43 +18673,43 @@ Object.defineProperty(exports, "useWorkspaceDocs", {
|
|
|
18118
18673
|
});
|
|
18119
18674
|
Object.defineProperty(exports, "ConnectedWorkflowDocumentsField", {
|
|
18120
18675
|
enumerable: true,
|
|
18121
|
-
get: function () { return
|
|
18676
|
+
get: function () { return chunkIJEISII2_cjs.ConnectedWorkflowDocumentsField; }
|
|
18122
18677
|
});
|
|
18123
18678
|
Object.defineProperty(exports, "ConnectedWorkflowLauncher", {
|
|
18124
18679
|
enumerable: true,
|
|
18125
|
-
get: function () { return
|
|
18680
|
+
get: function () { return chunkIJEISII2_cjs.ConnectedWorkflowLauncher; }
|
|
18126
18681
|
});
|
|
18127
18682
|
Object.defineProperty(exports, "ConnectedWorkflowsTable", {
|
|
18128
18683
|
enumerable: true,
|
|
18129
|
-
get: function () { return
|
|
18684
|
+
get: function () { return chunkIJEISII2_cjs.ConnectedWorkflowsTable; }
|
|
18130
18685
|
});
|
|
18131
18686
|
Object.defineProperty(exports, "DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS", {
|
|
18132
18687
|
enumerable: true,
|
|
18133
|
-
get: function () { return
|
|
18688
|
+
get: function () { return chunkIJEISII2_cjs.DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS; }
|
|
18134
18689
|
});
|
|
18135
18690
|
Object.defineProperty(exports, "NativeDocxSupportProvider", {
|
|
18136
18691
|
enumerable: true,
|
|
18137
|
-
get: function () { return
|
|
18692
|
+
get: function () { return chunkIJEISII2_cjs.NativeDocxSupportProvider; }
|
|
18138
18693
|
});
|
|
18139
18694
|
Object.defineProperty(exports, "toWorkflowFieldDocument", {
|
|
18140
18695
|
enumerable: true,
|
|
18141
|
-
get: function () { return
|
|
18696
|
+
get: function () { return chunkIJEISII2_cjs.toWorkflowFieldDocument; }
|
|
18142
18697
|
});
|
|
18143
18698
|
Object.defineProperty(exports, "useConnectedAgentOptions", {
|
|
18144
18699
|
enumerable: true,
|
|
18145
|
-
get: function () { return
|
|
18700
|
+
get: function () { return chunkIJEISII2_cjs.useConnectedAgentOptions; }
|
|
18146
18701
|
});
|
|
18147
18702
|
Object.defineProperty(exports, "useConnectedWorkflowScopeSource", {
|
|
18148
18703
|
enumerable: true,
|
|
18149
|
-
get: function () { return
|
|
18704
|
+
get: function () { return chunkIJEISII2_cjs.useConnectedWorkflowScopeSource; }
|
|
18150
18705
|
});
|
|
18151
18706
|
Object.defineProperty(exports, "useConnectedWorkspaceRole", {
|
|
18152
18707
|
enumerable: true,
|
|
18153
|
-
get: function () { return
|
|
18708
|
+
get: function () { return chunkIJEISII2_cjs.useConnectedWorkspaceRole; }
|
|
18154
18709
|
});
|
|
18155
18710
|
Object.defineProperty(exports, "useNativeDocxSupport", {
|
|
18156
18711
|
enumerable: true,
|
|
18157
|
-
get: function () { return
|
|
18712
|
+
get: function () { return chunkIJEISII2_cjs.useNativeDocxSupport; }
|
|
18158
18713
|
});
|
|
18159
18714
|
Object.defineProperty(exports, "DocumentViewerSupportProvider", {
|
|
18160
18715
|
enumerable: true,
|
|
@@ -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;
|