@copilotkit/react-ui 1.56.2 → 1.56.4-canary.1777529757
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +16 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +7 -2
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +5 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +16 -9
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +16 -9
- package/dist/index.umd.js.map +1 -1
- package/package.json +6 -6
- package/src/components/chat/Markdown.tsx +20 -17
- package/src/css/messages.css +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@copilotkit/react-ui",
|
|
3
|
-
"version": "1.56.
|
|
3
|
+
"version": "1.56.4-canary.1777529757",
|
|
4
4
|
"private": false,
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"rehype-raw": "^7.0.0",
|
|
49
49
|
"remark-gfm": "^4.0.1",
|
|
50
50
|
"remark-math": "^6.0.0",
|
|
51
|
-
"@copilotkit/react-core": "1.56.
|
|
52
|
-
"@copilotkit/
|
|
53
|
-
"@copilotkit/
|
|
51
|
+
"@copilotkit/react-core": "1.56.4-canary.1777529757",
|
|
52
|
+
"@copilotkit/shared": "1.56.4-canary.1777529757",
|
|
53
|
+
"@copilotkit/runtime-client-gql": "1.56.4-canary.1777529757"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/react": "^19.1.0",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"tsdown": "^0.20.3",
|
|
63
63
|
"typescript": "^5.2.3",
|
|
64
64
|
"vitest": "^3.2.4",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
65
|
+
"tsconfig": "1.4.12",
|
|
66
|
+
"tailwind-config": "1.4.12"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"react": "^18 || ^19 || ^19.0.0-rc"
|
|
@@ -122,39 +122,42 @@ const defaultComponents: Components = {
|
|
|
122
122
|
),
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
-
const MemoizedReactMarkdown: FC<Options> = memo(
|
|
126
|
-
ReactMarkdown,
|
|
127
|
-
(prevProps, nextProps) =>
|
|
128
|
-
prevProps.children === nextProps.children &&
|
|
129
|
-
prevProps.components === nextProps.components &&
|
|
130
|
-
prevProps.urlTransform === nextProps.urlTransform,
|
|
131
|
-
);
|
|
125
|
+
const MemoizedReactMarkdown: FC<Options> = memo(ReactMarkdown);
|
|
132
126
|
|
|
133
|
-
type MarkdownProps = {
|
|
127
|
+
type MarkdownProps = Omit<Options, "children"> & {
|
|
134
128
|
content: string;
|
|
135
|
-
components?: Components;
|
|
136
|
-
urlTransform?: Options["urlTransform"];
|
|
137
129
|
};
|
|
138
130
|
|
|
139
131
|
export const Markdown = ({
|
|
140
132
|
content,
|
|
141
133
|
components,
|
|
142
|
-
|
|
134
|
+
remarkPlugins,
|
|
135
|
+
rehypePlugins,
|
|
136
|
+
...rest
|
|
143
137
|
}: MarkdownProps) => {
|
|
144
138
|
const mergedComponents = useMemo(
|
|
145
139
|
() => ({ ...defaultComponents, ...components }),
|
|
146
140
|
[components],
|
|
147
141
|
);
|
|
142
|
+
const mergedRemarkPlugins = useMemo<Options["remarkPlugins"]>(
|
|
143
|
+
() => [
|
|
144
|
+
remarkGfm,
|
|
145
|
+
[remarkMath, { singleDollarTextMath: false }],
|
|
146
|
+
...(remarkPlugins ?? []),
|
|
147
|
+
],
|
|
148
|
+
[remarkPlugins],
|
|
149
|
+
);
|
|
150
|
+
const mergedRehypePlugins = useMemo<Options["rehypePlugins"]>(
|
|
151
|
+
() => [rehypeRaw, ...(rehypePlugins ?? [])],
|
|
152
|
+
[rehypePlugins],
|
|
153
|
+
);
|
|
148
154
|
return (
|
|
149
155
|
<div className="copilotKitMarkdown">
|
|
150
156
|
<MemoizedReactMarkdown
|
|
157
|
+
{...rest}
|
|
151
158
|
components={mergedComponents}
|
|
152
|
-
remarkPlugins={
|
|
153
|
-
|
|
154
|
-
[remarkMath, { singleDollarTextMath: false }],
|
|
155
|
-
]}
|
|
156
|
-
rehypePlugins={[rehypeRaw]}
|
|
157
|
-
{...(urlTransform !== undefined ? { urlTransform } : {})}
|
|
159
|
+
remarkPlugins={mergedRemarkPlugins}
|
|
160
|
+
rehypePlugins={mergedRehypePlugins}
|
|
158
161
|
>
|
|
159
162
|
{content}
|
|
160
163
|
</MemoizedReactMarkdown>
|
package/src/css/messages.css
CHANGED
|
@@ -208,10 +208,15 @@
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
.copilotKitImageRenderingImage {
|
|
211
|
-
max-width:
|
|
211
|
+
max-width: 80px;
|
|
212
|
+
max-height: 80px;
|
|
213
|
+
width: auto;
|
|
212
214
|
height: auto;
|
|
213
|
-
|
|
215
|
+
object-fit: cover;
|
|
216
|
+
border-radius: 12px;
|
|
217
|
+
background-color: var(--copilot-kit-input-background-color);
|
|
214
218
|
box-shadow: var(--copilot-kit-shadow-sm);
|
|
219
|
+
cursor: pointer;
|
|
215
220
|
}
|
|
216
221
|
|
|
217
222
|
.copilotKitImageRenderingContent {
|