@planningcenter/chat-react-native 3.37.0-rc.2 → 3.37.0-rc.4
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/build/components/conversation/message.d.ts.map +1 -1
- package/build/components/conversation/message.js +3 -3
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/index.d.ts +2 -0
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +2 -0
- package/build/components/index.js.map +1 -1
- package/build/components/page/component_error_boundary.d.ts +4 -0
- package/build/components/page/component_error_boundary.d.ts.map +1 -0
- package/build/components/page/component_error_boundary.js +8 -0
- package/build/components/page/component_error_boundary.js.map +1 -0
- package/build/components/page/error_boundary.d.ts +13 -10
- package/build/components/page/error_boundary.d.ts.map +1 -1
- package/build/components/page/error_boundary.js +20 -90
- package/build/components/page/error_boundary.js.map +1 -1
- package/build/components/page/page_error_boundary.d.ts +4 -0
- package/build/components/page/page_error_boundary.d.ts.map +1 -0
- package/build/components/page/page_error_boundary.js +80 -0
- package/build/components/page/page_error_boundary.js.map +1 -0
- package/build/navigation/screenLayout.d.ts.map +1 -1
- package/build/navigation/screenLayout.js +5 -3
- package/build/navigation/screenLayout.js.map +1 -1
- package/build/utils/client/instrumented_fetch.d.ts +2 -0
- package/build/utils/client/instrumented_fetch.d.ts.map +1 -0
- package/build/utils/client/instrumented_fetch.js +64 -0
- package/build/utils/client/instrumented_fetch.js.map +1 -0
- package/build/utils/client/request_helpers.d.ts.map +1 -1
- package/build/utils/client/request_helpers.js +2 -1
- package/build/utils/client/request_helpers.js.map +1 -1
- package/build/utils/native_adapters/log.d.ts +1 -1
- package/build/utils/native_adapters/log.d.ts.map +1 -1
- package/build/utils/native_adapters/log.js.map +1 -1
- package/package.json +2 -2
- package/src/components/conversation/message.tsx +6 -4
- package/src/components/index.tsx +2 -0
- package/src/components/page/__tests__/component_error_boundary.test.tsx +46 -0
- package/src/components/page/__tests__/error_boundary.test.tsx +93 -0
- package/src/components/page/__tests__/page_error_boundary.test.tsx +77 -0
- package/src/components/page/component_error_boundary.tsx +13 -0
- package/src/components/page/error_boundary.tsx +34 -118
- package/src/components/page/page_error_boundary.tsx +112 -0
- package/src/navigation/screenLayout.tsx +6 -3
- package/src/utils/client/__tests__/instrumented_fetch.test.ts +84 -0
- package/src/utils/client/instrumented_fetch.ts +69 -0
- package/src/utils/client/request_helpers.ts +2 -1
- package/src/utils/native_adapters/log.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAoBxC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAiB7C;;GAEG;AACH,UAAU,YAAa,SAAQ,eAAe;IAC5C,4BAA4B,EAAE,OAAO,CAAA;IACrC,eAAe,EAAE,MAAM,CAAA;IACvB,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,wBAAgB,OAAO,CAAC,EACtB,4BAA4B,EAC5B,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,GAAG,OAAO,EACX,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAoBxC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAiB7C;;GAEG;AACH,UAAU,YAAa,SAAQ,eAAe;IAC5C,4BAA4B,EAAE,OAAO,CAAA;IACrC,eAAe,EAAE,MAAM,CAAA;IACvB,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,wBAAgB,OAAO,CAAC,EACtB,4BAA4B,EAC5B,eAAe,EACf,wBAAwB,EACxB,aAAa,EACb,GAAG,OAAO,EACX,EAAE,YAAY,qBA0Rd"}
|
|
@@ -14,7 +14,7 @@ import { pluralize } from '../../utils';
|
|
|
14
14
|
import { isNewMessage } from '../../utils/cache/messages_cache';
|
|
15
15
|
import { Haptic } from '../../utils/native_adapters';
|
|
16
16
|
import { CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL, MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH, platformFontWeightMedium, } from '../../utils/styles';
|
|
17
|
-
import
|
|
17
|
+
import { ComponentErrorBoundary } from '../page/component_error_boundary';
|
|
18
18
|
import { MessageAttachments } from './message_attachments';
|
|
19
19
|
import { MessageMarkdown } from './message_markdown';
|
|
20
20
|
import { MessageReadReceipts } from './message_read_receipts';
|
|
@@ -149,9 +149,9 @@ export function Message({ canDeleteNonAuthoredMessages, conversation_id, latestR
|
|
|
149
149
|
{isDeletedReplyRootMessage ? (<View style={styles.messageText}>
|
|
150
150
|
<Text style={styles.replyRootDeletedText}>{messageText}</Text>
|
|
151
151
|
</View>) : (<>
|
|
152
|
-
<
|
|
152
|
+
<ComponentErrorBoundary>
|
|
153
153
|
<MessageAttachments attachments={attachments} metaProps={metaProps} onMessageAttachmentLongPress={handleMessageAttachmentLongPress} onMessageLongPress={handleMessageLongPress}/>
|
|
154
|
-
</
|
|
154
|
+
</ComponentErrorBoundary>
|
|
155
155
|
{text && (<View style={styles.messageText}>
|
|
156
156
|
<MessageMarkdown text={text}/>
|
|
157
157
|
</View>)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/components/conversation/message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAEL,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,IAAI,GACL,MAA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;QACD,iBAAiB,EAAE;YACjB,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;SAC5C;QACD,WAAW,EAAE;YACX,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY;YAChD,GAAG,EAAE,CAAC;SACP;QACD,UAAU,EAAE;YACV,UAAU,EAAE,wBAAwB;SACrC;QACD,yBAAyB,EAAE;YACzB,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;SACP;QACD,cAAc,EAAE;YACd,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;SACP;QACD,SAAS,EAAE;YACT,KAAK,EAAE,MAAM,CAAC,eAAe;SAC9B;QACD,SAAS,EAAE;YACT,KAAK,EAAE,MAAM,CAAC,eAAe;SAC9B;QACD,oBAAoB,EAAE;YACpB,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACvC,SAAS,EAAE,QAAQ;SACpB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport { some } from 'lodash'\nimport React, { useEffect } from 'react'\nimport {\n AccessibilityActionEvent,\n Pressable,\n StyleSheet,\n useWindowDimensions,\n View,\n} from 'react-native'\nimport Animated from 'react-native-reanimated'\nimport { MessageReaction } from '../../components/conversation/message_reaction'\nimport { Avatar, Icon, Spinner, Text, TextButton, TextInlineButton } from '../../components/display'\nimport {\n useAnimatedMessageBackgroundColor,\n useInteractionGhostBackgroundColor,\n useTheme,\n} from '../../hooks'\nimport { useDeletingIds } from '../../hooks'\nimport { useConversationMessage } from '../../hooks/use_conversation_message'\nimport { useLiveRelativeTime } from '../../hooks/use_live_relative_time'\nimport { useMessageCreateOrUpdate } from '../../hooks/use_message_create_or_update'\nimport { MessageResource } from '../../types'\nimport { DenormalizedMessageAttachmentResource } from '../../types/resources/denormalized_attachment_resource'\nimport { ReactionCountResource } from '../../types/resources/reaction'\nimport { pluralize } from '../../utils'\nimport { isNewMessage } from '../../utils/cache/messages_cache'\nimport { Haptic } from '../../utils/native_adapters'\nimport {\n CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH,\n platformFontWeightMedium,\n} from '../../utils/styles'\nimport ErrorBoundary from '../page/error_boundary'\nimport { MessageAttachments } from './message_attachments'\nimport { MessageMarkdown } from './message_markdown'\nimport { MessageReadReceipts } from './message_read_receipts'\nimport { TheirReplyConnector, MyReplyConnector, AVATAR_CONNECTOR_SPACING } from './reply_connectors'\n\n/** Message\n * Component for display of a message within a conversation list\n */\ninterface MessageProps extends MessageResource {\n canDeleteNonAuthoredMessages: boolean\n conversation_id: number\n latestReadMessageSortKey?: string\n inReplyScreen?: boolean\n}\n\nexport function Message({\n canDeleteNonAuthoredMessages,\n conversation_id,\n latestReadMessageSortKey,\n inReplyScreen,\n ...message\n}: MessageProps) {\n const { text, reactionCounts, pending, error, attachments, author } = message\n const deletingMessageIds = useDeletingIds('deleteMessage')\n const isDeleting = deletingMessageIds.has(message.id)\n const styles = useMessageStyles(message.mine, isDeleting)\n const navigation = useNavigation()\n const { colors } = useTheme()\n const hasReactions = reactionCounts.length > 0\n const [showMessageMetaToggle, setShowMessageMetaToggle] = React.useState(false)\n const showMessageMeta =\n showMessageMetaToggle || message.myLatestInConversation || !!pending || !!error || false\n const timestamp = useLiveRelativeTime(message.createdAt)\n const wasEdited = Boolean(message.textEditedAt)\n const isPersisted = !isNewMessage(message)\n const [temporarilyHidePendingState, setTemporarilyHidePendingState] = React.useState(true)\n const [messageBubbleHeight, setMessageBubbleHeight] = React.useState(0)\n const { animatedBackgroundColor, handleMessagePressIn, handleMessagePressOut } =\n useAnimatedMessageBackgroundColor()\n const { message: replyRootMessage } = useConversationMessage({\n conversation_id,\n messageId: message.replyRootId || '',\n enabled: !!message.replyRootId,\n })\n\n const metaProps = {\n authorName: author.name,\n createdAt: message.createdAt,\n }\n\n const renderAuthor = (!message.mine && message.renderAuthor) || false\n const showReplyCountButton = !inReplyScreen && message.replyRootId === message.id\n const isReplyRootMessage = message.replyRootId === message.id\n const isDeletedReplyRootMessage = isReplyRootMessage && !!message.deletedAt\n const replyToReplyRootMessage = !isReplyRootMessage && !!message.replyRootId\n\n const replyCountText = pluralize(message.replyCount, 'reply')\n const messagePendingLabel = isPersisted ? 'Saving' : 'Sending'\n const replyRootAuthorName = message.replyRootId ? replyRootMessage?.author.name : author.name\n const messageText = isDeletedReplyRootMessage ? 'Message deleted' : text\n\n const messageBottomMargin =\n message.lastInGroup || message.nextIsReplyShadowMessage\n ? 16\n : hasReactions || showMessageMeta || showReplyCountButton\n ? 8\n : 4\n\n const messageIsReplyLabel = replyToReplyRootMessage ? 'Reply' : ''\n const attachmentLabel = some(attachments) ? pluralize(attachments.length, 'attachment') : ''\n const replyCountLabel = isReplyRootMessage ? replyCountText : ''\n const accessibilityLabel = `${author?.name || ''} ${messageIsReplyLabel} ${attachmentLabel} ${messageText || ''} ${timestamp} ${replyCountLabel}`\n\n useEffect(() => {\n if (pending) {\n const timer = setTimeout(() => {\n setTemporarilyHidePendingState(false)\n }, 2000)\n return () => clearTimeout(timer)\n }\n return () => {}\n }, [pending])\n\n const retryFailedSaveMutation = useMessageCreateOrUpdate({\n conversationId: conversation_id,\n message,\n })\n\n const handleRetry = () => {\n if (text && error) {\n retryFailedSaveMutation.mutateAsync({\n text,\n attachments: message.attachmentsForCreate,\n })\n }\n }\n\n const handleMessagePress = () => {\n setShowMessageMetaToggle(!showMessageMetaToggle)\n }\n\n const handleMessageLongPress = () => {\n if (!isPersisted) return\n\n Haptic.impactLight()\n navigation.navigate('MessageActions', {\n message_id: message.id,\n conversation_id,\n canDeleteNonAuthoredMessages,\n inReplyScreen,\n reply_root_author_name: replyRootAuthorName,\n })\n }\n\n const handleReactionLongPress = (reaction: ReactionCountResource) => {\n Haptic.impactLight()\n navigation.navigate('Reactions', {\n message_id: message.id,\n conversation_id,\n reaction_value: reaction.value,\n })\n }\n\n const handleMessageAttachmentLongPress = (attachment: DenormalizedMessageAttachmentResource) => {\n Haptic.impactLight()\n navigation.navigate('AttachmentActions', {\n attachmentId: attachment?.id,\n attachmentContentType: attachment?.attributes.contentType,\n attachmentUrl: attachment?.attributes.url,\n conversation_id,\n canDeleteNonAuthoredMessages,\n myMessage: message.mine,\n })\n }\n\n const handleNavigateToReplyPress = () => {\n navigation.navigate('ConversationReply', {\n conversation_id,\n reply_root_id: message.id,\n reply_root_author_name: author.name,\n })\n }\n\n const accessibilityActions = [\n {\n name: 'navigateToReplies',\n label: 'Navigate to replies',\n },\n ]\n\n const handleAccessibilityAction = (event: AccessibilityActionEvent) => {\n if (event.nativeEvent.actionName === 'navigateToReplies') {\n handleNavigateToReplyPress()\n }\n }\n\n return (\n <Pressable\n onLongPress={isDeleting ? undefined : handleMessageLongPress}\n onPress={isDeleting ? undefined : handleMessagePress}\n onPressIn={isDeleting ? undefined : handleMessagePressIn}\n onPressOut={isDeleting ? undefined : handleMessagePressOut}\n android_ripple={{ color: colors.androidRippleNeutral, borderless: false, foreground: true }}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint=\"Long press to view message actions like reacting and copying.\"\n accessibilityActions={isReplyRootMessage ? accessibilityActions : undefined}\n onAccessibilityAction={isReplyRootMessage ? handleAccessibilityAction : undefined}\n disabled={isDeletedReplyRootMessage || isDeleting}\n >\n <Animated.View style={[styles.message, animatedBackgroundColor]}>\n {!message.mine && (\n <View>\n {renderAuthor ? (\n <Avatar\n size={'md'}\n sourceUri={author.avatar}\n style={styles.avatar}\n maxFontSizeMultiplier={1}\n minFontSizeMultiplier={1}\n fallbackIconName={isDeletedReplyRootMessage ? 'publishing.trash' : 'general.person'}\n showFallback={isDeletedReplyRootMessage}\n />\n ) : (\n <View style={styles.avatarPlaceholder} />\n )}\n <TheirReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n </View>\n )}\n <View style={[styles.messageContent, { marginBottom: messageBottomMargin }]}>\n {renderAuthor && !isDeletedReplyRootMessage && (\n <Text variant=\"footnote\" style={styles.authorName}>\n {author.name}\n </Text>\n )}\n <View\n style={styles.messageBubble}\n onLayout={e => setMessageBubbleHeight(e.nativeEvent.layout.height)}\n >\n {isDeletedReplyRootMessage ? (\n <View style={styles.messageText}>\n <Text style={styles.replyRootDeletedText}>{messageText}</Text>\n </View>\n ) : (\n <>\n <ErrorBoundary>\n <MessageAttachments\n attachments={attachments}\n metaProps={metaProps}\n onMessageAttachmentLongPress={handleMessageAttachmentLongPress}\n onMessageLongPress={handleMessageLongPress}\n />\n </ErrorBoundary>\n {text && (\n <View style={styles.messageText}>\n <MessageMarkdown text={text} />\n </View>\n )}\n </>\n )}\n </View>\n {showReplyCountButton && (\n <TextButton\n variant=\"footnote\"\n onPress={handleNavigateToReplyPress}\n style={styles.messageReplyCount}\n accessibilityHint=\"Navigates to reply screen for this message\"\n accessibilityRole=\"link\"\n >\n {replyCountText}\n </TextButton>\n )}\n {hasReactions && !isDeletedReplyRootMessage && (\n <View style={styles.messageReactions}>\n {reactionCounts.map(reaction => (\n <MessageReaction\n key={reaction.value}\n reaction={reaction}\n onLongPress={handleReactionLongPress}\n message={message}\n conversationId={conversation_id}\n />\n ))}\n </View>\n )}\n {showMessageMeta && !isDeletedReplyRootMessage && (\n <View style={styles.messageMeta}>\n {message.mine && !pending && !error && (\n <MessageReadReceipts\n message={message}\n latestReadMessageSortKey={latestReadMessageSortKey}\n />\n )}\n {error ? (\n <View style={styles.errorContainer}>\n {retryFailedSaveMutation.isPending ? (\n <Spinner size={12} />\n ) : (\n <Icon name=\"general.exclamationTriangle\" size={12} style={styles.errorIcon} />\n )}\n <Text variant=\"footnote\" style={styles.errorText}>\n Failed to {isPersisted ? 'edit' : 'send'} |{' '}\n <TextInlineButton\n onPress={handleRetry}\n variant=\"footnote\"\n appearance=\"danger\"\n disabled={retryFailedSaveMutation.isPending}\n >\n Try again\n </TextInlineButton>\n </Text>\n </View>\n ) : pending && (!temporarilyHidePendingState || isPersisted) ? (\n <View style={styles.pendingIndicatorContainer}>\n <Icon\n name=\"general.outlinedClock\"\n size={12}\n color={colors.iconColorDefaultSecondary}\n />\n <Text variant=\"footnote\">{messagePendingLabel}</Text>\n </View>\n ) : isPersisted ? (\n <Text variant=\"footnote\">{timestamp}</Text>\n ) : null}\n {!pending && !error && wasEdited && (\n <Text variant=\"footnote\">\n |{' '}\n <Text variant=\"footnote\" style={styles.editedText}>\n Edited\n </Text>\n </Text>\n )}\n </View>\n )}\n </View>\n {message.mine && (\n <MyReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n )}\n </Animated.View>\n </Pressable>\n )\n}\n\nconst useMessageStyles = (mine: boolean, isDeleting: boolean) => {\n const { colors } = useTheme()\n const myMessageBackgroundColor = useInteractionGhostBackgroundColor()\n const { width } = useWindowDimensions()\n const tabletWidth = width >= 744 // Smallest iPad Mini's width\n\n const messageBubbleBackgroundColor = mine ? myMessageBackgroundColor : colors.fillColorNeutral070\n\n return StyleSheet.create({\n message: {\n gap: 8,\n flexDirection: mine ? 'row-reverse' : 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n opacity: isDeleting ? 0.5 : 1,\n },\n messageContent: {\n flex: 1,\n gap: 4,\n },\n avatar: {\n marginBottom: AVATAR_CONNECTOR_SPACING,\n },\n avatarPlaceholder: {\n width: MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH, // Same width as avatar\n },\n authorName: {\n fontWeight: platformFontWeightMedium,\n },\n messageBubble: {\n backgroundColor: messageBubbleBackgroundColor,\n borderRadius: 8,\n maxWidth: tabletWidth ? 360 : '80%',\n alignSelf: mine ? 'flex-end' : 'flex-start',\n },\n messageText: {\n paddingVertical: 6,\n paddingHorizontal: 8,\n },\n messageReactions: {\n flexDirection: 'row',\n gap: 4,\n justifyContent: mine ? 'flex-end' : 'flex-start',\n },\n messageReplyCount: {\n alignSelf: mine ? 'flex-end' : 'flex-start',\n },\n messageMeta: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: mine ? 'flex-end' : 'flex-start',\n gap: 4,\n },\n editedText: {\n fontWeight: platformFontWeightMedium,\n },\n pendingIndicatorContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n errorContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n errorIcon: {\n color: colors.statusErrorIcon,\n },\n errorText: {\n color: colors.statusErrorText,\n },\n replyRootDeletedText: {\n color: colors.textColorDefaultSecondary,\n fontStyle: 'italic',\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/components/conversation/message.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAEL,SAAS,EACT,UAAU,EACV,mBAAmB,EACnB,IAAI,GACL,MAAM,cAAc,CAAA;AACrB,OAAO,QAAQ,MAAM,yBAAyB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AACpG,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,QAAQ,GACT,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAC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Aa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;SACP;QACD,SAAS,EAAE;YACT,KAAK,EAAE,MAAM,CAAC,eAAe;SAC9B;QACD,SAAS,EAAE;YACT,KAAK,EAAE,MAAM,CAAC,eAAe;SAC9B;QACD,oBAAoB,EAAE;YACpB,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACvC,SAAS,EAAE,QAAQ;SACpB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport { some } from 'lodash'\nimport React, { useEffect } from 'react'\nimport {\n AccessibilityActionEvent,\n Pressable,\n StyleSheet,\n useWindowDimensions,\n View,\n} from 'react-native'\nimport Animated from 'react-native-reanimated'\nimport { MessageReaction } from '../../components/conversation/message_reaction'\nimport { Avatar, Icon, Spinner, Text, TextButton, TextInlineButton } from '../../components/display'\nimport {\n useAnimatedMessageBackgroundColor,\n useInteractionGhostBackgroundColor,\n useTheme,\n} from '../../hooks'\nimport { useDeletingIds } from '../../hooks'\nimport { useConversationMessage } from '../../hooks/use_conversation_message'\nimport { useLiveRelativeTime } from '../../hooks/use_live_relative_time'\nimport { useMessageCreateOrUpdate } from '../../hooks/use_message_create_or_update'\nimport { MessageResource } from '../../types'\nimport { DenormalizedMessageAttachmentResource } from '../../types/resources/denormalized_attachment_resource'\nimport { ReactionCountResource } from '../../types/resources/reaction'\nimport { pluralize } from '../../utils'\nimport { isNewMessage } from '../../utils/cache/messages_cache'\nimport { Haptic } from '../../utils/native_adapters'\nimport {\n CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH,\n platformFontWeightMedium,\n} from '../../utils/styles'\nimport { ComponentErrorBoundary } from '../page/component_error_boundary'\nimport { MessageAttachments } from './message_attachments'\nimport { MessageMarkdown } from './message_markdown'\nimport { MessageReadReceipts } from './message_read_receipts'\nimport { TheirReplyConnector, MyReplyConnector, AVATAR_CONNECTOR_SPACING } from './reply_connectors'\n\n/** Message\n * Component for display of a message within a conversation list\n */\ninterface MessageProps extends MessageResource {\n canDeleteNonAuthoredMessages: boolean\n conversation_id: number\n latestReadMessageSortKey?: string\n inReplyScreen?: boolean\n}\n\nexport function Message({\n canDeleteNonAuthoredMessages,\n conversation_id,\n latestReadMessageSortKey,\n inReplyScreen,\n ...message\n}: MessageProps) {\n const { text, reactionCounts, pending, error, attachments, author } = message\n const deletingMessageIds = useDeletingIds('deleteMessage')\n const isDeleting = deletingMessageIds.has(message.id)\n const styles = useMessageStyles(message.mine, isDeleting)\n const navigation = useNavigation()\n const { colors } = useTheme()\n const hasReactions = reactionCounts.length > 0\n const [showMessageMetaToggle, setShowMessageMetaToggle] = React.useState(false)\n const showMessageMeta =\n showMessageMetaToggle || message.myLatestInConversation || !!pending || !!error || false\n const timestamp = useLiveRelativeTime(message.createdAt)\n const wasEdited = Boolean(message.textEditedAt)\n const isPersisted = !isNewMessage(message)\n const [temporarilyHidePendingState, setTemporarilyHidePendingState] = React.useState(true)\n const [messageBubbleHeight, setMessageBubbleHeight] = React.useState(0)\n const { animatedBackgroundColor, handleMessagePressIn, handleMessagePressOut } =\n useAnimatedMessageBackgroundColor()\n const { message: replyRootMessage } = useConversationMessage({\n conversation_id,\n messageId: message.replyRootId || '',\n enabled: !!message.replyRootId,\n })\n\n const metaProps = {\n authorName: author.name,\n createdAt: message.createdAt,\n }\n\n const renderAuthor = (!message.mine && message.renderAuthor) || false\n const showReplyCountButton = !inReplyScreen && message.replyRootId === message.id\n const isReplyRootMessage = message.replyRootId === message.id\n const isDeletedReplyRootMessage = isReplyRootMessage && !!message.deletedAt\n const replyToReplyRootMessage = !isReplyRootMessage && !!message.replyRootId\n\n const replyCountText = pluralize(message.replyCount, 'reply')\n const messagePendingLabel = isPersisted ? 'Saving' : 'Sending'\n const replyRootAuthorName = message.replyRootId ? replyRootMessage?.author.name : author.name\n const messageText = isDeletedReplyRootMessage ? 'Message deleted' : text\n\n const messageBottomMargin =\n message.lastInGroup || message.nextIsReplyShadowMessage\n ? 16\n : hasReactions || showMessageMeta || showReplyCountButton\n ? 8\n : 4\n\n const messageIsReplyLabel = replyToReplyRootMessage ? 'Reply' : ''\n const attachmentLabel = some(attachments) ? pluralize(attachments.length, 'attachment') : ''\n const replyCountLabel = isReplyRootMessage ? replyCountText : ''\n const accessibilityLabel = `${author?.name || ''} ${messageIsReplyLabel} ${attachmentLabel} ${\n messageText || ''\n } ${timestamp} ${replyCountLabel}`\n\n useEffect(() => {\n if (pending) {\n const timer = setTimeout(() => {\n setTemporarilyHidePendingState(false)\n }, 2000)\n return () => clearTimeout(timer)\n }\n return () => {}\n }, [pending])\n\n const retryFailedSaveMutation = useMessageCreateOrUpdate({\n conversationId: conversation_id,\n message,\n })\n\n const handleRetry = () => {\n if (text && error) {\n retryFailedSaveMutation.mutateAsync({\n text,\n attachments: message.attachmentsForCreate,\n })\n }\n }\n\n const handleMessagePress = () => {\n setShowMessageMetaToggle(!showMessageMetaToggle)\n }\n\n const handleMessageLongPress = () => {\n if (!isPersisted) return\n\n Haptic.impactLight()\n navigation.navigate('MessageActions', {\n message_id: message.id,\n conversation_id,\n canDeleteNonAuthoredMessages,\n inReplyScreen,\n reply_root_author_name: replyRootAuthorName,\n })\n }\n\n const handleReactionLongPress = (reaction: ReactionCountResource) => {\n Haptic.impactLight()\n navigation.navigate('Reactions', {\n message_id: message.id,\n conversation_id,\n reaction_value: reaction.value,\n })\n }\n\n const handleMessageAttachmentLongPress = (attachment: DenormalizedMessageAttachmentResource) => {\n Haptic.impactLight()\n navigation.navigate('AttachmentActions', {\n attachmentId: attachment?.id,\n attachmentContentType: attachment?.attributes.contentType,\n attachmentUrl: attachment?.attributes.url,\n conversation_id,\n canDeleteNonAuthoredMessages,\n myMessage: message.mine,\n })\n }\n\n const handleNavigateToReplyPress = () => {\n navigation.navigate('ConversationReply', {\n conversation_id,\n reply_root_id: message.id,\n reply_root_author_name: author.name,\n })\n }\n\n const accessibilityActions = [\n {\n name: 'navigateToReplies',\n label: 'Navigate to replies',\n },\n ]\n\n const handleAccessibilityAction = (event: AccessibilityActionEvent) => {\n if (event.nativeEvent.actionName === 'navigateToReplies') {\n handleNavigateToReplyPress()\n }\n }\n\n return (\n <Pressable\n onLongPress={isDeleting ? undefined : handleMessageLongPress}\n onPress={isDeleting ? undefined : handleMessagePress}\n onPressIn={isDeleting ? undefined : handleMessagePressIn}\n onPressOut={isDeleting ? undefined : handleMessagePressOut}\n android_ripple={{ color: colors.androidRippleNeutral, borderless: false, foreground: true }}\n accessibilityRole=\"button\"\n accessibilityLabel={accessibilityLabel}\n accessibilityHint=\"Long press to view message actions like reacting and copying.\"\n accessibilityActions={isReplyRootMessage ? accessibilityActions : undefined}\n onAccessibilityAction={isReplyRootMessage ? handleAccessibilityAction : undefined}\n disabled={isDeletedReplyRootMessage || isDeleting}\n >\n <Animated.View style={[styles.message, animatedBackgroundColor]}>\n {!message.mine && (\n <View>\n {renderAuthor ? (\n <Avatar\n size={'md'}\n sourceUri={author.avatar}\n style={styles.avatar}\n maxFontSizeMultiplier={1}\n minFontSizeMultiplier={1}\n fallbackIconName={isDeletedReplyRootMessage ? 'publishing.trash' : 'general.person'}\n showFallback={isDeletedReplyRootMessage}\n />\n ) : (\n <View style={styles.avatarPlaceholder} />\n )}\n <TheirReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n </View>\n )}\n <View style={[styles.messageContent, { marginBottom: messageBottomMargin }]}>\n {renderAuthor && !isDeletedReplyRootMessage && (\n <Text variant=\"footnote\" style={styles.authorName}>\n {author.name}\n </Text>\n )}\n <View\n style={styles.messageBubble}\n onLayout={e => setMessageBubbleHeight(e.nativeEvent.layout.height)}\n >\n {isDeletedReplyRootMessage ? (\n <View style={styles.messageText}>\n <Text style={styles.replyRootDeletedText}>{messageText}</Text>\n </View>\n ) : (\n <>\n <ComponentErrorBoundary>\n <MessageAttachments\n attachments={attachments}\n metaProps={metaProps}\n onMessageAttachmentLongPress={handleMessageAttachmentLongPress}\n onMessageLongPress={handleMessageLongPress}\n />\n </ComponentErrorBoundary>\n {text && (\n <View style={styles.messageText}>\n <MessageMarkdown text={text} />\n </View>\n )}\n </>\n )}\n </View>\n {showReplyCountButton && (\n <TextButton\n variant=\"footnote\"\n onPress={handleNavigateToReplyPress}\n style={styles.messageReplyCount}\n accessibilityHint=\"Navigates to reply screen for this message\"\n accessibilityRole=\"link\"\n >\n {replyCountText}\n </TextButton>\n )}\n {hasReactions && !isDeletedReplyRootMessage && (\n <View style={styles.messageReactions}>\n {reactionCounts.map(reaction => (\n <MessageReaction\n key={reaction.value}\n reaction={reaction}\n onLongPress={handleReactionLongPress}\n message={message}\n conversationId={conversation_id}\n />\n ))}\n </View>\n )}\n {showMessageMeta && !isDeletedReplyRootMessage && (\n <View style={styles.messageMeta}>\n {message.mine && !pending && !error && (\n <MessageReadReceipts\n message={message}\n latestReadMessageSortKey={latestReadMessageSortKey}\n />\n )}\n {error ? (\n <View style={styles.errorContainer}>\n {retryFailedSaveMutation.isPending ? (\n <Spinner size={12} />\n ) : (\n <Icon name=\"general.exclamationTriangle\" size={12} style={styles.errorIcon} />\n )}\n <Text variant=\"footnote\" style={styles.errorText}>\n Failed to {isPersisted ? 'edit' : 'send'} |{' '}\n <TextInlineButton\n onPress={handleRetry}\n variant=\"footnote\"\n appearance=\"danger\"\n disabled={retryFailedSaveMutation.isPending}\n >\n Try again\n </TextInlineButton>\n </Text>\n </View>\n ) : pending && (!temporarilyHidePendingState || isPersisted) ? (\n <View style={styles.pendingIndicatorContainer}>\n <Icon\n name=\"general.outlinedClock\"\n size={12}\n color={colors.iconColorDefaultSecondary}\n />\n <Text variant=\"footnote\">{messagePendingLabel}</Text>\n </View>\n ) : isPersisted ? (\n <Text variant=\"footnote\">{timestamp}</Text>\n ) : null}\n {!pending && !error && wasEdited && (\n <Text variant=\"footnote\">\n |{' '}\n <Text variant=\"footnote\" style={styles.editedText}>\n Edited\n </Text>\n </Text>\n )}\n </View>\n )}\n </View>\n {message.mine && (\n <MyReplyConnector message={message} messageBubbleHeight={messageBubbleHeight} />\n )}\n </Animated.View>\n </Pressable>\n )\n}\n\nconst useMessageStyles = (mine: boolean, isDeleting: boolean) => {\n const { colors } = useTheme()\n const myMessageBackgroundColor = useInteractionGhostBackgroundColor()\n const { width } = useWindowDimensions()\n const tabletWidth = width >= 744 // Smallest iPad Mini's width\n\n const messageBubbleBackgroundColor = mine ? myMessageBackgroundColor : colors.fillColorNeutral070\n\n return StyleSheet.create({\n message: {\n gap: 8,\n flexDirection: mine ? 'row-reverse' : 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n opacity: isDeleting ? 0.5 : 1,\n },\n messageContent: {\n flex: 1,\n gap: 4,\n },\n avatar: {\n marginBottom: AVATAR_CONNECTOR_SPACING,\n },\n avatarPlaceholder: {\n width: MESSAGE_AUTHOR_AVATAR_COLUMN_WIDTH, // Same width as avatar\n },\n authorName: {\n fontWeight: platformFontWeightMedium,\n },\n messageBubble: {\n backgroundColor: messageBubbleBackgroundColor,\n borderRadius: 8,\n maxWidth: tabletWidth ? 360 : '80%',\n alignSelf: mine ? 'flex-end' : 'flex-start',\n },\n messageText: {\n paddingVertical: 6,\n paddingHorizontal: 8,\n },\n messageReactions: {\n flexDirection: 'row',\n gap: 4,\n justifyContent: mine ? 'flex-end' : 'flex-start',\n },\n messageReplyCount: {\n alignSelf: mine ? 'flex-end' : 'flex-start',\n },\n messageMeta: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: mine ? 'flex-end' : 'flex-start',\n gap: 4,\n },\n editedText: {\n fontWeight: platformFontWeightMedium,\n },\n pendingIndicatorContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n errorContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4,\n },\n errorIcon: {\n color: colors.statusErrorIcon,\n },\n errorText: {\n color: colors.statusErrorText,\n },\n replyRootDeletedText: {\n color: colors.textColorDefaultSecondary,\n fontStyle: 'italic',\n },\n })\n}\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './conversations/conversations';
|
|
2
|
+
export * from './page/component_error_boundary';
|
|
2
3
|
export * from './page/error_boundary';
|
|
4
|
+
export * from './page/page_error_boundary';
|
|
3
5
|
export * from './display';
|
|
4
6
|
export * from './group_conversation_list';
|
|
5
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,WAAW,CAAA;AACzB,cAAc,2BAA2B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,WAAW,CAAA;AACzB,cAAc,2BAA2B,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './conversations/conversations';
|
|
2
|
+
export * from './page/component_error_boundary';
|
|
2
3
|
export * from './page/error_boundary';
|
|
4
|
+
export * from './page/page_error_boundary';
|
|
3
5
|
export * from './display';
|
|
4
6
|
export * from './group_conversation_list';
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uBAAuB,CAAA;AACrC,cAAc,WAAW,CAAA;AACzB,cAAc,2BAA2B,CAAA","sourcesContent":["export * from './conversations/conversations'\nexport * from './page/error_boundary'\nexport * from './display'\nexport * from './group_conversation_list'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.tsx"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,WAAW,CAAA;AACzB,cAAc,2BAA2B,CAAA","sourcesContent":["export * from './conversations/conversations'\nexport * from './page/component_error_boundary'\nexport * from './page/error_boundary'\nexport * from './page/page_error_boundary'\nexport * from './display'\nexport * from './group_conversation_list'\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { ErrorBoundaryProps } from './error_boundary';
|
|
3
|
+
export declare function ComponentErrorBoundary({ children, ...props }: PropsWithChildren<ErrorBoundaryProps>): React.JSX.Element;
|
|
4
|
+
//# sourceMappingURL=component_error_boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component_error_boundary.d.ts","sourceRoot":"","sources":["../../../src/components/page/component_error_boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,EAAiB,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAEpE,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,qBAMvC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ErrorBoundary } from './error_boundary';
|
|
3
|
+
export function ComponentErrorBoundary({ children, ...props }) {
|
|
4
|
+
return (<ErrorBoundary scope="component" fallback={null} {...props}>
|
|
5
|
+
{children}
|
|
6
|
+
</ErrorBoundary>);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=component_error_boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component_error_boundary.js","sourceRoot":"","sources":["../../../src/components/page/component_error_boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,aAAa,EAAsB,MAAM,kBAAkB,CAAA;AAEpE,MAAM,UAAU,sBAAsB,CAAC,EACrC,QAAQ,EACR,GAAG,KAAK,EAC8B;IACtC,OAAO,CACL,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CACzD;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,aAAa,CAAC,CACjB,CAAA;AACH,CAAC","sourcesContent":["import React, { PropsWithChildren } from 'react'\nimport { ErrorBoundary, ErrorBoundaryProps } from './error_boundary'\n\nexport function ComponentErrorBoundary({\n children,\n ...props\n}: PropsWithChildren<ErrorBoundaryProps>) {\n return (\n <ErrorBoundary scope=\"component\" fallback={null} {...props}>\n {children}\n </ErrorBoundary>\n )\n}\n"]}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ReportErrorScope } from '../../utils/native_adapters/log';
|
|
3
|
+
export type ErrorBoundaryFallback = React.ReactNode | ((error: Error, reset: () => void) => React.ReactNode);
|
|
4
|
+
export type ErrorBoundaryProps = {
|
|
5
|
+
scope?: ReportErrorScope;
|
|
6
|
+
screenName?: string;
|
|
7
|
+
fallback?: ErrorBoundaryFallback;
|
|
8
|
+
};
|
|
3
9
|
type ErrorBoundaryState = {
|
|
4
|
-
error:
|
|
5
|
-
unsubscriber: () => void;
|
|
10
|
+
error: Error | null;
|
|
6
11
|
};
|
|
7
|
-
declare class ErrorBoundary extends React.Component<PropsWithChildren<{
|
|
8
|
-
onReset?: () => void;
|
|
9
|
-
}>> {
|
|
12
|
+
export declare class ErrorBoundary extends React.Component<PropsWithChildren<ErrorBoundaryProps>, ErrorBoundaryState> {
|
|
10
13
|
state: ErrorBoundaryState;
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
static getDerivedStateFromError(error: Error): ErrorBoundaryState;
|
|
15
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
13
16
|
handleReset: () => void;
|
|
14
|
-
render():
|
|
17
|
+
render(): React.ReactNode;
|
|
15
18
|
}
|
|
16
|
-
export
|
|
19
|
+
export {};
|
|
17
20
|
//# sourceMappingURL=error_boundary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error_boundary.d.ts","sourceRoot":"","sources":["../../../src/components/page/error_boundary.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error_boundary.d.ts","sourceRoot":"","sources":["../../../src/components/page/error_boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAA;AAGlE,MAAM,MAAM,qBAAqB,GAC7B,KAAK,CAAC,SAAS,GACf,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,IAAI,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;AAE1D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAAC,EAAE,gBAAgB,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,qBAAqB,CAAA;CACjC,CAAA;AAED,KAAK,kBAAkB,GAAG;IACxB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CACpB,CAAA;AAED,qBAAa,aAAc,SAAQ,KAAK,CAAC,SAAS,CAChD,iBAAiB,CAAC,kBAAkB,CAAC,EACrC,kBAAkB,CACnB;IACC,KAAK,EAAE,kBAAkB,CAAkB;IAE3C,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,kBAAkB;IAIjE,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS;IAW1D,WAAW,aAEV;IAED,MAAM;CAQP"}
|
|
@@ -1,101 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
4
|
-
import { onAuthRefresh } from '../../utils/auth_events';
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Log } from '../../utils/native_adapters/configuration';
|
|
5
3
|
import { ResponseError } from '../../utils/response_error';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
error
|
|
10
|
-
unsubscriber: () => { },
|
|
11
|
-
};
|
|
12
|
-
componentDidCatch(error) {
|
|
13
|
-
this.handleError(error);
|
|
4
|
+
export class ErrorBoundary extends React.Component {
|
|
5
|
+
state = { error: null };
|
|
6
|
+
static getDerivedStateFromError(error) {
|
|
7
|
+
return { error };
|
|
14
8
|
}
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
componentDidCatch(error, errorInfo) {
|
|
10
|
+
if (error instanceof ResponseError)
|
|
11
|
+
return;
|
|
12
|
+
Log.reportError(error, {
|
|
13
|
+
componentStack: errorInfo.componentStack ?? undefined,
|
|
14
|
+
scope: this.props.scope,
|
|
15
|
+
screenName: this.props.screenName,
|
|
16
|
+
tags: { team: 'chat', package: 'chat-react-native' },
|
|
17
|
+
});
|
|
17
18
|
}
|
|
18
19
|
handleReset = () => {
|
|
19
|
-
this.props.onReset?.();
|
|
20
20
|
this.setState({ error: null });
|
|
21
21
|
};
|
|
22
22
|
render() {
|
|
23
|
-
if (this.state.error)
|
|
24
|
-
return <ErrorView error={this.state.error} onReset={this.handleReset}/>;
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
23
|
+
if (!this.state.error)
|
|
27
24
|
return this.props.children;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
function
|
|
32
|
-
const { reset } = useQueryErrorResetBoundary();
|
|
33
|
-
const handleReset = useCallback(() => {
|
|
34
|
-
reset();
|
|
35
|
-
onReset();
|
|
36
|
-
}, [reset, onReset]);
|
|
37
|
-
useEffect(() => handleReset, [handleReset]);
|
|
38
|
-
if (error instanceof ResponseError) {
|
|
39
|
-
return <ResponseErrorView response={error.response} onReset={handleReset}/>;
|
|
40
|
-
}
|
|
41
|
-
if (isNetworkError(error)) {
|
|
42
|
-
return (<ErrorContent heading={'Problem connecting!'} body={'Check your internet connection and try again.'}/>);
|
|
25
|
+
const { fallback } = this.props;
|
|
26
|
+
if (fallback === undefined)
|
|
27
|
+
return null;
|
|
28
|
+
return typeof fallback === 'function' ? fallback(this.state.error, this.handleReset) : fallback;
|
|
43
29
|
}
|
|
44
|
-
return <ErrorContent heading={'Oops!'} body={'Something unexpected happened.'}/>;
|
|
45
|
-
}
|
|
46
|
-
function isNetworkError(error) {
|
|
47
|
-
const isError = error instanceof Error;
|
|
48
|
-
const networkFailedMessages = [
|
|
49
|
-
'Network request failed',
|
|
50
|
-
'Network request timed out',
|
|
51
|
-
'Failed to fetch',
|
|
52
|
-
];
|
|
53
|
-
if (!isError)
|
|
54
|
-
return false;
|
|
55
|
-
return new RegExp(networkFailedMessages.join('|'), 'i').test(error.message);
|
|
56
|
-
}
|
|
57
|
-
function ResponseErrorView({ response, onReset }) {
|
|
58
|
-
const { status } = response;
|
|
59
|
-
const heading = useMemo(() => {
|
|
60
|
-
switch (status) {
|
|
61
|
-
case 403:
|
|
62
|
-
return 'Permission required';
|
|
63
|
-
case 404:
|
|
64
|
-
return 'Content not found';
|
|
65
|
-
default:
|
|
66
|
-
return 'Oops!';
|
|
67
|
-
}
|
|
68
|
-
}, [status]);
|
|
69
|
-
const body = useMemo(() => {
|
|
70
|
-
switch (status) {
|
|
71
|
-
case 403:
|
|
72
|
-
return 'Contact your administrator for access.';
|
|
73
|
-
case 404:
|
|
74
|
-
return 'If you believe something should be here, please reach out to your administrator.';
|
|
75
|
-
default:
|
|
76
|
-
return 'Something unexpected happened.';
|
|
77
|
-
}
|
|
78
|
-
}, [status]);
|
|
79
|
-
useEffect(() => {
|
|
80
|
-
if (status !== 401)
|
|
81
|
-
return;
|
|
82
|
-
return onAuthRefresh(onReset);
|
|
83
|
-
}, [status, onReset]);
|
|
84
|
-
return <ErrorContent heading={heading} body={body}/>;
|
|
85
|
-
}
|
|
86
|
-
function ErrorContent({ heading, body }) {
|
|
87
|
-
const navigation = useNavigation();
|
|
88
|
-
return (<BlankState.Root>
|
|
89
|
-
<BlankState.Imagery name="people.noTextMessage"/>
|
|
90
|
-
<BlankState.Content>
|
|
91
|
-
<BlankState.Heading>{heading}</BlankState.Heading>
|
|
92
|
-
<BlankState.Text>{body}</BlankState.Text>
|
|
93
|
-
</BlankState.Content>
|
|
94
|
-
<BlankState.Button title="Go back" onPress={navigation.goBack} size="md" accessibilityRole="link"/>
|
|
95
|
-
<BlankState.TextButton onPress={() => navigation.navigate('BugReport')}>
|
|
96
|
-
Report a bug
|
|
97
|
-
</BlankState.TextButton>
|
|
98
|
-
</BlankState.Root>);
|
|
99
30
|
}
|
|
100
|
-
export default ErrorBoundary;
|
|
101
31
|
//# sourceMappingURL=error_boundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error_boundary.js","sourceRoot":"","sources":["../../../src/components/page/error_boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"error_boundary.js","sourceRoot":"","sources":["../../../src/components/page/error_boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,2CAA2C,CAAA;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAgB1D,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,SAGxC;IACC,KAAK,GAAuB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA;IAE3C,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC1C,OAAO,EAAE,KAAK,EAAE,CAAA;IAClB,CAAC;IAED,iBAAiB,CAAC,KAAY,EAAE,SAA0B;QACxD,IAAI,KAAK,YAAY,aAAa;YAAE,OAAM;QAE1C,GAAG,CAAC,WAAW,CAAC,KAAK,EAAE;YACrB,cAAc,EAAE,SAAS,CAAC,cAAc,IAAI,SAAS;YACrD,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK;YACvB,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU;YACjC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,EAAE;SACrD,CAAC,CAAA;IACJ,CAAC;IAED,WAAW,GAAG,GAAG,EAAE;QACjB,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IAChC,CAAC,CAAA;IAED,MAAM;QACJ,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAA;QAEjD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,KAAK,CAAA;QAC/B,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO,IAAI,CAAA;QAEvC,OAAO,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAA;IACjG,CAAC;CACF","sourcesContent":["import React, { PropsWithChildren } from 'react'\nimport { Log } from '../../utils/native_adapters/configuration'\nimport { ReportErrorScope } from '../../utils/native_adapters/log'\nimport { ResponseError } from '../../utils/response_error'\n\nexport type ErrorBoundaryFallback =\n | React.ReactNode\n | ((error: Error, reset: () => void) => React.ReactNode)\n\nexport type ErrorBoundaryProps = {\n scope?: ReportErrorScope\n screenName?: string\n fallback?: ErrorBoundaryFallback\n}\n\ntype ErrorBoundaryState = {\n error: Error | null\n}\n\nexport class ErrorBoundary extends React.Component<\n PropsWithChildren<ErrorBoundaryProps>,\n ErrorBoundaryState\n> {\n state: ErrorBoundaryState = { error: null }\n\n static getDerivedStateFromError(error: Error): ErrorBoundaryState {\n return { error }\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n if (error instanceof ResponseError) return\n\n Log.reportError(error, {\n componentStack: errorInfo.componentStack ?? undefined,\n scope: this.props.scope,\n screenName: this.props.screenName,\n tags: { team: 'chat', package: 'chat-react-native' },\n })\n }\n\n handleReset = () => {\n this.setState({ error: null })\n }\n\n render() {\n if (!this.state.error) return this.props.children\n\n const { fallback } = this.props\n if (fallback === undefined) return null\n\n return typeof fallback === 'function' ? fallback(this.state.error, this.handleReset) : fallback\n }\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { ErrorBoundaryProps } from './error_boundary';
|
|
3
|
+
export declare function PageErrorBoundary({ children, ...props }: PropsWithChildren<ErrorBoundaryProps>): React.JSX.Element;
|
|
4
|
+
//# sourceMappingURL=page_error_boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page_error_boundary.d.ts","sourceRoot":"","sources":["../../../src/components/page/page_error_boundary.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAmC,MAAM,OAAO,CAAA;AAIjF,OAAO,EAAwC,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAM3F,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,qBAM9F"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { useNavigation } from '@react-navigation/native';
|
|
2
|
+
import { useQueryErrorResetBoundary } from '@tanstack/react-query';
|
|
3
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
4
|
+
import { onAuthRefresh } from '../../utils/auth_events';
|
|
5
|
+
import { ResponseError } from '../../utils/response_error';
|
|
6
|
+
import BlankState from '../primitive/blank_state_primitive';
|
|
7
|
+
import { ErrorBoundary } from './error_boundary';
|
|
8
|
+
const renderPageFallback = (error, reset) => (<ErrorView error={error} reset={reset}/>);
|
|
9
|
+
export function PageErrorBoundary({ children, ...props }) {
|
|
10
|
+
return (<ErrorBoundary scope="screen" fallback={renderPageFallback} {...props}>
|
|
11
|
+
{children}
|
|
12
|
+
</ErrorBoundary>);
|
|
13
|
+
}
|
|
14
|
+
function ErrorView({ error, reset }) {
|
|
15
|
+
const { reset: resetQueries } = useQueryErrorResetBoundary();
|
|
16
|
+
const handleReset = useCallback(() => {
|
|
17
|
+
resetQueries();
|
|
18
|
+
reset();
|
|
19
|
+
}, [resetQueries, reset]);
|
|
20
|
+
useEffect(() => handleReset, [handleReset]);
|
|
21
|
+
if (error instanceof ResponseError) {
|
|
22
|
+
return <ResponseErrorView response={error.response} onReset={handleReset}/>;
|
|
23
|
+
}
|
|
24
|
+
if (isNetworkError(error)) {
|
|
25
|
+
return (<ErrorContent heading={'Problem connecting!'} body={'Check your internet connection and try again.'}/>);
|
|
26
|
+
}
|
|
27
|
+
return <ErrorContent heading={'Oops!'} body={'Something unexpected happened.'}/>;
|
|
28
|
+
}
|
|
29
|
+
function isNetworkError(error) {
|
|
30
|
+
const networkFailedMessages = [
|
|
31
|
+
'Network request failed',
|
|
32
|
+
'Network request timed out',
|
|
33
|
+
'Failed to fetch',
|
|
34
|
+
];
|
|
35
|
+
return new RegExp(networkFailedMessages.join('|'), 'i').test(error.message);
|
|
36
|
+
}
|
|
37
|
+
function ResponseErrorView({ response, onReset }) {
|
|
38
|
+
const { status } = response;
|
|
39
|
+
const heading = useMemo(() => {
|
|
40
|
+
switch (status) {
|
|
41
|
+
case 403:
|
|
42
|
+
return 'Permission required';
|
|
43
|
+
case 404:
|
|
44
|
+
return 'Content not found';
|
|
45
|
+
default:
|
|
46
|
+
return 'Oops!';
|
|
47
|
+
}
|
|
48
|
+
}, [status]);
|
|
49
|
+
const body = useMemo(() => {
|
|
50
|
+
switch (status) {
|
|
51
|
+
case 403:
|
|
52
|
+
return 'Contact your administrator for access.';
|
|
53
|
+
case 404:
|
|
54
|
+
return 'If you believe something should be here, please reach out to your administrator.';
|
|
55
|
+
default:
|
|
56
|
+
return 'Something unexpected happened.';
|
|
57
|
+
}
|
|
58
|
+
}, [status]);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
if (status !== 401)
|
|
61
|
+
return;
|
|
62
|
+
return onAuthRefresh(onReset);
|
|
63
|
+
}, [status, onReset]);
|
|
64
|
+
return <ErrorContent heading={heading} body={body}/>;
|
|
65
|
+
}
|
|
66
|
+
function ErrorContent({ heading, body }) {
|
|
67
|
+
const navigation = useNavigation();
|
|
68
|
+
return (<BlankState.Root>
|
|
69
|
+
<BlankState.Imagery name="people.noTextMessage"/>
|
|
70
|
+
<BlankState.Content>
|
|
71
|
+
<BlankState.Heading>{heading}</BlankState.Heading>
|
|
72
|
+
<BlankState.Text>{body}</BlankState.Text>
|
|
73
|
+
</BlankState.Content>
|
|
74
|
+
<BlankState.Button title="Go back" onPress={navigation.goBack} size="md" accessibilityRole="link"/>
|
|
75
|
+
<BlankState.TextButton onPress={() => navigation.navigate('BugReport')}>
|
|
76
|
+
Report a bug
|
|
77
|
+
</BlankState.TextButton>
|
|
78
|
+
</BlankState.Root>);
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=page_error_boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page_error_boundary.js","sourceRoot":"","sources":["../../../src/components/page/page_error_boundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,KAAK,EAAE,EAAqB,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,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,OAAO,aAAa,CAAC,OAAO,CAAC,CAAA;IAC/B,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IAErB,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAG,CAAA;AACvD,CAAC;AAED,SAAS,YAAY,CAAC,EAAE,OAAO,EAAE,IAAI,EAAqC;IACxE,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAElC,OAAO,CACL,CAAC,UAAU,CAAC,IAAI,CACd;MAAA,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,sBAAsB,EAC/C;MAAA,CAAC,UAAU,CAAC,OAAO,CACjB;QAAA,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,OAAO,CACjD;QAAA,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,IAAI,CAC1C;MAAA,EAAE,UAAU,CAAC,OAAO,CACpB;MAAA,CAAC,UAAU,CAAC,MAAM,CAChB,KAAK,CAAC,SAAS,CACf,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAC3B,IAAI,CAAC,IAAI,CACT,iBAAiB,CAAC,MAAM,EAE1B;MAAA,CAAC,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CACrE;;MACF,EAAE,UAAU,CAAC,UAAU,CACzB;IAAA,EAAE,UAAU,CAAC,IAAI,CAAC,CACnB,CAAA;AACH,CAAC","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport { useQueryErrorResetBoundary } from '@tanstack/react-query'\nimport React, { PropsWithChildren, useCallback, useEffect, useMemo } from 'react'\nimport { onAuthRefresh } from '../../utils/auth_events'\nimport { ResponseError } from '../../utils/response_error'\nimport BlankState from '../primitive/blank_state_primitive'\nimport { ErrorBoundary, ErrorBoundaryFallback, ErrorBoundaryProps } from './error_boundary'\n\nconst renderPageFallback: ErrorBoundaryFallback = (error, reset) => (\n <ErrorView error={error} reset={reset} />\n)\n\nexport function PageErrorBoundary({ children, ...props }: PropsWithChildren<ErrorBoundaryProps>) {\n return (\n <ErrorBoundary scope=\"screen\" fallback={renderPageFallback} {...props}>\n {children}\n </ErrorBoundary>\n )\n}\n\nfunction ErrorView({ error, reset }: { error: Error; reset: () => void }) {\n const { reset: resetQueries } = useQueryErrorResetBoundary()\n\n const handleReset = useCallback(() => {\n resetQueries()\n reset()\n }, [resetQueries, reset])\n\n useEffect(() => handleReset, [handleReset])\n\n if (error instanceof ResponseError) {\n return <ResponseErrorView response={error.response} onReset={handleReset} />\n }\n\n if (isNetworkError(error)) {\n return (\n <ErrorContent\n heading={'Problem connecting!'}\n body={'Check your internet connection and try again.'}\n />\n )\n }\n\n return <ErrorContent heading={'Oops!'} body={'Something unexpected happened.'} />\n}\n\nfunction isNetworkError(error: Error) {\n const networkFailedMessages = [\n 'Network request failed',\n 'Network request timed out',\n 'Failed to fetch',\n ]\n\n return new RegExp(networkFailedMessages.join('|'), 'i').test(error.message)\n}\n\nfunction ResponseErrorView({ response, onReset }: { response: Response; onReset: () => void }) {\n const { status } = response\n\n const heading = useMemo(() => {\n switch (status) {\n case 403:\n return 'Permission required'\n case 404:\n return 'Content not found'\n default:\n return 'Oops!'\n }\n }, [status])\n\n const body = useMemo(() => {\n switch (status) {\n case 403:\n return 'Contact your administrator for access.'\n case 404:\n return 'If you believe something should be here, please reach out to your administrator.'\n default:\n return 'Something unexpected happened.'\n }\n }, [status])\n\n useEffect(() => {\n if (status !== 401) return\n\n return onAuthRefresh(onReset)\n }, [status, onReset])\n\n return <ErrorContent heading={heading} body={body} />\n}\n\nfunction ErrorContent({ heading, body }: { heading: string; body: string }) {\n const navigation = useNavigation()\n\n return (\n <BlankState.Root>\n <BlankState.Imagery name=\"people.noTextMessage\" />\n <BlankState.Content>\n <BlankState.Heading>{heading}</BlankState.Heading>\n <BlankState.Text>{body}</BlankState.Text>\n </BlankState.Content>\n <BlankState.Button\n title=\"Go back\"\n onPress={navigation.goBack}\n size=\"md\"\n accessibilityRole=\"link\"\n />\n <BlankState.TextButton onPress={() => navigation.navigate('BugReport')}>\n Report a bug\n </BlankState.TextButton>\n </BlankState.Root>\n )\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenLayout.d.ts","sourceRoot":"","sources":["../../src/navigation/screenLayout.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"screenLayout.d.ts","sourceRoot":"","sources":["../../src/navigation/screenLayout.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAA;CAAE,qBAQ1E;AAED,wBAAgB,8BAA8B,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAA;CAAE,qBAQ5F"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { useRoute } from '@react-navigation/native';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { Suspense } from 'react';
|
|
3
|
-
import ErrorBoundary from '../components/page/error_boundary';
|
|
4
4
|
import { DefaultLoading } from '../components/page/loading';
|
|
5
|
+
import { PageErrorBoundary } from '../components/page/page_error_boundary';
|
|
5
6
|
import { ChatAccessGate } from './chat_access_gate';
|
|
6
7
|
export function ScreenLayout({ children }) {
|
|
7
|
-
|
|
8
|
+
const route = useRoute();
|
|
9
|
+
return (<PageErrorBoundary screenName={route.name}>
|
|
8
10
|
<Suspense fallback={<DefaultLoading />}>{children}</Suspense>
|
|
9
|
-
</
|
|
11
|
+
</PageErrorBoundary>);
|
|
10
12
|
}
|
|
11
13
|
export function ScreenLayoutWithChatAccessGate({ children }) {
|
|
12
14
|
return (<ScreenLayout>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenLayout.js","sourceRoot":"","sources":["../../src/navigation/screenLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,
|
|
1
|
+
{"version":3,"file":"screenLayout.js","sourceRoot":"","sources":["../../src/navigation/screenLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,UAAU,YAAY,CAAC,EAAE,QAAQ,EAAoC;IACzE,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IAExB,OAAO,CACL,CAAC,iBAAiB,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CACxC;MAAA,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,AAAD,EAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAC9D;IAAA,EAAE,iBAAiB,CAAC,CACrB,CAAA;AACH,CAAC;AAED,MAAM,UAAU,8BAA8B,CAAC,EAAE,QAAQ,EAAoC;IAC3F,OAAO,CACL,CAAC,YAAY,CACX;MAAA,CAAC,cAAc,CACb;QAAA,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,AAAD,EAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAC9D;MAAA,EAAE,cAAc,CAClB;IAAA,EAAE,YAAY,CAAC,CAChB,CAAA;AACH,CAAC","sourcesContent":["import { useRoute } from '@react-navigation/native'\nimport React from 'react'\nimport { Suspense } from 'react'\nimport { DefaultLoading } from '../components/page/loading'\nimport { PageErrorBoundary } from '../components/page/page_error_boundary'\nimport { ChatAccessGate } from './chat_access_gate'\n\nexport function ScreenLayout({ children }: { children: React.ReactElement }) {\n const route = useRoute()\n\n return (\n <PageErrorBoundary screenName={route.name}>\n <Suspense fallback={<DefaultLoading />}>{children}</Suspense>\n </PageErrorBoundary>\n )\n}\n\nexport function ScreenLayoutWithChatAccessGate({ children }: { children: React.ReactElement }) {\n return (\n <ScreenLayout>\n <ChatAccessGate>\n <Suspense fallback={<DefaultLoading />}>{children}</Suspense>\n </ChatAccessGate>\n </ScreenLayout>\n )\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumented_fetch.d.ts","sourceRoot":"","sources":["../../../src/utils/client/instrumented_fetch.ts"],"names":[],"mappings":"AASA,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAUzF"}
|