@page-speed/agent-everywhere 0.3.0 → 0.3.1

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.js CHANGED
@@ -981,33 +981,70 @@ function MessageBubble({ role, children, className, unstyled }) {
981
981
  }
982
982
  );
983
983
  }
984
- var PROSE_CLASSES = cn(
985
- "text-sm leading-relaxed",
986
- "[&_p]:my-1.5 first:[&_p]:mt-0 last:[&_p]:mb-0",
987
- "[&_ul]:my-1.5 [&_ul]:list-disc [&_ul]:pl-5",
988
- "[&_ol]:my-1.5 [&_ol]:list-decimal [&_ol]:pl-5",
989
- "[&_li]:my-0.5",
990
- "[&_h1]:mt-2 [&_h1]:mb-1 [&_h1]:text-base [&_h1]:font-semibold",
991
- "[&_h2]:mt-2 [&_h2]:mb-1 [&_h2]:text-sm [&_h2]:font-semibold",
992
- "[&_h3]:mt-2 [&_h3]:mb-1 [&_h3]:text-sm [&_h3]:font-semibold",
993
- "[&_strong]:font-semibold",
994
- "[&_a]:underline [&_a]:underline-offset-2",
995
- "[&_code]:rounded [&_code]:bg-black/10 [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-[0.85em]",
996
- "[&_pre]:my-1.5 [&_pre]:overflow-x-auto [&_pre]:rounded-md [&_pre]:bg-black/10 [&_pre]:p-2 [&_pre]:text-xs",
997
- "[&_pre_code]:bg-transparent [&_pre_code]:p-0",
998
- "[&_blockquote]:border-l-2 [&_blockquote]:border-current/30 [&_blockquote]:pl-3 [&_blockquote]:opacity-90",
999
- "[&_hr]:my-2 [&_hr]:border-current/20",
1000
- "whitespace-normal"
984
+ var SPACE = "0.5rem";
985
+ var mdStyle = { lineHeight: 1.6 };
986
+ var MdP = ({ children }) => /* @__PURE__ */ jsx("p", { style: { margin: `${SPACE} 0` }, children });
987
+ var MdUl = ({ children }) => /* @__PURE__ */ jsx("ul", { style: { margin: `${SPACE} 0`, paddingLeft: "1.25rem", listStyle: "disc" }, children });
988
+ var MdOl = ({ children }) => /* @__PURE__ */ jsx(
989
+ "ol",
990
+ {
991
+ style: { margin: `${SPACE} 0`, paddingLeft: "1.25rem", listStyle: "decimal" },
992
+ children
993
+ }
994
+ );
995
+ var MdLi = ({ children }) => /* @__PURE__ */ jsx("li", { style: { margin: "0.2rem 0" }, children });
996
+ var mkHeading = (level, fontSize) => ({ children }) => {
997
+ const Tag = `h${level}`;
998
+ return /* @__PURE__ */ jsx(Tag, { style: { margin: `${SPACE} 0 0.25rem`, fontSize, fontWeight: 600 }, children });
999
+ };
1000
+ var MdBlockquote = ({ children }) => /* @__PURE__ */ jsx(
1001
+ "blockquote",
1002
+ {
1003
+ style: {
1004
+ margin: `${SPACE} 0`,
1005
+ paddingLeft: "0.75rem",
1006
+ borderLeft: "2px solid currentColor",
1007
+ opacity: 0.85
1008
+ },
1009
+ children
1010
+ }
1001
1011
  );
1012
+ var MARKDOWN_OVERRIDES = {
1013
+ p: MdP,
1014
+ ul: MdUl,
1015
+ ol: MdOl,
1016
+ li: MdLi,
1017
+ h1: mkHeading(1, "1rem"),
1018
+ h2: mkHeading(2, "0.95rem"),
1019
+ h3: mkHeading(3, "0.9rem"),
1020
+ blockquote: MdBlockquote
1021
+ };
1002
1022
  function MessageContent({
1003
1023
  children,
1004
1024
  className,
1005
1025
  markdown = true
1006
1026
  }) {
1007
1027
  if (markdown && typeof children === "string") {
1008
- return /* @__PURE__ */ jsx(Markdown, { className: cn(PROSE_CLASSES, className), children });
1028
+ return /* @__PURE__ */ jsx(
1029
+ Markdown,
1030
+ {
1031
+ className: cn(
1032
+ "text-sm [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
1033
+ className
1034
+ ),
1035
+ overrides: MARKDOWN_OVERRIDES,
1036
+ children
1037
+ }
1038
+ );
1009
1039
  }
1010
- return /* @__PURE__ */ jsx("div", { className: cn("text-sm leading-relaxed whitespace-pre-wrap", className), children });
1040
+ return /* @__PURE__ */ jsx(
1041
+ "div",
1042
+ {
1043
+ className: cn("text-sm leading-relaxed whitespace-pre-wrap", className),
1044
+ style: mdStyle,
1045
+ children
1046
+ }
1047
+ );
1011
1048
  }
1012
1049
  function MessageContainer({ role, children, className }) {
1013
1050
  return /* @__PURE__ */ jsx(