vzcode 2.6.0 → 2.7.0

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.html CHANGED
@@ -20,7 +20,7 @@
20
20
  href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap"
21
21
  rel="stylesheet"
22
22
  />
23
- <script type="module" crossorigin src="/assets/index-Bfp1zhR4.js"></script>
23
+ <script type="module" crossorigin src="/assets/index-DL2VQRps.js"></script>
24
24
  <link rel="stylesheet" crossorigin href="/assets/index-Bjj9VRMn.css">
25
25
  </head>
26
26
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vzcode",
3
- "version": "2.6.0",
3
+ "version": "2.7.0",
4
4
  "description": "Multiplayer code editor system",
5
5
  "main": "src/index.ts",
6
6
  "type": "module",
@@ -199,14 +199,14 @@ export type VZCodeContextValue = {
199
199
  } | null;
200
200
 
201
201
  // Additional widgets that can be rendered in AI chat messages
202
- additionalWidgets?: React.ComponentType<{
202
+ additionalWidgets?: (props: {
203
203
  messageId: string;
204
204
  chatId: string;
205
205
  handleSendMessage?: (
206
206
  messageToSend?: string,
207
207
  options?: Record<string, string>,
208
208
  ) => void;
209
- }>;
209
+ }) => React.ReactNode;
210
210
  };
211
211
 
212
212
  export interface VZCodeProviderProps {
@@ -239,10 +239,14 @@ export interface VZCodeProviderProps {
239
239
  prompt: string;
240
240
  modelName: string;
241
241
  } | null;
242
- additionalWidgets?: React.ComponentType<{
242
+ additionalWidgets?: (props: {
243
243
  messageId: string;
244
244
  chatId: string;
245
- }>;
245
+ handleSendMessage?: (
246
+ messageToSend?: string,
247
+ options?: Record<string, string>,
248
+ ) => void;
249
+ }) => React.ReactNode;
246
250
  iframeRef?: React.MutableRefObject<HTMLIFrameElement>;
247
251
  handleChatError?: (
248
252
  error: string,
@@ -63,7 +63,7 @@ const MessageComponent = ({
63
63
  )}
64
64
  {additionalWidgets &&
65
65
  chatId &&
66
- React.createElement(additionalWidgets, {
66
+ additionalWidgets({
67
67
  messageId: id,
68
68
  chatId: chatId,
69
69
  handleSendMessage,