@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/connect/index.cjs
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkBR2CPKFU_cjs = require('../chunk-BR2CPKFU.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkVUEZARW5_cjs = require('../chunk-VUEZARW5.cjs');
|
|
6
6
|
var chunkQVBZESYQ_cjs = require('../chunk-QVBZESYQ.cjs');
|
|
7
7
|
require('../chunk-ADOKTJHV.cjs');
|
|
8
8
|
var chunk5DM6VU4L_cjs = require('../chunk-5DM6VU4L.cjs');
|
|
9
9
|
require('../chunk-VGOFFCMT.cjs');
|
|
10
10
|
require('../chunk-V3L5DONY.cjs');
|
|
11
11
|
require('../chunk-PPCATBOY.cjs');
|
|
12
|
-
require('../chunk-DCDVWPMB.cjs');
|
|
13
12
|
var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
|
|
13
|
+
require('../chunk-DCDVWPMB.cjs');
|
|
14
14
|
var chunkTLQQV7WW_cjs = require('../chunk-TLQQV7WW.cjs');
|
|
15
15
|
require('../chunk-7UTB4PHM.cjs');
|
|
16
16
|
require('../chunk-MHVNT4J3.cjs');
|
|
@@ -252,12 +252,12 @@ function ConnectedProfileCard({ notify: notify3, title = "Profile" }) {
|
|
|
252
252
|
}
|
|
253
253
|
});
|
|
254
254
|
const display = profile?.fullName || user?.name || "Unnamed";
|
|
255
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
256
|
-
|
|
255
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkVUEZARW5_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UserCircle, {}), title, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
256
|
+
chunkVUEZARW5_cjs.ProfileCard,
|
|
257
257
|
{
|
|
258
258
|
avatar: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
259
259
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
260
|
-
|
|
260
|
+
chunkVUEZARW5_cjs.AvatarPicker,
|
|
261
261
|
{
|
|
262
262
|
pictureUrl: profile?.picture ?? user?.picture,
|
|
263
263
|
initials: chunkKDG6FER6_cjs.initials(display),
|
|
@@ -315,10 +315,10 @@ function ConnectedSecuritySection({
|
|
|
315
315
|
},
|
|
316
316
|
onClose: () => setOpen(false)
|
|
317
317
|
});
|
|
318
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
319
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
318
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunkVUEZARW5_cjs.SettingsSection, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.KeyRound, {}), title: "Security", children: [
|
|
319
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkVUEZARW5_cjs.SettingsCard, { padding: "sm", children: [
|
|
320
320
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
321
|
-
|
|
321
|
+
chunkVUEZARW5_cjs.SettingsActionRow,
|
|
322
322
|
{
|
|
323
323
|
title: "Change password",
|
|
324
324
|
description: "Used to sign in and to encrypt your data. Changing it re-encrypts everything in your account.",
|
|
@@ -329,7 +329,7 @@ function ConnectedSecuritySection({
|
|
|
329
329
|
children
|
|
330
330
|
] }),
|
|
331
331
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
332
|
-
|
|
332
|
+
chunkVUEZARW5_cjs.PasswordChangeDialog,
|
|
333
333
|
{
|
|
334
334
|
open,
|
|
335
335
|
onClose: form.onCancel,
|
|
@@ -353,23 +353,23 @@ function ConnectedSecuritySection({
|
|
|
353
353
|
] });
|
|
354
354
|
}
|
|
355
355
|
function ConnectedNotificationPreferences({
|
|
356
|
-
categories =
|
|
356
|
+
categories = chunkVUEZARW5_cjs.EMAIL_NOTIFICATION_CATEGORIES,
|
|
357
357
|
title = "Notifications"
|
|
358
358
|
}) {
|
|
359
359
|
const keys = react.useMemo(
|
|
360
|
-
() => categories ===
|
|
360
|
+
() => categories === chunkVUEZARW5_cjs.EMAIL_NOTIFICATION_CATEGORIES ? chunkVUEZARW5_cjs.EMAIL_NOTIFICATION_KEYS : categories.map((c) => c.key),
|
|
361
361
|
[categories]
|
|
362
362
|
);
|
|
363
363
|
const prefs = react$1.useNotificationPreferences(keys);
|
|
364
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
365
|
-
|
|
364
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkVUEZARW5_cjs.SettingsSection, { title, children: /* @__PURE__ */ jsxRuntime.jsx(chunkVUEZARW5_cjs.SettingsCard, { className: "space-y-0", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
365
|
+
chunkVUEZARW5_cjs.NotificationCategoryList,
|
|
366
366
|
{
|
|
367
367
|
masterId: "emailNotifications",
|
|
368
368
|
masterTitle: "Email Notifications",
|
|
369
369
|
masterDescription: "Email me about activity when I\u2019m away",
|
|
370
370
|
masterChecked: prefs.masterChecked,
|
|
371
371
|
onMasterChange: prefs.setAll,
|
|
372
|
-
categories:
|
|
372
|
+
categories: chunkVUEZARW5_cjs.toNotificationCategories(prefs.checked, categories),
|
|
373
373
|
onCategoryChange: prefs.setCategory
|
|
374
374
|
}
|
|
375
375
|
) }) });
|
|
@@ -383,14 +383,14 @@ function ConnectedSessionsRow({
|
|
|
383
383
|
const sessions = react$1.useSessions({ enabled: open });
|
|
384
384
|
const currentSessionId = react$1.useCurrentSessionId();
|
|
385
385
|
const terminate = react$1.useTerminateSession();
|
|
386
|
-
const views =
|
|
386
|
+
const views = chunkVUEZARW5_cjs.toActiveSessionViews(sessions.data ?? [], {
|
|
387
387
|
currentSessionId,
|
|
388
388
|
terminatingId: terminate.isPending ? terminate.variables : null,
|
|
389
389
|
renderIcon: renderSessionIcon
|
|
390
390
|
});
|
|
391
391
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
392
392
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
393
|
-
|
|
393
|
+
chunkVUEZARW5_cjs.SettingsRow,
|
|
394
394
|
{
|
|
395
395
|
label: "Active sessions",
|
|
396
396
|
description: "Devices and agents currently signed in to your account.",
|
|
@@ -412,7 +412,7 @@ function ConnectedSessionsRow({
|
|
|
412
412
|
}
|
|
413
413
|
),
|
|
414
414
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
415
|
-
|
|
415
|
+
chunkVUEZARW5_cjs.ActiveSessionsDialog,
|
|
416
416
|
{
|
|
417
417
|
open,
|
|
418
418
|
onOpenChange: setOpen,
|
|
@@ -447,7 +447,7 @@ function ConnectedLogoutDialog({
|
|
|
447
447
|
const sessions = react$1.useSessions({ enabled: open });
|
|
448
448
|
const logoutAll = react$1.useLogoutAllSessions();
|
|
449
449
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
450
|
-
|
|
450
|
+
chunkVUEZARW5_cjs.LogoutDialog,
|
|
451
451
|
{
|
|
452
452
|
open,
|
|
453
453
|
onClose,
|
|
@@ -461,7 +461,7 @@ function ConnectedLogoutDialog({
|
|
|
461
461
|
},
|
|
462
462
|
canLogoutAll: true,
|
|
463
463
|
isOnline,
|
|
464
|
-
sessions:
|
|
464
|
+
sessions: chunkVUEZARW5_cjs.toLogoutSessionViews(sessions.data ?? []),
|
|
465
465
|
renderSessionIcon
|
|
466
466
|
}
|
|
467
467
|
);
|
|
@@ -480,7 +480,7 @@ function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
|
|
|
480
480
|
});
|
|
481
481
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
482
482
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
483
|
-
|
|
483
|
+
chunkVUEZARW5_cjs.SettingsDangerZone,
|
|
484
484
|
{
|
|
485
485
|
isOpen: zoneOpen,
|
|
486
486
|
onToggle: () => setZoneOpen((o) => !o),
|
|
@@ -500,12 +500,12 @@ function ConnectedDangerZone({ notify: notify3, renderSubscriptionLink }) {
|
|
|
500
500
|
}
|
|
501
501
|
),
|
|
502
502
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
503
|
-
|
|
503
|
+
chunkVUEZARW5_cjs.DeleteAccountDialog,
|
|
504
504
|
{
|
|
505
505
|
open: dialogOpen,
|
|
506
506
|
onClose: flow.onClose,
|
|
507
507
|
step: flow.step,
|
|
508
|
-
blockers:
|
|
508
|
+
blockers: chunkVUEZARW5_cjs.toDeleteBlockerViews(flow.blockers, renderSubscriptionLink),
|
|
509
509
|
onContinue: flow.onContinue,
|
|
510
510
|
onBack: flow.onBack,
|
|
511
511
|
userEmail: user?.email ?? "",
|
package/dist/connect/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
export { ConnectedAssistantDock, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useSemanticSearch, useWorkspaceDocs } from '../chunk-CW4WXGEN.js';
|
|
3
|
-
import { SettingsSection, ProfileCard, AvatarPicker, SettingsCard, SettingsActionRow, PasswordChangeDialog, EMAIL_NOTIFICATION_KEYS, EMAIL_NOTIFICATION_CATEGORIES, NotificationCategoryList, toNotificationCategories, toActiveSessionViews, SettingsRow, ActiveSessionsDialog, LogoutDialog, toLogoutSessionViews, SettingsDangerZone, DeleteAccountDialog, toDeleteBlockerViews } from '../chunk-
|
|
3
|
+
import { SettingsSection, ProfileCard, AvatarPicker, SettingsCard, SettingsActionRow, PasswordChangeDialog, EMAIL_NOTIFICATION_KEYS, EMAIL_NOTIFICATION_CATEGORIES, NotificationCategoryList, toNotificationCategories, toActiveSessionViews, SettingsRow, ActiveSessionsDialog, LogoutDialog, toLogoutSessionViews, SettingsDangerZone, DeleteAccountDialog, toDeleteBlockerViews } from '../chunk-VZGBCBYB.js';
|
|
4
4
|
import { StreamedArtifactFrame } from '../chunk-LOJVUGBJ.js';
|
|
5
5
|
import '../chunk-VILAPTCB.js';
|
|
6
6
|
import { ChatPage } from '../chunk-DABEWNL2.js';
|
|
7
7
|
import '../chunk-KZJAG7T3.js';
|
|
8
8
|
import '../chunk-3VQYJBOI.js';
|
|
9
9
|
import '../chunk-NPLYHR2E.js';
|
|
10
|
-
import '../chunk-TJMKFY5P.js';
|
|
11
10
|
import { initials } from '../chunk-OXF2IFXG.js';
|
|
11
|
+
import '../chunk-TJMKFY5P.js';
|
|
12
12
|
import { ConnectionProvider, useConnection } from '../chunk-EHXSBH6U.js';
|
|
13
13
|
export { ConnectionProvider, SESSION_EXPIRED_MESSAGE, isAuthenticated, useConnection } from '../chunk-EHXSBH6U.js';
|
|
14
14
|
import '../chunk-AA3PT6KR.js';
|
|
@@ -12,7 +12,7 @@ export interface FactSearchBarTestIds {
|
|
|
12
12
|
submit: string;
|
|
13
13
|
}
|
|
14
14
|
export interface FactSearchResultLabels {
|
|
15
|
-
|
|
15
|
+
inChat: string;
|
|
16
16
|
verified: string;
|
|
17
17
|
open: string;
|
|
18
18
|
}
|
|
@@ -66,7 +66,8 @@ export interface FactSearchResultProps {
|
|
|
66
66
|
terms: string[];
|
|
67
67
|
renderSnippet: (content: string, terms: string[]) => ReactNode;
|
|
68
68
|
labels: FactSearchResultLabel[];
|
|
69
|
-
|
|
69
|
+
/** The fact is in the host's current chat. */
|
|
70
|
+
isInChat?: boolean;
|
|
70
71
|
isVerified?: boolean;
|
|
71
72
|
/** The fact open in the composer. */
|
|
72
73
|
isSelected?: boolean;
|
|
@@ -76,5 +77,5 @@ export interface FactSearchResultProps {
|
|
|
76
77
|
/** Destination of the fact; the card stays a click target (see SearchHit `href`). */
|
|
77
78
|
href?: string;
|
|
78
79
|
}
|
|
79
|
-
/** One facts search result: rank, highlighted text, labels (and
|
|
80
|
-
export declare function FactSearchResult({ id, rank, text, terms, renderSnippet, labels,
|
|
80
|
+
/** One facts search result: rank, highlighted text, labels (and In this chat) and the Verified mark. */
|
|
81
|
+
export declare function FactSearchResult({ id, rank, text, terms, renderSnippet, labels, isInChat, isVerified, isSelected, onOpen, uiLabels: labelOverrides, testIds, href, }: FactSearchResultProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
export interface FactsBulkBarLabels {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
removeFromChat: string;
|
|
4
|
+
addToChat: string;
|
|
5
5
|
label: string;
|
|
6
6
|
shared: string;
|
|
7
7
|
more: string;
|
|
@@ -10,14 +10,14 @@ export interface FactsBulkBarLabels {
|
|
|
10
10
|
budgetHint: string;
|
|
11
11
|
/** The `~{tokens}/{cap} tokens` line (numbers arrive formatted). */
|
|
12
12
|
budget: (tokens: string, cap: string) => string;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
removeFromChatTooltip: (pluralNoun: string) => string;
|
|
14
|
+
addToChatTooltip: (pluralNoun: string) => string;
|
|
15
15
|
labelTooltip: (pluralNoun: string) => string;
|
|
16
16
|
}
|
|
17
17
|
export declare const DEFAULT_FACTS_BULK_BAR_LABELS: FactsBulkBarLabels;
|
|
18
18
|
export interface FactsBulkBarTestIds {
|
|
19
19
|
budget: string;
|
|
20
|
-
|
|
20
|
+
inChat: string;
|
|
21
21
|
label: string;
|
|
22
22
|
more: string;
|
|
23
23
|
export: string;
|
|
@@ -27,15 +27,15 @@ export interface FactsBulkBarProps {
|
|
|
27
27
|
/** Number of selected facts. */
|
|
28
28
|
count: number;
|
|
29
29
|
onClear: () => void;
|
|
30
|
-
/** True when every selected fact is already
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
/** True when every selected fact is already in the current chat (the action then removes). */
|
|
31
|
+
allSelectedInChat: boolean;
|
|
32
|
+
onToggleInChat: () => void;
|
|
33
33
|
onLabel: () => void;
|
|
34
34
|
/** The aggregate Shared switch for the selection (the app binds its toggle). */
|
|
35
35
|
sharedToggle: ReactNode;
|
|
36
36
|
onExport: () => void;
|
|
37
37
|
onDelete: () => void;
|
|
38
|
-
/**
|
|
38
|
+
/** The current chat's facts token budget, shown at the left (the chat's facts, not the selection). */
|
|
39
39
|
budget?: {
|
|
40
40
|
tokens: number;
|
|
41
41
|
cap: number;
|
|
@@ -47,7 +47,7 @@ export interface FactsBulkBarProps {
|
|
|
47
47
|
testIds?: Partial<FactsBulkBarTestIds>;
|
|
48
48
|
}
|
|
49
49
|
/**
|
|
50
|
-
* Sticky bulk-action bar for the facts table:
|
|
50
|
+
* Sticky bulk-action bar for the facts table: Add to Chat, Label, Shared and a More menu (Export,
|
|
51
51
|
* Delete). Actions are disabled until something is selected.
|
|
52
52
|
*/
|
|
53
|
-
export declare function FactsBulkBar({ count, onClear,
|
|
53
|
+
export declare function FactsBulkBar({ count, onClear, allSelectedInChat, onToggleInChat, onLabel, sharedToggle, onExport, onDelete, budget, pluralNoun, labels, testIds, }: FactsBulkBarProps): import("react").JSX.Element;
|
|
@@ -2,7 +2,9 @@ import { type GridViewProps } from '../files/GridView';
|
|
|
2
2
|
import { type FactColumnLabels, type FactRowView } from './factColumns';
|
|
3
3
|
export interface FactsTableProps<T extends FactRowView> {
|
|
4
4
|
facts: T[];
|
|
5
|
-
|
|
5
|
+
/** With `onToggleInChat`, shows the In chat column (whether a fact is in the host's chat). */
|
|
6
|
+
isInChat?: (fact: T) => boolean;
|
|
7
|
+
onToggleInChat?: (fact: T) => void;
|
|
6
8
|
onToggleConfirmed: (fact: T) => void;
|
|
7
9
|
onToggleShared: (fact: T) => void;
|
|
8
10
|
/** The row menu appears when both `onEdit` and `onDelete` are provided. */
|
|
@@ -25,4 +27,4 @@ export interface FactsTableProps<T extends FactRowView> {
|
|
|
25
27
|
testId?: string;
|
|
26
28
|
}
|
|
27
29
|
/** The default facts table: columns, cells and the grid in one component. */
|
|
28
|
-
export declare function FactsTable<T extends FactRowView>({ facts,
|
|
30
|
+
export declare function FactsTable<T extends FactRowView>({ facts, isInChat, onToggleInChat, onToggleConfirmed, onToggleShared, onEdit, onDelete, onOpen, getCreatorName, formatDate, columnLabels, isLoading, gridId, height, rowHeight, gridProps, testId, }: FactsTableProps<T>): import("react").JSX.Element;
|
package/dist/facts/fact-row.d.ts
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
import type { ReactNode } from 'react';
|
|
7
7
|
import type { ColDef, ICellRendererParams, IHeaderParams, ValueGetterParams } from 'ag-grid-community';
|
|
8
8
|
export interface FactColumnLabels {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
inChatHeaderTooltip: string;
|
|
10
|
+
inChatTitle: string;
|
|
11
|
+
notInChatTitle: string;
|
|
12
|
+
removeFromChat: string;
|
|
13
|
+
addToChat: string;
|
|
14
14
|
fact: string;
|
|
15
15
|
dates: string;
|
|
16
16
|
dateTitle: string;
|
|
@@ -29,7 +29,7 @@ export interface FactColumnLabels {
|
|
|
29
29
|
}
|
|
30
30
|
export declare const DEFAULT_FACT_COLUMN_LABELS: FactColumnLabels;
|
|
31
31
|
export interface FactColumnTestIds {
|
|
32
|
-
|
|
32
|
+
inChat: (factId: string) => string;
|
|
33
33
|
text: (factId: string) => string;
|
|
34
34
|
date: (factId: string) => string;
|
|
35
35
|
}
|
|
@@ -37,7 +37,6 @@ export interface FactColumnTestIds {
|
|
|
37
37
|
export interface FactRowView {
|
|
38
38
|
external_id: string;
|
|
39
39
|
text: string;
|
|
40
|
-
pinned: boolean;
|
|
41
40
|
confirmed: boolean;
|
|
42
41
|
shared: boolean;
|
|
43
42
|
date_start?: string | null;
|
|
@@ -52,7 +51,12 @@ export interface FactRowView {
|
|
|
52
51
|
updated_at?: string | null;
|
|
53
52
|
}
|
|
54
53
|
export interface FactColumnSlots<T extends FactRowView> {
|
|
55
|
-
|
|
54
|
+
/** Whether the fact is in the host's current chat. With `onToggleInChat`, adds the In chat
|
|
55
|
+
* column; a host without chats leaves both out. Read at render time: the host refreshes the
|
|
56
|
+
* column when its chat changes. */
|
|
57
|
+
isInChat?: (fact: T) => boolean;
|
|
58
|
+
/** Add the fact to the current chat, or take it out. */
|
|
59
|
+
onToggleInChat?: (fact: T) => void;
|
|
56
60
|
/** Custom header (persistent filter button) for the columns that use one. */
|
|
57
61
|
renderHeader: (params: IHeaderParams, colId: string) => ReactNode;
|
|
58
62
|
/** Row action menu, shown at the right edge of the Fact cell. */
|
|
@@ -84,5 +88,5 @@ export declare const ISO_DATE_FILTER_PARAMS: {
|
|
|
84
88
|
/** How many source documents a fact cites (the Sources column counts documents, not passages). */
|
|
85
89
|
export declare function sourceDocCount(fact: Pick<FactRowView, 'citations'> | undefined): number;
|
|
86
90
|
/** Default left-to-right order; default-hidden columns trail. Every colId must be listed. */
|
|
87
|
-
export declare const DEFAULT_FACT_COLUMN_ORDER: readonly ["
|
|
91
|
+
export declare const DEFAULT_FACT_COLUMN_ORDER: readonly ["in_chat", "text", "sources", "tags", "date", "confirmed", "shared", "created_by", "created_at", "updated_at", "note_id"];
|
|
88
92
|
export declare function createFactColumns<T extends FactRowView>(slots: FactColumnSlots<T>): ColDef<T>[];
|
package/dist/facts/index.cjs
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkZPERNIMP_cjs = require('../chunk-ZPERNIMP.cjs');
|
|
5
|
-
var chunkOUW6G4O2_cjs = require('../chunk-OUW6G4O2.cjs');
|
|
6
5
|
var chunkVPPX5XUF_cjs = require('../chunk-VPPX5XUF.cjs');
|
|
6
|
+
var chunkOUW6G4O2_cjs = require('../chunk-OUW6G4O2.cjs');
|
|
7
7
|
var chunkIA7RTPT3_cjs = require('../chunk-IA7RTPT3.cjs');
|
|
8
|
-
var chunk7RGLTF76_cjs = require('../chunk-7RGLTF76.cjs');
|
|
9
8
|
var chunk2EI7NCUA_cjs = require('../chunk-2EI7NCUA.cjs');
|
|
9
|
+
var chunk7RGLTF76_cjs = require('../chunk-7RGLTF76.cjs');
|
|
10
|
+
require('../chunk-C54XEN5T.cjs');
|
|
10
11
|
require('../chunk-FX3K6LNZ.cjs');
|
|
11
12
|
var chunkPPCATBOY_cjs = require('../chunk-PPCATBOY.cjs');
|
|
12
|
-
require('../chunk-C54XEN5T.cjs');
|
|
13
13
|
var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
|
|
14
14
|
var chunkMHVNT4J3_cjs = require('../chunk-MHVNT4J3.cjs');
|
|
15
15
|
var lucideReact = require('lucide-react');
|
|
@@ -27,11 +27,11 @@ function decodeWhitespaceEntities(text) {
|
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
var DEFAULT_FACT_COLUMN_LABELS = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
inChatHeaderTooltip: "Facts added to this chat are always in context for this chat",
|
|
31
|
+
inChatTitle: "In this chat \u2014 always in context for it. Click to remove from chat.",
|
|
32
|
+
notInChatTitle: "Add to chat \u2014 always in context for this chat",
|
|
33
|
+
removeFromChat: "Remove from chat",
|
|
34
|
+
addToChat: "Add to chat",
|
|
35
35
|
fact: "Fact",
|
|
36
36
|
dates: "Dates",
|
|
37
37
|
dateTitle: "Date of the fact itself, not when this was saved",
|
|
@@ -66,7 +66,7 @@ function sourceDocCount(fact) {
|
|
|
66
66
|
return fact?.citations?.length ?? 0;
|
|
67
67
|
}
|
|
68
68
|
var DEFAULT_FACT_COLUMN_ORDER = [
|
|
69
|
-
"
|
|
69
|
+
"in_chat",
|
|
70
70
|
"text",
|
|
71
71
|
"sources",
|
|
72
72
|
"tags",
|
|
@@ -82,49 +82,54 @@ function createFactColumns(slots) {
|
|
|
82
82
|
const fieldOf = (name) => name;
|
|
83
83
|
const l = { ...DEFAULT_FACT_COLUMN_LABELS, ...slots.labels };
|
|
84
84
|
const ids = slots.testIds;
|
|
85
|
-
const
|
|
85
|
+
const { isInChat, onToggleInChat } = slots;
|
|
86
|
+
const inChatColumn = isInChat && onToggleInChat ? [
|
|
86
87
|
{
|
|
87
|
-
colId: "
|
|
88
|
+
colId: "in_chat",
|
|
88
89
|
headerName: "",
|
|
89
|
-
headerComponent: () => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.
|
|
90
|
-
|
|
90
|
+
headerComponent: () => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex size-full items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Paperclip, { className: "size-3.5 text-muted-foreground" }) }),
|
|
91
|
+
valueGetter: (params) => params.data ? isInChat(params.data) : false,
|
|
91
92
|
width: 44,
|
|
92
93
|
minWidth: 44,
|
|
93
94
|
maxWidth: 44,
|
|
94
95
|
sortable: true,
|
|
95
96
|
resizable: false,
|
|
96
|
-
headerTooltip: l.
|
|
97
|
+
headerTooltip: l.inChatHeaderTooltip,
|
|
97
98
|
cellClass: "cell-hcenter",
|
|
98
|
-
// A toggle, not a readout:
|
|
99
|
-
//
|
|
99
|
+
// A toggle, not a readout: a fact in the chat rides every message of it, so it flips
|
|
100
|
+
// in place.
|
|
100
101
|
cellRenderer: (params) => {
|
|
101
102
|
if (!params.data) return null;
|
|
102
103
|
const fact = params.data;
|
|
104
|
+
const inChat = isInChat(fact);
|
|
103
105
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
104
106
|
"button",
|
|
105
107
|
{
|
|
106
108
|
type: "button",
|
|
107
|
-
onClick: () =>
|
|
108
|
-
title:
|
|
109
|
-
"aria-label":
|
|
110
|
-
"aria-pressed":
|
|
111
|
-
"data-testid": chunkMHVNT4J3_cjs.testIdOr(ids?.
|
|
112
|
-
testId: `facts-grid-
|
|
109
|
+
onClick: () => onToggleInChat(fact),
|
|
110
|
+
title: inChat ? l.inChatTitle : l.notInChatTitle,
|
|
111
|
+
"aria-label": inChat ? l.removeFromChat : l.addToChat,
|
|
112
|
+
"aria-pressed": inChat,
|
|
113
|
+
"data-testid": chunkMHVNT4J3_cjs.testIdOr(ids?.inChat?.(fact.external_id), {
|
|
114
|
+
testId: `facts-grid-in-chat-${fact.external_id}`
|
|
113
115
|
}),
|
|
114
116
|
className: "flex h-full items-center",
|
|
115
117
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
116
|
-
lucideReact.
|
|
118
|
+
lucideReact.Paperclip,
|
|
117
119
|
{
|
|
118
120
|
className: ui.cn(
|
|
119
121
|
"size-3.5",
|
|
120
|
-
|
|
122
|
+
inChat ? "text-primary" : "text-muted-foreground/30 transition-colors hover:text-muted-foreground"
|
|
121
123
|
)
|
|
122
124
|
}
|
|
123
125
|
)
|
|
124
126
|
}
|
|
125
127
|
);
|
|
126
128
|
}
|
|
127
|
-
}
|
|
129
|
+
}
|
|
130
|
+
] : [];
|
|
131
|
+
const columns = [
|
|
132
|
+
...inChatColumn,
|
|
128
133
|
{
|
|
129
134
|
colId: "text",
|
|
130
135
|
suppressHeaderFilterButton: true,
|
|
@@ -436,7 +441,8 @@ var defaultFormatDate = (iso) => {
|
|
|
436
441
|
var EMPTY_STATE = { title: "No facts yet" };
|
|
437
442
|
function FactsTable({
|
|
438
443
|
facts,
|
|
439
|
-
|
|
444
|
+
isInChat,
|
|
445
|
+
onToggleInChat,
|
|
440
446
|
onToggleConfirmed,
|
|
441
447
|
onToggleShared,
|
|
442
448
|
onEdit,
|
|
@@ -455,7 +461,8 @@ function FactsTable({
|
|
|
455
461
|
const l = { ...DEFAULT_FACT_COLUMN_LABELS, ...columnLabels };
|
|
456
462
|
const columnDefs = react.useMemo(
|
|
457
463
|
() => createFactColumns({
|
|
458
|
-
|
|
464
|
+
isInChat,
|
|
465
|
+
onToggleInChat,
|
|
459
466
|
renderHeader: (params) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[12.5px] font-medium", children: params.displayName }),
|
|
460
467
|
renderRowActions: (fact) => onEdit && onDelete ? /* @__PURE__ */ jsxRuntime.jsx(FactRowActions, { onEdit: () => onEdit(fact), onDelete: () => onDelete(fact) }) : null,
|
|
461
468
|
renderLabels: (fact) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex flex-wrap items-center gap-1", children: (fact.tags ?? []).map((tag) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -500,7 +507,8 @@ function FactsTable({
|
|
|
500
507
|
labels: columnLabels
|
|
501
508
|
}),
|
|
502
509
|
[
|
|
503
|
-
|
|
510
|
+
isInChat,
|
|
511
|
+
onToggleInChat,
|
|
504
512
|
onToggleConfirmed,
|
|
505
513
|
onToggleShared,
|
|
506
514
|
onEdit,
|
|
@@ -536,7 +544,6 @@ function toFactRow(record) {
|
|
|
536
544
|
return {
|
|
537
545
|
external_id: record.id,
|
|
538
546
|
text: record.text,
|
|
539
|
-
pinned: record.pinned ?? false,
|
|
540
547
|
confirmed: record.confirmed ?? false,
|
|
541
548
|
shared: record.shared ?? false,
|
|
542
549
|
date_start: record.dateStart ?? null,
|
|
@@ -1327,7 +1334,7 @@ var DEFAULT_FACTS_FIELDS_BUTTON_LABELS = {
|
|
|
1327
1334
|
fields: "Fields",
|
|
1328
1335
|
defaultView: "Default view",
|
|
1329
1336
|
columns: "Columns",
|
|
1330
|
-
columnNames: {
|
|
1337
|
+
columnNames: { in_chat: "In chat" }
|
|
1331
1338
|
};
|
|
1332
1339
|
function FactsFieldsButton({
|
|
1333
1340
|
getGridApi,
|
|
@@ -1735,24 +1742,24 @@ function FactComposer({
|
|
|
1735
1742
|
);
|
|
1736
1743
|
}
|
|
1737
1744
|
var DEFAULT_FACTS_BULK_BAR_LABELS = {
|
|
1738
|
-
|
|
1739
|
-
|
|
1745
|
+
removeFromChat: "Remove from Chat",
|
|
1746
|
+
addToChat: "Add to Chat",
|
|
1740
1747
|
label: "Label",
|
|
1741
1748
|
shared: "Shared",
|
|
1742
1749
|
more: "More",
|
|
1743
1750
|
export: "Export",
|
|
1744
1751
|
delete: "Delete",
|
|
1745
|
-
budgetHint: "
|
|
1752
|
+
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.",
|
|
1746
1753
|
budget: (tokens, cap) => `~${tokens}/${cap} tokens`,
|
|
1747
|
-
|
|
1748
|
-
|
|
1754
|
+
removeFromChatTooltip: (n) => `Remove the selected ${n} from this chat`,
|
|
1755
|
+
addToChatTooltip: (n) => `Add the selected ${n} to this chat, so they are always in its context`,
|
|
1749
1756
|
labelTooltip: (n) => `Add or remove labels from selected ${n}`
|
|
1750
1757
|
};
|
|
1751
1758
|
function FactsBulkBar({
|
|
1752
1759
|
count,
|
|
1753
1760
|
onClear,
|
|
1754
|
-
|
|
1755
|
-
|
|
1761
|
+
allSelectedInChat,
|
|
1762
|
+
onToggleInChat,
|
|
1756
1763
|
onLabel,
|
|
1757
1764
|
sharedToggle,
|
|
1758
1765
|
onExport,
|
|
@@ -1777,7 +1784,7 @@ function FactsBulkBar({
|
|
|
1777
1784
|
budget.isOver ? "text-destructive" : "text-muted-foreground"
|
|
1778
1785
|
),
|
|
1779
1786
|
title: l.budgetHint,
|
|
1780
|
-
"data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.budget, { testId: "facts-page-
|
|
1787
|
+
"data-testid": chunkMHVNT4J3_cjs.testIdOr(testIds?.budget, { testId: "facts-page-chat-budget" }),
|
|
1781
1788
|
children: l.budget(budget.tokens.toLocaleString(), budget.cap.toLocaleString())
|
|
1782
1789
|
}
|
|
1783
1790
|
) : null,
|
|
@@ -1785,14 +1792,14 @@ function FactsBulkBar({
|
|
|
1785
1792
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1786
1793
|
chunkIA7RTPT3_cjs.SelectionBarAction,
|
|
1787
1794
|
{
|
|
1788
|
-
icon:
|
|
1789
|
-
label:
|
|
1790
|
-
onClick:
|
|
1795
|
+
icon: lucideReact.Paperclip,
|
|
1796
|
+
label: allSelectedInChat ? l.removeFromChat : l.addToChat,
|
|
1797
|
+
onClick: onToggleInChat,
|
|
1791
1798
|
disabled: none,
|
|
1792
1799
|
isCompact,
|
|
1793
|
-
className: "border-
|
|
1794
|
-
tooltip:
|
|
1795
|
-
testId: chunkMHVNT4J3_cjs.testIdOr(testIds?.
|
|
1800
|
+
className: "border-blue-border text-blue-text hover:bg-blue-bg hover:text-blue-text",
|
|
1801
|
+
tooltip: allSelectedInChat ? l.removeFromChatTooltip(pluralNoun) : l.addToChatTooltip(pluralNoun),
|
|
1802
|
+
testId: chunkMHVNT4J3_cjs.testIdOr(testIds?.inChat, { testId: "bulk-in-chat-facts-button" })
|
|
1796
1803
|
}
|
|
1797
1804
|
),
|
|
1798
1805
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2027,7 +2034,7 @@ var DEFAULT_FACT_SEARCH_BAR_LABELS = {
|
|
|
2027
2034
|
submit: "Search"
|
|
2028
2035
|
};
|
|
2029
2036
|
var DEFAULT_FACT_SEARCH_RESULT_LABELS = {
|
|
2030
|
-
|
|
2037
|
+
inChat: "In this chat",
|
|
2031
2038
|
verified: "Verified",
|
|
2032
2039
|
open: "Open"
|
|
2033
2040
|
};
|
|
@@ -2153,7 +2160,7 @@ function FactSearchResult({
|
|
|
2153
2160
|
terms,
|
|
2154
2161
|
renderSnippet,
|
|
2155
2162
|
labels,
|
|
2156
|
-
|
|
2163
|
+
isInChat,
|
|
2157
2164
|
isVerified,
|
|
2158
2165
|
isSelected,
|
|
2159
2166
|
onOpen,
|
|
@@ -2190,11 +2197,18 @@ function FactSearchResult({
|
|
|
2190
2197
|
testId: `facts-smart-search-hit-labels-${id}`
|
|
2191
2198
|
}),
|
|
2192
2199
|
children: [
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2200
|
+
isInChat && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2201
|
+
"span",
|
|
2202
|
+
{
|
|
2203
|
+
className: "inline-flex items-center gap-1 pr-1",
|
|
2204
|
+
"data-testid": `facts-smart-search-hit-in-chat-${id}`,
|
|
2205
|
+
children: [
|
|
2206
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Paperclip, { className: "size-3" }),
|
|
2207
|
+
" ",
|
|
2208
|
+
l.inChat
|
|
2209
|
+
]
|
|
2210
|
+
}
|
|
2211
|
+
),
|
|
2198
2212
|
labels.map((tag) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2199
2213
|
"span",
|
|
2200
2214
|
{
|