@partrunner-ai/ui 2.2.5 → 2.3.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 +767 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +174 -1
- package/dist/index.d.ts +174 -1
- package/dist/index.js +762 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/light.css +574 -0
- package/styles/theme.css +574 -0
- package/styles/ui.css +574 -0
package/dist/index.d.cts
CHANGED
|
@@ -2030,4 +2030,177 @@ declare function useAnchoredMenu<T extends HTMLElement>(options?: AnchoredMenuOp
|
|
|
2030
2030
|
/** Turns a computed position into inline styles for the fixed container. */
|
|
2031
2031
|
declare function menuStyle(pos: MenuPosition | null): CSSProperties;
|
|
2032
2032
|
|
|
2033
|
-
|
|
2033
|
+
/**
|
|
2034
|
+
* Text helpers for `CommentThread`. Framework-free and transport-free.
|
|
2035
|
+
*
|
|
2036
|
+
* A stored comment body is plain text with mention tokens: `<@u:UUID>` for a
|
|
2037
|
+
* person and `<@a:handle>` for an AI agent. The server extracts mentions from
|
|
2038
|
+
* those tokens, so what gets notified is exactly what the text shows. While
|
|
2039
|
+
* typing, the composer shows `@Name` instead and remembers which names were
|
|
2040
|
+
* picked from the suggestions; `serializeCommentDraft` turns them back into
|
|
2041
|
+
* tokens on send.
|
|
2042
|
+
*/
|
|
2043
|
+
type CommentMentionKind = 'user' | 'agent';
|
|
2044
|
+
interface CommentMention {
|
|
2045
|
+
kind: CommentMentionKind;
|
|
2046
|
+
/** A user id for people, the handle for agents. */
|
|
2047
|
+
id: string;
|
|
2048
|
+
name: string;
|
|
2049
|
+
}
|
|
2050
|
+
type CommentSegment = {
|
|
2051
|
+
type: 'text';
|
|
2052
|
+
text: string;
|
|
2053
|
+
} | {
|
|
2054
|
+
type: 'mention';
|
|
2055
|
+
kind: CommentMentionKind;
|
|
2056
|
+
id: string;
|
|
2057
|
+
name: string;
|
|
2058
|
+
};
|
|
2059
|
+
/** Splits a stored body into text and mention segments, naming each mention. */
|
|
2060
|
+
declare function parseCommentBody(body: string, mentions?: readonly CommentMention[]): CommentSegment[];
|
|
2061
|
+
/** Body as readable text (`@Name`), for quotes, previews and editing. */
|
|
2062
|
+
declare function commentPlainText(body: string, mentions?: readonly CommentMention[]): string;
|
|
2063
|
+
/**
|
|
2064
|
+
* Draft text → stored body. Every `@Name` that the user picked from the
|
|
2065
|
+
* suggestions becomes its token; anything else stays as typed. Longer names
|
|
2066
|
+
* go first so "@Ana Ruiz" is not cut short by a picked "@Ana".
|
|
2067
|
+
*/
|
|
2068
|
+
declare function serializeCommentDraft(text: string, picked: readonly CommentMention[]): string;
|
|
2069
|
+
/** Stored body → draft text plus the mentions it carries (to edit a message). */
|
|
2070
|
+
declare function commentDraftFromBody(body: string, mentions?: readonly CommentMention[]): {
|
|
2071
|
+
text: string;
|
|
2072
|
+
picked: CommentMention[];
|
|
2073
|
+
};
|
|
2074
|
+
/**
|
|
2075
|
+
* The `@query` being typed right before the caret, if any: an `@` at the start
|
|
2076
|
+
* or after whitespace, followed by up to 40 non-newline characters.
|
|
2077
|
+
*/
|
|
2078
|
+
declare function activeMentionQuery(text: string, caret: number): {
|
|
2079
|
+
start: number;
|
|
2080
|
+
query: string;
|
|
2081
|
+
} | null;
|
|
2082
|
+
/**
|
|
2083
|
+
* Merges changed messages into a list by id, keeping chronological order.
|
|
2084
|
+
* Used to apply a polling delta or an optimistic update without reloading.
|
|
2085
|
+
*/
|
|
2086
|
+
declare function mergeCommentMessages<T extends {
|
|
2087
|
+
id: string;
|
|
2088
|
+
createdAt: string;
|
|
2089
|
+
}>(current: readonly T[], changes: readonly T[]): T[];
|
|
2090
|
+
|
|
2091
|
+
type CommentAuthorKind = 'user' | 'agent' | 'system';
|
|
2092
|
+
type CommentStatus = 'pending' | 'streaming' | 'sent' | 'failed';
|
|
2093
|
+
type CommentFollowState = 'none' | 'following' | 'muted';
|
|
2094
|
+
interface CommentAuthor {
|
|
2095
|
+
kind: CommentAuthorKind;
|
|
2096
|
+
userId: string | null;
|
|
2097
|
+
agentId?: string | null;
|
|
2098
|
+
handle?: string | null;
|
|
2099
|
+
name: string;
|
|
2100
|
+
avatarUrl?: string | null;
|
|
2101
|
+
}
|
|
2102
|
+
interface CommentAttachment {
|
|
2103
|
+
id: string;
|
|
2104
|
+
fileName: string;
|
|
2105
|
+
mimeType: string;
|
|
2106
|
+
sizeBytes: number;
|
|
2107
|
+
width?: number | null;
|
|
2108
|
+
height?: number | null;
|
|
2109
|
+
}
|
|
2110
|
+
interface CommentReaction {
|
|
2111
|
+
emoji: string;
|
|
2112
|
+
count: number;
|
|
2113
|
+
mine: boolean;
|
|
2114
|
+
names: string[];
|
|
2115
|
+
}
|
|
2116
|
+
interface CommentReplyRef {
|
|
2117
|
+
id: string;
|
|
2118
|
+
authorName: string;
|
|
2119
|
+
excerpt: string;
|
|
2120
|
+
hasAttachments: boolean;
|
|
2121
|
+
deleted: boolean;
|
|
2122
|
+
}
|
|
2123
|
+
interface CommentMessage {
|
|
2124
|
+
id: string;
|
|
2125
|
+
author: CommentAuthor;
|
|
2126
|
+
/** Plain text with `<@u:UUID>` / `<@a:handle>` mention tokens. */
|
|
2127
|
+
body: string;
|
|
2128
|
+
status: CommentStatus;
|
|
2129
|
+
createdAt: string;
|
|
2130
|
+
editedAt: string | null;
|
|
2131
|
+
deleted: boolean;
|
|
2132
|
+
replyTo: CommentReplyRef | null;
|
|
2133
|
+
mentions: CommentMention[];
|
|
2134
|
+
attachments: CommentAttachment[];
|
|
2135
|
+
reactions: CommentReaction[];
|
|
2136
|
+
}
|
|
2137
|
+
interface CommentMentionCandidate extends CommentMention {
|
|
2138
|
+
email?: string | null;
|
|
2139
|
+
avatarUrl?: string | null;
|
|
2140
|
+
description?: string | null;
|
|
2141
|
+
}
|
|
2142
|
+
interface CommentDraft {
|
|
2143
|
+
body: string;
|
|
2144
|
+
replyTo: string | null;
|
|
2145
|
+
attachmentIds: string[];
|
|
2146
|
+
}
|
|
2147
|
+
interface CommentThreadProps {
|
|
2148
|
+
/** Chronological, oldest first. */
|
|
2149
|
+
messages: readonly CommentMessage[];
|
|
2150
|
+
viewerId: string | null;
|
|
2151
|
+
canWrite: boolean;
|
|
2152
|
+
/** First load in flight: the list shows a spinner instead of the empty state. */
|
|
2153
|
+
loading?: boolean;
|
|
2154
|
+
/** A load or refresh error to show above the composer. */
|
|
2155
|
+
error?: string | null;
|
|
2156
|
+
hasMore?: boolean;
|
|
2157
|
+
loadingOlder?: boolean;
|
|
2158
|
+
onLoadOlder?: () => void;
|
|
2159
|
+
/** Messages after this instant (not the viewer's) are marked "Nuevos". */
|
|
2160
|
+
lastReadAt?: string | null;
|
|
2161
|
+
follow?: CommentFollowState;
|
|
2162
|
+
onFollowChange?: (follow: CommentFollowState) => void;
|
|
2163
|
+
/** URL the app serves an attachment from (its own proxy, never the bucket). */
|
|
2164
|
+
attachmentHref: (attachmentId: string, options?: {
|
|
2165
|
+
download?: boolean;
|
|
2166
|
+
}) => string;
|
|
2167
|
+
onSend: (draft: CommentDraft) => Promise<void>;
|
|
2168
|
+
onEdit?: (messageId: string, body: string) => Promise<void>;
|
|
2169
|
+
onDelete?: (messageId: string) => Promise<void>;
|
|
2170
|
+
onReact?: (messageId: string, emoji: string, on: boolean) => void | Promise<void>;
|
|
2171
|
+
/** People (and agents) the viewer can tag, for the typed `@query`. */
|
|
2172
|
+
onSearchMentions?: (query: string) => Promise<CommentMentionCandidate[]>;
|
|
2173
|
+
/** Uploads one file and returns it as a loose attachment. Omit to hide the clip. */
|
|
2174
|
+
onUpload?: (file: File) => Promise<CommentAttachment>;
|
|
2175
|
+
title?: ReactNode;
|
|
2176
|
+
emptyText?: string;
|
|
2177
|
+
placeholder?: string;
|
|
2178
|
+
className?: string;
|
|
2179
|
+
}
|
|
2180
|
+
/**
|
|
2181
|
+
* A chat-style comment thread: bubbles, quoted replies, reactions, files,
|
|
2182
|
+
* `@mentions` with suggestions and AI-agent messages that stream in.
|
|
2183
|
+
*
|
|
2184
|
+
* Controlled and transport-free: the app loads and refreshes `messages` and
|
|
2185
|
+
* passes callbacks that talk to its own API. Every file URL comes from
|
|
2186
|
+
* `attachmentHref`, so the app decides how files are served.
|
|
2187
|
+
*/
|
|
2188
|
+
declare function CommentThread({ messages, viewerId, canWrite, loading, error, hasMore, loadingOlder, onLoadOlder, lastReadAt, follow, onFollowChange, attachmentHref, onSend, onEdit, onDelete, onReact, onSearchMentions, onUpload, title, emptyText, placeholder, className, }: CommentThreadProps): react.JSX.Element;
|
|
2189
|
+
|
|
2190
|
+
/**
|
|
2191
|
+
* Browser-only helper for `CommentThread` uploads: shrinks a large photo
|
|
2192
|
+
* before it leaves the device and reports its dimensions.
|
|
2193
|
+
*
|
|
2194
|
+
* Comment attachments travel through each app's server, whose request body is
|
|
2195
|
+
* capped (4.5 MB on Vercel). A phone photo is often bigger than that, so it is
|
|
2196
|
+
* redrawn at most 2560px on its long side as JPEG. GIFs (animation) and HEIC
|
|
2197
|
+
* (browsers cannot decode it) are sent untouched.
|
|
2198
|
+
*/
|
|
2199
|
+
interface PreparedCommentFile {
|
|
2200
|
+
file: File;
|
|
2201
|
+
width: number | null;
|
|
2202
|
+
height: number | null;
|
|
2203
|
+
}
|
|
2204
|
+
declare function prepareCommentFile(file: File): Promise<PreparedCommentFile>;
|
|
2205
|
+
|
|
2206
|
+
export { AlertDialogAction, type AlertDialogActionProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, AlertDialogMedia, type AlertDialogMediaProps, AlertDialogRoot, type AlertDialogRootProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertDialogTriggerProps, AmbientBackground, type AmbientBackgroundProps, type AmbientBackgroundVariant, type AnchoredMenuOptions, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeSize, type BadgeTone, Button, type ButtonIcon, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarDate, type CalendarDisabledDates, type CalendarProps, type CalendarRange, type CalendarRangeProps, type CalendarSharedProps, type CalendarSingleProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardHeader, type CardHeaderProps, type CardPadding, type CardProps, CardTitle, type CardTitleProps, type CardTone, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type ChoiceGroupOrientation, type ChoiceOption, Combobox, type ComboboxOption, type ComboboxProps, type CommentAttachment, type CommentAuthor, type CommentAuthorKind, type CommentDraft, type CommentFollowState, type CommentMention, type CommentMentionCandidate, type CommentMentionKind, type CommentMessage, type CommentReaction, type CommentReplyRef, type CommentSegment, type CommentStatus, CommentThread, type CommentThreadProps, ConfirmDialog, type ConfirmDialogProps, CopyField, type CopyFieldProps, DataTable, type DataTableProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DatePickerSize, type DateRange, DateRangeFilter, type DateRangeFilterLabels, type DateRangeFilterProps, type DateRangeFilterSize, type DateRangePreset, Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogLayer, type DialogLayerAutoFocusEvent, type DialogLayerProps, type DialogPrimitiveSize, type DialogProps, DialogRoot, type DialogRootProps, type DialogSize, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, DropdownMenu, type DropdownMenuAlign, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, EMPTY_DATE_RANGE, EmptyState, type EmptyStateProps, FileDropzone, type FileDropzoneProps, type FileDropzoneSelectionSource, FilterChip, type FilterChipProps, FilterChipRow, type FilterChipRowProps, FormField, type FormFieldProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, IconTile, type IconTileProps, type IconTileSize, Input, type InputProps, type InputSize, Label, type LabelProps, type MenuPosition, MultiSelect, type MultiSelectOption, type MultiSelectProps, type MultiSelectVariant, type NavigationTabItem, NavigationTabs, type NavigationTabsLinkComponent, type NavigationTabsLinkProps, type NavigationTabsProps, OtpInput, type OtpInputProps, Page, PageHeader, type PageHeaderProps, type PageProps, type PageWidth, Pagination, type PaginationLabels, type PaginationProps, type PaginationSummary, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, PopoverHeader, type PopoverHeaderProps, type PopoverPadding, type PopoverProps, PopoverTitle, type PopoverTitleProps, PopoverTrigger, type PopoverTriggerProps, type PreparedCommentFile, ProgressBar, type ProgressBarProps, type ProgressBarSize, ProgressDots, type ProgressDotsProps, ProgressRing, type ProgressRingProps, RadioGroup, type RadioGroupProps, RichSelect, RichSelectContent, type RichSelectContentProps, RichSelectEmpty, type RichSelectEmptyProps, RichSelectGroup, type RichSelectGroupProps, RichSelectItem, type RichSelectItemProps, RichSelectLabel, type RichSelectLabelProps, type RichSelectProps, RichSelectSearch, type RichSelectSearchProps, RichSelectSeparator, type RichSelectSeparatorProps, type RichSelectSize, RichSelectTrigger, type RichSelectTriggerProps, RichSelectValue, type RichSelectValueProps, SearchField, type SearchFieldProps, SectionHeading, type SectionHeadingLevel, type SectionHeadingProps, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, type SegmentedOption, Select, type SelectOption, type SelectProps, type SelectSize, Separator, type SeparatorOrientation, type SeparatorProps, SheetClose, type SheetCloseProps, SheetContent, type SheetContentProps, SheetDescription, type SheetDescriptionProps, SheetFooter, type SheetFooterProps, SheetHeader, type SheetHeaderProps, SheetRoot, type SheetRootProps, type SheetSide, SheetTitle, type SheetTitleProps, SheetTrigger, type SheetTriggerProps, type SheetWidth, Skeleton, type SkeletonProps, type SkeletonShape, Slot, type SlotAllProps, type SlotProps, Spinner, type SpinnerProps, type SpinnerSize, StatTile, StatTileGrid, type StatTileGridColumns, type StatTileGridProps, type StatTileProps, type StatTone, StatusDot, type StatusDotProps, type StatusDotSize, Stepper, type StepperProps, type StepperStep, Switch, type SwitchProps, TINT_TONES, Table, type TableAlign, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, type TableColumn, type TableDensity, TableFooter, type TableFooterProps, TableFrame, type TableFrameProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableProps, type TableRootProps, TableRow, type TableRowProps, TableSkeleton, type TableSkeletonProps, Tabs, type TabsActivationMode, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsListVariant, type TabsOrientation, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type TextareaSize, type TintTone, Toolbar, ToolbarGroup, type ToolbarGroupProps, type ToolbarProps, ToolbarSpacer, type ToolbarSpacerProps, Tooltip, type TooltipProps, ValidationSummary, type ValidationSummaryError, type ValidationSummaryProps, activeMentionQuery, avatarInitials, commentDraftFromBody, commentPlainText, formatCalendarDate, formatDateRange, isCalendarDate, isSameDateRange, isValidDateRange, menuStyle, mergeCommentMessages, parseCalendarDate, parseCommentBody, prepareCommentFile, registerDialogLayerPortal, resolveActiveNavigationHref, serializeCalendarDate, serializeCommentDraft, toneFromString, useAnchoredMenu };
|
package/dist/index.d.ts
CHANGED
|
@@ -2030,4 +2030,177 @@ declare function useAnchoredMenu<T extends HTMLElement>(options?: AnchoredMenuOp
|
|
|
2030
2030
|
/** Turns a computed position into inline styles for the fixed container. */
|
|
2031
2031
|
declare function menuStyle(pos: MenuPosition | null): CSSProperties;
|
|
2032
2032
|
|
|
2033
|
-
|
|
2033
|
+
/**
|
|
2034
|
+
* Text helpers for `CommentThread`. Framework-free and transport-free.
|
|
2035
|
+
*
|
|
2036
|
+
* A stored comment body is plain text with mention tokens: `<@u:UUID>` for a
|
|
2037
|
+
* person and `<@a:handle>` for an AI agent. The server extracts mentions from
|
|
2038
|
+
* those tokens, so what gets notified is exactly what the text shows. While
|
|
2039
|
+
* typing, the composer shows `@Name` instead and remembers which names were
|
|
2040
|
+
* picked from the suggestions; `serializeCommentDraft` turns them back into
|
|
2041
|
+
* tokens on send.
|
|
2042
|
+
*/
|
|
2043
|
+
type CommentMentionKind = 'user' | 'agent';
|
|
2044
|
+
interface CommentMention {
|
|
2045
|
+
kind: CommentMentionKind;
|
|
2046
|
+
/** A user id for people, the handle for agents. */
|
|
2047
|
+
id: string;
|
|
2048
|
+
name: string;
|
|
2049
|
+
}
|
|
2050
|
+
type CommentSegment = {
|
|
2051
|
+
type: 'text';
|
|
2052
|
+
text: string;
|
|
2053
|
+
} | {
|
|
2054
|
+
type: 'mention';
|
|
2055
|
+
kind: CommentMentionKind;
|
|
2056
|
+
id: string;
|
|
2057
|
+
name: string;
|
|
2058
|
+
};
|
|
2059
|
+
/** Splits a stored body into text and mention segments, naming each mention. */
|
|
2060
|
+
declare function parseCommentBody(body: string, mentions?: readonly CommentMention[]): CommentSegment[];
|
|
2061
|
+
/** Body as readable text (`@Name`), for quotes, previews and editing. */
|
|
2062
|
+
declare function commentPlainText(body: string, mentions?: readonly CommentMention[]): string;
|
|
2063
|
+
/**
|
|
2064
|
+
* Draft text → stored body. Every `@Name` that the user picked from the
|
|
2065
|
+
* suggestions becomes its token; anything else stays as typed. Longer names
|
|
2066
|
+
* go first so "@Ana Ruiz" is not cut short by a picked "@Ana".
|
|
2067
|
+
*/
|
|
2068
|
+
declare function serializeCommentDraft(text: string, picked: readonly CommentMention[]): string;
|
|
2069
|
+
/** Stored body → draft text plus the mentions it carries (to edit a message). */
|
|
2070
|
+
declare function commentDraftFromBody(body: string, mentions?: readonly CommentMention[]): {
|
|
2071
|
+
text: string;
|
|
2072
|
+
picked: CommentMention[];
|
|
2073
|
+
};
|
|
2074
|
+
/**
|
|
2075
|
+
* The `@query` being typed right before the caret, if any: an `@` at the start
|
|
2076
|
+
* or after whitespace, followed by up to 40 non-newline characters.
|
|
2077
|
+
*/
|
|
2078
|
+
declare function activeMentionQuery(text: string, caret: number): {
|
|
2079
|
+
start: number;
|
|
2080
|
+
query: string;
|
|
2081
|
+
} | null;
|
|
2082
|
+
/**
|
|
2083
|
+
* Merges changed messages into a list by id, keeping chronological order.
|
|
2084
|
+
* Used to apply a polling delta or an optimistic update without reloading.
|
|
2085
|
+
*/
|
|
2086
|
+
declare function mergeCommentMessages<T extends {
|
|
2087
|
+
id: string;
|
|
2088
|
+
createdAt: string;
|
|
2089
|
+
}>(current: readonly T[], changes: readonly T[]): T[];
|
|
2090
|
+
|
|
2091
|
+
type CommentAuthorKind = 'user' | 'agent' | 'system';
|
|
2092
|
+
type CommentStatus = 'pending' | 'streaming' | 'sent' | 'failed';
|
|
2093
|
+
type CommentFollowState = 'none' | 'following' | 'muted';
|
|
2094
|
+
interface CommentAuthor {
|
|
2095
|
+
kind: CommentAuthorKind;
|
|
2096
|
+
userId: string | null;
|
|
2097
|
+
agentId?: string | null;
|
|
2098
|
+
handle?: string | null;
|
|
2099
|
+
name: string;
|
|
2100
|
+
avatarUrl?: string | null;
|
|
2101
|
+
}
|
|
2102
|
+
interface CommentAttachment {
|
|
2103
|
+
id: string;
|
|
2104
|
+
fileName: string;
|
|
2105
|
+
mimeType: string;
|
|
2106
|
+
sizeBytes: number;
|
|
2107
|
+
width?: number | null;
|
|
2108
|
+
height?: number | null;
|
|
2109
|
+
}
|
|
2110
|
+
interface CommentReaction {
|
|
2111
|
+
emoji: string;
|
|
2112
|
+
count: number;
|
|
2113
|
+
mine: boolean;
|
|
2114
|
+
names: string[];
|
|
2115
|
+
}
|
|
2116
|
+
interface CommentReplyRef {
|
|
2117
|
+
id: string;
|
|
2118
|
+
authorName: string;
|
|
2119
|
+
excerpt: string;
|
|
2120
|
+
hasAttachments: boolean;
|
|
2121
|
+
deleted: boolean;
|
|
2122
|
+
}
|
|
2123
|
+
interface CommentMessage {
|
|
2124
|
+
id: string;
|
|
2125
|
+
author: CommentAuthor;
|
|
2126
|
+
/** Plain text with `<@u:UUID>` / `<@a:handle>` mention tokens. */
|
|
2127
|
+
body: string;
|
|
2128
|
+
status: CommentStatus;
|
|
2129
|
+
createdAt: string;
|
|
2130
|
+
editedAt: string | null;
|
|
2131
|
+
deleted: boolean;
|
|
2132
|
+
replyTo: CommentReplyRef | null;
|
|
2133
|
+
mentions: CommentMention[];
|
|
2134
|
+
attachments: CommentAttachment[];
|
|
2135
|
+
reactions: CommentReaction[];
|
|
2136
|
+
}
|
|
2137
|
+
interface CommentMentionCandidate extends CommentMention {
|
|
2138
|
+
email?: string | null;
|
|
2139
|
+
avatarUrl?: string | null;
|
|
2140
|
+
description?: string | null;
|
|
2141
|
+
}
|
|
2142
|
+
interface CommentDraft {
|
|
2143
|
+
body: string;
|
|
2144
|
+
replyTo: string | null;
|
|
2145
|
+
attachmentIds: string[];
|
|
2146
|
+
}
|
|
2147
|
+
interface CommentThreadProps {
|
|
2148
|
+
/** Chronological, oldest first. */
|
|
2149
|
+
messages: readonly CommentMessage[];
|
|
2150
|
+
viewerId: string | null;
|
|
2151
|
+
canWrite: boolean;
|
|
2152
|
+
/** First load in flight: the list shows a spinner instead of the empty state. */
|
|
2153
|
+
loading?: boolean;
|
|
2154
|
+
/** A load or refresh error to show above the composer. */
|
|
2155
|
+
error?: string | null;
|
|
2156
|
+
hasMore?: boolean;
|
|
2157
|
+
loadingOlder?: boolean;
|
|
2158
|
+
onLoadOlder?: () => void;
|
|
2159
|
+
/** Messages after this instant (not the viewer's) are marked "Nuevos". */
|
|
2160
|
+
lastReadAt?: string | null;
|
|
2161
|
+
follow?: CommentFollowState;
|
|
2162
|
+
onFollowChange?: (follow: CommentFollowState) => void;
|
|
2163
|
+
/** URL the app serves an attachment from (its own proxy, never the bucket). */
|
|
2164
|
+
attachmentHref: (attachmentId: string, options?: {
|
|
2165
|
+
download?: boolean;
|
|
2166
|
+
}) => string;
|
|
2167
|
+
onSend: (draft: CommentDraft) => Promise<void>;
|
|
2168
|
+
onEdit?: (messageId: string, body: string) => Promise<void>;
|
|
2169
|
+
onDelete?: (messageId: string) => Promise<void>;
|
|
2170
|
+
onReact?: (messageId: string, emoji: string, on: boolean) => void | Promise<void>;
|
|
2171
|
+
/** People (and agents) the viewer can tag, for the typed `@query`. */
|
|
2172
|
+
onSearchMentions?: (query: string) => Promise<CommentMentionCandidate[]>;
|
|
2173
|
+
/** Uploads one file and returns it as a loose attachment. Omit to hide the clip. */
|
|
2174
|
+
onUpload?: (file: File) => Promise<CommentAttachment>;
|
|
2175
|
+
title?: ReactNode;
|
|
2176
|
+
emptyText?: string;
|
|
2177
|
+
placeholder?: string;
|
|
2178
|
+
className?: string;
|
|
2179
|
+
}
|
|
2180
|
+
/**
|
|
2181
|
+
* A chat-style comment thread: bubbles, quoted replies, reactions, files,
|
|
2182
|
+
* `@mentions` with suggestions and AI-agent messages that stream in.
|
|
2183
|
+
*
|
|
2184
|
+
* Controlled and transport-free: the app loads and refreshes `messages` and
|
|
2185
|
+
* passes callbacks that talk to its own API. Every file URL comes from
|
|
2186
|
+
* `attachmentHref`, so the app decides how files are served.
|
|
2187
|
+
*/
|
|
2188
|
+
declare function CommentThread({ messages, viewerId, canWrite, loading, error, hasMore, loadingOlder, onLoadOlder, lastReadAt, follow, onFollowChange, attachmentHref, onSend, onEdit, onDelete, onReact, onSearchMentions, onUpload, title, emptyText, placeholder, className, }: CommentThreadProps): react.JSX.Element;
|
|
2189
|
+
|
|
2190
|
+
/**
|
|
2191
|
+
* Browser-only helper for `CommentThread` uploads: shrinks a large photo
|
|
2192
|
+
* before it leaves the device and reports its dimensions.
|
|
2193
|
+
*
|
|
2194
|
+
* Comment attachments travel through each app's server, whose request body is
|
|
2195
|
+
* capped (4.5 MB on Vercel). A phone photo is often bigger than that, so it is
|
|
2196
|
+
* redrawn at most 2560px on its long side as JPEG. GIFs (animation) and HEIC
|
|
2197
|
+
* (browsers cannot decode it) are sent untouched.
|
|
2198
|
+
*/
|
|
2199
|
+
interface PreparedCommentFile {
|
|
2200
|
+
file: File;
|
|
2201
|
+
width: number | null;
|
|
2202
|
+
height: number | null;
|
|
2203
|
+
}
|
|
2204
|
+
declare function prepareCommentFile(file: File): Promise<PreparedCommentFile>;
|
|
2205
|
+
|
|
2206
|
+
export { AlertDialogAction, type AlertDialogActionProps, AlertDialogCancel, type AlertDialogCancelProps, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, type AlertDialogDescriptionProps, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, AlertDialogMedia, type AlertDialogMediaProps, AlertDialogRoot, type AlertDialogRootProps, AlertDialogTitle, type AlertDialogTitleProps, AlertDialogTrigger, type AlertDialogTriggerProps, AmbientBackground, type AmbientBackgroundProps, type AmbientBackgroundVariant, type AnchoredMenuOptions, Avatar, type AvatarProps, type AvatarSize, Badge, type BadgeProps, type BadgeSize, type BadgeTone, Button, type ButtonIcon, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarDate, type CalendarDisabledDates, type CalendarProps, type CalendarRange, type CalendarRangeProps, type CalendarSharedProps, type CalendarSingleProps, Card, CardContent, type CardContentProps, CardDescription, type CardDescriptionProps, CardHeader, type CardHeaderProps, type CardPadding, type CardProps, CardTitle, type CardTitleProps, type CardTone, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, type ChoiceGroupOrientation, type ChoiceOption, Combobox, type ComboboxOption, type ComboboxProps, type CommentAttachment, type CommentAuthor, type CommentAuthorKind, type CommentDraft, type CommentFollowState, type CommentMention, type CommentMentionCandidate, type CommentMentionKind, type CommentMessage, type CommentReaction, type CommentReplyRef, type CommentSegment, type CommentStatus, CommentThread, type CommentThreadProps, ConfirmDialog, type ConfirmDialogProps, CopyField, type CopyFieldProps, DataTable, type DataTableProps, DatePicker, type DatePickerProps, type DatePickerRangeProps, type DatePickerSingleProps, type DatePickerSize, type DateRange, DateRangeFilter, type DateRangeFilterLabels, type DateRangeFilterProps, type DateRangeFilterSize, type DateRangePreset, Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogFooter, type DialogFooterProps, DialogHeader, type DialogHeaderProps, DialogLayer, type DialogLayerAutoFocusEvent, type DialogLayerProps, type DialogPrimitiveSize, type DialogProps, DialogRoot, type DialogRootProps, type DialogSize, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, DropdownMenu, type DropdownMenuAlign, DropdownMenuCheckboxItem, type DropdownMenuCheckboxItemProps, DropdownMenuContent, type DropdownMenuContentProps, DropdownMenuGroup, type DropdownMenuGroupProps, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, type DropdownMenuProps, DropdownMenuRadioGroup, type DropdownMenuRadioGroupProps, DropdownMenuRadioItem, type DropdownMenuRadioItemProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuTrigger, type DropdownMenuTriggerProps, EMPTY_DATE_RANGE, EmptyState, type EmptyStateProps, FileDropzone, type FileDropzoneProps, type FileDropzoneSelectionSource, FilterChip, type FilterChipProps, FilterChipRow, type FilterChipRowProps, FormField, type FormFieldProps, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, IconTile, type IconTileProps, type IconTileSize, Input, type InputProps, type InputSize, Label, type LabelProps, type MenuPosition, MultiSelect, type MultiSelectOption, type MultiSelectProps, type MultiSelectVariant, type NavigationTabItem, NavigationTabs, type NavigationTabsLinkComponent, type NavigationTabsLinkProps, type NavigationTabsProps, OtpInput, type OtpInputProps, Page, PageHeader, type PageHeaderProps, type PageProps, type PageWidth, Pagination, type PaginationLabels, type PaginationProps, type PaginationSummary, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, PopoverHeader, type PopoverHeaderProps, type PopoverPadding, type PopoverProps, PopoverTitle, type PopoverTitleProps, PopoverTrigger, type PopoverTriggerProps, type PreparedCommentFile, ProgressBar, type ProgressBarProps, type ProgressBarSize, ProgressDots, type ProgressDotsProps, ProgressRing, type ProgressRingProps, RadioGroup, type RadioGroupProps, RichSelect, RichSelectContent, type RichSelectContentProps, RichSelectEmpty, type RichSelectEmptyProps, RichSelectGroup, type RichSelectGroupProps, RichSelectItem, type RichSelectItemProps, RichSelectLabel, type RichSelectLabelProps, type RichSelectProps, RichSelectSearch, type RichSelectSearchProps, RichSelectSeparator, type RichSelectSeparatorProps, type RichSelectSize, RichSelectTrigger, type RichSelectTriggerProps, RichSelectValue, type RichSelectValueProps, SearchField, type SearchFieldProps, SectionHeading, type SectionHeadingLevel, type SectionHeadingProps, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, type SegmentedOption, Select, type SelectOption, type SelectProps, type SelectSize, Separator, type SeparatorOrientation, type SeparatorProps, SheetClose, type SheetCloseProps, SheetContent, type SheetContentProps, SheetDescription, type SheetDescriptionProps, SheetFooter, type SheetFooterProps, SheetHeader, type SheetHeaderProps, SheetRoot, type SheetRootProps, type SheetSide, SheetTitle, type SheetTitleProps, SheetTrigger, type SheetTriggerProps, type SheetWidth, Skeleton, type SkeletonProps, type SkeletonShape, Slot, type SlotAllProps, type SlotProps, Spinner, type SpinnerProps, type SpinnerSize, StatTile, StatTileGrid, type StatTileGridColumns, type StatTileGridProps, type StatTileProps, type StatTone, StatusDot, type StatusDotProps, type StatusDotSize, Stepper, type StepperProps, type StepperStep, Switch, type SwitchProps, TINT_TONES, Table, type TableAlign, TableBody, type TableBodyProps, TableCaption, type TableCaptionProps, TableCell, type TableCellProps, type TableColumn, type TableDensity, TableFooter, type TableFooterProps, TableFrame, type TableFrameProps, TableHead, type TableHeadProps, TableHeader, type TableHeaderProps, type TableProps, type TableRootProps, TableRow, type TableRowProps, TableSkeleton, type TableSkeletonProps, Tabs, type TabsActivationMode, TabsContent, type TabsContentProps, TabsList, type TabsListProps, type TabsListVariant, type TabsOrientation, type TabsProps, TabsTrigger, type TabsTriggerProps, Textarea, type TextareaProps, type TextareaSize, type TintTone, Toolbar, ToolbarGroup, type ToolbarGroupProps, type ToolbarProps, ToolbarSpacer, type ToolbarSpacerProps, Tooltip, type TooltipProps, ValidationSummary, type ValidationSummaryError, type ValidationSummaryProps, activeMentionQuery, avatarInitials, commentDraftFromBody, commentPlainText, formatCalendarDate, formatDateRange, isCalendarDate, isSameDateRange, isValidDateRange, menuStyle, mergeCommentMessages, parseCalendarDate, parseCommentBody, prepareCommentFile, registerDialogLayerPortal, resolveActiveNavigationHref, serializeCalendarDate, serializeCommentDraft, toneFromString, useAnchoredMenu };
|