@connectycube/chat-widget 0.32.1 → 0.33.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 +31 -0
- package/README.md +3 -1
- package/dist/index.es.js +4519 -17710
- package/dist/index.umd.js +55 -49
- package/dist/{react19/index.es.js → react19.es.js} +6317 -19508
- package/dist/types/components/home/main/chat-input-file.d.ts +6 -0
- package/dist/types/components/home/main/single-view-form.d.ts +5 -0
- package/dist/types/components/shadcn-ui/card.d.ts +9 -0
- package/dist/types/components/shadcn-ui/checkbox.d.ts +4 -0
- package/dist/types/components/shadcn-ui/class-names.d.ts +46 -0
- package/dist/types/components/widget/widget-app.d.ts +1 -0
- package/dist/types/components/widget/widget-auth.d.ts +2 -0
- package/dist/types/components/widget/widget-error.d.ts +2 -0
- package/dist/types/helpers/connectycube.d.ts +10 -1
- package/dist/types/helpers/widget.d.ts +3 -0
- package/dist/types/hooks/store/useAppDefaultChatStore.d.ts +15 -2
- package/dist/types/hooks/store/useAppInterfaceStore.d.ts +6 -0
- package/dist/types/hooks/store/useAppNotificationStore.d.ts +2 -2
- package/dist/types/hooks/store/useAppSettingsStore.d.ts +13 -4
- package/dist/types/hooks/useAppAuthorization.d.ts +2 -1
- package/dist/types/hooks/useAppPresets.d.ts +8 -3
- package/dist/types/locales/el/translation.json.d.ts +35 -1
- package/dist/types/locales/en/translation.json.d.ts +35 -1
- package/dist/types/locales/ua/translation.json.d.ts +35 -1
- package/package.json +18 -14
- package/dist/react19/connectycube-chat-widget-sw.js +0 -44
- package/dist/react19/logo.png +0 -0
- package/dist/react19/types/App.d.ts +0 -23
- package/dist/react19/types/components/calls/calls-confirm-incoming.d.ts +0 -2
- package/dist/react19/types/components/calls/calls-fullscreen-stream.d.ts +0 -6
- package/dist/react19/types/components/calls/calls-header-buttons.d.ts +0 -3
- package/dist/react19/types/components/calls/calls-modal-screen.d.ts +0 -2
- package/dist/react19/types/components/calls/calls-navigation/calls-nav-buttons.d.ts +0 -5
- package/dist/react19/types/components/calls/calls-navigation/calls-nav-hung-up.d.ts +0 -2
- package/dist/react19/types/components/calls/calls-navigation/calls-nav-screen-share.d.ts +0 -2
- package/dist/react19/types/components/calls/calls-navigation/calls-nav-toggle-camera.d.ts +0 -2
- package/dist/react19/types/components/calls/calls-navigation/calls-nav-toggle-mic.d.ts +0 -2
- package/dist/react19/types/components/home/home.d.ts +0 -2
- package/dist/react19/types/components/home/main/chat-header/chat-header-avatar.d.ts +0 -3
- package/dist/react19/types/components/home/main/chat-header/chat-header-back-button.d.ts +0 -3
- package/dist/react19/types/components/home/main/chat-header/chat-header-buttons.d.ts +0 -3
- package/dist/react19/types/components/home/main/chat-header/chat-header-titles.d.ts +0 -3
- package/dist/react19/types/components/home/main/chat-header/chat-header.d.ts +0 -3
- package/dist/react19/types/components/home/main/chat-header.d.ts +0 -3
- package/dist/react19/types/components/home/main/chat-info-members.d.ts +0 -3
- package/dist/react19/types/components/home/main/chat-info-user.d.ts +0 -7
- package/dist/react19/types/components/home/main/chat-input.d.ts +0 -8
- package/dist/react19/types/components/home/main/chat-messages-list.d.ts +0 -6
- package/dist/react19/types/components/home/main/group-member.d.ts +0 -8
- package/dist/react19/types/components/home/main/main.d.ts +0 -2
- package/dist/react19/types/components/home/main/message/message-attachment.d.ts +0 -9
- package/dist/react19/types/components/home/main/message/message-body.d.ts +0 -6
- package/dist/react19/types/components/home/main/message/message-status-mark.d.ts +0 -6
- package/dist/react19/types/components/home/main/message/message-url-preview.d.ts +0 -7
- package/dist/react19/types/components/home/main/message/message.d.ts +0 -15
- package/dist/react19/types/components/home/main/my-profile/my-block-list-item.d.ts +0 -7
- package/dist/react19/types/components/home/main/my-profile/my-block-list.d.ts +0 -3
- package/dist/react19/types/components/home/main/my-profile/my-profile-settings.d.ts +0 -2
- package/dist/react19/types/components/home/main/my-profile/my-profile.d.ts +0 -3
- package/dist/react19/types/components/home/main/profile-info.d.ts +0 -6
- package/dist/react19/types/components/home/main/quick-actions.d.ts +0 -5
- package/dist/react19/types/components/home/main/report-user-dialog.d.ts +0 -6
- package/dist/react19/types/components/home/main/user-status/user-status-badge.d.ts +0 -7
- package/dist/react19/types/components/home/main/user-status/user-status-select.d.ts +0 -3
- package/dist/react19/types/components/home/main/user-status/user-status.d.ts +0 -6
- package/dist/react19/types/components/home/sidebar/chat-item.d.ts +0 -8
- package/dist/react19/types/components/home/sidebar/chats-list.d.ts +0 -3
- package/dist/react19/types/components/home/sidebar/new-chat/create-group-chat/create-group-chat.d.ts +0 -8
- package/dist/react19/types/components/home/sidebar/new-chat/create-group-chat/participant.d.ts +0 -7
- package/dist/react19/types/components/home/sidebar/new-chat/new-chat-dialog.d.ts +0 -9
- package/dist/react19/types/components/home/sidebar/new-chat/searched-user.d.ts +0 -13
- package/dist/react19/types/components/home/sidebar/sidebar.d.ts +0 -2
- package/dist/react19/types/components/home/sidebar/tabs/chats-tab.d.ts +0 -2
- package/dist/react19/types/components/home/sidebar/tabs/users-tab.d.ts +0 -2
- package/dist/react19/types/components/home/sidebar/user-item.d.ts +0 -9
- package/dist/react19/types/components/home/sidebar/users-list.d.ts +0 -6
- package/dist/react19/types/components/shadcn-ui/alert-dialog.d.ts +0 -14
- package/dist/react19/types/components/shadcn-ui/avatar.d.ts +0 -6
- package/dist/react19/types/components/shadcn-ui/badge.d.ts +0 -9
- package/dist/react19/types/components/shadcn-ui/button.d.ts +0 -10
- package/dist/react19/types/components/shadcn-ui/dialog.d.ts +0 -13
- package/dist/react19/types/components/shadcn-ui/dropdown-menu.d.ts +0 -25
- package/dist/react19/types/components/shadcn-ui/input.d.ts +0 -3
- package/dist/react19/types/components/shadcn-ui/label.d.ts +0 -4
- package/dist/react19/types/components/shadcn-ui/sonner.d.ts +0 -3
- package/dist/react19/types/components/shadcn-ui/switch.d.ts +0 -4
- package/dist/react19/types/components/shadcn-ui/tabs.d.ts +0 -7
- package/dist/react19/types/components/shadcn-ui/tooltip.d.ts +0 -7
- package/dist/react19/types/components/shared/alert-busy.d.ts +0 -2
- package/dist/react19/types/components/shared/avatar.d.ts +0 -15
- package/dist/react19/types/components/shared/chat-status-mark.d.ts +0 -2
- package/dist/react19/types/components/shared/confirmation-alert.d.ts +0 -8
- package/dist/react19/types/components/shared/empty-content-placeholder.d.ts +0 -7
- package/dist/react19/types/components/shared/loader.d.ts +0 -5
- package/dist/react19/types/components/widget/widget-app.d.ts +0 -8
- package/dist/react19/types/components/widget/widget-button.d.ts +0 -9
- package/dist/react19/types/components/widget/widget-calls.d.ts +0 -2
- package/dist/react19/types/components/widget/widget-messages-badge.d.ts +0 -5
- package/dist/react19/types/components/widget/widget-online-badge.d.ts +0 -5
- package/dist/react19/types/components/widget/widget-overlay.d.ts +0 -7
- package/dist/react19/types/components/widget/widget-portal.d.ts +0 -8
- package/dist/react19/types/components/widget/widget-shadow-root.d.ts +0 -6
- package/dist/react19/types/helpers/connectycube.d.ts +0 -47
- package/dist/react19/types/helpers/debounce.d.ts +0 -3
- package/dist/react19/types/helpers/i18n.d.ts +0 -2
- package/dist/react19/types/helpers/notifications.d.ts +0 -11
- package/dist/react19/types/helpers/throttle.d.ts +0 -3
- package/dist/react19/types/helpers/widget.d.ts +0 -9
- package/dist/react19/types/hooks/index.d.ts +0 -23
- package/dist/react19/types/hooks/store/useActiveTabsStore.d.ts +0 -15
- package/dist/react19/types/hooks/store/useAlertBusyStore.d.ts +0 -11
- package/dist/react19/types/hooks/store/useAppDefaultChatStore.d.ts +0 -21
- package/dist/react19/types/hooks/store/useAppInterfaceStore.d.ts +0 -31
- package/dist/react19/types/hooks/store/useAppNotificationStore.d.ts +0 -34
- package/dist/react19/types/hooks/store/useAppQuickActionsStore.d.ts +0 -17
- package/dist/react19/types/hooks/store/useAppSettingsStore.d.ts +0 -37
- package/dist/react19/types/hooks/store/useDraftMessagesStore.d.ts +0 -14
- package/dist/react19/types/hooks/store/useLinkPreviewStore.d.ts +0 -18
- package/dist/react19/types/hooks/store/useOnlineUsersCountStore.d.ts +0 -19
- package/dist/react19/types/hooks/store/useProfileStore.d.ts +0 -9
- package/dist/react19/types/hooks/store/useShadowRootStore.d.ts +0 -7
- package/dist/react19/types/hooks/store/useUnreadCountStore.d.ts +0 -8
- package/dist/react19/types/hooks/store/useUserSettingsStore.d.ts +0 -17
- package/dist/react19/types/hooks/useAppAuthorization.d.ts +0 -14
- package/dist/react19/types/hooks/useAppPresets.d.ts +0 -35
- package/dist/react19/types/hooks/useAudio.d.ts +0 -6
- package/dist/react19/types/hooks/useLastActivity.d.ts +0 -2
- package/dist/react19/types/hooks/useNotification.d.ts +0 -9
- package/dist/react19/types/hooks/usePageFocus.d.ts +0 -6
- package/dist/react19/types/hooks/useResizeScreenWidth.d.ts +0 -10
- package/dist/react19/types/hooks/useTypingStatusText.d.ts +0 -3
- package/dist/react19/types/index.d.ts +0 -10
- package/dist/react19/types/lib/utils.d.ts +0 -6
- package/dist/react19/types/locales/el/translation.json.d.ts +0 -76
- package/dist/react19/types/locales/en/translation.json.d.ts +0 -76
- package/dist/react19/types/locales/ua/translation.json.d.ts +0 -76
- package/dist/react19/types/main.d.ts +0 -1
- package/dist/react19/types/tests/connectycube.test.d.ts +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare function Card({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
export declare const shadcnClassNames: {
|
|
3
|
+
alertDialogOverlay: ClassValue;
|
|
4
|
+
alertDialogContent: ClassValue;
|
|
5
|
+
alertDialogHeader: ClassValue;
|
|
6
|
+
alertDialogFooter: ClassValue;
|
|
7
|
+
alertDialogTitle: ClassValue;
|
|
8
|
+
alertDialogDescription: ClassValue;
|
|
9
|
+
avatar: ClassValue;
|
|
10
|
+
avatarImage: ClassValue;
|
|
11
|
+
avatarFallback: ClassValue;
|
|
12
|
+
badge: ClassValue;
|
|
13
|
+
button: ClassValue;
|
|
14
|
+
card: ClassValue;
|
|
15
|
+
cardHeader: ClassValue;
|
|
16
|
+
cardTitle: ClassValue;
|
|
17
|
+
cardDescription: ClassValue;
|
|
18
|
+
cardAction: ClassValue;
|
|
19
|
+
cardContent: ClassValue;
|
|
20
|
+
cardFooter: ClassValue;
|
|
21
|
+
checkbox: ClassValue;
|
|
22
|
+
dialogOverlay: ClassValue;
|
|
23
|
+
dialogContent: ClassValue;
|
|
24
|
+
dialogHeader: ClassValue;
|
|
25
|
+
dialogFooter: ClassValue;
|
|
26
|
+
dialogTitle: ClassValue;
|
|
27
|
+
dialogDescription: ClassValue;
|
|
28
|
+
dropdownMenuContent: ClassValue;
|
|
29
|
+
dropdownMenuItem: ClassValue;
|
|
30
|
+
dropdownMenuCheckboxItem: ClassValue;
|
|
31
|
+
dropdownMenuRadioItem: ClassValue;
|
|
32
|
+
dropdownMenuLabel: ClassValue;
|
|
33
|
+
dropdownMenuSeparator: ClassValue;
|
|
34
|
+
dropdownMenuShortcut: ClassValue;
|
|
35
|
+
dropdownMenuSubTrigger: ClassValue;
|
|
36
|
+
dropdownMenuSubContent: ClassValue;
|
|
37
|
+
input: ClassValue[];
|
|
38
|
+
label: ClassValue;
|
|
39
|
+
switch: ClassValue;
|
|
40
|
+
switchThumb: ClassValue;
|
|
41
|
+
tabs: ClassValue;
|
|
42
|
+
tabsList: ClassValue;
|
|
43
|
+
tabsTrigger: ClassValue;
|
|
44
|
+
tabsContent: ClassValue;
|
|
45
|
+
tooltipContent: ClassValue;
|
|
46
|
+
};
|
|
@@ -9,17 +9,21 @@ export declare enum USER_STATUS {
|
|
|
9
9
|
AWAY = "Away"
|
|
10
10
|
}
|
|
11
11
|
export declare const SESSION_KEY = "@connectycube/chat-widget:session";
|
|
12
|
+
export declare const GUEST_KEY = "@connectycube/chat-widget:guest";
|
|
13
|
+
export declare const REMEMBER_ME_KEY = "@connectycube/chat-widget:rememberMe";
|
|
12
14
|
export declare const initConnectyCubeSDK: (credentials: Config.Credentials, config?: Config.Options) => void;
|
|
13
15
|
export declare const tryReuseSession: (userName?: string, userId?: string, userAvatar?: string, userProfileLink?: string) => Promise<boolean>;
|
|
14
16
|
export declare const restoreSession: () => Promise<Auth.Session | null>;
|
|
15
17
|
export declare const createUserSession: (login: string, password: string) => Promise<Auth.Session>;
|
|
18
|
+
export declare const createGuestSession: (full_name: string) => Promise<Auth.Session>;
|
|
16
19
|
export declare const createSession: (userId?: string, userName?: string, userAvatar?: string, userProfileLink?: string) => Promise<Auth.Session | null>;
|
|
17
20
|
export declare const destroyUserSession: () => Promise<void>;
|
|
21
|
+
export declare const getServiceSession: () => Auth.Session | null;
|
|
18
22
|
export declare const userSignup: (login: string, password: string, name?: string, externalId?: string, userAvatar?: string, userProfileLink?: string) => Promise<Auth.Session>;
|
|
19
23
|
export declare const upsertConnectyCubeConfig: (config?: Config.Options) => void;
|
|
20
24
|
export declare const autoconnect: (connect: (credentials: Chat.ConnectionParams) => Promise<boolean>, session?: Auth.Session | null) => Promise<boolean>;
|
|
21
25
|
export declare const updateUserProfileIfNeeded: (session: Auth.Session, name?: string, externalId?: string, avatar?: string, userProfileLink?: string) => Promise<Auth.Session>;
|
|
22
|
-
export declare const setSessionToLocalStorage: (session: Auth.Session) => void;
|
|
26
|
+
export declare const setSessionToLocalStorage: (session: Auth.Session, ignore?: boolean) => void;
|
|
23
27
|
export declare const getSessionFromLocalStorage: () => Auth.Session | null;
|
|
24
28
|
export declare const clearSessionInLocalStorage: () => void;
|
|
25
29
|
export declare const getCurrentUser: () => Users.User | null | undefined;
|
|
@@ -45,3 +49,8 @@ export declare const createUserReport: (reportedUserId: number, reason: string)
|
|
|
45
49
|
export declare const subscribeToPushNotifications: (pushSubscriptionData?: PushSubscriptionData) => Promise<PushNotifications.Subscription | undefined>;
|
|
46
50
|
export declare const unsubscribeFromPushNotifications: () => Promise<EmptyResponse[]>;
|
|
47
51
|
export declare const isCallsSupported: boolean;
|
|
52
|
+
export declare const setRememberMe: (rememberMe?: boolean) => void;
|
|
53
|
+
export declare const setGuestUser: (isGuest?: boolean) => void;
|
|
54
|
+
export declare const isRememberMe: () => boolean;
|
|
55
|
+
export declare const isGuestUser: () => boolean;
|
|
56
|
+
export declare const isTempSession: () => boolean;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Users } from 'connectycube/types';
|
|
2
|
+
export declare const buildExternalIdFromUsers: (users?: Users.User[]) => string;
|
|
1
3
|
export declare const sleep: (ms: number) => Promise<void>;
|
|
2
4
|
export declare const stripSpecificTailwindSupports: (css: string) => string;
|
|
3
5
|
export declare const isBrowser: boolean;
|
|
@@ -7,3 +9,4 @@ export declare enum dataPrefix {
|
|
|
7
9
|
}
|
|
8
10
|
export declare const widgetFontSize = "15px";
|
|
9
11
|
export declare const widgetFontWeight = "400";
|
|
12
|
+
export declare const widgetExternalIdPrefix = "external_id";
|
|
@@ -1,18 +1,31 @@
|
|
|
1
|
+
export declare enum DefaultChatTypes {
|
|
2
|
+
SINGLE = "1on1",
|
|
3
|
+
GROUP = "group"
|
|
4
|
+
}
|
|
1
5
|
export type DefaultChat = {
|
|
2
6
|
id: string;
|
|
3
|
-
opponentUserId
|
|
4
|
-
type:
|
|
7
|
+
opponentUserId?: string | string[];
|
|
8
|
+
type: DefaultChatTypes;
|
|
5
9
|
name?: string;
|
|
10
|
+
photo?: string;
|
|
6
11
|
metadata?: {
|
|
7
12
|
[key: string]: string;
|
|
8
13
|
};
|
|
9
14
|
};
|
|
15
|
+
export type SingleViewChat = {
|
|
16
|
+
opponentUserIds: string | string[];
|
|
17
|
+
name?: string;
|
|
18
|
+
photo?: string;
|
|
19
|
+
};
|
|
10
20
|
export type AppDefaultChatStateProps = {
|
|
11
21
|
defaultChat?: DefaultChat | null;
|
|
22
|
+
singleViewChat: SingleViewChat;
|
|
12
23
|
};
|
|
13
24
|
interface AppDefaultChatState extends AppDefaultChatStateProps {
|
|
14
25
|
setDefaultChat: (defaultChat?: DefaultChat) => void;
|
|
26
|
+
setSingleViewChat: (singleViewChat?: SingleViewChat) => void;
|
|
15
27
|
resetDefaultChat: () => void;
|
|
28
|
+
resetSingleViewChat: () => void;
|
|
16
29
|
}
|
|
17
30
|
export declare const appDefaultChatInitialState: AppDefaultChatStateProps;
|
|
18
31
|
declare const useDefaultChatStore: import('zustand').UseBoundStore<import('zustand').StoreApi<AppDefaultChatState>>;
|
|
@@ -1,28 +1,34 @@
|
|
|
1
1
|
export type AppInterfaceStoreProps = {
|
|
2
2
|
opened: boolean;
|
|
3
3
|
splitView: boolean;
|
|
4
|
+
singleView: boolean;
|
|
4
5
|
showChatStatus: boolean;
|
|
5
6
|
showOnlineUsersTab: boolean;
|
|
6
7
|
hideNewChatButton: boolean;
|
|
7
8
|
hideNewUserChatOption: boolean;
|
|
8
9
|
hideNewGroupChatOption: boolean;
|
|
10
|
+
imgLogoSource: string;
|
|
9
11
|
};
|
|
10
12
|
export interface AppInterfaceStoreState extends AppInterfaceStoreProps {
|
|
11
13
|
setOpened: (opened: boolean) => void;
|
|
12
14
|
setSplitView: (splitView: boolean) => void;
|
|
15
|
+
setSingleView: (singleView: boolean) => void;
|
|
13
16
|
setShowChatStatus: (showChatStatus: boolean) => void;
|
|
14
17
|
setShowOnlineUsersTab: (showOnlineUsersTab: boolean) => void;
|
|
15
18
|
setHideNewChatButton: (hideNewChatButton: boolean) => void;
|
|
16
19
|
setHideNewUserChatOption: (hideNewUserChatOption: boolean) => void;
|
|
17
20
|
setHideNewGroupChatOption: (hideNewGroupChatOption: boolean) => void;
|
|
21
|
+
setImgLogoSource: (imgLogoSource: string) => void;
|
|
18
22
|
toggleOpened: () => void;
|
|
19
23
|
resetOpened: () => void;
|
|
20
24
|
resetSplitView: () => void;
|
|
25
|
+
resetSingleView: () => void;
|
|
21
26
|
resetShowChatStatus: () => void;
|
|
22
27
|
resetShowOnlineUsersTab: () => void;
|
|
23
28
|
resetHideNewChatButton: () => void;
|
|
24
29
|
resetHideNewUserChatOption: () => void;
|
|
25
30
|
resetHideNewGroupChatOption: () => void;
|
|
31
|
+
resetImgLogoSource: () => void;
|
|
26
32
|
}
|
|
27
33
|
export declare const appInterfaceStoreInitialState: AppInterfaceStoreProps;
|
|
28
34
|
declare const useAppInterfaceStore: import('zustand').UseBoundStore<import('zustand').StoreApi<AppInterfaceStoreState>>;
|
|
@@ -25,8 +25,8 @@ export declare const appNotificationStoreInitialState: {
|
|
|
25
25
|
showNotifications: boolean;
|
|
26
26
|
playSound: boolean;
|
|
27
27
|
webPushNotifications: boolean;
|
|
28
|
-
webPushVapidPublicKey:
|
|
29
|
-
serviceWorkerPath:
|
|
28
|
+
webPushVapidPublicKey: any;
|
|
29
|
+
serviceWorkerPath: any;
|
|
30
30
|
};
|
|
31
31
|
declare const useAppNotificationStore: import('zustand').UseBoundStore<import('zustand').StoreApi<AppNotificationStoreState>>;
|
|
32
32
|
export declare const setAppNotificationStore: (state: Partial<AppNotificationStoreProps>) => void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export type AppSettingStoreProps = {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
userAuthorized: boolean;
|
|
3
|
+
attachmentsAccept: string | null;
|
|
4
|
+
attachmentsAcceptList: string[] | null;
|
|
5
|
+
enableUserLogin: boolean;
|
|
4
6
|
enableCalls: boolean;
|
|
5
7
|
enableUserStatuses: boolean;
|
|
6
8
|
enableLastSeen: boolean;
|
|
@@ -8,9 +10,12 @@ export type AppSettingStoreProps = {
|
|
|
8
10
|
enableBlockList: boolean;
|
|
9
11
|
enableUrlPreview: boolean;
|
|
10
12
|
limitUrlsPreviews: number;
|
|
13
|
+
termsAndConditions?: string;
|
|
11
14
|
};
|
|
12
15
|
export interface AppSettingStoreState extends AppSettingStoreProps {
|
|
13
|
-
|
|
16
|
+
setUserAuthorized: (userAuthorized: boolean) => void;
|
|
17
|
+
setAttachmentsAccept: (attachmentsAccept: string | null) => void;
|
|
18
|
+
setEnableUserLogin: (enableUserLogin: boolean) => void;
|
|
14
19
|
setEnableCalls: (enableCalls: boolean) => void;
|
|
15
20
|
setEnableUserStatuses: (enableUserStatuses: boolean) => void;
|
|
16
21
|
setEnableLastSeen: (enableLastSeen: boolean) => void;
|
|
@@ -18,7 +23,10 @@ export interface AppSettingStoreState extends AppSettingStoreProps {
|
|
|
18
23
|
setEnableBlockList: (enableBlockList: boolean) => void;
|
|
19
24
|
setEnableUrlPreview: (enableUrlPreview: boolean) => void;
|
|
20
25
|
setLimitUrlsPreviews: (limitUrlsPreviews: number) => void;
|
|
26
|
+
setTermsAndConditions: (termsAndConditions?: string) => void;
|
|
27
|
+
resetUserAuthorized: () => void;
|
|
21
28
|
resetAttachmentsAccept: () => void;
|
|
29
|
+
resetEnableUserLogin: () => void;
|
|
22
30
|
resetEnableCalls: () => void;
|
|
23
31
|
resetEnableUserStatuses: () => void;
|
|
24
32
|
resetEnableLastSeen: () => void;
|
|
@@ -26,6 +34,7 @@ export interface AppSettingStoreState extends AppSettingStoreProps {
|
|
|
26
34
|
resetEnableBlockList: () => void;
|
|
27
35
|
resetEnableUrlPreview: () => void;
|
|
28
36
|
resetLimitUrlsPreviews: () => void;
|
|
37
|
+
resetTermsAndConditions: () => void;
|
|
29
38
|
isSupportedFile: (file: File) => boolean;
|
|
30
39
|
}
|
|
31
40
|
export declare const appSettingsStoreInitialState: AppSettingStoreProps;
|
|
@@ -33,5 +42,5 @@ declare const useAppSettingsStore: import('zustand').UseBoundStore<import('zusta
|
|
|
33
42
|
export declare const setAppSettingsStore: (state: Partial<AppSettingStoreProps>) => void;
|
|
34
43
|
export declare const resetAppSettingsStore: () => void;
|
|
35
44
|
export default useAppSettingsStore;
|
|
36
|
-
export declare const getAttachmentsAcceptList: (attachmentsAccept: string) => string[];
|
|
45
|
+
export declare const getAttachmentsAcceptList: (attachmentsAccept: string | null) => string[] | null;
|
|
37
46
|
export declare const isSupportedFileMimeType: (file: File, attachmentsAcceptList: AppSettingStoreState["attachmentsAcceptList"]) => boolean;
|
|
@@ -9,6 +9,7 @@ type AppAuthorizationProps = {
|
|
|
9
9
|
creds: Config.Credentials;
|
|
10
10
|
config?: Config.Options;
|
|
11
11
|
user?: AppUser;
|
|
12
|
+
enableUserLogin: boolean;
|
|
12
13
|
};
|
|
13
|
-
declare const useAppAuthorization: ({ creds, config, user }: AppAuthorizationProps) => void;
|
|
14
|
+
declare const useAppAuthorization: ({ creds, config, user, enableUserLogin }: AppAuthorizationProps) => void;
|
|
14
15
|
export default useAppAuthorization;
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { DefaultChat } from './store/useAppDefaultChatStore';
|
|
1
|
+
import { DefaultChat, SingleViewChat } from './store/useAppDefaultChatStore';
|
|
2
2
|
import { QuickActions } from './store/useAppQuickActionsStore';
|
|
3
3
|
export type AppPresets = {
|
|
4
4
|
open?: boolean;
|
|
5
5
|
embedView?: boolean;
|
|
6
6
|
splitView?: boolean;
|
|
7
|
+
singleView?: boolean;
|
|
7
8
|
showChatStatus?: boolean;
|
|
8
9
|
showOnlineUsersTab?: boolean;
|
|
9
10
|
hideNewChatButton?: boolean;
|
|
10
11
|
hideNewUserChatOption?: boolean;
|
|
11
12
|
hideNewGroupChatOption?: boolean;
|
|
13
|
+
imgLogoSource?: string;
|
|
12
14
|
muted?: boolean;
|
|
13
15
|
showNotifications?: boolean;
|
|
14
16
|
playSound?: boolean;
|
|
15
17
|
webPushNotifications?: boolean;
|
|
16
18
|
webPushVapidPublicKey?: string;
|
|
17
19
|
serviceWorkerPath?: string | URL;
|
|
18
|
-
attachmentsAccept?: string;
|
|
20
|
+
attachmentsAccept?: string | null;
|
|
21
|
+
enableUserLogin?: boolean;
|
|
19
22
|
enableCalls?: boolean;
|
|
20
23
|
enableUserStatuses?: boolean;
|
|
21
24
|
enableLastSeen?: boolean;
|
|
@@ -25,11 +28,13 @@ export type AppPresets = {
|
|
|
25
28
|
getOnlineUsersInterval?: number;
|
|
26
29
|
enableUrlPreview?: boolean;
|
|
27
30
|
limitUrlsPreviews?: number;
|
|
31
|
+
singleViewChat?: SingleViewChat;
|
|
32
|
+
termsAndConditions?: string;
|
|
28
33
|
quickActions?: QuickActions;
|
|
29
34
|
defaultChat?: DefaultChat | null;
|
|
30
35
|
onUnreadCountChange?: (count: number) => void;
|
|
31
36
|
onOnlineUsersCountChange?: (count: number) => void;
|
|
32
37
|
onOpenChange?: (open: boolean) => void;
|
|
33
38
|
};
|
|
34
|
-
declare const useAppPresets: ({
|
|
39
|
+
declare const useAppPresets: ({ open, embedView, splitView, singleView, showChatStatus, showOnlineUsersTab, hideNewChatButton, hideNewUserChatOption, hideNewGroupChatOption, imgLogoSource, muted, showNotifications, playSound, webPushNotifications, serviceWorkerPath, webPushVapidPublicKey, attachmentsAccept, enableUserLogin, enableCalls, enableUserStatuses, enableLastSeen, enableContentReporting, enableBlockList, enableUrlPreview, limitUrlsPreviews, termsAndConditions, quickActions, defaultChat, singleViewChat, enableOnlineUsersBadge, getOnlineUsersInterval, onUnreadCountChange, onOnlineUsersCountChange, onOpenChange, }: AppPresets) => void;
|
|
35
40
|
export default useAppPresets;
|
|
@@ -69,7 +69,41 @@ declare const _default: {
|
|
|
69
69
|
"Accept": "Αποδοχή",
|
|
70
70
|
"Reject": "Απόρριψη",
|
|
71
71
|
"RejectedCall": "Ο χρήστης {{name}} απέρριψε την κλήση",
|
|
72
|
-
"MissedCall": "Αναπάντητη κλήση από τον χρήστη {{name}}"
|
|
72
|
+
"MissedCall": "Αναπάντητη κλήση από τον χρήστη {{name}}",
|
|
73
|
+
"AuthForm": {
|
|
74
|
+
"Login": "Σύνδεση",
|
|
75
|
+
"Password": "Κωδικός πρόσβασης",
|
|
76
|
+
"Register": "Εγγραφή",
|
|
77
|
+
"Registration": "Εγγραφή",
|
|
78
|
+
"LoginRequired": "Το όνομα χρήστη είναι υποχρεωτικό",
|
|
79
|
+
"LoginMinLimit": "Το όνομα χρήστη πρέπει να έχει τουλάχιστον {{limit}} χαρακτήρες",
|
|
80
|
+
"LoginMaxLimit": "Το όνομα χρήστη πρέπει να έχει το πολύ {{limit}} χαρακτήρες",
|
|
81
|
+
"PasswordRequired": "Ο κωδικός πρόσβασης είναι υποχρεωτικός",
|
|
82
|
+
"PasswordMinLimit": "Ο κωδικός πρόσβασης πρέπει να έχει τουλάχιστον {{limit}} χαρακτήρες",
|
|
83
|
+
"PasswordMaxLimit": "Ο κωδικός πρόσβασης πρέπει να έχει το πολύ {{limit}} χαρακτήρες",
|
|
84
|
+
"LoginDescription": "Εισάγετε το όνομα χρήστη και τον κωδικό πρόσβασης για να αποκτήσετε πρόσβαση στον λογαριασμό σας",
|
|
85
|
+
"RegisterDescription": "Συμπληρώστε την παρακάτω φόρμα για να εγγραφείτε",
|
|
86
|
+
"ToRegister?": "Δεν έχετε λογαριασμό;",
|
|
87
|
+
"ToLogin?": "Έχετε ήδη λογαριασμό;"
|
|
88
|
+
},
|
|
89
|
+
"SingleViewForm": {
|
|
90
|
+
"Title": "Υποβάλετε τα στοιχεία επικοινωνίας σας για να ξεκινήσετε μια συνομιλία",
|
|
91
|
+
"Subtitle": "Δεν θα κοινοποιήσουμε τη διεύθυνση email σας. Η διεύθυνση email σας χρησιμοποιείται αποκλειστικά για να επικοινωνήσουμε μαζί σας.",
|
|
92
|
+
"NamePlaceholder": "Όνομα",
|
|
93
|
+
"NameRequired": "Το όνομα είναι υποχρεωτικό",
|
|
94
|
+
"EmailPlaceholder": "E-mail",
|
|
95
|
+
"EmailRequired": "Απαιτείται email",
|
|
96
|
+
"Emailnvalid": "Μη έγκυρη μορφή email",
|
|
97
|
+
"AcceptTermsAndConditions": "Αποδοχή όρων και προϋποθέσεων",
|
|
98
|
+
"AcceptTermsAndConditionsError": "Πρέπει να αποδεχτείτε τους όρους και τις προϋποθέσεις",
|
|
99
|
+
"TermsAndConditionsText": "Κάνοντας κλικ σε αυτό το πλαίσιο, συμφωνείτε με τους",
|
|
100
|
+
"TermsAndConditionsLink": "όρους και προϋποθέσεις",
|
|
101
|
+
"RememberMe": "Να με θυμάσαι",
|
|
102
|
+
"RememberMeText": "Αυτή είναι η προσωπική μου συσκευή",
|
|
103
|
+
"Next": "Επόμενο"
|
|
104
|
+
},
|
|
105
|
+
"SingleViewChatError": "Δεν βρέθηκαν αντίπαλοι για τη συνομιλία",
|
|
106
|
+
"Information": "Πληροφορίες"
|
|
73
107
|
}
|
|
74
108
|
;
|
|
75
109
|
|
|
@@ -69,7 +69,41 @@ declare const _default: {
|
|
|
69
69
|
"Accept": "Accept",
|
|
70
70
|
"Reject": "Reject",
|
|
71
71
|
"RejectedCall": "{{name}} rejected the call",
|
|
72
|
-
"MissedCall": "Missed call from {{name}}"
|
|
72
|
+
"MissedCall": "Missed call from {{name}}",
|
|
73
|
+
"AuthForm": {
|
|
74
|
+
"Login": "Login",
|
|
75
|
+
"Password": "Password",
|
|
76
|
+
"Register": "Register",
|
|
77
|
+
"Registration": "Registration",
|
|
78
|
+
"LoginRequired": "Login is required",
|
|
79
|
+
"LoginMinLimit": "Login must be at least {{limit}} symbols",
|
|
80
|
+
"LoginMaxLimit": "Login must be at most {{limit}} symbols",
|
|
81
|
+
"PasswordRequired": "Login is required",
|
|
82
|
+
"PasswordMinLimit": "Password must be at least {{limit}} symbols",
|
|
83
|
+
"PasswordMaxLimit": "Password must be at most {{limit}} symbols",
|
|
84
|
+
"LoginDescription": "Enter your login and password to access your account",
|
|
85
|
+
"RegisterDescription": "Fill in the form below to sign up",
|
|
86
|
+
"ToRegister?": "Don't have an account?",
|
|
87
|
+
"ToLogin?": "Already have an account?"
|
|
88
|
+
},
|
|
89
|
+
"SingleViewForm": {
|
|
90
|
+
"Title": "Submit your contact data to start a chat",
|
|
91
|
+
"Subtitle": "We will not share your email address. Your email address is used solely to contact you",
|
|
92
|
+
"NamePlaceholder": "Name",
|
|
93
|
+
"NameRequired": "Name is required",
|
|
94
|
+
"EmailPlaceholder": "Email",
|
|
95
|
+
"EmailRequired": "Email is required",
|
|
96
|
+
"EmailInvalid": "Invalid email format",
|
|
97
|
+
"AcceptTermsAndConditions": "Accept terms and conditions",
|
|
98
|
+
"AcceptTermsAndConditionsError": "You must accept the terms and conditions",
|
|
99
|
+
"TermsAndConditionsText": "By clicking this checkbox, you agree to the",
|
|
100
|
+
"TermsAndConditionsLink": "terms and conditions",
|
|
101
|
+
"RememberMe": "Remember me",
|
|
102
|
+
"RememberMeText": "This is my private device",
|
|
103
|
+
"Next": "Next"
|
|
104
|
+
},
|
|
105
|
+
"SingleViewChatError": "Opponent(s) for the chat not found",
|
|
106
|
+
"Information": "Information"
|
|
73
107
|
}
|
|
74
108
|
;
|
|
75
109
|
|
|
@@ -69,7 +69,41 @@ declare const _default: {
|
|
|
69
69
|
"Accept": "Прийняти",
|
|
70
70
|
"Reject": "Відхилити",
|
|
71
71
|
"RejectedCall": "{{name}} відхилив виклик",
|
|
72
|
-
"MissedCall": "Пропущений виклик від {{name}}"
|
|
72
|
+
"MissedCall": "Пропущений виклик від {{name}}",
|
|
73
|
+
"AuthForm": {
|
|
74
|
+
"Login": "Логін",
|
|
75
|
+
"Password": "Пароль",
|
|
76
|
+
"Register": "Зареєструвати",
|
|
77
|
+
"Registration": "Реєстрація",
|
|
78
|
+
"LoginRequired": "Логін є обов'язковим",
|
|
79
|
+
"LoginMinLimit": "Логін має містити щонайменше {{limit}} символів",
|
|
80
|
+
"LoginMaxLimit": "Логін має містити не більше {{limit}} символів",
|
|
81
|
+
"PasswordRequired": "Пароль є обов'язковим",
|
|
82
|
+
"PasswordMinLimit": "Пароль має містити щонайменше {{limit}} символів",
|
|
83
|
+
"PasswordMaxLimit": "Пароль має містити не більше {{limit}} символів",
|
|
84
|
+
"LoginDescription": "Введіть ваш логін та пароль для доступу до акаунту",
|
|
85
|
+
"RegisterDescription": "Заповніть форму нижче для реєстрації",
|
|
86
|
+
"ToRegister?": "Ще не маєте акаунту?",
|
|
87
|
+
"ToLogin?": "Вже маєте акаунт?"
|
|
88
|
+
},
|
|
89
|
+
"SingleViewForm": {
|
|
90
|
+
"Title": "Введіть свою електронну пошту, щоб почати чат",
|
|
91
|
+
"Subtitle": "Ми не будемо передавати вашу електронну пошту. Ваша електронна пошта використовується виключно для зв'язку з вами",
|
|
92
|
+
"NamePlaceholder": "Ім'я",
|
|
93
|
+
"NameRequired": "Ім'я є обов'язковим",
|
|
94
|
+
"EmailPlaceholder": "Електронна пошта",
|
|
95
|
+
"EmailRequired": "Електронна пошта є обов'язковою",
|
|
96
|
+
"EmailInvalid": "Невірний формат електронної пошти",
|
|
97
|
+
"AcceptTermsAndConditions": "Прийняти умови та положення",
|
|
98
|
+
"AcceptTermsAndConditionsError": "Ви повинні прийняти умови та положення",
|
|
99
|
+
"TermsAndConditionsText": "Натискаючи цю галочку, ви погоджуєтесь з",
|
|
100
|
+
"TermsAndConditionsLink": "умовами та положеннями",
|
|
101
|
+
"RememberMe": "Запам'ятати мене",
|
|
102
|
+
"RememberMeText": "Це мій приватний пристрій",
|
|
103
|
+
"Next": "Далі"
|
|
104
|
+
},
|
|
105
|
+
"SingleViewChatError": "Опонента(ів) для чату не знайдено",
|
|
106
|
+
"Information": "Інформація"
|
|
73
107
|
}
|
|
74
108
|
;
|
|
75
109
|
|
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.
|
|
4
|
+
"version": "0.33.0",
|
|
5
5
|
"license": "GPL-3.0-only",
|
|
6
6
|
"homepage": "https://github.com/ConnectyCube/connectycube-chat-widget#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"default": "./dist/index.es.js"
|
|
45
45
|
},
|
|
46
46
|
"./react19": {
|
|
47
|
-
"types": "./dist/
|
|
48
|
-
"import": "./dist/react19
|
|
49
|
-
"default": "./dist/react19
|
|
47
|
+
"types": "./dist/types/index.d.ts",
|
|
48
|
+
"import": "./dist/react19.es.js",
|
|
49
|
+
"default": "./dist/react19.es.js"
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
"files": [
|
|
@@ -62,14 +62,17 @@
|
|
|
62
62
|
"react:default": "npm install --no-save",
|
|
63
63
|
"vite:dev": "vite",
|
|
64
64
|
"vite:build": "tsc -b && vite build",
|
|
65
|
-
"vite:
|
|
65
|
+
"vite:build:es": "BUNDLE_FORMAT=es npm run vite:build",
|
|
66
|
+
"vite:build:umd": "BUNDLE_FORMAT=umd npm run vite:build",
|
|
66
67
|
"tailwindcss": "npx @tailwindcss/cli -i ./src/index.css -o ./src/widget.css",
|
|
67
68
|
"tailwindcss:watch": "npx @tailwindcss/cli -i ./src/index.css -o ./src/widget.css --watch",
|
|
68
69
|
"tailwindcss:minify": "npx @tailwindcss/cli -i ./src/index.css -o ./src/widget.css --minify",
|
|
69
70
|
"dev": "npx npm-run-all --parallel vite:dev tailwindcss:watch",
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"build
|
|
71
|
+
"dev:18": "npm run react:18 && REACT_VERSION=18 BUNDLE_FORMAT=es vite",
|
|
72
|
+
"dev:19": "npm run react:19 && REACT_VERSION=19 BUNDLE_FORMAT=es vite",
|
|
73
|
+
"build": "npm run tailwindcss:minify && npm run react:18 && REACT_VERSION=18 npm run vite:build:es && KEEP_DIST=true npm run vite:build:umd && npm run react:19 && REACT_VERSION=19 KEEP_DIST=true npm run vite:build:es && npm run react:default",
|
|
74
|
+
"build:18": "npm run tailwindcss:minify && npm run react:18 && REACT_VERSION=18 npm run vite:build:es && KEEP_DIST=true npm run vite:build:umd",
|
|
75
|
+
"build:19": "npm run tailwindcss:minify && npm run react:19 && REACT_VERSION=19 npm run vite:build:es",
|
|
73
76
|
"build:default": "npm run tailwindcss:minify && npm run vite:build",
|
|
74
77
|
"preview": "npm run tailwindcss && npm run vite:preview",
|
|
75
78
|
"lint": "eslint .",
|
|
@@ -83,6 +86,7 @@
|
|
|
83
86
|
"@connectycube/use-chat": "^0.26.2",
|
|
84
87
|
"@radix-ui/react-alert-dialog": "^1.1.14",
|
|
85
88
|
"@radix-ui/react-avatar": "^1.1.10",
|
|
89
|
+
"@radix-ui/react-checkbox": "^1.3.2",
|
|
86
90
|
"@radix-ui/react-dialog": "^1.1.14",
|
|
87
91
|
"@radix-ui/react-dropdown-menu": "^2.1.15",
|
|
88
92
|
"@radix-ui/react-label": "^2.1.7",
|
|
@@ -97,7 +101,7 @@
|
|
|
97
101
|
"i18next": "^25.3.2",
|
|
98
102
|
"linkify-react": "^4.3.1",
|
|
99
103
|
"linkifyjs": "^4.3.1",
|
|
100
|
-
"lucide-react": "^0.
|
|
104
|
+
"lucide-react": "^0.534.0",
|
|
101
105
|
"next-themes": "^0.4.6",
|
|
102
106
|
"react-hook-form": "^7.60.0",
|
|
103
107
|
"react-i18next": "^15.6.0",
|
|
@@ -116,10 +120,10 @@
|
|
|
116
120
|
"@eslint/js": "^9.31.0",
|
|
117
121
|
"@tailwindcss/postcss": "^4.1.11",
|
|
118
122
|
"@tailwindcss/vite": "^4.1.11",
|
|
119
|
-
"@types/node": "^24.0.
|
|
123
|
+
"@types/node": "^24.0.15",
|
|
120
124
|
"@types/react": "^19.1.8",
|
|
121
125
|
"@types/react-dom": "^19.1.6",
|
|
122
|
-
"@vitejs/plugin-react": "^4.
|
|
126
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
123
127
|
"@vitest/coverage-v8": "^3.2.4",
|
|
124
128
|
"eslint": "^9.31.0",
|
|
125
129
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
@@ -132,13 +136,13 @@
|
|
|
132
136
|
"tailwindcss": "^4.1.11",
|
|
133
137
|
"tw-animate-css": "^1.3.5",
|
|
134
138
|
"typescript": "^5.8.3",
|
|
135
|
-
"typescript-eslint": "^8.
|
|
136
|
-
"vite": "^7.0.
|
|
139
|
+
"typescript-eslint": "^8.37.0",
|
|
140
|
+
"vite": "^7.0.5",
|
|
137
141
|
"vite-plugin-dts": "^4.5.4",
|
|
138
142
|
"vitest": "^3.2.4"
|
|
139
143
|
},
|
|
140
144
|
"optionalDependencies": {
|
|
141
|
-
"@rollup/rollup-linux-x64-gnu": "4.
|
|
145
|
+
"@rollup/rollup-linux-x64-gnu": "4.46.2",
|
|
142
146
|
"@tailwindcss/oxide-linux-x64-gnu": "^4.1.11",
|
|
143
147
|
"lightningcss-linux-x64-gnu": "^1.30.1"
|
|
144
148
|
},
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
self.addEventListener('install', (event) => {
|
|
2
|
-
self.skipWaiting();
|
|
3
|
-
});
|
|
4
|
-
|
|
5
|
-
self.addEventListener('push', (event) => {
|
|
6
|
-
const { data } = event.data?.json() || {};
|
|
7
|
-
const title = data.title || '';
|
|
8
|
-
const options = {
|
|
9
|
-
body: data.message || '',
|
|
10
|
-
icon: data.photo || '/logo.png',
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
event.waitUntil(self.registration.showNotification(title, options));
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
self.addEventListener('notificationclick', (event) => {
|
|
17
|
-
event.notification.close();
|
|
18
|
-
event.waitUntil(
|
|
19
|
-
clients.matchAll({ type: 'window', includeUncontrolled: true }).then((clientList) => {
|
|
20
|
-
const matchedClient = clientList.find((client) =>
|
|
21
|
-
client.url.startsWith(self.location.origin) && 'focus' in client
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
if (matchedClient) {
|
|
25
|
-
matchedClient.focus();
|
|
26
|
-
} else {
|
|
27
|
-
clients.openWindow('/').then((chatWidget) => {
|
|
28
|
-
const payload = {
|
|
29
|
-
badge: event.notification.badge || '',
|
|
30
|
-
body: event.notification.body || '',
|
|
31
|
-
data: event.notification.data || null,
|
|
32
|
-
dir: event.notification.dir || '',
|
|
33
|
-
lang: event.notification.lang || '',
|
|
34
|
-
title: event.notification.title || '',
|
|
35
|
-
icon: event.notification.icon || '',
|
|
36
|
-
timestamp: event.notification.timestamp || Date.now(),
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
chatWidget?.postMessage({ action: 'connectycube-chat-widget-sw/initialNotification', payload });
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
})
|
|
43
|
-
);
|
|
44
|
-
});
|
package/dist/react19/logo.png
DELETED
|
Binary file
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Config } from 'connectycube/types';
|
|
2
|
-
import { AppPresets } from './hooks/useAppPresets';
|
|
3
|
-
export type AppProps = AppPresets & {
|
|
4
|
-
appId: Config.Credentials['appId'];
|
|
5
|
-
authKey: Config.Credentials['authKey'];
|
|
6
|
-
config?: Config.Options;
|
|
7
|
-
userId?: string;
|
|
8
|
-
userName?: string;
|
|
9
|
-
userAvatar?: string;
|
|
10
|
-
userProfileLink?: string;
|
|
11
|
-
translation?: 'en' | 'el' | 'ua';
|
|
12
|
-
disableClickOutside?: boolean;
|
|
13
|
-
disableEscKeyPress?: boolean;
|
|
14
|
-
hideWidgetButton?: boolean;
|
|
15
|
-
buttonTitle?: string;
|
|
16
|
-
portalStyle?: React.CSSProperties;
|
|
17
|
-
overlayStyle?: React.CSSProperties;
|
|
18
|
-
buttonStyle?: React.CSSProperties;
|
|
19
|
-
badgeStyle?: React.CSSProperties;
|
|
20
|
-
onlineBadgeStyle?: React.CSSProperties;
|
|
21
|
-
};
|
|
22
|
-
declare const App: React.FC<AppProps>;
|
|
23
|
-
export default App;
|