@arbidocs/blocks 0.4.39 → 0.4.41

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 (52) hide show
  1. package/dist/agents/index.cjs +222 -220
  2. package/dist/agents/index.js +3 -1
  3. package/dist/agents/tasks/TaskInbox.d.ts +1 -1
  4. package/dist/agents/tasks/TaskStartDialog.d.ts +11 -3
  5. package/dist/agents/tasks/taskRequest.d.ts +3 -0
  6. package/dist/chat/index.cjs +127 -126
  7. package/dist/chat/index.js +3 -2
  8. package/dist/chunk-3VQYJBOI.js +76 -0
  9. package/dist/chunk-3VQYJBOI.js.map +1 -0
  10. package/dist/{chunk-SWON6O45.js → chunk-7L3KPYD2.js} +3 -3
  11. package/dist/{chunk-SWON6O45.js.map → chunk-7L3KPYD2.js.map} +1 -1
  12. package/dist/{chunk-LQITIYBN.js → chunk-CA7JD6IX.js} +3 -3
  13. package/dist/{chunk-LQITIYBN.js.map → chunk-CA7JD6IX.js.map} +1 -1
  14. package/dist/{chunk-CHVFO74Y.cjs → chunk-DIOTMJTC.cjs} +155 -37
  15. package/dist/chunk-DIOTMJTC.cjs.map +1 -0
  16. package/dist/{chunk-ZXYHBQFW.js → chunk-E3U5GYAP.js} +5 -72
  17. package/dist/chunk-E3U5GYAP.js.map +1 -0
  18. package/dist/{chunk-SKFSJHVU.cjs → chunk-LR54PQ7N.cjs} +4 -4
  19. package/dist/{chunk-SKFSJHVU.cjs.map → chunk-LR54PQ7N.cjs.map} +1 -1
  20. package/dist/{chunk-EEGPWOOG.cjs → chunk-NT3WEHL5.cjs} +5 -5
  21. package/dist/{chunk-EEGPWOOG.cjs.map → chunk-NT3WEHL5.cjs.map} +1 -1
  22. package/dist/{chunk-KFR4GKHS.js → chunk-PG2RWOGF.js} +155 -37
  23. package/dist/chunk-PG2RWOGF.js.map +1 -0
  24. package/dist/{chunk-KMYLQIOH.cjs → chunk-UW3IHMYA.cjs} +4 -72
  25. package/dist/chunk-UW3IHMYA.cjs.map +1 -0
  26. package/dist/chunk-V3L5DONY.cjs +78 -0
  27. package/dist/chunk-V3L5DONY.cjs.map +1 -0
  28. package/dist/connect/index.cjs +12 -11
  29. package/dist/connect/index.cjs.map +1 -1
  30. package/dist/connect/index.js +3 -2
  31. package/dist/connect/index.js.map +1 -1
  32. package/dist/index.cjs +462 -461
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.js +6 -5
  35. package/dist/index.js.map +1 -1
  36. package/dist/settings/index.cjs +1 -1
  37. package/dist/settings/index.js +1 -1
  38. package/dist/studio/index.cjs +4 -3
  39. package/dist/studio/index.cjs.map +1 -1
  40. package/dist/studio/index.js +3 -2
  41. package/dist/studio/index.js.map +1 -1
  42. package/dist/workspaces/WorkspaceSettingsParts.d.ts +2 -0
  43. package/dist/workspaces/index.cjs +4 -1
  44. package/dist/workspaces/index.cjs.map +1 -1
  45. package/dist/workspaces/index.js +5 -2
  46. package/dist/workspaces/index.js.map +1 -1
  47. package/package.json +4 -4
  48. package/src/docx/styles.css +6 -0
  49. package/dist/chunk-CHVFO74Y.cjs.map +0 -1
  50. package/dist/chunk-KFR4GKHS.js.map +0 -1
  51. package/dist/chunk-KMYLQIOH.cjs.map +0 -1
  52. package/dist/chunk-ZXYHBQFW.js.map +0 -1
@@ -10,9 +10,11 @@ var chunkVFUWWH52_cjs = require('./chunk-VFUWWH52.cjs');
10
10
  var chunk2EI7NCUA_cjs = require('./chunk-2EI7NCUA.cjs');
11
11
  var chunkOB5F4577_cjs = require('./chunk-OB5F4577.cjs');
12
12
  var chunk7RGLTF76_cjs = require('./chunk-7RGLTF76.cjs');
13
+ var chunkV3L5DONY_cjs = require('./chunk-V3L5DONY.cjs');
13
14
  var chunkC54XEN5T_cjs = require('./chunk-C54XEN5T.cjs');
14
15
  var chunkKDG6FER6_cjs = require('./chunk-KDG6FER6.cjs');
15
16
  var chunk2ZTONLT5_cjs = require('./chunk-2ZTONLT5.cjs');
17
+ var chunk7UTB4PHM_cjs = require('./chunk-7UTB4PHM.cjs');
16
18
  var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
17
19
  var react = require('react');
18
20
  var ui = require('@arbidocs/react/ui');
@@ -4294,6 +4296,7 @@ function TaskTable(props) {
4294
4296
  const isOwner = task.is_owner !== false;
4295
4297
  const canEdit = isOwner || Boolean(p.canEditShared);
4296
4298
  const canAdmin = isOwner || Boolean(p.isWorkspaceOwner);
4299
+ const canAskReview = status !== "done" && status !== "chat" && canEdit && Boolean(p.onRequestApproval && p.people?.length);
4297
4300
  const reviewActions = (closeMenu) => status === "ready_for_review" ? /* @__PURE__ */ jsxRuntime.jsx(
4298
4301
  TaskReviewActions,
4299
4302
  {
@@ -4318,6 +4321,23 @@ function TaskTable(props) {
4318
4321
  compact: true,
4319
4322
  labels: p.reviewLabels
4320
4323
  }
4324
+ ) : canAskReview ? /* @__PURE__ */ jsxRuntime.jsx(
4325
+ TaskReviewActions,
4326
+ {
4327
+ id,
4328
+ busy,
4329
+ canApprove: false,
4330
+ canRequestChanges: false,
4331
+ onApprove: () => void 0,
4332
+ onRequestChanges: () => void 0,
4333
+ onRequestApproval: (userId, note) => {
4334
+ p.onRequestApproval?.(task, userId, note);
4335
+ closeMenu?.();
4336
+ },
4337
+ people: p.people,
4338
+ compact: true,
4339
+ labels: p.reviewLabels
4340
+ }
4321
4341
  ) : null;
4322
4342
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-end gap-2", children: [
4323
4343
  !latest.current.narrow && reviewActions(),
@@ -4337,7 +4357,7 @@ function TaskTable(props) {
4337
4357
  /* @__PURE__ */ jsxRuntime.jsx(
4338
4358
  TaskRowMenu,
4339
4359
  {
4340
- reviewActions: latest.current.narrow && status === "ready_for_review" ? reviewActions : void 0,
4360
+ reviewActions: latest.current.narrow && (status === "ready_for_review" || canAskReview) ? reviewActions : void 0,
4341
4361
  task,
4342
4362
  status,
4343
4363
  busy,
@@ -4786,6 +4806,21 @@ function TaskInbox(p) {
4786
4806
  children: "Allow access"
4787
4807
  }
4788
4808
  ),
4809
+ p.onRequestApproval && status !== "done" && canEdit(task) && /* @__PURE__ */ jsxRuntime.jsx(
4810
+ TaskReviewActions,
4811
+ {
4812
+ id,
4813
+ busy,
4814
+ compact: true,
4815
+ canApprove: false,
4816
+ canRequestChanges: false,
4817
+ onApprove: () => void 0,
4818
+ onRequestChanges: () => void 0,
4819
+ onRequestApproval: (userId, note) => p.onRequestApproval?.(task, userId, note),
4820
+ people: p.people,
4821
+ labels: p.reviewLabels
4822
+ }
4823
+ ),
4789
4824
  /* @__PURE__ */ jsxRuntime.jsx(
4790
4825
  TaskRowMenu,
4791
4826
  {
@@ -5163,7 +5198,7 @@ function ConversationListView(p) {
5163
5198
  ...liveProps.current.renderBy || liveProps.current.renderOwner ? [
5164
5199
  {
5165
5200
  colId: liveProps.current.renderBy ? "by" : "owner",
5166
- headerName: liveProps.current.renderBy ? "By" : "Owner",
5201
+ headerName: liveProps.current.renderBy ? "Last message by" : "Owner",
5167
5202
  width: 160,
5168
5203
  cellRenderer: ({ data }) => data && (liveProps.current.renderBy || liveProps.current.renderOwner)?.(data)
5169
5204
  }
@@ -5187,7 +5222,7 @@ function ConversationListView(p) {
5187
5222
  {
5188
5223
  colId: "visibility",
5189
5224
  headerName: "Visibility",
5190
- width: 100,
5225
+ width: 170,
5191
5226
  cellClass: "cell-hcenter",
5192
5227
  sortable: false,
5193
5228
  resizable: false,
@@ -5195,7 +5230,8 @@ function ConversationListView(p) {
5195
5230
  ui.VisibilityToggle,
5196
5231
  {
5197
5232
  items: [data],
5198
- showLabel: false,
5233
+ showLabel: true,
5234
+ label: data.is_shared ? "Workspace" : "Only Me",
5199
5235
  disabled: data.is_owner === false,
5200
5236
  onToggle: () => liveProps.current.onToggleShared?.(data, !data.is_shared)
5201
5237
  }
@@ -5294,10 +5330,14 @@ function ConversationListView(p) {
5294
5330
  p.selectionActions && /* @__PURE__ */ jsxRuntime.jsx(chunkIA7RTPT3_cjs.SelectionBar, { count: selectedRows.length, onClear: () => setSelected(/* @__PURE__ */ new Set()), children: (compact) => p.selectionActions?.(selectedRows, compact, () => setSelected(/* @__PURE__ */ new Set())) })
5295
5331
  ] });
5296
5332
  }
5333
+ var NO_PEOPLE = [];
5334
+ var NO_ASSIGNEES = [];
5297
5335
  function TaskStartDialog({
5298
5336
  open,
5299
5337
  onOpenChange,
5300
5338
  workflows,
5339
+ people = NO_PEOPLE,
5340
+ assignees = NO_ASSIGNEES,
5301
5341
  isPending,
5302
5342
  error,
5303
5343
  onStart,
@@ -5306,14 +5346,35 @@ function TaskStartDialog({
5306
5346
  const [prompt, setPrompt] = react.useState("");
5307
5347
  const [choice, setChoice] = react.useState("prompt");
5308
5348
  const [shared, setShared] = react.useState(false);
5349
+ const [sourceOpen, setSourceOpen] = react.useState(false);
5350
+ const [assignee, setAssignee] = react.useState("");
5351
+ react.useEffect(() => {
5352
+ if (open) return;
5353
+ setPrompt("");
5354
+ setChoice("prompt");
5355
+ setShared(false);
5356
+ setSourceOpen(false);
5357
+ setAssignee("");
5358
+ }, [open]);
5359
+ const textareaRef = react.useRef(null);
5360
+ const mention = chunkV3L5DONY_cjs.useMentionAutocomplete({
5361
+ value: prompt,
5362
+ onValueChange: setPrompt,
5363
+ candidates: people,
5364
+ textareaRef
5365
+ });
5309
5366
  const todo = choice === "todo";
5310
5367
  const workflowId = choice === "prompt" || todo ? null : choice;
5368
+ const assigneeId = todo ? assignee : "";
5369
+ const sharedNow = shared || assigneeId !== "";
5311
5370
  const valid = workflowId ? workflows.some((w) => w.external_id === workflowId) : Boolean(prompt.trim());
5312
5371
  const values = {
5313
5372
  prompt: prompt.trim(),
5314
5373
  workflowId,
5315
5374
  todo,
5316
- shared
5375
+ shared: sharedNow,
5376
+ mentions: chunk7UTB4PHM_cjs.toMessageMentions(chunk7UTB4PHM_cjs.extractMentions(prompt, people)),
5377
+ ...assigneeId ? { assigneeId } : {}
5317
5378
  };
5318
5379
  return /* @__PURE__ */ jsxRuntime.jsx(ui.Dialog, { modal: false, open, onOpenChange: (next) => !isPending && onOpenChange(next), children: /* @__PURE__ */ jsxRuntime.jsxs(
5319
5380
  ui.DialogContent,
@@ -5321,6 +5382,11 @@ function TaskStartDialog({
5321
5382
  presentation: "right",
5322
5383
  hideCloseButton: true,
5323
5384
  onInteractOutside: (event) => event.preventDefault(),
5385
+ onEscapeKeyDown: (event) => {
5386
+ if (!sourceOpen) return;
5387
+ event.preventDefault();
5388
+ setSourceOpen(false);
5389
+ },
5324
5390
  className: "flex flex-col gap-0 overflow-hidden p-0 shadow-lg",
5325
5391
  "data-testid": "task-start-dialog",
5326
5392
  children: [
@@ -5339,35 +5405,90 @@ function TaskStartDialog({
5339
5405
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-h-0 flex-1 overflow-y-auto px-3 py-3", children: [
5340
5406
  !workflowId ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5341
5407
  /* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "sr-only", htmlFor: "task-start-prompt", children: todo ? "What needs doing?" : "What should ARBI do?" }),
5342
- /* @__PURE__ */ jsxRuntime.jsx(
5343
- ui.Textarea,
5408
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
5409
+ /* @__PURE__ */ jsxRuntime.jsx(
5410
+ ui.Textarea,
5411
+ {
5412
+ id: "task-start-prompt",
5413
+ ref: textareaRef,
5414
+ autoFocus: true,
5415
+ value: prompt,
5416
+ onChange: (event) => mention.onValueChange(event.target.value),
5417
+ onKeyDown: mention.nav.handleKeyDown,
5418
+ ...mention.isOpen ? mention.nav.comboboxProps : {},
5419
+ ...mention.textareaProps,
5420
+ disabled: isPending,
5421
+ placeholder: "What needs doing?",
5422
+ className: "min-h-44 resize-y shadow-none"
5423
+ }
5424
+ ),
5425
+ /* @__PURE__ */ jsxRuntime.jsx(
5426
+ chunk7UTB4PHM_cjs.MentionMenu,
5427
+ {
5428
+ open: mention.isOpen,
5429
+ placement: "below",
5430
+ items: mention.items,
5431
+ selectedIndex: mention.nav.selectedIndex,
5432
+ setSelectedIndex: mention.nav.setSelectedIndex,
5433
+ listboxId: mention.nav.listboxId,
5434
+ onSelect: mention.pick
5435
+ }
5436
+ )
5437
+ ] })
5438
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", children: workflows.find((workflow) => workflow.external_id === workflowId)?.name }),
5439
+ /* @__PURE__ */ jsxRuntime.jsxs(
5440
+ ui.Select,
5441
+ {
5442
+ value: choice,
5443
+ onValueChange: setChoice,
5444
+ open: sourceOpen,
5445
+ onOpenChange: setSourceOpen,
5446
+ disabled: isPending,
5447
+ children: [
5448
+ /* @__PURE__ */ jsxRuntime.jsx(
5449
+ ui.SelectTrigger,
5450
+ {
5451
+ id: "task-start-source",
5452
+ "aria-label": "Who does the work",
5453
+ className: "mt-3 h-7 w-auto max-w-full border-0 bg-transparent px-1 text-xs font-normal text-muted-foreground shadow-none hover:bg-muted",
5454
+ children: /* @__PURE__ */ jsxRuntime.jsx(ui.SelectValue, {})
5455
+ }
5456
+ ),
5457
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.SelectContent, { children: [
5458
+ /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "prompt", children: "With ARBI" }),
5459
+ /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "todo", children: "People only" }),
5460
+ workflows.map((workflow) => /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: workflow.external_id, children: workflow.name }, workflow.external_id))
5461
+ ] })
5462
+ ]
5463
+ }
5464
+ ),
5465
+ todo && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 flex items-center gap-2 text-xs text-muted-foreground", children: [
5466
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Assigned to" }),
5467
+ /* @__PURE__ */ jsxRuntime.jsxs(
5468
+ ui.Select,
5344
5469
  {
5345
- id: "task-start-prompt",
5346
- autoFocus: true,
5347
- value: prompt,
5348
- onChange: (event) => setPrompt(event.target.value),
5470
+ value: assigneeId || "me",
5471
+ onValueChange: (next) => setAssignee(next === "me" ? "" : next),
5349
5472
  disabled: isPending,
5350
- placeholder: "What needs doing?",
5351
- className: "min-h-44 resize-y shadow-none"
5473
+ children: [
5474
+ /* @__PURE__ */ jsxRuntime.jsx(
5475
+ ui.SelectTrigger,
5476
+ {
5477
+ id: "task-start-assignee",
5478
+ "aria-label": "Assigned to",
5479
+ className: "h-7 w-auto max-w-full border-0 bg-transparent px-1 text-xs font-normal text-foreground shadow-none hover:bg-muted",
5480
+ children: /* @__PURE__ */ jsxRuntime.jsx(ui.SelectValue, {})
5481
+ }
5482
+ ),
5483
+ /* @__PURE__ */ jsxRuntime.jsxs(ui.SelectContent, { children: [
5484
+ /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "me", children: "Me" }),
5485
+ assignees.map((person) => /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: person.id, children: person.label }, person.id))
5486
+ ] })
5487
+ ]
5352
5488
  }
5353
5489
  )
5354
- ] }) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm", children: workflows.find((workflow) => workflow.external_id === workflowId)?.name }),
5355
- /* @__PURE__ */ jsxRuntime.jsxs(ui.Select, { value: choice, onValueChange: setChoice, disabled: isPending, children: [
5356
- /* @__PURE__ */ jsxRuntime.jsx(
5357
- ui.SelectTrigger,
5358
- {
5359
- id: "task-start-source",
5360
- "aria-label": "Who does the work",
5361
- className: "mt-3 h-7 w-auto max-w-full border-0 bg-transparent px-1 text-xs font-normal text-muted-foreground shadow-none hover:bg-muted",
5362
- children: /* @__PURE__ */ jsxRuntime.jsx(ui.SelectValue, {})
5363
- }
5364
- ),
5365
- /* @__PURE__ */ jsxRuntime.jsxs(ui.SelectContent, { children: [
5366
- /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "prompt", children: "With ARBI" }),
5367
- /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: "todo", children: "People only" }),
5368
- workflows.map((workflow) => /* @__PURE__ */ jsxRuntime.jsx(ui.SelectItem, { value: workflow.external_id, children: workflow.name }, workflow.external_id))
5369
- ] })
5370
5490
  ] }),
5491
+ todo && assignees.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-muted-foreground", children: "Invite a workspace collaborator to assign this to them." }),
5371
5492
  error && /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "mt-3 text-sm text-destructive", children: error })
5372
5493
  ] }),
5373
5494
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t px-3 py-2", children: [
@@ -5386,10 +5507,10 @@ function TaskStartDialog({
5386
5507
  /* @__PURE__ */ jsxRuntime.jsx(
5387
5508
  ui.VisibilityToggle,
5388
5509
  {
5389
- items: { shared },
5510
+ items: { shared: sharedNow },
5390
5511
  onToggle: setShared,
5391
- label: shared ? "Workspace" : "Only Me",
5392
- disabled: isPending,
5512
+ label: sharedNow ? "Workspace" : "Only Me",
5513
+ disabled: isPending || assigneeId !== "",
5393
5514
  "data-testid": "task-start-visibility"
5394
5515
  }
5395
5516
  ),
@@ -5402,9 +5523,6 @@ function TaskStartDialog({
5402
5523
  onClick: async () => {
5403
5524
  try {
5404
5525
  await onStart(values);
5405
- setPrompt("");
5406
- setChoice("prompt");
5407
- setShared(false);
5408
5526
  } catch {
5409
5527
  }
5410
5528
  },
@@ -10751,5 +10869,5 @@ exports.workflowTriggerType = workflowTriggerType;
10751
10869
  exports.workflowWhen = workflowWhen;
10752
10870
  exports.workflowsAccepting = workflowsAccepting;
10753
10871
  exports.workflowsForHost = workflowsForHost;
10754
- //# sourceMappingURL=chunk-CHVFO74Y.cjs.map
10755
- //# sourceMappingURL=chunk-CHVFO74Y.cjs.map
10872
+ //# sourceMappingURL=chunk-DIOTMJTC.cjs.map
10873
+ //# sourceMappingURL=chunk-DIOTMJTC.cjs.map