@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.cjs +42 -15
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.js +42 -15
- package/dist/ui/index.js.map +1 -1
- package/package.json +1 -1
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(
|
|
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
|
|
782
|
-
sm: "
|
|
783
|
-
base: "
|
|
784
|
-
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
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
"
|
|
798
|
-
"
|
|
799
|
-
"
|
|
800
|
-
"
|
|
801
|
-
|
|
802
|
-
"[&
|
|
803
|
-
|
|
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
|
}
|