@sendbird/uikit-react-native 2.4.2 → 2.5.0-rc.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/lib/commonjs/components/ChannelMessageList/index.js +319 -0
- package/lib/commonjs/components/ChannelMessageList/index.js.map +1 -0
- package/lib/commonjs/components/ChatFlatList.js +30 -50
- package/lib/commonjs/components/ChatFlatList.js.map +1 -1
- package/lib/commonjs/components/MessageSearchResultItem.js +132 -0
- package/lib/commonjs/components/MessageSearchResultItem.js.map +1 -0
- package/lib/commonjs/components/ScrollToBottomButton.js +1 -1
- package/lib/commonjs/components/ScrollToBottomButton.js.map +1 -1
- package/lib/commonjs/constants.js +6 -2
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/containers/GroupChannelPreviewContainer.js +2 -2
- package/lib/commonjs/containers/GroupChannelPreviewContainer.js.map +1 -1
- package/lib/commonjs/containers/SendbirdUIKitContainer.js +4 -2
- package/lib/commonjs/containers/SendbirdUIKitContainer.js.map +1 -1
- package/lib/commonjs/contexts/SendbirdChatCtx.js +4 -2
- package/lib/commonjs/contexts/SendbirdChatCtx.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelHeader.js +4 -2
- package/lib/commonjs/domain/groupChannel/component/GroupChannelHeader.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js +84 -301
- package/lib/commonjs/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/component/GroupChannelSuggestedMentionList.js +2 -0
- package/lib/commonjs/domain/groupChannel/component/GroupChannelSuggestedMentionList.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/module/moduleContext.js +9 -2
- package/lib/commonjs/domain/groupChannel/module/moduleContext.js.map +1 -1
- package/lib/commonjs/domain/groupChannel/types.js.map +1 -1
- package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js +18 -4
- package/lib/commonjs/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js.map +1 -1
- package/lib/commonjs/domain/groupChannelSettings/types.js.map +1 -1
- package/lib/commonjs/domain/messageSearch/component/MessageSearchHeader.js +105 -0
- package/lib/commonjs/domain/messageSearch/component/MessageSearchHeader.js.map +1 -0
- package/lib/commonjs/domain/messageSearch/component/MessageSearchList.js +40 -0
- package/lib/commonjs/domain/messageSearch/component/MessageSearchList.js.map +1 -0
- package/lib/commonjs/domain/messageSearch/component/MessageSearchStatusEmpty.js +22 -0
- package/lib/commonjs/domain/messageSearch/component/MessageSearchStatusEmpty.js.map +1 -0
- package/lib/commonjs/domain/messageSearch/component/MessageSearchStatusError.js +26 -0
- package/lib/commonjs/domain/messageSearch/component/MessageSearchStatusError.js.map +1 -0
- package/lib/commonjs/domain/messageSearch/component/MessageSearchStatusLoading.js +22 -0
- package/lib/commonjs/domain/messageSearch/component/MessageSearchStatusLoading.js.map +1 -0
- package/lib/commonjs/domain/messageSearch/index.js +62 -0
- package/lib/commonjs/domain/messageSearch/index.js.map +1 -0
- package/lib/commonjs/domain/messageSearch/module/createMessageSearchModule.js +36 -0
- package/lib/commonjs/domain/messageSearch/module/createMessageSearchModule.js.map +1 -0
- package/lib/commonjs/domain/messageSearch/module/moduleContext.js +25 -0
- package/lib/commonjs/domain/messageSearch/module/moduleContext.js.map +1 -0
- package/lib/commonjs/domain/messageSearch/types.js +6 -0
- package/lib/commonjs/domain/messageSearch/types.js.map +1 -0
- package/lib/commonjs/domain/openChannel/component/OpenChannelMessageList.js +38 -279
- package/lib/commonjs/domain/openChannel/component/OpenChannelMessageList.js.map +1 -1
- package/lib/commonjs/domain/openChannel/module/moduleContext.js +9 -2
- package/lib/commonjs/domain/openChannel/module/moduleContext.js.map +1 -1
- package/lib/commonjs/domain/openChannel/types.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelFragment.js +107 -15
- package/lib/commonjs/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/commonjs/fragments/createGroupChannelSettingsFragment.js +2 -0
- package/lib/commonjs/fragments/createGroupChannelSettingsFragment.js.map +1 -1
- package/lib/commonjs/fragments/createMessageSearchFragment.js +145 -0
- package/lib/commonjs/fragments/createMessageSearchFragment.js.map +1 -0
- package/lib/commonjs/fragments/createOpenChannelFragment.js +40 -8
- package/lib/commonjs/fragments/createOpenChannelFragment.js.map +1 -1
- package/lib/commonjs/hooks/useMentionSuggestion.js +17 -0
- package/lib/commonjs/hooks/useMentionSuggestion.js.map +1 -1
- package/lib/commonjs/index.js +60 -40
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/localization/StringSet.type.js.map +1 -1
- package/lib/commonjs/localization/createBaseStringSet.js +33 -20
- package/lib/commonjs/localization/createBaseStringSet.js.map +1 -1
- package/lib/commonjs/utils/pubsub.js +21 -0
- package/lib/commonjs/utils/pubsub.js.map +1 -0
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/components/ChannelMessageList/index.js +311 -0
- package/lib/module/components/ChannelMessageList/index.js.map +1 -0
- package/lib/module/components/ChatFlatList.js +32 -52
- package/lib/module/components/ChatFlatList.js.map +1 -1
- package/lib/module/components/MessageSearchResultItem.js +124 -0
- package/lib/module/components/MessageSearchResultItem.js.map +1 -0
- package/lib/module/components/ScrollToBottomButton.js +1 -1
- package/lib/module/components/ScrollToBottomButton.js.map +1 -1
- package/lib/module/constants.js +3 -1
- package/lib/module/constants.js.map +1 -1
- package/lib/module/containers/GroupChannelPreviewContainer.js +2 -2
- package/lib/module/containers/GroupChannelPreviewContainer.js.map +1 -1
- package/lib/module/containers/SendbirdUIKitContainer.js +4 -2
- package/lib/module/containers/SendbirdUIKitContainer.js.map +1 -1
- package/lib/module/contexts/SendbirdChatCtx.js +4 -2
- package/lib/module/contexts/SendbirdChatCtx.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelHeader.js +4 -2
- package/lib/module/domain/groupChannel/component/GroupChannelHeader.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js +88 -305
- package/lib/module/domain/groupChannel/component/GroupChannelMessageList.js.map +1 -1
- package/lib/module/domain/groupChannel/component/GroupChannelSuggestedMentionList.js +2 -0
- package/lib/module/domain/groupChannel/component/GroupChannelSuggestedMentionList.js.map +1 -1
- package/lib/module/domain/groupChannel/module/moduleContext.js +9 -2
- package/lib/module/domain/groupChannel/module/moduleContext.js.map +1 -1
- package/lib/module/domain/groupChannel/types.js.map +1 -1
- package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js +18 -4
- package/lib/module/domain/groupChannelSettings/component/GroupChannelSettingsMenu.js.map +1 -1
- package/lib/module/domain/groupChannelSettings/types.js.map +1 -1
- package/lib/module/domain/messageSearch/component/MessageSearchHeader.js +96 -0
- package/lib/module/domain/messageSearch/component/MessageSearchHeader.js.map +1 -0
- package/lib/module/domain/messageSearch/component/MessageSearchList.js +32 -0
- package/lib/module/domain/messageSearch/component/MessageSearchList.js.map +1 -0
- package/lib/module/domain/messageSearch/component/MessageSearchStatusEmpty.js +14 -0
- package/lib/module/domain/messageSearch/component/MessageSearchStatusEmpty.js.map +1 -0
- package/lib/module/domain/messageSearch/component/MessageSearchStatusError.js +18 -0
- package/lib/module/domain/messageSearch/component/MessageSearchStatusError.js.map +1 -0
- package/lib/module/domain/messageSearch/component/MessageSearchStatusLoading.js +14 -0
- package/lib/module/domain/messageSearch/component/MessageSearchStatusLoading.js.map +1 -0
- package/lib/module/domain/messageSearch/index.js +8 -0
- package/lib/module/domain/messageSearch/index.js.map +1 -0
- package/lib/module/domain/messageSearch/module/createMessageSearchModule.js +28 -0
- package/lib/module/domain/messageSearch/module/createMessageSearchModule.js.map +1 -0
- package/lib/module/domain/messageSearch/module/moduleContext.js +14 -0
- package/lib/module/domain/messageSearch/module/moduleContext.js.map +1 -0
- package/lib/module/domain/messageSearch/types.js +2 -0
- package/lib/module/domain/messageSearch/types.js.map +1 -0
- package/lib/module/domain/openChannel/component/OpenChannelMessageList.js +40 -281
- package/lib/module/domain/openChannel/component/OpenChannelMessageList.js.map +1 -1
- package/lib/module/domain/openChannel/module/moduleContext.js +9 -2
- package/lib/module/domain/openChannel/module/moduleContext.js.map +1 -1
- package/lib/module/domain/openChannel/types.js.map +1 -1
- package/lib/module/fragments/createGroupChannelFragment.js +109 -17
- package/lib/module/fragments/createGroupChannelFragment.js.map +1 -1
- package/lib/module/fragments/createGroupChannelSettingsFragment.js +2 -0
- package/lib/module/fragments/createGroupChannelSettingsFragment.js.map +1 -1
- package/lib/module/fragments/createMessageSearchFragment.js +135 -0
- package/lib/module/fragments/createMessageSearchFragment.js.map +1 -0
- package/lib/module/fragments/createOpenChannelFragment.js +41 -9
- package/lib/module/fragments/createOpenChannelFragment.js.map +1 -1
- package/lib/module/hooks/useMentionSuggestion.js +18 -1
- package/lib/module/hooks/useMentionSuggestion.js.map +1 -1
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/localization/StringSet.type.js.map +1 -1
- package/lib/module/localization/createBaseStringSet.js +34 -21
- package/lib/module/localization/createBaseStringSet.js.map +1 -1
- package/lib/module/utils/pubsub.js +14 -0
- package/lib/module/utils/pubsub.js.map +1 -0
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/src/components/ChannelMessageList/index.d.ts +55 -0
- package/lib/typescript/src/components/ChatFlatList.d.ts +7 -8
- package/lib/typescript/src/components/MessageRenderer/index.d.ts +4 -0
- package/lib/typescript/src/components/MessageSearchResultItem.d.ts +2 -0
- package/lib/typescript/src/components/OpenChannelMessageRenderer/index.d.ts +1 -0
- package/lib/typescript/src/components/ScrollToBottomButton.d.ts +1 -1
- package/lib/typescript/src/constants.d.ts +3 -1
- package/lib/typescript/src/containers/SendbirdUIKitContainer.d.ts +2 -1
- package/lib/typescript/src/contexts/SendbirdChatCtx.d.ts +3 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelHeader.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannel/component/GroupChannelMessageList.d.ts +3 -32
- package/lib/typescript/src/domain/groupChannel/types.d.ts +23 -35
- package/lib/typescript/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.d.ts +1 -1
- package/lib/typescript/src/domain/groupChannelSettings/types.d.ts +2 -0
- package/lib/typescript/src/domain/messageSearch/component/MessageSearchHeader.d.ts +3 -0
- package/lib/typescript/src/domain/messageSearch/component/MessageSearchList.d.ts +3 -0
- package/lib/typescript/src/domain/messageSearch/component/MessageSearchStatusEmpty.d.ts +2 -0
- package/lib/typescript/src/domain/messageSearch/component/MessageSearchStatusError.d.ts +3 -0
- package/lib/typescript/src/domain/messageSearch/component/MessageSearchStatusLoading.d.ts +2 -0
- package/lib/typescript/src/domain/messageSearch/index.d.ts +7 -0
- package/lib/typescript/src/domain/messageSearch/module/createMessageSearchModule.d.ts +3 -0
- package/lib/typescript/src/domain/messageSearch/module/moduleContext.d.ts +3 -0
- package/lib/typescript/src/domain/messageSearch/types.d.ts +53 -0
- package/lib/typescript/src/domain/openChannel/component/OpenChannelMessageList.d.ts +1 -37
- package/lib/typescript/src/domain/openChannel/types.d.ts +17 -36
- package/lib/typescript/src/fragments/createMessageSearchFragment.d.ts +3 -0
- package/lib/typescript/src/hooks/useMentionSuggestion.d.ts +3 -2
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/localization/StringSet.type.d.ts +17 -3
- package/lib/typescript/src/utils/pubsub.d.ts +6 -0
- package/lib/typescript/src/version.d.ts +1 -1
- package/package.json +8 -7
- package/src/components/ChannelMessageList/index.tsx +392 -0
- package/src/components/ChatFlatList.tsx +33 -51
- package/src/components/MessageSearchResultItem.tsx +125 -0
- package/src/components/ScrollToBottomButton.tsx +3 -4
- package/src/constants.ts +3 -1
- package/src/containers/GroupChannelPreviewContainer.tsx +2 -2
- package/src/containers/SendbirdUIKitContainer.tsx +2 -0
- package/src/contexts/SendbirdChatCtx.tsx +7 -1
- package/src/domain/groupChannel/component/GroupChannelHeader.tsx +9 -3
- package/src/domain/groupChannel/component/GroupChannelMessageList.tsx +73 -316
- package/src/domain/groupChannel/component/GroupChannelSuggestedMentionList.tsx +2 -1
- package/src/domain/groupChannel/module/moduleContext.tsx +10 -2
- package/src/domain/groupChannel/types.ts +49 -38
- package/src/domain/groupChannelSettings/component/GroupChannelSettingsMenu.tsx +29 -13
- package/src/domain/groupChannelSettings/types.ts +2 -0
- package/src/domain/messageSearch/component/MessageSearchHeader.tsx +98 -0
- package/src/domain/messageSearch/component/MessageSearchList.tsx +26 -0
- package/src/domain/messageSearch/component/MessageSearchStatusEmpty.tsx +15 -0
- package/src/domain/messageSearch/component/MessageSearchStatusError.tsx +16 -0
- package/src/domain/messageSearch/component/MessageSearchStatusLoading.tsx +15 -0
- package/src/domain/messageSearch/index.ts +7 -0
- package/src/domain/messageSearch/module/createMessageSearchModule.tsx +21 -0
- package/src/domain/messageSearch/module/moduleContext.tsx +16 -0
- package/src/domain/messageSearch/types.ts +55 -0
- package/src/domain/openChannel/component/OpenChannelMessageList.tsx +35 -303
- package/src/domain/openChannel/module/moduleContext.tsx +8 -2
- package/src/domain/openChannel/types.ts +40 -38
- package/src/fragments/createGroupChannelFragment.tsx +114 -17
- package/src/fragments/createGroupChannelSettingsFragment.tsx +2 -0
- package/src/fragments/createMessageSearchFragment.tsx +159 -0
- package/src/fragments/createOpenChannelFragment.tsx +48 -12
- package/src/hooks/useMentionSuggestion.ts +23 -3
- package/src/index.ts +3 -0
- package/src/localization/StringSet.type.ts +20 -2
- package/src/localization/createBaseStringSet.ts +22 -2
- package/src/utils/pubsub.ts +20 -0
- package/src/version.ts +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type React from 'react';\
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { UseGroupChannelMessagesOptions } from '@sendbird/uikit-chat-hooks';\nimport type {\n OnBeforeHandler,\n SendbirdFileMessage,\n SendbirdFileMessageCreateParams,\n SendbirdFileMessageUpdateParams,\n SendbirdGroupChannel,\n SendbirdMessage,\n SendbirdUser,\n SendbirdUserMessage,\n SendbirdUserMessageCreateParams,\n SendbirdUserMessageUpdateParams,\n} from '@sendbird/uikit-utils';\n\nimport type { ChannelInputProps, SuggestedMentionListProps } from '../../components/ChannelInput';\nimport type { ChannelMessageListProps } from '../../components/ChannelMessageList';\nimport type { CommonComponent } from '../../types';\nimport type { PubSub } from '../../utils/pubsub';\n\nexport interface GroupChannelProps {\n Fragment: {\n channel: SendbirdGroupChannel;\n onChannelDeleted: () => void;\n onPressHeaderLeft: GroupChannelProps['Header']['onPressHeaderLeft'];\n onPressHeaderRight: GroupChannelProps['Header']['onPressHeaderRight'];\n onPressMediaMessage?: GroupChannelProps['MessageList']['onPressMediaMessage'];\n\n onBeforeSendUserMessage?: OnBeforeHandler<SendbirdUserMessageCreateParams>;\n onBeforeSendFileMessage?: OnBeforeHandler<SendbirdFileMessageCreateParams>;\n onBeforeUpdateUserMessage?: OnBeforeHandler<SendbirdUserMessageUpdateParams>;\n onBeforeUpdateFileMessage?: OnBeforeHandler<SendbirdFileMessageUpdateParams>;\n\n renderMessage?: GroupChannelProps['MessageList']['renderMessage'];\n renderNewMessagesButton?: GroupChannelProps['MessageList']['renderNewMessagesButton'];\n renderScrollToBottomButton?: GroupChannelProps['MessageList']['renderScrollToBottomButton'];\n\n enableTypingIndicator?: GroupChannelProps['Provider']['enableTypingIndicator'];\n enableMessageGrouping?: GroupChannelProps['MessageList']['enableMessageGrouping'];\n\n keyboardAvoidOffset?: GroupChannelProps['Provider']['keyboardAvoidOffset'];\n flatListProps?: GroupChannelProps['MessageList']['flatListProps'];\n sortComparator?: UseGroupChannelMessagesOptions['sortComparator'];\n collectionCreator?: UseGroupChannelMessagesOptions['collectionCreator'];\n queryCreator?: UseGroupChannelMessagesOptions['queryCreator'];\n\n searchItem?: GroupChannelProps['MessageList']['searchItem'];\n\n /** @deprecated Please use `onPressMediaMessage` instead **/\n onPressImageMessage?: GroupChannelProps['MessageList']['onPressImageMessage'];\n };\n Header: {\n shouldHideRight: () => boolean;\n onPressHeaderLeft: () => void;\n onPressHeaderRight: () => void;\n };\n MessageList: Pick<\n ChannelMessageListProps<SendbirdGroupChannel>,\n | 'enableMessageGrouping'\n | 'currentUserId'\n | 'channel'\n | 'messages'\n | 'newMessages'\n | 'scrolledAwayFromBottom'\n | 'onScrolledAwayFromBottom'\n | 'onTopReached'\n | 'onBottomReached'\n | 'onResendFailedMessage'\n | 'onDeleteMessage'\n | 'onPressMediaMessage'\n | 'renderMessage'\n | 'renderNewMessagesButton'\n | 'renderScrollToBottomButton'\n | 'flatListProps'\n | 'onPressImageMessage'\n | 'hasNext'\n | 'searchItem'\n > & {\n onResetMessageList: (callback?: () => void) => void;\n\n /** @deprecated Please use `newMessages` instead */\n newMessagesFromMembers: SendbirdMessage[];\n /** @deprecated Please use `newMessages` instead */\n nextMessages: SendbirdMessage[];\n };\n Input: Pick<\n ChannelInputProps,\n | 'shouldRenderInput'\n | 'onPressSendUserMessage'\n | 'onPressSendFileMessage'\n | 'onPressUpdateUserMessage'\n | 'onPressUpdateFileMessage'\n | 'SuggestedMentionList'\n | 'onSendFileMessage'\n | 'onSendUserMessage'\n | 'onUpdateFileMessage'\n | 'onUpdateUserMessage'\n >;\n\n SuggestedMentionList: SuggestedMentionListProps;\n Provider: {\n channel: SendbirdGroupChannel;\n enableTypingIndicator: boolean;\n keyboardAvoidOffset?: number;\n groupChannelPubSub: PubSub<GroupChannelPubSubContextPayload>;\n };\n}\n\n/**\n * Internal context for GroupChannel\n * For example, the developer can create a custom header\n * with getting data from the domain context\n * */\nexport interface GroupChannelContextsType {\n Fragment: React.Context<{\n headerTitle: string;\n channel: SendbirdGroupChannel;\n messageToEdit?: SendbirdUserMessage | SendbirdFileMessage;\n setMessageToEdit: (msg?: SendbirdUserMessage | SendbirdFileMessage) => void;\n keyboardAvoidOffset?: number;\n }>;\n TypingIndicator: React.Context<{\n typingUsers: SendbirdUser[];\n }>;\n PubSub: React.Context<PubSub<GroupChannelPubSubContextPayload>>;\n}\nexport interface GroupChannelModule {\n Provider: CommonComponent<GroupChannelProps['Provider']>;\n Header: CommonComponent<GroupChannelProps['Header']>;\n MessageList: CommonComponent<GroupChannelProps['MessageList']>;\n Input: CommonComponent<GroupChannelProps['Input']>;\n SuggestedMentionList: CommonComponent<GroupChannelProps['SuggestedMentionList']>;\n StatusEmpty: CommonComponent;\n StatusLoading: CommonComponent;\n}\n\nexport type GroupChannelFragment = CommonComponent<GroupChannelProps['Fragment']>;\n\nexport type GroupChannelPubSubContextPayload =\n | {\n type: 'MESSAGE_SENT_PENDING' | 'MESSAGE_SENT_SUCCESS';\n data: {\n message: SendbirdUserMessage | SendbirdFileMessage;\n };\n }\n | {\n type: 'MESSAGES_RECEIVED';\n data: {\n messages: SendbirdMessage[];\n };\n };\n"],"mappings":""}
|
|
@@ -6,10 +6,12 @@ import { Logger, conditionChaining, useIIFE } from '@sendbird/uikit-utils';
|
|
|
6
6
|
import { useLocalization, useSendbirdChat } from '../../../hooks/useContext';
|
|
7
7
|
import { GroupChannelSettingsContexts } from '../module/moduleContext';
|
|
8
8
|
let WARN_onPressMenuNotification = false;
|
|
9
|
+
let WARN_onPressMenuSearchInChannel = false;
|
|
9
10
|
const GroupChannelSettingsMenu = _ref => {
|
|
10
11
|
let {
|
|
11
12
|
onPressMenuModeration,
|
|
12
13
|
onPressMenuMembers,
|
|
14
|
+
onPressMenuSearchInChannel,
|
|
13
15
|
onPressMenuLeaveChannel,
|
|
14
16
|
onPressMenuNotification,
|
|
15
17
|
menuItemsCreator = menu => menu
|
|
@@ -27,10 +29,14 @@ const GroupChannelSettingsMenu = _ref => {
|
|
|
27
29
|
const {
|
|
28
30
|
colors
|
|
29
31
|
} = useUIKitTheme();
|
|
30
|
-
if (__DEV__ && !WARN_onPressMenuNotification && !onPressMenuNotification) {
|
|
31
|
-
Logger.warn('
|
|
32
|
+
if (__DEV__ && !WARN_onPressMenuNotification && !onPressMenuNotification && features.userMentionEnabled) {
|
|
33
|
+
Logger.warn('If you are using mention, make sure to pass the `onPressMenuNotification` prop');
|
|
32
34
|
WARN_onPressMenuNotification = true;
|
|
33
35
|
}
|
|
36
|
+
if (__DEV__ && !WARN_onPressMenuSearchInChannel && !onPressMenuSearchInChannel && features.messageSearchEnabled) {
|
|
37
|
+
Logger.warn('If you are using message search, make sure to pass the `onPressMenuSearchInChannel` prop');
|
|
38
|
+
WARN_onPressMenuSearchInChannel = true;
|
|
39
|
+
}
|
|
34
40
|
const toggleNotification = async () => {
|
|
35
41
|
if (channel.myPushTriggerOption === 'off') {
|
|
36
42
|
await channel.setMyPushTriggerOption(PushTriggerOption.DEFAULT);
|
|
@@ -92,7 +98,15 @@ const GroupChannelSettingsMenu = _ref => {
|
|
|
92
98
|
icon: 'chevron-right',
|
|
93
99
|
color: colors.onBackground01
|
|
94
100
|
})
|
|
95
|
-
}
|
|
101
|
+
}]);
|
|
102
|
+
if (features.messageSearchEnabled) {
|
|
103
|
+
menuItems.push({
|
|
104
|
+
icon: 'search',
|
|
105
|
+
name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_SEARCH,
|
|
106
|
+
onPress: () => onPressMenuSearchInChannel === null || onPressMenuSearchInChannel === void 0 ? void 0 : onPressMenuSearchInChannel()
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
menuItems.push({
|
|
96
110
|
icon: 'leave',
|
|
97
111
|
iconColor: colors.error,
|
|
98
112
|
name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_LEAVE_CHANNEL,
|
|
@@ -102,7 +116,7 @@ const GroupChannelSettingsMenu = _ref => {
|
|
|
102
116
|
sdk.clearCachedMessages([channel.url]).catch();
|
|
103
117
|
});
|
|
104
118
|
}
|
|
105
|
-
}
|
|
119
|
+
});
|
|
106
120
|
return /*#__PURE__*/React.createElement(View, null, menuItems.map(menu => {
|
|
107
121
|
return /*#__PURE__*/React.createElement(MenuBar, {
|
|
108
122
|
key: menu.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useContext","View","PushTriggerOption","Icon","MenuBar","Switch","useUIKitTheme","Logger","conditionChaining","useIIFE","useLocalization","useSendbirdChat","GroupChannelSettingsContexts","WARN_onPressMenuNotification","GroupChannelSettingsMenu","_ref","onPressMenuModeration","onPressMenuMembers","onPressMenuLeaveChannel","onPressMenuNotification","menuItemsCreator","menu","sdk","features","channel","Fragment","STRINGS","colors","__DEV__","warn","toggleNotification","myPushTriggerOption","setMyPushTriggerOption","DEFAULT","OFF","onPressNotificationMenu","actionLabelNotificationMenu","actionItemNotificationMenu","getNotificationsLabel","ALL","GROUP_CHANNEL_SETTINGS","MENU_NOTIFICATION_LABEL_ON","MENU_NOTIFICATION_LABEL_OFF","MENTION_ONLY","MENU_NOTIFICATION_LABEL_MENTION_ONLY","userMentionEnabled","createElement","icon","color","onBackground01","value","onChangeValue","menuItems","visible","myRole","name","MENU_MODERATION","onPress","actionItem","MENU_NOTIFICATION","actionLabel","MENU_MEMBERS","String","memberCount","iconColor","error","MENU_LEAVE_CHANNEL","leave","then","clearCachedMessages","url","catch","map","key","disabled","iconBackgroundColor"],"sources":["GroupChannelSettingsMenu.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { View } from 'react-native';\n\nimport { PushTriggerOption } from '@sendbird/chat';\nimport type { MenuBarProps } from '@sendbird/uikit-react-native-foundation';\nimport { Icon, MenuBar, Switch, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport { Logger, conditionChaining, useIIFE } from '@sendbird/uikit-utils';\n\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport { GroupChannelSettingsContexts } from '../module/moduleContext';\nimport type { GroupChannelSettingsProps } from '../types';\n\nlet WARN_onPressMenuNotification = false;\n\nconst GroupChannelSettingsMenu = ({\n onPressMenuModeration,\n onPressMenuMembers,\n onPressMenuLeaveChannel,\n onPressMenuNotification,\n menuItemsCreator = (menu) => menu,\n}: GroupChannelSettingsProps['Menu']) => {\n const { sdk, features } = useSendbirdChat();\n const { channel } = useContext(GroupChannelSettingsContexts.Fragment);\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n\n if (__DEV__ && !WARN_onPressMenuNotification && !onPressMenuNotification) {\n Logger.warn('You should pass `onPressMenuNotification` prop if using mention');\n WARN_onPressMenuNotification = true;\n }\n\n const toggleNotification = async () => {\n if (channel.myPushTriggerOption === 'off') {\n await channel.setMyPushTriggerOption(PushTriggerOption.DEFAULT);\n } else {\n await channel.setMyPushTriggerOption(PushTriggerOption.OFF);\n }\n };\n\n const { onPressNotificationMenu, actionLabelNotificationMenu, actionItemNotificationMenu } = useIIFE(() => {\n const getNotificationsLabel = () => {\n switch (channel.myPushTriggerOption) {\n case PushTriggerOption.ALL:\n case PushTriggerOption.DEFAULT:\n return STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION_LABEL_ON;\n case PushTriggerOption.OFF:\n return STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION_LABEL_OFF;\n case PushTriggerOption.MENTION_ONLY:\n return STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION_LABEL_MENTION_ONLY;\n }\n };\n\n return {\n actionLabelNotificationMenu: getNotificationsLabel(),\n actionItemNotificationMenu: conditionChaining(\n [features.userMentionEnabled],\n [\n <Icon icon={'chevron-right'} color={colors.onBackground01} />,\n <Switch value={channel.myPushTriggerOption !== 'off'} onChangeValue={toggleNotification} />,\n ],\n ),\n onPressNotificationMenu: () => {\n if (features.userMentionEnabled) onPressMenuNotification?.();\n else toggleNotification();\n },\n };\n });\n\n const menuItems: MenuBarProps[] = menuItemsCreator([\n {\n icon: 'moderation',\n visible: channel.myRole === 'operator',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_MODERATION,\n onPress: () => onPressMenuModeration(),\n actionItem: <Icon icon={'chevron-right'} color={colors.onBackground01} />,\n },\n {\n icon: 'notifications',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION,\n onPress: onPressNotificationMenu,\n actionLabel: actionLabelNotificationMenu,\n actionItem: actionItemNotificationMenu,\n },\n {\n icon: 'members',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_MEMBERS,\n onPress: () => onPressMenuMembers(),\n actionLabel: String(channel.memberCount),\n actionItem: <Icon icon={'chevron-right'} color={colors.onBackground01} />,\n },\n {\n icon: 'leave',\n iconColor: colors.error,\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_LEAVE_CHANNEL,\n onPress: () => {\n channel.leave().then(() => {\n onPressMenuLeaveChannel();\n sdk.clearCachedMessages([channel.url]).catch();\n });\n },\n },\n ]);\n\n return (\n <View>\n {menuItems.map((menu) => {\n return (\n <MenuBar\n key={menu.name}\n onPress={menu.onPress}\n name={menu.name}\n disabled={menu.disabled}\n visible={menu.visible}\n icon={menu.icon}\n iconColor={menu.iconColor}\n iconBackgroundColor={menu.iconBackgroundColor}\n actionLabel={menu.actionLabel}\n actionItem={menu.actionItem}\n />\n );\n })}\n </View>\n );\n};\n\nexport default GroupChannelSettingsMenu;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,iBAAiB,QAAQ,gBAAgB;AAElD,SAASC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAEC,aAAa,QAAQ,yCAAyC;AAC9F,SAASC,MAAM,EAAEC,iBAAiB,EAAEC,OAAO,QAAQ,uBAAuB;AAE1E,SAASC,eAAe,EAAEC,eAAe,QAAQ,2BAA2B;AAC5E,SAASC,4BAA4B,QAAQ,yBAAyB;AAGtE,IAAIC,4BAA4B,GAAG,KAAK;AAExC,MAAMC,wBAAwB,GAAGC,IAAA,IAMQ;EAAA,IANP;IAChCC,qBAAqB;IACrBC,kBAAkB;IAClBC,uBAAuB;IACvBC,uBAAuB;IACvBC,g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
+
{"version":3,"names":["React","useContext","View","PushTriggerOption","Icon","MenuBar","Switch","useUIKitTheme","Logger","conditionChaining","useIIFE","useLocalization","useSendbirdChat","GroupChannelSettingsContexts","WARN_onPressMenuNotification","WARN_onPressMenuSearchInChannel","GroupChannelSettingsMenu","_ref","onPressMenuModeration","onPressMenuMembers","onPressMenuSearchInChannel","onPressMenuLeaveChannel","onPressMenuNotification","menuItemsCreator","menu","sdk","features","channel","Fragment","STRINGS","colors","__DEV__","userMentionEnabled","warn","messageSearchEnabled","toggleNotification","myPushTriggerOption","setMyPushTriggerOption","DEFAULT","OFF","onPressNotificationMenu","actionLabelNotificationMenu","actionItemNotificationMenu","getNotificationsLabel","ALL","GROUP_CHANNEL_SETTINGS","MENU_NOTIFICATION_LABEL_ON","MENU_NOTIFICATION_LABEL_OFF","MENTION_ONLY","MENU_NOTIFICATION_LABEL_MENTION_ONLY","createElement","icon","color","onBackground01","value","onChangeValue","menuItems","visible","myRole","name","MENU_MODERATION","onPress","actionItem","MENU_NOTIFICATION","actionLabel","MENU_MEMBERS","String","memberCount","push","MENU_SEARCH","iconColor","error","MENU_LEAVE_CHANNEL","leave","then","clearCachedMessages","url","catch","map","key","disabled","iconBackgroundColor"],"sources":["GroupChannelSettingsMenu.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport { View } from 'react-native';\n\nimport { PushTriggerOption } from '@sendbird/chat';\nimport type { MenuBarProps } from '@sendbird/uikit-react-native-foundation';\nimport { Icon, MenuBar, Switch, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';\nimport { Logger, conditionChaining, useIIFE } from '@sendbird/uikit-utils';\n\nimport { useLocalization, useSendbirdChat } from '../../../hooks/useContext';\nimport { GroupChannelSettingsContexts } from '../module/moduleContext';\nimport type { GroupChannelSettingsProps } from '../types';\n\nlet WARN_onPressMenuNotification = false;\nlet WARN_onPressMenuSearchInChannel = false;\n\nconst GroupChannelSettingsMenu = ({\n onPressMenuModeration,\n onPressMenuMembers,\n onPressMenuSearchInChannel,\n onPressMenuLeaveChannel,\n onPressMenuNotification,\n menuItemsCreator = (menu) => menu,\n}: GroupChannelSettingsProps['Menu']) => {\n const { sdk, features } = useSendbirdChat();\n const { channel } = useContext(GroupChannelSettingsContexts.Fragment);\n const { STRINGS } = useLocalization();\n const { colors } = useUIKitTheme();\n\n if (__DEV__ && !WARN_onPressMenuNotification && !onPressMenuNotification && features.userMentionEnabled) {\n Logger.warn('If you are using mention, make sure to pass the `onPressMenuNotification` prop');\n WARN_onPressMenuNotification = true;\n }\n\n if (__DEV__ && !WARN_onPressMenuSearchInChannel && !onPressMenuSearchInChannel && features.messageSearchEnabled) {\n Logger.warn('If you are using message search, make sure to pass the `onPressMenuSearchInChannel` prop');\n WARN_onPressMenuSearchInChannel = true;\n }\n\n const toggleNotification = async () => {\n if (channel.myPushTriggerOption === 'off') {\n await channel.setMyPushTriggerOption(PushTriggerOption.DEFAULT);\n } else {\n await channel.setMyPushTriggerOption(PushTriggerOption.OFF);\n }\n };\n\n const { onPressNotificationMenu, actionLabelNotificationMenu, actionItemNotificationMenu } = useIIFE(() => {\n const getNotificationsLabel = () => {\n switch (channel.myPushTriggerOption) {\n case PushTriggerOption.ALL:\n case PushTriggerOption.DEFAULT:\n return STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION_LABEL_ON;\n case PushTriggerOption.OFF:\n return STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION_LABEL_OFF;\n case PushTriggerOption.MENTION_ONLY:\n return STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION_LABEL_MENTION_ONLY;\n }\n };\n\n return {\n actionLabelNotificationMenu: getNotificationsLabel(),\n actionItemNotificationMenu: conditionChaining(\n [features.userMentionEnabled],\n [\n <Icon icon={'chevron-right'} color={colors.onBackground01} />,\n <Switch value={channel.myPushTriggerOption !== 'off'} onChangeValue={toggleNotification} />,\n ],\n ),\n onPressNotificationMenu: () => {\n if (features.userMentionEnabled) onPressMenuNotification?.();\n else toggleNotification();\n },\n };\n });\n\n const menuItems: MenuBarProps[] = menuItemsCreator([\n {\n icon: 'moderation',\n visible: channel.myRole === 'operator',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_MODERATION,\n onPress: () => onPressMenuModeration(),\n actionItem: <Icon icon={'chevron-right'} color={colors.onBackground01} />,\n },\n {\n icon: 'notifications',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_NOTIFICATION,\n onPress: onPressNotificationMenu,\n actionLabel: actionLabelNotificationMenu,\n actionItem: actionItemNotificationMenu,\n },\n {\n icon: 'members',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_MEMBERS,\n onPress: () => onPressMenuMembers(),\n actionLabel: String(channel.memberCount),\n actionItem: <Icon icon={'chevron-right'} color={colors.onBackground01} />,\n },\n ]);\n\n if (features.messageSearchEnabled) {\n menuItems.push({\n icon: 'search',\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_SEARCH,\n onPress: () => onPressMenuSearchInChannel?.(),\n });\n }\n\n menuItems.push({\n icon: 'leave',\n iconColor: colors.error,\n name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_LEAVE_CHANNEL,\n onPress: () => {\n channel.leave().then(() => {\n onPressMenuLeaveChannel();\n sdk.clearCachedMessages([channel.url]).catch();\n });\n },\n });\n\n return (\n <View>\n {menuItems.map((menu) => {\n return (\n <MenuBar\n key={menu.name}\n onPress={menu.onPress}\n name={menu.name}\n disabled={menu.disabled}\n visible={menu.visible}\n icon={menu.icon}\n iconColor={menu.iconColor}\n iconBackgroundColor={menu.iconBackgroundColor}\n actionLabel={menu.actionLabel}\n actionItem={menu.actionItem}\n />\n );\n })}\n </View>\n );\n};\n\nexport default GroupChannelSettingsMenu;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,iBAAiB,QAAQ,gBAAgB;AAElD,SAASC,IAAI,EAA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O,CAACgB,sBAAsB,CAAC2B,kBAAkB;IACvDX,OAAO,EAAEA,CAAA,KAAM;MACblC,OAAO,CAAC8C,KAAK,EAAE,CAACC,IAAI,CAAC,MAAM;QACzBrD,uBAAuB,EAAE;QACzBI,GAAG,CAACkD,mBAAmB,CAAC,CAAChD,OAAO,CAACiD,GAAG,CAAC,CAAC,CAACC,KAAK,EAAE;MAChD,CAAC,CAAC;IACJ;EACF,CAAC,CAAC;EAEF,oBACE7E,KAAA,CAAAkD,aAAA,CAAChD,IAAI,QACFsD,SAAS,CAACsB,GAAG,CAAEtD,IAAI,IAAK;IACvB,oBACExB,KAAA,CAAAkD,aAAA,CAAC7C,OAAO;MACN0E,GAAG,EAAEvD,IAAI,CAACmC,IAAK;MACfE,OAAO,EAAErC,IAAI,CAACqC,OAAQ;MACtBF,IAAI,EAAEnC,IAAI,CAACmC,IAAK;MAChBqB,QAAQ,EAAExD,IAAI,CAACwD,QAAS;MACxBvB,OAAO,EAAEjC,IAAI,CAACiC,OAAQ;MACtBN,IAAI,EAAE3B,IAAI,CAAC2B,IAAK;MAChBmB,SAAS,EAAE9C,IAAI,CAAC8C,SAAU;MAC1BW,mBAAmB,EAAEzD,IAAI,CAACyD,mBAAoB;MAC9CjB,WAAW,EAAExC,IAAI,CAACwC,WAAY;MAC9BF,UAAU,EAAEtC,IAAI,CAACsC;IAAW,EAC5B;EAEN,CAAC,CAAC,CACG;AAEX,CAAC;AAED,eAAe9C,wBAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { MenuBarProps } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdGroupChannel } from '@sendbird/uikit-utils';\n\nimport type { CommonComponent } from '../../types';\n\nexport interface GroupChannelSettingsProps {\n Fragment: {\n channel: GroupChannelSettingsProps['Provider']['channel'];\n onPressHeaderLeft: GroupChannelSettingsProps['Header']['onPressHeaderLeft'];\n onPressMenuModeration: GroupChannelSettingsProps['Menu']['onPressMenuModeration'];\n onPressMenuMembers: GroupChannelSettingsProps['Menu']['onPressMenuMembers'];\n onPressMenuLeaveChannel: GroupChannelSettingsProps['Menu']['onPressMenuLeaveChannel'];\n onPressMenuNotification?: GroupChannelSettingsProps['Menu']['onPressMenuNotification'];\n menuItemsCreator?: GroupChannelSettingsProps['Menu']['menuItemsCreator'];\n };\n Header: {\n onPressHeaderLeft: () => void;\n };\n Info: {};\n Menu: {\n onPressMenuModeration: () => void;\n onPressMenuMembers: () => void;\n onPressMenuLeaveChannel: () => void;\n onPressMenuNotification?: () => void;\n menuItemsCreator?: (defaultMenuItems: MenuBarProps[]) => MenuBarProps[];\n };\n Provider: {\n channel: SendbirdGroupChannel;\n };\n}\n\n/**\n * Internal context for GroupChannelSettings\n * For example, the developer can create a custom header\n * with getting data from the domain context\n * */\nexport interface GroupChannelSettingsContextsType {\n Fragment: React.Context<{\n channel: SendbirdGroupChannel;\n headerTitle: string;\n headerRight: string;\n onPressHeaderRight: () => void;\n }>;\n}\nexport interface GroupChannelSettingsModule {\n Provider: CommonComponent<GroupChannelSettingsProps['Provider']>;\n Header: CommonComponent<GroupChannelSettingsProps['Header']>;\n Info: CommonComponent<GroupChannelSettingsProps['Info']>;\n Menu: CommonComponent<GroupChannelSettingsProps['Menu']>;\n}\n\nexport type GroupChannelSettingsFragment = CommonComponent<GroupChannelSettingsProps['Fragment']>;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type React from 'react';\n\nimport type { MenuBarProps } from '@sendbird/uikit-react-native-foundation';\nimport type { SendbirdGroupChannel } from '@sendbird/uikit-utils';\n\nimport type { CommonComponent } from '../../types';\n\nexport interface GroupChannelSettingsProps {\n Fragment: {\n channel: GroupChannelSettingsProps['Provider']['channel'];\n onPressHeaderLeft: GroupChannelSettingsProps['Header']['onPressHeaderLeft'];\n onPressMenuModeration: GroupChannelSettingsProps['Menu']['onPressMenuModeration'];\n onPressMenuMembers: GroupChannelSettingsProps['Menu']['onPressMenuMembers'];\n onPressMenuSearchInChannel?: GroupChannelSettingsProps['Menu']['onPressMenuSearchInChannel'];\n onPressMenuLeaveChannel: GroupChannelSettingsProps['Menu']['onPressMenuLeaveChannel'];\n onPressMenuNotification?: GroupChannelSettingsProps['Menu']['onPressMenuNotification'];\n menuItemsCreator?: GroupChannelSettingsProps['Menu']['menuItemsCreator'];\n };\n Header: {\n onPressHeaderLeft: () => void;\n };\n Info: {};\n Menu: {\n onPressMenuModeration: () => void;\n onPressMenuMembers: () => void;\n onPressMenuSearchInChannel?: () => void;\n onPressMenuLeaveChannel: () => void;\n onPressMenuNotification?: () => void;\n menuItemsCreator?: (defaultMenuItems: MenuBarProps[]) => MenuBarProps[];\n };\n Provider: {\n channel: SendbirdGroupChannel;\n };\n}\n\n/**\n * Internal context for GroupChannelSettings\n * For example, the developer can create a custom header\n * with getting data from the domain context\n * */\nexport interface GroupChannelSettingsContextsType {\n Fragment: React.Context<{\n channel: SendbirdGroupChannel;\n headerTitle: string;\n headerRight: string;\n onPressHeaderRight: () => void;\n }>;\n}\nexport interface GroupChannelSettingsModule {\n Provider: CommonComponent<GroupChannelSettingsProps['Provider']>;\n Header: CommonComponent<GroupChannelSettingsProps['Header']>;\n Info: CommonComponent<GroupChannelSettingsProps['Info']>;\n Menu: CommonComponent<GroupChannelSettingsProps['Menu']>;\n}\n\nexport type GroupChannelSettingsFragment = CommonComponent<GroupChannelSettingsProps['Fragment']>;\n"],"mappings":""}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { Platform, TextInput } from 'react-native';
|
|
3
|
+
import { Box, Icon, PressBox, Text, createStyleSheet, useHeaderStyle, useUIKitTheme } from '@sendbird/uikit-react-native-foundation';
|
|
4
|
+
import { useLocalization } from '../../../hooks/useContext';
|
|
5
|
+
const MessageSearchHeader = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
keyword,
|
|
8
|
+
onChangeKeyword,
|
|
9
|
+
onPressHeaderLeft,
|
|
10
|
+
onPressHeaderRight
|
|
11
|
+
} = _ref;
|
|
12
|
+
const {
|
|
13
|
+
HeaderComponent
|
|
14
|
+
} = useHeaderStyle();
|
|
15
|
+
const {
|
|
16
|
+
colors
|
|
17
|
+
} = useUIKitTheme();
|
|
18
|
+
const {
|
|
19
|
+
STRINGS
|
|
20
|
+
} = useLocalization();
|
|
21
|
+
const inputRef = useRef(null);
|
|
22
|
+
const inputColor = colors.ui.input.default.active;
|
|
23
|
+
const searchEnabled = keyword.length > 0;
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
var _inputRef$current;
|
|
27
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
|
|
28
|
+
}, Platform.select({
|
|
29
|
+
ios: 500,
|
|
30
|
+
default: 0
|
|
31
|
+
}));
|
|
32
|
+
}, []);
|
|
33
|
+
return /*#__PURE__*/React.createElement(HeaderComponent, {
|
|
34
|
+
clearTitleMargin: true,
|
|
35
|
+
title: /*#__PURE__*/React.createElement(Box, {
|
|
36
|
+
flex: 1,
|
|
37
|
+
height: 36,
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
backgroundColor: inputColor.background,
|
|
40
|
+
borderRadius: 24,
|
|
41
|
+
paddingHorizontal: 10,
|
|
42
|
+
flexDirection: 'row'
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
44
|
+
size: 24,
|
|
45
|
+
icon: 'search',
|
|
46
|
+
color: colors.onBackground03,
|
|
47
|
+
containerStyle: styles.searchIcon
|
|
48
|
+
}), /*#__PURE__*/React.createElement(TextInput, {
|
|
49
|
+
disableFullscreenUI: true,
|
|
50
|
+
enablesReturnKeyAutomatically: true,
|
|
51
|
+
ref: inputRef,
|
|
52
|
+
returnKeyType: 'search',
|
|
53
|
+
onSubmitEditing: () => onPressHeaderRight(),
|
|
54
|
+
selectionColor: colors.primary,
|
|
55
|
+
placeholder: STRINGS.MESSAGE_SEARCH.HEADER_INPUT_PLACEHOLDER,
|
|
56
|
+
placeholderTextColor: inputColor.placeholder,
|
|
57
|
+
style: [styles.input, {
|
|
58
|
+
color: inputColor.text
|
|
59
|
+
}],
|
|
60
|
+
value: keyword,
|
|
61
|
+
onChangeText: onChangeKeyword
|
|
62
|
+
}), searchEnabled && /*#__PURE__*/React.createElement(PressBox, {
|
|
63
|
+
onPress: () => onChangeKeyword('')
|
|
64
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
65
|
+
size: 18,
|
|
66
|
+
icon: 'remove',
|
|
67
|
+
color: colors.onBackground03,
|
|
68
|
+
containerStyle: styles.clearIcon
|
|
69
|
+
}))),
|
|
70
|
+
left: /*#__PURE__*/React.createElement(Icon, {
|
|
71
|
+
icon: 'arrow-left'
|
|
72
|
+
}),
|
|
73
|
+
onPressLeft: onPressHeaderLeft,
|
|
74
|
+
right: /*#__PURE__*/React.createElement(Text, {
|
|
75
|
+
button: true,
|
|
76
|
+
color: searchEnabled ? colors.primary : colors.onBackground04
|
|
77
|
+
}, STRINGS.MESSAGE_SEARCH.HEADER_RIGHT),
|
|
78
|
+
onPressRight: searchEnabled ? onPressHeaderRight : undefined
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
const styles = createStyleSheet({
|
|
82
|
+
searchIcon: {
|
|
83
|
+
marginRight: 8
|
|
84
|
+
},
|
|
85
|
+
clearIcon: {
|
|
86
|
+
marginLeft: 8
|
|
87
|
+
},
|
|
88
|
+
input: {
|
|
89
|
+
flex: 1,
|
|
90
|
+
height: '100%',
|
|
91
|
+
fontSize: 14,
|
|
92
|
+
padding: 0
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
export default MessageSearchHeader;
|
|
96
|
+
//# sourceMappingURL=MessageSearchHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","Platform","TextInput","Box","Icon","PressBox","Text","createStyleSheet","useHeaderStyle","useUIKitTheme","useLocalization","MessageSearchHeader","_ref","keyword","onChangeKeyword","onPressHeaderLeft","onPressHeaderRight","HeaderComponent","colors","STRINGS","inputRef","inputColor","ui","input","default","active","searchEnabled","length","setTimeout","_inputRef$current","current","focus","select","ios","createElement","clearTitleMargin","title","flex","height","alignItems","backgroundColor","background","borderRadius","paddingHorizontal","flexDirection","size","icon","color","onBackground03","containerStyle","styles","searchIcon","disableFullscreenUI","enablesReturnKeyAutomatically","ref","returnKeyType","onSubmitEditing","selectionColor","primary","placeholder","MESSAGE_SEARCH","HEADER_INPUT_PLACEHOLDER","placeholderTextColor","style","text","value","onChangeText","onPress","clearIcon","left","onPressLeft","right","button","onBackground04","HEADER_RIGHT","onPressRight","undefined","marginRight","marginLeft","fontSize","padding"],"sources":["MessageSearchHeader.tsx"],"sourcesContent":["import React, { useEffect, useRef } from 'react';\nimport { Platform, TextInput } from 'react-native';\n\nimport {\n Box,\n Icon,\n PressBox,\n Text,\n createStyleSheet,\n useHeaderStyle,\n useUIKitTheme,\n} from '@sendbird/uikit-react-native-foundation';\n\nimport { useLocalization } from '../../../hooks/useContext';\nimport type { MessageSearchProps } from '../types';\n\nconst MessageSearchHeader = ({\n keyword,\n onChangeKeyword,\n onPressHeaderLeft,\n onPressHeaderRight,\n}: MessageSearchProps['Header']) => {\n const { HeaderComponent } = useHeaderStyle();\n const { colors } = useUIKitTheme();\n const { STRINGS } = useLocalization();\n\n const inputRef = useRef<TextInput>(null);\n const inputColor = colors.ui.input.default.active;\n const searchEnabled = keyword.length > 0;\n\n useEffect(() => {\n setTimeout(() => {\n inputRef.current?.focus();\n }, Platform.select({ ios: 500, default: 0 }));\n }, []);\n\n return (\n <HeaderComponent\n clearTitleMargin\n title={\n <Box\n flex={1}\n height={36}\n alignItems={'center'}\n backgroundColor={inputColor.background}\n borderRadius={24}\n paddingHorizontal={10}\n flexDirection={'row'}\n >\n <Icon size={24} icon={'search'} color={colors.onBackground03} containerStyle={styles.searchIcon} />\n <TextInput\n disableFullscreenUI\n enablesReturnKeyAutomatically\n ref={inputRef}\n returnKeyType={'search'}\n onSubmitEditing={() => onPressHeaderRight()}\n selectionColor={colors.primary}\n placeholder={STRINGS.MESSAGE_SEARCH.HEADER_INPUT_PLACEHOLDER}\n placeholderTextColor={inputColor.placeholder}\n style={[styles.input, { color: inputColor.text }]}\n value={keyword}\n onChangeText={onChangeKeyword}\n />\n {searchEnabled && (\n <PressBox onPress={() => onChangeKeyword('')}>\n <Icon size={18} icon={'remove'} color={colors.onBackground03} containerStyle={styles.clearIcon} />\n </PressBox>\n )}\n </Box>\n }\n left={<Icon icon={'arrow-left'} />}\n onPressLeft={onPressHeaderLeft}\n right={\n <Text button color={searchEnabled ? colors.primary : colors.onBackground04}>\n {STRINGS.MESSAGE_SEARCH.HEADER_RIGHT}\n </Text>\n }\n onPressRight={searchEnabled ? onPressHeaderRight : undefined}\n />\n );\n};\n\nconst styles = createStyleSheet({\n searchIcon: {\n marginRight: 8,\n },\n clearIcon: {\n marginLeft: 8,\n },\n input: {\n flex: 1,\n height: '100%',\n fontSize: 14,\n padding: 0,\n },\n});\n\nexport default MessageSearchHeader;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAChD,SAASC,QAAQ,EAAEC,SAAS,QAAQ,cAAc;AAElD,SACEC,GAAG,EACHC,IAAI,EACJC,QAAQ,EACRC,IAAI,EACJC,gBAAgB,EAChBC,cAAc,EACdC,aAAa,QACR,yCAAyC;AAEhD,SAASC,eAAe,QAAQ,2BAA2B;AAG3D,MAAMC,mBAAmB,GAAGC,IAAA,IAKQ;EAAA,IALP;IAC3BC,OAAO;IACPC,eAAe;IACfC,iBAAiB;IACjBC;EAC4B,CAAC,GAAAJ,IAAA;EAC7B,MAAM;IAAEK;EAAgB,CAAC,GAAGT,cAAc,EAAE;EAC5C,MAAM;IAAEU;EAAO,CAAC,GAAGT,aAAa,EA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yC,QAAQ,EAAE,EAAE;IACZC,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEF,eAAerE,mBAAmB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { FlatList } from 'react-native';
|
|
4
|
+
import { useFreshCallback } from '@sendbird/uikit-utils';
|
|
5
|
+
const MessageSearchList = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
messages,
|
|
8
|
+
renderSearchResultItem,
|
|
9
|
+
flatListProps,
|
|
10
|
+
onPressSearchResultItem,
|
|
11
|
+
channel
|
|
12
|
+
} = _ref;
|
|
13
|
+
const renderItem = useFreshCallback(_ref2 => {
|
|
14
|
+
let {
|
|
15
|
+
item
|
|
16
|
+
} = _ref2;
|
|
17
|
+
return renderSearchResultItem({
|
|
18
|
+
message: item,
|
|
19
|
+
onPress: () => onPressSearchResultItem({
|
|
20
|
+
message: item,
|
|
21
|
+
channel
|
|
22
|
+
}),
|
|
23
|
+
channel
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
return /*#__PURE__*/React.createElement(FlatList, _extends({}, flatListProps, {
|
|
27
|
+
data: messages,
|
|
28
|
+
renderItem: renderItem
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
31
|
+
export default MessageSearchList;
|
|
32
|
+
//# sourceMappingURL=MessageSearchList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","FlatList","useFreshCallback","MessageSearchList","_ref","messages","renderSearchResultItem","flatListProps","onPressSearchResultItem","channel","renderItem","_ref2","item","message","onPress","createElement","_extends","data"],"sources":["MessageSearchList.tsx"],"sourcesContent":["import React from 'react';\nimport { FlatList, ListRenderItem } from 'react-native';\n\nimport { SendbirdBaseMessage, useFreshCallback } from '@sendbird/uikit-utils';\n\nimport type { MessageSearchProps } from '../types';\n\nconst MessageSearchList = ({\n messages,\n renderSearchResultItem,\n flatListProps,\n onPressSearchResultItem,\n channel,\n}: MessageSearchProps['List']) => {\n const renderItem: ListRenderItem<SendbirdBaseMessage> = useFreshCallback(({ item }) => {\n return renderSearchResultItem({\n message: item,\n onPress: () => onPressSearchResultItem({ message: item, channel }),\n channel,\n });\n });\n\n return <FlatList {...flatListProps} data={messages} renderItem={renderItem} />;\n};\n\nexport default MessageSearchList;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAwB,cAAc;AAEvD,SAA8BC,gBAAgB,QAAQ,uBAAuB;AAI7E,MAAMC,iBAAiB,GAAGC,IAAA,IAMQ;EAAA,IANP;IACzBC,QAAQ;IACRC,sBAAsB;IACtBC,aAAa;IACbC,uBAAuB;IACvBC;EAC0B,CAAC,GAAAL,IAAA;EAC3B,MAAMM,UAA+C,GAAGR,gBAAgB,CAACS,KAAA,IAAc;IAAA,IAAb;MAAEC;IAAK,CAAC,GAAAD,KAAA;IAChF,OAAOL,sBAAsB,CAAC;MAC5BO,OAAO,EAAED,IAAI;MACbE,OAAO,EAAEA,CAAA,KAAMN,uBAAuB,CAAC;QAAEK,OAAO,EAAED,IAAI;QAAEH;MAAQ,CAAC,CAAC;MAClEA;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,oBAAOT,KAAA,CAAAe,aAAA,CAACd,QAAQ,EAAAe,QAAA,KAAKT,aAAa;IAAEU,IAAI,EAAEZ,QAAS;IAACK,UAAU,EAAEA;EAAW,GAAG;AAChF,CAAC;AAED,eAAeP,iBAAiB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box } from '@sendbird/uikit-react-native-foundation';
|
|
3
|
+
import TypedPlaceholder from '../../../components/TypedPlaceholder';
|
|
4
|
+
const MessageSearchStatusEmpty = () => {
|
|
5
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
6
|
+
flex: 1,
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
justifyContent: 'center'
|
|
9
|
+
}, /*#__PURE__*/React.createElement(TypedPlaceholder, {
|
|
10
|
+
type: 'no-results-found'
|
|
11
|
+
}));
|
|
12
|
+
};
|
|
13
|
+
export default MessageSearchStatusEmpty;
|
|
14
|
+
//# sourceMappingURL=MessageSearchStatusEmpty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Box","TypedPlaceholder","MessageSearchStatusEmpty","createElement","flex","alignItems","justifyContent","type"],"sources":["MessageSearchStatusEmpty.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Box } from '@sendbird/uikit-react-native-foundation';\n\nimport TypedPlaceholder from '../../../components/TypedPlaceholder';\n\nconst MessageSearchStatusEmpty = () => {\n return (\n <Box flex={1} alignItems={'center'} justifyContent={'center'}>\n <TypedPlaceholder type={'no-results-found'} />\n </Box>\n );\n};\n\nexport default MessageSearchStatusEmpty;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,GAAG,QAAQ,yCAAyC;AAE7D,OAAOC,gBAAgB,MAAM,sCAAsC;AAEnE,MAAMC,wBAAwB,GAAGA,CAAA,KAAM;EACrC,oBACEH,KAAA,CAAAI,aAAA,CAACH,GAAG;IAACI,IAAI,EAAE,CAAE;IAACC,UAAU,EAAE,QAAS;IAACC,cAAc,EAAE;EAAS,gBAC3DP,KAAA,CAAAI,aAAA,CAACF,gBAAgB;IAACM,IAAI,EAAE;EAAmB,EAAG,CAC1C;AAEV,CAAC;AAED,eAAeL,wBAAwB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box } from '@sendbird/uikit-react-native-foundation';
|
|
3
|
+
import TypedPlaceholder from '../../../components/TypedPlaceholder';
|
|
4
|
+
const MessageSearchStatusError = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
onPressRetry
|
|
7
|
+
} = _ref;
|
|
8
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
9
|
+
flex: 1,
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
justifyContent: 'center'
|
|
12
|
+
}, /*#__PURE__*/React.createElement(TypedPlaceholder, {
|
|
13
|
+
type: 'error-wrong',
|
|
14
|
+
onPressRetry: onPressRetry
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
17
|
+
export default MessageSearchStatusError;
|
|
18
|
+
//# sourceMappingURL=MessageSearchStatusError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Box","TypedPlaceholder","MessageSearchStatusError","_ref","onPressRetry","createElement","flex","alignItems","justifyContent","type"],"sources":["MessageSearchStatusError.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Box } from '@sendbird/uikit-react-native-foundation';\n\nimport TypedPlaceholder from '../../../components/TypedPlaceholder';\nimport type { MessageSearchModule } from '../types';\n\nconst MessageSearchStatusError: MessageSearchModule['StatusError'] = ({ onPressRetry }) => {\n return (\n <Box flex={1} alignItems={'center'} justifyContent={'center'}>\n <TypedPlaceholder type={'error-wrong'} onPressRetry={onPressRetry} />\n </Box>\n );\n};\n\nexport default MessageSearchStatusError;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,GAAG,QAAQ,yCAAyC;AAE7D,OAAOC,gBAAgB,MAAM,sCAAsC;AAGnE,MAAMC,wBAA4D,GAAGC,IAAA,IAAsB;EAAA,IAArB;IAAEC;EAAa,CAAC,GAAAD,IAAA;EACpF,oBACEJ,KAAA,CAAAM,aAAA,CAACL,GAAG;IAACM,IAAI,EAAE,CAAE;IAACC,UAAU,EAAE,QAAS;IAACC,cAAc,EAAE;EAAS,gBAC3DT,KAAA,CAAAM,aAAA,CAACJ,gBAAgB;IAACQ,IAAI,EAAE,aAAc;IAACL,YAAY,EAAEA;EAAa,EAAG,CACjE;AAEV,CAAC;AAED,eAAeF,wBAAwB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box } from '@sendbird/uikit-react-native-foundation';
|
|
3
|
+
import TypedPlaceholder from '../../../components/TypedPlaceholder';
|
|
4
|
+
const MessageSearchStatusLoading = () => {
|
|
5
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
6
|
+
flex: 1,
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
justifyContent: 'center'
|
|
9
|
+
}, /*#__PURE__*/React.createElement(TypedPlaceholder, {
|
|
10
|
+
type: 'loading'
|
|
11
|
+
}));
|
|
12
|
+
};
|
|
13
|
+
export default MessageSearchStatusLoading;
|
|
14
|
+
//# sourceMappingURL=MessageSearchStatusLoading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Box","TypedPlaceholder","MessageSearchStatusLoading","createElement","flex","alignItems","justifyContent","type"],"sources":["MessageSearchStatusLoading.tsx"],"sourcesContent":["import React from 'react';\n\nimport { Box } from '@sendbird/uikit-react-native-foundation';\n\nimport TypedPlaceholder from '../../../components/TypedPlaceholder';\n\nconst MessageSearchStatusLoading = () => {\n return (\n <Box flex={1} alignItems={'center'} justifyContent={'center'}>\n <TypedPlaceholder type={'loading'} />\n </Box>\n );\n};\n\nexport default MessageSearchStatusLoading;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,GAAG,QAAQ,yCAAyC;AAE7D,OAAOC,gBAAgB,MAAM,sCAAsC;AAEnE,MAAMC,0BAA0B,GAAGA,CAAA,KAAM;EACvC,oBACEH,KAAA,CAAAI,aAAA,CAACH,GAAG;IAACI,IAAI,EAAE,CAAE;IAACC,UAAU,EAAE,QAAS;IAACC,cAAc,EAAE;EAAS,gBAC3DP,KAAA,CAAAI,aAAA,CAACF,gBAAgB;IAACM,IAAI,EAAE;EAAU,EAAG,CACjC;AAEV,CAAC;AAED,eAAeL,0BAA0B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as MessageSearchHeader } from './component/MessageSearchHeader';
|
|
2
|
+
export { default as MessageSearchList } from './component/MessageSearchList';
|
|
3
|
+
export { default as MessageSearchStatusLoading } from './component/MessageSearchStatusLoading';
|
|
4
|
+
export { default as MessageSearchStatusEmpty } from './component/MessageSearchStatusEmpty';
|
|
5
|
+
export { default as MessageSearchStatusError } from './component/MessageSearchStatusError';
|
|
6
|
+
export { default as createMessageSearchModule } from './module/createMessageSearchModule';
|
|
7
|
+
export { MessageSearchContextsProvider, MessageSearchContexts } from './module/moduleContext';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["default","MessageSearchHeader","MessageSearchList","MessageSearchStatusLoading","MessageSearchStatusEmpty","MessageSearchStatusError","createMessageSearchModule","MessageSearchContextsProvider","MessageSearchContexts"],"sources":["index.ts"],"sourcesContent":["export { default as MessageSearchHeader } from './component/MessageSearchHeader';\nexport { default as MessageSearchList } from './component/MessageSearchList';\nexport { default as MessageSearchStatusLoading } from './component/MessageSearchStatusLoading';\nexport { default as MessageSearchStatusEmpty } from './component/MessageSearchStatusEmpty';\nexport { default as MessageSearchStatusError } from './component/MessageSearchStatusError';\nexport { default as createMessageSearchModule } from './module/createMessageSearchModule';\nexport { MessageSearchContextsProvider, MessageSearchContexts } from './module/moduleContext';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,mBAAmB,QAAQ,iCAAiC;AAChF,SAASD,OAAO,IAAIE,iBAAiB,QAAQ,+BAA+B;AAC5E,SAASF,OAAO,IAAIG,0BAA0B,QAAQ,wCAAwC;AAC9F,SAASH,OAAO,IAAII,wBAAwB,QAAQ,sCAAsC;AAC1F,SAASJ,OAAO,IAAIK,wBAAwB,QAAQ,sCAAsC;AAC1F,SAASL,OAAO,IAAIM,yBAAyB,QAAQ,oCAAoC;AACzF,SAASC,6BAA6B,EAAEC,qBAAqB,QAAQ,wBAAwB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import MessageSearchHeader from '../component/MessageSearchHeader';
|
|
2
|
+
import MessageSearchList from '../component/MessageSearchList';
|
|
3
|
+
import MessageSearchStatusEmpty from '../component/MessageSearchStatusEmpty';
|
|
4
|
+
import MessageSearchStatusError from '../component/MessageSearchStatusError';
|
|
5
|
+
import MessageSearchStatusLoading from '../component/MessageSearchStatusLoading';
|
|
6
|
+
import { MessageSearchContextsProvider } from './moduleContext';
|
|
7
|
+
const createMessageSearchModule = function () {
|
|
8
|
+
let {
|
|
9
|
+
Header = MessageSearchHeader,
|
|
10
|
+
List = MessageSearchList,
|
|
11
|
+
StatusError = MessageSearchStatusError,
|
|
12
|
+
StatusLoading = MessageSearchStatusLoading,
|
|
13
|
+
StatusEmpty = MessageSearchStatusEmpty,
|
|
14
|
+
Provider = MessageSearchContextsProvider,
|
|
15
|
+
...module
|
|
16
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
17
|
+
return {
|
|
18
|
+
Header,
|
|
19
|
+
List,
|
|
20
|
+
Provider,
|
|
21
|
+
StatusError,
|
|
22
|
+
StatusEmpty,
|
|
23
|
+
StatusLoading,
|
|
24
|
+
...module
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default createMessageSearchModule;
|
|
28
|
+
//# sourceMappingURL=createMessageSearchModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MessageSearchHeader","MessageSearchList","MessageSearchStatusEmpty","MessageSearchStatusError","MessageSearchStatusLoading","MessageSearchContextsProvider","createMessageSearchModule","Header","List","StatusError","StatusLoading","StatusEmpty","Provider","module","arguments","length","undefined"],"sources":["createMessageSearchModule.tsx"],"sourcesContent":["import MessageSearchHeader from '../component/MessageSearchHeader';\nimport MessageSearchList from '../component/MessageSearchList';\nimport MessageSearchStatusEmpty from '../component/MessageSearchStatusEmpty';\nimport MessageSearchStatusError from '../component/MessageSearchStatusError';\nimport MessageSearchStatusLoading from '../component/MessageSearchStatusLoading';\nimport type { MessageSearchModule } from '../types';\nimport { MessageSearchContextsProvider } from './moduleContext';\n\nconst createMessageSearchModule = ({\n Header = MessageSearchHeader,\n List = MessageSearchList,\n StatusError = MessageSearchStatusError,\n StatusLoading = MessageSearchStatusLoading,\n StatusEmpty = MessageSearchStatusEmpty,\n Provider = MessageSearchContextsProvider,\n ...module\n}: Partial<MessageSearchModule> = {}): MessageSearchModule => {\n return { Header, List, Provider, StatusError, StatusEmpty, StatusLoading, ...module };\n};\n\nexport default createMessageSearchModule;\n"],"mappings":"AAAA,OAAOA,mBAAmB,MAAM,kCAAkC;AAClE,OAAOC,iBAAiB,MAAM,gCAAgC;AAC9D,OAAOC,wBAAwB,MAAM,uCAAuC;AAC5E,OAAOC,wBAAwB,MAAM,uCAAuC;AAC5E,OAAOC,0BAA0B,MAAM,yCAAyC;AAEhF,SAASC,6BAA6B,QAAQ,iBAAiB;AAE/D,MAAMC,yBAAyB,GAAG,SAAAA,CAAA,EAQ4B;EAAA,IAR3B;IACjCC,MAAM,GAAGP,mBAAmB;IAC5BQ,IAAI,GAAGP,iBAAiB;IACxBQ,WAAW,GAAGN,wBAAwB;IACtCO,aAAa,GAAGN,0BAA0B;IAC1CO,WAAW,GAAGT,wBAAwB;IACtCU,QAAQ,GAAGP,6BAA6B;IACxC,GAAGQ;EACyB,CAAC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAClC,OAAO;IAAEP,MAAM;IAAEC,IAAI;IAAEI,QAAQ;IAAEH,WAAW;IAAEE,WAAW;IAAED,aAAa;IAAE,GAAGG;EAAO,CAAC;AACvF,CAAC;AAED,eAAeP,yBAAyB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { createContext } from 'react';
|
|
2
|
+
import ProviderLayout from '../../../components/ProviderLayout';
|
|
3
|
+
export const MessageSearchContexts = {
|
|
4
|
+
Fragment: /*#__PURE__*/createContext(null)
|
|
5
|
+
};
|
|
6
|
+
export const MessageSearchContextsProvider = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
children
|
|
9
|
+
} = _ref;
|
|
10
|
+
return /*#__PURE__*/React.createElement(ProviderLayout, null, /*#__PURE__*/React.createElement(MessageSearchContexts.Fragment.Provider, {
|
|
11
|
+
value: null
|
|
12
|
+
}, children));
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=moduleContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","createContext","ProviderLayout","MessageSearchContexts","Fragment","MessageSearchContextsProvider","_ref","children","createElement","Provider","value"],"sources":["moduleContext.tsx"],"sourcesContent":["import React, { createContext } from 'react';\n\nimport ProviderLayout from '../../../components/ProviderLayout';\nimport type { MessageSearchContextsType, MessageSearchModule } from '../types';\n\nexport const MessageSearchContexts: MessageSearchContextsType = {\n Fragment: createContext(null),\n};\n\nexport const MessageSearchContextsProvider: MessageSearchModule['Provider'] = ({ children }) => {\n return (\n <ProviderLayout>\n <MessageSearchContexts.Fragment.Provider value={null}>{children}</MessageSearchContexts.Fragment.Provider>\n </ProviderLayout>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAE5C,OAAOC,cAAc,MAAM,oCAAoC;AAG/D,OAAO,MAAMC,qBAAgD,GAAG;EAC9DC,QAAQ,eAAEH,aAAa,CAAC,IAAI;AAC9B,CAAC;AAED,OAAO,MAAMI,6BAA8D,GAAGC,IAAA,IAAkB;EAAA,IAAjB;IAAEC;EAAS,CAAC,GAAAD,IAAA;EACzF,oBACEN,KAAA,CAAAQ,aAAA,CAACN,cAAc,qBACbF,KAAA,CAAAQ,aAAA,CAACL,qBAAqB,CAACC,QAAQ,CAACK,QAAQ;IAACC,KAAK,EAAE;EAAK,GAAEH,QAAQ,CAA2C,CAC3F;AAErB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type React from 'react';\nimport type { FlatListProps } from 'react-native';\n\nimport type { SendbirdBaseMessage, SendbirdGroupChannel, SendbirdMessageSearchQuery } from '@sendbird/uikit-utils';\n\nimport type { CommonComponent } from '../../types';\n\nexport type MessageSearchProps = {\n Fragment: {\n channel: SendbirdGroupChannel;\n onPressHeaderLeft: MessageSearchProps['Header']['onPressHeaderLeft'];\n onPressSearchResultItem: MessageSearchProps['List']['onPressSearchResultItem'];\n renderSearchResultItem?: MessageSearchProps['List']['renderSearchResultItem'];\n queryCreator?: () => SendbirdMessageSearchQuery;\n };\n Header: {\n keyword: string;\n onChangeKeyword: (value: string) => void;\n onPressHeaderLeft: () => void;\n onPressHeaderRight: () => void;\n };\n List: {\n channel: SendbirdGroupChannel;\n messages: SendbirdBaseMessage[];\n onPressSearchResultItem: (params: { channel: SendbirdGroupChannel; message: SendbirdBaseMessage }) => void;\n renderSearchResultItem: (props: {\n channel: SendbirdGroupChannel;\n message: SendbirdBaseMessage;\n onPress: () => void;\n }) => React.ReactElement | null;\n flatListProps?: Partial<FlatListProps<SendbirdBaseMessage>>;\n };\n StatusError: {\n onPressRetry: () => void;\n };\n};\n\n/**\n * Internal context for MessageSearch\n * For example, the developer can create a custom header\n * with getting data from the domain context\n * */\nexport type MessageSearchContextsType = {\n Fragment: React.Context<null>;\n};\nexport interface MessageSearchModule {\n Provider: CommonComponent;\n Header: CommonComponent<MessageSearchProps['Header']>;\n List: CommonComponent<MessageSearchProps['List']>;\n StatusEmpty: CommonComponent;\n StatusLoading: CommonComponent;\n StatusError: CommonComponent<MessageSearchProps['StatusError']>;\n}\n\nexport type MessageSearchFragment = CommonComponent<MessageSearchProps['Fragment']>;\n"],"mappings":""}
|