@connectycube/chat-widget 0.24.0 → 0.26.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 +47 -2
- package/dist/index.es.js +14945 -14130
- package/dist/index.umd.js +90 -66
- package/dist/react19/index.es.js +14871 -14056
- package/dist/react19/types/App.d.ts +6 -33
- package/dist/react19/types/components/home/main/message/message-status-mark.d.ts +6 -0
- package/dist/react19/types/components/home/main/user-status/user-status-badge.d.ts +7 -0
- package/dist/react19/types/components/home/main/user-status/user-status-select.d.ts +3 -0
- package/dist/react19/types/components/home/main/user-status/user-status.d.ts +6 -0
- package/dist/react19/types/components/home/sidebar/user-item.d.ts +2 -0
- package/dist/react19/types/components/shadcn-ui/button.d.ts +1 -1
- package/dist/react19/types/components/shadcn-ui/tooltip.d.ts +7 -0
- package/dist/react19/types/components/shared/avatar.d.ts +2 -0
- package/dist/react19/types/components/shared/chat-status-mark.d.ts +2 -0
- package/dist/react19/types/components/widget/widget-app.d.ts +8 -0
- package/dist/react19/types/components/{shared → widget}/widget-button.d.ts +2 -8
- package/dist/react19/types/components/{shared → widget}/widget-messages-badge.d.ts +0 -2
- package/dist/react19/types/components/{shared → widget}/widget-online-badge.d.ts +0 -2
- package/dist/react19/types/components/widget/widget-overlay.d.ts +7 -0
- package/dist/react19/types/components/widget/widget-portal.d.ts +8 -0
- package/dist/react19/types/components/widget/widget-shadow-root.d.ts +6 -0
- package/dist/react19/types/helpers/connectycube.d.ts +13 -1
- package/dist/react19/types/helpers/widget.d.ts +5 -0
- package/dist/react19/types/hooks/index.d.ts +1 -0
- package/dist/react19/types/hooks/store/useAppDefaultChatStore.d.ts +1 -1
- package/dist/react19/types/hooks/store/useAppInterfaceStore.d.ts +4 -0
- package/dist/react19/types/hooks/store/useAppNotificationStore.d.ts +1 -1
- package/dist/react19/types/hooks/store/useAppQuickActionsStore.d.ts +1 -1
- package/dist/react19/types/hooks/store/useAppSettingsStore.d.ts +3 -0
- package/dist/react19/types/hooks/store/useOnlineUsersCountStore.d.ts +5 -0
- package/dist/react19/types/hooks/store/useUserSettingsStore.d.ts +6 -3
- package/dist/react19/types/hooks/useAppPresets.d.ts +34 -0
- package/dist/react19/types/locales/el/translation.json.d.ts +5 -1
- package/dist/react19/types/locales/en/translation.json.d.ts +5 -1
- package/dist/react19/types/locales/ua/translation.json.d.ts +5 -1
- package/dist/types/App.d.ts +6 -33
- package/dist/types/components/home/main/message/message-status-mark.d.ts +6 -0
- package/dist/types/components/home/main/user-status/user-status-badge.d.ts +7 -0
- package/dist/types/components/home/main/user-status/user-status-select.d.ts +3 -0
- package/dist/types/components/home/main/user-status/user-status.d.ts +6 -0
- package/dist/types/components/home/sidebar/user-item.d.ts +2 -0
- package/dist/types/components/shadcn-ui/button.d.ts +1 -1
- package/dist/types/components/shadcn-ui/tooltip.d.ts +7 -0
- package/dist/types/components/shared/avatar.d.ts +2 -0
- package/dist/types/components/shared/chat-status-mark.d.ts +2 -0
- package/dist/types/components/widget/widget-app.d.ts +8 -0
- package/dist/types/components/{shared → widget}/widget-button.d.ts +2 -8
- package/dist/types/components/{shared → widget}/widget-messages-badge.d.ts +0 -2
- package/dist/types/components/{shared → widget}/widget-online-badge.d.ts +0 -2
- package/dist/types/components/widget/widget-overlay.d.ts +7 -0
- package/dist/types/components/widget/widget-portal.d.ts +8 -0
- package/dist/types/components/widget/widget-shadow-root.d.ts +6 -0
- package/dist/types/helpers/connectycube.d.ts +13 -1
- package/dist/types/helpers/widget.d.ts +5 -0
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/store/useAppDefaultChatStore.d.ts +1 -1
- package/dist/types/hooks/store/useAppInterfaceStore.d.ts +4 -0
- package/dist/types/hooks/store/useAppNotificationStore.d.ts +1 -1
- package/dist/types/hooks/store/useAppQuickActionsStore.d.ts +1 -1
- package/dist/types/hooks/store/useAppSettingsStore.d.ts +3 -0
- package/dist/types/hooks/store/useOnlineUsersCountStore.d.ts +5 -0
- package/dist/types/hooks/store/useUserSettingsStore.d.ts +6 -3
- package/dist/types/hooks/useAppPresets.d.ts +34 -0
- package/dist/types/locales/el/translation.json.d.ts +5 -1
- package/dist/types/locales/en/translation.json.d.ts +5 -1
- package/dist/types/locales/ua/translation.json.d.ts +5 -1
- package/package.json +45 -42
- package/dist/react19/types/components/app-login.d.ts +0 -8
- package/dist/react19/types/components/app-shadow-root.d.ts +0 -6
- package/dist/types/components/app-login.d.ts +0 -8
- package/dist/types/components/app-shadow-root.d.ts +0 -6
- /package/dist/react19/types/components/home/main/{message-attachment.d.ts → message/message-attachment.d.ts} +0 -0
- /package/dist/react19/types/components/home/main/{message-body.d.ts → message/message-body.d.ts} +0 -0
- /package/dist/react19/types/components/home/main/{message-url-preview.d.ts → message/message-url-preview.d.ts} +0 -0
- /package/dist/react19/types/components/home/main/{message.d.ts → message/message.d.ts} +0 -0
- /package/dist/types/components/home/main/{message-attachment.d.ts → message/message-attachment.d.ts} +0 -0
- /package/dist/types/components/home/main/{message-body.d.ts → message/message-body.d.ts} +0 -0
- /package/dist/types/components/home/main/{message-url-preview.d.ts → message/message-url-preview.d.ts} +0 -0
- /package/dist/types/components/home/main/{message.d.ts → message/message.d.ts} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Config } from 'connectycube/types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export type AppProps = {
|
|
2
|
+
import { AppPresets } from './hooks/useAppPresets';
|
|
3
|
+
export type AppProps = AppPresets & {
|
|
5
4
|
appId: Config.Credentials['appId'];
|
|
6
5
|
authKey: Config.Credentials['authKey'];
|
|
7
6
|
config?: Config.Options;
|
|
@@ -9,42 +8,16 @@ export type AppProps = {
|
|
|
9
8
|
userName?: string;
|
|
10
9
|
userAvatar?: string;
|
|
11
10
|
userProfileLink?: string;
|
|
12
|
-
open?: boolean;
|
|
13
|
-
splitView?: boolean;
|
|
14
|
-
showOnlineUsersTab?: boolean;
|
|
15
|
-
hideNewChatButton?: boolean;
|
|
16
|
-
hideNewUserChatOption?: boolean;
|
|
17
|
-
hideNewGroupChatOption?: boolean;
|
|
18
|
-
muted?: boolean;
|
|
19
|
-
showNotifications?: boolean;
|
|
20
|
-
playSound?: boolean;
|
|
21
|
-
webPushNotifications?: boolean;
|
|
22
|
-
webPushVapidPublicKey?: string;
|
|
23
|
-
serviceWorkerPath?: string | URL;
|
|
24
|
-
attachmentsAccept?: string;
|
|
25
|
-
enableLastSeen?: boolean;
|
|
26
|
-
enableContentReporting?: boolean;
|
|
27
|
-
enableBlockList?: boolean;
|
|
28
|
-
enableOnlineUsersBadge?: boolean;
|
|
29
|
-
getOnlineUsersInterval?: number;
|
|
30
|
-
enableUrlPreview?: boolean;
|
|
31
|
-
limitUrlsPreviews?: number;
|
|
32
|
-
quickActions?: QuickActions;
|
|
33
|
-
defaultChat?: DefaultChat;
|
|
34
|
-
hideWidgetButton?: boolean;
|
|
35
11
|
translation?: 'en' | 'el' | 'ua';
|
|
12
|
+
disableClickOutside?: boolean;
|
|
13
|
+
disableEscKeyPress?: boolean;
|
|
14
|
+
hideWidgetButton?: boolean;
|
|
36
15
|
buttonTitle?: string;
|
|
37
16
|
portalStyle?: React.CSSProperties;
|
|
17
|
+
overlayStyle?: React.CSSProperties;
|
|
38
18
|
buttonStyle?: React.CSSProperties;
|
|
39
19
|
badgeStyle?: React.CSSProperties;
|
|
40
20
|
onlineBadgeStyle?: React.CSSProperties;
|
|
41
|
-
portalClassName?: string;
|
|
42
|
-
buttonClassName?: string;
|
|
43
|
-
badgeClassName?: string;
|
|
44
|
-
onlineBadgeClassName?: string;
|
|
45
|
-
onOpenChange?: (open: boolean) => void;
|
|
46
|
-
onUnreadCountChange?: (count: number) => void;
|
|
47
|
-
onOnlineUsersCountChange?: (count: number) => void;
|
|
48
21
|
};
|
|
49
22
|
declare const App: React.FC<AppProps>;
|
|
50
23
|
export default App;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { USER_STATUS } from '../../../helpers/connectycube';
|
|
1
2
|
export interface UserItemProps {
|
|
2
3
|
userId: number;
|
|
3
4
|
userName: string;
|
|
4
5
|
avatar?: string;
|
|
6
|
+
status?: USER_STATUS | null;
|
|
5
7
|
}
|
|
6
8
|
declare const _default: import('react').NamedExoticComponent<UserItemProps>;
|
|
7
9
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
5
5
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { USER_STATUS } from '../../helpers/connectycube';
|
|
2
3
|
interface BaseAvatarProps {
|
|
3
4
|
imageUIDOrUrl?: string | null;
|
|
4
5
|
name?: string;
|
|
@@ -6,6 +7,7 @@ interface BaseAvatarProps {
|
|
|
6
7
|
}
|
|
7
8
|
interface AvatarWithStatusProps extends BaseAvatarProps {
|
|
8
9
|
isOnline?: boolean;
|
|
10
|
+
status?: USER_STATUS | null;
|
|
9
11
|
}
|
|
10
12
|
declare const Avatar: React.FC<BaseAvatarProps> & {
|
|
11
13
|
WithStatus: React.NamedExoticComponent<AvatarWithStatusProps>;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
type WidgetButtonProps = {
|
|
2
|
-
|
|
3
|
-
title
|
|
2
|
+
lng: 'en' | 'el' | 'ua';
|
|
3
|
+
title?: string;
|
|
4
4
|
style?: React.CSSProperties;
|
|
5
|
-
className?: string;
|
|
6
|
-
badgeTitle?: number;
|
|
7
5
|
badgeStyle?: React.CSSProperties;
|
|
8
|
-
badgeClassName?: string;
|
|
9
|
-
enableOnlineUsersBadge?: boolean;
|
|
10
|
-
onlineBadgeCount?: number;
|
|
11
6
|
onlineBadgeStyle?: React.CSSProperties;
|
|
12
|
-
onlineBadgeClassName?: string;
|
|
13
7
|
};
|
|
14
8
|
declare const WidgetButton: React.FC<WidgetButtonProps>;
|
|
15
9
|
export default WidgetButton;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { Config, Users, Auth, Chat, EmptyResponse, PushNotifications } from 'connectycube/types';
|
|
2
2
|
import { PushSubscriptionData } from './notifications';
|
|
3
|
+
export declare enum SIGNAL {
|
|
4
|
+
UPDATE_USER = "user/UPDATE"
|
|
5
|
+
}
|
|
6
|
+
export declare enum USER_STATUS {
|
|
7
|
+
AVAILABLE = "Available",
|
|
8
|
+
BUSY = "Busy",
|
|
9
|
+
AWAY = "Away"
|
|
10
|
+
}
|
|
3
11
|
export declare const SESSION_KEY = "@connectycube/chat-widget:session";
|
|
4
12
|
export declare const initConnectyCubeSDK: (credentials: Config.Credentials, config?: Config.Options) => void;
|
|
5
13
|
export declare const tryReuseSession: (userName?: string, userId?: string, userAvatar?: string, userProfileLink?: string) => Promise<boolean>;
|
|
@@ -14,12 +22,16 @@ export declare const setSessionToLocalStorage: (session: Auth.Session) => void;
|
|
|
14
22
|
export declare const getSessionFromLocalStorage: () => Auth.Session | null;
|
|
15
23
|
export declare const clearSessionInLocalStorage: () => void;
|
|
16
24
|
export declare const getCurrentUser: () => Users.User | null | undefined;
|
|
25
|
+
export declare const parseUserCustomData: (user: Users.User | null | undefined) => {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
} | null;
|
|
17
28
|
export declare const getUserSettings: () => {
|
|
18
29
|
[key: string]: any;
|
|
19
30
|
} | null;
|
|
31
|
+
export declare const getUserStatus: (user: Users.User | null | undefined) => USER_STATUS;
|
|
20
32
|
export declare const updateUserSettings: (settings: {
|
|
21
33
|
[key: string]: any;
|
|
22
|
-
}) => Promise<Users.User>;
|
|
34
|
+
}, onlyLocal?: boolean) => Promise<Users.User>;
|
|
23
35
|
export declare const getSessionToken: () => string | null;
|
|
24
36
|
export declare const getSessionUserId: () => number | null;
|
|
25
37
|
export declare const isSessionExpired: () => boolean;
|
|
@@ -14,6 +14,7 @@ export { default as useShadowRootStore } from './store/useShadowRootStore';
|
|
|
14
14
|
export { default as useUnreadCountStore } from './store/useUnreadCountStore';
|
|
15
15
|
export { default as useUserSettingsStore } from './store/useUserSettingsStore';
|
|
16
16
|
export { default as useAppAuthorization } from './useAppAuthorization';
|
|
17
|
+
export { default as useAppPresets } from './useAppPresets';
|
|
17
18
|
export { default as useLastActivity } from './useLastActivity';
|
|
18
19
|
export { default as useNotification } from './useNotification';
|
|
19
20
|
export { default as usePageFocus } from './usePageFocus';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type AppInterfaceStoreProps = {
|
|
2
2
|
opened: boolean;
|
|
3
3
|
splitView: boolean;
|
|
4
|
+
showChatStatus: boolean;
|
|
4
5
|
showOnlineUsersTab: boolean;
|
|
5
6
|
hideNewChatButton: boolean;
|
|
6
7
|
hideNewUserChatOption: boolean;
|
|
@@ -9,12 +10,15 @@ export type AppInterfaceStoreProps = {
|
|
|
9
10
|
export interface AppInterfaceStoreState extends AppInterfaceStoreProps {
|
|
10
11
|
setOpened: (opened: boolean) => void;
|
|
11
12
|
setSplitView: (splitView: boolean) => void;
|
|
13
|
+
setShowChatStatus: (showChatStatus: boolean) => void;
|
|
12
14
|
setShowOnlineUsersTab: (showOnlineUsersTab: boolean) => void;
|
|
13
15
|
setHideNewChatButton: (hideNewChatButton: boolean) => void;
|
|
14
16
|
setHideNewUserChatOption: (hideNewUserChatOption: boolean) => void;
|
|
15
17
|
setHideNewGroupChatOption: (hideNewGroupChatOption: boolean) => void;
|
|
18
|
+
toggleOpened: () => void;
|
|
16
19
|
resetOpened: () => void;
|
|
17
20
|
resetSplitView: () => void;
|
|
21
|
+
resetShowChatStatus: () => void;
|
|
18
22
|
resetShowOnlineUsersTab: () => void;
|
|
19
23
|
resetHideNewChatButton: () => void;
|
|
20
24
|
resetHideNewUserChatOption: () => void;
|
|
@@ -20,7 +20,7 @@ export interface AppNotificationStoreState extends AppNotificationStoreProps {
|
|
|
20
20
|
setServiceWorkerPath: (serviceWorkerPath?: string | URL) => void;
|
|
21
21
|
resetServiceWorkerPath: () => void;
|
|
22
22
|
}
|
|
23
|
-
export declare const
|
|
23
|
+
export declare const appNotificationStoreInitialState: {
|
|
24
24
|
muted: boolean;
|
|
25
25
|
showNotifications: boolean;
|
|
26
26
|
playSound: boolean;
|
|
@@ -10,7 +10,7 @@ export interface AppQuickActionsStoreState extends AppQuickActionsStoreProps {
|
|
|
10
10
|
setQuickActions: (quickActions: QuickActions) => void;
|
|
11
11
|
resetQuickActions: () => void;
|
|
12
12
|
}
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const appQuickActionsStoreInitialState: AppQuickActionsStoreProps;
|
|
14
14
|
declare const useAppQuickActionsStore: import('zustand').UseBoundStore<import('zustand').StoreApi<AppQuickActionsStoreState>>;
|
|
15
15
|
export declare const setAppQuickActionsStore: (state: Partial<AppQuickActionsStoreProps>) => void;
|
|
16
16
|
export declare const resetAppQuickActionsStore: () => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type AppSettingStoreProps = {
|
|
2
2
|
attachmentsAccept: string;
|
|
3
3
|
attachmentsAcceptList: string[];
|
|
4
|
+
enableUserStatuses: boolean;
|
|
4
5
|
enableLastSeen: boolean;
|
|
5
6
|
enableContentReporting: boolean;
|
|
6
7
|
enableBlockList: boolean;
|
|
@@ -9,12 +10,14 @@ export type AppSettingStoreProps = {
|
|
|
9
10
|
};
|
|
10
11
|
export interface AppSettingStoreState extends AppSettingStoreProps {
|
|
11
12
|
setAttachmentsAccept: (attachmentsAccept: string) => void;
|
|
13
|
+
setEnableUserStatuses: (enableUserStatuses: boolean) => void;
|
|
12
14
|
setEnableLastSeen: (enableLastSeen: boolean) => void;
|
|
13
15
|
setEnableContentReporting: (enableContentReporting: boolean) => void;
|
|
14
16
|
setEnableBlockList: (enableBlockList: boolean) => void;
|
|
15
17
|
setEnableUrlPreview: (enableUrlPreview: boolean) => void;
|
|
16
18
|
setLimitUrlsPreviews: (limitUrlsPreviews: number) => void;
|
|
17
19
|
resetAttachmentsAccept: () => void;
|
|
20
|
+
resetEnableUserStatuses: () => void;
|
|
18
21
|
resetEnableLastSeen: () => void;
|
|
19
22
|
resetEnableContentReporting: () => void;
|
|
20
23
|
resetEnableBlockList: () => void;
|
|
@@ -9,6 +9,11 @@ interface OnlineUsersCountState {
|
|
|
9
9
|
resetEnableOnlineUsersBadge: () => void;
|
|
10
10
|
resetOnlineUsersCount: () => void;
|
|
11
11
|
}
|
|
12
|
+
export declare const onlineUsersCountInitialState: {
|
|
13
|
+
requestOnlineUsersInterval: number;
|
|
14
|
+
enableOnlineUsersBadge: boolean;
|
|
15
|
+
onlineUsersCount: number;
|
|
16
|
+
};
|
|
12
17
|
declare const useOnlineUsersCountStore: import('zustand').UseBoundStore<import('zustand').StoreApi<OnlineUsersCountState>>;
|
|
13
18
|
export declare const resetOnlineUsersCountStore: () => void;
|
|
14
19
|
export default useOnlineUsersCountStore;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { USER_STATUS } from '../../helpers/connectycube';
|
|
1
2
|
type UserSettingsStateProps = {
|
|
3
|
+
userStatus: USER_STATUS;
|
|
2
4
|
isNotifications: boolean;
|
|
3
5
|
isNotificationSound: boolean;
|
|
4
6
|
isPushNotifications: boolean;
|
|
5
7
|
};
|
|
6
8
|
interface UserSettingsState extends UserSettingsStateProps {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
setUserStatus: (status: USER_STATUS, onlyLocal?: boolean) => Promise<void>;
|
|
10
|
+
setIsNotifications: (enabled: boolean, onlyLocal?: boolean) => Promise<void>;
|
|
11
|
+
setIsNotificationSound: (enabled: boolean, onlyLocal?: boolean) => Promise<void>;
|
|
12
|
+
setIsPushNotifications: (enabled: boolean, onlyLocal?: boolean) => Promise<void>;
|
|
10
13
|
}
|
|
11
14
|
declare const useUserSettingsStore: import('zustand').UseBoundStore<import('zustand').StoreApi<UserSettingsState>>;
|
|
12
15
|
export declare const managePushNotificationsSubscription: (enable: boolean) => Promise<boolean>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DefaultChat } from './store/useAppDefaultChatStore';
|
|
2
|
+
import { QuickActions } from './store/useAppQuickActionsStore';
|
|
3
|
+
export type AppPresets = {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
embedView?: boolean;
|
|
6
|
+
splitView?: boolean;
|
|
7
|
+
showChatStatus?: boolean;
|
|
8
|
+
showOnlineUsersTab?: boolean;
|
|
9
|
+
hideNewChatButton?: boolean;
|
|
10
|
+
hideNewUserChatOption?: boolean;
|
|
11
|
+
hideNewGroupChatOption?: boolean;
|
|
12
|
+
muted?: boolean;
|
|
13
|
+
showNotifications?: boolean;
|
|
14
|
+
playSound?: boolean;
|
|
15
|
+
webPushNotifications?: boolean;
|
|
16
|
+
webPushVapidPublicKey?: string;
|
|
17
|
+
serviceWorkerPath?: string | URL;
|
|
18
|
+
attachmentsAccept?: string;
|
|
19
|
+
enableUserStatuses?: boolean;
|
|
20
|
+
enableLastSeen?: boolean;
|
|
21
|
+
enableContentReporting?: boolean;
|
|
22
|
+
enableBlockList?: boolean;
|
|
23
|
+
enableOnlineUsersBadge?: boolean;
|
|
24
|
+
getOnlineUsersInterval?: number;
|
|
25
|
+
enableUrlPreview?: boolean;
|
|
26
|
+
limitUrlsPreviews?: number;
|
|
27
|
+
quickActions?: QuickActions;
|
|
28
|
+
defaultChat?: DefaultChat | null;
|
|
29
|
+
onUnreadCountChange?: (count: number) => void;
|
|
30
|
+
onOnlineUsersCountChange?: (count: number) => void;
|
|
31
|
+
onOpenChange?: (open: boolean) => void;
|
|
32
|
+
};
|
|
33
|
+
declare const useAppPresets: ({ embedView, open, splitView, showChatStatus, showOnlineUsersTab, hideNewChatButton, hideNewUserChatOption, hideNewGroupChatOption, muted, showNotifications, playSound, webPushNotifications, serviceWorkerPath, webPushVapidPublicKey, attachmentsAccept, enableUserStatuses, enableLastSeen, enableContentReporting, enableBlockList, enableUrlPreview, limitUrlsPreviews, quickActions, defaultChat, enableOnlineUsersBadge, getOnlineUsersInterval, onUnreadCountChange, onOnlineUsersCountChange, onOpenChange, }: AppPresets) => void;
|
|
34
|
+
export default useAppPresets;
|
|
@@ -58,7 +58,11 @@ declare const _default: {
|
|
|
58
58
|
"Notifications": "Ειδοποιήσεις",
|
|
59
59
|
"NotificationSound": "Ήχος ειδοποίησης",
|
|
60
60
|
"PushNotifications": "Ειδοποιήσεις push",
|
|
61
|
-
"PleaseWait": "Παρακαλώ περιμένετε"
|
|
61
|
+
"PleaseWait": "Παρακαλώ περιμένετε",
|
|
62
|
+
"Available": "Διαθέσιμος/η",
|
|
63
|
+
"Busy": "Απασχολημένος/η",
|
|
64
|
+
"Away": "Απουσιάζω",
|
|
65
|
+
"Online": "Συνδεδεμένος/η"
|
|
62
66
|
}
|
|
63
67
|
;
|
|
64
68
|
|
|
@@ -58,7 +58,11 @@ declare const _default: {
|
|
|
58
58
|
"Notifications": "Notifications",
|
|
59
59
|
"NotificationSound": "Notification sound",
|
|
60
60
|
"PushNotifications": "Push notifications",
|
|
61
|
-
"PleaseWait": "Please wait"
|
|
61
|
+
"PleaseWait": "Please wait",
|
|
62
|
+
"Available": "Available",
|
|
63
|
+
"Busy": "Busy",
|
|
64
|
+
"Away": "Away",
|
|
65
|
+
"Online": "Online"
|
|
62
66
|
}
|
|
63
67
|
;
|
|
64
68
|
|
|
@@ -58,7 +58,11 @@ declare const _default: {
|
|
|
58
58
|
"Notifications": "Сповіщення",
|
|
59
59
|
"NotificationSound": "Звук сповіщення",
|
|
60
60
|
"PushNotifications": "Push-сповіщення",
|
|
61
|
-
"PleaseWait": "Будь ласка, зачекайте"
|
|
61
|
+
"PleaseWait": "Будь ласка, зачекайте",
|
|
62
|
+
"Available": "Присутній",
|
|
63
|
+
"Busy": "Зайнятий",
|
|
64
|
+
"Away": "Відсутній",
|
|
65
|
+
"Online": "В мережі"
|
|
62
66
|
}
|
|
63
67
|
;
|
|
64
68
|
|
package/dist/types/App.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Config } from 'connectycube/types';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export type AppProps = {
|
|
2
|
+
import { AppPresets } from './hooks/useAppPresets';
|
|
3
|
+
export type AppProps = AppPresets & {
|
|
5
4
|
appId: Config.Credentials['appId'];
|
|
6
5
|
authKey: Config.Credentials['authKey'];
|
|
7
6
|
config?: Config.Options;
|
|
@@ -9,42 +8,16 @@ export type AppProps = {
|
|
|
9
8
|
userName?: string;
|
|
10
9
|
userAvatar?: string;
|
|
11
10
|
userProfileLink?: string;
|
|
12
|
-
open?: boolean;
|
|
13
|
-
splitView?: boolean;
|
|
14
|
-
showOnlineUsersTab?: boolean;
|
|
15
|
-
hideNewChatButton?: boolean;
|
|
16
|
-
hideNewUserChatOption?: boolean;
|
|
17
|
-
hideNewGroupChatOption?: boolean;
|
|
18
|
-
muted?: boolean;
|
|
19
|
-
showNotifications?: boolean;
|
|
20
|
-
playSound?: boolean;
|
|
21
|
-
webPushNotifications?: boolean;
|
|
22
|
-
webPushVapidPublicKey?: string;
|
|
23
|
-
serviceWorkerPath?: string | URL;
|
|
24
|
-
attachmentsAccept?: string;
|
|
25
|
-
enableLastSeen?: boolean;
|
|
26
|
-
enableContentReporting?: boolean;
|
|
27
|
-
enableBlockList?: boolean;
|
|
28
|
-
enableOnlineUsersBadge?: boolean;
|
|
29
|
-
getOnlineUsersInterval?: number;
|
|
30
|
-
enableUrlPreview?: boolean;
|
|
31
|
-
limitUrlsPreviews?: number;
|
|
32
|
-
quickActions?: QuickActions;
|
|
33
|
-
defaultChat?: DefaultChat;
|
|
34
|
-
hideWidgetButton?: boolean;
|
|
35
11
|
translation?: 'en' | 'el' | 'ua';
|
|
12
|
+
disableClickOutside?: boolean;
|
|
13
|
+
disableEscKeyPress?: boolean;
|
|
14
|
+
hideWidgetButton?: boolean;
|
|
36
15
|
buttonTitle?: string;
|
|
37
16
|
portalStyle?: React.CSSProperties;
|
|
17
|
+
overlayStyle?: React.CSSProperties;
|
|
38
18
|
buttonStyle?: React.CSSProperties;
|
|
39
19
|
badgeStyle?: React.CSSProperties;
|
|
40
20
|
onlineBadgeStyle?: React.CSSProperties;
|
|
41
|
-
portalClassName?: string;
|
|
42
|
-
buttonClassName?: string;
|
|
43
|
-
badgeClassName?: string;
|
|
44
|
-
onlineBadgeClassName?: string;
|
|
45
|
-
onOpenChange?: (open: boolean) => void;
|
|
46
|
-
onUnreadCountChange?: (count: number) => void;
|
|
47
|
-
onOnlineUsersCountChange?: (count: number) => void;
|
|
48
21
|
};
|
|
49
22
|
declare const App: React.FC<AppProps>;
|
|
50
23
|
export default App;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { USER_STATUS } from '../../../helpers/connectycube';
|
|
1
2
|
export interface UserItemProps {
|
|
2
3
|
userId: number;
|
|
3
4
|
userName: string;
|
|
4
5
|
avatar?: string;
|
|
6
|
+
status?: USER_STATUS | null;
|
|
5
7
|
}
|
|
6
8
|
declare const _default: import('react').NamedExoticComponent<UserItemProps>;
|
|
7
9
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
5
5
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { USER_STATUS } from '../../helpers/connectycube';
|
|
2
3
|
interface BaseAvatarProps {
|
|
3
4
|
imageUIDOrUrl?: string | null;
|
|
4
5
|
name?: string;
|
|
@@ -6,6 +7,7 @@ interface BaseAvatarProps {
|
|
|
6
7
|
}
|
|
7
8
|
interface AvatarWithStatusProps extends BaseAvatarProps {
|
|
8
9
|
isOnline?: boolean;
|
|
10
|
+
status?: USER_STATUS | null;
|
|
9
11
|
}
|
|
10
12
|
declare const Avatar: React.FC<BaseAvatarProps> & {
|
|
11
13
|
WithStatus: React.NamedExoticComponent<AvatarWithStatusProps>;
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
type WidgetButtonProps = {
|
|
2
|
-
|
|
3
|
-
title
|
|
2
|
+
lng: 'en' | 'el' | 'ua';
|
|
3
|
+
title?: string;
|
|
4
4
|
style?: React.CSSProperties;
|
|
5
|
-
className?: string;
|
|
6
|
-
badgeTitle?: number;
|
|
7
5
|
badgeStyle?: React.CSSProperties;
|
|
8
|
-
badgeClassName?: string;
|
|
9
|
-
enableOnlineUsersBadge?: boolean;
|
|
10
|
-
onlineBadgeCount?: number;
|
|
11
6
|
onlineBadgeStyle?: React.CSSProperties;
|
|
12
|
-
onlineBadgeClassName?: string;
|
|
13
7
|
};
|
|
14
8
|
declare const WidgetButton: React.FC<WidgetButtonProps>;
|
|
15
9
|
export default WidgetButton;
|