@yourgpt/copilot-sdk 1.2.9 → 1.2.10

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/ui/index.cjs CHANGED
@@ -436,12 +436,37 @@ function Loader({
436
436
  return /* @__PURE__ */ jsxRuntime.jsx(CircularLoader, { size, className });
437
437
  }
438
438
  }
439
+ var createHeading = (Tag) => {
440
+ const HeadingComponent = ({
441
+ children,
442
+ className: _,
443
+ ...props
444
+ }) => /* @__PURE__ */ jsxRuntime.jsx(Tag, { className: "text-[1em] font-semibold my-2 first:mt-0", ...props, children });
445
+ HeadingComponent.displayName = Tag.toUpperCase();
446
+ return HeadingComponent;
447
+ };
448
+ var headingComponents = {
449
+ h1: createHeading("h1"),
450
+ h2: createHeading("h2"),
451
+ h3: createHeading("h3"),
452
+ h4: createHeading("h4"),
453
+ h5: createHeading("h5"),
454
+ h6: createHeading("h6")
455
+ };
439
456
  function MarkdownComponent({
440
457
  children,
441
458
  className,
442
459
  isStreaming = false
443
460
  }) {
444
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx(streamdown.Streamdown, { plugins: { code: code.code }, isAnimating: isStreaming, children }) });
461
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: /* @__PURE__ */ jsxRuntime.jsx(
462
+ streamdown.Streamdown,
463
+ {
464
+ plugins: { code: code.code },
465
+ isAnimating: isStreaming,
466
+ components: headingComponents,
467
+ children
468
+ }
469
+ ) });
445
470
  }
446
471
  var Markdown = React7.memo(MarkdownComponent);
447
472
  Markdown.displayName = "Markdown";
@@ -801,10 +826,10 @@ var MessageAvatar = ({
801
826
  /* @__PURE__ */ jsxRuntime.jsx(AvatarFallback, { delayMs, children: fallbackIcon || fallback })
802
827
  ] });
803
828
  };
804
- var proseSizeMap = {
805
- sm: "prose-sm",
806
- base: "prose-base",
807
- lg: "prose-lg"
829
+ var textSizeMap = {
830
+ sm: "text-sm",
831
+ base: "text-base",
832
+ lg: "text-lg"
808
833
  };
809
834
  var MessageContent = ({
810
835
  children,
@@ -814,18 +839,17 @@ var MessageContent = ({
814
839
  ...props
815
840
  }) => {
816
841
  const classNames = cn(
817
- "rounded-lg p-2 bg-secondary prose break-words whitespace-normal max-w-none",
818
- "text-foreground prose-headings:text-foreground prose-p:text-foreground prose-strong:text-foreground prose-li:text-foreground prose-a:text-foreground prose-ol:text-foreground prose-ul:text-foreground prose-code:text-foreground",
819
- // Compact spacing overrides
820
- "prose-p:my-1 prose-p:leading-relaxed",
821
- "prose-ul:my-1 prose-ol:my-1 prose-li:my-0.5",
822
- "prose-headings:my-2 first:prose-headings:mt-0",
823
- "prose-pre:my-2 prose-blockquote:my-2",
824
- // Normalize headings for chat UI (same size, just bold)
825
- "prose-headings:text-[1em] prose-headings:font-semibold",
826
- // List styling overrides (fix Streamdown's list-inside)
827
- "[&_ul]:list-outside [&_ol]:list-outside [&_ul]:pl-4 [&_ol]:pl-4 [&_li]:pl-0",
828
- proseSizeMap[size],
842
+ "rounded-lg p-2 break-words whitespace-normal max-w-none leading-relaxed",
843
+ // Typography - simple Tailwind utilities (no prose)
844
+ "[&_p]:my-1 [&_p]:leading-relaxed",
845
+ "[&_ul]:my-1 [&_ul]:pl-4 [&_ul]:list-disc [&_ul]:list-outside",
846
+ "[&_ol]:my-1 [&_ol]:pl-4 [&_ol]:list-decimal [&_ol]:list-outside",
847
+ "[&_li]:my-0.5 [&_li]:pl-0",
848
+ "[&_pre]:my-2 [&_blockquote]:my-2 [&_blockquote]:pl-3 [&_blockquote]:border-l-2 [&_blockquote]:border-current/30",
849
+ "[&_code]:bg-current/10 [&_code]:px-1 [&_code]:rounded [&_code]:text-[0.9em]",
850
+ "[&_a]:underline",
851
+ "[&_strong]:font-semibold",
852
+ textSizeMap[size],
829
853
  className
830
854
  );
831
855
  return markdown ? /* @__PURE__ */ jsxRuntime.jsx(Markdown, { className: classNames, ...props, children }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames, ...props, children });
@@ -3565,6 +3589,7 @@ function DefaultMessage({
3565
3589
  "rounded-lg px-4 py-2 bg-primary text-primary-foreground",
3566
3590
  userMessageClassName
3567
3591
  ),
3592
+ markdown: true,
3568
3593
  size,
3569
3594
  children: message.content
3570
3595
  }