@poolse/react-ui 0.2.0-alpha.7 → 1.0.1-beta.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/CHANGELOG.md +10 -0
- package/dist/index.cjs +393 -117
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +76 -2
- package/dist/index.d.ts +76 -2
- package/dist/index.js +389 -118
- package/dist/index.js.map +1 -1
- package/dist/styles.css +228 -9
- package/package.json +6 -3
package/dist/index.d.cts
CHANGED
|
@@ -42,6 +42,47 @@ interface ConversationViewProps {
|
|
|
42
42
|
quotations?: boolean;
|
|
43
43
|
/** Check-double glyph on own messages once another member's read cursor advances past them. */
|
|
44
44
|
readReceipts?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Render message bodies as Markdown (bold, italic, lists, code,
|
|
47
|
+
* blockquotes, strikethrough, autolinks, ==highlight==). Defaults
|
|
48
|
+
* to `true`. Set `false` for raw-text rendering.
|
|
49
|
+
*/
|
|
50
|
+
markdown?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Trim message bodies longer than this many characters and show a
|
|
53
|
+
* "Read more" toggle. Defaults to 200. Set 0 to disable.
|
|
54
|
+
*/
|
|
55
|
+
maxBodyLength?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Group consecutive messages from the same sender within
|
|
58
|
+
* `groupingWindowMs` (default 5 min) on the same day into a single
|
|
59
|
+
* visual cluster — only the LAST bubble in a cluster shows the
|
|
60
|
+
* asymmetric tail corner, matching WhatsApp / iMessage. Set false
|
|
61
|
+
* to render every bubble as standalone (uniform tails).
|
|
62
|
+
*/
|
|
63
|
+
grouping?: boolean;
|
|
64
|
+
/** Milliseconds between same-sender messages to still count as a group. Default 5 min. */
|
|
65
|
+
groupingWindowMs?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Insert a centered day-separator pill between messages whose
|
|
68
|
+
* calendar day differs. Defaults to true.
|
|
69
|
+
*/
|
|
70
|
+
daySeparators?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Show a colored sender label above other-side bubbles in group
|
|
73
|
+
* chats. Resolved via the customer's `userResolver`.
|
|
74
|
+
* * `'auto'` — on when the conversation has more than 2 members
|
|
75
|
+
* * `'always'` — even in DMs (rarely useful)
|
|
76
|
+
* * `'never'` — disable entirely
|
|
77
|
+
* Defaults to `'auto'`.
|
|
78
|
+
*/
|
|
79
|
+
senderLabels?: 'auto' | 'always' | 'never';
|
|
80
|
+
/**
|
|
81
|
+
* Show participant avatars to the LEFT of other-side bubbles in
|
|
82
|
+
* group chats. Same `auto | always | never` semantics as
|
|
83
|
+
* `senderLabels`. Defaults to `'auto'`.
|
|
84
|
+
*/
|
|
85
|
+
avatars?: 'auto' | 'always' | 'never';
|
|
45
86
|
/**
|
|
46
87
|
* Fired once after the caller's auto-mark-read fires for a fresh
|
|
47
88
|
* message. Useful for clearing a sidebar unread badge before the
|
|
@@ -50,8 +91,16 @@ interface ConversationViewProps {
|
|
|
50
91
|
*/
|
|
51
92
|
onMarkedRead?: (conversationId: string) => void;
|
|
52
93
|
}
|
|
53
|
-
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, loadFonts, reactions, mentions, attachments, actions, threads, quotations, readReceipts, onMarkedRead, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
94
|
+
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, loadFonts, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, grouping, groupingWindowMs, daySeparators, senderLabels, avatars, onMarkedRead, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
54
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Position of this bubble within a same-sender, same-day, ≤5-min
|
|
98
|
+
* cluster. Drives the tail-corner rendering: only `last` and
|
|
99
|
+
* `standalone` get the asymmetric tail, matching the WhatsApp /
|
|
100
|
+
* iMessage convention where consecutive bursts read as a single
|
|
101
|
+
* unit with one trailing tail.
|
|
102
|
+
*/
|
|
103
|
+
type BubbleGroupPosition = 'first' | 'middle' | 'last' | 'standalone';
|
|
55
104
|
interface MessageBubbleProps {
|
|
56
105
|
message: Message;
|
|
57
106
|
/** Used to decide left/right alignment + color, and whether to show the read-receipt glyph. */
|
|
@@ -75,6 +124,31 @@ interface MessageBubbleProps {
|
|
|
75
124
|
* No-op when omitted.
|
|
76
125
|
*/
|
|
77
126
|
onQuotedClick?: (quotedMessageId: Uuid) => void;
|
|
127
|
+
/**
|
|
128
|
+
* Where this bubble sits within a same-sender cluster (see
|
|
129
|
+
* BubbleGroupPosition). Defaults to `standalone`.
|
|
130
|
+
*/
|
|
131
|
+
groupPosition?: BubbleGroupPosition;
|
|
132
|
+
/**
|
|
133
|
+
* When > 0, truncates the body at this many characters and shows a
|
|
134
|
+
* "Read more" toggle to expand. Defaults to 0 (no truncation).
|
|
135
|
+
*/
|
|
136
|
+
maxBodyLength?: number;
|
|
137
|
+
/**
|
|
138
|
+
* Render the body as GitHub-flavored Markdown (bold, italic, lists,
|
|
139
|
+
* fenced code, blockquotes, strikethrough, autolinks). Defaults to
|
|
140
|
+
* `false`. `<ConversationView>` flips this on by default.
|
|
141
|
+
*/
|
|
142
|
+
markdown?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Show a colored sender label above the body for other-side
|
|
145
|
+
* bubbles. Only meaningful in group chats (3+ participants) and
|
|
146
|
+
* only on the FIRST / STANDALONE bubble of a cluster (continuation
|
|
147
|
+
* bubbles share the cluster's identity). The label name comes
|
|
148
|
+
* from the SDK's `useUser` hook via the customer's
|
|
149
|
+
* `userResolver` config.
|
|
150
|
+
*/
|
|
151
|
+
showSenderName?: boolean;
|
|
78
152
|
}
|
|
79
153
|
/**
|
|
80
154
|
* One message bubble. The default renderer for `<ConversationView>` —
|
|
@@ -85,7 +159,7 @@ interface MessageBubbleProps {
|
|
|
85
159
|
* (coral for self, surface-with-border for others), matching the
|
|
86
160
|
* brand-kit chat showcase.
|
|
87
161
|
*/
|
|
88
|
-
declare function MessageBubble({ message, currentUserId, readState, labelFor, onQuotedClick, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
162
|
+
declare function MessageBubble({ message, currentUserId, readState, labelFor, onQuotedClick, groupPosition, maxBodyLength, markdown, showSenderName, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
89
163
|
|
|
90
164
|
interface EditableMessageBubbleProps {
|
|
91
165
|
message: Message;
|
package/dist/index.d.ts
CHANGED
|
@@ -42,6 +42,47 @@ interface ConversationViewProps {
|
|
|
42
42
|
quotations?: boolean;
|
|
43
43
|
/** Check-double glyph on own messages once another member's read cursor advances past them. */
|
|
44
44
|
readReceipts?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Render message bodies as Markdown (bold, italic, lists, code,
|
|
47
|
+
* blockquotes, strikethrough, autolinks, ==highlight==). Defaults
|
|
48
|
+
* to `true`. Set `false` for raw-text rendering.
|
|
49
|
+
*/
|
|
50
|
+
markdown?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Trim message bodies longer than this many characters and show a
|
|
53
|
+
* "Read more" toggle. Defaults to 200. Set 0 to disable.
|
|
54
|
+
*/
|
|
55
|
+
maxBodyLength?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Group consecutive messages from the same sender within
|
|
58
|
+
* `groupingWindowMs` (default 5 min) on the same day into a single
|
|
59
|
+
* visual cluster — only the LAST bubble in a cluster shows the
|
|
60
|
+
* asymmetric tail corner, matching WhatsApp / iMessage. Set false
|
|
61
|
+
* to render every bubble as standalone (uniform tails).
|
|
62
|
+
*/
|
|
63
|
+
grouping?: boolean;
|
|
64
|
+
/** Milliseconds between same-sender messages to still count as a group. Default 5 min. */
|
|
65
|
+
groupingWindowMs?: number;
|
|
66
|
+
/**
|
|
67
|
+
* Insert a centered day-separator pill between messages whose
|
|
68
|
+
* calendar day differs. Defaults to true.
|
|
69
|
+
*/
|
|
70
|
+
daySeparators?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Show a colored sender label above other-side bubbles in group
|
|
73
|
+
* chats. Resolved via the customer's `userResolver`.
|
|
74
|
+
* * `'auto'` — on when the conversation has more than 2 members
|
|
75
|
+
* * `'always'` — even in DMs (rarely useful)
|
|
76
|
+
* * `'never'` — disable entirely
|
|
77
|
+
* Defaults to `'auto'`.
|
|
78
|
+
*/
|
|
79
|
+
senderLabels?: 'auto' | 'always' | 'never';
|
|
80
|
+
/**
|
|
81
|
+
* Show participant avatars to the LEFT of other-side bubbles in
|
|
82
|
+
* group chats. Same `auto | always | never` semantics as
|
|
83
|
+
* `senderLabels`. Defaults to `'auto'`.
|
|
84
|
+
*/
|
|
85
|
+
avatars?: 'auto' | 'always' | 'never';
|
|
45
86
|
/**
|
|
46
87
|
* Fired once after the caller's auto-mark-read fires for a fresh
|
|
47
88
|
* message. Useful for clearing a sidebar unread badge before the
|
|
@@ -50,8 +91,16 @@ interface ConversationViewProps {
|
|
|
50
91
|
*/
|
|
51
92
|
onMarkedRead?: (conversationId: string) => void;
|
|
52
93
|
}
|
|
53
|
-
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, loadFonts, reactions, mentions, attachments, actions, threads, quotations, readReceipts, onMarkedRead, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
94
|
+
declare function ConversationView({ conversationId, emptyState, renderMessage, labelFor, loadFonts, reactions, mentions, attachments, actions, threads, quotations, readReceipts, markdown, maxBodyLength, grouping, groupingWindowMs, daySeparators, senderLabels, avatars, onMarkedRead, }: ConversationViewProps): react_jsx_runtime.JSX.Element;
|
|
54
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Position of this bubble within a same-sender, same-day, ≤5-min
|
|
98
|
+
* cluster. Drives the tail-corner rendering: only `last` and
|
|
99
|
+
* `standalone` get the asymmetric tail, matching the WhatsApp /
|
|
100
|
+
* iMessage convention where consecutive bursts read as a single
|
|
101
|
+
* unit with one trailing tail.
|
|
102
|
+
*/
|
|
103
|
+
type BubbleGroupPosition = 'first' | 'middle' | 'last' | 'standalone';
|
|
55
104
|
interface MessageBubbleProps {
|
|
56
105
|
message: Message;
|
|
57
106
|
/** Used to decide left/right alignment + color, and whether to show the read-receipt glyph. */
|
|
@@ -75,6 +124,31 @@ interface MessageBubbleProps {
|
|
|
75
124
|
* No-op when omitted.
|
|
76
125
|
*/
|
|
77
126
|
onQuotedClick?: (quotedMessageId: Uuid) => void;
|
|
127
|
+
/**
|
|
128
|
+
* Where this bubble sits within a same-sender cluster (see
|
|
129
|
+
* BubbleGroupPosition). Defaults to `standalone`.
|
|
130
|
+
*/
|
|
131
|
+
groupPosition?: BubbleGroupPosition;
|
|
132
|
+
/**
|
|
133
|
+
* When > 0, truncates the body at this many characters and shows a
|
|
134
|
+
* "Read more" toggle to expand. Defaults to 0 (no truncation).
|
|
135
|
+
*/
|
|
136
|
+
maxBodyLength?: number;
|
|
137
|
+
/**
|
|
138
|
+
* Render the body as GitHub-flavored Markdown (bold, italic, lists,
|
|
139
|
+
* fenced code, blockquotes, strikethrough, autolinks). Defaults to
|
|
140
|
+
* `false`. `<ConversationView>` flips this on by default.
|
|
141
|
+
*/
|
|
142
|
+
markdown?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Show a colored sender label above the body for other-side
|
|
145
|
+
* bubbles. Only meaningful in group chats (3+ participants) and
|
|
146
|
+
* only on the FIRST / STANDALONE bubble of a cluster (continuation
|
|
147
|
+
* bubbles share the cluster's identity). The label name comes
|
|
148
|
+
* from the SDK's `useUser` hook via the customer's
|
|
149
|
+
* `userResolver` config.
|
|
150
|
+
*/
|
|
151
|
+
showSenderName?: boolean;
|
|
78
152
|
}
|
|
79
153
|
/**
|
|
80
154
|
* One message bubble. The default renderer for `<ConversationView>` —
|
|
@@ -85,7 +159,7 @@ interface MessageBubbleProps {
|
|
|
85
159
|
* (coral for self, surface-with-border for others), matching the
|
|
86
160
|
* brand-kit chat showcase.
|
|
87
161
|
*/
|
|
88
|
-
declare function MessageBubble({ message, currentUserId, readState, labelFor, onQuotedClick, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
162
|
+
declare function MessageBubble({ message, currentUserId, readState, labelFor, onQuotedClick, groupPosition, maxBodyLength, markdown, showSenderName, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
89
163
|
|
|
90
164
|
interface EditableMessageBubbleProps {
|
|
91
165
|
message: Message;
|