@planningcenter/chat-react-native 3.16.0-rc.2 → 3.16.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.
Files changed (104) hide show
  1. package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -1
  2. package/build/components/conversation/attachments/giphy_attachment.js +1 -11
  3. package/build/components/conversation/attachments/giphy_attachment.js.map +1 -1
  4. package/build/components/conversation/message.d.ts +2 -1
  5. package/build/components/conversation/message.d.ts.map +1 -1
  6. package/build/components/conversation/message.js +23 -23
  7. package/build/components/conversation/message.js.map +1 -1
  8. package/build/components/conversation/message_form.d.ts +2 -1
  9. package/build/components/conversation/message_form.d.ts.map +1 -1
  10. package/build/components/conversation/message_form.js +38 -16
  11. package/build/components/conversation/message_form.js.map +1 -1
  12. package/build/components/conversation/reply_connectors.js +1 -1
  13. package/build/components/conversation/reply_connectors.js.map +1 -1
  14. package/build/components/conversation/shadow_message.d.ts +8 -0
  15. package/build/components/conversation/shadow_message.d.ts.map +1 -0
  16. package/build/components/conversation/shadow_message.js +161 -0
  17. package/build/components/conversation/shadow_message.js.map +1 -0
  18. package/build/components/display/icon.d.ts +3 -1
  19. package/build/components/display/icon.d.ts.map +1 -1
  20. package/build/components/display/icon.js +2 -0
  21. package/build/components/display/icon.js.map +1 -1
  22. package/build/components/primitive/avatar_primitive.d.ts +1 -0
  23. package/build/components/primitive/avatar_primitive.d.ts.map +1 -1
  24. package/build/components/primitive/avatar_primitive.js +4 -0
  25. package/build/components/primitive/avatar_primitive.js.map +1 -1
  26. package/build/hooks/index.d.ts +1 -0
  27. package/build/hooks/index.d.ts.map +1 -1
  28. package/build/hooks/index.js +1 -0
  29. package/build/hooks/index.js.map +1 -1
  30. package/build/hooks/use_animated_message_background_color.d.ts +8 -0
  31. package/build/hooks/use_animated_message_background_color.d.ts.map +1 -0
  32. package/build/hooks/use_animated_message_background_color.js +29 -0
  33. package/build/hooks/use_animated_message_background_color.js.map +1 -0
  34. package/build/hooks/use_conversation_messages.d.ts +6 -3
  35. package/build/hooks/use_conversation_messages.d.ts.map +1 -1
  36. package/build/hooks/use_conversation_messages.js +32 -25
  37. package/build/hooks/use_conversation_messages.js.map +1 -1
  38. package/build/hooks/use_message_create_or_update.d.ts +2 -1
  39. package/build/hooks/use_message_create_or_update.d.ts.map +1 -1
  40. package/build/hooks/use_message_create_or_update.js +6 -2
  41. package/build/hooks/use_message_create_or_update.js.map +1 -1
  42. package/build/hooks/use_suspense_api.d.ts +3 -1
  43. package/build/hooks/use_suspense_api.d.ts.map +1 -1
  44. package/build/hooks/use_suspense_api.js +1 -0
  45. package/build/hooks/use_suspense_api.js.map +1 -1
  46. package/build/navigation/index.d.ts +6 -0
  47. package/build/navigation/index.d.ts.map +1 -1
  48. package/build/navigation/index.js +6 -0
  49. package/build/navigation/index.js.map +1 -1
  50. package/build/screens/conversation_screen.d.ts +2 -1
  51. package/build/screens/conversation_screen.d.ts.map +1 -1
  52. package/build/screens/conversation_screen.js +7 -5
  53. package/build/screens/conversation_screen.js.map +1 -1
  54. package/build/screens/message_actions_screen.d.ts +1 -0
  55. package/build/screens/message_actions_screen.d.ts.map +1 -1
  56. package/build/screens/message_actions_screen.js +16 -3
  57. package/build/screens/message_actions_screen.js.map +1 -1
  58. package/build/types/jolt_events/message_events.d.ts +2 -0
  59. package/build/types/jolt_events/message_events.d.ts.map +1 -1
  60. package/build/types/jolt_events/message_events.js.map +1 -1
  61. package/build/types/resources/message.d.ts +2 -0
  62. package/build/types/resources/message.d.ts.map +1 -1
  63. package/build/types/resources/message.js.map +1 -1
  64. package/build/utils/assert_keys_are_numbers.d.ts +2 -0
  65. package/build/utils/assert_keys_are_numbers.d.ts.map +1 -0
  66. package/build/utils/assert_keys_are_numbers.js +12 -0
  67. package/build/utils/assert_keys_are_numbers.js.map +1 -0
  68. package/build/utils/cache/optimistically_create_message.d.ts.map +1 -1
  69. package/build/utils/cache/optimistically_create_message.js +2 -0
  70. package/build/utils/cache/optimistically_create_message.js.map +1 -1
  71. package/build/utils/index.d.ts +2 -0
  72. package/build/utils/index.d.ts.map +1 -1
  73. package/build/utils/index.js +2 -0
  74. package/build/utils/index.js.map +1 -1
  75. package/build/utils/jolt/transform_message_event_data_to_message_resource.d.ts.map +1 -1
  76. package/build/utils/jolt/transform_message_event_data_to_message_resource.js +2 -0
  77. package/build/utils/jolt/transform_message_event_data_to_message_resource.js.map +1 -1
  78. package/build/utils/replies_local_feature_flag.d.ts +2 -0
  79. package/build/utils/replies_local_feature_flag.d.ts.map +1 -0
  80. package/build/utils/replies_local_feature_flag.js +3 -0
  81. package/build/utils/replies_local_feature_flag.js.map +1 -0
  82. package/package.json +2 -2
  83. package/src/components/conversation/attachments/giphy_attachment.tsx +1 -14
  84. package/src/components/conversation/message.tsx +40 -36
  85. package/src/components/conversation/message_form.tsx +85 -15
  86. package/src/components/conversation/reply_connectors.tsx +1 -1
  87. package/src/components/conversation/shadow_message.tsx +274 -0
  88. package/src/components/display/icon.tsx +3 -0
  89. package/src/components/primitive/avatar_primitive.tsx +4 -0
  90. package/src/hooks/index.ts +1 -0
  91. package/src/hooks/use_animated_message_background_color.ts +44 -0
  92. package/src/hooks/use_conversation_messages.ts +45 -25
  93. package/src/hooks/use_message_create_or_update.ts +7 -2
  94. package/src/hooks/use_suspense_api.ts +3 -0
  95. package/src/navigation/index.tsx +6 -0
  96. package/src/screens/conversation_screen.tsx +9 -4
  97. package/src/screens/message_actions_screen.tsx +27 -1
  98. package/src/types/jolt_events/message_events.ts +2 -0
  99. package/src/types/resources/message.ts +2 -0
  100. package/src/utils/assert_keys_are_numbers.ts +13 -0
  101. package/src/utils/cache/optimistically_create_message.ts +2 -0
  102. package/src/utils/index.ts +2 -0
  103. package/src/utils/jolt/transform_message_event_data_to_message_resource.ts +2 -0
  104. package/src/utils/replies_local_feature_flag.ts +2 -0
@@ -0,0 +1,13 @@
1
+ export const assertKeysAreNumbers = (obj: Object): Record<any, number> => {
2
+ return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, assertNumber(value)]))
3
+ }
4
+
5
+ const assertNumber = (value: string): number => {
6
+ if (typeof value === 'number') return value
7
+
8
+ if (typeof value === 'string' && !isNaN(Number(value))) {
9
+ return Number(value)
10
+ }
11
+
12
+ return 0
13
+ }
@@ -48,6 +48,8 @@ export function optimisticallyCreateMessage({
48
48
  myLatestInConversation: true,
49
49
  lastInGroup: true,
50
50
  pending: true,
51
+ replyCount: 0,
52
+ replyRootId: null,
51
53
  }
52
54
 
53
55
  // Add the optimistic message to the cache
@@ -8,3 +8,5 @@ export * from './native_adapters'
8
8
  export * from './pluralize'
9
9
  export * from './destructure_chat_group_graph_id'
10
10
  export * from './convert_attachments_for_create'
11
+ export * from './assert_keys_are_numbers'
12
+ export * from './replies_local_feature_flag'
@@ -27,5 +27,7 @@ export function transformMessageEventDataToMessageResource({
27
27
  avatar: data.author_avatar,
28
28
  },
29
29
  reactionCounts: [],
30
+ replyCount: data.reply_count || 0,
31
+ replyRootId: data.reply_root_id || null,
30
32
  }
31
33
  }
@@ -0,0 +1,2 @@
1
+ // TODO: Replace this whole file with the flipper flag
2
+ export const REPLIES_FEATURE_ENABLED = false