diff --git a/CHANGELOG.md b/CHANGELOG.md index fe7ed55796..6126dedb9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). Nothing is unreleased! +## [0.7.603] - 2023-11-15 + +### Fixed + +- Markdown links special characters are no longer encoded +- Collapsed messages no longer make the chat scroll +- Stringified Python objects are now displayed in a Python code block + ## [0.7.602] - 2023-11-14 ### Added diff --git a/backend/chainlit/message.py b/backend/chainlit/message.py index 4dcade7152..632d167d3a 100644 --- a/backend/chainlit/message.py +++ b/backend/chainlit/message.py @@ -200,10 +200,12 @@ def __init__( self.language = "json" except TypeError: self.content = str(content) + self.language = "python" elif isinstance(content, str): self.content = content else: self.content = str(content) + self.language = "python" if id: self.id = str(id) diff --git a/backend/pyproject.toml b/backend/pyproject.toml index 8a0b219a56..3712a8ea11 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "chainlit" -version = "0.7.602" +version = "0.7.603" keywords = ['LLM', 'Agents', 'gen ai', 'chat ui', 'chatbot ui', 'langchain'] description = "A faster way to build chatbot UIs." authors = ["Chainlit"] diff --git a/libs/components/package.json b/libs/components/package.json index a89a10a608..0228d4cd1a 100644 --- a/libs/components/package.json +++ b/libs/components/package.json @@ -1,7 +1,7 @@ { "name": "@chainlit/components", "description": "Reusable components of the Chainlit UI.", - "version": "0.1.0", + "version": "0.1.1", "scripts": { "build": "tsup src/index.ts --clean --format esm,cjs --dts --external react --legacy-output --minify --sourcemap --treeshake", "build:watch": "tsup src/index.ts --watch --clean --format esm,cjs --dts --external react --legacy-output --minify --sourcemap --treeshake", @@ -70,7 +70,7 @@ "plotly.js": "^2.27.0", "react-dropzone": "^14.2.3", "react-file-icon": "^1.3.0", - "react-markdown": "^9.0.0", + "react-markdown": "^9.0.1", "react-password-checklist": "^1.5.0", "react-plotly.js": "^2.6.0", "react-resizable": "^3.0.5", diff --git a/libs/components/pnpm-lock.yaml b/libs/components/pnpm-lock.yaml index 1a98a6bb1b..e3995ce971 100644 --- a/libs/components/pnpm-lock.yaml +++ b/libs/components/pnpm-lock.yaml @@ -54,8 +54,8 @@ dependencies: specifier: ^1.3.0 version: 1.3.0(react-dom@18.2.0)(react@18.2.0) react-markdown: - specifier: ^9.0.0 - version: 9.0.0(@types/react@18.2.0)(react@18.2.0) + specifier: ^9.0.1 + version: 9.0.1(@types/react@18.2.0)(react@18.2.0) react-password-checklist: specifier: ^1.5.0 version: 1.5.0(react@18.2.0) @@ -4767,8 +4767,8 @@ packages: /react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} - /react-markdown@9.0.0(@types/react@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-v6yNf3AB8GfJ8lCpUvzxAXKxgsHpdmWPlcVRQ6Nocsezp255E/IDrF31kLQsPJeB/cKto/geUwjU36wH784FCA==} + /react-markdown@9.0.1(@types/react@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-186Gw/vF1uRkydbsOIkcGXw7aHq0sZOCRFFjGrr7b9+nVZg4UfA4enXCaxm4fUzecU38sWfrNDitGhshuU7rdg==} peerDependencies: '@types/react': '>=18' react: '>=18' @@ -4779,7 +4779,6 @@ packages: hast-util-to-jsx-runtime: 2.2.0 html-url-attributes: 3.0.0 mdast-util-to-hast: 13.0.2 - micromark-util-sanitize-uri: 2.0.0 react: 18.2.0 remark-parse: 11.0.0 remark-rehype: 11.0.0 diff --git a/libs/components/src/Collapse.tsx b/libs/components/src/Collapse.tsx index f495135024..f89d3690ba 100644 --- a/libs/components/src/Collapse.tsx +++ b/libs/components/src/Collapse.tsx @@ -22,10 +22,24 @@ const Collapse = ({ }: CollapseProps): JSX.Element => { const [expandAll, toggleExpandAll] = useToggle(defaultExpandAll); + const content = ( + + + {children} + + + ); + return ( - {children} + {content} @@ -34,7 +48,7 @@ const Collapse = ({ - + diff --git a/libs/components/src/messages/Message.tsx b/libs/components/src/messages/Message.tsx index 2f9ae709bb..d989eeb4fc 100644 --- a/libs/components/src/messages/Message.tsx +++ b/libs/components/src/messages/Message.tsx @@ -97,7 +97,13 @@ const Message = memo( }} > - + - + {preparedContent ? content : null}