@arbidocs/blocks 0.5.199 → 0.5.200
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-O5SAYRUM.cjs → ConnectedCallDock-UCNWTCTS.cjs} +22 -22
- package/dist/{ConnectedCallDock-O5SAYRUM.cjs.map → ConnectedCallDock-UCNWTCTS.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-Q4CEF2XK.cjs → ConnectedCallRoom-BN2EMZ7A.cjs} +15 -15
- package/dist/{ConnectedCallRoom-Q4CEF2XK.cjs.map → ConnectedCallRoom-BN2EMZ7A.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-FDBAVRFO.cjs → ConnectedNativeDocxComparison-4DTDQQXI.cjs} +15 -15
- package/dist/{ConnectedNativeDocxComparison-FDBAVRFO.cjs.map → ConnectedNativeDocxComparison-4DTDQQXI.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-VGWCLJKM.cjs → ConnectedPresentation-OIMVGUAZ.cjs} +17 -17
- package/dist/{ConnectedPresentation-VGWCLJKM.cjs.map → ConnectedPresentation-OIMVGUAZ.cjs.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-R7FVJ4X7.cjs → ConnectedProductionSetDialog-ENRCLFAF.cjs} +6 -6
- package/dist/{ConnectedProductionSetDialog-R7FVJ4X7.cjs.map → ConnectedProductionSetDialog-ENRCLFAF.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-PCJTMD3W.cjs → ConnectedSlidesTab-NSNOGSE7.cjs} +14 -14
- package/dist/{ConnectedSlidesTab-PCJTMD3W.cjs.map → ConnectedSlidesTab-NSNOGSE7.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-JET44WCX.cjs → ConnectedStreamedWordArtifact-FHEHPYUO.cjs} +15 -15
- package/dist/{ConnectedStreamedWordArtifact-JET44WCX.cjs.map → ConnectedStreamedWordArtifact-FHEHPYUO.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-CJHMIMSM.cjs → DocumentReviewCard-XCEFFM2E.cjs} +16 -16
- package/dist/{DocumentReviewCard-CJHMIMSM.cjs.map → DocumentReviewCard-XCEFFM2E.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-TKENBLEE.cjs → FilesViewerDialog-J4XHAODW.cjs} +51 -51
- package/dist/{FilesViewerDialog-TKENBLEE.cjs.map → FilesViewerDialog-J4XHAODW.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-XK7L4MU6.cjs → WorkspaceTableView-DIM3XSI7.cjs} +9 -9
- package/dist/{WorkspaceTableView-XK7L4MU6.cjs.map → WorkspaceTableView-DIM3XSI7.cjs.map} +1 -1
- package/dist/agents/index.cjs +366 -350
- package/dist/agents/tasks/TaskComposer.js +4 -3
- package/dist/agents/tasks/TaskComposer.js.map +2 -2
- package/dist/agents/tasks/WorkflowComposer.d.ts +1 -1
- package/dist/agents/tasks/WorkflowComposer.js +5 -4
- package/dist/agents/tasks/WorkflowComposer.js.map +2 -2
- package/dist/agents/tasks/index.d.ts +1 -1
- package/dist/agents/tasks/index.js +9 -1
- package/dist/agents/tasks/index.js.map +2 -2
- package/dist/agents/tasks/taskComposerTypes.d.ts +20 -3
- package/dist/agents/tasks/taskComposerTypes.js +25 -4
- package/dist/agents/tasks/taskComposerTypes.js.map +2 -2
- package/dist/agents/tasks/taskRequest.d.ts +5 -4
- package/dist/agents/tasks/taskRequest.js +9 -2
- package/dist/agents/tasks/taskRequest.js.map +2 -2
- package/dist/agents/workflows/planSteps.js +6 -3
- package/dist/agents/workflows/planSteps.js.map +2 -2
- package/dist/{ai-6PPZ35T6.cjs → ai-BUYAHCUP.cjs} +33 -33
- package/dist/ai-BUYAHCUP.cjs.map +1 -0
- package/dist/auth/index.cjs +12 -12
- package/dist/calls/index.cjs +125 -125
- package/dist/chat/index.cjs +6 -6
- package/dist/{chunk-V4362YKU.cjs → chunk-2A3LUSU6.cjs} +4 -4
- package/dist/{chunk-V4362YKU.cjs.map → chunk-2A3LUSU6.cjs.map} +1 -1
- package/dist/{chunk-RIGCKOUY.cjs → chunk-2GSNYENP.cjs} +4 -4
- package/dist/{chunk-RIGCKOUY.cjs.map → chunk-2GSNYENP.cjs.map} +1 -1
- package/dist/{chunk-QFSFTO7I.cjs → chunk-2NAYUIT4.cjs} +153 -4
- package/dist/chunk-2NAYUIT4.cjs.map +1 -0
- package/dist/{chunk-XJAOAAN6.cjs → chunk-33DJDPVL.cjs} +4 -4
- package/dist/{chunk-XJAOAAN6.cjs.map → chunk-33DJDPVL.cjs.map} +1 -1
- package/dist/{chunk-PGJJTERG.cjs → chunk-3IYVFQO7.cjs} +116 -79
- package/dist/chunk-3IYVFQO7.cjs.map +1 -0
- package/dist/{chunk-5OD6DRG7.cjs → chunk-3P6KGC46.cjs} +3 -3
- package/dist/{chunk-5OD6DRG7.cjs.map → chunk-3P6KGC46.cjs.map} +1 -1
- package/dist/{chunk-ZMGPE43A.cjs → chunk-3V7IAS52.cjs} +6 -6
- package/dist/{chunk-ZMGPE43A.cjs.map → chunk-3V7IAS52.cjs.map} +1 -1
- package/dist/{chunk-5KQBS4RS.cjs → chunk-4IDPBMZQ.cjs} +8 -8
- package/dist/{chunk-5KQBS4RS.cjs.map → chunk-4IDPBMZQ.cjs.map} +1 -1
- package/dist/{chunk-T44BYZNJ.cjs → chunk-4SPLVRCR.cjs} +3 -3
- package/dist/{chunk-T44BYZNJ.cjs.map → chunk-4SPLVRCR.cjs.map} +1 -1
- package/dist/{chunk-PIM7D4BJ.cjs → chunk-55DGUHLE.cjs} +4 -4
- package/dist/{chunk-PIM7D4BJ.cjs.map → chunk-55DGUHLE.cjs.map} +1 -1
- package/dist/{chunk-QPSLGOIH.cjs → chunk-ADICO4AG.cjs} +4 -4
- package/dist/{chunk-QPSLGOIH.cjs.map → chunk-ADICO4AG.cjs.map} +1 -1
- package/dist/{chunk-BDKAB2ND.cjs → chunk-AJUCQ3A4.cjs} +18 -18
- package/dist/{chunk-BDKAB2ND.cjs.map → chunk-AJUCQ3A4.cjs.map} +1 -1
- package/dist/{chunk-UO2IJNYC.cjs → chunk-BLVSAXZR.cjs} +9 -9
- package/dist/{chunk-UO2IJNYC.cjs.map → chunk-BLVSAXZR.cjs.map} +1 -1
- package/dist/{chunk-5ISSFIVO.cjs → chunk-CFOI2FTZ.cjs} +5 -5
- package/dist/{chunk-5ISSFIVO.cjs.map → chunk-CFOI2FTZ.cjs.map} +1 -1
- package/dist/{chunk-YKEI4XPI.cjs → chunk-CVJNHZHK.cjs} +25 -25
- package/dist/{chunk-YKEI4XPI.cjs.map → chunk-CVJNHZHK.cjs.map} +1 -1
- package/dist/{chunk-2FB2TP2R.cjs → chunk-D2EU67W3.cjs} +23 -23
- package/dist/{chunk-2FB2TP2R.cjs.map → chunk-D2EU67W3.cjs.map} +1 -1
- package/dist/{chunk-PFWIWVSP.cjs → chunk-EUY4G2EF.cjs} +54 -54
- package/dist/{chunk-PFWIWVSP.cjs.map → chunk-EUY4G2EF.cjs.map} +1 -1
- package/dist/{chunk-S4P52VEF.cjs → chunk-FQ365MON.cjs} +9 -6
- package/dist/chunk-FQ365MON.cjs.map +1 -0
- package/dist/{chunk-DEL7BS25.cjs → chunk-IPVRLNOP.cjs} +37 -37
- package/dist/{chunk-DEL7BS25.cjs.map → chunk-IPVRLNOP.cjs.map} +1 -1
- package/dist/{chunk-SZF4CR4O.cjs → chunk-IVZNTOHU.cjs} +6 -6
- package/dist/{chunk-SZF4CR4O.cjs.map → chunk-IVZNTOHU.cjs.map} +1 -1
- package/dist/{chunk-XE3PKEBU.cjs → chunk-J4DOSC7N.cjs} +3 -3
- package/dist/{chunk-XE3PKEBU.cjs.map → chunk-J4DOSC7N.cjs.map} +1 -1
- package/dist/{chunk-DBZMO33L.cjs → chunk-JZH7TTW7.cjs} +4 -4
- package/dist/{chunk-DBZMO33L.cjs.map → chunk-JZH7TTW7.cjs.map} +1 -1
- package/dist/{chunk-ZGT6M5C5.cjs → chunk-KE7VBTGB.cjs} +6 -6
- package/dist/{chunk-ZGT6M5C5.cjs.map → chunk-KE7VBTGB.cjs.map} +1 -1
- package/dist/{chunk-SOVYCUML.cjs → chunk-KU5QWNN7.cjs} +10 -10
- package/dist/{chunk-SOVYCUML.cjs.map → chunk-KU5QWNN7.cjs.map} +1 -1
- package/dist/{chunk-XKKY2RF2.cjs → chunk-LBQKFWTB.cjs} +3 -3
- package/dist/{chunk-XKKY2RF2.cjs.map → chunk-LBQKFWTB.cjs.map} +1 -1
- package/dist/{chunk-G7JESVKJ.cjs → chunk-LF5OBP36.cjs} +28 -31
- package/dist/chunk-LF5OBP36.cjs.map +1 -0
- package/dist/{chunk-QTNIFFBJ.cjs → chunk-N53CRS65.cjs} +3 -3
- package/dist/{chunk-QTNIFFBJ.cjs.map → chunk-N53CRS65.cjs.map} +1 -1
- package/dist/{chunk-KD37PODE.cjs → chunk-NEOJMU7F.cjs} +3 -3
- package/dist/{chunk-KD37PODE.cjs.map → chunk-NEOJMU7F.cjs.map} +1 -1
- package/dist/{chunk-SAQ7ZAMK.cjs → chunk-O5QHQ5ML.cjs} +14 -14
- package/dist/{chunk-SAQ7ZAMK.cjs.map → chunk-O5QHQ5ML.cjs.map} +1 -1
- package/dist/{chunk-SI3YRTW4.cjs → chunk-O66HB7KI.cjs} +6 -6
- package/dist/{chunk-SI3YRTW4.cjs.map → chunk-O66HB7KI.cjs.map} +1 -1
- package/dist/{chunk-75UNBJVM.cjs → chunk-OA76PXL7.cjs} +10 -10
- package/dist/{chunk-75UNBJVM.cjs.map → chunk-OA76PXL7.cjs.map} +1 -1
- package/dist/{chunk-R6HGMPF4.cjs → chunk-OQODCEEH.cjs} +9 -9
- package/dist/{chunk-R6HGMPF4.cjs.map → chunk-OQODCEEH.cjs.map} +1 -1
- package/dist/{chunk-XCQDQSZL.cjs → chunk-PCOXZATI.cjs} +7 -3
- package/dist/chunk-PCOXZATI.cjs.map +1 -0
- package/dist/{chunk-CV2YOGBW.cjs → chunk-PHNHOJ7N.cjs} +28 -28
- package/dist/{chunk-CV2YOGBW.cjs.map → chunk-PHNHOJ7N.cjs.map} +1 -1
- package/dist/{chunk-WRYNJNC6.cjs → chunk-PNPZBRDE.cjs} +4 -4
- package/dist/{chunk-WRYNJNC6.cjs.map → chunk-PNPZBRDE.cjs.map} +1 -1
- package/dist/{chunk-AX26HWDZ.cjs → chunk-PSQGJPC3.cjs} +10 -10
- package/dist/{chunk-AX26HWDZ.cjs.map → chunk-PSQGJPC3.cjs.map} +1 -1
- package/dist/{chunk-7OTRT6EV.cjs → chunk-Q4DQR5HP.cjs} +80 -205
- package/dist/chunk-Q4DQR5HP.cjs.map +1 -0
- package/dist/{chunk-TZQJ3HI6.cjs → chunk-SDCJV5I3.cjs} +75 -75
- package/dist/{chunk-TZQJ3HI6.cjs.map → chunk-SDCJV5I3.cjs.map} +1 -1
- package/dist/{chunk-ZINJWTUD.cjs → chunk-T2IEHV75.cjs} +4 -4
- package/dist/{chunk-ZINJWTUD.cjs.map → chunk-T2IEHV75.cjs.map} +1 -1
- package/dist/{chunk-KLEH67QD.cjs → chunk-TPTCTNDE.cjs} +48 -48
- package/dist/{chunk-KLEH67QD.cjs.map → chunk-TPTCTNDE.cjs.map} +1 -1
- package/dist/{chunk-H7S4DVSM.cjs → chunk-USFM2L6T.cjs} +4 -4
- package/dist/{chunk-H7S4DVSM.cjs.map → chunk-USFM2L6T.cjs.map} +1 -1
- package/dist/{chunk-T6KYE3TR.cjs → chunk-WWIWW7IH.cjs} +3 -3
- package/dist/{chunk-T6KYE3TR.cjs.map → chunk-WWIWW7IH.cjs.map} +1 -1
- package/dist/{chunk-QSY2VW7V.cjs → chunk-WXRAU2FF.cjs} +6 -6
- package/dist/{chunk-QSY2VW7V.cjs.map → chunk-WXRAU2FF.cjs.map} +1 -1
- package/dist/{chunk-HUAABZ2C.cjs → chunk-X6EG33C7.cjs} +3 -3
- package/dist/{chunk-HUAABZ2C.cjs.map → chunk-X6EG33C7.cjs.map} +1 -1
- package/dist/{chunk-NZBPVCQ5.cjs → chunk-XW2PSBGE.cjs} +11 -11
- package/dist/{chunk-NZBPVCQ5.cjs.map → chunk-XW2PSBGE.cjs.map} +1 -1
- package/dist/{chunk-3HBSKI7W.cjs → chunk-YJN3JWDZ.cjs} +9 -9
- package/dist/{chunk-3HBSKI7W.cjs.map → chunk-YJN3JWDZ.cjs.map} +1 -1
- package/dist/connect/docx.cjs +18 -18
- package/dist/connect/index.cjs +1223 -1223
- package/dist/connect/viewer.cjs +38 -38
- package/dist/connection/ConnectedWorkflowBuilder.js +8 -9
- package/dist/connection/ConnectedWorkflowBuilder.js.map +2 -2
- package/dist/connection/tasks/ConnectedTaskComposer.js +57 -18
- package/dist/connection/tasks/ConnectedTaskComposer.js.map +2 -2
- package/dist/connection/workflows/useWorkflowTasks.js +14 -17
- package/dist/connection/workflows/useWorkflowTasks.js.map +2 -2
- package/dist/connection/workflows/useWorkflowsPageState.d.ts +6 -0
- package/dist/dashboards/index.cjs +1 -1
- package/dist/databases/index.cjs +71 -71
- package/dist/document-tools/FileShareDialog.js +5 -1
- package/dist/document-tools/FileShareDialog.js.map +2 -2
- package/dist/document-tools/index.cjs +13 -13
- package/dist/document-tools/viewer/SignatureRequestEditor.js +2 -1
- package/dist/document-tools/viewer/SignatureRequestEditor.js.map +2 -2
- package/dist/document-tools/viewer/index.cjs +2 -1
- package/dist/document-tools/viewer/index.cjs.map +1 -1
- package/dist/embed/index.cjs +44 -44
- package/dist/facts/index.cjs +8 -8
- package/dist/files/index.cjs +221 -221
- package/dist/home/index.cjs +9 -9
- package/dist/index.cjs +1826 -1810
- package/dist/pages/index.cjs +35 -35
- package/dist/settings/index.cjs +135 -135
- package/dist/shell/index.cjs +81 -81
- package/dist/studio/index.cjs +35 -35
- package/dist/workflow-canvas/TriggerInspector.d.ts +1 -1
- package/dist/workflow-canvas/TriggerInspector.js +4 -3
- package/dist/workflow-canvas/TriggerInspector.js.map +2 -2
- package/dist/workflow-canvas/index.cjs +84 -82
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/trigger.d.ts +3 -2
- package/dist/workflow-canvas/trigger.js +10 -2
- package/dist/workflow-canvas/trigger.js.map +2 -2
- package/dist/workspaces/index.cjs +5 -5
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ai-6PPZ35T6.cjs.map +0 -1
- package/dist/chunk-7OTRT6EV.cjs.map +0 -1
- package/dist/chunk-G7JESVKJ.cjs.map +0 -1
- package/dist/chunk-PGJJTERG.cjs.map +0 -1
- package/dist/chunk-QFSFTO7I.cjs.map +0 -1
- package/dist/chunk-S4P52VEF.cjs.map +0 -1
- package/dist/chunk-XCQDQSZL.cjs.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { workflows as workflowOps } from "@arbidocs/sdk/browser";
|
|
2
3
|
import {
|
|
4
|
+
useAuthorizeWorkflow,
|
|
3
5
|
useCreateWorkflow,
|
|
4
|
-
useGrantAgentAccess,
|
|
5
6
|
useRunWorkflow,
|
|
6
7
|
useUpdateWorkflow,
|
|
7
8
|
useDocuments,
|
|
@@ -27,13 +28,16 @@ function useWorkflowTasks() {
|
|
|
27
28
|
const activeWorkspaceId = useArbiSessionState((s) => s.workspaceId);
|
|
28
29
|
const createWork = useCreateWork({ workspaceId: activeWorkspaceId });
|
|
29
30
|
const { openFiles } = useBlocksEnvironment();
|
|
30
|
-
const { mutateAsync:
|
|
31
|
-
const
|
|
32
|
-
(
|
|
31
|
+
const { mutateAsync: authorize } = useAuthorizeWorkflow();
|
|
32
|
+
const ensureAuthorized = useCallback(
|
|
33
|
+
(workflow) => workflowOps.needsAuthorization(workflow) && workflow.is_owner !== false ? authorize({
|
|
34
|
+
workflowId: workflow.external_id,
|
|
35
|
+
accessSeconds: workflow.access_seconds ?? void 0
|
|
36
|
+
}).then(
|
|
33
37
|
() => void 0,
|
|
34
38
|
() => void 0
|
|
35
|
-
),
|
|
36
|
-
[
|
|
39
|
+
) : Promise.resolve(),
|
|
40
|
+
[authorize]
|
|
37
41
|
);
|
|
38
42
|
const { data: documents = [] } = useDocuments();
|
|
39
43
|
const documentTitles = useMemo(
|
|
@@ -49,10 +53,7 @@ function useWorkflowTasks() {
|
|
|
49
53
|
);
|
|
50
54
|
if (request.kind === "workflow") {
|
|
51
55
|
const workflow = await createWorkflow.mutateAsync(request.body);
|
|
52
|
-
|
|
53
|
-
if (workflow.auth_mode === "scheduled_permanent" && !workflow.on_demand && workflow.agent_ext_id && workspaceId) {
|
|
54
|
-
await grantAgentAccess(workflow.agent_ext_id, workspaceId);
|
|
55
|
-
}
|
|
56
|
+
await ensureAuthorized(workflow);
|
|
56
57
|
if (ctx.workflow.documentAction && ctx.values.when === "now" && !forceWorkflow) {
|
|
57
58
|
const result = await runWorkflow.mutateAsync(workflow.external_id);
|
|
58
59
|
if (result.error) throw new Error(result.error);
|
|
@@ -76,7 +77,7 @@ function useWorkflowTasks() {
|
|
|
76
77
|
createWork,
|
|
77
78
|
createWorkflow,
|
|
78
79
|
documentTitles,
|
|
79
|
-
|
|
80
|
+
ensureAuthorized,
|
|
80
81
|
startQuery,
|
|
81
82
|
runWorkflow,
|
|
82
83
|
openFiles
|
|
@@ -94,17 +95,13 @@ function useWorkflowTasks() {
|
|
|
94
95
|
async (workflow, ctx) => {
|
|
95
96
|
const patch = composerToWorkflowUpdate({ ...ctx, documentTitles, plan: ctx.plan ?? null });
|
|
96
97
|
if (workflow.is_owner === false) delete patch.shared;
|
|
97
|
-
const workspaceId = workflow.workspace_ext_id ?? activeWorkspaceId;
|
|
98
98
|
const updated = await updateWorkflowMutation.mutateAsync({
|
|
99
99
|
workflowId: workflow.external_id,
|
|
100
100
|
patch
|
|
101
101
|
});
|
|
102
|
-
|
|
103
|
-
if (updated.auth_mode === "scheduled_permanent" && !updated.on_demand && agentId && workspaceId) {
|
|
104
|
-
await grantAgentAccess(agentId, workspaceId);
|
|
105
|
-
}
|
|
102
|
+
await ensureAuthorized(updated);
|
|
106
103
|
},
|
|
107
|
-
[
|
|
104
|
+
[documentTitles, ensureAuthorized, updateWorkflowMutation]
|
|
108
105
|
);
|
|
109
106
|
return {
|
|
110
107
|
create,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/workflows/useWorkflowTasks.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Creating and updating work and workflows from the composer, in one place.\n *\n * \"Now\" is an assistant query with task options (the person's own run: the thread becomes a task); a plain\n * to-do creates work with no run. Any other start (a date, a repeat, an event, after another task) saves a workflow\n * that creates the work when it fires. The request mapping is shared with every host (and tested in\n * blocks): `taskComposerToCreateRequest` decides which.\n *\n * Workspace authorization is a per-run, least-privilege choice (`auth_mode`) composed over the shipped\n * workspace-access-request + grant machinery:\n * - Now -> no tier: the query runs as the person asking, with their own access.\n * - Workflow -> `scheduled_require_auth` by default (asks at run time), or `scheduled_permanent`\n * (\"keep access\"): standing membership so unattended runs can decrypt while the owner\n * is away. Only this tier grants membership.\n */\n\nimport {\n
|
|
5
|
-
"mappings": ";AAgBA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,wBAAwB;AAEjC,SAAS,aAAa,eAAe;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIP,SAAS,4BAA4B;AAiB9B,SAAS,mBAAmB;AACjC,QAAM,cAAc,eAAe;AACnC,QAAM,aAAa,kBAAkB;AACrC,QAAM,iBAAiB,kBAAkB;AACzC,QAAM,qBAAqB,sBAAsB;AACjD,QAAM,yBAAyB,kBAAkB;AACjD,QAAM,oBAAoB,oBAAoB,CAAC,MAAM,EAAE,WAAW;AAClE,QAAM,aAAa,cAAc,EAAE,aAAa,kBAAkB,CAAC;AACnE,QAAM,EAAE,UAAU,IAAI,qBAAqB;
|
|
4
|
+
"sourcesContent": ["/**\n * Creating and updating work and workflows from the composer, in one place.\n *\n * \"Now\" is an assistant query with task options (the person's own run: the thread becomes a task); a plain\n * to-do creates work with no run. Any other start (a date, a repeat, an event, after another task) saves a workflow\n * that creates the work when it fires. The request mapping is shared with every host (and tested in\n * blocks): `taskComposerToCreateRequest` decides which.\n *\n * Workspace authorization is a per-run, least-privilege choice (`auth_mode`) composed over the shipped\n * workspace-access-request + grant machinery:\n * - Now -> no tier: the query runs as the person asking, with their own access.\n * - Workflow -> `scheduled_require_auth` by default (asks at run time), or `scheduled_permanent`\n * (\"keep access\"): standing membership so unattended runs can decrypt while the owner\n * is away. Only this tier grants membership.\n */\n\nimport { workflows as workflowOps } from '@arbidocs/sdk/browser'\nimport {\n useAuthorizeWorkflow,\n useCreateWorkflow,\n useRunWorkflow,\n useUpdateWorkflow,\n useDocuments,\n useArbiSessionState,\n useCreateWork,\n useStartTaskQuery,\n useUpdateConversation,\n} from '@arbidocs/react'\nimport { getDocumentTitle } from '@arbidocs/react/ui'\nimport type { components } from '@arbidocs/client'\nimport { useCallback, useMemo } from 'react'\nimport {\n composerToWorkflowUpdate,\n taskComposerToCreateRequest,\n taskComposerToUpdateRequest,\n} from '../../agents/tasks/taskRequest'\nimport { type TaskComposerValues } from '../../agents/tasks/taskComposerTypes'\nimport { type WorkflowDefinition } from '../../agents/workflows/types'\nimport type { TaskPlan } from '../../agents/workflows/planSteps'\nimport { useBlocksEnvironment } from '../../provider/environment'\n\ntype Task = components['schemas']['ConversationResponse']\ntype Workflow = components['schemas']['WorkflowResponse']\n\nexport interface TaskSubmitContext {\n workflow: WorkflowDefinition\n values: TaskComposerValues\n /** Goal checklist for agent work, if one was drafted. */\n plan?: TaskPlan | null\n}\n\n/** What a composer submission created. `ran` is null for work no agent runs. */\nexport type CreateOutcome =\n | { kind: 'work'; task: Pick<Task, 'title'> & { external_id?: string }; ran: boolean | null }\n | { kind: 'workflow'; workflow: Workflow }\n\nexport function useWorkflowTasks() {\n const runWorkflow = useRunWorkflow()\n const startQuery = useStartTaskQuery()\n const createWorkflow = useCreateWorkflow()\n const updateConversation = useUpdateConversation()\n const updateWorkflowMutation = useUpdateWorkflow()\n const activeWorkspaceId = useArbiSessionState((s) => s.workspaceId)\n const createWork = useCreateWork({ workspaceId: activeWorkspaceId })\n const { openFiles } = useBlocksEnvironment()\n\n // A timed workflow its owner saves with the workspace open is authorized by the server as it saves. One saved\n // without the key on the session (or by someone else) is not: authorize it now, while the owner is here. A\n // refusal is no failure of the save: its unattended runs then ask the owner, as for an expired authorization.\n const { mutateAsync: authorize } = useAuthorizeWorkflow()\n const ensureAuthorized = useCallback(\n (workflow: Workflow) =>\n workflowOps.needsAuthorization(workflow) && workflow.is_owner !== false\n ? authorize({\n workflowId: workflow.external_id,\n accessSeconds: workflow.access_seconds ?? undefined,\n }).then(\n () => undefined,\n () => undefined\n )\n : Promise.resolve(),\n [authorize]\n )\n // File names for the prompt's wording (\"the document <name>\"): the server is told the ids as well.\n const { data: documents = [] } = useDocuments()\n const documentTitles = useMemo(\n () =>\n Object.fromEntries(documents.map((d) => [d.external_id, getDocumentTitle(d, d.external_id)])),\n [documents]\n )\n\n /**\n * Create work or a workflow. `forceWorkflow` is for the workflow dialog, where even a reminder is\n * saved as a workflow.\n */\n const create = useCallback(\n async (ctx: TaskSubmitContext, forceWorkflow = false): Promise<CreateOutcome> => {\n const request = taskComposerToCreateRequest(\n { ...ctx, documentTitles, plan: ctx.plan ?? null },\n activeWorkspaceId ?? undefined,\n forceWorkflow\n )\n if (request.kind === 'workflow') {\n const workflow = await createWorkflow.mutateAsync(request.body)\n await ensureAuthorized(workflow)\n if (ctx.workflow.documentAction && ctx.values.when === 'now' && !forceWorkflow) {\n const result = await runWorkflow.mutateAsync(workflow.external_id)\n if (result.error) throw new Error(result.error)\n openFiles()\n }\n return { kind: 'workflow', workflow }\n }\n if (request.kind === 'query') {\n // Run now is the person's own assistant query: it makes the thread a task and runs it.\n const { conversationId } = await startQuery.start(request.query)\n return {\n kind: 'work',\n task: { external_id: conversationId, title: request.query.task.title ?? null },\n ran: true,\n }\n }\n // A plain to-do (or reminder): a task with no run.\n const task = await createWork.mutateAsync(request.body)\n return { kind: 'work', task, ran: null }\n },\n [\n activeWorkspaceId,\n createWork,\n createWorkflow,\n documentTitles,\n ensureAuthorized,\n startQuery,\n runWorkflow,\n openFiles,\n ]\n )\n\n /** PATCH the editable fields of a task (the instruction, workspace and agent stay as created). */\n const update = useCallback(\n async (task: Pick<Task, 'external_id'> & { is_owner?: boolean }, ctx: TaskSubmitContext) => {\n const patch = taskComposerToUpdateRequest({ ...ctx, plan: ctx.plan ?? null })\n // Who can see a task is its owner's to change: an editor's save leaves it out.\n if (task.is_owner === false) delete patch.shared\n await updateConversation.mutateAsync({ conversationId: task.external_id, patch })\n },\n [updateConversation]\n )\n\n /** PATCH a workflow: its name, trigger and action. */\n const updateWorkflow = useCallback(\n async (\n workflow: Pick<Workflow, 'external_id' | 'agent_ext_id' | 'workspace_ext_id'> & {\n is_owner?: boolean\n },\n ctx: TaskSubmitContext\n ) => {\n const patch = composerToWorkflowUpdate({ ...ctx, documentTitles, plan: ctx.plan ?? null })\n // Sharing a workflow is its owner's: an editor's save leaves it out.\n if (workflow.is_owner === false) delete patch.shared\n const updated = await updateWorkflowMutation.mutateAsync({\n workflowId: workflow.external_id,\n patch,\n })\n // Changing what it does ends its authorization: the owner saving it authorizes the new version.\n await ensureAuthorized(updated)\n },\n [documentTitles, ensureAuthorized, updateWorkflowMutation]\n )\n\n return {\n create,\n update,\n updateWorkflow,\n isPending:\n createWork.isPending ||\n startQuery.isPending ||\n createWorkflow.isPending ||\n updateConversation.isPending ||\n updateWorkflowMutation.isPending,\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAgBA,SAAS,aAAa,mBAAmB;AACzC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAA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MAAM,uBAAuB,YAAY;AAAA,QACvD,YAAY,SAAS;AAAA,QACrB;AAAA,MACF,CAAC;AAED,YAAM,iBAAiB,OAAO;AAAA,IAChC;AAAA,IACA,CAAC,gBAAgB,kBAAkB,sBAAsB;AAAA,EAC3D;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,WACE,WAAW,aACX,WAAW,aACX,eAAe,aACf,mBAAmB,aACnB,uBAAuB;AAAA,EAC3B;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -45,6 +45,8 @@ export declare function useWorkflowsPageState({ initialBuilder, historyWorkflowI
|
|
|
45
45
|
plan?: import("@arbidocs/client").components["schemas"]["TaskPlan"] | null;
|
|
46
46
|
agent_ext_id?: string | null;
|
|
47
47
|
auth_mode: import("@arbidocs/client").components["schemas"]["src__models__workflow__AuthMode"];
|
|
48
|
+
access_seconds?: number | null;
|
|
49
|
+
access_expires_at?: string | null;
|
|
48
50
|
fact_ext_id?: string | null;
|
|
49
51
|
source_workflow_ext_id?: string | null;
|
|
50
52
|
last_fired_at?: string | null;
|
|
@@ -86,6 +88,8 @@ export declare function useWorkflowsPageState({ initialBuilder, historyWorkflowI
|
|
|
86
88
|
plan?: import("@arbidocs/client").components["schemas"]["TaskPlan"] | null;
|
|
87
89
|
agent_ext_id?: string | null;
|
|
88
90
|
auth_mode: import("@arbidocs/client").components["schemas"]["src__models__workflow__AuthMode"];
|
|
91
|
+
access_seconds?: number | null;
|
|
92
|
+
access_expires_at?: string | null;
|
|
89
93
|
fact_ext_id?: string | null;
|
|
90
94
|
source_workflow_ext_id?: string | null;
|
|
91
95
|
last_fired_at?: string | null;
|
|
@@ -122,6 +126,8 @@ export declare function useWorkflowsPageState({ initialBuilder, historyWorkflowI
|
|
|
122
126
|
plan?: import("@arbidocs/client").components["schemas"]["TaskPlan"] | null;
|
|
123
127
|
agent_ext_id?: string | null;
|
|
124
128
|
auth_mode: import("@arbidocs/client").components["schemas"]["src__models__workflow__AuthMode"];
|
|
129
|
+
access_seconds?: number | null;
|
|
130
|
+
access_expires_at?: string | null;
|
|
125
131
|
fact_ext_id?: string | null;
|
|
126
132
|
source_workflow_ext_id?: string | null;
|
|
127
133
|
last_fired_at?: string | null;
|
|
@@ -11,8 +11,8 @@ require('../chunk-67HUC56R.cjs');
|
|
|
11
11
|
var chunkZU2B2RZK_cjs = require('../chunk-ZU2B2RZK.cjs');
|
|
12
12
|
var chunkOEJQFPWO_cjs = require('../chunk-OEJQFPWO.cjs');
|
|
13
13
|
require('../chunk-FEM56BGP.cjs');
|
|
14
|
-
require('../chunk-IPSHAMO2.cjs');
|
|
15
14
|
require('../chunk-ZW6FPIFC.cjs');
|
|
15
|
+
require('../chunk-IPSHAMO2.cjs');
|
|
16
16
|
require('../chunk-UCMUGS6F.cjs');
|
|
17
17
|
require('../chunk-VJKUADA3.cjs');
|
|
18
18
|
require('../chunk-NAVFMFWM.cjs');
|
package/dist/databases/index.cjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
4
|
+
var chunkOQODCEEH_cjs = require('../chunk-OQODCEEH.cjs');
|
|
5
|
+
require('../chunk-X6EG33C7.cjs');
|
|
6
6
|
require('../chunk-GISMY7J7.cjs');
|
|
7
|
+
require('../chunk-QUMUAJ2P.cjs');
|
|
7
8
|
require('../chunk-V5P5MRSR.cjs');
|
|
8
9
|
require('../chunk-SNUBQMIS.cjs');
|
|
9
10
|
require('../chunk-LIJB6XOR.cjs');
|
|
@@ -11,7 +12,6 @@ require('../chunk-U46OGRCO.cjs');
|
|
|
11
12
|
require('../chunk-66IOCKWS.cjs');
|
|
12
13
|
require('../chunk-6UZC4XVV.cjs');
|
|
13
14
|
require('../chunk-ZVEW3JBT.cjs');
|
|
14
|
-
require('../chunk-QUMUAJ2P.cjs');
|
|
15
15
|
require('../chunk-VZOOGA47.cjs');
|
|
16
16
|
require('../chunk-PPCATBOY.cjs');
|
|
17
17
|
require('../chunk-PLIF5CUV.cjs');
|
|
@@ -20,275 +20,275 @@ require('../chunk-PLIF5CUV.cjs');
|
|
|
20
20
|
|
|
21
21
|
Object.defineProperty(exports, "ADD_COLUMN_COL_ID", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkOQODCEEH_cjs.ADD_COLUMN_COL_ID; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "CALENDAR_LAYOUT", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkOQODCEEH_cjs.CALENDAR_LAYOUT; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "COLUMN_TYPE_ICONS", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkOQODCEEH_cjs.COLUMN_TYPE_ICONS; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "COMPUTED_COLUMN_TYPES", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkOQODCEEH_cjs.COMPUTED_COLUMN_TYPES; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "DATABASE_COLUMN_TYPES", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkOQODCEEH_cjs.DATABASE_COLUMN_TYPES; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "DATABASE_ROLLUP_OPS", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkOQODCEEH_cjs.DATABASE_ROLLUP_OPS; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "DEFAULT_COLUMN_CONFIG_LABELS", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkOQODCEEH_cjs.DEFAULT_COLUMN_CONFIG_LABELS; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "DEFAULT_DATABASE_COLUMN_DIALOG_LABELS", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkOQODCEEH_cjs.DEFAULT_DATABASE_COLUMN_DIALOG_LABELS; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "DEFAULT_DATABASE_COLUMN_LABELS", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkOQODCEEH_cjs.DEFAULT_DATABASE_COLUMN_LABELS; }
|
|
56
56
|
});
|
|
57
57
|
Object.defineProperty(exports, "DEFAULT_DATABASE_COLUMN_TYPE_LABELS", {
|
|
58
58
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
59
|
+
get: function () { return chunkOQODCEEH_cjs.DEFAULT_DATABASE_COLUMN_TYPE_LABELS; }
|
|
60
60
|
});
|
|
61
61
|
Object.defineProperty(exports, "DEFAULT_DATABASE_FILTER_MENU_LABELS", {
|
|
62
62
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
63
|
+
get: function () { return chunkOQODCEEH_cjs.DEFAULT_DATABASE_FILTER_MENU_LABELS; }
|
|
64
64
|
});
|
|
65
65
|
Object.defineProperty(exports, "DEFAULT_DATABASE_LAYOUT_LABELS", {
|
|
66
66
|
enumerable: true,
|
|
67
|
-
get: function () { return
|
|
67
|
+
get: function () { return chunkOQODCEEH_cjs.DEFAULT_DATABASE_LAYOUT_LABELS; }
|
|
68
68
|
});
|
|
69
69
|
Object.defineProperty(exports, "DEFAULT_DATABASE_LIST_LABELS", {
|
|
70
70
|
enumerable: true,
|
|
71
|
-
get: function () { return
|
|
71
|
+
get: function () { return chunkOQODCEEH_cjs.DEFAULT_DATABASE_LIST_LABELS; }
|
|
72
72
|
});
|
|
73
73
|
Object.defineProperty(exports, "DEFAULT_DATABASE_ROW_DETAIL_LABELS", {
|
|
74
74
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
75
|
+
get: function () { return chunkOQODCEEH_cjs.DEFAULT_DATABASE_ROW_DETAIL_LABELS; }
|
|
76
76
|
});
|
|
77
77
|
Object.defineProperty(exports, "DEFAULT_DATABASE_TABLE_LABELS", {
|
|
78
78
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
79
|
+
get: function () { return chunkOQODCEEH_cjs.DEFAULT_DATABASE_TABLE_LABELS; }
|
|
80
80
|
});
|
|
81
81
|
Object.defineProperty(exports, "DEFAULT_DATABASE_TOOLBAR_LABELS", {
|
|
82
82
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
83
|
+
get: function () { return chunkOQODCEEH_cjs.DEFAULT_DATABASE_TOOLBAR_LABELS; }
|
|
84
84
|
});
|
|
85
85
|
Object.defineProperty(exports, "DEFAULT_NEW_DATABASE_DIALOG_LABELS", {
|
|
86
86
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
87
|
+
get: function () { return chunkOQODCEEH_cjs.DEFAULT_NEW_DATABASE_DIALOG_LABELS; }
|
|
88
88
|
});
|
|
89
89
|
Object.defineProperty(exports, "DEFAULT_PICK_CELL_EDITOR_LABELS", {
|
|
90
90
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
91
|
+
get: function () { return chunkOQODCEEH_cjs.DEFAULT_PICK_CELL_EDITOR_LABELS; }
|
|
92
92
|
});
|
|
93
93
|
Object.defineProperty(exports, "DatabaseCalendar", {
|
|
94
94
|
enumerable: true,
|
|
95
|
-
get: function () { return
|
|
95
|
+
get: function () { return chunkOQODCEEH_cjs.DatabaseCalendar; }
|
|
96
96
|
});
|
|
97
97
|
Object.defineProperty(exports, "DatabaseColumnDialog", {
|
|
98
98
|
enumerable: true,
|
|
99
|
-
get: function () { return
|
|
99
|
+
get: function () { return chunkOQODCEEH_cjs.DatabaseColumnDialog; }
|
|
100
100
|
});
|
|
101
101
|
Object.defineProperty(exports, "DatabaseFilterMenu", {
|
|
102
102
|
enumerable: true,
|
|
103
|
-
get: function () { return
|
|
103
|
+
get: function () { return chunkOQODCEEH_cjs.DatabaseFilterMenu; }
|
|
104
104
|
});
|
|
105
105
|
Object.defineProperty(exports, "DatabaseGantt", {
|
|
106
106
|
enumerable: true,
|
|
107
|
-
get: function () { return
|
|
107
|
+
get: function () { return chunkOQODCEEH_cjs.DatabaseGantt; }
|
|
108
108
|
});
|
|
109
109
|
Object.defineProperty(exports, "DatabaseLayoutSwitcher", {
|
|
110
110
|
enumerable: true,
|
|
111
|
-
get: function () { return
|
|
111
|
+
get: function () { return chunkOQODCEEH_cjs.DatabaseLayoutSwitcher; }
|
|
112
112
|
});
|
|
113
113
|
Object.defineProperty(exports, "DatabaseList", {
|
|
114
114
|
enumerable: true,
|
|
115
|
-
get: function () { return
|
|
115
|
+
get: function () { return chunkOQODCEEH_cjs.DatabaseList; }
|
|
116
116
|
});
|
|
117
117
|
Object.defineProperty(exports, "DatabaseRowDetail", {
|
|
118
118
|
enumerable: true,
|
|
119
|
-
get: function () { return
|
|
119
|
+
get: function () { return chunkOQODCEEH_cjs.DatabaseRowDetail; }
|
|
120
120
|
});
|
|
121
121
|
Object.defineProperty(exports, "DatabaseTable", {
|
|
122
122
|
enumerable: true,
|
|
123
|
-
get: function () { return
|
|
123
|
+
get: function () { return chunkOQODCEEH_cjs.DatabaseTable; }
|
|
124
124
|
});
|
|
125
125
|
Object.defineProperty(exports, "DatabaseToolbar", {
|
|
126
126
|
enumerable: true,
|
|
127
|
-
get: function () { return
|
|
127
|
+
get: function () { return chunkOQODCEEH_cjs.DatabaseToolbar; }
|
|
128
128
|
});
|
|
129
129
|
Object.defineProperty(exports, "DateSpanCellEditor", {
|
|
130
130
|
enumerable: true,
|
|
131
|
-
get: function () { return
|
|
131
|
+
get: function () { return chunkOQODCEEH_cjs.DateSpanCellEditor; }
|
|
132
132
|
});
|
|
133
133
|
Object.defineProperty(exports, "DateSpanField", {
|
|
134
134
|
enumerable: true,
|
|
135
|
-
get: function () { return
|
|
135
|
+
get: function () { return chunkOQODCEEH_cjs.DateSpanField; }
|
|
136
136
|
});
|
|
137
137
|
Object.defineProperty(exports, "GANTT_LAYOUT", {
|
|
138
138
|
enumerable: true,
|
|
139
|
-
get: function () { return
|
|
139
|
+
get: function () { return chunkOQODCEEH_cjs.GANTT_LAYOUT; }
|
|
140
140
|
});
|
|
141
141
|
Object.defineProperty(exports, "LINK_COLUMN_TYPES", {
|
|
142
142
|
enumerable: true,
|
|
143
|
-
get: function () { return
|
|
143
|
+
get: function () { return chunkOQODCEEH_cjs.LINK_COLUMN_TYPES; }
|
|
144
144
|
});
|
|
145
145
|
Object.defineProperty(exports, "LabelsCell", {
|
|
146
146
|
enumerable: true,
|
|
147
|
-
get: function () { return
|
|
147
|
+
get: function () { return chunkOQODCEEH_cjs.LabelsCell; }
|
|
148
148
|
});
|
|
149
149
|
Object.defineProperty(exports, "LabelsField", {
|
|
150
150
|
enumerable: true,
|
|
151
|
-
get: function () { return
|
|
151
|
+
get: function () { return chunkOQODCEEH_cjs.LabelsField; }
|
|
152
152
|
});
|
|
153
153
|
Object.defineProperty(exports, "LinkChip", {
|
|
154
154
|
enumerable: true,
|
|
155
|
-
get: function () { return
|
|
155
|
+
get: function () { return chunkOQODCEEH_cjs.LinkChip; }
|
|
156
156
|
});
|
|
157
157
|
Object.defineProperty(exports, "LinkChipsCell", {
|
|
158
158
|
enumerable: true,
|
|
159
|
-
get: function () { return
|
|
159
|
+
get: function () { return chunkOQODCEEH_cjs.LinkChipsCell; }
|
|
160
160
|
});
|
|
161
161
|
Object.defineProperty(exports, "LookupCell", {
|
|
162
162
|
enumerable: true,
|
|
163
|
-
get: function () { return
|
|
163
|
+
get: function () { return chunkOQODCEEH_cjs.LookupCell; }
|
|
164
164
|
});
|
|
165
165
|
Object.defineProperty(exports, "NewDatabaseDialog", {
|
|
166
166
|
enumerable: true,
|
|
167
|
-
get: function () { return
|
|
167
|
+
get: function () { return chunkOQODCEEH_cjs.NewDatabaseDialog; }
|
|
168
168
|
});
|
|
169
169
|
Object.defineProperty(exports, "OPEN_ROW_COL_ID", {
|
|
170
170
|
enumerable: true,
|
|
171
|
-
get: function () { return
|
|
171
|
+
get: function () { return chunkOQODCEEH_cjs.OPEN_ROW_COL_ID; }
|
|
172
172
|
});
|
|
173
173
|
Object.defineProperty(exports, "PersonCell", {
|
|
174
174
|
enumerable: true,
|
|
175
|
-
get: function () { return
|
|
175
|
+
get: function () { return chunkOQODCEEH_cjs.PersonCell; }
|
|
176
176
|
});
|
|
177
177
|
Object.defineProperty(exports, "PersonChip", {
|
|
178
178
|
enumerable: true,
|
|
179
|
-
get: function () { return
|
|
179
|
+
get: function () { return chunkOQODCEEH_cjs.PersonChip; }
|
|
180
180
|
});
|
|
181
181
|
Object.defineProperty(exports, "PickCellEditor", {
|
|
182
182
|
enumerable: true,
|
|
183
|
-
get: function () { return
|
|
183
|
+
get: function () { return chunkOQODCEEH_cjs.PickCellEditor; }
|
|
184
184
|
});
|
|
185
185
|
Object.defineProperty(exports, "ROW_ACTIONS_COL_ID", {
|
|
186
186
|
enumerable: true,
|
|
187
|
-
get: function () { return
|
|
187
|
+
get: function () { return chunkOQODCEEH_cjs.ROW_ACTIONS_COL_ID; }
|
|
188
188
|
});
|
|
189
189
|
Object.defineProperty(exports, "SelectCellEditor", {
|
|
190
190
|
enumerable: true,
|
|
191
|
-
get: function () { return
|
|
191
|
+
get: function () { return chunkOQODCEEH_cjs.SelectCellEditor; }
|
|
192
192
|
});
|
|
193
193
|
Object.defineProperty(exports, "SelectChip", {
|
|
194
194
|
enumerable: true,
|
|
195
|
-
get: function () { return
|
|
195
|
+
get: function () { return chunkOQODCEEH_cjs.SelectChip; }
|
|
196
196
|
});
|
|
197
197
|
Object.defineProperty(exports, "SourcesCell", {
|
|
198
198
|
enumerable: true,
|
|
199
|
-
get: function () { return
|
|
199
|
+
get: function () { return chunkOQODCEEH_cjs.SourcesCell; }
|
|
200
200
|
});
|
|
201
201
|
Object.defineProperty(exports, "SourcesField", {
|
|
202
202
|
enumerable: true,
|
|
203
|
-
get: function () { return
|
|
203
|
+
get: function () { return chunkOQODCEEH_cjs.SourcesField; }
|
|
204
204
|
});
|
|
205
205
|
Object.defineProperty(exports, "TABLE_LAYOUT", {
|
|
206
206
|
enumerable: true,
|
|
207
|
-
get: function () { return
|
|
207
|
+
get: function () { return chunkOQODCEEH_cjs.TABLE_LAYOUT; }
|
|
208
208
|
});
|
|
209
209
|
Object.defineProperty(exports, "canEditColumn", {
|
|
210
210
|
enumerable: true,
|
|
211
|
-
get: function () { return
|
|
211
|
+
get: function () { return chunkOQODCEEH_cjs.canEditColumn; }
|
|
212
212
|
});
|
|
213
213
|
Object.defineProperty(exports, "cellIds", {
|
|
214
214
|
enumerable: true,
|
|
215
|
-
get: function () { return
|
|
215
|
+
get: function () { return chunkOQODCEEH_cjs.cellIds; }
|
|
216
216
|
});
|
|
217
217
|
Object.defineProperty(exports, "cellList", {
|
|
218
218
|
enumerable: true,
|
|
219
|
-
get: function () { return
|
|
219
|
+
get: function () { return chunkOQODCEEH_cjs.cellList; }
|
|
220
220
|
});
|
|
221
221
|
Object.defineProperty(exports, "columnWidth", {
|
|
222
222
|
enumerable: true,
|
|
223
|
-
get: function () { return
|
|
223
|
+
get: function () { return chunkOQODCEEH_cjs.columnWidth; }
|
|
224
224
|
});
|
|
225
225
|
Object.defineProperty(exports, "compareCells", {
|
|
226
226
|
enumerable: true,
|
|
227
|
-
get: function () { return
|
|
227
|
+
get: function () { return chunkOQODCEEH_cjs.compareCells; }
|
|
228
228
|
});
|
|
229
229
|
Object.defineProperty(exports, "completeFilters", {
|
|
230
230
|
enumerable: true,
|
|
231
|
-
get: function () { return
|
|
231
|
+
get: function () { return chunkOQODCEEH_cjs.completeFilters; }
|
|
232
232
|
});
|
|
233
233
|
Object.defineProperty(exports, "createDatabaseColumns", {
|
|
234
234
|
enumerable: true,
|
|
235
|
-
get: function () { return
|
|
235
|
+
get: function () { return chunkOQODCEEH_cjs.createDatabaseColumns; }
|
|
236
236
|
});
|
|
237
237
|
Object.defineProperty(exports, "formatCell", {
|
|
238
238
|
enumerable: true,
|
|
239
|
-
get: function () { return
|
|
239
|
+
get: function () { return chunkOQODCEEH_cjs.formatCell; }
|
|
240
240
|
});
|
|
241
241
|
Object.defineProperty(exports, "formatDateValue", {
|
|
242
242
|
enumerable: true,
|
|
243
|
-
get: function () { return
|
|
243
|
+
get: function () { return chunkOQODCEEH_cjs.formatDateValue; }
|
|
244
244
|
});
|
|
245
245
|
Object.defineProperty(exports, "formatLookupValue", {
|
|
246
246
|
enumerable: true,
|
|
247
|
-
get: function () { return
|
|
247
|
+
get: function () { return chunkOQODCEEH_cjs.formatLookupValue; }
|
|
248
248
|
});
|
|
249
249
|
Object.defineProperty(exports, "formatNumberValue", {
|
|
250
250
|
enumerable: true,
|
|
251
|
-
get: function () { return
|
|
251
|
+
get: function () { return chunkOQODCEEH_cjs.formatNumberValue; }
|
|
252
252
|
});
|
|
253
253
|
Object.defineProperty(exports, "isComputedColumn", {
|
|
254
254
|
enumerable: true,
|
|
255
|
-
get: function () { return
|
|
255
|
+
get: function () { return chunkOQODCEEH_cjs.isComputedColumn; }
|
|
256
256
|
});
|
|
257
257
|
Object.defineProperty(exports, "optionTone", {
|
|
258
258
|
enumerable: true,
|
|
259
|
-
get: function () { return
|
|
259
|
+
get: function () { return chunkOQODCEEH_cjs.optionTone; }
|
|
260
260
|
});
|
|
261
261
|
Object.defineProperty(exports, "resolveLayoutSettings", {
|
|
262
262
|
enumerable: true,
|
|
263
|
-
get: function () { return
|
|
263
|
+
get: function () { return chunkOQODCEEH_cjs.resolveLayoutSettings; }
|
|
264
264
|
});
|
|
265
265
|
Object.defineProperty(exports, "rowTitle", {
|
|
266
266
|
enumerable: true,
|
|
267
|
-
get: function () { return
|
|
267
|
+
get: function () { return chunkOQODCEEH_cjs.rowTitle; }
|
|
268
268
|
});
|
|
269
269
|
Object.defineProperty(exports, "rowsToTimelineItems", {
|
|
270
270
|
enumerable: true,
|
|
271
|
-
get: function () { return
|
|
271
|
+
get: function () { return chunkOQODCEEH_cjs.rowsToTimelineItems; }
|
|
272
272
|
});
|
|
273
273
|
Object.defineProperty(exports, "sameCellValue", {
|
|
274
274
|
enumerable: true,
|
|
275
|
-
get: function () { return
|
|
275
|
+
get: function () { return chunkOQODCEEH_cjs.sameCellValue; }
|
|
276
276
|
});
|
|
277
277
|
Object.defineProperty(exports, "storedLayoutAfter", {
|
|
278
278
|
enumerable: true,
|
|
279
|
-
get: function () { return
|
|
279
|
+
get: function () { return chunkOQODCEEH_cjs.storedLayoutAfter; }
|
|
280
280
|
});
|
|
281
281
|
Object.defineProperty(exports, "titleOf", {
|
|
282
282
|
enumerable: true,
|
|
283
|
-
get: function () { return
|
|
283
|
+
get: function () { return chunkOQODCEEH_cjs.titleOf; }
|
|
284
284
|
});
|
|
285
285
|
Object.defineProperty(exports, "toApiValue", {
|
|
286
286
|
enumerable: true,
|
|
287
|
-
get: function () { return
|
|
287
|
+
get: function () { return chunkOQODCEEH_cjs.toApiValue; }
|
|
288
288
|
});
|
|
289
289
|
Object.defineProperty(exports, "withUndatedFilter", {
|
|
290
290
|
enumerable: true,
|
|
291
|
-
get: function () { return
|
|
291
|
+
get: function () { return chunkOQODCEEH_cjs.withUndatedFilter; }
|
|
292
292
|
});
|
|
293
293
|
//# sourceMappingURL=index.cjs.map
|
|
294
294
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -41,7 +41,11 @@ function FileShareDialog({
|
|
|
41
41
|
await prepareFileShare(documentId);
|
|
42
42
|
const share = await createFileShare(client, documentId, {
|
|
43
43
|
version,
|
|
44
|
-
recipients: recipients.map((email) => ({
|
|
44
|
+
recipients: recipients.map((email) => ({
|
|
45
|
+
email,
|
|
46
|
+
permission: "view",
|
|
47
|
+
require_identity_verification: false
|
|
48
|
+
})),
|
|
45
49
|
message
|
|
46
50
|
});
|
|
47
51
|
window.location.assign(`/shared-files/${share.external_id}`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/document-tools/FileShareDialog.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useState } from 'react'\nimport { createFileShare, useDocumentTools } from '@arbidocs/react/document-tools'\nimport { Button, Label, Textarea } from '@arbidocs/react/ui'\nimport { ModalScaffold } from '../settings/ModalScaffold'\n\nexport function FileShareDialog({\n open,\n onOpenChange,\n documentId,\n version,\n}: {\n open: boolean\n onOpenChange: (open: boolean) => void\n documentId: string\n version: number\n}) {\n const { client, prepareFileShare } = useDocumentTools()\n const [emails, setEmails] = useState('')\n const [message, setMessage] = useState('')\n const [busy, setBusy] = useState(false)\n const [error, setError] = useState('')\n return (\n <ModalScaffold\n open={open}\n onOpenChange={(next) => !busy && onOpenChange(next)}\n title={`Share file \u00B7 version ${version}`}\n description=\"Recipients can view and download only this version. They get no workspace access or other versions.\"\n showDescription\n testId=\"file-share-dialog\"\n >\n <form\n onSubmit={async (event) => {\n event.preventDefault()\n setBusy(true)\n setError('')\n try {\n const recipients = [\n ...new Set(\n emails\n .split(/[,;\\n]+/)\n .map((e) => e.trim().toLowerCase())\n .filter(Boolean)\n ),\n ]\n if (!recipients.length) throw new Error('Add at least one recipient email')\n await prepareFileShare(documentId)\n const share = await createFileShare(client, documentId, {\n version,\n recipients: recipients.map((email) => ({
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import { useState } from 'react'\nimport { createFileShare, useDocumentTools } from '@arbidocs/react/document-tools'\nimport { Button, Label, Textarea } from '@arbidocs/react/ui'\nimport { ModalScaffold } from '../settings/ModalScaffold'\n\nexport function FileShareDialog({\n open,\n onOpenChange,\n documentId,\n version,\n}: {\n open: boolean\n onOpenChange: (open: boolean) => void\n documentId: string\n version: number\n}) {\n const { client, prepareFileShare } = useDocumentTools()\n const [emails, setEmails] = useState('')\n const [message, setMessage] = useState('')\n const [busy, setBusy] = useState(false)\n const [error, setError] = useState('')\n return (\n <ModalScaffold\n open={open}\n onOpenChange={(next) => !busy && onOpenChange(next)}\n title={`Share file \u00B7 version ${version}`}\n description=\"Recipients can view and download only this version. They get no workspace access or other versions.\"\n showDescription\n testId=\"file-share-dialog\"\n >\n <form\n onSubmit={async (event) => {\n event.preventDefault()\n setBusy(true)\n setError('')\n try {\n const recipients = [\n ...new Set(\n emails\n .split(/[,;\\n]+/)\n .map((e) => e.trim().toLowerCase())\n .filter(Boolean)\n ),\n ]\n if (!recipients.length) throw new Error('Add at least one recipient email')\n await prepareFileShare(documentId)\n const share = await createFileShare(client, documentId, {\n version,\n recipients: recipients.map((email) => ({\n email,\n permission: 'view',\n require_identity_verification: false,\n })),\n message,\n })\n window.location.assign(`/shared-files/${share.external_id}`)\n } catch (e) {\n setError(e instanceof Error ? e.message : 'Could not share the file')\n } finally {\n setBusy(false)\n }\n }}\n >\n <ModalScaffold.Body>\n <Label htmlFor=\"file-share-emails\">Recipient emails</Label>\n <Textarea\n id=\"file-share-emails\"\n data-testid=\"file-share-emails\"\n value={emails}\n onChange={(e) => setEmails(e.target.value)}\n placeholder=\"One email per line, or separated by commas\"\n required\n />\n <Label htmlFor=\"file-share-message\">Message (optional)</Label>\n <Textarea\n id=\"file-share-message\"\n value={message}\n onChange={(e) => setMessage(e.target.value)}\n maxLength={2000}\n />\n <p className=\"text-sm text-muted-foreground\">\n Each recipient receives an email with an account-specific link. External users on a Box\n receive up to 24 hours of access.\n </p>\n {error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n {error}\n </p>\n )}\n </ModalScaffold.Body>\n <ModalScaffold.Footer>\n <Button\n type=\"button\"\n variant=\"outline\"\n disabled={busy}\n onClick={() => onOpenChange(false)}\n >\n Cancel\n </Button>\n <Button type=\"submit\" disabled={busy} data-testid=\"file-share-send\">\n {busy ? 'Sharing\u2026' : 'Share this version'}\n </Button>\n </ModalScaffold.Footer>\n </form>\n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