diff --git a/sparkle/package-lock.json b/sparkle/package-lock.json index ef85ae7573b1..b2f1443c06dc 100644 --- a/sparkle/package-lock.json +++ b/sparkle/package-lock.json @@ -1,12 +1,12 @@ { "name": "@dust-tt/sparkle", - "version": "0.2.352", + "version": "0.2.353", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@dust-tt/sparkle", - "version": "0.2.352", + "version": "0.2.353", "license": "ISC", "dependencies": { "@emoji-mart/data": "^1.1.2", diff --git a/sparkle/package.json b/sparkle/package.json index 5201a738d6b4..9836d9d8fb1a 100644 --- a/sparkle/package.json +++ b/sparkle/package.json @@ -1,6 +1,6 @@ { "name": "@dust-tt/sparkle", - "version": "0.2.352", + "version": "0.2.353", "scripts": { "build": "rm -rf dist && npm run tailwind && npm run build:esm && npm run build:cjs", "tailwind": "tailwindcss -i ./src/styles/tailwind.css -o dist/sparkle.css", diff --git a/sparkle/src/components/markdown/CodeBlock.tsx b/sparkle/src/components/markdown/CodeBlock.tsx index babac73234e9..34f489984ca2 100644 --- a/sparkle/src/components/markdown/CodeBlock.tsx +++ b/sparkle/src/components/markdown/CodeBlock.tsx @@ -125,12 +125,13 @@ export function CodeBlock({ style={codeStyle} language={languageToUse} PreTag="div" + className="s-cursor-text" > {String(children).replace(/\n$/, "")} ) : ( - + {children} ); diff --git a/sparkle/src/components/markdown/CodeBlockWithExtendedSupport.tsx b/sparkle/src/components/markdown/CodeBlockWithExtendedSupport.tsx index c46d97a49a5e..1879aae2660c 100644 --- a/sparkle/src/components/markdown/CodeBlockWithExtendedSupport.tsx +++ b/sparkle/src/components/markdown/CodeBlockWithExtendedSupport.tsx @@ -104,8 +104,15 @@ const mermaidStyles = ` /* Base diagram styles */ .mermaid { background: ${palette.slate[50]}; + cursor: default; } - + + .mermaid text, + .mermaid .nodeLabel, + .mermaid .edgeLabel, + .mermaid .label { + cursor: text; + /* Cluster styles */ .mermaid .cluster rect { rx: 8px; diff --git a/sparkle/src/components/markdown/ContentBlockWrapper.tsx b/sparkle/src/components/markdown/ContentBlockWrapper.tsx index 3edffe4cb38b..d4e2e8f1a296 100644 --- a/sparkle/src/components/markdown/ContentBlockWrapper.tsx +++ b/sparkle/src/components/markdown/ContentBlockWrapper.tsx @@ -47,11 +47,11 @@ export function ContentBlockWrapper({ getContentToDownload, }: ContentBlockWrapperProps) { const [isCopied, copyToClipboard] = useCopyToClipboard(); + const handleCopyToClipboard = useCallback(() => { if (!content) { return; } - const rawContent: ClipboardContent = typeof content === "string" ? { "text/plain": content } : content; @@ -79,9 +79,7 @@ export function ContentBlockWrapper({ if (!getContentToDownload) { return; } - const { content, filename, type } = await getContentToDownload(); - const blob = new Blob([content], { type }); const url = URL.createObjectURL(blob); const a = document.createElement("a"); @@ -101,7 +99,7 @@ export function ContentBlockWrapper({
{actions && actions} {getContentToDownload && ( @@ -124,9 +122,7 @@ export function ContentBlockWrapper({ )}
-
- {children} -
+
{children}
); }