@arbidocs/blocks 0.4.81 → 0.4.82

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.
Files changed (35) hide show
  1. package/dist/agents/index.cjs +209 -209
  2. package/dist/agents/index.js +2 -2
  3. package/dist/{chunk-B3WCKBJ7.cjs → chunk-5XVWGJ2H.cjs} +3 -3
  4. package/dist/{chunk-B3WCKBJ7.cjs.map → chunk-5XVWGJ2H.cjs.map} +1 -1
  5. package/dist/{chunk-SWSVPQNB.js → chunk-COP6GVKN.js} +148 -5
  6. package/dist/chunk-COP6GVKN.js.map +1 -0
  7. package/dist/{chunk-I56ORHPY.js → chunk-IRG5LPDP.js} +3 -3
  8. package/dist/{chunk-I56ORHPY.js.map → chunk-IRG5LPDP.js.map} +1 -1
  9. package/dist/{chunk-UA2AMDR6.cjs → chunk-LRRJ2HBW.cjs} +151 -3
  10. package/dist/chunk-LRRJ2HBW.cjs.map +1 -0
  11. package/dist/{chunk-GJV2G4FC.js → chunk-O35LRB3P.js} +3 -3
  12. package/dist/{chunk-GJV2G4FC.js.map → chunk-O35LRB3P.js.map} +1 -1
  13. package/dist/{chunk-F5WIETZY.cjs → chunk-VWK24TEY.cjs} +3 -3
  14. package/dist/{chunk-F5WIETZY.cjs.map → chunk-VWK24TEY.cjs.map} +1 -1
  15. package/dist/connect/index.cjs +59 -38
  16. package/dist/connect/index.cjs.map +1 -1
  17. package/dist/connect/index.js +35 -14
  18. package/dist/connect/index.js.map +1 -1
  19. package/dist/connection/ConnectedTagMatrix.d.ts +6 -3
  20. package/dist/files/index.cjs +2 -2
  21. package/dist/files/index.js +2 -2
  22. package/dist/index.cjs +414 -398
  23. package/dist/index.js +6 -6
  24. package/dist/settings/index.cjs +35 -35
  25. package/dist/settings/index.js +3 -3
  26. package/dist/tags/TagMatrix.d.ts +7 -3
  27. package/dist/tags/index.d.ts +1 -0
  28. package/dist/tags/tagMatrixDocx.d.ts +42 -0
  29. package/dist/workflow-canvas/index.cjs +9 -9
  30. package/dist/workflow-canvas/index.js +2 -2
  31. package/dist/workspaces/index.cjs +1 -1
  32. package/dist/workspaces/index.js +1 -1
  33. package/package.json +4 -4
  34. package/dist/chunk-SWSVPQNB.js.map +0 -1
  35. package/dist/chunk-UA2AMDR6.cjs.map +0 -1
@@ -1,25 +1,25 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkB3WCKBJ7_cjs = require('../chunk-B3WCKBJ7.cjs');
4
+ var chunk5XVWGJ2H_cjs = require('../chunk-5XVWGJ2H.cjs');
5
5
  var chunkXMBYDLZQ_cjs = require('../chunk-XMBYDLZQ.cjs');
6
6
  var chunkTZR36PPP_cjs = require('../chunk-TZR36PPP.cjs');
7
7
  var chunkMUMH3Z6K_cjs = require('../chunk-MUMH3Z6K.cjs');
8
8
  var chunkZVBPRMHJ_cjs = require('../chunk-ZVBPRMHJ.cjs');
9
9
  require('../chunk-7YUFMNFW.cjs');
10
- var chunkUA2AMDR6_cjs = require('../chunk-UA2AMDR6.cjs');
11
- var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
10
+ var chunkLRRJ2HBW_cjs = require('../chunk-LRRJ2HBW.cjs');
12
11
  var chunkBX7JWZWE_cjs = require('../chunk-BX7JWZWE.cjs');
13
12
  require('../chunk-DETZZBG2.cjs');
14
13
  require('../chunk-7D737FLE.cjs');
14
+ var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
15
15
  require('../chunk-ADOKTJHV.cjs');
16
+ var chunkULWRNGGE_cjs = require('../chunk-ULWRNGGE.cjs');
16
17
  var chunkMP6FK43E_cjs = require('../chunk-MP6FK43E.cjs');
17
18
  require('../chunk-VGOFFCMT.cjs');
18
19
  require('../chunk-B4SRYJLM.cjs');
19
20
  require('../chunk-7UTB4PHM.cjs');
20
21
  require('../chunk-PPCATBOY.cjs');
21
22
  var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
22
- var chunkULWRNGGE_cjs = require('../chunk-ULWRNGGE.cjs');
23
23
  require('../chunk-MHVNT4J3.cjs');
24
24
  require('../chunk-DES3K4SD.cjs');
25
25
  var react = require('react');
@@ -963,6 +963,7 @@ function ConnectedTagMatrix({
963
963
  linksLimit = 3,
964
964
  exportTitle,
965
965
  onExported,
966
+ downloadable = true,
966
967
  readOnly,
967
968
  ...props
968
969
  }) {
@@ -981,9 +982,19 @@ function ConnectedTagMatrix({
981
982
  label: [m.user.given_name, m.user.family_name].filter(Boolean).join(" ") || m.user.email
982
983
  }));
983
984
  const fail = (e) => setError(e instanceof Error ? e.message : String(e));
985
+ const snapshot = (data) => {
986
+ const title = exportTitle ?? data.parent?.name ?? "Matrix";
987
+ const bytes = chunkLRRJ2HBW_cjs.tagMatrixDocx(data, {
988
+ title,
989
+ nameOf: (id) => people.find((p) => p.value === id)?.label
990
+ });
991
+ const stamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
992
+ const name = `${title.replace(/[\\/:*?"<>|]+/g, "-")} (${stamp}).docx`;
993
+ return { blob: new Blob([bytes], { type: chunkLRRJ2HBW_cjs.DOCX_MIME_TYPE }), name };
994
+ };
984
995
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
985
996
  /* @__PURE__ */ jsxRuntime.jsx(
986
- chunkUA2AMDR6_cjs.TagMatrix,
997
+ chunkLRRJ2HBW_cjs.TagMatrix,
987
998
  {
988
999
  ...props,
989
1000
  matrix: matrix.data,
@@ -1008,22 +1019,32 @@ function ConnectedTagMatrix({
1008
1019
  try {
1009
1020
  const data = matrix.data;
1010
1021
  if (!data) return;
1011
- const title = exportTitle ?? data.parent?.name ?? "Matrix";
1012
- const markdown = chunkUA2AMDR6_cjs.tagMatrixMarkdown(data, {
1013
- title,
1014
- nameOf: (id2) => people.find((p) => p.value === id2)?.label
1015
- });
1022
+ const { blob, name } = snapshot(data);
1016
1023
  await ensureWorkspaceOpen();
1017
- const stamp = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
1018
- const uploaded = await arbi.documents.uploadFile(
1019
- new Blob([markdown], { type: "text/markdown" }),
1020
- `${title} (${stamp}).md`
1021
- );
1024
+ const uploaded = await arbi.documents.uploadFile(blob, name);
1022
1025
  const id = uploaded?.doc_ext_ids?.[0];
1023
1026
  if (id) onExported(id);
1024
1027
  } catch (e) {
1025
1028
  fail(e);
1026
1029
  }
1030
+ } : void 0,
1031
+ onDownload: downloadable && matrix.data ? () => {
1032
+ setError(null);
1033
+ try {
1034
+ const data = matrix.data;
1035
+ if (!data) return;
1036
+ const { blob, name } = snapshot(data);
1037
+ const url = URL.createObjectURL(blob);
1038
+ const link = document.createElement("a");
1039
+ link.href = url;
1040
+ link.download = name;
1041
+ document.body.appendChild(link);
1042
+ link.click();
1043
+ link.remove();
1044
+ setTimeout(() => URL.revokeObjectURL(url), 0);
1045
+ } catch (e) {
1046
+ fail(e);
1047
+ }
1027
1048
  } : void 0
1028
1049
  }
1029
1050
  ),
@@ -1103,12 +1124,12 @@ function ConnectedProfileCard({ notify: notify3, title = "Profile" }) {
1103
1124
  }
1104
1125
  });
1105
1126
  const display = profile?.fullName || user?.name || "Unnamed";
1106
- return /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCircle, {}), title, children: /* @__PURE__ */ jsxRuntime.jsx(
1107
- chunkB3WCKBJ7_cjs.ProfileCard,
1127
+ return /* @__PURE__ */ jsxRuntime.jsx(chunk5XVWGJ2H_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCircle, {}), title, children: /* @__PURE__ */ jsxRuntime.jsx(
1128
+ chunk5XVWGJ2H_cjs.ProfileCard,
1108
1129
  {
1109
1130
  avatar: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1110
1131
  /* @__PURE__ */ jsxRuntime.jsx(
1111
- chunkB3WCKBJ7_cjs.AvatarPicker,
1132
+ chunk5XVWGJ2H_cjs.AvatarPicker,
1112
1133
  {
1113
1134
  pictureUrl: profile?.picture ?? user?.picture,
1114
1135
  initials: chunkKDG6FER6_cjs.initials(display),
@@ -1150,9 +1171,9 @@ function ConnectedIdentityVerification({
1150
1171
  onNameAccepted: () => notify3?.("Name updated to match your ID", "success")
1151
1172
  });
1152
1173
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1153
- /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.IdentityVerificationCard, { flow, labels }),
1174
+ /* @__PURE__ */ jsxRuntime.jsx(chunk5XVWGJ2H_cjs.IdentityVerificationCard, { flow, labels }),
1154
1175
  /* @__PURE__ */ jsxRuntime.jsx(
1155
- chunkB3WCKBJ7_cjs.IdentityVerificationDialog,
1176
+ chunk5XVWGJ2H_cjs.IdentityVerificationDialog,
1156
1177
  {
1157
1178
  flow,
1158
1179
  accountName: profile?.fullName ?? "",
@@ -1164,7 +1185,7 @@ function ConnectedIdentityVerification({
1164
1185
  function ConnectedRequireVerified({ children, labels }) {
1165
1186
  const { data: profile } = react$1.useProfile();
1166
1187
  const flow = react$1.useIdentityVerification();
1167
- return /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.RequireVerified, { flow, accountName: profile?.fullName ?? "", labels, children });
1188
+ return /* @__PURE__ */ jsxRuntime.jsx(chunk5XVWGJ2H_cjs.RequireVerified, { flow, accountName: profile?.fullName ?? "", labels, children });
1168
1189
  }
1169
1190
  function defaultUnmetPasswordRequirement(password) {
1170
1191
  if (password.length < 8) return "Minimum 8 characters";
@@ -1193,10 +1214,10 @@ function ConnectedSecuritySection({
1193
1214
  },
1194
1215
  onClose: () => setOpen(false)
1195
1216
  });
1196
- return /* @__PURE__ */ jsxRuntime.jsxs(chunkB3WCKBJ7_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.KeyRound, {}), title: "Security", children: [
1197
- /* @__PURE__ */ jsxRuntime.jsxs(chunkB3WCKBJ7_cjs.SettingsCard, { padding: "sm", children: [
1217
+ return /* @__PURE__ */ jsxRuntime.jsxs(chunk5XVWGJ2H_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.KeyRound, {}), title: "Security", children: [
1218
+ /* @__PURE__ */ jsxRuntime.jsxs(chunk5XVWGJ2H_cjs.SettingsCard, { padding: "sm", children: [
1198
1219
  /* @__PURE__ */ jsxRuntime.jsx(
1199
- chunkB3WCKBJ7_cjs.SettingsActionRow,
1220
+ chunk5XVWGJ2H_cjs.SettingsActionRow,
1200
1221
  {
1201
1222
  title: "Change password",
1202
1223
  description: "Used to sign in and to encrypt your data. Changing it re-encrypts everything in your account.",
@@ -1207,7 +1228,7 @@ function ConnectedSecuritySection({
1207
1228
  children
1208
1229
  ] }),
1209
1230
  /* @__PURE__ */ jsxRuntime.jsx(
1210
- chunkB3WCKBJ7_cjs.PasswordChangeDialog,
1231
+ chunk5XVWGJ2H_cjs.PasswordChangeDialog,
1211
1232
  {
1212
1233
  open,
1213
1234
  onClose: form.onCancel,
@@ -1231,23 +1252,23 @@ function ConnectedSecuritySection({
1231
1252
  ] });
1232
1253
  }
1233
1254
  function ConnectedNotificationPreferences({
1234
- categories = chunkB3WCKBJ7_cjs.EMAIL_NOTIFICATION_CATEGORIES,
1255
+ categories = chunk5XVWGJ2H_cjs.EMAIL_NOTIFICATION_CATEGORIES,
1235
1256
  title = "Notifications"
1236
1257
  }) {
1237
1258
  const keys = react.useMemo(
1238
- () => categories === chunkB3WCKBJ7_cjs.EMAIL_NOTIFICATION_CATEGORIES ? chunkB3WCKBJ7_cjs.EMAIL_NOTIFICATION_KEYS : categories.map((c) => c.key),
1259
+ () => categories === chunk5XVWGJ2H_cjs.EMAIL_NOTIFICATION_CATEGORIES ? chunk5XVWGJ2H_cjs.EMAIL_NOTIFICATION_KEYS : categories.map((c) => c.key),
1239
1260
  [categories]
1240
1261
  );
1241
1262
  const prefs = react$1.useNotificationPreferences(keys);
1242
- return /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.SettingsSection, { title, children: /* @__PURE__ */ jsxRuntime.jsx(chunkB3WCKBJ7_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
1243
- chunkB3WCKBJ7_cjs.NotificationCategoryList,
1263
+ return /* @__PURE__ */ jsxRuntime.jsx(chunk5XVWGJ2H_cjs.SettingsSection, { title, children: /* @__PURE__ */ jsxRuntime.jsx(chunk5XVWGJ2H_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
1264
+ chunk5XVWGJ2H_cjs.NotificationCategoryList,
1244
1265
  {
1245
1266
  masterId: "emailNotifications",
1246
1267
  masterTitle: "Email Notifications",
1247
1268
  masterDescription: "Email me about activity when I\u2019m away",
1248
1269
  masterChecked: prefs.masterChecked,
1249
1270
  onMasterChange: prefs.setAll,
1250
- categories: chunkB3WCKBJ7_cjs.toNotificationCategories(prefs.checked, categories),
1271
+ categories: chunk5XVWGJ2H_cjs.toNotificationCategories(prefs.checked, categories),
1251
1272
  onCategoryChange: prefs.setCategory
1252
1273
  }
1253
1274
  ) }) });
@@ -1261,14 +1282,14 @@ function ConnectedSessionsRow({
1261
1282
  const sessions = react$1.useSessions({ enabled: open });
1262
1283
  const currentSessionId = react$1.useCurrentSessionId();
1263
1284
  const terminate = react$1.useTerminateSession();
1264
- const views = chunkB3WCKBJ7_cjs.toActiveSessionViews(sessions.data ?? [], {
1285
+ const views = chunk5XVWGJ2H_cjs.toActiveSessionViews(sessions.data ?? [], {
1265
1286
  currentSessionId,
1266
1287
  terminatingId: terminate.isPending ? terminate.variables : null,
1267
1288
  renderIcon: renderSessionIcon
1268
1289
  });
1269
1290
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1270
1291
  /* @__PURE__ */ jsxRuntime.jsx(
1271
- chunkB3WCKBJ7_cjs.SettingsRow,
1292
+ chunk5XVWGJ2H_cjs.SettingsRow,
1272
1293
  {
1273
1294
  label: "Active sessions",
1274
1295
  description: "Devices and agents currently signed in to your account.",
@@ -1290,7 +1311,7 @@ function ConnectedSessionsRow({
1290
1311
  }
1291
1312
  ),
1292
1313
  /* @__PURE__ */ jsxRuntime.jsx(
1293
- chunkB3WCKBJ7_cjs.ActiveSessionsDialog,
1314
+ chunk5XVWGJ2H_cjs.ActiveSessionsDialog,
1294
1315
  {
1295
1316
  open,
1296
1317
  onOpenChange: setOpen,
@@ -1325,7 +1346,7 @@ function ConnectedLogoutDialog({
1325
1346
  const sessions = react$1.useSessions({ enabled: open });
1326
1347
  const logoutAll = react$1.useLogoutAllSessions();
1327
1348
  return /* @__PURE__ */ jsxRuntime.jsx(
1328
- chunkB3WCKBJ7_cjs.LogoutDialog,
1349
+ chunk5XVWGJ2H_cjs.LogoutDialog,
1329
1350
  {
1330
1351
  open,
1331
1352
  onClose,
@@ -1339,7 +1360,7 @@ function ConnectedLogoutDialog({
1339
1360
  },
1340
1361
  canLogoutAll: true,
1341
1362
  isOnline,
1342
- sessions: chunkB3WCKBJ7_cjs.toLogoutSessionViews(sessions.data ?? []),
1363
+ sessions: chunk5XVWGJ2H_cjs.toLogoutSessionViews(sessions.data ?? []),
1343
1364
  renderSessionIcon
1344
1365
  }
1345
1366
  );
@@ -1358,7 +1379,7 @@ function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
1358
1379
  });
1359
1380
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1360
1381
  /* @__PURE__ */ jsxRuntime.jsx(
1361
- chunkB3WCKBJ7_cjs.SettingsDangerZone,
1382
+ chunk5XVWGJ2H_cjs.SettingsDangerZone,
1362
1383
  {
1363
1384
  isOpen: zoneOpen,
1364
1385
  onToggle: () => setZoneOpen((o) => !o),
@@ -1378,12 +1399,12 @@ function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
1378
1399
  }
1379
1400
  ),
1380
1401
  /* @__PURE__ */ jsxRuntime.jsx(
1381
- chunkB3WCKBJ7_cjs.DeleteAccountDialog,
1402
+ chunk5XVWGJ2H_cjs.DeleteAccountDialog,
1382
1403
  {
1383
1404
  open: dialogOpen,
1384
1405
  onClose: flow.onClose,
1385
1406
  step: flow.step,
1386
- blockers: chunkB3WCKBJ7_cjs.toDeleteBlockerViews(flow.blockers, renderSubscriptionLink),
1407
+ blockers: chunk5XVWGJ2H_cjs.toDeleteBlockerViews(flow.blockers, renderSubscriptionLink),
1387
1408
  onContinue: flow.onContinue,
1388
1409
  onBack: flow.onBack,
1389
1410
  userEmail: user?.email ?? "",