@vantageos/mosaic-blocks 0.5.19-alpha → 0.5.20-alpha

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 CHANGED
@@ -46,7 +46,7 @@ function _interopNamespace(e) {
46
46
  var React28__namespace = /*#__PURE__*/_interopNamespace(React28);
47
47
 
48
48
  // src/version.ts
49
- var version = "0.5.19-alpha";
49
+ var version = "0.5.20-alpha";
50
50
  function Placeholder({ label = "mosaic-blocks placeholder" }) {
51
51
  return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-mosaic-block": "placeholder", children: label });
52
52
  }
@@ -12064,7 +12064,9 @@ function cn76(...classes) {
12064
12064
  return classes.filter(Boolean).join(" ");
12065
12065
  }
12066
12066
  function partKey(part, index) {
12067
- return part.type === "tool" ? part.toolCallId : `${part.type}:${index}`;
12067
+ if (part.type === "tool") return part.toolCallId;
12068
+ if (part.type === "attachment") return part.attachmentId;
12069
+ return `${part.type}:${index}`;
12068
12070
  }
12069
12071
  function toolStatusOf(part) {
12070
12072
  switch (part.state) {
@@ -12166,6 +12168,21 @@ function ChatMessageToolPartView({
12166
12168
  )
12167
12169
  ] });
12168
12170
  }
12171
+ function ChatMessageAttachmentPartView({ part }) {
12172
+ return /* @__PURE__ */ jsxRuntime.jsx(
12173
+ "div",
12174
+ {
12175
+ "data-slot": "chat-message-attachment",
12176
+ "data-attachment-id": part.attachmentId,
12177
+ "data-attachment-filename": part.fileName,
12178
+ "data-attachment-mimetype": part.mimeType,
12179
+ "data-attachment-size": part.sizeBytes,
12180
+ "data-attachment-url": part.url,
12181
+ className: "my-2",
12182
+ children: part.renderAttachment(part)
12183
+ }
12184
+ );
12185
+ }
12169
12186
  function ChatMessagePartView({
12170
12187
  part,
12171
12188
  renderText,
@@ -12188,6 +12205,8 @@ function ChatMessagePartView({
12188
12205
  );
12189
12206
  case "tool":
12190
12207
  return /* @__PURE__ */ jsxRuntime.jsx(ChatMessageToolPartView, { part, toolStatusLabels });
12208
+ case "attachment":
12209
+ return /* @__PURE__ */ jsxRuntime.jsx(ChatMessageAttachmentPartView, { part });
12191
12210
  }
12192
12211
  }
12193
12212
  function MosaicChatMessage({