@mieweb/ui 0.3.0-dev.107 → 0.3.0-dev.108

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
@@ -2262,11 +2262,21 @@ function AITypingIndicator({ className }) {
2262
2262
  }
2263
2263
  );
2264
2264
  }
2265
- function ContentBlock({ content, onLinkClick }) {
2265
+ function ContentBlock({
2266
+ content,
2267
+ onLinkClick,
2268
+ messageId,
2269
+ streaming,
2270
+ role,
2271
+ renderTextContent
2272
+ }) {
2266
2273
  const [isCollapsed, setIsCollapsed] = React48__namespace.useState(
2267
2274
  content.collapsed ?? false
2268
2275
  );
2269
2276
  if (content.type === "text" && content.text) {
2277
+ if (renderTextContent) {
2278
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none", children: renderTextContent(content.text, { messageId, streaming, role }) });
2279
+ }
2270
2280
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-wrap", children: content.text }) });
2271
2281
  }
2272
2282
  if (content.type === "tool_use" && content.toolCall) {
@@ -2379,6 +2389,7 @@ function AIMessageDisplay({
2379
2389
  showAvatar = true,
2380
2390
  showTimestamp = false,
2381
2391
  onLinkClick,
2392
+ renderTextContent,
2382
2393
  className
2383
2394
  }) {
2384
2395
  const isStreaming = message.status === "streaming";
@@ -2402,7 +2413,11 @@ function AIMessageDisplay({
2402
2413
  ContentBlock,
2403
2414
  {
2404
2415
  content,
2405
- onLinkClick
2416
+ onLinkClick,
2417
+ messageId: message.id,
2418
+ streaming: isStreaming,
2419
+ role: message.role,
2420
+ renderTextContent
2406
2421
  },
2407
2422
  index
2408
2423
  )) })
@@ -2437,7 +2452,11 @@ function AIMessageDisplay({
2437
2452
  ContentBlock,
2438
2453
  {
2439
2454
  content,
2440
- onLinkClick
2455
+ onLinkClick,
2456
+ messageId: message.id,
2457
+ streaming: isStreaming,
2458
+ role: message.role,
2459
+ renderTextContent
2441
2460
  },
2442
2461
  index
2443
2462
  )) }) : isStreaming ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(AITypingIndicator, {}) }) : null
@@ -4658,7 +4677,8 @@ function AIChat({
4658
4677
  onSuggestedAction,
4659
4678
  onCancel,
4660
4679
  onClear,
4661
- onClose
4680
+ onClose,
4681
+ renderTextContent
4662
4682
  }) {
4663
4683
  const messagesEndRef = React48__namespace.useRef(null);
4664
4684
  const messages = React48__namespace.useMemo(
@@ -4771,7 +4791,8 @@ function AIChat({
4771
4791
  message,
4772
4792
  userName,
4773
4793
  showTimestamp: showTimestamps,
4774
- onLinkClick: handleLinkClick
4794
+ onLinkClick: handleLinkClick,
4795
+ renderTextContent
4775
4796
  },
4776
4797
  message.id
4777
4798
  )),