@talkjs/react-components 0.1.0 → 0.1.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 (4) hide show
  1. package/default.cjs +291 -289
  2. package/default.d.ts +14 -9
  3. package/default.js +9778 -10116
  4. package/package.json +1 -1
package/default.d.ts CHANGED
@@ -6,6 +6,7 @@ import { FileBlock } from '@talkjs/core';
6
6
  import { FileToken } from '@talkjs/core';
7
7
  import { GenericFileBlock } from '@talkjs/core';
8
8
  import { ImageBlock } from '@talkjs/core';
9
+ import { JSX as JSX } from 'react/jsx-runtime';
9
10
  import { LocationBlock } from '@talkjs/core';
10
11
  import { MessageSnapshot } from '@talkjs/core';
11
12
  import { ParticipantSnapshot } from '@talkjs/core';
@@ -535,11 +536,6 @@ export declare interface CommonChatboxProps {
535
536
  * The conversation displayed in the chatbox.
536
537
  */
537
538
  conversation: ConversationSnapshot;
538
- /**
539
- * A list of participants that are part of the conversation that's currently
540
- * being shown.
541
- */
542
- participants: ParticipantSnapshot[];
543
539
  /**
544
540
  * Tells you which participants are currently typing
545
541
  */
@@ -674,10 +670,6 @@ export declare interface ConversationListItemProps {
674
670
  * The conversation that's being displayed.
675
671
  */
676
672
  conversation: ConversationSnapshot;
677
- /**
678
- * The list of participants that are part of the given conversation.
679
- */
680
- participants: ParticipantSnapshot[];
681
673
  /**
682
674
  * If `true`, this conversation is the currently selected one in the
683
675
  * conversation list.
@@ -1698,6 +1690,19 @@ declare interface TranslationStrings {
1698
1690
 
1699
1691
  export { TypingSnapshot }
1700
1692
 
1693
+ /**
1694
+ * Returns a list of participants in the conversation with the given ID.
1695
+ * It'll initially return an empty list, and re-render the calling component as data participants are loaded.
1696
+ * It'll also cause a re-render when any of those participants change, such as when a user's name or photoUrl changes.
1697
+ *
1698
+ * @param conversationId ID of the conversation
1699
+ * @param limit Maximum number of participants to subscribe to. Defaults to 10. The maximum is 100.
1700
+ * @returns List of participant snapshots.
1701
+ *
1702
+ * @public
1703
+ */
1704
+ export declare function useParticipants(conversationId: string, limit?: number): ParticipantSnapshot[];
1705
+
1701
1706
  /**
1702
1707
  * Returns "Yesterday", "Last Monday", "Tuesday, March 31" or "Monday, March 31
1703
1708
  * 2014", depending on which is most appropriate.