stream-chat-react-native-core 9.7.1 → 9.7.2

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 (45) hide show
  1. package/lib/commonjs/components/Message/Message.js +2 -0
  2. package/lib/commonjs/components/Message/Message.js.map +1 -1
  3. package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListBottom.js +0 -5
  4. package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListBottom.js.map +1 -1
  5. package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListItem.js +14 -6
  6. package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListItem.js.map +1 -1
  7. package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListTop.js +1 -5
  8. package/lib/commonjs/components/Message/MessageItemView/ReactionList/ReactionListTop.js.map +1 -1
  9. package/lib/commonjs/components/MessageMenu/MessageUserReactions.js +2 -1
  10. package/lib/commonjs/components/MessageMenu/MessageUserReactions.js.map +1 -1
  11. package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
  12. package/lib/commonjs/version.json +1 -1
  13. package/lib/module/components/Message/Message.js +2 -0
  14. package/lib/module/components/Message/Message.js.map +1 -1
  15. package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListBottom.js +0 -5
  16. package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListBottom.js.map +1 -1
  17. package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListItem.js +14 -6
  18. package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListItem.js.map +1 -1
  19. package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListTop.js +1 -5
  20. package/lib/module/components/Message/MessageItemView/ReactionList/ReactionListTop.js.map +1 -1
  21. package/lib/module/components/MessageMenu/MessageUserReactions.js +2 -1
  22. package/lib/module/components/MessageMenu/MessageUserReactions.js.map +1 -1
  23. package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
  24. package/lib/module/version.json +1 -1
  25. package/lib/typescript/components/Message/Message.d.ts +15 -2
  26. package/lib/typescript/components/Message/Message.d.ts.map +1 -1
  27. package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListBottom.d.ts +1 -1
  28. package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListBottom.d.ts.map +1 -1
  29. package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListItem.d.ts +1 -1
  30. package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListItem.d.ts.map +1 -1
  31. package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListTop.d.ts +1 -1
  32. package/lib/typescript/components/Message/MessageItemView/ReactionList/ReactionListTop.d.ts.map +1 -1
  33. package/lib/typescript/components/MessageMenu/MessageUserReactions.d.ts.map +1 -1
  34. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +16 -0
  35. package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts.map +1 -1
  36. package/package.json +1 -1
  37. package/src/components/Message/Message.tsx +19 -1
  38. package/src/components/Message/MessageItemView/ReactionList/ReactionListBottom.tsx +0 -6
  39. package/src/components/Message/MessageItemView/ReactionList/ReactionListItem.tsx +8 -11
  40. package/src/components/Message/MessageItemView/ReactionList/ReactionListTop.tsx +0 -5
  41. package/src/components/Message/MessageItemView/__tests__/ReactionListBottom.test.tsx +42 -2
  42. package/src/components/MessageMenu/MessageUserReactions.tsx +9 -2
  43. package/src/components/MessageMenu/__tests__/MessageUserReactions.test.tsx +8 -0
  44. package/src/contexts/messagesContext/MessagesContext.tsx +16 -0
  45. package/src/version.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../../src/components/Message/Message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AACpE,OAAO,EACL,qBAAqB,EAErB,SAAS,EAGT,SAAS,EACV,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,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AChB,oBAAoB,GACpB,eAAe,CAClB,GACD,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,GACtC,IAAI,CAAC,uBAAuB,EAAE,GAAG,CAAC,GAAG;IACnC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,eAAe,EAAE,oBAAoB,CAAC;IACtC;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IACjD,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,IAAI,CAAC,8BAA8B,EAAE,kBAAkB,GAAG,iBAAiB,CAAC,CAAC;AAy2BnF,MAAM,MAAM,YAAY,GAAG,OAAO,CAChC,IAAI,CAAC,uBAAuB,EAAE,aAAa,GAAG,gBAAgB,GAAG,SAAS,CAAC,CAC5E,GACC,IAAI,CAAC,uBAAuB,EAAE,aAAa,GAAG,SAAS,CAAC,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,YAAY,sBAgC1C,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { MessageContextValue } from '../../../../contexts/messageContext/MessageContext';
3
3
  import { MessagesContextValue } from '../../../../contexts/messagesContext/MessagesContext';
4
- export type ReactionListBottomProps = Partial<Pick<MessageContextValue, 'alignment' | 'handleReaction' | 'hasReactions' | 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress' | 'reactions' | 'showReactionsOverlay'>> & Partial<Pick<MessagesContextValue, 'supportedReactions'>> & {
4
+ export type ReactionListBottomProps = Partial<Pick<MessageContextValue, 'alignment' | 'hasReactions' | 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress' | 'reactions' | 'showReactionsOverlay'>> & Partial<Pick<MessagesContextValue, 'supportedReactions'>> & {
5
5
  type?: 'clustered' | 'segmented';
6
6
  showCount?: boolean;
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ReactionListBottom.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Message/MessageItemView/ReactionList/ReactionListBottom.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAMpD,OAAO,EACL,mBAAmB,EAEpB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,oBAAoB,EAErB,MAAM,sDAAsD,CAAC;AAK9D,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAC3C,IAAI,CACF,mBAAmB,EACjB,WAAW,GACX,gBAAgB,GAChB,cAAc,GACd,aAAa,GACb,SAAS,GACT,WAAW,GACX,cAAc,GACd,WAAW,GACX,sBAAsB,CACzB,CACF,GACC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,GAAG;IAC1D,IAAI,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAOJ,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,6BAwGhE,CAAC"}
1
+ {"version":3,"file":"ReactionListBottom.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Message/MessageItemView/ReactionList/ReactionListBottom.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AAMpD,OAAO,EACL,mBAAmB,EAEpB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,oBAAoB,EAErB,MAAM,sDAAsD,CAAC;AAK9D,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAC3C,IAAI,CACF,mBAAmB,EACjB,WAAW,GACX,cAAc,GACd,aAAa,GACb,SAAS,GACT,WAAW,GACX,cAAc,GACd,WAAW,GACX,sBAAsB,CACzB,CACF,GACC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,GAAG;IAC1D,IAAI,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAOJ,eAAO,MAAM,kBAAkB,GAAI,OAAO,uBAAuB,6BAmGhE,CAAC"}
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { MessageContextValue } from '../../../../contexts/messageContext/MessageContext';
3
3
  import { MessagesContextValue } from '../../../../contexts/messagesContext/MessagesContext';
4
4
  import { ReactionSummary } from '../../hooks/useProcessReactions';
5
- export type ReactionListItemProps = Partial<Pick<MessageContextValue, 'handleReaction' | 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress' | 'showReactionsOverlay'>> & Partial<Pick<MessagesContextValue, 'supportedReactions'>> & {
5
+ export type ReactionListItemProps = Partial<Pick<MessageContextValue, 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress' | 'showReactionsOverlay'>> & Partial<Pick<MessagesContextValue, 'supportedReactions'>> & {
6
6
  reaction: ReactionSummary;
7
7
  showCount?: boolean;
8
8
  selected?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"ReactionListItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Message/MessageItemView/ReactionList/ReactionListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAQ5F,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAgBlE,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,IAAI,CACF,mBAAmB,EACjB,gBAAgB,GAChB,aAAa,GACb,SAAS,GACT,WAAW,GACX,cAAc,GACd,sBAAsB,CACzB,CACF,GACC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,GAAG;IAC1D,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEJ,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,sBAkF5D,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAC9C,IAAI,CACF,mBAAmB,EACnB,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,GAAG,sBAAsB,CAClF,CACF,GAAG;IACF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,OAAO,0BAA0B,6BA2DtE,CAAC"}
1
+ {"version":3,"file":"ReactionListItem.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Message/MessageItemView/ReactionList/ReactionListItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oDAAoD,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAQ5F,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAgBlE,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,IAAI,CACF,mBAAmB,EACnB,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,GAAG,sBAAsB,CAClF,CACF,GACC,OAAO,CAAC,IAAI,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,GAAG;IAC1D,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEJ,eAAO,MAAM,gBAAgB,GAAI,OAAO,qBAAqB,sBAoF5D,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAC9C,IAAI,CACF,mBAAmB,EACnB,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,GAAG,sBAAsB,CAClF,CACF,GAAG;IACF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,OAAO,0BAA0B,6BA2DtE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { MessageContextValue } from '../../../../contexts/messageContext/MessageContext';
3
3
  import { MessagesContextValue } from '../../../../contexts/messagesContext/MessagesContext';
4
- export type ReactionListTopProps = Partial<Pick<MessageContextValue, 'alignment' | 'hasReactions' | 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress' | 'reactions' | 'showReactionsOverlay' | 'handleReaction'> & Pick<MessagesContextValue, 'supportedReactions' | 'reactionListType'>> & {
4
+ export type ReactionListTopProps = Partial<Pick<MessageContextValue, 'alignment' | 'hasReactions' | 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress' | 'reactions' | 'showReactionsOverlay'> & Pick<MessagesContextValue, 'supportedReactions' | 'reactionListType'>> & {
5
5
  type?: 'clustered' | 'segmented';
6
6
  showCount?: boolean;
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ReactionListTop.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Message/MessageItemView/ReactionList/ReactionListTop.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAKvC,OAAO,EACL,mBAAmB,EAEpB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,oBAAoB,EAErB,MAAM,sDAAsD,CAAC;AAI9D,MAAM,MAAM,oBAAoB,GAAG,OAAO,CACxC,IAAI,CACF,mBAAmB,EACjB,WAAW,GACX,cAAc,GACd,aAAa,GACb,SAAS,GACT,WAAW,GACX,cAAc,GACd,WAAW,GACX,sBAAsB,GACtB,gBAAgB,CACnB,GACC,IAAI,CAAC,oBAAoB,EAAE,oBAAoB,GAAG,kBAAkB,CAAC,CACxE,GAAG;IACF,IAAI,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,6BAoG1D,CAAC"}
1
+ {"version":3,"file":"ReactionListTop.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Message/MessageItemView/ReactionList/ReactionListTop.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAKvC,OAAO,EACL,mBAAmB,EAEpB,MAAM,oDAAoD,CAAC;AAC5D,OAAO,EACL,oBAAoB,EAErB,MAAM,sDAAsD,CAAC;AAI9D,MAAM,MAAM,oBAAoB,GAAG,OAAO,CACxC,IAAI,CACF,mBAAmB,EACjB,WAAW,GACX,cAAc,GACd,aAAa,GACb,SAAS,GACT,WAAW,GACX,cAAc,GACd,WAAW,GACX,sBAAsB,CACzB,GACC,IAAI,CAAC,oBAAoB,EAAE,oBAAoB,GAAG,kBAAkB,CAAC,CACxE,GAAG;IACF,IAAI,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,OAAO,oBAAoB,6BAgG1D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"MessageUserReactions.d.ts","sourceRoot":"","sources":["../../../../src/components/MessageMenu/MessageUserReactions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAcjF,OAAO,EACL,mBAAmB,EAEpB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,oBAAoB,EAErB,MAAM,gDAAgD,CAAC;AAMxD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,M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AC3B,CAAC;AAMJ,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG;IACpD,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAAI,OAAO,wBAAwB,sBAc/E,CAAC;AAgBF,eAAO,MAAM,oBAAoB,GAAI,OAAO,yBAAyB,sBA+MpE,CAAC"}
@@ -256,6 +256,7 @@ export type MessagesContextValue = Pick<MessageContextValue, 'isMessageAIGenerat
256
256
  * toggleMuteUser, // () => Promise<void>;
257
257
  * toggleReaction, // (reactionType: string) => Promise<void>;
258
258
  * },
259
+ * additionalInfo, // emitter-specific info, e.g. `{ reactionType }` when emitter === 'reactionList'
259
260
  * defaultHandler, // () => void
260
261
  * event, // any event object corresponding to touchable feedback
261
262
  * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc
@@ -265,6 +266,21 @@ export type MessagesContextValue = Pick<MessageContextValue, 'isMessageAIGenerat
265
266
  * }}
266
267
  * />
267
268
  * ```
269
+ *
270
+ * By default, pressing a reaction opens the reactions bottom sheet. To instead toggle
271
+ * the reaction (add/remove the current user's reaction), intercept the `reactionList` emitter:
272
+ *
273
+ * ```
274
+ * <Channel
275
+ * onPressMessage={({ emitter, additionalInfo, actionHandlers, defaultHandler }) => {
276
+ * if (emitter === 'reactionList' && additionalInfo?.reactionType) {
277
+ * actionHandlers?.toggleReaction(additionalInfo.reactionType as string);
278
+ * return;
279
+ * }
280
+ * defaultHandler?.();
281
+ * }}
282
+ * />
283
+ * ```
268
284
  */
269
285
  onPressMessage?: (payload: MessagePressableHandlerPayload) => void;
270
286
  quotedMessage?: LocalMessage | null;
@@ -1 +1 @@
1
- {"version":3,"file":"MessagesContext.d.ts","sourceRoot":"","sources":["../../../../src/contexts/messagesContext/MessagesContext.tsx"],"names":[],"mappings":"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,IAAI,CAAC;IACrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAyCG;IACH,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,8BAA8B,KAAK,IAAI,CAAC;IACnE,aAAa,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IACpC;;OAEG;IACH,oBAAoB,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IAExC;;OAEG;IACH,gBAAgB,CAAC,EAAE,WAAW,GAAG,WAAW,CAAC;IAE7C;;;;SAIK;IACL,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpF;;OAEG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;OAEG;IACH,kBAAkB,CAAC,EAAE,YAAY,EAAE,CAAC;IAEpC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,eAAe,qCAE3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,sBAG9B,iBAAiB,CAAC;IACnB,KAAK,CAAC,EAAE,oBAAoB,CAAC;CAC9B,CAAC,sBAID,CAAC;AAEF,eAAO,MAAM,kBAAkB,4BAU9B,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stream-chat-react-native-core",
3
3
  "description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
4
- "version": "9.7.1",
4
+ "version": "9.7.2",
5
5
  "author": {
6
6
  "company": "Stream.io Inc",
7
7
  "name": "Stream.io Inc"
@@ -136,20 +136,36 @@ export type GalleryThumbnailTouchableHandlerPayload = {
136
136
  additionalInfo?: GalleryThumbnailTouchableHandlerAdditionalInfo;
137
137
  };
138
138
 
139
+ export type ReactionListTouchableHandlerAdditionalInfo = {
140
+ /**
141
+ * The reaction type of the pressed reaction. Populated for presses that
142
+ * originate from a single reaction (segmented list item/clustered pill),
143
+ * undefined for the "+N more" overflow item.
144
+ */
145
+ reactionType?: string;
146
+ };
147
+
148
+ export type ReactionListTouchableHandlerPayload = {
149
+ emitter: 'reactionList';
150
+ additionalInfo?: ReactionListTouchableHandlerAdditionalInfo;
151
+ };
152
+
139
153
  export type PressableHandlerPayload = {
140
154
  defaultHandler?: () => void;
141
155
  event?: GestureResponderEvent;
142
156
  } & (
143
157
  | {
158
+ additionalInfo?: Record<string, unknown>;
144
159
  emitter?: Exclude<
145
160
  TouchableEmitter,
146
- 'textMention' | 'textLink' | 'urlPreview' | 'fileAttachment' | 'gallery'
161
+ 'textMention' | 'textLink' | 'urlPreview' | 'fileAttachment' | 'gallery' | 'reactionList'
147
162
  >;
148
163
  }
149
164
  | TextMentionTouchableHandlerPayload
150
165
  | UrlTouchableHandlerPayload
151
166
  | FileAttachmentTouchableHandlerPayload
152
167
  | GalleryThumbnailTouchableHandlerPayload
168
+ | ReactionListTouchableHandlerPayload
153
169
  );
154
170
 
155
171
  export type MessagePressableHandlerPayload = PressableHandlerPayload & {
@@ -741,6 +757,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
741
757
  onLongPress: (payload) => {
742
758
  const onLongPressArgs = {
743
759
  actionHandlers,
760
+ additionalInfo: payload?.additionalInfo,
744
761
  defaultHandler: payload?.defaultHandler || onLongPress,
745
762
  emitter: payload?.emitter || 'message',
746
763
  event: payload?.event,
@@ -796,6 +813,7 @@ const MessageWithContext = (props: MessagePropsWithContext) => {
796
813
  if (onPressInMessageProp) {
797
814
  return onPressInMessageProp({
798
815
  actionHandlers,
816
+ additionalInfo: payload.additionalInfo,
799
817
  defaultHandler: payload.defaultHandler,
800
818
  emitter: payload.emitter || 'message',
801
819
  event: payload.event,
@@ -20,7 +20,6 @@ export type ReactionListBottomProps = Partial<
20
20
  Pick<
21
21
  MessageContextValue,
22
22
  | 'alignment'
23
- | 'handleReaction'
24
23
  | 'hasReactions'
25
24
  | 'onLongPress'
26
25
  | 'onPress'
@@ -43,7 +42,6 @@ const ItemSeparatorComponent = () => {
43
42
  export const ReactionListBottom = (props: ReactionListBottomProps) => {
44
43
  const {
45
44
  alignment: propAlignment,
46
- handleReaction: propHandlerReaction,
47
45
  hasReactions: propHasReactions,
48
46
  onLongPress: propOnLongPress,
49
47
  onPress: propOnPress,
@@ -58,7 +56,6 @@ export const ReactionListBottom = (props: ReactionListBottomProps) => {
58
56
 
59
57
  const {
60
58
  alignment: contextAlignment,
61
- handleReaction: contextHandleReaction,
62
59
  hasReactions: contextHasReactions,
63
60
  onLongPress: contextOnLongPress,
64
61
  onPress: contextOnPress,
@@ -72,7 +69,6 @@ export const ReactionListBottom = (props: ReactionListBottomProps) => {
72
69
  const { supportedReactions: contextSupportedReactions } = useMessagesContext();
73
70
 
74
71
  const alignment = propAlignment || contextAlignment;
75
- const handleReaction = propHandlerReaction || contextHandleReaction;
76
72
  const hasReactions = propHasReactions || contextHasReactions;
77
73
  const onLongPress = propOnLongPress || contextOnLongPress;
78
74
  const onPress = propOnPress || contextOnPress;
@@ -85,7 +81,6 @@ export const ReactionListBottom = (props: ReactionListBottomProps) => {
85
81
  const renderItem = useCallback(
86
82
  ({ index, item }: { index: number; item: ReactionListItemProps }) => (
87
83
  <ReactionListItem
88
- handleReaction={item.handleReaction}
89
84
  key={index}
90
85
  onLongPress={item.onLongPress}
91
86
  onPress={item.onPress}
@@ -115,7 +110,6 @@ export const ReactionListBottom = (props: ReactionListBottomProps) => {
115
110
  }
116
111
 
117
112
  const reactionListBottomItemData: ReactionListItemProps[] = reactions.map((reaction) => ({
118
- handleReaction,
119
113
  onLongPress,
120
114
  onPress,
121
115
  onPressIn,
@@ -33,12 +33,7 @@ const Icon = ({ size, style, supportedReactions, type }: Props) => {
33
33
  export type ReactionListItemProps = Partial<
34
34
  Pick<
35
35
  MessageContextValue,
36
- | 'handleReaction'
37
- | 'onLongPress'
38
- | 'onPress'
39
- | 'onPressIn'
40
- | 'preventPress'
41
- | 'showReactionsOverlay'
36
+ 'onLongPress' | 'onPress' | 'onPressIn' | 'preventPress' | 'showReactionsOverlay'
42
37
  >
43
38
  > &
44
39
  Partial<Pick<MessagesContextValue, 'supportedReactions'>> & {
@@ -49,7 +44,6 @@ export type ReactionListItemProps = Partial<
49
44
 
50
45
  export const ReactionListItem = (props: ReactionListItemProps) => {
51
46
  const {
52
- handleReaction,
53
47
  onLongPress,
54
48
  onPress,
55
49
  onPressIn,
@@ -80,6 +74,7 @@ export const ReactionListItem = (props: ReactionListItemProps) => {
80
74
  onLongPress={(event) => {
81
75
  if (onLongPress) {
82
76
  onLongPress({
77
+ additionalInfo: { reactionType: reaction.type },
83
78
  defaultHandler: () => {
84
79
  if (showReactionsOverlay) {
85
80
  showReactionsOverlay(reaction.type);
@@ -93,9 +88,10 @@ export const ReactionListItem = (props: ReactionListItemProps) => {
93
88
  onPress={(event) => {
94
89
  if (onPress) {
95
90
  onPress({
91
+ additionalInfo: { reactionType: reaction.type },
96
92
  defaultHandler: () => {
97
- if (handleReaction) {
98
- handleReaction(reaction.type);
93
+ if (showReactionsOverlay) {
94
+ showReactionsOverlay(reaction.type);
99
95
  }
100
96
  },
101
97
  emitter: 'reactionList',
@@ -106,9 +102,10 @@ export const ReactionListItem = (props: ReactionListItemProps) => {
106
102
  onPressIn={(event) => {
107
103
  if (onPressIn) {
108
104
  onPressIn({
105
+ additionalInfo: { reactionType: reaction.type },
109
106
  defaultHandler: () => {
110
- if (handleReaction) {
111
- handleReaction(reaction.type);
107
+ if (showReactionsOverlay) {
108
+ showReactionsOverlay(reaction.type);
112
109
  }
113
110
  },
114
111
  emitter: 'reactionList',
@@ -25,7 +25,6 @@ export type ReactionListTopProps = Partial<
25
25
  | 'preventPress'
26
26
  | 'reactions'
27
27
  | 'showReactionsOverlay'
28
- | 'handleReaction'
29
28
  > &
30
29
  Pick<MessagesContextValue, 'supportedReactions' | 'reactionListType'>
31
30
  > & {
@@ -47,7 +46,6 @@ export const ReactionListTop = (props: ReactionListTopProps) => {
47
46
  reactions: propReactions,
48
47
  showReactionsOverlay: propShowReactionsOverlay,
49
48
  supportedReactions: propSupportedReactions,
50
- handleReaction: propHandleReaction,
51
49
  type,
52
50
  showCount = true,
53
51
  } = props;
@@ -61,7 +59,6 @@ export const ReactionListTop = (props: ReactionListTopProps) => {
61
59
  preventPress: contextPreventPress,
62
60
  reactions: contextReactions,
63
61
  showReactionsOverlay: contextShowReactionsOverlay,
64
- handleReaction: contextHandleReaction,
65
62
  } = useMessageContext();
66
63
 
67
64
  const { ReactionListClustered, ReactionListCountItem, ReactionListItem } = useComponentsContext();
@@ -76,7 +73,6 @@ export const ReactionListTop = (props: ReactionListTopProps) => {
76
73
  const reactions = propReactions || contextReactions;
77
74
  const showReactionsOverlay = propShowReactionsOverlay || contextShowReactionsOverlay;
78
75
  const supportedReactions = propSupportedReactions || contextSupportedReactions;
79
- const handleReaction = propHandleReaction || contextHandleReaction;
80
76
 
81
77
  const styles = useStyles({ alignment });
82
78
 
@@ -115,7 +111,6 @@ export const ReactionListTop = (props: ReactionListTopProps) => {
115
111
  <ReactionListItem
116
112
  key={reaction.type}
117
113
  reaction={reaction}
118
- handleReaction={handleReaction}
119
114
  onLongPress={onLongPress}
120
115
  onPress={onPress}
121
116
  onPressIn={onPressIn}
@@ -149,7 +149,10 @@ describe('ReactionListBottom', () => {
149
149
  // });
150
150
  // });
151
151
 
152
- it('call handleReaction on press', () => {
152
+ it('does not toggle the reaction on press but opens the reactions bottom sheet instead', () => {
153
+ // Tapping a segmented reaction must mirror the clustered flow: it opens the
154
+ // reactions bottom sheet (preselecting the tapped reaction) rather than
155
+ // adding/removing the current user's reaction.
153
156
  const handleReactionMock = jest.fn();
154
157
  const user = generateUser();
155
158
  const reaction = generateReaction();
@@ -172,6 +175,43 @@ describe('ReactionListBottom', () => {
172
175
 
173
176
  fireEvent(reactionListBottomItem, 'onPress');
174
177
 
175
- expect(handleReactionMock).toHaveBeenCalledTimes(1);
178
+ expect(handleReactionMock).not.toHaveBeenCalled();
179
+ expect(screen.getByLabelText('User Reactions on long press message')).toBeTruthy();
180
+ });
181
+
182
+ it('exposes the pressed reaction type via onPressMessage so integrators can toggle', () => {
183
+ // Integrators that want the old toggle-on-tap behavior can intercept the
184
+ // `reactionList` emitter and call `actionHandlers.toggleReaction(reactionType)`.
185
+ const onPressMessageMock = jest.fn();
186
+ const user = generateUser();
187
+ const reaction = generateReaction();
188
+ const message = generateMessage({
189
+ reaction_groups: { [reaction.type]: reaction } as unknown as ReturnType<
190
+ typeof generateMessage
191
+ >['reaction_groups'],
192
+ user,
193
+ });
194
+
195
+ renderMessage(
196
+ { message },
197
+ {
198
+ onPressMessage: onPressMessageMock,
199
+ reactionListPosition: 'bottom',
200
+ reactionListType: 'segmented',
201
+ },
202
+ );
203
+
204
+ const reactionListBottomItem = screen.getByTestId('reaction-list-item');
205
+
206
+ fireEvent(reactionListBottomItem, 'onPress');
207
+
208
+ expect(onPressMessageMock).toHaveBeenCalledWith(
209
+ expect.objectContaining({
210
+ additionalInfo: { reactionType: reaction.type },
211
+ emitter: 'reactionList',
212
+ }),
213
+ );
214
+ // onPressMessage replaces the default handler, so the sheet must NOT open here.
215
+ expect(screen.queryByLabelText('User Reactions on long press message')).toBeNull();
176
216
  });
177
217
  });
@@ -94,14 +94,21 @@ const reactionSelectorKeyExtractor = (item: ReactionSelectorItemType) => item.ty
94
94
  export const MessageUserReactions = (props: MessageUserReactionsProps) => {
95
95
  const styles = useStyles();
96
96
  const [showMoreReactions, setShowMoreReactions] = useState(false);
97
- const { message, reactions: propReactions, supportedReactions: propSupportedReactions } = props;
97
+ const {
98
+ message,
99
+ reactions: propReactions,
100
+ selectedReaction: propSelectedReaction,
101
+ supportedReactions: propSupportedReactions,
102
+ } = props;
98
103
  const selectorListRef = useRef<FlatList>(null);
99
104
  const { close } = useBottomSheetContext();
100
105
  const reactionTypes = useMemo(
101
106
  () => Object.keys(message?.reaction_groups ?? {}),
102
107
  [message?.reaction_groups],
103
108
  );
104
- const [selectedReaction, setSelectedReaction] = useState<string | undefined>(undefined);
109
+ const [selectedReaction, setSelectedReaction] = useState<string | undefined>(
110
+ propSelectedReaction,
111
+ );
105
112
  const { supportedReactions: contextSupportedReactions } = useMessagesContext();
106
113
  const { icons, MessageUserReactionsItem } = useComponentsContext();
107
114
  const { handleReaction } = useMessageContext();
@@ -103,6 +103,14 @@ describe('MessageUserReactions when the supportedReactions are defined', () => {
103
103
  expect(reactionButtons[1].props.accessibilityState.selected).toBe(false);
104
104
  });
105
105
 
106
+ it('preselects the reaction passed via the selectedReaction prop', () => {
107
+ const { getAllByRole } = renderComponent({ selectedReaction: 'love' });
108
+ const reactionButtons = filterReactionButtons(getAllByRole('button'));
109
+ // reaction_groups order is `like`, `love`
110
+ expect(reactionButtons[0].props.accessibilityState.selected).toBe(false);
111
+ expect(reactionButtons[1].props.accessibilityState.selected).toBe(true);
112
+ });
113
+
106
114
  it('toggles the selected reaction when a reaction button is pressed twice', () => {
107
115
  const { getAllByRole } = renderComponent();
108
116
  let reactionButtons = filterReactionButtons(getAllByRole('button'));
@@ -302,6 +302,7 @@ export type MessagesContextValue = Pick<MessageContextValue, 'isMessageAIGenerat
302
302
  * toggleMuteUser, // () => Promise<void>;
303
303
  * toggleReaction, // (reactionType: string) => Promise<void>;
304
304
  * },
305
+ * additionalInfo, // emitter-specific info, e.g. `{ reactionType }` when emitter === 'reactionList'
305
306
  * defaultHandler, // () => void
306
307
  * event, // any event object corresponding to touchable feedback
307
308
  * emitter, // which component trigged this touchable feedback e.g. card, fileAttachment, gallery, message ... etc
@@ -311,6 +312,21 @@ export type MessagesContextValue = Pick<MessageContextValue, 'isMessageAIGenerat
311
312
  * }}
312
313
  * />
313
314
  * ```
315
+ *
316
+ * By default, pressing a reaction opens the reactions bottom sheet. To instead toggle
317
+ * the reaction (add/remove the current user's reaction), intercept the `reactionList` emitter:
318
+ *
319
+ * ```
320
+ * <Channel
321
+ * onPressMessage={({ emitter, additionalInfo, actionHandlers, defaultHandler }) => {
322
+ * if (emitter === 'reactionList' && additionalInfo?.reactionType) {
323
+ * actionHandlers?.toggleReaction(additionalInfo.reactionType as string);
324
+ * return;
325
+ * }
326
+ * defaultHandler?.();
327
+ * }}
328
+ * />
329
+ * ```
314
330
  */
315
331
  onPressMessage?: (payload: MessagePressableHandlerPayload) => void;
316
332
  quotedMessage?: LocalMessage | null;
package/src/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "9.7.1"
2
+ "version": "9.7.2"
3
3
  }