@planningcenter/chat-react-native 4.8.0-rc.9 → 4.8.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/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +31 -25
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversations/app_update_banner.d.ts +2 -0
- package/build/components/conversations/app_update_banner.d.ts.map +1 -0
- package/build/components/conversations/app_update_banner.js +52 -0
- package/build/components/conversations/app_update_banner.js.map +1 -0
- package/build/components/conversations/bulk_conversation_actions_bar.d.ts +2 -0
- package/build/components/conversations/bulk_conversation_actions_bar.d.ts.map +1 -0
- package/build/components/conversations/bulk_conversation_actions_bar.js +215 -0
- package/build/components/conversations/bulk_conversation_actions_bar.js.map +1 -0
- package/build/components/conversations/conversation_actions.d.ts.map +1 -1
- package/build/components/conversations/conversation_actions.js +202 -161
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +129 -115
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.d.ts +5 -1
- package/build/components/conversations/swipeable_toggle_button.d.ts.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.js +96 -67
- package/build/components/conversations/swipeable_toggle_button.js.map +1 -1
- package/build/components/display/icon.d.ts +3 -1
- package/build/components/display/icon.d.ts.map +1 -1
- package/build/components/display/icon.js +2 -0
- package/build/components/display/icon.js.map +1 -1
- package/build/components/primitive/banner_primitive.js +7 -3
- package/build/components/primitive/banner_primitive.js.map +1 -1
- package/build/screens/conversation_actions_screen.d.ts +2 -0
- package/build/screens/conversation_actions_screen.d.ts.map +1 -1
- package/build/screens/conversation_actions_screen.js +380 -46
- package/build/screens/conversation_actions_screen.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts +1 -0
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +105 -33
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/utils/theme.js +20 -21
- package/build/utils/theme.js.map +1 -1
- package/package.json +2 -2
- package/src/components/conversation/__tests__/message_form.test.tsx +19 -2
- package/src/components/conversation/message_form.tsx +15 -2
- package/src/components/conversations/__tests__/app_update_banner.test.tsx +27 -0
- package/src/components/conversations/__tests__/bulk_conversation_actions_bar.test.tsx +95 -0
- package/src/components/conversations/__tests__/conversation_actions.test.tsx +10 -3
- package/src/components/conversations/app_update_banner.tsx +36 -0
- package/src/components/conversations/bulk_conversation_actions_bar.tsx +140 -0
- package/src/components/conversations/conversation_actions.tsx +51 -34
- package/src/components/conversations/conversation_preview.tsx +8 -1
- package/src/components/conversations/swipeable_toggle_button.tsx +45 -16
- package/src/components/display/icon.tsx +3 -0
- package/src/components/primitive/banner_primitive.tsx +5 -1
- package/src/screens/__tests__/conversation_actions_screen.test.tsx +48 -6
- package/src/screens/conversation_actions_screen.tsx +145 -12
- package/src/screens/conversations/__tests__/conversations_screen.test.tsx +34 -8
- package/src/screens/conversations/conversations_screen.tsx +28 -2
- package/src/utils/theme.ts +20 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_actions_screen.js","names":["useNavigation","React","StyleSheet","FormSheet","getFormSheetScreenOptions","useConversation","useHideConversation","useHideConversationsEnabled","jsx","_jsx","ConversationActionsScreenOptions","headerTitle","ConversationActionsScreen","t0","$","_c","route","navigation","styles","useStyles","data","conversation","params","t1","hidden","setHidden","isPending","hideConversationsEnabled","t2","goBack","handleHidePress","t3","Action","title","iconName","accessibilityHint","t4","formSheetContent","Root","style","children","create","paddingTop"],"sources":["../../src/screens/conversation_actions_screen.tsx"],"sourcesContent":["import { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { StyleSheet } from 'react-native'\nimport FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'\nimport { useConversation } from '../hooks/use_conversation'\nimport { useHideConversation } from '../hooks/use_hide_conversation'\nimport { useHideConversationsEnabled } from '../hooks/use_hide_conversations_enabled'\n\nexport const ConversationActionsScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Conversation actions',\n})\n\nexport type ConversationActionsScreenProps = StaticScreenProps<{\n conversation_id: number\n}>\n\nexport function ConversationActionsScreen({ route }: ConversationActionsScreenProps) {\n const navigation = useNavigation()\n const styles = useStyles()\n const { data: conversation } = useConversation(route.params)\n const { hidden, setHidden, isPending } = useHideConversation({ conversation })\n const hideConversationsEnabled = useHideConversationsEnabled()\n\n const handleHidePress = () => {\n setHidden(!hidden)\n navigation.goBack()\n }\n\n return (\n <FormSheet.Root style={styles.formSheetContent}>\n {hideConversationsEnabled && (\n <FormSheet.Action\n onPress={handleHidePress}\n title={hidden ? 'Unhide conversation' : 'Hide conversation'}\n iconName={hidden ? 'general.showEye' : 'general.hideEye'}\n disabled={isPending}\n accessibilityHint={\n hidden\n ? 'Shows this conversation in your conversation list again.'\n : 'Hides this conversation from your conversation list.'\n }\n />\n )}\n </FormSheet.Root>\n )\n}\n\nconst useStyles = () =>\n StyleSheet.create({\n formSheetContent: {\n paddingTop: 16,\n },\n })\n"],"mappings":";AAAA,SAA4BA,aAAa,QAAQ,0BAA0B;AAC3E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,SAAS,IAAIC,yBAAyB,QAAQ,oCAAoC;AACzF,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,SAASC,2BAA2B,QAAQ,yCAAyC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAErF,OAAO,MAAMC,gCAAgC,GAAGN,yBAAyB,CAAC;EACxEO,WAAW,EAAE;AACf,CAAC,CAAC;AAMF,OAAO,SAAAC,0BAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAAmC;IAAAC;EAAA,IAAAH,EAAyC;EACjF,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AC9CE,QAAS,EAATA,SAAS;MAEjBS,iBAE0D,EAF1DX,MAAM,GAAN,0DAE0D,GAF1D;IAE0D,CAGhE,CAAC;IAAAV,CAAA,MAAAgB,eAAA;IAAAhB,CAAA,MAAAU,MAAA;IAAAV,CAAA,MAAAa,wBAAA;IAAAb,CAAA,MAAAY,SAAA;IAAAZ,CAAA,OAAAiB,EAAA;EAAA;IAAAA,EAAA,GAAAjB,CAAA;EAAA;EAAA,IAAAsB,EAAA;EAAA,IAAAtB,CAAA,SAAAI,MAAA,CAAAmB,gBAAA,IAAAvB,CAAA,SAAAiB,EAAA;IAbHK,EAAA,gBAAA3B,IAAA,CAAAN,SAAA,CAAAmC,IAAA;MAAuBC,KAAuB,EAAvBrB,MAAM,CAAAmB,gBAAiB;MAAAG,QAAA,EAC3CT;IAYA,CACa,CAAC;IAAAjB,CAAA,OAAAI,MAAA,CAAAmB,gBAAA;IAAAvB,CAAA,OAAAiB,EAAA;IAAAjB,CAAA,OAAAsB,EAAA;EAAA;IAAAA,EAAA,GAAAtB,CAAA;EAAA;EAAA,OAdjBsB,EAciB;AAAA;AAIrB,MAAMjB,SAAS,GAAGA,CAAA,KAChBjB,UAAU,CAACuC,MAAM,CAAC;EAChBJ,gBAAgB,EAAE;IAChBK,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"conversation_actions_screen.js","names":["StackActions","useNavigation","React","StyleSheet","View","ConversationAvatar","Heading","Text","FormSheet","getFormSheetScreenOptions","useTheme","useConversation","useConversationMute","useConversationsMarkRead","useHideConversation","useHideConversationsEnabled","isArchivedConversation","MAX_FONT_SIZE_MULTIPLIER_LANDMARK","jsx","_jsx","jsxs","_jsxs","ConversationActionsScreenOptions","headerTitle","sheetAllowedDetents","ConversationActionsScreen","t0","$","_c","route","navigation","styles","useStyles","conversation_id","params","t1","data","conversation","t2","hidden","setHidden","isPending","isHiddenPending","t3","markReadState","t4","muteState","hideConversationsEnabled","read","muted","t5","archived","emptyConversation","lastMessageCreatedAt","subtitle","badges","text","t6","navigate","goBack","requestAnimationFrame","navigateAfterDismiss","t7","deleted","title","undefined","badge","handleOpenPress","t8","handleDetailsPress","t9","markRead","handleMarkReadPress","t10","setMuted","handleMutePress","t11","handleHidePress","t12","dispatch","popTo","select_conversation_id","merge","handleSelectPress","t13","Symbol","for","Root","fitToContents","children","size","showFallback","t14","variant","numberOfLines","t15","t16","headerText","style","t17","header","Header","t18","Action","iconName","t19","t20","disabled","t21","accessibilityHint","t22","t23","divider","t24","t25","colors","borderColorDefaultBase","create","flex","flexDirection","alignItems","gap","height","marginHorizontal","marginVertical","backgroundColor"],"sources":["../../src/screens/conversation_actions_screen.tsx"],"sourcesContent":["import { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { ConversationAvatar, Heading, Text } from '../components/display'\nimport FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'\nimport { useTheme } from '../hooks'\nimport { useConversation, useConversationMute } from '../hooks/use_conversation'\nimport { useConversationsMarkRead } from '../hooks/use_conversations_actions'\nimport { useHideConversation } from '../hooks/use_hide_conversation'\nimport { useHideConversationsEnabled } from '../hooks/use_hide_conversations_enabled'\nimport { isArchivedConversation, MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../utils'\n\nexport const ConversationActionsScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Conversation actions',\n sheetAllowedDetents: 'fitToContents',\n})\n\nexport type ConversationActionsScreenProps = StaticScreenProps<{\n conversation_id: number\n read?: boolean\n muted?: boolean\n}>\n\nexport function ConversationActionsScreen({ route }: ConversationActionsScreenProps) {\n const navigation = useNavigation()\n const styles = useStyles()\n const { conversation_id } = route.params\n const { data: conversation } = useConversation({ conversation_id })\n const { hidden, setHidden, isPending: isHiddenPending } = useHideConversation({ conversation })\n const markReadState = useConversationsMarkRead({ conversation })\n const muteState = useConversationMute({ conversation_id })\n const hideConversationsEnabled = useHideConversationsEnabled()\n\n const read = route.params.read ?? markReadState.read\n const muted = route.params.muted ?? muteState.muted\n const archived = isArchivedConversation(conversation)\n const emptyConversation = conversation.lastMessageCreatedAt === null\n const subtitle = conversation.badges?.[0]?.text\n\n const navigateAfterDismiss = (navigate: () => void) => {\n navigation.goBack()\n requestAnimationFrame(navigate)\n }\n\n const handleOpenPress = () =>\n navigateAfterDismiss(() =>\n navigation.navigate('Conversation', {\n conversation_id,\n title: conversation.title ?? undefined,\n badge: conversation.badges?.[0],\n deleted: conversation.deleted,\n muted,\n })\n )\n\n const handleDetailsPress = () =>\n navigateAfterDismiss(() => navigation.navigate('ConversationDetails', { conversation_id }))\n\n const handleMarkReadPress = () => {\n markReadState.markRead(!read)\n navigation.goBack()\n }\n\n const handleMutePress = () => {\n muteState.setMuted(!muted)\n navigation.goBack()\n }\n\n const handleHidePress = () => {\n setHidden(!hidden)\n navigation.goBack()\n }\n\n const handleSelectPress = () => {\n navigation.dispatch(\n StackActions.popTo(\n 'Conversations',\n { select_conversation_id: conversation_id },\n { merge: true }\n )\n )\n }\n\n if (!hideConversationsEnabled) return <FormSheet.Root fitToContents>{null}</FormSheet.Root>\n\n return (\n <FormSheet.Root fitToContents>\n <FormSheet.Header>\n <View style={styles.header}>\n <ConversationAvatar conversation={conversation} size=\"md\" showFallback />\n <View style={styles.headerText}>\n <Heading\n variant=\"h3\"\n numberOfLines={1}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n >\n {conversation.title}\n </Heading>\n {!!subtitle && (\n <Text\n variant=\"tertiary\"\n numberOfLines={1}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n >\n {subtitle}\n </Text>\n )}\n </View>\n </View>\n </FormSheet.Header>\n <FormSheet.Action\n onPress={handleOpenPress}\n title=\"Open conversation\"\n iconName=\"general.textMessage\"\n />\n <FormSheet.Action\n onPress={handleDetailsPress}\n title=\"Conversation details\"\n iconName=\"general.cog\"\n />\n {!emptyConversation && (\n <FormSheet.Action\n onPress={handleMarkReadPress}\n title={read ? 'Mark as unread' : 'Mark as read'}\n iconName={read ? 'checkIns.checkPending' : 'checkIns.check'}\n disabled={markReadState.isPending}\n />\n )}\n {!archived && (\n <FormSheet.Action\n onPress={handleMutePress}\n title={muted ? 'Enable' : 'Silence'}\n iconName={muted ? 'general.bell' : 'general.bellMuted'}\n disabled={muteState.isPending}\n accessibilityHint={\n muted\n ? 'Turns notifications for this conversation back on.'\n : 'Turns off notifications for this conversation.'\n }\n />\n )}\n {!archived && (\n <FormSheet.Action\n onPress={handleHidePress}\n title={hidden ? 'Unhide conversation' : 'Hide conversation'}\n iconName={hidden ? 'general.showEye' : 'general.hideEye'}\n disabled={isHiddenPending}\n accessibilityHint={\n hidden\n ? 'Shows this conversation in your conversation list again.'\n : 'Hides this conversation from your conversation list.'\n }\n />\n )}\n <View style={styles.divider} />\n <FormSheet.Action\n onPress={handleSelectPress}\n title=\"Select conversations\"\n iconName=\"general.check\"\n accessibilityHint=\"Selects this conversation and lets you choose more to hide, silence, or mark read.\"\n />\n </FormSheet.Root>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n header: {\n flex: 1,\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n },\n headerText: {\n flex: 1,\n },\n divider: {\n height: 1,\n marginHorizontal: 16,\n marginVertical: 4,\n backgroundColor: colors.borderColorDefaultBase,\n },\n })\n}\n"],"mappings":";AAAA,SAASA,YAAY,EAAqBC,aAAa,QAAQ,0BAA0B;AACzF,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,kBAAkB,EAAEC,OAAO,EAAEC,IAAI,QAAQ,uBAAuB;AACzE,OAAOC,SAAS,IAAIC,yBAAyB,QAAQ,oCAAoC;AACzF,SAASC,QAAQ,QAAQ,UAAU;AACnC,SAASC,eAAe,EAAEC,mBAAmB,Q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zB;IACF,CAAC,CAAC;IAAAzF,CAAA,MAAAwF,MAAA,CAAAC,sBAAA;IAAAzF,CAAA,MAAAD,EAAA;EAAA;IAAAA,EAAA,GAAAC,CAAA;EAAA;EAAA,OAhBKD,EAgBL;AAAA,CACH","ignoreList":[]}
|
|
@@ -9,6 +9,7 @@ export type ConversationsScreenProps = StaticScreenProps<{
|
|
|
9
9
|
show_archived?: boolean;
|
|
10
10
|
show_hidden?: boolean;
|
|
11
11
|
show_unread?: boolean;
|
|
12
|
+
select_conversation_id?: number;
|
|
12
13
|
}>;
|
|
13
14
|
export declare const conversationsScreenOptions: ({ title, onClose, }: {
|
|
14
15
|
title?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversations/conversations_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"conversations_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/conversations/conversations_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAmB3E,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAK9D,MAAM,MAAM,wBAAwB,GAAG,iBAAiB,CAAC;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,sBAAsB,CAAC,EAAE,MAAM,CAAA;CAChC,CAAC,CAAA;AAEF,eAAO,MAAM,0BAA0B,GAAI,qBAGxC;IACD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,0EAIE,CAAA;AAEH,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,EAAE,wBAAwB,2CAwBtE"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useNavigation } from '@react-navigation/native';
|
|
3
|
-
import React, { useLayoutEffect, useRef } from 'react';
|
|
3
|
+
import React, { useEffect, useLayoutEffect, useRef } from 'react';
|
|
4
4
|
import { StyleSheet, View } from 'react-native';
|
|
5
5
|
import { Conversations } from '../../components';
|
|
6
|
+
import { AppUpdateBanner } from '../../components/conversations/app_update_banner';
|
|
7
|
+
import { BulkConversationActionsBar } from '../../components/conversations/bulk_conversation_actions_bar';
|
|
6
8
|
import { composeOptions, withRightClose, withRightText } from '../../components/display/platform_modal_header_buttons';
|
|
7
9
|
import { Toast } from '../../components/display/toast';
|
|
8
10
|
import { ConversationsContextProvider, useConversationsContext } from '../../contexts/conversations_context';
|
|
@@ -12,7 +14,7 @@ import { useSearchEnabled } from '../../hooks/use_search_enabled';
|
|
|
12
14
|
import { FilterDropdownListHeaderComponent } from './components/filter_dropdown_list_header_component';
|
|
13
15
|
import { ListHeaderComponent } from './components/list_header_component';
|
|
14
16
|
import { SearchListHeaderComponent } from './components/search_list_header_component';
|
|
15
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
18
|
export const conversationsScreenOptions = ({
|
|
17
19
|
title,
|
|
18
20
|
onClose
|
|
@@ -23,7 +25,7 @@ export const conversationsScreenOptions = ({
|
|
|
23
25
|
onPress: onClose
|
|
24
26
|
}));
|
|
25
27
|
export function ConversationsScreen(t0) {
|
|
26
|
-
const $ = _c(
|
|
28
|
+
const $ = _c(20);
|
|
27
29
|
const {
|
|
28
30
|
route
|
|
29
31
|
} = t0;
|
|
@@ -50,50 +52,86 @@ export function ConversationsScreen(t0) {
|
|
|
50
52
|
} else {
|
|
51
53
|
t3 = $[2];
|
|
52
54
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
const t4 = route.params?.select_conversation_id;
|
|
56
|
+
let t5;
|
|
57
|
+
if ($[3] !== t4) {
|
|
58
|
+
t5 = /*#__PURE__*/_jsx(SelectModeRequest, {
|
|
59
|
+
conversationId: t4
|
|
57
60
|
});
|
|
58
|
-
$[3] =
|
|
59
|
-
$[4] =
|
|
61
|
+
$[3] = t4;
|
|
62
|
+
$[4] = t5;
|
|
60
63
|
} else {
|
|
61
|
-
|
|
64
|
+
t5 = $[4];
|
|
62
65
|
}
|
|
63
|
-
let
|
|
64
|
-
if ($[5] !==
|
|
65
|
-
|
|
66
|
+
let t6;
|
|
67
|
+
if ($[5] !== Header) {
|
|
68
|
+
t6 = /*#__PURE__*/_jsx(Header, {});
|
|
69
|
+
$[5] = Header;
|
|
70
|
+
$[6] = t6;
|
|
71
|
+
} else {
|
|
72
|
+
t6 = $[6];
|
|
73
|
+
}
|
|
74
|
+
let t7;
|
|
75
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
76
|
+
t7 = /*#__PURE__*/_jsx(AppUpdateBanner, {});
|
|
77
|
+
$[7] = t7;
|
|
78
|
+
} else {
|
|
79
|
+
t7 = $[7];
|
|
80
|
+
}
|
|
81
|
+
let t8;
|
|
82
|
+
if ($[8] !== t6) {
|
|
83
|
+
t8 = /*#__PURE__*/_jsx(Conversations, {
|
|
84
|
+
ListHeaderComponent: /*#__PURE__*/_jsxs(_Fragment, {
|
|
85
|
+
children: [t6, t7]
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
$[8] = t6;
|
|
89
|
+
$[9] = t8;
|
|
90
|
+
} else {
|
|
91
|
+
t8 = $[9];
|
|
92
|
+
}
|
|
93
|
+
let t9;
|
|
94
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
95
|
+
t9 = /*#__PURE__*/_jsx(BulkConversationActionsBar, {});
|
|
96
|
+
$[10] = t9;
|
|
97
|
+
} else {
|
|
98
|
+
t9 = $[10];
|
|
99
|
+
}
|
|
100
|
+
let t10;
|
|
101
|
+
if ($[11] !== route.params || $[12] !== t3 || $[13] !== t5 || $[14] !== t8) {
|
|
102
|
+
t10 = /*#__PURE__*/_jsxs(ConversationsContextProvider, {
|
|
66
103
|
args: route.params,
|
|
67
104
|
opts: t1,
|
|
68
|
-
children: [t3,
|
|
105
|
+
children: [t3, t5, t8, t9]
|
|
69
106
|
});
|
|
70
|
-
$[
|
|
71
|
-
$[
|
|
72
|
-
$[
|
|
73
|
-
$[
|
|
107
|
+
$[11] = route.params;
|
|
108
|
+
$[12] = t3;
|
|
109
|
+
$[13] = t5;
|
|
110
|
+
$[14] = t8;
|
|
111
|
+
$[15] = t10;
|
|
74
112
|
} else {
|
|
75
|
-
|
|
113
|
+
t10 = $[15];
|
|
76
114
|
}
|
|
77
|
-
let
|
|
78
|
-
if ($[
|
|
79
|
-
|
|
80
|
-
$[
|
|
115
|
+
let t11;
|
|
116
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
117
|
+
t11 = /*#__PURE__*/_jsx(Toast, {});
|
|
118
|
+
$[16] = t11;
|
|
81
119
|
} else {
|
|
82
|
-
|
|
120
|
+
t11 = $[16];
|
|
83
121
|
}
|
|
84
|
-
let
|
|
85
|
-
if ($[
|
|
86
|
-
|
|
122
|
+
let t12;
|
|
123
|
+
if ($[17] !== styles.container || $[18] !== t10) {
|
|
124
|
+
t12 = /*#__PURE__*/_jsxs(View, {
|
|
87
125
|
style: styles.container,
|
|
88
|
-
children: [
|
|
126
|
+
children: [t10, t11]
|
|
89
127
|
});
|
|
90
|
-
$[
|
|
91
|
-
$[
|
|
92
|
-
$[
|
|
128
|
+
$[17] = styles.container;
|
|
129
|
+
$[18] = t10;
|
|
130
|
+
$[19] = t12;
|
|
93
131
|
} else {
|
|
94
|
-
|
|
132
|
+
t12 = $[19];
|
|
95
133
|
}
|
|
96
|
-
return
|
|
134
|
+
return t12;
|
|
97
135
|
}
|
|
98
136
|
function SelectModeHeader(t0) {
|
|
99
137
|
const $ = _c(7);
|
|
@@ -143,6 +181,40 @@ function SelectModeHeader(t0) {
|
|
|
143
181
|
useLayoutEffect(t1, t2);
|
|
144
182
|
return null;
|
|
145
183
|
}
|
|
184
|
+
function SelectModeRequest(t0) {
|
|
185
|
+
const $ = _c(5);
|
|
186
|
+
const {
|
|
187
|
+
conversationId
|
|
188
|
+
} = t0;
|
|
189
|
+
const navigation = useNavigation();
|
|
190
|
+
const {
|
|
191
|
+
enterSelectMode
|
|
192
|
+
} = useConversationsContext();
|
|
193
|
+
let t1;
|
|
194
|
+
let t2;
|
|
195
|
+
if ($[0] !== conversationId || $[1] !== enterSelectMode || $[2] !== navigation) {
|
|
196
|
+
t1 = () => {
|
|
197
|
+
if (conversationId === undefined) {
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
enterSelectMode(conversationId);
|
|
201
|
+
navigation.setParams({
|
|
202
|
+
select_conversation_id: undefined
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
t2 = [conversationId, enterSelectMode, navigation];
|
|
206
|
+
$[0] = conversationId;
|
|
207
|
+
$[1] = enterSelectMode;
|
|
208
|
+
$[2] = navigation;
|
|
209
|
+
$[3] = t1;
|
|
210
|
+
$[4] = t2;
|
|
211
|
+
} else {
|
|
212
|
+
t1 = $[3];
|
|
213
|
+
t2 = $[4];
|
|
214
|
+
}
|
|
215
|
+
useEffect(t1, t2);
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
146
218
|
const useListHeaderComponent = () => {
|
|
147
219
|
const filterDropdownEnabled = useFilterDropdownEnabled();
|
|
148
220
|
const searchEnabled = useSearchEnabled();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations_screen.js","names":["useNavigation","React","useLayoutEffect","useRef","StyleSheet","View","Conversations","composeOptions","withRightClose","withRightText","Toast","ConversationsContextProvider","useConversationsContext","useFilterDropdownEnabled","analyticsEvents","usePublishProductAnalyticsEvent","useSearchEnabled","FilterDropdownListHeaderComponent","ListHeaderComponent","SearchListHeaderComponent","jsx","_jsx","jsxs","_jsxs","conversationsScreenOptions","title","onClose","headerTitle","headerBackVisible","onPress","ConversationsScreen","t0","$","_c","route","styles","useStyles","Header","useListHeaderComponent","conversation_index_opened","t1","Symbol","for","throwOnError","t2","params","t3","SelectModeHeader","t4","t5","args","opts","children","t6","t7","container","style","navigation","selectMode","selectedIds","clearSelection","hasEnteredSelectMode","selectedCount","length","current","setOptions","text","goBack","filterDropdownEnabled","searchEnabled","create","flex","justifyContent"],"sources":["../../../src/screens/conversations/conversations_screen.tsx"],"sourcesContent":["import { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useLayoutEffect, useRef } from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Conversations } from '../../components'\nimport {\n composeOptions,\n withRightClose,\n withRightText,\n} from '../../components/display/platform_modal_header_buttons'\nimport { Toast } from '../../components/display/toast'\nimport {\n ConversationsContextProvider,\n useConversationsContext,\n} from '../../contexts/conversations_context'\nimport { useFilterDropdownEnabled } from '../../hooks/use_filter_dropdown_enabled'\nimport { analyticsEvents, usePublishProductAnalyticsEvent } from '../../hooks/use_product_analytics'\nimport { useSearchEnabled } from '../../hooks/use_search_enabled'\nimport { AppName } from '../../types/resources/app_name'\nimport { GraphId } from '../../types/resources/group_resource'\nimport { FilterDropdownListHeaderComponent } from './components/filter_dropdown_list_header_component'\nimport { ListHeaderComponent } from './components/list_header_component'\nimport { SearchListHeaderComponent } from './components/search_list_header_component'\n\nexport type ConversationsScreenProps = StaticScreenProps<{\n title?: string\n chat_group_graph_id?: GraphId\n group_source_app_name?: AppName\n show_direct_messages?: boolean\n show_archived?: boolean\n show_hidden?: boolean\n show_unread?: boolean\n}>\n\nexport const conversationsScreenOptions = ({\n title,\n onClose,\n}: {\n title?: string\n onClose: () => void\n}) =>\n composeOptions(\n { headerTitle: title ?? 'Chat', headerBackVisible: false },\n withRightClose({ onPress: onClose })\n )\n\nexport function ConversationsScreen({ route }: ConversationsScreenProps) {\n const styles = useStyles()\n const Header = useListHeaderComponent()\n\n usePublishProductAnalyticsEvent(analyticsEvents.conversation_index_opened)\n\n return (\n <View style={styles.container}>\n <ConversationsContextProvider args={route.params} opts={{ throwOnError: true }}>\n <SelectModeHeader title={route.params?.title} />\n <Conversations ListHeaderComponent={Header} />\n </ConversationsContextProvider>\n <Toast />\n </View>\n )\n}\n\nfunction SelectModeHeader({ title }: { title?: string }) {\n const navigation = useNavigation()\n const { selectMode, selectedIds, clearSelection } = useConversationsContext()\n const hasEnteredSelectMode = useRef(false)\n const selectedCount = selectedIds.length\n\n useLayoutEffect(() => {\n if (selectMode) hasEnteredSelectMode.current = true\n if (!hasEnteredSelectMode.current) return\n\n navigation.setOptions(\n selectMode\n ? composeOptions(\n {\n headerTitle: selectedCount > 0 ? `${selectedCount} selected` : 'Select conversations',\n },\n withRightText({ text: 'Cancel', onPress: clearSelection })\n )\n : conversationsScreenOptions({ title, onClose: navigation.goBack })\n )\n }, [navigation, selectMode, selectedCount, clearSelection, title])\n\n return null\n}\n\nconst useListHeaderComponent = () => {\n const filterDropdownEnabled = useFilterDropdownEnabled()\n const searchEnabled = useSearchEnabled()\n\n if (filterDropdownEnabled) return FilterDropdownListHeaderComponent\n if (searchEnabled) return SearchListHeaderComponent\n\n return ListHeaderComponent\n}\n\nconst useStyles = () => {\n return StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n },\n })\n}\n"],"mappings":";AAAA,SAA4BA,aAAa,QAAQ,0BAA0B;AAC3E,OAAOC,KAAK,IAAIC,eAAe,EAAEC,MAAM,QAAQ,OAAO;AACtD,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAA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AQ,CAAC,CACtE,CAAC;IAAA,CACF;IAAEvB,EAAA,IAACa,UAAU,EAAEC,UAAU,EAAEI,aAAa,EAAEF,cAAc,EAAEnC,KAAK,CAAC;IAAAO,CAAA,MAAA4B,cAAA;IAAA5B,CAAA,MAAAyB,UAAA;IAAAzB,CAAA,MAAA0B,UAAA;IAAA1B,CAAA,MAAA8B,aAAA;IAAA9B,CAAA,MAAAP,KAAA;IAAAO,CAAA,MAAAQ,EAAA;IAAAR,CAAA,MAAAY,EAAA;EAAA;IAAAJ,EAAA,GAAAR,CAAA;IAAAY,EAAA,GAAAZ,CAAA;EAAA;EAdjE9B,eAAe,CAACsC,EAcf,EAAEI,EAA8D,CAAC;EAAA,OAE3D,IAAI;AAAA;AAGb,MAAMN,sBAAsB,GAAGA,CAAA;EAC7B,MAAA8B,qBAAA,GAA8BvD,wBAAwB,CAAC,CAAC;EACxD,MAAAwD,aAAA,GAAsBrD,gBAAgB,CAAC,CAAC;EAExC,IAAIoD,qBAAqB;IAAA,OAASnD,iCAAiC;EAAA;EACnE,IAAIoD,aAAa;IAAA,OAASlD,yBAAyB;EAAA;EAAA,OAE5CD,mBAAmB;AAAA,CAC3B;AAED,MAAMkB,SAAS,GAAGA,CAAA,KAAM;EACtB,OAAOhC,UAAU,CAACkE,MAAM,CAAC;IACvBf,SAAS,EAAE;MACTgB,IAAI,EAAE,CAAC;MACPC,cAAc,EAAE;IAClB;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"conversations_screen.js","names":["useNavigation","React","useEffect","useLayoutEffect","useRef","StyleSheet","View","Conversations","AppUpdateBanner","BulkConversationActionsBar","composeOptions","withRightClose","withRightText","Toast","ConversationsContextProvider","useConversationsContext","useFilterDropdownEnabled","analyticsEvents","usePublishProductAnalyticsEvent","useSearchEnabled","FilterDropdownListHeaderComponent","ListHeaderComponent","SearchListHeaderComponent","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","conversationsScreenOptions","title","onClose","headerTitle","headerBackVisible","onPress","ConversationsScreen","t0","$","_c","route","styles","useStyles","Header","useListHeaderComponent","conversation_index_opened","t1","Symbol","for","throwOnError","t2","params","t3","SelectModeHeader","t4","select_conversation_id","t5","SelectModeRequest","conversationId","t6","t7","t8","children","t9","t10","args","opts","t11","t12","container","style","navigation","selectMode","selectedIds","clearSelection","hasEnteredSelectMode","selectedCount","length","current","setOptions","text","goBack","enterSelectMode","undefined","setParams","filterDropdownEnabled","searchEnabled","create","flex","justifyContent"],"sources":["../../../src/screens/conversations/conversations_screen.tsx"],"sourcesContent":["import { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useEffect, useLayoutEffect, useRef } from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Conversations } from '../../components'\nimport { AppUpdateBanner } from '../../components/conversations/app_update_banner'\nimport { BulkConversationActionsBar } from '../../components/conversations/bulk_conversation_actions_bar'\nimport {\n composeOptions,\n withRightClose,\n withRightText,\n} from '../../components/display/platform_modal_header_buttons'\nimport { Toast } from '../../components/display/toast'\nimport {\n ConversationsContextProvider,\n useConversationsContext,\n} from '../../contexts/conversations_context'\nimport { useFilterDropdownEnabled } from '../../hooks/use_filter_dropdown_enabled'\nimport { analyticsEvents, usePublishProductAnalyticsEvent } from '../../hooks/use_product_analytics'\nimport { useSearchEnabled } from '../../hooks/use_search_enabled'\nimport { AppName } from '../../types/resources/app_name'\nimport { GraphId } from '../../types/resources/group_resource'\nimport { FilterDropdownListHeaderComponent } from './components/filter_dropdown_list_header_component'\nimport { ListHeaderComponent } from './components/list_header_component'\nimport { SearchListHeaderComponent } from './components/search_list_header_component'\n\nexport type ConversationsScreenProps = StaticScreenProps<{\n title?: string\n chat_group_graph_id?: GraphId\n group_source_app_name?: AppName\n show_direct_messages?: boolean\n show_archived?: boolean\n show_hidden?: boolean\n show_unread?: boolean\n select_conversation_id?: number\n}>\n\nexport const conversationsScreenOptions = ({\n title,\n onClose,\n}: {\n title?: string\n onClose: () => void\n}) =>\n composeOptions(\n { headerTitle: title ?? 'Chat', headerBackVisible: false },\n withRightClose({ onPress: onClose })\n )\n\nexport function ConversationsScreen({ route }: ConversationsScreenProps) {\n const styles = useStyles()\n const Header = useListHeaderComponent()\n\n usePublishProductAnalyticsEvent(analyticsEvents.conversation_index_opened)\n\n return (\n <View style={styles.container}>\n <ConversationsContextProvider args={route.params} opts={{ throwOnError: true }}>\n <SelectModeHeader title={route.params?.title} />\n <SelectModeRequest conversationId={route.params?.select_conversation_id} />\n <Conversations\n ListHeaderComponent={\n <>\n <Header />\n <AppUpdateBanner />\n </>\n }\n />\n <BulkConversationActionsBar />\n </ConversationsContextProvider>\n <Toast />\n </View>\n )\n}\n\nfunction SelectModeHeader({ title }: { title?: string }) {\n const navigation = useNavigation()\n const { selectMode, selectedIds, clearSelection } = useConversationsContext()\n const hasEnteredSelectMode = useRef(false)\n const selectedCount = selectedIds.length\n\n useLayoutEffect(() => {\n if (selectMode) hasEnteredSelectMode.current = true\n if (!hasEnteredSelectMode.current) return\n\n navigation.setOptions(\n selectMode\n ? composeOptions(\n {\n headerTitle: selectedCount > 0 ? `${selectedCount} selected` : 'Select conversations',\n },\n withRightText({ text: 'Cancel', onPress: clearSelection })\n )\n : conversationsScreenOptions({ title, onClose: navigation.goBack })\n )\n }, [navigation, selectMode, selectedCount, clearSelection, title])\n\n return null\n}\n\nfunction SelectModeRequest({ conversationId }: { conversationId?: number }) {\n const navigation = useNavigation()\n const { enterSelectMode } = useConversationsContext()\n\n useEffect(() => {\n if (conversationId === undefined) return\n\n enterSelectMode(conversationId)\n navigation.setParams({ select_conversation_id: undefined })\n }, [conversationId, enterSelectMode, navigation])\n\n return null\n}\n\nconst useListHeaderComponent = () => {\n const filterDropdownEnabled = useFilterDropdownEnabled()\n const searchEnabled = useSearchEnabled()\n\n if (filterDropdownEnabled) return FilterDropdownListHeaderComponent\n if (searchEnabled) return SearchListHeaderComponent\n\n return ListHeaderComponent\n}\n\nconst useStyles = () => {\n return StyleShe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C,CAAA,MAAAiC,UAAA;IAAAjC,CAAA,MAAAQ,EAAA;IAAAR,CAAA,MAAAY,EAAA;EAAA;IAAAJ,EAAA,GAAAR,CAAA;IAAAY,EAAA,GAAAZ,CAAA;EAAA;EALhDnC,SAAS,CAAC2C,EAKT,EAAEI,EAA6C,CAAC;EAAA,OAE1C,IAAI;AAAA;AAGb,MAAMN,sBAAsB,GAAGA,CAAA;EAC7B,MAAAyC,qBAAA,GAA8BpE,wBAAwB,CAAC,CAAC;EACxD,MAAAqE,aAAA,GAAsBlE,gBAAgB,CAAC,CAAC;EAExC,IAAIiE,qBAAqB;IAAA,OAAShE,iCAAiC;EAAA;EACnE,IAAIiE,aAAa;IAAA,OAAS/D,yBAAyB;EAAA;EAAA,OAE5CD,mBAAmB;AAAA,CAC3B;AAED,MAAMoB,SAAS,GAAGA,CAAA,KAAM;EACtB,OAAOpC,UAAU,CAACiF,MAAM,CAAC;IACvBlB,SAAS,EAAE;MACTmB,IAAI,EAAE,CAAC;MACPC,cAAc,EAAE;IAClB;EACF,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
package/build/utils/theme.js
CHANGED
|
@@ -63,20 +63,20 @@ const colorsChatLight = {
|
|
|
63
63
|
statusErrorText: tokens.textColorStatusError,
|
|
64
64
|
statusErrorBorder: tokens.borderColorStatusError,
|
|
65
65
|
statusErrorFill: tokens.fillColorStatusErrorSolid,
|
|
66
|
-
statusInfoComposedIcon: tokens.
|
|
67
|
-
statusInfoComposedText: tokens.
|
|
66
|
+
statusInfoComposedIcon: tokens.textColorStatusInfo,
|
|
67
|
+
statusInfoComposedText: tokens.colorNeutral24,
|
|
68
68
|
statusInfoComposedBackground: tokens.fillColorStatusInfoGhost,
|
|
69
|
-
statusSuccessComposedIcon: tokens.
|
|
70
|
-
statusSuccessComposedText: tokens.
|
|
69
|
+
statusSuccessComposedIcon: tokens.textColorStatusSuccess,
|
|
70
|
+
statusSuccessComposedText: tokens.colorNeutral24,
|
|
71
71
|
statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhost,
|
|
72
|
-
statusWarningComposedIcon: tokens.
|
|
73
|
-
statusWarningComposedText: tokens.
|
|
72
|
+
statusWarningComposedIcon: tokens.textColorStatusWarning,
|
|
73
|
+
statusWarningComposedText: tokens.colorNeutral24,
|
|
74
74
|
statusWarningComposedBackground: tokens.fillColorStatusWarningGhost,
|
|
75
|
-
statusErrorComposedIcon: tokens.
|
|
76
|
-
statusErrorComposedText: tokens.
|
|
75
|
+
statusErrorComposedIcon: tokens.textColorStatusError,
|
|
76
|
+
statusErrorComposedText: tokens.colorNeutral24,
|
|
77
77
|
statusErrorComposedBackground: tokens.fillColorStatusErrorGhost,
|
|
78
|
-
statusNeutralComposedIcon: tokens.
|
|
79
|
-
statusNeutralComposedText: tokens.
|
|
78
|
+
statusNeutralComposedIcon: tokens.textColorStatusNeutral,
|
|
79
|
+
statusNeutralComposedText: tokens.colorNeutral24,
|
|
80
80
|
statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhost,
|
|
81
81
|
borderColorChip: tokens.colorNeutral88,
|
|
82
82
|
fillColorChip: 'transparent',
|
|
@@ -108,21 +108,20 @@ const colorsChatDark = {
|
|
|
108
108
|
statusErrorText: tokens.textColorStatusErrorDark,
|
|
109
109
|
statusErrorBorder: tokens.borderColorStatusErrorDark,
|
|
110
110
|
statusErrorFill: tokens.fillColorStatusErrorSolidDark,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
statusInfoComposedText: tokens.textColorStatusInfoDark,
|
|
111
|
+
statusInfoComposedIcon: tokens.textColorStatusInfoDark,
|
|
112
|
+
statusInfoComposedText: tokens.colorNeutral88,
|
|
114
113
|
statusInfoComposedBackground: tokens.fillColorStatusInfoGhostDark,
|
|
115
|
-
statusSuccessComposedIcon: tokens.
|
|
116
|
-
statusSuccessComposedText: tokens.
|
|
114
|
+
statusSuccessComposedIcon: tokens.textColorStatusSuccessDark,
|
|
115
|
+
statusSuccessComposedText: tokens.colorNeutral88,
|
|
117
116
|
statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhostDark,
|
|
118
|
-
statusWarningComposedIcon: tokens.
|
|
119
|
-
statusWarningComposedText: tokens.
|
|
117
|
+
statusWarningComposedIcon: tokens.textColorStatusWarningDark,
|
|
118
|
+
statusWarningComposedText: tokens.colorNeutral88,
|
|
120
119
|
statusWarningComposedBackground: tokens.fillColorStatusWarningGhostDark,
|
|
121
|
-
statusErrorComposedIcon: tokens.
|
|
122
|
-
statusErrorComposedText: tokens.
|
|
120
|
+
statusErrorComposedIcon: tokens.textColorStatusErrorDark,
|
|
121
|
+
statusErrorComposedText: tokens.colorNeutral88,
|
|
123
122
|
statusErrorComposedBackground: tokens.fillColorStatusErrorGhostDark,
|
|
124
|
-
statusNeutralComposedIcon: tokens.
|
|
125
|
-
statusNeutralComposedText: tokens.
|
|
123
|
+
statusNeutralComposedIcon: tokens.textColorStatusNeutralDark,
|
|
124
|
+
statusNeutralComposedText: tokens.colorNeutral88,
|
|
126
125
|
statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhostDark,
|
|
127
126
|
borderColorChip: tokens.colorNeutral24,
|
|
128
127
|
fillColorChip: 'transparent',
|
package/build/utils/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","names":["Platform","PlatformColor","aliasTokensColorMap","tokens","defaultTheme","colorScheme","scheme","defaultColors","chatThemeColorMap","colors","button","borderRadius","chip","hslLightnessChipSelected","showBadgeProductLogo","iOSLinkColor","OS","undefined","colorsChatLight","name","androidModalHeaderButtonTextColor","fillColorInteractionDefault","iOSModalHeaderButtonTextColor","buttonStart","buttonEnd","interaction","androidSwitchThumbColor","conversationActionsBackground","colorNeutral100White","testColor","statusInfoIcon","iconColorStatusInfoPrimary","statusInfoText","textColorStatusInfo","statusInfoBorder","borderColorStatusInfo","statusInfoFill","fillColorStatusInfoSolid","statusSuccessIcon","iconColorStatusSuccessPrimary","statusSuccessText","textColorStatusSuccess","statusSuccessBorder","borderColorStatusSuccess","statusSuccessFill","fillColorStatusSuccessSolid","statusWarningIcon","iconColorStatusWarningPrimary","statusWarningText","textColorStatusWarning","statusWarningBorder","borderColorStatusWarning","statusWarningFill","fillColorStatusWarningSolid","statusErrorIcon","iconColorStatusErrorPrimary","statusErrorText","textColorStatusError","statusErrorBorder","borderColorStatusError","statusErrorFill","fillColorStatusErrorSolid","statusInfoComposedIcon","statusInfoComposedText","statusInfoComposedBackground","fillColorStatusInfoGhost","statusSuccessComposedIcon","statusSuccessComposedText","statusSuccessComposedBackground","fillColorStatusSuccessGhost","statusWarningComposedIcon","statusWarningComposedText","statusWarningComposedBackground","fillColorStatusWarningGhost","statusErrorComposedIcon","statusErrorComposedText","statusErrorComposedBackground","fillColorStatusErrorGhost","statusNeutralComposedIcon","iconColorStatusNeutralPrimary","statusNeutralComposedText","textColorStatusNeutral","statusNeutralComposedBackground","fillColorStatusNeutralGhost","borderColorChip","colorNeutral88","fillColorChip","textColorChip","colorNeutral45","colorsChatDark","fillColorInteractionDefaultDark","colorNeutral7","iconColorStatusInfoPrimaryDark","textColorStatusInfoDark","borderColorStatusInfoDark","fillColorStatusInfoSolidDark","iconColorStatusSuccessPrimaryDark","textColorStatusSuccessDark","borderColorStatusSuccessDark","fillColorStatusSuccessSolidDark","iconColorStatusWarningPrimaryDark","textColorStatusWarningDark","borderColorStatusWarningDark","fillColorStatusWarningSolidDark","iconColorStatusErrorPrimaryDark","textColorStatusErrorDark","borderColorStatusErrorDark","fillColorStatusErrorSolidDark","fillColorStatusInfoGhostDark","fillColorStatusSuccessGhostDark","fillColorStatusWarningGhostDark","fillColorStatusErrorGhostDark","iconColorStatusNeutralPrimaryDark","textColorStatusNeutralDark","fillColorStatusNeutralGhostDark","colorNeutral24","colorNeutral68","light","dark"],"sources":["../../src/utils/theme.ts"],"sourcesContent":["import { Platform, PlatformColor } from 'react-native'\nimport type { ColorSchemeName, ColorValue, OpaqueColorValue } from 'react-native'\nimport { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map'\nimport { tokens } from '../vendor/tapestry/tokens'\n\nexport interface ChatTheme extends DefaultTheme {\n colors: DefaultTheme['colors'] &\n (typeof aliasTokensColorMap.light | typeof aliasTokensColorMap.dark)\n}\n\n/** =============================================\n NOTE: The specific values for `colors` and the `productBadge` are temporary examples that can be replaced once we start building out UI. This line's comment can be removed at that time too.\n\n The default theme is intended to support two types of customizations:\n 1. Specific color properties for a chat component (eg. `primaryButtonBackgroundColor`)\n 2. Any styles for a specific component. (Use only one level of nesting.)\n ```\n primaryButton: {\n borderRadius: number\n container: ViewStyle\n text: TextStyle\n }\n ```\n============================================= */\n\nexport interface DefaultTheme {\n colors: ChatColors\n button: {\n borderRadius: number\n }\n chip: {\n hslLightnessChipSelected: number\n }\n showBadgeProductLogo: boolean\n}\n\nexport const defaultTheme = (colorScheme: ColorSchemeName | null): ChatTheme => {\n const scheme: 'light' | 'dark' = colorScheme === 'dark' ? 'dark' : 'light'\n\n const defaultColors = {\n ...chatThemeColorMap[scheme],\n ...aliasTokensColorMap[scheme],\n }\n\n return {\n colors: defaultColors,\n button: {\n borderRadius: 40,\n },\n chip: {\n hslLightnessChipSelected: scheme === 'dark' ? 12 : 92,\n },\n showBadgeProductLogo: true, // Overrides visibility of the product logo in `src/display/badge.tsx`\n }\n}\n\nexport type TemporaryDefaultColorsType = Partial<ChatColors>\n\ninterface ChatColors {\n name: string\n buttonStart: string | undefined\n buttonEnd: string | undefined\n interaction: string\n androidModalHeaderButtonTextColor: ColorValue | string | undefined\n iOSModalHeaderButtonTextColor: OpaqueColorValue | string | undefined\n androidSwitchThumbColor: string | undefined\n conversationActionsBackground: string\n testColor: string\n statusSuccessIcon: string\n statusSuccessText: string\n statusSuccessBorder: string\n statusSuccessFill: string\n statusInfoIcon: string\n statusInfoText: string\n statusInfoBorder: string\n statusInfoFill: string\n statusWarningIcon: string\n statusWarningText: string\n statusWarningBorder: string\n statusWarningFill: string\n statusErrorIcon: string\n statusErrorText: string\n statusErrorBorder: string\n statusErrorFill: string\n statusSuccessComposedIcon: string\n statusSuccessComposedText: string\n statusSuccessComposedBackground: string\n statusInfoComposedIcon: string\n statusInfoComposedText: string\n statusInfoComposedBackground: string\n statusWarningComposedIcon: string\n statusWarningComposedText: string\n statusWarningComposedBackground: string\n statusErrorComposedIcon: string\n statusErrorComposedText: string\n statusErrorComposedBackground: string\n statusNeutralComposedIcon: string\n statusNeutralComposedText: string\n statusNeutralComposedBackground: string\n borderColorChip: string\n fillColorChip: string\n textColorChip: string\n /**\n * Selected-chip colors (border/fill/text). Never assign a static default\n * directly — these stay optional so they always fall back to\n * `colors.interaction` via `??` at the read site. Every current consumer\n * overrides `interaction` at runtime, and a seeded default here could win\n * over that override depending on merge order.\n */\n borderColorChipSelected?: string\n fillColorChipSelected?: string\n textColorChipSelected?: string\n}\n\n// 'link' is an iOS-only semantic color name — constructing it on Android is\n// undefined behavior, so only build it when the code is actually running on iOS\nconst iOSLinkColor = Platform.OS === 'ios' ? PlatformColor('link') : undefined\n\nconst colorsChatLight: ChatColors = {\n name: 'light',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefault,\n iOSModalHeaderButtonTextColor: iOSLinkColor,\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefault,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral100White,\n testColor: 'hotpink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoText: tokens.textColorStatusInfo,\n statusInfoBorder: tokens.borderColorStatusInfo,\n statusInfoFill: tokens.fillColorStatusInfoSolid,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessText: tokens.textColorStatusSuccess,\n statusSuccessBorder: tokens.borderColorStatusSuccess,\n statusSuccessFill: tokens.fillColorStatusSuccessSolid,\n statusWarningIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningText: tokens.textColorStatusWarning,\n statusWarningBorder: tokens.borderColorStatusWarning,\n statusWarningFill: tokens.fillColorStatusWarningSolid,\n statusErrorIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorText: tokens.textColorStatusError,\n statusErrorBorder: tokens.borderColorStatusError,\n statusErrorFill: tokens.fillColorStatusErrorSolid,\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoComposedText: tokens.textColorStatusInfo,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhost,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessComposedText: tokens.textColorStatusSuccess,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhost,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningComposedText: tokens.textColorStatusWarning,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhost,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorComposedText: tokens.textColorStatusError,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhost,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimary,\n statusNeutralComposedText: tokens.textColorStatusNeutral,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhost,\n borderColorChip: tokens.colorNeutral88,\n fillColorChip: 'transparent',\n textColorChip: tokens.colorNeutral45,\n}\n\nconst colorsChatDark: ChatColors = {\n name: 'dark',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefaultDark,\n iOSModalHeaderButtonTextColor: iOSLinkColor,\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefaultDark,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral7,\n testColor: 'pink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoText: tokens.textColorStatusInfoDark,\n statusInfoBorder: tokens.borderColorStatusInfoDark,\n statusInfoFill: tokens.fillColorStatusInfoSolidDark,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessText: tokens.textColorStatusSuccessDark,\n statusSuccessBorder: tokens.borderColorStatusSuccessDark,\n statusSuccessFill: tokens.fillColorStatusSuccessSolidDark,\n statusWarningIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningText: tokens.textColorStatusWarningDark,\n statusWarningBorder: tokens.borderColorStatusWarningDark,\n statusWarningFill: tokens.fillColorStatusWarningSolidDark,\n statusErrorIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorText: tokens.textColorStatusErrorDark,\n statusErrorBorder: tokens.borderColorStatusErrorDark,\n statusErrorFill: tokens.fillColorStatusErrorSolidDark,\n\n // Note: CCA inverts composed status colors in dark mode\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoComposedText: tokens.textColorStatusInfoDark,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhostDark,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessComposedText: tokens.textColorStatusSuccessDark,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhostDark,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningComposedText: tokens.textColorStatusWarningDark,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhostDark,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorComposedText: tokens.textColorStatusErrorDark,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhostDark,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimaryDark,\n statusNeutralComposedText: tokens.textColorStatusNeutralDark,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhostDark,\n borderColorChip: tokens.colorNeutral24,\n fillColorChip: 'transparent',\n textColorChip: tokens.colorNeutral68,\n}\n\nconst chatThemeColorMap = {\n light: colorsChatLight,\n dark: colorsChatDark,\n}\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,aAAa,QAAQ,cAAc;AAEtD,SAASC,mBAAmB,QAAQ,2CAA2C;AAC/E,SAASC,MAAM,QAAQ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F,uBAAuB;EACtD7B,4BAA4B,EAAE7D,MAAM,CAACyG,4BAA4B;EACjE1C,yBAAyB,EAAE/D,MAAM,CAAC6F,iCAAiC;EACnE7B,yBAAyB,EAAEhE,MAAM,CAAC8F,0BAA0B;EAC5D7B,+BAA+B,EAAEjE,MAAM,CAAC0G,+BAA+B;EACvEvC,yBAAyB,EAAEnE,MAAM,CAACiG,iCAAiC;EACnE7B,yBAAyB,EAAEpE,MAAM,CAACkG,0BAA0B;EAC5D7B,+BAA+B,EAAErE,MAAM,CAAC2G,+BAA+B;EACvEpC,uBAAuB,EAAEvE,MAAM,CAACqG,+BAA+B;EAC/D7B,uBAAuB,EAAExE,MAAM,CAACsG,wBAAwB;EACxD7B,6BAA6B,EAAEzE,MAAM,CAAC4G,6BAA6B;EACnEjC,yBAAyB,EAAE3E,MAAM,CAAC6G,iCAAiC;EACnEhC,yBAAyB,EAAE7E,MAAM,CAAC8G,0BAA0B;EAC5D/B,+BAA+B,EAAE/E,MAAM,CAAC+G,+BAA+B;EACvE9B,eAAe,EAAEjF,MAAM,CAACgH,cAAc;EACtC7B,aAAa,EAAE,aAAa;EAC5BC,aAAa,EAAEpF,MAAM,CAACiH;AACxB,CAAC;AAED,MAAM5G,iBAAiB,GAAG;EACxB6G,KAAK,EAAEnG,eAAe;EACtBoG,IAAI,EAAE7B;AACR,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"theme.js","names":["Platform","PlatformColor","aliasTokensColorMap","tokens","defaultTheme","colorScheme","scheme","defaultColors","chatThemeColorMap","colors","button","borderRadius","chip","hslLightnessChipSelected","showBadgeProductLogo","iOSLinkColor","OS","undefined","colorsChatLight","name","androidModalHeaderButtonTextColor","fillColorInteractionDefault","iOSModalHeaderButtonTextColor","buttonStart","buttonEnd","interaction","androidSwitchThumbColor","conversationActionsBackground","colorNeutral100White","testColor","statusInfoIcon","iconColorStatusInfoPrimary","statusInfoText","textColorStatusInfo","statusInfoBorder","borderColorStatusInfo","statusInfoFill","fillColorStatusInfoSolid","statusSuccessIcon","iconColorStatusSuccessPrimary","statusSuccessText","textColorStatusSuccess","statusSuccessBorder","borderColorStatusSuccess","statusSuccessFill","fillColorStatusSuccessSolid","statusWarningIcon","iconColorStatusWarningPrimary","statusWarningText","textColorStatusWarning","statusWarningBorder","borderColorStatusWarning","statusWarningFill","fillColorStatusWarningSolid","statusErrorIcon","iconColorStatusErrorPrimary","statusErrorText","textColorStatusError","statusErrorBorder","borderColorStatusError","statusErrorFill","fillColorStatusErrorSolid","statusInfoComposedIcon","statusInfoComposedText","colorNeutral24","statusInfoComposedBackground","fillColorStatusInfoGhost","statusSuccessComposedIcon","statusSuccessComposedText","statusSuccessComposedBackground","fillColorStatusSuccessGhost","statusWarningComposedIcon","statusWarningComposedText","statusWarningComposedBackground","fillColorStatusWarningGhost","statusErrorComposedIcon","statusErrorComposedText","statusErrorComposedBackground","fillColorStatusErrorGhost","statusNeutralComposedIcon","textColorStatusNeutral","statusNeutralComposedText","statusNeutralComposedBackground","fillColorStatusNeutralGhost","borderColorChip","colorNeutral88","fillColorChip","textColorChip","colorNeutral45","colorsChatDark","fillColorInteractionDefaultDark","colorNeutral7","iconColorStatusInfoPrimaryDark","textColorStatusInfoDark","borderColorStatusInfoDark","fillColorStatusInfoSolidDark","iconColorStatusSuccessPrimaryDark","textColorStatusSuccessDark","borderColorStatusSuccessDark","fillColorStatusSuccessSolidDark","iconColorStatusWarningPrimaryDark","textColorStatusWarningDark","borderColorStatusWarningDark","fillColorStatusWarningSolidDark","iconColorStatusErrorPrimaryDark","textColorStatusErrorDark","borderColorStatusErrorDark","fillColorStatusErrorSolidDark","fillColorStatusInfoGhostDark","fillColorStatusSuccessGhostDark","fillColorStatusWarningGhostDark","fillColorStatusErrorGhostDark","textColorStatusNeutralDark","fillColorStatusNeutralGhostDark","colorNeutral68","light","dark"],"sources":["../../src/utils/theme.ts"],"sourcesContent":["import { Platform, PlatformColor } from 'react-native'\nimport type { ColorSchemeName, ColorValue, OpaqueColorValue } from 'react-native'\nimport { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map'\nimport { tokens } from '../vendor/tapestry/tokens'\n\nexport interface ChatTheme extends DefaultTheme {\n colors: DefaultTheme['colors'] &\n (typeof aliasTokensColorMap.light | typeof aliasTokensColorMap.dark)\n}\n\n/** =============================================\n NOTE: The specific values for `colors` and the `productBadge` are temporary examples that can be replaced once we start building out UI. This line's comment can be removed at that time too.\n\n The default theme is intended to support two types of customizations:\n 1. Specific color properties for a chat component (eg. `primaryButtonBackgroundColor`)\n 2. Any styles for a specific component. (Use only one level of nesting.)\n ```\n primaryButton: {\n borderRadius: number\n container: ViewStyle\n text: TextStyle\n }\n ```\n============================================= */\n\nexport interface DefaultTheme {\n colors: ChatColors\n button: {\n borderRadius: number\n }\n chip: {\n hslLightnessChipSelected: number\n }\n showBadgeProductLogo: boolean\n}\n\nexport const defaultTheme = (colorScheme: ColorSchemeName | null): ChatTheme => {\n const scheme: 'light' | 'dark' = colorScheme === 'dark' ? 'dark' : 'light'\n\n const defaultColors = {\n ...chatThemeColorMap[scheme],\n ...aliasTokensColorMap[scheme],\n }\n\n return {\n colors: defaultColors,\n button: {\n borderRadius: 40,\n },\n chip: {\n hslLightnessChipSelected: scheme === 'dark' ? 12 : 92,\n },\n showBadgeProductLogo: true, // Overrides visibility of the product logo in `src/display/badge.tsx`\n }\n}\n\nexport type TemporaryDefaultColorsType = Partial<ChatColors>\n\ninterface ChatColors {\n name: string\n buttonStart: string | undefined\n buttonEnd: string | undefined\n interaction: string\n androidModalHeaderButtonTextColor: ColorValue | string | undefined\n iOSModalHeaderButtonTextColor: OpaqueColorValue | string | undefined\n androidSwitchThumbColor: string | undefined\n conversationActionsBackground: string\n testColor: string\n statusSuccessIcon: string\n statusSuccessText: string\n statusSuccessBorder: string\n statusSuccessFill: string\n statusInfoIcon: string\n statusInfoText: string\n statusInfoBorder: string\n statusInfoFill: string\n statusWarningIcon: string\n statusWarningText: string\n statusWarningBorder: string\n statusWarningFill: string\n statusErrorIcon: string\n statusErrorText: string\n statusErrorBorder: string\n statusErrorFill: string\n statusSuccessComposedIcon: string\n statusSuccessComposedText: string\n statusSuccessComposedBackground: string\n statusInfoComposedIcon: string\n statusInfoComposedText: string\n statusInfoComposedBackground: string\n statusWarningComposedIcon: string\n statusWarningComposedText: string\n statusWarningComposedBackground: string\n statusErrorComposedIcon: string\n statusErrorComposedText: string\n statusErrorComposedBackground: string\n statusNeutralComposedIcon: string\n statusNeutralComposedText: string\n statusNeutralComposedBackground: string\n borderColorChip: string\n fillColorChip: string\n textColorChip: string\n /**\n * Selected-chip colors (border/fill/text). Never assign a static default\n * directly — these stay optional so they always fall back to\n * `colors.interaction` via `??` at the read site. Every current consumer\n * overrides `interaction` at runtime, and a seeded default here could win\n * over that override depending on merge order.\n */\n borderColorChipSelected?: string\n fillColorChipSelected?: string\n textColorChipSelected?: string\n}\n\n// 'link' is an iOS-only semantic color name — constructing it on Android is\n// undefined behavior, so only build it when the code is actually running on iOS\nconst iOSLinkColor = Platform.OS === 'ios' ? PlatformColor('link') : undefined\n\nconst colorsChatLight: ChatColors = {\n name: 'light',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefault,\n iOSModalHeaderButtonTextColor: iOSLinkColor,\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefault,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral100White,\n testColor: 'hotpink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoText: tokens.textColorStatusInfo,\n statusInfoBorder: tokens.borderColorStatusInfo,\n statusInfoFill: tokens.fillColorStatusInfoSolid,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessText: tokens.textColorStatusSuccess,\n statusSuccessBorder: tokens.borderColorStatusSuccess,\n statusSuccessFill: tokens.fillColorStatusSuccessSolid,\n statusWarningIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningText: tokens.textColorStatusWarning,\n statusWarningBorder: tokens.borderColorStatusWarning,\n statusWarningFill: tokens.fillColorStatusWarningSolid,\n statusErrorIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorText: tokens.textColorStatusError,\n statusErrorBorder: tokens.borderColorStatusError,\n statusErrorFill: tokens.fillColorStatusErrorSolid,\n statusInfoComposedIcon: tokens.textColorStatusInfo,\n statusInfoComposedText: tokens.colorNeutral24,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhost,\n statusSuccessComposedIcon: tokens.textColorStatusSuccess,\n statusSuccessComposedText: tokens.colorNeutral24,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhost,\n statusWarningComposedIcon: tokens.textColorStatusWarning,\n statusWarningComposedText: tokens.colorNeutral24,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhost,\n statusErrorComposedIcon: tokens.textColorStatusError,\n statusErrorComposedText: tokens.colorNeutral24,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhost,\n statusNeutralComposedIcon: tokens.textColorStatusNeutral,\n statusNeutralComposedText: tokens.colorNeutral24,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhost,\n borderColorChip: tokens.colorNeutral88,\n fillColorChip: 'transparent',\n textColorChip: tokens.colorNeutral45,\n}\n\nconst colorsChatDark: ChatColors = {\n name: 'dark',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefaultDark,\n iOSModalHeaderButtonTextColor: iOSLinkColor,\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefaultDark,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral7,\n testColor: 'pink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoText: tokens.textColorStatusInfoDark,\n statusInfoBorder: tokens.borderColorStatusInfoDark,\n statusInfoFill: tokens.fillColorStatusInfoSolidDark,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessText: tokens.textColorStatusSuccessDark,\n statusSuccessBorder: tokens.borderColorStatusSuccessDark,\n statusSuccessFill: tokens.fillColorStatusSuccessSolidDark,\n statusWarningIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningText: tokens.textColorStatusWarningDark,\n statusWarningBorder: tokens.borderColorStatusWarningDark,\n statusWarningFill: tokens.fillColorStatusWarningSolidDark,\n statusErrorIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorText: tokens.textColorStatusErrorDark,\n statusErrorBorder: tokens.borderColorStatusErrorDark,\n statusErrorFill: tokens.fillColorStatusErrorSolidDark,\n\n statusInfoComposedIcon: tokens.textColorStatusInfoDark,\n statusInfoComposedText: tokens.colorNeutral88,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhostDark,\n statusSuccessComposedIcon: tokens.textColorStatusSuccessDark,\n statusSuccessComposedText: tokens.colorNeutral88,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhostDark,\n statusWarningComposedIcon: tokens.textColorStatusWarningDark,\n statusWarningComposedText: tokens.colorNeutral88,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhostDark,\n statusErrorComposedIcon: tokens.textColorStatusErrorDark,\n statusErrorComposedText: tokens.colorNeutral88,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhostDark,\n statusNeutralComposedIcon: tokens.textColorStatusNeutralDark,\n statusNeutralComposedText: tokens.colorNeutral88,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhostDark,\n borderColorChip: tokens.colorNeutral24,\n fillColorChip: 'transparent',\n textColorChip: tokens.colorNeutral68,\n}\n\nconst chatThemeColorMap = {\n light: colorsChatLight,\n dark: colorsChatDark,\n}\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,aAAa,QAAQ,cAAc;AAEtD,SAASC,mBAAmB,QAAQ,2CAA2C;AAC/E,SAASC,MAAM,QAAQ,2BAA2B;;AAOlD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAaA,OAAO,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AAyB,EAAEjE,MAAM,CAACkF,cAAc;EAChDhB,+BAA+B,EAAElE,MAAM,CAAC0G,+BAA+B;EACvEtC,yBAAyB,EAAEpE,MAAM,CAACkG,0BAA0B;EAC5D7B,yBAAyB,EAAErE,MAAM,CAACkF,cAAc;EAChDZ,+BAA+B,EAAEtE,MAAM,CAAC2G,+BAA+B;EACvEnC,uBAAuB,EAAExE,MAAM,CAACsG,wBAAwB;EACxD7B,uBAAuB,EAAEzE,MAAM,CAACkF,cAAc;EAC9CR,6BAA6B,EAAE1E,MAAM,CAAC4G,6BAA6B;EACnEhC,yBAAyB,EAAE5E,MAAM,CAAC6G,0BAA0B;EAC5D/B,yBAAyB,EAAE9E,MAAM,CAACkF,cAAc;EAChDH,+BAA+B,EAAE/E,MAAM,CAAC8G,+BAA+B;EACvE7B,eAAe,EAAEjF,MAAM,CAAC6D,cAAc;EACtCsB,aAAa,EAAE,aAAa;EAC5BC,aAAa,EAAEpF,MAAM,CAAC+G;AACxB,CAAC;AAED,MAAM1G,iBAAiB,GAAG;EACxB2G,KAAK,EAAEjG,eAAe;EACtBkG,IAAI,EAAE3B;AACR,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "4.8.0
|
|
3
|
+
"version": "4.8.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"sf-symbols-typescript": "^2.2.0",
|
|
85
85
|
"typescript": "~6.0.3"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "94ea3fc9776b8fbb0871ad95427b539bf52739bc"
|
|
88
88
|
}
|
|
@@ -2,6 +2,7 @@ import { DefaultTheme, ThemeProvider } from '@react-navigation/native'
|
|
|
2
2
|
import { QueryClientProvider, notifyManager } from '@tanstack/react-query'
|
|
3
3
|
import { act, fireEvent, render, screen } from '@testing-library/react-native'
|
|
4
4
|
import React from 'react'
|
|
5
|
+
import { TextInput } from 'react-native'
|
|
5
6
|
import { chatQueryClient } from '../../../contexts/api_provider'
|
|
6
7
|
import type { ConversationResource } from '../../../types'
|
|
7
8
|
import { MessageForm } from '../message_form'
|
|
@@ -60,7 +61,7 @@ describe('MessageForm', () => {
|
|
|
60
61
|
await act(async () => finishSend({ data: { type: 'Message', id: 'sent', mine: true } }))
|
|
61
62
|
})
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
function renderForm() {
|
|
64
65
|
render(
|
|
65
66
|
<QueryClientProvider client={chatQueryClient}>
|
|
66
67
|
<ThemeProvider value={DefaultTheme}>
|
|
@@ -71,13 +72,29 @@ describe('MessageForm', () => {
|
|
|
71
72
|
</ThemeProvider>
|
|
72
73
|
</QueryClientProvider>
|
|
73
74
|
)
|
|
75
|
+
}
|
|
74
76
|
|
|
75
|
-
|
|
77
|
+
async function sendMessage(text: string) {
|
|
78
|
+
fireEvent.changeText(screen.getByTestId('message-composer-input'), text)
|
|
76
79
|
await act(async () => {
|
|
77
80
|
fireEvent.press(screen.getByLabelText('Send message'))
|
|
78
81
|
})
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
it('keeps the input editable while a sent message is in flight', async () => {
|
|
85
|
+
renderForm()
|
|
86
|
+
await sendMessage('hello')
|
|
79
87
|
|
|
80
88
|
expect(mockPost).toHaveBeenCalled()
|
|
81
89
|
expect(screen.getByTestId('message-composer-input').props.editable).toBe(true)
|
|
82
90
|
})
|
|
91
|
+
|
|
92
|
+
it('clears the native input after sending so iOS resizes the composer', async () => {
|
|
93
|
+
const clear = jest.spyOn(TextInput.prototype, 'clear')
|
|
94
|
+
renderForm()
|
|
95
|
+
await sendMessage('a message long enough to wrap onto more than one line in the composer')
|
|
96
|
+
|
|
97
|
+
expect(clear).toHaveBeenCalled()
|
|
98
|
+
expect(screen.getByTestId('message-composer-input').props.value).toBe('')
|
|
99
|
+
})
|
|
83
100
|
})
|
|
@@ -89,6 +89,7 @@ const MessageFormContext = React.createContext<{
|
|
|
89
89
|
reset: () => void
|
|
90
90
|
replyRootId?: string | null
|
|
91
91
|
replyRootAuthorFirstName?: string | null
|
|
92
|
+
inputRef?: React.RefObject<TextInput | null>
|
|
92
93
|
}>({
|
|
93
94
|
text: '',
|
|
94
95
|
setText: (_text: string) => {},
|
|
@@ -144,10 +145,12 @@ function MessageFormRoot({
|
|
|
144
145
|
onFlaggedInMessageForm,
|
|
145
146
|
})
|
|
146
147
|
const resetAttachmentUploader = attachmentUploader.reset
|
|
148
|
+
const inputRef = useRef<TextInput>(null)
|
|
147
149
|
|
|
148
150
|
const reset = useCallback(() => {
|
|
149
151
|
resetAttachmentUploader()
|
|
150
152
|
resetMutation()
|
|
153
|
+
inputRef.current?.clear()
|
|
151
154
|
setText('')
|
|
152
155
|
setUsingGiphy(false)
|
|
153
156
|
if (!currentlyEditingMessage) {
|
|
@@ -306,6 +309,7 @@ function MessageFormRoot({
|
|
|
306
309
|
reset,
|
|
307
310
|
replyRootId,
|
|
308
311
|
replyRootAuthorFirstName,
|
|
312
|
+
inputRef,
|
|
309
313
|
}}
|
|
310
314
|
>
|
|
311
315
|
<View style={styles.container}>
|
|
@@ -457,8 +461,16 @@ function MessageFormInput() {
|
|
|
457
461
|
const styles = useMessageFormStyles()
|
|
458
462
|
const theme = useTheme()
|
|
459
463
|
const fontScale = useFontScale()
|
|
460
|
-
const {
|
|
461
|
-
|
|
464
|
+
const {
|
|
465
|
+
text,
|
|
466
|
+
setText,
|
|
467
|
+
onSubmit,
|
|
468
|
+
inputEditable,
|
|
469
|
+
usingGiphy,
|
|
470
|
+
attachmentUploader,
|
|
471
|
+
replyRootId,
|
|
472
|
+
inputRef,
|
|
473
|
+
} = React.useContext(MessageFormContext)
|
|
462
474
|
const attachmentError = attachmentUploader?.errorMessage
|
|
463
475
|
|
|
464
476
|
const broadcastTypingStatus = useBroadcastTypingStatus()
|
|
@@ -495,6 +507,7 @@ function MessageFormInput() {
|
|
|
495
507
|
) : null}
|
|
496
508
|
|
|
497
509
|
<TextInput
|
|
510
|
+
ref={inputRef}
|
|
498
511
|
testID="message-composer-input"
|
|
499
512
|
style={[styles.textInput, usingGiphy && styles.textInputWithGiphy]}
|
|
500
513
|
multiline={true}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { fireEvent, render } from '@testing-library/react-native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { Updates, UpdatesAdapter } from '../../../utils/native_adapters'
|
|
4
|
+
import { AppUpdateBanner } from '../app_update_banner'
|
|
5
|
+
|
|
6
|
+
jest.mock('../../../utils/native_adapters', () => ({
|
|
7
|
+
...jest.requireActual('../../../utils/native_adapters'),
|
|
8
|
+
Updates: { useDownloadedUpdateId: jest.fn(), restart: jest.fn() },
|
|
9
|
+
}))
|
|
10
|
+
|
|
11
|
+
const mockUpdates = Updates as jest.Mocked<UpdatesAdapter>
|
|
12
|
+
|
|
13
|
+
describe('AppUpdateBanner', () => {
|
|
14
|
+
it('stays hidden until an update has downloaded', () => {
|
|
15
|
+
mockUpdates.useDownloadedUpdateId.mockReturnValue(undefined)
|
|
16
|
+
|
|
17
|
+
expect(render(<AppUpdateBanner />).queryByText('Chat update available')).toBeNull()
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('reloads through the adapter', () => {
|
|
21
|
+
mockUpdates.useDownloadedUpdateId.mockReturnValue('update-1')
|
|
22
|
+
|
|
23
|
+
fireEvent.press(render(<AppUpdateBanner />).getByText('Reload'))
|
|
24
|
+
|
|
25
|
+
expect(mockUpdates.restart).toHaveBeenCalledTimes(1)
|
|
26
|
+
})
|
|
27
|
+
})
|