From ae63373f254cc0f749d9d7f20e50ec621c26b54e Mon Sep 17 00:00:00 2001 From: Yasin Date: Sun, 21 Jan 2024 14:37:42 +0100 Subject: [PATCH 1/5] refactor(chat): update to react-markdown@9 with dependencies --- apps/www/package.json | 15 +- .../www/registry/default/ui/chat/markdown.tsx | 21 +- pnpm-lock.yaml | 699 +++++++++++++++--- 3 files changed, 596 insertions(+), 139 deletions(-) diff --git a/apps/www/package.json b/apps/www/package.json index 95c1415..0e88a4e 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -59,6 +59,7 @@ "lodash.template": "^4.5.0", "lucide-react": "0.214.0", "markdown-wasm": "^1.2.0", + "mdast-util-gfm-table": "2", "next": "13.4.8", "next-contentlayer": "0.3.4", "next-themes": "^0.2.1", @@ -66,18 +67,18 @@ "react-day-picker": "^8.7.1", "react-dom": "^18.2.0", "react-hook-form": "^7.44.2", + "react-markdown": "^9.0.1", + "react-syntax-highlighter": "^15.5.0", "react-wrap-balancer": "^0.4.1", "recharts": "^2.6.2", - "sharp": "^0.31.3", - "tailwind-merge": "^1.12.0", - "vaul": "^0.2.0", - "zod": "^3.21.4", "remark": "^14.0.3", "remark-code-import": "^1.2.0", - "remark-gfm": "^3.0.1", + "remark-gfm": "^4.0.0", "remark-math": "^5.1.1", - "react-markdown": "^8.0.7", - "react-syntax-highlighter": "^15.5.0" + "sharp": "^0.31.3", + "tailwind-merge": "^1.12.0", + "vaul": "^0.2.0", + "zod": "^3.21.4" }, "devDependencies": { "@types/lodash.template": "^4.5.1", diff --git a/apps/www/registry/default/ui/chat/markdown.tsx b/apps/www/registry/default/ui/chat/markdown.tsx index 31b7824..d8689fc 100644 --- a/apps/www/registry/default/ui/chat/markdown.tsx +++ b/apps/www/registry/default/ui/chat/markdown.tsx @@ -21,8 +21,8 @@ export default function Markdown({ content }: { content: string }) { p({ children }) { return

{children}

}, - code({ node, inline, className, children, ...props }) { - if (children.length) { + code({ node, className, children, ...props }) { + if (Array.isArray(children) && children.length) { if (children[0] == "▍") { return ( @@ -32,21 +32,20 @@ export default function Markdown({ content }: { content: string }) { children[0] = (children[0] as string).replace("`▍`", "▍") } + return ( + + {children} + + ) + }, + pre({ node, className, ...props }) { const match = /language-(\w+)/.exec(className || "") - if (inline) { - return ( - - {children} - - ) - } - return ( ) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 091c8a4..268ad73 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -233,6 +233,9 @@ importers: markdown-wasm: specifier: ^1.2.0 version: 1.2.0 + mdast-util-gfm-table: + specifier: '2' + version: 2.0.0 next: specifier: 13.4.8 version: 13.4.8(@babel/core@7.22.1)(@opentelemetry/api@1.4.1)(react-dom@18.2.0)(react@18.2.0) @@ -255,8 +258,8 @@ importers: specifier: ^7.44.2 version: 7.44.2(react@18.2.0) react-markdown: - specifier: ^8.0.7 - version: 8.0.7(@types/react@18.2.7)(react@18.2.0) + specifier: ^9.0.1 + version: 9.0.1(@types/react@18.2.7)(react@18.2.0) react-syntax-highlighter: specifier: ^15.5.0 version: 15.5.0(react@18.2.0) @@ -273,8 +276,8 @@ importers: specifier: ^1.2.0 version: 1.2.0 remark-gfm: - specifier: ^3.0.1 - version: 3.0.1 + specifier: ^4.0.0 + version: 4.0.0 remark-math: specifier: ^5.1.1 version: 5.1.1 @@ -3929,6 +3932,12 @@ packages: dependencies: '@types/unist': 2.0.6 + /@types/hast@3.0.3: + resolution: {integrity: sha512-2fYGlaDy/qyLlhidX42wAH0KBi2TCjKMH8CHmBXgRlJ3Y+OXTiqsPQ6IWarZKwF1JoUcAJdPogv1d4b0COTpmQ==} + dependencies: + '@types/unist': 2.0.6 + dev: false + /@types/is-ci@3.0.0: resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} dependencies: @@ -3974,6 +3983,12 @@ packages: dependencies: '@types/unist': 2.0.6 + /@types/mdast@4.0.3: + resolution: {integrity: sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==} + dependencies: + '@types/unist': 3.0.2 + dev: false + /@types/mdx@2.0.5: resolution: {integrity: sha512-76CqzuD6Q7LC+AtbPqrvD9AqsN0k8bsYo2bM2J8pmNldP1aIPAbzUQ7QbobyXL4eLr1wK5x8FZFe8eF/ubRuBg==} dev: false @@ -4077,6 +4092,10 @@ packages: /@types/unist@2.0.6: resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==} + /@types/unist@3.0.2: + resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==} + dev: false + /@types/yoga-layout@1.9.2: resolution: {integrity: sha512-S9q47ByT2pPvD65IvrWp7qppVMpk9WGMbVq9wbWZOHg6tnXSD4vyhao6nOSBwwfDdV2p3Kx9evA9vI+XWTfDvw==} dev: false @@ -4143,6 +4162,10 @@ packages: eslint-visitor-keys: 3.4.1 dev: false + /@ungap/structured-clone@1.2.0: + resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} + dev: false + /@vercel/analytics@1.0.1: resolution: {integrity: sha512-Ux0c9qUfkcPqng3vrR0GTrlQdqNJ2JREn/2ydrVuKwM3RtMfF2mWX31Ijqo1opSjNAq6rK76PwtANw6kl6TAow==} dev: false @@ -5386,6 +5409,12 @@ packages: resolution: {integrity: sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==} dev: false + /devlop@1.1.0: + resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} + dependencies: + dequal: 2.0.3 + dev: false + /didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} @@ -5942,6 +5971,10 @@ packages: resolution: {integrity: sha512-bEN9VHRyXAUOjkKVQVvArFym08BTWB0aJPppZZr0UNyAqWsLaVfAqP7hbaTJjzHifmB5ebnR8Wm7r7yGN/HonQ==} dev: false + /estree-util-is-identifier-name@3.0.0: + resolution: {integrity: sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==} + dev: false + /estree-util-to-js@1.2.0: resolution: {integrity: sha512-IzU74r1PK5IMMGZXUVZbmiu4A1uhiPgW5hm1GjcOfr4ZzHaMPpLNJjR7HjXiIOzi25nZDrgFTobHTkV5Q6ITjA==} dependencies: @@ -6645,6 +6678,28 @@ packages: stringify-entities: 4.0.3 zwitch: 2.0.4 + /hast-util-to-jsx-runtime@2.3.0: + resolution: {integrity: sha512-H/y0+IWPdsLLS738P8tDnrQ8Z+dj12zQQ6WC11TIM21C8WFVoIxcqWXf2H3hiTVZjF1AWqoimGwrTWecWrnmRQ==} + dependencies: + '@types/estree': 1.0.1 + '@types/hast': 3.0.3 + '@types/unist': 3.0.2 + comma-separated-tokens: 2.0.3 + devlop: 1.1.0 + estree-util-is-identifier-name: 3.0.0 + hast-util-whitespace: 3.0.0 + mdast-util-mdx-expression: 2.0.0 + mdast-util-mdx-jsx: 3.0.0 + mdast-util-mdxjs-esm: 2.0.1 + property-information: 6.2.0 + space-separated-tokens: 2.0.2 + style-to-object: 1.0.5 + unist-util-position: 5.0.0 + vfile-message: 4.0.2 + transitivePeerDependencies: + - supports-color + dev: false + /hast-util-to-parse5@7.1.0: resolution: {integrity: sha512-YNRgAJkH2Jky5ySkIqFXTQiaqcAtJyVE+D5lkN6CdtOqrnkLfGYYrEcKuHOJZlp+MwjSwuD3fZuawI+sic/RBw==} dependencies: @@ -6664,6 +6719,12 @@ packages: /hast-util-whitespace@2.0.1: resolution: {integrity: sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==} + /hast-util-whitespace@3.0.0: + resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==} + dependencies: + '@types/hast': 3.0.3 + dev: false + /hastscript@6.0.0: resolution: {integrity: sha512-nDM6bvd7lIqDUiYEiu5Sl/+6ReP0BMk/2f4U/Rooccxkj0P5nm+acM5PrGJ/t5I8qPGiqZSE6hVAwZEdZIvP4w==} dependencies: @@ -6698,6 +6759,10 @@ packages: lru-cache: 6.0.0 dev: false + /html-url-attributes@3.0.0: + resolution: {integrity: sha512-/sXbVCWayk6GDVg3ctOX6nxaVj7So40FcFAnWlWGNAB1LpYKcV5Cd10APjPjW80O7zYW2MsjBV4zZ7IZO5fVow==} + dev: false + /html-void-elements@2.0.1: resolution: {integrity: sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==} @@ -6797,6 +6862,10 @@ packages: resolution: {integrity: sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==} dev: false + /inline-style-parser@0.2.2: + resolution: {integrity: sha512-EcKzdTHVe8wFVOGEYXiW9WmJXPjqi1T+234YpJr98RiFYKHV3cdy1+3mkTE+KHTHxFFLH51SfaGOoUdW+v7ViQ==} + dev: false + /internal-slot@1.0.5: resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} engines: {node: '>= 0.4'} @@ -7565,13 +7634,13 @@ packages: unist-util-visit: 4.1.2 dev: false - /mdast-util-find-and-replace@2.2.2: - resolution: {integrity: sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==} + /mdast-util-find-and-replace@3.0.1: + resolution: {integrity: sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==} dependencies: - '@types/mdast': 3.0.11 + '@types/mdast': 4.0.3 escape-string-regexp: 5.0.0 - unist-util-is: 5.2.1 - unist-util-visit-parents: 5.1.3 + unist-util-is: 6.0.0 + unist-util-visit-parents: 6.0.1 dev: false /mdast-util-from-markdown@1.3.0: @@ -7593,6 +7662,25 @@ packages: - supports-color dev: false + /mdast-util-from-markdown@2.0.0: + resolution: {integrity: sha512-n7MTOr/z+8NAX/wmhhDji8O3bRvPTV/U0oTCaZJkjhPSKTPhS3xufVhKGF8s1pJ7Ox4QgoIU7KHseh09S+9rTA==} + dependencies: + '@types/mdast': 4.0.3 + '@types/unist': 3.0.2 + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + mdast-util-to-string: 4.0.0 + micromark: 4.0.0 + micromark-util-decode-numeric-character-reference: 2.0.1 + micromark-util-decode-string: 2.0.0 + micromark-util-normalize-identifier: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + unist-util-stringify-position: 4.0.0 + transitivePeerDependencies: + - supports-color + dev: false + /mdast-util-frontmatter@1.0.1: resolution: {integrity: sha512-JjA2OjxRqAa8wEG8hloD0uTU0kdn8kbtOWpPP94NBkfAlbxn4S8gCGf/9DwFtEeGPXrDcNXdiDjVaRdUFqYokw==} dependencies: @@ -7601,58 +7689,71 @@ packages: micromark-extension-frontmatter: 1.1.0 dev: false - /mdast-util-gfm-autolink-literal@1.0.3: - resolution: {integrity: sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==} + /mdast-util-gfm-autolink-literal@2.0.0: + resolution: {integrity: sha512-FyzMsduZZHSc3i0Px3PQcBT4WJY/X/RCtEJKuybiC6sjPqLv7h1yqAkmILZtuxMSsUyaLUWNp71+vQH2zqp5cg==} dependencies: - '@types/mdast': 3.0.11 + '@types/mdast': 4.0.3 ccount: 2.0.1 - mdast-util-find-and-replace: 2.2.2 - micromark-util-character: 1.1.0 + devlop: 1.1.0 + mdast-util-find-and-replace: 3.0.1 + micromark-util-character: 2.0.1 dev: false - /mdast-util-gfm-footnote@1.0.2: - resolution: {integrity: sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ==} + /mdast-util-gfm-footnote@2.0.0: + resolution: {integrity: sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==} dependencies: - '@types/mdast': 3.0.11 - mdast-util-to-markdown: 1.5.0 - micromark-util-normalize-identifier: 1.0.0 + '@types/mdast': 4.0.3 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.0 + mdast-util-to-markdown: 2.1.0 + micromark-util-normalize-identifier: 2.0.0 + transitivePeerDependencies: + - supports-color dev: false - /mdast-util-gfm-strikethrough@1.0.3: - resolution: {integrity: sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ==} + /mdast-util-gfm-strikethrough@2.0.0: + resolution: {integrity: sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==} dependencies: - '@types/mdast': 3.0.11 - mdast-util-to-markdown: 1.5.0 + '@types/mdast': 4.0.3 + mdast-util-from-markdown: 2.0.0 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color dev: false - /mdast-util-gfm-table@1.0.7: - resolution: {integrity: sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg==} + /mdast-util-gfm-table@2.0.0: + resolution: {integrity: sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==} dependencies: - '@types/mdast': 3.0.11 + '@types/mdast': 4.0.3 + devlop: 1.1.0 markdown-table: 3.0.3 - mdast-util-from-markdown: 1.3.0 - mdast-util-to-markdown: 1.5.0 + mdast-util-from-markdown: 2.0.0 + mdast-util-to-markdown: 2.1.0 transitivePeerDependencies: - supports-color dev: false - /mdast-util-gfm-task-list-item@1.0.2: - resolution: {integrity: sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ==} + /mdast-util-gfm-task-list-item@2.0.0: + resolution: {integrity: sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==} dependencies: - '@types/mdast': 3.0.11 - mdast-util-to-markdown: 1.5.0 + '@types/mdast': 4.0.3 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.0 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color dev: false - /mdast-util-gfm@2.0.2: - resolution: {integrity: sha512-qvZ608nBppZ4icQlhQQIAdc6S3Ffj9RGmzwUKUWuEICFnd1LVkN3EktF7ZHAgfcEdvZB5owU9tQgt99e2TlLjg==} + /mdast-util-gfm@3.0.0: + resolution: {integrity: sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==} dependencies: - mdast-util-from-markdown: 1.3.0 - mdast-util-gfm-autolink-literal: 1.0.3 - mdast-util-gfm-footnote: 1.0.2 - mdast-util-gfm-strikethrough: 1.0.3 - mdast-util-gfm-table: 1.0.7 - mdast-util-gfm-task-list-item: 1.0.2 - mdast-util-to-markdown: 1.5.0 + mdast-util-from-markdown: 2.0.0 + mdast-util-gfm-autolink-literal: 2.0.0 + mdast-util-gfm-footnote: 2.0.0 + mdast-util-gfm-strikethrough: 2.0.0 + mdast-util-gfm-table: 2.0.0 + mdast-util-gfm-task-list-item: 2.0.0 + mdast-util-to-markdown: 2.1.0 transitivePeerDependencies: - supports-color dev: false @@ -7677,6 +7778,19 @@ packages: - supports-color dev: false + /mdast-util-mdx-expression@2.0.0: + resolution: {integrity: sha512-fGCu8eWdKUKNu5mohVGkhBXCXGnOTLuFqOvGMvdikr+J1w7lDJgxThOKpwRWzzbyXAU2hhSwsmssOY4yTokluw==} + dependencies: + '@types/estree-jsx': 1.0.0 + '@types/hast': 3.0.3 + '@types/mdast': 4.0.3 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.0 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color + dev: false + /mdast-util-mdx-jsx@2.1.4: resolution: {integrity: sha512-DtMn9CmVhVzZx3f+optVDF8yFgQVt7FghCRNdlIaS3X5Bnym3hZwPbg/XW86vdpKjlc1PVj26SpnLGeJBXD3JA==} dependencies: @@ -7696,6 +7810,26 @@ packages: - supports-color dev: false + /mdast-util-mdx-jsx@3.0.0: + resolution: {integrity: sha512-XZuPPzQNBPAlaqsTTgRrcJnyFbSOBovSadFgbFu8SnuNgm+6Bdx1K+IWoitsmj6Lq6MNtI+ytOqwN70n//NaBA==} + dependencies: + '@types/estree-jsx': 1.0.0 + '@types/hast': 3.0.3 + '@types/mdast': 4.0.3 + '@types/unist': 3.0.2 + ccount: 2.0.1 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.0 + mdast-util-to-markdown: 2.1.0 + parse-entities: 4.0.1 + stringify-entities: 4.0.3 + unist-util-remove-position: 5.0.0 + unist-util-stringify-position: 4.0.0 + vfile-message: 4.0.2 + transitivePeerDependencies: + - supports-color + dev: false + /mdast-util-mdx@2.0.1: resolution: {integrity: sha512-38w5y+r8nyKlGvNjSEqWrhG0w5PmnRA+wnBvm+ulYCct7nsGYhFVb0lljS9bQav4psDAS1eGkP2LMVcZBi/aqw==} dependencies: @@ -7720,6 +7854,19 @@ packages: - supports-color dev: false + /mdast-util-mdxjs-esm@2.0.1: + resolution: {integrity: sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==} + dependencies: + '@types/estree-jsx': 1.0.0 + '@types/hast': 3.0.3 + '@types/mdast': 4.0.3 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.0 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color + dev: false + /mdast-util-phrasing@3.0.1: resolution: {integrity: sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==} dependencies: @@ -7727,6 +7874,13 @@ packages: unist-util-is: 5.2.1 dev: false + /mdast-util-phrasing@4.0.0: + resolution: {integrity: sha512-xadSsJayQIucJ9n053dfQwVu1kuXg7jCTdYsMK8rqzKZh52nLfSH/k0sAxE0u+pj/zKZX+o5wB+ML5mRayOxFA==} + dependencies: + '@types/mdast': 4.0.3 + unist-util-is: 6.0.0 + dev: false + /mdast-util-to-hast@12.3.0: resolution: {integrity: sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==} dependencies: @@ -7740,6 +7894,20 @@ packages: unist-util-visit: 4.1.2 dev: false + /mdast-util-to-hast@13.1.0: + resolution: {integrity: sha512-/e2l/6+OdGp/FB+ctrJ9Avz71AN/GRH3oi/3KAx/kMnoUsD6q0woXlDT8lLEeViVKE7oZxE7RXzvO3T8kF2/sA==} + dependencies: + '@types/hast': 3.0.3 + '@types/mdast': 4.0.3 + '@ungap/structured-clone': 1.2.0 + devlop: 1.1.0 + micromark-util-sanitize-uri: 2.0.0 + trim-lines: 3.0.1 + unist-util-position: 5.0.0 + unist-util-visit: 5.0.0 + vfile: 6.0.1 + dev: false + /mdast-util-to-markdown@1.5.0: resolution: {integrity: sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==} dependencies: @@ -7753,11 +7921,30 @@ packages: zwitch: 2.0.4 dev: false + /mdast-util-to-markdown@2.1.0: + resolution: {integrity: sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==} + dependencies: + '@types/mdast': 4.0.3 + '@types/unist': 3.0.2 + longest-streak: 3.1.0 + mdast-util-phrasing: 4.0.0 + mdast-util-to-string: 4.0.0 + micromark-util-decode-string: 2.0.0 + unist-util-visit: 5.0.0 + zwitch: 2.0.4 + dev: false + /mdast-util-to-string@3.2.0: resolution: {integrity: sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==} dependencies: '@types/mdast': 3.0.11 + /mdast-util-to-string@4.0.0: + resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} + dependencies: + '@types/mdast': 4.0.3 + dev: false + /mdast-util-toc@6.1.1: resolution: {integrity: sha512-Er21728Kow8hehecK2GZtb7Ny3omcoPUVrmObiSUwmoRYVZaXLR751QROEFjR8W/vAQdHMLj49Lz20J55XaNpw==} dependencies: @@ -7859,6 +8046,27 @@ packages: uvu: 0.5.6 dev: false + /micromark-core-commonmark@2.0.0: + resolution: {integrity: sha512-jThOz/pVmAYUtkroV3D5c1osFXAMv9e0ypGDOIZuCeAe91/sD6BoE2Sjzt30yuXtwOYUmySOhMas/PVyh02itA==} + dependencies: + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + micromark-factory-destination: 2.0.0 + micromark-factory-label: 2.0.0 + micromark-factory-space: 2.0.0 + micromark-factory-title: 2.0.0 + micromark-factory-whitespace: 2.0.0 + micromark-util-character: 2.0.1 + micromark-util-chunked: 2.0.0 + micromark-util-classify-character: 2.0.0 + micromark-util-html-tag-name: 2.0.0 + micromark-util-normalize-identifier: 2.0.0 + micromark-util-resolve-all: 2.0.0 + micromark-util-subtokenize: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + /micromark-extension-frontmatter@1.1.0: resolution: {integrity: sha512-0nLelmvXR5aZ+F2IL6/Ed4cDnHLpL/VD/EELKuclsTWHrLI8UgxGHEmeoumeX2FXiM6z2WrBIOEcbKUZR8RYNg==} dependencies: @@ -7868,76 +8076,76 @@ packages: micromark-util-types: 1.0.2 dev: false - /micromark-extension-gfm-autolink-literal@1.0.4: - resolution: {integrity: sha512-WCssN+M9rUyfHN5zPBn3/f0mIA7tqArHL/EKbv3CZK+LT2rG77FEikIQEqBkv46fOqXQK4NEW/Pc7Z27gshpeg==} + /micromark-extension-gfm-autolink-literal@2.0.0: + resolution: {integrity: sha512-rTHfnpt/Q7dEAK1Y5ii0W8bhfJlVJFnJMHIPisfPK3gpVNuOP0VnRl96+YJ3RYWV/P4gFeQoGKNlT3RhuvpqAg==} dependencies: - micromark-util-character: 1.1.0 - micromark-util-sanitize-uri: 1.1.0 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 + micromark-util-character: 2.0.1 + micromark-util-sanitize-uri: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 dev: false - /micromark-extension-gfm-footnote@1.1.0: - resolution: {integrity: sha512-RWYce7j8+c0n7Djzv5NzGEGitNNYO3uj+h/XYMdS/JinH1Go+/Qkomg/rfxExFzYTiydaV6GLeffGO5qcJbMPA==} + /micromark-extension-gfm-footnote@2.0.0: + resolution: {integrity: sha512-6Rzu0CYRKDv3BfLAUnZsSlzx3ak6HAoI85KTiijuKIz5UxZxbUI+pD6oHgw+6UtQuiRwnGRhzMmPRv4smcz0fg==} dependencies: - micromark-core-commonmark: 1.0.6 - micromark-factory-space: 1.0.0 - micromark-util-character: 1.1.0 - micromark-util-normalize-identifier: 1.0.0 - micromark-util-sanitize-uri: 1.1.0 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - uvu: 0.5.6 + devlop: 1.1.0 + micromark-core-commonmark: 2.0.0 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.0.1 + micromark-util-normalize-identifier: 2.0.0 + micromark-util-sanitize-uri: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 dev: false - /micromark-extension-gfm-strikethrough@1.0.5: - resolution: {integrity: sha512-X0oI5eYYQVARhiNfbETy7BfLSmSilzN1eOuoRnrf9oUNsPRrWOAe9UqSizgw1vNxQBfOwL+n2610S3bYjVNi7w==} + /micromark-extension-gfm-strikethrough@2.0.0: + resolution: {integrity: sha512-c3BR1ClMp5fxxmwP6AoOY2fXO9U8uFMKs4ADD66ahLTNcwzSCyRVU4k7LPV5Nxo/VJiR4TdzxRQY2v3qIUceCw==} dependencies: - micromark-util-chunked: 1.0.0 - micromark-util-classify-character: 1.0.0 - micromark-util-resolve-all: 1.0.0 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - uvu: 0.5.6 + devlop: 1.1.0 + micromark-util-chunked: 2.0.0 + micromark-util-classify-character: 2.0.0 + micromark-util-resolve-all: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 dev: false - /micromark-extension-gfm-table@1.0.6: - resolution: {integrity: sha512-92pq7Q+T+4kXH4M6kL+pc8WU23Z9iuhcqmtYFWdFWjm73ZscFpH2xE28+XFpGWlvgq3LUwcN0XC0PGCicYFpgA==} + /micromark-extension-gfm-table@2.0.0: + resolution: {integrity: sha512-PoHlhypg1ItIucOaHmKE8fbin3vTLpDOUg8KAr8gRCF1MOZI9Nquq2i/44wFvviM4WuxJzc3demT8Y3dkfvYrw==} dependencies: - micromark-factory-space: 1.0.0 - micromark-util-character: 1.1.0 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - uvu: 0.5.6 + devlop: 1.1.0 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 dev: false - /micromark-extension-gfm-tagfilter@1.0.2: - resolution: {integrity: sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g==} + /micromark-extension-gfm-tagfilter@2.0.0: + resolution: {integrity: sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==} dependencies: - micromark-util-types: 1.0.2 + micromark-util-types: 2.0.0 dev: false - /micromark-extension-gfm-task-list-item@1.0.4: - resolution: {integrity: sha512-9XlIUUVnYXHsFF2HZ9jby4h3npfX10S1coXTnV035QGPgrtNYQq3J6IfIvcCIUAJrrqBVi5BqA/LmaOMJqPwMQ==} + /micromark-extension-gfm-task-list-item@2.0.1: + resolution: {integrity: sha512-cY5PzGcnULaN5O7T+cOzfMoHjBW7j+T9D2sucA5d/KbsBTPcYdebm9zUd9zzdgJGCwahV+/W78Z3nbulBYVbTw==} dependencies: - micromark-factory-space: 1.0.0 - micromark-util-character: 1.1.0 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - uvu: 0.5.6 + devlop: 1.1.0 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 dev: false - /micromark-extension-gfm@2.0.3: - resolution: {integrity: sha512-vb9OoHqrhCmbRidQv/2+Bc6pkP0FrtlhurxZofvOEy5o8RtuuvTq+RQ1Vw5ZDNrVraQZu3HixESqbG+0iKk/MQ==} + /micromark-extension-gfm@3.0.0: + resolution: {integrity: sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==} dependencies: - micromark-extension-gfm-autolink-literal: 1.0.4 - micromark-extension-gfm-footnote: 1.1.0 - micromark-extension-gfm-strikethrough: 1.0.5 - micromark-extension-gfm-table: 1.0.6 - micromark-extension-gfm-tagfilter: 1.0.2 - micromark-extension-gfm-task-list-item: 1.0.4 - micromark-util-combine-extensions: 1.0.0 - micromark-util-types: 1.0.2 + micromark-extension-gfm-autolink-literal: 2.0.0 + micromark-extension-gfm-footnote: 2.0.0 + micromark-extension-gfm-strikethrough: 2.0.0 + micromark-extension-gfm-table: 2.0.0 + micromark-extension-gfm-tagfilter: 2.0.0 + micromark-extension-gfm-task-list-item: 2.0.1 + micromark-util-combine-extensions: 2.0.0 + micromark-util-types: 2.0.0 dev: false /micromark-extension-math@2.1.2: @@ -8018,6 +8226,14 @@ packages: micromark-util-types: 1.0.2 dev: false + /micromark-factory-destination@2.0.0: + resolution: {integrity: sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==} + dependencies: + micromark-util-character: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + /micromark-factory-label@1.0.2: resolution: {integrity: sha512-CTIwxlOnU7dEshXDQ+dsr2n+yxpP0+fn271pu0bwDIS8uqfFcumXpj5mLn3hSC8iw2MUr6Gx8EcKng1dD7i6hg==} dependencies: @@ -8027,6 +8243,15 @@ packages: uvu: 0.5.6 dev: false + /micromark-factory-label@2.0.0: + resolution: {integrity: sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==} + dependencies: + devlop: 1.1.0 + micromark-util-character: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + /micromark-factory-mdx-expression@1.0.8: resolution: {integrity: sha512-/GWj6h6bDFCDCkxOCb/xXpgKGonhBXEqMnhTThVo0nlIN/i8z6L6YrmRq+N91oerxY97fEz7vHSCSIcW7fGFhQ==} dependencies: @@ -8047,6 +8272,13 @@ packages: micromark-util-types: 1.0.2 dev: false + /micromark-factory-space@2.0.0: + resolution: {integrity: sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==} + dependencies: + micromark-util-character: 2.0.1 + micromark-util-types: 2.0.0 + dev: false + /micromark-factory-title@1.0.2: resolution: {integrity: sha512-zily+Nr4yFqgMGRKLpTVsNl5L4PMu485fGFDOQJQBl2NFpjGte1e86zC0da93wf97jrc4+2G2GQudFMHn3IX+A==} dependencies: @@ -8057,6 +8289,15 @@ packages: uvu: 0.5.6 dev: false + /micromark-factory-title@2.0.0: + resolution: {integrity: sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==} + dependencies: + micromark-factory-space: 2.0.0 + micromark-util-character: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + /micromark-factory-whitespace@1.0.0: resolution: {integrity: sha512-Qx7uEyahU1lt1RnsECBiuEbfr9INjQTGa6Err+gF3g0Tx4YEviPbqqGKNv/NrBaE7dVHdn1bVZKM/n5I/Bak7A==} dependencies: @@ -8066,6 +8307,15 @@ packages: micromark-util-types: 1.0.2 dev: false + /micromark-factory-whitespace@2.0.0: + resolution: {integrity: sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==} + dependencies: + micromark-factory-space: 2.0.0 + micromark-util-character: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + /micromark-util-character@1.1.0: resolution: {integrity: sha512-agJ5B3unGNJ9rJvADMJ5ZiYjBRyDpzKAOk01Kpi1TKhlT1APx3XZk6eN7RtSz1erbWHC2L8T3xLZ81wdtGRZzg==} dependencies: @@ -8073,12 +8323,25 @@ packages: micromark-util-types: 1.0.2 dev: false + /micromark-util-character@2.0.1: + resolution: {integrity: sha512-3wgnrmEAJ4T+mGXAUfMvMAbxU9RDG43XmGce4j6CwPtVxB3vfwXSZ6KhFwDzZ3mZHhmPimMAXg71veiBGzeAZw==} + dependencies: + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + /micromark-util-chunked@1.0.0: resolution: {integrity: sha512-5e8xTis5tEZKgesfbQMKRCyzvffRRUX+lK/y+DvsMFdabAicPkkZV6gO+FEWi9RfuKKoxxPwNL+dFF0SMImc1g==} dependencies: micromark-util-symbol: 1.0.1 dev: false + /micromark-util-chunked@2.0.0: + resolution: {integrity: sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==} + dependencies: + micromark-util-symbol: 2.0.0 + dev: false + /micromark-util-classify-character@1.0.0: resolution: {integrity: sha512-F8oW2KKrQRb3vS5ud5HIqBVkCqQi224Nm55o5wYLzY/9PwHGXC01tr3d7+TqHHz6zrKQ72Okwtvm/xQm6OVNZA==} dependencies: @@ -8087,6 +8350,14 @@ packages: micromark-util-types: 1.0.2 dev: false + /micromark-util-classify-character@2.0.0: + resolution: {integrity: sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==} + dependencies: + micromark-util-character: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + /micromark-util-combine-extensions@1.0.0: resolution: {integrity: sha512-J8H058vFBdo/6+AsjHp2NF7AJ02SZtWaVUjsayNFeAiydTxUwViQPxN0Hf8dp4FmCQi0UUFovFsEyRSUmFH3MA==} dependencies: @@ -8094,12 +8365,25 @@ packages: micromark-util-types: 1.0.2 dev: false + /micromark-util-combine-extensions@2.0.0: + resolution: {integrity: sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==} + dependencies: + micromark-util-chunked: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + /micromark-util-decode-numeric-character-reference@1.0.0: resolution: {integrity: sha512-OzO9AI5VUtrTD7KSdagf4MWgHMtET17Ua1fIpXTpuhclCqD8egFWo85GxSGvxgkGS74bEahvtM0WP0HjvV0e4w==} dependencies: micromark-util-symbol: 1.0.1 dev: false + /micromark-util-decode-numeric-character-reference@2.0.1: + resolution: {integrity: sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==} + dependencies: + micromark-util-symbol: 2.0.0 + dev: false + /micromark-util-decode-string@1.0.2: resolution: {integrity: sha512-DLT5Ho02qr6QWVNYbRZ3RYOSSWWFuH3tJexd3dgN1odEuPNxCngTCXJum7+ViRAd9BbdxCvMToPOD/IvVhzG6Q==} dependencies: @@ -8109,10 +8393,23 @@ packages: micromark-util-symbol: 1.0.1 dev: false + /micromark-util-decode-string@2.0.0: + resolution: {integrity: sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==} + dependencies: + decode-named-character-reference: 1.0.2 + micromark-util-character: 2.0.1 + micromark-util-decode-numeric-character-reference: 2.0.1 + micromark-util-symbol: 2.0.0 + dev: false + /micromark-util-encode@1.0.1: resolution: {integrity: sha512-U2s5YdnAYexjKDel31SVMPbfi+eF8y1U4pfiRW/Y8EFVCy/vgxk/2wWTxzcqE71LHtCuCzlBDRU2a5CQ5j+mQA==} dev: false + /micromark-util-encode@2.0.0: + resolution: {integrity: sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==} + dev: false + /micromark-util-events-to-acorn@1.2.3: resolution: {integrity: sha512-ij4X7Wuc4fED6UoLWkmo0xJQhsktfNh1J0m8g4PbIMPlx+ek/4YdW5mvbye8z/aZvAPUoxgXHrwVlXAPKMRp1w==} dependencies: @@ -8130,18 +8427,34 @@ packages: resolution: {integrity: sha512-BKlClMmYROy9UiV03SwNmckkjn8QHVaWkqoAqzivabvdGcwNGMMMH/5szAnywmsTBUzDsU57/mFi0sp4BQO6dA==} dev: false + /micromark-util-html-tag-name@2.0.0: + resolution: {integrity: sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==} + dev: false + /micromark-util-normalize-identifier@1.0.0: resolution: {integrity: sha512-yg+zrL14bBTFrQ7n35CmByWUTFsgst5JhA4gJYoty4Dqzj4Z4Fr/DHekSS5aLfH9bdlfnSvKAWsAgJhIbogyBg==} dependencies: micromark-util-symbol: 1.0.1 dev: false + /micromark-util-normalize-identifier@2.0.0: + resolution: {integrity: sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==} + dependencies: + micromark-util-symbol: 2.0.0 + dev: false + /micromark-util-resolve-all@1.0.0: resolution: {integrity: sha512-CB/AGk98u50k42kvgaMM94wzBqozSzDDaonKU7P7jwQIuH2RU0TeBqGYJz2WY1UdihhjweivStrJ2JdkdEmcfw==} dependencies: micromark-util-types: 1.0.2 dev: false + /micromark-util-resolve-all@2.0.0: + resolution: {integrity: sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==} + dependencies: + micromark-util-types: 2.0.0 + dev: false + /micromark-util-sanitize-uri@1.1.0: resolution: {integrity: sha512-RoxtuSCX6sUNtxhbmsEFQfWzs8VN7cTctmBPvYivo98xb/kDEoTCtJQX5wyzIYEmk/lvNFTat4hL8oW0KndFpg==} dependencies: @@ -8150,6 +8463,14 @@ packages: micromark-util-symbol: 1.0.1 dev: false + /micromark-util-sanitize-uri@2.0.0: + resolution: {integrity: sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==} + dependencies: + micromark-util-character: 2.0.1 + micromark-util-encode: 2.0.0 + micromark-util-symbol: 2.0.0 + dev: false + /micromark-util-subtokenize@1.0.2: resolution: {integrity: sha512-d90uqCnXp/cy4G881Ub4psE57Sf8YD0pim9QdjCRNjfas2M1u6Lbt+XZK9gnHL2XFhnozZiEdCa9CNfXSfQ6xA==} dependencies: @@ -8159,14 +8480,31 @@ packages: uvu: 0.5.6 dev: false + /micromark-util-subtokenize@2.0.0: + resolution: {integrity: sha512-vc93L1t+gpR3p8jxeVdaYlbV2jTYteDje19rNSS/H5dlhxUYll5Fy6vJ2cDwP8RnsXi818yGty1ayP55y3W6fg==} + dependencies: + devlop: 1.1.0 + micromark-util-chunked: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + dev: false + /micromark-util-symbol@1.0.1: resolution: {integrity: sha512-oKDEMK2u5qqAptasDAwWDXq0tG9AssVwAx3E9bBF3t/shRIGsWIRG+cGafs2p/SnDSOecnt6hZPCE2o6lHfFmQ==} dev: false + /micromark-util-symbol@2.0.0: + resolution: {integrity: sha512-8JZt9ElZ5kyTnO94muPxIGS8oyElRJaiJO8EzV6ZSyGQ1Is8xwl4Q45qU5UOg+bGH4AikWziz0iN4sFLWs8PGw==} + dev: false + /micromark-util-types@1.0.2: resolution: {integrity: sha512-DCfg/T8fcrhrRKTPjRrw/5LLvdGV7BHySf/1LOZx7TzWZdYRjogNtyNq885z3nNallwr3QUKARjqvHqX1/7t+w==} dev: false + /micromark-util-types@2.0.0: + resolution: {integrity: sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==} + dev: false + /micromark@3.1.0: resolution: {integrity: sha512-6Mj0yHLdUZjHnOPgr5xfWIMqMWS12zDN6iws9SLuSz76W8jTtAv24MN4/CL7gJrl5vtxGInkkqDv/JIoRsQOvA==} dependencies: @@ -8191,6 +8529,30 @@ packages: - supports-color dev: false + /micromark@4.0.0: + resolution: {integrity: sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==} + dependencies: + '@types/debug': 4.1.8 + debug: 4.3.4 + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + micromark-core-commonmark: 2.0.0 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.0.1 + micromark-util-chunked: 2.0.0 + micromark-util-combine-extensions: 2.0.0 + micromark-util-decode-numeric-character-reference: 2.0.1 + micromark-util-encode: 2.0.0 + micromark-util-normalize-identifier: 2.0.0 + micromark-util-resolve-all: 2.0.0 + micromark-util-sanitize-uri: 2.0.0 + micromark-util-subtokenize: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + transitivePeerDependencies: + - supports-color + dev: false + /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} @@ -9133,37 +9495,28 @@ packages: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} dev: false - /react-is@18.2.0: - resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} - dev: false - /react-lifecycles-compat@3.0.4: resolution: {integrity: sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==} dev: false - /react-markdown@8.0.7(@types/react@18.2.7)(react@18.2.0): - resolution: {integrity: sha512-bvWbzG4MtOU62XqBx3Xx+zB2raaFFsq4mYiAzfjXJMEz2sixgeAfraA3tvzULF02ZdOMUOKTBFFaZJDDrq+BJQ==} + /react-markdown@9.0.1(@types/react@18.2.7)(react@18.2.0): + resolution: {integrity: sha512-186Gw/vF1uRkydbsOIkcGXw7aHq0sZOCRFFjGrr7b9+nVZg4UfA4enXCaxm4fUzecU38sWfrNDitGhshuU7rdg==} peerDependencies: - '@types/react': '>=16' - react: '>=16' + '@types/react': '>=18' + react: '>=18' dependencies: - '@types/hast': 2.3.4 - '@types/prop-types': 15.7.5 + '@types/hast': 3.0.3 '@types/react': 18.2.7 - '@types/unist': 2.0.6 - comma-separated-tokens: 2.0.3 - hast-util-whitespace: 2.0.1 - prop-types: 15.8.1 - property-information: 6.2.0 + devlop: 1.1.0 + hast-util-to-jsx-runtime: 2.3.0 + html-url-attributes: 3.0.0 + mdast-util-to-hast: 13.1.0 react: 18.2.0 - react-is: 18.2.0 - remark-parse: 10.0.2 - remark-rehype: 10.1.0 - space-separated-tokens: 2.0.2 - style-to-object: 0.4.1 - unified: 10.1.2 - unist-util-visit: 4.1.2 - vfile: 5.3.7 + remark-parse: 11.0.0 + remark-rehype: 11.1.0 + unified: 11.0.4 + unist-util-visit: 5.0.0 + vfile: 6.0.1 transitivePeerDependencies: - supports-color dev: false @@ -9523,13 +9876,15 @@ packages: unified: 10.1.2 dev: false - /remark-gfm@3.0.1: - resolution: {integrity: sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==} + /remark-gfm@4.0.0: + resolution: {integrity: sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==} dependencies: - '@types/mdast': 3.0.11 - mdast-util-gfm: 2.0.2 - micromark-extension-gfm: 2.0.3 - unified: 10.1.2 + '@types/mdast': 4.0.3 + mdast-util-gfm: 3.0.0 + micromark-extension-gfm: 3.0.0 + remark-parse: 11.0.0 + remark-stringify: 11.0.0 + unified: 11.0.4 transitivePeerDependencies: - supports-color dev: false @@ -9572,6 +9927,17 @@ packages: - supports-color dev: false + /remark-parse@11.0.0: + resolution: {integrity: sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==} + dependencies: + '@types/mdast': 4.0.3 + mdast-util-from-markdown: 2.0.0 + micromark-util-types: 2.0.0 + unified: 11.0.4 + transitivePeerDependencies: + - supports-color + dev: false + /remark-rehype@10.1.0: resolution: {integrity: sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==} dependencies: @@ -9581,6 +9947,16 @@ packages: unified: 10.1.2 dev: false + /remark-rehype@11.1.0: + resolution: {integrity: sha512-z3tJrAs2kIs1AqIIy6pzHmAHlF1hWQ+OdY4/hv+Wxe35EhyLKcajL33iUEn3ScxtFox9nUvRufR/Zre8Q08H/g==} + dependencies: + '@types/hast': 3.0.3 + '@types/mdast': 4.0.3 + mdast-util-to-hast: 13.1.0 + unified: 11.0.4 + vfile: 6.0.1 + dev: false + /remark-stringify@10.0.3: resolution: {integrity: sha512-koyOzCMYoUHudypbj4XpnAKFbkddRMYZHwghnxd7ue5210WzGw6kOBwauJTRUMq16jsovXx8dYNvSSWP89kZ3A==} dependencies: @@ -9589,6 +9965,14 @@ packages: unified: 10.1.2 dev: false + /remark-stringify@11.0.0: + resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==} + dependencies: + '@types/mdast': 4.0.3 + mdast-util-to-markdown: 2.1.0 + unified: 11.0.4 + dev: false + /remark@14.0.3: resolution: {integrity: sha512-bfmJW1dmR2LvaMJuAnE88pZP9DktIFYXazkTfOIKZzi3Knk9lT0roItIA24ydOucI3bV/g/tXBA6hzqq3FV9Ew==} dependencies: @@ -10160,6 +10544,12 @@ packages: inline-style-parser: 0.1.1 dev: false + /style-to-object@1.0.5: + resolution: {integrity: sha512-rDRwHtoDD3UMMrmZ6BzOW0naTjMsVZLIjsGleSKS/0Oz+cgCfAPRspaqJuE8rDzpKha/nEvnM0IF4seEAZUTKQ==} + dependencies: + inline-style-parser: 0.2.2 + dev: false + /styled-jsx@5.1.1(@babel/core@7.22.1)(react@18.2.0): resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} engines: {node: '>= 12.0.0'} @@ -10720,6 +11110,18 @@ packages: trough: 2.1.0 vfile: 5.3.7 + /unified@11.0.4: + resolution: {integrity: sha512-apMPnyLjAX+ty4OrNap7yumyVAMlKx5IWU2wlzzUdYJO9A8f1p9m/gywF/GM2ZDFcjQPrx59Mc90KwmxsoklxQ==} + dependencies: + '@types/unist': 3.0.2 + bail: 2.0.2 + devlop: 1.1.0 + extend: 3.0.2 + is-plain-obj: 4.1.0 + trough: 2.1.0 + vfile: 6.0.1 + dev: false + /unist-builder@3.0.0: resolution: {integrity: sha512-GFxmfEAa0vi9i5sd0R2kcrI9ks0r82NasRq5QHh2ysGngrc6GiqD5CDf1FjPenY4vApmFASBIIlk/jj5J5YbmQ==} dependencies: @@ -10735,6 +11137,12 @@ packages: dependencies: '@types/unist': 2.0.6 + /unist-util-is@6.0.0: + resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} + dependencies: + '@types/unist': 3.0.2 + dev: false + /unist-util-position-from-estree@1.1.2: resolution: {integrity: sha512-poZa0eXpS+/XpoQwGwl79UUdea4ol2ZuCYguVaJS4qzIOMDzbqz8a3erUCOmubSZkaOuGamb3tX790iwOIROww==} dependencies: @@ -10746,6 +11154,12 @@ packages: dependencies: '@types/unist': 2.0.6 + /unist-util-position@5.0.0: + resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==} + dependencies: + '@types/unist': 3.0.2 + dev: false + /unist-util-remove-position@4.0.2: resolution: {integrity: sha512-TkBb0HABNmxzAcfLf4qsIbFbaPDvMO6wa3b3j4VcEzFVaw1LBKwnW4/sRJ/atSLSzoIg41JWEdnE7N6DIhGDGQ==} dependencies: @@ -10753,6 +11167,13 @@ packages: unist-util-visit: 4.1.2 dev: false + /unist-util-remove-position@5.0.0: + resolution: {integrity: sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==} + dependencies: + '@types/unist': 3.0.2 + unist-util-visit: 5.0.0 + dev: false + /unist-util-stringify-position@2.0.3: resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} dependencies: @@ -10764,12 +11185,25 @@ packages: dependencies: '@types/unist': 2.0.6 + /unist-util-stringify-position@4.0.0: + resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} + dependencies: + '@types/unist': 3.0.2 + dev: false + /unist-util-visit-parents@5.1.3: resolution: {integrity: sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==} dependencies: '@types/unist': 2.0.6 unist-util-is: 5.2.1 + /unist-util-visit-parents@6.0.1: + resolution: {integrity: sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==} + dependencies: + '@types/unist': 3.0.2 + unist-util-is: 6.0.0 + dev: false + /unist-util-visit@4.1.2: resolution: {integrity: sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==} dependencies: @@ -10777,6 +11211,14 @@ packages: unist-util-is: 5.2.1 unist-util-visit-parents: 5.1.3 + /unist-util-visit@5.0.0: + resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} + dependencies: + '@types/unist': 3.0.2 + unist-util-is: 6.0.0 + unist-util-visit-parents: 6.0.1 + dev: false + /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -10924,6 +11366,13 @@ packages: '@types/unist': 2.0.6 unist-util-stringify-position: 3.0.3 + /vfile-message@4.0.2: + resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} + dependencies: + '@types/unist': 3.0.2 + unist-util-stringify-position: 4.0.0 + dev: false + /vfile@4.2.1: resolution: {integrity: sha512-O6AE4OskCG5S1emQ/4gl8zK586RqA3srz3nfK/Viy0UPToBc5Trp9BVFb1u0CjsKrAWwnpr4ifM/KBXPWwJbCA==} dependencies: @@ -10941,6 +11390,14 @@ packages: unist-util-stringify-position: 3.0.3 vfile-message: 3.1.4 + /vfile@6.0.1: + resolution: {integrity: sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==} + dependencies: + '@types/unist': 3.0.2 + unist-util-stringify-position: 4.0.0 + vfile-message: 4.0.2 + dev: false + /victory-vendor@36.6.10: resolution: {integrity: sha512-7YqYGtsA4mByokBhCjk+ewwPhUfzhR1I3Da6/ZsZUv/31ceT77RKoaqrxRq5Ki+9we4uzf7+A+7aG2sfYhm7nA==} dependencies: From 961ce7b18ceb520cdd329b50868195b419e27dd2 Mon Sep 17 00:00:00 2001 From: Yasin Date: Sun, 21 Jan 2024 14:44:02 +0100 Subject: [PATCH 2/5] refactor(chat): code cleanup --- apps/www/registry/default/ui/chat/markdown.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/www/registry/default/ui/chat/markdown.tsx b/apps/www/registry/default/ui/chat/markdown.tsx index d8689fc..ab52bfb 100644 --- a/apps/www/registry/default/ui/chat/markdown.tsx +++ b/apps/www/registry/default/ui/chat/markdown.tsx @@ -38,14 +38,14 @@ export default function Markdown({ content }: { content: string }) { ) }, - pre({ node, className, ...props }) { + pre({ node, className, children, ...props }) { const match = /language-(\w+)/.exec(className || "") return ( ) From 59f1a9afa241526c095347cb7e866c9c17bc43be Mon Sep 17 00:00:00 2001 From: Yasin Date: Mon, 22 Jan 2024 09:56:38 +0100 Subject: [PATCH 3/5] fix: formatting & typecheck --- apps/www/package.json | 2 +- .../registry/default/ui/chat/chat-actions.tsx | 14 +-- .../registry/default/ui/chat/chat-avatar.tsx | 8 +- .../registry/default/ui/chat/chat-input.tsx | 55 +++++------ .../registry/default/ui/chat/chat-message.tsx | 16 ++-- .../default/ui/chat/chat-messages.tsx | 32 +++---- .../default/ui/chat/chat.interface.ts | 28 +++--- apps/www/registry/default/ui/chat/index.ts | 8 +- .../default/ui/chat/use-copy-to-clipboard.tsx | 8 +- .../www/registry/default/ui/file-uploader.tsx | 92 ++++++++++--------- .../default/ui/upload-image-preview.tsx | 13 +-- pnpm-lock.yaml | 46 ++++++---- 12 files changed, 167 insertions(+), 155 deletions(-) diff --git a/apps/www/package.json b/apps/www/package.json index 0e88a4e..7758db7 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -74,7 +74,7 @@ "remark": "^14.0.3", "remark-code-import": "^1.2.0", "remark-gfm": "^4.0.0", - "remark-math": "^5.1.1", + "remark-math": "^6.0.0", "sharp": "^0.31.3", "tailwind-merge": "^1.12.0", "vaul": "^0.2.0", diff --git a/apps/www/registry/default/ui/chat/chat-actions.tsx b/apps/www/registry/default/ui/chat/chat-actions.tsx index 151ef61..53bfc7e 100644 --- a/apps/www/registry/default/ui/chat/chat-actions.tsx +++ b/apps/www/registry/default/ui/chat/chat-actions.tsx @@ -1,13 +1,13 @@ -import { PauseCircle, RefreshCw } from "lucide-react"; +import { PauseCircle, RefreshCw } from "lucide-react" -import { Button } from "../button"; -import { ChatHandler } from "./chat.interface"; +import { Button } from "../button" +import { ChatHandler } from "./chat.interface" export default function ChatActions( props: Pick & { - showReload?: boolean; - showStop?: boolean; - }, + showReload?: boolean + showStop?: boolean + } ) { return (
@@ -24,5 +24,5 @@ export default function ChatActions( )}
- ); + ) } diff --git a/apps/www/registry/default/ui/chat/chat-avatar.tsx b/apps/www/registry/default/ui/chat/chat-avatar.tsx index 5e2040d..665d070 100644 --- a/apps/www/registry/default/ui/chat/chat-avatar.tsx +++ b/apps/www/registry/default/ui/chat/chat-avatar.tsx @@ -1,5 +1,5 @@ -import { User2 } from "lucide-react"; -import Image from "next/image"; +import Image from "next/image" +import { User2 } from "lucide-react" export default function ChatAvatar({ role }: { role: string }) { if (role === "user") { @@ -7,7 +7,7 @@ export default function ChatAvatar({ role }: { role: string }) {
- ); + ) } return ( @@ -22,5 +22,5 @@ export default function ChatAvatar({ role }: { role: string }) { - ); + ) } diff --git a/apps/www/registry/default/ui/chat/chat-input.tsx b/apps/www/registry/default/ui/chat/chat-input.tsx index 435637e..60855a3 100644 --- a/apps/www/registry/default/ui/chat/chat-input.tsx +++ b/apps/www/registry/default/ui/chat/chat-input.tsx @@ -1,9 +1,10 @@ -import { useState } from "react"; -import { Button } from "../button"; -import FileUploader from "../file-uploader"; -import { Input } from "../input"; -import UploadImagePreview from "../upload-image-preview"; -import { ChatHandler } from "./chat.interface"; +import { useState } from "react" + +import { Button } from "../button" +import FileUploader from "../file-uploader" +import { Input } from "../input" +import UploadImagePreview from "../upload-image-preview" +import { ChatHandler } from "./chat.interface" export default function ChatInput( props: Pick< @@ -15,44 +16,44 @@ export default function ChatInput( | "handleSubmit" | "handleInputChange" > & { - multiModal?: boolean; - }, + multiModal?: boolean + } ) { - const [imageUrl, setImageUrl] = useState(null); + const [imageUrl, setImageUrl] = useState(null) const onSubmit = (e: React.FormEvent) => { if (imageUrl) { props.handleSubmit(e, { data: { imageUrl: imageUrl }, - }); - setImageUrl(null); - return; + }) + setImageUrl(null) + return } - props.handleSubmit(e); - }; + props.handleSubmit(e) + } - const onRemovePreviewImage = () => setImageUrl(null); + const onRemovePreviewImage = () => setImageUrl(null) const handleUploadImageFile = async (file: File) => { const base64 = await new Promise((resolve, reject) => { - const reader = new FileReader(); - reader.readAsDataURL(file); - reader.onload = () => resolve(reader.result as string); - reader.onerror = (error) => reject(error); - }); - setImageUrl(base64); - }; + const reader = new FileReader() + reader.readAsDataURL(file) + reader.onload = () => resolve(reader.result as string) + reader.onerror = (error) => reject(error) + }) + setImageUrl(base64) + } const handleUploadFile = async (file: File) => { try { if (props.multiModal && file.type.startsWith("image/")) { - return await handleUploadImageFile(file); + return await handleUploadImageFile(file) } - props.onFileUpload?.(file); + props.onFileUpload?.(file) } catch (error: any) { - props.onFileError?.(error.message); + props.onFileError?.(error.message) } - }; + } return (
- ); + ) } diff --git a/apps/www/registry/default/ui/chat/chat-message.tsx b/apps/www/registry/default/ui/chat/chat-message.tsx index 9ada08a..e1d3eaa 100644 --- a/apps/www/registry/default/ui/chat/chat-message.tsx +++ b/apps/www/registry/default/ui/chat/chat-message.tsx @@ -1,13 +1,13 @@ -import { Check, Copy } from "lucide-react"; +import { Check, Copy } from "lucide-react" -import { Button } from "../button"; -import ChatAvatar from "./chat-avatar"; -import { Message } from "./chat.interface"; -import Markdown from "./markdown"; -import { useCopyToClipboard } from "./use-copy-to-clipboard"; +import { Button } from "../button" +import ChatAvatar from "./chat-avatar" +import { Message } from "./chat.interface" +import Markdown from "./markdown" +import { useCopyToClipboard } from "./use-copy-to-clipboard" export default function ChatMessage(chatMessage: Message) { - const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 }); + const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 }) return (
@@ -29,5 +29,5 @@ export default function ChatMessage(chatMessage: Message) {
- ); + ) } diff --git a/apps/www/registry/default/ui/chat/chat-messages.tsx b/apps/www/registry/default/ui/chat/chat-messages.tsx index dd0a442..3aadb50 100644 --- a/apps/www/registry/default/ui/chat/chat-messages.tsx +++ b/apps/www/registry/default/ui/chat/chat-messages.tsx @@ -1,32 +1,32 @@ -import { useEffect, useRef } from "react"; +import { useEffect, useRef } from "react" -import ChatActions from "./chat-actions"; -import ChatMessage from "./chat-message"; -import { ChatHandler } from "./chat.interface"; +import ChatActions from "./chat-actions" +import ChatMessage from "./chat-message" +import { ChatHandler } from "./chat.interface" export default function ChatMessages( - props: Pick, + props: Pick ) { - const scrollableChatContainerRef = useRef(null); - const messageLength = props.messages.length; - const lastMessage = props.messages[messageLength - 1]; + const scrollableChatContainerRef = useRef(null) + const messageLength = props.messages.length + const lastMessage = props.messages[messageLength - 1] const scrollToBottom = () => { if (scrollableChatContainerRef.current) { scrollableChatContainerRef.current.scrollTop = - scrollableChatContainerRef.current.scrollHeight; + scrollableChatContainerRef.current.scrollHeight } - }; + } const isLastMessageFromAssistant = - messageLength > 0 && lastMessage?.role !== "user"; + messageLength > 0 && lastMessage?.role !== "user" const showReload = - props.reload && !props.isLoading && isLastMessageFromAssistant; - const showStop = props.stop && props.isLoading; + props.reload && !props.isLoading && isLastMessageFromAssistant + const showStop = props.stop && props.isLoading useEffect(() => { - scrollToBottom(); - }, [messageLength, lastMessage]); + scrollToBottom() + }, [messageLength, lastMessage]) return (
@@ -47,5 +47,5 @@ export default function ChatMessages( />
- ); + ) } diff --git a/apps/www/registry/default/ui/chat/chat.interface.ts b/apps/www/registry/default/ui/chat/chat.interface.ts index 584a63f..a3d84e6 100644 --- a/apps/www/registry/default/ui/chat/chat.interface.ts +++ b/apps/www/registry/default/ui/chat/chat.interface.ts @@ -1,22 +1,22 @@ export interface Message { - id: string; - content: string; - role: string; + id: string + content: string + role: string } export interface ChatHandler { - messages: Message[]; - input: string; - isLoading: boolean; + messages: Message[] + input: string + isLoading: boolean handleSubmit: ( e: React.FormEvent, ops?: { - data?: any; - }, - ) => void; - handleInputChange: (e: React.ChangeEvent) => void; - reload?: () => void; - stop?: () => void; - onFileUpload?: (file: File) => Promise; - onFileError?: (errMsg: string) => void; + data?: any + } + ) => void + handleInputChange: (e: React.ChangeEvent) => void + reload?: () => void + stop?: () => void + onFileUpload?: (file: File) => Promise + onFileError?: (errMsg: string) => void } diff --git a/apps/www/registry/default/ui/chat/index.ts b/apps/www/registry/default/ui/chat/index.ts index 0b81049..a8fde57 100644 --- a/apps/www/registry/default/ui/chat/index.ts +++ b/apps/www/registry/default/ui/chat/index.ts @@ -1,5 +1,5 @@ -import ChatInput from "./chat-input"; -import ChatMessages from "./chat-messages"; +import ChatInput from "./chat-input" +import ChatMessages from "./chat-messages" -export { type ChatHandler, type Message } from "./chat.interface"; -export { ChatMessages, ChatInput }; +export { type ChatHandler, type Message } from "./chat.interface" +export { ChatMessages, ChatInput } diff --git a/apps/www/registry/default/ui/chat/use-copy-to-clipboard.tsx b/apps/www/registry/default/ui/chat/use-copy-to-clipboard.tsx index 62f7156..02b899c 100644 --- a/apps/www/registry/default/ui/chat/use-copy-to-clipboard.tsx +++ b/apps/www/registry/default/ui/chat/use-copy-to-clipboard.tsx @@ -1,18 +1,18 @@ -'use client' +"use client" -import * as React from 'react' +import * as React from "react" export interface useCopyToClipboardProps { timeout?: number } export function useCopyToClipboard({ - timeout = 2000 + timeout = 2000, }: useCopyToClipboardProps) { const [isCopied, setIsCopied] = React.useState(false) const copyToClipboard = (value: string) => { - if (typeof window === 'undefined' || !navigator.clipboard?.writeText) { + if (typeof window === "undefined" || !navigator.clipboard?.writeText) { return } diff --git a/apps/www/registry/default/ui/file-uploader.tsx b/apps/www/registry/default/ui/file-uploader.tsx index bab773e..a9576b5 100644 --- a/apps/www/registry/default/ui/file-uploader.tsx +++ b/apps/www/registry/default/ui/file-uploader.tsx @@ -1,80 +1,82 @@ -"use client"; +"use client" + +import { ChangeEvent, useState } from "react" +import { Loader2, Paperclip } from "lucide-react" -import { Loader2, Paperclip } from "lucide-react"; -import { ChangeEvent, useState } from "react"; -import { buttonVariants } from "./button"; import { cn } from "@/lib/utils" +import { buttonVariants } from "./button" + export interface FileUploaderProps { config?: { - inputId?: string; - fileSizeLimit?: number; - allowedExtensions?: string[]; - checkExtension?: (extension: string) => string | null; - disabled: boolean; - }; - onFileUpload: (file: File) => Promise; - onFileError?: (errMsg: string) => void; + inputId?: string + fileSizeLimit?: number + allowedExtensions?: string[] + checkExtension?: (extension: string) => string | null + disabled: boolean + } + onFileUpload: (file: File) => Promise + onFileError?: (errMsg: string) => void } -const DEFAULT_INPUT_ID = "fileInput"; -const DEFAULT_FILE_SIZE_LIMIT = 1024 * 1024 * 50; // 50 MB +const DEFAULT_INPUT_ID = "fileInput" +const DEFAULT_FILE_SIZE_LIMIT = 1024 * 1024 * 50 // 50 MB export default function FileUploader({ config, onFileUpload, onFileError, }: FileUploaderProps) { - const [uploading, setUploading] = useState(false); + const [uploading, setUploading] = useState(false) - const inputId = config?.inputId || DEFAULT_INPUT_ID; - const fileSizeLimit = config?.fileSizeLimit || DEFAULT_FILE_SIZE_LIMIT; - const allowedExtensions = config?.allowedExtensions; + const inputId = config?.inputId || DEFAULT_INPUT_ID + const fileSizeLimit = config?.fileSizeLimit || DEFAULT_FILE_SIZE_LIMIT + const allowedExtensions = config?.allowedExtensions const defaultCheckExtension = (extension: string) => { if (allowedExtensions && !allowedExtensions.includes(extension)) { return `Invalid file type. Please select a file with one of these formats: ${allowedExtensions!.join( - ",", - )}`; + "," + )}` } - return null; - }; - const checkExtension = config?.checkExtension ?? defaultCheckExtension; + return null + } + const checkExtension = config?.checkExtension ?? defaultCheckExtension const isFileSizeExceeded = (file: File) => { - return file.size > fileSizeLimit; - }; + return file.size > fileSizeLimit + } const resetInput = () => { - const fileInput = document.getElementById(inputId) as HTMLInputElement; - fileInput.value = ""; - }; + const fileInput = document.getElementById(inputId) as HTMLInputElement + fileInput.value = "" + } const onFileChange = async (e: ChangeEvent) => { - const file = e.target.files?.[0]; - if (!file) return; + const file = e.target.files?.[0] + if (!file) return - setUploading(true); - await handleUpload(file); - resetInput(); - setUploading(false); - }; + setUploading(true) + await handleUpload(file) + resetInput() + setUploading(false) + } const handleUpload = async (file: File) => { - const onFileUploadError = onFileError || window.alert; - const fileExtension = file.name.split(".").pop() || ""; - const extensionFileError = checkExtension(fileExtension); + const onFileUploadError = onFileError || window.alert + const fileExtension = file.name.split(".").pop() || "" + const extensionFileError = checkExtension(fileExtension) if (extensionFileError) { - return onFileUploadError(extensionFileError); + return onFileUploadError(extensionFileError) } if (isFileSizeExceeded(file)) { return onFileUploadError( - `File size exceeded. Limit is ${fileSizeLimit / 1024 / 1024} MB`, - ); + `File size exceeded. Limit is ${fileSizeLimit / 1024 / 1024} MB` + ) } - await onFileUpload(file); - }; + await onFileUpload(file) + } return (
@@ -91,7 +93,7 @@ export default function FileUploader({ className={cn( buttonVariants({ variant: "secondary", size: "icon" }), "cursor-pointer", - uploading && "opacity-50", + uploading && "opacity-50" )} > {uploading ? ( @@ -101,5 +103,5 @@ export default function FileUploader({ )}
- ); + ) } diff --git a/apps/www/registry/default/ui/upload-image-preview.tsx b/apps/www/registry/default/ui/upload-image-preview.tsx index b809056..4528e65 100644 --- a/apps/www/registry/default/ui/upload-image-preview.tsx +++ b/apps/www/registry/default/ui/upload-image-preview.tsx @@ -1,13 +1,14 @@ -import { XCircleIcon } from "lucide-react"; -import Image from "next/image"; +import Image from "next/image" +import { XCircleIcon } from "lucide-react" + import { cn } from "@/lib/utils" export default function UploadImagePreview({ url, onRemove, }: { - url: string; - onRemove: () => void; + url: string + onRemove: () => void }) { return (
@@ -19,7 +20,7 @@ export default function UploadImagePreview({ />
- ); + ) } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 268ad73..a1731f5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -279,8 +279,8 @@ importers: specifier: ^4.0.0 version: 4.0.0 remark-math: - specifier: ^5.1.1 - version: 5.1.1 + specifier: ^6.0.0 + version: 6.0.0 sharp: specifier: ^0.31.3 version: 0.31.3 @@ -7758,12 +7758,18 @@ packages: - supports-color dev: false - /mdast-util-math@2.0.2: - resolution: {integrity: sha512-8gmkKVp9v6+Tgjtq6SYx9kGPpTf6FVYRa53/DLh479aldR9AyP48qeVOgNZ5X7QUK7nOy4yw7vg6mbiGcs9jWQ==} + /mdast-util-math@3.0.0: + resolution: {integrity: sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w==} dependencies: - '@types/mdast': 3.0.11 + '@types/hast': 3.0.3 + '@types/mdast': 4.0.3 + devlop: 1.1.0 longest-streak: 3.1.0 - mdast-util-to-markdown: 1.5.0 + mdast-util-from-markdown: 2.0.0 + mdast-util-to-markdown: 2.1.0 + unist-util-remove-position: 5.0.0 + transitivePeerDependencies: + - supports-color dev: false /mdast-util-mdx-expression@1.3.2: @@ -8148,16 +8154,16 @@ packages: micromark-util-types: 2.0.0 dev: false - /micromark-extension-math@2.1.2: - resolution: {integrity: sha512-es0CcOV89VNS9wFmyn+wyFTKweXGW4CEvdaAca6SWRWPyYCbBisnjaHLjWO4Nszuiud84jCpkHsqAJoa768Pvg==} + /micromark-extension-math@3.0.0: + resolution: {integrity: sha512-iJ2Q28vBoEovLN5o3GO12CpqorQRYDPT+p4zW50tGwTfJB+iv/VnB6Ini+gqa24K97DwptMBBIvVX6Bjk49oyQ==} dependencies: '@types/katex': 0.16.5 + devlop: 1.1.0 katex: 0.16.9 - micromark-factory-space: 1.0.0 - micromark-util-character: 1.1.0 - micromark-util-symbol: 1.0.1 - micromark-util-types: 1.0.2 - uvu: 0.5.6 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 dev: false /micromark-extension-mdx-expression@1.0.5: @@ -9889,13 +9895,15 @@ packages: - supports-color dev: false - /remark-math@5.1.1: - resolution: {integrity: sha512-cE5T2R/xLVtfFI4cCePtiRn+e6jKMtFDR3P8V3qpv8wpKjwvHoBA4eJzvX+nVrnlNy0911bdGmuspCSwetfYHw==} + /remark-math@6.0.0: + resolution: {integrity: sha512-MMqgnP74Igy+S3WwnhQ7kqGlEerTETXMvJhrUzDikVZ2/uogJCb+WHUg97hK9/jcfc0dkD73s3LN8zU49cTEtA==} dependencies: - '@types/mdast': 3.0.11 - mdast-util-math: 2.0.2 - micromark-extension-math: 2.1.2 - unified: 10.1.2 + '@types/mdast': 4.0.3 + mdast-util-math: 3.0.0 + micromark-extension-math: 3.0.0 + unified: 11.0.4 + transitivePeerDependencies: + - supports-color dev: false /remark-mdx-frontmatter@1.1.1: From 25bbd401ed1933d71cd6bbb479712e81f985170c Mon Sep 17 00:00:00 2001 From: Yasin Date: Wed, 24 Jan 2024 23:04:20 +0100 Subject: [PATCH 4/5] fix: update mdast-util-toc@7 --- apps/www/package.json | 2 +- pnpm-lock.yaml | 37 ++++++++++++++++--------------------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/apps/www/package.json b/apps/www/package.json index 7758db7..89a8cc9 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -89,7 +89,7 @@ "@types/react-syntax-highlighter": "^15.5.6", "esbuild": "^0.17.19", "eslint": "^8.41.0", - "mdast-util-toc": "^6.1.1", + "mdast-util-toc": "^7.0.0", "postcss": "^8.4.24", "rehype": "^12.0.1", "rehype-autolink-headings": "^6.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a1731f5..e7c1c23 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -319,8 +319,8 @@ importers: specifier: ^8.41.0 version: 8.41.0 mdast-util-toc: - specifier: ^6.1.1 - version: 6.1.1 + specifier: ^7.0.0 + version: 7.0.0 postcss: specifier: ^8.4.24 version: 8.4.24 @@ -3916,10 +3916,6 @@ packages: resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==} dev: false - /@types/extend@3.0.1: - resolution: {integrity: sha512-R1g/VyKFFI2HLC1QGAeTtCBWCo6n75l41OnsVYNbmKG+kempOESaodf6BeJyUM3Q0rKa/NQcTHbB2+66lNnxLw==} - dev: true - /@types/fs-extra@11.0.1: resolution: {integrity: sha512-MxObHvNl4A69ofaTRU8DFqvgzzv8s9yRtaPPm5gud9HDNvpB3GPQFvNuTWAI59B9huVGV5jXYJwbCsmBsOGYWA==} dependencies: @@ -3982,12 +3978,12 @@ packages: resolution: {integrity: sha512-Y/uImid8aAwrEA24/1tcRZwpxX3pIFTSilcNDKSPn+Y2iDywSEachzRuvgAYYLR3wpGXAsMbv5lvKLDZLeYPAw==} dependencies: '@types/unist': 2.0.6 + dev: false /@types/mdast@4.0.3: resolution: {integrity: sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==} dependencies: '@types/unist': 3.0.2 - dev: false /@types/mdx@2.0.5: resolution: {integrity: sha512-76CqzuD6Q7LC+AtbPqrvD9AqsN0k8bsYo2bM2J8pmNldP1aIPAbzUQ7QbobyXL4eLr1wK5x8FZFe8eF/ubRuBg==} @@ -4089,12 +4085,15 @@ packages: resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} dev: false + /@types/ungap__structured-clone@0.3.3: + resolution: {integrity: sha512-RNmhIPwoip6K/zZOv3ypksTAqaqLEXvlNSXKyrC93xMSOAHZCR7PifW6xKZCwkbbnbM9dwB9X56PPoNTlNwEqw==} + dev: true + /@types/unist@2.0.6: resolution: {integrity: sha512-PBjIUxZHOuj0R15/xuwJYjFi+KZdNFrehocChv4g5hu6aFroHue8m0lBP0POdK2nKzbw0cgV1mws8+V/JAcEkQ==} /@types/unist@3.0.2: resolution: {integrity: sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==} - dev: false /@types/yoga-layout@1.9.2: resolution: {integrity: sha512-S9q47ByT2pPvD65IvrWp7qppVMpk9WGMbVq9wbWZOHg6tnXSD4vyhao6nOSBwwfDdV2p3Kx9evA9vI+XWTfDvw==} @@ -4164,7 +4163,6 @@ packages: /@ungap/structured-clone@1.2.0: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - dev: false /@vercel/analytics@1.0.1: resolution: {integrity: sha512-Ux0c9qUfkcPqng3vrR0GTrlQdqNJ2JREn/2ydrVuKwM3RtMfF2mWX31Ijqo1opSjNAq6rK76PwtANw6kl6TAow==} @@ -7944,23 +7942,23 @@ packages: resolution: {integrity: sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==} dependencies: '@types/mdast': 3.0.11 + dev: false /mdast-util-to-string@4.0.0: resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} dependencies: '@types/mdast': 4.0.3 - dev: false - /mdast-util-toc@6.1.1: - resolution: {integrity: sha512-Er21728Kow8hehecK2GZtb7Ny3omcoPUVrmObiSUwmoRYVZaXLR751QROEFjR8W/vAQdHMLj49Lz20J55XaNpw==} + /mdast-util-toc@7.0.0: + resolution: {integrity: sha512-C28UcSqjmnWuvgT8d97qpaItHKvySqVPAECUzqQ51xuMyNFFJwcFoKW77KoMjtXrclTidLQFDzLUmTmrshRweA==} dependencies: - '@types/extend': 3.0.1 - '@types/mdast': 3.0.11 - extend: 3.0.2 + '@types/mdast': 4.0.3 + '@types/ungap__structured-clone': 0.3.3 + '@ungap/structured-clone': 1.2.0 github-slugger: 2.0.0 - mdast-util-to-string: 3.2.0 - unist-util-is: 5.2.1 - unist-util-visit: 4.1.2 + mdast-util-to-string: 4.0.0 + unist-util-is: 6.0.0 + unist-util-visit: 5.0.0 dev: true /mdx-bundler@9.2.1(esbuild@0.17.19): @@ -11149,7 +11147,6 @@ packages: resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} dependencies: '@types/unist': 3.0.2 - dev: false /unist-util-position-from-estree@1.1.2: resolution: {integrity: sha512-poZa0eXpS+/XpoQwGwl79UUdea4ol2ZuCYguVaJS4qzIOMDzbqz8a3erUCOmubSZkaOuGamb3tX790iwOIROww==} @@ -11210,7 +11207,6 @@ packages: dependencies: '@types/unist': 3.0.2 unist-util-is: 6.0.0 - dev: false /unist-util-visit@4.1.2: resolution: {integrity: sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==} @@ -11225,7 +11221,6 @@ packages: '@types/unist': 3.0.2 unist-util-is: 6.0.0 unist-util-visit-parents: 6.0.1 - dev: false /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} From db0533ff43351e95e55d872475141248bb1eb960 Mon Sep 17 00:00:00 2001 From: Yasin Date: Wed, 24 Jan 2024 23:12:17 +0100 Subject: [PATCH 5/5] fix: update remark-parse@11 --- apps/www/package.json | 1 + pnpm-lock.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/apps/www/package.json b/apps/www/package.json index 89a8cc9..4e80236 100644 --- a/apps/www/package.json +++ b/apps/www/package.json @@ -75,6 +75,7 @@ "remark-code-import": "^1.2.0", "remark-gfm": "^4.0.0", "remark-math": "^6.0.0", + "remark-parse": "11", "sharp": "^0.31.3", "tailwind-merge": "^1.12.0", "vaul": "^0.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e7c1c23..1570051 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -281,6 +281,9 @@ importers: remark-math: specifier: ^6.0.0 version: 6.0.0 + remark-parse: + specifier: '11' + version: 11.0.0 sharp: specifier: ^0.31.3 version: 0.31.3