@rolder/kit 3.0.0-alpha.44 → 3.0.0-alpha.45

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.
@@ -1,2 +1,7 @@
1
1
  import { type StackProps } from '@mantine/core';
2
- export declare const Messages: ({ children, ...props }: StackProps) => import("react/jsx-runtime").JSX.Element;
2
+ import type { ReactNode } from 'react';
3
+ type MessagesProps = Omit<StackProps, 'children'> & {
4
+ children: (messageId: string) => ReactNode;
5
+ };
6
+ export declare const Messages: ({ children, ...props }: MessagesProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -1,9 +1,12 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Stack } from "@mantine/core";
3
+ import { useChatMessageIds } from "./store/index.js";
3
4
  const Messages = ({ children, ...props })=>{
4
- console.log('Messages render');
5
+ const messageIds = useChatMessageIds();
6
+ console.log('Messages render', messageIds);
5
7
  return /*#__PURE__*/ jsx(Stack, {
6
- ...props
8
+ ...props,
9
+ children: 'function' == typeof children ? messageIds.map((messageId)=>children(messageId)) : null
7
10
  });
8
11
  };
9
12
  export { Messages };
@@ -1,6 +1,8 @@
1
1
  export declare const Chat: {
2
2
  Root: ({ children, scrollAreaProps, withScrollButton, ...props }: import("./Root").ConversationRootProps) => import("react/jsx-runtime").JSX.Element;
3
- Messages: ({ children, ...props }: import("@mantine/core").StackProps) => import("react/jsx-runtime").JSX.Element;
3
+ Messages: ({ children, ...props }: Omit<import("@mantine/core").StackProps, "children"> & {
4
+ children: (messageId: string) => import("react").ReactNode;
5
+ }) => import("react/jsx-runtime").JSX.Element;
4
6
  Message: import("react").MemoExoticComponent<({ messageId }: {
5
7
  messageId: string;
6
8
  }) => import("react/jsx-runtime").JSX.Element | null>;
@@ -50,7 +50,6 @@ const useChatMessageIds = (props)=>{
50
50
  error?.message
51
51
  ]);
52
52
  useEffect(()=>{
53
- console.log('useChatMessageIds', sendMessage);
54
53
  setChatSendMessage(sendMessage);
55
54
  }, [
56
55
  sendMessage
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rolder/kit",
3
- "version": "3.0.0-alpha.44",
3
+ "version": "3.0.0-alpha.45",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {