@arbidocs/blocks 0.4.154 → 0.4.156
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} +7 -7
- package/dist/{ConnectedNativeDocxComparison-OLWRQSRS.js.map → ConnectedNativeDocxComparison-2PLOOXSH.js.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-YORMOPPN.cjs → ConnectedNativeDocxComparison-S25BPUH5.cjs} +8 -8
- package/dist/{ConnectedNativeDocxComparison-YORMOPPN.cjs.map → ConnectedNativeDocxComparison-S25BPUH5.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-34EBIIFS.js → ConnectedNativeDocxEditor-JJAGMHZC.js} +5 -5
- package/dist/{ConnectedNativeDocxEditor-34EBIIFS.js.map → ConnectedNativeDocxEditor-JJAGMHZC.js.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-EHTWGGX3.cjs → ConnectedNativeDocxEditor-YA4HWLY4.cjs} +7 -7
- package/dist/{ConnectedNativeDocxEditor-EHTWGGX3.cjs.map → ConnectedNativeDocxEditor-YA4HWLY4.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-5DK6QGYN.cjs → ConnectedStreamedWordArtifact-EXYZAU4Y.cjs} +8 -8
- package/dist/ConnectedStreamedWordArtifact-EXYZAU4Y.cjs.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-GLIDLSAS.js → ConnectedStreamedWordArtifact-YAAXY5KY.js} +7 -7
- 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/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-MF5KQ4PS.js → chunk-2CWM2CFZ.js} +4 -4
- package/dist/{chunk-MF5KQ4PS.js.map → chunk-2CWM2CFZ.js.map} +1 -1
- package/dist/{chunk-QKR5LWDO.js → chunk-6HG56GCT.js} +4 -4
- package/dist/{chunk-QKR5LWDO.js.map → chunk-6HG56GCT.js.map} +1 -1
- package/dist/chunk-6HMCF4AJ.js +1720 -0
- package/dist/chunk-6HMCF4AJ.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-YF3QUHKN.cjs → chunk-FEGXFABZ.cjs} +3 -3
- package/dist/{chunk-YF3QUHKN.cjs.map → chunk-FEGXFABZ.cjs.map} +1 -1
- package/dist/{chunk-GC2FSPSQ.cjs → chunk-HDJRSCRE.cjs} +6 -6
- package/dist/{chunk-GC2FSPSQ.cjs.map → chunk-HDJRSCRE.cjs.map} +1 -1
- 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-BDA3RHYD.cjs → chunk-MUDEL7UL.cjs} +25 -884
- package/dist/chunk-MUDEL7UL.cjs.map +1 -0
- package/dist/{chunk-6QAAIDQQ.cjs → chunk-O3FB62T5.cjs} +47 -47
- package/dist/{chunk-6QAAIDQQ.cjs.map → chunk-O3FB62T5.cjs.map} +1 -1
- 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-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-MNG7N6M2.js → chunk-UKCCV63X.js} +4 -4
- package/dist/{chunk-MNG7N6M2.js.map → chunk-UKCCV63X.js.map} +1 -1
- package/dist/{chunk-B3FMUFAW.cjs → chunk-UKT3WH5Z.cjs} +3 -3
- package/dist/{chunk-B3FMUFAW.cjs.map → chunk-UKT3WH5Z.cjs.map} +1 -1
- package/dist/{chunk-P6RIBIVN.js → chunk-UPMADXDU.js} +3 -3
- package/dist/{chunk-P6RIBIVN.js.map → chunk-UPMADXDU.js.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/{chunk-RE7NULEY.js → chunk-W7CWGURO.js} +28 -873
- package/dist/chunk-W7CWGURO.js.map +1 -0
- package/dist/chunk-WV4TD2HZ.cjs +1785 -0
- package/dist/chunk-WV4TD2HZ.cjs.map +1 -0
- package/dist/{chunk-WU34CHU5.js → chunk-YMQDDUKW.js} +3 -3
- package/dist/{chunk-WU34CHU5.js.map → chunk-YMQDDUKW.js.map} +1 -1
- package/dist/connect/docx.cjs +11 -11
- package/dist/connect/docx.js +7 -7
- package/dist/connect/index.cjs +1313 -151
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +1175 -27
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/viewer.cjs +48 -52
- package/dist/connect/viewer.cjs.map +1 -1
- package/dist/connect/viewer.js +10 -14
- package/dist/connect/viewer.js.map +1 -1
- package/dist/connection/files/DocumentSyncGlyph.d.ts +28 -0
- package/dist/connection/files/explorer/ConnectedFilesExplorer.d.ts +56 -0
- package/dist/connection/files/explorer/FileTiles.d.ts +87 -0
- package/dist/connection/files/index.d.ts +5 -0
- package/dist/connection/files/store.d.ts +27 -0
- package/dist/connection/files/support.d.ts +38 -0
- package/dist/document-tools/index.cjs +1 -1
- package/dist/document-tools/index.js +1 -1
- package/dist/docx/index.cjs +47 -47
- package/dist/docx/index.js +3 -3
- package/dist/facts/index.cjs +54 -54
- package/dist/facts/index.js +4 -4
- package/dist/files/DocStatusIcon.d.ts +5 -4
- package/dist/files/FailedStageIcon.d.ts +26 -0
- package/dist/files/folders/FolderProviderIcon.d.ts +29 -0
- package/dist/files/folders/folderPaths.d.ts +86 -0
- package/dist/files/folders/index.d.ts +2 -0
- package/dist/files/index.cjs +326 -238
- package/dist/files/index.d.ts +5 -0
- package/dist/files/index.js +2 -2
- package/dist/files/permissions.d.ts +28 -0
- package/dist/files/recently-deleted.d.ts +7 -0
- package/dist/files/visibility.d.ts +31 -0
- package/dist/index.cjs +371 -371
- package/dist/index.js +10 -10
- 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/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 +6 -5
- package/dist/ConnectedStreamedWordArtifact-5DK6QGYN.cjs.map +0 -1
- package/dist/chunk-265GOG4W.js.map +0 -1
- package/dist/chunk-BDA3RHYD.cjs.map +0 -1
- package/dist/chunk-C3SMTA3C.cjs +0 -18
- package/dist/chunk-HUATKA3M.cjs +0 -18
- package/dist/chunk-JGOST4IL.js +0 -648
- package/dist/chunk-JGOST4IL.js.map +0 -1
- package/dist/chunk-NPR5BGFF.cjs.map +0 -1
- package/dist/chunk-RE7NULEY.js.map +0 -1
- package/dist/chunk-YAEXSCUW.cjs +0 -677
- package/dist/chunk-YAEXSCUW.cjs.map +0 -1
|
@@ -0,0 +1,1785 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var chunkFAXXN7KI_cjs = require('./chunk-FAXXN7KI.cjs');
|
|
5
|
+
var chunk3VULDTNL_cjs = require('./chunk-3VULDTNL.cjs');
|
|
6
|
+
var chunk32HW2Q33_cjs = require('./chunk-32HW2Q33.cjs');
|
|
7
|
+
var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
|
|
8
|
+
var chunkKDG6FER6_cjs = require('./chunk-KDG6FER6.cjs');
|
|
9
|
+
var lucideReact = require('lucide-react');
|
|
10
|
+
var ui = require('@arbidocs/react/ui');
|
|
11
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
12
|
+
var react = require('react');
|
|
13
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
14
|
+
|
|
15
|
+
function FilesFilterBar({ className, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
"data-slot": "files-filter-bar",
|
|
20
|
+
className: ui.cn("flex min-w-0 flex-1 flex-nowrap items-center gap-2", className),
|
|
21
|
+
...props
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function FilesTagsButton({
|
|
26
|
+
onClick,
|
|
27
|
+
label = "Tags",
|
|
28
|
+
className,
|
|
29
|
+
testId
|
|
30
|
+
}) {
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
32
|
+
ui.Button,
|
|
33
|
+
{
|
|
34
|
+
variant: "ghost",
|
|
35
|
+
size: "sm",
|
|
36
|
+
className: ui.cn("h-8 shrink-0 gap-1.5 px-2 font-normal pointer-coarse:h-11", className),
|
|
37
|
+
onClick,
|
|
38
|
+
"data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "filter-bar-tags-button" }),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.BookMarked, { className: "h-3.5 w-3.5" }),
|
|
41
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm max-[480px]:sr-only", children: label })
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
function FilesViewCenter({ className, ...props }) {
|
|
47
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
"data-slot": "files-view-center",
|
|
51
|
+
className: ui.cn("@container flex min-w-[9.5rem] flex-1 items-center gap-2", className),
|
|
52
|
+
...props
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function FilesModalFooter({ children, className }) {
|
|
57
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "files-modal-footer",
|
|
61
|
+
className: ui.cn(
|
|
62
|
+
// Sticks to the bottom of the modal's scrolling body so Close is always reachable.
|
|
63
|
+
"sticky bottom-0 z-40 flex justify-end gap-2 border-t border-border bg-background px-4 py-3 sm:px-6",
|
|
64
|
+
className
|
|
65
|
+
),
|
|
66
|
+
children
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// src/files/grid/row-density.ts
|
|
72
|
+
var LINE_PX = 14 * 1.35;
|
|
73
|
+
var CHROME = 18;
|
|
74
|
+
var MIN_LINES = 1;
|
|
75
|
+
var MAX_LINES = 10;
|
|
76
|
+
var rowHeightForLines = (lines) => Math.ceil(lines * LINE_PX + CHROME);
|
|
77
|
+
var linesForRowHeight = (height) => Math.max(MIN_LINES, Math.min(MAX_LINES, Math.floor((height - CHROME) / LINE_PX)));
|
|
78
|
+
var ROW_MIN = rowHeightForLines(MIN_LINES);
|
|
79
|
+
function RowDensityControl({
|
|
80
|
+
rowHeight,
|
|
81
|
+
onRowHeightChange,
|
|
82
|
+
testId = "documents-density"
|
|
83
|
+
}) {
|
|
84
|
+
const lines = linesForRowHeight(rowHeight);
|
|
85
|
+
const setLines = (next) => onRowHeightChange(rowHeightForLines(Math.max(MIN_LINES, Math.min(MAX_LINES, next))));
|
|
86
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { delayDuration: 300, children: [
|
|
87
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-7 items-center gap-1.5 rounded-md border border-input px-2 pointer-coarse:h-11", children: [
|
|
88
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "hidden text-xs text-muted-foreground md:inline", children: "Rows" }),
|
|
89
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
90
|
+
"button",
|
|
91
|
+
{
|
|
92
|
+
type: "button",
|
|
93
|
+
"aria-label": "Shorter rows",
|
|
94
|
+
"data-testid": `${testId}-out`,
|
|
95
|
+
onClick: () => setLines(lines - 1),
|
|
96
|
+
disabled: lines <= MIN_LINES,
|
|
97
|
+
className: "flex items-center justify-center text-muted-foreground hover:text-foreground disabled:opacity-40 pointer-coarse:size-11",
|
|
98
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListChevronsUpDown, { className: "h-4 w-4" })
|
|
99
|
+
}
|
|
100
|
+
),
|
|
101
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
102
|
+
ui.Slider,
|
|
103
|
+
{
|
|
104
|
+
value: [lines],
|
|
105
|
+
min: MIN_LINES,
|
|
106
|
+
max: MAX_LINES,
|
|
107
|
+
step: 1,
|
|
108
|
+
onValueChange: ([value]) => setLines(value),
|
|
109
|
+
"aria-label": "Row height",
|
|
110
|
+
"data-testid": testId,
|
|
111
|
+
className: "w-20"
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
] }) }),
|
|
115
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.TooltipContent, { children: [
|
|
116
|
+
"Row height: ",
|
|
117
|
+
lines,
|
|
118
|
+
" line",
|
|
119
|
+
lines === 1 ? "" : "s"
|
|
120
|
+
] })
|
|
121
|
+
] });
|
|
122
|
+
}
|
|
123
|
+
function FolderBreadcrumb({
|
|
124
|
+
segments,
|
|
125
|
+
size = "xs"
|
|
126
|
+
}) {
|
|
127
|
+
const text = size === "sm" ? "text-sm" : "text-xs";
|
|
128
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "data-slot": "folder-breadcrumb", className: "min-w-0 truncate", children: segments.map((part, i, arr) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-0.5", children: [
|
|
129
|
+
i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: `mx-0.5 ${text} text-muted-foreground/50`, children: "/" }),
|
|
130
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: i < arr.length - 1 ? `${text} text-muted-foreground` : "", children: part })
|
|
131
|
+
] }, i)) });
|
|
132
|
+
}
|
|
133
|
+
function FolderCell({
|
|
134
|
+
folder,
|
|
135
|
+
segments,
|
|
136
|
+
icon,
|
|
137
|
+
isEditable,
|
|
138
|
+
picker,
|
|
139
|
+
className
|
|
140
|
+
}) {
|
|
141
|
+
const display = folder ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
142
|
+
icon ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderOpen, { className: "h-3.5 w-3.5 flex-none shrink-0 text-muted-foreground" }),
|
|
143
|
+
/* @__PURE__ */ jsxRuntime.jsx(FolderBreadcrumb, { segments })
|
|
144
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
145
|
+
const title = folder || void 0;
|
|
146
|
+
if (!isEditable) {
|
|
147
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
"data-slot": "folder-cell",
|
|
151
|
+
title,
|
|
152
|
+
className: ui.cn("flex h-full w-full min-w-0 items-center gap-1.5 text-sm", className),
|
|
153
|
+
children: display
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { children: [
|
|
158
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
159
|
+
"button",
|
|
160
|
+
{
|
|
161
|
+
type: "button",
|
|
162
|
+
"data-slot": "folder-cell",
|
|
163
|
+
title,
|
|
164
|
+
className: ui.cn(
|
|
165
|
+
"flex h-full w-full min-w-0 cursor-pointer items-center gap-1.5 text-left text-sm hover:text-primary",
|
|
166
|
+
className
|
|
167
|
+
),
|
|
168
|
+
children: display
|
|
169
|
+
}
|
|
170
|
+
) }),
|
|
171
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
172
|
+
ui.PopoverContent,
|
|
173
|
+
{
|
|
174
|
+
className: "w-max min-w-[220px] max-w-[min(640px,92vw)] p-0",
|
|
175
|
+
align: "start",
|
|
176
|
+
side: "bottom",
|
|
177
|
+
sideOffset: 4,
|
|
178
|
+
children: picker
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
] });
|
|
182
|
+
}
|
|
183
|
+
var FIELD_SURFACE = "rounded-md border border-input bg-muted/40 text-sm transition-colors hover:bg-background";
|
|
184
|
+
function FieldValue({ tone = "default", isMono, isTruncated, children }) {
|
|
185
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
186
|
+
"span",
|
|
187
|
+
{
|
|
188
|
+
"data-slot": "field-value",
|
|
189
|
+
className: ui.cn(
|
|
190
|
+
"text-sm",
|
|
191
|
+
tone === "strong" && "font-semibold",
|
|
192
|
+
tone === "muted" && "text-muted-foreground",
|
|
193
|
+
isMono && "font-mono",
|
|
194
|
+
isTruncated && "truncate"
|
|
195
|
+
),
|
|
196
|
+
children
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
function FieldFolderSelect({ folder, picker }) {
|
|
201
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { children: [
|
|
202
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
203
|
+
"button",
|
|
204
|
+
{
|
|
205
|
+
type: "button",
|
|
206
|
+
"data-slot": "field-folder-select",
|
|
207
|
+
className: ui.cn(
|
|
208
|
+
FIELD_SURFACE,
|
|
209
|
+
"flex h-9 w-full min-w-0 items-center gap-1.5 px-3 text-left hover:text-primary pointer-coarse:h-11"
|
|
210
|
+
),
|
|
211
|
+
children: [
|
|
212
|
+
folder ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
213
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderOpen, { className: "size-3.5 flex-none shrink-0 text-yellow-600" }),
|
|
214
|
+
/* @__PURE__ */ jsxRuntime.jsx(FolderBreadcrumb, { segments: folder.split("/"), size: "sm" })
|
|
215
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" }),
|
|
216
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { className: "ml-auto size-3.5 shrink-0 opacity-50" })
|
|
217
|
+
]
|
|
218
|
+
}
|
|
219
|
+
) }),
|
|
220
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
221
|
+
ui.PopoverContent,
|
|
222
|
+
{
|
|
223
|
+
className: "w-max min-w-[var(--radix-popover-trigger-width)] max-w-[min(640px,92vw)] p-0",
|
|
224
|
+
align: "start",
|
|
225
|
+
side: "bottom",
|
|
226
|
+
sideOffset: 4,
|
|
227
|
+
children: picker
|
|
228
|
+
}
|
|
229
|
+
)
|
|
230
|
+
] });
|
|
231
|
+
}
|
|
232
|
+
function FieldFolderValue({ folder }) {
|
|
233
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1.5 text-sm", children: folder ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
234
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderOpen, { className: "size-3.5 shrink-0 text-yellow-600" }),
|
|
235
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: folder })
|
|
236
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "\u2014" }) });
|
|
237
|
+
}
|
|
238
|
+
function FieldLabelsSelect({
|
|
239
|
+
options,
|
|
240
|
+
appliedIds,
|
|
241
|
+
displayedIds = appliedIds,
|
|
242
|
+
onToggle,
|
|
243
|
+
onCreate,
|
|
244
|
+
emptyText = "Click to add",
|
|
245
|
+
labels
|
|
246
|
+
}) {
|
|
247
|
+
const applied = react.useMemo(
|
|
248
|
+
() => options.filter((o) => displayedIds.has(o.id)),
|
|
249
|
+
[options, displayedIds]
|
|
250
|
+
);
|
|
251
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { children: [
|
|
252
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
253
|
+
"button",
|
|
254
|
+
{
|
|
255
|
+
type: "button",
|
|
256
|
+
"data-slot": "field-labels-select",
|
|
257
|
+
className: ui.cn(
|
|
258
|
+
FIELD_SURFACE,
|
|
259
|
+
"flex min-h-9 w-full cursor-pointer items-center px-3 py-1.5 text-left pointer-coarse:min-h-11"
|
|
260
|
+
),
|
|
261
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-h-[28px] flex-wrap items-center gap-1.5", children: [
|
|
262
|
+
applied.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm italic text-muted-foreground", children: emptyText }),
|
|
263
|
+
applied.map((o) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-medium", children: [
|
|
264
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
265
|
+
"span",
|
|
266
|
+
{
|
|
267
|
+
className: "flex size-4 shrink-0 items-center justify-center rounded border-2",
|
|
268
|
+
style: { borderColor: o.color, backgroundColor: o.color },
|
|
269
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3 text-white", strokeWidth: 3 })
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-[280px] truncate", children: o.name })
|
|
273
|
+
] }, o.id))
|
|
274
|
+
] })
|
|
275
|
+
}
|
|
276
|
+
) }),
|
|
277
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverContent, { className: "w-[360px] p-0", align: "start", side: "bottom", sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
278
|
+
chunkFAXXN7KI_cjs.LabelPickerList,
|
|
279
|
+
{
|
|
280
|
+
options,
|
|
281
|
+
appliedIds,
|
|
282
|
+
onToggle,
|
|
283
|
+
onCreate,
|
|
284
|
+
labels: { ...chunkFAXXN7KI_cjs.DEFAULT_LABEL_MULTI_SELECT_LABELS, ...labels }
|
|
285
|
+
}
|
|
286
|
+
) })
|
|
287
|
+
] });
|
|
288
|
+
}
|
|
289
|
+
function FieldNativeSelect({
|
|
290
|
+
value,
|
|
291
|
+
options,
|
|
292
|
+
onChange,
|
|
293
|
+
emptyLabel = "--",
|
|
294
|
+
ariaLabel
|
|
295
|
+
}) {
|
|
296
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
297
|
+
"select",
|
|
298
|
+
{
|
|
299
|
+
value,
|
|
300
|
+
"aria-label": ariaLabel,
|
|
301
|
+
onChange: (e) => onChange(e.target.value),
|
|
302
|
+
className: "h-9 w-full rounded-md border border-input bg-muted/40 px-3 text-sm transition-colors focus:bg-background focus:outline-none focus:ring-1 focus:ring-ring pointer-coarse:h-11",
|
|
303
|
+
children: [
|
|
304
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "", children: emptyLabel }),
|
|
305
|
+
options.map((opt) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: opt, children: opt }, opt))
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
function FieldAttribution({ avatar, date, lines }) {
|
|
311
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1", "data-slot": "field-attribution", children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
|
|
312
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
|
|
313
|
+
avatar,
|
|
314
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: date })
|
|
315
|
+
] }) }),
|
|
316
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { side: "bottom", children: lines.map((line, i) => /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", children: line }, i)) })
|
|
317
|
+
] }) });
|
|
318
|
+
}
|
|
319
|
+
function FieldWithAttribution({
|
|
320
|
+
attribution,
|
|
321
|
+
children
|
|
322
|
+
}) {
|
|
323
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "group/doctag relative", "data-slot": "field-with-attribution", children: [
|
|
324
|
+
children,
|
|
325
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-0 top-0 bg-background/90 pl-2 opacity-0 transition-opacity group-focus-within/doctag:opacity-100 group-hover/doctag:opacity-100 pointer-coarse:opacity-100", children: attribution })
|
|
326
|
+
] });
|
|
327
|
+
}
|
|
328
|
+
var FilterButton = ({ params, colId }) => {
|
|
329
|
+
const [isFilterActive, setIsFilterActive] = react.useState(false);
|
|
330
|
+
const btnRef = react.useRef(null);
|
|
331
|
+
react.useEffect(() => {
|
|
332
|
+
const check = () => setIsFilterActive(!!params.api.getFilterModel()[colId]);
|
|
333
|
+
check();
|
|
334
|
+
params.api.addEventListener("filterChanged", check);
|
|
335
|
+
return () => {
|
|
336
|
+
if (!params.api.isDestroyed()) params.api.removeEventListener("filterChanged", check);
|
|
337
|
+
};
|
|
338
|
+
}, [params.api, colId]);
|
|
339
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
340
|
+
"span",
|
|
341
|
+
{
|
|
342
|
+
ref: btnRef,
|
|
343
|
+
role: "button",
|
|
344
|
+
"aria-label": "Filter",
|
|
345
|
+
onClick: (e) => {
|
|
346
|
+
e.stopPropagation();
|
|
347
|
+
if (btnRef.current) params.showFilter(btnRef.current);
|
|
348
|
+
},
|
|
349
|
+
className: `ag-header-icon ag-header-cell-filter-button ag-header-label-icon ${isFilterActive ? "ag-filter-active" : ""}`,
|
|
350
|
+
"aria-hidden": "false",
|
|
351
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ag-icon ag-icon-filter" })
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
};
|
|
355
|
+
var DEFAULT_FOLDER_PICKER_LABELS = {
|
|
356
|
+
none: "None",
|
|
357
|
+
removeFromFolder: "Remove from folder",
|
|
358
|
+
searchOrCreate: "Search or create...",
|
|
359
|
+
noFolders: "No folders yet",
|
|
360
|
+
create: (name) => `Create \u201C${name}\u201D`
|
|
361
|
+
};
|
|
362
|
+
function FolderPickerRow({
|
|
363
|
+
label,
|
|
364
|
+
icon,
|
|
365
|
+
count,
|
|
366
|
+
depth,
|
|
367
|
+
isActive,
|
|
368
|
+
muted,
|
|
369
|
+
checkbox,
|
|
370
|
+
indeterminate,
|
|
371
|
+
testId,
|
|
372
|
+
onClick
|
|
373
|
+
}) {
|
|
374
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
375
|
+
"button",
|
|
376
|
+
{
|
|
377
|
+
type: "button",
|
|
378
|
+
"data-testid": testId,
|
|
379
|
+
onClick,
|
|
380
|
+
role: checkbox ? "checkbox" : void 0,
|
|
381
|
+
"aria-checked": checkbox ? indeterminate ? "mixed" : isActive : void 0,
|
|
382
|
+
style: { paddingLeft: `${4 + depth * 14}px` },
|
|
383
|
+
className: ui.cn(
|
|
384
|
+
// `[&:hover]:`, not `hover:`: the latter compiles behind `@media (hover: hover)`, so on a
|
|
385
|
+
// touchscreen whose PRIMARY pointer reports `hover: none` the row would never highlight
|
|
386
|
+
// even with a real mouse attached. The arbitrary selector has no media gate.
|
|
387
|
+
"flex w-full items-center gap-1 rounded-sm py-1 pr-2 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&:hover]:bg-accent pointer-coarse:min-h-11",
|
|
388
|
+
isActive && "bg-primary/10",
|
|
389
|
+
muted && !isActive && "text-muted-foreground"
|
|
390
|
+
),
|
|
391
|
+
children: [
|
|
392
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex w-4 shrink-0 items-center justify-center", children: checkbox ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
393
|
+
"span",
|
|
394
|
+
{
|
|
395
|
+
className: ui.cn(
|
|
396
|
+
"flex size-3.5 items-center justify-center rounded-[3px] border transition-colors",
|
|
397
|
+
isActive || indeterminate ? "border-primary bg-primary text-primary-foreground" : "border-muted-foreground/40"
|
|
398
|
+
),
|
|
399
|
+
children: indeterminate ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minus, { className: "size-2.5" }) : isActive && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-2.5" })
|
|
400
|
+
}
|
|
401
|
+
) : isActive && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3.5 text-primary" }) }),
|
|
402
|
+
icon,
|
|
403
|
+
label !== "" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: ui.cn("min-w-0 truncate", isActive && "font-semibold text-primary"), children: label }),
|
|
404
|
+
count !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto pl-2 text-sm font-semibold text-muted-foreground", children: count })
|
|
405
|
+
]
|
|
406
|
+
}
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
function FolderTree({
|
|
410
|
+
nodes,
|
|
411
|
+
unfiledCount,
|
|
412
|
+
value,
|
|
413
|
+
onChange,
|
|
414
|
+
showUnfiledAlways,
|
|
415
|
+
labels
|
|
416
|
+
}) {
|
|
417
|
+
const l = { ...DEFAULT_FOLDER_PICKER_LABELS, ...labels };
|
|
418
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-h-[240px] overflow-y-auto", children: [
|
|
419
|
+
nodes.map((node) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
420
|
+
FolderPickerRow,
|
|
421
|
+
{
|
|
422
|
+
label: node.label,
|
|
423
|
+
icon: node.icon,
|
|
424
|
+
count: node.count,
|
|
425
|
+
depth: node.depth,
|
|
426
|
+
isActive: value === node.path,
|
|
427
|
+
onClick: () => onChange(node.path)
|
|
428
|
+
},
|
|
429
|
+
node.path
|
|
430
|
+
)),
|
|
431
|
+
(unfiledCount > 0 || showUnfiledAlways) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
432
|
+
nodes.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 border-t border-border" }),
|
|
433
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
434
|
+
FolderPickerRow,
|
|
435
|
+
{
|
|
436
|
+
label: l.none,
|
|
437
|
+
count: unfiledCount,
|
|
438
|
+
depth: 0,
|
|
439
|
+
isActive: value === null,
|
|
440
|
+
muted: true,
|
|
441
|
+
onClick: () => onChange(null)
|
|
442
|
+
}
|
|
443
|
+
)
|
|
444
|
+
] })
|
|
445
|
+
] });
|
|
446
|
+
}
|
|
447
|
+
function FolderBreadcrumb2({ folder }) {
|
|
448
|
+
const parts = folder.split("/");
|
|
449
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "whitespace-nowrap", children: parts.map((part, i) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-0.5", children: [
|
|
450
|
+
i > 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mx-0.5 text-sm text-muted-foreground/50", children: "/" }),
|
|
451
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: i < parts.length - 1 ? "text-sm text-muted-foreground" : "", children: part })
|
|
452
|
+
] }, i)) });
|
|
453
|
+
}
|
|
454
|
+
function FolderCommandList({
|
|
455
|
+
folders,
|
|
456
|
+
value,
|
|
457
|
+
onSelect,
|
|
458
|
+
showRemove = false,
|
|
459
|
+
removeLabel,
|
|
460
|
+
placeholder,
|
|
461
|
+
autoFocus = true,
|
|
462
|
+
labels,
|
|
463
|
+
testIds
|
|
464
|
+
}) {
|
|
465
|
+
const l = { ...DEFAULT_FOLDER_PICKER_LABELS, ...labels };
|
|
466
|
+
const [search, setSearch] = react.useState("");
|
|
467
|
+
const trimmed = search.trim();
|
|
468
|
+
const matchesExisting = folders.some((f) => f.toLowerCase() === trimmed.toLowerCase());
|
|
469
|
+
const handleCreate = react.useCallback(
|
|
470
|
+
(name) => {
|
|
471
|
+
const next = name.trim();
|
|
472
|
+
if (!next) return;
|
|
473
|
+
onSelect(next);
|
|
474
|
+
setSearch("");
|
|
475
|
+
},
|
|
476
|
+
[onSelect]
|
|
477
|
+
);
|
|
478
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Command, { shouldFilter: true, children: [
|
|
479
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
480
|
+
ui.CommandInput,
|
|
481
|
+
{
|
|
482
|
+
placeholder: placeholder ?? l.searchOrCreate,
|
|
483
|
+
value: search,
|
|
484
|
+
onValueChange: setSearch,
|
|
485
|
+
autoFocus,
|
|
486
|
+
onKeyDown: (e) => {
|
|
487
|
+
if (e.key === "Enter" && trimmed && !matchesExisting) {
|
|
488
|
+
e.preventDefault();
|
|
489
|
+
handleCreate(search);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
),
|
|
494
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.CommandList, { children: [
|
|
495
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.CommandEmpty, { children: trimmed ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
496
|
+
"button",
|
|
497
|
+
{
|
|
498
|
+
type: "button",
|
|
499
|
+
"data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.create, { testId: "folder-picker-create" }),
|
|
500
|
+
onClick: () => handleCreate(search),
|
|
501
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
502
|
+
className: "flex w-full cursor-pointer items-center gap-1.5 rounded px-2 py-1.5 text-left text-sm text-primary hover:bg-accent pointer-coarse:min-h-11",
|
|
503
|
+
children: [
|
|
504
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "size-3.5 shrink-0" }),
|
|
505
|
+
l.create(trimmed)
|
|
506
|
+
]
|
|
507
|
+
}
|
|
508
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: l.noFolders }) }),
|
|
509
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.CommandGroup, { children: folders.map((folder) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
510
|
+
ui.CommandItem,
|
|
511
|
+
{
|
|
512
|
+
value: folder,
|
|
513
|
+
"data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.option?.(folder), {
|
|
514
|
+
testId: `folder-picker-option-${folder}`
|
|
515
|
+
}),
|
|
516
|
+
onSelect: () => onSelect(folder),
|
|
517
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
518
|
+
className: "cursor-pointer text-sm",
|
|
519
|
+
children: [
|
|
520
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderOpen, { className: "mr-1.5 size-3.5 flex-none shrink-0 text-yellow-text" }),
|
|
521
|
+
/* @__PURE__ */ jsxRuntime.jsx(FolderBreadcrumb2, { folder }),
|
|
522
|
+
value === folder && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto flex-none text-sm text-primary", children: "\u2713" })
|
|
523
|
+
]
|
|
524
|
+
},
|
|
525
|
+
folder
|
|
526
|
+
)) }),
|
|
527
|
+
trimmed && !matchesExisting && folders.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(ui.CommandGroup, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
528
|
+
ui.CommandItem,
|
|
529
|
+
{
|
|
530
|
+
value: `__create__${trimmed}`,
|
|
531
|
+
"data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.createOption, {
|
|
532
|
+
testId: "folder-picker-create-option"
|
|
533
|
+
}),
|
|
534
|
+
onSelect: () => handleCreate(search),
|
|
535
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
536
|
+
className: "cursor-pointer text-sm text-primary",
|
|
537
|
+
children: [
|
|
538
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "mr-1.5 size-3.5 shrink-0" }),
|
|
539
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: l.create(trimmed) })
|
|
540
|
+
]
|
|
541
|
+
}
|
|
542
|
+
) }),
|
|
543
|
+
showRemove && /* @__PURE__ */ jsxRuntime.jsx(ui.CommandGroup, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
544
|
+
ui.CommandItem,
|
|
545
|
+
{
|
|
546
|
+
value: "__none__",
|
|
547
|
+
"data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.remove, { testId: "folder-picker-remove" }),
|
|
548
|
+
onSelect: () => onSelect(null),
|
|
549
|
+
onPointerDown: (e) => e.preventDefault(),
|
|
550
|
+
className: "cursor-pointer text-sm text-muted-foreground",
|
|
551
|
+
children: [
|
|
552
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "mr-1 size-3.5 shrink-0" }),
|
|
553
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: removeLabel ?? l.removeFromFolder }),
|
|
554
|
+
value === null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto flex-none text-sm text-primary", children: "\u2713" })
|
|
555
|
+
]
|
|
556
|
+
}
|
|
557
|
+
) })
|
|
558
|
+
] })
|
|
559
|
+
] });
|
|
560
|
+
}
|
|
561
|
+
var DEFAULT_FOLDER_FILTER_LABELS = {
|
|
562
|
+
all: "All",
|
|
563
|
+
newFolder: "New folder"
|
|
564
|
+
};
|
|
565
|
+
function FolderFilterButton({
|
|
566
|
+
label,
|
|
567
|
+
icon,
|
|
568
|
+
isActive,
|
|
569
|
+
open,
|
|
570
|
+
onOpenChange,
|
|
571
|
+
allCount,
|
|
572
|
+
onSelectAll,
|
|
573
|
+
onNewFolder,
|
|
574
|
+
children,
|
|
575
|
+
className,
|
|
576
|
+
labels,
|
|
577
|
+
testId,
|
|
578
|
+
newFolderTestId
|
|
579
|
+
}) {
|
|
580
|
+
const l = { ...DEFAULT_FOLDER_FILTER_LABELS, ...labels };
|
|
581
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { open, onOpenChange, children: [
|
|
582
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
583
|
+
ui.Button,
|
|
584
|
+
{
|
|
585
|
+
variant: "ghost",
|
|
586
|
+
size: "sm",
|
|
587
|
+
"data-slot": "folder-filter-button",
|
|
588
|
+
"data-testid": testId,
|
|
589
|
+
className: ui.cn(
|
|
590
|
+
"h-7 shrink-0 gap-1.5 px-2 text-sm font-normal pointer-coarse:h-10",
|
|
591
|
+
isActive && "bg-accent font-medium text-accent-foreground",
|
|
592
|
+
className
|
|
593
|
+
),
|
|
594
|
+
children: [
|
|
595
|
+
icon ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
596
|
+
lucideReact.FolderOpen,
|
|
597
|
+
{
|
|
598
|
+
className: ui.cn(
|
|
599
|
+
"h-3.5 w-3.5 shrink-0 text-muted-foreground",
|
|
600
|
+
isActive && "fill-muted-foreground/30"
|
|
601
|
+
)
|
|
602
|
+
}
|
|
603
|
+
),
|
|
604
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-[280px] truncate", children: label }),
|
|
605
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-4 w-4 text-foreground", strokeWidth: 2.5 })
|
|
606
|
+
]
|
|
607
|
+
}
|
|
608
|
+
) }),
|
|
609
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
610
|
+
ui.PopoverContent,
|
|
611
|
+
{
|
|
612
|
+
className: "w-max min-w-56 max-w-[480px] p-1 shadow-lg",
|
|
613
|
+
align: "start",
|
|
614
|
+
sideOffset: 4,
|
|
615
|
+
children: [
|
|
616
|
+
onSelectAll && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
617
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
618
|
+
FolderPickerRow,
|
|
619
|
+
{
|
|
620
|
+
label: l.all,
|
|
621
|
+
count: allCount,
|
|
622
|
+
depth: 0,
|
|
623
|
+
isActive: !isActive,
|
|
624
|
+
onClick: onSelectAll
|
|
625
|
+
}
|
|
626
|
+
),
|
|
627
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 border-t border-border" })
|
|
628
|
+
] }),
|
|
629
|
+
children,
|
|
630
|
+
onNewFolder && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
631
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "my-1 border-t border-border" }),
|
|
632
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
633
|
+
"button",
|
|
634
|
+
{
|
|
635
|
+
type: "button",
|
|
636
|
+
onClick: onNewFolder,
|
|
637
|
+
"data-testid": chunkMHVNT4J3_cjs.testIdOr(newFolderTestId, { testId: "explorer-new-folder" }),
|
|
638
|
+
className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground pointer-coarse:min-h-11",
|
|
639
|
+
children: [
|
|
640
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderPlus, { className: "h-3.5 w-3.5" }),
|
|
641
|
+
l.newFolder
|
|
642
|
+
]
|
|
643
|
+
}
|
|
644
|
+
)
|
|
645
|
+
] })
|
|
646
|
+
]
|
|
647
|
+
}
|
|
648
|
+
)
|
|
649
|
+
] });
|
|
650
|
+
}
|
|
651
|
+
function ExplorerFrame({ className, ...props }) {
|
|
652
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "explorer-frame", className: ui.cn("flex h-full flex-col", className), ...props });
|
|
653
|
+
}
|
|
654
|
+
function ExplorerStage({ className, ...props }) {
|
|
655
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
656
|
+
"div",
|
|
657
|
+
{
|
|
658
|
+
"data-slot": "explorer-stage",
|
|
659
|
+
className: ui.cn("relative min-h-0 flex-1", className),
|
|
660
|
+
...props
|
|
661
|
+
}
|
|
662
|
+
);
|
|
663
|
+
}
|
|
664
|
+
var ExplorerScroller = react.forwardRef(
|
|
665
|
+
function ExplorerScroller2({ className, ...props }, ref) {
|
|
666
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
667
|
+
"div",
|
|
668
|
+
{
|
|
669
|
+
ref,
|
|
670
|
+
"data-slot": "explorer-scroller",
|
|
671
|
+
className: ui.cn(
|
|
672
|
+
"h-full select-none overflow-auto px-4 py-4 [scrollbar-gutter:stable]",
|
|
673
|
+
className
|
|
674
|
+
),
|
|
675
|
+
...props
|
|
676
|
+
}
|
|
677
|
+
);
|
|
678
|
+
}
|
|
679
|
+
);
|
|
680
|
+
function ExplorerEmpty({ title, description }) {
|
|
681
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
682
|
+
"div",
|
|
683
|
+
{
|
|
684
|
+
"data-slot": "explorer-empty",
|
|
685
|
+
className: "flex h-full flex-col items-center justify-center gap-1 text-center text-muted-foreground",
|
|
686
|
+
children: [
|
|
687
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: title }),
|
|
688
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs", children: description })
|
|
689
|
+
]
|
|
690
|
+
}
|
|
691
|
+
);
|
|
692
|
+
}
|
|
693
|
+
var ExplorerMarquee = react.forwardRef(
|
|
694
|
+
function ExplorerMarquee2({ className, style, ...props }, ref) {
|
|
695
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
696
|
+
"div",
|
|
697
|
+
{
|
|
698
|
+
ref,
|
|
699
|
+
"aria-hidden": true,
|
|
700
|
+
"data-slot": "explorer-marquee",
|
|
701
|
+
className: ui.cn(
|
|
702
|
+
"pointer-events-none fixed z-30 border border-primary bg-primary/10",
|
|
703
|
+
className
|
|
704
|
+
),
|
|
705
|
+
style: { display: "none", ...style },
|
|
706
|
+
...props
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
}
|
|
710
|
+
);
|
|
711
|
+
function ExplorerDropOverlay({ label }) {
|
|
712
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
713
|
+
"div",
|
|
714
|
+
{
|
|
715
|
+
"data-slot": "explorer-drop-overlay",
|
|
716
|
+
className: "pointer-events-none absolute inset-2 z-20 flex flex-col items-center justify-center gap-2 rounded-lg border-2 border-dashed border-primary bg-accent/80 backdrop-blur-sm",
|
|
717
|
+
children: [
|
|
718
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.UploadCloud, { className: "size-8 text-primary" }),
|
|
719
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium text-primary", children: label })
|
|
720
|
+
]
|
|
721
|
+
}
|
|
722
|
+
);
|
|
723
|
+
}
|
|
724
|
+
function ExplorerDragPreview({ icon, title, count }) {
|
|
725
|
+
const isMulti = count > 1;
|
|
726
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "explorer-drag-preview", className: "relative", children: [
|
|
727
|
+
isMulti && /* @__PURE__ */ jsxRuntime.jsx(
|
|
728
|
+
"div",
|
|
729
|
+
{
|
|
730
|
+
"aria-hidden": true,
|
|
731
|
+
className: "absolute inset-0 translate-x-1.5 translate-y-1.5 rounded-lg border border-primary/30 bg-popover shadow-md"
|
|
732
|
+
}
|
|
733
|
+
),
|
|
734
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center gap-2 rounded-lg border border-primary/40 bg-popover px-3 py-2 shadow-lg", children: [
|
|
735
|
+
icon,
|
|
736
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-[12rem] truncate text-sm font-medium", children: title }),
|
|
737
|
+
isMulti && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
738
|
+
"span",
|
|
739
|
+
{
|
|
740
|
+
"data-slot": "explorer-drag-preview-count",
|
|
741
|
+
className: "whitespace-nowrap rounded-full bg-primary px-2 py-0.5 text-xs font-semibold text-primary-foreground",
|
|
742
|
+
children: [
|
|
743
|
+
count,
|
|
744
|
+
" items"
|
|
745
|
+
]
|
|
746
|
+
}
|
|
747
|
+
)
|
|
748
|
+
] })
|
|
749
|
+
] });
|
|
750
|
+
}
|
|
751
|
+
function ExplorerLoadingTiles({
|
|
752
|
+
count = 18,
|
|
753
|
+
label = "Loading files",
|
|
754
|
+
testId,
|
|
755
|
+
className,
|
|
756
|
+
...rest
|
|
757
|
+
}) {
|
|
758
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
759
|
+
"div",
|
|
760
|
+
{
|
|
761
|
+
className: ui.cn(
|
|
762
|
+
"grid gap-3 [grid-template-columns:repeat(auto-fill,minmax(150px,1fr))]",
|
|
763
|
+
className
|
|
764
|
+
),
|
|
765
|
+
"aria-busy": "true",
|
|
766
|
+
"aria-label": label,
|
|
767
|
+
"data-slot": "explorer-loading-tiles",
|
|
768
|
+
...rest,
|
|
769
|
+
"data-testid": chunkMHVNT4J3_cjs.testIdOr(testId, { testId: "explorer-loading-skeleton" }),
|
|
770
|
+
children: Array.from({ length: count }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aspect-[4/5] animate-pulse rounded-lg bg-muted" }, i))
|
|
771
|
+
}
|
|
772
|
+
);
|
|
773
|
+
}
|
|
774
|
+
function getExplorerDisplayName(doc) {
|
|
775
|
+
const title = ui.getDocumentTitle(doc, doc.file_name ?? "Untitled");
|
|
776
|
+
if (ui.getFileExtension(title)) return title;
|
|
777
|
+
const ext = ui.getFileExtension(doc.file_name) || ui.extensionFromMime(doc.file_type);
|
|
778
|
+
return ext ? `${title}.${ext}` : title;
|
|
779
|
+
}
|
|
780
|
+
function parseFolderSegments(folder) {
|
|
781
|
+
if (!folder) return [];
|
|
782
|
+
return folder.split("/").map((segment) => segment.trim()).filter(Boolean);
|
|
783
|
+
}
|
|
784
|
+
function joinFolderPath(segments) {
|
|
785
|
+
return segments.length > 0 ? segments.join("/") : null;
|
|
786
|
+
}
|
|
787
|
+
function startsWithPath(segments, prefix) {
|
|
788
|
+
if (segments.length < prefix.length) return false;
|
|
789
|
+
for (let i = 0; i < prefix.length; i++) {
|
|
790
|
+
if (segments[i] !== prefix[i]) return false;
|
|
791
|
+
}
|
|
792
|
+
return true;
|
|
793
|
+
}
|
|
794
|
+
function isExplorerDocument(doc) {
|
|
795
|
+
return !doc.parent_ext_id;
|
|
796
|
+
}
|
|
797
|
+
function collectFolderDocs(documents, path) {
|
|
798
|
+
if (path.length === 0) return documents.filter(isExplorerDocument);
|
|
799
|
+
return documents.filter(
|
|
800
|
+
(doc) => isExplorerDocument(doc) && startsWithPath(parseFolderSegments(doc.folder), path)
|
|
801
|
+
);
|
|
802
|
+
}
|
|
803
|
+
function compareFiles(a, b, sort) {
|
|
804
|
+
switch (sort) {
|
|
805
|
+
case "date": {
|
|
806
|
+
const at = a.created_at ? Date.parse(a.created_at) : 0;
|
|
807
|
+
const bt = b.created_at ? Date.parse(b.created_at) : 0;
|
|
808
|
+
return bt - at;
|
|
809
|
+
}
|
|
810
|
+
case "size": {
|
|
811
|
+
return (b.file_size ?? 0) - (a.file_size ?? 0);
|
|
812
|
+
}
|
|
813
|
+
case "name":
|
|
814
|
+
default:
|
|
815
|
+
return ui.getDocumentTitle(a, a.file_name ?? "").localeCompare(
|
|
816
|
+
ui.getDocumentTitle(b, b.file_name ?? ""),
|
|
817
|
+
void 0,
|
|
818
|
+
{ numeric: true, sensitivity: "base" }
|
|
819
|
+
);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
function sortExplorerFiles(docs, sort, reversed = false) {
|
|
823
|
+
const sorted = [...docs].sort((a, b) => compareFiles(a, b, sort));
|
|
824
|
+
return reversed ? sorted.reverse() : sorted;
|
|
825
|
+
}
|
|
826
|
+
function buildExplorerEntries(documents, currentPath, sort = "name", pendingFolders = []) {
|
|
827
|
+
const folderCounts = /* @__PURE__ */ new Map();
|
|
828
|
+
const files = [];
|
|
829
|
+
for (const doc of documents) {
|
|
830
|
+
const segments = parseFolderSegments(doc.folder);
|
|
831
|
+
if (!startsWithPath(segments, currentPath)) continue;
|
|
832
|
+
if (segments.length === currentPath.length) {
|
|
833
|
+
files.push(doc);
|
|
834
|
+
} else {
|
|
835
|
+
const childName = segments[currentPath.length];
|
|
836
|
+
folderCounts.set(childName, (folderCounts.get(childName) ?? 0) + 1);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
const childNames = new Set(folderCounts.keys());
|
|
840
|
+
for (const pending of pendingFolders) {
|
|
841
|
+
const segments = parseFolderSegments(pending);
|
|
842
|
+
if (!startsWithPath(segments, currentPath)) continue;
|
|
843
|
+
if (segments.length > currentPath.length) childNames.add(segments[currentPath.length]);
|
|
844
|
+
}
|
|
845
|
+
const folders = Array.from(childNames).map((name) => ({
|
|
846
|
+
kind: "folder",
|
|
847
|
+
name,
|
|
848
|
+
path: [...currentPath, name],
|
|
849
|
+
count: folderCounts.get(name) ?? 0
|
|
850
|
+
})).sort((a, b) => a.name.localeCompare(b.name, void 0, { numeric: true, sensitivity: "base" }));
|
|
851
|
+
files.sort((a, b) => compareFiles(a, b, sort));
|
|
852
|
+
return { folders, files };
|
|
853
|
+
}
|
|
854
|
+
function searchExplorerDocuments(documents, query, sort = "name") {
|
|
855
|
+
const needle = query.trim().toLowerCase();
|
|
856
|
+
if (!needle) return [];
|
|
857
|
+
return documents.filter((doc) => {
|
|
858
|
+
if (!isExplorerDocument(doc)) return false;
|
|
859
|
+
const title = ui.getDocumentTitle(doc, doc.file_name ?? "").toLowerCase();
|
|
860
|
+
const name = (doc.file_name ?? "").toLowerCase();
|
|
861
|
+
return title.includes(needle) || name.includes(needle);
|
|
862
|
+
}).sort((a, b) => compareFiles(a, b, sort));
|
|
863
|
+
}
|
|
864
|
+
function GmailMark({ className }) {
|
|
865
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 256 193", className, "aria-hidden": "true", focusable: "false", children: [
|
|
866
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
867
|
+
"path",
|
|
868
|
+
{
|
|
869
|
+
fill: "#4285F4",
|
|
870
|
+
d: "M58.182 192.05V93.14L27.507 65.077 0 49.504v125.091c0 9.658 7.825 17.455 17.455 17.455z"
|
|
871
|
+
}
|
|
872
|
+
),
|
|
873
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
874
|
+
"path",
|
|
875
|
+
{
|
|
876
|
+
fill: "#34A853",
|
|
877
|
+
d: "M197.818 192.05h40.727c9.659 0 17.455-7.826 17.455-17.455V49.505l-31.156 17.837-27.026 25.798z"
|
|
878
|
+
}
|
|
879
|
+
),
|
|
880
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
881
|
+
"path",
|
|
882
|
+
{
|
|
883
|
+
fill: "#EA4335",
|
|
884
|
+
d: "m58.182 93.14-4.174-38.647 4.174-36.989L128 69.868l69.818-52.364 4.669 34.992-4.669 40.644L128 145.504z"
|
|
885
|
+
}
|
|
886
|
+
),
|
|
887
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
888
|
+
"path",
|
|
889
|
+
{
|
|
890
|
+
fill: "#FBBC04",
|
|
891
|
+
d: "M197.818 17.504V93.14L256 49.504V26.231c0-21.585-24.64-33.89-41.89-20.945z"
|
|
892
|
+
}
|
|
893
|
+
),
|
|
894
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
895
|
+
"path",
|
|
896
|
+
{
|
|
897
|
+
fill: "#C5221F",
|
|
898
|
+
d: "M0 49.504 26.759 69.574 58.182 93.14V17.504L41.89 5.286C24.61-7.66 0 4.646 0 26.231z"
|
|
899
|
+
}
|
|
900
|
+
)
|
|
901
|
+
] });
|
|
902
|
+
}
|
|
903
|
+
function OutlookMark({ className }) {
|
|
904
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 48 48", className, "aria-hidden": "true", focusable: "false", children: [
|
|
905
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#0F6CBD", d: "M44 13H24v22h18.5A1.5 1.5 0 0 0 44 33.5z" }),
|
|
906
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { fill: "#28A8EA", d: "M24 15.5 44 13v3L24 27z" }),
|
|
907
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "4", y: "9", width: "21", height: "30", rx: "2.5", fill: "#0364B8" }),
|
|
908
|
+
/* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "14.5", cy: "24", rx: "6.2", ry: "7", fill: "none", stroke: "#fff", strokeWidth: "3.1" })
|
|
909
|
+
] });
|
|
910
|
+
}
|
|
911
|
+
function OneDriveMark({ className }) {
|
|
912
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 256 165", className, "aria-hidden": "true", focusable: "false", children: [
|
|
913
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
914
|
+
"path",
|
|
915
|
+
{
|
|
916
|
+
fill: "#0364B8",
|
|
917
|
+
d: "M154.66056 110.681557 207.502052 60.1479482C196.525811 17.3487078 152.932256-8.44908883 110.132767 2.52715287 90.8589801 7.46999082 74.1187452 19.4179992 63.179535 36.0386895 63.9974594 36.0180612 154.66056 110.681557 154.66056 110.681557Z"
|
|
918
|
+
}
|
|
919
|
+
),
|
|
920
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
921
|
+
"path",
|
|
922
|
+
{
|
|
923
|
+
fill: "#0078D4",
|
|
924
|
+
d: "M97.6181022 45.5520619 97.6156169 45.5607606C87.5186874 39.307156 75.8741386 36.001658 63.9972108 36.0177537 63.7228296 36.0177537 63.4531706 36.03521 63.1792865 36.0384409 27.8517142 36.4761088-.432413365 65.4695515.00500592252 100.797124.163570414 113.612018 4.16769663 126.083687 11.4981977 136.595916L90.6631356 126.680913 151.357298 77.7409022 97.6181022 45.5520619Z"
|
|
925
|
+
}
|
|
926
|
+
),
|
|
927
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
928
|
+
"path",
|
|
929
|
+
{
|
|
930
|
+
fill: "#1490DF",
|
|
931
|
+
d: "M207.502052 60.1481967C206.340406 60.0706542 205.173043 60.016946 203.992011 60.016946 196.903085 60.010012 189.887973 61.4579693 183.381112 64.271122L183.379621 64.2656543 151.357547 77.7411507 186.65952 121.347877 249.770673 136.689364C263.390071 111.405536 253.93411 79.8683506 228.650281 66.2489531 222.117076 62.7297161 214.906119 60.6497377 207.502301 60.1484453L207.502301 60.1481967 207.502052 60.1481967Z"
|
|
932
|
+
}
|
|
933
|
+
),
|
|
934
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
935
|
+
"path",
|
|
936
|
+
{
|
|
937
|
+
fill: "#28A8EA",
|
|
938
|
+
d: "M11.4981977 136.595916C23.4514253 153.781772 43.063467 164.023845 63.9974594 164.012918L203.991762 164.012918C223.115435 164.018377 240.697951 153.524291 249.770425 136.689862L151.357298 77.7409022 11.4981977 136.595916Z"
|
|
939
|
+
}
|
|
940
|
+
)
|
|
941
|
+
] });
|
|
942
|
+
}
|
|
943
|
+
function SharePointMark({ className }) {
|
|
944
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 48 48", className, "aria-hidden": "true", focusable: "false", children: [
|
|
945
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "22", cy: "22", r: "20", fill: "#036C70" }),
|
|
946
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "16", cy: "20", r: "12", fill: "#1A9BA1" }),
|
|
947
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "26", cy: "30", r: "10", fill: "#37C6D0" }),
|
|
948
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "33", cy: "22", r: "8", fill: "#fff", opacity: "0.15" })
|
|
949
|
+
] });
|
|
950
|
+
}
|
|
951
|
+
function GoogleDriveMark({ className }) {
|
|
952
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 87.3 78", className, "aria-hidden": "true", focusable: "false", children: [
|
|
953
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
954
|
+
"path",
|
|
955
|
+
{
|
|
956
|
+
fill: "#0066da",
|
|
957
|
+
d: "M6.6 66.85l3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8H0c0 1.55.4 3.1 1.2 4.5z"
|
|
958
|
+
}
|
|
959
|
+
),
|
|
960
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
961
|
+
"path",
|
|
962
|
+
{
|
|
963
|
+
fill: "#00ac47",
|
|
964
|
+
d: "M43.65 25L29.9 1.2c-1.35.8-2.5 1.9-3.3 3.3L1.2 48.5A9.06 9.06 0 0 0 0 53h27.5z"
|
|
965
|
+
}
|
|
966
|
+
),
|
|
967
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
968
|
+
"path",
|
|
969
|
+
{
|
|
970
|
+
fill: "#ea4335",
|
|
971
|
+
d: "M73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75L86.1 57.4c.8-1.4 1.2-2.95 1.2-4.5H59.798l5.85 11.5z"
|
|
972
|
+
}
|
|
973
|
+
),
|
|
974
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
975
|
+
"path",
|
|
976
|
+
{
|
|
977
|
+
fill: "#00832d",
|
|
978
|
+
d: "M43.65 25L57.4 1.2C56.05.4 54.5 0 52.9 0H34.4c-1.6 0-3.15.45-4.5 1.2z"
|
|
979
|
+
}
|
|
980
|
+
),
|
|
981
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
982
|
+
"path",
|
|
983
|
+
{
|
|
984
|
+
fill: "#2684fc",
|
|
985
|
+
d: "M59.8 53H27.5L13.75 76.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z"
|
|
986
|
+
}
|
|
987
|
+
),
|
|
988
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
989
|
+
"path",
|
|
990
|
+
{
|
|
991
|
+
fill: "#ffba00",
|
|
992
|
+
d: "M73.4 26.5L60.65 4.5c-.8-1.4-1.95-2.5-3.3-3.3L43.65 25l16.15 28h27.45c0-1.55-.4-3.1-1.2-4.5z"
|
|
993
|
+
}
|
|
994
|
+
)
|
|
995
|
+
] });
|
|
996
|
+
}
|
|
997
|
+
function BoxMark({ className }) {
|
|
998
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 48 48", className, "aria-hidden": "true", focusable: "false", children: [
|
|
999
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "48", height: "48", rx: "10", fill: "#0061D5" }),
|
|
1000
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1001
|
+
"path",
|
|
1002
|
+
{
|
|
1003
|
+
fill: "none",
|
|
1004
|
+
stroke: "#fff",
|
|
1005
|
+
strokeWidth: "2.5",
|
|
1006
|
+
strokeLinejoin: "round",
|
|
1007
|
+
strokeLinecap: "round",
|
|
1008
|
+
d: "M24 13 36 19 36 29 24 35 12 29 12 19Z"
|
|
1009
|
+
}
|
|
1010
|
+
),
|
|
1011
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1012
|
+
"path",
|
|
1013
|
+
{
|
|
1014
|
+
fill: "none",
|
|
1015
|
+
stroke: "#fff",
|
|
1016
|
+
strokeWidth: "2.5",
|
|
1017
|
+
strokeLinejoin: "round",
|
|
1018
|
+
strokeLinecap: "round",
|
|
1019
|
+
d: "M12 19 24 25 36 19 M24 25 24 35"
|
|
1020
|
+
}
|
|
1021
|
+
)
|
|
1022
|
+
] });
|
|
1023
|
+
}
|
|
1024
|
+
function DropboxMark({ className }) {
|
|
1025
|
+
return /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 48 48", className, "aria-hidden": "true", focusable: "false", children: /* @__PURE__ */ jsxRuntime.jsxs("g", { fill: "#0061FF", children: [
|
|
1026
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 6 0 14l12 8 12-8z" }),
|
|
1027
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M36 6 24 14l12 8 12-8z" }),
|
|
1028
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0 30l12 8 12-8-12-8z" }),
|
|
1029
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M36 22 24 30l12 8 12-8z" }),
|
|
1030
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M12 40.5 24 33l12 7.5L24 48z" })
|
|
1031
|
+
] }) });
|
|
1032
|
+
}
|
|
1033
|
+
function OneNoteMark({ className }) {
|
|
1034
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 48 48", className, "aria-hidden": "true", focusable: "false", children: [
|
|
1035
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "48", height: "48", rx: "10", fill: "#7719AA" }),
|
|
1036
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "10", y: "10", width: "21", height: "28", rx: "2.5", fill: "#fff", opacity: "0.95" }),
|
|
1037
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "31", y: "15", width: "7", height: "5", rx: "1.5", fill: "#fff", opacity: "0.6" }),
|
|
1038
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "31", y: "22", width: "7", height: "5", rx: "1.5", fill: "#fff", opacity: "0.6" }),
|
|
1039
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "31", y: "29", width: "7", height: "5", rx: "1.5", fill: "#fff", opacity: "0.6" })
|
|
1040
|
+
] });
|
|
1041
|
+
}
|
|
1042
|
+
function ClioMark({ className }) {
|
|
1043
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 48 48", className, "aria-hidden": "true", focusable: "false", children: [
|
|
1044
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "48", height: "48", rx: "10", fill: "#00263E" }),
|
|
1045
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1046
|
+
"path",
|
|
1047
|
+
{
|
|
1048
|
+
fill: "none",
|
|
1049
|
+
stroke: "#4FC3F7",
|
|
1050
|
+
strokeWidth: "4.5",
|
|
1051
|
+
strokeLinecap: "round",
|
|
1052
|
+
d: "M32 17a10 10 0 1 0 0 14"
|
|
1053
|
+
}
|
|
1054
|
+
)
|
|
1055
|
+
] });
|
|
1056
|
+
}
|
|
1057
|
+
function VendorLogo({
|
|
1058
|
+
vendorKey,
|
|
1059
|
+
className = "h-4 w-4",
|
|
1060
|
+
product
|
|
1061
|
+
}) {
|
|
1062
|
+
if (product === "onedrive") return /* @__PURE__ */ jsxRuntime.jsx(OneDriveMark, { className });
|
|
1063
|
+
if (product === "googledrive") return /* @__PURE__ */ jsxRuntime.jsx(GoogleDriveMark, { className });
|
|
1064
|
+
if (product === "sharepoint") return /* @__PURE__ */ jsxRuntime.jsx(SharePointMark, { className });
|
|
1065
|
+
if (product === "box") return /* @__PURE__ */ jsxRuntime.jsx(BoxMark, { className });
|
|
1066
|
+
if (product === "dropbox") return /* @__PURE__ */ jsxRuntime.jsx(DropboxMark, { className });
|
|
1067
|
+
if (product === "onenote") return /* @__PURE__ */ jsxRuntime.jsx(OneNoteMark, { className });
|
|
1068
|
+
if (product === "clio") return /* @__PURE__ */ jsxRuntime.jsx(ClioMark, { className });
|
|
1069
|
+
if (vendorKey === "gmail") return /* @__PURE__ */ jsxRuntime.jsx(GmailMark, { className });
|
|
1070
|
+
if (vendorKey === "microsoft") return /* @__PURE__ */ jsxRuntime.jsx(OutlookMark, { className });
|
|
1071
|
+
if (vendorKey === "microsoft_sharepoint") return /* @__PURE__ */ jsxRuntime.jsx(SharePointMark, { className });
|
|
1072
|
+
if (vendorKey === "box") return /* @__PURE__ */ jsxRuntime.jsx(BoxMark, { className });
|
|
1073
|
+
if (vendorKey === "dropbox") return /* @__PURE__ */ jsxRuntime.jsx(DropboxMark, { className });
|
|
1074
|
+
if (vendorKey === "onenote") return /* @__PURE__ */ jsxRuntime.jsx(OneNoteMark, { className });
|
|
1075
|
+
if (vendorKey === "clio") return /* @__PURE__ */ jsxRuntime.jsx(ClioMark, { className });
|
|
1076
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mail, { className: `${className} text-muted-foreground`, "aria-hidden": "true" });
|
|
1077
|
+
}
|
|
1078
|
+
var PROVIDER_PREFIXES = [
|
|
1079
|
+
["Outlook", { vendorKey: "microsoft" }],
|
|
1080
|
+
["Gmail", { vendorKey: "gmail" }],
|
|
1081
|
+
["OneDrive", { vendorKey: "microsoft", product: "onedrive" }],
|
|
1082
|
+
["Google Drive", { vendorKey: "gmail", product: "googledrive" }]
|
|
1083
|
+
];
|
|
1084
|
+
function providerForRoot(root) {
|
|
1085
|
+
for (const [prefix, props] of PROVIDER_PREFIXES) {
|
|
1086
|
+
if (root.startsWith(prefix)) return props;
|
|
1087
|
+
}
|
|
1088
|
+
return null;
|
|
1089
|
+
}
|
|
1090
|
+
function FolderProviderIcon({
|
|
1091
|
+
folderPath,
|
|
1092
|
+
className
|
|
1093
|
+
}) {
|
|
1094
|
+
const root = folderPath.split("/")[0];
|
|
1095
|
+
const provider = providerForRoot(root);
|
|
1096
|
+
if (!provider) return null;
|
|
1097
|
+
return /* @__PURE__ */ jsxRuntime.jsx(VendorLogo, { vendorKey: provider.vendorKey, product: provider.product, className });
|
|
1098
|
+
}
|
|
1099
|
+
function hasFolderProviderIcon(folderPath) {
|
|
1100
|
+
return providerForRoot(folderPath.split("/")[0]) !== null;
|
|
1101
|
+
}
|
|
1102
|
+
function formatFolderSegment(segment) {
|
|
1103
|
+
if (!providerForRoot(segment)) return segment;
|
|
1104
|
+
const account = segment.match(/\(([^)]*)\)/);
|
|
1105
|
+
return account ? account[1].trim() : "";
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
// src/files/permissions.ts
|
|
1109
|
+
function canChangeVisibility(doc, currentUserExtId) {
|
|
1110
|
+
if (!doc || !currentUserExtId) return false;
|
|
1111
|
+
const isCurrentUserAgent = currentUserExtId.startsWith("agt-");
|
|
1112
|
+
const isCreatedByAgent = doc.created_by_ext_id?.startsWith("agt-") ?? false;
|
|
1113
|
+
return isCurrentUserAgent || isCreatedByAgent || doc.created_by_ext_id === currentUserExtId;
|
|
1114
|
+
}
|
|
1115
|
+
function canEditDocumentFields(doc, currentUserExtId, workspaceRole) {
|
|
1116
|
+
if (!doc || !currentUserExtId) return false;
|
|
1117
|
+
if (currentUserExtId.startsWith("agt-")) return true;
|
|
1118
|
+
if (workspaceRole === "owner" || workspaceRole === "collaborator") return true;
|
|
1119
|
+
return canChangeVisibility(doc, currentUserExtId);
|
|
1120
|
+
}
|
|
1121
|
+
function canDeleteDocument(doc, currentUserExtId, workspaceRole) {
|
|
1122
|
+
if (!doc || !currentUserExtId) return false;
|
|
1123
|
+
if (workspaceRole === "owner") return true;
|
|
1124
|
+
if (workspaceRole === "collaborator") return doc.created_by_ext_id === currentUserExtId;
|
|
1125
|
+
return false;
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
// src/files/recently-deleted.ts
|
|
1129
|
+
var RECENTLY_DELETED_HINT = "You can restore it from Recently deleted (Settings > Storage) for at least 30 days.";
|
|
1130
|
+
var RECENTLY_DELETED_HINT_PLURAL = "You can restore them from Recently deleted (Settings > Storage) for at least 30 days.";
|
|
1131
|
+
var DEFAULT_EXPLORER_LABELS = {
|
|
1132
|
+
moreActions: "More actions",
|
|
1133
|
+
name: "Name",
|
|
1134
|
+
select: "Select",
|
|
1135
|
+
deselect: "Deselect",
|
|
1136
|
+
empty: "Empty",
|
|
1137
|
+
itemCount: (count) => chunkKDG6FER6_cjs.formatCount(count, { one: "item", other: "items" }),
|
|
1138
|
+
processing: (count) => `${count} processing`,
|
|
1139
|
+
aiSummary: "AI Summary:",
|
|
1140
|
+
noSummary: "No AI summary is available for this document yet.",
|
|
1141
|
+
lastModifiedBy: "Last modified by",
|
|
1142
|
+
shared: "Shared",
|
|
1143
|
+
private: "Private"
|
|
1144
|
+
};
|
|
1145
|
+
function TileLink({
|
|
1146
|
+
href,
|
|
1147
|
+
label,
|
|
1148
|
+
onSelect
|
|
1149
|
+
}) {
|
|
1150
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1151
|
+
chunk3VULDTNL_cjs.ActionLink,
|
|
1152
|
+
{
|
|
1153
|
+
href,
|
|
1154
|
+
onSelect,
|
|
1155
|
+
"aria-label": label,
|
|
1156
|
+
"data-slot": "explorer-tile-link",
|
|
1157
|
+
className: "absolute inset-0 z-10 rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
1158
|
+
}
|
|
1159
|
+
);
|
|
1160
|
+
}
|
|
1161
|
+
function isInsideTileLink(e) {
|
|
1162
|
+
return e.target instanceof Element && !!e.target.closest('[data-slot="explorer-tile-link"]');
|
|
1163
|
+
}
|
|
1164
|
+
function ExplorerMenu({
|
|
1165
|
+
items,
|
|
1166
|
+
testId,
|
|
1167
|
+
label,
|
|
1168
|
+
align,
|
|
1169
|
+
triggerClassName
|
|
1170
|
+
}) {
|
|
1171
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
|
|
1172
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1173
|
+
"button",
|
|
1174
|
+
{
|
|
1175
|
+
type: "button",
|
|
1176
|
+
"aria-label": label,
|
|
1177
|
+
"data-testid": testId,
|
|
1178
|
+
onClick: (e) => e.stopPropagation(),
|
|
1179
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
1180
|
+
className: ui.cn(
|
|
1181
|
+
"flex size-6 items-center justify-center rounded-md bg-background/90 text-muted-foreground backdrop-blur-sm transition hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-background data-[state=open]:text-foreground pointer-coarse:size-11",
|
|
1182
|
+
triggerClassName
|
|
1183
|
+
),
|
|
1184
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { className: "size-4" })
|
|
1185
|
+
}
|
|
1186
|
+
) }),
|
|
1187
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1188
|
+
ui.DropdownMenuContent,
|
|
1189
|
+
{
|
|
1190
|
+
align,
|
|
1191
|
+
onClick: (e) => e.stopPropagation(),
|
|
1192
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
1193
|
+
className: "w-44",
|
|
1194
|
+
children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1195
|
+
item.separatorBefore && /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuSeparator, {}),
|
|
1196
|
+
item.submenu ? /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuSub, { children: [
|
|
1197
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuSubTrigger, { "data-testid": item.testId, children: [
|
|
1198
|
+
/* @__PURE__ */ jsxRuntime.jsx(item.icon, { className: "mr-2 size-4" }),
|
|
1199
|
+
item.label
|
|
1200
|
+
] }),
|
|
1201
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuSubContent, { className: "w-52", children: item.submenu.map((sub) => /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuItem, { onSelect: sub.onSelect, "data-testid": sub.testId, children: [
|
|
1202
|
+
/* @__PURE__ */ jsxRuntime.jsx(sub.icon, { className: "mr-2 size-4" }),
|
|
1203
|
+
sub.label
|
|
1204
|
+
] }, sub.id)) })
|
|
1205
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1206
|
+
ui.DropdownMenuItem,
|
|
1207
|
+
{
|
|
1208
|
+
onSelect: item.onSelect,
|
|
1209
|
+
"data-testid": item.testId,
|
|
1210
|
+
className: ui.cn(item.destructive && "text-destructive focus:text-destructive"),
|
|
1211
|
+
children: [
|
|
1212
|
+
/* @__PURE__ */ jsxRuntime.jsx(item.icon, { className: "mr-2 size-4" }),
|
|
1213
|
+
item.label
|
|
1214
|
+
]
|
|
1215
|
+
}
|
|
1216
|
+
)
|
|
1217
|
+
] }, item.id))
|
|
1218
|
+
}
|
|
1219
|
+
)
|
|
1220
|
+
] });
|
|
1221
|
+
}
|
|
1222
|
+
function RenameField({
|
|
1223
|
+
seed,
|
|
1224
|
+
testId,
|
|
1225
|
+
label,
|
|
1226
|
+
onCommit,
|
|
1227
|
+
onCancel,
|
|
1228
|
+
className
|
|
1229
|
+
}) {
|
|
1230
|
+
const doneRef = react.useRef(false);
|
|
1231
|
+
const commit = (value) => {
|
|
1232
|
+
if (doneRef.current) return;
|
|
1233
|
+
doneRef.current = true;
|
|
1234
|
+
const trimmed = value.trim();
|
|
1235
|
+
if (trimmed && trimmed !== seed) onCommit(trimmed);
|
|
1236
|
+
else onCancel();
|
|
1237
|
+
};
|
|
1238
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1239
|
+
"input",
|
|
1240
|
+
{
|
|
1241
|
+
autoFocus: true,
|
|
1242
|
+
defaultValue: seed,
|
|
1243
|
+
"data-testid": testId,
|
|
1244
|
+
"aria-label": label,
|
|
1245
|
+
onFocus: (e) => e.currentTarget.select(),
|
|
1246
|
+
onClick: (e) => e.stopPropagation(),
|
|
1247
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
1248
|
+
onDoubleClick: (e) => e.stopPropagation(),
|
|
1249
|
+
onKeyDown: (e) => {
|
|
1250
|
+
if (e.key === "Enter") {
|
|
1251
|
+
e.preventDefault();
|
|
1252
|
+
commit(e.currentTarget.value);
|
|
1253
|
+
} else if (e.key === "Escape") {
|
|
1254
|
+
e.preventDefault();
|
|
1255
|
+
doneRef.current = true;
|
|
1256
|
+
onCancel();
|
|
1257
|
+
}
|
|
1258
|
+
},
|
|
1259
|
+
onBlur: (e) => commit(e.currentTarget.value),
|
|
1260
|
+
className: ui.cn(
|
|
1261
|
+
"w-full rounded-md border border-primary bg-background px-1 py-0.5 text-sm text-foreground outline-none",
|
|
1262
|
+
className
|
|
1263
|
+
)
|
|
1264
|
+
}
|
|
1265
|
+
);
|
|
1266
|
+
}
|
|
1267
|
+
function SelectCheckbox({
|
|
1268
|
+
selected,
|
|
1269
|
+
onToggle,
|
|
1270
|
+
labels,
|
|
1271
|
+
className
|
|
1272
|
+
}) {
|
|
1273
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1274
|
+
ui.Checkbox,
|
|
1275
|
+
{
|
|
1276
|
+
checked: selected,
|
|
1277
|
+
onPointerDown: (e) => e.stopPropagation(),
|
|
1278
|
+
onClick: onToggle,
|
|
1279
|
+
"aria-label": selected ? labels.deselect : labels.select,
|
|
1280
|
+
className: ui.cn(
|
|
1281
|
+
"size-6 rounded-md border-muted-foreground/60 bg-card transition data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground pointer-coarse:size-9",
|
|
1282
|
+
selected ? "opacity-100" : "opacity-60 hover:opacity-100",
|
|
1283
|
+
className
|
|
1284
|
+
)
|
|
1285
|
+
}
|
|
1286
|
+
);
|
|
1287
|
+
}
|
|
1288
|
+
function ExplorerFileTile({
|
|
1289
|
+
id,
|
|
1290
|
+
title,
|
|
1291
|
+
density,
|
|
1292
|
+
selected,
|
|
1293
|
+
dragging,
|
|
1294
|
+
renaming,
|
|
1295
|
+
thumbnailUrl,
|
|
1296
|
+
renderFileIcon,
|
|
1297
|
+
progress,
|
|
1298
|
+
statusMarker,
|
|
1299
|
+
offlineMarker,
|
|
1300
|
+
entity,
|
|
1301
|
+
tooltip,
|
|
1302
|
+
menuItems,
|
|
1303
|
+
rootRef,
|
|
1304
|
+
rootProps,
|
|
1305
|
+
onOpen,
|
|
1306
|
+
href,
|
|
1307
|
+
labels,
|
|
1308
|
+
testIds,
|
|
1309
|
+
onSelect,
|
|
1310
|
+
onToggle,
|
|
1311
|
+
onCommitRename,
|
|
1312
|
+
onCancelRename
|
|
1313
|
+
}) {
|
|
1314
|
+
const l = { ...DEFAULT_EXPLORER_LABELS, ...labels };
|
|
1315
|
+
const [thumbFailed, setThumbFailed] = react.useState(false);
|
|
1316
|
+
const [thumbLandscape, setThumbLandscape] = react.useState(false);
|
|
1317
|
+
const showThumbnail = !!thumbnailUrl && !thumbFailed && !progress;
|
|
1318
|
+
const tile = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1319
|
+
"div",
|
|
1320
|
+
{
|
|
1321
|
+
ref: rootRef,
|
|
1322
|
+
...rootProps,
|
|
1323
|
+
onClick: (e) => {
|
|
1324
|
+
if (href && isInsideTileLink(e)) {
|
|
1325
|
+
if (e.shiftKey) {
|
|
1326
|
+
e.preventDefault();
|
|
1327
|
+
onSelect(e);
|
|
1328
|
+
}
|
|
1329
|
+
return;
|
|
1330
|
+
}
|
|
1331
|
+
if (e.shiftKey || e.metaKey || e.ctrlKey) onSelect(e);
|
|
1332
|
+
else onOpen();
|
|
1333
|
+
},
|
|
1334
|
+
onDoubleClick: onOpen,
|
|
1335
|
+
"data-slot": "explorer-file-tile",
|
|
1336
|
+
"data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.root, { testId: "explorer-file" }),
|
|
1337
|
+
"data-doc-id": id,
|
|
1338
|
+
className: ui.cn(
|
|
1339
|
+
"group relative h-full cursor-default select-none overflow-hidden rounded-lg border transition",
|
|
1340
|
+
dragging && "opacity-40",
|
|
1341
|
+
selected ? "border-primary/30 bg-accent" : "border-border bg-muted hover:bg-muted/70"
|
|
1342
|
+
),
|
|
1343
|
+
children: [
|
|
1344
|
+
href && /* @__PURE__ */ jsxRuntime.jsx(TileLink, { href, label: title, onSelect: onOpen }),
|
|
1345
|
+
showThumbnail ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1346
|
+
"img",
|
|
1347
|
+
{
|
|
1348
|
+
src: thumbnailUrl,
|
|
1349
|
+
alt: "",
|
|
1350
|
+
loading: "lazy",
|
|
1351
|
+
draggable: false,
|
|
1352
|
+
onError: () => setThumbFailed(true),
|
|
1353
|
+
onLoad: (e) => setThumbLandscape(e.currentTarget.naturalWidth > e.currentTarget.naturalHeight),
|
|
1354
|
+
className: ui.cn(
|
|
1355
|
+
"absolute inset-0 size-full bg-card",
|
|
1356
|
+
thumbLandscape ? "object-contain" : "object-cover object-top"
|
|
1357
|
+
)
|
|
1358
|
+
}
|
|
1359
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: renderFileIcon(density === "list" ? 30 : 44) }),
|
|
1360
|
+
progress && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-1.5 bg-background/80 px-3", children: [
|
|
1361
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1362
|
+
"div",
|
|
1363
|
+
{
|
|
1364
|
+
className: ui.cn(
|
|
1365
|
+
"h-1.5 w-full rounded-sm",
|
|
1366
|
+
progress.queued ? "progress-bar-queued" : "progress-bar-processing"
|
|
1367
|
+
)
|
|
1368
|
+
}
|
|
1369
|
+
),
|
|
1370
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-medium text-primary", children: progress.label })
|
|
1371
|
+
] }),
|
|
1372
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1373
|
+
SelectCheckbox,
|
|
1374
|
+
{
|
|
1375
|
+
selected,
|
|
1376
|
+
onToggle,
|
|
1377
|
+
labels: l,
|
|
1378
|
+
className: "absolute left-1.5 top-1.5 z-20"
|
|
1379
|
+
}
|
|
1380
|
+
),
|
|
1381
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-1.5 top-1.5 z-20", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1382
|
+
ExplorerMenu,
|
|
1383
|
+
{
|
|
1384
|
+
items: menuItems,
|
|
1385
|
+
testId: chunkMHVNT4J3_cjs.testIdOr(testIds?.menu, { testId: "explorer-file-menu" }),
|
|
1386
|
+
label: l.moreActions,
|
|
1387
|
+
align: "start"
|
|
1388
|
+
}
|
|
1389
|
+
) }),
|
|
1390
|
+
renaming ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-x-0 bottom-0 z-20 flex items-center gap-1 bg-background/90 px-1.5 py-1 backdrop-blur-sm", children: [
|
|
1391
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0", children: renderFileIcon(13) }),
|
|
1392
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1393
|
+
RenameField,
|
|
1394
|
+
{
|
|
1395
|
+
seed: title,
|
|
1396
|
+
testId: chunkMHVNT4J3_cjs.testIdOr(testIds?.renameInput, { testId: "explorer-rename-input" }),
|
|
1397
|
+
label: l.name,
|
|
1398
|
+
onCommit: onCommitRename,
|
|
1399
|
+
onCancel: onCancelRename,
|
|
1400
|
+
className: "flex-1 text-left"
|
|
1401
|
+
}
|
|
1402
|
+
)
|
|
1403
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute inset-x-1.5 bottom-1.5 z-20 flex flex-col gap-1", children: [
|
|
1404
|
+
(offlineMarker || statusMarker) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center", children: [
|
|
1405
|
+
offlineMarker,
|
|
1406
|
+
statusMarker && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto flex", children: statusMarker })
|
|
1407
|
+
] }),
|
|
1408
|
+
entity
|
|
1409
|
+
] })
|
|
1410
|
+
]
|
|
1411
|
+
}
|
|
1412
|
+
);
|
|
1413
|
+
if (!tooltip) return tile;
|
|
1414
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { delayDuration: 500, children: [
|
|
1415
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: tile }),
|
|
1416
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { side: "bottom", sideOffset: 6, className: "p-2.5", children: tooltip })
|
|
1417
|
+
] });
|
|
1418
|
+
}
|
|
1419
|
+
function ExplorerFolderTile({
|
|
1420
|
+
name,
|
|
1421
|
+
displayName,
|
|
1422
|
+
path,
|
|
1423
|
+
count,
|
|
1424
|
+
density,
|
|
1425
|
+
editing,
|
|
1426
|
+
selected,
|
|
1427
|
+
partiallySelected,
|
|
1428
|
+
processingCount = 0,
|
|
1429
|
+
isOver,
|
|
1430
|
+
icon,
|
|
1431
|
+
menuItems = [],
|
|
1432
|
+
rootRef,
|
|
1433
|
+
rootProps,
|
|
1434
|
+
onOpen,
|
|
1435
|
+
href,
|
|
1436
|
+
labels,
|
|
1437
|
+
testIds,
|
|
1438
|
+
onToggleSelect,
|
|
1439
|
+
onCommitName,
|
|
1440
|
+
onCancelName
|
|
1441
|
+
}) {
|
|
1442
|
+
const l = { ...DEFAULT_EXPLORER_LABELS, ...labels };
|
|
1443
|
+
const iconSize = density === "list" ? 34 : 48;
|
|
1444
|
+
const isEmpty = count === 0;
|
|
1445
|
+
const countLabel = isEmpty ? l.empty : l.itemCount(count);
|
|
1446
|
+
const joined = path.join("/");
|
|
1447
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1448
|
+
"div",
|
|
1449
|
+
{
|
|
1450
|
+
ref: rootRef,
|
|
1451
|
+
...rootProps,
|
|
1452
|
+
onClick: editing || href ? void 0 : onOpen,
|
|
1453
|
+
"data-slot": "explorer-folder-tile",
|
|
1454
|
+
"data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.root, { testId: "explorer-folder" }),
|
|
1455
|
+
"data-folder-path": joined,
|
|
1456
|
+
title: name,
|
|
1457
|
+
className: ui.cn(
|
|
1458
|
+
"group relative flex h-full cursor-pointer select-none flex-col items-center justify-center gap-1 rounded-lg p-2 text-center transition",
|
|
1459
|
+
isOver ? "bg-accent ring-2 ring-primary/40" : selected ? "bg-accent ring-1 ring-primary/30" : "bg-muted hover:bg-muted/70",
|
|
1460
|
+
isEmpty && !isOver && !selected && "opacity-70"
|
|
1461
|
+
),
|
|
1462
|
+
children: [
|
|
1463
|
+
href && !editing && /* @__PURE__ */ jsxRuntime.jsx(TileLink, { href, label: displayName || name, onSelect: onOpen }),
|
|
1464
|
+
onToggleSelect && !isEmpty && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1465
|
+
SelectCheckbox,
|
|
1466
|
+
{
|
|
1467
|
+
selected: !!selected,
|
|
1468
|
+
onToggle: onToggleSelect,
|
|
1469
|
+
labels: l,
|
|
1470
|
+
className: ui.cn(
|
|
1471
|
+
"absolute left-1.5 top-1.5 z-20",
|
|
1472
|
+
partiallySelected && !selected && "opacity-100"
|
|
1473
|
+
)
|
|
1474
|
+
}
|
|
1475
|
+
),
|
|
1476
|
+
menuItems.length > 0 && !editing && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-1 top-1 z-20", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1477
|
+
ExplorerMenu,
|
|
1478
|
+
{
|
|
1479
|
+
items: menuItems,
|
|
1480
|
+
testId: chunkMHVNT4J3_cjs.testIdOr(testIds?.menu, { testId: "explorer-folder-menu" }),
|
|
1481
|
+
label: l.moreActions,
|
|
1482
|
+
align: "end"
|
|
1483
|
+
}
|
|
1484
|
+
) }),
|
|
1485
|
+
icon ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1486
|
+
lucideReact.Folder,
|
|
1487
|
+
{
|
|
1488
|
+
className: ui.cn(
|
|
1489
|
+
"transition",
|
|
1490
|
+
isEmpty ? "text-yellow-text/50" : "fill-yellow-text/30 text-yellow-text group-hover:fill-yellow-text/40"
|
|
1491
|
+
),
|
|
1492
|
+
size: iconSize
|
|
1493
|
+
}
|
|
1494
|
+
),
|
|
1495
|
+
editing ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1496
|
+
RenameField,
|
|
1497
|
+
{
|
|
1498
|
+
seed: name,
|
|
1499
|
+
testId: chunkMHVNT4J3_cjs.testIdOr(testIds?.renameInput, { testId: "explorer-rename-input" }),
|
|
1500
|
+
label: l.name,
|
|
1501
|
+
onCommit: (next) => onCommitName?.(next),
|
|
1502
|
+
onCancel: () => onCancelName?.(),
|
|
1503
|
+
className: "text-center"
|
|
1504
|
+
}
|
|
1505
|
+
) : displayName && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1506
|
+
"span",
|
|
1507
|
+
{
|
|
1508
|
+
className: ui.cn(
|
|
1509
|
+
"line-clamp-2 w-full break-words text-xs font-semibold leading-tight",
|
|
1510
|
+
isEmpty ? "text-foreground/60" : "text-foreground/90"
|
|
1511
|
+
),
|
|
1512
|
+
children: displayName
|
|
1513
|
+
}
|
|
1514
|
+
),
|
|
1515
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: countLabel }),
|
|
1516
|
+
processingCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1517
|
+
"span",
|
|
1518
|
+
{
|
|
1519
|
+
className: "inline-flex items-center gap-1 text-xs font-semibold text-primary",
|
|
1520
|
+
"data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.processing, {
|
|
1521
|
+
testId: `explorer-folder-processing-${joined}`
|
|
1522
|
+
}),
|
|
1523
|
+
children: [
|
|
1524
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.LoaderCircle, { className: "size-3 animate-spin" }),
|
|
1525
|
+
l.processing(processingCount)
|
|
1526
|
+
]
|
|
1527
|
+
}
|
|
1528
|
+
)
|
|
1529
|
+
]
|
|
1530
|
+
}
|
|
1531
|
+
);
|
|
1532
|
+
}
|
|
1533
|
+
function ExplorerFileTooltip({
|
|
1534
|
+
title,
|
|
1535
|
+
summary,
|
|
1536
|
+
modifiedLabel,
|
|
1537
|
+
modifiedByAvatar,
|
|
1538
|
+
shared,
|
|
1539
|
+
visibilityIcon,
|
|
1540
|
+
labels,
|
|
1541
|
+
uiLabels
|
|
1542
|
+
}) {
|
|
1543
|
+
const l = { ...DEFAULT_EXPLORER_LABELS, ...uiLabels };
|
|
1544
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "max-w-xs space-y-2", children: [
|
|
1545
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "break-words text-xs font-semibold leading-snug text-foreground", children: title }),
|
|
1546
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1 border-t border-border pt-1.5", children: [
|
|
1547
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 text-xs font-semibold text-foreground", children: [
|
|
1548
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { className: "size-3.5 shrink-0 text-yellow-text" }),
|
|
1549
|
+
l.aiSummary
|
|
1550
|
+
] }),
|
|
1551
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "line-clamp-6 text-xs leading-snug text-foreground/90", children: summary?.trim() || l.noSummary })
|
|
1552
|
+
] }),
|
|
1553
|
+
(modifiedLabel || labels.length > 0) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5 border-t border-border pt-1.5", children: [
|
|
1554
|
+
modifiedLabel && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2 text-xs text-muted-foreground", children: [
|
|
1555
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-1", children: [
|
|
1556
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: l.lastModifiedBy }),
|
|
1557
|
+
modifiedByAvatar,
|
|
1558
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: modifiedLabel })
|
|
1559
|
+
] }),
|
|
1560
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
1561
|
+
visibilityIcon,
|
|
1562
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: shared ? l.shared : l.private })
|
|
1563
|
+
] })
|
|
1564
|
+
] }),
|
|
1565
|
+
labels.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-1 pt-0.5", children: labels.map((label) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1566
|
+
"span",
|
|
1567
|
+
{
|
|
1568
|
+
className: "rounded bg-muted px-1.5 py-0.5 text-xs font-medium text-foreground/80",
|
|
1569
|
+
children: label
|
|
1570
|
+
},
|
|
1571
|
+
label
|
|
1572
|
+
)) })
|
|
1573
|
+
] })
|
|
1574
|
+
] });
|
|
1575
|
+
}
|
|
1576
|
+
var pill = classVarianceAuthority.cva(
|
|
1577
|
+
"inline-flex max-w-full items-center justify-center gap-1 rounded-full text-xs font-medium leading-none",
|
|
1578
|
+
{
|
|
1579
|
+
variants: {
|
|
1580
|
+
/** `icon` = glyph-only chip; `label` = text pill. */
|
|
1581
|
+
shape: { icon: "size-6 p-0 pointer-coarse:size-8", label: "h-6 px-2 pointer-coarse:h-8" },
|
|
1582
|
+
interactive: {
|
|
1583
|
+
true: "relative cursor-pointer pointer-coarse:after:absolute pointer-coarse:after:left-1/2 pointer-coarse:after:top-1/2 pointer-coarse:after:size-11 pointer-coarse:after:-translate-x-1/2 pointer-coarse:after:-translate-y-1/2 pointer-coarse:after:content-[''] hover:brightness-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1584
|
+
false: ""
|
|
1585
|
+
}
|
|
1586
|
+
},
|
|
1587
|
+
defaultVariants: { shape: "label", interactive: false }
|
|
1588
|
+
}
|
|
1589
|
+
);
|
|
1590
|
+
function StatusPill({
|
|
1591
|
+
tone = "neutral",
|
|
1592
|
+
icon,
|
|
1593
|
+
label,
|
|
1594
|
+
progress,
|
|
1595
|
+
title,
|
|
1596
|
+
onClick,
|
|
1597
|
+
testId,
|
|
1598
|
+
className
|
|
1599
|
+
}) {
|
|
1600
|
+
const hasLabel = label !== void 0 && label !== null && label !== "";
|
|
1601
|
+
const classes = ui.cn(
|
|
1602
|
+
pill({ shape: hasLabel ? "label" : "icon", interactive: !!onClick }),
|
|
1603
|
+
chunk32HW2Q33_cjs.TONE_SURFACE[tone],
|
|
1604
|
+
progress && "h-auto min-h-6 flex-col gap-0 px-2 py-1",
|
|
1605
|
+
className
|
|
1606
|
+
);
|
|
1607
|
+
const body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1608
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex max-w-full items-center gap-1", children: [
|
|
1609
|
+
icon,
|
|
1610
|
+
hasLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: label })
|
|
1611
|
+
] }),
|
|
1612
|
+
progress && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1613
|
+
"span",
|
|
1614
|
+
{
|
|
1615
|
+
"aria-hidden": true,
|
|
1616
|
+
"data-slot": "status-pill-progress",
|
|
1617
|
+
className: ui.cn(
|
|
1618
|
+
"mt-0.5 block h-1 w-full min-w-10 shrink-0 rounded-sm",
|
|
1619
|
+
progress === "queued" ? "progress-bar-queued" : "progress-bar-processing"
|
|
1620
|
+
)
|
|
1621
|
+
}
|
|
1622
|
+
)
|
|
1623
|
+
] });
|
|
1624
|
+
if (onClick) {
|
|
1625
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1626
|
+
"button",
|
|
1627
|
+
{
|
|
1628
|
+
type: "button",
|
|
1629
|
+
title,
|
|
1630
|
+
"aria-label": hasLabel ? void 0 : title,
|
|
1631
|
+
"data-slot": "status-pill",
|
|
1632
|
+
"data-testid": testId,
|
|
1633
|
+
className: classes,
|
|
1634
|
+
onClick: (e) => {
|
|
1635
|
+
e.stopPropagation();
|
|
1636
|
+
onClick();
|
|
1637
|
+
},
|
|
1638
|
+
onKeyDown: (e) => e.stopPropagation(),
|
|
1639
|
+
children: body
|
|
1640
|
+
}
|
|
1641
|
+
);
|
|
1642
|
+
}
|
|
1643
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1644
|
+
"span",
|
|
1645
|
+
{
|
|
1646
|
+
title,
|
|
1647
|
+
role: hasLabel || !title ? void 0 : "img",
|
|
1648
|
+
"aria-label": hasLabel ? void 0 : title,
|
|
1649
|
+
"data-slot": "status-pill",
|
|
1650
|
+
"data-testid": testId,
|
|
1651
|
+
className: classes,
|
|
1652
|
+
children: body
|
|
1653
|
+
}
|
|
1654
|
+
);
|
|
1655
|
+
}
|
|
1656
|
+
var STAGE_VARIANTS = {
|
|
1657
|
+
parsing: { Icon: lucideReact.FileX, title: "Parsing failed" },
|
|
1658
|
+
indexing: { Icon: lucideReact.DatabaseZap, title: "Indexing failed" },
|
|
1659
|
+
encrypting: { Icon: lucideReact.LockKeyholeOpen, title: "Encryption failed" },
|
|
1660
|
+
analysing: { Icon: lucideReact.BrainCircuit, title: "Analysis failed" },
|
|
1661
|
+
queued: { Icon: lucideReact.CircleSlash, title: "Failed before processing" },
|
|
1662
|
+
unknown: { Icon: lucideReact.AlertCircle, title: "Failed" }
|
|
1663
|
+
};
|
|
1664
|
+
var LEGACY_VARIANT = {
|
|
1665
|
+
Icon: lucideReact.AlertCircle,
|
|
1666
|
+
title: "Failed (stage unknown)"
|
|
1667
|
+
};
|
|
1668
|
+
function resolveVariant(stage) {
|
|
1669
|
+
if (stage == null) return LEGACY_VARIANT;
|
|
1670
|
+
return STAGE_VARIANTS[stage] ?? STAGE_VARIANTS.unknown;
|
|
1671
|
+
}
|
|
1672
|
+
var FailedStageIcon = react.memo(function FailedStageIcon2({
|
|
1673
|
+
stage,
|
|
1674
|
+
errorMessage,
|
|
1675
|
+
className = "w-4 h-4 text-red-text cursor-pointer hover:text-red-text",
|
|
1676
|
+
onClick
|
|
1677
|
+
}) {
|
|
1678
|
+
const { Icon, title } = resolveVariant(stage);
|
|
1679
|
+
const fullTitle = errorMessage ? `${title}: ${errorMessage}` : title;
|
|
1680
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { title: fullTitle, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className, onClick }) });
|
|
1681
|
+
});
|
|
1682
|
+
var MAX_NAMES_IN_CONFIRM = 5;
|
|
1683
|
+
function shareStateOf(items) {
|
|
1684
|
+
if (items.length === 0) return "private";
|
|
1685
|
+
const sharedCount = items.filter((item) => item.shared === true).length;
|
|
1686
|
+
if (sharedCount === items.length) return "shared";
|
|
1687
|
+
return sharedCount > 0 ? "mixed" : "private";
|
|
1688
|
+
}
|
|
1689
|
+
function shareTooltipFor(state, isSingle) {
|
|
1690
|
+
const workspace = ui.getEntityLabel("WORKSPACE");
|
|
1691
|
+
const subject = isSingle ? "" : " all";
|
|
1692
|
+
if (state === "shared") return `Hide${subject} from ${workspace} members`;
|
|
1693
|
+
if (state === "mixed") return `Make all visible to ${workspace} members (some already shared)`;
|
|
1694
|
+
return `Make${subject} visible to ${workspace} members`;
|
|
1695
|
+
}
|
|
1696
|
+
function confirmHideFromMembers(confirm, count, members) {
|
|
1697
|
+
const workspace = ui.getEntityLabel("WORKSPACE");
|
|
1698
|
+
const documentLabel = ui.getEntityLabel("DOCUMENT", count === 1 ? "SINGULAR" : "PLURAL");
|
|
1699
|
+
const pronoun = count === 1 ? "it" : "them";
|
|
1700
|
+
const names = members.filter((member) => !ui.isAgent(member.user)).map((member) => ui.getUserDisplayName(member.user));
|
|
1701
|
+
const shown = names.slice(0, MAX_NAMES_IN_CONFIRM);
|
|
1702
|
+
const hiddenCount = names.length - shown.length;
|
|
1703
|
+
const listed = hiddenCount > 0 ? [...shown, `${hiddenCount} more`] : shown;
|
|
1704
|
+
const last = listed[listed.length - 1];
|
|
1705
|
+
const audienceList = listed.length > 2 ? `${listed.slice(0, -1).join(", ")}, and ${last}` : listed.join(" and ");
|
|
1706
|
+
const audience = names.length > 0 ? `Right now ${audienceList} can see ${pronoun}. ` : "";
|
|
1707
|
+
return confirm({
|
|
1708
|
+
message: `Hide ${count} ${documentLabel.toLowerCase()} from ${workspace} members? ${audience}They will no longer be able to see ${pronoun}.`,
|
|
1709
|
+
title: "Hide from members"
|
|
1710
|
+
});
|
|
1711
|
+
}
|
|
1712
|
+
function visibilityAudience(shared, workspaceLabel = ui.getEntityLabel("WORKSPACE")) {
|
|
1713
|
+
return shared ? `Shared with ${workspaceLabel.toLowerCase()}` : "Private to you";
|
|
1714
|
+
}
|
|
1715
|
+
function visibilityToggleTooltip(shared) {
|
|
1716
|
+
const workspace = ui.getEntityLabel("WORKSPACE").toLowerCase();
|
|
1717
|
+
return shared ? `${visibilityAudience(true)}: everyone in it can see this file. Click to make it private to you.` : `${visibilityAudience(false)}: only you can see this file. Click to share it with the ${workspace}.`;
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
exports.CHROME = CHROME;
|
|
1721
|
+
exports.DEFAULT_EXPLORER_LABELS = DEFAULT_EXPLORER_LABELS;
|
|
1722
|
+
exports.DEFAULT_FOLDER_FILTER_LABELS = DEFAULT_FOLDER_FILTER_LABELS;
|
|
1723
|
+
exports.DEFAULT_FOLDER_PICKER_LABELS = DEFAULT_FOLDER_PICKER_LABELS;
|
|
1724
|
+
exports.ExplorerDragPreview = ExplorerDragPreview;
|
|
1725
|
+
exports.ExplorerDropOverlay = ExplorerDropOverlay;
|
|
1726
|
+
exports.ExplorerEmpty = ExplorerEmpty;
|
|
1727
|
+
exports.ExplorerFileTile = ExplorerFileTile;
|
|
1728
|
+
exports.ExplorerFileTooltip = ExplorerFileTooltip;
|
|
1729
|
+
exports.ExplorerFolderTile = ExplorerFolderTile;
|
|
1730
|
+
exports.ExplorerFrame = ExplorerFrame;
|
|
1731
|
+
exports.ExplorerLoadingTiles = ExplorerLoadingTiles;
|
|
1732
|
+
exports.ExplorerMarquee = ExplorerMarquee;
|
|
1733
|
+
exports.ExplorerScroller = ExplorerScroller;
|
|
1734
|
+
exports.ExplorerStage = ExplorerStage;
|
|
1735
|
+
exports.FailedStageIcon = FailedStageIcon;
|
|
1736
|
+
exports.FieldAttribution = FieldAttribution;
|
|
1737
|
+
exports.FieldFolderSelect = FieldFolderSelect;
|
|
1738
|
+
exports.FieldFolderValue = FieldFolderValue;
|
|
1739
|
+
exports.FieldLabelsSelect = FieldLabelsSelect;
|
|
1740
|
+
exports.FieldNativeSelect = FieldNativeSelect;
|
|
1741
|
+
exports.FieldValue = FieldValue;
|
|
1742
|
+
exports.FieldWithAttribution = FieldWithAttribution;
|
|
1743
|
+
exports.FilesFilterBar = FilesFilterBar;
|
|
1744
|
+
exports.FilesModalFooter = FilesModalFooter;
|
|
1745
|
+
exports.FilesTagsButton = FilesTagsButton;
|
|
1746
|
+
exports.FilesViewCenter = FilesViewCenter;
|
|
1747
|
+
exports.FilterButton = FilterButton;
|
|
1748
|
+
exports.FolderBreadcrumb = FolderBreadcrumb;
|
|
1749
|
+
exports.FolderCell = FolderCell;
|
|
1750
|
+
exports.FolderCommandList = FolderCommandList;
|
|
1751
|
+
exports.FolderFilterButton = FolderFilterButton;
|
|
1752
|
+
exports.FolderPickerRow = FolderPickerRow;
|
|
1753
|
+
exports.FolderProviderIcon = FolderProviderIcon;
|
|
1754
|
+
exports.FolderTree = FolderTree;
|
|
1755
|
+
exports.LINE_PX = LINE_PX;
|
|
1756
|
+
exports.MAX_LINES = MAX_LINES;
|
|
1757
|
+
exports.MIN_LINES = MIN_LINES;
|
|
1758
|
+
exports.RECENTLY_DELETED_HINT = RECENTLY_DELETED_HINT;
|
|
1759
|
+
exports.RECENTLY_DELETED_HINT_PLURAL = RECENTLY_DELETED_HINT_PLURAL;
|
|
1760
|
+
exports.ROW_MIN = ROW_MIN;
|
|
1761
|
+
exports.RowDensityControl = RowDensityControl;
|
|
1762
|
+
exports.StatusPill = StatusPill;
|
|
1763
|
+
exports.VendorLogo = VendorLogo;
|
|
1764
|
+
exports.buildExplorerEntries = buildExplorerEntries;
|
|
1765
|
+
exports.canChangeVisibility = canChangeVisibility;
|
|
1766
|
+
exports.canDeleteDocument = canDeleteDocument;
|
|
1767
|
+
exports.canEditDocumentFields = canEditDocumentFields;
|
|
1768
|
+
exports.collectFolderDocs = collectFolderDocs;
|
|
1769
|
+
exports.confirmHideFromMembers = confirmHideFromMembers;
|
|
1770
|
+
exports.formatFolderSegment = formatFolderSegment;
|
|
1771
|
+
exports.getExplorerDisplayName = getExplorerDisplayName;
|
|
1772
|
+
exports.hasFolderProviderIcon = hasFolderProviderIcon;
|
|
1773
|
+
exports.isExplorerDocument = isExplorerDocument;
|
|
1774
|
+
exports.joinFolderPath = joinFolderPath;
|
|
1775
|
+
exports.linesForRowHeight = linesForRowHeight;
|
|
1776
|
+
exports.parseFolderSegments = parseFolderSegments;
|
|
1777
|
+
exports.rowHeightForLines = rowHeightForLines;
|
|
1778
|
+
exports.searchExplorerDocuments = searchExplorerDocuments;
|
|
1779
|
+
exports.shareStateOf = shareStateOf;
|
|
1780
|
+
exports.shareTooltipFor = shareTooltipFor;
|
|
1781
|
+
exports.sortExplorerFiles = sortExplorerFiles;
|
|
1782
|
+
exports.visibilityAudience = visibilityAudience;
|
|
1783
|
+
exports.visibilityToggleTooltip = visibilityToggleTooltip;
|
|
1784
|
+
//# sourceMappingURL=chunk-WV4TD2HZ.cjs.map
|
|
1785
|
+
//# sourceMappingURL=chunk-WV4TD2HZ.cjs.map
|