@cellarnode/ui 0.201.0 → 0.202.0
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/agent/composer.d.ts +6 -1
- package/dist/agent/composer.d.ts.map +1 -1
- package/dist/agent/composer.js +43 -9
- package/dist/agent/composer.js.map +1 -1
- package/dist/agent/conversation.d.ts +20 -2
- package/dist/agent/conversation.d.ts.map +1 -1
- package/dist/agent/conversation.js +37 -5
- package/dist/agent/conversation.js.map +1 -1
- package/dist/agent/copy.d.ts +7 -0
- package/dist/agent/copy.d.ts.map +1 -1
- package/dist/agent/copy.js +9 -0
- package/dist/agent/copy.js.map +1 -1
- package/dist/agent/fixtures.d.ts +34 -0
- package/dist/agent/fixtures.d.ts.map +1 -1
- package/dist/agent/fixtures.js +77 -0
- package/dist/agent/fixtures.js.map +1 -1
- package/dist/agent/index.d.ts +18 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +18 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/markdown.d.ts +64 -0
- package/dist/agent/markdown.d.ts.map +1 -0
- package/dist/agent/markdown.js +220 -0
- package/dist/agent/markdown.js.map +1 -0
- package/dist/agent/masked-value.d.ts +1 -0
- package/dist/agent/masked-value.d.ts.map +1 -1
- package/dist/agent/masked-value.js +4 -1
- package/dist/agent/masked-value.js.map +1 -1
- package/dist/agent/message.d.ts +26 -6
- package/dist/agent/message.d.ts.map +1 -1
- package/dist/agent/message.js +47 -11
- package/dist/agent/message.js.map +1 -1
- package/dist/agent/panel-frame.js +1 -1
- package/dist/agent/panel-frame.js.map +1 -1
- package/dist/agent/role-cards/card-kit.d.ts +111 -0
- package/dist/agent/role-cards/card-kit.d.ts.map +1 -0
- package/dist/agent/role-cards/card-kit.js +68 -0
- package/dist/agent/role-cards/card-kit.js.map +1 -0
- package/dist/agent/role-cards/data-table-card.d.ts +80 -0
- package/dist/agent/role-cards/data-table-card.d.ts.map +1 -0
- package/dist/agent/role-cards/data-table-card.js +214 -0
- package/dist/agent/role-cards/data-table-card.js.map +1 -0
- package/dist/agent/role-cards/fixtures.d.ts +124 -0
- package/dist/agent/role-cards/fixtures.d.ts.map +1 -0
- package/dist/agent/role-cards/fixtures.js +401 -0
- package/dist/agent/role-cards/fixtures.js.map +1 -0
- package/dist/agent/role-cards/host-contract.d.ts +214 -0
- package/dist/agent/role-cards/host-contract.d.ts.map +1 -0
- package/dist/agent/role-cards/host-contract.js +348 -0
- package/dist/agent/role-cards/host-contract.js.map +1 -0
- package/dist/agent/role-cards/inspector-drawer.d.ts +42 -0
- package/dist/agent/role-cards/inspector-drawer.d.ts.map +1 -0
- package/dist/agent/role-cards/inspector-drawer.js +68 -0
- package/dist/agent/role-cards/inspector-drawer.js.map +1 -0
- package/dist/agent/role-cards/inspector-fixtures.d.ts +84 -0
- package/dist/agent/role-cards/inspector-fixtures.d.ts.map +1 -0
- package/dist/agent/role-cards/inspector-fixtures.js +162 -0
- package/dist/agent/role-cards/inspector-fixtures.js.map +1 -0
- package/dist/agent/role-cards/inspector-record.d.ts +109 -0
- package/dist/agent/role-cards/inspector-record.d.ts.map +1 -0
- package/dist/agent/role-cards/inspector-record.js +346 -0
- package/dist/agent/role-cards/inspector-record.js.map +1 -0
- package/dist/agent/role-cards/inspector-view.d.ts +137 -0
- package/dist/agent/role-cards/inspector-view.d.ts.map +1 -0
- package/dist/agent/role-cards/inspector-view.js +261 -0
- package/dist/agent/role-cards/inspector-view.js.map +1 -0
- package/dist/agent/role-cards/match-card.d.ts +21 -0
- package/dist/agent/role-cards/match-card.d.ts.map +1 -0
- package/dist/agent/role-cards/match-card.js +30 -0
- package/dist/agent/role-cards/match-card.js.map +1 -0
- package/dist/agent/role-cards/offer-card.d.ts +27 -0
- package/dist/agent/role-cards/offer-card.d.ts.map +1 -0
- package/dist/agent/role-cards/offer-card.js +68 -0
- package/dist/agent/role-cards/offer-card.js.map +1 -0
- package/dist/agent/role-cards/opportunity-card.d.ts +26 -0
- package/dist/agent/role-cards/opportunity-card.d.ts.map +1 -0
- package/dist/agent/role-cards/opportunity-card.js +50 -0
- package/dist/agent/role-cards/opportunity-card.js.map +1 -0
- package/dist/agent/role-cards/product-card.d.ts +32 -0
- package/dist/agent/role-cards/product-card.d.ts.map +1 -0
- package/dist/agent/role-cards/product-card.js +50 -0
- package/dist/agent/role-cards/product-card.js.map +1 -0
- package/dist/agent/role-cards/proposal-diff.d.ts +38 -0
- package/dist/agent/role-cards/proposal-diff.d.ts.map +1 -0
- package/dist/agent/role-cards/proposal-diff.js +74 -0
- package/dist/agent/role-cards/proposal-diff.js.map +1 -0
- package/dist/agent/role-cards/registry.d.ts +43 -0
- package/dist/agent/role-cards/registry.d.ts.map +1 -0
- package/dist/agent/role-cards/registry.js +46 -0
- package/dist/agent/role-cards/registry.js.map +1 -0
- package/dist/agent/role-cards/score-meter.d.ts +12 -0
- package/dist/agent/role-cards/score-meter.d.ts.map +1 -0
- package/dist/agent/role-cards/score-meter.js +17 -0
- package/dist/agent/role-cards/score-meter.js.map +1 -0
- package/dist/agent/role-cards/surface-links.d.ts +54 -0
- package/dist/agent/role-cards/surface-links.d.ts.map +1 -0
- package/dist/agent/role-cards/surface-links.js +149 -0
- package/dist/agent/role-cards/surface-links.js.map +1 -0
- package/dist/agent/role-cards/text-safety.d.ts +24 -0
- package/dist/agent/role-cards/text-safety.d.ts.map +1 -0
- package/dist/agent/role-cards/text-safety.js +61 -0
- package/dist/agent/role-cards/text-safety.js.map +1 -0
- package/dist/agent/schema.d.ts +7 -0
- package/dist/agent/schema.d.ts.map +1 -1
- package/dist/agent/schema.js +25 -2
- package/dist/agent/schema.js.map +1 -1
- package/dist/agent/states.d.ts +1 -0
- package/dist/agent/states.d.ts.map +1 -1
- package/dist/agent/states.js +1 -1
- package/dist/agent/states.js.map +1 -1
- package/dist/agent/thinking.d.ts +13 -4
- package/dist/agent/thinking.d.ts.map +1 -1
- package/dist/agent/thinking.js +15 -6
- package/dist/agent/thinking.js.map +1 -1
- package/dist/agent/thread-list.d.ts +33 -2
- package/dist/agent/thread-list.d.ts.map +1 -1
- package/dist/agent/thread-list.js +158 -8
- package/dist/agent/thread-list.js.map +1 -1
- package/dist/agent/tool-activity-model.d.ts +136 -0
- package/dist/agent/tool-activity-model.d.ts.map +1 -0
- package/dist/agent/tool-activity-model.js +288 -0
- package/dist/agent/tool-activity-model.js.map +1 -0
- package/dist/agent/tool-activity.d.ts +55 -0
- package/dist/agent/tool-activity.d.ts.map +1 -0
- package/dist/agent/tool-activity.js +159 -0
- package/dist/agent/tool-activity.js.map +1 -0
- package/dist/agent/tool-call-card.d.ts +9 -1
- package/dist/agent/tool-call-card.d.ts.map +1 -1
- package/dist/agent/tool-call-card.js +7 -1
- package/dist/agent/tool-call-card.js.map +1 -1
- package/dist/agent/ui.js +1 -1
- package/dist/agent/ui.js.map +1 -1
- package/dist/agent/use-motion.d.ts +15 -0
- package/dist/agent/use-motion.d.ts.map +1 -0
- package/dist/agent/use-motion.js +52 -0
- package/dist/agent/use-motion.js.map +1 -0
- package/dist/chat/chat-composer.d.ts.map +1 -1
- package/dist/chat/chat-composer.js +1 -1
- package/dist/chat/chat-composer.js.map +1 -1
- package/dist/chat/use-stick-to-bottom.d.ts +5 -0
- package/dist/chat/use-stick-to-bottom.d.ts.map +1 -1
- package/dist/chat/use-stick-to-bottom.js +11 -1
- package/dist/chat/use-stick-to-bottom.js.map +1 -1
- package/dist/components/sheet.d.ts +3 -1
- package/dist/components/sheet.d.ts.map +1 -1
- package/dist/components/sheet.js +2 -2
- package/dist/components/sheet.js.map +1 -1
- package/dist/portfolio-import/import-job-panels.d.ts +6 -0
- package/dist/portfolio-import/import-job-panels.d.ts.map +1 -1
- package/dist/portfolio-import/import-job-panels.js +11 -4
- package/dist/portfolio-import/import-job-panels.js.map +1 -1
- package/dist/portfolio-import/job-error-copy.d.ts +62 -0
- package/dist/portfolio-import/job-error-copy.d.ts.map +1 -0
- package/dist/portfolio-import/job-error-copy.js +78 -0
- package/dist/portfolio-import/job-error-copy.js.map +1 -0
- package/dist/realtime/organisation-events/schemas.d.ts +2 -2
- package/package.json +4 -1
- package/src/theme/tokens.css +66 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { CardAction, CardDetail, CardProposal } from "@cellarnode/agent-cards/zod4";
|
|
3
|
+
import { type MaskedValueCopy } from "../masked-value.js";
|
|
4
|
+
import { type CellValue } from "../schema.js";
|
|
5
|
+
import { type Tone } from "../ui.js";
|
|
6
|
+
import { subjectOf, type AgentToolCatalog, type BuildConfirmFailure, type CardConfirmPlan, type DetailKind, type ProposalApplyPlan } from "./host-contract.js";
|
|
7
|
+
import { type AgentProposalDiffCopy } from "./proposal-diff.js";
|
|
8
|
+
/**
|
|
9
|
+
* @internal Shared kit for the role-agent result cards (CEL-2445): frame, field grid, chip, actions, detail pointer.
|
|
10
|
+
* Pure props in, events out. Cards never fetch, never run a tool and never build a link from model text: a link renders
|
|
11
|
+
* only when the host's `allowLink` accepts the path, otherwise the label is plain text.
|
|
12
|
+
*/
|
|
13
|
+
export interface AgentCardLinkProps {
|
|
14
|
+
/** The host's route allowlist. With no `allowLink` NO link renders (secure default). */
|
|
15
|
+
allowLink?: (path: string) => boolean;
|
|
16
|
+
/** How the host renders an accepted internal link (router `<Link>`); defaults to a plain anchor. */
|
|
17
|
+
renderLink?: (path: string, children: ReactNode, className: string) => ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare function AgentCardLink({ path, allowLink, renderLink, className, children, }: AgentCardLinkProps & {
|
|
20
|
+
path: string | undefined;
|
|
21
|
+
className?: string;
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function AgentCardFrame({ title, eyebrow, badge, children, footer, className, }: {
|
|
25
|
+
title: ReactNode;
|
|
26
|
+
/** A small kind label above the title ("Offer") when the title is the record's own name. */
|
|
27
|
+
eyebrow?: ReactNode;
|
|
28
|
+
badge?: ReactNode;
|
|
29
|
+
children: ReactNode;
|
|
30
|
+
footer?: ReactNode;
|
|
31
|
+
className?: string;
|
|
32
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare function AgentChip({ tone, className, children, }: {
|
|
34
|
+
tone?: Tone;
|
|
35
|
+
className?: string;
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function AgentFieldGrid({ children }: {
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
/** One labelled value. Renders nothing for an absent field, so a sparse card stays compact. A masked cell renders as masked and takes a full row (the mask pill does not wrap, so it never spills into its neighbour at 320px). */
|
|
42
|
+
export declare function AgentField({ label, value, wide, maskedCopy, }: {
|
|
43
|
+
label: string;
|
|
44
|
+
value: CellValue | undefined;
|
|
45
|
+
wide?: boolean;
|
|
46
|
+
/** The mask pill's strings, in the host's language. */
|
|
47
|
+
maskedCopy?: Partial<MaskedValueCopy>;
|
|
48
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
49
|
+
export interface AgentCardActionsCopy {
|
|
50
|
+
needsConfirm: string;
|
|
51
|
+
openDetail: string;
|
|
52
|
+
}
|
|
53
|
+
export declare const ACTIONS_COPY: AgentCardActionsCopy;
|
|
54
|
+
/**
|
|
55
|
+
* What every role card needs from its host. The host owns the catalog, the record fetch and what happens after a confirm
|
|
56
|
+
* plan exists; the card owns nothing that writes.
|
|
57
|
+
*/
|
|
58
|
+
export interface AgentRoleCardHostProps extends AgentCardLinkProps {
|
|
59
|
+
/** The mask pill's strings (its accessible name and tooltip), in the host's language. Every masked value on the card uses them. */
|
|
60
|
+
maskedCopy?: Partial<MaskedValueCopy>;
|
|
61
|
+
/** The host's tool catalog. Without it no tool action and no proposal can be used. */
|
|
62
|
+
catalog?: AgentToolCatalog;
|
|
63
|
+
/** Fetch the full record for a proposal's Apply (the host's own authenticated read). */
|
|
64
|
+
fetchRecord?: (kind: DetailKind, id: string) => Promise<unknown>;
|
|
65
|
+
/** Called ONLY with a successful confirm plan built from the catalog; never with the raw model action. */
|
|
66
|
+
onAction?: (result: {
|
|
67
|
+
action: CardAction;
|
|
68
|
+
plan: CardConfirmPlan;
|
|
69
|
+
}) => void;
|
|
70
|
+
/** Called when a clicked action could not be turned into a plan (the catalog changed under it, or the args no longer validate). */
|
|
71
|
+
onActionRefused?: (action: CardAction, reason: BuildConfirmFailure) => void;
|
|
72
|
+
/**
|
|
73
|
+
* Open the inspector drawer / canvas for the record the pointer names; the host fetches the record itself. `opener` is the button
|
|
74
|
+
* that was pressed: hand it back to the drawer's `returnFocus` so focus returns to it on close even where the browser did not
|
|
75
|
+
* focus the button on click (Safari) or the card re-rendered in between.
|
|
76
|
+
*/
|
|
77
|
+
onOpenDetail?: (detail: CardDetail, opener?: HTMLElement) => void;
|
|
78
|
+
/** Called ONLY with the `planProposalApply` result; never with the raw proposal. */
|
|
79
|
+
onApplyProposal?: (result: ProposalApplyPlan) => void;
|
|
80
|
+
/**
|
|
81
|
+
* Edit before applying. The edited proposal is a NEW claim: saving it MUST go back through `planProposalApply` (re-fetch, stale
|
|
82
|
+
* check, subject and targetKind binding, input schema) and the confirm flow, exactly like the original. Never apply an edited
|
|
83
|
+
* proposal directly.
|
|
84
|
+
*/
|
|
85
|
+
onEditProposal?: (proposal: CardProposal) => void;
|
|
86
|
+
onRejectProposal?: (proposal: CardProposal) => void;
|
|
87
|
+
proposalCopy?: Partial<AgentProposalDiffCopy>;
|
|
88
|
+
}
|
|
89
|
+
export interface AgentCardActionsProps extends AgentCardLinkProps {
|
|
90
|
+
actions?: CardAction[];
|
|
91
|
+
detail?: CardDetail;
|
|
92
|
+
catalog?: AgentToolCatalog;
|
|
93
|
+
onAction?: AgentRoleCardHostProps["onAction"];
|
|
94
|
+
onActionRefused?: AgentRoleCardHostProps["onActionRefused"];
|
|
95
|
+
onOpenDetail?: AgentRoleCardHostProps["onOpenDetail"];
|
|
96
|
+
copy?: Partial<AgentCardActionsCopy>;
|
|
97
|
+
}
|
|
98
|
+
export declare function AgentCardActions({ actions, detail, catalog, onAction, onActionRefused, onOpenDetail, allowLink, renderLink, copy, }: AgentCardActionsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
99
|
+
/** The proposal diff and the action row every role card ends with, wired to the host contract. */
|
|
100
|
+
export declare function AgentCardExtras({ data, subject, host, }: {
|
|
101
|
+
data: {
|
|
102
|
+
actions?: CardAction[];
|
|
103
|
+
detail?: CardDetail;
|
|
104
|
+
proposal?: CardProposal;
|
|
105
|
+
};
|
|
106
|
+
/** The record THIS card is about; a proposal for any other record is refused at Apply. */
|
|
107
|
+
subject: Pick<CardDetail, "kind" | "id"> | undefined;
|
|
108
|
+
host: AgentRoleCardHostProps;
|
|
109
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
110
|
+
export { subjectOf };
|
|
111
|
+
//# sourceMappingURL=card-kit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-kit.d.ts","sourceRoot":"","sources":["../../../src/agent/role-cards/card-kit.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAGzF,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAgC,KAAK,IAAI,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAGL,SAAS,EACT,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CA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AO,CAAC,qBAAqB,CAAC,CAAC;CAC/C;AAED,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC/D,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,CAAC,EAAE,sBAAsB,CAAC,UAAU,CAAC,CAAC;IAC9C,eAAe,CAAC,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,CAAC;IAC5D,YAAY,CAAC,EAAE,sBAAsB,CAAC,cAAc,CAAC,CAAC;IACtD,IAAI,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACtC;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,MAAM,EACN,OAAO,EACP,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,SAAS,EACT,UAAU,EACV,IAAI,GACL,EAAE,qBAAqB,kDAsDvB;AAED,kGAAkG;AAClG,wBAAgB,eAAe,CAAC,EAC9B,IAAI,EACJ,OAAO,EACP,IAAI,GACL,EAAE;IACD,IAAI,EAAE;QAAE,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,UAAU,CAAC;QAAC,QAAQ,CAAC,EAAE,YAAY,CAAA;KAAE,CAAC;IAC/E,0FAA0F;IAC1F,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IACrD,IAAI,EAAE,sBAAsB,CAAC;CAC9B,2CA2BA;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import { cn } from "../../lib/utils.js";
|
|
4
|
+
import { fmt, useCopy } from "../copy.js";
|
|
5
|
+
import { MaskedValue } from "../masked-value.js";
|
|
6
|
+
import { isMasked } from "../schema.js";
|
|
7
|
+
import { agentButton, bezel, toneChip } from "../ui.js";
|
|
8
|
+
import { buildConfirm, offeredActions, subjectOf, } from "./host-contract.js";
|
|
9
|
+
import { AgentProposalDiff } from "./proposal-diff.js";
|
|
10
|
+
export function AgentCardLink({ path, allowLink, renderLink, className, children, }) {
|
|
11
|
+
const cls = cn("rounded-sm underline-offset-2 hover:underline pointer-coarse:inline-flex pointer-coarse:min-h-11 pointer-coarse:items-center focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", className);
|
|
12
|
+
if (!path || !allowLink?.(path))
|
|
13
|
+
return _jsx(_Fragment, { children: children });
|
|
14
|
+
if (renderLink)
|
|
15
|
+
return _jsx(_Fragment, { children: renderLink(path, children, cls) });
|
|
16
|
+
return (_jsx("a", { href: path, className: cls, children: children }));
|
|
17
|
+
}
|
|
18
|
+
export function AgentCardFrame({ title, eyebrow, badge, children, footer, className, }) {
|
|
19
|
+
const id = useId();
|
|
20
|
+
return (_jsxs("section", { "aria-labelledby": id, className: cn("@container flex flex-col gap-3 p-4 text-sm/5 text-foreground", bezel, className), children: [_jsxs("header", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsxs("div", { className: "flex min-w-0 flex-col gap-0.5", children: [eyebrow && _jsx("p", { className: "text-xs/4 text-muted-foreground", children: eyebrow }), _jsx("h3", { id: id, className: "min-w-0 text-sm/5 font-semibold text-balance", children: title })] }), badge] }), children, footer] }));
|
|
21
|
+
}
|
|
22
|
+
export function AgentChip({ tone = "neutral", className, children, }) {
|
|
23
|
+
return (_jsx("span", { className: cn("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs/4 font-medium", toneChip[tone], className), children: children }));
|
|
24
|
+
}
|
|
25
|
+
export function AgentFieldGrid({ children }) {
|
|
26
|
+
return _jsx("dl", { className: "grid grid-cols-2 gap-x-4 gap-y-2 @sm:grid-cols-3", children: children });
|
|
27
|
+
}
|
|
28
|
+
/** One labelled value. Renders nothing for an absent field, so a sparse card stays compact. A masked cell renders as masked and takes a full row (the mask pill does not wrap, so it never spills into its neighbour at 320px). */
|
|
29
|
+
export function AgentField({ label, value, wide, maskedCopy, }) {
|
|
30
|
+
if (value === undefined || value === null || value === "")
|
|
31
|
+
return null;
|
|
32
|
+
return (_jsxs("div", { className: cn("flex min-w-0 flex-col gap-0.5", (wide || isMasked(value)) && "col-span-2 @sm:col-span-3"), children: [_jsx("dt", { className: "text-xs/4 text-muted-foreground", children: label }), _jsx("dd", { className: "min-w-0 text-sm/5 break-words", children: _jsx(MaskedValue, { value: value, copy: maskedCopy }) })] }));
|
|
33
|
+
}
|
|
34
|
+
export const ACTIONS_COPY = {
|
|
35
|
+
needsConfirm: "Asks you to confirm",
|
|
36
|
+
openDetail: "Open full details",
|
|
37
|
+
};
|
|
38
|
+
export function AgentCardActions({ actions, detail, catalog, onAction, onActionRefused, onOpenDetail, allowLink, renderLink, copy, }) {
|
|
39
|
+
const c = useCopy(ACTIONS_COPY, copy);
|
|
40
|
+
// Rules 1 to 3: only what the catalog accepts, labelled and tiered by the catalog.
|
|
41
|
+
const visible = offeredActions(actions, catalog, { canRunTools: !!onAction, allowLink });
|
|
42
|
+
const showDetail = detail !== undefined && onOpenDetail !== undefined;
|
|
43
|
+
if (visible.length === 0 && !showDetail)
|
|
44
|
+
return null;
|
|
45
|
+
return (_jsxs("div", { className: "flex flex-wrap items-center gap-2 border-t border-border/60 pt-3", children: [showDetail && (_jsx("button", { type: "button", className: agentButton.quiet, onClick: (event) => onOpenDetail(detail, event.currentTarget), children: c.openDetail })), visible.map((a) => {
|
|
46
|
+
const gated = a.tier === "destructive" || a.tier === "costly";
|
|
47
|
+
const cls = gated ? agentButton.danger : agentButton.quiet;
|
|
48
|
+
const hint = gated
|
|
49
|
+
? fmt("{label}. {hint}", { label: a.label, hint: c.needsConfirm })
|
|
50
|
+
: a.label;
|
|
51
|
+
if (a.tool && onAction) {
|
|
52
|
+
return (_jsx("button", { type: "button", className: cls, "aria-label": hint, onClick: () => {
|
|
53
|
+
const built = buildConfirm(a, catalog ?? {});
|
|
54
|
+
if (built.ok)
|
|
55
|
+
onAction({ action: a, plan: built.plan });
|
|
56
|
+
else
|
|
57
|
+
onActionRefused?.(a, built.reason);
|
|
58
|
+
}, children: a.label }, a.id));
|
|
59
|
+
}
|
|
60
|
+
return (_jsx(AgentCardLink, { path: a.href, allowLink: allowLink, renderLink: renderLink, className: cls, children: a.label }, a.id));
|
|
61
|
+
})] }));
|
|
62
|
+
}
|
|
63
|
+
/** The proposal diff and the action row every role card ends with, wired to the host contract. */
|
|
64
|
+
export function AgentCardExtras({ data, subject, host, }) {
|
|
65
|
+
return (_jsxs(_Fragment, { children: [data.proposal && (_jsx(AgentProposalDiff, { proposal: data.proposal, catalog: host.catalog, fetchRecord: host.fetchRecord, expected: subject, onApply: host.onApplyProposal, onEdit: host.onEditProposal, onReject: host.onRejectProposal, copy: host.proposalCopy })), _jsx(AgentCardActions, { actions: data.actions, detail: data.detail, catalog: host.catalog, onAction: host.onAction, onActionRefused: host.onActionRefused, onOpenDetail: host.onOpenDetail, allowLink: host.allowLink, renderLink: host.renderLink })] }));
|
|
66
|
+
}
|
|
67
|
+
export { subjectOf };
|
|
68
|
+
//# sourceMappingURL=card-kit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-kit.js","sourceRoot":"","sources":["../../../src/agent/role-cards/card-kit.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,WAAW,EAAwB,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAkB,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAa,MAAM,OA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SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { DataTableData } from "@cellarnode/agent-cards/zod4";
|
|
2
|
+
import { type AgentRoleCardHostProps } from "./card-kit.js";
|
|
3
|
+
export interface AgentDataTableCardCopy {
|
|
4
|
+
title: string;
|
|
5
|
+
/** The table's name for a screen reader. */
|
|
6
|
+
caption: string;
|
|
7
|
+
/** What the card says when there are no rows. */
|
|
8
|
+
empty: string;
|
|
9
|
+
/** What a cell with nothing in it shows. */
|
|
10
|
+
emptyCell: string;
|
|
11
|
+
/** `{shown}` rows are drawn out of `{total}`. */
|
|
12
|
+
capped: string;
|
|
13
|
+
/** A column whose label is empty once cleaned: `{n}` is its position. */
|
|
14
|
+
column: string;
|
|
15
|
+
yes: string;
|
|
16
|
+
no: string;
|
|
17
|
+
/** What a plain value in a column the server marked masked is replaced with. */
|
|
18
|
+
hidden: string;
|
|
19
|
+
/** How text written by someone else is set off: `{text}` is the text. */
|
|
20
|
+
quote: string;
|
|
21
|
+
/** The name of the card's deep link, by the kind of page it opens (the link's text, so it reads on its own). */
|
|
22
|
+
openOffer: string;
|
|
23
|
+
openProducer: string;
|
|
24
|
+
openOrganisation: string;
|
|
25
|
+
openPortfolio: string;
|
|
26
|
+
openProduct: string;
|
|
27
|
+
openProductGallery: string;
|
|
28
|
+
openLabels: string;
|
|
29
|
+
openImports: string;
|
|
30
|
+
openElabelHome: string;
|
|
31
|
+
/** Any other page of the e-label app. */
|
|
32
|
+
openElabel: string;
|
|
33
|
+
/** A link to a route the host added itself. */
|
|
34
|
+
openOther: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Columns whose text is obviously someone else's, quoted without the host having to say so: a buyer, a counterparty, the
|
|
38
|
+
* opportunity an offer answers, and the columns the cellarnode-mcp agents key by author (`counterpartyFile`: the other side's offer
|
|
39
|
+
* file; `producerFile` and `producerBeverage`: a producer's public documents and beverages as an importer sees them; `file` is the
|
|
40
|
+
* caller's own and is not here). `thirdPartyColumns` EXTENDS these (`surfaceThirdPartyColumns` is the per-surface list). A
|
|
41
|
+
* `DataTable` has no flag that marks a column untrusted, so the column's key is what says whose words it carries.
|
|
42
|
+
*/
|
|
43
|
+
export declare const DEFAULT_THIRD_PARTY_COLUMNS: readonly string[];
|
|
44
|
+
/** Rows drawn. The schema allows 500, the agents emit at most 51 (50 and a marker row), a chat card is not a data grid. */
|
|
45
|
+
export declare const MAX_AGENT_TABLE_ROWS = 100;
|
|
46
|
+
export interface AgentDataTableCardProps extends AgentRoleCardHostProps {
|
|
47
|
+
data: DataTableData;
|
|
48
|
+
copy?: Partial<AgentDataTableCardCopy>;
|
|
49
|
+
/** More column keys whose text someone else wrote, on top of `DEFAULT_THIRD_PARTY_COLUMNS`. Matched on the column's `key`. */
|
|
50
|
+
thirdPartyColumns?: readonly string[];
|
|
51
|
+
/** The host's own label for a column, by its `key`. It wins over the label the agent sent (which is in the agent's language). */
|
|
52
|
+
columnLabels?: Readonly<Record<string, string>>;
|
|
53
|
+
/**
|
|
54
|
+
* The host's display text for a cell (a date, a currency, a number in the viewer's locale), or `undefined` for the default. Never
|
|
55
|
+
* called for a mask, an empty cell or a plain value in a masked column. Text from a column quoted as third-party stays quoted. A
|
|
56
|
+
* hook that throws is skipped: it cannot take the card down.
|
|
57
|
+
*/
|
|
58
|
+
formatCell?: (key: string, value: string | number | boolean) => string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* A BCP 47 tag for the numbers in cells. Set, a number shows with that locale's decimal separator and never grouped (a year or an
|
|
61
|
+
* id stays `2022`); unset, a number shows as JavaScript spells it. Use `formatCell` for grouping or a currency.
|
|
62
|
+
*/
|
|
63
|
+
locale?: string;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @internal Read card for a table the agent shows (CEL-2488): the file link tools, a producer's documents and showcase. Pure props in,
|
|
67
|
+
* events out, drawn on the card kit like every role card.
|
|
68
|
+
*
|
|
69
|
+
* - Cells are inert text, never markup or links. A mask stays a mask; a plain value in a column marked `masked` is replaced by a mask
|
|
70
|
+
* (the server is the one that masks, so a plain value there is a contract break, and it is not shown). Text someone else wrote
|
|
71
|
+
* renders quoted when its column is in `DEFAULT_THIRD_PARTY_COLUMNS` or the host's `thirdPartyColumns`.
|
|
72
|
+
* - The table's `link` is a visible link under the table, named for the page it opens ("Open offer", from `copy`), and it is drawn
|
|
73
|
+
* only when the host's `allowLink` accepts the path: a refused link draws nothing. Rows carry no link of their own (the schema has
|
|
74
|
+
* none).
|
|
75
|
+
* - Read-only: a `detail` pointer and a `proposal` are not drawn, because a table is a list, not one record (`readRoleCard` drops
|
|
76
|
+
* them). `actions` go through the same catalog and `allowLink` rules as every card.
|
|
77
|
+
* - Rows past `MAX_AGENT_TABLE_ROWS` are left out and the card says so.
|
|
78
|
+
*/
|
|
79
|
+
export declare function AgentDataTableCard({ data, copy, thirdPartyColumns, columnLabels, formatCell, locale, ...host }: AgentDataTableCardProps): import("react/jsx-runtime").JSX.Element;
|
|
80
|
+
//# sourceMappingURL=data-table-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table-card.d.ts","sourceRoot":"","sources":["../../../src/agent/role-cards/data-table-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAMlE,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,YAAY,CAAC;AAIpB,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,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I,EACR,EAAE,uBAAuB,2CAyGzB"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId, useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
import { ArrowUpRight } from "lucide-react";
|
|
4
|
+
import { cn } from "../../lib/utils.js";
|
|
5
|
+
import { DEFAULT_QUOTE, fmt, quoteText, useCopy } from "../copy.js";
|
|
6
|
+
import { MaskedValue } from "../masked-value.js";
|
|
7
|
+
import { isMasked } from "../schema.js";
|
|
8
|
+
import { focusRing } from "../ui.js";
|
|
9
|
+
import { AgentCardExtras, AgentCardFrame, AgentCardLink, } from "./card-kit.js";
|
|
10
|
+
import { agentLinkKind } from "./surface-links.js";
|
|
11
|
+
import { cleanInline } from "./text-safety.js";
|
|
12
|
+
const DEFAULT_COPY = {
|
|
13
|
+
title: "Results",
|
|
14
|
+
caption: "Results table",
|
|
15
|
+
empty: "Nothing to show",
|
|
16
|
+
emptyCell: "-",
|
|
17
|
+
capped: "Showing the first {shown} of {total} rows",
|
|
18
|
+
column: "Column {n}",
|
|
19
|
+
yes: "Yes",
|
|
20
|
+
no: "No",
|
|
21
|
+
hidden: "Hidden",
|
|
22
|
+
quote: DEFAULT_QUOTE,
|
|
23
|
+
openOffer: "Open offer",
|
|
24
|
+
openProducer: "Open producer page",
|
|
25
|
+
openOrganisation: "Open organisation profile",
|
|
26
|
+
openPortfolio: "Open portfolio",
|
|
27
|
+
openProduct: "Open product",
|
|
28
|
+
openProductGallery: "Open product gallery",
|
|
29
|
+
openLabels: "Open labels",
|
|
30
|
+
openImports: "Open imports",
|
|
31
|
+
openElabelHome: "Open e-label home",
|
|
32
|
+
openElabel: "Open in e-label",
|
|
33
|
+
openOther: "Open in the dashboard",
|
|
34
|
+
};
|
|
35
|
+
const LINK_COPY = {
|
|
36
|
+
offer: "openOffer",
|
|
37
|
+
producer: "openProducer",
|
|
38
|
+
organisation: "openOrganisation",
|
|
39
|
+
portfolio: "openPortfolio",
|
|
40
|
+
product: "openProduct",
|
|
41
|
+
productGallery: "openProductGallery",
|
|
42
|
+
labels: "openLabels",
|
|
43
|
+
imports: "openImports",
|
|
44
|
+
elabelHome: "openElabelHome",
|
|
45
|
+
elabel: "openElabel",
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Columns whose text is obviously someone else's, quoted without the host having to say so: a buyer, a counterparty, the
|
|
49
|
+
* opportunity an offer answers, and the columns the cellarnode-mcp agents key by author (`counterpartyFile`: the other side's offer
|
|
50
|
+
* file; `producerFile` and `producerBeverage`: a producer's public documents and beverages as an importer sees them; `file` is the
|
|
51
|
+
* caller's own and is not here). `thirdPartyColumns` EXTENDS these (`surfaceThirdPartyColumns` is the per-surface list). A
|
|
52
|
+
* `DataTable` has no flag that marks a column untrusted, so the column's key is what says whose words it carries.
|
|
53
|
+
*/
|
|
54
|
+
export const DEFAULT_THIRD_PARTY_COLUMNS = [
|
|
55
|
+
"buyer",
|
|
56
|
+
"counterparty",
|
|
57
|
+
"opportunity",
|
|
58
|
+
"market",
|
|
59
|
+
"counterpartyFile",
|
|
60
|
+
"producerFile",
|
|
61
|
+
"producerBeverage",
|
|
62
|
+
];
|
|
63
|
+
/** Rows drawn. The schema allows 500, the agents emit at most 51 (50 and a marker row), a chat card is not a data grid. */
|
|
64
|
+
export const MAX_AGENT_TABLE_ROWS = 100;
|
|
65
|
+
/** Code points of one cell's text; longer text ends in an ellipsis. */
|
|
66
|
+
const MAX_CELL = 300;
|
|
67
|
+
/** Code points of a column label and of a mask's display text. */
|
|
68
|
+
const MAX_LABEL = 80;
|
|
69
|
+
/** A cell's value, or `undefined` when the row has no such key. Own keys only: `constructor` and `__proto__` are not data. */
|
|
70
|
+
const cellOf = (row, key) => Object.hasOwn(row, key) ? row[key] : undefined;
|
|
71
|
+
/** One formatter per locale tag for the life of the page (building an `Intl.NumberFormat` is not cheap); a bad tag is remembered too. */
|
|
72
|
+
const NUMBER_FORMATTERS = new Map();
|
|
73
|
+
/** How a number reads: as JavaScript spells it, or in the host's locale (never grouped, so a year or an id stays as it is). */
|
|
74
|
+
function numberFormatter(locale) {
|
|
75
|
+
if (locale === undefined)
|
|
76
|
+
return String;
|
|
77
|
+
const known = NUMBER_FORMATTERS.get(locale);
|
|
78
|
+
if (known)
|
|
79
|
+
return known;
|
|
80
|
+
let made;
|
|
81
|
+
try {
|
|
82
|
+
const format = new Intl.NumberFormat(locale, { useGrouping: false, maximumFractionDigits: 20 });
|
|
83
|
+
made = (n) => format.format(n);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
made = String; // an unknown locale tag is the host's bug, not a reason to lose the table
|
|
87
|
+
}
|
|
88
|
+
NUMBER_FORMATTERS.set(locale, made);
|
|
89
|
+
return made;
|
|
90
|
+
}
|
|
91
|
+
/** The host's text for a plain cell, cleaned; `undefined` when the host has none, said nothing readable or threw. */
|
|
92
|
+
function hostText(formatCell, key, value) {
|
|
93
|
+
if (!formatCell)
|
|
94
|
+
return undefined;
|
|
95
|
+
try {
|
|
96
|
+
return cleanInline(formatCell(key, value), MAX_CELL, true);
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return undefined; // host code: fall back to the default text
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* One cell, as inert text. Nothing a cell holds becomes markup, a link or an instruction: a string is cleaned (unsafe characters out,
|
|
104
|
+
* whitespace collapsed, clipped), a number or a boolean is spelled out, a mask stays a mask, and an empty value is a dash.
|
|
105
|
+
*/
|
|
106
|
+
function TableCell({ columnKey, value, maskedColumn, quoted, copy, maskedCopy, formatNumber, formatCell, }) {
|
|
107
|
+
const dash = _jsx(MaskedValue, { value: null, empty: copy.emptyCell, copy: maskedCopy });
|
|
108
|
+
if (value === undefined || value === null || value === "")
|
|
109
|
+
return dash;
|
|
110
|
+
if (isMasked(value)) {
|
|
111
|
+
const display = cleanInline(value.display, MAX_LABEL, true) ?? copy.hidden;
|
|
112
|
+
return _jsx(MaskedValue, { value: { masked: true, display }, copy: maskedCopy });
|
|
113
|
+
}
|
|
114
|
+
// The server said this column is masked and sent a plain value: fail closed, never show it.
|
|
115
|
+
if (maskedColumn)
|
|
116
|
+
return _jsx(MaskedValue, { value: { masked: true, display: copy.hidden }, copy: maskedCopy });
|
|
117
|
+
const custom = hostText(formatCell, columnKey, value);
|
|
118
|
+
const text = custom ??
|
|
119
|
+
(typeof value === "boolean"
|
|
120
|
+
? value
|
|
121
|
+
? copy.yes
|
|
122
|
+
: copy.no
|
|
123
|
+
: typeof value === "number"
|
|
124
|
+
? formatNumber(value)
|
|
125
|
+
: cleanInline(value, MAX_CELL, true));
|
|
126
|
+
if (text === undefined)
|
|
127
|
+
return dash;
|
|
128
|
+
return quoted && typeof value === "string" ? quoteText(text, copy.quote) : text;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Is the scrolling area wider than the card? Measured before paint and again whenever the area or the table changes size, so the
|
|
132
|
+
* area is a keyboard stop exactly when there is something to scroll to (`scrollable-region-focusable`), and not a dead tab stop
|
|
133
|
+
* otherwise. When it loses its overflow while it has focus, focus moves to the card.
|
|
134
|
+
*/
|
|
135
|
+
function useOverflowing(active) {
|
|
136
|
+
const ref = useRef(null);
|
|
137
|
+
const [overflowing, setOverflowing] = useState(false);
|
|
138
|
+
useLayoutEffect(() => {
|
|
139
|
+
const el = ref.current;
|
|
140
|
+
if (!active || !el)
|
|
141
|
+
return;
|
|
142
|
+
const measure = () => {
|
|
143
|
+
const wide = el.scrollWidth > el.clientWidth;
|
|
144
|
+
// The area stops being a tab stop when it stops overflowing. If it has focus, hand focus to the card first, or it would
|
|
145
|
+
// fall back to the page.
|
|
146
|
+
if (!wide && el.ownerDocument.activeElement === el) {
|
|
147
|
+
const card = el.closest("section");
|
|
148
|
+
if (card) {
|
|
149
|
+
if (!card.hasAttribute("tabindex"))
|
|
150
|
+
card.setAttribute("tabindex", "-1");
|
|
151
|
+
card.focus({ preventScroll: true });
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// A DOM measurement can only be read after layout. Taken before paint it never shows a frame with the wrong tab stop.
|
|
155
|
+
// eslint-disable-next-line @eslint-react/set-state-in-effect -- the setter is the measurement's result, not derived state
|
|
156
|
+
setOverflowing(wide);
|
|
157
|
+
};
|
|
158
|
+
measure();
|
|
159
|
+
if (typeof ResizeObserver === "undefined")
|
|
160
|
+
return;
|
|
161
|
+
const observer = new ResizeObserver(measure);
|
|
162
|
+
observer.observe(el);
|
|
163
|
+
if (el.firstElementChild)
|
|
164
|
+
observer.observe(el.firstElementChild);
|
|
165
|
+
return () => observer.disconnect();
|
|
166
|
+
}, [active]);
|
|
167
|
+
return { ref, overflowing: active && overflowing };
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* @internal Read card for a table the agent shows (CEL-2488): the file link tools, a producer's documents and showcase. Pure props in,
|
|
171
|
+
* events out, drawn on the card kit like every role card.
|
|
172
|
+
*
|
|
173
|
+
* - Cells are inert text, never markup or links. A mask stays a mask; a plain value in a column marked `masked` is replaced by a mask
|
|
174
|
+
* (the server is the one that masks, so a plain value there is a contract break, and it is not shown). Text someone else wrote
|
|
175
|
+
* renders quoted when its column is in `DEFAULT_THIRD_PARTY_COLUMNS` or the host's `thirdPartyColumns`.
|
|
176
|
+
* - The table's `link` is a visible link under the table, named for the page it opens ("Open offer", from `copy`), and it is drawn
|
|
177
|
+
* only when the host's `allowLink` accepts the path: a refused link draws nothing. Rows carry no link of their own (the schema has
|
|
178
|
+
* none).
|
|
179
|
+
* - Read-only: a `detail` pointer and a `proposal` are not drawn, because a table is a list, not one record (`readRoleCard` drops
|
|
180
|
+
* them). `actions` go through the same catalog and `allowLink` rules as every card.
|
|
181
|
+
* - Rows past `MAX_AGENT_TABLE_ROWS` are left out and the card says so.
|
|
182
|
+
*/
|
|
183
|
+
export function AgentDataTableCard({ data, copy, thirdPartyColumns, columnLabels, formatCell, locale, ...host }) {
|
|
184
|
+
const { allowLink, renderLink, maskedCopy } = host;
|
|
185
|
+
const c = useCopy(DEFAULT_COPY, copy);
|
|
186
|
+
const captionId = useId();
|
|
187
|
+
// Rows and columns have no id of their own (two columns may share a key), so each gets its position as one.
|
|
188
|
+
const rows = data.rows.slice(0, MAX_AGENT_TABLE_ROWS).map((cells, r) => ({ id: `r${r}`, cells }));
|
|
189
|
+
const columns = data.columns.map((col, i) => ({
|
|
190
|
+
id: `c${i}`,
|
|
191
|
+
key: col.key,
|
|
192
|
+
label: (columnLabels && Object.hasOwn(columnLabels, col.key)
|
|
193
|
+
? cleanInline(columnLabels[col.key], MAX_LABEL, true)
|
|
194
|
+
: undefined) ??
|
|
195
|
+
cleanInline(col.label, MAX_LABEL, true) ??
|
|
196
|
+
fmt(c.column, { n: i + 1 }),
|
|
197
|
+
masked: col.masked === true,
|
|
198
|
+
quoted: DEFAULT_THIRD_PARTY_COLUMNS.includes(col.key) || !!thirdPartyColumns?.includes(col.key),
|
|
199
|
+
}));
|
|
200
|
+
const formatNumber = numberFormatter(locale);
|
|
201
|
+
const { ref, overflowing } = useOverflowing(rows.length > 0);
|
|
202
|
+
const link = data.link !== undefined && allowLink?.(data.link) === true ? data.link : undefined;
|
|
203
|
+
const kind = link === undefined ? undefined : agentLinkKind(link);
|
|
204
|
+
return (_jsxs(AgentCardFrame, { title: c.title, children: [rows.length === 0 ? (_jsx("p", { className: "text-sm/5 text-muted-foreground", children: c.empty })) : (
|
|
205
|
+
// A wide table scrolls inside the card. Only then is the scrolling area a keyboard stop, and it is a named group (not a
|
|
206
|
+
// second landmark: the card is already the region).
|
|
207
|
+
_jsx("div", { ref: ref, ...(overflowing ? { role: "group", tabIndex: 0, "aria-labelledby": captionId } : {}), className: cn("overflow-x-auto rounded-xl ring-1 ring-border/60", focusRing), children: _jsxs("table", { className: "w-full text-start text-xs/5", children: [_jsx("caption", { id: captionId, className: "sr-only", children: c.caption }), _jsx("thead", { children: _jsx("tr", { className: "border-b border-border bg-muted/40 text-muted-foreground", children: columns.map((col) => (_jsx("th", { scope: "col",
|
|
208
|
+
// `text-start` on the cell itself: a `th` that only inherits `start` is centred by the user agent.
|
|
209
|
+
className: "px-3 py-2 text-start align-top font-medium", children: col.label }, col.id))) }) }), _jsx("tbody", { children: rows.map((row) => (_jsx("tr", { className: "border-b border-border/60 last:border-b-0", children: columns.map((col) => {
|
|
210
|
+
const value = cellOf(row.cells, col.key);
|
|
211
|
+
return (_jsx("td", { className: "px-3 py-2 align-top", children: _jsx("div", { className: cn("max-w-64 min-w-24 wrap-anywhere", typeof value === "number" && "tabular-nums"), children: _jsx(TableCell, { columnKey: col.key, value: value, maskedColumn: col.masked, quoted: col.quoted, copy: c, maskedCopy: maskedCopy, formatNumber: formatNumber, formatCell: formatCell }) }) }, col.id));
|
|
212
|
+
}) }, row.id))) })] }) })), data.rows.length > MAX_AGENT_TABLE_ROWS && (_jsx("p", { className: "text-xs/4 text-muted-foreground", children: fmt(c.capped, { shown: MAX_AGENT_TABLE_ROWS, total: data.rows.length }) })), link !== undefined && (_jsxs(AgentCardLink, { path: link, allowLink: allowLink, renderLink: renderLink, className: "inline-flex items-center gap-1 self-start text-sm/5 font-medium text-primary underline hover:decoration-2", children: [c[kind ? LINK_COPY[kind] : "openOther"], _jsx(ArrowUpRight, { "aria-hidden": true, className: "size-3.5 shrink-0 rtl:-scale-x-100" })] })), _jsx(AgentCardExtras, { data: { actions: data.actions }, subject: undefined, host: host })] }));
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=data-table-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-table-card.js","sourceRoot":"","sources":["../../../src/agent/role-cards/data-table-card.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,EAAE,EAAE,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