@proteos/ui 0.51.0 → 0.52.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/index.cjs +36 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -2
- package/dist/index.d.ts +10 -2
- package/dist/index.js +37 -14
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/conversation-brief-card/conversation-brief-preview.tsx +47 -10
- package/src/components/conversation-brief-card/conversation-brief-review.test.tsx +36 -0
- package/src/components/conversation-brief-card/conversation-brief-review.tsx +5 -1
package/dist/index.d.cts
CHANGED
|
@@ -810,8 +810,14 @@ interface ConversationBriefPreviewProps {
|
|
|
810
810
|
className?: string;
|
|
811
811
|
/** Visual override for the guidance text box (e.g. a max height). */
|
|
812
812
|
contentClassName?: string;
|
|
813
|
+
/** Renders the guidance text (markdown). Absent ⇒ plain pre-wrapped text. */
|
|
814
|
+
renderContent?: (content: string) => ReactNode;
|
|
815
|
+
/** Shows an Edit button on hover over the guidance box. */
|
|
816
|
+
onEdit?: () => void;
|
|
817
|
+
/** Replaces the guidance box wholesale — the host's editing surface. */
|
|
818
|
+
editor?: ReactNode;
|
|
813
819
|
}
|
|
814
|
-
declare function ConversationBriefPreview({ brief, contacts, onCall, isCallDisabled, callDisabledReason, controls, isCallButtonHidden, onSelectionChange, callLabel, className, contentClassName, }: ConversationBriefPreviewProps): react_jsx_runtime.JSX.Element;
|
|
820
|
+
declare function ConversationBriefPreview({ brief, contacts, onCall, isCallDisabled, callDisabledReason, controls, isCallButtonHidden, onSelectionChange, callLabel, className, contentClassName, renderContent, onEdit, editor, }: ConversationBriefPreviewProps): react_jsx_runtime.JSX.Element;
|
|
815
821
|
|
|
816
822
|
interface ConversationBriefReviewProps {
|
|
817
823
|
conversationBriefId: string;
|
|
@@ -839,8 +845,10 @@ interface ConversationBriefReviewProps {
|
|
|
839
845
|
overlayClassName?: string;
|
|
840
846
|
openLabel?: string;
|
|
841
847
|
className?: string;
|
|
848
|
+
/** Built-in modal only: markdown renderer for the guidance text. */
|
|
849
|
+
renderContent?: (content: string) => ReactNode;
|
|
842
850
|
}
|
|
843
|
-
declare function ConversationBriefReview({ conversationBriefId, client, onOpenCall, onCall, isCallDisabled, callDisabledReason, onOutcome, onLoadError, modalTitle, modalClassName, overlayClassName, openLabel, className, }: ConversationBriefReviewProps): react_jsx_runtime.JSX.Element | null;
|
|
851
|
+
declare function ConversationBriefReview({ conversationBriefId, client, onOpenCall, onCall, isCallDisabled, callDisabledReason, onOutcome, onLoadError, modalTitle, modalClassName, overlayClassName, openLabel, className, renderContent, }: ConversationBriefReviewProps): react_jsx_runtime.JSX.Element | null;
|
|
844
852
|
/** The people's names, comma-joined. */
|
|
845
853
|
declare function namesOf(contacts: Contact[]): string;
|
|
846
854
|
/** Who + where + what: the people (when the subject took the headline),
|
package/dist/index.d.ts
CHANGED
|
@@ -810,8 +810,14 @@ interface ConversationBriefPreviewProps {
|
|
|
810
810
|
className?: string;
|
|
811
811
|
/** Visual override for the guidance text box (e.g. a max height). */
|
|
812
812
|
contentClassName?: string;
|
|
813
|
+
/** Renders the guidance text (markdown). Absent ⇒ plain pre-wrapped text. */
|
|
814
|
+
renderContent?: (content: string) => ReactNode;
|
|
815
|
+
/** Shows an Edit button on hover over the guidance box. */
|
|
816
|
+
onEdit?: () => void;
|
|
817
|
+
/** Replaces the guidance box wholesale — the host's editing surface. */
|
|
818
|
+
editor?: ReactNode;
|
|
813
819
|
}
|
|
814
|
-
declare function ConversationBriefPreview({ brief, contacts, onCall, isCallDisabled, callDisabledReason, controls, isCallButtonHidden, onSelectionChange, callLabel, className, contentClassName, }: ConversationBriefPreviewProps): react_jsx_runtime.JSX.Element;
|
|
820
|
+
declare function ConversationBriefPreview({ brief, contacts, onCall, isCallDisabled, callDisabledReason, controls, isCallButtonHidden, onSelectionChange, callLabel, className, contentClassName, renderContent, onEdit, editor, }: ConversationBriefPreviewProps): react_jsx_runtime.JSX.Element;
|
|
815
821
|
|
|
816
822
|
interface ConversationBriefReviewProps {
|
|
817
823
|
conversationBriefId: string;
|
|
@@ -839,8 +845,10 @@ interface ConversationBriefReviewProps {
|
|
|
839
845
|
overlayClassName?: string;
|
|
840
846
|
openLabel?: string;
|
|
841
847
|
className?: string;
|
|
848
|
+
/** Built-in modal only: markdown renderer for the guidance text. */
|
|
849
|
+
renderContent?: (content: string) => ReactNode;
|
|
842
850
|
}
|
|
843
|
-
declare function ConversationBriefReview({ conversationBriefId, client, onOpenCall, onCall, isCallDisabled, callDisabledReason, onOutcome, onLoadError, modalTitle, modalClassName, overlayClassName, openLabel, className, }: ConversationBriefReviewProps): react_jsx_runtime.JSX.Element | null;
|
|
851
|
+
declare function ConversationBriefReview({ conversationBriefId, client, onOpenCall, onCall, isCallDisabled, callDisabledReason, onOutcome, onLoadError, modalTitle, modalClassName, overlayClassName, openLabel, className, renderContent, }: ConversationBriefReviewProps): react_jsx_runtime.JSX.Element | null;
|
|
844
852
|
/** The people's names, comma-joined. */
|
|
845
853
|
declare function namesOf(contacts: Contact[]): string;
|
|
846
854
|
/** Who + where + what: the people (when the subject took the headline),
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn, Button, Skeleton } from './chunk-IKAX76MB.js';
|
|
2
2
|
export { Button, Skeleton, buttonStyles, cn, skeletonStyles } from './chunk-IKAX76MB.js';
|
|
3
|
-
import { icons, Paperclip, BookText, Banknote, UsersRound, User, Link2, Braces, Brackets, ToggleLeft, CircleDot, Calendar, Hash, Type, File, FileImage, FileText, FileSpreadsheet, FileArchive, Loader2, X, Shapes, Search, Phone, AudioLines, Video, Mic, AtSign, MessagesSquare, Camera, Send, Linkedin, MessageCircle, Mail, Pipette, ChevronDown, GripVertical, SendHorizontal, CircleX, Download, ChevronRight as ChevronRight$1, CircleCheck, CircleAlert, Info } from 'lucide-react';
|
|
3
|
+
import { icons, Paperclip, BookText, Banknote, UsersRound, User, Link2, Braces, Brackets, ToggleLeft, CircleDot, Calendar, Hash, Type, File, FileImage, FileText, FileSpreadsheet, FileArchive, Loader2, X, Shapes, Search, Phone, AudioLines, Video, Mic, AtSign, MessagesSquare, Camera, Send, Linkedin, MessageCircle, Mail, Pipette, Pencil, ChevronDown, GripVertical, SendHorizontal, CircleX, Download, ChevronRight as ChevronRight$1, CircleCheck, CircleAlert, Info } from 'lucide-react';
|
|
4
4
|
import { tv } from 'tailwind-variants';
|
|
5
5
|
import { Tabs as Tabs$1, TabPanel, Tab, TabList, MenuTrigger as MenuTrigger$1, SubmenuTrigger as SubmenuTrigger$1, DialogTrigger, Popover as Popover$1, Dialog, DropZone, Text, FileTrigger, Heading, Label, Input as Input$1, ListBox, ListBoxItem, Breadcrumbs as Breadcrumbs$1, Breadcrumb, Link, Button as Button$1, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, FieldError, TextField, ComboBox, ComboBoxStateContext, Select as Select$1, SelectValue, ModalOverlay, Modal as Modal$1, DatePicker as DatePicker$1, Group, DateInput, DateSegment, Menu as Menu$1, MenuItem as MenuItem$1, Disclosure, DisclosurePanel, ProgressBar as ProgressBar$1, RadioGroup as RadioGroup$1, Radio as Radio$1, Separator as Separator$1, Switch as Switch$1, TextArea, TimeField as TimeField$1, UNSTABLE_ToastQueue, UNSTABLE_ToastRegion, UNSTABLE_Toast, UNSTABLE_ToastContent, TooltipTrigger as TooltipTrigger$1, Tooltip as Tooltip$1, Calendar as Calendar$1, CalendarGrid, CalendarGridHeader, CalendarHeaderCell, CalendarGridBody, CalendarCell, DatePickerStateContext } from 'react-aria-components';
|
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
@@ -2147,7 +2147,10 @@ function ConversationBriefPreview({
|
|
|
2147
2147
|
onSelectionChange,
|
|
2148
2148
|
callLabel = "Call",
|
|
2149
2149
|
className,
|
|
2150
|
-
contentClassName
|
|
2150
|
+
contentClassName,
|
|
2151
|
+
renderContent,
|
|
2152
|
+
onEdit,
|
|
2153
|
+
editor
|
|
2151
2154
|
}) {
|
|
2152
2155
|
const [pickedContactId, setPickedContactId] = useState("");
|
|
2153
2156
|
const contact = contacts.find((entry) => entry.id === pickedContactId) ?? contacts[0] ?? null;
|
|
@@ -2171,17 +2174,35 @@ function ConversationBriefPreview({
|
|
|
2171
2174
|
brief.status === "prepared" ? "Prepared" : brief.status === "used" ? "Call held" : "Discarded"
|
|
2172
2175
|
].filter(Boolean).join(" \xB7 ") })
|
|
2173
2176
|
] }),
|
|
2174
|
-
/* @__PURE__ */
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2177
|
+
editor ?? /* @__PURE__ */ jsxs("div", { className: "group/brief-content relative", children: [
|
|
2178
|
+
/* @__PURE__ */ jsx(
|
|
2179
|
+
"div",
|
|
2180
|
+
{
|
|
2181
|
+
className: cn(
|
|
2182
|
+
"rounded-md border border-rule-2 bg-surface-2/60 px-3 py-2.5",
|
|
2183
|
+
"text-[13px] leading-relaxed text-ink-2 overflow-y-auto [scrollbar-width:thin]",
|
|
2184
|
+
renderContent ? null : "whitespace-pre-wrap",
|
|
2185
|
+
contentClassName
|
|
2186
|
+
),
|
|
2187
|
+
children: renderContent ? renderContent(brief.content) : brief.content
|
|
2188
|
+
}
|
|
2189
|
+
),
|
|
2190
|
+
onEdit ? /* @__PURE__ */ jsx(
|
|
2191
|
+
Button$1,
|
|
2192
|
+
{
|
|
2193
|
+
"aria-label": "Edit brief",
|
|
2194
|
+
onPress: onEdit,
|
|
2195
|
+
className: cn(
|
|
2196
|
+
"absolute right-1.5 top-1.5 inline-flex size-7 cursor-pointer items-center justify-center",
|
|
2197
|
+
"rounded-md bg-surface/80 text-ink-3 outline-none transition-opacity",
|
|
2198
|
+
"opacity-0 group-hover/brief-content:opacity-100 focus-visible:opacity-100",
|
|
2199
|
+
"data-[hovered]:bg-surface-3 data-[hovered]:text-ink",
|
|
2200
|
+
"focus-visible:shadow-[var(--shadow-focus)]"
|
|
2201
|
+
),
|
|
2202
|
+
children: /* @__PURE__ */ jsx(Pencil, { className: "size-3.5", "aria-hidden": true })
|
|
2203
|
+
}
|
|
2204
|
+
) : null
|
|
2205
|
+
] }),
|
|
2185
2206
|
onCall ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 border-t border-rule-2 pt-3", children: [
|
|
2186
2207
|
contacts.length > 1 ? /* @__PURE__ */ jsx(
|
|
2187
2208
|
Select,
|
|
@@ -2319,7 +2340,8 @@ function ConversationBriefReview({
|
|
|
2319
2340
|
modalClassName = "max-w-2xl",
|
|
2320
2341
|
overlayClassName,
|
|
2321
2342
|
openLabel,
|
|
2322
|
-
className
|
|
2343
|
+
className,
|
|
2344
|
+
renderContent
|
|
2323
2345
|
}) {
|
|
2324
2346
|
const [brief, setBrief] = useState(null);
|
|
2325
2347
|
const [contacts, setContacts] = useState([]);
|
|
@@ -2396,6 +2418,7 @@ function ConversationBriefReview({
|
|
|
2396
2418
|
contentClassName: "max-h-[50dvh]",
|
|
2397
2419
|
isCallDisabled,
|
|
2398
2420
|
...callDisabledReason !== void 0 ? { callDisabledReason } : {},
|
|
2421
|
+
...renderContent !== void 0 ? { renderContent } : {},
|
|
2399
2422
|
...onCall && isDialableConversationBrief(brief) ? {
|
|
2400
2423
|
onCall: (contact, phoneNumber) => {
|
|
2401
2424
|
setIsOpen(false);
|