polymorph-ui-components 0.6.1 → 0.6.2
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/Chat/Chat.svelte +11 -1
- package/dist/Chat/properties.d.ts +1 -0
- package/dist/ChatMessage/ChatMessage.svelte +4 -0
- package/dist/ChatMessage/properties.d.ts +1 -1
- package/dist/ChatMessageList/ChatMessageList.svelte +5 -0
- package/dist/ChatMessageList/properties.d.ts +1 -0
- package/package.json +1 -1
package/dist/Chat/Chat.svelte
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
headerActions,
|
|
31
31
|
headerContent,
|
|
32
32
|
message,
|
|
33
|
+
messageAttachments,
|
|
33
34
|
empty,
|
|
34
35
|
composerLeading,
|
|
35
36
|
sendIcon,
|
|
@@ -83,7 +84,16 @@
|
|
|
83
84
|
/>
|
|
84
85
|
{/if}
|
|
85
86
|
|
|
86
|
-
<ChatMessageList
|
|
87
|
+
<ChatMessageList
|
|
88
|
+
{messages}
|
|
89
|
+
{autoscroll}
|
|
90
|
+
{message}
|
|
91
|
+
{messageAttachments}
|
|
92
|
+
{empty}
|
|
93
|
+
{allowCopy}
|
|
94
|
+
{onretry}
|
|
95
|
+
{onfeedback}
|
|
96
|
+
/>
|
|
87
97
|
|
|
88
98
|
<div class="footer">
|
|
89
99
|
{#if showSuggestions}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
messages,
|
|
15
15
|
autoscroll = true,
|
|
16
16
|
message,
|
|
17
|
+
messageAttachments,
|
|
17
18
|
empty,
|
|
18
19
|
jumpLabel = 'Jump to latest',
|
|
19
20
|
jumpIcon,
|
|
@@ -105,6 +106,9 @@
|
|
|
105
106
|
{#if typeof message === 'function'}
|
|
106
107
|
{@render message(msg)}
|
|
107
108
|
{:else}
|
|
109
|
+
{#snippet attachmentsFor()}
|
|
110
|
+
{@render messageAttachments?.(msg)}
|
|
111
|
+
{/snippet}
|
|
108
112
|
<ChatMessage
|
|
109
113
|
role={msg.role}
|
|
110
114
|
content={msg.content}
|
|
@@ -112,6 +116,7 @@
|
|
|
112
116
|
streaming={msg.streaming}
|
|
113
117
|
status={msg.status}
|
|
114
118
|
allowCopy={allowCopy && partyOf(msg.role) === 'responder'}
|
|
119
|
+
attachments={typeof messageAttachments === 'function' ? attachmentsFor : null}
|
|
115
120
|
onretry={retryFor(msg)}
|
|
116
121
|
onfeedback={feedbackFor(msg)}
|
|
117
122
|
/>
|
|
@@ -8,6 +8,7 @@ export type MandatoryChatMessageListProperties = {
|
|
|
8
8
|
export type OptionalChatMessageListProperties = {
|
|
9
9
|
autoscroll?: boolean;
|
|
10
10
|
message?: Snippet<[ChatMessageData]>;
|
|
11
|
+
messageAttachments?: Snippet<[ChatMessageData]>;
|
|
11
12
|
empty?: Snippet;
|
|
12
13
|
jumpLabel?: string;
|
|
13
14
|
jumpIcon?: Snippet;
|