@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.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(
|
|
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
|
|
805
|
-
sm: "
|
|
806
|
-
base: "
|
|
807
|
-
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,16 +839,17 @@ var MessageContent = ({
|
|
|
814
839
|
...props
|
|
815
840
|
}) => {
|
|
816
841
|
const classNames = cn(
|
|
817
|
-
"rounded-lg p-2
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
"
|
|
821
|
-
"
|
|
822
|
-
"
|
|
823
|
-
"
|
|
824
|
-
|
|
825
|
-
"[&
|
|
826
|
-
|
|
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],
|
|
827
853
|
className
|
|
828
854
|
);
|
|
829
855
|
return markdown ? /* @__PURE__ */ jsxRuntime.jsx(Markdown, { className: classNames, ...props, children }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: classNames, ...props, children });
|
|
@@ -3563,6 +3589,7 @@ function DefaultMessage({
|
|
|
3563
3589
|
"rounded-lg px-4 py-2 bg-primary text-primary-foreground",
|
|
3564
3590
|
userMessageClassName
|
|
3565
3591
|
),
|
|
3592
|
+
markdown: true,
|
|
3566
3593
|
size,
|
|
3567
3594
|
children: message.content
|
|
3568
3595
|
}
|