@realtimexsco/live-chat 1.4.12 → 1.4.14
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/README.md +9 -1
- package/dist/index.cjs +66 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.mjs +67 -19
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +7 -7
- package/package.json +1 -9
package/dist/index.d.mts
CHANGED
|
@@ -454,6 +454,8 @@ interface AppStoreState extends SocketState, AuthState {
|
|
|
454
454
|
}
|
|
455
455
|
|
|
456
456
|
interface EffectiveCallsSettings {
|
|
457
|
+
/** Platform / plan allows calls at all. Checked first. */
|
|
458
|
+
allowedByPlatform: boolean;
|
|
457
459
|
enabled: boolean;
|
|
458
460
|
configured: boolean;
|
|
459
461
|
}
|
|
@@ -489,6 +491,7 @@ interface EffectiveSettings {
|
|
|
489
491
|
}
|
|
490
492
|
declare const DEFAULT_EFFECTIVE_SETTINGS: EffectiveSettings;
|
|
491
493
|
declare const ADMIN_PERMISSION_DENIED_MESSAGE = "This feature is disabled by your administrator.";
|
|
494
|
+
declare const CALLS_NOT_ALLOWED_BY_PLATFORM_MESSAGE = "Calls are not allowed on this platform. Please contact your administrator.";
|
|
492
495
|
declare const CALLS_NOT_CONFIGURED_MESSAGE = "Calls are not configured. Please contact your administrator.";
|
|
493
496
|
|
|
494
497
|
declare const fetchEffectiveSettings: () => Promise<EffectiveSettings>;
|
|
@@ -1848,4 +1851,4 @@ declare function ChatEffectiveSettingsProvider({ children, enabled, }: {
|
|
|
1848
1851
|
declare function useEffectiveSettings(): ChatEffectiveSettingsContextValue;
|
|
1849
1852
|
declare function useEffectiveSettingsOptional(): ChatEffectiveSettingsContextValue;
|
|
1850
1853
|
|
|
1851
|
-
export { ADMIN_PERMISSION_DENIED_MESSAGE, type ActiveChannelMessagesSlotProps, type AdminsDrawerSlotProps, type AttachmentsDrawerSlotProps, type AvatarSlotProps, CALLS_NOT_CONFIGURED_MESSAGE, CHAT_API_KEYS, CHAT_GET_API_KEYS, Calendar, CalendarDayButton, Channel, type ChannelDetailsDrawerSlotProps, ChannelHeaderView as ChannelHeader, type ChannelHeaderSlotProps, ChannelListView as ChannelList, ChannelListItem, type ChannelListItemSlotProps, type ChannelListSlotProps, type ChannelMessageBoxSlotProps, Chat, type ChatActionModalSlotProps, ChatAlertsProvider, type ChatApiKey, type ChatApiVersionConfig, type ChatApiVersionKey, ChatAvatar, type ChatCallContext, type ChatClassNames, type ChatColorMode, type ChatComponents, type ChatCustomizationConfig, ChatCustomizationProvider, ChatDateJumpMenu, type ChatDateTimePreferences, ChatEffectiveSettingsProvider, type ChatFeatures, type ChatGetApiKey, ChatLayout, type ChatLayoutConfig, type ChatLayoutSlotProps, ChatLocaleProvider, ChatMain, type ChatPanelAlertsSlotProps, type ChatQueryParams, type ChatQueryParamsByApi, ChatThemeProvider, ChatViewport, type ChatViewportHeight, DEFAULT_EFFECTIVE_SETTINGS, DefaultChannelListItem, DefaultChatAvatar, DefaultChatLayout, type EffectiveAttachmentsSettings, type EffectiveCallsSettings, type EffectiveGroupPolicy, type EffectiveMessageTimers, type EffectiveSettings, ForegroundPushBridge, type ForegroundPushBridgeProps, type ForegroundPushPayload, ForwardModalView as ForwardModal, type ForwardModalSlotProps, HeaderCallActions, type HeaderCallActionsSlotProps, type HeaderLeftSideSlotProps, type HeaderRightSideSlotProps, type HeaderSearchOverlaySlotProps, type IAttachment, type IChannel, type IDMDelete, type IDMEditMessage, type IDMForward, type IDMMessage, type IDMPin, type IDMReaction, type IDMRead, type IDMStar, type IDMTyping, type IDMUnstar, type IMessage, type ISocketConfig, type JumpToPreset, LoggedUserDetails, type LoggedUserDetailsSlotProps, LoggedUserSettingsContent, type LoggedUserSettingsContentSlotProps, LoggedUserSettingsDialog, type LoggedUserSettingsDialogSlotProps, LoggedUserSettingsTrigger, type LoggedUserSettingsTriggerSlotProps, type MembersDrawerSlotProps, type MessageAttachmentsSlotProps, ChannelMessageBoxView as MessageInput, MessageItemView as MessageItem, type MessageItemSlotProps, ActiveChannelMessagesView as MessageList, type MessageReactionsSlotProps, type MessageReplySnippetSlotProps, type MessageStatusSlotProps, type MessageToolbarSlotProps, NOTIFICATION_CLICK_SW_TYPE, type NotificationClickBridgeOptions, OPEN_CONVERSATION_EVENT, PUSH_BROADCAST_CHANNEL, PUSH_CHANGED_EVENT, PUSH_DATA_CACHE_NAME, type PendingJump, type PermissionDrawerSlotProps, type PhoneCallButtonSlotProps, type PinnedMessagesDrawerSlotProps, type PushConfig, PushNotificationToggle, type PushNotificationToggleProps, type PushNotificationToggleRenderProps, type PushNotificationsState, type PushOpenRequest, type PushPreference, type StarredMessagesDrawerSlotProps, type UIConfig, type UsePushNotifications, type VideoCallButtonSlotProps, apiGetPushConfig, apiGetPushPreference, apiRegisterPushToken, apiRemovePushToken, apiUpdatePushPreference, buildChannelFromPushRequest, buildLoggedUserProfile, buildVersionedApiUrl, capitalizeFirst, clampJumpDate, consumePendingOpenConversation, consumePendingOpenFromPushCache, consumePendingOpenRequest, ChatMain as default, defaultChatClassNames, defaultChatComponents, defaultChatFeatures, defaultChatLayoutConfig, disablePushOnThisDevice, downloadFile, enablePushOnThisDevice, fetchEffectiveSettings, getChatApiVersions, getChatBaseUrl, getChatQueryParamApis, getChatQueryParams, getChatQueryParamsByApi, getChatSocketUrl, getFirstAndLastNameOneCharacter, getResponsiveWidth, getSocketConfig, getStoredPushToken, installNotificationClickBridge, isEmpty, isPushSupported, mergeChatCustomization, mergeChatLayoutConfig, onForegroundPush, packageDefaultComponents, peekPendingOpenConversation, peekPendingOpenRequest, requestOpenConversation, resolveApiRoot, resolveApiUrl, resolveChatApiKey, resolveConversationIdFromPushData, resolveJumpDateBounds, resolveJumpPreset, resolveJumpStep, resolveSocketUrl, setChatAccessToken, setChatApiVersions, setChatBaseURL, setChatClientId, setChatPushApiVersion, setChatQueryParamApis, setChatQueryParams, setChatQueryParamsByApi, setChatSocketUrl, showNotification, smoothScrollToMessage, socketService, startOfLocalDay, toDateInputValue, uniqueList, useChatAlerts, useChatContext, useChatController, useChatCustomization, useChatCustomizationOptional, useChatFeatures, useChatFeaturesOptional, useChatLocale, useStore as useChatStore, useChatTheme, useEffectiveSettings, useEffectiveSettingsOptional, usePushNotifications };
|
|
1854
|
+
export { ADMIN_PERMISSION_DENIED_MESSAGE, type ActiveChannelMessagesSlotProps, type AdminsDrawerSlotProps, type AttachmentsDrawerSlotProps, type AvatarSlotProps, CALLS_NOT_ALLOWED_BY_PLATFORM_MESSAGE, CALLS_NOT_CONFIGURED_MESSAGE, CHAT_API_KEYS, CHAT_GET_API_KEYS, Calendar, CalendarDayButton, Channel, type ChannelDetailsDrawerSlotProps, ChannelHeaderView as ChannelHeader, type ChannelHeaderSlotProps, ChannelListView as ChannelList, ChannelListItem, type ChannelListItemSlotProps, type ChannelListSlotProps, type ChannelMessageBoxSlotProps, Chat, type ChatActionModalSlotProps, ChatAlertsProvider, type ChatApiKey, type ChatApiVersionConfig, type ChatApiVersionKey, ChatAvatar, type ChatCallContext, type ChatClassNames, type ChatColorMode, type ChatComponents, type ChatCustomizationConfig, ChatCustomizationProvider, ChatDateJumpMenu, type ChatDateTimePreferences, ChatEffectiveSettingsProvider, type ChatFeatures, type ChatGetApiKey, ChatLayout, type ChatLayoutConfig, type ChatLayoutSlotProps, ChatLocaleProvider, ChatMain, type ChatPanelAlertsSlotProps, type ChatQueryParams, type ChatQueryParamsByApi, ChatThemeProvider, ChatViewport, type ChatViewportHeight, DEFAULT_EFFECTIVE_SETTINGS, DefaultChannelListItem, DefaultChatAvatar, DefaultChatLayout, type EffectiveAttachmentsSettings, type EffectiveCallsSettings, type EffectiveGroupPolicy, type EffectiveMessageTimers, type EffectiveSettings, ForegroundPushBridge, type ForegroundPushBridgeProps, type ForegroundPushPayload, ForwardModalView as ForwardModal, type ForwardModalSlotProps, HeaderCallActions, type HeaderCallActionsSlotProps, type HeaderLeftSideSlotProps, type HeaderRightSideSlotProps, type HeaderSearchOverlaySlotProps, type IAttachment, type IChannel, type IDMDelete, type IDMEditMessage, type IDMForward, type IDMMessage, type IDMPin, type IDMReaction, type IDMRead, type IDMStar, type IDMTyping, type IDMUnstar, type IMessage, type ISocketConfig, type JumpToPreset, LoggedUserDetails, type LoggedUserDetailsSlotProps, LoggedUserSettingsContent, type LoggedUserSettingsContentSlotProps, LoggedUserSettingsDialog, type LoggedUserSettingsDialogSlotProps, LoggedUserSettingsTrigger, type LoggedUserSettingsTriggerSlotProps, type MembersDrawerSlotProps, type MessageAttachmentsSlotProps, ChannelMessageBoxView as MessageInput, MessageItemView as MessageItem, type MessageItemSlotProps, ActiveChannelMessagesView as MessageList, type MessageReactionsSlotProps, type MessageReplySnippetSlotProps, type MessageStatusSlotProps, type MessageToolbarSlotProps, NOTIFICATION_CLICK_SW_TYPE, type NotificationClickBridgeOptions, OPEN_CONVERSATION_EVENT, PUSH_BROADCAST_CHANNEL, PUSH_CHANGED_EVENT, PUSH_DATA_CACHE_NAME, type PendingJump, type PermissionDrawerSlotProps, type PhoneCallButtonSlotProps, type PinnedMessagesDrawerSlotProps, type PushConfig, PushNotificationToggle, type PushNotificationToggleProps, type PushNotificationToggleRenderProps, type PushNotificationsState, type PushOpenRequest, type PushPreference, type StarredMessagesDrawerSlotProps, type UIConfig, type UsePushNotifications, type VideoCallButtonSlotProps, apiGetPushConfig, apiGetPushPreference, apiRegisterPushToken, apiRemovePushToken, apiUpdatePushPreference, buildChannelFromPushRequest, buildLoggedUserProfile, buildVersionedApiUrl, capitalizeFirst, clampJumpDate, consumePendingOpenConversation, consumePendingOpenFromPushCache, consumePendingOpenRequest, ChatMain as default, defaultChatClassNames, defaultChatComponents, defaultChatFeatures, defaultChatLayoutConfig, disablePushOnThisDevice, downloadFile, enablePushOnThisDevice, fetchEffectiveSettings, getChatApiVersions, getChatBaseUrl, getChatQueryParamApis, getChatQueryParams, getChatQueryParamsByApi, getChatSocketUrl, getFirstAndLastNameOneCharacter, getResponsiveWidth, getSocketConfig, getStoredPushToken, installNotificationClickBridge, isEmpty, isPushSupported, mergeChatCustomization, mergeChatLayoutConfig, onForegroundPush, packageDefaultComponents, peekPendingOpenConversation, peekPendingOpenRequest, requestOpenConversation, resolveApiRoot, resolveApiUrl, resolveChatApiKey, resolveConversationIdFromPushData, resolveJumpDateBounds, resolveJumpPreset, resolveJumpStep, resolveSocketUrl, setChatAccessToken, setChatApiVersions, setChatBaseURL, setChatClientId, setChatPushApiVersion, setChatQueryParamApis, setChatQueryParams, setChatQueryParamsByApi, setChatSocketUrl, showNotification, smoothScrollToMessage, socketService, startOfLocalDay, toDateInputValue, uniqueList, useChatAlerts, useChatContext, useChatController, useChatCustomization, useChatCustomizationOptional, useChatFeatures, useChatFeaturesOptional, useChatLocale, useStore as useChatStore, useChatTheme, useEffectiveSettings, useEffectiveSettingsOptional, usePushNotifications };
|
package/dist/index.d.ts
CHANGED
|
@@ -454,6 +454,8 @@ interface AppStoreState extends SocketState, AuthState {
|
|
|
454
454
|
}
|
|
455
455
|
|
|
456
456
|
interface EffectiveCallsSettings {
|
|
457
|
+
/** Platform / plan allows calls at all. Checked first. */
|
|
458
|
+
allowedByPlatform: boolean;
|
|
457
459
|
enabled: boolean;
|
|
458
460
|
configured: boolean;
|
|
459
461
|
}
|
|
@@ -489,6 +491,7 @@ interface EffectiveSettings {
|
|
|
489
491
|
}
|
|
490
492
|
declare const DEFAULT_EFFECTIVE_SETTINGS: EffectiveSettings;
|
|
491
493
|
declare const ADMIN_PERMISSION_DENIED_MESSAGE = "This feature is disabled by your administrator.";
|
|
494
|
+
declare const CALLS_NOT_ALLOWED_BY_PLATFORM_MESSAGE = "Calls are not allowed on this platform. Please contact your administrator.";
|
|
492
495
|
declare const CALLS_NOT_CONFIGURED_MESSAGE = "Calls are not configured. Please contact your administrator.";
|
|
493
496
|
|
|
494
497
|
declare const fetchEffectiveSettings: () => Promise<EffectiveSettings>;
|
|
@@ -1848,4 +1851,4 @@ declare function ChatEffectiveSettingsProvider({ children, enabled, }: {
|
|
|
1848
1851
|
declare function useEffectiveSettings(): ChatEffectiveSettingsContextValue;
|
|
1849
1852
|
declare function useEffectiveSettingsOptional(): ChatEffectiveSettingsContextValue;
|
|
1850
1853
|
|
|
1851
|
-
export { ADMIN_PERMISSION_DENIED_MESSAGE, type ActiveChannelMessagesSlotProps, type AdminsDrawerSlotProps, type AttachmentsDrawerSlotProps, type AvatarSlotProps, CALLS_NOT_CONFIGURED_MESSAGE, CHAT_API_KEYS, CHAT_GET_API_KEYS, Calendar, CalendarDayButton, Channel, type ChannelDetailsDrawerSlotProps, ChannelHeaderView as ChannelHeader, type ChannelHeaderSlotProps, ChannelListView as ChannelList, ChannelListItem, type ChannelListItemSlotProps, type ChannelListSlotProps, type ChannelMessageBoxSlotProps, Chat, type ChatActionModalSlotProps, ChatAlertsProvider, type ChatApiKey, type ChatApiVersionConfig, type ChatApiVersionKey, ChatAvatar, type ChatCallContext, type ChatClassNames, type ChatColorMode, type ChatComponents, type ChatCustomizationConfig, ChatCustomizationProvider, ChatDateJumpMenu, type ChatDateTimePreferences, ChatEffectiveSettingsProvider, type ChatFeatures, type ChatGetApiKey, ChatLayout, type ChatLayoutConfig, type ChatLayoutSlotProps, ChatLocaleProvider, ChatMain, type ChatPanelAlertsSlotProps, type ChatQueryParams, type ChatQueryParamsByApi, ChatThemeProvider, ChatViewport, type ChatViewportHeight, DEFAULT_EFFECTIVE_SETTINGS, DefaultChannelListItem, DefaultChatAvatar, DefaultChatLayout, type EffectiveAttachmentsSettings, type EffectiveCallsSettings, type EffectiveGroupPolicy, type EffectiveMessageTimers, type EffectiveSettings, ForegroundPushBridge, type ForegroundPushBridgeProps, type ForegroundPushPayload, ForwardModalView as ForwardModal, type ForwardModalSlotProps, HeaderCallActions, type HeaderCallActionsSlotProps, type HeaderLeftSideSlotProps, type HeaderRightSideSlotProps, type HeaderSearchOverlaySlotProps, type IAttachment, type IChannel, type IDMDelete, type IDMEditMessage, type IDMForward, type IDMMessage, type IDMPin, type IDMReaction, type IDMRead, type IDMStar, type IDMTyping, type IDMUnstar, type IMessage, type ISocketConfig, type JumpToPreset, LoggedUserDetails, type LoggedUserDetailsSlotProps, LoggedUserSettingsContent, type LoggedUserSettingsContentSlotProps, LoggedUserSettingsDialog, type LoggedUserSettingsDialogSlotProps, LoggedUserSettingsTrigger, type LoggedUserSettingsTriggerSlotProps, type MembersDrawerSlotProps, type MessageAttachmentsSlotProps, ChannelMessageBoxView as MessageInput, MessageItemView as MessageItem, type MessageItemSlotProps, ActiveChannelMessagesView as MessageList, type MessageReactionsSlotProps, type MessageReplySnippetSlotProps, type MessageStatusSlotProps, type MessageToolbarSlotProps, NOTIFICATION_CLICK_SW_TYPE, type NotificationClickBridgeOptions, OPEN_CONVERSATION_EVENT, PUSH_BROADCAST_CHANNEL, PUSH_CHANGED_EVENT, PUSH_DATA_CACHE_NAME, type PendingJump, type PermissionDrawerSlotProps, type PhoneCallButtonSlotProps, type PinnedMessagesDrawerSlotProps, type PushConfig, PushNotificationToggle, type PushNotificationToggleProps, type PushNotificationToggleRenderProps, type PushNotificationsState, type PushOpenRequest, type PushPreference, type StarredMessagesDrawerSlotProps, type UIConfig, type UsePushNotifications, type VideoCallButtonSlotProps, apiGetPushConfig, apiGetPushPreference, apiRegisterPushToken, apiRemovePushToken, apiUpdatePushPreference, buildChannelFromPushRequest, buildLoggedUserProfile, buildVersionedApiUrl, capitalizeFirst, clampJumpDate, consumePendingOpenConversation, consumePendingOpenFromPushCache, consumePendingOpenRequest, ChatMain as default, defaultChatClassNames, defaultChatComponents, defaultChatFeatures, defaultChatLayoutConfig, disablePushOnThisDevice, downloadFile, enablePushOnThisDevice, fetchEffectiveSettings, getChatApiVersions, getChatBaseUrl, getChatQueryParamApis, getChatQueryParams, getChatQueryParamsByApi, getChatSocketUrl, getFirstAndLastNameOneCharacter, getResponsiveWidth, getSocketConfig, getStoredPushToken, installNotificationClickBridge, isEmpty, isPushSupported, mergeChatCustomization, mergeChatLayoutConfig, onForegroundPush, packageDefaultComponents, peekPendingOpenConversation, peekPendingOpenRequest, requestOpenConversation, resolveApiRoot, resolveApiUrl, resolveChatApiKey, resolveConversationIdFromPushData, resolveJumpDateBounds, resolveJumpPreset, resolveJumpStep, resolveSocketUrl, setChatAccessToken, setChatApiVersions, setChatBaseURL, setChatClientId, setChatPushApiVersion, setChatQueryParamApis, setChatQueryParams, setChatQueryParamsByApi, setChatSocketUrl, showNotification, smoothScrollToMessage, socketService, startOfLocalDay, toDateInputValue, uniqueList, useChatAlerts, useChatContext, useChatController, useChatCustomization, useChatCustomizationOptional, useChatFeatures, useChatFeaturesOptional, useChatLocale, useStore as useChatStore, useChatTheme, useEffectiveSettings, useEffectiveSettingsOptional, usePushNotifications };
|
|
1854
|
+
export { ADMIN_PERMISSION_DENIED_MESSAGE, type ActiveChannelMessagesSlotProps, type AdminsDrawerSlotProps, type AttachmentsDrawerSlotProps, type AvatarSlotProps, CALLS_NOT_ALLOWED_BY_PLATFORM_MESSAGE, CALLS_NOT_CONFIGURED_MESSAGE, CHAT_API_KEYS, CHAT_GET_API_KEYS, Calendar, CalendarDayButton, Channel, type ChannelDetailsDrawerSlotProps, ChannelHeaderView as ChannelHeader, type ChannelHeaderSlotProps, ChannelListView as ChannelList, ChannelListItem, type ChannelListItemSlotProps, type ChannelListSlotProps, type ChannelMessageBoxSlotProps, Chat, type ChatActionModalSlotProps, ChatAlertsProvider, type ChatApiKey, type ChatApiVersionConfig, type ChatApiVersionKey, ChatAvatar, type ChatCallContext, type ChatClassNames, type ChatColorMode, type ChatComponents, type ChatCustomizationConfig, ChatCustomizationProvider, ChatDateJumpMenu, type ChatDateTimePreferences, ChatEffectiveSettingsProvider, type ChatFeatures, type ChatGetApiKey, ChatLayout, type ChatLayoutConfig, type ChatLayoutSlotProps, ChatLocaleProvider, ChatMain, type ChatPanelAlertsSlotProps, type ChatQueryParams, type ChatQueryParamsByApi, ChatThemeProvider, ChatViewport, type ChatViewportHeight, DEFAULT_EFFECTIVE_SETTINGS, DefaultChannelListItem, DefaultChatAvatar, DefaultChatLayout, type EffectiveAttachmentsSettings, type EffectiveCallsSettings, type EffectiveGroupPolicy, type EffectiveMessageTimers, type EffectiveSettings, ForegroundPushBridge, type ForegroundPushBridgeProps, type ForegroundPushPayload, ForwardModalView as ForwardModal, type ForwardModalSlotProps, HeaderCallActions, type HeaderCallActionsSlotProps, type HeaderLeftSideSlotProps, type HeaderRightSideSlotProps, type HeaderSearchOverlaySlotProps, type IAttachment, type IChannel, type IDMDelete, type IDMEditMessage, type IDMForward, type IDMMessage, type IDMPin, type IDMReaction, type IDMRead, type IDMStar, type IDMTyping, type IDMUnstar, type IMessage, type ISocketConfig, type JumpToPreset, LoggedUserDetails, type LoggedUserDetailsSlotProps, LoggedUserSettingsContent, type LoggedUserSettingsContentSlotProps, LoggedUserSettingsDialog, type LoggedUserSettingsDialogSlotProps, LoggedUserSettingsTrigger, type LoggedUserSettingsTriggerSlotProps, type MembersDrawerSlotProps, type MessageAttachmentsSlotProps, ChannelMessageBoxView as MessageInput, MessageItemView as MessageItem, type MessageItemSlotProps, ActiveChannelMessagesView as MessageList, type MessageReactionsSlotProps, type MessageReplySnippetSlotProps, type MessageStatusSlotProps, type MessageToolbarSlotProps, NOTIFICATION_CLICK_SW_TYPE, type NotificationClickBridgeOptions, OPEN_CONVERSATION_EVENT, PUSH_BROADCAST_CHANNEL, PUSH_CHANGED_EVENT, PUSH_DATA_CACHE_NAME, type PendingJump, type PermissionDrawerSlotProps, type PhoneCallButtonSlotProps, type PinnedMessagesDrawerSlotProps, type PushConfig, PushNotificationToggle, type PushNotificationToggleProps, type PushNotificationToggleRenderProps, type PushNotificationsState, type PushOpenRequest, type PushPreference, type StarredMessagesDrawerSlotProps, type UIConfig, type UsePushNotifications, type VideoCallButtonSlotProps, apiGetPushConfig, apiGetPushPreference, apiRegisterPushToken, apiRemovePushToken, apiUpdatePushPreference, buildChannelFromPushRequest, buildLoggedUserProfile, buildVersionedApiUrl, capitalizeFirst, clampJumpDate, consumePendingOpenConversation, consumePendingOpenFromPushCache, consumePendingOpenRequest, ChatMain as default, defaultChatClassNames, defaultChatComponents, defaultChatFeatures, defaultChatLayoutConfig, disablePushOnThisDevice, downloadFile, enablePushOnThisDevice, fetchEffectiveSettings, getChatApiVersions, getChatBaseUrl, getChatQueryParamApis, getChatQueryParams, getChatQueryParamsByApi, getChatSocketUrl, getFirstAndLastNameOneCharacter, getResponsiveWidth, getSocketConfig, getStoredPushToken, installNotificationClickBridge, isEmpty, isPushSupported, mergeChatCustomization, mergeChatLayoutConfig, onForegroundPush, packageDefaultComponents, peekPendingOpenConversation, peekPendingOpenRequest, requestOpenConversation, resolveApiRoot, resolveApiUrl, resolveChatApiKey, resolveConversationIdFromPushData, resolveJumpDateBounds, resolveJumpPreset, resolveJumpStep, resolveSocketUrl, setChatAccessToken, setChatApiVersions, setChatBaseURL, setChatClientId, setChatPushApiVersion, setChatQueryParamApis, setChatQueryParams, setChatQueryParamsByApi, setChatSocketUrl, showNotification, smoothScrollToMessage, socketService, startOfLocalDay, toDateInputValue, uniqueList, useChatAlerts, useChatContext, useChatController, useChatCustomization, useChatCustomizationOptional, useChatFeatures, useChatFeaturesOptional, useChatLocale, useStore as useChatStore, useChatTheme, useEffectiveSettings, useEffectiveSettingsOptional, usePushNotifications };
|
package/dist/index.mjs
CHANGED
|
@@ -1054,16 +1054,27 @@ var init_connection_actions = __esm({
|
|
|
1054
1054
|
setActiveConversationId: (conversationId) => {
|
|
1055
1055
|
set((state) => {
|
|
1056
1056
|
const nextId = conversationId ?? null;
|
|
1057
|
-
|
|
1057
|
+
const prevId = state.activeConversationId ?? null;
|
|
1058
|
+
if (String(prevId ?? "") === String(nextId ?? "")) {
|
|
1058
1059
|
return state;
|
|
1059
1060
|
}
|
|
1061
|
+
const nextErrors = { ...state.conversationErrors };
|
|
1062
|
+
if (prevId) {
|
|
1063
|
+
delete nextErrors[String(prevId)];
|
|
1064
|
+
}
|
|
1060
1065
|
if (!nextId) {
|
|
1061
|
-
return {
|
|
1066
|
+
return {
|
|
1067
|
+
activeConversationId: null,
|
|
1068
|
+
globalAppError: null,
|
|
1069
|
+
conversationErrors: nextErrors
|
|
1070
|
+
};
|
|
1062
1071
|
}
|
|
1063
1072
|
const target = state.conversations.find((c) => String(c._id) === String(nextId));
|
|
1064
1073
|
const unreadAlreadyZero = !normalizeUnreadCount(target?.unreadCount, state.loggedUserDetails?._id);
|
|
1065
1074
|
return {
|
|
1066
1075
|
activeConversationId: nextId,
|
|
1076
|
+
globalAppError: null,
|
|
1077
|
+
conversationErrors: nextErrors,
|
|
1067
1078
|
conversations: unreadAlreadyZero ? state.conversations : state.conversations.map(
|
|
1068
1079
|
(c) => String(c._id) === String(nextId) ? { ...c, unreadCount: 0 } : c
|
|
1069
1080
|
)
|
|
@@ -1104,25 +1115,32 @@ var init_connection_actions = __esm({
|
|
|
1104
1115
|
type = "rate_limit";
|
|
1105
1116
|
return;
|
|
1106
1117
|
}
|
|
1118
|
+
if (conversationId) {
|
|
1119
|
+
set((state) => ({
|
|
1120
|
+
conversationErrors: {
|
|
1121
|
+
...state.conversationErrors,
|
|
1122
|
+
[conversationId]: { message, type }
|
|
1123
|
+
},
|
|
1124
|
+
globalAppError: null
|
|
1125
|
+
}));
|
|
1126
|
+
return;
|
|
1127
|
+
}
|
|
1107
1128
|
set({ globalAppError: { message, type } });
|
|
1108
1129
|
},
|
|
1109
1130
|
clearAppError: (conversationId) => {
|
|
1110
1131
|
set((state) => {
|
|
1111
|
-
|
|
1112
|
-
if (targetId) {
|
|
1132
|
+
if (conversationId) {
|
|
1113
1133
|
const nextErrors = { ...state.conversationErrors };
|
|
1114
1134
|
const nextComposer = { ...state.composerDisabledByConversation };
|
|
1115
|
-
delete nextErrors[
|
|
1116
|
-
delete nextComposer[
|
|
1135
|
+
delete nextErrors[conversationId];
|
|
1136
|
+
delete nextComposer[conversationId];
|
|
1117
1137
|
return {
|
|
1118
1138
|
conversationErrors: nextErrors,
|
|
1119
1139
|
composerDisabledByConversation: nextComposer
|
|
1120
1140
|
};
|
|
1121
1141
|
}
|
|
1122
1142
|
return {
|
|
1123
|
-
globalAppError: null
|
|
1124
|
-
conversationErrors: {},
|
|
1125
|
-
composerDisabledByConversation: {}
|
|
1143
|
+
globalAppError: null
|
|
1126
1144
|
};
|
|
1127
1145
|
});
|
|
1128
1146
|
},
|
|
@@ -1670,7 +1688,7 @@ var init_uploads_api = __esm({
|
|
|
1670
1688
|
});
|
|
1671
1689
|
|
|
1672
1690
|
// src/types/settings.types.ts
|
|
1673
|
-
var DEFAULT_EFFECTIVE_SETTINGS, ADMIN_PERMISSION_DENIED_MESSAGE, CALLS_NOT_CONFIGURED_MESSAGE;
|
|
1691
|
+
var DEFAULT_EFFECTIVE_SETTINGS, ADMIN_PERMISSION_DENIED_MESSAGE, CALLS_NOT_ALLOWED_BY_PLATFORM_MESSAGE, CALLS_NOT_CONFIGURED_MESSAGE;
|
|
1674
1692
|
var init_settings_types = __esm({
|
|
1675
1693
|
"src/types/settings.types.ts"() {
|
|
1676
1694
|
DEFAULT_EFFECTIVE_SETTINGS = {
|
|
@@ -1679,6 +1697,7 @@ var init_settings_types = __esm({
|
|
|
1679
1697
|
audioCallEnabled: true,
|
|
1680
1698
|
blockUsersEnabled: true,
|
|
1681
1699
|
calls: {
|
|
1700
|
+
allowedByPlatform: true,
|
|
1682
1701
|
enabled: true,
|
|
1683
1702
|
configured: true
|
|
1684
1703
|
},
|
|
@@ -1711,6 +1730,7 @@ var init_settings_types = __esm({
|
|
|
1711
1730
|
groupCreationEnabled: true
|
|
1712
1731
|
};
|
|
1713
1732
|
ADMIN_PERMISSION_DENIED_MESSAGE = "This feature is disabled by your administrator.";
|
|
1733
|
+
CALLS_NOT_ALLOWED_BY_PLATFORM_MESSAGE = "Calls are not allowed on this platform. Please contact your administrator.";
|
|
1714
1734
|
CALLS_NOT_CONFIGURED_MESSAGE = "Calls are not configured. Please contact your administrator.";
|
|
1715
1735
|
}
|
|
1716
1736
|
});
|
|
@@ -1758,6 +1778,10 @@ function normalizeCalls(value, fallback) {
|
|
|
1758
1778
|
if (!value || typeof value !== "object") return { ...fallback };
|
|
1759
1779
|
const raw = value;
|
|
1760
1780
|
return {
|
|
1781
|
+
allowedByPlatform: asBoolean(
|
|
1782
|
+
raw.allowedByPlatform,
|
|
1783
|
+
fallback.allowedByPlatform
|
|
1784
|
+
),
|
|
1761
1785
|
enabled: asBoolean(raw.enabled, fallback.enabled),
|
|
1762
1786
|
configured: asBoolean(raw.configured, fallback.configured)
|
|
1763
1787
|
};
|
|
@@ -4715,6 +4739,13 @@ init_settings_api();
|
|
|
4715
4739
|
init_settings_types();
|
|
4716
4740
|
var ChatEffectiveSettingsContext = createContext(null);
|
|
4717
4741
|
function buildCallGate(settings, featureEnabled) {
|
|
4742
|
+
if (!settings.calls.allowedByPlatform) {
|
|
4743
|
+
return {
|
|
4744
|
+
visible: true,
|
|
4745
|
+
enabled: false,
|
|
4746
|
+
disabledReason: CALLS_NOT_ALLOWED_BY_PLATFORM_MESSAGE
|
|
4747
|
+
};
|
|
4748
|
+
}
|
|
4718
4749
|
if (!settings.calls.configured) {
|
|
4719
4750
|
return {
|
|
4720
4751
|
visible: true,
|
|
@@ -7330,7 +7361,8 @@ var PushNotificationToggle = ({
|
|
|
7330
7361
|
checked: adminBlocked || notConfigured ? false : isOn,
|
|
7331
7362
|
disabled: isDisabled,
|
|
7332
7363
|
onCheckedChange: (checked) => void handleChange(checked),
|
|
7333
|
-
"aria-label": `Toggle ${label}
|
|
7364
|
+
"aria-label": `Toggle ${label}`,
|
|
7365
|
+
className: "data-[state=checked]:bg-(--chat-theme) data-[state=unchecked]:bg-(--chat-border)"
|
|
7334
7366
|
}
|
|
7335
7367
|
)
|
|
7336
7368
|
}
|
|
@@ -8933,7 +8965,7 @@ var HeaderSearchPopover = ({
|
|
|
8933
8965
|
] });
|
|
8934
8966
|
};
|
|
8935
8967
|
var HeaderSearchPopover_default = HeaderSearchPopover;
|
|
8936
|
-
var actionBtnClass = "size-8 rounded-lg text-(--chat-muted) transition-colors hover:bg-(--chat-surface) hover:text-(--chat-text) disabled:
|
|
8968
|
+
var actionBtnClass = "size-8 rounded-lg text-(--chat-muted) transition-colors hover:bg-(--chat-surface) hover:text-(--chat-text) disabled:opacity-40";
|
|
8937
8969
|
var DefaultHeaderCallActions = ({
|
|
8938
8970
|
activeChannel,
|
|
8939
8971
|
conversationId,
|
|
@@ -14953,7 +14985,15 @@ function isWithinMessageEditWindow(createdAt, timers, isGroup) {
|
|
|
14953
14985
|
function isWithinMessageDeleteWindow(createdAt, timers, isGroup) {
|
|
14954
14986
|
return isWithinWindow(createdAt, getDeleteWindowMs(timers, isGroup));
|
|
14955
14987
|
}
|
|
14988
|
+
function allowsAllMimeTypes(allowedMimeTypes) {
|
|
14989
|
+
return allowedMimeTypes.some((pattern) => {
|
|
14990
|
+
const normalized = pattern.trim().toLowerCase();
|
|
14991
|
+
return normalized === "*" || normalized === "*/*";
|
|
14992
|
+
});
|
|
14993
|
+
}
|
|
14956
14994
|
function matchesAllowedMimeType(fileType, allowedMimeTypes) {
|
|
14995
|
+
if (!allowedMimeTypes.length) return false;
|
|
14996
|
+
if (allowsAllMimeTypes(allowedMimeTypes)) return true;
|
|
14957
14997
|
const mime = (fileType || "application/octet-stream").toLowerCase();
|
|
14958
14998
|
return allowedMimeTypes.some((pattern) => {
|
|
14959
14999
|
const normalized = pattern.trim().toLowerCase();
|
|
@@ -14966,6 +15006,7 @@ function matchesAllowedMimeType(fileType, allowedMimeTypes) {
|
|
|
14966
15006
|
});
|
|
14967
15007
|
}
|
|
14968
15008
|
function buildAcceptFromMimeTypes(allowedMimeTypes) {
|
|
15009
|
+
if (allowsAllMimeTypes(allowedMimeTypes)) return "";
|
|
14969
15010
|
return allowedMimeTypes.map((type) => type.trim()).filter(Boolean).join(",");
|
|
14970
15011
|
}
|
|
14971
15012
|
function formatFileSizeMB(sizeBytes) {
|
|
@@ -18580,6 +18621,7 @@ var ChatPanelAlerts = () => {
|
|
|
18580
18621
|
const globalAppError = useStore((s) => s.globalAppError);
|
|
18581
18622
|
const conversationErrors = useStore((s) => s.conversationErrors);
|
|
18582
18623
|
const clearAppError = useStore((s) => s.clearAppError);
|
|
18624
|
+
const setRateLimitResetAt = useStore((s) => s.setRateLimitResetAt);
|
|
18583
18625
|
const rateLimitResetAt2 = useStore((s) => s.rateLimitResetAt);
|
|
18584
18626
|
const [now, setNow] = useState(() => Date.now());
|
|
18585
18627
|
const conversationAppError = activeConversationId ? conversationErrors[activeConversationId] ?? null : null;
|
|
@@ -18616,7 +18658,7 @@ var ChatPanelAlerts = () => {
|
|
|
18616
18658
|
onDismiss: () => clearAppError(activeConversationId)
|
|
18617
18659
|
});
|
|
18618
18660
|
}
|
|
18619
|
-
if (globalAppError?.message) {
|
|
18661
|
+
if (!activeConversationId && globalAppError?.message) {
|
|
18620
18662
|
push({
|
|
18621
18663
|
id: `global-app-error-${globalAppError.type}`,
|
|
18622
18664
|
type: "error",
|
|
@@ -18631,7 +18673,8 @@ var ChatPanelAlerts = () => {
|
|
|
18631
18673
|
id: "rate-limit",
|
|
18632
18674
|
type: "warning",
|
|
18633
18675
|
message: `Too many requests. Please wait ${seconds}s before trying again.`,
|
|
18634
|
-
icon: AlertCircle
|
|
18676
|
+
icon: AlertCircle,
|
|
18677
|
+
onDismiss: () => setRateLimitResetAt(0)
|
|
18635
18678
|
});
|
|
18636
18679
|
}
|
|
18637
18680
|
if (info?.trim()) {
|
|
@@ -18654,7 +18697,8 @@ var ChatPanelAlerts = () => {
|
|
|
18654
18697
|
onDismissError,
|
|
18655
18698
|
onDismissInfo,
|
|
18656
18699
|
info,
|
|
18657
|
-
clearAppError
|
|
18700
|
+
clearAppError,
|
|
18701
|
+
setRateLimitResetAt
|
|
18658
18702
|
]);
|
|
18659
18703
|
if (alerts.length === 0) return null;
|
|
18660
18704
|
return /* @__PURE__ */ jsx("div", { className: "shrink-0 space-y-2 border-b border-(--chat-border) bg-(--chat-surface) px-4 py-2.5", children: alerts.map((alert) => {
|
|
@@ -18670,16 +18714,20 @@ var ChatPanelAlerts = () => {
|
|
|
18670
18714
|
children: [
|
|
18671
18715
|
/* @__PURE__ */ jsx(Icon, { className: "size-3.5 shrink-0", "aria-hidden": true }),
|
|
18672
18716
|
/* @__PURE__ */ jsx("p", { className: "min-w-0 flex-1 leading-relaxed", children: alert.message }),
|
|
18673
|
-
alert.onDismiss
|
|
18717
|
+
alert.onDismiss ? /* @__PURE__ */ jsx(
|
|
18674
18718
|
"button",
|
|
18675
18719
|
{
|
|
18676
18720
|
type: "button",
|
|
18677
|
-
onClick:
|
|
18721
|
+
onClick: (event) => {
|
|
18722
|
+
event.preventDefault();
|
|
18723
|
+
event.stopPropagation();
|
|
18724
|
+
alert.onDismiss?.();
|
|
18725
|
+
},
|
|
18678
18726
|
className: "shrink-0 rounded-md p-0.5 opacity-70 transition-opacity hover:opacity-100",
|
|
18679
18727
|
"aria-label": "Dismiss",
|
|
18680
18728
|
children: /* @__PURE__ */ jsx(X, { className: "size-3.5" })
|
|
18681
18729
|
}
|
|
18682
|
-
)
|
|
18730
|
+
) : null
|
|
18683
18731
|
]
|
|
18684
18732
|
},
|
|
18685
18733
|
alert.id
|
|
@@ -19583,6 +19631,6 @@ init_settings_types();
|
|
|
19583
19631
|
init_api_service();
|
|
19584
19632
|
var index_default = ChatMain_default;
|
|
19585
19633
|
|
|
19586
|
-
export { ADMIN_PERMISSION_DENIED_MESSAGE, CALLS_NOT_CONFIGURED_MESSAGE, CHAT_API_KEYS, CHAT_GET_API_KEYS, Calendar, CalendarDayButton, Channel, ChannelHeaderView_default as ChannelHeader, ChannelListView_default as ChannelList, ChannelListItem_default as ChannelListItem, Chat, ChatAlertsProvider, ChatAvatar_default as ChatAvatar, ChatCustomizationProvider, ChatDateJumpMenu, ChatEffectiveSettingsProvider, ChatLayout_default as ChatLayout, ChatLocaleProvider, ChatMain_default as ChatMain, ChatThemeProvider, ChatViewport, DEFAULT_EFFECTIVE_SETTINGS, DefaultChannelListItem, DefaultChatAvatar, DefaultChatLayout_default as DefaultChatLayout, ForegroundPushBridge, ForwardModalView as ForwardModal, HeaderCallActions_default as HeaderCallActions, LoggedUserDetails_default as LoggedUserDetails, LoggedUserSettingsContent_default as LoggedUserSettingsContent, LoggedUserSettingsDialog_default as LoggedUserSettingsDialog, LoggedUserSettingsTrigger_default as LoggedUserSettingsTrigger, ChannelMessageBoxView_default as MessageInput, MessageItemView as MessageItem, ActiveChannelMessagesView_default as MessageList, NOTIFICATION_CLICK_SW_TYPE, OPEN_CONVERSATION_EVENT, PUSH_BROADCAST_CHANNEL, PUSH_CHANGED_EVENT, PUSH_DATA_CACHE_NAME, PushNotificationToggle, apiGetPushConfig, apiGetPushPreference, apiRegisterPushToken, apiRemovePushToken, apiUpdatePushPreference, buildChannelFromPushRequest, buildLoggedUserProfile, buildVersionedApiUrl, capitalizeFirst, clampJumpDate, consumePendingOpenConversation, consumePendingOpenFromPushCache, consumePendingOpenRequest, index_default as default, defaultChatClassNames, defaultChatComponents, defaultChatFeatures, defaultChatLayoutConfig, disablePushOnThisDevice, downloadFile, enablePushOnThisDevice, fetchEffectiveSettings, getChatApiVersions, getChatBaseUrl, getChatQueryParamApis, getChatQueryParams, getChatQueryParamsByApi, getChatSocketUrl, getFirstAndLastNameOneCharacter, getResponsiveWidth, getSocketConfig, getStoredPushToken, installNotificationClickBridge, isEmpty, isPushSupported, mergeChatCustomization, mergeChatLayoutConfig, onForegroundPush, packageDefaultComponents, peekPendingOpenConversation, peekPendingOpenRequest, requestOpenConversation, resolveApiRoot, resolveApiUrl, resolveChatApiKey, resolveConversationIdFromPushData, resolveJumpDateBounds, resolveJumpPreset, resolveJumpStep, resolveSocketUrl, setChatAccessToken, setChatApiVersions, setChatBaseURL, setChatClientId, setChatPushApiVersion, setChatQueryParamApis, setChatQueryParams, setChatQueryParamsByApi, setChatSocketUrl, showNotification, smoothScrollToMessage, socket_service_default as socketService, startOfLocalDay, toDateInputValue, uniqueList, useChatAlerts, useChatContext, useChatController, useChatCustomization, useChatCustomizationOptional, useChatFeatures, useChatFeaturesOptional, useChatLocale, useStore as useChatStore, useChatTheme, useEffectiveSettings, useEffectiveSettingsOptional, usePushNotifications };
|
|
19634
|
+
export { ADMIN_PERMISSION_DENIED_MESSAGE, CALLS_NOT_ALLOWED_BY_PLATFORM_MESSAGE, CALLS_NOT_CONFIGURED_MESSAGE, CHAT_API_KEYS, CHAT_GET_API_KEYS, Calendar, CalendarDayButton, Channel, ChannelHeaderView_default as ChannelHeader, ChannelListView_default as ChannelList, ChannelListItem_default as ChannelListItem, Chat, ChatAlertsProvider, ChatAvatar_default as ChatAvatar, ChatCustomizationProvider, ChatDateJumpMenu, ChatEffectiveSettingsProvider, ChatLayout_default as ChatLayout, ChatLocaleProvider, ChatMain_default as ChatMain, ChatThemeProvider, ChatViewport, DEFAULT_EFFECTIVE_SETTINGS, DefaultChannelListItem, DefaultChatAvatar, DefaultChatLayout_default as DefaultChatLayout, ForegroundPushBridge, ForwardModalView as ForwardModal, HeaderCallActions_default as HeaderCallActions, LoggedUserDetails_default as LoggedUserDetails, LoggedUserSettingsContent_default as LoggedUserSettingsContent, LoggedUserSettingsDialog_default as LoggedUserSettingsDialog, LoggedUserSettingsTrigger_default as LoggedUserSettingsTrigger, ChannelMessageBoxView_default as MessageInput, MessageItemView as MessageItem, ActiveChannelMessagesView_default as MessageList, NOTIFICATION_CLICK_SW_TYPE, OPEN_CONVERSATION_EVENT, PUSH_BROADCAST_CHANNEL, PUSH_CHANGED_EVENT, PUSH_DATA_CACHE_NAME, PushNotificationToggle, apiGetPushConfig, apiGetPushPreference, apiRegisterPushToken, apiRemovePushToken, apiUpdatePushPreference, buildChannelFromPushRequest, buildLoggedUserProfile, buildVersionedApiUrl, capitalizeFirst, clampJumpDate, consumePendingOpenConversation, consumePendingOpenFromPushCache, consumePendingOpenRequest, index_default as default, defaultChatClassNames, defaultChatComponents, defaultChatFeatures, defaultChatLayoutConfig, disablePushOnThisDevice, downloadFile, enablePushOnThisDevice, fetchEffectiveSettings, getChatApiVersions, getChatBaseUrl, getChatQueryParamApis, getChatQueryParams, getChatQueryParamsByApi, getChatSocketUrl, getFirstAndLastNameOneCharacter, getResponsiveWidth, getSocketConfig, getStoredPushToken, installNotificationClickBridge, isEmpty, isPushSupported, mergeChatCustomization, mergeChatLayoutConfig, onForegroundPush, packageDefaultComponents, peekPendingOpenConversation, peekPendingOpenRequest, requestOpenConversation, resolveApiRoot, resolveApiUrl, resolveChatApiKey, resolveConversationIdFromPushData, resolveJumpDateBounds, resolveJumpPreset, resolveJumpStep, resolveSocketUrl, setChatAccessToken, setChatApiVersions, setChatBaseURL, setChatClientId, setChatPushApiVersion, setChatQueryParamApis, setChatQueryParams, setChatQueryParamsByApi, setChatSocketUrl, showNotification, smoothScrollToMessage, socket_service_default as socketService, startOfLocalDay, toDateInputValue, uniqueList, useChatAlerts, useChatContext, useChatController, useChatCustomization, useChatCustomizationOptional, useChatFeatures, useChatFeaturesOptional, useChatLocale, useStore as useChatStore, useChatTheme, useEffectiveSettings, useEffectiveSettingsOptional, usePushNotifications };
|
|
19587
19635
|
//# sourceMappingURL=index.mjs.map
|
|
19588
19636
|
//# sourceMappingURL=index.mjs.map
|