inline-chat-kit 0.57.0 → 0.58.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.
@@ -113,6 +113,16 @@ export interface ChatInputProps {
113
113
  onEdit?: (value: string) => void;
114
114
  onCancelEdit?: () => void;
115
115
  isEditing?: boolean;
116
+ /**
117
+ * An answer is still arriving somewhere else.
118
+ *
119
+ * The composer stays open to type into and closed to send from: Enter does
120
+ * nothing, and the send glyph is a stop — the one control that means
121
+ * anything while an answer is in flight — if there is an `onStop`, and
122
+ * disabled if there is not. For the composer that stays at the bottom while
123
+ * the answer it asked for is written above it.
124
+ */
125
+ busy?: boolean;
116
126
  placeholder?: string;
117
127
  /**
118
128
  * What the "+" opens. Left out, the built-in three — Add, Design,
@@ -35,6 +35,13 @@ export interface ChatTurnRowProps {
35
35
  entranceDelay?: number;
36
36
  /** Passed through to the highlighter over the answer. */
37
37
  selectionMode?: "marker" | "precise";
38
+ /**
39
+ * Whether the answer can be marked. `false` draws it as plain prose — no
40
+ * marker layer, nothing in the tab order, no cursor of its own — and
41
+ * `onHighlight` and `onReplyInThread` are never called. See
42
+ * `TextHighlighter`.
43
+ */
44
+ highlights?: boolean;
38
45
  /**
39
46
  * Passed through to the composer. Given, this row's live input offers a
40
47
  * microphone; left out, it does not. See `ChatInput`.
@@ -60,6 +67,12 @@ export interface ChatTurnRowProps {
60
67
  onDraft?: (id: string, value: string) => void;
61
68
  onSubmit?: (id: string, value: string, attachments: Attachment[]) => void;
62
69
  onStop?: () => void;
70
+ /**
71
+ * An answer is arriving in another turn. Passed to this row's composer,
72
+ * which stays open to type into and offers a stop instead of a send. See
73
+ * `ChatInput`.
74
+ */
75
+ busy?: boolean;
63
76
  onEdit?: (id: string) => void;
64
77
  onCancelEdit?: (id: string) => void;
65
78
  /** Defaults to writing to the clipboard. */
@@ -132,4 +145,4 @@ export interface ChatTurnRowProps {
132
145
  labels?: ChatLabels;
133
146
  className?: string;
134
147
  }
135
- export declare const ChatTurnRow: import('react').MemoExoticComponent<({ turn, isActiveInput, inputRef, placeholder, animationConfig, foldMotion, openArtifactId, onOpenArtifact, onArtifactChange, entranceDelay, selectionMode, questionAlign, onDraft, onSubmit, onStop, onEdit, onCancelEdit, onCopy, onHighlight, onReplyInThread, onRegenerate, onShowVersion, onFeedback, feedback, answerActions, onAnswerQuestion, onEditQuestion, onDecideApproval, renderPart, composerMenu, labels, className, onTranscribe, }: ChatTurnRowProps) => import("react").JSX.Element>;
148
+ export declare const ChatTurnRow: import('react').MemoExoticComponent<({ turn, isActiveInput, inputRef, placeholder, animationConfig, foldMotion, openArtifactId, onOpenArtifact, onArtifactChange, entranceDelay, selectionMode, highlights, questionAlign, onDraft, onSubmit, onStop, busy, onEdit, onCancelEdit, onCopy, onHighlight, onReplyInThread, onRegenerate, onShowVersion, onFeedback, feedback, answerActions, onAnswerQuestion, onEditQuestion, onDecideApproval, renderPart, composerMenu, labels, className, onTranscribe, }: ChatTurnRowProps) => import("react").JSX.Element>;
@@ -83,6 +83,17 @@ export interface ConversationProps extends HTMLAttributes<HTMLDivElement> {
83
83
  tail?: "auto" | number;
84
84
  /** Switch the whole thing off and it is a plain scroll container. */
85
85
  follow?: boolean;
86
+ /**
87
+ * The last child is a dock.
88
+ *
89
+ * Pinned to the bottom edge while the content is shorter than the view, and
90
+ * held there while it is longer — the composer of a chat that keeps it at
91
+ * the bottom rather than at the end of the conversation. It is still
92
+ * content: the end of the scroll is still the last turn's end, and what is
93
+ * under it scrolls under it, which is what lets that composer become a
94
+ * bubble in the conversation without being moved between two trees.
95
+ */
96
+ dock?: boolean;
86
97
  /**
87
98
  * For the element that actually scrolls, which is not the one `className`
88
99
  * lands on.
@@ -2,6 +2,17 @@ import { default as React } from 'react';
2
2
  import { Source } from '../Sources/Sources';
3
3
  export interface TextHighlighterProps {
4
4
  text: string;
5
+ /**
6
+ * Whether the answer can be marked at all.
7
+ *
8
+ * `false` draws the answer and nothing else: no marker layer, no menu, no
9
+ * keyboard affordance, no cursor of its own — the text is text, selectable
10
+ * and copyable the way any page's is. For a product that has no use for
11
+ * highlights, which should not have to see them switched off in its own
12
+ * interface. Everything else the component draws — markdown, code blocks,
13
+ * citations — is unchanged, because that is the answer itself.
14
+ */
15
+ marking?: boolean;
5
16
  selectionMode?: "marker" | "precise";
6
17
  onHighlightComplete?: (highlightedText: string) => void;
7
18
  onReplyInThread?: (text: string, rect: DOMRect) => void;
@@ -14,4 +25,4 @@ export interface TextHighlighterProps {
14
25
  sources?: Source[];
15
26
  onSelectSource?: (index: number, source?: Source) => void;
16
27
  }
17
- export declare function TextHighlighter({ text, selectionMode, onHighlightComplete, onReplyInThread, sources, onSelectSource, }: TextHighlighterProps): React.JSX.Element;
28
+ export declare function TextHighlighter({ text, marking, selectionMode, onHighlightComplete, onReplyInThread, sources, onSelectSource, }: TextHighlighterProps): React.JSX.Element;
@@ -26,5 +26,8 @@ export interface ChatExperienceDemoProps {
26
26
  foldMotion?: FoldMotion;
27
27
  feedDelay?: number;
28
28
  introMotion?: IntroMotion;
29
+ /** Where the composer starts. See `ChatExperience`. A header action
30
+ switches it either way, so both can be tried on one page. */
31
+ composer?: "inline" | "docked";
29
32
  }
30
- export declare function ChatExperienceDemo({ logo, back, backHref, backLabel, skipIntro, theme, onThemeChange, cursor, animationConfig, foldMotion, feedDelay, introMotion, }: ChatExperienceDemoProps): import("react").JSX.Element;
33
+ export declare function ChatExperienceDemo({ logo, back, backHref, backLabel, skipIntro, theme, onThemeChange, cursor, animationConfig, foldMotion, feedDelay, introMotion, composer: initialComposer, }: ChatExperienceDemoProps): import("react").JSX.Element;