@arbidocs/blocks 0.5.172 → 0.5.173
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ConnectedNativeDocxComparison-G3WMVARG.cjs → ConnectedNativeDocxComparison-KGUSDMDH.cjs} +14 -14
- package/dist/{ConnectedNativeDocxComparison-G3WMVARG.cjs.map → ConnectedNativeDocxComparison-KGUSDMDH.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-WLUA6H4R.cjs → ConnectedStreamedWordArtifact-ERKIDFFG.cjs} +14 -14
- package/dist/{ConnectedStreamedWordArtifact-WLUA6H4R.cjs.map → ConnectedStreamedWordArtifact-ERKIDFFG.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-3FUZZ67O.cjs → DocumentReviewCard-EYJ5Q4F4.cjs} +15 -15
- package/dist/{DocumentReviewCard-3FUZZ67O.cjs.map → DocumentReviewCard-EYJ5Q4F4.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-KD22ACKY.cjs → FilesViewerDialog-AZUR4XBV.cjs} +21 -21
- package/dist/{FilesViewerDialog-KD22ACKY.cjs.map → FilesViewerDialog-AZUR4XBV.cjs.map} +1 -1
- package/dist/{NativeDocxEditor-R2OKJLRY.cjs → NativeDocxEditor-T7FSMKG3.cjs} +6 -6
- package/dist/{NativeDocxEditor-R2OKJLRY.cjs.map → NativeDocxEditor-T7FSMKG3.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-HRUN3JSX.cjs → WorkspaceTableView-YQERZOHV.cjs} +8 -8
- package/dist/{WorkspaceTableView-HRUN3JSX.cjs.map → WorkspaceTableView-YQERZOHV.cjs.map} +1 -1
- package/dist/agents/index.cjs +174 -174
- package/dist/calls/index.cjs +21 -21
- package/dist/{chunk-KEV2R7WX.cjs → chunk-4BOX77K3.cjs} +5 -5
- package/dist/{chunk-KEV2R7WX.cjs.map → chunk-4BOX77K3.cjs.map} +1 -1
- package/dist/{chunk-25ZZOEKD.cjs → chunk-5PZZRBAG.cjs} +4 -4
- package/dist/{chunk-25ZZOEKD.cjs.map → chunk-5PZZRBAG.cjs.map} +1 -1
- package/dist/{chunk-L3MYUPSH.cjs → chunk-6AFAYGJW.cjs} +5 -5
- package/dist/{chunk-L3MYUPSH.cjs.map → chunk-6AFAYGJW.cjs.map} +1 -1
- package/dist/{chunk-LH3PDPJP.cjs → chunk-7H7KIJW2.cjs} +3 -3
- package/dist/{chunk-LH3PDPJP.cjs.map → chunk-7H7KIJW2.cjs.map} +1 -1
- package/dist/{chunk-YFEQVJH6.cjs → chunk-7VZHGEA4.cjs} +7 -7
- package/dist/{chunk-YFEQVJH6.cjs.map → chunk-7VZHGEA4.cjs.map} +1 -1
- package/dist/{chunk-F6SXNJU3.cjs → chunk-CHZ6SPOT.cjs} +4 -4
- package/dist/{chunk-F6SXNJU3.cjs.map → chunk-CHZ6SPOT.cjs.map} +1 -1
- package/dist/{chunk-4LCLVVYD.cjs → chunk-D5QGLBQC.cjs} +36 -36
- package/dist/{chunk-4LCLVVYD.cjs.map → chunk-D5QGLBQC.cjs.map} +1 -1
- package/dist/{chunk-OIYKKUAN.cjs → chunk-FX5TZ6JU.cjs} +3 -3
- package/dist/{chunk-OIYKKUAN.cjs.map → chunk-FX5TZ6JU.cjs.map} +1 -1
- package/dist/{chunk-BD7P4KYQ.cjs → chunk-G2B2BWE5.cjs} +12 -2
- package/dist/chunk-G2B2BWE5.cjs.map +1 -0
- package/dist/{chunk-STPBNALX.cjs → chunk-GPPPH37H.cjs} +4 -4
- package/dist/{chunk-STPBNALX.cjs.map → chunk-GPPPH37H.cjs.map} +1 -1
- package/dist/{chunk-A7MGQMOV.cjs → chunk-H4N6BZNU.cjs} +3 -3
- package/dist/{chunk-A7MGQMOV.cjs.map → chunk-H4N6BZNU.cjs.map} +1 -1
- package/dist/{chunk-K6C7L73R.cjs → chunk-IJBCEBGR.cjs} +28 -28
- package/dist/{chunk-K6C7L73R.cjs.map → chunk-IJBCEBGR.cjs.map} +1 -1
- package/dist/{chunk-LYDSETR7.cjs → chunk-JEHGTPS2.cjs} +3 -3
- package/dist/{chunk-LYDSETR7.cjs.map → chunk-JEHGTPS2.cjs.map} +1 -1
- package/dist/{chunk-WN6BLSAZ.cjs → chunk-JKTUL4L3.cjs} +5 -5
- package/dist/{chunk-WN6BLSAZ.cjs.map → chunk-JKTUL4L3.cjs.map} +1 -1
- package/dist/{chunk-AYOJZPA2.cjs → chunk-K7JV2OV3.cjs} +9 -9
- package/dist/{chunk-AYOJZPA2.cjs.map → chunk-K7JV2OV3.cjs.map} +1 -1
- package/dist/{chunk-BLJET4KG.cjs → chunk-KULGPKLY.cjs} +4 -4
- package/dist/{chunk-BLJET4KG.cjs.map → chunk-KULGPKLY.cjs.map} +1 -1
- package/dist/{chunk-P726C7NL.cjs → chunk-MGI5FR6I.cjs} +4 -4
- package/dist/{chunk-P726C7NL.cjs.map → chunk-MGI5FR6I.cjs.map} +1 -1
- package/dist/chunk-QHXFXV2F.cjs +18 -0
- package/dist/{chunk-5GUJ27XK.cjs.map → chunk-QHXFXV2F.cjs.map} +1 -1
- package/dist/{chunk-7TX2JCTZ.cjs → chunk-TF3JNVHS.cjs} +4 -4
- package/dist/{chunk-7TX2JCTZ.cjs.map → chunk-TF3JNVHS.cjs.map} +1 -1
- package/dist/{chunk-YOTUWXOV.cjs → chunk-THGWHKWR.cjs} +27 -27
- package/dist/{chunk-YOTUWXOV.cjs.map → chunk-THGWHKWR.cjs.map} +1 -1
- package/dist/{chunk-TV2HTJD6.cjs → chunk-TMK5YVNN.cjs} +58 -58
- package/dist/{chunk-TV2HTJD6.cjs.map → chunk-TMK5YVNN.cjs.map} +1 -1
- package/dist/{chunk-UVEBRUTI.cjs → chunk-U2L4GTMV.cjs} +6 -6
- package/dist/{chunk-UVEBRUTI.cjs.map → chunk-U2L4GTMV.cjs.map} +1 -1
- package/dist/{chunk-ICZLFE26.cjs → chunk-WQ3GB74G.cjs} +7 -7
- package/dist/{chunk-ICZLFE26.cjs.map → chunk-WQ3GB74G.cjs.map} +1 -1
- package/dist/{chunk-ZRYU32HB.cjs → chunk-ZOI4DFSB.cjs} +31 -31
- package/dist/{chunk-ZRYU32HB.cjs.map → chunk-ZOI4DFSB.cjs.map} +1 -1
- package/dist/{chunk-RJMKTK4P.cjs → chunk-ZUQGG3FL.cjs} +3 -3
- package/dist/{chunk-RJMKTK4P.cjs.map → chunk-ZUQGG3FL.cjs.map} +1 -1
- package/dist/connect/docx.cjs +18 -18
- package/dist/connect/index.cjs +969 -968
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +18 -18
- package/dist/connection/workspace-access/ConnectedGrantWorkspaceAccessDialog.js +5 -4
- package/dist/connection/workspace-access/ConnectedGrantWorkspaceAccessDialog.js.map +2 -2
- package/dist/docx/index.cjs +38 -38
- package/dist/docx/review/DocxEditorReview.js +10 -0
- package/dist/docx/review/DocxEditorReview.js.map +2 -2
- package/dist/embed/index.cjs +18 -18
- package/dist/files/index.cjs +228 -228
- package/dist/index.cjs +722 -722
- package/dist/pages/index.cjs +20 -20
- package/dist/settings/index.cjs +136 -136
- package/dist/workflow-canvas/index.cjs +30 -30
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/chunk-5GUJ27XK.cjs +0 -18
- package/dist/chunk-BD7P4KYQ.cjs.map +0 -1
package/dist/connect/viewer.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkTMK5YVNN_cjs = require('../chunk-TMK5YVNN.cjs');
|
|
5
5
|
require('../chunk-JITYC4OS.cjs');
|
|
6
6
|
require('../chunk-WVZLAAIZ.cjs');
|
|
7
7
|
require('../chunk-X7ALF4MP.cjs');
|
|
@@ -10,25 +10,25 @@ require('../chunk-4CIVQWAX.cjs');
|
|
|
10
10
|
require('../chunk-QWVUBTW3.cjs');
|
|
11
11
|
require('../chunk-JVEDKKNO.cjs');
|
|
12
12
|
var chunkJ5CBCUQE_cjs = require('../chunk-J5CBCUQE.cjs');
|
|
13
|
-
require('../chunk-
|
|
13
|
+
require('../chunk-CHZ6SPOT.cjs');
|
|
14
14
|
require('../chunk-D4SJT3NG.cjs');
|
|
15
15
|
require('../chunk-OUYBYZ7Y.cjs');
|
|
16
|
-
require('../chunk-
|
|
17
|
-
require('../chunk-
|
|
18
|
-
require('../chunk-
|
|
16
|
+
require('../chunk-H4N6BZNU.cjs');
|
|
17
|
+
require('../chunk-D5QGLBQC.cjs');
|
|
18
|
+
require('../chunk-JEHGTPS2.cjs');
|
|
19
19
|
require('../chunk-HYUKPHCT.cjs');
|
|
20
20
|
require('../chunk-JWCVA4LC.cjs');
|
|
21
21
|
require('../chunk-QQMMCXBP.cjs');
|
|
22
|
-
require('../chunk-
|
|
22
|
+
require('../chunk-GPPPH37H.cjs');
|
|
23
23
|
require('../chunk-223D4727.cjs');
|
|
24
24
|
require('../chunk-DTMBAFIL.cjs');
|
|
25
25
|
require('../chunk-SNUBQMIS.cjs');
|
|
26
|
-
require('../chunk-
|
|
26
|
+
require('../chunk-K7JV2OV3.cjs');
|
|
27
|
+
require('../chunk-SOT7NPIB.cjs');
|
|
28
|
+
require('../chunk-3EIO4ZH5.cjs');
|
|
27
29
|
require('../chunk-4ONPEVTP.cjs');
|
|
28
30
|
require('../chunk-V3KLUWQQ.cjs');
|
|
29
31
|
require('../chunk-7NJKDJVO.cjs');
|
|
30
|
-
require('../chunk-SOT7NPIB.cjs');
|
|
31
|
-
require('../chunk-3EIO4ZH5.cjs');
|
|
32
32
|
require('../chunk-LIDXIX36.cjs');
|
|
33
33
|
require('../chunk-34HQO4ZQ.cjs');
|
|
34
34
|
require('../chunk-CT3SLXB7.cjs');
|
|
@@ -43,37 +43,37 @@ require('../chunk-WQMR3O2D.cjs');
|
|
|
43
43
|
require('../chunk-NZNBJF3M.cjs');
|
|
44
44
|
require('../chunk-NWNVWO6L.cjs');
|
|
45
45
|
require('../chunk-SK6HQ46Q.cjs');
|
|
46
|
+
require('../chunk-MNIQDXM6.cjs');
|
|
47
|
+
require('../chunk-VJNJ4G6Y.cjs');
|
|
48
|
+
require('../chunk-WCT6FT2K.cjs');
|
|
46
49
|
require('../chunk-DEXUL3T6.cjs');
|
|
47
50
|
require('../chunk-AFQTQC7A.cjs');
|
|
48
51
|
require('../chunk-XJEXFEWG.cjs');
|
|
49
52
|
require('../chunk-E23H6FJR.cjs');
|
|
50
53
|
require('../chunk-YZSQ7F5K.cjs');
|
|
51
54
|
require('../chunk-KQF7POTG.cjs');
|
|
52
|
-
require('../chunk-
|
|
53
|
-
require('../chunk-VJNJ4G6Y.cjs');
|
|
54
|
-
require('../chunk-WCT6FT2K.cjs');
|
|
55
|
-
require('../chunk-LH3PDPJP.cjs');
|
|
55
|
+
require('../chunk-7H7KIJW2.cjs');
|
|
56
56
|
require('../chunk-75BNMCUX.cjs');
|
|
57
57
|
require('../chunk-OEJQFPWO.cjs');
|
|
58
58
|
require('../chunk-OYXWQTHF.cjs');
|
|
59
59
|
require('../chunk-S237ORM3.cjs');
|
|
60
60
|
require('../chunk-II2OEXHW.cjs');
|
|
61
61
|
require('../chunk-FX3K6LNZ.cjs');
|
|
62
|
-
require('../chunk-
|
|
62
|
+
require('../chunk-FX5TZ6JU.cjs');
|
|
63
63
|
require('../chunk-3YEXZX4H.cjs');
|
|
64
64
|
require('../chunk-4PA6VCCR.cjs');
|
|
65
65
|
require('../chunk-5FSULBPE.cjs');
|
|
66
66
|
require('../chunk-AHDJXIUB.cjs');
|
|
67
|
+
require('../chunk-IXCWZ4HC.cjs');
|
|
67
68
|
require('../chunk-S3GVFAFB.cjs');
|
|
68
69
|
require('../chunk-6UZC4XVV.cjs');
|
|
69
|
-
require('../chunk-
|
|
70
|
+
require('../chunk-DKY67DA6.cjs');
|
|
70
71
|
require('../chunk-Y3GJBLAI.cjs');
|
|
71
72
|
require('../chunk-SQCCQU3K.cjs');
|
|
72
73
|
require('../chunk-UDSHVNU3.cjs');
|
|
73
|
-
require('../chunk-
|
|
74
|
+
require('../chunk-ZVEW3JBT.cjs');
|
|
74
75
|
require('../chunk-ZQQVXRYZ.cjs');
|
|
75
76
|
require('../chunk-IPSHAMO2.cjs');
|
|
76
|
-
require('../chunk-ZVEW3JBT.cjs');
|
|
77
77
|
require('../chunk-MHIG6GGS.cjs');
|
|
78
78
|
require('../chunk-VG24E4JJ.cjs');
|
|
79
79
|
require('../chunk-U2FFG2B3.cjs');
|
|
@@ -99,7 +99,7 @@ require('../chunk-PLIF5CUV.cjs');
|
|
|
99
99
|
|
|
100
100
|
Object.defineProperty(exports, "ConnectedDocumentViewer", {
|
|
101
101
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunkTMK5YVNN_cjs.ConnectedDocumentViewer; }
|
|
103
103
|
});
|
|
104
104
|
Object.defineProperty(exports, "ConnectedDocumentToolsProvider", {
|
|
105
105
|
enumerable: true,
|
|
@@ -53,9 +53,10 @@ function ConnectedGrantWorkspaceAccessDialog({
|
|
|
53
53
|
const workspaceExtId = notification?.workspace_ext_id ?? null;
|
|
54
54
|
const taskExtId = notification?.conversation_ext_id ?? null;
|
|
55
55
|
const fromTask = !content && !!taskExtId;
|
|
56
|
-
const { data: pendingAuth } = useConversationPendingAuth(
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
const { data: pendingAuth, isLoading: pendingAuthLoading } = useConversationPendingAuth(
|
|
57
|
+
taskExtId ?? void 0,
|
|
58
|
+
{ enabled: fromTask }
|
|
59
|
+
);
|
|
59
60
|
const requesterName = [requester?.given_name, requester?.family_name].filter(Boolean).join(" ") || requester?.email || "Someone";
|
|
60
61
|
const ownedWorkspaces = useMemo(
|
|
61
62
|
() => workspaces.filter(
|
|
@@ -194,7 +195,7 @@ function ConnectedGrantWorkspaceAccessDialog({
|
|
|
194
195
|
const primaryKind = isExternal || locked ? "temporary" : "permanent";
|
|
195
196
|
const secondaryKind = locked ? "permanent" : "temporary";
|
|
196
197
|
const canGrant = (kind) => !(kind === "temporary" && selectedRole === "owner");
|
|
197
|
-
const blocked = (kind) => busy || noWorkspace || noSelection || !canGrant(kind);
|
|
198
|
+
const blocked = (kind) => busy || noWorkspace || noSelection || !canGrant(kind) || kind === "temporary" && fromTask && !isExternal && pendingAuthLoading;
|
|
198
199
|
const kindLabel = (kind) => kind === "temporary" ? "temporary" : "permanent";
|
|
199
200
|
if (!notification || !requester) return null;
|
|
200
201
|
if (grantConfirmation) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/workspace-access/ConnectedGrantWorkspaceAccessDialog.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * ConnectedGrantWorkspaceAccessDialog\n *\n * Recipient side of the workspace-access-request flow. When another user asks\n * for access (a `workspace_access_request` notification, or its entry in the DM\n * thread), this modal lets the owner grant it:\n *\n * - A `workspace_ext_id` on the request (agent-initiated, e.g. the email\n * gateway addressing wrk-xxxx@\u2026) \u2192 locked to that workspace, and the primary\n * action is **temporary** (these are short-lived, scoped grants).\n * - No `workspace_ext_id` (user-initiated) \u2192 a dropdown of the owner's\n * workspaces with NO default selection, and the primary action is\n * **permanent**.\n *\n * The primary button always reads \"Grant access\" and performs the flow's\n * default; the other kind is offered as a small secondary action. Temporary\n * passes the requester's session public key (decrypted from the request\n * `content`) as `session_pubkey_b64`; permanent omits it and the server wraps\n * the workspace key with the requester's long-term key.\n *\n * External requesters (`temporary_access_only`) only receive fixed-expiry grants\n * (up to 24 hours) with no live session key required, and never as owner.\n *\n * Role: default collaborator; guest is read-only (shown as \"Viewer\"); owner is allowed only for\n * permanent grants (a temporary grant can never be owner).\n */\n\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Button,\n Badge,\n} from '@arbidocs/react/ui'\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n openAccessRequest,\n useAddWorkspaceMembers,\n useArbi,\n useArbiSession,\n useConversationPendingAuth,\n useDeleteNotifications,\n useRunConversation,\n useWorkspaces,\n} from '@arbidocs/react'\nimport type { components } from '@arbidocs/client'\nimport { Clock, Infinity as InfinityIcon } from 'lucide-react'\nimport { ModalSection, ModalSectionTitle } from '../../settings/ModalScaffold'\nimport { formatRole, getRoleBadgeClass, getRoleDescription } from '../../workspaces/workspace-roles'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { closeAccessRequestReview, useAccessRequestUnderReview } from './access-review'\nimport { formatAccessExpiry } from './access-expiry'\n\ntype WorkspaceRole = components['schemas']['WorkspaceRole']\n/** The access request under review: its `workspace_access_request` notification. */\nexport type AccessRequestNotification = components['schemas']['NotificationResponse']\n\n/** Roles the owner can grant from a request \u2014 mirrors AddWorkspaceUser. */\nconst GRANTABLE_ROLES: { value: WorkspaceRole; label: string }[] = (\n ['owner', 'collaborator', 'guest'] as const\n).map((value) => ({ value, label: formatRole(value) }))\n\nexport interface ConnectedGrantWorkspaceAccessDialogProps {\n /**\n * The request under review; nothing shows while it is null. Absent: the one asked for with\n * `reviewAccessRequest` (a notification's \"Review\", `useOpenNotificationTarget`).\n */\n notification?: AccessRequestNotification | null\n /** The dialog is done (granted, dismissed, or closed). Default: ends that review. */\n onClose?: () => void\n}\n\n/**\n * The owner's side of a workspace access request: grant it (temporary or permanent, with a role)\n * or dismiss it. A request an agent raised for a task run resumes the run once granted.\n */\nexport function ConnectedGrantWorkspaceAccessDialog({\n notification: controlled,\n onClose,\n}: ConnectedGrantWorkspaceAccessDialogProps) {\n const requested = useAccessRequestUnderReview()\n const notification = controlled === undefined ? requested : controlled\n const close = onClose ?? closeAccessRequestReview\n const { data: workspaces = [] } = useWorkspaces()\n const arbi = useArbi()\n const addWorkspaceUsers = useAddWorkspaceMembers()\n const deleteNotifications = useDeleteNotifications()\n const runNow = useRunConversation()\n const { notify } = useBlocksEnvironment()\n const currentUserExtId = useArbiSession().user?.external_id\n\n const requester = notification?.sender\n const isExternal = requester?.temporary_access_only === true\n const [accessHours, setAccessHours] = useState('24')\n const content = notification?.content ?? ''\n const workspaceExtId = notification?.workspace_ext_id ?? null\n // A request an agent raised for a task run has no encrypted note (the server cannot encrypt as the\n // agent). Its session key comes from the task (a conversation) instead, and granting resumes the\n // parked run.\n const taskExtId = notification?.conversation_ext_id ?? null\n const fromTask = !content && !!taskExtId\n const { data: pendingAuth } = useConversationPendingAuth(taskExtId ?? undefined, {\n enabled: fromTask,\n })\n const requesterName =\n [requester?.given_name, requester?.family_name].filter(Boolean).join(' ') ||\n requester?.email ||\n 'Someone'\n\n // Workspaces the current user owns and holds a key for (i.e. can actually share).\n const ownedWorkspaces = useMemo(\n () =>\n workspaces.filter(\n (w) =>\n !!w.wrapped_key &&\n (w.created_by_ext_id === currentUserExtId ||\n w.users?.some((u) => u.user?.external_id === currentUserExtId && u.role === 'owner'))\n ),\n [workspaces, currentUserExtId]\n )\n\n const locked = !!workspaceExtId\n const [selectedWsId, setSelectedWsId] = useState<string>('')\n const [selectedRole, setSelectedRole] = useState<WorkspaceRole>('collaborator')\n const [note, setNote] = useState<string | undefined>(undefined)\n const [grantConfirmation, setGrantConfirmation] = useState<{\n workspace: string\n role: WorkspaceRole\n waitingTask: boolean\n } | null>(null)\n const [grantingKind, setGrantingKind] = useState<'temporary' | 'permanent' | null>(null)\n const [dismissing, setDismissing] = useState(false)\n\n // Reset transient state whenever the reviewed request changes.\n useEffect(() => {\n setNote(undefined)\n setGrantConfirmation(null)\n setSelectedWsId(workspaceExtId ?? '')\n setSelectedRole('collaborator')\n setAccessHours('24')\n }, [notification, workspaceExtId])\n\n // Intentionally NO auto-default for the dropdown: when the requester didn't\n // name a workspace, the owner must consciously pick one so they can't grant\n // the wrong workspace by reflexively clicking before reading.\n\n // Decrypt the request note for display (the session pubkey is read at grant time).\n useEffect(() => {\n let cancelled = false\n if (!notification || !requester || !content) return\n void openAccessRequest(content, requester.encryption_public_key).then((payload) => {\n if (!cancelled && payload) setNote(payload.note)\n })\n return () => {\n cancelled = true\n }\n }, [notification, content, requester])\n\n const grant = async (kind: 'temporary' | 'permanent') => {\n if (!requester) return\n if (kind === 'temporary' && selectedRole === 'owner') {\n notify('Temporary access can\u2019t be owner \u2014 pick another role or grant permanent', 'warning')\n return\n }\n const wsId = locked ? workspaceExtId! : selectedWsId\n if (!wsId) {\n notify('Pick a workspace to grant access to', 'warning')\n return\n }\n setGrantingKind(kind)\n try {\n const workspaceKey = await arbi.workspaces.sealKey(wsId).catch(() => null)\n if (!workspaceKey) {\n notify('Could not load the key for that workspace', 'error')\n return\n }\n\n let sessionPubkey: string | undefined\n if (kind === 'temporary' && !isExternal) {\n if (fromTask) {\n sessionPubkey = pendingAuth?.session_pubkey\n } else {\n const payload = await openAccessRequest(content, requester.encryption_public_key)\n sessionPubkey = payload?.session_pubkey_b64\n }\n if (!sessionPubkey) {\n notify('Request is missing a session key \u2014 grant permanent instead', 'warning')\n return\n }\n }\n\n const grantedMembers = await addWorkspaceUsers.mutateAsync({\n emails: [requester.email],\n role: selectedRole,\n workspace_key: workspaceKey,\n workspace_ext_id: wsId,\n ...(sessionPubkey ? { session_pubkey_b64: sessionPubkey } : {}),\n ...(isExternal ? { access_duration_seconds: Number(accessHours) * 3600 } : {}),\n })\n\n const wsName = workspaces.find((w) => w.external_id === wsId)?.name ?? 'the workspace'\n const grantedMember = Array.isArray(grantedMembers)\n ? grantedMembers.find((member) => member.user?.email === requester.email)\n : undefined\n const isAgent = requester.external_id.startsWith('agt-')\n const grantedRole = grantedMember?.role ?? (isAgent ? null : selectedRole)\n if (!grantedRole) {\n notify(\n 'No changed membership was returned. Check the existing workspace role before continuing.',\n 'warning'\n )\n return\n }\n const roleLabel = formatRole(grantedRole).toLowerCase()\n const expiresAt = grantedMember?.access_expires_at\n const needsAiUpgrade = grantedRole === 'guest'\n notify(\n kind === 'temporary'\n ? `Access granted.${expiresAt ? ` Expires ${formatAccessExpiry(expiresAt)}.` : ''}`\n : `Granted ${requesterName} ${roleLabel} access to ${wsName}`,\n 'success'\n )\n // The run was parked waiting for exactly this: resume it now the key is deposited.\n if (fromTask && kind === 'temporary' && taskExtId && !needsAiUpgrade) {\n try {\n await runNow.mutateAsync(taskExtId)\n } catch (err) {\n console.error('Granted access but could not resume the run', err)\n notify('Access granted, but the run could not resume. Run it again.', 'warning')\n }\n }\n // A Viewer grant does not fulfill an AI task's request; keep it available for an approved upgrade.\n if (notification && !(fromTask && needsAiUpgrade)) {\n try {\n await deleteNotifications.mutateAsync([notification.external_id])\n } catch (err) {\n console.error('Failed to clear fulfilled access request', err)\n }\n }\n if (isAgent && (!fromTask || needsAiUpgrade)) {\n setGrantConfirmation({ workspace: wsName, role: grantedRole, waitingTask: fromTask })\n } else {\n close()\n }\n } catch (err) {\n const e = err as { detail?: string; message?: string }\n notify(e?.detail || e?.message || 'Failed to grant access', 'error')\n } finally {\n setGrantingKind(null)\n }\n }\n\n // Dismiss = decline: drop the request entirely (bilateral delete) so it stops\n // nagging both sides. Distinct from closing the modal (X / click-outside),\n // which leaves the request pending for later.\n const dismiss = async () => {\n if (!notification) {\n close()\n return\n }\n setDismissing(true)\n try {\n await deleteNotifications.mutateAsync([notification.external_id])\n notify(`Dismissed ${requesterName}'s access request`, 'info')\n close()\n } catch (err) {\n const e = err as { detail?: string; message?: string }\n notify(e?.detail || e?.message || 'Failed to dismiss request', 'error')\n } finally {\n setDismissing(false)\n }\n }\n\n const busy = grantingKind !== null || dismissing\n const noWorkspace = !locked && ownedWorkspaces.length === 0\n // Nothing to grant until a workspace is actually selected (or locked in).\n const noSelection = !locked && !selectedWsId\n\n // External requests always receive fixed-expiry grants. Otherwise a request that names a\n // workspace is agent-initiated (e.g. the email gateway) \u2192 default to a short-lived,\n // session-scoped grant; a request with no workspace is user-initiated \u2192 the owner\n // deliberately picks a workspace and grants lasting access.\n const primaryKind: 'temporary' | 'permanent' = isExternal || locked ? 'temporary' : 'permanent'\n const secondaryKind: 'temporary' | 'permanent' = locked ? 'permanent' : 'temporary'\n // A temporary grant can never be owner \u2014 the key lives only in the requester's\n // session, so ownership (which manages membership) makes no sense there.\n const canGrant = (kind: 'temporary' | 'permanent') =>\n !(kind === 'temporary' && selectedRole === 'owner')\n const blocked = (kind: 'temporary' | 'permanent') =>\n busy || noWorkspace || noSelection || !canGrant(kind)\n const kindLabel = (kind: 'temporary' | 'permanent') =>\n kind === 'temporary' ? 'temporary' : 'permanent'\n\n if (!notification || !requester) return null\n\n if (grantConfirmation) {\n return (\n <Dialog open onOpenChange={(o) => !o && close()}>\n <DialogContent presentation=\"sheet\" data-testid=\"grant-workspace-access-confirmation\">\n <DialogHeader>\n <DialogTitle>Access granted</DialogTitle>\n <DialogDescription>\n {formatRole(grantConfirmation.role)} access was granted to{' '}\n {grantConfirmation.workspace}.{' '}\n {grantConfirmation.role === 'guest' ? (\n <>\n This permits reading shared content, but not running AI in this workspace.{' '}\n {grantConfirmation.waitingTask\n ? 'The task is still waiting. Review this access request again and approve a Collaborator upgrade to run it.'\n : 'For workspace AI, ask the agent to request a Collaborator upgrade and approve it through the normal access review.'}\n </>\n ) : (\n <>\n Return to this chat and ask the agent to continue. The earlier response will not\n update automatically.\n </>\n )}\n </DialogDescription>\n </DialogHeader>\n <div className=\"flex justify-end\">\n <Button onClick={close}>Done</Button>\n </div>\n </DialogContent>\n </Dialog>\n )\n }\n\n return (\n <Dialog open onOpenChange={(o) => !o && close()}>\n <DialogContent presentation=\"sheet\" data-testid=\"grant-workspace-access-modal\">\n <DialogHeader>\n <DialogTitle>{requesterName} requested workspace access</DialogTitle>\n <DialogDescription>\n {locked\n ? `Grant ${requesterName} access to this workspace.`\n : `Grant ${requesterName} access to one of your workspaces.`}\n </DialogDescription>\n </DialogHeader>\n\n <ModalSection className=\"space-y-3\">\n {/* The requester's note, surfaced clearly (decrypted from the request). */}\n {note ? (\n <div className=\"rounded-md border-l-2 border-primary/50 bg-muted/40 px-3 py-2\">\n <ModalSectionTitle>Note from {requesterName}</ModalSectionTitle>\n <p\n className=\"whitespace-pre-wrap text-sm italic text-foreground\"\n data-testid=\"access-request-note\"\n >\n \u201C{note}\u201D\n </p>\n </div>\n ) : (\n <p className=\"text-xs text-muted-foreground\">No note was included with this request.</p>\n )}\n\n {locked ? (\n <div>\n <ModalSectionTitle>Workspace</ModalSectionTitle>\n <div className=\"rounded-lg bg-muted px-3 py-2 text-sm\">\n {workspaces.find((w) => w.external_id === workspaceExtId)?.name ?? workspaceExtId}\n </div>\n </div>\n ) : noWorkspace ? (\n <p className=\"text-sm text-muted-foreground\">\n You don\u2019t own a workspace you can share. Create one first.\n </p>\n ) : (\n <div>\n <ModalSectionTitle>Workspace</ModalSectionTitle>\n <Select value={selectedWsId} onValueChange={setSelectedWsId} disabled={busy}>\n <SelectTrigger data-testid=\"grant-workspace-select\">\n <SelectValue placeholder=\"Select a workspace\" />\n </SelectTrigger>\n <SelectContent>\n {ownedWorkspaces.map((w) => (\n <SelectItem key={w.external_id} value={w.external_id}>\n {w.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n )}\n\n {!noWorkspace && (\n <div>\n <ModalSectionTitle>Role</ModalSectionTitle>\n <Select\n value={selectedRole}\n onValueChange={(v) => setSelectedRole(v as WorkspaceRole)}\n disabled={busy}\n >\n <SelectTrigger data-testid=\"grant-role-select\">\n <SelectValue>\n <Badge variant=\"default\" className={getRoleBadgeClass(selectedRole)}>\n {formatRole(selectedRole)}\n </Badge>\n </SelectValue>\n </SelectTrigger>\n <SelectContent>\n {GRANTABLE_ROLES.filter((role) => !isExternal || role.value !== 'owner').map(\n (role) => (\n <SelectItem key={role.value} value={role.value}>\n <Badge variant=\"default\" className={getRoleBadgeClass(role.value)}>\n {role.label}\n </Badge>\n </SelectItem>\n )\n )}\n </SelectContent>\n </Select>\n <p className=\"mt-1.5 text-xs text-muted-foreground\">\n {getRoleDescription(selectedRole)}\n </p>\n {!canGrant(primaryKind) && (\n <p className=\"mt-1 text-xs text-yellow-text\" data-testid=\"owner-temporary-warning\">\n Temporary access can\u2019t be owner \u2014 pick another role or grant permanent.\n </p>\n )}\n </div>\n )}\n </ModalSection>\n\n {isExternal && (\n <ModalSection className=\"space-y-2\">\n <ModalSectionTitle>Access duration</ModalSectionTitle>\n <Select value={accessHours} onValueChange={setAccessHours} disabled={busy}>\n <SelectTrigger data-testid=\"grant-access-duration\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"1\">1 hour</SelectItem>\n <SelectItem value=\"4\">4 hours</SelectItem>\n <SelectItem value=\"24\">24 hours</SelectItem>\n </SelectContent>\n </Select>\n </ModalSection>\n )}\n <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-end\">\n <Button\n variant=\"ghost\"\n onClick={dismiss}\n disabled={busy}\n className=\"sm:mr-auto\"\n data-testid=\"dismiss-access-request-button\"\n >\n {dismissing ? 'Dismissing\u2026' : 'Dismiss'}\n </Button>\n\n {!noWorkspace && (\n <>\n {/* Secondary, deliberately understated \u2014 the non-default grant kind. */}\n {!isExternal && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => grant(secondaryKind)}\n disabled={blocked(secondaryKind)}\n className=\"text-xs text-muted-foreground hover:text-foreground\"\n data-testid={`grant-${secondaryKind}-button`}\n >\n {grantingKind === secondaryKind\n ? 'Granting\u2026'\n : `Grant ${kindLabel(secondaryKind)} instead`}\n </Button>\n )}\n\n {/* Primary CTA \u2014 always \"Grant access\", performs the flow default. */}\n <Button\n onClick={() => grant(primaryKind)}\n disabled={blocked(primaryKind)}\n data-testid={`grant-${primaryKind}-button`}\n >\n {primaryKind === 'temporary' ? (\n <Clock className=\"mr-2 h-4 w-4\" />\n ) : (\n <InfinityIcon className=\"mr-2 h-4 w-4\" />\n )}\n {grantingKind === primaryKind ? 'Granting\u2026' : 'Grant access'}\n </Button>\n </>\n )}\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["/**\n * ConnectedGrantWorkspaceAccessDialog\n *\n * Recipient side of the workspace-access-request flow. When another user asks\n * for access (a `workspace_access_request` notification, or its entry in the DM\n * thread), this modal lets the owner grant it:\n *\n * - A `workspace_ext_id` on the request (agent-initiated, e.g. the email\n * gateway addressing wrk-xxxx@\u2026) \u2192 locked to that workspace, and the primary\n * action is **temporary** (these are short-lived, scoped grants).\n * - No `workspace_ext_id` (user-initiated) \u2192 a dropdown of the owner's\n * workspaces with NO default selection, and the primary action is\n * **permanent**.\n *\n * The primary button always reads \"Grant access\" and performs the flow's\n * default; the other kind is offered as a small secondary action. Temporary\n * passes the requester's session public key (decrypted from the request\n * `content`) as `session_pubkey_b64`; permanent omits it and the server wraps\n * the workspace key with the requester's long-term key.\n *\n * External requesters (`temporary_access_only`) only receive fixed-expiry grants\n * (up to 24 hours) with no live session key required, and never as owner.\n *\n * Role: default collaborator; guest is read-only (shown as \"Viewer\"); owner is allowed only for\n * permanent grants (a temporary grant can never be owner).\n */\n\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n Button,\n Badge,\n} from '@arbidocs/react/ui'\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n openAccessRequest,\n useAddWorkspaceMembers,\n useArbi,\n useArbiSession,\n useConversationPendingAuth,\n useDeleteNotifications,\n useRunConversation,\n useWorkspaces,\n} from '@arbidocs/react'\nimport type { components } from '@arbidocs/client'\nimport { Clock, Infinity as InfinityIcon } from 'lucide-react'\nimport { ModalSection, ModalSectionTitle } from '../../settings/ModalScaffold'\nimport { formatRole, getRoleBadgeClass, getRoleDescription } from '../../workspaces/workspace-roles'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { closeAccessRequestReview, useAccessRequestUnderReview } from './access-review'\nimport { formatAccessExpiry } from './access-expiry'\n\ntype WorkspaceRole = components['schemas']['WorkspaceRole']\n/** The access request under review: its `workspace_access_request` notification. */\nexport type AccessRequestNotification = components['schemas']['NotificationResponse']\n\n/** Roles the owner can grant from a request \u2014 mirrors AddWorkspaceUser. */\nconst GRANTABLE_ROLES: { value: WorkspaceRole; label: string }[] = (\n ['owner', 'collaborator', 'guest'] as const\n).map((value) => ({ value, label: formatRole(value) }))\n\nexport interface ConnectedGrantWorkspaceAccessDialogProps {\n /**\n * The request under review; nothing shows while it is null. Absent: the one asked for with\n * `reviewAccessRequest` (a notification's \"Review\", `useOpenNotificationTarget`).\n */\n notification?: AccessRequestNotification | null\n /** The dialog is done (granted, dismissed, or closed). Default: ends that review. */\n onClose?: () => void\n}\n\n/**\n * The owner's side of a workspace access request: grant it (temporary or permanent, with a role)\n * or dismiss it. A request an agent raised for a task run resumes the run once granted.\n */\nexport function ConnectedGrantWorkspaceAccessDialog({\n notification: controlled,\n onClose,\n}: ConnectedGrantWorkspaceAccessDialogProps) {\n const requested = useAccessRequestUnderReview()\n const notification = controlled === undefined ? requested : controlled\n const close = onClose ?? closeAccessRequestReview\n const { data: workspaces = [] } = useWorkspaces()\n const arbi = useArbi()\n const addWorkspaceUsers = useAddWorkspaceMembers()\n const deleteNotifications = useDeleteNotifications()\n const runNow = useRunConversation()\n const { notify } = useBlocksEnvironment()\n const currentUserExtId = useArbiSession().user?.external_id\n\n const requester = notification?.sender\n const isExternal = requester?.temporary_access_only === true\n const [accessHours, setAccessHours] = useState('24')\n const content = notification?.content ?? ''\n const workspaceExtId = notification?.workspace_ext_id ?? null\n // A request an agent raised for a task run has no encrypted note (the server cannot encrypt as the\n // agent). Its session key comes from the task (a conversation) instead, and granting resumes the\n // parked run.\n const taskExtId = notification?.conversation_ext_id ?? null\n const fromTask = !content && !!taskExtId\n const { data: pendingAuth, isLoading: pendingAuthLoading } = useConversationPendingAuth(\n taskExtId ?? undefined,\n { enabled: fromTask }\n )\n const requesterName =\n [requester?.given_name, requester?.family_name].filter(Boolean).join(' ') ||\n requester?.email ||\n 'Someone'\n\n // Workspaces the current user owns and holds a key for (i.e. can actually share).\n const ownedWorkspaces = useMemo(\n () =>\n workspaces.filter(\n (w) =>\n !!w.wrapped_key &&\n (w.created_by_ext_id === currentUserExtId ||\n w.users?.some((u) => u.user?.external_id === currentUserExtId && u.role === 'owner'))\n ),\n [workspaces, currentUserExtId]\n )\n\n const locked = !!workspaceExtId\n const [selectedWsId, setSelectedWsId] = useState<string>('')\n const [selectedRole, setSelectedRole] = useState<WorkspaceRole>('collaborator')\n const [note, setNote] = useState<string | undefined>(undefined)\n const [grantConfirmation, setGrantConfirmation] = useState<{\n workspace: string\n role: WorkspaceRole\n waitingTask: boolean\n } | null>(null)\n const [grantingKind, setGrantingKind] = useState<'temporary' | 'permanent' | null>(null)\n const [dismissing, setDismissing] = useState(false)\n\n // Reset transient state whenever the reviewed request changes.\n useEffect(() => {\n setNote(undefined)\n setGrantConfirmation(null)\n setSelectedWsId(workspaceExtId ?? '')\n setSelectedRole('collaborator')\n setAccessHours('24')\n }, [notification, workspaceExtId])\n\n // Intentionally NO auto-default for the dropdown: when the requester didn't\n // name a workspace, the owner must consciously pick one so they can't grant\n // the wrong workspace by reflexively clicking before reading.\n\n // Decrypt the request note for display (the session pubkey is read at grant time).\n useEffect(() => {\n let cancelled = false\n if (!notification || !requester || !content) return\n void openAccessRequest(content, requester.encryption_public_key).then((payload) => {\n if (!cancelled && payload) setNote(payload.note)\n })\n return () => {\n cancelled = true\n }\n }, [notification, content, requester])\n\n const grant = async (kind: 'temporary' | 'permanent') => {\n if (!requester) return\n if (kind === 'temporary' && selectedRole === 'owner') {\n notify('Temporary access can\u2019t be owner \u2014 pick another role or grant permanent', 'warning')\n return\n }\n const wsId = locked ? workspaceExtId! : selectedWsId\n if (!wsId) {\n notify('Pick a workspace to grant access to', 'warning')\n return\n }\n setGrantingKind(kind)\n try {\n const workspaceKey = await arbi.workspaces.sealKey(wsId).catch(() => null)\n if (!workspaceKey) {\n notify('Could not load the key for that workspace', 'error')\n return\n }\n\n let sessionPubkey: string | undefined\n if (kind === 'temporary' && !isExternal) {\n if (fromTask) {\n sessionPubkey = pendingAuth?.session_pubkey\n } else {\n const payload = await openAccessRequest(content, requester.encryption_public_key)\n sessionPubkey = payload?.session_pubkey_b64\n }\n if (!sessionPubkey) {\n notify('Request is missing a session key \u2014 grant permanent instead', 'warning')\n return\n }\n }\n\n const grantedMembers = await addWorkspaceUsers.mutateAsync({\n emails: [requester.email],\n role: selectedRole,\n workspace_key: workspaceKey,\n workspace_ext_id: wsId,\n ...(sessionPubkey ? { session_pubkey_b64: sessionPubkey } : {}),\n ...(isExternal ? { access_duration_seconds: Number(accessHours) * 3600 } : {}),\n })\n\n const wsName = workspaces.find((w) => w.external_id === wsId)?.name ?? 'the workspace'\n const grantedMember = Array.isArray(grantedMembers)\n ? grantedMembers.find((member) => member.user?.email === requester.email)\n : undefined\n const isAgent = requester.external_id.startsWith('agt-')\n const grantedRole = grantedMember?.role ?? (isAgent ? null : selectedRole)\n if (!grantedRole) {\n notify(\n 'No changed membership was returned. Check the existing workspace role before continuing.',\n 'warning'\n )\n return\n }\n const roleLabel = formatRole(grantedRole).toLowerCase()\n const expiresAt = grantedMember?.access_expires_at\n const needsAiUpgrade = grantedRole === 'guest'\n notify(\n kind === 'temporary'\n ? `Access granted.${expiresAt ? ` Expires ${formatAccessExpiry(expiresAt)}.` : ''}`\n : `Granted ${requesterName} ${roleLabel} access to ${wsName}`,\n 'success'\n )\n // The run was parked waiting for exactly this: resume it now the key is deposited.\n if (fromTask && kind === 'temporary' && taskExtId && !needsAiUpgrade) {\n try {\n await runNow.mutateAsync(taskExtId)\n } catch (err) {\n console.error('Granted access but could not resume the run', err)\n notify('Access granted, but the run could not resume. Run it again.', 'warning')\n }\n }\n // A Viewer grant does not fulfill an AI task's request; keep it available for an approved upgrade.\n if (notification && !(fromTask && needsAiUpgrade)) {\n try {\n await deleteNotifications.mutateAsync([notification.external_id])\n } catch (err) {\n console.error('Failed to clear fulfilled access request', err)\n }\n }\n if (isAgent && (!fromTask || needsAiUpgrade)) {\n setGrantConfirmation({ workspace: wsName, role: grantedRole, waitingTask: fromTask })\n } else {\n close()\n }\n } catch (err) {\n const e = err as { detail?: string; message?: string }\n notify(e?.detail || e?.message || 'Failed to grant access', 'error')\n } finally {\n setGrantingKind(null)\n }\n }\n\n // Dismiss = decline: drop the request entirely (bilateral delete) so it stops\n // nagging both sides. Distinct from closing the modal (X / click-outside),\n // which leaves the request pending for later.\n const dismiss = async () => {\n if (!notification) {\n close()\n return\n }\n setDismissing(true)\n try {\n await deleteNotifications.mutateAsync([notification.external_id])\n notify(`Dismissed ${requesterName}'s access request`, 'info')\n close()\n } catch (err) {\n const e = err as { detail?: string; message?: string }\n notify(e?.detail || e?.message || 'Failed to dismiss request', 'error')\n } finally {\n setDismissing(false)\n }\n }\n\n const busy = grantingKind !== null || dismissing\n const noWorkspace = !locked && ownedWorkspaces.length === 0\n // Nothing to grant until a workspace is actually selected (or locked in).\n const noSelection = !locked && !selectedWsId\n\n // External requests always receive fixed-expiry grants. Otherwise a request that names a\n // workspace is agent-initiated (e.g. the email gateway) \u2192 default to a short-lived,\n // session-scoped grant; a request with no workspace is user-initiated \u2192 the owner\n // deliberately picks a workspace and grants lasting access.\n const primaryKind: 'temporary' | 'permanent' = isExternal || locked ? 'temporary' : 'permanent'\n const secondaryKind: 'temporary' | 'permanent' = locked ? 'permanent' : 'temporary'\n // A temporary grant can never be owner \u2014 the key lives only in the requester's\n // session, so ownership (which manages membership) makes no sense there.\n const canGrant = (kind: 'temporary' | 'permanent') =>\n !(kind === 'temporary' && selectedRole === 'owner')\n // A task's temporary grant carries the run's session key: wait until it has loaded.\n const blocked = (kind: 'temporary' | 'permanent') =>\n busy ||\n noWorkspace ||\n noSelection ||\n !canGrant(kind) ||\n (kind === 'temporary' && fromTask && !isExternal && pendingAuthLoading)\n const kindLabel = (kind: 'temporary' | 'permanent') =>\n kind === 'temporary' ? 'temporary' : 'permanent'\n\n if (!notification || !requester) return null\n\n if (grantConfirmation) {\n return (\n <Dialog open onOpenChange={(o) => !o && close()}>\n <DialogContent presentation=\"sheet\" data-testid=\"grant-workspace-access-confirmation\">\n <DialogHeader>\n <DialogTitle>Access granted</DialogTitle>\n <DialogDescription>\n {formatRole(grantConfirmation.role)} access was granted to{' '}\n {grantConfirmation.workspace}.{' '}\n {grantConfirmation.role === 'guest' ? (\n <>\n This permits reading shared content, but not running AI in this workspace.{' '}\n {grantConfirmation.waitingTask\n ? 'The task is still waiting. Review this access request again and approve a Collaborator upgrade to run it.'\n : 'For workspace AI, ask the agent to request a Collaborator upgrade and approve it through the normal access review.'}\n </>\n ) : (\n <>\n Return to this chat and ask the agent to continue. The earlier response will not\n update automatically.\n </>\n )}\n </DialogDescription>\n </DialogHeader>\n <div className=\"flex justify-end\">\n <Button onClick={close}>Done</Button>\n </div>\n </DialogContent>\n </Dialog>\n )\n }\n\n return (\n <Dialog open onOpenChange={(o) => !o && close()}>\n <DialogContent presentation=\"sheet\" data-testid=\"grant-workspace-access-modal\">\n <DialogHeader>\n <DialogTitle>{requesterName} requested workspace access</DialogTitle>\n <DialogDescription>\n {locked\n ? `Grant ${requesterName} access to this workspace.`\n : `Grant ${requesterName} access to one of your workspaces.`}\n </DialogDescription>\n </DialogHeader>\n\n <ModalSection className=\"space-y-3\">\n {/* The requester's note, surfaced clearly (decrypted from the request). */}\n {note ? (\n <div className=\"rounded-md border-l-2 border-primary/50 bg-muted/40 px-3 py-2\">\n <ModalSectionTitle>Note from {requesterName}</ModalSectionTitle>\n <p\n className=\"whitespace-pre-wrap text-sm italic text-foreground\"\n data-testid=\"access-request-note\"\n >\n \u201C{note}\u201D\n </p>\n </div>\n ) : (\n <p className=\"text-xs text-muted-foreground\">No note was included with this request.</p>\n )}\n\n {locked ? (\n <div>\n <ModalSectionTitle>Workspace</ModalSectionTitle>\n <div className=\"rounded-lg bg-muted px-3 py-2 text-sm\">\n {workspaces.find((w) => w.external_id === workspaceExtId)?.name ?? workspaceExtId}\n </div>\n </div>\n ) : noWorkspace ? (\n <p className=\"text-sm text-muted-foreground\">\n You don\u2019t own a workspace you can share. Create one first.\n </p>\n ) : (\n <div>\n <ModalSectionTitle>Workspace</ModalSectionTitle>\n <Select value={selectedWsId} onValueChange={setSelectedWsId} disabled={busy}>\n <SelectTrigger data-testid=\"grant-workspace-select\">\n <SelectValue placeholder=\"Select a workspace\" />\n </SelectTrigger>\n <SelectContent>\n {ownedWorkspaces.map((w) => (\n <SelectItem key={w.external_id} value={w.external_id}>\n {w.name}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n )}\n\n {!noWorkspace && (\n <div>\n <ModalSectionTitle>Role</ModalSectionTitle>\n <Select\n value={selectedRole}\n onValueChange={(v) => setSelectedRole(v as WorkspaceRole)}\n disabled={busy}\n >\n <SelectTrigger data-testid=\"grant-role-select\">\n <SelectValue>\n <Badge variant=\"default\" className={getRoleBadgeClass(selectedRole)}>\n {formatRole(selectedRole)}\n </Badge>\n </SelectValue>\n </SelectTrigger>\n <SelectContent>\n {GRANTABLE_ROLES.filter((role) => !isExternal || role.value !== 'owner').map(\n (role) => (\n <SelectItem key={role.value} value={role.value}>\n <Badge variant=\"default\" className={getRoleBadgeClass(role.value)}>\n {role.label}\n </Badge>\n </SelectItem>\n )\n )}\n </SelectContent>\n </Select>\n <p className=\"mt-1.5 text-xs text-muted-foreground\">\n {getRoleDescription(selectedRole)}\n </p>\n {!canGrant(primaryKind) && (\n <p className=\"mt-1 text-xs text-yellow-text\" data-testid=\"owner-temporary-warning\">\n Temporary access can\u2019t be owner \u2014 pick another role or grant permanent.\n </p>\n )}\n </div>\n )}\n </ModalSection>\n\n {isExternal && (\n <ModalSection className=\"space-y-2\">\n <ModalSectionTitle>Access duration</ModalSectionTitle>\n <Select value={accessHours} onValueChange={setAccessHours} disabled={busy}>\n <SelectTrigger data-testid=\"grant-access-duration\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n <SelectItem value=\"1\">1 hour</SelectItem>\n <SelectItem value=\"4\">4 hours</SelectItem>\n <SelectItem value=\"24\">24 hours</SelectItem>\n </SelectContent>\n </Select>\n </ModalSection>\n )}\n <div className=\"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-end\">\n <Button\n variant=\"ghost\"\n onClick={dismiss}\n disabled={busy}\n className=\"sm:mr-auto\"\n data-testid=\"dismiss-access-request-button\"\n >\n {dismissing ? 'Dismissing\u2026' : 'Dismiss'}\n </Button>\n\n {!noWorkspace && (\n <>\n {/* Secondary, deliberately understated \u2014 the non-default grant kind. */}\n {!isExternal && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => grant(secondaryKind)}\n disabled={blocked(secondaryKind)}\n className=\"text-xs text-muted-foreground hover:text-foreground\"\n data-testid={`grant-${secondaryKind}-button`}\n >\n {grantingKind === secondaryKind\n ? 'Granting\u2026'\n : `Grant ${kindLabel(secondaryKind)} instead`}\n </Button>\n )}\n\n {/* Primary CTA \u2014 always \"Grant access\", performs the flow default. */}\n <Button\n onClick={() => grant(primaryKind)}\n disabled={blocked(primaryKind)}\n data-testid={`grant-${primaryKind}-button`}\n >\n {primaryKind === 'temporary' ? (\n <Clock className=\"mr-2 h-4 w-4\" />\n ) : (\n <InfinityIcon className=\"mr-2 h-4 w-4\" />\n )}\n {grantingKind === primaryKind ? 'Granting\u2026' : 'Grant access'}\n </Button>\n </>\n )}\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAyTY,SAKI,UALJ,KAKI,YALJ;AA9RZ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,WAAW,SAAS,gBAAgB;AAC7C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,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C7B,eAAa,SAAS,WAAW;AAAA,YAEhC;AAAA,8BAAgB,cACf,oBAAC,SAAM,WAAU,gBAAe,IAEhC,oBAAC,gBAAa,WAAU,gBAAe;AAAA,cAExC,iBAAiB,cAAc,mBAAc;AAAA;AAAA;AAAA,QAChD;AAAA,SACF;AAAA,OAEJ;AAAA,KACF,GACF;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/docx/index.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunk2BOTSU23_cjs = require('../chunk-2BOTSU23.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunkJKTUL4L3_cjs = require('../chunk-JKTUL4L3.cjs');
|
|
6
|
+
var chunkKULGPKLY_cjs = require('../chunk-KULGPKLY.cjs');
|
|
7
|
+
var chunkG2B2BWE5_cjs = require('../chunk-G2B2BWE5.cjs');
|
|
8
8
|
var chunkGA5ZO4YA_cjs = require('../chunk-GA5ZO4YA.cjs');
|
|
9
9
|
var chunkVG5XNE4H_cjs = require('../chunk-VG5XNE4H.cjs');
|
|
10
10
|
require('../chunk-DDWLMYRO.cjs');
|
|
@@ -27,143 +27,143 @@ Object.defineProperty(exports, "loadDocxFonts", {
|
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "StreamedWordArtifact", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkJKTUL4L3_cjs.StreamedWordArtifact; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "NativeDocxComparison", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkKULGPKLY_cjs.NativeDocxComparison; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "CrossReferencesProvider", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunkG2B2BWE5_cjs.CrossReferencesProvider; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "DEFAULT_CROSS_REFERENCES_LABELS", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunkG2B2BWE5_cjs.DEFAULT_CROSS_REFERENCES_LABELS; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "DEFAULT_DEFINED_TERMS_LABELS", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunkG2B2BWE5_cjs.DEFAULT_DEFINED_TERMS_LABELS; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "DEFINED_TERM_TRIGGER", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunkG2B2BWE5_cjs.DEFINED_TERM_TRIGGER; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "DefinedTermsProvider", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunkG2B2BWE5_cjs.DefinedTermsProvider; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "DocxCommentActivity", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunkG2B2BWE5_cjs.DocxCommentActivity; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "DocxEditorReview", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunkG2B2BWE5_cjs.DocxEditorReview; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "DocxMentions", {
|
|
65
65
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunkG2B2BWE5_cjs.DocxMentions; }
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, "DocxParticipants", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunkG2B2BWE5_cjs.DocxParticipants; }
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "DocxRibbon", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunkG2B2BWE5_cjs.DocxRibbon; }
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, "GenerateImageButton", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunkG2B2BWE5_cjs.GenerateImageButton; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "LinkHoverCard", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunkG2B2BWE5_cjs.LinkHoverCard; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "NativeDocxEditor", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunkG2B2BWE5_cjs.NativeDocxEditor; }
|
|
87
87
|
});
|
|
88
88
|
Object.defineProperty(exports, "SignatureFieldMenu", {
|
|
89
89
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunkG2B2BWE5_cjs.SignatureFieldMenu; }
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "SignatureFieldsProvider", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunkG2B2BWE5_cjs.SignatureFieldsProvider; }
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "editorPort", {
|
|
97
97
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunkG2B2BWE5_cjs.editorPort; }
|
|
99
99
|
});
|
|
100
100
|
Object.defineProperty(exports, "findDefinitionsSection", {
|
|
101
101
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunkG2B2BWE5_cjs.findDefinitionsSection; }
|
|
103
103
|
});
|
|
104
104
|
Object.defineProperty(exports, "insertCrossReference", {
|
|
105
105
|
enumerable: true,
|
|
106
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunkG2B2BWE5_cjs.insertCrossReference; }
|
|
107
107
|
});
|
|
108
108
|
Object.defineProperty(exports, "insertDefinedTerm", {
|
|
109
109
|
enumerable: true,
|
|
110
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunkG2B2BWE5_cjs.insertDefinedTerm; }
|
|
111
111
|
});
|
|
112
112
|
Object.defineProperty(exports, "insertDocumentReference", {
|
|
113
113
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunkG2B2BWE5_cjs.insertDocumentReference; }
|
|
115
115
|
});
|
|
116
116
|
Object.defineProperty(exports, "insertSignatureField", {
|
|
117
117
|
enumerable: true,
|
|
118
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunkG2B2BWE5_cjs.insertSignatureField; }
|
|
119
119
|
});
|
|
120
120
|
Object.defineProperty(exports, "listTargets", {
|
|
121
121
|
enumerable: true,
|
|
122
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunkG2B2BWE5_cjs.listTargets; }
|
|
123
123
|
});
|
|
124
124
|
Object.defineProperty(exports, "normalizeDocxExport", {
|
|
125
125
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunkG2B2BWE5_cjs.normalizeDocxExport; }
|
|
127
127
|
});
|
|
128
128
|
Object.defineProperty(exports, "paragraphNumber", {
|
|
129
129
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunkG2B2BWE5_cjs.paragraphNumber; }
|
|
131
131
|
});
|
|
132
132
|
Object.defineProperty(exports, "referenceText", {
|
|
133
133
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunkG2B2BWE5_cjs.referenceText; }
|
|
135
135
|
});
|
|
136
136
|
Object.defineProperty(exports, "referencesPort", {
|
|
137
137
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunkG2B2BWE5_cjs.referencesPort; }
|
|
139
139
|
});
|
|
140
140
|
Object.defineProperty(exports, "reviewModule", {
|
|
141
141
|
enumerable: true,
|
|
142
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunkG2B2BWE5_cjs.reviewModule; }
|
|
143
143
|
});
|
|
144
144
|
Object.defineProperty(exports, "shortTitle", {
|
|
145
145
|
enumerable: true,
|
|
146
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunkG2B2BWE5_cjs.shortTitle; }
|
|
147
147
|
});
|
|
148
148
|
Object.defineProperty(exports, "useCrossReferences", {
|
|
149
149
|
enumerable: true,
|
|
150
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunkG2B2BWE5_cjs.useCrossReferences; }
|
|
151
151
|
});
|
|
152
152
|
Object.defineProperty(exports, "useDefinedTerms", {
|
|
153
153
|
enumerable: true,
|
|
154
|
-
get: function () { return
|
|
154
|
+
get: function () { return chunkG2B2BWE5_cjs.useDefinedTerms; }
|
|
155
155
|
});
|
|
156
156
|
Object.defineProperty(exports, "useReview", {
|
|
157
157
|
enumerable: true,
|
|
158
|
-
get: function () { return
|
|
158
|
+
get: function () { return chunkG2B2BWE5_cjs.useReview; }
|
|
159
159
|
});
|
|
160
160
|
Object.defineProperty(exports, "useReviewItem", {
|
|
161
161
|
enumerable: true,
|
|
162
|
-
get: function () { return
|
|
162
|
+
get: function () { return chunkG2B2BWE5_cjs.useReviewItem; }
|
|
163
163
|
});
|
|
164
164
|
Object.defineProperty(exports, "withDirectEditing", {
|
|
165
165
|
enumerable: true,
|
|
166
|
-
get: function () { return
|
|
166
|
+
get: function () { return chunkG2B2BWE5_cjs.withDirectEditing; }
|
|
167
167
|
});
|
|
168
168
|
Object.defineProperty(exports, "DocxAuthorContext", {
|
|
169
169
|
enumerable: true,
|
|
@@ -160,6 +160,11 @@ function ReplyForm({
|
|
|
160
160
|
event.preventDefault();
|
|
161
161
|
event.stopPropagation();
|
|
162
162
|
onDismiss();
|
|
163
|
+
} else if (event.key === "Enter" && !event.nativeEvent.isComposing) {
|
|
164
|
+
event.preventDefault();
|
|
165
|
+
event.stopPropagation();
|
|
166
|
+
const value = event.currentTarget.value.trim();
|
|
167
|
+
if (value && review.reply(entry, value)) setText("");
|
|
163
168
|
}
|
|
164
169
|
}
|
|
165
170
|
}
|
|
@@ -337,6 +342,11 @@ function Draft({
|
|
|
337
342
|
event.preventDefault();
|
|
338
343
|
event.stopPropagation();
|
|
339
344
|
onCancel();
|
|
345
|
+
} else if (event.key === "Enter" && !event.nativeEvent.isComposing) {
|
|
346
|
+
event.preventDefault();
|
|
347
|
+
event.stopPropagation();
|
|
348
|
+
const value = event.currentTarget.value.trim();
|
|
349
|
+
if (value) onSubmit(value);
|
|
340
350
|
}
|
|
341
351
|
}
|
|
342
352
|
}
|