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.
@@ -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 {messages} {autoscroll} {message} {empty} {allowCopy} {onretry} {onfeedback} />
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}
@@ -29,6 +29,7 @@ export type OptionalChatProperties = {
29
29
  headerActions?: Snippet;
30
30
  headerContent?: Snippet;
31
31
  message?: Snippet<[ChatMessageData]>;
32
+ messageAttachments?: Snippet<[ChatMessageData]>;
32
33
  empty?: Snippet;
33
34
  composerLeading?: Snippet;
34
35
  sendIcon?: Snippet;
@@ -252,6 +252,10 @@
252
252
  margin: var(--chat-message-attachments-margin, 4px 0 0 0);
253
253
  }
254
254
 
255
+ .message-attachments:empty {
256
+ display: none;
257
+ }
258
+
255
259
  .actions {
256
260
  display: flex;
257
261
  align-items: center;
@@ -12,7 +12,7 @@ export type OptionalChatMessageProperties = {
12
12
  status?: ChatMessageStatus;
13
13
  avatar?: Snippet;
14
14
  header?: Snippet;
15
- attachments?: Snippet;
15
+ attachments?: Snippet | null;
16
16
  allowCopy?: boolean;
17
17
  actions?: Snippet;
18
18
  copyLabel?: string;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polymorph-ui-components",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "A themeable Svelte 5 UI component library with CSS custom property driven styling",
5
5
  "keywords": [
6
6
  "svelte",