@connectycube/chat-widget 0.20.0 → 0.21.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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.21.0
4
+
5
+ ### Features
6
+
7
+ - Video-preview for video attachment in chat
8
+
9
+ ### Misc
10
+
11
+ - Added support for node 22
12
+ - Upgraded `connectycube` to 4.2.2 and `@connectycube/use-chat` to 0.18.0 to use import types and enums from "connectycube/types"
13
+
14
+ ### Bug fixes
15
+
16
+ - Web Push Notifications init and fetch with user setting
17
+
3
18
  ## 0.20.0
4
19
 
5
20
  ### Features
package/README.md CHANGED
@@ -150,15 +150,17 @@ See all available recipes <https://developers.connectycube.com/js/chat-widget/#r
150
150
 
151
151
  ## Have an issue?
152
152
 
153
- Join our [Discord](https://discord.gg/wDwbvJmD) for quick answers to your questions
153
+ Join our [Discord](https://discord.com/invite/zqbBWNCCFJ) for quick answers to your questions
154
154
 
155
- ## Community and support
155
+ ## Community
156
156
 
157
- - [Discord](https://discord.gg/wDwbvJmD)
158
157
  - [Blog](https://connectycube.com/blog)
159
158
  - X (twitter)[@ConnectyCube](https://x.com/ConnectyCube)
160
159
  - [Facebook](https://www.facebook.com/ConnectyCube)
161
160
 
161
+ **Want to support our team**:<br>
162
+ <a href="https://www.buymeacoffee.com/connectycube" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-blue.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
163
+
162
164
  ## Changelog
163
165
 
164
166
  <https://github.com/ConnectyCube/connectycube-chat-widget-samples/blob/main/CHANGELOG.md>
package/dist/App.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Config } from '../node_modules/connectycube/src/types';
1
+ import { Config } from 'connectycube/types';
2
2
  import { DefaultChat } from './hooks/store/useAppDefaultChatStore';
3
3
  import { QuickActions } from './hooks/store/useAppQuickActionsStore';
4
4
  export type AppProps = {
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { Users } from '../../../../node_modules/connectycube/src/types';
2
+ import { Users } from 'connectycube/types';
3
3
  export interface ChatInfoUserProps {
4
- user?: Users.User;
4
+ user?: Users.User | null;
5
5
  }
6
6
  declare const _default: React.NamedExoticComponent<ChatInfoUserProps>;
7
7
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { Dialogs } from '../../../../node_modules/connectycube/src/types';
2
+ import { Dialogs } from 'connectycube/types';
3
3
  export interface ChatInputProps {
4
4
  onSendMessage: (message: string, dialog?: Dialogs.Dialog) => void;
5
5
  onSendMessageWithAttachment: (files: File[]) => void;
@@ -2,7 +2,7 @@ import { default as React } from 'react';
2
2
  export interface GroupMemberProps {
3
3
  userId: number;
4
4
  name: string;
5
- avatar?: string;
5
+ avatar?: string | null;
6
6
  }
7
7
  declare const _default: React.NamedExoticComponent<GroupMemberProps>;
8
8
  export default _default;
@@ -1,4 +1,4 @@
1
- import { Messages } from '../../../../node_modules/connectycube/src/types';
1
+ import { Messages } from 'connectycube/types';
2
2
  import { default as React } from 'react';
3
3
  export interface MessageAttachmentProps {
4
4
  attachment: Messages.Attachment;
@@ -1,11 +1,11 @@
1
1
  import { default as React } from 'react';
2
- import { Messages } from '../../../../node_modules/connectycube/src/types';
2
+ import { Messages } from 'connectycube/types';
3
3
  export interface MessageProps {
4
4
  message: Messages.Message;
5
5
  isGroupChat: boolean;
6
6
  dialogName: string;
7
7
  senderName: string;
8
- senderAvatar: string;
8
+ senderAvatar?: string | null;
9
9
  }
10
10
  declare const Message: React.FC<MessageProps>;
11
11
  export default Message;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { Users } from '../../../../../node_modules/connectycube/src/types';
2
+ import { Users } from 'connectycube/types';
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 '../../../../node_modules/connectycube/src/types';
2
+ import { Dialogs } from 'connectycube/types';
3
3
  export interface ChatItemProps {
4
4
  dialog: Dialogs.Dialog;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { Users } from '../../../../../../node_modules/connectycube/src/types';
2
+ import { Users } from 'connectycube/types';
3
3
  export interface CreateGroupChatProps {
4
4
  users: Users.User[];
5
5
  onCreateChat: (name: string) => void;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
2
  export interface AvatarProps {
3
- imageUIDOrUrl?: string;
4
- name: string;
3
+ imageUIDOrUrl?: string | null;
4
+ name?: string;
5
5
  className?: string | undefined;
6
6
  }
7
7
  declare const _default: React.NamedExoticComponent<AvatarProps>;
@@ -1,4 +1,4 @@
1
- import { Config, Users, Auth, Chat, EmptyResponse, PushNotifications } from '../../node_modules/connectycube/src/types';
1
+ import { Config, Users, Auth, Chat, EmptyResponse, PushNotifications } from 'connectycube/types';
2
2
  import { PushSubscriptionData } from './notifications';
3
3
  export declare const SESSION_KEY = "@connectycube/chat-widget:session";
4
4
  export declare const initConnectyCubeSDK: (credentials: Config.Credentials, config?: Config.Options) => void;
@@ -28,6 +28,6 @@ export declare const sha256: (str: string) => Promise<string>;
28
28
  export declare const getUserName: (user: Users.User | null | undefined, force?: boolean) => string;
29
29
  export declare const getPhotoUrl: (photoOrAvatar?: string | null) => string;
30
30
  export declare const generateConnectyCubeLogin: (userId?: string) => string;
31
- export declare const createUserReport: (reportedUserId: number, reason: string) => Promise<import("@connectycube/types").Data.DataRecord>;
31
+ export declare const createUserReport: (reportedUserId: number, reason: string) => Promise<import("connectycube/types").Data.DataRecord>;
32
32
  export declare const subscribeToPushNotifications: (pushSubscriptionData?: PushSubscriptionData) => Promise<PushNotifications.Subscription | undefined>;
33
33
  export declare const unsubscribeFromPushNotifications: () => Promise<EmptyResponse[]>;
@@ -3,8 +3,8 @@ export type PushSubscriptionData = {
3
3
  auth: string;
4
4
  p256dh: string;
5
5
  } | undefined;
6
- export declare const requestNotificationPermission: () => Promise<void>;
7
- export declare const registerWidgetServiceWorker: (serviceWorkerPath?: string | URL) => Promise<void>;
6
+ export declare const requestNotificationPermission: () => Promise<boolean>;
7
+ export declare const registerWidgetServiceWorker: (serviceWorkerPath?: string | URL) => Promise<boolean>;
8
8
  export declare const getWidgetServiceWorker: (serviceWorkerPath?: string | URL) => Promise<ServiceWorkerRegistration | void>;
9
9
  export declare const getPushManagerSubscriptionData: (subscription?: PushSubscription | null) => PushSubscriptionData;
10
10
  export declare const getPushManagerSubscription: (serviceWorkerPath?: string | URL, applicationServerKey?: PushSubscriptionOptionsInit["applicationServerKey"]) => Promise<PushSubscription | null>;
@@ -9,6 +9,6 @@ interface UserSettingsState extends UserSettingsStateProps {
9
9
  setIsPushNotifications: (enabled: boolean) => Promise<void>;
10
10
  }
11
11
  declare const useUserSettingsStore: import('zustand').UseBoundStore<import('zustand').StoreApi<UserSettingsState>>;
12
- export declare const managePushNotificationsSubscription: (enable: boolean) => Promise<void>;
12
+ export declare const managePushNotificationsSubscription: (enable: boolean) => Promise<boolean>;
13
13
  export declare const restoreUserSettingsStore: () => Promise<void>;
14
14
  export default useUserSettingsStore;
@@ -1,4 +1,4 @@
1
- import { Config } from '../../node_modules/connectycube/src/types';
1
+ import { Config } from 'connectycube/types';
2
2
  type AppUser = {
3
3
  id?: string;
4
4
  name?: string;
@@ -1,4 +1,4 @@
1
- import { Chat } from '../../node_modules/connectycube/src/types';
1
+ import { Chat } from 'connectycube/types';
2
2
  type NotificationHook = {
3
3
  showNotification: (title: string, body: string, icon: string) => Promise<Notification | void>;
4
4
  notifyOnMessage: (userId: number, message: Chat.Message) => Promise<Notification | void>;