@arbidocs/blocks 0.4.20 → 0.4.22
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/agents/definitions/AgentCard.d.ts +4 -1
- package/dist/agents/index.cjs +211 -211
- package/dist/agents/index.js +5 -5
- package/dist/chat/ChatPage.d.ts +1 -1
- package/dist/chat/chat-page-types.d.ts +2 -0
- package/dist/chat/index.cjs +169 -168
- package/dist/chat/index.js +3 -2
- package/dist/chunk-5TRALRWN.js +42 -0
- package/dist/chunk-5TRALRWN.js.map +1 -0
- package/dist/chunk-7UTB4PHM.cjs +300 -0
- package/dist/chunk-7UTB4PHM.cjs.map +1 -0
- package/dist/chunk-AA3PT6KR.js +286 -0
- package/dist/chunk-AA3PT6KR.js.map +1 -0
- package/dist/{chunk-QJEJBLHI.js → chunk-CQ6CYPV4.js} +7 -281
- package/dist/chunk-CQ6CYPV4.js.map +1 -0
- package/dist/chunk-EUOGPUMJ.cjs +59 -0
- package/dist/chunk-EUOGPUMJ.cjs.map +1 -0
- package/dist/{chunk-PRVKJ5XL.cjs → chunk-J22DXUJY.cjs} +4 -3
- package/dist/chunk-J22DXUJY.cjs.map +1 -0
- package/dist/{chunk-ZPOLKYR2.cjs → chunk-JCVZKCXC.cjs} +22 -69
- package/dist/chunk-JCVZKCXC.cjs.map +1 -0
- package/dist/{chunk-557EU3G4.js → chunk-JLOYWXRB.js} +3 -3
- package/dist/{chunk-557EU3G4.js.map → chunk-JLOYWXRB.js.map} +1 -1
- package/dist/{chunk-UVIOQUJA.js → chunk-JLPYOPCX.js} +4 -3
- package/dist/chunk-JLPYOPCX.js.map +1 -0
- package/dist/{chunk-4TBZRZFC.js → chunk-MLJDOH3B.js} +23 -6
- package/dist/chunk-MLJDOH3B.js.map +1 -0
- package/dist/chunk-NNH7N62N.cjs +876 -0
- package/dist/chunk-NNH7N62N.cjs.map +1 -0
- package/dist/{chunk-7Q6RBXIV.cjs → chunk-OEQXYWUO.cjs} +22 -5
- package/dist/chunk-OEQXYWUO.cjs.map +1 -0
- package/dist/{chunk-J4AOAFZF.cjs → chunk-TL2DHSC5.cjs} +11 -297
- package/dist/chunk-TL2DHSC5.cjs.map +1 -0
- package/dist/chunk-UOLMFC5K.js +846 -0
- package/dist/chunk-UOLMFC5K.js.map +1 -0
- package/dist/{chunk-DCEI37AX.cjs → chunk-YVIOCITQ.cjs} +3 -3
- package/dist/{chunk-DCEI37AX.cjs.map → chunk-YVIOCITQ.cjs.map} +1 -1
- package/dist/{chunk-S74WZNK7.js → chunk-ZEIOREJY.js} +5 -36
- package/dist/chunk-ZEIOREJY.js.map +1 -0
- package/dist/connect/docx.cjs +86 -0
- package/dist/connect/docx.cjs.map +1 -0
- package/dist/connect/docx.d.ts +1 -0
- package/dist/connect/docx.js +84 -0
- package/dist/connect/docx.js.map +1 -0
- package/dist/connect/index.cjs +136 -69
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +91 -25
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectedNativeDocxEditor.d.ts +5 -0
- package/dist/connection/useConnectedDocxNotifications.d.ts +9 -0
- package/dist/docx/DocxMentions.d.ts +17 -0
- package/dist/docx/NativeDocxComparison.d.ts +10 -0
- package/dist/docx/NativeDocxEditor.d.ts +50 -0
- package/dist/docx/export.d.ts +2 -0
- package/dist/docx/fonts.d.ts +2 -0
- package/dist/docx/index.cjs +116 -0
- package/dist/docx/index.cjs.map +1 -0
- package/dist/docx/index.d.ts +10 -0
- package/dist/docx/index.js +63 -0
- package/dist/docx/index.js.map +1 -0
- package/dist/docx/mentions.d.ts +8 -0
- package/dist/facts/index.cjs +1 -1
- package/dist/facts/index.js +1 -1
- package/dist/files/index.cjs +5 -5
- package/dist/files/index.js +6 -6
- package/dist/index.cjs +795 -794
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -16
- package/dist/index.js.map +1 -1
- package/dist/settings/index.cjs +41 -41
- package/dist/settings/index.js +4 -4
- package/dist/shell/index.cjs +9 -9
- package/dist/shell/index.js +1 -1
- package/dist/site/index.cjs +13 -13
- package/dist/site/index.js +1 -1
- package/dist/studio/index.cjs +6 -5
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +4 -3
- package/dist/studio/index.js.map +1 -1
- package/dist/workspaces/index.cjs +2 -2
- package/dist/workspaces/index.js +2 -2
- package/package.json +48 -7
- package/src/docx/README.md +68 -0
- package/src/docx/styles.css +36 -0
- package/dist/chunk-4TBZRZFC.js.map +0 -1
- package/dist/chunk-7Q6RBXIV.cjs.map +0 -1
- package/dist/chunk-J4AOAFZF.cjs.map +0 -1
- package/dist/chunk-PRVKJ5XL.cjs.map +0 -1
- package/dist/chunk-QJEJBLHI.js.map +0 -1
- package/dist/chunk-S74WZNK7.js.map +0 -1
- package/dist/chunk-UVIOQUJA.js.map +0 -1
- package/dist/chunk-ZPOLKYR2.cjs.map +0 -1
package/dist/connect/index.cjs
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkEUOGPUMJ_cjs = require('../chunk-EUOGPUMJ.cjs');
|
|
5
|
+
var chunkYVIOCITQ_cjs = require('../chunk-YVIOCITQ.cjs');
|
|
6
6
|
var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
|
|
7
7
|
require('../chunk-ADOKTJHV.cjs');
|
|
8
|
-
require('../chunk-
|
|
8
|
+
require('../chunk-J22DXUJY.cjs');
|
|
9
9
|
require('../chunk-VGOFFCMT.cjs');
|
|
10
|
-
require('../chunk-DCDVWPMB.cjs');
|
|
11
10
|
require('../chunk-PPCATBOY.cjs');
|
|
12
11
|
var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
|
|
12
|
+
require('../chunk-DCDVWPMB.cjs');
|
|
13
|
+
var chunkJCVZKCXC_cjs = require('../chunk-JCVZKCXC.cjs');
|
|
13
14
|
require('../chunk-MHVNT4J3.cjs');
|
|
14
15
|
var react = require('react');
|
|
15
16
|
var reactQuery = require('@tanstack/react-query');
|
|
@@ -20,7 +21,7 @@ var lucideReact = require('lucide-react');
|
|
|
20
21
|
var ui = require('@arbidocs/react/ui');
|
|
21
22
|
|
|
22
23
|
function ConnectionBoundWebSocket({ children }) {
|
|
23
|
-
const { status } =
|
|
24
|
+
const { status } = chunkJCVZKCXC_cjs.useConnection();
|
|
24
25
|
return /* @__PURE__ */ jsxRuntime.jsx(react$1.ArbiWebSocketProvider, { enabled: status === "authenticated", children });
|
|
25
26
|
}
|
|
26
27
|
function ArbiAppProvider({
|
|
@@ -33,7 +34,7 @@ function ArbiAppProvider({
|
|
|
33
34
|
})
|
|
34
35
|
);
|
|
35
36
|
const providerUrl = config.apiUrl || config.demoApiUrl || "https://demo.arbi.local";
|
|
36
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.ArbiProvider, { url: providerUrl, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactQuery.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsxRuntime.jsx(react$1.ArbiProvider, { url: providerUrl, children: /* @__PURE__ */ jsxRuntime.jsx(chunkJCVZKCXC_cjs.ConnectionProvider, { config, children: /* @__PURE__ */ jsxRuntime.jsx(ConnectionBoundWebSocket, { children }) }) }) });
|
|
37
38
|
}
|
|
38
39
|
var StreamedArtifactEditor = react.lazy(() => import('../StreamedArtifactEditor-L2AZZORU.cjs'));
|
|
39
40
|
function StreamedArtifact({
|
|
@@ -107,7 +108,7 @@ function StreamedArtifact({
|
|
|
107
108
|
);
|
|
108
109
|
}
|
|
109
110
|
function useConnectedShellWorkspaces(options = {}) {
|
|
110
|
-
const { workspaceId, setWorkspace } =
|
|
111
|
+
const { workspaceId, setWorkspace } = chunkJCVZKCXC_cjs.useConnection();
|
|
111
112
|
const query = react$1.useWorkspaces();
|
|
112
113
|
return react$1.useShellWorkspaces({
|
|
113
114
|
...options,
|
|
@@ -127,21 +128,21 @@ var AVATAR_PROBLEMS = {
|
|
|
127
128
|
"too-large": "Image must be 5 MB or smaller",
|
|
128
129
|
unreadable: "Couldn't read that image \u2014 try a different file"
|
|
129
130
|
};
|
|
130
|
-
function ConnectedProfileCard({ notify, title = "Profile" }) {
|
|
131
|
+
function ConnectedProfileCard({ notify: notify2, title = "Profile" }) {
|
|
131
132
|
const { data: profile } = react$1.useProfile();
|
|
132
133
|
const updateProfile = react$1.useUpdateProfile();
|
|
133
134
|
const requestEmailChange = react$1.useRequestEmailChange();
|
|
134
135
|
const confirmEmailChange = react$1.useConfirmEmailChange();
|
|
135
|
-
const { user } =
|
|
136
|
+
const { user } = chunkJCVZKCXC_cjs.useConnection();
|
|
136
137
|
const name = react$1.useNameEditor({
|
|
137
138
|
givenName: profile?.givenName,
|
|
138
139
|
familyName: profile?.familyName,
|
|
139
140
|
save: async (next) => {
|
|
140
141
|
try {
|
|
141
142
|
await updateProfile.mutateAsync(next);
|
|
142
|
-
|
|
143
|
+
notify2?.("Name updated", "success");
|
|
143
144
|
} catch (e) {
|
|
144
|
-
|
|
145
|
+
notify2?.("Failed to update name", "error");
|
|
145
146
|
throw e;
|
|
146
147
|
}
|
|
147
148
|
}
|
|
@@ -150,41 +151,41 @@ function ConnectedProfileCard({ notify, title = "Profile" }) {
|
|
|
150
151
|
upload: async (picture) => {
|
|
151
152
|
try {
|
|
152
153
|
await updateProfile.mutateAsync({ picture });
|
|
153
|
-
|
|
154
|
+
notify2?.("Profile picture updated", "success");
|
|
154
155
|
} catch (e) {
|
|
155
|
-
|
|
156
|
+
notify2?.("Failed to update picture", "error");
|
|
156
157
|
throw e;
|
|
157
158
|
}
|
|
158
159
|
},
|
|
159
|
-
onProblem: (problem) =>
|
|
160
|
+
onProblem: (problem) => notify2?.(AVATAR_PROBLEMS[problem], "error")
|
|
160
161
|
});
|
|
161
162
|
const email = react$1.useEmailChange({
|
|
162
163
|
requestCode: async (address) => {
|
|
163
164
|
try {
|
|
164
165
|
await requestEmailChange.mutateAsync(address);
|
|
165
|
-
|
|
166
|
+
notify2?.("Verification code sent to your new email", "success");
|
|
166
167
|
} catch (e) {
|
|
167
|
-
|
|
168
|
+
notify2?.(errorText(e, "Failed to send verification code"), "error");
|
|
168
169
|
throw e;
|
|
169
170
|
}
|
|
170
171
|
},
|
|
171
172
|
confirm: async (args) => {
|
|
172
173
|
try {
|
|
173
174
|
await confirmEmailChange.mutateAsync(args);
|
|
174
|
-
|
|
175
|
+
notify2?.("Email address updated", "success");
|
|
175
176
|
} catch (e) {
|
|
176
|
-
|
|
177
|
+
notify2?.(errorText(e, "Invalid or expired verification code"), "error");
|
|
177
178
|
throw e;
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
181
|
});
|
|
181
182
|
const display = profile?.fullName || user?.name || "Unnamed";
|
|
182
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
183
|
-
|
|
183
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkYVIOCITQ_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCircle, {}), title, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
184
|
+
chunkYVIOCITQ_cjs.ProfileCard,
|
|
184
185
|
{
|
|
185
186
|
avatar: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
186
187
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
187
|
-
|
|
188
|
+
chunkYVIOCITQ_cjs.AvatarPicker,
|
|
188
189
|
{
|
|
189
190
|
pictureUrl: profile?.picture ?? user?.picture,
|
|
190
191
|
initials: chunkKDG6FER6_cjs.initials(display),
|
|
@@ -224,7 +225,7 @@ function defaultUnmetPasswordRequirement(password) {
|
|
|
224
225
|
return null;
|
|
225
226
|
}
|
|
226
227
|
function ConnectedSecuritySection({
|
|
227
|
-
notify,
|
|
228
|
+
notify: notify2,
|
|
228
229
|
getUnmetRequirement = defaultUnmetPasswordRequirement,
|
|
229
230
|
renderRecoveryKey,
|
|
230
231
|
children
|
|
@@ -237,15 +238,15 @@ function ConnectedSecuritySection({
|
|
|
237
238
|
getUnmetRequirement,
|
|
238
239
|
submit: async (vars) => {
|
|
239
240
|
const result = await change.mutateAsync(vars);
|
|
240
|
-
|
|
241
|
+
notify2?.("Password changed successfully", "success");
|
|
241
242
|
return result;
|
|
242
243
|
},
|
|
243
244
|
onClose: () => setOpen(false)
|
|
244
245
|
});
|
|
245
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
246
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
246
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunkYVIOCITQ_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.KeyRound, {}), title: "Security", children: [
|
|
247
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkYVIOCITQ_cjs.SettingsCard, { padding: "sm", children: [
|
|
247
248
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
248
|
-
|
|
249
|
+
chunkYVIOCITQ_cjs.SettingsActionRow,
|
|
249
250
|
{
|
|
250
251
|
title: "Change password",
|
|
251
252
|
description: "Used to sign in and to encrypt your data. Changing it re-encrypts everything in your account.",
|
|
@@ -256,7 +257,7 @@ function ConnectedSecuritySection({
|
|
|
256
257
|
children
|
|
257
258
|
] }),
|
|
258
259
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
259
|
-
|
|
260
|
+
chunkYVIOCITQ_cjs.PasswordChangeDialog,
|
|
260
261
|
{
|
|
261
262
|
open,
|
|
262
263
|
onClose: form.onCancel,
|
|
@@ -280,29 +281,29 @@ function ConnectedSecuritySection({
|
|
|
280
281
|
] });
|
|
281
282
|
}
|
|
282
283
|
function ConnectedNotificationPreferences({
|
|
283
|
-
categories =
|
|
284
|
+
categories = chunkYVIOCITQ_cjs.EMAIL_NOTIFICATION_CATEGORIES,
|
|
284
285
|
title = "Notifications"
|
|
285
286
|
}) {
|
|
286
287
|
const keys = react.useMemo(
|
|
287
|
-
() => categories ===
|
|
288
|
+
() => categories === chunkYVIOCITQ_cjs.EMAIL_NOTIFICATION_CATEGORIES ? chunkYVIOCITQ_cjs.EMAIL_NOTIFICATION_KEYS : categories.map((c) => c.key),
|
|
288
289
|
[categories]
|
|
289
290
|
);
|
|
290
291
|
const prefs = react$1.useNotificationPreferences(keys);
|
|
291
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
292
|
-
|
|
292
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkYVIOCITQ_cjs.SettingsSection, { title, children: /* @__PURE__ */ jsxRuntime.jsx(chunkYVIOCITQ_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
293
|
+
chunkYVIOCITQ_cjs.NotificationCategoryList,
|
|
293
294
|
{
|
|
294
295
|
masterId: "emailNotifications",
|
|
295
296
|
masterTitle: "Email Notifications",
|
|
296
297
|
masterDescription: "Email me about activity when I\u2019m away",
|
|
297
298
|
masterChecked: prefs.masterChecked,
|
|
298
299
|
onMasterChange: prefs.setAll,
|
|
299
|
-
categories:
|
|
300
|
+
categories: chunkYVIOCITQ_cjs.toNotificationCategories(prefs.checked, categories),
|
|
300
301
|
onCategoryChange: prefs.setCategory
|
|
301
302
|
}
|
|
302
303
|
) }) });
|
|
303
304
|
}
|
|
304
305
|
function ConnectedSessionsRow({
|
|
305
|
-
notify,
|
|
306
|
+
notify: notify2,
|
|
306
307
|
confirm,
|
|
307
308
|
renderSessionIcon
|
|
308
309
|
}) {
|
|
@@ -310,14 +311,14 @@ function ConnectedSessionsRow({
|
|
|
310
311
|
const sessions = react$1.useSessions({ enabled: open });
|
|
311
312
|
const currentSessionId = react$1.useCurrentSessionId();
|
|
312
313
|
const terminate = react$1.useTerminateSession();
|
|
313
|
-
const views =
|
|
314
|
+
const views = chunkYVIOCITQ_cjs.toActiveSessionViews(sessions.data ?? [], {
|
|
314
315
|
currentSessionId,
|
|
315
316
|
terminatingId: terminate.isPending ? terminate.variables : null,
|
|
316
317
|
renderIcon: renderSessionIcon
|
|
317
318
|
});
|
|
318
319
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
319
320
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
320
|
-
|
|
321
|
+
chunkYVIOCITQ_cjs.SettingsRow,
|
|
321
322
|
{
|
|
322
323
|
label: "Active sessions",
|
|
323
324
|
description: "Devices and agents currently signed in to your account.",
|
|
@@ -339,7 +340,7 @@ function ConnectedSessionsRow({
|
|
|
339
340
|
}
|
|
340
341
|
),
|
|
341
342
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
342
|
-
|
|
343
|
+
chunkYVIOCITQ_cjs.ActiveSessionsDialog,
|
|
343
344
|
{
|
|
344
345
|
open,
|
|
345
346
|
onOpenChange: setOpen,
|
|
@@ -356,7 +357,7 @@ function ConnectedSessionsRow({
|
|
|
356
357
|
try {
|
|
357
358
|
await terminate.mutateAsync(id);
|
|
358
359
|
} catch {
|
|
359
|
-
|
|
360
|
+
notify2?.("Failed to end session. Please try again.", "error");
|
|
360
361
|
}
|
|
361
362
|
})();
|
|
362
363
|
}
|
|
@@ -370,11 +371,11 @@ function ConnectedLogoutDialog({
|
|
|
370
371
|
isOnline = true,
|
|
371
372
|
renderSessionIcon
|
|
372
373
|
}) {
|
|
373
|
-
const { logout } =
|
|
374
|
+
const { logout } = chunkJCVZKCXC_cjs.useConnection();
|
|
374
375
|
const sessions = react$1.useSessions({ enabled: open });
|
|
375
376
|
const logoutAll = react$1.useLogoutAllSessions();
|
|
376
377
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
377
|
-
|
|
378
|
+
chunkYVIOCITQ_cjs.LogoutDialog,
|
|
378
379
|
{
|
|
379
380
|
open,
|
|
380
381
|
onClose,
|
|
@@ -388,26 +389,26 @@ function ConnectedLogoutDialog({
|
|
|
388
389
|
},
|
|
389
390
|
canLogoutAll: true,
|
|
390
391
|
isOnline,
|
|
391
|
-
sessions:
|
|
392
|
+
sessions: chunkYVIOCITQ_cjs.toLogoutSessionViews(sessions.data ?? []),
|
|
392
393
|
renderSessionIcon
|
|
393
394
|
}
|
|
394
395
|
);
|
|
395
396
|
}
|
|
396
|
-
function ConnectedDangerZone({ notify, renderSubscriptionLink }) {
|
|
397
|
+
function ConnectedDangerZone({ notify: notify2, renderSubscriptionLink }) {
|
|
397
398
|
const [zoneOpen, setZoneOpen] = react.useState(false);
|
|
398
399
|
const [dialogOpen, setDialogOpen] = react.useState(false);
|
|
399
|
-
const { user, logout } =
|
|
400
|
+
const { user, logout } = chunkJCVZKCXC_cjs.useConnection();
|
|
400
401
|
const remove = react$1.useDeleteAccount();
|
|
401
402
|
const flow = react$1.useDeleteAccountFlow({
|
|
402
403
|
userEmail: user?.email ?? "",
|
|
403
404
|
remove: () => remove.mutateAsync(),
|
|
404
405
|
onClose: () => setDialogOpen(false),
|
|
405
406
|
onDeleted: logout,
|
|
406
|
-
onError: () =>
|
|
407
|
+
onError: () => notify2?.("Failed to delete account. Please try again.", "error")
|
|
407
408
|
});
|
|
408
409
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
409
410
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
410
|
-
|
|
411
|
+
chunkYVIOCITQ_cjs.SettingsDangerZone,
|
|
411
412
|
{
|
|
412
413
|
isOpen: zoneOpen,
|
|
413
414
|
onToggle: () => setZoneOpen((o) => !o),
|
|
@@ -427,12 +428,12 @@ function ConnectedDangerZone({ notify, renderSubscriptionLink }) {
|
|
|
427
428
|
}
|
|
428
429
|
),
|
|
429
430
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
430
|
-
|
|
431
|
+
chunkYVIOCITQ_cjs.DeleteAccountDialog,
|
|
431
432
|
{
|
|
432
433
|
open: dialogOpen,
|
|
433
434
|
onClose: flow.onClose,
|
|
434
435
|
step: flow.step,
|
|
435
|
-
blockers:
|
|
436
|
+
blockers: chunkYVIOCITQ_cjs.toDeleteBlockerViews(flow.blockers, renderSubscriptionLink),
|
|
436
437
|
onContinue: flow.onContinue,
|
|
437
438
|
onBack: flow.onBack,
|
|
438
439
|
userEmail: user?.email ?? "",
|
|
@@ -444,54 +445,119 @@ function ConnectedDangerZone({ notify, renderSubscriptionLink }) {
|
|
|
444
445
|
)
|
|
445
446
|
] });
|
|
446
447
|
}
|
|
448
|
+
function useConnectedDocxNotifications(onOpen) {
|
|
449
|
+
const arbi = react$1.useArbi();
|
|
450
|
+
const { status, user, apiUrl } = chunkJCVZKCXC_cjs.useConnection();
|
|
451
|
+
const queries = reactQuery.useQueryClient();
|
|
452
|
+
const source = `docx-mentions:${apiUrl}:${user?.externalId || ""}`;
|
|
453
|
+
const queryKey = ["docx-mentions", apiUrl, user?.externalId];
|
|
454
|
+
const { data = [] } = reactQuery.useQuery({
|
|
455
|
+
queryKey,
|
|
456
|
+
queryFn: () => arbi.notifications.list("docx_mention"),
|
|
457
|
+
enabled: status === "authenticated",
|
|
458
|
+
refetchInterval: 3e4
|
|
459
|
+
});
|
|
460
|
+
react$1.useArbiWebSocket((message) => {
|
|
461
|
+
if (message.type === "docx_mention") void queries.invalidateQueries({ queryKey });
|
|
462
|
+
});
|
|
463
|
+
react.useEffect(() => {
|
|
464
|
+
const items = [];
|
|
465
|
+
if (status === "authenticated")
|
|
466
|
+
for (const note of data) {
|
|
467
|
+
if (note.recipient.external_id !== user?.externalId || !note.workspace_ext_id) continue;
|
|
468
|
+
try {
|
|
469
|
+
const target = JSON.parse(note.content || "{}");
|
|
470
|
+
if (!target.document_id?.startsWith("doc-") || !target.comment_id) continue;
|
|
471
|
+
const documentId = target.document_id, commentId = target.comment_id, workspaceId = note.workspace_ext_id;
|
|
472
|
+
items.push({
|
|
473
|
+
id: `docx:${note.external_id}`,
|
|
474
|
+
title: "Mentioned you in a document comment",
|
|
475
|
+
description: [note.sender.given_name, note.sender.family_name].filter(Boolean).join(" "),
|
|
476
|
+
variant: "info",
|
|
477
|
+
ts: Date.parse(note.created_at),
|
|
478
|
+
read: note.read,
|
|
479
|
+
source,
|
|
480
|
+
onSelect: () => {
|
|
481
|
+
void Promise.resolve(onOpen({ documentId, commentId, workspaceId })).catch(
|
|
482
|
+
(error) => react$1.notify.error(
|
|
483
|
+
error instanceof Error ? error.message : "Could not open the document."
|
|
484
|
+
)
|
|
485
|
+
);
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
} catch {
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
react$1.useNotify.getState().syncSource(source, items);
|
|
492
|
+
return () => react$1.useNotify.getState().syncSource(source, []);
|
|
493
|
+
}, [data, status, user?.externalId, source, onOpen]);
|
|
494
|
+
const markRead = async (ids) => {
|
|
495
|
+
try {
|
|
496
|
+
await arbi.notifications.markRead(ids);
|
|
497
|
+
await queries.invalidateQueries({ queryKey });
|
|
498
|
+
} catch {
|
|
499
|
+
react$1.notify.error("Could not mark document mentions read.");
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
return {
|
|
503
|
+
onMarkRead: (id) => {
|
|
504
|
+
if (id.startsWith("docx:")) void markRead([id.slice(5)]);
|
|
505
|
+
},
|
|
506
|
+
onMarkAllRead: () => {
|
|
507
|
+
void markRead(
|
|
508
|
+
data.filter((note) => !note.read && note.recipient.external_id === user?.externalId).map((note) => note.external_id)
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
}
|
|
447
513
|
|
|
448
514
|
Object.defineProperty(exports, "ConnectedAssistantDock", {
|
|
449
515
|
enumerable: true,
|
|
450
|
-
get: function () { return
|
|
516
|
+
get: function () { return chunkEUOGPUMJ_cjs.ConnectedAssistantDock; }
|
|
451
517
|
});
|
|
452
|
-
Object.defineProperty(exports, "
|
|
518
|
+
Object.defineProperty(exports, "redlineStats", {
|
|
453
519
|
enumerable: true,
|
|
454
|
-
get: function () { return
|
|
520
|
+
get: function () { return chunkEUOGPUMJ_cjs.redlineStats; }
|
|
455
521
|
});
|
|
456
|
-
Object.defineProperty(exports, "
|
|
522
|
+
Object.defineProperty(exports, "textToArtifact", {
|
|
457
523
|
enumerable: true,
|
|
458
|
-
get: function () { return
|
|
524
|
+
get: function () { return chunkEUOGPUMJ_cjs.textToArtifact; }
|
|
459
525
|
});
|
|
460
|
-
Object.defineProperty(exports, "
|
|
526
|
+
Object.defineProperty(exports, "toRedlineMarkdown", {
|
|
461
527
|
enumerable: true,
|
|
462
|
-
get: function () { return
|
|
528
|
+
get: function () { return chunkEUOGPUMJ_cjs.toRedlineMarkdown; }
|
|
463
529
|
});
|
|
464
|
-
Object.defineProperty(exports, "
|
|
530
|
+
Object.defineProperty(exports, "useConnectedAiTask", {
|
|
465
531
|
enumerable: true,
|
|
466
|
-
get: function () { return
|
|
532
|
+
get: function () { return chunkEUOGPUMJ_cjs.useConnectedAiTask; }
|
|
467
533
|
});
|
|
468
|
-
Object.defineProperty(exports, "
|
|
534
|
+
Object.defineProperty(exports, "useConnectedChat", {
|
|
469
535
|
enumerable: true,
|
|
470
|
-
get: function () { return
|
|
536
|
+
get: function () { return chunkEUOGPUMJ_cjs.useConnectedChat; }
|
|
471
537
|
});
|
|
472
|
-
Object.defineProperty(exports, "
|
|
538
|
+
Object.defineProperty(exports, "useSemanticSearch", {
|
|
473
539
|
enumerable: true,
|
|
474
|
-
get: function () { return
|
|
540
|
+
get: function () { return chunkEUOGPUMJ_cjs.useSemanticSearch; }
|
|
475
541
|
});
|
|
476
|
-
Object.defineProperty(exports, "
|
|
542
|
+
Object.defineProperty(exports, "useWorkspaceDocs", {
|
|
477
543
|
enumerable: true,
|
|
478
|
-
get: function () { return
|
|
544
|
+
get: function () { return chunkEUOGPUMJ_cjs.useWorkspaceDocs; }
|
|
479
545
|
});
|
|
480
|
-
Object.defineProperty(exports, "
|
|
546
|
+
Object.defineProperty(exports, "ConnectionProvider", {
|
|
481
547
|
enumerable: true,
|
|
482
|
-
get: function () { return
|
|
548
|
+
get: function () { return chunkJCVZKCXC_cjs.ConnectionProvider; }
|
|
483
549
|
});
|
|
484
|
-
Object.defineProperty(exports, "
|
|
550
|
+
Object.defineProperty(exports, "SESSION_EXPIRED_MESSAGE", {
|
|
485
551
|
enumerable: true,
|
|
486
|
-
get: function () { return
|
|
552
|
+
get: function () { return chunkJCVZKCXC_cjs.SESSION_EXPIRED_MESSAGE; }
|
|
487
553
|
});
|
|
488
|
-
Object.defineProperty(exports, "
|
|
554
|
+
Object.defineProperty(exports, "isAuthenticated", {
|
|
489
555
|
enumerable: true,
|
|
490
|
-
get: function () { return
|
|
556
|
+
get: function () { return chunkJCVZKCXC_cjs.isAuthenticated; }
|
|
491
557
|
});
|
|
492
|
-
Object.defineProperty(exports, "
|
|
558
|
+
Object.defineProperty(exports, "useConnection", {
|
|
493
559
|
enumerable: true,
|
|
494
|
-
get: function () { return
|
|
560
|
+
get: function () { return chunkJCVZKCXC_cjs.useConnection; }
|
|
495
561
|
});
|
|
496
562
|
exports.ArbiAppProvider = ArbiAppProvider;
|
|
497
563
|
exports.ConnectedDangerZone = ConnectedDangerZone;
|
|
@@ -502,6 +568,7 @@ exports.ConnectedSecuritySection = ConnectedSecuritySection;
|
|
|
502
568
|
exports.ConnectedSessionsRow = ConnectedSessionsRow;
|
|
503
569
|
exports.StreamedArtifact = StreamedArtifact;
|
|
504
570
|
exports.defaultUnmetPasswordRequirement = defaultUnmetPasswordRequirement;
|
|
571
|
+
exports.useConnectedDocxNotifications = useConnectedDocxNotifications;
|
|
505
572
|
exports.useConnectedShellWorkspaces = useConnectedShellWorkspaces;
|
|
506
573
|
//# sourceMappingURL=index.cjs.map
|
|
507
574
|
//# sourceMappingURL=index.cjs.map
|