@arbidocs/blocks 0.5.49 → 0.5.50
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/{ConnectedCallDock-HRP4B2MJ.js → ConnectedCallDock-5OLBZED2.js} +8 -8
- package/dist/{ConnectedCallDock-HRP4B2MJ.js.map → ConnectedCallDock-5OLBZED2.js.map} +1 -1
- package/dist/{ConnectedCallDock-CW2XPKGT.cjs → ConnectedCallDock-GHJTVUSQ.cjs} +17 -17
- package/dist/{ConnectedCallDock-CW2XPKGT.cjs.map → ConnectedCallDock-GHJTVUSQ.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-4QOEQFWP.cjs → ConnectedCallRoom-GVNZ3S6R.cjs} +9 -9
- package/dist/{ConnectedCallRoom-4QOEQFWP.cjs.map → ConnectedCallRoom-GVNZ3S6R.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-TONSYRP4.js → ConnectedCallRoom-SSSKBQA7.js} +8 -8
- package/dist/{ConnectedCallRoom-TONSYRP4.js.map → ConnectedCallRoom-SSSKBQA7.js.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-AGRCHABY.cjs → ConnectedNativeDocxComparison-7ADU6OGW.cjs} +14 -14
- package/dist/{ConnectedNativeDocxComparison-AGRCHABY.cjs.map → ConnectedNativeDocxComparison-7ADU6OGW.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-HDH2QP7N.js → ConnectedNativeDocxComparison-GIATDKIH.js} +13 -13
- package/dist/{ConnectedNativeDocxComparison-HDH2QP7N.js.map → ConnectedNativeDocxComparison-GIATDKIH.js.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-TDAJGXIC.cjs → ConnectedNativeDocxEditor-GCVZCWDG.cjs} +14 -14
- package/dist/{ConnectedNativeDocxEditor-TDAJGXIC.cjs.map → ConnectedNativeDocxEditor-GCVZCWDG.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxEditor-K5ZZME7M.js → ConnectedNativeDocxEditor-UQTPB42S.js} +12 -12
- package/dist/{ConnectedNativeDocxEditor-K5ZZME7M.js.map → ConnectedNativeDocxEditor-UQTPB42S.js.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-RJXD4ASQ.cjs → ConnectedStreamedWordArtifact-DUBHCHBP.cjs} +14 -14
- package/dist/ConnectedStreamedWordArtifact-DUBHCHBP.cjs.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-GKSZLKOU.js → ConnectedStreamedWordArtifact-VN5XBWSI.js} +13 -13
- package/dist/ConnectedStreamedWordArtifact-VN5XBWSI.js.map +1 -0
- package/dist/{DocumentReviewCard-WZHQXLGD.cjs → DocumentReviewCard-DLR4XOIZ.cjs} +14 -14
- package/dist/{DocumentReviewCard-WZHQXLGD.cjs.map → DocumentReviewCard-DLR4XOIZ.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-RD26SHWJ.js → DocumentReviewCard-Y67FFRPC.js} +9 -9
- package/dist/{DocumentReviewCard-RD26SHWJ.js.map → DocumentReviewCard-Y67FFRPC.js.map} +1 -1
- package/dist/{WorkspaceTableView-4NJ72RYO.cjs → WorkspaceTableView-GZ6Y6QCD.cjs} +10 -10
- package/dist/{WorkspaceTableView-4NJ72RYO.cjs.map → WorkspaceTableView-GZ6Y6QCD.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-6X6CQLLB.js → WorkspaceTableView-ZI2HDG2R.js} +8 -8
- package/dist/{WorkspaceTableView-6X6CQLLB.js.map → WorkspaceTableView-ZI2HDG2R.js.map} +1 -1
- package/dist/agents/index.cjs +332 -332
- package/dist/agents/index.js +9 -9
- package/dist/calls/index.cjs +142 -142
- package/dist/calls/index.js +8 -8
- package/dist/chat/index.cjs +79 -79
- package/dist/chat/index.js +3 -3
- package/dist/{chunk-T3E7POT3.cjs → chunk-226ILMHW.cjs} +3 -3
- package/dist/{chunk-T3E7POT3.cjs.map → chunk-226ILMHW.cjs.map} +1 -1
- package/dist/{chunk-O4H2LH7X.js → chunk-3Y4UTPCD.js} +3 -3
- package/dist/{chunk-O4H2LH7X.js.map → chunk-3Y4UTPCD.js.map} +1 -1
- package/dist/{chunk-CN653BRY.cjs → chunk-4FIYA764.cjs} +74 -74
- package/dist/{chunk-CN653BRY.cjs.map → chunk-4FIYA764.cjs.map} +1 -1
- package/dist/{chunk-OKKL7VJU.js → chunk-53YTK235.js} +6 -6
- package/dist/{chunk-OKKL7VJU.js.map → chunk-53YTK235.js.map} +1 -1
- package/dist/{chunk-HBB5GNOT.cjs → chunk-5WV7HI7Y.cjs} +3 -3
- package/dist/{chunk-HBB5GNOT.cjs.map → chunk-5WV7HI7Y.cjs.map} +1 -1
- package/dist/{chunk-TBFEYO64.cjs → chunk-5YX3R6CK.cjs} +3 -3
- package/dist/{chunk-TBFEYO64.cjs.map → chunk-5YX3R6CK.cjs.map} +1 -1
- package/dist/{chunk-UA7JZOFP.js → chunk-6D3XKIEB.js} +5 -5
- package/dist/{chunk-UA7JZOFP.js.map → chunk-6D3XKIEB.js.map} +1 -1
- package/dist/{chunk-QNETPVHY.js → chunk-6GI3S7TN.js} +3 -3
- package/dist/{chunk-QNETPVHY.js.map → chunk-6GI3S7TN.js.map} +1 -1
- package/dist/{chunk-XI376C3E.js → chunk-75Z5AUMM.js} +3 -3
- package/dist/{chunk-XI376C3E.js.map → chunk-75Z5AUMM.js.map} +1 -1
- package/dist/{chunk-UDPS5HU7.js → chunk-7G4N2HP7.js} +4 -4
- package/dist/{chunk-UDPS5HU7.js.map → chunk-7G4N2HP7.js.map} +1 -1
- package/dist/{chunk-LOFNX5OS.cjs → chunk-7KIM64LQ.cjs} +7 -7
- package/dist/{chunk-LOFNX5OS.cjs.map → chunk-7KIM64LQ.cjs.map} +1 -1
- package/dist/{chunk-Y3L5PAZX.js → chunk-7QJNWQ7O.js} +3 -3
- package/dist/{chunk-Y3L5PAZX.js.map → chunk-7QJNWQ7O.js.map} +1 -1
- package/dist/{chunk-IP34TOTK.js → chunk-A54WLQQA.js} +5 -5
- package/dist/{chunk-IP34TOTK.js.map → chunk-A54WLQQA.js.map} +1 -1
- package/dist/{chunk-SNMRCCKX.cjs → chunk-BB4PMCU6.cjs} +5 -5
- package/dist/{chunk-SNMRCCKX.cjs.map → chunk-BB4PMCU6.cjs.map} +1 -1
- package/dist/{chunk-OTLKI27J.js → chunk-DYYTVUBW.js} +4 -4
- package/dist/{chunk-OTLKI27J.js.map → chunk-DYYTVUBW.js.map} +1 -1
- package/dist/{chunk-AANKR46B.cjs → chunk-E6FNC5PN.cjs} +17 -17
- package/dist/{chunk-AANKR46B.cjs.map → chunk-E6FNC5PN.cjs.map} +1 -1
- package/dist/{chunk-2WTOVE2Q.js → chunk-EXE3RBDZ.js} +3 -3
- package/dist/{chunk-2WTOVE2Q.js.map → chunk-EXE3RBDZ.js.map} +1 -1
- package/dist/{chunk-LPGFODB4.cjs → chunk-FEVJA4BP.cjs} +3 -3
- package/dist/{chunk-LPGFODB4.cjs.map → chunk-FEVJA4BP.cjs.map} +1 -1
- package/dist/{chunk-ZN2EVDK6.cjs → chunk-FYL7IGK2.cjs} +10 -10
- package/dist/{chunk-ZN2EVDK6.cjs.map → chunk-FYL7IGK2.cjs.map} +1 -1
- package/dist/{chunk-M3VOZ6RR.js → chunk-GXJIN7G3.js} +3 -3
- package/dist/{chunk-M3VOZ6RR.js.map → chunk-GXJIN7G3.js.map} +1 -1
- package/dist/{chunk-KSGMPJIT.cjs → chunk-HNEOW7F3.cjs} +4 -4
- package/dist/{chunk-KSGMPJIT.cjs.map → chunk-HNEOW7F3.cjs.map} +1 -1
- package/dist/{chunk-NNUNS47F.js → chunk-ICCBNHPU.js} +3 -3
- package/dist/{chunk-NNUNS47F.js.map → chunk-ICCBNHPU.js.map} +1 -1
- package/dist/{chunk-FVZIXO6F.js → chunk-IDFAMK2G.js} +4 -4
- package/dist/{chunk-FVZIXO6F.js.map → chunk-IDFAMK2G.js.map} +1 -1
- package/dist/{chunk-DVS7G42G.cjs → chunk-IOPGY3IP.cjs} +19 -19
- package/dist/{chunk-DVS7G42G.cjs.map → chunk-IOPGY3IP.cjs.map} +1 -1
- package/dist/{chunk-4H3Y7AFR.js → chunk-IQ3VDTR7.js} +3 -3
- package/dist/{chunk-4H3Y7AFR.js.map → chunk-IQ3VDTR7.js.map} +1 -1
- package/dist/{chunk-5SUTOXCC.js → chunk-JGFBC66V.js} +4 -4
- package/dist/{chunk-5SUTOXCC.js.map → chunk-JGFBC66V.js.map} +1 -1
- package/dist/{chunk-W4KK54PA.js → chunk-JOK2TJLY.js} +4 -4
- package/dist/{chunk-W4KK54PA.js.map → chunk-JOK2TJLY.js.map} +1 -1
- package/dist/{chunk-LUKD7KKS.cjs → chunk-JYR55F3P.cjs} +18 -18
- package/dist/{chunk-LUKD7KKS.cjs.map → chunk-JYR55F3P.cjs.map} +1 -1
- package/dist/{chunk-SSCJ6EFS.cjs → chunk-MBGV6JHG.cjs} +4 -4
- package/dist/{chunk-SSCJ6EFS.cjs.map → chunk-MBGV6JHG.cjs.map} +1 -1
- package/dist/{chunk-EFXAYLVO.js → chunk-NIH2QCPE.js} +3 -3
- package/dist/{chunk-EFXAYLVO.js.map → chunk-NIH2QCPE.js.map} +1 -1
- package/dist/{chunk-VM3MDWKJ.js → chunk-NQA6P7XB.js} +3 -3
- package/dist/{chunk-VM3MDWKJ.js.map → chunk-NQA6P7XB.js.map} +1 -1
- package/dist/{chunk-R642PDJF.js → chunk-O4LORAFC.js} +7 -7
- package/dist/{chunk-R642PDJF.js.map → chunk-O4LORAFC.js.map} +1 -1
- package/dist/{chunk-GTPWCAUC.cjs → chunk-PFJSYJ34.cjs} +22 -22
- package/dist/{chunk-GTPWCAUC.cjs.map → chunk-PFJSYJ34.cjs.map} +1 -1
- package/dist/{chunk-MRUKU677.js → chunk-PP3LWBIH.js} +3 -3
- package/dist/{chunk-MRUKU677.js.map → chunk-PP3LWBIH.js.map} +1 -1
- package/dist/{chunk-ECAII5N2.cjs → chunk-QPZDJVNY.cjs} +3 -3
- package/dist/{chunk-ECAII5N2.cjs.map → chunk-QPZDJVNY.cjs.map} +1 -1
- package/dist/{chunk-WCCRGRBR.cjs → chunk-QQMZ7XKU.cjs} +4 -4
- package/dist/{chunk-WCCRGRBR.cjs.map → chunk-QQMZ7XKU.cjs.map} +1 -1
- package/dist/{chunk-2XBFFJJV.cjs → chunk-RTS3B2W7.cjs} +5 -5
- package/dist/{chunk-2XBFFJJV.cjs.map → chunk-RTS3B2W7.cjs.map} +1 -1
- package/dist/{chunk-YEXV3PV7.cjs → chunk-S7B5E3RU.cjs} +52 -52
- package/dist/{chunk-YEXV3PV7.cjs.map → chunk-S7B5E3RU.cjs.map} +1 -1
- package/dist/{chunk-HO2R6QRK.cjs → chunk-TQYEHARI.cjs} +5 -5
- package/dist/{chunk-HO2R6QRK.cjs.map → chunk-TQYEHARI.cjs.map} +1 -1
- package/dist/{chunk-O6W222ZU.cjs → chunk-V7JDMKNQ.cjs} +5 -5
- package/dist/{chunk-O6W222ZU.cjs.map → chunk-V7JDMKNQ.cjs.map} +1 -1
- package/dist/{chunk-EOT57KLI.cjs → chunk-XHHDVSYY.cjs} +4 -4
- package/dist/{chunk-EOT57KLI.cjs.map → chunk-XHHDVSYY.cjs.map} +1 -1
- package/dist/{chunk-CG5STA76.cjs → chunk-YD3RN2FY.cjs} +3 -3
- package/dist/{chunk-CG5STA76.cjs.map → chunk-YD3RN2FY.cjs.map} +1 -1
- package/dist/{chunk-U663NTEI.js → chunk-YRORPDIY.js} +3 -3
- package/dist/{chunk-U663NTEI.js.map → chunk-YRORPDIY.js.map} +1 -1
- package/dist/{chunk-KCB5G4KU.js → chunk-YYZH6VRP.js} +3 -3
- package/dist/{chunk-KCB5G4KU.js.map → chunk-YYZH6VRP.js.map} +1 -1
- package/dist/{chunk-QKR6Q34L.js → chunk-ZAYUJFPI.js} +3 -3
- package/dist/{chunk-QKR6Q34L.js.map → chunk-ZAYUJFPI.js.map} +1 -1
- package/dist/{chunk-DZP6XFTR.cjs → chunk-ZXHGPTAZ.cjs} +11 -11
- package/dist/{chunk-DZP6XFTR.cjs.map → chunk-ZXHGPTAZ.cjs.map} +1 -1
- package/dist/collaboration/index.cjs +1 -1
- package/dist/collaboration/index.js +1 -1
- package/dist/connect/docx.cjs +16 -16
- package/dist/connect/docx.js +12 -12
- package/dist/connect/index.cjs +1029 -1029
- package/dist/connect/index.js +39 -39
- package/dist/connect/viewer.cjs +64 -64
- package/dist/connect/viewer.js +17 -17
- package/dist/connection/config/useDeveloperConfig.d.ts +1 -1
- package/dist/facts/index.cjs +57 -57
- package/dist/facts/index.js +5 -5
- package/dist/files/index.cjs +223 -223
- package/dist/files/index.js +3 -3
- package/dist/home/index.cjs +29 -29
- package/dist/home/index.js +4 -4
- package/dist/index.cjs +1424 -1424
- package/dist/index.js +24 -24
- package/dist/settings/index.cjs +157 -157
- package/dist/settings/index.js +4 -4
- package/dist/shell/index.cjs +85 -85
- package/dist/shell/index.js +5 -5
- package/dist/studio/index.cjs +8 -8
- package/dist/studio/index.js +7 -7
- package/dist/workflow-canvas/index.cjs +24 -24
- package/dist/workflow-canvas/index.js +11 -11
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ConnectedStreamedWordArtifact-GKSZLKOU.js.map +0 -1
- package/dist/ConnectedStreamedWordArtifact-RJXD4ASQ.cjs.map +0 -1
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
var chunk464YPRAE_cjs = require('./chunk-464YPRAE.cjs');
|
|
5
5
|
var chunkPICGTGEB_cjs = require('./chunk-PICGTGEB.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkZXHGPTAZ_cjs = require('./chunk-ZXHGPTAZ.cjs');
|
|
7
|
+
var chunkVZOOGA47_cjs = require('./chunk-VZOOGA47.cjs');
|
|
7
8
|
var chunkV5QAXGGT_cjs = require('./chunk-V5QAXGGT.cjs');
|
|
8
9
|
var chunkDLHAKRU2_cjs = require('./chunk-DLHAKRU2.cjs');
|
|
9
10
|
var chunkG2BKHCI2_cjs = require('./chunk-G2BKHCI2.cjs');
|
|
10
|
-
var chunk725OETK3_cjs = require('./chunk-725OETK3.cjs');
|
|
11
|
-
var chunkVZOOGA47_cjs = require('./chunk-VZOOGA47.cjs');
|
|
12
11
|
var chunkUFEXJIEY_cjs = require('./chunk-UFEXJIEY.cjs');
|
|
12
|
+
var chunk725OETK3_cjs = require('./chunk-725OETK3.cjs');
|
|
13
13
|
var chunkI72IYIO2_cjs = require('./chunk-I72IYIO2.cjs');
|
|
14
14
|
var react = require('react');
|
|
15
15
|
var reactQuery = require('@tanstack/react-query');
|
|
@@ -44,7 +44,7 @@ function toWorkflowFieldDocument(doc) {
|
|
|
44
44
|
function useConnectedWorkflowScopeSource() {
|
|
45
45
|
const { data: docs } = chunkV5QAXGGT_cjs.useListedDocuments();
|
|
46
46
|
const { data: tags } = chunkV5QAXGGT_cjs.useConnectedTags();
|
|
47
|
-
return react.useMemo(() =>
|
|
47
|
+
return react.useMemo(() => chunkZXHGPTAZ_cjs.buildWorkflowScopeSource(docs, chunkZXHGPTAZ_cjs.documentScopeLabels(tags)), [docs, tags]);
|
|
48
48
|
}
|
|
49
49
|
function useConnectedAgentOptions() {
|
|
50
50
|
const { data: agents } = react$1.useAgents();
|
|
@@ -101,7 +101,7 @@ function ConnectedWorkflowDocumentsField({
|
|
|
101
101
|
}
|
|
102
102
|
),
|
|
103
103
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
104
|
-
|
|
104
|
+
chunkZXHGPTAZ_cjs.WorkflowDocumentsField,
|
|
105
105
|
{
|
|
106
106
|
field,
|
|
107
107
|
value,
|
|
@@ -123,7 +123,7 @@ function ConnectedWorkflowLauncher({
|
|
|
123
123
|
const scopeSource = useConnectedWorkflowScopeSource();
|
|
124
124
|
const agents = useConnectedAgentOptions();
|
|
125
125
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
126
|
-
|
|
126
|
+
chunkZXHGPTAZ_cjs.WorkflowLauncher,
|
|
127
127
|
{
|
|
128
128
|
...props,
|
|
129
129
|
scopeSource,
|
|
@@ -245,7 +245,7 @@ var DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS = {
|
|
|
245
245
|
var messageOf = (error) => error instanceof Error ? error.message : "";
|
|
246
246
|
function ConnectedWorkflowsTable({
|
|
247
247
|
filter,
|
|
248
|
-
describeTrigger = (w) =>
|
|
248
|
+
describeTrigger = (w) => chunkZXHGPTAZ_cjs.workflowTriggerType(w).replaceAll("_", " "),
|
|
249
249
|
formatDate = chunkUFEXJIEY_cjs.fmtDate,
|
|
250
250
|
onViewRuns,
|
|
251
251
|
connectedLabels,
|
|
@@ -307,7 +307,7 @@ function ConnectedWorkflowsTable({
|
|
|
307
307
|
await act(workflow, () => remove.mutateAsync(workflow.external_id));
|
|
308
308
|
};
|
|
309
309
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
310
|
-
|
|
310
|
+
chunkZXHGPTAZ_cjs.WorkflowsTable,
|
|
311
311
|
{
|
|
312
312
|
...tableProps,
|
|
313
313
|
workflows,
|
|
@@ -564,5 +564,5 @@ exports.useConnectedWorkflowScopeSource = useConnectedWorkflowScopeSource;
|
|
|
564
564
|
exports.useConnectedWorkspaceRole = useConnectedWorkspaceRole;
|
|
565
565
|
exports.useDocxCommentTarget = useDocxCommentTarget;
|
|
566
566
|
exports.useNativeDocxSupport = useNativeDocxSupport;
|
|
567
|
-
//# sourceMappingURL=chunk-
|
|
568
|
-
//# sourceMappingURL=chunk-
|
|
567
|
+
//# sourceMappingURL=chunk-FYL7IGK2.cjs.map
|
|
568
|
+
//# sourceMappingURL=chunk-FYL7IGK2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/docx/support.ts","../src/connection/ConnectedWorkflowLauncher.tsx","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["useHost","useListedDocuments","useConnectedTags","useMemo","buildWorkflowScopeSource","documentScopeLabels","useAgents","useBlocksEnvironment","useConnectedWorkspace","useUploadDocuments","useThumbnails","useRef","useState","useCallback","jsxs","Fragment","jsx","WorkflowDocumentsField","WorkflowLauncher","DocumentPicker","useArbi","buildDeepLinkUrl","parseDeepLinkPath","useWorkspaceUsers","workflowTriggerType","fmtDate","useWorkflows","useConnectedConversations","useUpdateWorkflow","useDeleteWorkflow","useRunWorkflow","useEffect","WorkflowsTable","useSetWorkspaceHouseTemplate","useWorkspaces","supportsHouseTemplates","workspaceHouseTemplateId","useHouseTemplateCandidates","contentPath","builtinHouseTemplate","isCandidate","useRegisterOpenDocument","NativeDocxEditor","useQueryClient","useOptionalDocumentTools","loadDocxFonts","refreshDocuments","fetchSavedSignature","storeSavedSignature"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBA,IAAM,aAAgC,EAAC;AACvC,IAAM,YAAY,MAAM,IAAA;AAEjB,SAAS,oBAAA,GAA0C;AACxD,EAAA,OAAOA,yBAAA,GAAU,IAAA,IAAQ,UAAA;AAC3B;AAGO,SAAS,oBAAA,GAAyE;AACvF,EAAA,MAAM,SAAA,GAAY,oBAAA,EAAqB,CAAE,gBAAA,IAAoB,SAAA;AAC7D,EAAA,OAAO,SAAA,EAAU;AACnB;ACZA,IAAM,gBAAA,mBAAmB,IAAI,GAAA,CAAI,CAAC,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,KAAA,EAAO,MAAA,EAAQ,MAAM,CAAC,CAAA;AAG9E,SAAS,wBAAwB,GAAA,EAA+C;AAErF,EAAA,MAAM,UAAU,gBAAA,CAAiB,GAAA,CAAA,CAAK,IAAI,SAAA,IAAa,EAAA,EAAI,aAAa,CAAA;AACxE,EAAA,OAAO;AAAA,IACL,IAAI,GAAA,CAAI,WAAA;AAAA,IACR,OAAO,GAAA,CAAI,YAAA,EAAc,KAAA,IAAS,GAAA,CAAI,aAA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form API alone cannot give: the\n * workspace's definitions (facts labelled \"Definitions\"), image generation (an assistant run), the\n * host's leave-page guard, and a comment to open the editor at. It is the host configuration's\n * `docx`; every field is optional, and without one the editor simply offers less (no Defined term,\n * no Generate image).\n */\n\nimport { useHost } from '../../provider/host'\nimport type { DefinitionSource } from '../../tags/definitions'\nimport type { DocxImageGeneration } from '../../docx/layout/GenerateImage'\n\nexport interface NativeDocxSupport {\n /** The workspace's definitions. Present: Insert offers Defined term and `@@` the type-ahead. */\n definitions?: () => Promise<DefinitionSource[]>\n /** The platform's image generation. Present: Insert offers Generate image. */\n imageGeneration?: DocxImageGeneration\n /** The open editor has (or no longer has) unsaved changes. */\n onDirtyChange?: (dirty: boolean) => void\n /** A comment thread to open when its document opens (a notification's link), as a hook. */\n useCommentTarget?: () => { documentId: string; commentId: string } | null\n}\n\nconst NO_SUPPORT: NativeDocxSupport = {}\nconst NO_TARGET = () => null\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useHost().docx ?? NO_SUPPORT\n}\n\n/** The comment thread to open with its document (none without the host's). */\nexport function useDocxCommentTarget(): { documentId: string; commentId: string } | null {\n const useTarget = useNativeDocxSupport().useCommentTarget ?? NO_TARGET\n return useTarget()\n}\n","/**\n * The workflow launcher bound to the connection: the open workspace's folders, labels and files\n * behind its scope and `documents` fields (files can be added right there), and the user's agents\n * behind \"Run as\". The host still says what a launch does (`onLaunch`): open a chat, start a task.\n */\n\nimport { useCallback, useMemo, useRef, useState } from 'react'\nimport { useAgents, useThumbnails, useUploadDocuments } from '@arbidocs/react'\nimport { WorkflowLauncher, type WorkflowLauncherProps } from '../agents/workflows/WorkflowLauncher'\nimport {\n WorkflowDocumentsField,\n type WorkflowDocumentsFieldLabels,\n type WorkflowFieldDocument,\n} from '../agents/workflows/WorkflowDocumentsField'\nimport type { WorkflowScopeSource } from '../agents/workflows/WorkflowConfigDialog'\nimport { buildWorkflowScopeSource, documentScopeLabels } from '../agents/workflows/workspaceScope'\nimport type { AgentOption } from '../agents/workflows/AgentSelect'\nimport type { WorkflowField, WorkflowScope } from '../agents/workflows/types'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedTags, useListedDocuments, type ConnectedDocument } from './workspaceData'\n\nconst IMAGE_FILE_TYPES = new Set(['png', 'jpg', 'jpeg', 'gif', 'bmp', 'tiff', 'webp'])\n\n/** A workspace document as a `documents` field offers it. */\nexport function toWorkflowFieldDocument(doc: ConnectedDocument): WorkflowFieldDocument {\n // Pages and tokens are a text-parsing concept: never meaningful for an image.\n const isImage = IMAGE_FILE_TYPES.has((doc.file_type ?? '').toLowerCase())\n return {\n id: doc.external_id,\n title: doc.doc_metadata?.title || doc.file_name || doc.external_id,\n fileName: doc.file_name,\n pages: isImage ? null : (doc.n_pages ?? null),\n tokens: isImage ? null : (doc.tokens ?? null),\n status: doc.status,\n isImage,\n }\n}\n\n/** The open workspace's folders and labels for a workflow's scope field. */\nexport function useConnectedWorkflowScopeSource(): WorkflowScopeSource {\n const { data: docs } = useListedDocuments()\n const { data: tags } = useConnectedTags()\n return useMemo(() => buildWorkflowScopeSource(docs, documentScopeLabels(tags)), [docs, tags])\n}\n\n/** The user's agents, for \"Run as\". */\nexport function useConnectedAgentOptions(): AgentOption[] {\n const { data: agents } = useAgents()\n return useMemo(\n () => (agents ?? []).map((a) => ({ id: a.external_id, label: a.given_name || a.email })),\n [agents]\n )\n}\n\nexport interface ConnectedWorkflowDocumentsFieldProps {\n field: WorkflowField\n value: WorkflowScope\n onChange: (value: WorkflowScope) => void\n /** Add files the host's way (its upload dialog). Absent: they are uploaded here. */\n onAddFiles?: (files?: File[]) => void\n labels?: Partial<WorkflowDocumentsFieldLabels>\n}\n\n/**\n * A workflow `documents` field over the open workspace's files: pick, add (or drop) files, see the\n * chosen images. A launcher's or a task composer's `renderDocuments`.\n */\nexport function ConnectedWorkflowDocumentsField({\n field,\n value,\n onChange,\n onAddFiles,\n labels,\n}: ConnectedWorkflowDocumentsFieldProps) {\n const { notify } = useBlocksEnvironment()\n const { ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: docs, loaded } = useListedDocuments()\n const uploadDocuments = useUploadDocuments()\n const documents = useMemo(() => docs.map(toWorkflowFieldDocument), [docs])\n const chosen = value.documents ?? []\n const { data: thumbnails } = useThumbnails(chosen, { enabled: (field.max ?? 1) > 1 })\n const input = useRef<HTMLInputElement>(null)\n const [adding, setAdding] = useState(false)\n\n const upload = useCallback(\n async (files: File[]) => {\n setAdding(true)\n try {\n await ensureWorkspaceOpen()\n // Each new document joins the shared list as it lands.\n for (const file of files) await uploadDocuments.mutateAsync({ files: [file] })\n } catch (error) {\n notify(error instanceof Error && error.message ? error.message : String(error), 'error')\n } finally {\n setAdding(false)\n }\n },\n [uploadDocuments, ensureWorkspaceOpen, notify]\n )\n\n return (\n <>\n {!onAddFiles && (\n <input\n ref={input}\n type=\"file\"\n multiple\n className=\"hidden\"\n aria-label=\"Add files\"\n data-testid=\"workflow-add-files-input\"\n onChange={(e) => {\n const files = Array.from(e.target.files ?? [])\n e.target.value = ''\n if (files.length) void upload(files)\n }}\n />\n )}\n <WorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n documents={documents}\n loaded={loaded}\n thumbnailOf={(id) => thumbnails?.[id]}\n onAddFiles={\n onAddFiles ?? ((files) => (files?.length ? void upload(files) : input.current?.click()))\n }\n adding={adding}\n labels={labels}\n />\n </>\n )\n}\n\nexport interface ConnectedWorkflowLauncherProps extends Omit<\n WorkflowLauncherProps,\n 'scopeSource' | 'renderDocuments' | 'agents'\n> {\n /** Add files from a `documents` field the host's way (its upload dialog). Absent: uploaded here. */\n onAddFiles?: (files?: File[]) => void\n}\n\nexport function ConnectedWorkflowLauncher({\n onAddFiles,\n ...props\n}: ConnectedWorkflowLauncherProps) {\n const scopeSource = useConnectedWorkflowScopeSource()\n const agents = useConnectedAgentOptions()\n return (\n <WorkflowLauncher\n {...props}\n scopeSource={scopeSource}\n agents={agents}\n renderDocuments={(field, value, onChange) => (\n <ConnectedWorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n onAddFiles={onAddFiles}\n />\n )}\n />\n )\n}\n","/**\n * The Word editor's references to the workspace's other documents: the documents and their\n * passages (the same parsed passages a fact's citations quote), the ARBI address of a passage\n * (`/wrk-…/doc-…/cnk-…`, the deep link that opens a document at a passage, so the link works from\n * Word too), and opening one wherever the host shows documents, highlighted like a citation.\n */\nimport { useMemo, useRef } from 'react'\nimport { useArbi } from '@arbidocs/react'\nimport type { DocxReferencesAdapter } from '../../docx/references/CrossReferences'\nimport { DocumentPicker } from '../../settings/DocumentPicker'\nimport { buildDeepLinkUrl, parseDeepLinkPath } from '../../lib/deep-link'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useListedDocuments, type ConnectedDocument } from '../workspaceData'\n\ninterface ParsedChunk {\n content?: string | null\n metadata?: { chunk_ext_id?: string | null; page_number?: number | null } | null\n}\n\n/** Top-level documents only: an attachment opens with its parent. */\nconst isTopLevel = (doc: ConnectedDocument) => !doc.parent_ext_id\n\nfunction ReferencePicker({\n documents,\n selectedId,\n onSelect,\n}: {\n documents: ConnectedDocument[]\n selectedId: string | null\n onSelect: (documentId: string) => void\n}) {\n const groups = useMemo(() => {\n const docs = documents\n .filter(isTopLevel)\n .map(toWorkflowFieldDocument)\n .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()))\n return [{ id: 'all', heading: 'In this workspace', docs }]\n }, [documents])\n const selected = groups[0].docs.find((d) => d.id === selectedId)\n return (\n <DocumentPicker\n groups={groups}\n value={selectedId ?? ''}\n onValueChange={onSelect}\n selected={selected}\n labels={{ placeholder: 'Search documents…' }}\n />\n )\n}\n\nexport function useConnectedDocxReferences(): DocxReferencesAdapter {\n const arbi = useArbi()\n const { workspaceId } = useConnectedWorkspace()\n const { openDocument, runtimeConfig } = useBlocksEnvironment()\n const { data: documents } = useListedDocuments()\n // Read when called (the picker, a link): the list grows while the editor is open.\n const documentsRef = useRef(documents)\n documentsRef.current = documents\n return useMemo<DocxReferencesAdapter>(\n () => ({\n documents: async () =>\n documentsRef.current\n .filter(isTopLevel)\n .map((d) => ({ id: d.external_id, title: toWorkflowFieldDocument(d).title })),\n passages: async (documentId) => {\n const parsed = await arbi.documents.getParsedContent(documentId, 'final')\n return ((parsed.chunks ?? []) as ParsedChunk[]).flatMap((chunk) =>\n chunk.metadata?.chunk_ext_id && chunk.content?.trim()\n ? [\n {\n chunkId: chunk.metadata.chunk_ext_id,\n page: chunk.metadata.page_number ?? null,\n text: chunk.content,\n },\n ]\n : []\n )\n },\n linkFor: ({ documentId, chunkId, page }) => {\n const url = buildDeepLinkUrl(\n { workspaceId: workspaceId ?? undefined, documentId, chunkId },\n runtimeConfig.deploymentDomain\n )\n return page ? `${url}?page=${page}` : url\n },\n targetOf: (href) => {\n let url: URL\n try {\n url = new URL(href, window.location.origin)\n } catch {\n return null\n }\n const { documentId, chunkId } = parseDeepLinkPath(url.pathname)\n if (!documentId || !chunkId) return null\n const page = Number(url.searchParams.get('page')) || null\n return { documentId, chunkId, page }\n },\n open: ({ documentId, chunkId, page }) =>\n openDocument(documentId, { passageId: chunkId, page: page ?? undefined }),\n renderDocumentPicker: (onSelect, selectedId) => (\n <ReferencePicker\n documents={documentsRef.current}\n selectedId={selectedId}\n onSelect={onSelect}\n />\n ),\n }),\n [arbi, workspaceId, openDocument, runtimeConfig.deploymentDomain]\n )\n}\n","/**\n * The saved workflows bound to the connection: when each starts, its last run (a link to the thread\n * it created) and next run, who runs it, pause and resume, share, run now, delete (one or many), and\n * the workflow's history. The host opens a workflow (its builder) and its history; threads open\n * through the environment's `openConversation`, failures are told through its `notify`.\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useDeleteWorkflow,\n useRunWorkflow,\n useUpdateWorkflow,\n useWorkflows,\n useWorkspaceUsers,\n type WorkflowResponse,\n} from '@arbidocs/react'\nimport { WorkflowsTable, type WorkflowsTableProps } from '../agents/tasks/WorkflowsTable'\nimport { workflowTriggerType } from '../agents/tasks/workflowRows'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations } from './workspaceData'\n\n/** The viewer's role in the open workspace, and the workspace's members. */\nexport function useConnectedWorkspaceRole() {\n const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: members = [] } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const role = members.find((m) => m.user.external_id === userId)?.role\n return {\n members,\n role,\n /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */\n canEditShared: role === 'owner' || role === 'collaborator',\n /** With an item's creator, the only one who deletes it. */\n isWorkspaceOwner: role === 'owner',\n }\n}\n\nexport interface ConnectedWorkflowsTableLabels {\n /** A change (pause, share, delete) that failed without a message. */\n updateFailed: string\n deleteTitle: string\n deleteOne: (name: string) => string\n deleteMany: (count: number) => string\n /** A run that failed: its history has the error report. */\n runFailed: string\n /** A run that created no thread. */\n noThread: string\n /** A document action that started (it has no thread): what is happening. */\n documentAction: (workflow: WorkflowResponse) => string\n untitledTask: string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS: ConnectedWorkflowsTableLabels = {\n updateFailed: 'Could not update the workflow',\n deleteTitle: 'Delete workflow',\n deleteOne: (name) => `Delete “${name}”? Threads it already created stay.`,\n deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,\n runFailed: 'The workflow failed. You can send an error report from its history.',\n noThread: 'The workflow did not create a thread.',\n documentAction: (workflow) =>\n workflow.action?.type === 'email_documents'\n ? 'Preparing your document email'\n : 'Reviewing documents',\n untitledTask: 'Untitled thread',\n}\n\ntype TableProps = WorkflowsTableProps<WorkflowResponse>\n\nexport interface ConnectedWorkflowsTableProps extends Omit<\n TableProps,\n | 'workflows'\n | 'isLoading'\n | 'busyId'\n | 'describeTrigger'\n | 'formatDate'\n | 'onToggleActive'\n | 'onToggleShared'\n | 'onDelete'\n | 'onDeleteMany'\n | 'onToggleActiveMany'\n | 'onRun'\n | 'onOpenThread'\n | 'lastRuns'\n | 'agentNames'\n | 'taskNames'\n | 'canEditShared'\n | 'isWorkspaceOwner'\n> {\n /** Which saved workflows to list (e.g. those on a schedule). Default: all. */\n filter?: (workflow: WorkflowResponse) => boolean\n /** When a workflow starts, in the host's words. Default: its trigger type. */\n describeTrigger?: TableProps['describeTrigger']\n formatDate?: TableProps['formatDate']\n connectedLabels?: Partial<ConnectedWorkflowsTableLabels>\n}\n\nconst messageOf = (error: unknown) => (error instanceof Error ? error.message : '')\n\nexport function ConnectedWorkflowsTable({\n filter,\n describeTrigger = (w) => workflowTriggerType(w).replaceAll('_', ' '),\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\n const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole()\n const { data: saved = [], isLoading } = useWorkflows({ live: true })\n const { data: conversations, refetch } = useConnectedConversations({ live: true })\n const { data: agents = [] } = useAgents()\n const update = useUpdateWorkflow()\n const remove = useDeleteWorkflow()\n const run = useRunWorkflow()\n const [busyId, setBusyId] = useState<string | null>(null)\n\n const workflows = useMemo(() => (filter ? saved.filter(filter) : saved), [saved, filter])\n // A clock or an event fired a workflow: the thread it created is new to the conversation list.\n const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ''}`).join('|')\n useEffect(() => {\n void refetch?.()\n }, [firingStamp, refetch])\n\n const lastRuns = useMemo(() => {\n const out: NonNullable<TableProps['lastRuns']> = {}\n for (const c of conversations) {\n const id = c.workflow_ext_id\n if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))\n out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status }\n }\n return out\n }, [conversations])\n const agentNames = useMemo(\n () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),\n [agents]\n )\n const taskNames = useMemo(\n () =>\n Object.fromEntries(\n conversations\n .filter((c) => c.status != null)\n .map((c) => [c.external_id, c.title || l.untitledTask])\n ),\n [conversations, l.untitledTask]\n )\n\n const act = async (workflow: WorkflowResponse, action: () => Promise<unknown>) => {\n setBusyId(workflow.external_id)\n try {\n await action()\n } catch (error) {\n notify(messageOf(error) || l.updateFailed, 'error')\n } finally {\n setBusyId(null)\n }\n }\n const setActive = (workflow: WorkflowResponse, active: boolean) =>\n act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }))\n const deleteAll = async (items: WorkflowResponse[]) => {\n if (!items.length) return\n const ok = await confirm({\n title: l.deleteTitle,\n message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length),\n })\n if (!ok) return\n for (const workflow of items)\n await act(workflow, () => remove.mutateAsync(workflow.external_id))\n }\n\n return (\n <WorkflowsTable\n {...tableProps}\n workflows={workflows}\n isLoading={isLoading}\n busyId={busyId}\n describeTrigger={describeTrigger}\n formatDate={formatDate}\n agentNames={agentNames}\n taskNames={taskNames}\n lastRuns={lastRuns}\n canEditShared={canEditShared}\n isWorkspaceOwner={isWorkspaceOwner}\n onOpenThread={(conversationId) => openConversation(conversationId)}\n onViewRuns={onViewRuns}\n onToggleActive={(workflow, active) => void setActive(workflow, active)}\n onToggleActiveMany={(items, active) => {\n void (async () => {\n for (const workflow of items) await setActive(workflow, active)\n })()\n }}\n onToggleShared={(workflow, shared) =>\n void act(workflow, () =>\n update.mutateAsync({ workflowId: workflow.external_id, patch: { shared } })\n )\n }\n onDelete={(workflow) => void deleteAll([workflow])}\n onDeleteMany={(items) => void deleteAll(items)}\n onRun={(workflow) =>\n void act(workflow, async () => {\n const result = await run.mutateAsync(workflow.external_id)\n if (result.conversation_ext_id) openConversation(result.conversation_ext_id)\n if (result.error) {\n onViewRuns?.(workflow)\n notify(l.runFailed, 'error')\n return\n }\n if (result.execution_id && !result.conversation_ext_id) {\n // A document action runs without a thread: its history shows how it goes.\n onViewRuns?.(workflow)\n notify(l.documentAction(workflow), 'success')\n return\n }\n if (!result.conversation_ext_id) throw new Error(l.noThread)\n })\n }\n />\n )\n}\n","/**\n * The house template for the open workspace: its own (a document of the workspace), else the\n * deployment's default, else ARBI's built-in legal template. A workspace owner can make a document\n * the house template once the server supports it.\n */\nimport { useMemo } from 'react'\nimport {\n supportsHouseTemplates,\n useArbi,\n useHouseTemplateCandidates,\n useSetWorkspaceHouseTemplate,\n useWorkspaces,\n workspaceHouseTemplateId,\n} from '@arbidocs/react'\nimport { contentPath } from '../../docx/NativeDocxEditor'\nimport {\n builtinHouseTemplate,\n type HouseTemplate,\n type HouseTemplateHost,\n} from '../../docx/template/HouseTemplate'\nimport { isCandidate } from '../../docx/template/candidates'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useConnectedWorkspaceRole } from '../ConnectedWorkflowsTable'\n\nexport function useConnectedHouseTemplate(): HouseTemplateHost {\n const arbi = useArbi()\n const { mutateAsync: setWorkspaceTemplate } = useSetWorkspaceHouseTemplate()\n const { workspaceId, live, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: workspaces } = useWorkspaces({ enabled: live })\n const workspace = workspaces?.find((w) => w.external_id === workspaceId)\n const { isWorkspaceOwner } = useConnectedWorkspaceRole()\n const supported = supportsHouseTemplates(workspace)\n const templateId = workspaceHouseTemplateId(workspace)\n // Only an eligible document (shared, Word, here or in a public workspace) is offered as the template.\n const { data: candidates } = useHouseTemplateCandidates(\n workspaceId,\n supported && isWorkspaceOwner\n )\n return useMemo<HouseTemplateHost>(\n () => ({\n load: async (): Promise<HouseTemplate> => {\n if (templateId) {\n await ensureWorkspaceOpen()\n const response = await arbi.editor.request(contentPath(templateId))\n const [record] = await arbi.documents.get([templateId]).catch(() => [])\n return {\n bytes: new Uint8Array(await response.arrayBuffer()),\n name: record?.file_name ?? 'House template.docx',\n source: 'workspace',\n documentId: templateId,\n }\n }\n if (supported) {\n const deployment = await arbi.houseTemplates.deployment()\n if (deployment) return { ...deployment, source: 'deployment' }\n }\n return builtinHouseTemplate()\n },\n setFromDocument:\n supported && isWorkspaceOwner\n ? async (documentId) => {\n await ensureWorkspaceOpen()\n await setWorkspaceTemplate(documentId)\n }\n : undefined,\n isEligible: (documentId) => isCandidate(candidates, documentId),\n }),\n [\n arbi,\n setWorkspaceTemplate,\n supported,\n templateId,\n isWorkspaceOwner,\n candidates,\n ensureWorkspaceOpen,\n ]\n )\n}\n","import { useMemo, useRef, useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport {\n NativeDocxEditor,\n type NativeDocxAdapter,\n type NativeDocxEditorProps,\n} from '../../docx/NativeDocxEditor'\nimport { loadDocxFonts } from '../../docx/fonts'\nimport { useRegisterOpenDocument } from '@arbidocs/react/shell'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent && !props.compact\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn't available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const queries = useQueryClient()\n const { notify } = useBlocksEnvironment()\n const tools = useOptionalDocumentTools()\n const support = useNativeDocxSupport()\n const references = useConnectedDocxReferences()\n const houseTemplate = useConnectedHouseTemplate()\n const { data: members } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const onDocumentsChanged = tools?.onDocumentsChanged\n // Tracked changes and comments are authored by the user's first name.\n const author = (live && arbi.user.profile()?.givenName) || user?.name || 'You'\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: async (id, state) =>\n (\n await arbi.editor.request(`/${encodeURIComponent(id)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state }),\n })\n ).json(),\n loadFonts: () => loadDocxFonts(fontBaseUrl),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n // The document's row moves to the saved version in place: through the host when it keeps\n // the lists (its document tools refresh them), else here.\n onVersionSaved: async (id) => {\n await (onDocumentsChanged\n ? onDocumentsChanged([id], 'version')\n : refreshDocuments(queries, arbi, [id]))\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n user?.name,\n ]\n )\n return adapter\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/connection/docx/support.ts","../src/connection/ConnectedWorkflowLauncher.tsx","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["useHost","useListedDocuments","useConnectedTags","useMemo","buildWorkflowScopeSource","documentScopeLabels","useAgents","useBlocksEnvironment","useConnectedWorkspace","useUploadDocuments","useThumbnails","useRef","useState","useCallback","jsxs","Fragment","jsx","WorkflowDocumentsField","WorkflowLauncher","DocumentPicker","useArbi","buildDeepLinkUrl","parseDeepLinkPath","useWorkspaceUsers","workflowTriggerType","fmtDate","useWorkflows","useConnectedConversations","useUpdateWorkflow","useDeleteWorkflow","useRunWorkflow","useEffect","WorkflowsTable","useSetWorkspaceHouseTemplate","useWorkspaces","supportsHouseTemplates","workspaceHouseTemplateId","useHouseTemplateCandidates","contentPath","builtinHouseTemplate","isCandidate","useRegisterOpenDocument","NativeDocxEditor","useQueryClient","use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A,SACF,CAAA;AACD,QAAA,MAAM,QAAA,GAAY,MAAM,QAAA,CAAS,IAAA,EAAK;AACtC,QAAA,MAAA,CAAO,sBAAsB,SAAS,CAAA;AACtC,QAAA,OAAO,EAAE,WAAA,EAAa,QAAA,CAAS,YAAA,IAAgB,EAAC,EAAE;AAAA,MACpD,CAAA;AAAA,MACA,cAAA,EAAgB,OAAO,UAAA,KAAA,CAAgB,MAAM,KAAK,SAAA,CAAU,WAAA,CAAY,UAAU,CAAA,EAAG,MAAA;AAAA,MACrF,aAAa,OAAA,CAAQ,WAAA;AAAA,MACrB,UAAA;AAAA,MACA,iBAAiB,OAAA,CAAQ,eAAA;AAAA,MACzB;AAAA,KACF,CAAA;AAAA,IACA;AAAA,MACE,IAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,kBAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA,aAAA;AAAA,MACA,IAAA,EAAM;AAAA;AACR,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-FYL7IGK2.cjs","sourcesContent":["/**\n * What a host adds to the connected Word editor that the platform API alone cannot give: the\n * workspace's definitions (facts labelled \"Definitions\"), image generation (an assistant run), the\n * host's leave-page guard, and a comment to open the editor at. It is the host configuration's\n * `docx`; every field is optional, and without one the editor simply offers less (no Defined term,\n * no Generate image).\n */\n\nimport { useHost } from '../../provider/host'\nimport type { DefinitionSource } from '../../tags/definitions'\nimport type { DocxImageGeneration } from '../../docx/layout/GenerateImage'\n\nexport interface NativeDocxSupport {\n /** The workspace's definitions. Present: Insert offers Defined term and `@@` the type-ahead. */\n definitions?: () => Promise<DefinitionSource[]>\n /** The platform's image generation. Present: Insert offers Generate image. */\n imageGeneration?: DocxImageGeneration\n /** The open editor has (or no longer has) unsaved changes. */\n onDirtyChange?: (dirty: boolean) => void\n /** A comment thread to open when its document opens (a notification's link), as a hook. */\n useCommentTarget?: () => { documentId: string; commentId: string } | null\n}\n\nconst NO_SUPPORT: NativeDocxSupport = {}\nconst NO_TARGET = () => null\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useHost().docx ?? NO_SUPPORT\n}\n\n/** The comment thread to open with its document (none without the host's). */\nexport function useDocxCommentTarget(): { documentId: string; commentId: string } | null {\n const useTarget = useNativeDocxSupport().useCommentTarget ?? NO_TARGET\n return useTarget()\n}\n","/**\n * The workflow launcher bound to the connection: the open workspace's folders, labels and files\n * behind its scope and `documents` fields (files can be added right there), and the user's agents\n * behind \"Run as\". The host still says what a launch does (`onLaunch`): open a chat, start a task.\n */\n\nimport { useCallback, useMemo, useRef, useState } from 'react'\nimport { useAgents, useThumbnails, useUploadDocuments } from '@arbidocs/react'\nimport { WorkflowLauncher, type WorkflowLauncherProps } from '../agents/workflows/WorkflowLauncher'\nimport {\n WorkflowDocumentsField,\n type WorkflowDocumentsFieldLabels,\n type WorkflowFieldDocument,\n} from '../agents/workflows/WorkflowDocumentsField'\nimport type { WorkflowScopeSource } from '../agents/workflows/WorkflowConfigDialog'\nimport { buildWorkflowScopeSource, documentScopeLabels } from '../agents/workflows/workspaceScope'\nimport type { AgentOption } from '../agents/workflows/AgentSelect'\nimport type { WorkflowField, WorkflowScope } from '../agents/workflows/types'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedTags, useListedDocuments, type ConnectedDocument } from './workspaceData'\n\nconst IMAGE_FILE_TYPES = new Set(['png', 'jpg', 'jpeg', 'gif', 'bmp', 'tiff', 'webp'])\n\n/** A workspace document as a `documents` field offers it. */\nexport function toWorkflowFieldDocument(doc: ConnectedDocument): WorkflowFieldDocument {\n // Pages and tokens are a text-parsing concept: never meaningful for an image.\n const isImage = IMAGE_FILE_TYPES.has((doc.file_type ?? '').toLowerCase())\n return {\n id: doc.external_id,\n title: doc.doc_metadata?.title || doc.file_name || doc.external_id,\n fileName: doc.file_name,\n pages: isImage ? null : (doc.n_pages ?? null),\n tokens: isImage ? null : (doc.tokens ?? null),\n status: doc.status,\n isImage,\n }\n}\n\n/** The open workspace's folders and labels for a workflow's scope field. */\nexport function useConnectedWorkflowScopeSource(): WorkflowScopeSource {\n const { data: docs } = useListedDocuments()\n const { data: tags } = useConnectedTags()\n return useMemo(() => buildWorkflowScopeSource(docs, documentScopeLabels(tags)), [docs, tags])\n}\n\n/** The user's agents, for \"Run as\". */\nexport function useConnectedAgentOptions(): AgentOption[] {\n const { data: agents } = useAgents()\n return useMemo(\n () => (agents ?? []).map((a) => ({ id: a.external_id, label: a.given_name || a.email })),\n [agents]\n )\n}\n\nexport interface ConnectedWorkflowDocumentsFieldProps {\n field: WorkflowField\n value: WorkflowScope\n onChange: (value: WorkflowScope) => void\n /** Add files the host's way (its upload dialog). Absent: they are uploaded here. */\n onAddFiles?: (files?: File[]) => void\n labels?: Partial<WorkflowDocumentsFieldLabels>\n}\n\n/**\n * A workflow `documents` field over the open workspace's files: pick, add (or drop) files, see the\n * chosen images. A launcher's or a task composer's `renderDocuments`.\n */\nexport function ConnectedWorkflowDocumentsField({\n field,\n value,\n onChange,\n onAddFiles,\n labels,\n}: ConnectedWorkflowDocumentsFieldProps) {\n const { notify } = useBlocksEnvironment()\n const { ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: docs, loaded } = useListedDocuments()\n const uploadDocuments = useUploadDocuments()\n const documents = useMemo(() => docs.map(toWorkflowFieldDocument), [docs])\n const chosen = value.documents ?? []\n const { data: thumbnails } = useThumbnails(chosen, { enabled: (field.max ?? 1) > 1 })\n const input = useRef<HTMLInputElement>(null)\n const [adding, setAdding] = useState(false)\n\n const upload = useCallback(\n async (files: File[]) => {\n setAdding(true)\n try {\n await ensureWorkspaceOpen()\n // Each new document joins the shared list as it lands.\n for (const file of files) await uploadDocuments.mutateAsync({ files: [file] })\n } catch (error) {\n notify(error instanceof Error && error.message ? error.message : String(error), 'error')\n } finally {\n setAdding(false)\n }\n },\n [uploadDocuments, ensureWorkspaceOpen, notify]\n )\n\n return (\n <>\n {!onAddFiles && (\n <input\n ref={input}\n type=\"file\"\n multiple\n className=\"hidden\"\n aria-label=\"Add files\"\n data-testid=\"workflow-add-files-input\"\n onChange={(e) => {\n const files = Array.from(e.target.files ?? [])\n e.target.value = ''\n if (files.length) void upload(files)\n }}\n />\n )}\n <WorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n documents={documents}\n loaded={loaded}\n thumbnailOf={(id) => thumbnails?.[id]}\n onAddFiles={\n onAddFiles ?? ((files) => (files?.length ? void upload(files) : input.current?.click()))\n }\n adding={adding}\n labels={labels}\n />\n </>\n )\n}\n\nexport interface ConnectedWorkflowLauncherProps extends Omit<\n WorkflowLauncherProps,\n 'scopeSource' | 'renderDocuments' | 'agents'\n> {\n /** Add files from a `documents` field the host's way (its upload dialog). Absent: uploaded here. */\n onAddFiles?: (files?: File[]) => void\n}\n\nexport function ConnectedWorkflowLauncher({\n onAddFiles,\n ...props\n}: ConnectedWorkflowLauncherProps) {\n const scopeSource = useConnectedWorkflowScopeSource()\n const agents = useConnectedAgentOptions()\n return (\n <WorkflowLauncher\n {...props}\n scopeSource={scopeSource}\n agents={agents}\n renderDocuments={(field, value, onChange) => (\n <ConnectedWorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n onAddFiles={onAddFiles}\n />\n )}\n />\n )\n}\n","/**\n * The Word editor's references to the workspace's other documents: the documents and their\n * passages (the same parsed passages a fact's citations quote), the ARBI address of a passage\n * (`/wrk-…/doc-…/cnk-…`, the deep link that opens a document at a passage, so the link works from\n * Word too), and opening one wherever the host shows documents, highlighted like a citation.\n */\nimport { useMemo, useRef } from 'react'\nimport { useArbi } from '@arbidocs/react'\nimport type { DocxReferencesAdapter } from '../../docx/references/CrossReferences'\nimport { DocumentPicker } from '../../settings/DocumentPicker'\nimport { buildDeepLinkUrl, parseDeepLinkPath } from '../../lib/deep-link'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useListedDocuments, type ConnectedDocument } from '../workspaceData'\n\ninterface ParsedChunk {\n content?: string | null\n metadata?: { chunk_ext_id?: string | null; page_number?: number | null } | null\n}\n\n/** Top-level documents only: an attachment opens with its parent. */\nconst isTopLevel = (doc: ConnectedDocument) => !doc.parent_ext_id\n\nfunction ReferencePicker({\n documents,\n selectedId,\n onSelect,\n}: {\n documents: ConnectedDocument[]\n selectedId: string | null\n onSelect: (documentId: string) => void\n}) {\n const groups = useMemo(() => {\n const docs = documents\n .filter(isTopLevel)\n .map(toWorkflowFieldDocument)\n .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()))\n return [{ id: 'all', heading: 'In this workspace', docs }]\n }, [documents])\n const selected = groups[0].docs.find((d) => d.id === selectedId)\n return (\n <DocumentPicker\n groups={groups}\n value={selectedId ?? ''}\n onValueChange={onSelect}\n selected={selected}\n labels={{ placeholder: 'Search documents…' }}\n />\n )\n}\n\nexport function useConnectedDocxReferences(): DocxReferencesAdapter {\n const arbi = useArbi()\n const { workspaceId } = useConnectedWorkspace()\n const { openDocument, runtimeConfig } = useBlocksEnvironment()\n const { data: documents } = useListedDocuments()\n // Read when called (the picker, a link): the list grows while the editor is open.\n const documentsRef = useRef(documents)\n documentsRef.current = documents\n return useMemo<DocxReferencesAdapter>(\n () => ({\n documents: async () =>\n documentsRef.current\n .filter(isTopLevel)\n .map((d) => ({ id: d.external_id, title: toWorkflowFieldDocument(d).title })),\n passages: async (documentId) => {\n const parsed = await arbi.documents.getParsedContent(documentId, 'final')\n return ((parsed.chunks ?? []) as ParsedChunk[]).flatMap((chunk) =>\n chunk.metadata?.chunk_ext_id && chunk.content?.trim()\n ? [\n {\n chunkId: chunk.metadata.chunk_ext_id,\n page: chunk.metadata.page_number ?? null,\n text: chunk.content,\n },\n ]\n : []\n )\n },\n linkFor: ({ documentId, chunkId, page }) => {\n const url = buildDeepLinkUrl(\n { workspaceId: workspaceId ?? undefined, documentId, chunkId },\n runtimeConfig.deploymentDomain\n )\n return page ? `${url}?page=${page}` : url\n },\n targetOf: (href) => {\n let url: URL\n try {\n url = new URL(href, window.location.origin)\n } catch {\n return null\n }\n const { documentId, chunkId } = parseDeepLinkPath(url.pathname)\n if (!documentId || !chunkId) return null\n const page = Number(url.searchParams.get('page')) || null\n return { documentId, chunkId, page }\n },\n open: ({ documentId, chunkId, page }) =>\n openDocument(documentId, { passageId: chunkId, page: page ?? undefined }),\n renderDocumentPicker: (onSelect, selectedId) => (\n <ReferencePicker\n documents={documentsRef.current}\n selectedId={selectedId}\n onSelect={onSelect}\n />\n ),\n }),\n [arbi, workspaceId, openDocument, runtimeConfig.deploymentDomain]\n )\n}\n","/**\n * The saved workflows bound to the connection: when each starts, its last run (a link to the thread\n * it created) and next run, who runs it, pause and resume, share, run now, delete (one or many), and\n * the workflow's history. The host opens a workflow (its builder) and its history; threads open\n * through the environment's `openConversation`, failures are told through its `notify`.\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useDeleteWorkflow,\n useRunWorkflow,\n useUpdateWorkflow,\n useWorkflows,\n useWorkspaceUsers,\n type WorkflowResponse,\n} from '@arbidocs/react'\nimport { WorkflowsTable, type WorkflowsTableProps } from '../agents/tasks/WorkflowsTable'\nimport { workflowTriggerType } from '../agents/tasks/workflowRows'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/environment'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations } from './workspaceData'\n\n/** The viewer's role in the open workspace, and the workspace's members. */\nexport function useConnectedWorkspaceRole() {\n const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: members = [] } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const role = members.find((m) => m.user.external_id === userId)?.role\n return {\n members,\n role,\n /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */\n canEditShared: role === 'owner' || role === 'collaborator',\n /** With an item's creator, the only one who deletes it. */\n isWorkspaceOwner: role === 'owner',\n }\n}\n\nexport interface ConnectedWorkflowsTableLabels {\n /** A change (pause, share, delete) that failed without a message. */\n updateFailed: string\n deleteTitle: string\n deleteOne: (name: string) => string\n deleteMany: (count: number) => string\n /** A run that failed: its history has the error report. */\n runFailed: string\n /** A run that created no thread. */\n noThread: string\n /** A document action that started (it has no thread): what is happening. */\n documentAction: (workflow: WorkflowResponse) => string\n untitledTask: string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS: ConnectedWorkflowsTableLabels = {\n updateFailed: 'Could not update the workflow',\n deleteTitle: 'Delete workflow',\n deleteOne: (name) => `Delete “${name}”? Threads it already created stay.`,\n deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,\n runFailed: 'The workflow failed. You can send an error report from its history.',\n noThread: 'The workflow did not create a thread.',\n documentAction: (workflow) =>\n workflow.action?.type === 'email_documents'\n ? 'Preparing your document email'\n : 'Reviewing documents',\n untitledTask: 'Untitled thread',\n}\n\ntype TableProps = WorkflowsTableProps<WorkflowResponse>\n\nexport interface ConnectedWorkflowsTableProps extends Omit<\n TableProps,\n | 'workflows'\n | 'isLoading'\n | 'busyId'\n | 'describeTrigger'\n | 'formatDate'\n | 'onToggleActive'\n | 'onToggleShared'\n | 'onDelete'\n | 'onDeleteMany'\n | 'onToggleActiveMany'\n | 'onRun'\n | 'onOpenThread'\n | 'lastRuns'\n | 'agentNames'\n | 'taskNames'\n | 'canEditShared'\n | 'isWorkspaceOwner'\n> {\n /** Which saved workflows to list (e.g. those on a schedule). Default: all. */\n filter?: (workflow: WorkflowResponse) => boolean\n /** When a workflow starts, in the host's words. Default: its trigger type. */\n describeTrigger?: TableProps['describeTrigger']\n formatDate?: TableProps['formatDate']\n connectedLabels?: Partial<ConnectedWorkflowsTableLabels>\n}\n\nconst messageOf = (error: unknown) => (error instanceof Error ? error.message : '')\n\nexport function ConnectedWorkflowsTable({\n filter,\n describeTrigger = (w) => workflowTriggerType(w).replaceAll('_', ' '),\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\n const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole()\n const { data: saved = [], isLoading } = useWorkflows({ live: true })\n const { data: conversations, refetch } = useConnectedConversations({ live: true })\n const { data: agents = [] } = useAgents()\n const update = useUpdateWorkflow()\n const remove = useDeleteWorkflow()\n const run = useRunWorkflow()\n const [busyId, setBusyId] = useState<string | null>(null)\n\n const workflows = useMemo(() => (filter ? saved.filter(filter) : saved), [saved, filter])\n // A clock or an event fired a workflow: the thread it created is new to the conversation list.\n const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ''}`).join('|')\n useEffect(() => {\n void refetch?.()\n }, [firingStamp, refetch])\n\n const lastRuns = useMemo(() => {\n const out: NonNullable<TableProps['lastRuns']> = {}\n for (const c of conversations) {\n const id = c.workflow_ext_id\n if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))\n out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status }\n }\n return out\n }, [conversations])\n const agentNames = useMemo(\n () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),\n [agents]\n )\n const taskNames = useMemo(\n () =>\n Object.fromEntries(\n conversations\n .filter((c) => c.status != null)\n .map((c) => [c.external_id, c.title || l.untitledTask])\n ),\n [conversations, l.untitledTask]\n )\n\n const act = async (workflow: WorkflowResponse, action: () => Promise<unknown>) => {\n setBusyId(workflow.external_id)\n try {\n await action()\n } catch (error) {\n notify(messageOf(error) || l.updateFailed, 'error')\n } finally {\n setBusyId(null)\n }\n }\n const setActive = (workflow: WorkflowResponse, active: boolean) =>\n act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }))\n const deleteAll = async (items: WorkflowResponse[]) => {\n if (!items.length) return\n const ok = await confirm({\n title: l.deleteTitle,\n message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length),\n })\n if (!ok) return\n for (const workflow of items)\n await act(workflow, () => remove.mutateAsync(workflow.external_id))\n }\n\n return (\n <WorkflowsTable\n {...tableProps}\n workflows={workflows}\n isLoading={isLoading}\n busyId={busyId}\n describeTrigger={describeTrigger}\n formatDate={formatDate}\n agentNames={agentNames}\n taskNames={taskNames}\n lastRuns={lastRuns}\n canEditShared={canEditShared}\n isWorkspaceOwner={isWorkspaceOwner}\n onOpenThread={(conversationId) => openConversation(conversationId)}\n onViewRuns={onViewRuns}\n onToggleActive={(workflow, active) => void setActive(workflow, active)}\n onToggleActiveMany={(items, active) => {\n void (async () => {\n for (const workflow of items) await setActive(workflow, active)\n })()\n }}\n onToggleShared={(workflow, shared) =>\n void act(workflow, () =>\n update.mutateAsync({ workflowId: workflow.external_id, patch: { shared } })\n )\n }\n onDelete={(workflow) => void deleteAll([workflow])}\n onDeleteMany={(items) => void deleteAll(items)}\n onRun={(workflow) =>\n void act(workflow, async () => {\n const result = await run.mutateAsync(workflow.external_id)\n if (result.conversation_ext_id) openConversation(result.conversation_ext_id)\n if (result.error) {\n onViewRuns?.(workflow)\n notify(l.runFailed, 'error')\n return\n }\n if (result.execution_id && !result.conversation_ext_id) {\n // A document action runs without a thread: its history shows how it goes.\n onViewRuns?.(workflow)\n notify(l.documentAction(workflow), 'success')\n return\n }\n if (!result.conversation_ext_id) throw new Error(l.noThread)\n })\n }\n />\n )\n}\n","/**\n * The house template for the open workspace: its own (a document of the workspace), else the\n * deployment's default, else ARBI's built-in legal template. A workspace owner can make a document\n * the house template once the server supports it.\n */\nimport { useMemo } from 'react'\nimport {\n supportsHouseTemplates,\n useArbi,\n useHouseTemplateCandidates,\n useSetWorkspaceHouseTemplate,\n useWorkspaces,\n workspaceHouseTemplateId,\n} from '@arbidocs/react'\nimport { contentPath } from '../../docx/NativeDocxEditor'\nimport {\n builtinHouseTemplate,\n type HouseTemplate,\n type HouseTemplateHost,\n} from '../../docx/template/HouseTemplate'\nimport { isCandidate } from '../../docx/template/candidates'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useConnectedWorkspaceRole } from '../ConnectedWorkflowsTable'\n\nexport function useConnectedHouseTemplate(): HouseTemplateHost {\n const arbi = useArbi()\n const { mutateAsync: setWorkspaceTemplate } = useSetWorkspaceHouseTemplate()\n const { workspaceId, live, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: workspaces } = useWorkspaces({ enabled: live })\n const workspace = workspaces?.find((w) => w.external_id === workspaceId)\n const { isWorkspaceOwner } = useConnectedWorkspaceRole()\n const supported = supportsHouseTemplates(workspace)\n const templateId = workspaceHouseTemplateId(workspace)\n // Only an eligible document (shared, Word, here or in a public workspace) is offered as the template.\n const { data: candidates } = useHouseTemplateCandidates(\n workspaceId,\n supported && isWorkspaceOwner\n )\n return useMemo<HouseTemplateHost>(\n () => ({\n load: async (): Promise<HouseTemplate> => {\n if (templateId) {\n await ensureWorkspaceOpen()\n const response = await arbi.editor.request(contentPath(templateId))\n const [record] = await arbi.documents.get([templateId]).catch(() => [])\n return {\n bytes: new Uint8Array(await response.arrayBuffer()),\n name: record?.file_name ?? 'House template.docx',\n source: 'workspace',\n documentId: templateId,\n }\n }\n if (supported) {\n const deployment = await arbi.houseTemplates.deployment()\n if (deployment) return { ...deployment, source: 'deployment' }\n }\n return builtinHouseTemplate()\n },\n setFromDocument:\n supported && isWorkspaceOwner\n ? async (documentId) => {\n await ensureWorkspaceOpen()\n await setWorkspaceTemplate(documentId)\n }\n : undefined,\n isEligible: (documentId) => isCandidate(candidates, documentId),\n }),\n [\n arbi,\n setWorkspaceTemplate,\n supported,\n templateId,\n isWorkspaceOwner,\n candidates,\n ensureWorkspaceOpen,\n ]\n )\n}\n","import { useMemo, useRef, useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport {\n NativeDocxEditor,\n type NativeDocxAdapter,\n type NativeDocxEditorProps,\n} from '../../docx/NativeDocxEditor'\nimport { loadDocxFonts } from '../../docx/fonts'\nimport { useRegisterOpenDocument } from '@arbidocs/react/shell'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent && !props.compact\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn't available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const queries = useQueryClient()\n const { notify } = useBlocksEnvironment()\n const tools = useOptionalDocumentTools()\n const support = useNativeDocxSupport()\n const references = useConnectedDocxReferences()\n const houseTemplate = useConnectedHouseTemplate()\n const { data: members } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const onDocumentsChanged = tools?.onDocumentsChanged\n // Tracked changes and comments are authored by the user's first name.\n const author = (live && arbi.user.profile()?.givenName) || user?.name || 'You'\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: async (id, state) =>\n (\n await arbi.editor.request(`/${encodeURIComponent(id)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state }),\n })\n ).json(),\n loadFonts: () => loadDocxFonts(fontBaseUrl),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n // The document's row moves to the saved version in place: through the host when it keeps\n // the lists (its document tools refresh them), else here.\n onVersionSaved: async (id) => {\n await (onDocumentsChanged\n ? onDocumentsChanged([id], 'version')\n : refreshDocuments(queries, arbi, [id]))\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n user?.name,\n ]\n )\n return adapter\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ActionLink } from './chunk-NXSGOC2M.js';
|
|
3
|
-
import { observeResize } from './chunk-NPLYHR2E.js';
|
|
4
3
|
import { formatCount } from './chunk-5VYJP6XD.js';
|
|
4
|
+
import { observeResize } from './chunk-NPLYHR2E.js';
|
|
5
5
|
import { testIdOr, prefixedTestId } from './chunk-7F6CBP3Z.js';
|
|
6
6
|
import { ChevronDown, FolderPlus, Check, FileCheck2, Plus, Minus } from 'lucide-react';
|
|
7
7
|
import { Collapsible, CollapsibleTrigger, cn, CollapsibleContent, DialogHeader, DialogTitle, DialogDescription } from '@arbidocs/react/ui';
|
|
@@ -504,5 +504,5 @@ function StartTiles({ items, caption, captionTestId, className, testId }) {
|
|
|
504
504
|
}
|
|
505
505
|
|
|
506
506
|
export { AddFilesFirst, DEFAULT_ADD_FILES_FIRST_LABELS, DEFAULT_SCOPE_PICKER_LABELS, EmptyStrip, FoldSection, QuickActionDialogHeader, ScopePicker, SectionHeader, SectionLabel, StartTiles, useScopeSelection };
|
|
507
|
-
//# sourceMappingURL=chunk-
|
|
508
|
-
//# sourceMappingURL=chunk-
|
|
507
|
+
//# sourceMappingURL=chunk-GXJIN7G3.js.map
|
|
508
|
+
//# sourceMappingURL=chunk-GXJIN7G3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/home/FoldSection.tsx","../src/home/AddFilesFirst.tsx","../src/home/QuickActionDialogHeader.tsx","../src/lib/useScopeSelection.ts","../src/home/ScopePicker.tsx","../src/home/sections.tsx","../src/lib/balanced-columns.ts","../src/home/StartTiles.tsx"],"names":["jsxs","jsx","cn","useMemo","useState"],"mappings":";;;;;;;;;AAsBO,SAAS,WAAA,CAAY;AAAA,EAC1B,KAAA;A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A,GAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,uDAAA,EACb,QAAA,EAAA,IAAA,CAAK,QAAA,IAAY,IAAA,CAAK,cAAA,GAAiB,IAAA,CAAK,cAAA,GAAiB,IAAA,CAAK,WAAA,EACrE;AAAA,qBAAA,EACF;AAAA;AAAA,iBAAA;AAAA,gBA3BK,IAAA,CAAK;AAAA,eA4BZ;AAAA,YAEJ,CAAC;AAAA;AAAA;AACH;AAAA;AAAA,GACF;AAEJ","file":"chunk-M3VOZ6RR.js","sourcesContent":["import type { ReactNode } from 'react'\nimport { ChevronDown } from 'lucide-react'\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger, cn } from '@arbidocs/react/ui'\n\nexport interface FoldSectionProps {\n label: string\n /** Shown as plain muted text beside the name; omit or pass 0 to hide. */\n count?: number\n /** A word or two of state for sections a count cannot summarise (shown while shut). */\n hint?: string\n open: boolean\n onOpenChange: (open: boolean) => void\n /** Trigger test id; the caller owns the naming. */\n testId: string\n children: ReactNode\n}\n\n/**\n * One foldable block of a dialog. The chevron and the name are the whole hit\n * target (44px on touch), and the count keeps the selection readable while the\n * section is shut, so you need not re-open it to check.\n */\nexport function FoldSection({\n label,\n count = 0,\n hint,\n open,\n onOpenChange,\n testId,\n children,\n}: FoldSectionProps) {\n return (\n <Collapsible open={open} onOpenChange={onOpenChange} data-slot=\"fold-section\">\n <CollapsibleTrigger\n className=\"mb-1.5 flex w-full items-center gap-1.5 rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&:hover]:text-muted-foreground pointer-coarse:min-h-11\"\n data-testid={testId}\n >\n <ChevronDown\n className={cn('size-4 shrink-0 transition-transform', !open && '-rotate-90')}\n />\n <span>{label}</span>\n {count > 0 && <span className=\"text-xs tabular-nums text-muted-foreground\">{count}</span>}\n {hint && !open && (\n <span className=\"min-w-0 truncate text-xs font-normal text-muted-foreground\">{hint}</span>\n )}\n </CollapsibleTrigger>\n <CollapsibleContent>{children}</CollapsibleContent>\n </Collapsible>\n )\n}\n","import type { ReactNode } from 'react'\nimport { FolderPlus } from 'lucide-react'\n\n/** Fixed strings of the empty-files state. */\nexport interface AddFilesFirstLabels {\n heading: string\n}\n\nexport const DEFAULT_ADD_FILES_FIRST_LABELS: AddFilesFirstLabels = {\n heading: 'Add files first',\n}\n\nexport interface AddFilesFirstProps {\n /** Why this action needs files, in the action's own words. */\n reason: string\n /** The host's own \"Add\" control. */\n action: ReactNode\n testId?: string\n labels?: Partial<AddFilesFirstLabels>\n}\n\n/**\n * What a quick-action dialog shows when the workspace has no files yet.\n *\n * Greying the action out says you cannot do it without saying how to get\n * there. Offering the same \"Add\" menu the Files view carries turns the dead\n * end into the first step: add files here, then run the action.\n */\nexport function AddFilesFirst({ reason, action, testId, labels }: AddFilesFirstProps) {\n const l = { ...DEFAULT_ADD_FILES_FIRST_LABELS, ...labels }\n return (\n <div\n className=\"flex flex-col items-center gap-3 rounded-lg border border-border bg-card shadow-xs px-4 py-8 text-center\"\n data-slot=\"add-files-first\"\n data-testid={testId}\n >\n <span className=\"flex size-11 items-center justify-center rounded-full bg-ai-soft text-ai-ink\">\n <FolderPlus className=\"size-5\" aria-hidden=\"true\" />\n </span>\n <div className=\"flex flex-col gap-1\">\n <p className=\"text-sm font-semibold text-foreground\">{l.heading}</p>\n <p className=\"text-xs leading-relaxed text-muted-foreground\">{reason}</p>\n </div>\n {action}\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { DialogDescription, DialogHeader, DialogTitle } from '@arbidocs/react/ui'\n\nexport interface QuickActionDialogHeaderProps {\n /** The tile's glyph, sized by the caller at `size-5`. */\n icon: ReactNode\n title: string\n /** One sentence on what the dialog does. Keep it to a line or two. */\n description: ReactNode\n /** Test id for the description, where a test asserts on the copy. */\n descriptionTestId?: string\n}\n\n/**\n * The header every \"Start\" quick-action dialog wears: the tile's own mark in\n * its disc, the action's name, and one line saying what the dialog will do.\n *\n * - The disc centres on the TITLE row, so it reads as the title's mark.\n * - The description keeps the title's left edge (`pl-13` = disc + gap), so the\n * header is one text column beside the mark rather than an L.\n * - `max-w-prose` + `text-pretty` cap the measure and stop two-word orphans.\n * - `pr-8` keeps the copy clear of the close button.\n */\nexport function QuickActionDialogHeader({\n icon,\n title,\n description,\n descriptionTestId,\n}: QuickActionDialogHeaderProps) {\n return (\n <DialogHeader className=\"space-y-0 text-left\" data-slot=\"quick-action-dialog-header\">\n <div className=\"flex items-center gap-3 pr-8\">\n <div className=\"flex size-10 shrink-0 items-center justify-center rounded-full bg-ai-soft text-ai-ink\">\n {icon}\n </div>\n <DialogTitle className=\"text-xl font-semibold leading-tight\">{title}</DialogTitle>\n </div>\n <DialogDescription\n className=\"mt-2 max-w-prose pl-13 pr-8 text-sm leading-relaxed text-pretty\"\n data-testid={descriptionTestId}\n >\n {description}\n </DialogDescription>\n </DialogHeader>\n )\n}\n","import { useMemo } from 'react'\n\n/** Which folders and labels a run is limited to. Empty = everything. */\nexport interface DocumentScope {\n /** Folder paths; `''` is the \"unfiled\" bucket. */\n folders: string[]\n /** Label (tag) ids. */\n labels: string[]\n}\n\nexport interface UseScopeSelectionOptions {\n /** Every folder path in the tree (not including the unfiled bucket). */\n folderPaths: string[]\n /** Whether the unfiled bucket is shown as a row. */\n hasUnfiled: boolean\n scope: DocumentScope\n onScopeChange: (scope: DocumentScope) => void\n}\n\n/**\n * Headless selection logic for a folder + label scope picker.\n *\n * Folders use hierarchical selection: ticking \"contracts\" also ticks\n * \"contracts/2024\", and unticking removes the whole subtree. \"All\" ticks every\n * row, which is NOT the same as an empty scope: empty means \"the whole\n * workspace, whatever lands in it later\", all-ticked means \"these folders, as\n * they are now\".\n */\nexport function useScopeSelection({\n folderPaths,\n hasUnfiled,\n scope,\n onScopeChange,\n}: UseScopeSelectionOptions) {\n const selectedFolders = useMemo(() => new Set(scope.folders), [scope.folders])\n const selectedLabels = useMemo(() => new Set(scope.labels), [scope.labels])\n\n /** Every row the folder list shows, \"unfiled\" included. */\n const allRowPaths = useMemo(\n () => [...(hasUnfiled ? [''] : []), ...folderPaths],\n [folderPaths, hasUnfiled]\n )\n const allSelected = allRowPaths.length > 0 && allRowPaths.every((p) => selectedFolders.has(p))\n const someSelected = selectedFolders.size > 0 && !allSelected\n\n const descendants = (path: string) => folderPaths.filter((p) => p.startsWith(path + '/'))\n\n const toggleFolder = (path: string) => {\n const next = new Set(selectedFolders)\n const family = [path, ...descendants(path)]\n if (next.has(path)) for (const p of family) next.delete(p)\n else for (const p of family) next.add(p)\n onScopeChange({ folders: [...next], labels: scope.labels })\n }\n\n const toggleAllFolders = () => {\n onScopeChange({ folders: allSelected ? [] : allRowPaths, labels: scope.labels })\n }\n\n const toggleLabel = (labelId: string) => {\n const next = new Set(selectedLabels)\n if (next.has(labelId)) next.delete(labelId)\n else next.add(labelId)\n onScopeChange({ folders: scope.folders, labels: [...next] })\n }\n\n return {\n selectedFolders,\n selectedLabels,\n allSelected,\n someSelected,\n hasSelection: scope.folders.length > 0 || scope.labels.length > 0,\n toggleFolder,\n toggleAllFolders,\n toggleLabel,\n }\n}\n","import { useMemo, useState } from 'react'\nimport { Check, FileCheck2, Minus } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { prefixedTestId, testIdOr } from '../chat/test-id'\nimport { useScopeSelection, type DocumentScope } from '../lib/useScopeSelection'\nimport { formatCount } from '../lib/format'\nimport { FoldSection } from './FoldSection'\n\n/**\n * Fixed strings of the picker. Passed as `uiLabels`: the `labels` prop is already the list of\n * document labels to scope by.\n */\nexport interface ScopePickerLabels {\n folders: string\n /** The Labels section heading. */\n labelsHeading: string\n all: string\n unfiled: string\n noFoldersYet: string\n noLabelsYet: string\n filesToInclude: string\n /** \"3 of 10 files\". */\n matchedOfTotal: (matched: number, total: number) => string\n selectedSuffix: string\n folderCount: (count: number) => string\n labelCount: (count: number) => string\n left: (count: number) => string\n /** \"All 10 files\". */\n allFiles: (total: number) => string\n includedSuffix: string\n}\n\nconst pluralize = (n: number, word: string) => `${n} ${word}${n !== 1 ? 's' : ''}`\n\nexport const DEFAULT_SCOPE_PICKER_LABELS: ScopePickerLabels = {\n folders: 'Folders',\n labelsHeading: 'Labels',\n all: 'All',\n unfiled: 'Unfiled',\n noFoldersYet: 'No folders yet',\n noLabelsYet: 'No labels yet — label files from the Files page to scope by them here.',\n filesToInclude: 'Files to include',\n matchedOfTotal: (matched, total) =>\n `${matched} of ${formatCount(total, { one: 'file', other: 'files' })}`,\n selectedSuffix: ' selected',\n folderCount: (count) => pluralize(count, 'folder'),\n labelCount: (count) => pluralize(count, 'label'),\n left: (count) => `${count} left`,\n allFiles: (total) => `All ${pluralize(total, 'file')}`,\n includedSuffix: ' in the workspace will be included',\n}\n\nexport interface ScopeFolder {\n /** Full path, e.g. `contracts/2024`. */\n path: string\n /** Last segment, shown. */\n label: string\n /** Documents under this folder. */\n count: number\n depth: number\n}\n\nexport interface ScopeLabel {\n id: string\n name: string\n /** Any CSS colour for the dot. */\n color: string\n /** Documents carrying this label. */\n count: number\n}\n\nexport interface ScopePickerProps {\n folders: ScopeFolder[]\n /** Documents with no folder; the \"Unfiled\" row is hidden at 0. */\n unfiledCount: number\n labels: ScopeLabel[]\n /** All documents the picker is scoping. */\n totalCount: number\n /** Documents the current scope matches (computed by the caller). */\n matchedCount: number\n scope: DocumentScope\n onScopeChange: (scope: DocumentScope) => void\n /** Reword the picker's fixed strings. */\n uiLabels?: Partial<ScopePickerLabels>\n /** Sub-element ids; defaults are the current ids. `labelChip` is a prefix (`<prefix>-<label id>`). */\n testIds?: Partial<\n Record<'foldersToggle' | 'labelsToggle' | 'noLabels' | 'labelChip' | 'summary', string>\n >\n}\n\ninterface FolderRowProps {\n label: string\n count: number\n depth: number\n isActive: boolean\n indeterminate?: boolean\n muted?: boolean\n onToggle: () => void\n}\n\n/** A checkbox row: the row is the checkbox (a nested real one would swallow the click). */\nfunction FolderRow({\n label,\n count,\n depth,\n isActive,\n indeterminate,\n muted,\n onToggle,\n}: FolderRowProps) {\n return (\n <button\n type=\"button\"\n onClick={onToggle}\n role=\"checkbox\"\n aria-checked={indeterminate ? 'mixed' : isActive}\n style={{ paddingLeft: `${4 + depth * 14}px` }}\n className={cn(\n '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',\n isActive && 'bg-primary/10',\n muted && !isActive && 'text-muted-foreground'\n )}\n data-slot=\"scope-folder-row\"\n >\n <span className=\"flex w-4 shrink-0 items-center justify-center\">\n <span\n className={cn(\n 'flex size-3.5 items-center justify-center rounded-[3px] border transition-colors',\n isActive || indeterminate\n ? 'border-primary bg-primary text-primary-foreground'\n : 'border-muted-foreground/40'\n )}\n >\n {indeterminate ? (\n <Minus className=\"size-2.5\" />\n ) : (\n isActive && <Check className=\"size-2.5\" />\n )}\n </span>\n </span>\n {label !== '' && (\n <span className={cn('min-w-0 truncate', isActive && 'font-semibold text-primary')}>\n {label}\n </span>\n )}\n <span className=\"ml-auto pl-2 text-sm font-semibold text-muted-foreground\">{count}</span>\n </button>\n )\n}\n\n/**\n * Pick a folder + label scope for a run over documents. Controlled: the caller\n * owns the scope and computes `matchedCount`, so the submit button lives with\n * the caller. Both sections start shut: the default (every file) is what most\n * runs want, and the summary states it plainly.\n */\nexport function ScopePicker({\n folders,\n unfiledCount,\n labels,\n totalCount,\n matchedCount,\n scope,\n onScopeChange,\n uiLabels,\n testIds,\n}: ScopePickerProps) {\n const l = { ...DEFAULT_SCOPE_PICKER_LABELS, ...uiLabels }\n const [foldersOpen, setFoldersOpen] = useState(false)\n const [labelsOpen, setLabelsOpen] = useState(false)\n\n const folderPaths = useMemo(() => folders.map((f) => f.path), [folders])\n const selection = useScopeSelection({\n folderPaths,\n hasUnfiled: unfiledCount > 0,\n scope,\n onScopeChange,\n })\n const hasRows = folders.length > 0 || unfiledCount > 0\n\n return (\n <div className=\"flex flex-col gap-4\" data-slot=\"scope-picker\">\n <FoldSection\n label={l.folders}\n count={scope.folders.length}\n open={foldersOpen}\n onOpenChange={setFoldersOpen}\n testId={testIdOr(testIds?.foldersToggle, { testId: 'scope-picker-folders-toggle' })}\n >\n <div className=\"max-h-[180px] overflow-y-auto rounded-md border border-border p-1\">\n {hasRows && (\n <>\n <FolderRow\n label={l.all}\n count={totalCount}\n depth={0}\n isActive={selection.allSelected}\n indeterminate={selection.someSelected}\n onToggle={selection.toggleAllFolders}\n />\n <div className=\"my-1 border-t border-border\" />\n </>\n )}\n {unfiledCount > 0 && (\n <>\n <FolderRow\n label={l.unfiled}\n count={unfiledCount}\n depth={0}\n isActive={selection.selectedFolders.has('')}\n muted\n onToggle={() => selection.toggleFolder('')}\n />\n {folders.length > 0 && <div className=\"my-1 border-t border-border\" />}\n </>\n )}\n {folders.map((folder) => (\n <FolderRow\n key={folder.path}\n label={folder.label}\n count={folder.count}\n depth={folder.depth}\n isActive={selection.selectedFolders.has(folder.path)}\n onToggle={() => selection.toggleFolder(folder.path)}\n />\n ))}\n {!hasRows && <p className=\"px-2 py-1 text-sm text-muted-foreground\">{l.noFoldersYet}</p>}\n </div>\n </FoldSection>\n\n {/* Always present, like Folders: a workspace with no labels yet reads as\n \"you have not labelled anything\", not \"this cannot scope by label\". */}\n <FoldSection\n label={l.labelsHeading}\n count={scope.labels.length}\n open={labelsOpen}\n onOpenChange={setLabelsOpen}\n testId={testIdOr(testIds?.labelsToggle, { testId: 'scope-picker-labels-toggle' })}\n >\n {labels.length === 0 ? (\n <p\n className=\"px-2 py-1 text-sm text-muted-foreground\"\n data-testid={testIdOr(testIds?.noLabels, { testId: 'scope-picker-no-labels' })}\n >\n {l.noLabelsYet}\n </p>\n ) : (\n <div className=\"flex flex-wrap gap-1.5\">\n {labels.map((label) => {\n const isActive = selection.selectedLabels.has(label.id)\n return (\n <button\n key={label.id}\n type=\"button\"\n onClick={() => selection.toggleLabel(label.id)}\n aria-pressed={isActive}\n data-testid={prefixedTestId(testIds?.labelChip, label.id, {\n testId: `scope-picker-label-chip-${label.id}`,\n })}\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11',\n isActive\n ? 'border-primary/40 bg-primary/10 text-primary'\n : 'border-border [&:hover]:bg-accent [&:hover]:text-accent-foreground'\n )}\n >\n <span\n className=\"size-2.5 shrink-0 rounded-full\"\n style={{ backgroundColor: label.color }}\n />\n <span className=\"truncate\">{label.name}</span>\n <span className=\"shrink-0 text-xs text-muted-foreground\">({label.count})</span>\n {isActive && <Check className=\"size-3.5 shrink-0\" />}\n </button>\n )\n })}\n </div>\n )}\n </FoldSection>\n\n <div\n className=\"rounded-lg bg-muted p-3\"\n data-testid={testIdOr(testIds?.summary, { testId: 'scope-picker-summary' })}\n >\n <div className=\"mb-2 flex items-center gap-1.5 text-xs font-medium text-muted-foreground\">\n <FileCheck2 className=\"size-4\" />\n {l.filesToInclude}\n </div>\n {selection.hasSelection ? (\n <div className=\"text-sm text-muted-foreground\">\n <span className=\"text-base font-semibold text-foreground\">\n {l.matchedOfTotal(matchedCount, totalCount)}\n </span>\n {l.selectedSuffix}\n {scope.folders.length > 0 && <span> — {l.folderCount(scope.folders.length)}</span>}\n {scope.folders.length > 0 && scope.labels.length > 0 && <span>, </span>}\n {scope.labels.length > 0 && <span>{l.labelCount(scope.labels.length)}</span>}\n <span className=\"text-xs\">\n {' · '}\n {l.left(totalCount - matchedCount)}\n </span>\n </div>\n ) : (\n <div className=\"text-sm text-muted-foreground\">\n <span className=\"text-base font-semibold text-foreground\">\n {l.allFiles(totalCount)}\n </span>\n {l.includedSuffix}\n </div>\n )}\n </div>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Plus, type LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\n\n/** The small label that names a band of a page (\"Start\", \"Recent\"). */\nexport function SectionLabel({\n children,\n className,\n testId,\n}: {\n children: ReactNode\n className?: string\n testId?: string\n}) {\n return (\n <p\n className={cn(\n 'flex items-center gap-3 text-sm font-semibold text-foreground after:h-px after:flex-1 after:bg-border',\n className\n )}\n data-slot=\"section-label\"\n data-testid={testId}\n >\n {children}\n </p>\n )\n}\n\nexport interface SectionHeaderProps {\n icon?: LucideIcon\n title: string\n count?: number\n /** Makes the title a button (open the full list). Omit for a static title. */\n onOpen?: () => void\n /** Real link target of the title; `onOpen` still fires on a plain click. */\n openHref?: string\n /** Test id of the title button. */\n openTestId?: string\n /** The section's one quiet action, rendered at the trailing edge. */\n action?: ReactNode\n className?: string\n}\n\n/** Title + count + one quiet action: the head of a list section. */\nexport function SectionHeader({\n icon: Icon,\n title,\n count,\n onOpen,\n openHref,\n openTestId,\n action,\n className,\n}: SectionHeaderProps) {\n return (\n <div\n className={cn('flex items-center justify-between gap-2', className)}\n data-slot=\"section-header\"\n >\n <ActionLink\n href={openHref}\n onSelect={onOpen}\n disabled={!onOpen && !openHref}\n className=\"flex min-w-0 cursor-pointer items-center gap-2 rounded-md py-1.5 pr-2 text-left transition-colors hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:hover:text-foreground pointer-coarse:min-h-11\"\n data-testid={openTestId}\n >\n {Icon && <Icon className=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />}\n <span className=\"whitespace-nowrap text-sm font-semibold text-foreground\">{title}</span>\n {count !== undefined && (\n <span className=\"text-sm tabular-nums text-muted-foreground\">{count}</span>\n )}\n </ActionLink>\n {action && <div className=\"shrink-0\">{action}</div>}\n </div>\n )\n}\n\nexport interface EmptyStripProps {\n icon?: LucideIcon\n label: ReactNode\n description?: ReactNode\n onSelect?: () => void\n testId?: string\n}\n\n/** One tonal strip that stands in for an empty section: an invitation, not a void. */\nexport function EmptyStrip({\n icon: Icon = Plus,\n label,\n description,\n onSelect,\n testId,\n}: EmptyStripProps) {\n return (\n <button\n type=\"button\"\n onClick={onSelect}\n disabled={!onSelect}\n className=\"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left border border-border bg-card shadow-xs transition-colors hover:border-ring/50 hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:hover:bg-card disabled:hover:border-border pointer-coarse:min-h-11\"\n data-slot=\"empty-strip\"\n data-testid={testId}\n >\n <Icon className=\"size-5 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block text-sm font-semibold text-foreground\">{label}</span>\n {description && (\n <span className=\"block text-sm leading-snug text-muted-foreground\">{description}</span>\n )}\n </span>\n </button>\n )\n}\n","/**\n * The column count for a grid of `count` equal tiles in `width` pixels, chosen so the last row is\n * never left with a lone orphan: of the counts that fit (each column at least `minTile` wide),\n * take the one that leaves the fewest empty cells in the last row, preferring more columns on a\n * tie (never fewer than two columns when two fit). Four tiles resolve to 2x2 where three would fit\n * and 4 across when there is room for four; six resolve to 3x2.\n */\nexport function balancedColumns(count: number, width: number, minTile = 200, gap = 12): number {\n if (count <= 1) return 1\n const fit = Math.max(1, Math.min(count, Math.floor((width + gap) / (minTile + gap))))\n if (fit < 2) return 1\n let best = 2\n let bestEmpty = Number.POSITIVE_INFINITY\n for (let columns = 2; columns <= fit; columns++) {\n const empty = (columns - (count % columns)) % columns\n if (empty < bestEmpty || (empty === bestEmpty && columns > best)) {\n best = columns\n bestEmpty = empty\n }\n }\n return best\n}\n","import { useEffect, useRef, useState, type ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\nimport { balancedColumns } from '../lib/balanced-columns'\nimport { observeResize } from '../lib/observe-resize'\nimport { SectionLabel } from './sections'\n\n/** One \"start something\" tile: an AI-driven action, one click from underway. */\nexport interface StartTile {\n id: string\n /** A Lucide glyph; `iconNode` wins when both are given. */\n icon?: LucideIcon\n /** A ready-made mark (host icon maps), wearing the same AI ink. */\n iconNode?: ReactNode\n title: string\n description: string\n onSelect: () => void\n /** Real link target (ctrl-click / new tab, in-SPA through the host environment's `linkComponent`). `onSelect` still fires on a plain click. */\n href?: string\n /** Rendered non-interactive and dimmed; `disabledReason` replaces the description. */\n disabled?: boolean\n disabledReason?: string\n testId?: string\n}\n\nexport interface StartTilesProps {\n items: StartTile[]\n /** Optional band label above the tiles (\"Start\"). */\n caption?: string\n captionTestId?: string\n className?: string\n testId?: string\n}\n\n/**\n * A band of tonal action tiles. The glyph wears the AI ink, because these are\n * the AI-driven starts. Nothing is hover-only: tiles are always rendered, hover\n * only nudges tone, and touch targets are at least 44px.\n */\nexport function StartTiles({ items, caption, captionTestId, className, testId }: StartTilesProps) {\n // The tiles reflow by their own container width (a docked tablet sidebar narrows it without\n // changing the viewport), choosing a column count that never leaves one tile alone on a row.\n const gridRef = useRef<HTMLDivElement>(null)\n const [columns, setColumns] = useState<number | null>(null)\n const count = items.length\n useEffect(() => {\n const grid = gridRef.current\n if (!grid || count === 0) return\n const measure = () => setColumns(balancedColumns(count, grid.clientWidth))\n measure()\n return observeResize(grid, measure)\n }, [count])\n\n if (count === 0) return null\n return (\n <section\n className={cn('flex flex-col gap-3', className)}\n data-slot=\"start-tiles\"\n data-testid={testId}\n >\n {caption && <SectionLabel testId={captionTestId}>{caption}</SectionLabel>}\n <div\n ref={gridRef}\n data-slot=\"start-tiles-grid\"\n data-columns={columns ?? undefined}\n className=\"grid gap-3\"\n style={{\n gridTemplateColumns:\n columns === null\n ? 'repeat(auto-fit, minmax(200px, 1fr))'\n : `repeat(${columns}, minmax(0, 1fr))`,\n }}\n >\n {items.map((item) => {\n const Icon = item.icon\n return (\n <ActionLink\n key={item.id}\n href={item.href}\n onSelect={item.onSelect}\n disabled={item.disabled}\n title={item.disabled ? item.disabledReason : undefined}\n className={cn(\n 'flex h-full flex-col items-start gap-3 rounded-lg p-4 text-left',\n 'border border-border bg-card shadow-xs transition-colors hover:border-ring/50 hover:bg-accent/40',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n 'disabled:cursor-default disabled:opacity-55 disabled:hover:bg-card disabled:hover:border-border',\n 'pointer-coarse:min-h-11'\n )}\n data-slot=\"start-tile\"\n data-testid={item.testId}\n >\n {item.iconNode ? (\n <span className=\"shrink-0 text-ai-ink [&>svg]:size-5\" aria-hidden=\"true\">\n {item.iconNode}\n </span>\n ) : (\n Icon && <Icon className=\"size-5 shrink-0 text-ai-ink\" aria-hidden=\"true\" />\n )}\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-semibold text-foreground\">{item.title}</span>\n <span className=\"mt-1 block text-sm leading-snug text-muted-foreground\">\n {item.disabled && item.disabledReason ? item.disabledReason : item.description}\n </span>\n </span>\n </ActionLink>\n )\n })}\n </div>\n </section>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/home/FoldSection.tsx","../src/home/AddFilesFirst.tsx","../src/home/QuickActionDialogHeader.tsx","../src/lib/useScopeSelection.ts","../src/home/ScopePicker.tsx","../src/home/sections.tsx","../src/lib/balanced-columns.ts","../src/home/StartTiles.tsx"],"names":["jsxs","jsx","cn","useMemo","useState"],"mappings":";;;;;;;;;AAsBO,SAAS,WAAA,CAAY;AAAA,EAC1B,KAAA;AAAA,EACA,KAAA,GAAQ,CAAA;AAAA,EACR,IAAA;AAAA,EACA,IAAA;AAAA,EACA,YAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,EAAqB;AACnB,EAAA,uBACE,IAAA,CAAC,WAAA,EAAA,EAAY,IAAA,EAAY,YAAA,EAA4B,aAAU,cAAA,EAC7D,QAAA,EAAA;AAAA,oBAAA,IAAA;AAAA,MAAC,kBAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,wMAAA;AAAA,QACV,aAAA,EAAa,MAAA;AAAA,QAEb,QAAA,EAAA;AAAA,0BAAA,GAAA;AAAA,YAAC,WAAA;AAAA,YAAA;AAAA,cACC,SAAA,EAAW,E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;AAAA,kBACX,UAAU,IAAA,CAAK,QAAA;AAAA,kBACf,UAAU,IAAA,CAAK,QAAA;AAAA,kBACf,KAAA,EAAO,IAAA,CAAK,QAAA,GAAW,IAAA,CAAK,cAAA,GAAiB,MAAA;AAAA,kBAC7C,SAAA,EAAWE,EAAAA;AAAA,oBACT,iEAAA;AAAA,oBACA,kGAAA;AAAA,oBACA,yEAAA;AAAA,oBACA,iGAAA;AAAA,oBACA;AAAA,mBACF;AAAA,kBACA,WAAA,EAAU,YAAA;AAAA,kBACV,eAAa,IAAA,CAAK,MAAA;AAAA,kBAEjB,QAAA,EAAA;AAAA,oBAAA,IAAA,CAAK,2BACJD,GAAAA,CAAC,UAAK,SAAA,EAAU,qCAAA,EAAsC,eAAY,MAAA,EAC/D,QAAA,EAAA,IAAA,CAAK,QAAA,EACR,CAAA,GAEA,wBAAQA,GAAAA,CAAC,QAAK,SAAA,EAAU,6BAAA,EAA8B,eAAY,MAAA,EAAO,CAAA;AAAA,oCAE3ED,IAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,SAAA,EACd,QAAA,EAAA;AAAA,sCAAAC,GAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,6CAAA,EAA+C,eAAK,KAAA,EAAM,CAAA;AAAA,sCAC1EA,GAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,uDAAA,EACb,QAAA,EAAA,IAAA,CAAK,QAAA,IAAY,IAAA,CAAK,cAAA,GAAiB,IAAA,CAAK,cAAA,GAAiB,IAAA,CAAK,WAAA,EACrE;AAAA,qBAAA,EACF;AAAA;AAAA,iBAAA;AAAA,gBA3BK,IAAA,CAAK;AAAA,eA4BZ;AAAA,YAEJ,CAAC;AAAA;AAAA;AACH;AAAA;AAAA,GACF;AAEJ","file":"chunk-GXJIN7G3.js","sourcesContent":["import type { ReactNode } from 'react'\nimport { ChevronDown } from 'lucide-react'\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger, cn } from '@arbidocs/react/ui'\n\nexport interface FoldSectionProps {\n label: string\n /** Shown as plain muted text beside the name; omit or pass 0 to hide. */\n count?: number\n /** A word or two of state for sections a count cannot summarise (shown while shut). */\n hint?: string\n open: boolean\n onOpenChange: (open: boolean) => void\n /** Trigger test id; the caller owns the naming. */\n testId: string\n children: ReactNode\n}\n\n/**\n * One foldable block of a dialog. The chevron and the name are the whole hit\n * target (44px on touch), and the count keeps the selection readable while the\n * section is shut, so you need not re-open it to check.\n */\nexport function FoldSection({\n label,\n count = 0,\n hint,\n open,\n onOpenChange,\n testId,\n children,\n}: FoldSectionProps) {\n return (\n <Collapsible open={open} onOpenChange={onOpenChange} data-slot=\"fold-section\">\n <CollapsibleTrigger\n className=\"mb-1.5 flex w-full items-center gap-1.5 rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&:hover]:text-muted-foreground pointer-coarse:min-h-11\"\n data-testid={testId}\n >\n <ChevronDown\n className={cn('size-4 shrink-0 transition-transform', !open && '-rotate-90')}\n />\n <span>{label}</span>\n {count > 0 && <span className=\"text-xs tabular-nums text-muted-foreground\">{count}</span>}\n {hint && !open && (\n <span className=\"min-w-0 truncate text-xs font-normal text-muted-foreground\">{hint}</span>\n )}\n </CollapsibleTrigger>\n <CollapsibleContent>{children}</CollapsibleContent>\n </Collapsible>\n )\n}\n","import type { ReactNode } from 'react'\nimport { FolderPlus } from 'lucide-react'\n\n/** Fixed strings of the empty-files state. */\nexport interface AddFilesFirstLabels {\n heading: string\n}\n\nexport const DEFAULT_ADD_FILES_FIRST_LABELS: AddFilesFirstLabels = {\n heading: 'Add files first',\n}\n\nexport interface AddFilesFirstProps {\n /** Why this action needs files, in the action's own words. */\n reason: string\n /** The host's own \"Add\" control. */\n action: ReactNode\n testId?: string\n labels?: Partial<AddFilesFirstLabels>\n}\n\n/**\n * What a quick-action dialog shows when the workspace has no files yet.\n *\n * Greying the action out says you cannot do it without saying how to get\n * there. Offering the same \"Add\" menu the Files view carries turns the dead\n * end into the first step: add files here, then run the action.\n */\nexport function AddFilesFirst({ reason, action, testId, labels }: AddFilesFirstProps) {\n const l = { ...DEFAULT_ADD_FILES_FIRST_LABELS, ...labels }\n return (\n <div\n className=\"flex flex-col items-center gap-3 rounded-lg border border-border bg-card shadow-xs px-4 py-8 text-center\"\n data-slot=\"add-files-first\"\n data-testid={testId}\n >\n <span className=\"flex size-11 items-center justify-center rounded-full bg-ai-soft text-ai-ink\">\n <FolderPlus className=\"size-5\" aria-hidden=\"true\" />\n </span>\n <div className=\"flex flex-col gap-1\">\n <p className=\"text-sm font-semibold text-foreground\">{l.heading}</p>\n <p className=\"text-xs leading-relaxed text-muted-foreground\">{reason}</p>\n </div>\n {action}\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { DialogDescription, DialogHeader, DialogTitle } from '@arbidocs/react/ui'\n\nexport interface QuickActionDialogHeaderProps {\n /** The tile's glyph, sized by the caller at `size-5`. */\n icon: ReactNode\n title: string\n /** One sentence on what the dialog does. Keep it to a line or two. */\n description: ReactNode\n /** Test id for the description, where a test asserts on the copy. */\n descriptionTestId?: string\n}\n\n/**\n * The header every \"Start\" quick-action dialog wears: the tile's own mark in\n * its disc, the action's name, and one line saying what the dialog will do.\n *\n * - The disc centres on the TITLE row, so it reads as the title's mark.\n * - The description keeps the title's left edge (`pl-13` = disc + gap), so the\n * header is one text column beside the mark rather than an L.\n * - `max-w-prose` + `text-pretty` cap the measure and stop two-word orphans.\n * - `pr-8` keeps the copy clear of the close button.\n */\nexport function QuickActionDialogHeader({\n icon,\n title,\n description,\n descriptionTestId,\n}: QuickActionDialogHeaderProps) {\n return (\n <DialogHeader className=\"space-y-0 text-left\" data-slot=\"quick-action-dialog-header\">\n <div className=\"flex items-center gap-3 pr-8\">\n <div className=\"flex size-10 shrink-0 items-center justify-center rounded-full bg-ai-soft text-ai-ink\">\n {icon}\n </div>\n <DialogTitle className=\"text-xl font-semibold leading-tight\">{title}</DialogTitle>\n </div>\n <DialogDescription\n className=\"mt-2 max-w-prose pl-13 pr-8 text-sm leading-relaxed text-pretty\"\n data-testid={descriptionTestId}\n >\n {description}\n </DialogDescription>\n </DialogHeader>\n )\n}\n","import { useMemo } from 'react'\n\n/** Which folders and labels a run is limited to. Empty = everything. */\nexport interface DocumentScope {\n /** Folder paths; `''` is the \"unfiled\" bucket. */\n folders: string[]\n /** Label (tag) ids. */\n labels: string[]\n}\n\nexport interface UseScopeSelectionOptions {\n /** Every folder path in the tree (not including the unfiled bucket). */\n folderPaths: string[]\n /** Whether the unfiled bucket is shown as a row. */\n hasUnfiled: boolean\n scope: DocumentScope\n onScopeChange: (scope: DocumentScope) => void\n}\n\n/**\n * Headless selection logic for a folder + label scope picker.\n *\n * Folders use hierarchical selection: ticking \"contracts\" also ticks\n * \"contracts/2024\", and unticking removes the whole subtree. \"All\" ticks every\n * row, which is NOT the same as an empty scope: empty means \"the whole\n * workspace, whatever lands in it later\", all-ticked means \"these folders, as\n * they are now\".\n */\nexport function useScopeSelection({\n folderPaths,\n hasUnfiled,\n scope,\n onScopeChange,\n}: UseScopeSelectionOptions) {\n const selectedFolders = useMemo(() => new Set(scope.folders), [scope.folders])\n const selectedLabels = useMemo(() => new Set(scope.labels), [scope.labels])\n\n /** Every row the folder list shows, \"unfiled\" included. */\n const allRowPaths = useMemo(\n () => [...(hasUnfiled ? [''] : []), ...folderPaths],\n [folderPaths, hasUnfiled]\n )\n const allSelected = allRowPaths.length > 0 && allRowPaths.every((p) => selectedFolders.has(p))\n const someSelected = selectedFolders.size > 0 && !allSelected\n\n const descendants = (path: string) => folderPaths.filter((p) => p.startsWith(path + '/'))\n\n const toggleFolder = (path: string) => {\n const next = new Set(selectedFolders)\n const family = [path, ...descendants(path)]\n if (next.has(path)) for (const p of family) next.delete(p)\n else for (const p of family) next.add(p)\n onScopeChange({ folders: [...next], labels: scope.labels })\n }\n\n const toggleAllFolders = () => {\n onScopeChange({ folders: allSelected ? [] : allRowPaths, labels: scope.labels })\n }\n\n const toggleLabel = (labelId: string) => {\n const next = new Set(selectedLabels)\n if (next.has(labelId)) next.delete(labelId)\n else next.add(labelId)\n onScopeChange({ folders: scope.folders, labels: [...next] })\n }\n\n return {\n selectedFolders,\n selectedLabels,\n allSelected,\n someSelected,\n hasSelection: scope.folders.length > 0 || scope.labels.length > 0,\n toggleFolder,\n toggleAllFolders,\n toggleLabel,\n }\n}\n","import { useMemo, useState } from 'react'\nimport { Check, FileCheck2, Minus } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { prefixedTestId, testIdOr } from '../chat/test-id'\nimport { useScopeSelection, type DocumentScope } from '../lib/useScopeSelection'\nimport { formatCount } from '../lib/format'\nimport { FoldSection } from './FoldSection'\n\n/**\n * Fixed strings of the picker. Passed as `uiLabels`: the `labels` prop is already the list of\n * document labels to scope by.\n */\nexport interface ScopePickerLabels {\n folders: string\n /** The Labels section heading. */\n labelsHeading: string\n all: string\n unfiled: string\n noFoldersYet: string\n noLabelsYet: string\n filesToInclude: string\n /** \"3 of 10 files\". */\n matchedOfTotal: (matched: number, total: number) => string\n selectedSuffix: string\n folderCount: (count: number) => string\n labelCount: (count: number) => string\n left: (count: number) => string\n /** \"All 10 files\". */\n allFiles: (total: number) => string\n includedSuffix: string\n}\n\nconst pluralize = (n: number, word: string) => `${n} ${word}${n !== 1 ? 's' : ''}`\n\nexport const DEFAULT_SCOPE_PICKER_LABELS: ScopePickerLabels = {\n folders: 'Folders',\n labelsHeading: 'Labels',\n all: 'All',\n unfiled: 'Unfiled',\n noFoldersYet: 'No folders yet',\n noLabelsYet: 'No labels yet — label files from the Files page to scope by them here.',\n filesToInclude: 'Files to include',\n matchedOfTotal: (matched, total) =>\n `${matched} of ${formatCount(total, { one: 'file', other: 'files' })}`,\n selectedSuffix: ' selected',\n folderCount: (count) => pluralize(count, 'folder'),\n labelCount: (count) => pluralize(count, 'label'),\n left: (count) => `${count} left`,\n allFiles: (total) => `All ${pluralize(total, 'file')}`,\n includedSuffix: ' in the workspace will be included',\n}\n\nexport interface ScopeFolder {\n /** Full path, e.g. `contracts/2024`. */\n path: string\n /** Last segment, shown. */\n label: string\n /** Documents under this folder. */\n count: number\n depth: number\n}\n\nexport interface ScopeLabel {\n id: string\n name: string\n /** Any CSS colour for the dot. */\n color: string\n /** Documents carrying this label. */\n count: number\n}\n\nexport interface ScopePickerProps {\n folders: ScopeFolder[]\n /** Documents with no folder; the \"Unfiled\" row is hidden at 0. */\n unfiledCount: number\n labels: ScopeLabel[]\n /** All documents the picker is scoping. */\n totalCount: number\n /** Documents the current scope matches (computed by the caller). */\n matchedCount: number\n scope: DocumentScope\n onScopeChange: (scope: DocumentScope) => void\n /** Reword the picker's fixed strings. */\n uiLabels?: Partial<ScopePickerLabels>\n /** Sub-element ids; defaults are the current ids. `labelChip` is a prefix (`<prefix>-<label id>`). */\n testIds?: Partial<\n Record<'foldersToggle' | 'labelsToggle' | 'noLabels' | 'labelChip' | 'summary', string>\n >\n}\n\ninterface FolderRowProps {\n label: string\n count: number\n depth: number\n isActive: boolean\n indeterminate?: boolean\n muted?: boolean\n onToggle: () => void\n}\n\n/** A checkbox row: the row is the checkbox (a nested real one would swallow the click). */\nfunction FolderRow({\n label,\n count,\n depth,\n isActive,\n indeterminate,\n muted,\n onToggle,\n}: FolderRowProps) {\n return (\n <button\n type=\"button\"\n onClick={onToggle}\n role=\"checkbox\"\n aria-checked={indeterminate ? 'mixed' : isActive}\n style={{ paddingLeft: `${4 + depth * 14}px` }}\n className={cn(\n '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',\n isActive && 'bg-primary/10',\n muted && !isActive && 'text-muted-foreground'\n )}\n data-slot=\"scope-folder-row\"\n >\n <span className=\"flex w-4 shrink-0 items-center justify-center\">\n <span\n className={cn(\n 'flex size-3.5 items-center justify-center rounded-[3px] border transition-colors',\n isActive || indeterminate\n ? 'border-primary bg-primary text-primary-foreground'\n : 'border-muted-foreground/40'\n )}\n >\n {indeterminate ? (\n <Minus className=\"size-2.5\" />\n ) : (\n isActive && <Check className=\"size-2.5\" />\n )}\n </span>\n </span>\n {label !== '' && (\n <span className={cn('min-w-0 truncate', isActive && 'font-semibold text-primary')}>\n {label}\n </span>\n )}\n <span className=\"ml-auto pl-2 text-sm font-semibold text-muted-foreground\">{count}</span>\n </button>\n )\n}\n\n/**\n * Pick a folder + label scope for a run over documents. Controlled: the caller\n * owns the scope and computes `matchedCount`, so the submit button lives with\n * the caller. Both sections start shut: the default (every file) is what most\n * runs want, and the summary states it plainly.\n */\nexport function ScopePicker({\n folders,\n unfiledCount,\n labels,\n totalCount,\n matchedCount,\n scope,\n onScopeChange,\n uiLabels,\n testIds,\n}: ScopePickerProps) {\n const l = { ...DEFAULT_SCOPE_PICKER_LABELS, ...uiLabels }\n const [foldersOpen, setFoldersOpen] = useState(false)\n const [labelsOpen, setLabelsOpen] = useState(false)\n\n const folderPaths = useMemo(() => folders.map((f) => f.path), [folders])\n const selection = useScopeSelection({\n folderPaths,\n hasUnfiled: unfiledCount > 0,\n scope,\n onScopeChange,\n })\n const hasRows = folders.length > 0 || unfiledCount > 0\n\n return (\n <div className=\"flex flex-col gap-4\" data-slot=\"scope-picker\">\n <FoldSection\n label={l.folders}\n count={scope.folders.length}\n open={foldersOpen}\n onOpenChange={setFoldersOpen}\n testId={testIdOr(testIds?.foldersToggle, { testId: 'scope-picker-folders-toggle' })}\n >\n <div className=\"max-h-[180px] overflow-y-auto rounded-md border border-border p-1\">\n {hasRows && (\n <>\n <FolderRow\n label={l.all}\n count={totalCount}\n depth={0}\n isActive={selection.allSelected}\n indeterminate={selection.someSelected}\n onToggle={selection.toggleAllFolders}\n />\n <div className=\"my-1 border-t border-border\" />\n </>\n )}\n {unfiledCount > 0 && (\n <>\n <FolderRow\n label={l.unfiled}\n count={unfiledCount}\n depth={0}\n isActive={selection.selectedFolders.has('')}\n muted\n onToggle={() => selection.toggleFolder('')}\n />\n {folders.length > 0 && <div className=\"my-1 border-t border-border\" />}\n </>\n )}\n {folders.map((folder) => (\n <FolderRow\n key={folder.path}\n label={folder.label}\n count={folder.count}\n depth={folder.depth}\n isActive={selection.selectedFolders.has(folder.path)}\n onToggle={() => selection.toggleFolder(folder.path)}\n />\n ))}\n {!hasRows && <p className=\"px-2 py-1 text-sm text-muted-foreground\">{l.noFoldersYet}</p>}\n </div>\n </FoldSection>\n\n {/* Always present, like Folders: a workspace with no labels yet reads as\n \"you have not labelled anything\", not \"this cannot scope by label\". */}\n <FoldSection\n label={l.labelsHeading}\n count={scope.labels.length}\n open={labelsOpen}\n onOpenChange={setLabelsOpen}\n testId={testIdOr(testIds?.labelsToggle, { testId: 'scope-picker-labels-toggle' })}\n >\n {labels.length === 0 ? (\n <p\n className=\"px-2 py-1 text-sm text-muted-foreground\"\n data-testid={testIdOr(testIds?.noLabels, { testId: 'scope-picker-no-labels' })}\n >\n {l.noLabelsYet}\n </p>\n ) : (\n <div className=\"flex flex-wrap gap-1.5\">\n {labels.map((label) => {\n const isActive = selection.selectedLabels.has(label.id)\n return (\n <button\n key={label.id}\n type=\"button\"\n onClick={() => selection.toggleLabel(label.id)}\n aria-pressed={isActive}\n data-testid={prefixedTestId(testIds?.labelChip, label.id, {\n testId: `scope-picker-label-chip-${label.id}`,\n })}\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-md border px-2 py-1 text-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11',\n isActive\n ? 'border-primary/40 bg-primary/10 text-primary'\n : 'border-border [&:hover]:bg-accent [&:hover]:text-accent-foreground'\n )}\n >\n <span\n className=\"size-2.5 shrink-0 rounded-full\"\n style={{ backgroundColor: label.color }}\n />\n <span className=\"truncate\">{label.name}</span>\n <span className=\"shrink-0 text-xs text-muted-foreground\">({label.count})</span>\n {isActive && <Check className=\"size-3.5 shrink-0\" />}\n </button>\n )\n })}\n </div>\n )}\n </FoldSection>\n\n <div\n className=\"rounded-lg bg-muted p-3\"\n data-testid={testIdOr(testIds?.summary, { testId: 'scope-picker-summary' })}\n >\n <div className=\"mb-2 flex items-center gap-1.5 text-xs font-medium text-muted-foreground\">\n <FileCheck2 className=\"size-4\" />\n {l.filesToInclude}\n </div>\n {selection.hasSelection ? (\n <div className=\"text-sm text-muted-foreground\">\n <span className=\"text-base font-semibold text-foreground\">\n {l.matchedOfTotal(matchedCount, totalCount)}\n </span>\n {l.selectedSuffix}\n {scope.folders.length > 0 && <span> — {l.folderCount(scope.folders.length)}</span>}\n {scope.folders.length > 0 && scope.labels.length > 0 && <span>, </span>}\n {scope.labels.length > 0 && <span>{l.labelCount(scope.labels.length)}</span>}\n <span className=\"text-xs\">\n {' · '}\n {l.left(totalCount - matchedCount)}\n </span>\n </div>\n ) : (\n <div className=\"text-sm text-muted-foreground\">\n <span className=\"text-base font-semibold text-foreground\">\n {l.allFiles(totalCount)}\n </span>\n {l.includedSuffix}\n </div>\n )}\n </div>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Plus, type LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\n\n/** The small label that names a band of a page (\"Start\", \"Recent\"). */\nexport function SectionLabel({\n children,\n className,\n testId,\n}: {\n children: ReactNode\n className?: string\n testId?: string\n}) {\n return (\n <p\n className={cn(\n 'flex items-center gap-3 text-sm font-semibold text-foreground after:h-px after:flex-1 after:bg-border',\n className\n )}\n data-slot=\"section-label\"\n data-testid={testId}\n >\n {children}\n </p>\n )\n}\n\nexport interface SectionHeaderProps {\n icon?: LucideIcon\n title: string\n count?: number\n /** Makes the title a button (open the full list). Omit for a static title. */\n onOpen?: () => void\n /** Real link target of the title; `onOpen` still fires on a plain click. */\n openHref?: string\n /** Test id of the title button. */\n openTestId?: string\n /** The section's one quiet action, rendered at the trailing edge. */\n action?: ReactNode\n className?: string\n}\n\n/** Title + count + one quiet action: the head of a list section. */\nexport function SectionHeader({\n icon: Icon,\n title,\n count,\n onOpen,\n openHref,\n openTestId,\n action,\n className,\n}: SectionHeaderProps) {\n return (\n <div\n className={cn('flex items-center justify-between gap-2', className)}\n data-slot=\"section-header\"\n >\n <ActionLink\n href={openHref}\n onSelect={onOpen}\n disabled={!onOpen && !openHref}\n className=\"flex min-w-0 cursor-pointer items-center gap-2 rounded-md py-1.5 pr-2 text-left transition-colors hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:hover:text-foreground pointer-coarse:min-h-11\"\n data-testid={openTestId}\n >\n {Icon && <Icon className=\"size-4 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />}\n <span className=\"whitespace-nowrap text-sm font-semibold text-foreground\">{title}</span>\n {count !== undefined && (\n <span className=\"text-sm tabular-nums text-muted-foreground\">{count}</span>\n )}\n </ActionLink>\n {action && <div className=\"shrink-0\">{action}</div>}\n </div>\n )\n}\n\nexport interface EmptyStripProps {\n icon?: LucideIcon\n label: ReactNode\n description?: ReactNode\n onSelect?: () => void\n testId?: string\n}\n\n/** One tonal strip that stands in for an empty section: an invitation, not a void. */\nexport function EmptyStrip({\n icon: Icon = Plus,\n label,\n description,\n onSelect,\n testId,\n}: EmptyStripProps) {\n return (\n <button\n type=\"button\"\n onClick={onSelect}\n disabled={!onSelect}\n className=\"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left border border-border bg-card shadow-xs transition-colors hover:border-ring/50 hover:bg-accent/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:hover:bg-card disabled:hover:border-border pointer-coarse:min-h-11\"\n data-slot=\"empty-strip\"\n data-testid={testId}\n >\n <Icon className=\"size-5 shrink-0 text-muted-foreground\" aria-hidden=\"true\" />\n <span className=\"min-w-0 flex-1\">\n <span className=\"block text-sm font-semibold text-foreground\">{label}</span>\n {description && (\n <span className=\"block text-sm leading-snug text-muted-foreground\">{description}</span>\n )}\n </span>\n </button>\n )\n}\n","/**\n * The column count for a grid of `count` equal tiles in `width` pixels, chosen so the last row is\n * never left with a lone orphan: of the counts that fit (each column at least `minTile` wide),\n * take the one that leaves the fewest empty cells in the last row, preferring more columns on a\n * tie (never fewer than two columns when two fit). Four tiles resolve to 2x2 where three would fit\n * and 4 across when there is room for four; six resolve to 3x2.\n */\nexport function balancedColumns(count: number, width: number, minTile = 200, gap = 12): number {\n if (count <= 1) return 1\n const fit = Math.max(1, Math.min(count, Math.floor((width + gap) / (minTile + gap))))\n if (fit < 2) return 1\n let best = 2\n let bestEmpty = Number.POSITIVE_INFINITY\n for (let columns = 2; columns <= fit; columns++) {\n const empty = (columns - (count % columns)) % columns\n if (empty < bestEmpty || (empty === bestEmpty && columns > best)) {\n best = columns\n bestEmpty = empty\n }\n }\n return best\n}\n","import { useEffect, useRef, useState, type ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\nimport { balancedColumns } from '../lib/balanced-columns'\nimport { observeResize } from '../lib/observe-resize'\nimport { SectionLabel } from './sections'\n\n/** One \"start something\" tile: an AI-driven action, one click from underway. */\nexport interface StartTile {\n id: string\n /** A Lucide glyph; `iconNode` wins when both are given. */\n icon?: LucideIcon\n /** A ready-made mark (host icon maps), wearing the same AI ink. */\n iconNode?: ReactNode\n title: string\n description: string\n onSelect: () => void\n /** Real link target (ctrl-click / new tab, in-SPA through the host environment's `linkComponent`). `onSelect` still fires on a plain click. */\n href?: string\n /** Rendered non-interactive and dimmed; `disabledReason` replaces the description. */\n disabled?: boolean\n disabledReason?: string\n testId?: string\n}\n\nexport interface StartTilesProps {\n items: StartTile[]\n /** Optional band label above the tiles (\"Start\"). */\n caption?: string\n captionTestId?: string\n className?: string\n testId?: string\n}\n\n/**\n * A band of tonal action tiles. The glyph wears the AI ink, because these are\n * the AI-driven starts. Nothing is hover-only: tiles are always rendered, hover\n * only nudges tone, and touch targets are at least 44px.\n */\nexport function StartTiles({ items, caption, captionTestId, className, testId }: StartTilesProps) {\n // The tiles reflow by their own container width (a docked tablet sidebar narrows it without\n // changing the viewport), choosing a column count that never leaves one tile alone on a row.\n const gridRef = useRef<HTMLDivElement>(null)\n const [columns, setColumns] = useState<number | null>(null)\n const count = items.length\n useEffect(() => {\n const grid = gridRef.current\n if (!grid || count === 0) return\n const measure = () => setColumns(balancedColumns(count, grid.clientWidth))\n measure()\n return observeResize(grid, measure)\n }, [count])\n\n if (count === 0) return null\n return (\n <section\n className={cn('flex flex-col gap-3', className)}\n data-slot=\"start-tiles\"\n data-testid={testId}\n >\n {caption && <SectionLabel testId={captionTestId}>{caption}</SectionLabel>}\n <div\n ref={gridRef}\n data-slot=\"start-tiles-grid\"\n data-columns={columns ?? undefined}\n className=\"grid gap-3\"\n style={{\n gridTemplateColumns:\n columns === null\n ? 'repeat(auto-fit, minmax(200px, 1fr))'\n : `repeat(${columns}, minmax(0, 1fr))`,\n }}\n >\n {items.map((item) => {\n const Icon = item.icon\n return (\n <ActionLink\n key={item.id}\n href={item.href}\n onSelect={item.onSelect}\n disabled={item.disabled}\n title={item.disabled ? item.disabledReason : undefined}\n className={cn(\n 'flex h-full flex-col items-start gap-3 rounded-lg p-4 text-left',\n 'border border-border bg-card shadow-xs transition-colors hover:border-ring/50 hover:bg-accent/40',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n 'disabled:cursor-default disabled:opacity-55 disabled:hover:bg-card disabled:hover:border-border',\n 'pointer-coarse:min-h-11'\n )}\n data-slot=\"start-tile\"\n data-testid={item.testId}\n >\n {item.iconNode ? (\n <span className=\"shrink-0 text-ai-ink [&>svg]:size-5\" aria-hidden=\"true\">\n {item.iconNode}\n </span>\n ) : (\n Icon && <Icon className=\"size-5 shrink-0 text-ai-ink\" aria-hidden=\"true\" />\n )}\n <span className=\"min-w-0\">\n <span className=\"block text-sm font-semibold text-foreground\">{item.title}</span>\n <span className=\"mt-1 block text-sm leading-snug text-muted-foreground\">\n {item.disabled && item.disabledReason ? item.disabledReason : item.description}\n </span>\n </span>\n </ActionLink>\n )\n })}\n </div>\n </section>\n )\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var chunkB6MVQCXW_cjs = require('./chunk-B6MVQCXW.cjs');
|
|
5
4
|
var chunkAHDJXIUB_cjs = require('./chunk-AHDJXIUB.cjs');
|
|
6
|
-
var chunkFX3K6LNZ_cjs = require('./chunk-FX3K6LNZ.cjs');
|
|
7
5
|
var chunkG2BKHCI2_cjs = require('./chunk-G2BKHCI2.cjs');
|
|
6
|
+
var chunkB6MVQCXW_cjs = require('./chunk-B6MVQCXW.cjs');
|
|
7
|
+
var chunkFX3K6LNZ_cjs = require('./chunk-FX3K6LNZ.cjs');
|
|
8
8
|
var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
|
|
9
9
|
var react = require('react');
|
|
10
10
|
var ui = require('@arbidocs/react/ui');
|
|
@@ -1317,5 +1317,5 @@ exports.useSidebarController = useSidebarController;
|
|
|
1317
1317
|
exports.useSidebarSettle = useSidebarSettle;
|
|
1318
1318
|
exports.workspaceKindColor = workspaceKindColor;
|
|
1319
1319
|
exports.workspaceKindMeta = workspaceKindMeta;
|
|
1320
|
-
//# sourceMappingURL=chunk-
|
|
1321
|
-
//# sourceMappingURL=chunk-
|
|
1320
|
+
//# sourceMappingURL=chunk-HNEOW7F3.cjs.map
|
|
1321
|
+
//# sourceMappingURL=chunk-HNEOW7F3.cjs.map
|