@connectycube/chat-widget 0.36.1 → 0.37.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 (35) hide show
  1. package/dist/index.es.js +9802 -3634
  2. package/dist/index.umd.js +155 -99
  3. package/dist/react18.es.js +10020 -3852
  4. package/dist/types/App.d.ts +1 -1
  5. package/dist/types/components/calls/calls-nav-buttons.d.ts +5 -0
  6. package/dist/types/components/calls/calls-screen.d.ts +2 -0
  7. package/dist/types/components/connectycube-ui/stream-view.d.ts +47 -0
  8. package/dist/types/components/connectycube-ui/utils.d.ts +3 -0
  9. package/dist/types/components/home/main/chat-info-user.d.ts +1 -1
  10. package/dist/types/components/home/main/chat-input.d.ts +2 -2
  11. package/dist/types/components/home/main/message/call-message.d.ts +1 -1
  12. package/dist/types/components/home/main/message/message-attachment.d.ts +1 -1
  13. package/dist/types/components/home/main/message/message-status-mark.d.ts +1 -1
  14. package/dist/types/components/home/main/message/message.d.ts +1 -1
  15. package/dist/types/components/home/main/my-profile/my-block-list-item.d.ts +1 -1
  16. package/dist/types/components/home/sidebar/chat-item.d.ts +1 -1
  17. package/dist/types/components/home/sidebar/new-chat/create-group-chat/create-group-chat.d.ts +1 -1
  18. package/dist/types/helpers/connectycube.d.ts +2 -2
  19. package/dist/types/helpers/widget.d.ts +1 -1
  20. package/dist/types/hooks/store/useAppDefaultChatStore.d.ts +1 -0
  21. package/dist/types/hooks/store/useProfileStore.d.ts +2 -2
  22. package/dist/types/hooks/useAppAuthorization.d.ts +1 -1
  23. package/dist/types/hooks/useCallHistory.d.ts +3 -3
  24. package/dist/types/hooks/useNotification.d.ts +1 -1
  25. package/dist/types/hooks/useTypingStatusText.d.ts +1 -1
  26. package/dist/types/lib/utils.d.ts +1 -1
  27. package/package.json +30 -31
  28. package/dist/types/components/calls/calls-fullscreen-stream.d.ts +0 -6
  29. package/dist/types/components/calls/calls-modal-screen.d.ts +0 -2
  30. package/dist/types/components/calls/calls-navigation/calls-nav-buttons.d.ts +0 -5
  31. package/dist/types/components/calls/calls-navigation/calls-nav-hung-up.d.ts +0 -2
  32. package/dist/types/components/calls/calls-navigation/calls-nav-screen-share.d.ts +0 -2
  33. package/dist/types/components/calls/calls-navigation/calls-nav-toggle-camera.d.ts +0 -2
  34. package/dist/types/components/calls/calls-navigation/calls-nav-toggle-mic.d.ts +0 -2
  35. /package/dist/types/components/calls/{calls-header-buttons.d.ts → calls-buttons.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { Config } from 'connectycube/types';
1
+ import { Config } from '@connectycube/react';
2
2
  import { AppPresets } from './hooks/useAppPresets';
3
3
  export type AppProps = AppPresets & {
4
4
  appId: number | string;
@@ -0,0 +1,5 @@
1
+ type CallsNavBarProps = {
2
+ customButton?: React.ReactNode;
3
+ };
4
+ declare const CallsNavBar: React.FC<CallsNavBarProps>;
5
+ export default CallsNavBar;
@@ -0,0 +1,2 @@
1
+ declare const CallsScreen: React.FC;
2
+ export default CallsScreen;
@@ -0,0 +1,47 @@
1
+ import { default as React } from 'react';
2
+ export type StreamViewProps = {
3
+ id?: string;
4
+ stream?: MediaStream | null;
5
+ mirror?: boolean;
6
+ } & React.VideoHTMLAttributes<HTMLVideoElement>;
7
+ export declare const StreamView: React.ForwardRefExoticComponent<{
8
+ id?: string;
9
+ stream?: MediaStream | null;
10
+ mirror?: boolean;
11
+ } & React.VideoHTMLAttributes<HTMLVideoElement> & React.RefAttributes<HTMLVideoElement>>;
12
+ export declare const LocalStreamView: React.ForwardRefExoticComponent<{
13
+ id?: string;
14
+ stream?: MediaStream | null;
15
+ mirror?: boolean;
16
+ } & React.VideoHTMLAttributes<HTMLVideoElement> & React.RefAttributes<HTMLVideoElement>>;
17
+ export declare const RemoteStreamView: React.ForwardRefExoticComponent<{
18
+ id?: string;
19
+ stream?: MediaStream | null;
20
+ mirror?: boolean;
21
+ } & React.VideoHTMLAttributes<HTMLVideoElement> & React.RefAttributes<HTMLVideoElement>>;
22
+ export type FullscreenStreamViewProps = {
23
+ element: React.ReactElement<StreamViewProps>;
24
+ pipElement?: React.ReactElement<StreamViewProps>;
25
+ navElement?: React.ReactElement<HTMLElement>;
26
+ hideIconElement?: React.ReactElement;
27
+ showIconElement?: React.ReactElement;
28
+ containerClassName?: string;
29
+ fullscreenButtonClassName?: string;
30
+ fullscreenButtonIconClassName?: string;
31
+ pipContainerClassName?: string;
32
+ pipButtonClassName?: string;
33
+ pipButtonIconClassName?: string;
34
+ containerProps?: React.HTMLAttributes<HTMLDivElement>;
35
+ fullscreenButtonProps?: React.HTMLAttributes<HTMLButtonElement>;
36
+ fullscreenButtonIconProps?: React.HTMLAttributes<SVGElement>;
37
+ pipContainerProps?: React.HTMLAttributes<HTMLDivElement>;
38
+ pipButtonProps?: React.HTMLAttributes<HTMLButtonElement>;
39
+ pipButtonIconProps?: React.HTMLAttributes<SVGElement>;
40
+ };
41
+ export type FullscreenStreamViewRef = {
42
+ isFullscreen: boolean;
43
+ isPictureInPicture: boolean;
44
+ toggleFullscreen: () => Promise<void>;
45
+ togglePictureInPicture: () => void;
46
+ };
47
+ export declare const FullscreenStreamView: React.ForwardRefExoticComponent<FullscreenStreamViewProps & React.RefAttributes<FullscreenStreamViewRef>>;
@@ -0,0 +1,3 @@
1
+ import { ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
3
+ export declare function getRandomString(length?: number): string;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { Users } from 'connectycube/types';
2
+ import { Users } from '@connectycube/react';
3
3
  export interface ChatInfoUserProps {
4
4
  user?: Users.User | null;
5
5
  }
@@ -1,8 +1,8 @@
1
1
  import { default as React } from 'react';
2
- import { Dialogs } from 'connectycube/types';
2
+ import { Dialogs } from '@connectycube/react';
3
3
  export interface ChatInputProps {
4
4
  onSendMessage: (message: string, dialog?: Dialogs.Dialog) => void;
5
- onSendMessageWithAttachment: (files: File[]) => void;
5
+ onSendAttachment: (files: File[]) => void;
6
6
  setTextareaScrollOffset: React.Dispatch<React.SetStateAction<number>>;
7
7
  }
8
8
  declare const _default: React.NamedExoticComponent<ChatInputProps>;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { CallType } from 'connectycube/types';
2
+ import { CallType } from '@connectycube/react';
3
3
  import { CallHistorySignal } from '../../../../hooks/useCallHistory';
4
4
  export interface CallMessageProps {
5
5
  signal: CallHistorySignal;
@@ -1,5 +1,5 @@
1
- import { Messages } from 'connectycube/types';
2
1
  import { default as React } from 'react';
2
+ import { Messages } from '@connectycube/react';
3
3
  export interface MessageAttachmentProps {
4
4
  attachment: Messages.Attachment;
5
5
  uploading: boolean;
@@ -1,4 +1,4 @@
1
- import { MessageStatus } from '@connectycube/use-chat';
1
+ import { MessageStatus } from '@connectycube/react';
2
2
  type MessageStatusMarkProps = {
3
3
  status: MessageStatus;
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { Messages } from 'connectycube/types';
2
+ import { Messages } from '@connectycube/react';
3
3
  export interface MessageProps {
4
4
  message: Messages.Message;
5
5
  senderName?: string;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { Users } from 'connectycube/types';
2
+ import { Users } from '@connectycube/react';
3
3
  export interface MyBlockListItemProps {
4
4
  user?: Users.User;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { Dialogs } from 'connectycube/types';
2
+ import { Dialogs } from '@connectycube/react';
3
3
  export interface ChatItemProps {
4
4
  dialog: Dialogs.Dialog;
5
5
  isFirstInList?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { Users } from 'connectycube/types';
2
+ import { Users } from '@connectycube/react';
3
3
  export interface CreateGroupChatProps {
4
4
  users: Users.User[];
5
5
  onCreateChat: (name: string) => Promise<void>;
@@ -1,4 +1,4 @@
1
- import { Config, Users, Auth, Chat, EmptyResponse, PushNotifications } from 'connectycube/types';
1
+ import { Config, Users, Auth, Chat, EmptyResponse, PushNotifications } from '@connectycube/react';
2
2
  import { PushSubscriptionData } from './notifications';
3
3
  export declare enum SIGNAL {
4
4
  UPDATE_USER = "user/UPDATE"
@@ -45,7 +45,7 @@ export declare const sha256: (str: string) => Promise<string>;
45
45
  export declare const getUserName: (user: Users.User | null | undefined, force?: boolean) => string;
46
46
  export declare const getPhotoUrl: (photoOrAvatar?: string | null) => string;
47
47
  export declare const generateConnectyCubeLogin: (userId?: string) => string;
48
- export declare const createUserReport: (reportedUserId: number, reason: string) => Promise<import("connectycube/types").Data.DataRecord>;
48
+ export declare const createUserReport: (reportedUserId: number, reason: string) => Promise<import("connectycube").Data.DataRecord>;
49
49
  export declare const subscribeToPushNotifications: (pushSubscriptionData?: PushSubscriptionData) => Promise<PushNotifications.Subscription | undefined>;
50
50
  export declare const unsubscribeFromPushNotifications: () => Promise<EmptyResponse[]>;
51
51
  export declare const isCallsSupported: boolean;
@@ -1,4 +1,4 @@
1
- import { Users } from 'connectycube/types';
1
+ import { Users } from '@connectycube/react';
2
2
  export declare const buildExternalIdFromUsers: (users?: Users.User[]) => string;
3
3
  export declare const sleep: (ms: number) => Promise<void>;
4
4
  export declare const stripSpecificTailwindSupports: (css: string) => string;
@@ -13,6 +13,7 @@ export type DefaultChat = {
13
13
  };
14
14
  };
15
15
  export type SingleViewChat = {
16
+ externalId?: string;
16
17
  opponentUserIds: string | string[];
17
18
  name?: string;
18
19
  photo?: string;
@@ -1,7 +1,7 @@
1
1
  interface ProfileState {
2
2
  visible: boolean;
3
- userId?: number;
4
- showProfile: (userId?: number) => void;
3
+ userId?: number | null;
4
+ showProfile: (userId?: number | null) => void;
5
5
  hideProfile: () => void;
6
6
  }
7
7
  declare const useProfileStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ProfileState>>;
@@ -1,4 +1,4 @@
1
- import { Config } from 'connectycube/types';
1
+ import { Config } from '@connectycube/react';
2
2
  type AppUser = {
3
3
  id?: string;
4
4
  name?: string;
@@ -7,9 +7,9 @@ export declare enum CallHistorySignal {
7
7
  }
8
8
  export type CallHistoryHook = {
9
9
  sendAcceptCall: () => void;
10
- sendRejectCall: () => void;
11
- sendHungUpCall: () => void;
12
- sendNotAnswerCall: () => void;
10
+ sendRejectCall: (userId?: number) => void;
11
+ sendHungUpCall: (userId?: number) => void;
12
+ sendNotAnswerCall: (userId?: number) => void;
13
13
  };
14
14
  declare function useCallHistory(): CallHistoryHook;
15
15
  export default useCallHistory;
@@ -1,4 +1,4 @@
1
- import { Chat } from 'connectycube/types';
1
+ import { Chat } from '@connectycube/react';
2
2
  type NotificationHook = {
3
3
  showNotification: (title?: string, body?: string, icon?: string) => Promise<Notification | void>;
4
4
  notifyWithSound: (title?: string, body?: string, icon?: string) => Promise<Notification | void>;
@@ -1,3 +1,3 @@
1
- import { Dialogs } from 'connectycube/types';
1
+ import { Dialogs } from '@connectycube/react';
2
2
  declare function useTypingStatusText(dialog?: Dialogs.Dialog, reverse?: boolean): string | undefined;
3
3
  export default useTypingStatusText;
@@ -1,4 +1,4 @@
1
- import { Dialogs } from 'connectycube/types';
1
+ import { Dialogs } from '@connectycube/react';
2
2
  import { ClassValue } from 'clsx';
3
3
  export declare function cn(...inputs: ClassValue[]): string;
4
4
  export declare function createTempChat(id: string, name: string, type: 3 | 2, occupantsIds: number[], currentUserId: number, photo?: string, extensions?: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@connectycube/chat-widget",
3
3
  "description": "A customizable React chat widget built on the ConnectyCube platform, enabling real-time messaging, calls, and user engagement in any web app.",
4
- "version": "0.36.1",
4
+ "version": "0.37.0",
5
5
  "license": "GPL-3.0-only",
6
6
  "homepage": "https://github.com/ConnectyCube/connectycube-chat-widget/chat-widget#readme",
7
7
  "bugs": {
@@ -85,9 +85,8 @@
85
85
  "coverage": "vitest run --coverage"
86
86
  },
87
87
  "dependencies": {
88
- "@ai-sdk/google": "^2.0.17",
89
- "@connectycube/use-calls": "^0.12.1",
90
- "@connectycube/use-chat": "^0.27.0",
88
+ "@ai-sdk/google": "^2.0.24",
89
+ "@connectycube/react": "4.7.7",
91
90
  "@radix-ui/react-alert-dialog": "^1.1.15",
92
91
  "@radix-ui/react-avatar": "^1.1.10",
93
92
  "@radix-ui/react-checkbox": "^1.3.3",
@@ -98,23 +97,22 @@
98
97
  "@radix-ui/react-switch": "^1.2.6",
99
98
  "@radix-ui/react-tabs": "^1.1.13",
100
99
  "@radix-ui/react-tooltip": "^1.2.8",
101
- "ai": "^5.0.54",
100
+ "ai": "^5.0.81",
102
101
  "class-variance-authority": "^0.7.1",
103
102
  "clsx": "^2.1.1",
104
- "connectycube": "^4.7.2",
105
103
  "get-browser-fingerprint": "^4.1.1",
106
- "i18next": "^25.5.2",
104
+ "i18next": "^25.6.0",
107
105
  "linkify-react": "^4.3.2",
108
106
  "linkifyjs": "^4.3.2",
109
- "lucide-react": "^0.544.0",
107
+ "lucide-react": "^0.548.0",
110
108
  "next-themes": "^0.4.6",
111
- "react-hook-form": "^7.63.0",
112
- "react-i18next": "^16.0.0",
109
+ "react-hook-form": "^7.65.0",
110
+ "react-i18next": "^16.2.1",
113
111
  "react-icons": "^5.5.0",
114
112
  "react-intersection-observer": "^9.16.0",
115
113
  "react-player": "^2.16.1",
116
114
  "sonner": "^2.0.7",
117
- "virtua": "^0.43.4",
115
+ "virtua": "^0.46.4",
118
116
  "zustand": "^5.0.8"
119
117
  },
120
118
  "peerDependencies": {
@@ -122,34 +120,35 @@
122
120
  "react-dom": ">=18"
123
121
  },
124
122
  "devDependencies": {
125
- "@eslint/js": "^9.36.0",
126
- "@tailwindcss/postcss": "^4.1.13",
127
- "@tailwindcss/vite": "^4.1.13",
128
- "@types/node": "^24.5.2",
129
- "@types/react": "^19.1.13",
130
- "@types/react-dom": "^19.1.9",
131
- "@vitejs/plugin-react": "^5.0.3",
132
- "@vitest/coverage-v8": "^3.2.4",
133
- "eslint": "^9.36.0",
134
- "eslint-plugin-react-hooks": "^5.2.0",
135
- "eslint-plugin-react-refresh": "^0.4.22",
123
+ "@eslint/js": "^9.38.0",
124
+ "@tailwindcss/cli": "^4.1.16",
125
+ "@tailwindcss/postcss": "^4.1.16",
126
+ "@tailwindcss/vite": "^4.1.16",
127
+ "@types/node": "^24.9.1",
128
+ "@types/react": "^19.2.2",
129
+ "@types/react-dom": "^19.2.2",
130
+ "@vitejs/plugin-react": "^5.1.0",
131
+ "@vitest/coverage-v8": "^4.0.4",
132
+ "eslint": "^9.38.0",
133
+ "eslint-plugin-react-hooks": "^7.0.1",
134
+ "eslint-plugin-react-refresh": "^0.4.24",
136
135
  "globals": "^16.4.0",
137
- "jsdom": "^27.0.0",
136
+ "jsdom": "^27.0.1",
138
137
  "prettier": "3.6.2",
139
138
  "tailwind-merge": "^3.3.1",
140
139
  "tailwind-scrollbar": "^4.0.2",
141
- "tailwindcss": "^4.1.13",
140
+ "tailwindcss": "^4.1.16",
142
141
  "tw-animate-css": "^1.4.0",
143
- "typescript": "^5.9.2",
144
- "typescript-eslint": "^8.44.1",
145
- "vite": "^7.1.7",
142
+ "typescript": "^5.9.3",
143
+ "typescript-eslint": "^8.46.2",
144
+ "vite": "^7.1.12",
146
145
  "vite-plugin-dts": "^4.5.4",
147
- "vitest": "^3.2.4"
146
+ "vitest": "^4.0.4"
148
147
  },
149
148
  "optionalDependencies": {
150
- "@rollup/rollup-linux-x64-gnu": "4.52.2",
151
- "@tailwindcss/oxide-linux-x64-gnu": "^4.1.13",
152
- "lightningcss-linux-x64-gnu": "^1.30.1"
149
+ "@rollup/rollup-linux-x64-gnu": "4.52.5",
150
+ "@tailwindcss/oxide-linux-x64-gnu": "^4.1.16",
151
+ "lightningcss-linux-x64-gnu": "^1.30.2"
153
152
  },
154
153
  "engines": {
155
154
  "node": ">=20.0.0",
@@ -1,6 +0,0 @@
1
- type CallsFullscreenStreamProps = {
2
- fullscreenStream: React.ReactNode;
3
- cornerStream: React.ReactNode;
4
- };
5
- declare const CallsFullscreenStream: React.FC<CallsFullscreenStreamProps>;
6
- export default CallsFullscreenStream;
@@ -1,2 +0,0 @@
1
- declare const CallsModalScreen: React.FC;
2
- export default CallsModalScreen;
@@ -1,5 +0,0 @@
1
- type CallsNavButtonsProps = {
2
- customButton?: React.ReactNode;
3
- };
4
- declare const CallsNavButtons: React.FC<CallsNavButtonsProps>;
5
- export default CallsNavButtons;
@@ -1,2 +0,0 @@
1
- declare const CallsNavHungUp: React.FC;
2
- export default CallsNavHungUp;
@@ -1,2 +0,0 @@
1
- declare const CallsNavScreenShare: React.FC;
2
- export default CallsNavScreenShare;
@@ -1,2 +0,0 @@
1
- declare const CallsNavToggleCamera: React.FC;
2
- export default CallsNavToggleCamera;
@@ -1,2 +0,0 @@
1
- declare const CallsNavToggleMic: React.FC;
2
- export default CallsNavToggleMic;