@planningcenter/chat-react-native 4.4.0-rc.0 → 4.4.0-rc.1

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.
@@ -8,7 +8,9 @@ interface MessageProps extends MessageResource {
8
8
  conversation_id: number;
9
9
  readByOthers?: boolean;
10
10
  inReplyScreen?: boolean;
11
+ highlighted?: boolean;
12
+ onHighlightShown?: () => void;
11
13
  }
12
- export declare const Message: React.MemoExoticComponent<({ canDeleteNonAuthoredMessages, conversation_id, readByOthers, inReplyScreen, ...message }: MessageProps) => import("react/jsx-runtime").JSX.Element>;
14
+ export declare const Message: React.MemoExoticComponent<({ canDeleteNonAuthoredMessages, conversation_id, readByOthers, inReplyScreen, highlighted, onHighlightShown, ...message }: MessageProps) => import("react/jsx-runtime").JSX.Element>;
13
15
  export {};
14
16
  //# sourceMappingURL=message.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA0B,MAAM,OAAO,CAAA;AAoB9C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAkB7C;;GAEG;AACH,UAAU,YAAa,SAAQ,eAAe;IAC5C,4BAA4B,EAAE,OAAO,CAAA;IACrC,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,eAAO,MAAM,OAAO,yHAMjB,YAAY,6CA8Rb,CAAA"}
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA0B,MAAM,OAAO,CAAA;AAoB9C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAkB7C;;GAEG;AACH,UAAU,YAAa,SAAQ,eAAe;IAC5C,4BAA4B,EAAE,OAAO,CAAA;IACrC,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAA;CAC9B;AAED,eAAO,MAAM,OAAO,wJAQjB,YAAY,6CAqSb,CAAA"}
@@ -27,14 +27,17 @@ import { TheirReplyConnector, MyReplyConnector, AVATAR_CONNECTOR_SPACING } from
27
27
  */
28
28
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
29
29
  export const Message = memo(function MessageRow(t0) {
30
- const $ = _c(68);
30
+ const $ = _c(73);
31
31
  const {
32
32
  canDeleteNonAuthoredMessages,
33
33
  conversation_id,
34
34
  readByOthers,
35
35
  inReplyScreen,
36
+ highlighted: t1,
37
+ onHighlightShown,
36
38
  ...message
37
39
  } = t0;
40
+ const highlighted = t1 === undefined ? false : t1;
38
41
  const {
39
42
  reactionCounts,
40
43
  pending,
@@ -60,6 +63,7 @@ export const Message = memo(function MessageRow(t0) {
60
63
  const [messageBubbleHeight, setMessageBubbleHeight] = React.useState(0);
61
64
  const {
62
65
  animatedBackgroundColor,
66
+ flash,
63
67
  handleMessagePressIn,
64
68
  handleMessagePressOut
65
69
  } = useAnimatedMessageBackgroundColor();
@@ -91,6 +95,27 @@ export const Message = memo(function MessageRow(t0) {
91
95
  const replyCountLabel = isReplyRootMessage ? replyCountText : "";
92
96
  const saveStatusLabel = error ? `Failed to ${isPersisted ? "edit" : "send"}` : pending ? messagePendingLabel : "";
93
97
  const accessibilityLabel = `${author?.name || ""} ${messageIsReplyLabel} ${attachmentLabel} ${messageText || ""} ${saveStatusLabel} ${timestamp} ${replyCountLabel}`;
98
+ let t2;
99
+ let t3;
100
+ if ($[0] !== flash || $[1] !== highlighted || $[2] !== onHighlightShown) {
101
+ t2 = () => {
102
+ if (!highlighted) {
103
+ return;
104
+ }
105
+ flash();
106
+ onHighlightShown?.();
107
+ };
108
+ t3 = [highlighted, flash, onHighlightShown];
109
+ $[0] = flash;
110
+ $[1] = highlighted;
111
+ $[2] = onHighlightShown;
112
+ $[3] = t2;
113
+ $[4] = t3;
114
+ } else {
115
+ t2 = $[3];
116
+ t3 = $[4];
117
+ }
118
+ useEffect(t2, t3);
94
119
  useEffect(() => {
95
120
  if (pending) {
96
121
  const timer = setTimeout(() => {
@@ -112,17 +137,17 @@ export const Message = memo(function MessageRow(t0) {
112
137
  });
113
138
  }
114
139
  };
115
- let t1;
116
- if ($[0] !== showMessageMetaToggle) {
117
- t1 = () => {
140
+ let t4;
141
+ if ($[5] !== showMessageMetaToggle) {
142
+ t4 = () => {
118
143
  setShowMessageMetaToggle(!showMessageMetaToggle);
119
144
  };
120
- $[0] = showMessageMetaToggle;
121
- $[1] = t1;
145
+ $[5] = showMessageMetaToggle;
146
+ $[6] = t4;
122
147
  } else {
123
- t1 = $[1];
148
+ t4 = $[6];
124
149
  }
125
- const handleMessagePress = t1;
150
+ const handleMessagePress = t4;
126
151
  const handleMessageLongPress = () => {
127
152
  if (!isPersisted) {
128
153
  return;
@@ -162,56 +187,56 @@ export const Message = memo(function MessageRow(t0) {
162
187
  reply_root_author_name: author.name
163
188
  });
164
189
  };
165
- let t2;
166
- if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
167
- t2 = [{
190
+ let t5;
191
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
192
+ t5 = [{
168
193
  name: "navigateToReplies",
169
194
  label: "Navigate to replies"
170
195
  }];
171
- $[2] = t2;
196
+ $[7] = t5;
172
197
  } else {
173
- t2 = $[2];
198
+ t5 = $[7];
174
199
  }
175
- const accessibilityActions = t2;
200
+ const accessibilityActions = t5;
176
201
  const handleAccessibilityAction = event => {
177
202
  if (event.nativeEvent.actionName === "navigateToReplies") {
178
203
  handleNavigateToReplyPress();
179
204
  }
180
205
  };
181
206
  const T0 = Pressable;
182
- const t3 = `message-${message.id}`;
183
- const t4 = isDeleting ? undefined : handleMessageLongPress;
184
- const t5 = isDeleting ? undefined : handleMessagePress;
185
- const t6 = isDeleting ? undefined : handleMessagePressIn;
186
- const t7 = isDeleting ? undefined : handleMessagePressOut;
187
- let t8;
188
- if ($[3] !== colors.androidRippleNeutral) {
189
- t8 = {
207
+ const t6 = `message-${message.id}`;
208
+ const t7 = isDeleting ? undefined : handleMessageLongPress;
209
+ const t8 = isDeleting ? undefined : handleMessagePress;
210
+ const t9 = isDeleting ? undefined : handleMessagePressIn;
211
+ const t10 = isDeleting ? undefined : handleMessagePressOut;
212
+ let t11;
213
+ if ($[8] !== colors.androidRippleNeutral) {
214
+ t11 = {
190
215
  color: colors.androidRippleNeutral,
191
216
  borderless: false,
192
217
  foreground: true
193
218
  };
194
- $[3] = colors.androidRippleNeutral;
195
- $[4] = t8;
219
+ $[8] = colors.androidRippleNeutral;
220
+ $[9] = t11;
196
221
  } else {
197
- t8 = $[4];
222
+ t11 = $[9];
198
223
  }
199
- const t9 = "button";
200
- const t10 = "Long press to view message actions like reacting and copying.";
201
- const t11 = isReplyRootMessage ? accessibilityActions : undefined;
202
- const t12 = isReplyRootMessage ? handleAccessibilityAction : undefined;
203
- const t13 = isDeletedReplyRootMessage || isDeleting;
204
- const t14 = Animated;
205
- let t15;
206
- if ($[5] !== animatedBackgroundColor || $[6] !== styles.message) {
207
- t15 = [styles.message, animatedBackgroundColor];
208
- $[5] = animatedBackgroundColor;
209
- $[6] = styles.message;
210
- $[7] = t15;
224
+ const t12 = "button";
225
+ const t13 = "Long press to view message actions like reacting and copying.";
226
+ const t14 = isReplyRootMessage ? accessibilityActions : undefined;
227
+ const t15 = isReplyRootMessage ? handleAccessibilityAction : undefined;
228
+ const t16 = isDeletedReplyRootMessage || isDeleting;
229
+ const t17 = Animated;
230
+ let t18;
231
+ if ($[10] !== animatedBackgroundColor || $[11] !== styles.message) {
232
+ t18 = [styles.message, animatedBackgroundColor];
233
+ $[10] = animatedBackgroundColor;
234
+ $[11] = styles.message;
235
+ $[12] = t18;
211
236
  } else {
212
- t15 = $[7];
237
+ t18 = $[12];
213
238
  }
214
- const t16 = !message.mine && /*#__PURE__*/_jsxs(View, {
239
+ const t19 = !message.mine && /*#__PURE__*/_jsxs(View, {
215
240
  children: [renderAuthor ? /*#__PURE__*/_jsx(Avatar, {
216
241
  size: "md",
217
242
  sourceUri: author.avatar,
@@ -228,38 +253,38 @@ export const Message = memo(function MessageRow(t0) {
228
253
  })]
229
254
  });
230
255
  const T1 = View;
231
- let t17;
232
- if ($[8] !== messageBottomMargin) {
233
- t17 = {
256
+ let t20;
257
+ if ($[13] !== messageBottomMargin) {
258
+ t20 = {
234
259
  marginBottom: messageBottomMargin
235
260
  };
236
- $[8] = messageBottomMargin;
237
- $[9] = t17;
261
+ $[13] = messageBottomMargin;
262
+ $[14] = t20;
238
263
  } else {
239
- t17 = $[9];
264
+ t20 = $[14];
240
265
  }
241
- let t18;
242
- if ($[10] !== styles.messageContent || $[11] !== t17) {
243
- t18 = [styles.messageContent, t17];
244
- $[10] = styles.messageContent;
245
- $[11] = t17;
246
- $[12] = t18;
266
+ let t21;
267
+ if ($[15] !== styles.messageContent || $[16] !== t20) {
268
+ t21 = [styles.messageContent, t20];
269
+ $[15] = styles.messageContent;
270
+ $[16] = t20;
271
+ $[17] = t21;
247
272
  } else {
248
- t18 = $[12];
273
+ t21 = $[17];
249
274
  }
250
- const t19 = renderAuthor && !isDeletedReplyRootMessage && /*#__PURE__*/_jsx(Text, {
275
+ const t22 = renderAuthor && !isDeletedReplyRootMessage && /*#__PURE__*/_jsx(Text, {
251
276
  variant: "footnote",
252
277
  style: styles.authorName,
253
278
  children: author.name
254
279
  });
255
- let t20;
256
- if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
257
- t20 = e => setMessageBubbleHeight(e.nativeEvent.layout.height);
258
- $[13] = t20;
280
+ let t23;
281
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
282
+ t23 = e => setMessageBubbleHeight(e.nativeEvent.layout.height);
283
+ $[18] = t23;
259
284
  } else {
260
- t20 = $[13];
285
+ t23 = $[18];
261
286
  }
262
- const t21 = isDeletedReplyRootMessage ? /*#__PURE__*/_jsx(View, {
287
+ const t24 = isDeletedReplyRootMessage ? /*#__PURE__*/_jsx(View, {
263
288
  style: styles.messageText,
264
289
  children: /*#__PURE__*/_jsx(Text, {
265
290
  style: styles.replyRootDeletedText,
@@ -280,20 +305,20 @@ export const Message = memo(function MessageRow(t0) {
280
305
  })
281
306
  })]
282
307
  });
283
- let t22;
284
- if ($[14] !== styles.messageBubble || $[15] !== t21) {
285
- t22 = /*#__PURE__*/_jsx(View, {
308
+ let t25;
309
+ if ($[19] !== styles.messageBubble || $[20] !== t24) {
310
+ t25 = /*#__PURE__*/_jsx(View, {
286
311
  style: styles.messageBubble,
287
- onLayout: t20,
288
- children: t21
312
+ onLayout: t23,
313
+ children: t24
289
314
  });
290
- $[14] = styles.messageBubble;
291
- $[15] = t21;
292
- $[16] = t22;
315
+ $[19] = styles.messageBubble;
316
+ $[20] = t24;
317
+ $[21] = t25;
293
318
  } else {
294
- t22 = $[16];
319
+ t25 = $[21];
295
320
  }
296
- const t23 = showReplyCountButton && /*#__PURE__*/_jsx(TextButton, {
321
+ const t26 = showReplyCountButton && /*#__PURE__*/_jsx(TextButton, {
297
322
  variant: "footnote",
298
323
  onPress: handleNavigateToReplyPress,
299
324
  style: styles.messageReplyCount,
@@ -301,7 +326,7 @@ export const Message = memo(function MessageRow(t0) {
301
326
  accessibilityRole: "link",
302
327
  children: replyCountText
303
328
  });
304
- const t24 = hasReactions && !isDeletedReplyRootMessage && /*#__PURE__*/_jsx(View, {
329
+ const t27 = hasReactions && !isDeletedReplyRootMessage && /*#__PURE__*/_jsx(View, {
305
330
  style: styles.messageReactions,
306
331
  children: reactionCounts.map(reaction_0 => /*#__PURE__*/_jsx(MessageReaction, {
307
332
  reaction: reaction_0,
@@ -310,9 +335,9 @@ export const Message = memo(function MessageRow(t0) {
310
335
  conversationId: conversation_id
311
336
  }, reaction_0.value))
312
337
  });
313
- let t25;
314
- if ($[17] !== colors.iconColorDefaultSecondary || $[18] !== error || $[19] !== handleRetry || $[20] !== isDeletedReplyRootMessage || $[21] !== isPersisted || $[22] !== messagePendingLabel || $[23] !== pending || $[24] !== readByOthers || $[25] !== retryFailedSaveMutation || $[26] !== showMessageMeta || $[27] !== showReadReceipts || $[28] !== styles.editedText || $[29] !== styles.errorContainer || $[30] !== styles.errorIcon || $[31] !== styles.errorText || $[32] !== styles.messageMeta || $[33] !== styles.pendingIndicatorContainer || $[34] !== temporarilyHidePendingState || $[35] !== timestamp || $[36] !== wasEdited) {
315
- t25 = showMessageMeta && !isDeletedReplyRootMessage && /*#__PURE__*/_jsxs(View, {
338
+ let t28;
339
+ if ($[22] !== colors.iconColorDefaultSecondary || $[23] !== error || $[24] !== handleRetry || $[25] !== isDeletedReplyRootMessage || $[26] !== isPersisted || $[27] !== messagePendingLabel || $[28] !== pending || $[29] !== readByOthers || $[30] !== retryFailedSaveMutation || $[31] !== showMessageMeta || $[32] !== showReadReceipts || $[33] !== styles.editedText || $[34] !== styles.errorContainer || $[35] !== styles.errorIcon || $[36] !== styles.errorText || $[37] !== styles.messageMeta || $[38] !== styles.pendingIndicatorContainer || $[39] !== temporarilyHidePendingState || $[40] !== timestamp || $[41] !== wasEdited) {
340
+ t28 = showMessageMeta && !isDeletedReplyRootMessage && /*#__PURE__*/_jsxs(View, {
316
341
  style: styles.messageMeta,
317
342
  children: [showReadReceipts && /*#__PURE__*/_jsx(MessageReadReceipts, {
318
343
  read: readByOthers
@@ -357,108 +382,108 @@ export const Message = memo(function MessageRow(t0) {
357
382
  })]
358
383
  })]
359
384
  });
360
- $[17] = colors.iconColorDefaultSecondary;
361
- $[18] = error;
362
- $[19] = handleRetry;
363
- $[20] = isDeletedReplyRootMessage;
364
- $[21] = isPersisted;
365
- $[22] = messagePendingLabel;
366
- $[23] = pending;
367
- $[24] = readByOthers;
368
- $[25] = retryFailedSaveMutation;
369
- $[26] = showMessageMeta;
370
- $[27] = showReadReceipts;
371
- $[28] = styles.editedText;
372
- $[29] = styles.errorContainer;
373
- $[30] = styles.errorIcon;
374
- $[31] = styles.errorText;
375
- $[32] = styles.messageMeta;
376
- $[33] = styles.pendingIndicatorContainer;
377
- $[34] = temporarilyHidePendingState;
378
- $[35] = timestamp;
379
- $[36] = wasEdited;
380
- $[37] = t25;
385
+ $[22] = colors.iconColorDefaultSecondary;
386
+ $[23] = error;
387
+ $[24] = handleRetry;
388
+ $[25] = isDeletedReplyRootMessage;
389
+ $[26] = isPersisted;
390
+ $[27] = messagePendingLabel;
391
+ $[28] = pending;
392
+ $[29] = readByOthers;
393
+ $[30] = retryFailedSaveMutation;
394
+ $[31] = showMessageMeta;
395
+ $[32] = showReadReceipts;
396
+ $[33] = styles.editedText;
397
+ $[34] = styles.errorContainer;
398
+ $[35] = styles.errorIcon;
399
+ $[36] = styles.errorText;
400
+ $[37] = styles.messageMeta;
401
+ $[38] = styles.pendingIndicatorContainer;
402
+ $[39] = temporarilyHidePendingState;
403
+ $[40] = timestamp;
404
+ $[41] = wasEdited;
405
+ $[42] = t28;
381
406
  } else {
382
- t25 = $[37];
407
+ t28 = $[42];
383
408
  }
384
- let t26;
385
- if ($[38] !== T1 || $[39] !== t18 || $[40] !== t19 || $[41] !== t22 || $[42] !== t23 || $[43] !== t24 || $[44] !== t25) {
386
- t26 = /*#__PURE__*/_jsxs(T1, {
387
- style: t18,
388
- children: [t19, t22, t23, t24, t25]
409
+ let t29;
410
+ if ($[43] !== T1 || $[44] !== t21 || $[45] !== t22 || $[46] !== t25 || $[47] !== t26 || $[48] !== t27 || $[49] !== t28) {
411
+ t29 = /*#__PURE__*/_jsxs(T1, {
412
+ style: t21,
413
+ children: [t22, t25, t26, t27, t28]
389
414
  });
390
- $[38] = T1;
391
- $[39] = t18;
392
- $[40] = t19;
393
- $[41] = t22;
394
- $[42] = t23;
395
- $[43] = t24;
396
- $[44] = t25;
397
- $[45] = t26;
415
+ $[43] = T1;
416
+ $[44] = t21;
417
+ $[45] = t22;
418
+ $[46] = t25;
419
+ $[47] = t26;
420
+ $[48] = t27;
421
+ $[49] = t28;
422
+ $[50] = t29;
398
423
  } else {
399
- t26 = $[45];
424
+ t29 = $[50];
400
425
  }
401
- let t27;
402
- if ($[46] !== message || $[47] !== messageBubbleHeight) {
403
- t27 = message.mine && /*#__PURE__*/_jsx(MyReplyConnector, {
426
+ let t30;
427
+ if ($[51] !== message || $[52] !== messageBubbleHeight) {
428
+ t30 = message.mine && /*#__PURE__*/_jsx(MyReplyConnector, {
404
429
  message: message,
405
430
  messageBubbleHeight: messageBubbleHeight
406
431
  });
407
- $[46] = message;
408
- $[47] = messageBubbleHeight;
409
- $[48] = t27;
432
+ $[51] = message;
433
+ $[52] = messageBubbleHeight;
434
+ $[53] = t30;
410
435
  } else {
411
- t27 = $[48];
436
+ t30 = $[53];
412
437
  }
413
- let t28;
414
- if ($[49] !== t14.View || $[50] !== t15 || $[51] !== t16 || $[52] !== t26 || $[53] !== t27) {
415
- t28 = /*#__PURE__*/_jsxs(t14.View, {
416
- style: t15,
417
- children: [t16, t26, t27]
438
+ let t31;
439
+ if ($[54] !== t17.View || $[55] !== t18 || $[56] !== t19 || $[57] !== t29 || $[58] !== t30) {
440
+ t31 = /*#__PURE__*/_jsxs(t17.View, {
441
+ style: t18,
442
+ children: [t19, t29, t30]
418
443
  });
419
- $[49] = t14.View;
420
- $[50] = t15;
421
- $[51] = t16;
422
- $[52] = t26;
423
- $[53] = t27;
424
- $[54] = t28;
444
+ $[54] = t17.View;
445
+ $[55] = t18;
446
+ $[56] = t19;
447
+ $[57] = t29;
448
+ $[58] = t30;
449
+ $[59] = t31;
425
450
  } else {
426
- t28 = $[54];
451
+ t31 = $[59];
427
452
  }
428
- let t29;
429
- if ($[55] !== T0 || $[56] !== accessibilityLabel || $[57] !== t11 || $[58] !== t12 || $[59] !== t13 || $[60] !== t28 || $[61] !== t3 || $[62] !== t4 || $[63] !== t5 || $[64] !== t6 || $[65] !== t7 || $[66] !== t8) {
430
- t29 = /*#__PURE__*/_jsx(T0, {
431
- testID: t3,
432
- onLongPress: t4,
433
- onPress: t5,
434
- onPressIn: t6,
435
- onPressOut: t7,
436
- android_ripple: t8,
437
- accessibilityRole: t9,
453
+ let t32;
454
+ if ($[60] !== T0 || $[61] !== accessibilityLabel || $[62] !== t10 || $[63] !== t11 || $[64] !== t14 || $[65] !== t15 || $[66] !== t16 || $[67] !== t31 || $[68] !== t6 || $[69] !== t7 || $[70] !== t8 || $[71] !== t9) {
455
+ t32 = /*#__PURE__*/_jsx(T0, {
456
+ testID: t6,
457
+ onLongPress: t7,
458
+ onPress: t8,
459
+ onPressIn: t9,
460
+ onPressOut: t10,
461
+ android_ripple: t11,
462
+ accessibilityRole: t12,
438
463
  accessibilityLabel: accessibilityLabel,
439
- accessibilityHint: t10,
440
- accessibilityActions: t11,
441
- onAccessibilityAction: t12,
442
- disabled: t13,
443
- children: t28
464
+ accessibilityHint: t13,
465
+ accessibilityActions: t14,
466
+ onAccessibilityAction: t15,
467
+ disabled: t16,
468
+ children: t31
444
469
  });
445
- $[55] = T0;
446
- $[56] = accessibilityLabel;
447
- $[57] = t11;
448
- $[58] = t12;
449
- $[59] = t13;
450
- $[60] = t28;
451
- $[61] = t3;
452
- $[62] = t4;
453
- $[63] = t5;
454
- $[64] = t6;
455
- $[65] = t7;
456
- $[66] = t8;
457
- $[67] = t29;
470
+ $[60] = T0;
471
+ $[61] = accessibilityLabel;
472
+ $[62] = t10;
473
+ $[63] = t11;
474
+ $[64] = t14;
475
+ $[65] = t15;
476
+ $[66] = t16;
477
+ $[67] = t31;
478
+ $[68] = t6;
479
+ $[69] = t7;
480
+ $[70] = t8;
481
+ $[71] = t9;
482
+ $[72] = t32;
458
483
  } else {
459
- t29 = $[67];
484
+ t32 = $[72];
460
485
  }
461
- return t29;
486
+ return t32;
462
487
  });
463
488
  const useMessageStyles = (mine, isDeleting) => {
464
489
  const $ = _c(8);