@connectycube/chat-widget 0.21.0 → 0.22.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 +25 -0
- package/dist/App.d.ts +8 -0
- package/dist/components/home/main/chat-info-members.d.ts +1 -3
- package/dist/components/home/main/message-body.d.ts +1 -0
- package/dist/components/home/main/message-url-preview.d.ts +6 -0
- package/dist/components/home/sidebar/new-chat/create-group-chat/create-group-chat.d.ts +1 -1
- package/dist/components/shared/avatar.d.ts +8 -3
- package/dist/components/shared/widget-button.d.ts +4 -0
- package/dist/hooks/index.d.ts +5 -1
- package/dist/hooks/store/useAppSettingsStore.d.ts +9 -0
- package/dist/hooks/store/useLinkPreviewStore.d.ts +17 -0
- package/dist/hooks/store/useOnlineUsersCountStore.d.ts +11 -0
- package/dist/hooks/useLastActivity.d.ts +2 -0
- package/dist/hooks/useTypingStatusText.d.ts +3 -0
- package/dist/index.es.js +7242 -7349
- package/dist/index.umd.js +33 -33
- package/package.json +23 -23
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 0.22.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- URL preview - unfurl a link once posted in chat
|
|
8
|
+
- new prop `enableUrlPreview` to enable the feature
|
|
9
|
+
- new prop `limitUrlsPreviews` to set maximum displayed URLs preview in single message. Default is 1 and max is 5
|
|
10
|
+
- Display user last activity
|
|
11
|
+
- new prop `enableLastSeen` to show green dot on user avatar in chats list when user is online and last seen information on chat header
|
|
12
|
+
- Display online users badge on chat widget button
|
|
13
|
+
- new prop `enableOnlineUsersBadge` to enable the feature
|
|
14
|
+
- new prop `getOnlineUsersInterval` to set how frequently the badge should be updated, in seconds. Default is 300 (5 minutes), min is 30 seconds
|
|
15
|
+
- new prop `onOnlineUsersCountChange` to receive updates on the online users counter change
|
|
16
|
+
- new props `onlineBadgeStyle` and `onlineBadgeClassName` to customize the badge
|
|
17
|
+
|
|
18
|
+
### Misc
|
|
19
|
+
|
|
20
|
+
- Refactored typing statuses. Now it's possible to see who is typing in the dialog preview in the chat list
|
|
21
|
+
|
|
22
|
+
## 0.21.1
|
|
23
|
+
|
|
24
|
+
### Bug fixes
|
|
25
|
+
|
|
26
|
+
- removed unnecessary/obsessive alerts
|
|
27
|
+
|
|
3
28
|
## 0.21.0
|
|
4
29
|
|
|
5
30
|
### Features
|
package/dist/App.d.ts
CHANGED
|
@@ -22,8 +22,13 @@ export type AppProps = {
|
|
|
22
22
|
webPushVapidPublicKey?: string;
|
|
23
23
|
serviceWorkerPath?: string | URL;
|
|
24
24
|
attachmentsAccept?: string;
|
|
25
|
+
enableLastSeen?: boolean;
|
|
25
26
|
enableContentReporting?: boolean;
|
|
26
27
|
enableBlockList?: boolean;
|
|
28
|
+
enableOnlineUsersBadge?: boolean;
|
|
29
|
+
getOnlineUsersInterval?: number;
|
|
30
|
+
enableUrlPreview?: boolean;
|
|
31
|
+
limitUrlsPreviews?: number;
|
|
27
32
|
quickActions?: QuickActions;
|
|
28
33
|
defaultChat?: DefaultChat;
|
|
29
34
|
hideWidgetButton?: boolean;
|
|
@@ -32,11 +37,14 @@ export type AppProps = {
|
|
|
32
37
|
portalStyle?: React.CSSProperties;
|
|
33
38
|
buttonStyle?: React.CSSProperties;
|
|
34
39
|
badgeStyle?: React.CSSProperties;
|
|
40
|
+
onlineBadgeStyle?: React.CSSProperties;
|
|
35
41
|
portalClassName?: string;
|
|
36
42
|
buttonClassName?: string;
|
|
37
43
|
badgeClassName?: string;
|
|
44
|
+
onlineBadgeClassName?: string;
|
|
38
45
|
onOpenChange?: (open: boolean) => void;
|
|
39
46
|
onUnreadCountChange?: (count: number) => void;
|
|
47
|
+
onOnlineUsersCountChange?: (count: number) => void;
|
|
40
48
|
};
|
|
41
49
|
declare const App: React.FC<AppProps>;
|
|
42
50
|
export default App;
|
|
@@ -2,7 +2,7 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { Users } from 'connectycube/types';
|
|
3
3
|
export interface CreateGroupChatProps {
|
|
4
4
|
users: Users.User[];
|
|
5
|
-
onCreateChat: (name: string) => void
|
|
5
|
+
onCreateChat: (name: string) => Promise<void>;
|
|
6
6
|
}
|
|
7
7
|
declare const _default: React.NamedExoticComponent<CreateGroupChatProps>;
|
|
8
8
|
export default _default;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
2
|
+
interface BaseAvatarProps {
|
|
3
3
|
imageUIDOrUrl?: string | null;
|
|
4
4
|
name?: string;
|
|
5
5
|
className?: string | undefined;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
interface AvatarWithStatusProps extends BaseAvatarProps {
|
|
8
|
+
isOnline?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const Avatar: React.FC<BaseAvatarProps> & {
|
|
11
|
+
WithStatus: React.NamedExoticComponent<AvatarWithStatusProps>;
|
|
12
|
+
};
|
|
13
|
+
export default Avatar;
|
|
@@ -6,6 +6,10 @@ type WidgetButtonProps = {
|
|
|
6
6
|
badgeTitle?: number;
|
|
7
7
|
badgeStyle?: React.CSSProperties;
|
|
8
8
|
badgeClassName?: string;
|
|
9
|
+
enableOnlineUsersBadge?: boolean;
|
|
10
|
+
onlineBadgeTitle?: number;
|
|
11
|
+
onlineBadgeStyle?: React.CSSProperties;
|
|
12
|
+
onlineBadgeClassName?: string;
|
|
9
13
|
};
|
|
10
14
|
declare const WidgetButton: React.FC<WidgetButtonProps>;
|
|
11
15
|
export default WidgetButton;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -7,11 +7,15 @@ export { default as useAppSettingsStore } from './store/useAppSettingsStore';
|
|
|
7
7
|
export { default as useAppNotificationStore } from './store/useAppNotificationStore';
|
|
8
8
|
export { default as useAppQuickActionsStore } from './store/useAppQuickActionsStore';
|
|
9
9
|
export { default as useDraftMessagesStore } from './store/useDraftMessagesStore';
|
|
10
|
-
export { default as
|
|
10
|
+
export { default as useOnlineUsersCountStore } from './store/useOnlineUsersCountStore';
|
|
11
|
+
export { default as useLinkPreviewStore } from './store/useLinkPreviewStore';
|
|
11
12
|
export { default as useProfileStore } from './store/useProfileStore';
|
|
13
|
+
export { default as useUnreadCountStore } from './store/useUnreadCountStore';
|
|
12
14
|
export { default as useUserSettingsStore } from './store/useUserSettingsStore';
|
|
13
15
|
export { default as useAppAuthorization } from './useAppAuthorization';
|
|
16
|
+
export { default as useLastActivity } from './useLastActivity';
|
|
14
17
|
export { default as useNotification } from './useNotification';
|
|
15
18
|
export { default as usePageFocus } from './usePageFocus';
|
|
16
19
|
export { default as useResizeScreenWidth } from './useResizeScreenWidth';
|
|
20
|
+
export { default as useTypingStatusText } from './useTypingStatusText';
|
|
17
21
|
export { default as useValue } from './useValue';
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
export type AppSettingStoreProps = {
|
|
2
2
|
attachmentsAccept: string;
|
|
3
3
|
attachmentsAcceptList: string[];
|
|
4
|
+
enableLastSeen: boolean;
|
|
4
5
|
enableContentReporting: boolean;
|
|
5
6
|
enableBlockList: boolean;
|
|
7
|
+
enableUrlPreview: boolean;
|
|
8
|
+
limitUrlsPreviews: number;
|
|
6
9
|
};
|
|
7
10
|
export interface AppSettingStoreState extends AppSettingStoreProps {
|
|
8
11
|
setAttachmentsAccept: (attachmentsAccept: string) => void;
|
|
12
|
+
setEnableLastSeen: (enableLastSeen: boolean) => void;
|
|
9
13
|
setEnableContentReporting: (enableContentReporting: boolean) => void;
|
|
10
14
|
setEnableBlockList: (enableBlockList: boolean) => void;
|
|
15
|
+
setEnableUrlPreview: (enableUrlPreview: boolean) => void;
|
|
16
|
+
setLimitUrlsPreviews: (limitUrlsPreviews: number) => void;
|
|
11
17
|
resetAttachmentsAccept: () => void;
|
|
18
|
+
resetEnableLastSeen: () => void;
|
|
12
19
|
resetEnableContentReporting: () => void;
|
|
13
20
|
resetEnableBlockList: () => void;
|
|
21
|
+
resetEnableUrlPreview: () => void;
|
|
22
|
+
resetLimitUrlsPreviews: () => void;
|
|
14
23
|
isSupportedFile: (file: File) => boolean;
|
|
15
24
|
}
|
|
16
25
|
export declare const appSettingsStoreInitialState: AppSettingStoreProps;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type LinkPreview = {
|
|
2
|
+
url: string;
|
|
3
|
+
title: string;
|
|
4
|
+
images: string[];
|
|
5
|
+
description: string;
|
|
6
|
+
[key: string]: string | string[];
|
|
7
|
+
};
|
|
8
|
+
interface LinkPreviewStore {
|
|
9
|
+
queue: string[];
|
|
10
|
+
urlPreviews: Map<string, LinkPreview>;
|
|
11
|
+
isProcessing: boolean;
|
|
12
|
+
addUrls: (urls: string[]) => void;
|
|
13
|
+
matchUrlsFromMessage: (message: string) => string[];
|
|
14
|
+
}
|
|
15
|
+
declare const useLinkPreviewStore: import('zustand').UseBoundStore<import('zustand').StoreApi<LinkPreviewStore>>;
|
|
16
|
+
export declare const resetLinkPreviewStore: () => void;
|
|
17
|
+
export default useLinkPreviewStore;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface OnlineUsersCountState {
|
|
2
|
+
requestOnlineUsersInterval: number;
|
|
3
|
+
onlineUsersCount: number;
|
|
4
|
+
setRequestOnlineUsersInterval: (seconds: number) => void;
|
|
5
|
+
setOnlineUsersCount: (count: number) => void;
|
|
6
|
+
resetRequestOnlineUsersInterval: () => void;
|
|
7
|
+
resetOnlineUsersCount: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const useOnlineUsersCountStore: import('zustand').UseBoundStore<import('zustand').StoreApi<OnlineUsersCountState>>;
|
|
10
|
+
export declare const resetOnlineUsersCountStore: () => void;
|
|
11
|
+
export default useOnlineUsersCountStore;
|