@arbidocs/blocks 0.4.66 → 0.4.68
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 +221 -221
- package/dist/agents/index.js +5 -5
- package/dist/{chunk-UWUCWIKQ.cjs → chunk-5ZZCS2EK.cjs} +7 -7
- package/dist/chunk-5ZZCS2EK.cjs.map +1 -0
- package/dist/{chunk-DHPVD747.js → chunk-FAVN6VUR.js} +7 -7
- package/dist/chunk-FAVN6VUR.js.map +1 -0
- package/dist/{chunk-MDW5YCHZ.cjs → chunk-VUEZARW5.cjs} +3 -3
- package/dist/{chunk-MDW5YCHZ.cjs.map → chunk-VUEZARW5.cjs.map} +1 -1
- package/dist/{chunk-HTJXMA26.js → chunk-VZGBCBYB.js} +3 -3
- package/dist/{chunk-HTJXMA26.js.map → chunk-VZGBCBYB.js.map} +1 -1
- package/dist/connect/index.cjs +22 -22
- package/dist/connect/index.js +2 -2
- package/dist/facts/FactSearchParts.d.ts +5 -4
- package/dist/facts/FactsBulkBar.d.ts +11 -11
- package/dist/facts/FactsTable.d.ts +4 -2
- package/dist/facts/fact-row.d.ts +0 -1
- package/dist/facts/factColumns.d.ts +13 -9
- package/dist/facts/index.cjs +65 -51
- package/dist/facts/index.cjs.map +1 -1
- package/dist/facts/index.js +66 -52
- package/dist/facts/index.js.map +1 -1
- package/dist/files/index.cjs +3 -3
- package/dist/files/index.js +3 -3
- package/dist/home/DashboardParts.d.ts +2 -4
- package/dist/home/index.cjs +10 -3
- package/dist/home/index.cjs.map +1 -1
- package/dist/home/index.js +11 -4
- package/dist/home/index.js.map +1 -1
- package/dist/index.cjs +713 -713
- package/dist/index.js +14 -14
- package/dist/settings/index.cjs +33 -33
- package/dist/settings/index.js +4 -4
- package/dist/shell/index.cjs +10 -10
- package/dist/shell/index.js +2 -2
- package/dist/studio/index.cjs +1 -1
- package/dist/studio/index.js +1 -1
- package/dist/workspaces/index.cjs +2 -2
- package/dist/workspaces/index.js +2 -2
- package/package.json +4 -4
- package/dist/chunk-DHPVD747.js.map +0 -1
- package/dist/chunk-UWUCWIKQ.cjs.map +0 -1
package/dist/facts/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { ViewToggle } from '../chunk-IC2VHFWR.js';
|
|
3
|
-
import { SearchHit } from '../chunk-A2YAC22G.js';
|
|
4
3
|
import { formatSpan, TimelineCalendar, TimelineGantt } from '../chunk-4EZVCGRL.js';
|
|
4
|
+
import { SearchHit } from '../chunk-A2YAC22G.js';
|
|
5
5
|
import { GridView, SelectionBar, SelectionBarAction } from '../chunk-BUHKUKKB.js';
|
|
6
|
-
import { TabHeader } from '../chunk-4WWM3GQ5.js';
|
|
7
6
|
import { FilterInput } from '../chunk-YU2KUMGE.js';
|
|
8
7
|
export { DEFAULT_FILTER_INPUT_LABELS as DEFAULT_FACTS_FILTER_INPUT_LABELS, DEFAULT_FILTER_FIELDS as FACTS_SEARCH_FIELD_OPTIONS, FilterInput as FactsFilterInput } from '../chunk-YU2KUMGE.js';
|
|
8
|
+
import { TabHeader } from '../chunk-4WWM3GQ5.js';
|
|
9
|
+
import '../chunk-76JDDMSP.js';
|
|
9
10
|
import '../chunk-SLSBJRWW.js';
|
|
10
11
|
import { observeResize } from '../chunk-NPLYHR2E.js';
|
|
11
|
-
import '../chunk-76JDDMSP.js';
|
|
12
12
|
import { initials } from '../chunk-OXF2IFXG.js';
|
|
13
13
|
import { testIdOr } from '../chunk-7F6CBP3Z.js';
|
|
14
|
-
import { PencilLine, Check, MoreVertical, Pencil, Trash2, CalendarDays, X, Columns3, ChevronDown, RotateCcw, Milestone, CalendarClock, Scale, Lightbulb, ArrowRight, Loader2, Info,
|
|
14
|
+
import { PencilLine, Check, MoreVertical, Pencil, Trash2, CalendarDays, X, Columns3, ChevronDown, RotateCcw, Milestone, CalendarClock, Scale, Lightbulb, ArrowRight, Loader2, Info, Paperclip, Tags, MoreHorizontal, FolderUp, BookMarked, Plus, Search, CheckCircle2, CornerDownLeft, Quote, ChevronLeft, ChevronRight, Table2, CalendarRange, GanttChartSquare } from 'lucide-react';
|
|
15
15
|
import { Popover, PopoverTrigger, PopoverContent, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, cn, Input, Button, CommandSeparator, Tooltip, TooltipTrigger, TooltipContent } from '@arbidocs/react/ui';
|
|
16
16
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
17
17
|
import { memo, useState, useMemo, useRef, useEffect } from 'react';
|
|
@@ -26,11 +26,11 @@ function decodeWhitespaceEntities(text) {
|
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
var DEFAULT_FACT_COLUMN_LABELS = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
inChatHeaderTooltip: "Facts added to this chat are always in context for this chat",
|
|
30
|
+
inChatTitle: "In this chat \u2014 always in context for it. Click to remove from chat.",
|
|
31
|
+
notInChatTitle: "Add to chat \u2014 always in context for this chat",
|
|
32
|
+
removeFromChat: "Remove from chat",
|
|
33
|
+
addToChat: "Add to chat",
|
|
34
34
|
fact: "Fact",
|
|
35
35
|
dates: "Dates",
|
|
36
36
|
dateTitle: "Date of the fact itself, not when this was saved",
|
|
@@ -65,7 +65,7 @@ function sourceDocCount(fact) {
|
|
|
65
65
|
return fact?.citations?.length ?? 0;
|
|
66
66
|
}
|
|
67
67
|
var DEFAULT_FACT_COLUMN_ORDER = [
|
|
68
|
-
"
|
|
68
|
+
"in_chat",
|
|
69
69
|
"text",
|
|
70
70
|
"sources",
|
|
71
71
|
"tags",
|
|
@@ -81,49 +81,54 @@ function createFactColumns(slots) {
|
|
|
81
81
|
const fieldOf = (name) => name;
|
|
82
82
|
const l = { ...DEFAULT_FACT_COLUMN_LABELS, ...slots.labels };
|
|
83
83
|
const ids = slots.testIds;
|
|
84
|
-
const
|
|
84
|
+
const { isInChat, onToggleInChat } = slots;
|
|
85
|
+
const inChatColumn = isInChat && onToggleInChat ? [
|
|
85
86
|
{
|
|
86
|
-
colId: "
|
|
87
|
+
colId: "in_chat",
|
|
87
88
|
headerName: "",
|
|
88
|
-
headerComponent: () => /* @__PURE__ */ jsx("span", { className: "flex size-full items-center justify-center", children: /* @__PURE__ */ jsx(
|
|
89
|
-
|
|
89
|
+
headerComponent: () => /* @__PURE__ */ jsx("span", { className: "flex size-full items-center justify-center", children: /* @__PURE__ */ jsx(Paperclip, { className: "size-3.5 text-muted-foreground" }) }),
|
|
90
|
+
valueGetter: (params) => params.data ? isInChat(params.data) : false,
|
|
90
91
|
width: 44,
|
|
91
92
|
minWidth: 44,
|
|
92
93
|
maxWidth: 44,
|
|
93
94
|
sortable: true,
|
|
94
95
|
resizable: false,
|
|
95
|
-
headerTooltip: l.
|
|
96
|
+
headerTooltip: l.inChatHeaderTooltip,
|
|
96
97
|
cellClass: "cell-hcenter",
|
|
97
|
-
// A toggle, not a readout:
|
|
98
|
-
//
|
|
98
|
+
// A toggle, not a readout: a fact in the chat rides every message of it, so it flips
|
|
99
|
+
// in place.
|
|
99
100
|
cellRenderer: (params) => {
|
|
100
101
|
if (!params.data) return null;
|
|
101
102
|
const fact = params.data;
|
|
103
|
+
const inChat = isInChat(fact);
|
|
102
104
|
return /* @__PURE__ */ jsx(
|
|
103
105
|
"button",
|
|
104
106
|
{
|
|
105
107
|
type: "button",
|
|
106
|
-
onClick: () =>
|
|
107
|
-
title:
|
|
108
|
-
"aria-label":
|
|
109
|
-
"aria-pressed":
|
|
110
|
-
"data-testid": testIdOr(ids?.
|
|
111
|
-
testId: `facts-grid-
|
|
108
|
+
onClick: () => onToggleInChat(fact),
|
|
109
|
+
title: inChat ? l.inChatTitle : l.notInChatTitle,
|
|
110
|
+
"aria-label": inChat ? l.removeFromChat : l.addToChat,
|
|
111
|
+
"aria-pressed": inChat,
|
|
112
|
+
"data-testid": testIdOr(ids?.inChat?.(fact.external_id), {
|
|
113
|
+
testId: `facts-grid-in-chat-${fact.external_id}`
|
|
112
114
|
}),
|
|
113
115
|
className: "flex h-full items-center",
|
|
114
116
|
children: /* @__PURE__ */ jsx(
|
|
115
|
-
|
|
117
|
+
Paperclip,
|
|
116
118
|
{
|
|
117
119
|
className: cn(
|
|
118
120
|
"size-3.5",
|
|
119
|
-
|
|
121
|
+
inChat ? "text-primary" : "text-muted-foreground/30 transition-colors hover:text-muted-foreground"
|
|
120
122
|
)
|
|
121
123
|
}
|
|
122
124
|
)
|
|
123
125
|
}
|
|
124
126
|
);
|
|
125
127
|
}
|
|
126
|
-
}
|
|
128
|
+
}
|
|
129
|
+
] : [];
|
|
130
|
+
const columns = [
|
|
131
|
+
...inChatColumn,
|
|
127
132
|
{
|
|
128
133
|
colId: "text",
|
|
129
134
|
suppressHeaderFilterButton: true,
|
|
@@ -435,7 +440,8 @@ var defaultFormatDate = (iso) => {
|
|
|
435
440
|
var EMPTY_STATE = { title: "No facts yet" };
|
|
436
441
|
function FactsTable({
|
|
437
442
|
facts,
|
|
438
|
-
|
|
443
|
+
isInChat,
|
|
444
|
+
onToggleInChat,
|
|
439
445
|
onToggleConfirmed,
|
|
440
446
|
onToggleShared,
|
|
441
447
|
onEdit,
|
|
@@ -454,7 +460,8 @@ function FactsTable({
|
|
|
454
460
|
const l = { ...DEFAULT_FACT_COLUMN_LABELS, ...columnLabels };
|
|
455
461
|
const columnDefs = useMemo(
|
|
456
462
|
() => createFactColumns({
|
|
457
|
-
|
|
463
|
+
isInChat,
|
|
464
|
+
onToggleInChat,
|
|
458
465
|
renderHeader: (params) => /* @__PURE__ */ jsx("span", { className: "text-[12.5px] font-medium", children: params.displayName }),
|
|
459
466
|
renderRowActions: (fact) => onEdit && onDelete ? /* @__PURE__ */ jsx(FactRowActions, { onEdit: () => onEdit(fact), onDelete: () => onDelete(fact) }) : null,
|
|
460
467
|
renderLabels: (fact) => /* @__PURE__ */ jsx("span", { className: "flex flex-wrap items-center gap-1", children: (fact.tags ?? []).map((tag) => /* @__PURE__ */ jsx(
|
|
@@ -499,7 +506,8 @@ function FactsTable({
|
|
|
499
506
|
labels: columnLabels
|
|
500
507
|
}),
|
|
501
508
|
[
|
|
502
|
-
|
|
509
|
+
isInChat,
|
|
510
|
+
onToggleInChat,
|
|
503
511
|
onToggleConfirmed,
|
|
504
512
|
onToggleShared,
|
|
505
513
|
onEdit,
|
|
@@ -535,7 +543,6 @@ function toFactRow(record) {
|
|
|
535
543
|
return {
|
|
536
544
|
external_id: record.id,
|
|
537
545
|
text: record.text,
|
|
538
|
-
pinned: record.pinned ?? false,
|
|
539
546
|
confirmed: record.confirmed ?? false,
|
|
540
547
|
shared: record.shared ?? false,
|
|
541
548
|
date_start: record.dateStart ?? null,
|
|
@@ -1326,7 +1333,7 @@ var DEFAULT_FACTS_FIELDS_BUTTON_LABELS = {
|
|
|
1326
1333
|
fields: "Fields",
|
|
1327
1334
|
defaultView: "Default view",
|
|
1328
1335
|
columns: "Columns",
|
|
1329
|
-
columnNames: {
|
|
1336
|
+
columnNames: { in_chat: "In chat" }
|
|
1330
1337
|
};
|
|
1331
1338
|
function FactsFieldsButton({
|
|
1332
1339
|
getGridApi,
|
|
@@ -1734,24 +1741,24 @@ function FactComposer({
|
|
|
1734
1741
|
);
|
|
1735
1742
|
}
|
|
1736
1743
|
var DEFAULT_FACTS_BULK_BAR_LABELS = {
|
|
1737
|
-
|
|
1738
|
-
|
|
1744
|
+
removeFromChat: "Remove from Chat",
|
|
1745
|
+
addToChat: "Add to Chat",
|
|
1739
1746
|
label: "Label",
|
|
1740
1747
|
shared: "Shared",
|
|
1741
1748
|
more: "More",
|
|
1742
1749
|
export: "Export",
|
|
1743
1750
|
delete: "Delete",
|
|
1744
|
-
budgetHint: "
|
|
1751
|
+
budgetHint: "Facts added to this chat are always in ARBI's context for this chat, so they share one budget. This estimates the tokens they add (\u22484 characters per token), capped at ~2,000.",
|
|
1745
1752
|
budget: (tokens, cap) => `~${tokens}/${cap} tokens`,
|
|
1746
|
-
|
|
1747
|
-
|
|
1753
|
+
removeFromChatTooltip: (n) => `Remove the selected ${n} from this chat`,
|
|
1754
|
+
addToChatTooltip: (n) => `Add the selected ${n} to this chat, so they are always in its context`,
|
|
1748
1755
|
labelTooltip: (n) => `Add or remove labels from selected ${n}`
|
|
1749
1756
|
};
|
|
1750
1757
|
function FactsBulkBar({
|
|
1751
1758
|
count,
|
|
1752
1759
|
onClear,
|
|
1753
|
-
|
|
1754
|
-
|
|
1760
|
+
allSelectedInChat,
|
|
1761
|
+
onToggleInChat,
|
|
1755
1762
|
onLabel,
|
|
1756
1763
|
sharedToggle,
|
|
1757
1764
|
onExport,
|
|
@@ -1776,7 +1783,7 @@ function FactsBulkBar({
|
|
|
1776
1783
|
budget.isOver ? "text-destructive" : "text-muted-foreground"
|
|
1777
1784
|
),
|
|
1778
1785
|
title: l.budgetHint,
|
|
1779
|
-
"data-testid": testIdOr(testIds?.budget, { testId: "facts-page-
|
|
1786
|
+
"data-testid": testIdOr(testIds?.budget, { testId: "facts-page-chat-budget" }),
|
|
1780
1787
|
children: l.budget(budget.tokens.toLocaleString(), budget.cap.toLocaleString())
|
|
1781
1788
|
}
|
|
1782
1789
|
) : null,
|
|
@@ -1784,14 +1791,14 @@ function FactsBulkBar({
|
|
|
1784
1791
|
/* @__PURE__ */ jsx(
|
|
1785
1792
|
SelectionBarAction,
|
|
1786
1793
|
{
|
|
1787
|
-
icon:
|
|
1788
|
-
label:
|
|
1789
|
-
onClick:
|
|
1794
|
+
icon: Paperclip,
|
|
1795
|
+
label: allSelectedInChat ? l.removeFromChat : l.addToChat,
|
|
1796
|
+
onClick: onToggleInChat,
|
|
1790
1797
|
disabled: none,
|
|
1791
1798
|
isCompact,
|
|
1792
|
-
className: "border-
|
|
1793
|
-
tooltip:
|
|
1794
|
-
testId: testIdOr(testIds?.
|
|
1799
|
+
className: "border-blue-border text-blue-text hover:bg-blue-bg hover:text-blue-text",
|
|
1800
|
+
tooltip: allSelectedInChat ? l.removeFromChatTooltip(pluralNoun) : l.addToChatTooltip(pluralNoun),
|
|
1801
|
+
testId: testIdOr(testIds?.inChat, { testId: "bulk-in-chat-facts-button" })
|
|
1795
1802
|
}
|
|
1796
1803
|
),
|
|
1797
1804
|
/* @__PURE__ */ jsx(
|
|
@@ -2026,7 +2033,7 @@ var DEFAULT_FACT_SEARCH_BAR_LABELS = {
|
|
|
2026
2033
|
submit: "Search"
|
|
2027
2034
|
};
|
|
2028
2035
|
var DEFAULT_FACT_SEARCH_RESULT_LABELS = {
|
|
2029
|
-
|
|
2036
|
+
inChat: "In this chat",
|
|
2030
2037
|
verified: "Verified",
|
|
2031
2038
|
open: "Open"
|
|
2032
2039
|
};
|
|
@@ -2152,7 +2159,7 @@ function FactSearchResult({
|
|
|
2152
2159
|
terms,
|
|
2153
2160
|
renderSnippet,
|
|
2154
2161
|
labels,
|
|
2155
|
-
|
|
2162
|
+
isInChat,
|
|
2156
2163
|
isVerified,
|
|
2157
2164
|
isSelected,
|
|
2158
2165
|
onOpen,
|
|
@@ -2189,11 +2196,18 @@ function FactSearchResult({
|
|
|
2189
2196
|
testId: `facts-smart-search-hit-labels-${id}`
|
|
2190
2197
|
}),
|
|
2191
2198
|
children: [
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2199
|
+
isInChat && /* @__PURE__ */ jsxs(
|
|
2200
|
+
"span",
|
|
2201
|
+
{
|
|
2202
|
+
className: "inline-flex items-center gap-1 pr-1",
|
|
2203
|
+
"data-testid": `facts-smart-search-hit-in-chat-${id}`,
|
|
2204
|
+
children: [
|
|
2205
|
+
/* @__PURE__ */ jsx(Paperclip, { className: "size-3" }),
|
|
2206
|
+
" ",
|
|
2207
|
+
l.inChat
|
|
2208
|
+
]
|
|
2209
|
+
}
|
|
2210
|
+
),
|
|
2197
2211
|
labels.map((tag) => /* @__PURE__ */ jsxs(
|
|
2198
2212
|
"span",
|
|
2199
2213
|
{
|