@dust-tt/sparkle 0.7.7 → 0.7.8-rc-2

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.
Files changed (87) hide show
  1. package/dist/esm/components/markdownWithStreamingAnimation/BlockquoteBlock.d.ts +15 -0
  2. package/dist/esm/components/markdownWithStreamingAnimation/BlockquoteBlock.d.ts.map +1 -0
  3. package/dist/esm/components/markdownWithStreamingAnimation/BlockquoteBlock.js +46 -0
  4. package/dist/esm/components/markdownWithStreamingAnimation/BlockquoteBlock.js.map +1 -0
  5. package/dist/esm/components/markdownWithStreamingAnimation/CodeBlock.d.ts +18 -0
  6. package/dist/esm/components/markdownWithStreamingAnimation/CodeBlock.d.ts.map +1 -0
  7. package/dist/esm/components/markdownWithStreamingAnimation/CodeBlock.js +143 -0
  8. package/dist/esm/components/markdownWithStreamingAnimation/CodeBlock.js.map +1 -0
  9. package/dist/esm/components/markdownWithStreamingAnimation/CodeBlockWithExtendedSupport.d.ts +13 -0
  10. package/dist/esm/components/markdownWithStreamingAnimation/CodeBlockWithExtendedSupport.d.ts.map +1 -0
  11. package/dist/esm/components/markdownWithStreamingAnimation/CodeBlockWithExtendedSupport.js +336 -0
  12. package/dist/esm/components/markdownWithStreamingAnimation/CodeBlockWithExtendedSupport.js.map +1 -0
  13. package/dist/esm/components/markdownWithStreamingAnimation/ContentBlockWrapper.d.ts +25 -0
  14. package/dist/esm/components/markdownWithStreamingAnimation/ContentBlockWrapper.d.ts.map +1 -0
  15. package/dist/esm/components/markdownWithStreamingAnimation/ContentBlockWrapper.js +92 -0
  16. package/dist/esm/components/markdownWithStreamingAnimation/ContentBlockWrapper.js.map +1 -0
  17. package/dist/esm/components/markdownWithStreamingAnimation/List.d.ts +30 -0
  18. package/dist/esm/components/markdownWithStreamingAnimation/List.d.ts.map +1 -0
  19. package/dist/esm/components/markdownWithStreamingAnimation/List.js +34 -0
  20. package/dist/esm/components/markdownWithStreamingAnimation/List.js.map +1 -0
  21. package/dist/esm/components/markdownWithStreamingAnimation/Markdown.d.ts +23 -0
  22. package/dist/esm/components/markdownWithStreamingAnimation/Markdown.d.ts.map +1 -0
  23. package/dist/esm/components/markdownWithStreamingAnimation/Markdown.js +172 -0
  24. package/dist/esm/components/markdownWithStreamingAnimation/Markdown.js.map +1 -0
  25. package/dist/esm/components/markdownWithStreamingAnimation/MarkdownContentContext.d.ts +7 -0
  26. package/dist/esm/components/markdownWithStreamingAnimation/MarkdownContentContext.d.ts.map +1 -0
  27. package/dist/esm/components/markdownWithStreamingAnimation/MarkdownContentContext.js +7 -0
  28. package/dist/esm/components/markdownWithStreamingAnimation/MarkdownContentContext.js.map +1 -0
  29. package/dist/esm/components/markdownWithStreamingAnimation/ParagraphBlock.d.ts +15 -0
  30. package/dist/esm/components/markdownWithStreamingAnimation/ParagraphBlock.d.ts.map +1 -0
  31. package/dist/esm/components/markdownWithStreamingAnimation/ParagraphBlock.js +24 -0
  32. package/dist/esm/components/markdownWithStreamingAnimation/ParagraphBlock.js.map +1 -0
  33. package/dist/esm/components/markdownWithStreamingAnimation/PreBlock.d.ts +13 -0
  34. package/dist/esm/components/markdownWithStreamingAnimation/PreBlock.d.ts.map +1 -0
  35. package/dist/esm/components/markdownWithStreamingAnimation/PreBlock.js +31 -0
  36. package/dist/esm/components/markdownWithStreamingAnimation/PreBlock.js.map +1 -0
  37. package/dist/esm/components/markdownWithStreamingAnimation/PrettyJsonViewer.d.ts +11 -0
  38. package/dist/esm/components/markdownWithStreamingAnimation/PrettyJsonViewer.d.ts.map +1 -0
  39. package/dist/esm/components/markdownWithStreamingAnimation/PrettyJsonViewer.js +159 -0
  40. package/dist/esm/components/markdownWithStreamingAnimation/PrettyJsonViewer.js.map +1 -0
  41. package/dist/esm/components/markdownWithStreamingAnimation/TableBlock.d.ts +29 -0
  42. package/dist/esm/components/markdownWithStreamingAnimation/TableBlock.d.ts.map +1 -0
  43. package/dist/esm/components/markdownWithStreamingAnimation/TableBlock.js +91 -0
  44. package/dist/esm/components/markdownWithStreamingAnimation/TableBlock.js.map +1 -0
  45. package/dist/esm/components/markdownWithStreamingAnimation/index.d.ts +9 -0
  46. package/dist/esm/components/markdownWithStreamingAnimation/index.d.ts.map +1 -0
  47. package/dist/esm/components/markdownWithStreamingAnimation/index.js +9 -0
  48. package/dist/esm/components/markdownWithStreamingAnimation/index.js.map +1 -0
  49. package/dist/esm/components/markdownWithStreamingAnimation/safeRehypeKatex.d.ts +18 -0
  50. package/dist/esm/components/markdownWithStreamingAnimation/safeRehypeKatex.d.ts.map +1 -0
  51. package/dist/esm/components/markdownWithStreamingAnimation/safeRehypeKatex.js +20 -0
  52. package/dist/esm/components/markdownWithStreamingAnimation/safeRehypeKatex.js.map +1 -0
  53. package/dist/esm/components/markdownWithStreamingAnimation/styles.d.ts +22 -0
  54. package/dist/esm/components/markdownWithStreamingAnimation/styles.d.ts.map +1 -0
  55. package/dist/esm/components/markdownWithStreamingAnimation/styles.js +18 -0
  56. package/dist/esm/components/markdownWithStreamingAnimation/styles.js.map +1 -0
  57. package/dist/esm/components/markdownWithStreamingAnimation/types.d.ts +13 -0
  58. package/dist/esm/components/markdownWithStreamingAnimation/types.d.ts.map +1 -0
  59. package/dist/esm/components/markdownWithStreamingAnimation/types.js +2 -0
  60. package/dist/esm/components/markdownWithStreamingAnimation/types.js.map +1 -0
  61. package/dist/esm/components/markdownWithStreamingAnimation/useAnimatedText.d.ts +2 -0
  62. package/dist/esm/components/markdownWithStreamingAnimation/useAnimatedText.d.ts.map +1 -0
  63. package/dist/esm/components/markdownWithStreamingAnimation/useAnimatedText.js +31 -0
  64. package/dist/esm/components/markdownWithStreamingAnimation/useAnimatedText.js.map +1 -0
  65. package/dist/esm/components/markdownWithStreamingAnimation/utils.d.ts +31 -0
  66. package/dist/esm/components/markdownWithStreamingAnimation/utils.d.ts.map +1 -0
  67. package/dist/esm/components/markdownWithStreamingAnimation/utils.js +108 -0
  68. package/dist/esm/components/markdownWithStreamingAnimation/utils.js.map +1 -0
  69. package/dist/esm/lottie/spinnerLight.d.ts +30 -30
  70. package/package.json +2 -1
  71. package/src/components/markdownWithStreamingAnimation/BlockquoteBlock.tsx +86 -0
  72. package/src/components/markdownWithStreamingAnimation/CodeBlock.tsx +190 -0
  73. package/src/components/markdownWithStreamingAnimation/CodeBlockWithExtendedSupport.tsx +489 -0
  74. package/src/components/markdownWithStreamingAnimation/ContentBlockWrapper.tsx +186 -0
  75. package/src/components/markdownWithStreamingAnimation/List.tsx +95 -0
  76. package/src/components/markdownWithStreamingAnimation/Markdown.tsx +557 -0
  77. package/src/components/markdownWithStreamingAnimation/MarkdownContentContext.tsx +11 -0
  78. package/src/components/markdownWithStreamingAnimation/ParagraphBlock.tsx +60 -0
  79. package/src/components/markdownWithStreamingAnimation/PreBlock.tsx +55 -0
  80. package/src/components/markdownWithStreamingAnimation/PrettyJsonViewer.tsx +417 -0
  81. package/src/components/markdownWithStreamingAnimation/TableBlock.tsx +196 -0
  82. package/src/components/markdownWithStreamingAnimation/index.ts +8 -0
  83. package/src/components/markdownWithStreamingAnimation/safeRehypeKatex.ts +36 -0
  84. package/src/components/markdownWithStreamingAnimation/styles.ts +25 -0
  85. package/src/components/markdownWithStreamingAnimation/types.ts +5 -0
  86. package/src/components/markdownWithStreamingAnimation/useAnimatedText.tsx +37 -0
  87. package/src/components/markdownWithStreamingAnimation/utils.ts +130 -0
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import type { ReactMarkdownProps } from "react-markdown/lib/ast-to-react";
3
+ export declare const blockquoteVariants: (props?: ({
4
+ variant?: "surface" | null | undefined;
5
+ buttonDisplay?: "inside" | "outside" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ interface BlockquoteBlockProps extends Omit<ReactMarkdownProps, "children" | "node"> {
8
+ children: React.ReactNode;
9
+ variant?: "surface";
10
+ buttonDisplay?: "inside" | "outside" | null;
11
+ node?: ReactMarkdownProps["node"];
12
+ }
13
+ export declare const MemoBlockquoteBlock: React.NamedExoticComponent<BlockquoteBlockProps>;
14
+ export {};
15
+ //# sourceMappingURL=BlockquoteBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockquoteBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/markdownWithStreamingAnimation/BlockquoteBlock.tsx"],"names":[],"mappings":"AACA,OAAO,KAAe,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAK1E,eAAO,MAAM,kBAAkB;;;8EAsB9B,CAAC;AAEF,UAAU,oBAAqB,SAAQ,IAAI,CACzC,kBAAkB,EAClB,UAAU,GAAG,MAAM,CACpB;IACC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC;IAC5C,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;CACnC;AAED,eAAO,MAAM,mBAAmB,kDA0C/B,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { cva } from "class-variance-authority";
2
+ import React, { memo } from "react";
3
+ import { ContentBlockWrapper } from "../../components";
4
+ import { sameNodePosition } from "../../components/markdownWithStreamingAnimation/utils";
5
+ export const blockquoteVariants = cva([
6
+ "s-w-full s-text-base s-italic s-p-3",
7
+ "s-relative",
8
+ "before:s-content-[''] before:s-absolute before:s-left-0 before:s-top-3 before:s-bottom-3",
9
+ "before:s-w-1 before:s-bg-faint dark:before:s-bg-faint-night",
10
+ "before:s-rounded-full",
11
+ ], {
12
+ variants: {
13
+ variant: {
14
+ surface: [
15
+ "s-text-foreground dark:s-text-foreground-night",
16
+ "s-bg-transparent",
17
+ ],
18
+ },
19
+ buttonDisplay: {
20
+ inside: ["s-pr-12"],
21
+ outside: [],
22
+ },
23
+ },
24
+ });
25
+ export const MemoBlockquoteBlock = memo(({ children, variant = "surface", buttonDisplay = "inside", node: _node, }) => {
26
+ const elementAt1 = React.Children.toArray(children)[1];
27
+ const childrenContent = elementAt1 && React.isValidElement(elementAt1)
28
+ ? elementAt1.props.children
29
+ : null;
30
+ // Convert array content to string if necessary
31
+ const contentAsString = Array.isArray(childrenContent)
32
+ ? childrenContent.filter((c) => typeof c === "string").join("")
33
+ : childrenContent;
34
+ // Only pass content if it exists
35
+ const clipboardContent = contentAsString
36
+ ? { "text/plain": contentAsString }
37
+ : undefined;
38
+ return (React.createElement(ContentBlockWrapper, { content: clipboardContent, className: "s-my-2", buttonDisplay: buttonDisplay },
39
+ React.createElement("blockquote", { className: blockquoteVariants({ variant, buttonDisplay }) }, children)));
40
+ }, (prev, next) => {
41
+ return (sameNodePosition(prev.node, next.node) &&
42
+ prev.variant === next.variant &&
43
+ prev.buttonDisplay === next.buttonDisplay);
44
+ });
45
+ MemoBlockquoteBlock.displayName = "MemoBlockquoteBlock";
46
+ //# sourceMappingURL=BlockquoteBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockquoteBlock.js","sourceRoot":"","sources":["../../../../src/components/markdownWithStreamingAnimation/BlockquoteBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAGpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AAE5F,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CACnC;IACE,qCAAqC;IACrC,YAAY;IACZ,0FAA0F;IAC1F,6DAA6D;IAC7D,uBAAuB;CACxB,EACD;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,gDAAgD;gBAChD,kBAAkB;aACnB;SACF;QACD,aAAa,EAAE;YACb,MAAM,EAAE,CAAC,SAAS,CAAC;YACnB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O;QAC7B,IAAI,CAAC,aAAa,KAAK,IAAI,CAAC,aAAa,CAC1C,CAAC;AAAA,CACH,CACF,CAAC;AAEF,mBAAmB,CAAC,WAAW,GAAG,qBAAqB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ export declare const codeInlineVariants: (props?: ({
3
+ variant?: "surface" | null | undefined;
4
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
5
+ export declare const codeBlockVariants: (props?: ({
6
+ variant?: "surface" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ type CodeBlockProps = {
9
+ children?: React.ReactNode;
10
+ className?: string;
11
+ inline?: boolean;
12
+ variant?: "surface";
13
+ wrapLongLines?: boolean;
14
+ showLineNumber?: boolean;
15
+ };
16
+ export declare function CodeBlock({ children, className, inline, variant, wrapLongLines, showLineNumber }: CodeBlockProps): JSX.Element;
17
+ export {};
18
+ //# sourceMappingURL=CodeBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../../../src/components/markdownWithStreamingAnimation/CodeBlock.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AASxC,eAAO,MAAM,kBAAkB;;8EAiB9B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;8EAgB7B,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAmB,EACnB,aAAqB,EACrB,cAAsB,EACvB,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CA8H9B"}
@@ -0,0 +1,143 @@
1
+ import { cva } from "class-variance-authority";
2
+ import React, { Suspense } from "react";
3
+ import { violet } from "tailwindcss/colors";
4
+ import { customColors } from "../../lib/colors";
5
+ const SyntaxHighlighter = React.lazy(() => import("react-syntax-highlighter/dist/esm/default-highlight"));
6
+ export const codeInlineVariants = cva([
7
+ "s-mx-0.5 s-my-0.5 s-cursor-text s-rounded-md s-border s-px-1 s-py-0.5",
8
+ "s-border-border dark:s-border-border-night",
9
+ "s-text-[0.90em]",
10
+ "s-text-golden-600 dark:s-text-golden-600-night",
11
+ ], {
12
+ variants: {
13
+ variant: {
14
+ surface: ["s-bg-muted/70 dark:s-bg-muted-night/70"],
15
+ },
16
+ },
17
+ defaultVariants: {
18
+ variant: "surface",
19
+ },
20
+ });
21
+ export const codeBlockVariants = cva([
22
+ "s-mx-0.5 s-my-0.5 s-cursor-text s-rounded-md s-border s-p-2",
23
+ "s-border-border dark:s-border-border-night",
24
+ "s-text-[0.90em]",
25
+ ], {
26
+ variants: {
27
+ variant: {
28
+ surface: ["s-bg-muted/70 dark:s-bg-muted-night/70"],
29
+ },
30
+ },
31
+ defaultVariants: {
32
+ variant: "surface",
33
+ },
34
+ });
35
+ export function CodeBlock({ children, className, inline, variant = "surface", wrapLongLines = false, showLineNumber = false, }) {
36
+ const match = /language-(\w+)/.exec(className || "");
37
+ const language = match ? match[1] : "text";
38
+ const languageOverrides = {
39
+ jsx: "javascript",
40
+ tsx: "typescript",
41
+ py: "python",
42
+ };
43
+ const languageToUse = languageOverrides[language] || language;
44
+ const codeStyle = {
45
+ hljs: {
46
+ display: "block",
47
+ overflowX: "auto",
48
+ padding: "1em",
49
+ color: "var(--s-foreground)",
50
+ backgroundColor: "transparent",
51
+ fontSize: "0.875rem",
52
+ },
53
+ "hljs-ln": {
54
+ color: "var(--s-muted-foreground)",
55
+ fontSize: "0.75rem",
56
+ paddingRight: "1em",
57
+ textAlign: "right",
58
+ userSelect: "none",
59
+ },
60
+ "hljs-keyword": {
61
+ // function, const, let, if, return
62
+ color: violet[500],
63
+ },
64
+ "hljs-function": {
65
+ color: customColors.blue[600],
66
+ },
67
+ "hljs-title": {
68
+ // Function names
69
+ color: customColors.blue[600],
70
+ },
71
+ "hljs-built_in": {
72
+ // document, console, Date
73
+ color: customColors.golden[500],
74
+ },
75
+ "hljs-string": {
76
+ // Regular strings
77
+ color: customColors.green[500],
78
+ },
79
+ "hljs-variable": {
80
+ // Regular variables
81
+ color: "var(--s-foreground)",
82
+ },
83
+ "hljs-literal": {
84
+ // true, false, null
85
+ color: customColors.golden[500],
86
+ },
87
+ "hljs-number": {
88
+ // Numeric values
89
+ color: customColors.golden[500],
90
+ },
91
+ "hljs-comment": {
92
+ // Comments
93
+ color: customColors.golden[700],
94
+ },
95
+ "hljs-template-variable": {
96
+ // Template literal variables ${...}
97
+ color: customColors.rose[500],
98
+ },
99
+ "hljs-property": {
100
+ // Object properties
101
+ color: "var(--s-foreground)",
102
+ },
103
+ "hljs-punctuation": {
104
+ // Brackets, dots, etc
105
+ color: "var(--s-foreground)",
106
+ },
107
+ "hljs-operator": {
108
+ // =, +, -, etc
109
+ color: violet[500],
110
+ },
111
+ "hljs-method": {
112
+ // Method calls
113
+ color: customColors.blue[600],
114
+ },
115
+ "hljs-tag": {
116
+ // HTML tags
117
+ color: customColors.rose[500],
118
+ },
119
+ "hljs-name": {
120
+ // Tag names
121
+ color: customColors.rose[500],
122
+ },
123
+ "hljs-attr": {
124
+ // HTML attributes
125
+ color: customColors.golden[500],
126
+ },
127
+ "hljs-params": {
128
+ // Function parameters
129
+ color: "var(--s-foreground)",
130
+ },
131
+ // Typography styles
132
+ "hljs-emphasis": {
133
+ fontStyle: "italic",
134
+ },
135
+ "hljs-strong": {
136
+ fontWeight: "bold",
137
+ },
138
+ };
139
+ return !inline ? (React.createElement(Suspense, { fallback: React.createElement("div", null) },
140
+ React.createElement("div", { className: "s-text-foreground dark:s-text-foreground-night" },
141
+ React.createElement(SyntaxHighlighter, { wrapLongLines: wrapLongLines, showLineNumbers: showLineNumber, style: codeStyle, language: languageToUse, PreTag: "div", className: "s-cursor-text" }, String(children).replace(/\n$/, ""))))) : (React.createElement("code", { className: codeInlineVariants({ variant }) }, children));
142
+ }
143
+ //# sourceMappingURL=CodeBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeBlock.js","sourceRoot":"","sources":["../../../../src/components/markdownWithStreamingAnimation/CodeBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,iBAAiB,GAAG,KAAK,CAAC,IAAI,CAClC,GAAG,EAAE,CAAC,MAAM,CAAC,qDAAqD,CAAC,CACpE,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CACnC;IACE,uEAAuE;IACvE,4CAA4C;IAC5C,iBAAiB;IACjB,gDAAgD;CACjD,EACD;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,CAAC,wCAAwC,CAAC;SACpD;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;KACnB;CACF,CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAClC;IACE,6DAA6D;IAC7D,4CAA4C;IAC5C,iBAAiB;CAClB,EACD;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,CAAC,wCAAwC,CAAC;SACpD;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;KACnB;CACF,CACF,CAAC;AAWF,MAAM,UAAU,SAAS,CAAC,EACxB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,GAA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AAO;QACzB,6BAAK,SAAS,EAAC,gDAAgD;YAC7D,oBAAC,iBAAiB,IAChB,aAAa,EAAE,aAAa,EAC5B,eAAe,EAAE,cAAc,EAC/B,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAC,KAAK,EACZ,SAAS,EAAC,eAAe,IAExB,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAClB,CAChB,CACG,CACZ,CAAC,CAAC,CAAC,CACF,8BAAM,SAAS,EAAE,kBAAkB,CAAC,EAAE,OAAO,EAAE,CAAC,IAAG,QAAQ,CAAQ,CACpE,CAAC;AAAA,CACH"}
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import type { MarkdownNode } from "../../components/markdownWithStreamingAnimation/types";
3
+ export declare function StyledMermaidGraph({ children, className }: {
4
+ children?: React.ReactNode;
5
+ className?: string;
6
+ }): React.JSX.Element;
7
+ export declare const MemoCodeBlockWithExtendedSupport: React.MemoExoticComponent<({ children, className, inline, node: _node, }: {
8
+ children?: React.ReactNode;
9
+ className?: string | undefined;
10
+ inline?: boolean | undefined;
11
+ node?: MarkdownNode | undefined;
12
+ }) => React.JSX.Element>;
13
+ //# sourceMappingURL=CodeBlockWithExtendedSupport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeBlockWithExtendedSupport.d.ts","sourceRoot":"","sources":["../../../../src/components/markdownWithStreamingAnimation/CodeBlockWithExtendedSupport.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwD,MAAM,OAAO,CAAC;AA0B7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0DAA0D,CAAC;AA0R7F,wBAAgB,kBAAkB,CAAC,EACjC,QAAQ,EACR,SAAS,EACV,EAAE;IACD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,qBAQA;AAED,eAAO,MAAM,gCAAgC;;;;;wBAiK5C,CAAC"}
@@ -0,0 +1,336 @@
1
+ import React, { memo, useContext, useEffect, useRef, useState } from "react";
2
+ import { amber, blue, gray, green, indigo, purple, red, rose, sky, violet, yellow, } from "tailwindcss/colors";
3
+ import { Button, ContentBlockWrapper, } from "../../components";
4
+ import { CodeBlock } from "../../components/markdown/CodeBlock";
5
+ import { MarkdownContentContext } from "../../components/markdown/MarkdownContentContext";
6
+ import { PrettyJsonViewer, } from "../../components/markdown/PrettyJsonViewer";
7
+ import { sameNodePosition } from "../../components/markdownWithStreamingAnimation/utils";
8
+ import { CommandLineIcon, SparklesIcon } from "../../icons/app";
9
+ import { cn } from "../../lib/utils";
10
+ const PRETTY_JSON_PREFERENCE_KEY = "pretty-json-preference";
11
+ // Persist user's JSON display preference (raw vs pretty) in localStorage.
12
+ // Only affects newly rendered JSON blocks, not existing ones on the page.
13
+ const getPrettyJsonPreference = () => {
14
+ if (typeof window === "undefined") {
15
+ return false;
16
+ }
17
+ try {
18
+ const prettyJsonPreference = localStorage.getItem(PRETTY_JSON_PREFERENCE_KEY);
19
+ // Default to Pretty view when preference is not yet set.
20
+ if (prettyJsonPreference === null) {
21
+ return true;
22
+ }
23
+ return prettyJsonPreference === "true";
24
+ }
25
+ catch (_a) {
26
+ // If localStorage is unavailable, default to Pretty view.
27
+ return true;
28
+ }
29
+ };
30
+ const setPrettyJsonPreference = (value) => {
31
+ if (typeof window === "undefined") {
32
+ return;
33
+ }
34
+ try {
35
+ localStorage.setItem(PRETTY_JSON_PREFERENCE_KEY, String(value));
36
+ }
37
+ catch (_a) {
38
+ // do nothing
39
+ }
40
+ };
41
+ // Helper function to ensure we get hex values
42
+ const toHex = (color) => {
43
+ if (color.startsWith("#")) {
44
+ return color;
45
+ }
46
+ // For handling rgb/rgba values if they exist
47
+ if (color.startsWith("rgb")) {
48
+ const matches = color.match(/\d+/g);
49
+ if (matches && matches.length >= 3) {
50
+ const [r, g, b] = matches.map(Number);
51
+ return `#${[r, g, b].map((x) => x.toString(16).padStart(2, "0")).join("")}`;
52
+ }
53
+ }
54
+ return color;
55
+ };
56
+ const palette = {
57
+ gray: {
58
+ 50: toHex(gray[50]), // background, labelBoxBkgColor, groupBkgColor, edgeLabelBackground
59
+ 100: toHex(gray[100]), // primaryColor
60
+ 200: toHex(gray[200]), // tertiaryBorderColor, clusterBorder, labelBoxBorderColor, groupBorderColor, pieOuterStrokeColor
61
+ 400: toHex(gray[400]), // lineColor, signalColor
62
+ 600: toHex(gray[600]), // tertiaryTextColor, sequenceNumberColor
63
+ 700: toHex(gray[700]), // signalTextColor, labelTextColor, loopTextColor, messageTextColor, groupTextColor, pieSectionTextColor
64
+ 800: toHex(gray[800]), // textColor, titleColor, nodeTextColor, pieTitleTextColor, pieLegendTextColor
65
+ },
66
+ sky: {
67
+ 100: toHex(sky[100]), // primaryColor, nodeBorder, actorBkg, activationBkgColor
68
+ 200: toHex(sky[200]), // actorBorder, activationBorderColor
69
+ 300: toHex(sky[300]), // actorLineColor, pie1
70
+ 800: toHex(sky[800]), // primaryTextColor, nodeTextColor, actorTextColor, defaultLinkColor
71
+ },
72
+ green: {
73
+ 100: toHex(green[100]), // secondaryColor
74
+ 200: toHex(green[200]), // secondaryBorderColor
75
+ 300: toHex(green[300]), // pie3
76
+ 800: toHex(green[800]), // secondaryTextColor
77
+ },
78
+ amber: {
79
+ 50: toHex(amber[50]), // noteBkgColor
80
+ 200: toHex(amber[200]), // noteBorderColor
81
+ 300: toHex(amber[300]), // pie4
82
+ },
83
+ red: {
84
+ 100: toHex(red[100]), // errorBkgColor
85
+ 300: toHex(red[300]), // pie8
86
+ 800: toHex(red[800]), // errorTextColor
87
+ },
88
+ blue: {
89
+ 300: toHex(blue[300]), // pie2
90
+ },
91
+ purple: {
92
+ 400: toHex(purple[400]), // pie5
93
+ },
94
+ yellow: {
95
+ 300: toHex(yellow[300]), // pie7
96
+ },
97
+ rose: {
98
+ 300: toHex(rose[300]), // pie10
99
+ },
100
+ violet: {
101
+ 300: toHex(violet[300]), // pie11
102
+ },
103
+ indigo: {
104
+ 300: toHex(indigo[300]), // pie12
105
+ },
106
+ };
107
+ const mermaidStyles = `
108
+ /* Base diagram styles */
109
+ .mermaid {
110
+ background: ${palette.gray[100]};
111
+ cursor: default;
112
+ }
113
+
114
+ .mermaid text,
115
+ .mermaid .nodeLabel,
116
+ .mermaid .edgeLabel,
117
+ .mermaid .label {
118
+ cursor: text;
119
+
120
+ /* Cluster styles */
121
+ .mermaid .cluster rect {
122
+ rx: 8px;
123
+ ry: 8px;
124
+ stroke-width: 1px;
125
+ fill: ${palette.gray["100"]};
126
+ stroke: ${palette.gray["200"]};
127
+ }
128
+
129
+ /* Section styles */
130
+ .mermaid .section {
131
+ rx: 8px;
132
+ ry: 8px;
133
+ }
134
+
135
+ /* Node styles */
136
+ .mermaid .node rect,
137
+ .mermaid .node circle,
138
+ .mermaid .node ellipse,
139
+ .mermaid .node polygon,
140
+ .mermaid .node path {
141
+ stroke-width: 1px;
142
+ rx: 8px;
143
+ ry: 8px;
144
+ }
145
+ `;
146
+ const MermaidGraph = ({ chart }) => {
147
+ const graphRef = useRef(null);
148
+ useEffect(() => {
149
+ const renderMermaid = async () => {
150
+ if (!graphRef.current) {
151
+ return;
152
+ }
153
+ const mermaid = (await import("mermaid")).default;
154
+ mermaid.initialize({
155
+ startOnLoad: false,
156
+ theme: "base",
157
+ themeVariables: {
158
+ fontFamily: "Geist",
159
+ fontSize: "14px",
160
+ textColor: palette.gray[800],
161
+ primaryColor: palette.sky[100],
162
+ primaryTextColor: palette.sky[800],
163
+ primaryBorderColor: palette.sky[100],
164
+ lineColor: palette.gray[400],
165
+ secondaryColor: palette.green[100],
166
+ secondaryBorderColor: palette.green[200],
167
+ secondaryTextColor: palette.green[800],
168
+ tertiaryColor: "#FFF",
169
+ tertiaryBorderColor: palette.gray[200],
170
+ tertiaryTextColor: palette.gray[600],
171
+ noteBkgColor: palette.amber[50],
172
+ noteTextColor: palette.gray[800],
173
+ errorBkgColor: palette.red[100],
174
+ errorTextColor: palette.red[800],
175
+ // Flowchart specific
176
+ nodeBorder: palette.sky[100],
177
+ clusterBkg: "#FFF",
178
+ clusterBorder: palette.gray[200],
179
+ defaultLinkColor: palette.sky[800],
180
+ titleColor: palette.gray[800],
181
+ edgeLabelBackground: palette.gray[50],
182
+ nodeTextColor: palette.sky[800],
183
+ // Sequence Diagram Variables
184
+ // Actor styling
185
+ actorBkg: palette.sky[100], // Light blue background for actors
186
+ actorBorder: palette.sky[200], // Subtle blue border
187
+ actorTextColor: palette.sky[800], // Dark blue text
188
+ actorLineColor: palette.sky[300], // Subtle grey lines
189
+ // Signal styling
190
+ signalColor: palette.gray["400"], // Medium grey for signals/arrows
191
+ signalTextColor: palette.gray["700"], // Darker grey for signal labels
192
+ // Label box styling
193
+ labelBoxBkgColor: palette.gray["50"], // Very light grey background
194
+ labelBoxBorderColor: palette.gray["200"], // Light grey border
195
+ labelTextColor: palette.gray["700"], // Dark grey text
196
+ // Loop styling
197
+ loopTextColor: palette.gray["700"], // Dark grey for loop text
198
+ // Activation styling (the vertical bars)
199
+ activationBorderColor: palette.sky["200"], // Light blue border
200
+ activationBkgColor: palette.sky[100], // Very light blue background
201
+ // Sequence numbers
202
+ sequenceNumberColor: palette.gray["600"], // Medium grey for numbers
203
+ // Additional sequence-specific colors
204
+ messageBkgColor: "#FFFFFF", // White background for messages
205
+ messageTextColor: palette.gray["700"], // Dark grey for message text
206
+ noteBorderColor: palette.amber["200"], // Light amber for note borders
207
+ // Group styling
208
+ groupBkgColor: palette.gray["50"], // Very light grey for groups
209
+ groupBorderColor: palette.gray["200"], // Light grey for group borders
210
+ groupTextColor: palette.gray["700"], // Dark grey for group text
211
+ // Pie Chart Colors - Using a gradient approach
212
+ pie1: palette.sky["300"],
213
+ pie2: palette.blue["300"],
214
+ pie3: palette.green["300"],
215
+ pie4: palette.amber["300"],
216
+ pie5: palette.purple["400"],
217
+ pie7: palette.yellow["300"],
218
+ pie8: palette.red["300"],
219
+ pie9: palette.green["300"],
220
+ pie10: palette.rose["300"],
221
+ pie11: palette.violet["300"],
222
+ pie12: palette.indigo["300"],
223
+ // Pie Chart Text Styling
224
+ pieTitleTextSize: "16px",
225
+ pieTitleTextColor: palette.gray["800"],
226
+ pieSectionTextSize: "14px",
227
+ pieSectionTextColor: palette.gray["700"],
228
+ pieLegendTextSize: "14px",
229
+ pieLegendTextColor: palette.gray["800"],
230
+ // Pie Chart Stroke Styling
231
+ pieStrokeColor: "#FFFFFF", // White borders between sections
232
+ pieStrokeWidth: "1px",
233
+ pieOuterStrokeWidth: "1px",
234
+ pieOuterStrokeColor: palette.gray["200"],
235
+ pieOpacity: "0.9", // Slight transparency
236
+ },
237
+ flowchart: {
238
+ curve: "basis",
239
+ padding: 20,
240
+ htmlLabels: true,
241
+ useMaxWidth: true,
242
+ },
243
+ });
244
+ graphRef.current.textContent = chart;
245
+ await mermaid.run(undefined);
246
+ };
247
+ void renderMermaid();
248
+ }, [chart]);
249
+ return (React.createElement(React.Fragment, null,
250
+ React.createElement("style", null, mermaidStyles),
251
+ React.createElement("div", { ref: graphRef, className: cn("mermaid", "s-w-full", "s-rounded-2xl s-transition-all s-duration-200") })));
252
+ };
253
+ export function StyledMermaidGraph({ children, className, }) {
254
+ const validChildrenContent = String(children).trim();
255
+ return (React.createElement("div", { className: cn("s-relative", className) },
256
+ React.createElement(MermaidGraph, { chart: validChildrenContent })));
257
+ }
258
+ export const MemoCodeBlockWithExtendedSupport = memo(({ children, className, inline, node: _node, }) => {
259
+ const validChildrenContent = String(children).trim();
260
+ const [showMermaid, setShowMermaid] = useState(false);
261
+ const [isValidMermaid, setIsValidMermaid] = useState(false);
262
+ const [showPrettyJson, setShowPrettyJson] = useState(false);
263
+ const [parsedJson, setParsedJson] = useState(null);
264
+ const { isStreaming } = useContext(MarkdownContentContext);
265
+ // Detect language from className
266
+ const language = className === null || className === void 0 ? void 0 : className.split("-")[1];
267
+ // Only create getContentToDownload when we actually want to enable downloads
268
+ const getContentToDownload = !inline &&
269
+ validChildrenContent &&
270
+ (language === "csv" || language === "json")
271
+ ? async () => ({
272
+ content: validChildrenContent,
273
+ filename: `dust_output_${Date.now()}`,
274
+ type: language === "csv" ? "text/csv" : "application/json",
275
+ })
276
+ : undefined;
277
+ // Check for valid Mermaid and JSON.
278
+ useEffect(() => {
279
+ if (isStreaming || !validChildrenContent) {
280
+ return;
281
+ }
282
+ if (language === "mermaid") {
283
+ const checkValidMermaid = async () => {
284
+ try {
285
+ const mermaid = (await import("mermaid")).default;
286
+ await mermaid.parse(validChildrenContent);
287
+ setIsValidMermaid(true);
288
+ setShowMermaid(true);
289
+ }
290
+ catch (e) {
291
+ setIsValidMermaid(false);
292
+ setShowMermaid(false);
293
+ }
294
+ };
295
+ void checkValidMermaid();
296
+ }
297
+ if (language === "json") {
298
+ try {
299
+ const parsed = JSON.parse(validChildrenContent);
300
+ setParsedJson(parsed);
301
+ const prettyJsonPreference = getPrettyJsonPreference();
302
+ setShowPrettyJson(prettyJsonPreference);
303
+ }
304
+ catch (e) {
305
+ setParsedJson(null);
306
+ setShowPrettyJson(false);
307
+ }
308
+ }
309
+ }, [isStreaming, language, validChildrenContent]);
310
+ if (inline) {
311
+ return (React.createElement(CodeBlock, { className: className, inline: inline }, children));
312
+ }
313
+ if (isValidMermaid) {
314
+ return (React.createElement(ContentBlockWrapper, { content: validChildrenContent, getContentToDownload: getContentToDownload, actions: React.createElement(Button, { className: "s-font-sans", size: "xs", variant: "outline", label: showMermaid ? "Markdown" : "Mermaid", icon: showMermaid ? CommandLineIcon : SparklesIcon, onClick: (e) => {
315
+ e.preventDefault();
316
+ e.stopPropagation();
317
+ setShowMermaid(!showMermaid);
318
+ }, tooltip: showMermaid ? "Switch to Markdown" : "Switch to Mermaid" }) }, showMermaid ? (React.createElement(MermaidGraph, { chart: validChildrenContent })) : (React.createElement(CodeBlock, { className: className, inline: inline }, children))));
319
+ }
320
+ if (parsedJson !== null) {
321
+ return (React.createElement(ContentBlockWrapper, { content: validChildrenContent, getContentToDownload: getContentToDownload, actions: React.createElement(Button, { className: "s-font-sans", size: "xs", variant: "outline", label: showPrettyJson ? "Raw JSON" : "Pretty JSON", icon: showPrettyJson ? CommandLineIcon : SparklesIcon, onClick: (e) => {
322
+ e.preventDefault();
323
+ e.stopPropagation();
324
+ const newValue = !showPrettyJson;
325
+ setShowPrettyJson(newValue);
326
+ setPrettyJsonPreference(newValue);
327
+ }, tooltip: showPrettyJson ? "Switch to Raw JSON" : "Switch to Pretty View" }), displayActions: "hover", buttonDisplay: "inside" }, showPrettyJson ? (React.createElement(PrettyJsonViewer, { data: parsedJson })) : (React.createElement(CodeBlock, { className: className, inline: inline, wrapLongLines: true }, children))));
328
+ }
329
+ return (React.createElement(ContentBlockWrapper, { content: validChildrenContent, getContentToDownload: getContentToDownload, buttonDisplay: "inside", displayActions: "hover" },
330
+ React.createElement(CodeBlock, { className: className, inline: inline }, children)));
331
+ }, (prev, next) => sameNodePosition(prev.node, next.node) &&
332
+ prev.className === next.className &&
333
+ prev.inline === next.inline);
334
+ MemoCodeBlockWithExtendedSupport.displayName =
335
+ "MemoCodeBlockWithExtendedSupport";
336
+ //# sourceMappingURL=CodeBlockWithExtendedSupport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeBlockWithExtendedSupport.js","sourceRoot":"","sources":["../../../../src/components/markdownWithStreamingAnimation/CodeBlockWithExtendedSupport.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,EACL,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,EACL,MAAM,EACN,MAAM,EACN,GAAG,EACH,IAAI,EACJ,GAAG,EACH,MAAM,EACN,MAAM,GACP,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,MAAM,EACN,mBAAmB,GAEpB,MAAM,qBAAqB,CAAC;AAC7B,OA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C,CAAC,CAChB,oBAAC,gBAAgB,IAAC,IAAI,EAAE,UAAU,GAAI,CACvC,CAAC,CAAC,CAAC,CACF,oBAAC,SAAS,IAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,UAC3D,QAAQ,CACC,CACb,CACmB,CACvB,CAAC;IACJ,CAAC;IAED,OAAO,CACL,oBAAC,mBAAmB,IAClB,OAAO,EAAE,oBAAoB,EAC7B,oBAAoB,EAAE,oBAAoB,EAC1C,aAAa,EAAC,QAAQ,EACtB,cAAc,EAAC,OAAO;QAEtB,oBAAC,SAAS,IAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,IAC5C,QAAQ,CACC,CACQ,CACvB,CAAC;AAAA,CACH,EACD,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CACb,gBAAgB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC;IACtC,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS;IACjC,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAC9B,CAAC;AAEF,gCAAgC,CAAC,WAAW;IAC1C,kCAAkC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ export type SupportedContentType = "application/json" | "text/csv";
3
+ export interface ContentToDownload {
4
+ content: string;
5
+ filename: string;
6
+ type: SupportedContentType;
7
+ }
8
+ export type GetContentToDownloadFunction = () => Promise<ContentToDownload>;
9
+ type ClipboardContent = {
10
+ "text/plain"?: string;
11
+ "text/html"?: string;
12
+ };
13
+ interface ContentBlockWrapperProps {
14
+ children: React.ReactNode;
15
+ className?: string;
16
+ innerClassName?: string;
17
+ content?: ClipboardContent | string;
18
+ getContentToDownload?: GetContentToDownloadFunction;
19
+ actions?: React.ReactNode[] | React.ReactNode;
20
+ displayActions?: "hover" | "always";
21
+ buttonDisplay?: "inside" | "outside" | null;
22
+ }
23
+ export declare function ContentBlockWrapper({ children, className, innerClassName, content, actions, displayActions, getContentToDownload, buttonDisplay }: ContentBlockWrapperProps): React.JSX.Element;
24
+ export {};
25
+ //# sourceMappingURL=ContentBlockWrapper.d.ts.map