@arbidocs/blocks 0.4.87 → 0.4.88
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/index.cjs +211 -211
- package/dist/agents/index.js +6 -6
- package/dist/chat/index.cjs +125 -125
- package/dist/chat/index.js +3 -3
- package/dist/{chunk-2EI7NCUA.cjs → chunk-2CFW2ELM.cjs} +8 -2
- package/dist/chunk-2CFW2ELM.cjs.map +1 -0
- package/dist/{chunk-OR4CO743.cjs → chunk-5YXG342J.cjs} +3 -3
- package/dist/{chunk-OR4CO743.cjs.map → chunk-5YXG342J.cjs.map} +1 -1
- package/dist/{chunk-R26OHONI.js → chunk-6S5FLMWG.js} +83 -72
- package/dist/chunk-6S5FLMWG.js.map +1 -0
- package/dist/{chunk-P5ST47VY.js → chunk-DDF5GPIJ.js} +3 -3
- package/dist/{chunk-P5ST47VY.js.map → chunk-DDF5GPIJ.js.map} +1 -1
- package/dist/{chunk-PFA43QNX.js → chunk-EWSEQEPL.js} +3 -3
- package/dist/{chunk-PFA43QNX.js.map → chunk-EWSEQEPL.js.map} +1 -1
- package/dist/{chunk-X5K5PCRJ.cjs → chunk-FNEL2BYV.cjs} +18 -18
- package/dist/{chunk-X5K5PCRJ.cjs.map → chunk-FNEL2BYV.cjs.map} +1 -1
- package/dist/{chunk-LBE36YNZ.js → chunk-ICBAFX5B.js} +3 -3
- package/dist/{chunk-LBE36YNZ.js.map → chunk-ICBAFX5B.js.map} +1 -1
- package/dist/{chunk-C3DRLFU7.cjs → chunk-IF6VAYIA.cjs} +5 -5
- package/dist/{chunk-C3DRLFU7.cjs.map → chunk-IF6VAYIA.cjs.map} +1 -1
- package/dist/{chunk-O5NDG4EA.cjs → chunk-MP6FK43E.cjs} +3 -3
- package/dist/{chunk-O5NDG4EA.cjs.map → chunk-MP6FK43E.cjs.map} +1 -1
- package/dist/{chunk-AFSOUS5X.cjs → chunk-N26CXGXC.cjs} +83 -72
- package/dist/chunk-N26CXGXC.cjs.map +1 -0
- package/dist/{chunk-2FBQSQDW.js → chunk-NXWKMKZY.js} +298 -214
- package/dist/chunk-NXWKMKZY.js.map +1 -0
- package/dist/{chunk-QOADH2YB.cjs → chunk-UCAYNE44.cjs} +297 -213
- package/dist/chunk-UCAYNE44.cjs.map +1 -0
- package/dist/{chunk-UJM7TG44.js → chunk-UZV27QLC.js} +7 -7
- package/dist/{chunk-UJM7TG44.js.map → chunk-UZV27QLC.js.map} +1 -1
- package/dist/{chunk-GFYGYME3.js → chunk-W7NZRZ54.js} +3 -3
- package/dist/{chunk-GFYGYME3.js.map → chunk-W7NZRZ54.js.map} +1 -1
- package/dist/{chunk-HUJLKDWX.cjs → chunk-XMBYDLZQ.cjs} +4 -4
- package/dist/{chunk-HUJLKDWX.cjs.map → chunk-XMBYDLZQ.cjs.map} +1 -1
- package/dist/{chunk-WDD255XQ.js → chunk-XQDM6T6C.js} +3 -3
- package/dist/{chunk-WDD255XQ.js.map → chunk-XQDM6T6C.js.map} +1 -1
- package/dist/{chunk-ZV3BKLFY.cjs → chunk-Z5VUZ6YD.cjs} +3 -3
- package/dist/{chunk-ZV3BKLFY.cjs.map → chunk-Z5VUZ6YD.cjs.map} +1 -1
- package/dist/{chunk-YU2KUMGE.js → chunk-ZX2VPMBJ.js} +8 -2
- package/dist/chunk-ZX2VPMBJ.js.map +1 -0
- package/dist/connect/index.cjs +50 -50
- package/dist/connect/index.js +8 -8
- package/dist/facts/index.cjs +7 -7
- package/dist/facts/index.js +4 -4
- package/dist/files/index.cjs +4 -23
- package/dist/files/index.cjs.map +1 -1
- package/dist/files/index.js +4 -22
- package/dist/files/index.js.map +1 -1
- package/dist/files/views/TagFormParts.d.ts +0 -8
- package/dist/files/views/index.d.ts +1 -1
- package/dist/home/index.cjs +17 -17
- package/dist/home/index.js +3 -3
- package/dist/index.cjs +629 -537
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +116 -25
- package/dist/index.js.map +1 -1
- package/dist/retrieval/index.cjs +1 -1
- package/dist/retrieval/index.js +1 -1
- package/dist/settings/index.cjs +38 -38
- package/dist/settings/index.js +3 -3
- package/dist/shell/FilterInput.d.ts +3 -1
- package/dist/shell/index.cjs +5 -5
- package/dist/shell/index.js +2 -2
- package/dist/studio/index.cjs +4 -4
- package/dist/studio/index.js +3 -3
- package/dist/tags/TagDetail.d.ts +14 -2
- package/dist/tags/TagTable.d.ts +20 -11
- package/dist/tags/TagsNav.d.ts +28 -4
- package/dist/tags/index.d.ts +1 -1
- package/dist/tags/tagTableModel.d.ts +10 -2
- package/dist/workflow-canvas/index.cjs +13 -13
- package/dist/workflow-canvas/index.js +6 -6
- package/dist/workspaces/index.cjs +2 -2
- package/dist/workspaces/index.js +2 -2
- package/package.json +4 -4
- package/dist/chunk-2EI7NCUA.cjs.map +0 -1
- package/dist/chunk-2FBQSQDW.js.map +0 -1
- package/dist/chunk-AFSOUS5X.cjs.map +0 -1
- package/dist/chunk-QOADH2YB.cjs.map +0 -1
- package/dist/chunk-R26OHONI.js.map +0 -1
- package/dist/chunk-YU2KUMGE.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { taskActivityHeadline, DEFAULT_TASK_ACTIVITY_LABELS } from './chunk-YX466FWL.js';
|
|
3
|
-
import { BellOff, BellRing, Bell, Activity, ArrowUp, ArrowDown, X, Plus, Loader2, SlidersHorizontal, Download, FileDown, Workflow, FileText, MessageSquare,
|
|
3
|
+
import { BellOff, BellRing, Bell, Activity, ArrowUp, ArrowDown, X, Plus, Loader2, ArrowUpRight, ChevronDown, SlidersHorizontal, Download, FileDown, Workflow, FileText, MessageSquare, Lightbulb, MessagesSquare } from 'lucide-react';
|
|
4
4
|
import { cn, Button, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuItem, Input, Checkbox } from '@arbidocs/react/ui';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
import { useState, useEffect, useMemo } from 'react';
|
|
@@ -300,10 +300,16 @@ var isGap = (row) => {
|
|
|
300
300
|
const l = rowLinks(row);
|
|
301
301
|
return l.doc_count + l.fact_count + l.thread_count === 0;
|
|
302
302
|
};
|
|
303
|
+
function linkedTagIds(value) {
|
|
304
|
+
if (typeof value === "string") return value ? [value] : [];
|
|
305
|
+
return Array.isArray(value) ? value.filter((id) => typeof id === "string") : [];
|
|
306
|
+
}
|
|
303
307
|
function cellText(value, column, nameOf) {
|
|
304
308
|
if (value === void 0 || value === null || value === "") return "";
|
|
305
309
|
if (column.type === "checkbox") return value ? "Yes" : "No";
|
|
306
310
|
if (column.type === "person" && typeof value === "string") return nameOf?.(value) ?? value;
|
|
311
|
+
if (column.type === "tag")
|
|
312
|
+
return linkedTagIds(value).map((id) => nameOf?.(id) ?? id).join(", ");
|
|
307
313
|
if (Array.isArray(value)) return value.map(String).join(", ");
|
|
308
314
|
return String(value);
|
|
309
315
|
}
|
|
@@ -374,7 +380,8 @@ var DEFAULT_TAG_COLUMNS_EDITOR_LABELS = {
|
|
|
374
380
|
document: "Document",
|
|
375
381
|
relation: "Relation",
|
|
376
382
|
lookup: "Lookup",
|
|
377
|
-
rollup: "Rollup"
|
|
383
|
+
rollup: "Rollup",
|
|
384
|
+
tag: "Link to tags"
|
|
378
385
|
}
|
|
379
386
|
};
|
|
380
387
|
var TYPES = ["text", "number", "date", "checkbox", "select", "person"];
|
|
@@ -388,7 +395,7 @@ var toWrite = (d) => ({
|
|
|
388
395
|
...d.id ? { id: d.id } : {},
|
|
389
396
|
name: d.name.trim(),
|
|
390
397
|
type: d.type,
|
|
391
|
-
options: d.type === "select" ? d.options.split(",").map((o) => o.trim()).filter(Boolean) : null
|
|
398
|
+
options: d.type === "tag" ? d.options.split(",").map((o) => o.trim()).filter(Boolean) : d.type === "select" ? d.options.split(",").map((o) => o.trim()).filter(Boolean) : null
|
|
392
399
|
});
|
|
393
400
|
function TagColumnsEditor({
|
|
394
401
|
columns,
|
|
@@ -551,7 +558,7 @@ function TagColumnsEditor({
|
|
|
551
558
|
}
|
|
552
559
|
var DEFAULT_TAG_TABLE_LABELS = {
|
|
553
560
|
row: "Item",
|
|
554
|
-
evidence: "
|
|
561
|
+
evidence: "Tagged items",
|
|
555
562
|
documents: "{count} documents",
|
|
556
563
|
facts: "{count} facts",
|
|
557
564
|
threads: "{count} threads",
|
|
@@ -560,9 +567,6 @@ var DEFAULT_TAG_TABLE_LABELS = {
|
|
|
560
567
|
thread: "1 thread",
|
|
561
568
|
untitledThread: "Untitled thread",
|
|
562
569
|
more: "+{count} more",
|
|
563
|
-
gap: "No evidence",
|
|
564
|
-
gapsOnly: "Show gaps only",
|
|
565
|
-
gapCount: "{count} without evidence",
|
|
566
570
|
addRow: "Add row",
|
|
567
571
|
addRowPlaceholder: "Name of the new row",
|
|
568
572
|
add: "Add",
|
|
@@ -576,25 +580,41 @@ var DEFAULT_TAG_TABLE_LABELS = {
|
|
|
576
580
|
yes: "Yes",
|
|
577
581
|
editColumns: "Columns"
|
|
578
582
|
};
|
|
579
|
-
var ROW_LABEL_WIDTH = "w-[
|
|
583
|
+
var ROW_LABEL_WIDTH = "w-[11rem]";
|
|
584
|
+
var EVIDENCE_WIDTH = "w-[14rem]";
|
|
580
585
|
var ROW_LABEL = "line-clamp-3 whitespace-normal break-words";
|
|
581
586
|
function TagTableCell({
|
|
582
587
|
row,
|
|
583
588
|
column,
|
|
584
589
|
people,
|
|
590
|
+
tags,
|
|
591
|
+
onOpenTag,
|
|
585
592
|
onChange,
|
|
586
593
|
l,
|
|
587
594
|
testId
|
|
588
595
|
}) {
|
|
589
596
|
const value = cellValue(row, column);
|
|
590
|
-
const nameOf = (id) => people?.find((p) => p.value === id)?.label;
|
|
597
|
+
const nameOf = (id) => (column.type === "tag" ? tags : people)?.find((p) => p.value === id)?.label;
|
|
591
598
|
const shown = cellText(value, column, nameOf);
|
|
592
599
|
const [draft, setDraft] = useState(shown);
|
|
593
600
|
useEffect(() => setDraft(cellText(value, column)), [value, column]);
|
|
594
601
|
const set = (next) => void onChange?.(row.external_id, column.id, next);
|
|
602
|
+
if (column.type === "tag")
|
|
603
|
+
return /* @__PURE__ */ jsx(
|
|
604
|
+
TagLinkCell,
|
|
605
|
+
{
|
|
606
|
+
row,
|
|
607
|
+
column,
|
|
608
|
+
tags,
|
|
609
|
+
onOpenTag,
|
|
610
|
+
onChange: onChange ? set : void 0,
|
|
611
|
+
l,
|
|
612
|
+
testId
|
|
613
|
+
}
|
|
614
|
+
);
|
|
595
615
|
if (!onChange)
|
|
596
616
|
return /* @__PURE__ */ jsx("span", { className: "block truncate", title: shown, "data-testid": testId, children: shown || /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: l.choose }) });
|
|
597
|
-
const field = "h-8 w-full min-w-
|
|
617
|
+
const field = "h-8 w-full min-w-0 rounded-md border border-transparent bg-transparent px-1.5 text-sm hover:border-input focus:border-input focus:bg-background focus:outline-none";
|
|
598
618
|
switch (column.type) {
|
|
599
619
|
case "checkbox":
|
|
600
620
|
return /* @__PURE__ */ jsx(
|
|
@@ -612,7 +632,7 @@ function TagTableCell({
|
|
|
612
632
|
return /* @__PURE__ */ jsxs(
|
|
613
633
|
"select",
|
|
614
634
|
{
|
|
615
|
-
className: cn(field, "
|
|
635
|
+
className: cn(field, "pr-6"),
|
|
616
636
|
value: typeof value === "string" ? value : "",
|
|
617
637
|
onChange: (e) => set(e.target.value || null),
|
|
618
638
|
"aria-label": `${row.name}: ${column.name}`,
|
|
@@ -632,7 +652,7 @@ function TagTableCell({
|
|
|
632
652
|
return /* @__PURE__ */ jsx(
|
|
633
653
|
"input",
|
|
634
654
|
{
|
|
635
|
-
className: cn(field, "
|
|
655
|
+
className: cn(field, "pr-6"),
|
|
636
656
|
type: column.type === "number" ? "number" : column.type === "date" ? "date" : "text",
|
|
637
657
|
value: column.type === "date" ? draft.slice(0, 10) : draft,
|
|
638
658
|
onChange: (e) => setDraft(e.target.value),
|
|
@@ -648,6 +668,95 @@ function TagTableCell({
|
|
|
648
668
|
}
|
|
649
669
|
}
|
|
650
670
|
}
|
|
671
|
+
function TagLinkCell({
|
|
672
|
+
row,
|
|
673
|
+
column,
|
|
674
|
+
tags,
|
|
675
|
+
onOpenTag,
|
|
676
|
+
onChange,
|
|
677
|
+
l,
|
|
678
|
+
testId
|
|
679
|
+
}) {
|
|
680
|
+
const ids = linkedTagIds(cellValue(row, column));
|
|
681
|
+
const kinds = column.options ?? [];
|
|
682
|
+
const options = (tags ?? []).filter(
|
|
683
|
+
(t) => t.value !== row.external_id && (kinds.length === 0 || kinds.includes(t.kind))
|
|
684
|
+
);
|
|
685
|
+
const label = (id) => tags?.find((t) => t.value === id)?.label ?? id;
|
|
686
|
+
const chips = ids.map(
|
|
687
|
+
(id) => onOpenTag ? /* @__PURE__ */ jsx(
|
|
688
|
+
"button",
|
|
689
|
+
{
|
|
690
|
+
type: "button",
|
|
691
|
+
onClick: () => onOpenTag(id),
|
|
692
|
+
className: "inline-flex min-w-0 max-w-full items-center truncate rounded-md border border-border px-1.5 py-0.5 text-xs hover:border-primary/40 hover:text-primary",
|
|
693
|
+
"data-testid": `${testId}-link-${id}`,
|
|
694
|
+
children: label(id)
|
|
695
|
+
},
|
|
696
|
+
id
|
|
697
|
+
) : /* @__PURE__ */ jsx(
|
|
698
|
+
"span",
|
|
699
|
+
{
|
|
700
|
+
className: "inline-flex min-w-0 max-w-full truncate rounded-md border border-border px-1.5 py-0.5 text-xs",
|
|
701
|
+
"data-testid": `${testId}-link-${id}`,
|
|
702
|
+
children: label(id)
|
|
703
|
+
},
|
|
704
|
+
id
|
|
705
|
+
)
|
|
706
|
+
);
|
|
707
|
+
if (!onChange)
|
|
708
|
+
return /* @__PURE__ */ jsx("span", { className: "flex min-w-0 flex-wrap gap-1", "data-testid": testId, children: chips.length ? chips : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: l.choose }) });
|
|
709
|
+
const current = ids[0];
|
|
710
|
+
return (
|
|
711
|
+
// Wraps: in a narrow column the name breaks between words and the picker moves below it.
|
|
712
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-wrap items-center gap-x-1 py-1", children: [
|
|
713
|
+
current && (onOpenTag ? /* @__PURE__ */ jsxs(
|
|
714
|
+
"button",
|
|
715
|
+
{
|
|
716
|
+
type: "button",
|
|
717
|
+
onClick: () => onOpenTag(current),
|
|
718
|
+
className: "max-w-full rounded px-1 text-left text-sm break-words hover:text-primary hover:underline focus-visible:ring-2 focus-visible:ring-ring",
|
|
719
|
+
"aria-label": `Open ${label(current)}`,
|
|
720
|
+
title: `Open ${label(current)}`,
|
|
721
|
+
"data-testid": `${testId}-open`,
|
|
722
|
+
children: [
|
|
723
|
+
label(current),
|
|
724
|
+
/* @__PURE__ */ jsx(ArrowUpRight, { className: "ml-0.5 inline size-3.5 align-[-2px] text-muted-foreground" })
|
|
725
|
+
]
|
|
726
|
+
}
|
|
727
|
+
) : /* @__PURE__ */ jsx("span", { className: "max-w-full px-1 text-sm break-words", children: label(current) })),
|
|
728
|
+
/* @__PURE__ */ jsxs(
|
|
729
|
+
"span",
|
|
730
|
+
{
|
|
731
|
+
className: cn(
|
|
732
|
+
"relative inline-flex h-6 shrink-0 items-center rounded text-muted-foreground hover:bg-muted hover:text-foreground focus-within:ring-2 focus-within:ring-ring",
|
|
733
|
+
current ? "w-6 justify-center" : "min-w-0 flex-1 gap-1 px-1 text-sm"
|
|
734
|
+
),
|
|
735
|
+
title: current ? `${column.name}: ${label(current)}` : void 0,
|
|
736
|
+
children: [
|
|
737
|
+
!current && /* @__PURE__ */ jsx("span", { className: "truncate", children: l.choose }),
|
|
738
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5 shrink-0" }),
|
|
739
|
+
/* @__PURE__ */ jsxs(
|
|
740
|
+
"select",
|
|
741
|
+
{
|
|
742
|
+
className: "absolute inset-0 h-full w-full cursor-pointer opacity-0",
|
|
743
|
+
value: current ?? "",
|
|
744
|
+
onChange: (e) => onChange(e.target.value ? [e.target.value] : null),
|
|
745
|
+
"aria-label": `${row.name}: ${column.name}`,
|
|
746
|
+
"data-testid": testId,
|
|
747
|
+
children: [
|
|
748
|
+
/* @__PURE__ */ jsx("option", { value: "", children: l.choose }),
|
|
749
|
+
options.map((t) => /* @__PURE__ */ jsx("option", { value: t.value, children: t.label }, t.value)),
|
|
750
|
+
current && !options.some((t) => t.value === current) && /* @__PURE__ */ jsx("option", { value: current, children: label(current) })
|
|
751
|
+
]
|
|
752
|
+
}
|
|
753
|
+
)
|
|
754
|
+
]
|
|
755
|
+
}
|
|
756
|
+
)
|
|
757
|
+
] })
|
|
758
|
+
);
|
|
759
|
+
}
|
|
651
760
|
var countText = (count2, one, many) => count2 === 1 ? one : count2 ? many.replace("{count}", String(count2)) : null;
|
|
652
761
|
function Evidence({
|
|
653
762
|
row,
|
|
@@ -658,27 +767,15 @@ function Evidence({
|
|
|
658
767
|
onOpenRow,
|
|
659
768
|
testId
|
|
660
769
|
}) {
|
|
661
|
-
if (isGap(row))
|
|
662
|
-
return /* @__PURE__ */ jsxs(
|
|
663
|
-
"span",
|
|
664
|
-
{
|
|
665
|
-
className: "inline-flex items-center gap-1 rounded-full bg-amber-500/15 px-2 py-0.5 text-xs font-medium text-amber-700 dark:text-amber-300",
|
|
666
|
-
"data-testid": `${testId}-gap`,
|
|
667
|
-
children: [
|
|
668
|
-
/* @__PURE__ */ jsx(AlertTriangle, { className: "size-3" }),
|
|
669
|
-
" ",
|
|
670
|
-
l.gap
|
|
671
|
-
]
|
|
672
|
-
}
|
|
673
|
-
);
|
|
770
|
+
if (isGap(row)) return null;
|
|
674
771
|
const links = rowLinks(row);
|
|
675
772
|
const docs = links.docs ?? [];
|
|
676
773
|
const facts = links.facts ?? [];
|
|
677
774
|
const threads = links.threads ?? [];
|
|
678
775
|
const more = links.doc_count - docs.length + (links.fact_count - facts.length) + (links.thread_count - threads.length);
|
|
679
|
-
const chip = "inline-flex max-w-
|
|
680
|
-
return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1", "data-testid": testId, children: [
|
|
681
|
-
/* @__PURE__ */ jsx("span", { className: "mr-1 text-xs text-muted-foreground", children: [
|
|
776
|
+
const chip = "inline-flex min-w-0 max-w-full items-center gap-1 truncate rounded-md border border-border px-1.5 py-0.5 text-xs hover:border-primary/40 hover:text-primary disabled:hover:border-border disabled:hover:text-inherit";
|
|
777
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-wrap items-center gap-1", "data-testid": testId, children: [
|
|
778
|
+
/* @__PURE__ */ jsx("span", { className: "mr-1 w-full text-xs text-muted-foreground", children: [
|
|
682
779
|
countText(links.doc_count, l.document, l.documents),
|
|
683
780
|
countText(links.fact_count, l.fact, l.facts),
|
|
684
781
|
countText(links.thread_count, l.thread, l.threads)
|
|
@@ -756,6 +853,8 @@ function TagTable({
|
|
|
756
853
|
onExport,
|
|
757
854
|
onDownload,
|
|
758
855
|
people,
|
|
856
|
+
tags,
|
|
857
|
+
onOpenTag,
|
|
759
858
|
actions,
|
|
760
859
|
labels,
|
|
761
860
|
className,
|
|
@@ -765,12 +864,9 @@ function TagTable({
|
|
|
765
864
|
const columns = useMemo(() => table?.columns ?? [], [table]);
|
|
766
865
|
const rows = table?.rows ?? [];
|
|
767
866
|
const [editingColumns, setEditingColumns] = useState(false);
|
|
768
|
-
const gaps = rows.filter(isGap).length;
|
|
769
|
-
const [gapsOnly, setGapsOnly] = useState(false);
|
|
770
867
|
const [name, setName] = useState("");
|
|
771
868
|
const [adding, setAdding] = useState(false);
|
|
772
869
|
const [exporting, setExporting] = useState(false);
|
|
773
|
-
const shown = gapsOnly ? rows.filter(isGap) : rows;
|
|
774
870
|
const add = async () => {
|
|
775
871
|
const n = name.trim();
|
|
776
872
|
if (!n || !onAddRow) return;
|
|
@@ -783,76 +879,58 @@ function TagTable({
|
|
|
783
879
|
}
|
|
784
880
|
};
|
|
785
881
|
return /* @__PURE__ */ jsxs("div", { className: cn("space-y-3", className), "data-testid": testId, children: [
|
|
786
|
-
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
disabled: exporting || rows.length === 0,
|
|
839
|
-
onClick: async () => {
|
|
840
|
-
setExporting(true);
|
|
841
|
-
try {
|
|
842
|
-
await onExport();
|
|
843
|
-
} finally {
|
|
844
|
-
setExporting(false);
|
|
845
|
-
}
|
|
846
|
-
},
|
|
847
|
-
"data-testid": `${testId}-export`,
|
|
848
|
-
children: [
|
|
849
|
-
exporting ? /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsx(FileDown, { className: "size-4" }),
|
|
850
|
-
exporting ? l.exporting : l.export
|
|
851
|
-
]
|
|
852
|
-
}
|
|
853
|
-
)
|
|
854
|
-
] })
|
|
855
|
-
] }),
|
|
882
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-2", children: /* @__PURE__ */ jsxs("div", { className: "ml-auto flex flex-wrap items-center gap-2", children: [
|
|
883
|
+
actions,
|
|
884
|
+
onChangeColumns && /* @__PURE__ */ jsxs(
|
|
885
|
+
Button,
|
|
886
|
+
{
|
|
887
|
+
variant: "outline",
|
|
888
|
+
size: "sm",
|
|
889
|
+
"aria-pressed": editingColumns,
|
|
890
|
+
onClick: () => setEditingColumns((v) => !v),
|
|
891
|
+
"data-testid": `${testId}-edit-columns`,
|
|
892
|
+
children: [
|
|
893
|
+
/* @__PURE__ */ jsx(SlidersHorizontal, { className: "size-4" }),
|
|
894
|
+
l.editColumns
|
|
895
|
+
]
|
|
896
|
+
}
|
|
897
|
+
),
|
|
898
|
+
onDownload && /* @__PURE__ */ jsxs(
|
|
899
|
+
Button,
|
|
900
|
+
{
|
|
901
|
+
variant: "outline",
|
|
902
|
+
size: "sm",
|
|
903
|
+
disabled: rows.length === 0,
|
|
904
|
+
onClick: () => void onDownload(),
|
|
905
|
+
"data-testid": `${testId}-download`,
|
|
906
|
+
children: [
|
|
907
|
+
/* @__PURE__ */ jsx(Download, { className: "size-4" }),
|
|
908
|
+
l.download
|
|
909
|
+
]
|
|
910
|
+
}
|
|
911
|
+
),
|
|
912
|
+
onExport && /* @__PURE__ */ jsxs(
|
|
913
|
+
Button,
|
|
914
|
+
{
|
|
915
|
+
variant: "outline",
|
|
916
|
+
size: "sm",
|
|
917
|
+
disabled: exporting || rows.length === 0,
|
|
918
|
+
onClick: async () => {
|
|
919
|
+
setExporting(true);
|
|
920
|
+
try {
|
|
921
|
+
await onExport();
|
|
922
|
+
} finally {
|
|
923
|
+
setExporting(false);
|
|
924
|
+
}
|
|
925
|
+
},
|
|
926
|
+
"data-testid": `${testId}-export`,
|
|
927
|
+
children: [
|
|
928
|
+
exporting ? /* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin" }) : /* @__PURE__ */ jsx(FileDown, { className: "size-4" }),
|
|
929
|
+
exporting ? l.exporting : l.export
|
|
930
|
+
]
|
|
931
|
+
}
|
|
932
|
+
)
|
|
933
|
+
] }) }),
|
|
856
934
|
editingColumns && onChangeColumns && /* @__PURE__ */ jsx(
|
|
857
935
|
TagColumnsEditor,
|
|
858
936
|
{
|
|
@@ -866,116 +944,6 @@ function TagTable({
|
|
|
866
944
|
testId: `${testId}-columns`
|
|
867
945
|
}
|
|
868
946
|
),
|
|
869
|
-
isLoading ? /* @__PURE__ */ jsxs("p", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
870
|
-
/* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin" }),
|
|
871
|
-
" ",
|
|
872
|
-
l.loading
|
|
873
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: "overflow-x-auto rounded-lg border border-border", children: [
|
|
874
|
-
/* @__PURE__ */ jsxs("table", { className: "w-full border-collapse text-sm", "data-testid": `${testId}-table`, children: [
|
|
875
|
-
/* @__PURE__ */ jsx("thead", { className: "bg-muted/40", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
876
|
-
/* @__PURE__ */ jsx(
|
|
877
|
-
"th",
|
|
878
|
-
{
|
|
879
|
-
className: cn(
|
|
880
|
-
ROW_LABEL_WIDTH,
|
|
881
|
-
"sticky left-0 z-10 bg-muted/40 px-3 py-2 text-left font-medium"
|
|
882
|
-
),
|
|
883
|
-
children: l.row
|
|
884
|
-
}
|
|
885
|
-
),
|
|
886
|
-
columns.map((c) => /* @__PURE__ */ jsx(
|
|
887
|
-
"th",
|
|
888
|
-
{
|
|
889
|
-
className: "px-3 py-2 text-left font-medium",
|
|
890
|
-
"data-testid": `${testId}-column-${c.id}`,
|
|
891
|
-
children: c.name
|
|
892
|
-
},
|
|
893
|
-
c.id
|
|
894
|
-
)),
|
|
895
|
-
/* @__PURE__ */ jsx("th", { className: "px-3 py-2 text-left font-medium", children: l.evidence })
|
|
896
|
-
] }) }),
|
|
897
|
-
/* @__PURE__ */ jsxs("tbody", { children: [
|
|
898
|
-
shown.map((row) => {
|
|
899
|
-
const id = row.external_id;
|
|
900
|
-
const gap = isGap(row);
|
|
901
|
-
return /* @__PURE__ */ jsxs(
|
|
902
|
-
"tr",
|
|
903
|
-
{
|
|
904
|
-
className: cn("border-t border-border align-top", gap && "bg-amber-500/5"),
|
|
905
|
-
"data-gap": gap || void 0,
|
|
906
|
-
"data-testid": `${testId}-row-${id}`,
|
|
907
|
-
children: [
|
|
908
|
-
/* @__PURE__ */ jsx(
|
|
909
|
-
"th",
|
|
910
|
-
{
|
|
911
|
-
scope: "row",
|
|
912
|
-
className: cn(
|
|
913
|
-
ROW_LABEL_WIDTH,
|
|
914
|
-
"sticky left-0 z-10 px-3 py-2 text-left font-medium",
|
|
915
|
-
gap ? "bg-amber-50 dark:bg-amber-950" : "bg-background",
|
|
916
|
-
gap && "border-l-2 border-l-amber-500"
|
|
917
|
-
),
|
|
918
|
-
children: onOpenRow ? /* @__PURE__ */ jsx(
|
|
919
|
-
"button",
|
|
920
|
-
{
|
|
921
|
-
type: "button",
|
|
922
|
-
className: cn(ROW_LABEL, "text-left hover:text-primary hover:underline"),
|
|
923
|
-
title: row.name,
|
|
924
|
-
onClick: () => onOpenRow(id),
|
|
925
|
-
"data-testid": `${testId}-row-${id}-label`,
|
|
926
|
-
children: row.name
|
|
927
|
-
}
|
|
928
|
-
) : /* @__PURE__ */ jsx(
|
|
929
|
-
"span",
|
|
930
|
-
{
|
|
931
|
-
className: ROW_LABEL,
|
|
932
|
-
title: row.name,
|
|
933
|
-
"data-testid": `${testId}-row-${id}-label`,
|
|
934
|
-
children: row.name
|
|
935
|
-
}
|
|
936
|
-
)
|
|
937
|
-
}
|
|
938
|
-
),
|
|
939
|
-
columns.map((c) => /* @__PURE__ */ jsx("td", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsx(
|
|
940
|
-
TagTableCell,
|
|
941
|
-
{
|
|
942
|
-
row,
|
|
943
|
-
column: c,
|
|
944
|
-
people,
|
|
945
|
-
onChange: onChangeValue,
|
|
946
|
-
l,
|
|
947
|
-
testId: `${testId}-cell-${id}-${c.id}`
|
|
948
|
-
}
|
|
949
|
-
) }, c.id)),
|
|
950
|
-
/* @__PURE__ */ jsx("td", { className: "px-3 py-2", children: /* @__PURE__ */ jsx(
|
|
951
|
-
Evidence,
|
|
952
|
-
{
|
|
953
|
-
row,
|
|
954
|
-
l,
|
|
955
|
-
onOpenDocument,
|
|
956
|
-
onOpenFact,
|
|
957
|
-
onOpenThread,
|
|
958
|
-
onOpenRow,
|
|
959
|
-
testId: `${testId}-evidence-${id}`
|
|
960
|
-
}
|
|
961
|
-
) })
|
|
962
|
-
]
|
|
963
|
-
},
|
|
964
|
-
id
|
|
965
|
-
);
|
|
966
|
-
}),
|
|
967
|
-
shown.length === 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
|
|
968
|
-
"td",
|
|
969
|
-
{
|
|
970
|
-
colSpan: columns.length + 2,
|
|
971
|
-
className: "px-3 py-6 text-center text-sm text-muted-foreground",
|
|
972
|
-
children: l.empty
|
|
973
|
-
}
|
|
974
|
-
) })
|
|
975
|
-
] })
|
|
976
|
-
] }),
|
|
977
|
-
columns.length === 0 && rows.length > 0 && /* @__PURE__ */ jsx("p", { className: "border-t border-border px-3 py-2 text-xs text-muted-foreground", children: l.noColumns })
|
|
978
|
-
] }),
|
|
979
947
|
onAddRow && /* @__PURE__ */ jsxs(
|
|
980
948
|
"form",
|
|
981
949
|
{
|
|
@@ -1012,7 +980,123 @@ function TagTable({
|
|
|
1012
980
|
)
|
|
1013
981
|
]
|
|
1014
982
|
}
|
|
1015
|
-
)
|
|
983
|
+
),
|
|
984
|
+
isLoading ? /* @__PURE__ */ jsxs("p", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
985
|
+
/* @__PURE__ */ jsx(Loader2, { className: "size-4 animate-spin" }),
|
|
986
|
+
" ",
|
|
987
|
+
l.loading
|
|
988
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "overflow-x-auto rounded-lg border border-border", children: [
|
|
989
|
+
/* @__PURE__ */ jsxs(
|
|
990
|
+
"table",
|
|
991
|
+
{
|
|
992
|
+
className: "w-full min-w-[36rem] table-fixed border-collapse text-sm",
|
|
993
|
+
"data-testid": `${testId}-table`,
|
|
994
|
+
children: [
|
|
995
|
+
/* @__PURE__ */ jsx("thead", { className: "bg-muted/40", children: /* @__PURE__ */ jsxs("tr", { children: [
|
|
996
|
+
/* @__PURE__ */ jsx(
|
|
997
|
+
"th",
|
|
998
|
+
{
|
|
999
|
+
className: cn(
|
|
1000
|
+
ROW_LABEL_WIDTH,
|
|
1001
|
+
"sticky left-0 z-10 bg-muted/40 px-3 py-2 text-left font-medium"
|
|
1002
|
+
),
|
|
1003
|
+
children: l.row
|
|
1004
|
+
}
|
|
1005
|
+
),
|
|
1006
|
+
columns.map((c) => /* @__PURE__ */ jsx(
|
|
1007
|
+
"th",
|
|
1008
|
+
{
|
|
1009
|
+
className: "truncate px-3 py-2 text-left font-medium",
|
|
1010
|
+
title: c.name,
|
|
1011
|
+
"data-testid": `${testId}-column-${c.id}`,
|
|
1012
|
+
children: c.name
|
|
1013
|
+
},
|
|
1014
|
+
c.id
|
|
1015
|
+
)),
|
|
1016
|
+
/* @__PURE__ */ jsx("th", { className: cn(EVIDENCE_WIDTH, "px-3 py-2 text-left font-medium"), children: l.evidence })
|
|
1017
|
+
] }) }),
|
|
1018
|
+
/* @__PURE__ */ jsxs("tbody", { children: [
|
|
1019
|
+
rows.map((row) => {
|
|
1020
|
+
const id = row.external_id;
|
|
1021
|
+
return /* @__PURE__ */ jsxs(
|
|
1022
|
+
"tr",
|
|
1023
|
+
{
|
|
1024
|
+
className: "border-t border-border align-top",
|
|
1025
|
+
"data-testid": `${testId}-row-${id}`,
|
|
1026
|
+
children: [
|
|
1027
|
+
/* @__PURE__ */ jsx(
|
|
1028
|
+
"th",
|
|
1029
|
+
{
|
|
1030
|
+
scope: "row",
|
|
1031
|
+
className: cn(
|
|
1032
|
+
ROW_LABEL_WIDTH,
|
|
1033
|
+
"sticky left-0 z-10 bg-background px-3 py-2 text-left font-medium"
|
|
1034
|
+
),
|
|
1035
|
+
children: onOpenRow ? /* @__PURE__ */ jsx(
|
|
1036
|
+
"button",
|
|
1037
|
+
{
|
|
1038
|
+
type: "button",
|
|
1039
|
+
className: cn(ROW_LABEL, "text-left hover:text-primary hover:underline"),
|
|
1040
|
+
title: row.name,
|
|
1041
|
+
onClick: () => onOpenRow(id),
|
|
1042
|
+
"data-testid": `${testId}-row-${id}-label`,
|
|
1043
|
+
children: row.name
|
|
1044
|
+
}
|
|
1045
|
+
) : /* @__PURE__ */ jsx(
|
|
1046
|
+
"span",
|
|
1047
|
+
{
|
|
1048
|
+
className: ROW_LABEL,
|
|
1049
|
+
title: row.name,
|
|
1050
|
+
"data-testid": `${testId}-row-${id}-label`,
|
|
1051
|
+
children: row.name
|
|
1052
|
+
}
|
|
1053
|
+
)
|
|
1054
|
+
}
|
|
1055
|
+
),
|
|
1056
|
+
columns.map((c) => /* @__PURE__ */ jsx("td", { className: "px-1.5 py-1", children: /* @__PURE__ */ jsx(
|
|
1057
|
+
TagTableCell,
|
|
1058
|
+
{
|
|
1059
|
+
row,
|
|
1060
|
+
column: c,
|
|
1061
|
+
people,
|
|
1062
|
+
tags,
|
|
1063
|
+
onOpenTag,
|
|
1064
|
+
onChange: onChangeValue,
|
|
1065
|
+
l,
|
|
1066
|
+
testId: `${testId}-cell-${id}-${c.id}`
|
|
1067
|
+
}
|
|
1068
|
+
) }, c.id)),
|
|
1069
|
+
/* @__PURE__ */ jsx("td", { className: "min-w-0 px-3 py-2", children: /* @__PURE__ */ jsx(
|
|
1070
|
+
Evidence,
|
|
1071
|
+
{
|
|
1072
|
+
row,
|
|
1073
|
+
l,
|
|
1074
|
+
onOpenDocument,
|
|
1075
|
+
onOpenFact,
|
|
1076
|
+
onOpenThread,
|
|
1077
|
+
onOpenRow,
|
|
1078
|
+
testId: `${testId}-evidence-${id}`
|
|
1079
|
+
}
|
|
1080
|
+
) })
|
|
1081
|
+
]
|
|
1082
|
+
},
|
|
1083
|
+
id
|
|
1084
|
+
);
|
|
1085
|
+
}),
|
|
1086
|
+
rows.length === 0 && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
|
|
1087
|
+
"td",
|
|
1088
|
+
{
|
|
1089
|
+
colSpan: columns.length + 2,
|
|
1090
|
+
className: "px-3 py-6 text-center text-sm text-muted-foreground",
|
|
1091
|
+
children: l.empty
|
|
1092
|
+
}
|
|
1093
|
+
) })
|
|
1094
|
+
] })
|
|
1095
|
+
]
|
|
1096
|
+
}
|
|
1097
|
+
),
|
|
1098
|
+
columns.length === 0 && rows.length > 0 && /* @__PURE__ */ jsx("p", { className: "border-t border-border px-3 py-2 text-xs text-muted-foreground", children: l.noColumns })
|
|
1099
|
+
] })
|
|
1016
1100
|
] });
|
|
1017
1101
|
}
|
|
1018
1102
|
var DOCX_MIME_TYPE = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
@@ -1156,5 +1240,5 @@ function tagTableDocx(table, options) {
|
|
|
1156
1240
|
}
|
|
1157
1241
|
|
|
1158
1242
|
export { DEFAULT_TAG_COLUMNS_EDITOR_LABELS, DEFAULT_TAG_TABLE_DOCX_LABELS, DEFAULT_TAG_TABLE_LABELS, DEFAULT_THREAD_FOLLOW_LABELS, DEFAULT_WORKSPACE_ACTIVITY_LABELS, DEFAULT_WORKSPACE_NOTIFICATION_MENU_LABELS, DOCX_MIME_TYPE, TAG_TABLE_DOCX_LANDSCAPE_AFTER, TagColumnsEditor, TagTable, TagTableCell, ThreadFollowButton, ThreadFollowMenuItem, WorkspaceActivityList, WorkspaceNotificationMenu, cellText, cellValue, fieldWrites, isGap, parseCell, rowLinks, tagTableDocumentXml, tagTableDocx, tagTableMarkdown, workspaceActivityHeadline, workspaceActivityTarget };
|
|
1159
|
-
//# sourceMappingURL=chunk-
|
|
1160
|
-
//# sourceMappingURL=chunk-
|
|
1243
|
+
//# sourceMappingURL=chunk-NXWKMKZY.js.map
|
|
1244
|
+
//# sourceMappingURL=chunk-NXWKMKZY.js.map
|