@connectycube/chat-widget 0.30.2 → 0.32.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.
Files changed (26) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +24 -13
  3. package/dist/connectycube-chat-widget-sw.js +26 -1
  4. package/dist/index.es.js +7546 -7217
  5. package/dist/index.umd.js +46 -46
  6. package/dist/react19/connectycube-chat-widget-sw.js +26 -1
  7. package/dist/react19/index.es.js +6762 -6433
  8. package/dist/react19/types/components/home/main/message/message-attachment.d.ts +3 -2
  9. package/dist/react19/types/components/home/main/message/message-url-preview.d.ts +1 -0
  10. package/dist/react19/types/components/home/main/message/message.d.ts +2 -0
  11. package/dist/react19/types/components/home/sidebar/chat-item.d.ts +1 -0
  12. package/dist/react19/types/components/home/sidebar/chats-list.d.ts +1 -4
  13. package/dist/react19/types/helpers/widget.d.ts +1 -0
  14. package/dist/react19/types/hooks/store/useLinkPreviewStore.d.ts +1 -0
  15. package/dist/react19/types/index.d.ts +9 -0
  16. package/dist/react19/types/locales/en/translation.json.d.ts +1 -1
  17. package/dist/types/components/home/main/message/message-attachment.d.ts +3 -2
  18. package/dist/types/components/home/main/message/message-url-preview.d.ts +1 -0
  19. package/dist/types/components/home/main/message/message.d.ts +2 -0
  20. package/dist/types/components/home/sidebar/chat-item.d.ts +1 -0
  21. package/dist/types/components/home/sidebar/chats-list.d.ts +1 -4
  22. package/dist/types/helpers/widget.d.ts +1 -0
  23. package/dist/types/hooks/store/useLinkPreviewStore.d.ts +1 -0
  24. package/dist/types/index.d.ts +9 -0
  25. package/dist/types/locales/en/translation.json.d.ts +1 -1
  26. package/package.json +25 -25
@@ -3,6 +3,7 @@ import { default as React } from 'react';
3
3
  export interface MessageAttachmentProps {
4
4
  attachment: Messages.Attachment;
5
5
  uploading: boolean;
6
+ stickToBottom?: (skipOnce?: boolean) => void;
6
7
  }
7
- declare const MessageAttachment: React.FC<MessageAttachmentProps>;
8
- export default MessageAttachment;
8
+ declare const _default: React.NamedExoticComponent<MessageAttachmentProps>;
9
+ export default _default;
@@ -1,6 +1,7 @@
1
1
  type MessageUrlPreviewProps = {
2
2
  message: string;
3
3
  id: string;
4
+ stickToBottom?: (skipOnce?: boolean) => void;
4
5
  };
5
6
  declare const MessageUrlPreview: React.FC<MessageUrlPreviewProps>;
6
7
  export default MessageUrlPreview;
@@ -8,6 +8,8 @@ export interface MessageProps {
8
8
  isPlaceholder: boolean;
9
9
  isSameUserSender: boolean;
10
10
  isCurrentUserSender: boolean;
11
+ enableUrlPreview?: boolean;
12
+ stickToBottom?: (id: string, skipOnce?: boolean) => void;
11
13
  }
12
14
  declare const Message: React.FC<MessageProps>;
13
15
  export default Message;
@@ -2,6 +2,7 @@ import { default as React } from 'react';
2
2
  import { Dialogs } from 'connectycube/types';
3
3
  export interface ChatItemProps {
4
4
  dialog: Dialogs.Dialog;
5
+ isFirstInList?: boolean;
5
6
  }
6
7
  declare const ChatItem: React.FC<ChatItemProps>;
7
8
  export default ChatItem;
@@ -1,6 +1,3 @@
1
1
  import { default as React } from 'react';
2
- export interface ChatsListProps {
3
- searchTerm?: string;
4
- }
5
- declare const _default: React.NamedExoticComponent<ChatsListProps>;
2
+ declare const _default: React.NamedExoticComponent<{}>;
6
3
  export default _default;
@@ -1,5 +1,6 @@
1
1
  export declare const sleep: (ms: number) => Promise<void>;
2
2
  export declare const stripSpecificTailwindSupports: (css: string) => string;
3
+ export declare const isBrowser: boolean;
3
4
  export declare enum dataPrefix {
4
5
  WRAPPER = "data-connectycube-chat-widget-wrapper",
5
6
  FOCUSED = "data-connectycube-chat-widget-focused"
@@ -6,6 +6,7 @@ export type LinkPreview = {
6
6
  [key: string]: string | string[];
7
7
  };
8
8
  interface LinkPreviewStore {
9
+ fetchedCount: number;
9
10
  queue: string[];
10
11
  urlPreviews: Map<string, LinkPreview>;
11
12
  isProcessing: boolean;
@@ -1 +1,10 @@
1
+ export type ChatWidgetInWindow = {
2
+ initialNotification?: MessageEvent['data'];
3
+ open?: () => void;
4
+ close?: () => void;
5
+ toggle?: () => void;
6
+ };
7
+ export type WindowWithChatWidget = Window & typeof globalThis & {
8
+ ConnectyCubeChatWidget?: ChatWidgetInWindow;
9
+ };
1
10
  export { default } from './App';
@@ -69,7 +69,7 @@ declare const _default: {
69
69
  "Accept": "Accept",
70
70
  "Reject": "Reject",
71
71
  "RejectedCall": "{{name}} rejected the call",
72
- "MissedCall": "Messed call from {{name}}"
72
+ "MissedCall": "Missed call from {{name}}"
73
73
  }
74
74
  ;
75
75
 
@@ -3,6 +3,7 @@ import { default as React } from 'react';
3
3
  export interface MessageAttachmentProps {
4
4
  attachment: Messages.Attachment;
5
5
  uploading: boolean;
6
+ stickToBottom?: (skipOnce?: boolean) => void;
6
7
  }
7
- declare const MessageAttachment: React.FC<MessageAttachmentProps>;
8
- export default MessageAttachment;
8
+ declare const _default: React.NamedExoticComponent<MessageAttachmentProps>;
9
+ export default _default;
@@ -1,6 +1,7 @@
1
1
  type MessageUrlPreviewProps = {
2
2
  message: string;
3
3
  id: string;
4
+ stickToBottom?: (skipOnce?: boolean) => void;
4
5
  };
5
6
  declare const MessageUrlPreview: React.FC<MessageUrlPreviewProps>;
6
7
  export default MessageUrlPreview;
@@ -8,6 +8,8 @@ export interface MessageProps {
8
8
  isPlaceholder: boolean;
9
9
  isSameUserSender: boolean;
10
10
  isCurrentUserSender: boolean;
11
+ enableUrlPreview?: boolean;
12
+ stickToBottom?: (id: string, skipOnce?: boolean) => void;
11
13
  }
12
14
  declare const Message: React.FC<MessageProps>;
13
15
  export default Message;
@@ -2,6 +2,7 @@ import { default as React } from 'react';
2
2
  import { Dialogs } from 'connectycube/types';
3
3
  export interface ChatItemProps {
4
4
  dialog: Dialogs.Dialog;
5
+ isFirstInList?: boolean;
5
6
  }
6
7
  declare const ChatItem: React.FC<ChatItemProps>;
7
8
  export default ChatItem;
@@ -1,6 +1,3 @@
1
1
  import { default as React } from 'react';
2
- export interface ChatsListProps {
3
- searchTerm?: string;
4
- }
5
- declare const _default: React.NamedExoticComponent<ChatsListProps>;
2
+ declare const _default: React.NamedExoticComponent<{}>;
6
3
  export default _default;
@@ -1,5 +1,6 @@
1
1
  export declare const sleep: (ms: number) => Promise<void>;
2
2
  export declare const stripSpecificTailwindSupports: (css: string) => string;
3
+ export declare const isBrowser: boolean;
3
4
  export declare enum dataPrefix {
4
5
  WRAPPER = "data-connectycube-chat-widget-wrapper",
5
6
  FOCUSED = "data-connectycube-chat-widget-focused"
@@ -6,6 +6,7 @@ export type LinkPreview = {
6
6
  [key: string]: string | string[];
7
7
  };
8
8
  interface LinkPreviewStore {
9
+ fetchedCount: number;
9
10
  queue: string[];
10
11
  urlPreviews: Map<string, LinkPreview>;
11
12
  isProcessing: boolean;
@@ -1 +1,10 @@
1
+ export type ChatWidgetInWindow = {
2
+ initialNotification?: MessageEvent['data'];
3
+ open?: () => void;
4
+ close?: () => void;
5
+ toggle?: () => void;
6
+ };
7
+ export type WindowWithChatWidget = Window & typeof globalThis & {
8
+ ConnectyCubeChatWidget?: ChatWidgetInWindow;
9
+ };
1
10
  export { default } from './App';
@@ -69,7 +69,7 @@ declare const _default: {
69
69
  "Accept": "Accept",
70
70
  "Reject": "Reject",
71
71
  "RejectedCall": "{{name}} rejected the call",
72
- "MissedCall": "Messed call from {{name}}"
72
+ "MissedCall": "Missed call from {{name}}"
73
73
  }
74
74
  ;
75
75
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@connectycube/chat-widget",
3
3
  "description": "A React component that seamlessly integrates ConnectyCube's real-time chat capabilities into your web applications. This widget offers an out-of-the-box solution for embedding chat features—such as instant messaging, user presence, and file sharing—without the overhead of building a complete chat system from scratch.",
4
- "version": "0.30.2",
4
+ "version": "0.32.0",
5
5
  "license": "GPL-3.0-only",
6
6
  "homepage": "https://github.com/ConnectyCube/connectycube-chat-widget#readme",
7
7
  "bugs": {
@@ -79,8 +79,8 @@
79
79
  "version": "sh ./fetch-version.sh"
80
80
  },
81
81
  "dependencies": {
82
- "@connectycube/use-calls": "^0.11.1",
83
- "@connectycube/use-chat": "^0.26.0",
82
+ "@connectycube/use-calls": "^0.12.0",
83
+ "@connectycube/use-chat": "^0.26.1",
84
84
  "@radix-ui/react-alert-dialog": "^1.1.14",
85
85
  "@radix-ui/react-avatar": "^1.1.10",
86
86
  "@radix-ui/react-dialog": "^1.1.14",
@@ -92,54 +92,54 @@
92
92
  "@radix-ui/react-tooltip": "^1.2.7",
93
93
  "class-variance-authority": "^0.7.1",
94
94
  "clsx": "^2.1.1",
95
- "connectycube": "^4.6.0",
95
+ "connectycube": "^4.7.0",
96
96
  "get-browser-fingerprint": "^4.1.0",
97
- "i18next": "^25.2.1",
98
- "jsdom": "^26.1.0",
97
+ "i18next": "^25.3.0",
99
98
  "linkify-react": "^4.3.1",
100
99
  "linkifyjs": "^4.3.1",
101
- "lucide-react": "^0.517.0",
100
+ "lucide-react": "^0.525.0",
102
101
  "next-themes": "^0.4.6",
103
- "react-hook-form": "^7.58.1",
102
+ "react-hook-form": "^7.59.0",
104
103
  "react-i18next": "^15.5.3",
105
104
  "react-icons": "^5.5.0",
106
105
  "react-intersection-observer": "^9.16.0",
107
106
  "react-player": "^2.16.0",
108
107
  "sonner": "^2.0.5",
109
- "zustand": "^5.0.5"
108
+ "virtua": "^0.41.5",
109
+ "zustand": "^5.0.6"
110
110
  },
111
111
  "peerDependencies": {
112
- "react": "^18 || ^19",
113
- "react-dom": "^18 || ^19"
112
+ "react": ">=18",
113
+ "react-dom": ">=18"
114
114
  },
115
115
  "devDependencies": {
116
- "@eslint/js": "^9.29.0",
117
- "@tailwindcss/postcss": "^4.1.10",
118
- "@tailwindcss/vite": "^4.1.10",
119
- "@types/node": "^24.0.3",
116
+ "@eslint/js": "^9.30.1",
117
+ "@tailwindcss/postcss": "^4.1.11",
118
+ "@tailwindcss/vite": "^4.1.11",
119
+ "@types/node": "^24.0.10",
120
120
  "@types/react": "^19.1.8",
121
121
  "@types/react-dom": "^19.1.6",
122
- "@vitejs/plugin-react": "^4.5.2",
122
+ "@vitejs/plugin-react": "^4.6.0",
123
123
  "@vitest/coverage-v8": "^3.2.4",
124
- "eslint": "^9.29.0",
124
+ "eslint": "^9.30.1",
125
125
  "eslint-plugin-react-hooks": "^5.2.0",
126
126
  "eslint-plugin-react-refresh": "^0.4.20",
127
- "globals": "^16.2.0",
128
- "prettier": "3.5.3",
127
+ "globals": "^16.3.0",
128
+ "jsdom": "^26.1.0",
129
+ "prettier": "3.6.2",
129
130
  "tailwind-merge": "^3.3.1",
130
131
  "tailwind-scrollbar": "^4.0.2",
131
- "tailwindcss": "^4.1.10",
132
+ "tailwindcss": "^4.1.11",
132
133
  "tw-animate-css": "^1.3.4",
133
134
  "typescript": "^5.8.3",
134
- "typescript-eslint": "^8.34.1",
135
- "vite": "^6.3.5",
136
- "vite-plugin-css-injected-by-js": "^3.5.2",
135
+ "typescript-eslint": "^8.35.1",
136
+ "vite": "^7.0.0",
137
137
  "vite-plugin-dts": "^4.5.4",
138
138
  "vitest": "^3.2.4"
139
139
  },
140
140
  "optionalDependencies": {
141
- "@rollup/rollup-linux-x64-gnu": "4.43.0",
142
- "@tailwindcss/oxide-linux-x64-gnu": "^4.1.10",
141
+ "@rollup/rollup-linux-x64-gnu": "4.44.1",
142
+ "@tailwindcss/oxide-linux-x64-gnu": "^4.1.11",
143
143
  "lightningcss-linux-x64-gnu": "^1.30.1"
144
144
  },
145
145
  "engines": {