@planningcenter/chat-react-native 3.1.0-rc.2 → 3.1.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 +1 -1
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversations.d.ts.map +1 -1
- package/build/components/conversations.js +3 -6
- package/build/components/conversations.js.map +1 -1
- package/build/hooks/use_conversation.d.ts +3 -3
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversation_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversation_jolt_events.js +4 -3
- package/build/hooks/use_conversation_jolt_events.js.map +1 -1
- package/build/hooks/use_conversation_messages.d.ts +3 -3
- package/build/hooks/use_conversation_messages.js.map +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.d.ts +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
- package/build/hooks/use_current_person.js +1 -1
- package/build/hooks/use_current_person.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts +1 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +47 -17
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_screen.d.ts +1 -1
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/create/conversation_create_screen.js.map +1 -1
- package/build/screens/design_system_screen.js +2 -2
- package/build/screens/design_system_screen.js.map +1 -1
- package/build/screens/message_actions_screen.d.ts +1 -1
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/reactions_screen.d.ts +1 -1
- package/build/screens/reactions_screen.js +2 -2
- package/build/screens/reactions_screen.js.map +1 -1
- package/build/types/api_primitives.d.ts +1 -1
- package/build/types/api_primitives.d.ts.map +1 -1
- package/build/types/api_primitives.js.map +1 -1
- package/build/types/resources/app_grant.d.ts +2 -0
- package/build/types/resources/app_grant.d.ts.map +1 -1
- package/build/types/resources/app_grant.js.map +1 -1
- package/build/types/resources/conversation.d.ts +1 -1
- package/build/types/resources/conversation.js.map +1 -1
- package/build/types/resources/groups/groups_group_resource.d.ts +2 -0
- package/build/types/resources/groups/groups_group_resource.d.ts.map +1 -1
- package/build/types/resources/groups/groups_group_resource.js.map +1 -1
- package/build/types/resources/member.d.ts +1 -1
- package/build/types/resources/member.js.map +1 -1
- package/build/types/resources/person.d.ts +2 -0
- package/build/types/resources/person.d.ts.map +1 -1
- package/build/types/resources/person.js.map +1 -1
- package/build/types/resources/reaction.js.map +1 -1
- package/build/utils/cache/page_mutations.d.ts +3 -1
- package/build/utils/cache/page_mutations.d.ts.map +1 -1
- package/build/utils/cache/page_mutations.js.map +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.d.ts +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js +2 -2
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js.map +1 -1
- package/build/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.d.ts +1 -1
- package/build/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.js.map +1 -1
- package/build/utils/theme.d.ts +1 -0
- package/build/utils/theme.d.ts.map +1 -1
- package/build/utils/theme.js +2 -0
- package/build/utils/theme.js.map +1 -1
- package/build/vendor/tapestry/tokens.d.ts +2 -0
- package/build/vendor/tapestry/tokens.d.ts.map +1 -1
- package/build/vendor/tapestry/tokens.js +2 -0
- package/build/vendor/tapestry/tokens.js.map +1 -1
- package/package.json +2 -2
- package/src/components/conversation/message.tsx +1 -1
- package/src/components/conversations.tsx +6 -8
- package/src/hooks/use_conversation.ts +3 -3
- package/src/hooks/use_conversation_jolt_events.ts +8 -11
- package/src/hooks/use_conversation_messages.ts +3 -3
- package/src/hooks/use_conversation_messages_jolt_events.ts +1 -1
- package/src/hooks/use_current_person.ts +1 -1
- package/src/screens/conversation_details_screen.tsx +65 -15
- package/src/screens/conversation_screen.tsx +1 -1
- package/src/screens/create/conversation_create_screen.tsx +1 -1
- package/src/screens/design_system_screen.tsx +2 -2
- package/src/screens/message_actions_screen.tsx +1 -1
- package/src/screens/reactions_screen.tsx +3 -3
- package/src/types/api_primitives.ts +1 -1
- package/src/types/resources/app_grant.ts +2 -0
- package/src/types/resources/conversation.ts +1 -1
- package/src/types/resources/groups/groups_group_resource.ts +2 -0
- package/src/types/resources/member.ts +1 -1
- package/src/types/resources/person.ts +2 -0
- package/src/types/resources/reaction.ts +1 -1
- package/src/utils/cache/page_mutations.ts +1 -1
- package/src/utils/jolt/transform_message_event_data_to_message_resource.ts +3 -3
- package/src/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.ts +1 -1
- package/src/utils/theme.ts +3 -0
- package/src/vendor/tapestry/tokens.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reactions_screen.js","sourceRoot":"","sources":["../../src/screens/reactions_screen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAA;AAChG,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAI5E,MAAM,CAAC,MAAM,sBAAsB,GAAiC;IAClE,YAAY,EAAE,WAAW;IACzB,WAAW,EAAE,KAAK;IAClB,mBAAmB,EAAE,CAAC,GAAG,CAAC;IAC1B,mBAAmB,EAAE,IAAI;CAC1B,CAAA;AAQD,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAuB;IAC5D,M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,QAAQ,EAAE,CAAA;IACxB,MAAM,EAAE,MAAM,EAAE,GAAG,mBAAmB,EAAE,CAAA;IACxC,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IAEtC,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,cAAc,EAAE,YAAY;YAC5B,UAAU,EAAE,EAAE;YACd,aAAa,EAAE,MAAM;YACrB,KAAK,EAAE,MAAM;YACb,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,2BAA2B;YACzD,MAAM;YACN,GAAG,EAAE,CAAC;SACP;QACD,UAAU,EAAE;YACV,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;YACN,iBAAiB,EAAE,EAAE;YACrB,eAAe,EAAE,EAAE;SACpB;QACD,QAAQ,EAAE;YACR,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,EAAE;YACrB,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;SACP;QACD,OAAO,EAAE;YACP,SAAS,EAAE,EAAE;YACb,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB;YACnD,iBAAiB,EAAE,CAAC;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport React from 'react'\nimport { FlatList, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Avatar, Text } from '../components'\nimport { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction'\nimport { Tabs } from '../components/display/tabs'\nimport { useSuspenseGet, useTheme } from '../hooks'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\nimport { MemberResource } from '../types'\nimport { ReactionCountResource } from '../types/resources/reaction'\n\nexport const ReactionsScreenOptions: NativeStackNavigationOptions = {\n presentation: 'formSheet',\n headerShown: false,\n sheetAllowedDetents: [0.5],\n sheetGrabberVisible: true,\n}\n\nexport type ReactionScreenProps = StaticScreenProps<{\n message_id: string\n conversation_id: number\n reaction_value?: string\n}>\n\nexport function ReactionsScreen({ route }: ReactionScreenProps) {\n const { conversation_id, message_id, reaction_value } = route.params\n const styles = useStyles()\n\n const { messages } = useConversationMessages({ conversation_id }, { refetchOnMount: false })\n const { data: members } = useSuspenseGet<MemberResource[]>({\n url: `/me/conversations/${conversation_id}/members`,\n data: {\n fields: {\n Member: ['id', 'name', 'avatar', 'badges', 'child', 'role'],\n },\n },\n })\n const message = messages.find(m => m.id === message_id)\n const reactionCounts = message?.reactionCounts || []\n const initialReactionCount =\n reactionCounts.find(r => r.value === reaction_value) || reactionCounts[0]\n const [reactionCount, setReactionCount] =\n React.useState<ReactionCountResource>(initialReactionCount)\n\n const authorIds = reactionCount.authorIds\n const authors = members.filter(member => authorIds.includes(member.id.toString()))\n\n return (\n <View style={styles.container}>\n <Tabs\n data={reactionCounts}\n activeTab={reactionCount}\n onTabPress={setReactionCount}\n renderItem={({ item }) => (\n <Reaction\n active={reactionCount.id === item.id}\n reaction={item}\n onPress={() => setReactionCount(item)}\n />\n )}\n style={styles.actions}\n />\n <FlatList\n data={authors}\n keyExtractor={item => item.id.toString()}\n renderItem={({ item: author }) => (\n <View style={styles.authorList}>\n <Avatar size={'md'} sourceUri={author.avatar} />\n <Text key={author.id}>{author.name}</Text>\n </View>\n )}\n />\n </View>\n )\n}\n\nconst Reaction = ({\n reaction,\n}: {\n active: boolean\n reaction: ReactionCountResource\n onPress: () => void\n}) => {\n const styles = useStyles()\n const reactionStyles = useReactionStyles({ mine: reaction.mine ? 1 : 0 })\n\n return (\n <View key={reaction.value} style={styles.reaction}>\n <Text style={reactionStyles.reactionEmoji}>{REACTION_EMOJIS[reaction.value]}</Text>\n <Text style={reactionStyles.reactionEmoji}>{reaction.count}</Text>\n </View>\n )\n}\n\nconst useStyles = () => {\n const theme = useTheme()\n const { height } = useWindowDimensions()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n container: {\n justifyContent: 'flex-start',\n paddingTop: 12,\n paddingBottom: bottom,\n width: '100%',\n backgroundColor: theme.colors.fillColorNeutral100Inverted,\n height,\n gap: 8,\n },\n authorList: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n paddingHorizontal: 12,\n paddingVertical: 12,\n },\n reaction: {\n paddingVertical: 12,\n paddingHorizontal: 12,\n flexDirection: 'row',\n gap: 4,\n },\n actions: {\n minHeight: 48,\n borderBottomColor: theme.colors.fillColorNeutral040,\n borderBottomWidth: 1,\n },\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_primitives.d.ts","sourceRoot":"","sources":["../../src/types/api_primitives.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"api_primitives.d.ts","sourceRoot":"","sources":["../../src/types/api_primitives.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE;QAAE,oBAAoB,EAAE,GAAG,EAAE,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;IACxD,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,WAAW,CAAC,IAAI,GAAG,cAAc,IAAI;IAC/C,IAAI,EAAE,IAAI,CAAA;IACV,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,aAAa,CAAC,IAAI,GAAG,cAAc,IAAI;IACjD,IAAI,EAAE,IAAI,EAAE,CAAA;IACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B,IAAI,EAAE,cAAc,CAAA;CACrB,CAAA;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,WAAW,EAAE,CAAA;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAA;CACjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_primitives.js","sourceRoot":"","sources":["../../src/types/api_primitives.ts"],"names":[],"mappings":"","sourcesContent":["export interface ResourceObject {\n id: string\n type: string\n}\n\nexport interface ErrorObject {\n source?: { parameter: string }\n detail: string\n meta?: { associated_resources: any[]; resource: string }\n title: string\n status: string\n}\n\nexport type ApiResource<Type = ResourceObject> = {\n data: Type\n links: Record<string, string>\n meta: Record<string, unknown>\n}\n\nexport type ApiCollection<Type = ResourceObject> = {\n data: Type[]\n links: Record<string, string>\n meta: CollectionMeta\n}\n\nexport interface ApiError {\n errors: ErrorObject[]\n}\n\nexport interface CollectionMeta {\n count: number\n totalCount: number\n next?: Record<string, unknown>\n parent?: ResourceObject\n [attributeName: string]: unknown\n}\n"]}
|
|
1
|
+
{"version":3,"file":"api_primitives.js","sourceRoot":"","sources":["../../src/types/api_primitives.ts"],"names":[],"mappings":"","sourcesContent":["export interface ResourceObject {\n id: string | number\n type: string\n}\n\nexport interface ErrorObject {\n source?: { parameter: string }\n detail: string\n meta?: { associated_resources: any[]; resource: string }\n title: string\n status: string\n}\n\nexport type ApiResource<Type = ResourceObject> = {\n data: Type\n links: Record<string, string>\n meta: Record<string, unknown>\n}\n\nexport type ApiCollection<Type = ResourceObject> = {\n data: Type[]\n links: Record<string, string>\n meta: CollectionMeta\n}\n\nexport interface ApiError {\n errors: ErrorObject[]\n}\n\nexport interface CollectionMeta {\n count: number\n totalCount: number\n next?: Record<string, unknown>\n parent?: ResourceObject\n [attributeName: string]: unknown\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app_grant.d.ts","sourceRoot":"","sources":["../../../src/types/resources/app_grant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,mBAAmB,EAAE,OAAO,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;CAChB"}
|
|
1
|
+
{"version":3,"file":"app_grant.d.ts","sourceRoot":"","sources":["../../../src/types/resources/app_grant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACvD,IAAI,EAAE,UAAU,CAAA;IAChB,EAAE,EAAE,MAAM,CAAA;IACV,mBAAmB,EAAE,OAAO,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app_grant.js","sourceRoot":"","sources":["../../../src/types/resources/app_grant.ts"],"names":[],"mappings":"","sourcesContent":["import { ResourceObject } from '../api_primitives'\n\nexport interface AppGrantsResource extends ResourceObject {\n createConversations: boolean\n appName: string\n}\n"]}
|
|
1
|
+
{"version":3,"file":"app_grant.js","sourceRoot":"","sources":["../../../src/types/resources/app_grant.ts"],"names":[],"mappings":"","sourcesContent":["import { ResourceObject } from '../api_primitives'\n\nexport interface AppGrantsResource extends ResourceObject {\n type: 'AppGrant'\n id: number\n createConversations: boolean\n appName: string\n}\n"]}
|
|
@@ -3,7 +3,7 @@ import { GroupResource } from './group_resource';
|
|
|
3
3
|
import { MemberAbilityResource } from './member_ability';
|
|
4
4
|
export interface ConversationResource {
|
|
5
5
|
type: 'Conversation';
|
|
6
|
-
id:
|
|
6
|
+
id: number;
|
|
7
7
|
badges?: ConversationBadgeResource[];
|
|
8
8
|
createdAt: string;
|
|
9
9
|
deleted?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../src/types/resources/conversation.ts"],"names":[],"mappings":"","sourcesContent":["import { ConversationBadgeResource } from './conversation_badge'\nimport { GroupResource } from './group_resource'\nimport { MemberAbilityResource } from './member_ability'\n\nexport interface ConversationResource {\n type: 'Conversation'\n id:
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../src/types/resources/conversation.ts"],"names":[],"mappings":"","sourcesContent":["import { ConversationBadgeResource } from './conversation_badge'\nimport { GroupResource } from './group_resource'\nimport { MemberAbilityResource } from './member_ability'\n\nexport interface ConversationResource {\n type: 'Conversation'\n id: number\n badges?: ConversationBadgeResource[]\n createdAt: string\n deleted?: boolean\n groups?: GroupResource[]\n previewAvatarUrls?: string[]\n lastMessageAuthorId?: string\n lastMessageAuthorName?: string\n lastMessageCreatedAt?: string\n lastMessageTextPreview?: string\n memberAbility?: MemberAbilityResource\n muted: boolean\n repliesDisabled: boolean\n title: string\n unreadCount: number\n updatedAt: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groups_group_resource.d.ts","sourceRoot":"","sources":["../../../../src/types/resources/groups/groups_group_resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,WAAW,EAAE;QACX,SAAS,EAAE,MAAM,CAAA;QACjB,MAAM,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB,EAAE,MAAM,CAAA;IACxB,qBAAqB,EAAE,OAAO,CAAA;CAC/B"}
|
|
1
|
+
{"version":3,"file":"groups_group_resource.d.ts","sourceRoot":"","sources":["../../../../src/types/resources/groups/groups_group_resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,OAAO,CAAA;IACb,WAAW,EAAE;QACX,SAAS,EAAE,MAAM,CAAA;QACjB,MAAM,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,gBAAgB,EAAE,MAAM,CAAA;IACxB,qBAAqB,EAAE,OAAO,CAAA;CAC/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groups_group_resource.js","sourceRoot":"","sources":["../../../../src/types/resources/groups/groups_group_resource.ts"],"names":[],"mappings":"","sourcesContent":["import { ResourceObject } from '../../api_primitives'\n\nexport interface GroupsGroupResource extends ResourceObject {\n headerImage: {\n thumbnail: string\n medium: string\n original: string\n }\n name: string\n membershipsCount: number\n canCreateConversation: boolean\n}\n"]}
|
|
1
|
+
{"version":3,"file":"groups_group_resource.js","sourceRoot":"","sources":["../../../../src/types/resources/groups/groups_group_resource.ts"],"names":[],"mappings":"","sourcesContent":["import { ResourceObject } from '../../api_primitives'\n\nexport interface GroupsGroupResource extends ResourceObject {\n id: string\n type: 'Group'\n headerImage: {\n thumbnail: string\n medium: string\n original: string\n }\n name: string\n membershipsCount: number\n canCreateConversation: boolean\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member.js","sourceRoot":"","sources":["../../../src/types/resources/member.ts"],"names":[],"mappings":"","sourcesContent":["export interface MemberResource {\n type: 'Member'\n id:
|
|
1
|
+
{"version":3,"file":"member.js","sourceRoot":"","sources":["../../../src/types/resources/member.ts"],"names":[],"mappings":"","sourcesContent":["export interface MemberResource {\n type: 'Member'\n id: number\n name: string\n avatar: string\n badges: MemberBadge[]\n child: boolean\n role?: string\n}\n\nexport interface MemberResourceWithPerson extends MemberResource {\n person: {\n firstName: string\n lastName: string\n avatarUrl: string\n child: boolean\n id: string\n type: 'Person'\n }\n}\n\nexport interface MemberBadge {\n title: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.d.ts","sourceRoot":"","sources":["../../../src/types/resources/person.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,OAAO,CAAA;CACxB"}
|
|
1
|
+
{"version":3,"file":"person.d.ts","sourceRoot":"","sources":["../../../src/types/resources/person.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,OAAO,EAAE,OAAO,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,OAAO,CAAA;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.js","sourceRoot":"","sources":["../../../src/types/resources/person.ts"],"names":[],"mappings":"","sourcesContent":["import { ResourceObject } from '../api_primitives'\n\nexport interface PersonResource extends ResourceObject {\n name: string\n avatar: string\n}\n\nexport interface CurrentPersonResource extends PersonResource {\n canChat: boolean\n unreadCount: number\n pcoChatEnabled: boolean\n}\n"]}
|
|
1
|
+
{"version":3,"file":"person.js","sourceRoot":"","sources":["../../../src/types/resources/person.ts"],"names":[],"mappings":"","sourcesContent":["import { ResourceObject } from '../api_primitives'\n\nexport interface PersonResource extends ResourceObject {\n id: number\n type: 'Person'\n name: string\n avatar: string\n}\n\nexport interface CurrentPersonResource extends PersonResource {\n canChat: boolean\n unreadCount: number\n pcoChatEnabled: boolean\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reaction.js","sourceRoot":"","sources":["../../../src/types/resources/reaction.ts"],"names":[],"mappings":"","sourcesContent":["export interface ReactionCountResource {\n type: 'ReactionCount'\n id: string\n value: 'thumbs_up' | 'thumbs_down' | 'pray' | 'laugh' | 'heart'\n count: number\n mine: number\n messageId: string\n authorIds: string[]\n}\n"]}
|
|
1
|
+
{"version":3,"file":"reaction.js","sourceRoot":"","sources":["../../../src/types/resources/reaction.ts"],"names":[],"mappings":"","sourcesContent":["export interface ReactionCountResource {\n type: 'ReactionCount'\n id: string\n value: 'thumbs_up' | 'thumbs_down' | 'pray' | 'laugh' | 'heart'\n count: number\n mine: number\n messageId: string\n authorIds: string[] // These is in fact a string array\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page_mutations.d.ts","sourceRoot":"","sources":["../../../src/utils/cache/page_mutations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE3D;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,cAAc,EAAE,EAChE,IAAI,EACJ,MAAM,EACN,aAAsB,GACvB,EAAE;IACD,IAAI,CAAC,EAAE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SAAS,GAAG,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;IACpC,SAAS,CAAC,IAAI,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAA;IAE3D,QAAQ,CAAC,CAAC,CAAC,GAAG,SAAS,CAAA;IAEvB,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAA2B,EAChE,IAAI,EACJ,MAAM,GAIP;IACC,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IAEtB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;YACzC,OAAO,OAAO,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,CAAA;QACjC,CAAC,CAAC,CAAA;QAEF,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;AACrC,CAAC","sourcesContent":["/**\n * Helpers to handle updating messages in the cache\n * Messages are ordered by ULID on the client so we may\n * have diverging logic from other kinds of api data\n */\n\nimport { ApiCollection, ResourceObject } from '../../types'\n\n/**\n * updateRecordInPagesData\n * Updates record if found in the cache, otherwise noops.\n */\nexport function updateRecordInPagesData<T extends ResourceObject>({\n data,\n record,\n processRecord = r => r,\n}: {\n data?: { pages: ApiCollection<T>[]; pageParams: any }\n record: T\n processRecord?: (_next: T, _prev: T) => T\n}) {\n if (!data) return data\n\n const newPages = data.pages.map(page => {\n const newData = page.data.map(message => {\n if (message.id === record.id) {\n return processRecord(record, message)\n }\n return message\n })\n\n return { ...page, data: newData }\n })\n\n return { ...data, pages: newPages }\n}\n\n/**\n * updateOrCreateRecordInPagesData\n * Updates record if found in the cache, otherwise inserts.\n */\nexport function updateOrCreateRecordInPagesData<T extends ResourceObject>({\n data,\n record,\n processRecord = r => r,\n}: {\n data?: { pages: ApiCollection<T>[]; pageParams: any }\n record: T\n processRecord?: (_next: T, _prev?: T) => T\n}) {\n if (!data) return data\n\n let foundRecord = false\n const newPages = data.pages.map(page => {\n const newData = page.data.map(message => {\n if (message.id === record.id) {\n foundRecord = true\n return processRecord(record, message)\n }\n return message\n })\n\n return { ...page, data: newData }\n })\n\n if (!foundRecord) {\n // This is a fallback for when the record is not found in the cache.\n const firstPage = { ...newPages[0] }\n firstPage.data = [processRecord(record), ...firstPage.data]\n newPages[0] = firstPage\n }\n\n return { ...data, pages: newPages }\n}\n\nexport function addRecordInPagesData<T extends ResourceObject>({\n data,\n record,\n processRecord = r => r,\n}: {\n data?: { pages: ApiCollection<T>[]; pageParams: any }\n record: T\n processRecord?: (_next: T) => T\n}) {\n if (!data) return data\n\n const newPages = [...data.pages]\n const firstPage = { ...newPages[0] }\n firstPage.data = [processRecord(record), ...firstPage.data]\n\n newPages[0] = firstPage\n\n return { ...data, pages: newPages }\n}\n\n/**\n * deleteRecordInPagesData\n */\nexport function deleteRecordInPagesData<T extends ResourceObject>({\n data,\n record,\n}: {\n data?: { pages: ApiCollection<T>[]; pageParams: any }\n record:
|
|
1
|
+
{"version":3,"file":"page_mutations.js","sourceRoot":"","sources":["../../../src/utils/cache/page_mutations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAA2B,EAChE,IAAI,EACJ,MAAM,EACN,aAAa,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAKvB;IACC,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IAEtB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,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F,OAAO,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAA;AACrC,CAAC","sourcesContent":["/**\n * Helpers to handle updating messages in the cache\n * Messages are ordered by ULID on the client so we may\n * have diverging logic from other kinds of api data\n */\n\nimport { ApiCollection, ResourceObject } from '../../types'\n\n/**\n * updateRecordInPagesData\n * Updates record if found in the cache, otherwise noops.\n */\nexport function updateRecordInPagesData<T extends ResourceObject>({\n data,\n record,\n processRecord = r => r,\n}: {\n data?: { pages: ApiCollection<T>[]; pageParams: any }\n record: T\n processRecord?: (_next: T, _prev: T) => T\n}) {\n if (!data) return data\n\n const newPages = data.pages.map(page => {\n const newData = page.data.map(message => {\n if (message.id === record.id) {\n return processRecord(record, message)\n }\n return message\n })\n\n return { ...page, data: newData }\n })\n\n return { ...data, pages: newPages }\n}\n\n/**\n * updateOrCreateRecordInPagesData\n * Updates record if found in the cache, otherwise inserts.\n */\nexport function updateOrCreateRecordInPagesData<T extends ResourceObject>({\n data,\n record,\n processRecord = r => r,\n}: {\n data?: { pages: ApiCollection<T>[]; pageParams: any }\n record: T\n processRecord?: (_next: T, _prev?: T) => T\n}) {\n if (!data) return data\n\n let foundRecord = false\n const newPages = data.pages.map(page => {\n const newData = page.data.map(message => {\n if (message.id === record.id) {\n foundRecord = true\n return processRecord(record, message)\n }\n return message\n })\n\n return { ...page, data: newData }\n })\n\n if (!foundRecord) {\n // This is a fallback for when the record is not found in the cache.\n const firstPage = { ...newPages[0] }\n firstPage.data = [processRecord(record), ...firstPage.data]\n newPages[0] = firstPage\n }\n\n return { ...data, pages: newPages }\n}\n\nexport function addRecordInPagesData<T extends ResourceObject>({\n data,\n record,\n processRecord = r => r,\n}: {\n data?: { pages: ApiCollection<T>[]; pageParams: any }\n record: T\n processRecord?: (_next: T) => T\n}) {\n if (!data) return data\n\n const newPages = [...data.pages]\n const firstPage = { ...newPages[0] }\n firstPage.data = [processRecord(record), ...firstPage.data]\n\n newPages[0] = firstPage\n\n return { ...data, pages: newPages }\n}\n\n/**\n * deleteRecordInPagesData\n */\nexport function deleteRecordInPagesData<T extends ResourceObject>({\n data,\n record,\n}: {\n data?: { pages: ApiCollection<T>[]; pageParams: any }\n record: { id: string | number }\n}) {\n if (!data) return data\n\n const newPages = data.pages.map(page => {\n const newData = page.data.filter(message => {\n return message.id !== record.id\n })\n\n return { ...page, data: newData }\n })\n\n return { ...data, pages: newPages }\n}\n"]}
|
|
@@ -2,6 +2,6 @@ import { MessageResource } from '../../types';
|
|
|
2
2
|
import { MessageCreatedEvent } from '../../types/jolt_events/message_events';
|
|
3
3
|
export declare function transformMessageEventDataToMessageResource({ data, currentPersonId, }: {
|
|
4
4
|
data: MessageCreatedEvent['data']['data'];
|
|
5
|
-
currentPersonId:
|
|
5
|
+
currentPersonId: number;
|
|
6
6
|
}): MessageResource;
|
|
7
7
|
//# sourceMappingURL=transform_message_event_data_to_message_resource.d.ts.map
|
|
@@ -8,11 +8,11 @@ export function transformMessageEventDataToMessageResource({ data, currentPerson
|
|
|
8
8
|
createdAt: data.created_at,
|
|
9
9
|
deletedAt: data.deleted_at,
|
|
10
10
|
textEditedAt: data.text_edited_at,
|
|
11
|
-
mine: data.author_id
|
|
11
|
+
mine: data.author_id === currentPersonId,
|
|
12
12
|
attachments: deepCamelCaseKeys(data.attachments) || [],
|
|
13
13
|
author: {
|
|
14
14
|
type: 'Person',
|
|
15
|
-
id: data.author_id
|
|
15
|
+
id: data.author_id,
|
|
16
16
|
name: data.author_name,
|
|
17
17
|
avatar: data.author_avatar,
|
|
18
18
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform_message_event_data_to_message_resource.js","sourceRoot":"","sources":["../../../src/utils/jolt/transform_message_event_data_to_message_resource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,MAAM,UAAU,0CAA0C,CAAC,EACzD,IAAI,EACJ,eAAe,GAIhB;IACC,OAAO;QACL,IAAI,EAAE,SAAS;QACf,EAAE,EAAE,IAAI,CAAC,QAAQ;QACjB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,SAAS,EAAE,IAAI,CAAC,UAAU;QAC1B,SAAS,EAAE,IAAI,CAAC,UAAU;QAC1B,YAAY,EAAE,IAAI,CAAC,cAAc;QACjC,IAAI,EAAE,IAAI,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"transform_message_event_data_to_message_resource.js","sourceRoot":"","sources":["../../../src/utils/jolt/transform_message_event_data_to_message_resource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAExD,MAAM,UAAU,0CAA0C,CAAC,EACzD,IAAI,EACJ,eAAe,GAIhB;IACC,OAAO;QACL,IAAI,EAAE,SAAS;QACf,EAAE,EAAE,IAAI,CAAC,QAAQ;QACjB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,SAAS,EAAE,IAAI,CAAC,UAAU;QAC1B,SAAS,EAAE,IAAI,CAAC,UAAU;QAC1B,YAAY,EAAE,IAAI,CAAC,cAAc;QACjC,IAAI,EAAE,IAAI,CAAC,SAAS,KAAK,eAAe;QACxC,WAAW,EAAE,iBAAiB,CAAmC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE;QACxF,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,EAAE,EAAE,IAAI,CAAC,SAAS;YAClB,IAAI,EAAE,IAAI,CAAC,WAAW;YACtB,MAAM,EAAE,IAAI,CAAC,aAAa;SAC3B;QACD,cAAc,EAAE,EAAE;KACnB,CAAA;AACH,CAAC","sourcesContent":["import { MessageResource } from '../../types'\nimport { MessageCreatedEvent } from '../../types/jolt_events/message_events'\nimport { DenormalizedAttachmentResource } from '../../types/resources/denormalized_attachment_resource'\nimport { deepCamelCaseKeys } from '../deepCamelCaseKeys'\n\nexport function transformMessageEventDataToMessageResource({\n data,\n currentPersonId,\n}: {\n data: MessageCreatedEvent['data']['data']\n currentPersonId: number\n}): MessageResource {\n return {\n type: 'Message',\n id: data.sort_key,\n text: data.text,\n html: data.html,\n createdAt: data.created_at,\n deletedAt: data.deleted_at,\n textEditedAt: data.text_edited_at,\n mine: data.author_id === currentPersonId,\n attachments: deepCamelCaseKeys<DenormalizedAttachmentResource[]>(data.attachments) || [],\n author: {\n type: 'Person',\n id: data.author_id,\n name: data.author_name,\n avatar: data.author_avatar,\n },\n reactionCounts: [],\n }\n}\n"]}
|
|
@@ -5,7 +5,7 @@ interface Props {
|
|
|
5
5
|
data: ReactionCreatedEvent['data']['data'];
|
|
6
6
|
oldData?: ReactionCountResource;
|
|
7
7
|
event: JoltReactionEvent['event'];
|
|
8
|
-
currentPersonId:
|
|
8
|
+
currentPersonId: number;
|
|
9
9
|
}
|
|
10
10
|
export declare function transformReactionEventDataToReactionCountResource({ data, oldData, event, currentPersonId, }: Props): ReactionCountResource;
|
|
11
11
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transform_reaction_event_data_to_reaction_count_resource.js","sourceRoot":"","sources":["../../../src/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,iDAAiD,CAAC,EAChE,IAAI,EACJ,OAAO,EACP,KAAK,EACL,eAAe,GACT;IACN,IAAI,SAAS,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC,CAAA;IACjD,IAAI,KAAK,KAAK,kBAAkB,EAAE,CAAC;QACjC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC1C,CAAC;SAAM,IAAI,KAAK,KAAK,oBAAoB,EAAE,CAAC;QAC1C,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC7C,CAAC;IAED,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAA;IAEtD,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,EAAE,EAAE,GAAG,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,KAAK,EAAE;QAC5C,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClB,SAAS,EAAE,IAAI,CAAC,gBAAgB;QAChC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;KACjC,CAAA;AACH,CAAC","sourcesContent":["import { JoltReactionEvent } from '../../types/jolt_events'\nimport { ReactionCreatedEvent } from '../../types/jolt_events/reaction_events'\nimport { ReactionCountResource } from '../../types/resources/reaction'\n\ninterface Props {\n data: ReactionCreatedEvent['data']['data']\n oldData?: ReactionCountResource\n event: JoltReactionEvent['event']\n currentPersonId:
|
|
1
|
+
{"version":3,"file":"transform_reaction_event_data_to_reaction_count_resource.js","sourceRoot":"","sources":["../../../src/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.ts"],"names":[],"mappings":"AAWA,MAAM,UAAU,iDAAiD,CAAC,EAChE,IAAI,EACJ,OAAO,EACP,KAAK,EACL,eAAe,GACT;IACN,IAAI,SAAS,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE,SAAS,IAAI,EAAE,CAAC,CAAA;IACjD,IAAI,KAAK,KAAK,kBAAkB,EAAE,CAAC;QACjC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC1C,CAAC;SAAM,IAAI,KAAK,KAAK,oBAAoB,EAAE,CAAC;QAC1C,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAA;IAC7C,CAAC;IAED,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAA;IAEtD,OAAO;QACL,IAAI,EAAE,eAAe;QACrB,EAAE,EAAE,GAAG,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,KAAK,EAAE;QAC5C,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClB,SAAS,EAAE,IAAI,CAAC,gBAAgB;QAChC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;KACjC,CAAA;AACH,CAAC","sourcesContent":["import { JoltReactionEvent } from '../../types/jolt_events'\nimport { ReactionCreatedEvent } from '../../types/jolt_events/reaction_events'\nimport { ReactionCountResource } from '../../types/resources/reaction'\n\ninterface Props {\n data: ReactionCreatedEvent['data']['data']\n oldData?: ReactionCountResource\n event: JoltReactionEvent['event']\n currentPersonId: number\n}\n\nexport function transformReactionEventDataToReactionCountResource({\n data,\n oldData,\n event,\n currentPersonId,\n}: Props): ReactionCountResource {\n let authorIds = new Set(oldData?.authorIds || [])\n if (event === 'reaction.created') {\n authorIds.add(data.author_id.toString())\n } else if (event === 'reaction.destroyed') {\n authorIds.delete(data.author_id.toString())\n }\n\n const mine = authorIds.has(currentPersonId.toString())\n\n return {\n type: 'ReactionCount',\n id: `${data.message_sort_key}/${data.value}`,\n value: data.value,\n count: data.count,\n mine: mine ? 1 : 0,\n messageId: data.message_sort_key,\n authorIds: Array.from(authorIds),\n }\n}\n"]}
|
package/build/utils/theme.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE9C,OAAO,EAAE,mBAAmB,EAAE,MAAM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AC/B,iBAAiB,EAAE,MAAM,CAAA;IACzB,iBAAiB,EAAE,MAAM,CAAA;IACzB,uBAAuB,EAAE,MAAM,CAAA;IAC/B,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,qBAAqB,EAAE,MAAM,CAAA;IAC7B,iBAAiB,EAAE,MAAM,CAAA;IACzB,iBAAiB,EAAE,MAAM,CAAA;IACzB,uBAAuB,EAAE,MAAM,CAAA;IAC/B,sBAAsB,EAAE,MAAM,CAAA;CAC/B"}
|
package/build/utils/theme.js
CHANGED
|
@@ -38,6 +38,7 @@ const colorsChatLight = {
|
|
|
38
38
|
statusNeutralIcon: tokens.iconColorStatusNeutralPrimary,
|
|
39
39
|
statusNeutralText: tokens.textColorStatusNeutral,
|
|
40
40
|
statusNeutralBackground: tokens.fillColorStatusNeutralGhost,
|
|
41
|
+
borderColorStatusError: tokens.borderColorStatusError,
|
|
41
42
|
};
|
|
42
43
|
const colorsChatDark = {
|
|
43
44
|
name: 'dark',
|
|
@@ -63,6 +64,7 @@ const colorsChatDark = {
|
|
|
63
64
|
statusNeutralIcon: tokens.iconColorStatusNeutralPrimaryDark,
|
|
64
65
|
statusNeutralText: tokens.textColorStatusNeutralDark,
|
|
65
66
|
statusNeutralBackground: tokens.fillColorStatusNeutralGhostDark,
|
|
67
|
+
borderColorStatusError: tokens.borderColorStatusErrorDark,
|
|
66
68
|
};
|
|
67
69
|
const chatThemeColorMap = {
|
|
68
70
|
light: colorsChatLight,
|
package/build/utils/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AA8B/E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,WAA4B,EAAa,EAAE;IACtE,MAAM,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AAM,CAAC,6BAA6B;IAC3D,iBAAiB,EAAE,MAAM,CAAC,iCAAiC;IAC3D,iBAAiB,EAAE,MAAM,CAAC,0BAA0B;IACpD,uBAAuB,EAAE,MAAM,CAAC,+BAA+B;IAC/D,sBAAsB,EAAE,MAAM,CAAC,0BAA0B;CAC1D,CAAA;AAED,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;CACrB,CAAA","sourcesContent":["import { ColorSchemeName } from 'react-native'\nimport { tokens } from '../vendor/tapestry/tokens'\nimport { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map'\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 showBadgeLogo: boolean\n}\n\nexport const defaultTheme = (colorScheme: ColorSchemeName): ChatTheme => {\n const scheme = colorScheme || '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 showBadgeLogo: 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 switchTrackTrue: string | undefined\n switchTrackFalse: string | undefined\n switchThumbColor: string | undefined\n testColor: string\n statusInfoIcon: string\n statusInfoText: string\n statusInfoBackground: string\n statusSuccessIcon: string\n statusSuccessText: string\n statusSuccessBackground: string\n statusWarningIcon: string\n statusWarningText: string\n statusWarningBackground: string\n statusErrorIcon: string\n statusErrorText: string\n statusErrorBackground: string\n statusNeutralIcon: string\n statusNeutralText: string\n statusNeutralBackground: string\n borderColorStatusError: string\n}\n\nconst colorsChatLight: ChatColors = {\n name: 'light',\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefault,\n switchTrackTrue: undefined,\n switchTrackFalse: undefined,\n switchThumbColor: undefined,\n testColor: 'hotpink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoText: tokens.textColorStatusInfo,\n statusInfoBackground: tokens.fillColorStatusInfoGhost,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessText: tokens.textColorStatusSuccess,\n statusSuccessBackground: tokens.fillColorStatusSuccessGhost,\n statusWarningIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningText: tokens.textColorStatusWarning,\n statusWarningBackground: tokens.fillColorStatusWarningGhost,\n statusErrorIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorText: tokens.textColorStatusError,\n statusErrorBackground: tokens.fillColorStatusErrorGhost,\n statusNeutralIcon: tokens.iconColorStatusNeutralPrimary,\n statusNeutralText: tokens.textColorStatusNeutral,\n statusNeutralBackground: tokens.fillColorStatusNeutralGhost,\n borderColorStatusError: tokens.borderColorStatusError,\n}\n\nconst colorsChatDark: ChatColors = {\n name: 'dark',\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefaultDark,\n switchTrackTrue: undefined,\n switchTrackFalse: undefined,\n switchThumbColor: undefined,\n testColor: 'pink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoText: tokens.textColorStatusInfoDark,\n statusInfoBackground: tokens.fillColorStatusInfoGhostDark,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessText: tokens.textColorStatusSuccessDark,\n statusSuccessBackground: tokens.fillColorStatusSuccessGhostDark,\n statusWarningIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningText: tokens.textColorStatusWarningDark,\n statusWarningBackground: tokens.fillColorStatusWarningGhostDark,\n statusErrorIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorText: tokens.textColorStatusErrorDark,\n statusErrorBackground: tokens.fillColorStatusErrorGhostDark,\n statusNeutralIcon: tokens.iconColorStatusNeutralPrimaryDark,\n statusNeutralText: tokens.textColorStatusNeutralDark,\n statusNeutralBackground: tokens.fillColorStatusNeutralGhostDark,\n borderColorStatusError: tokens.borderColorStatusErrorDark,\n}\n\nconst chatThemeColorMap = {\n light: colorsChatLight,\n dark: colorsChatDark,\n}\n"]}
|
|
@@ -49,6 +49,8 @@ export declare const tokens: {
|
|
|
49
49
|
colorNeutral95: "hsl(0, 0%, 95%)";
|
|
50
50
|
colorNeutral97: "hsl(0, 0%, 97%)";
|
|
51
51
|
colorNeutral98: "hsl(0, 0%, 98%)";
|
|
52
|
+
borderColorStatusError: "hsl(8, 60%, 47%)";
|
|
53
|
+
borderColorStatusErrorDark: "hsl(8, 60%, 55%)";
|
|
52
54
|
colorNeutral100White: "hsl(0, 0%, 100%)";
|
|
53
55
|
fillColorInteractionDefault: "hsl(204, 100%, 40%)";
|
|
54
56
|
fillColorStatusNeutralGhost: "hsl(0, 0%, 93%)";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/vendor/tapestry/tokens.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../src/vendor/tapestry/tokens.ts"],"names":[],"mappings":"AAuHA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKlB,CAAA"}
|
|
@@ -19,6 +19,8 @@ const colorPrimitives = {
|
|
|
19
19
|
colorNeutral95: 'hsl(0, 0%, 95%)',
|
|
20
20
|
colorNeutral97: 'hsl(0, 0%, 97%)',
|
|
21
21
|
colorNeutral98: 'hsl(0, 0%, 98%)',
|
|
22
|
+
borderColorStatusError: 'hsl(8, 60%, 47%)',
|
|
23
|
+
borderColorStatusErrorDark: 'hsl(8, 60%, 55%)',
|
|
22
24
|
colorNeutral100White: 'hsl(0, 0%, 100%)',
|
|
23
25
|
fillColorInteractionDefault: 'hsl(204, 100%, 40%)',
|
|
24
26
|
fillColorStatusNeutralGhost: 'hsl(0, 0%, 93%)',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/vendor/tapestry/tokens.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,2FAA2F;AAC3F,0GAA0G;AAE1G,MAAM,eAAe,GAAG;IACtB,aAAa,EAAE,gBAAgB;IAC/B,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAiB;IACjC,oBAAoB,EAAE,kBAAkB;IACxC,2BAA2B,EAAE,qBAAqB;IAClD,2BAA2B,EAAE,iBAAiB;IAC9C,+BAA+B,EAAE,iBAAiB;IAClD,sBAAsB,EAAE,iBAAiB;IACzC,0BAA0B,EAAE,iBAAiB;IAC7C,6BAA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E,sBAAsB;IACpD,4BAA4B,EAAE,sBAAsB;CAC5C,CAAA;AAEV,MAAM,gBAAgB,GAAG;IACvB,aAAa,EAAE,CAAC;IAChB,WAAW,EAAE,CAAC;IACd,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,CAAC;IACjB,cAAc,EAAE,CAAC;IACjB,cAAc,EAAE,CAAC;IACjB,cAAc,EAAE,EAAE;IAClB,iBAAiB,EAAE,EAAE;IACrB,iBAAiB,EAAE,CAAC;IACpB,eAAe,EAAE,CAAC;IAClB,gBAAgB,EAAE,KAAK;IACvB,gBAAgB,EAAE,KAAK;IACvB,kBAAkB,EAAE,KAAK;IACzB,cAAc,EAAE,KAAK;IACrB,WAAW,EAAE,EAAE;IACf,WAAW,EAAE,EAAE;IACf,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;CACP,CAAA;AAEV,MAAM,cAAc,GAAG;IACrB,mBAAmB,EAAE,gBAAgB,CAAC,cAAc;CAC5C,CAAA;AAEV,gFAAgF;AAChF,MAAM,eAAe,GAAG;IACtB,6BAA6B,EAAE,oBAAoB;IACnD,+BAA+B,EAAE,qBAAqB;IACtD,0BAA0B,EAAE,kBAAkB;CACtC,CAAA;AAEV,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,GAAG,eAAe;IAClB,GAAG,gBAAgB;IACnB,GAAG,cAAc;IACjB,GAAG,eAAe;CACnB,CAAA","sourcesContent":["// Copied from `@planningcenter/tapestry` package.\n// Defining these tokens locally is a temporary solution until the package supports mobile.\n// Tokens Reference: https://planningcenter.github.io/tapestry/?path=/docs/foundations-design-tokens--docs\n\nconst colorPrimitives = {\n colorNeutral7: 'hsl(0, 0%, 7%)',\n colorNeutral12: 'hsl(0, 0%, 12%)',\n colorNeutral15: 'hsl(0, 0%, 15%)',\n colorNeutral17: 'hsl(0, 0%, 17%)',\n colorNeutral19: 'hsl(0, 0%, 19%)',\n colorNeutral24: 'hsl(0, 0%, 24%)',\n colorNeutral32: 'hsl(0, 0%, 32%)',\n colorNeutral45: 'hsl(0, 0%, 45%)',\n colorNeutral50: 'hsl(0, 0%, 50%)',\n colorNeutral58: 'hsl(0, 0%, 58%)',\n colorNeutral68: 'hsl(0, 0%, 68%)',\n colorNeutral81: 'hsl(0, 0%, 81%)',\n colorNeutral88: 'hsl(0, 0%, 88%)',\n colorNeutral93: 'hsl(0, 0%, 93%)',\n colorNeutral95: 'hsl(0, 0%, 95%)',\n colorNeutral97: 'hsl(0, 0%, 97%)',\n colorNeutral98: 'hsl(0, 0%, 98%)',\n colorNeutral100White: 'hsl(0, 0%, 100%)',\n fillColorInteractionDefault: 'hsl(204, 100%, 40%)',\n fillColorStatusNeutralGhost: 'hsl(0, 0%, 93%)',\n fillColorStatusNeutralGhostDark: 'hsl(0, 0%, 18%)',\n textColorStatusNeutral: 'hsl(0, 0%, 24%)',\n textColorStatusNeutralDark: 'hsl(0, 0%, 80%)',\n iconColorStatusNeutralPrimary: 'hsl(0, 0%, 45%)',\n iconColorStatusNeutralPrimaryDark: 'hsl(0, 0%, 54%)',\n fillColorStatusErrorGhost: 'hsl(9, 59%, 93%)',\n fillColorStatusErrorGhostDark: 'hsl(8, 20%, 16%)',\n textColorStatusError: 'hsl(8, 60%, 45%)',\n textColorStatusErrorDark: 'hsl(8, 61%, 61%)',\n iconColorStatusErrorPrimary: 'hsl(8, 60%, 47%)',\n iconColorStatusErrorPrimaryDark: 'hsl(8, 60%, 55%)',\n fillColorStatusWarningGhost: 'hsl(42, 87%, 94%)',\n fillColorStatusWarningGhostDark: 'hsl(41, 18%, 17%)',\n textColorStatusWarning: 'hsl(42, 100%, 29%)',\n textColorStatusWarningDark: 'hsl(42, 84%, 55%)',\n iconColorStatusWarningPrimary: 'hsl(42, 84%, 49%)',\n iconColorStatusWarningPrimaryDark: 'hsl(42, 84%, 49%)',\n fillColorStatusSuccessGhost: 'hsl(97, 57%, 90%)',\n fillColorStatusSuccessGhostDark: 'hsl(125, 17%, 15%)',\n textColorStatusSuccess: 'hsl(97, 57%, 28%)',\n textColorStatusSuccessDark: 'hsl(97, 57%, 41%)',\n iconColorStatusSuccessPrimary: 'hsl(96, 57%, 33%)',\n iconColorStatusSuccessPrimaryDark: 'hsl(96, 57%, 41%)',\n fillColorStatusInfoGhost: 'hsl(203, 94%, 94%)',\n fillColorStatusInfoGhostDark: 'hsl(204, 32%, 15%)',\n textColorStatusInfo: 'hsl(204, 100%, 35%)',\n textColorStatusInfoDark: 'hsl(204, 68%, 55%)',\n iconColorStatusInfoPrimary: 'hsl(204, 100%, 40%)',\n iconColorStatusInfoPrimaryDark: 'hsl(204, 78%, 38%)',\n fillColorTransparencyLight010: 'hsla(0, 0%, 100%, 0.1)',\n fillColorTransparencyLight020: 'hsla(0, 0%, 100%, 0.2)',\n fillColorTransparencyLight030: 'hsla(0, 0%, 100%, 0.3)',\n fillColorTransparencyLight040: 'hsla(0, 0%, 100%, 0.4)',\n fillColorTransparencyLight050: 'hsla(0, 0%, 100%, 0.5)',\n fillColorTransparencyLight060: 'hsla(0, 0%, 100%, 0.6)',\n fillColorTransparencyLight070: 'hsla(0, 0%, 100%, 0.7)',\n fillColorTransparencyLight080: 'hsla(0, 0%, 100%, 0.8)',\n fillColorTransparencyLight090: 'hsla(0, 0%, 100%, 0.9)',\n fillColorTransparencyDark010: 'hsla(0, 0%, 0%, 0.1)',\n fillColorTransparencyDark020: 'hsla(0, 0%, 0%, 0.2)',\n fillColorTransparencyDark030: 'hsla(0, 0%, 0%, 0.3)',\n fillColorTransparencyDark040: 'hsla(0, 0%, 0%, 0.4)',\n fillColorTransparencyDark050: 'hsla(0, 0%, 0%, 0.5)',\n fillColorTransparencyDark060: 'hsla(0, 0%, 0%, 0.6)',\n fillColorTransparencyDark070: 'hsla(0, 0%, 0%, 0.7)',\n fillColorTransparencyDark080: 'hsla(0, 0%, 0%, 0.8)',\n fillColorTransparencyDark090: 'hsla(0, 0%, 0%, 0.9)',\n} as const\n\nconst numericPrimtives = {\n spacingFourth: 2,\n spacingHalf: 4,\n spacing1: 8,\n spacing2: 16,\n spacing3: 24,\n spacing4: 32,\n spacing5: 40,\n spacing6: 48,\n spacing7: 56,\n borderRadiusSm: 2,\n borderRadiusMd: 4,\n borderRadiusLg: 8,\n borderRadiusXl: 16,\n borderRadiusRound: 56,\n borderSizeDefault: 1,\n borderSizeThick: 2,\n fontWeightNormal: '400',\n fontWeightMedium: '500',\n fontWeightSemiBold: '600',\n fontWeightBold: '700',\n fontSize4xl: 32,\n fontSize3xl: 28,\n fontSize2xl: 24,\n fontSizeXl: 20,\n fontSizeLg: 18,\n fontSizeMd: 16,\n fontSizeSm: 14,\n fontSizeXs: 12,\n fontSize2xs: 10,\n} as const\n\nconst numericAliases = {\n borderRadiusDefault: numericPrimtives.borderRadiusMd,\n} as const\n\n// These tokens are specfic to Chat will not be replaced by the Tapestry library\nconst localChatTokens = {\n colorInteractionOnlineDefault: 'hsl(123, 38%, 57%)',\n fillColorInteractionDefaultDark: 'hsl(204, 100%, 40%)',\n fillColorStatusErrorMedium: 'hsl(0, 72%, 45%)',\n} as const\n\nexport const tokens = {\n ...colorPrimitives,\n ...numericPrimtives,\n ...numericAliases,\n ...localChatTokens,\n}\n"]}
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../src/vendor/tapestry/tokens.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,2FAA2F;AAC3F,0GAA0G;AAE1G,MAAM,eAAe,GAAG;IACtB,aAAa,EAAE,gBAAgB;IAC/B,cAAc,EAAE,iBAAiB;IACjC,cAAc,EAAE,iBAAi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,EAAE,EAAE;IACf,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;CACP,CAAA;AAEV,MAAM,cAAc,GAAG;IACrB,mBAAmB,EAAE,gBAAgB,CAAC,cAAc;CAC5C,CAAA;AAEV,gFAAgF;AAChF,MAAM,eAAe,GAAG;IACtB,6BAA6B,EAAE,oBAAoB;IACnD,+BAA+B,EAAE,qBAAqB;IACtD,0BAA0B,EAAE,kBAAkB;CACtC,CAAA;AAEV,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,GAAG,eAAe;IAClB,GAAG,gBAAgB;IACnB,GAAG,cAAc;IACjB,GAAG,eAAe;CACnB,CAAA","sourcesContent":["// Copied from `@planningcenter/tapestry` package.\n// Defining these tokens locally is a temporary solution until the package supports mobile.\n// Tokens Reference: https://planningcenter.github.io/tapestry/?path=/docs/foundations-design-tokens--docs\n\nconst colorPrimitives = {\n colorNeutral7: 'hsl(0, 0%, 7%)',\n colorNeutral12: 'hsl(0, 0%, 12%)',\n colorNeutral15: 'hsl(0, 0%, 15%)',\n colorNeutral17: 'hsl(0, 0%, 17%)',\n colorNeutral19: 'hsl(0, 0%, 19%)',\n colorNeutral24: 'hsl(0, 0%, 24%)',\n colorNeutral32: 'hsl(0, 0%, 32%)',\n colorNeutral45: 'hsl(0, 0%, 45%)',\n colorNeutral50: 'hsl(0, 0%, 50%)',\n colorNeutral58: 'hsl(0, 0%, 58%)',\n colorNeutral68: 'hsl(0, 0%, 68%)',\n colorNeutral81: 'hsl(0, 0%, 81%)',\n colorNeutral88: 'hsl(0, 0%, 88%)',\n colorNeutral93: 'hsl(0, 0%, 93%)',\n colorNeutral95: 'hsl(0, 0%, 95%)',\n colorNeutral97: 'hsl(0, 0%, 97%)',\n colorNeutral98: 'hsl(0, 0%, 98%)',\n borderColorStatusError: 'hsl(8, 60%, 47%)',\n borderColorStatusErrorDark: 'hsl(8, 60%, 55%)',\n colorNeutral100White: 'hsl(0, 0%, 100%)',\n fillColorInteractionDefault: 'hsl(204, 100%, 40%)',\n fillColorStatusNeutralGhost: 'hsl(0, 0%, 93%)',\n fillColorStatusNeutralGhostDark: 'hsl(0, 0%, 18%)',\n textColorStatusNeutral: 'hsl(0, 0%, 24%)',\n textColorStatusNeutralDark: 'hsl(0, 0%, 80%)',\n iconColorStatusNeutralPrimary: 'hsl(0, 0%, 45%)',\n iconColorStatusNeutralPrimaryDark: 'hsl(0, 0%, 54%)',\n fillColorStatusErrorGhost: 'hsl(9, 59%, 93%)',\n fillColorStatusErrorGhostDark: 'hsl(8, 20%, 16%)',\n textColorStatusError: 'hsl(8, 60%, 45%)',\n textColorStatusErrorDark: 'hsl(8, 61%, 61%)',\n iconColorStatusErrorPrimary: 'hsl(8, 60%, 47%)',\n iconColorStatusErrorPrimaryDark: 'hsl(8, 60%, 55%)',\n fillColorStatusWarningGhost: 'hsl(42, 87%, 94%)',\n fillColorStatusWarningGhostDark: 'hsl(41, 18%, 17%)',\n textColorStatusWarning: 'hsl(42, 100%, 29%)',\n textColorStatusWarningDark: 'hsl(42, 84%, 55%)',\n iconColorStatusWarningPrimary: 'hsl(42, 84%, 49%)',\n iconColorStatusWarningPrimaryDark: 'hsl(42, 84%, 49%)',\n fillColorStatusSuccessGhost: 'hsl(97, 57%, 90%)',\n fillColorStatusSuccessGhostDark: 'hsl(125, 17%, 15%)',\n textColorStatusSuccess: 'hsl(97, 57%, 28%)',\n textColorStatusSuccessDark: 'hsl(97, 57%, 41%)',\n iconColorStatusSuccessPrimary: 'hsl(96, 57%, 33%)',\n iconColorStatusSuccessPrimaryDark: 'hsl(96, 57%, 41%)',\n fillColorStatusInfoGhost: 'hsl(203, 94%, 94%)',\n fillColorStatusInfoGhostDark: 'hsl(204, 32%, 15%)',\n textColorStatusInfo: 'hsl(204, 100%, 35%)',\n textColorStatusInfoDark: 'hsl(204, 68%, 55%)',\n iconColorStatusInfoPrimary: 'hsl(204, 100%, 40%)',\n iconColorStatusInfoPrimaryDark: 'hsl(204, 78%, 38%)',\n fillColorTransparencyLight010: 'hsla(0, 0%, 100%, 0.1)',\n fillColorTransparencyLight020: 'hsla(0, 0%, 100%, 0.2)',\n fillColorTransparencyLight030: 'hsla(0, 0%, 100%, 0.3)',\n fillColorTransparencyLight040: 'hsla(0, 0%, 100%, 0.4)',\n fillColorTransparencyLight050: 'hsla(0, 0%, 100%, 0.5)',\n fillColorTransparencyLight060: 'hsla(0, 0%, 100%, 0.6)',\n fillColorTransparencyLight070: 'hsla(0, 0%, 100%, 0.7)',\n fillColorTransparencyLight080: 'hsla(0, 0%, 100%, 0.8)',\n fillColorTransparencyLight090: 'hsla(0, 0%, 100%, 0.9)',\n fillColorTransparencyDark010: 'hsla(0, 0%, 0%, 0.1)',\n fillColorTransparencyDark020: 'hsla(0, 0%, 0%, 0.2)',\n fillColorTransparencyDark030: 'hsla(0, 0%, 0%, 0.3)',\n fillColorTransparencyDark040: 'hsla(0, 0%, 0%, 0.4)',\n fillColorTransparencyDark050: 'hsla(0, 0%, 0%, 0.5)',\n fillColorTransparencyDark060: 'hsla(0, 0%, 0%, 0.6)',\n fillColorTransparencyDark070: 'hsla(0, 0%, 0%, 0.7)',\n fillColorTransparencyDark080: 'hsla(0, 0%, 0%, 0.8)',\n fillColorTransparencyDark090: 'hsla(0, 0%, 0%, 0.9)',\n} as const\n\nconst numericPrimtives = {\n spacingFourth: 2,\n spacingHalf: 4,\n spacing1: 8,\n spacing2: 16,\n spacing3: 24,\n spacing4: 32,\n spacing5: 40,\n spacing6: 48,\n spacing7: 56,\n borderRadiusSm: 2,\n borderRadiusMd: 4,\n borderRadiusLg: 8,\n borderRadiusXl: 16,\n borderRadiusRound: 56,\n borderSizeDefault: 1,\n borderSizeThick: 2,\n fontWeightNormal: '400',\n fontWeightMedium: '500',\n fontWeightSemiBold: '600',\n fontWeightBold: '700',\n fontSize4xl: 32,\n fontSize3xl: 28,\n fontSize2xl: 24,\n fontSizeXl: 20,\n fontSizeLg: 18,\n fontSizeMd: 16,\n fontSizeSm: 14,\n fontSizeXs: 12,\n fontSize2xs: 10,\n} as const\n\nconst numericAliases = {\n borderRadiusDefault: numericPrimtives.borderRadiusMd,\n} as const\n\n// These tokens are specfic to Chat will not be replaced by the Tapestry library\nconst localChatTokens = {\n colorInteractionOnlineDefault: 'hsl(123, 38%, 57%)',\n fillColorInteractionDefaultDark: 'hsl(204, 100%, 40%)',\n fillColorStatusErrorMedium: 'hsl(0, 72%, 45%)',\n} as const\n\nexport const tokens = {\n ...colorPrimitives,\n ...numericPrimtives,\n ...numericAliases,\n ...localChatTokens,\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "3.1.0-rc.
|
|
3
|
+
"version": "3.1.0-rc.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"prettier": "^3.4.2",
|
|
53
53
|
"typescript": "<5.6.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "ce8c868189704488e7926a099c730b47d04af0a5"
|
|
56
56
|
}
|
|
@@ -12,7 +12,7 @@ import { ReactionCountResource } from '../../types/resources/reaction'
|
|
|
12
12
|
/** Message
|
|
13
13
|
* Component for display of a message within a conversation list
|
|
14
14
|
*/
|
|
15
|
-
export function Message(props: MessageResource & { conversation_id:
|
|
15
|
+
export function Message(props: MessageResource & { conversation_id: number }) {
|
|
16
16
|
const { text, conversation_id, reactionCounts } = props
|
|
17
17
|
const styles = useMessageStyles(props)
|
|
18
18
|
const navigation = useNavigation()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useNavigation } from '@react-navigation/native'
|
|
2
2
|
import { FlashList } from '@shopify/flash-list'
|
|
3
|
-
import React from 'react'
|
|
3
|
+
import React, { useMemo } from 'react'
|
|
4
4
|
import { Pressable, StyleSheet, View } from 'react-native'
|
|
5
5
|
import { useTheme } from '../hooks'
|
|
6
6
|
import { useConversationsJoltEvents } from '../hooks/use_conversation_jolt_events'
|
|
@@ -17,7 +17,10 @@ export const Conversations = () => {
|
|
|
17
17
|
const canCreateConversations = useCanCreateConversations()
|
|
18
18
|
|
|
19
19
|
// TODO: Filter using the API
|
|
20
|
-
const nonEmptyConversations =
|
|
20
|
+
const nonEmptyConversations = useMemo(
|
|
21
|
+
() => conversations.filter(c => c.lastMessageTextPreview) || [],
|
|
22
|
+
[conversations]
|
|
23
|
+
)
|
|
21
24
|
const navigation = useNavigation()
|
|
22
25
|
|
|
23
26
|
useConversationsJoltEvents()
|
|
@@ -42,12 +45,7 @@ export const Conversations = () => {
|
|
|
42
45
|
renderItem={({ item }) => (
|
|
43
46
|
<Pressable
|
|
44
47
|
style={styles.conversation}
|
|
45
|
-
onPress={() =>
|
|
46
|
-
navigation.navigate('Conversation', {
|
|
47
|
-
conversation_id: item.id,
|
|
48
|
-
chat_group_graph_id: item.id,
|
|
49
|
-
})
|
|
50
|
-
}
|
|
48
|
+
onPress={() => navigation.navigate('Conversation', { conversation_id: item.id })}
|
|
51
49
|
>
|
|
52
50
|
<AvatarGroup size="lg" sourceUris={item.previewAvatarUrls || []} />
|
|
53
51
|
<View style={styles.conversationBody}>
|
|
@@ -5,7 +5,7 @@ import { transformGetToPost } from '../utils/client/request_helpers'
|
|
|
5
5
|
import { useApiClient } from './use_api_client'
|
|
6
6
|
import { getRequestQueryKey, useSuspenseGet } from './use_suspense_api'
|
|
7
7
|
|
|
8
|
-
export const getConversationRequestArgs = ({ conversation_id }: { conversation_id:
|
|
8
|
+
export const getConversationRequestArgs = ({ conversation_id }: { conversation_id: number }) => ({
|
|
9
9
|
url: `/me/conversations/${conversation_id}`,
|
|
10
10
|
data: {
|
|
11
11
|
fields: {
|
|
@@ -36,7 +36,7 @@ export const useConversation = ({ conversation_id }) => {
|
|
|
36
36
|
return useSuspenseGet<ConversationResource>(getConversationRequestArgs({ conversation_id }))
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
export const useConversationMute = ({ conversation_id }: { conversation_id:
|
|
39
|
+
export const useConversationMute = ({ conversation_id }: { conversation_id: number }) => {
|
|
40
40
|
const apiClient = useApiClient()
|
|
41
41
|
const queryClient = useQueryClient()
|
|
42
42
|
const requestArgs = getConversationRequestArgs({ conversation_id })
|
|
@@ -80,7 +80,7 @@ export const useConversationMute = ({ conversation_id }: { conversation_id: stri
|
|
|
80
80
|
return { muted: value, setMuted, ...mutation }
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
export const useConversationUpdate = ({ conversation_id }: { conversation_id:
|
|
83
|
+
export const useConversationUpdate = ({ conversation_id }: { conversation_id: number }) => {
|
|
84
84
|
const apiClient = useApiClient()
|
|
85
85
|
const queryClient = useQueryClient()
|
|
86
86
|
const requestArgs = getConversationRequestArgs({ conversation_id })
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CustomMessage } from '@planningcenter/jolt-client/dist/types/JoltConnection'
|
|
2
1
|
import { InfiniteData, useQueryClient } from '@tanstack/react-query'
|
|
3
2
|
import { ApiCollection, ApiResource, ConversationResource } from '../types'
|
|
4
3
|
import { deleteRecordInPagesData, updateOrCreateRecordInPagesData } from '../utils'
|
|
@@ -7,13 +6,10 @@ import { getConversationsRequestArgs } from './use_conversations'
|
|
|
7
6
|
import { useCurrentPerson } from './use_current_person'
|
|
8
7
|
import { useJoltChannel, useJoltEvent } from './use_jolt'
|
|
9
8
|
import { getRequestQueryKey } from './use_suspense_api'
|
|
9
|
+
import { JoltConversationEvent } from '../types/jolt_events'
|
|
10
|
+
import { ConversationDeletedEvent } from '../types/jolt_events/conversation_events'
|
|
10
11
|
|
|
11
12
|
type QueryData = InfiniteData<ApiCollection<ConversationResource>>
|
|
12
|
-
interface JoltConversationsEvent extends CustomMessage {
|
|
13
|
-
data: {
|
|
14
|
-
data: ConversationResource
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
13
|
|
|
18
14
|
export function useConversationsJoltEvents() {
|
|
19
15
|
const apiClient = useApiClient()
|
|
@@ -24,7 +20,7 @@ export function useConversationsJoltEvents() {
|
|
|
24
20
|
const conversationsRequestArgs = getConversationsRequestArgs()
|
|
25
21
|
const conversationQueryKey = getRequestQueryKey(conversationsRequestArgs)
|
|
26
22
|
|
|
27
|
-
const fetchConversation = async (
|
|
23
|
+
const fetchConversation = async (id: number) => {
|
|
28
24
|
const { data: argsData } = conversationsRequestArgs
|
|
29
25
|
const { data } = await apiClient.chat.get<ApiResource<ConversationResource>>({
|
|
30
26
|
url: `/me/conversations/${id}`,
|
|
@@ -37,8 +33,9 @@ export function useConversationsJoltEvents() {
|
|
|
37
33
|
return data
|
|
38
34
|
}
|
|
39
35
|
|
|
40
|
-
const handleConversationUpdateOrCreate = async (e:
|
|
41
|
-
const
|
|
36
|
+
const handleConversationUpdateOrCreate = async (e: JoltConversationEvent) => {
|
|
37
|
+
const { data } = e.data
|
|
38
|
+
const conversation: ConversationResource = await fetchConversation(data.id).catch(c => c)
|
|
42
39
|
|
|
43
40
|
queryClient.setQueryData<QueryData>(conversationQueryKey, prev =>
|
|
44
41
|
updateOrCreateRecordInPagesData({
|
|
@@ -51,11 +48,11 @@ export function useConversationsJoltEvents() {
|
|
|
51
48
|
)
|
|
52
49
|
}
|
|
53
50
|
|
|
54
|
-
const handleConversationDestroy = (e:
|
|
51
|
+
const handleConversationDestroy = (e: ConversationDeletedEvent) => {
|
|
55
52
|
queryClient.setQueryData<QueryData>(conversationQueryKey, prev =>
|
|
56
53
|
deleteRecordInPagesData({
|
|
57
54
|
data: prev,
|
|
58
|
-
record: e.data.data,
|
|
55
|
+
record: { id: e.data.data.id },
|
|
59
56
|
})
|
|
60
57
|
)
|
|
61
58
|
}
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from './use_suspense_api'
|
|
9
9
|
|
|
10
10
|
export const useConversationMessages = (
|
|
11
|
-
{ conversation_id }: { conversation_id:
|
|
11
|
+
{ conversation_id }: { conversation_id: number },
|
|
12
12
|
opts?: SuspensePaginatorOptions
|
|
13
13
|
) => {
|
|
14
14
|
const { data, refetch, isRefetching, fetchNextPage } = useSuspensePaginator<MessageResource>(
|
|
@@ -28,7 +28,7 @@ export const useConversationMessages = (
|
|
|
28
28
|
return { messages, refetch, isRefetching, fetchNextPage, queryKey }
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export const getMessagesRequestArgs = ({ conversation_id }: { conversation_id:
|
|
31
|
+
export const getMessagesRequestArgs = ({ conversation_id }: { conversation_id: number }) => ({
|
|
32
32
|
url: `/me/conversations/${conversation_id}/messages`,
|
|
33
33
|
data: {
|
|
34
34
|
perPage: 25,
|
|
@@ -50,7 +50,7 @@ export const getMessagesRequestArgs = ({ conversation_id }: { conversation_id: s
|
|
|
50
50
|
},
|
|
51
51
|
})
|
|
52
52
|
|
|
53
|
-
export const getMessagesQueryKey = ({ conversation_id }: { conversation_id:
|
|
53
|
+
export const getMessagesQueryKey = ({ conversation_id }: { conversation_id: number }) => {
|
|
54
54
|
const requestArgs = getMessagesRequestArgs({ conversation_id })
|
|
55
55
|
return getRequestQueryKey(requestArgs)
|
|
56
56
|
}
|