@refraction-ui/react 0.10.0 → 0.12.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 +271 -171
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +271 -171
- package/dist/index.js.map +1 -1
- package/dist/internal/conversation/index.d.cts +12 -2
- package/dist/internal/conversation/index.d.ts +12 -2
- package/dist/internal/react-conversation/index.d.cts +5 -1
- package/dist/internal/react-conversation/index.d.ts +5 -1
- package/dist/internal/react-cookie-consent/index.d.cts +1 -2
- package/dist/internal/react-cookie-consent/index.d.ts +1 -2
- package/package.json +1 -1
|
@@ -61,9 +61,15 @@ interface ChatMessage {
|
|
|
61
61
|
error?: string;
|
|
62
62
|
/**
|
|
63
63
|
* Root message id of the reply-thread this message belongs to. Absent on
|
|
64
|
-
* root/main-timeline messages. Threads are one level deep
|
|
64
|
+
* root/main-timeline messages. Threads are one level deep — a reply to any
|
|
65
|
+
* message in a thread groups under the same originating root.
|
|
65
66
|
*/
|
|
66
67
|
parentId?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The specific message this is "in reply to" (for the quote), which may be a
|
|
70
|
+
* mid-thread reply even though `parentId` is always the originating root.
|
|
71
|
+
*/
|
|
72
|
+
replyToId?: string;
|
|
67
73
|
/** Emoji reactions */
|
|
68
74
|
reactions?: MessageReaction[];
|
|
69
75
|
/** Attachments (images/gifs/files) */
|
|
@@ -124,6 +130,8 @@ interface ConversationState {
|
|
|
124
130
|
messages: ChatMessage[];
|
|
125
131
|
/** Root id of the thread shown in the side panel, or null when closed */
|
|
126
132
|
openThreadRootId: string | null;
|
|
133
|
+
/** The specific message a reply in the open thread will target (default: the root) */
|
|
134
|
+
replyTarget: string | null;
|
|
127
135
|
/** Current threading mode */
|
|
128
136
|
threadingMode: ThreadingMode;
|
|
129
137
|
/** Coarse store status */
|
|
@@ -192,8 +200,10 @@ interface ConversationAPI {
|
|
|
192
200
|
retryLast(): Promise<void>;
|
|
193
201
|
/** Abort the in-flight stream, keeping any partial reply */
|
|
194
202
|
stop(): void;
|
|
195
|
-
/** Open the side panel focused on a message's thread */
|
|
203
|
+
/** Open the side panel focused on a message's thread (reply target = root) */
|
|
196
204
|
openThread(rootId: string): void;
|
|
205
|
+
/** Open the originating thread and target a specific message for the next reply */
|
|
206
|
+
replyTo(messageId: string): void;
|
|
197
207
|
/** Close the thread side panel */
|
|
198
208
|
closeThread(): void;
|
|
199
209
|
/** Switch threading mode */
|
|
@@ -61,9 +61,15 @@ interface ChatMessage {
|
|
|
61
61
|
error?: string;
|
|
62
62
|
/**
|
|
63
63
|
* Root message id of the reply-thread this message belongs to. Absent on
|
|
64
|
-
* root/main-timeline messages. Threads are one level deep
|
|
64
|
+
* root/main-timeline messages. Threads are one level deep — a reply to any
|
|
65
|
+
* message in a thread groups under the same originating root.
|
|
65
66
|
*/
|
|
66
67
|
parentId?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The specific message this is "in reply to" (for the quote), which may be a
|
|
70
|
+
* mid-thread reply even though `parentId` is always the originating root.
|
|
71
|
+
*/
|
|
72
|
+
replyToId?: string;
|
|
67
73
|
/** Emoji reactions */
|
|
68
74
|
reactions?: MessageReaction[];
|
|
69
75
|
/** Attachments (images/gifs/files) */
|
|
@@ -124,6 +130,8 @@ interface ConversationState {
|
|
|
124
130
|
messages: ChatMessage[];
|
|
125
131
|
/** Root id of the thread shown in the side panel, or null when closed */
|
|
126
132
|
openThreadRootId: string | null;
|
|
133
|
+
/** The specific message a reply in the open thread will target (default: the root) */
|
|
134
|
+
replyTarget: string | null;
|
|
127
135
|
/** Current threading mode */
|
|
128
136
|
threadingMode: ThreadingMode;
|
|
129
137
|
/** Coarse store status */
|
|
@@ -192,8 +200,10 @@ interface ConversationAPI {
|
|
|
192
200
|
retryLast(): Promise<void>;
|
|
193
201
|
/** Abort the in-flight stream, keeping any partial reply */
|
|
194
202
|
stop(): void;
|
|
195
|
-
/** Open the side panel focused on a message's thread */
|
|
203
|
+
/** Open the side panel focused on a message's thread (reply target = root) */
|
|
196
204
|
openThread(rootId: string): void;
|
|
205
|
+
/** Open the originating thread and target a specific message for the next reply */
|
|
206
|
+
replyTo(messageId: string): void;
|
|
197
207
|
/** Close the thread side panel */
|
|
198
208
|
closeThread(): void;
|
|
199
209
|
/** Switch threading mode */
|
|
@@ -18,6 +18,7 @@ interface UseConversationResult {
|
|
|
18
18
|
retryLast: ConversationAPI['retryLast'];
|
|
19
19
|
stop: ConversationAPI['stop'];
|
|
20
20
|
openThread: ConversationAPI['openThread'];
|
|
21
|
+
replyTo: ConversationAPI['replyTo'];
|
|
21
22
|
closeThread: ConversationAPI['closeThread'];
|
|
22
23
|
setThreadingMode: ConversationAPI['setThreadingMode'];
|
|
23
24
|
}
|
|
@@ -56,6 +57,9 @@ interface ComposerProps {
|
|
|
56
57
|
emoji?: boolean;
|
|
57
58
|
/** Enable the attach button (default true) */
|
|
58
59
|
attachments?: boolean;
|
|
60
|
+
/** Error to surface above the input (with a Retry button) */
|
|
61
|
+
error?: string | null;
|
|
62
|
+
onRetry?: () => void;
|
|
59
63
|
onSubmit: (content: string, attachments?: MessageAttachment[]) => void;
|
|
60
64
|
onStop?: () => void;
|
|
61
65
|
/** Called when a `/` command without `insertText` is chosen */
|
|
@@ -66,7 +70,7 @@ interface ComposerProps {
|
|
|
66
70
|
* Composer — rich message input: markdown formatting toolbar + Cmd/Ctrl shortcuts,
|
|
67
71
|
* and `/` command, `@` mention, and `:` emoji autocomplete menus.
|
|
68
72
|
*/
|
|
69
|
-
declare function Composer({ placeholder, busy, slashCommands, mentions, toolbar, emoji, attachments, onSubmit, onStop, onSlashCommand, autoFocus, }: ComposerProps): React.DetailedReactHTMLElement<{
|
|
73
|
+
declare function Composer({ placeholder, busy, slashCommands, mentions, toolbar, emoji, attachments, error, onRetry, onSubmit, onStop, onSlashCommand, autoFocus, }: ComposerProps): React.DetailedReactHTMLElement<{
|
|
70
74
|
className: string;
|
|
71
75
|
}, HTMLElement>;
|
|
72
76
|
|
|
@@ -18,6 +18,7 @@ interface UseConversationResult {
|
|
|
18
18
|
retryLast: ConversationAPI['retryLast'];
|
|
19
19
|
stop: ConversationAPI['stop'];
|
|
20
20
|
openThread: ConversationAPI['openThread'];
|
|
21
|
+
replyTo: ConversationAPI['replyTo'];
|
|
21
22
|
closeThread: ConversationAPI['closeThread'];
|
|
22
23
|
setThreadingMode: ConversationAPI['setThreadingMode'];
|
|
23
24
|
}
|
|
@@ -56,6 +57,9 @@ interface ComposerProps {
|
|
|
56
57
|
emoji?: boolean;
|
|
57
58
|
/** Enable the attach button (default true) */
|
|
58
59
|
attachments?: boolean;
|
|
60
|
+
/** Error to surface above the input (with a Retry button) */
|
|
61
|
+
error?: string | null;
|
|
62
|
+
onRetry?: () => void;
|
|
59
63
|
onSubmit: (content: string, attachments?: MessageAttachment[]) => void;
|
|
60
64
|
onStop?: () => void;
|
|
61
65
|
/** Called when a `/` command without `insertText` is chosen */
|
|
@@ -66,7 +70,7 @@ interface ComposerProps {
|
|
|
66
70
|
* Composer — rich message input: markdown formatting toolbar + Cmd/Ctrl shortcuts,
|
|
67
71
|
* and `/` command, `@` mention, and `:` emoji autocomplete menus.
|
|
68
72
|
*/
|
|
69
|
-
declare function Composer({ placeholder, busy, slashCommands, mentions, toolbar, emoji, attachments, onSubmit, onStop, onSlashCommand, autoFocus, }: ComposerProps): React.DetailedReactHTMLElement<{
|
|
73
|
+
declare function Composer({ placeholder, busy, slashCommands, mentions, toolbar, emoji, attachments, error, onRetry, onSubmit, onStop, onSlashCommand, autoFocus, }: ComposerProps): React.DetailedReactHTMLElement<{
|
|
70
74
|
className: string;
|
|
71
75
|
}, HTMLElement>;
|
|
72
76
|
|
|
@@ -33,8 +33,7 @@ interface CookieConsentProps {
|
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* CookieConsent — batteries-included consent banner over `useCookieConsent()`.
|
|
36
|
-
*
|
|
37
|
-
* per-category toggles. Renders nothing once the user has consented.
|
|
36
|
+
* Renders nothing once the user has consented.
|
|
38
37
|
*/
|
|
39
38
|
declare function CookieConsent({ consent, position, title, description, policyUrl, policyLabel, className, }: CookieConsentProps): React.DetailedReactHTMLElement<{
|
|
40
39
|
className: string;
|
|
@@ -33,8 +33,7 @@ interface CookieConsentProps {
|
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* CookieConsent — batteries-included consent banner over `useCookieConsent()`.
|
|
36
|
-
*
|
|
37
|
-
* per-category toggles. Renders nothing once the user has consented.
|
|
36
|
+
* Renders nothing once the user has consented.
|
|
38
37
|
*/
|
|
39
38
|
declare function CookieConsent({ consent, position, title, description, policyUrl, policyLabel, className, }: CookieConsentProps): React.DetailedReactHTMLElement<{
|
|
40
39
|
className: string;
|
package/package.json
CHANGED