@planningcenter/chat-react-native 1.3.0 → 1.3.1-qa-68.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.
Files changed (39) hide show
  1. package/README.md +10 -0
  2. package/build/components/conversations.d.ts.map +1 -1
  3. package/build/components/conversations.js +32 -4
  4. package/build/components/conversations.js.map +1 -1
  5. package/build/components/display/image.d.ts +19 -0
  6. package/build/components/display/image.d.ts.map +1 -0
  7. package/build/components/display/image.js +39 -0
  8. package/build/components/display/image.js.map +1 -0
  9. package/build/components/display/index.d.ts +3 -0
  10. package/build/components/display/index.d.ts.map +1 -0
  11. package/build/components/display/index.js +3 -0
  12. package/build/components/display/index.js.map +1 -0
  13. package/build/components/display/spinner.d.ts +10 -0
  14. package/build/components/display/spinner.d.ts.map +1 -0
  15. package/build/components/display/spinner.js +78 -0
  16. package/build/components/display/spinner.js.map +1 -0
  17. package/build/components/error_boundary.d.ts +1 -1
  18. package/build/hooks/index.d.ts +3 -0
  19. package/build/hooks/index.d.ts.map +1 -0
  20. package/build/hooks/index.js +3 -0
  21. package/build/hooks/index.js.map +1 -0
  22. package/build/index.d.ts +1 -1
  23. package/build/index.d.ts.map +1 -1
  24. package/build/index.js +1 -1
  25. package/build/index.js.map +1 -1
  26. package/package.json +10 -5
  27. package/src/components/conversations.tsx +40 -10
  28. package/src/components/display/image.tsx +88 -0
  29. package/src/components/display/index.ts +2 -0
  30. package/src/components/display/spinner.tsx +97 -0
  31. package/src/hooks/index.ts +2 -0
  32. package/src/index.tsx +1 -1
  33. package/.babelrc.json +0 -3
  34. package/.eslintrc.yml +0 -2
  35. package/CHANGELOG.md +0 -25
  36. package/patches/README.md +0 -12
  37. package/patches/stream-chat-expo+5.44.2.patch +0 -105
  38. package/patches/stream-chat-react-native-core+5.44.2.patch +0 -24
  39. package/tsconfig.json +0 -8
package/README.md ADDED
@@ -0,0 +1,10 @@
1
+ # @planningcenter/chat-react-native
2
+
3
+ The code hosted here is meant to encapsulate behavior for our mobile targets. Currently we support behavior in Services and ChurchCenterApp.
4
+
5
+ This codebase is powered by scripts from expo-modules but by design is not meant to require expo in order to run. We support both react-native and expo codebases.
6
+
7
+ ## Installation
8
+
9
+ `npm i @planningcenter/chat-react-native`
10
+ `npx pod-install`
@@ -1 +1 @@
1
- {"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/components/conversations.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+B,MAAM,OAAO,CAAA;AAanD,wBAAgB,aAAa,6BAgB5B"}
1
+ {"version":3,"file":"conversations.d.ts","sourceRoot":"","sources":["../../src/components/conversations.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA+B,MAAM,OAAO,CAAA;AASnD,wBAAgB,aAAa,6BAgB5B"}
@@ -1,9 +1,10 @@
1
1
  import { useNavigation } from '@react-navigation/native';
2
2
  import { QueryErrorResetBoundary, useSuspenseQuery } from '@tanstack/react-query';
3
3
  import React, { Suspense, useContext } from 'react';
4
- import { FlatList, Pressable, StyleSheet, Text } from 'react-native';
4
+ import { FlatList, Pressable, StyleSheet, Text, View } from 'react-native';
5
5
  import { ChatContext } from '../contexts/chat_context';
6
- import { useTheme } from '../hooks/use_theme';
6
+ import { useTheme } from '../hooks';
7
+ import { Image, Spinner } from './display';
7
8
  import ErrorBoundary from './error_boundary';
8
9
  export function Conversations() {
9
10
  const { token } = useContext(ChatContext);
@@ -23,16 +24,43 @@ const Loaded = () => {
23
24
  queryKey: ['/chat/v2/me/conversations'],
24
25
  });
25
26
  const navigation = useNavigation();
26
- return (<FlatList data={conversations?.data} contentContainerStyle={styles.container} ListEmptyComponent={<Text>No conversations found</Text>} ListHeaderComponent={<Text style={styles.foo}>Conversations</Text>} renderItem={({ item }) => (<Pressable onPress={() => navigation.navigate('Settings')}>
27
+ return (<FlatList data={conversations?.data} contentContainerStyle={styles.container} style={styles.scrollView} ListEmptyComponent={<Text>No conversations found</Text>} ListHeaderComponent={<View style={styles.column}>
28
+ <Text style={styles.foo}>Display Components</Text>
29
+ <View style={[styles.row, styles.spinnerContainer]}>
30
+ <Spinner size={24}/>
31
+ </View>
32
+ <View style={styles.row}>
33
+ <Image source={{ uri: 'https://broken.url' }} style={styles.image}/>
34
+ <Image source={{
35
+ uri: 'https://picsum.photos/seed/picsum/200',
36
+ }} style={styles.image}/>
37
+ </View>
38
+ <Text style={styles.foo}>Conversations</Text>
39
+ </View>} renderItem={({ item }) => (<Pressable onPress={() => navigation.navigate('Settings')}>
27
40
  <Text style={styles.listItem}>{item.attributes.title}</Text>
28
41
  </Pressable>)}/>);
29
42
  };
30
43
  const useStyles = () => {
31
44
  const { colors } = useTheme();
32
45
  return StyleSheet.create({
33
- container: { columnGap: 16, backgroundColor: colors.fillColorNeutral080 },
46
+ scrollView: { flex: 1, backgroundColor: colors.fillColorNeutral090 },
47
+ container: { gap: 8, padding: 16 },
34
48
  foo: { fontSize: 24, color: colors.testColor },
35
49
  listItem: { color: colors.fillColorNeutral020 },
50
+ row: {
51
+ gap: 16,
52
+ flexDirection: 'row',
53
+ alignItems: 'center',
54
+ justifyContent: 'center',
55
+ },
56
+ column: { gap: 16 },
57
+ spinnerContainer: {
58
+ height: 20,
59
+ },
60
+ image: {
61
+ width: 100,
62
+ height: 100,
63
+ },
36
64
  });
37
65
  };
38
66
  //# sourceMappingURL=conversations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../src/components/conversations.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,0BA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AAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CACxB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CACxD;UAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,IAAI,CAC7D;QAAA,EAAE,SAAS,CAAC,CACb,CAAC,EACF,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,eAAe,EAAE,MAAM,CAAC,mBAAmB,EAAE;QACzE,GAAG,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE;QAC9C,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,mBAAmB,EAAE;KAChD,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport { QueryErrorResetBoundary, useSuspenseQuery } from '@tanstack/react-query'\nimport React, { Suspense, useContext } from 'react'\nimport { FlatList, Pressable, StyleSheet, Text } from 'react-native'\nimport { ChatContext } from '../contexts/chat_context'\nimport { useTheme } from '../hooks/use_theme'\nimport { ConversationRecord } from '../types'\nimport ErrorBoundary from './error_boundary'\n\ntype ConversationsResponse = {\n data: ConversationRecord[]\n links: Record<string, string>\n meta: Record<string, string>\n}\n\nexport function Conversations() {\n const { token } = useContext(ChatContext)\n\n if (!token) return null\n\n return (\n <QueryErrorResetBoundary>\n {({ reset }) => (\n <ErrorBoundary onReset={reset}>\n <Suspense fallback={<Text>loading...</Text>}>\n <Loaded />\n </Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n )\n}\n\nconst Loaded = () => {\n const styles = useStyles()\n const { data: conversations } = useSuspenseQuery<ConversationsResponse>({\n queryKey: ['/chat/v2/me/conversations'],\n })\n const navigation = useNavigation()\n\n return (\n <FlatList\n data={conversations?.data}\n contentContainerStyle={styles.container}\n ListEmptyComponent={<Text>No conversations found</Text>}\n ListHeaderComponent={<Text style={styles.foo}>Conversations</Text>}\n renderItem={({ item }) => (\n <Pressable onPress={() => navigation.navigate('Settings')}>\n <Text style={styles.listItem}>{item.attributes.title}</Text>\n </Pressable>\n )}\n />\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n container: { columnGap: 16, backgroundColor: colors.fillColorNeutral080 },\n foo: { fontSize: 24, color: colors.testColor },\n listItem: { color: colors.fillColorNeutral020 },\n })\n}\n"]}
1
+ {"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../src/components/conversations.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,aAAa,MAAM,kBAAkB,CAAA;AAI5C,MAAM,UAAU,aAAa;IAC3B,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,CAAA;IAEzC,IAAI,CAAC,KAAK;QAAE,OAA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EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE;QAC9C,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,mBAAmB,EAAE;QAC/C,GAAG,EAAE;YACH,GAAG,EAAE,EAAE;YACP,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;SACzB;QACD,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;QACnB,gBAAgB,EAAE;YAChB,MAAM,EAAE,EAAE;SACX;QACD,KAAK,EAAE;YACL,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,GAAG;SACZ;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { ConversationResource, JSONAPICollection } from '@planningcenter/chat-core'\nimport { useNavigation } from '@react-navigation/native'\nimport { QueryErrorResetBoundary, useSuspenseQuery } from '@tanstack/react-query'\nimport React, { Suspense, useContext } from 'react'\nimport { FlatList, Pressable, StyleSheet, Text, View } from 'react-native'\nimport { ChatContext } from '../contexts/chat_context'\nimport { useTheme } from '../hooks'\nimport { Image, Spinner } from './display'\nimport ErrorBoundary from './error_boundary'\n\ntype ConversationsResponse = JSONAPICollection<ConversationResource>\n\nexport function Conversations() {\n const { token } = useContext(ChatContext)\n\n if (!token) return null\n\n return (\n <QueryErrorResetBoundary>\n {({ reset }) => (\n <ErrorBoundary onReset={reset}>\n <Suspense fallback={<Text>loading...</Text>}>\n <Loaded />\n </Suspense>\n </ErrorBoundary>\n )}\n </QueryErrorResetBoundary>\n )\n}\n\nconst Loaded = () => {\n const styles = useStyles()\n const { data: conversations } = useSuspenseQuery<ConversationsResponse>({\n queryKey: ['/chat/v2/me/conversations'],\n })\n const navigation = useNavigation()\n\n return (\n <FlatList\n data={conversations?.data}\n contentContainerStyle={styles.container}\n style={styles.scrollView}\n ListEmptyComponent={<Text>No conversations found</Text>}\n ListHeaderComponent={\n <View style={styles.column}>\n <Text style={styles.foo}>Display Components</Text>\n <View style={[styles.row, styles.spinnerContainer]}>\n <Spinner size={24} />\n </View>\n <View style={styles.row}>\n <Image source={{ uri: 'https://broken.url' }} style={styles.image} />\n <Image\n source={{\n uri: 'https://picsum.photos/seed/picsum/200',\n }}\n style={styles.image}\n />\n </View>\n <Text style={styles.foo}>Conversations</Text>\n </View>\n }\n renderItem={({ item }) => (\n <Pressable onPress={() => navigation.navigate('Settings')}>\n <Text style={styles.listItem}>{item.attributes.title}</Text>\n </Pressable>\n )}\n />\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n scrollView: { flex: 1, backgroundColor: colors.fillColorNeutral090 },\n container: { gap: 8, padding: 16 },\n foo: { fontSize: 24, color: colors.testColor },\n listItem: { color: colors.fillColorNeutral020 },\n row: {\n gap: 16,\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n },\n column: { gap: 16 },\n spinnerContainer: {\n height: 20,\n },\n image: {\n width: 100,\n height: 100,\n },\n })\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { ImageProps as RNImageProps, ViewStyle } from 'react-native';
3
+ interface ImageProps extends RNImageProps {
4
+ /**
5
+ * Should the image show the loading indicator by default.
6
+ */
7
+ defaultLoading?: boolean;
8
+ /**
9
+ * Size of the loading spinner.
10
+ */
11
+ loaderSize?: number;
12
+ /**
13
+ * Style object for the preload background.
14
+ */
15
+ loadingBackgroundStyles?: ViewStyle;
16
+ }
17
+ export declare function Image({ source, onLoad, defaultLoading, loaderSize, loadingBackgroundStyles, style, ...restProps }: ImageProps): React.JSX.Element;
18
+ export {};
19
+ //# sourceMappingURL=image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/display/image.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAA;AACvC,OAAO,EAIL,UAAU,IAAI,YAAY,EAG1B,SAAS,EACV,MAAM,cAAc,CAAA;AAIrB,UAAU,UAAW,SAAQ,YAAY;IACvC;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,uBAAuB,CAAC,EAAE,SAAS,CAAA;CACpC;AAED,wBAAgB,KAAK,CAAC,EACpB,MAAM,EACN,MAAa,EACb,cAAqB,EACrB,UAAe,EACf,uBAAuB,EACvB,KAAK,EACL,GAAG,SAAS,EACb,EAAE,UAAU,qBA2BZ"}
@@ -0,0 +1,39 @@
1
+ import { noop } from 'lodash';
2
+ import React, { useState } from 'react';
3
+ import { Image as ReactNativeImage, StyleSheet, View, } from 'react-native';
4
+ import { useTheme } from '../../hooks';
5
+ import { Spinner } from './spinner';
6
+ export function Image({ source, onLoad = noop, defaultLoading = true, loaderSize = 24, loadingBackgroundStyles, style, ...restProps }) {
7
+ const [loading, setLoading] = useState(defaultLoading);
8
+ const imageStyles = StyleSheet.flatten(style);
9
+ const { width = '100%', height = '100%', borderRadius = 0 } = imageStyles || {};
10
+ const styles = useStyles(width, height, borderRadius);
11
+ const handleOnLoad = (event) => {
12
+ setLoading(false);
13
+ onLoad?.(event);
14
+ };
15
+ return (<View>
16
+ <ReactNativeImage style={[styles.image, imageStyles]} onLoad={handleOnLoad} source={source} {...restProps}/>
17
+ {loading && (<View style={[styles.loadingBackground, loadingBackgroundStyles]}>
18
+ <Spinner size={loaderSize}/>
19
+ </View>)}
20
+ </View>);
21
+ }
22
+ const useStyles = (width, height, borderRadius) => {
23
+ const { colors } = useTheme();
24
+ return StyleSheet.create({
25
+ loadingBackground: {
26
+ position: 'absolute',
27
+ top: 0,
28
+ left: 0,
29
+ backgroundColor: colors.fillColorNeutral070,
30
+ borderRadius,
31
+ width,
32
+ height,
33
+ },
34
+ image: {
35
+ backgroundColor: 'transparent',
36
+ },
37
+ });
38
+ };
39
+ //# sourceMappingURL=image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"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,CAAC,OAAO,IAAI,CACV,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,iBAAiB,EAAE,uBAAuB,CAAC,CAAC,CAC/D;UAAA,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,EAC5B;QAAA,EAAE,IAAI,CAAC,CACR,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,CAChB,KAAqB,EACrB,MAAsB,EACtB,YAAoC,EACpC,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,iBAAiB,EAAE;YACjB,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,eAAe,EAAE,MAAM,CAAC,mBAAmB;YAC3C,YAAY;YACZ,KAAK;YACL,MAAM;SACP;QACD,KAAK,EAAE;YACL,eAAe,EAAE,aAAa;SAC/B;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { noop } from 'lodash'\nimport React, { useState } from 'react'\nimport {\n AnimatableNumericValue,\n DimensionValue,\n Image as ReactNativeImage,\n ImageProps as RNImageProps,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native'\nimport { useTheme } from '../../hooks'\nimport { Spinner } from './spinner'\n\ninterface ImageProps extends RNImageProps {\n /**\n * Should the image show the loading indicator by default.\n */\n defaultLoading?: boolean\n /**\n * Size of the loading spinner.\n */\n loaderSize?: number\n /**\n * Style object for the preload background.\n */\n loadingBackgroundStyles?: ViewStyle\n}\n\nexport function Image({\n source,\n onLoad = noop,\n defaultLoading = true,\n loaderSize = 24,\n loadingBackgroundStyles,\n style,\n ...restProps\n}: ImageProps) {\n const [loading, setLoading] = useState(defaultLoading)\n\n const imageStyles = StyleSheet.flatten(style)\n const { width = '100%', height = '100%', borderRadius = 0 } = imageStyles || {}\n const styles = useStyles(width, height, borderRadius)\n\n const handleOnLoad = (event: any) => {\n setLoading(false)\n onLoad?.(event)\n }\n\n return (\n <View>\n <ReactNativeImage\n style={[styles.image, imageStyles]}\n onLoad={handleOnLoad}\n source={source}\n {...restProps}\n />\n {loading && (\n <View style={[styles.loadingBackground, loadingBackgroundStyles]}>\n <Spinner size={loaderSize} />\n </View>\n )}\n </View>\n )\n}\n\nconst useStyles = (\n width: DimensionValue,\n height: DimensionValue,\n borderRadius: AnimatableNumericValue\n) => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n loadingBackground: {\n position: 'absolute',\n top: 0,\n left: 0,\n backgroundColor: colors.fillColorNeutral070,\n borderRadius,\n width,\n height,\n },\n image: {\n backgroundColor: 'transparent',\n },\n })\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export { Spinner } from './spinner';
2
+ export { Image } from './image';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/display/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { Spinner } from './spinner';
2
+ export { Image } from './image';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/display/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA","sourcesContent":["export { Spinner } from './spinner'\nexport { Image } from './image'\n"]}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface SpinnerProps {
3
+ /**
4
+ * Size of the spinner in px
5
+ * */
6
+ size?: number;
7
+ }
8
+ export declare function Spinner({ size }: SpinnerProps): React.JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=spinner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/components/display/spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAA;AAIhD,UAAU,YAAY;IACpB;;SAEK;IACL,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,OAAO,CAAC,EAAE,IAAS,EAAE,EAAE,YAAY,qBAoClD"}
@@ -0,0 +1,78 @@
1
+ import React, { useEffect, useRef } from 'react';
2
+ import { Animated, Easing, StyleSheet, View } from 'react-native';
3
+ import { useTheme } from '../../hooks';
4
+ export function Spinner({ size = 20 }) {
5
+ const rotation = useRef(new Animated.Value(0)).current;
6
+ const animation = Animated.loop(Animated.timing(rotation, {
7
+ toValue: 1,
8
+ duration: 1000,
9
+ easing: Easing.linear,
10
+ useNativeDriver: true,
11
+ }));
12
+ const rotateValue = rotation.interpolate({
13
+ inputRange: [0, 1],
14
+ outputRange: ['0deg', '360deg'],
15
+ });
16
+ const styles = useStyles(rotateValue, size);
17
+ useEffect(() => {
18
+ animation.start();
19
+ return () => animation.stop();
20
+ }, [animation]);
21
+ useEffect(() => () => rotation.setValue(0), [rotation]);
22
+ return (<View style={styles.container}>
23
+ <Animated.View style={styles.animatedContainer}>
24
+ <View style={styles.clipping}>
25
+ <View style={[styles.circle, styles.spinner]}/>
26
+ </View>
27
+ <View style={[styles.circle, styles.track]}/>
28
+ </Animated.View>
29
+ </View>);
30
+ }
31
+ const useStyles = (rotate, size) => {
32
+ const { colors } = useTheme();
33
+ return StyleSheet.create({
34
+ container: {
35
+ width: '100%',
36
+ height: '100%',
37
+ position: 'absolute',
38
+ top: 0,
39
+ left: 0,
40
+ zIndex: 200,
41
+ justifyContent: 'center',
42
+ alignItems: 'center',
43
+ opacity: 0.7,
44
+ },
45
+ animatedContainer: {
46
+ width: size,
47
+ height: size,
48
+ borderRadius: size / 2,
49
+ transform: [{ rotate }],
50
+ },
51
+ circle: {
52
+ width: size,
53
+ height: size,
54
+ borderRadius: size / 2,
55
+ borderStyle: 'solid',
56
+ borderWidth: 3,
57
+ },
58
+ spinner: {
59
+ position: 'absolute',
60
+ top: 0,
61
+ left: 0,
62
+ borderColor: colors.fillColorNeutral020,
63
+ },
64
+ track: {
65
+ borderColor: colors.fillColorNeutral050Base,
66
+ },
67
+ clipping: {
68
+ position: 'absolute',
69
+ top: 0,
70
+ left: 0,
71
+ width: size / 2,
72
+ height: size / 2,
73
+ overflow: 'hidden',
74
+ zIndex: 200,
75
+ },
76
+ });
77
+ };
78
+ //# sourceMappingURL=spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../../src/components/display/spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAStC,MAAM,UAAU,OAAO,CAAC,EAAE,IAAI,GAAG,EAAE,EAAgB;IACjD,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IAEtD,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAC7B,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE;QACxB,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,eAAe,EAAE,IAAI;KACtB,CAAC,CACH,CAAA;IAED,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QACvC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAClB,WAAW,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;KAChC,CAAC,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E,CAAC;YACP,MAAM,EAAE,GAAG;YACX,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,GAAG;SACb;QACD,iBAAiB,EAAE;YACjB,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,IAAI,GAAG,CAAC;YACtB,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;SACxB;QACD,MAAM,EAAE;YACN,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,IAAI,GAAG,CAAC;YACtB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,CAAC;SACf;QACD,OAAO,EAAE;YACP,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,WAAW,EAAE,MAAM,CAAC,mBAAmB;SACxC;QACD,KAAK,EAAE;YACL,WAAW,EAAE,MAAM,CAAC,uBAAuB;SAC5C;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,IAAI,GAAG,CAAC;YACf,MAAM,EAAE,IAAI,GAAG,CAAC;YAChB,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,GAAG;SACZ;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { useEffect, useRef } from 'react'\nimport { Animated, Easing, StyleSheet, View } from 'react-native'\nimport { useTheme } from '../../hooks'\n\ninterface SpinnerProps {\n /**\n * Size of the spinner in px\n * */\n size?: number\n}\n\nexport function Spinner({ size = 20 }: SpinnerProps) {\n const rotation = useRef(new Animated.Value(0)).current\n\n const animation = Animated.loop(\n Animated.timing(rotation, {\n toValue: 1,\n duration: 1000,\n easing: Easing.linear,\n useNativeDriver: true,\n })\n )\n\n const rotateValue = rotation.interpolate({\n inputRange: [0, 1],\n outputRange: ['0deg', '360deg'],\n })\n\n const styles = useStyles(rotateValue, size)\n\n useEffect(() => {\n animation.start()\n return () => animation.stop()\n }, [animation])\n\n useEffect(() => () => rotation.setValue(0), [rotation])\n\n return (\n <View style={styles.container}>\n <Animated.View style={styles.animatedContainer}>\n <View style={styles.clipping}>\n <View style={[styles.circle, styles.spinner]} />\n </View>\n <View style={[styles.circle, styles.track]} />\n </Animated.View>\n </View>\n )\n}\n\nconst useStyles = (rotate: Animated.AnimatedInterpolation<string | number>, size: number) => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n container: {\n width: '100%',\n height: '100%',\n position: 'absolute',\n top: 0,\n left: 0,\n zIndex: 200,\n justifyContent: 'center',\n alignItems: 'center',\n opacity: 0.7,\n },\n animatedContainer: {\n width: size,\n height: size,\n borderRadius: size / 2,\n transform: [{ rotate }],\n },\n circle: {\n width: size,\n height: size,\n borderRadius: size / 2,\n borderStyle: 'solid',\n borderWidth: 3,\n },\n spinner: {\n position: 'absolute',\n top: 0,\n left: 0,\n borderColor: colors.fillColorNeutral020,\n },\n track: {\n borderColor: colors.fillColorNeutral050Base,\n },\n clipping: {\n position: 'absolute',\n top: 0,\n left: 0,\n width: size / 2,\n height: size / 2,\n overflow: 'hidden',\n zIndex: 200,\n },\n })\n}\n"]}
@@ -8,7 +8,7 @@ declare class ErrorBoundary extends React.Component<PropsWithChildren<{
8
8
  };
9
9
  componentDidCatch(error: any): void;
10
10
  handleError(error: any): void;
11
- render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
11
+ render(): React.ReactNode;
12
12
  }
13
13
  export default ErrorBoundary;
14
14
  //# sourceMappingURL=error_boundary.d.ts.map
@@ -0,0 +1,3 @@
1
+ export { useCreateChatTheme } from './use_create_chat_theme';
2
+ export { useTheme } from './use_theme';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { useCreateChatTheme } from './use_create_chat_theme';
2
+ export { useTheme } from './use_theme';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA","sourcesContent":["export { useCreateChatTheme } from './use_create_chat_theme'\nexport { useTheme } from './use_theme'\n"]}
package/build/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Conversations } from './components/conversations';
2
2
  import { ChatContext, ChatProvider } from './contexts/chat_context';
3
- import { useCreateChatTheme } from './hooks/use_create_chat_theme';
3
+ import { useCreateChatTheme } from './hooks';
4
4
  import { OAuthToken } from './types';
5
5
  import { baseUrlMap, uploadUrlMap } from './utils/session';
6
6
  import { TemporaryDefaultColorsType } from './utils/theme';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAA;AAE1D,OAAO,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,aAAa,EACb,UAAU,EACV,0BAA0B,EAC1B,YAAY,EACZ,kBAAkB,GACnB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAA;AAE1D,OAAO,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,aAAa,EACb,UAAU,EACV,0BAA0B,EAC1B,YAAY,EACZ,kBAAkB,GACnB,CAAA"}
package/build/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Conversations } from './components/conversations';
2
2
  import { ChatContext, ChatProvider } from './contexts/chat_context';
3
- import { useCreateChatTheme } from './hooks/use_create_chat_theme';
3
+ import { useCreateChatTheme } from './hooks';
4
4
  import { baseUrlMap, uploadUrlMap } from './utils/session';
5
5
  export { baseUrlMap, ChatContext, ChatProvider, Conversations, uploadUrlMap, useCreateChatTheme, };
6
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAElE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAG1D,OAAO,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,aAAa,EAGb,YAAY,EACZ,kBAAkB,GACnB,CAAA","sourcesContent":["import { Conversations } from './components/conversations'\nimport { ChatContext, ChatProvider } from './contexts/chat_context'\nimport { useCreateChatTheme } from './hooks/use_create_chat_theme'\nimport { OAuthToken } from './types'\nimport { baseUrlMap, uploadUrlMap } from './utils/session'\nimport { TemporaryDefaultColorsType } from './utils/theme'\n\nexport {\n baseUrlMap,\n ChatContext,\n ChatProvider,\n Conversations,\n OAuthToken,\n TemporaryDefaultColorsType,\n uploadUrlMap,\n useCreateChatTheme,\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAG1D,OAAO,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,aAAa,EAGb,YAAY,EACZ,kBAAkB,GACnB,CAAA","sourcesContent":["import { Conversations } from './components/conversations'\nimport { ChatContext, ChatProvider } from './contexts/chat_context'\nimport { useCreateChatTheme } from './hooks'\nimport { OAuthToken } from './types'\nimport { baseUrlMap, uploadUrlMap } from './utils/session'\nimport { TemporaryDefaultColorsType } from './utils/theme'\n\nexport {\n baseUrlMap,\n ChatContext,\n ChatProvider,\n Conversations,\n OAuthToken,\n TemporaryDefaultColorsType,\n uploadUrlMap,\n useCreateChatTheme,\n}\n"]}
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@planningcenter/chat-react-native",
3
- "version": "1.3.0",
3
+ "version": "1.3.1-qa-68.0",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
7
+ "files": [
8
+ "build",
9
+ "src"
10
+ ],
7
11
  "sideEffects": false,
8
12
  "scripts": {
9
13
  "build": "expo-module build",
@@ -12,10 +16,12 @@
12
16
  "test": "expo-module test",
13
17
  "prepublishOnly": "expo-module prepublishOnly"
14
18
  },
19
+ "dependencies": {
20
+ "@planningcenter/chat-core": "^1.3.1-qa-68.0"
21
+ },
15
22
  "peerDependencies": {
16
23
  "@react-navigation/elements": "*",
17
24
  "@react-navigation/native": "*",
18
- "@react-navigation/native-stack": "*",
19
25
  "@tanstack/react-query": "^5.0.0",
20
26
  "lodash": "*",
21
27
  "react": "*",
@@ -25,13 +31,12 @@
25
31
  "@react-native/eslint-config": "^0.77.0",
26
32
  "@react-navigation/elements": "^2.2.3",
27
33
  "@react-navigation/native": "^7.0.14",
28
- "@react-navigation/native-stack": "^7.2.0",
29
34
  "@tanstack/react-query": "^5.66.0",
30
35
  "@typescript-eslint/parser": "^8.23.0",
31
- "expo-module-scripts": "^3.4.0",
36
+ "expo-module-scripts": "^4.0.3",
32
37
  "lodash": "^4.17.21",
33
38
  "prettier": "^3.4.2",
34
39
  "react-native": "0.74.5"
35
40
  },
36
- "gitHead": "fccff0f8691ba483d7f504423a1bd649c94a5af8"
41
+ "gitHead": "4bd5d6e5cec476c55e45280b972903861d47d071"
37
42
  }
@@ -1,17 +1,14 @@
1
+ import { ConversationResource, JSONAPICollection } from '@planningcenter/chat-core'
1
2
  import { useNavigation } from '@react-navigation/native'
2
3
  import { QueryErrorResetBoundary, useSuspenseQuery } from '@tanstack/react-query'
3
4
  import React, { Suspense, useContext } from 'react'
4
- import { FlatList, Pressable, StyleSheet, Text } from 'react-native'
5
+ import { FlatList, Pressable, StyleSheet, Text, View } from 'react-native'
5
6
  import { ChatContext } from '../contexts/chat_context'
6
- import { useTheme } from '../hooks/use_theme'
7
- import { ConversationRecord } from '../types'
7
+ import { useTheme } from '../hooks'
8
+ import { Image, Spinner } from './display'
8
9
  import ErrorBoundary from './error_boundary'
9
10
 
10
- type ConversationsResponse = {
11
- data: ConversationRecord[]
12
- links: Record<string, string>
13
- meta: Record<string, string>
14
- }
11
+ type ConversationsResponse = JSONAPICollection<ConversationResource>
15
12
 
16
13
  export function Conversations() {
17
14
  const { token } = useContext(ChatContext)
@@ -42,8 +39,26 @@ const Loaded = () => {
42
39
  <FlatList
43
40
  data={conversations?.data}
44
41
  contentContainerStyle={styles.container}
42
+ style={styles.scrollView}
45
43
  ListEmptyComponent={<Text>No conversations found</Text>}
46
- ListHeaderComponent={<Text style={styles.foo}>Conversations</Text>}
44
+ ListHeaderComponent={
45
+ <View style={styles.column}>
46
+ <Text style={styles.foo}>Display Components</Text>
47
+ <View style={[styles.row, styles.spinnerContainer]}>
48
+ <Spinner size={24} />
49
+ </View>
50
+ <View style={styles.row}>
51
+ <Image source={{ uri: 'https://broken.url' }} style={styles.image} />
52
+ <Image
53
+ source={{
54
+ uri: 'https://picsum.photos/seed/picsum/200',
55
+ }}
56
+ style={styles.image}
57
+ />
58
+ </View>
59
+ <Text style={styles.foo}>Conversations</Text>
60
+ </View>
61
+ }
47
62
  renderItem={({ item }) => (
48
63
  <Pressable onPress={() => navigation.navigate('Settings')}>
49
64
  <Text style={styles.listItem}>{item.attributes.title}</Text>
@@ -57,8 +72,23 @@ const useStyles = () => {
57
72
  const { colors } = useTheme()
58
73
 
59
74
  return StyleSheet.create({
60
- container: { columnGap: 16, backgroundColor: colors.fillColorNeutral080 },
75
+ scrollView: { flex: 1, backgroundColor: colors.fillColorNeutral090 },
76
+ container: { gap: 8, padding: 16 },
61
77
  foo: { fontSize: 24, color: colors.testColor },
62
78
  listItem: { color: colors.fillColorNeutral020 },
79
+ row: {
80
+ gap: 16,
81
+ flexDirection: 'row',
82
+ alignItems: 'center',
83
+ justifyContent: 'center',
84
+ },
85
+ column: { gap: 16 },
86
+ spinnerContainer: {
87
+ height: 20,
88
+ },
89
+ image: {
90
+ width: 100,
91
+ height: 100,
92
+ },
63
93
  })
64
94
  }
@@ -0,0 +1,88 @@
1
+ import { noop } from 'lodash'
2
+ import React, { useState } from 'react'
3
+ import {
4
+ AnimatableNumericValue,
5
+ DimensionValue,
6
+ Image as ReactNativeImage,
7
+ ImageProps as RNImageProps,
8
+ StyleSheet,
9
+ View,
10
+ ViewStyle,
11
+ } from 'react-native'
12
+ import { useTheme } from '../../hooks'
13
+ import { Spinner } from './spinner'
14
+
15
+ interface ImageProps extends RNImageProps {
16
+ /**
17
+ * Should the image show the loading indicator by default.
18
+ */
19
+ defaultLoading?: boolean
20
+ /**
21
+ * Size of the loading spinner.
22
+ */
23
+ loaderSize?: number
24
+ /**
25
+ * Style object for the preload background.
26
+ */
27
+ loadingBackgroundStyles?: ViewStyle
28
+ }
29
+
30
+ export function Image({
31
+ source,
32
+ onLoad = noop,
33
+ defaultLoading = true,
34
+ loaderSize = 24,
35
+ loadingBackgroundStyles,
36
+ style,
37
+ ...restProps
38
+ }: ImageProps) {
39
+ const [loading, setLoading] = useState(defaultLoading)
40
+
41
+ const imageStyles = StyleSheet.flatten(style)
42
+ const { width = '100%', height = '100%', borderRadius = 0 } = imageStyles || {}
43
+ const styles = useStyles(width, height, borderRadius)
44
+
45
+ const handleOnLoad = (event: any) => {
46
+ setLoading(false)
47
+ onLoad?.(event)
48
+ }
49
+
50
+ return (
51
+ <View>
52
+ <ReactNativeImage
53
+ style={[styles.image, imageStyles]}
54
+ onLoad={handleOnLoad}
55
+ source={source}
56
+ {...restProps}
57
+ />
58
+ {loading && (
59
+ <View style={[styles.loadingBackground, loadingBackgroundStyles]}>
60
+ <Spinner size={loaderSize} />
61
+ </View>
62
+ )}
63
+ </View>
64
+ )
65
+ }
66
+
67
+ const useStyles = (
68
+ width: DimensionValue,
69
+ height: DimensionValue,
70
+ borderRadius: AnimatableNumericValue
71
+ ) => {
72
+ const { colors } = useTheme()
73
+
74
+ return StyleSheet.create({
75
+ loadingBackground: {
76
+ position: 'absolute',
77
+ top: 0,
78
+ left: 0,
79
+ backgroundColor: colors.fillColorNeutral070,
80
+ borderRadius,
81
+ width,
82
+ height,
83
+ },
84
+ image: {
85
+ backgroundColor: 'transparent',
86
+ },
87
+ })
88
+ }
@@ -0,0 +1,2 @@
1
+ export { Spinner } from './spinner'
2
+ export { Image } from './image'
@@ -0,0 +1,97 @@
1
+ import React, { useEffect, useRef } from 'react'
2
+ import { Animated, Easing, StyleSheet, View } from 'react-native'
3
+ import { useTheme } from '../../hooks'
4
+
5
+ interface SpinnerProps {
6
+ /**
7
+ * Size of the spinner in px
8
+ * */
9
+ size?: number
10
+ }
11
+
12
+ export function Spinner({ size = 20 }: SpinnerProps) {
13
+ const rotation = useRef(new Animated.Value(0)).current
14
+
15
+ const animation = Animated.loop(
16
+ Animated.timing(rotation, {
17
+ toValue: 1,
18
+ duration: 1000,
19
+ easing: Easing.linear,
20
+ useNativeDriver: true,
21
+ })
22
+ )
23
+
24
+ const rotateValue = rotation.interpolate({
25
+ inputRange: [0, 1],
26
+ outputRange: ['0deg', '360deg'],
27
+ })
28
+
29
+ const styles = useStyles(rotateValue, size)
30
+
31
+ useEffect(() => {
32
+ animation.start()
33
+ return () => animation.stop()
34
+ }, [animation])
35
+
36
+ useEffect(() => () => rotation.setValue(0), [rotation])
37
+
38
+ return (
39
+ <View style={styles.container}>
40
+ <Animated.View style={styles.animatedContainer}>
41
+ <View style={styles.clipping}>
42
+ <View style={[styles.circle, styles.spinner]} />
43
+ </View>
44
+ <View style={[styles.circle, styles.track]} />
45
+ </Animated.View>
46
+ </View>
47
+ )
48
+ }
49
+
50
+ const useStyles = (rotate: Animated.AnimatedInterpolation<string | number>, size: number) => {
51
+ const { colors } = useTheme()
52
+
53
+ return StyleSheet.create({
54
+ container: {
55
+ width: '100%',
56
+ height: '100%',
57
+ position: 'absolute',
58
+ top: 0,
59
+ left: 0,
60
+ zIndex: 200,
61
+ justifyContent: 'center',
62
+ alignItems: 'center',
63
+ opacity: 0.7,
64
+ },
65
+ animatedContainer: {
66
+ width: size,
67
+ height: size,
68
+ borderRadius: size / 2,
69
+ transform: [{ rotate }],
70
+ },
71
+ circle: {
72
+ width: size,
73
+ height: size,
74
+ borderRadius: size / 2,
75
+ borderStyle: 'solid',
76
+ borderWidth: 3,
77
+ },
78
+ spinner: {
79
+ position: 'absolute',
80
+ top: 0,
81
+ left: 0,
82
+ borderColor: colors.fillColorNeutral020,
83
+ },
84
+ track: {
85
+ borderColor: colors.fillColorNeutral050Base,
86
+ },
87
+ clipping: {
88
+ position: 'absolute',
89
+ top: 0,
90
+ left: 0,
91
+ width: size / 2,
92
+ height: size / 2,
93
+ overflow: 'hidden',
94
+ zIndex: 200,
95
+ },
96
+ })
97
+ }
@@ -0,0 +1,2 @@
1
+ export { useCreateChatTheme } from './use_create_chat_theme'
2
+ export { useTheme } from './use_theme'
package/src/index.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Conversations } from './components/conversations'
2
2
  import { ChatContext, ChatProvider } from './contexts/chat_context'
3
- import { useCreateChatTheme } from './hooks/use_create_chat_theme'
3
+ import { useCreateChatTheme } from './hooks'
4
4
  import { OAuthToken } from './types'
5
5
  import { baseUrlMap, uploadUrlMap } from './utils/session'
6
6
  import { TemporaryDefaultColorsType } from './utils/theme'
package/.babelrc.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "presets": ["module:@react-native/babel-preset"]
3
- }
package/.eslintrc.yml DELETED
@@ -1,2 +0,0 @@
1
- root: true
2
- extends: ['@react-native', '../../.eslintrc.yml']
package/CHANGELOG.md DELETED
@@ -1,25 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [1.3.0](https://github.com/planningcenter/chat-js/compare/v1.2.0...v1.3.0) (2025-02-12)
7
-
8
-
9
- ### Features
10
-
11
- * add auth to the example app ([#50](https://github.com/planningcenter/chat-js/issues/50)) ([5e0ae00](https://github.com/planningcenter/chat-js/commit/5e0ae008345743f6bba388e982a3ad768265971a))
12
- * allow environment switching ([#58](https://github.com/planningcenter/chat-js/issues/58)) ([2518d33](https://github.com/planningcenter/chat-js/commit/2518d33588a3eff1517b440cb0e493e97915d9b0))
13
- * **Api:** teach app about enviroments and make fetching a snap ([#55](https://github.com/planningcenter/chat-js/issues/55)) ([bb7aa56](https://github.com/planningcenter/chat-js/commit/bb7aa567ea362b53faceed9c98ca3b315a0229f5))
14
- * create higher fidelity components ([#54](https://github.com/planningcenter/chat-js/issues/54)) ([367b707](https://github.com/planningcenter/chat-js/commit/367b7076b6d3a81ede7852248e98a199adea9978))
15
- * drop stream and set global dependencies ([#49](https://github.com/planningcenter/chat-js/issues/49)) ([1214b9f](https://github.com/planningcenter/chat-js/commit/1214b9fbc17f4ab67a1de1d39954604a28268f35))
16
- * **StreamChat:** export core package ([#41](https://github.com/planningcenter/chat-js/issues/41)) ([e9afde0](https://github.com/planningcenter/chat-js/commit/e9afde0e2a11d9c7e13b84f8eee8a6cfa7aff795)), closes [#45](https://github.com/planningcenter/chat-js/issues/45)
17
-
18
-
19
-
20
- ## [1.2.0](https://github.com/planningcenter/chat-js/compare/v1.1.0...v1.2.0) (2025-01-16)
21
-
22
-
23
- ### Features
24
-
25
- * behold the monorepo ([#28](https://github.com/planningcenter/chat-js/issues/28)) ([240a49b](https://github.com/planningcenter/chat-js/commit/240a49b46c8d27467472f1b9cb825438d05e52bb))
package/patches/README.md DELETED
@@ -1,12 +0,0 @@
1
- We currently maintain patches for:
2
-
3
- - **stream-chat-expo**
4
- - **stream-chat-react-native-core**
5
-
6
- We expect these patches to be removed post-strexit
7
-
8
-
9
- Some helpful context on the patches is available here: [chore(stream-chat): bump packages](https://github.com/planningcenter/ChurchCenterApp/pull/3534#discussion_r1852521860)
10
-
11
-
12
- >"Streamchat doesn't follow new unreads but we have ui that allows you to swipe to mark read and unread. Their UI doesn't follow those updates so it feels like marking unread is broken because the UI doesn't update even though it totally works."
@@ -1,105 +0,0 @@
1
- diff --git a/node_modules/stream-chat-expo/src/optionalDependencies/getLocalAssetUri.ts b/node_modules/stream-chat-expo/src/optionalDependencies/getLocalAssetUri.ts
2
- index 3d79743..656c391 100644
3
- --- a/node_modules/stream-chat-expo/src/optionalDependencies/getLocalAssetUri.ts
4
- +++ b/node_modules/stream-chat-expo/src/optionalDependencies/getLocalAssetUri.ts
5
- @@ -6,11 +6,11 @@ try {
6
- // do nothing
7
- }
8
-
9
- -if (!MediaLibrary) {
10
- - console.log(
11
- - 'expo-media-library is not installed. Please install it or you can choose to install expo-image-picker for native image picker.',
12
- - );
13
- -}
14
- +// if (!MediaLibrary) {
15
- +// console.log(
16
- +// 'expo-media-library is not installed. Please install it or you can choose to install expo-image-picker for native image picker.',
17
- +// );
18
- +// }
19
-
20
- export const getLocalAssetUri = async (assetId: string): Promise<string | undefined> => {
21
- try {
22
- diff --git a/node_modules/stream-chat-expo/src/optionalDependencies/getPhotos.ts b/node_modules/stream-chat-expo/src/optionalDependencies/getPhotos.ts
23
- index b40c745..4025b64 100644
24
- --- a/node_modules/stream-chat-expo/src/optionalDependencies/getPhotos.ts
25
- +++ b/node_modules/stream-chat-expo/src/optionalDependencies/getPhotos.ts
26
- @@ -6,11 +6,11 @@ try {
27
- // do nothing
28
- }
29
-
30
- -if (!MediaLibrary) {
31
- - console.log(
32
- - 'expo-media-library is not installed. Please install it or you can choose to install expo-image-picker for native image picker.',
33
- - );
34
- -}
35
- +// if (!MediaLibrary) {
36
- +// console.log(
37
- +// 'expo-media-library is not installed. Please install it or you can choose to install expo-image-picker for native image picker.',
38
- +// );
39
- +// }
40
- import type { Asset } from 'stream-chat-react-native-core';
41
-
42
- type ReturnType = {
43
- diff --git a/node_modules/stream-chat-expo/src/optionalDependencies/iOS14RefreshGallerySelection.ts b/node_modules/stream-chat-expo/src/optionalDependencies/iOS14RefreshGallerySelection.ts
44
- index 49bfe50..22e1a39 100644
45
- --- a/node_modules/stream-chat-expo/src/optionalDependencies/iOS14RefreshGallerySelection.ts
46
- +++ b/node_modules/stream-chat-expo/src/optionalDependencies/iOS14RefreshGallerySelection.ts
47
- @@ -8,11 +8,11 @@ try {
48
- // do nothing
49
- }
50
-
51
- -if (!MediaLibrary) {
52
- - console.log(
53
- - 'expo-media-library is not installed. Please install it or you can choose to install expo-image-picker for native image picker.',
54
- - );
55
- -}
56
- +// if (!MediaLibrary) {
57
- +// console.log(
58
- +// 'expo-media-library is not installed. Please install it or you can choose to install expo-image-picker for native image picker.',
59
- +// );
60
- +// }
61
-
62
- const isAboveIOS14 = Platform.OS === 'ios' && parseInt(Platform.Version as string, 10) >= 14;
63
-
64
- diff --git a/node_modules/stream-chat-expo/src/optionalDependencies/oniOS14GalleryLibrarySelectionChange.ts b/node_modules/stream-chat-expo/src/optionalDependencies/oniOS14GalleryLibrarySelectionChange.ts
65
- index 89721ac..bdf6686 100644
66
- --- a/node_modules/stream-chat-expo/src/optionalDependencies/oniOS14GalleryLibrarySelectionChange.ts
67
- +++ b/node_modules/stream-chat-expo/src/optionalDependencies/oniOS14GalleryLibrarySelectionChange.ts
68
- @@ -8,11 +8,11 @@ try {
69
- // do nothing
70
- }
71
-
72
- -if (!MediaLibrary) {
73
- - console.log(
74
- - 'expo-media-library is not installed. Please install it or you can choose to install expo-image-picker for native image picker.',
75
- - );
76
- -}
77
- +// if (!MediaLibrary) {
78
- +// console.log(
79
- +// 'expo-media-library is not installed. Please install it or you can choose to install expo-image-picker for native image picker.',
80
- +// );
81
- +// }
82
-
83
- const isAboveIOS14 = Platform.OS === 'ios' && parseInt(Platform.Version as string, 10) >= 14;
84
-
85
- diff --git a/node_modules/stream-chat-expo/src/optionalDependencies/triggerHaptic.ts b/node_modules/stream-chat-expo/src/optionalDependencies/triggerHaptic.ts
86
- index e385bf3..476a13a 100644
87
- --- a/node_modules/stream-chat-expo/src/optionalDependencies/triggerHaptic.ts
88
- +++ b/node_modules/stream-chat-expo/src/optionalDependencies/triggerHaptic.ts
89
- @@ -6,11 +6,11 @@ try {
90
- // do nothing
91
- }
92
-
93
- -if (!Haptics) {
94
- - console.log(
95
- - 'expo-haptics is not installed. Installing this package will enable haptic feedback when scaling images in the image gallery if the scaling hits the higher or lower limits for its value.',
96
- - );
97
- -}
98
- +// if (!Haptics) {
99
- +// console.log(
100
- +// 'expo-haptics is not installed. Installing this package will enable haptic feedback when scaling images in the image gallery if the scaling hits the higher or lower limits for its value.',
101
- +// );
102
- +// }
103
-
104
- type HapticFeedbackTypes =
105
- | 'impactHeavy'
@@ -1,24 +0,0 @@
1
- diff --git a/node_modules/stream-chat-react-native-core/src/components/ChannelPreview/hooks/useChannelPreviewData.ts b/node_modules/stream-chat-react-native-core/src/components/ChannelPreview/hooks/useChannelPreviewData.ts
2
- index a678e70..4beaf06 100644
3
- --- a/node_modules/stream-chat-react-native-core/src/components/ChannelPreview/hooks/useChannelPreviewData.ts
4
- +++ b/node_modules/stream-chat-react-native-core/src/components/ChannelPreview/hooks/useChannelPreviewData.ts
5
- @@ -31,10 +31,16 @@ export const useChannelPreviewData = <
6
- const channelLastMessageString = `${channelLastMessage?.id}${channelLastMessage?.updated_at}`;
7
-
8
- useEffect(() => {
9
- - const { unsubscribe } = client.on('notification.mark_read', () => {
10
- + const handleMarkReadOrMarkUnread = () => {
11
- setUnread(channel.countUnread());
12
- - });
13
- - return unsubscribe;
14
- + }
15
- +
16
- + const listeners = [
17
- + client.on('notification.mark_read', handleMarkReadOrMarkUnread),
18
- + client.on('notification.mark_unread', handleMarkReadOrMarkUnread),
19
- + ];
20
- +
21
- + return () => listeners.forEach((l) => l.unsubscribe());
22
- }, [channel, client]);
23
-
24
- useEffect(() => {
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "expo-module-scripts/tsconfig.base",
3
- "compilerOptions": {
4
- "outDir": "./build"
5
- },
6
- "include": ["./src", "../chat-core/types.d.ts"],
7
- "exclude": ["**/__mocks__/*", "**/__tests__/*"],
8
- }