@yourgpt/copilot-sdk 1.2.8 → 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.js CHANGED
@@ -413,12 +413,37 @@ function Loader({
413
413
  return /* @__PURE__ */ jsx(CircularLoader, { size, className });
414
414
  }
415
415
  }
416
+ var createHeading = (Tag) => {
417
+ const HeadingComponent = ({
418
+ children,
419
+ className: _,
420
+ ...props
421
+ }) => /* @__PURE__ */ jsx(Tag, { className: "text-[1em] font-semibold my-2 first:mt-0", ...props, children });
422
+ HeadingComponent.displayName = Tag.toUpperCase();
423
+ return HeadingComponent;
424
+ };
425
+ var headingComponents = {
426
+ h1: createHeading("h1"),
427
+ h2: createHeading("h2"),
428
+ h3: createHeading("h3"),
429
+ h4: createHeading("h4"),
430
+ h5: createHeading("h5"),
431
+ h6: createHeading("h6")
432
+ };
416
433
  function MarkdownComponent({
417
434
  children,
418
435
  className,
419
436
  isStreaming = false
420
437
  }) {
421
- return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(Streamdown, { plugins: { code }, isAnimating: isStreaming, children }) });
438
+ return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(
439
+ Streamdown,
440
+ {
441
+ plugins: { code },
442
+ isAnimating: isStreaming,
443
+ components: headingComponents,
444
+ children
445
+ }
446
+ ) });
422
447
  }
423
448
  var Markdown = memo(MarkdownComponent);
424
449
  Markdown.displayName = "Markdown";
@@ -778,10 +803,10 @@ var MessageAvatar = ({
778
803
  /* @__PURE__ */ jsx(AvatarFallback, { delayMs, children: fallbackIcon || fallback })
779
804
  ] });
780
805
  };
781
- var proseSizeMap = {
782
- sm: "prose-sm",
783
- base: "prose-base",
784
- lg: "prose-lg"
806
+ var textSizeMap = {
807
+ sm: "text-sm",
808
+ base: "text-base",
809
+ lg: "text-lg"
785
810
  };
786
811
  var MessageContent = ({
787
812
  children,
@@ -791,16 +816,17 @@ var MessageContent = ({
791
816
  ...props
792
817
  }) => {
793
818
  const classNames = cn(
794
- "rounded-lg p-2 bg-secondary prose break-words whitespace-normal max-w-none",
795
- "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",
796
- // Compact spacing overrides
797
- "prose-p:my-1 prose-p:leading-relaxed",
798
- "prose-ul:my-1 prose-ol:my-1 prose-li:my-0.5",
799
- "prose-headings:my-2 first:prose-headings:mt-0",
800
- "prose-pre:my-2 prose-blockquote:my-2",
801
- // List styling overrides (fix Streamdown's list-inside)
802
- "[&_ul]:list-outside [&_ol]:list-outside [&_ul]:pl-4 [&_ol]:pl-4 [&_li]:pl-0",
803
- proseSizeMap[size],
819
+ "rounded-lg p-2 break-words whitespace-normal max-w-none leading-relaxed",
820
+ // Typography - simple Tailwind utilities (no prose)
821
+ "[&_p]:my-1 [&_p]:leading-relaxed",
822
+ "[&_ul]:my-1 [&_ul]:pl-4 [&_ul]:list-disc [&_ul]:list-outside",
823
+ "[&_ol]:my-1 [&_ol]:pl-4 [&_ol]:list-decimal [&_ol]:list-outside",
824
+ "[&_li]:my-0.5 [&_li]:pl-0",
825
+ "[&_pre]:my-2 [&_blockquote]:my-2 [&_blockquote]:pl-3 [&_blockquote]:border-l-2 [&_blockquote]:border-current/30",
826
+ "[&_code]:bg-current/10 [&_code]:px-1 [&_code]:rounded [&_code]:text-[0.9em]",
827
+ "[&_a]:underline",
828
+ "[&_strong]:font-semibold",
829
+ textSizeMap[size],
804
830
  className
805
831
  );
806
832
  return markdown ? /* @__PURE__ */ jsx(Markdown, { className: classNames, ...props, children }) : /* @__PURE__ */ jsx("div", { className: classNames, ...props, children });
@@ -3540,6 +3566,7 @@ function DefaultMessage({
3540
3566
  "rounded-lg px-4 py-2 bg-primary text-primary-foreground",
3541
3567
  userMessageClassName
3542
3568
  ),
3569
+ markdown: true,
3543
3570
  size,
3544
3571
  children: message.content
3545
3572
  }