@stream-io/feeds-client 0.3.46 → 0.3.47

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 (28) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/index.js +1 -1
  3. package/dist/cjs/react-bindings.js +56 -23
  4. package/dist/cjs/react-bindings.js.map +1 -1
  5. package/dist/es/index.mjs +2 -2
  6. package/dist/es/react-bindings.mjs +56 -23
  7. package/dist/es/react-bindings.mjs.map +1 -1
  8. package/dist/{feeds-client-CF1yEox0.js → feeds-client-CxjZlEtX.js} +20 -16
  9. package/dist/feeds-client-CxjZlEtX.js.map +1 -0
  10. package/dist/{feeds-client-CSg4hlZ4.mjs → feeds-client-ykIZW9Hi.mjs} +20 -16
  11. package/dist/feeds-client-ykIZW9Hi.mjs.map +1 -0
  12. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  13. package/dist/types/bindings/react/hooks/feed-state-hooks/index.d.ts +1 -0
  14. package/dist/types/bindings/react/hooks/feed-state-hooks/index.d.ts.map +1 -1
  15. package/dist/types/bindings/react/hooks/feed-state-hooks/useMembers.d.ts +17 -0
  16. package/dist/types/bindings/react/hooks/feed-state-hooks/useMembers.d.ts.map +1 -0
  17. package/dist/types/common/Poll.d.ts.map +1 -1
  18. package/dist/types/feed/event-handlers/activity-updater.d.ts +2 -2
  19. package/dist/types/feed/event-handlers/activity-updater.d.ts.map +1 -1
  20. package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
  21. package/package.json +1 -1
  22. package/src/bindings/react/hooks/feed-state-hooks/index.ts +1 -0
  23. package/src/bindings/react/hooks/feed-state-hooks/useMembers.ts +55 -0
  24. package/src/common/Poll.ts +5 -2
  25. package/src/feed/event-handlers/activity-updater.ts +2 -0
  26. package/src/feeds-client/feeds-client.ts +10 -11
  27. package/dist/feeds-client-CF1yEox0.js.map +0 -1
  28. package/dist/feeds-client-CSg4hlZ4.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.3.47](https://github.com/GetStream/stream-feeds-js/compare/@stream-io/feeds-client-0.3.46...@stream-io/feeds-client-0.3.47) (2026-02-17)
6
+
7
+
8
+ ### Features
9
+
10
+ * add useMembers hook ([d60d251](https://github.com/GetStream/stream-feeds-js/commit/d60d2513f943f26731673ce714e6dbb4ffca4356))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * add poll to poll cache from parent activity too ([2ecbcf5](https://github.com/GetStream/stream-feeds-js/commit/2ecbcf5a2a636acc726c12bccb53babe49ea3db8))
16
+ * prevent WS event handler from wiping friend_reactions and friend… ([#235](https://github.com/GetStream/stream-feeds-js/issues/235)) ([de13b5d](https://github.com/GetStream/stream-feeds-js/commit/de13b5d9d75b3ac32957db392fd9b29e0aeba3ae))
17
+ * updating ownVotesByOptionId change didn't picked up by state store ([cb16ac7](https://github.com/GetStream/stream-feeds-js/commit/cb16ac77b39ebaf10ba370a8b7ae8b6094bcb39f))
18
+
5
19
  ## [0.3.46](https://github.com/GetStream/stream-feeds-js/compare/@stream-io/feeds-client-0.3.45...@stream-io/feeds-client-0.3.46) (2026-02-09)
6
20
 
7
21
 
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const stateStore = require("@stream-io/state-store");
4
- const feedsClient = require("../feeds-client-CF1yEox0.js");
4
+ const feedsClient = require("../feeds-client-CxjZlEtX.js");
5
5
  const loggerInternal = require("@stream-io/logger");
6
6
  const ownFeedFields = ["own_capabilities", "own_follows", "own_membership"];
7
7
  const ChannelOwnCapability = {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const reactBindings = require("@stream-io/state-store/react-bindings");
4
4
  const react = require("react");
5
- const feedsClient = require("../feeds-client-CF1yEox0.js");
5
+ const feedsClient = require("../feeds-client-CxjZlEtX.js");
6
6
  const jsxRuntime = require("react/jsx-runtime");
7
7
  const useCreateFeedsClient = ({
8
8
  apiKey,
@@ -62,18 +62,18 @@ const useFeedsClient = () => {
62
62
  };
63
63
  const useClientConnectedUser = () => {
64
64
  const client = useFeedsClient();
65
- const { user } = reactBindings.useStateStore(client?.state, selector$d) ?? {};
65
+ const { user } = reactBindings.useStateStore(client?.state, selector$e) ?? {};
66
66
  return user;
67
67
  };
68
- const selector$d = (nextState) => ({
68
+ const selector$e = (nextState) => ({
69
69
  user: nextState.connected_user
70
70
  });
71
71
  const useWsConnectionState = () => {
72
72
  const client = useFeedsClient();
73
- const { is_healthy } = reactBindings.useStateStore(client?.state, selector$c) ?? {};
73
+ const { is_healthy } = reactBindings.useStateStore(client?.state, selector$d) ?? {};
74
74
  return { is_healthy };
75
75
  };
76
- const selector$c = (nextState) => ({
76
+ const selector$d = (nextState) => ({
77
77
  is_healthy: nextState.is_ws_connection_healthy
78
78
  });
79
79
  const StreamFeedContext = react.createContext(void 0);
@@ -90,7 +90,7 @@ const useStableCallback = (callback) => {
90
90
  const useFeedActivities = (feedFromProps) => {
91
91
  const feedFromContext = useFeedContext();
92
92
  const feed = feedFromProps ?? feedFromContext;
93
- const data = reactBindings.useStateStore(feed?.state, selector$b);
93
+ const data = reactBindings.useStateStore(feed?.state, selector$c);
94
94
  const loadNextPage = useStableCallback(async () => {
95
95
  if (!feed || !data?.has_next_page || data?.is_loading) {
96
96
  return;
@@ -99,7 +99,7 @@ const useFeedActivities = (feedFromProps) => {
99
99
  });
100
100
  return react.useMemo(() => ({ ...data, loadNextPage }), [data, loadNextPage]);
101
101
  };
102
- const selector$b = ({
102
+ const selector$c = ({
103
103
  is_loading_activities,
104
104
  next,
105
105
  activities = []
@@ -148,7 +148,7 @@ function useComments({
148
148
  }, [data, loadNextPage]);
149
149
  }
150
150
  const stableEmptyArray = [];
151
- const selector$a = (currentState) => {
151
+ const selector$b = (currentState) => {
152
152
  return {
153
153
  feedOwnCapabilities: currentState.own_capabilities ?? stableEmptyArray
154
154
  };
@@ -161,10 +161,10 @@ const useOwnCapabilities = (feedFromProps) => {
161
161
  const [groupId, id] = feed.split(":");
162
162
  feed = groupId && id ? client?.feed(groupId, id) : void 0;
163
163
  }
164
- const { feedOwnCapabilities = stableEmptyArray } = reactBindings.useStateStore(feed?.state, selector$a) ?? {};
164
+ const { feedOwnCapabilities = stableEmptyArray } = reactBindings.useStateStore(feed?.state, selector$b) ?? {};
165
165
  return feedOwnCapabilities;
166
166
  };
167
- const selector$9 = ({
167
+ const selector$a = ({
168
168
  follower_count,
169
169
  followers,
170
170
  followers_pagination
@@ -176,7 +176,7 @@ const selector$9 = ({
176
176
  function useFollowers(feedFromProps) {
177
177
  const feedFromContext = useFeedContext();
178
178
  const feed = feedFromProps ?? feedFromContext;
179
- const data = reactBindings.useStateStore(feed?.state, selector$9);
179
+ const data = reactBindings.useStateStore(feed?.state, selector$a);
180
180
  const loadNextPage = react.useCallback(
181
181
  (...options) => feed?.loadNextPageFollowers(...options),
182
182
  [feed]
@@ -196,7 +196,7 @@ function useFollowers(feedFromProps) {
196
196
  };
197
197
  }, [data, loadNextPage]);
198
198
  }
199
- const selector$8 = ({
199
+ const selector$9 = ({
200
200
  following_count,
201
201
  following,
202
202
  following_pagination
@@ -208,7 +208,7 @@ const selector$8 = ({
208
208
  function useFollowing(feedFromProps) {
209
209
  const feedFromContext = useFeedContext();
210
210
  const feed = feedFromProps ?? feedFromContext;
211
- const data = reactBindings.useStateStore(feed?.state, selector$8);
211
+ const data = reactBindings.useStateStore(feed?.state, selector$9);
212
212
  const loadNextPage = react.useCallback(
213
213
  (...options) => feed?.loadNextPageFollowing(...options),
214
214
  [feed]
@@ -231,9 +231,9 @@ function useFollowing(feedFromProps) {
231
231
  const useFeedMetadata = (feedFromProps) => {
232
232
  const feedFromContext = useFeedContext();
233
233
  const feed = feedFromProps ?? feedFromContext;
234
- return reactBindings.useStateStore(feed?.state, selector$7);
234
+ return reactBindings.useStateStore(feed?.state, selector$8);
235
235
  };
236
- const selector$7 = ({
236
+ const selector$8 = ({
237
237
  follower_count = 0,
238
238
  following_count = 0,
239
239
  created_by,
@@ -249,12 +249,12 @@ const selector$7 = ({
249
249
  const useOwnFollows = (feedFromProps) => {
250
250
  const feedFromContext = useFeedContext();
251
251
  const feed = feedFromProps ?? feedFromContext;
252
- return reactBindings.useStateStore(feed?.state, selector$6);
252
+ return reactBindings.useStateStore(feed?.state, selector$7);
253
253
  };
254
- const selector$6 = ({ own_follows }) => ({
254
+ const selector$7 = ({ own_follows }) => ({
255
255
  own_follows
256
256
  });
257
- const selector$5 = ({ notification_status }) => ({
257
+ const selector$6 = ({ notification_status }) => ({
258
258
  unread: notification_status?.unread ?? 0,
259
259
  unseen: notification_status?.unseen ?? 0,
260
260
  last_read_at: notification_status?.last_read_at,
@@ -265,9 +265,9 @@ const selector$5 = ({ notification_status }) => ({
265
265
  function useNotificationStatus(feedFromProps) {
266
266
  const feedFromContext = useFeedContext();
267
267
  const feed = feedFromProps ?? feedFromContext;
268
- return reactBindings.useStateStore(feed?.state, selector$5);
268
+ return reactBindings.useStateStore(feed?.state, selector$6);
269
269
  }
270
- const selector$4 = ({
270
+ const selector$5 = ({
271
271
  is_loading_activities,
272
272
  next,
273
273
  aggregated_activities = []
@@ -279,7 +279,7 @@ const selector$4 = ({
279
279
  function useAggregatedActivities(feedFromProps) {
280
280
  const feedFromContext = useFeedContext();
281
281
  const feed = feedFromProps ?? feedFromContext;
282
- const data = reactBindings.useStateStore(feed?.state, selector$4);
282
+ const data = reactBindings.useStateStore(feed?.state, selector$5);
283
283
  const loadNextPage = useStableCallback(async () => {
284
284
  if (!feed || !data?.has_next_page || data?.is_loading) {
285
285
  return;
@@ -389,11 +389,43 @@ function useActivityComments({
389
389
  const useOwnFollowings = (feedFromProps) => {
390
390
  const feedFromContext = useFeedContext();
391
391
  const feed = feedFromProps ?? feedFromContext;
392
- return reactBindings.useStateStore(feed?.state, selector$3);
392
+ return reactBindings.useStateStore(feed?.state, selector$4);
393
393
  };
394
- const selector$3 = ({ own_followings }) => ({
394
+ const selector$4 = ({ own_followings }) => ({
395
395
  own_followings
396
396
  });
397
+ const selector$3 = ({
398
+ member_count,
399
+ members,
400
+ member_pagination
401
+ }) => ({
402
+ member_count,
403
+ members,
404
+ member_pagination
405
+ });
406
+ function useMembers(feedFromProps) {
407
+ const feedFromContext = useFeedContext();
408
+ const feed = feedFromProps ?? feedFromContext;
409
+ const data = reactBindings.useStateStore(feed?.state, selector$3);
410
+ const loadNextPage = react.useCallback(
411
+ (...options) => feed?.loadNextPageMembers(...options),
412
+ [feed]
413
+ );
414
+ return react.useMemo(() => {
415
+ if (!data) {
416
+ return void 0;
417
+ }
418
+ return {
419
+ ...data,
420
+ is_loading_next_page: data.member_pagination?.loading_next_page ?? false,
421
+ has_next_page: feedsClient.checkHasAnotherPage(
422
+ data.members,
423
+ data.member_pagination?.next
424
+ ),
425
+ loadNextPage
426
+ };
427
+ }, [data, loadNextPage]);
428
+ }
397
429
  const StreamSearchResultsContext = react.createContext(void 0);
398
430
  const useSearchResultsContext = () => {
399
431
  return react.useContext(StreamSearchResultsContext);
@@ -499,6 +531,7 @@ exports.useFollowers = useFollowers;
499
531
  exports.useFollowing = useFollowing;
500
532
  exports.useIsAggregatedActivityRead = useIsAggregatedActivityRead;
501
533
  exports.useIsAggregatedActivitySeen = useIsAggregatedActivitySeen;
534
+ exports.useMembers = useMembers;
502
535
  exports.useNotificationStatus = useNotificationStatus;
503
536
  exports.useOwnCapabilities = useOwnCapabilities;
504
537
  exports.useOwnFollowings = useOwnFollowings;
@@ -1 +1 @@
1
- {"version":3,"file":"react-bindings.js","sources":["../../src/bindings/react/hooks/useCreateFeedsClient.ts","../../src/bindings/react/contexts/StreamFeedsContext.tsx","../../src/bindings/react/hooks/client-state-hooks/useClientConnectedUser.ts","../../src/bindings/react/hooks/client-state-hooks/useWsConnectionState.ts","../../src/bindings/react/contexts/StreamFeedContext.tsx","../../src/bindings/react/hooks/internal/useStableCallback.ts","../../src/bindings/react/hooks/feed-state-hooks/useFeedActivities.ts","../../src/bindings/react/hooks/feed-state-hooks/useComments.ts","../../src/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.ts","../../src/bindings/react/hooks/feed-state-hooks/useFollowers.ts","../../src/bindings/react/hooks/feed-state-hooks/useFollowing.ts","../../src/bindings/react/hooks/feed-state-hooks/useFeedMetadata.ts","../../src/bindings/react/hooks/feed-state-hooks/useOwnFollows.ts","../../src/bindings/react/hooks/feed-state-hooks/useNotificationStatus.ts","../../src/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.ts","../../src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.ts","../../src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.ts","../../src/bindings/react/contexts/StreamActivityWithStateUpdatesContext.tsx","../../src/bindings/react/hooks/feed-state-hooks/useActivityComments.ts","../../src/bindings/react/hooks/feed-state-hooks/useOwnFollowings.ts","../../src/bindings/react/contexts/StreamSearchResultsContext.tsx","../../src/bindings/react/hooks/search-state-hooks/useSearchResult.ts","../../src/bindings/react/contexts/StreamSearchContext.tsx","../../src/bindings/react/hooks/search-state-hooks/useSearchQuery.ts","../../src/bindings/react/hooks/search-state-hooks/useSearchSources.ts","../../src/bindings/react/wrappers/StreamFeeds.tsx","../../src/bindings/react/wrappers/StreamFeed.tsx","../../src/bindings/react/wrappers/StreamActivityWithStateUpdates.tsx","../../src/bindings/react/wrappers/StreamSearch.tsx","../../src/bindings/react/wrappers/StreamSearchResults.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { FeedsClient } from '../../../feeds-client';\nimport type { TokenOrProvider } from '../../../types';\nimport type { CreateGuestResponse, UserRequest } from '../../../gen/models';\nimport type { FeedsClientOptions } from '../../../common/types';\n\n/**\n * A React hook to create, connect and return an instance of `FeedsClient`.\n */\nexport const useCreateFeedsClient = ({\n apiKey,\n tokenOrProvider,\n userData: userDataOrAnonymous,\n options,\n}: {\n apiKey: string;\n tokenOrProvider?: TokenOrProvider | 'guest';\n userData: UserRequest | 'anonymous';\n options?: FeedsClientOptions;\n}) => {\n const userData =\n userDataOrAnonymous === 'anonymous' ? undefined : userDataOrAnonymous;\n\n if (userDataOrAnonymous !== 'anonymous' && !tokenOrProvider) {\n throw new Error(\n 'Token provider can only be omitted when connecting anonymous user. If you want to connect as a guest, provide \"guest\" instead of a token provider.',\n );\n }\n\n const [client, setClient] = useState<FeedsClient | null>(null);\n const [error, setError] = useState<Error | null>(null);\n const [cachedUserData, setCachedUserData] = useState(userData);\n\n const [cachedOptions] = useState(options);\n\n if (error) {\n throw error;\n }\n\n if (userData?.id !== cachedUserData?.id) {\n setCachedUserData(userData);\n }\n\n useEffect(() => {\n const _client = new FeedsClient(apiKey, cachedOptions);\n\n let connectionPromise: Promise<void | CreateGuestResponse>;\n if (!cachedUserData) {\n connectionPromise = _client.connectAnonymous();\n } else if (tokenOrProvider === 'guest') {\n connectionPromise = _client.connectGuest({\n user: cachedUserData,\n });\n } else {\n connectionPromise = _client.connectUser(cachedUserData, tokenOrProvider!);\n }\n\n connectionPromise = connectionPromise\n .then(() => {\n setError(null);\n })\n .catch((err) => {\n setError(err);\n });\n\n setClient(_client);\n\n return () => {\n setClient(null);\n connectionPromise\n .then(() => {\n setError(null);\n return _client.disconnectUser();\n })\n .catch((err) => {\n setError(err);\n });\n };\n }, [apiKey, cachedUserData, cachedOptions, tokenOrProvider]);\n\n return client;\n};\n","import { createContext, useContext } from 'react';\n\nimport type { FeedsClient } from '../../../feeds-client';\n\nexport const StreamFeedsContext = createContext<FeedsClient | undefined>(undefined);\n\n/**\n * The props for the StreamFeedsProvider component.\n */\nexport type StreamFeedsContextProps = {\n /**\n * The client instance to provide to the component tree.\n */\n client: FeedsClient;\n};\n\n/**\n * Hook to access the nearest FeedsClient instance.\n */\nexport const useFeedsClient = () => {\n return useContext(StreamFeedsContext);\n};\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedsClient } from '../../contexts/StreamFeedsContext';\nimport type { FeedsClientState } from '../../../../feeds-client';\n\n/**\n * A React hook that returns the currently connected user on a `FeedsClient` instance and null otherwise.\n */\nexport const useClientConnectedUser = () => {\n const client = useFeedsClient();\n\n const { user } = useStateStore(client?.state, selector) ?? {};\n\n return user;\n};\n\nconst selector = (nextState: FeedsClientState) => ({\n user: nextState.connected_user,\n});\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedsClient } from '../../contexts/StreamFeedsContext';\nimport type { FeedsClientState } from '../../../../feeds-client';\n\n/**\n * A React hook that returns the websocket connection state of `FeedsClient`.\n */\nexport const useWsConnectionState = () => {\n const client = useFeedsClient();\n\n const { is_healthy } = useStateStore(client?.state, selector) ?? {}\n\n return { is_healthy };\n};\n\nconst selector = (nextState: FeedsClientState) => ({\n is_healthy: nextState.is_ws_connection_healthy,\n});\n","import { createContext, useContext } from 'react';\n\nimport type { Feed } from '../../../feed';\n\nexport const StreamFeedContext = createContext<Feed | undefined>(undefined);\n\n/**\n * The props for the StreamFeedProvider component.\n */\nexport type StreamFeedContextProps = {\n feed: Feed;\n};\n\n/**\n * Hook to access the nearest Feed instance.\n */\nexport const useFeedContext = () => {\n return useContext(StreamFeedContext);\n};\n","import { useCallback, useRef } from 'react';\n\nexport type StableCallback<A extends unknown[], R> = (...args: A) => R;\n\n/**\n * A utility hook implementing a stable callback. It takes in an unstable method that\n * is supposed to be invoked somewhere deeper in the DOM tree without making it\n * change its reference every time the parent component rerenders. It will also return\n * the value of the callback if it does return one.\n * A common use-case would be having a function whose invocation depends on state\n * somewhere high up in the DOM tree and wanting to use the same function deeper\n * down, for example in a leaf node and simply using useCallback results in\n * cascading dependency hell. If we wrap it in useStableCallback, we would be able\n * to:\n * - Use the same function as a dependency of another hook (since it is stable)\n * - Still invoke it and get the latest state\n *\n * **Caveats:**\n * - Never wrap a function that is supposed to return a React.ReactElement in\n * useStableCallback, since React will not know that the DOM needs to be updated\n * whenever the callback value changes (for example, renderItem from FlatList must\n * never be wrapped in this hook)\n * - Always prefer using a standard useCallback/stable function wherever possible\n * (the purpose of useStableCallback is to bridge the gap between top level contexts\n * and cascading rereders in downstream components - **not** as an escape hatch)\n * @param callback - the callback we want to stabilize\n */\nexport const useStableCallback = <A extends unknown[], R>(\n callback: StableCallback<A, R>,\n): StableCallback<A, R> => {\n const ref = useRef(callback);\n ref.current = callback;\n\n return useCallback<StableCallback<A, R>>((...args) => {\n return ref.current(...args);\n }, []);\n};\n","import { useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { useStableCallback } from '../internal';\nimport type { Feed, FeedState } from '../../../../feed';\n\n/**\n * A React hook that returns a reactive object containing the current activities,\n * loading state and whether there is a next page to paginate to or not.\n */\nexport const useFeedActivities = (feedFromProps?: Feed) => {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const data = useStateStore(feed?.state, selector);\n\n const loadNextPage = useStableCallback(async () => {\n if (!feed || !data?.has_next_page || data?.is_loading) {\n return;\n }\n\n await feed.getNextPage();\n });\n\n return useMemo(() => ({ ...data, loadNextPage }), [data, loadNextPage]);\n};\n\nconst selector = ({\n is_loading_activities,\n next,\n activities = [],\n}: FeedState) => ({\n is_loading: is_loading_activities,\n has_next_page: typeof next !== 'undefined',\n activities,\n});\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { checkHasAnotherPage, isCommentResponse } from '../../../../utils';\nimport type { ActivityResponse, CommentResponse } from '../../../../gen/models';\nimport type { Feed, FeedState } from '../../../../feed';\nimport type { CommentParent } from '../../../../types';\n\ntype UseCommentsReturnType<T extends ActivityResponse | CommentResponse> = {\n comments: NonNullable<\n FeedState['comments_by_entity_id'][T['id']]\n >['comments'];\n comments_pagination: NonNullable<\n FeedState['comments_by_entity_id'][T['id']]\n >['pagination'];\n has_next_page: boolean;\n is_loading_next_page: boolean;\n loadNextPage: (\n request?: T extends CommentResponse\n ? Parameters<Feed['loadNextPageCommentReplies']>[1]\n : Parameters<Feed['loadNextPageActivityComments']>[1],\n ) => Promise<void>;\n};\n\n/**\n * @deprecated Use `useActivityComments` instead.\n * @param\n */\nexport function useComments<T extends CommentParent>(_: {\n feed: Feed;\n parent: T;\n}): UseCommentsReturnType<T>;\nexport function useComments<T extends CommentParent>(_: {\n feed?: Feed;\n parent: T;\n}): UseCommentsReturnType<T> | undefined;\nexport function useComments<T extends CommentParent>({\n feed: feedFromProps,\n parent,\n}: {\n feed?: Feed;\n /**\n * The parent (activity or comment) for which to fetch comments.\n */\n parent: T;\n}) {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const selector = useCallback(\n (state: FeedState) => ({\n comments: state.comments_by_entity_id?.[parent.id]?.comments,\n comments_pagination: state.comments_by_entity_id?.[parent.id]?.pagination,\n }),\n [parent.id],\n );\n\n const data = useStateStore(feed?.state, selector);\n\n const loadNextPage = useMemo<\n UseCommentsReturnType<T>['loadNextPage'] | undefined\n >(() => {\n if (!feed) return undefined;\n\n return (request) => {\n if (isCommentResponse(parent)) {\n return feed.loadNextPageCommentReplies(parent, request);\n } else {\n return feed.loadNextPageActivityComments(parent, request);\n }\n };\n }, [feed, parent]);\n\n return useMemo(() => {\n if (!data) {\n return undefined;\n }\n\n return {\n ...data,\n has_next_page: checkHasAnotherPage(\n data.comments,\n data.comments_pagination?.next,\n ),\n is_loading_next_page:\n data?.comments_pagination?.loading_next_page ?? false,\n loadNextPage,\n };\n }, [data, loadNextPage]);\n}\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\nimport type { FeedOwnCapability } from '../../../../gen/models';\nimport { useFeedsClient } from '../../contexts/StreamFeedsContext';\n\nconst stableEmptyArray: readonly FeedOwnCapability[] = [];\n\nconst selector = (currentState: FeedState) => {\n return {\n feedOwnCapabilities: currentState.own_capabilities ?? stableEmptyArray,\n };\n};\n\nexport const useOwnCapabilities = (feedFromProps?: Feed | string) => {\n const client = useFeedsClient();\n const feedFromContext = useFeedContext();\n let feed = feedFromProps ?? feedFromContext;\n if (typeof feed === 'string') {\n const [groupId, id] = feed.split(':');\n feed = groupId && id ? client?.feed(groupId, id) : undefined;\n }\n\n const { feedOwnCapabilities = stableEmptyArray } =\n useStateStore(feed?.state, selector) ?? {};\n\n return feedOwnCapabilities;\n};\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\nimport { checkHasAnotherPage } from '../../../../utils';\n\nconst selector = ({\n follower_count,\n followers,\n followers_pagination,\n}: FeedState) => ({\n follower_count,\n followers,\n followers_pagination,\n});\n\ntype UseFollowersReturnType = ReturnType<typeof selector> & {\n is_loading_next_page: boolean;\n has_next_page: boolean;\n loadNextPage: (\n ...options: Parameters<Feed['loadNextPageFollowers']>\n ) => Promise<void>;\n};\n\nexport function useFollowers(feed: Feed): UseFollowersReturnType;\nexport function useFollowers(feed?: Feed): UseFollowersReturnType | undefined;\nexport function useFollowers(feedFromProps?: Feed) {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const data = useStateStore(feed?.state, selector);\n\n const loadNextPage = useCallback(\n (...options: Parameters<Feed['loadNextPageFollowers']>) =>\n feed?.loadNextPageFollowers(...options),\n [feed],\n );\n\n return useMemo(() => {\n if (!data) {\n return undefined;\n }\n\n return {\n ...data,\n is_loading_next_page:\n data.followers_pagination?.loading_next_page ?? false,\n has_next_page: checkHasAnotherPage(\n data.followers,\n data.followers_pagination?.next,\n ),\n loadNextPage,\n };\n }, [data, loadNextPage]);\n}\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { checkHasAnotherPage } from '../../../../utils';\nimport type { Feed, FeedState } from '../../../../feed';\n\nconst selector = ({\n following_count,\n following,\n following_pagination,\n}: FeedState) => ({\n following_count,\n following,\n following_pagination,\n});\n\ntype UseFollowingReturnType = ReturnType<typeof selector> & {\n is_loading_next_page: boolean;\n has_next_page: boolean;\n loadNextPage: (\n ...options: Parameters<Feed['loadNextPageFollowers']>\n ) => Promise<void>;\n};\n\nexport function useFollowing(feed: Feed): UseFollowingReturnType;\nexport function useFollowing(feed?: Feed): UseFollowingReturnType | undefined;\nexport function useFollowing(feedFromProps?: Feed) {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const data = useStateStore(feed?.state, selector);\n\n const loadNextPage = useCallback(\n (...options: Parameters<Feed['loadNextPageFollowing']>) =>\n feed?.loadNextPageFollowing(...options),\n [feed],\n );\n\n return useMemo(() => {\n if (!data) {\n return undefined;\n }\n\n return {\n ...data,\n is_loading_next_page:\n data.following_pagination?.loading_next_page ?? false,\n has_next_page: checkHasAnotherPage(\n data.following,\n data.following_pagination?.next,\n ),\n loadNextPage,\n };\n }, [data, loadNextPage]);\n}\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\n\n/**\n * A React hook that returns a reactive object containing some often used\n * metadata for a feed.\n */\nexport const useFeedMetadata = (feedFromProps?: Feed) => {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n return useStateStore(feed?.state, selector);\n};\n\nconst selector = ({\n follower_count = 0,\n following_count = 0,\n created_by,\n created_at,\n updated_at,\n}: FeedState) => ({\n created_by,\n follower_count,\n following_count,\n created_at,\n updated_at,\n});\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\n\n/**\n * A React hook that returns a reactive array of feeds that the current user\n * owns and are following the respective feed that we are observing.\n */\nexport const useOwnFollows = (feedFromProps?: Feed) => {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n return useStateStore(feed?.state, selector);\n};\n\nconst selector = ({ own_follows }: FeedState) => ({\n own_follows,\n});\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\nimport type { NotificationStatusResponse } from '../../../../gen/models';\n\nconst selector = ({ notification_status }: FeedState) =>\n ({\n unread: notification_status?.unread ?? 0,\n unseen: notification_status?.unseen ?? 0,\n last_read_at: notification_status?.last_read_at,\n last_seen_at: notification_status?.last_seen_at,\n read_activities: notification_status?.read_activities,\n seen_activities: notification_status?.seen_activities,\n }) satisfies NotificationStatusResponse;\n\ntype UseNotificationStatusReturnType = ReturnType<typeof selector>;\n\nexport function useNotificationStatus(\n feed: Feed,\n): UseNotificationStatusReturnType;\nexport function useNotificationStatus(\n feed?: Feed,\n): UseNotificationStatusReturnType | undefined;\nexport function useNotificationStatus(feedFromProps?: Feed) {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n return useStateStore(feed?.state, selector);\n}\n","import { useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { useStableCallback } from '../internal';\nimport type { Feed, FeedState } from '../../../../feed';\n\nconst selector = ({\n is_loading_activities,\n next,\n aggregated_activities = [],\n}: FeedState) => ({\n is_loading: is_loading_activities,\n has_next_page: typeof next !== 'undefined',\n aggregated_activities,\n});\n\ntype UseAggregatedActivitiesReturnType = ReturnType<typeof selector> & {\n loadNextPage: () => Promise<void>;\n};\n\n/**\n * A React hook that returns a reactive object containing the current aggregated activities,\n * loading state and whether there is a next page to paginate to or not.\n */\nexport function useAggregatedActivities(\n feedFromProps: Feed,\n): UseAggregatedActivitiesReturnType;\nexport function useAggregatedActivities(\n feedFromProps?: Feed,\n): UseAggregatedActivitiesReturnType | undefined;\nexport function useAggregatedActivities(feedFromProps?: Feed) {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const data = useStateStore(feed?.state, selector);\n\n const loadNextPage = useStableCallback(async () => {\n if (!feed || !data?.has_next_page || data?.is_loading) {\n return;\n }\n\n await feed.getNextPage();\n });\n\n return useMemo(\n () => (data ? { ...data, loadNextPage } : undefined),\n [data, loadNextPage],\n );\n}\n","import { useMemo } from 'react';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { useNotificationStatus } from './useNotificationStatus';\nimport type { Feed } from '../../../../feed';\nimport type { AggregatedActivityResponse } from '../../../../gen/models';\n\nexport const useIsAggregatedActivityRead = ({\n feed: feedFromProps,\n aggregatedActivity,\n}: {\n feed?: Feed;\n aggregatedActivity: AggregatedActivityResponse;\n}) => {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const { read_activities: readActivities, last_read_at: lastReadAt } =\n useNotificationStatus(feed) ?? {};\n\n const group = aggregatedActivity.group;\n\n return useMemo(\n () =>\n (lastReadAt &&\n aggregatedActivity.updated_at.getTime() <= lastReadAt.getTime()) ||\n (readActivities ?? []).includes(group),\n [lastReadAt, aggregatedActivity.updated_at, readActivities, group],\n );\n};\n","import { useMemo } from 'react';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { useNotificationStatus } from './useNotificationStatus';\nimport type { Feed } from '../../../../feed';\nimport type { AggregatedActivityResponse } from '../../../../gen/models';\n\nexport const useIsAggregatedActivitySeen = ({\n feed: feedFromProps,\n aggregatedActivity,\n}: {\n feed?: Feed;\n aggregatedActivity: AggregatedActivityResponse;\n}) => {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const { seen_activities: seenActivities, last_seen_at: lastSeenAt } =\n useNotificationStatus(feed) ?? {};\n\n const group = aggregatedActivity.group;\n\n return useMemo(\n () =>\n (lastSeenAt &&\n aggregatedActivity.updated_at.getTime() < lastSeenAt.getTime()) ||\n (seenActivities ?? []).includes(group),\n [lastSeenAt, aggregatedActivity.updated_at, seenActivities, group],\n );\n};\n","import { createContext, useContext } from 'react';\n\nimport type { ActivityWithStateUpdates } from '../../../activity-with-state-updates/activity-with-state-updates';\n\nexport const StreamActivityWithStateUpdatesContext = createContext<ActivityWithStateUpdates | undefined>(undefined);\n\n/**\n * The props for the StreamActivityWithStateUpdatesProvider component.\n */\nexport type StreamActivityWithStateUpdatesContextProps = {\n activityWithStateUpdates: ActivityWithStateUpdates;\n};\n\n/**\n * Hook to access the nearest ActivityWithStateUpdates instance.\n */\nexport const useActivityWithStateUpdatesContext = () => {\n return useContext(StreamActivityWithStateUpdatesContext);\n};\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\nimport type { StateStore } from '@stream-io/state-store';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { checkHasAnotherPage } from '../../../../utils';\nimport type { Feed, FeedState } from '../../../../feed';\nimport type { ActivityState, ActivityWithStateUpdates } from '../../../../activity-with-state-updates/activity-with-state-updates';\nimport type { ActivityResponse, CommentResponse } from '../../../../gen/models';\nimport { useActivityWithStateUpdatesContext } from '../../contexts/StreamActivityWithStateUpdatesContext';\n\nconst canLoadComments = (\n feedOrActivity: Feed | ActivityResponse | ActivityWithStateUpdates,\n): feedOrActivity is ActivityWithStateUpdates | Feed => {\n return (\n 'loadNextPageCommentReplies' in feedOrActivity &&\n 'loadNextPageActivityComments' in feedOrActivity\n );\n};\n\ntype UseCommentsReturnType<T extends ActivityResponse | CommentResponse> = {\n comments: NonNullable<\n FeedState['comments_by_entity_id'][T['id']]\n >['comments'];\n comments_pagination: NonNullable<\n FeedState['comments_by_entity_id'][T['id']]\n >['pagination'];\n has_next_page: boolean;\n is_loading_next_page: boolean;\n loadNextPage: (\n request?: T extends CommentResponse\n ? Parameters<Feed['loadNextPageCommentReplies']>[1]\n : Parameters<Feed['loadNextPageActivityComments']>[1],\n ) => Promise<void>;\n};\n\nexport function useActivityComments({\n feed: feedFromProps,\n parentComment,\n activity: activityFromProps,\n}: {\n feed?: Feed;\n parentComment?: CommentResponse;\n activity?: ActivityResponse | ActivityWithStateUpdates;\n} = {}) {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n const activityFromContext = useActivityWithStateUpdatesContext();\n const activity = activityFromProps ?? activityFromContext;\n const feedOrActivity = (activity && canLoadComments(activity)) ? activity : feed;\n\n if (!feedOrActivity) {\n throw new Error('Feed or activity is required');\n }\n\n if (!canLoadComments(feedOrActivity)) {\n throw new Error('Feed or activity does not support loading comments');\n }\n\n if (!(activity || parentComment)) {\n throw new Error('Activity or parent comment is required');\n }\n\n const entityId = parentComment?.id ?? activity?.id ?? '';\n const selector = useCallback(\n (state: FeedState | ActivityState) => ({\n comments: state.comments_by_entity_id?.[entityId]?.comments,\n comments_pagination: state.comments_by_entity_id?.[entityId]?.pagination,\n }),\n [entityId],\n );\n\n const data = useStateStore(\n feedOrActivity.state as StateStore<FeedState | ActivityState>,\n selector,\n );\n\n const loadNextPage = useCallback<\n UseCommentsReturnType<ActivityResponse | CommentResponse>['loadNextPage']\n >(\n (request) => {\n if (parentComment) {\n return feedOrActivity.loadNextPageCommentReplies(\n parentComment,\n request,\n );\n } else {\n if (activity && canLoadComments(activity)) {\n return activity.loadNextPageActivityComments(request);\n } else if (feed) {\n return feed.loadNextPageActivityComments(activity?.id ?? '', request);\n } else {\n throw new Error('Activity or feed is required');\n }\n }\n },\n [feedOrActivity, feed, parentComment, activity],\n );\n\n return useMemo(() => {\n return {\n ...data,\n has_next_page: checkHasAnotherPage(\n data.comments,\n data.comments_pagination?.next,\n ),\n is_loading_next_page:\n data?.comments_pagination?.loading_next_page ?? false,\n loadNextPage,\n };\n }, [data, loadNextPage]);\n}\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\n\n/**\n * A React hook that returns a reactive array of feeds that the feeds's owner is following and is owned by the current user.\n */\nexport const useOwnFollowings = (feedFromProps?: Feed) => {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n return useStateStore(feed?.state, selector);\n};\n\nconst selector = ({ own_followings }: FeedState) => ({\n own_followings,\n});\n","import { createContext, useContext } from 'react';\n\nimport type { SearchSource } from '../../../common/search';\n\nexport const StreamSearchResultsContext = createContext<\n SearchSource | undefined\n>(undefined);\n\n/**\n * The props for the StreamSearchResultsProvider component.\n */\nexport type StreamSearchResultsContextProps = {\n source: SearchSource;\n};\n\n/**\n * Hook to access the nearest SearchSource instance.\n */\nexport const useSearchResultsContext = () => {\n return useContext(StreamSearchResultsContext);\n};\n","import { useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useSearchResultsContext } from '../../contexts/StreamSearchResultsContext';\nimport { useStableCallback } from '../internal';\nimport type { SearchSourceState } from '../../../../common/types';\nimport type { SearchSource } from '../../../../common/search';\n\nexport const useSearchResult = (sourceFromProps?: SearchSource) => {\n const sourceFromContext = useSearchResultsContext();\n const source = sourceFromProps ?? sourceFromContext;\n\n const { items, error, isLoading, hasNext } =\n useStateStore(source?.state, selector) ?? {};\n\n const loadMore = useStableCallback(async () => {\n if (hasNext) {\n source?.search();\n }\n });\n\n return useMemo(\n () => ({ items, error, isLoading, hasNext, loadMore }),\n [error, hasNext, isLoading, items, loadMore],\n );\n};\n\nconst selector = ({\n items,\n isLoading,\n hasNext,\n lastQueryError,\n}: SearchSourceState) => ({\n items,\n isLoading,\n hasNext,\n error: lastQueryError,\n});\n","import { createContext, useContext } from 'react';\n\nimport type { SearchController } from '../../../common/search';\n\nexport const StreamSearchContext = createContext<SearchController | undefined>(undefined);\n\n/**\n * The props for the StreamSearchProvider component.\n */\nexport type StreamSearchContextProps = {\n searchController: SearchController;\n};\n\n/**\n * Hook to access the nearest SearchController instance.\n */\nexport const useSearchContext = () => {\n return useContext(StreamSearchContext);\n};\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport type {\n SearchController,\n SearchControllerState,\n} from '../../../../common/search';\nimport { useSearchContext } from '../../contexts/StreamSearchContext';\n\nexport const useSearchQuery = (controllerFromProps?: SearchController) => {\n const controllerFromState = useSearchContext();\n const controller = controllerFromProps ?? controllerFromState;\n\n return useStateStore(controller?.state, selector);\n};\n\nconst selector = ({ searchQuery }: SearchControllerState) => ({\n searchQuery,\n});\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useSearchContext } from '../../contexts/StreamSearchContext';\nimport type { SearchController, SearchControllerState } from '../../../../common/search';\n\nexport const useSearchSources = (controllerFromProps?: SearchController) => {\n const controllerFromState = useSearchContext();\n const controller = controllerFromProps ?? controllerFromState;\n\n return useStateStore(controller?.state, selector);\n};\n\nconst selector = ({ sources }: SearchControllerState) => ({\n sources,\n});\n","import type { PropsWithChildren } from 'react';\nimport { StreamFeedsContext } from '../contexts/StreamFeedsContext';\nimport type { StreamFeedsContextProps } from '../contexts/StreamFeedsContext';\n\nexport const StreamFeeds = ({ client, children }: PropsWithChildren<StreamFeedsContextProps>) => {\n return (\n <StreamFeedsContext.Provider value={client}>\n {children}\n </StreamFeedsContext.Provider>\n );\n};\n\nStreamFeeds.displayName = 'StreamFeeds';\n","import type { PropsWithChildren } from 'react';\n\nimport { StreamFeedContext } from '../contexts/StreamFeedContext';\nimport type { Feed } from '../../../feed';\n\n/**\n * The props for the StreamFeed component. It accepts a `Feed` instance.\n */\nexport type StreamFeedProps = {\n feed: Feed;\n};\n\nexport const StreamFeed = ({\n feed,\n children,\n}: PropsWithChildren<StreamFeedProps>) => {\n return (\n <StreamFeedContext.Provider value={feed}>\n {children}\n </StreamFeedContext.Provider>\n );\n};\n\nStreamFeed.displayName = 'StreamFeed';\n","import type { PropsWithChildren } from 'react';\n\nimport { StreamActivityWithStateUpdatesContext } from '../contexts/StreamActivityWithStateUpdatesContext';\nimport type { ActivityWithStateUpdates } from '../../../activity-with-state-updates/activity-with-state-updates';\n\n/**\n * The props for the StreamActivityWithStateUpdates component. It accepts an `ActivityWithStateUpdates` instance.\n */\nexport type StreamActivityWithStateUpdatesProps = {\n activityWithStateUpdates: ActivityWithStateUpdates;\n};\n\nexport const StreamActivityWithStateUpdates = ({\n activityWithStateUpdates,\n children,\n}: PropsWithChildren<StreamActivityWithStateUpdatesProps>) => {\n return (\n <StreamActivityWithStateUpdatesContext.Provider value={activityWithStateUpdates}>\n {children}\n </StreamActivityWithStateUpdatesContext.Provider>\n );\n};\n\nStreamActivityWithStateUpdates.displayName = 'StreamActivityWithStateUpdates';\n","import type { PropsWithChildren } from 'react';\n\nimport { StreamSearchContext } from '../contexts/StreamSearchContext';\nimport type { SearchController } from '../../../common/search';\n\n/**\n * The props for the StreamSearch component. It accepts a `SearchController` instance.\n */\nexport type StreamSearchProps = {\n searchController: SearchController | undefined;\n};\n\nexport const StreamSearch = ({\n searchController,\n children,\n}: PropsWithChildren<StreamSearchProps>) => {\n return (\n <StreamSearchContext.Provider value={searchController}>\n {children}\n </StreamSearchContext.Provider>\n );\n};\n\nStreamSearch.displayName = 'StreamSearch';\n","import type { PropsWithChildren } from 'react';\n\nimport { StreamSearchResultsContext } from '../contexts/StreamSearchResultsContext';\nimport type { SearchSource } from '../../../common/search';\n\n/**\n * The props for the StreamSearchResults component. It accepts a `SearchSource` instance.\n */\nexport type StreamSearchResultsProps = {\n source: SearchSource;\n};\n\nexport const StreamSearchResults = ({\n source,\n children,\n}: PropsWithChildren<StreamSearchResultsProps>) => {\n return (\n <StreamSearchResultsContext.Provider value={source}>\n {children}\n </StreamSearchResultsContext.Provider>\n );\n};\n\nStreamSearchResults.displayName = 'StreamSearchResults';\n"],"names":["useState","useEffect","FeedsClient","createContext","useContext","useStateStore","selector","use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AAA,EACA;AACF,MAA8D;AAC5D,wCACG,sCAAsC,UAAtC,EAA+C,OAAO,0BACpD,UACH;AAEJ;AAEA,+BAA+B,cAAc;ACXtC,MAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA;AACF,MAA4C;AAC1C,wCACG,oBAAoB,UAApB,EAA6B,OAAO,kBAClC,UACH;AAEJ;AAEA,aAAa,cAAc;ACXpB,MAAM,sBAAsB,CAAC;AAAA,EAClC;AAAA,EACA;AACF,MAAmD;AACjD,wCACG,2BAA2B,UAA3B,EAAoC,OAAO,QACzC,UACH;AAEJ;AAEA,oBAAoB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"react-bindings.js","sources":["../../src/bindings/react/hooks/useCreateFeedsClient.ts","../../src/bindings/react/contexts/StreamFeedsContext.tsx","../../src/bindings/react/hooks/client-state-hooks/useClientConnectedUser.ts","../../src/bindings/react/hooks/client-state-hooks/useWsConnectionState.ts","../../src/bindings/react/contexts/StreamFeedContext.tsx","../../src/bindings/react/hooks/internal/useStableCallback.ts","../../src/bindings/react/hooks/feed-state-hooks/useFeedActivities.ts","../../src/bindings/react/hooks/feed-state-hooks/useComments.ts","../../src/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.ts","../../src/bindings/react/hooks/feed-state-hooks/useFollowers.ts","../../src/bindings/react/hooks/feed-state-hooks/useFollowing.ts","../../src/bindings/react/hooks/feed-state-hooks/useFeedMetadata.ts","../../src/bindings/react/hooks/feed-state-hooks/useOwnFollows.ts","../../src/bindings/react/hooks/feed-state-hooks/useNotificationStatus.ts","../../src/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.ts","../../src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.ts","../../src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.ts","../../src/bindings/react/contexts/StreamActivityWithStateUpdatesContext.tsx","../../src/bindings/react/hooks/feed-state-hooks/useActivityComments.ts","../../src/bindings/react/hooks/feed-state-hooks/useOwnFollowings.ts","../../src/bindings/react/hooks/feed-state-hooks/useMembers.ts","../../src/bindings/react/contexts/StreamSearchResultsContext.tsx","../../src/bindings/react/hooks/search-state-hooks/useSearchResult.ts","../../src/bindings/react/contexts/StreamSearchContext.tsx","../../src/bindings/react/hooks/search-state-hooks/useSearchQuery.ts","../../src/bindings/react/hooks/search-state-hooks/useSearchSources.ts","../../src/bindings/react/wrappers/StreamFeeds.tsx","../../src/bindings/react/wrappers/StreamFeed.tsx","../../src/bindings/react/wrappers/StreamActivityWithStateUpdates.tsx","../../src/bindings/react/wrappers/StreamSearch.tsx","../../src/bindings/react/wrappers/StreamSearchResults.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nimport { FeedsClient } from '../../../feeds-client';\nimport type { TokenOrProvider } from '../../../types';\nimport type { CreateGuestResponse, UserRequest } from '../../../gen/models';\nimport type { FeedsClientOptions } from '../../../common/types';\n\n/**\n * A React hook to create, connect and return an instance of `FeedsClient`.\n */\nexport const useCreateFeedsClient = ({\n apiKey,\n tokenOrProvider,\n userData: userDataOrAnonymous,\n options,\n}: {\n apiKey: string;\n tokenOrProvider?: TokenOrProvider | 'guest';\n userData: UserRequest | 'anonymous';\n options?: FeedsClientOptions;\n}) => {\n const userData =\n userDataOrAnonymous === 'anonymous' ? undefined : userDataOrAnonymous;\n\n if (userDataOrAnonymous !== 'anonymous' && !tokenOrProvider) {\n throw new Error(\n 'Token provider can only be omitted when connecting anonymous user. If you want to connect as a guest, provide \"guest\" instead of a token provider.',\n );\n }\n\n const [client, setClient] = useState<FeedsClient | null>(null);\n const [error, setError] = useState<Error | null>(null);\n const [cachedUserData, setCachedUserData] = useState(userData);\n\n const [cachedOptions] = useState(options);\n\n if (error) {\n throw error;\n }\n\n if (userData?.id !== cachedUserData?.id) {\n setCachedUserData(userData);\n }\n\n useEffect(() => {\n const _client = new FeedsClient(apiKey, cachedOptions);\n\n let connectionPromise: Promise<void | CreateGuestResponse>;\n if (!cachedUserData) {\n connectionPromise = _client.connectAnonymous();\n } else if (tokenOrProvider === 'guest') {\n connectionPromise = _client.connectGuest({\n user: cachedUserData,\n });\n } else {\n connectionPromise = _client.connectUser(cachedUserData, tokenOrProvider!);\n }\n\n connectionPromise = connectionPromise\n .then(() => {\n setError(null);\n })\n .catch((err) => {\n setError(err);\n });\n\n setClient(_client);\n\n return () => {\n setClient(null);\n connectionPromise\n .then(() => {\n setError(null);\n return _client.disconnectUser();\n })\n .catch((err) => {\n setError(err);\n });\n };\n }, [apiKey, cachedUserData, cachedOptions, tokenOrProvider]);\n\n return client;\n};\n","import { createContext, useContext } from 'react';\n\nimport type { FeedsClient } from '../../../feeds-client';\n\nexport const StreamFeedsContext = createContext<FeedsClient | undefined>(undefined);\n\n/**\n * The props for the StreamFeedsProvider component.\n */\nexport type StreamFeedsContextProps = {\n /**\n * The client instance to provide to the component tree.\n */\n client: FeedsClient;\n};\n\n/**\n * Hook to access the nearest FeedsClient instance.\n */\nexport const useFeedsClient = () => {\n return useContext(StreamFeedsContext);\n};\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedsClient } from '../../contexts/StreamFeedsContext';\nimport type { FeedsClientState } from '../../../../feeds-client';\n\n/**\n * A React hook that returns the currently connected user on a `FeedsClient` instance and null otherwise.\n */\nexport const useClientConnectedUser = () => {\n const client = useFeedsClient();\n\n const { user } = useStateStore(client?.state, selector) ?? {};\n\n return user;\n};\n\nconst selector = (nextState: FeedsClientState) => ({\n user: nextState.connected_user,\n});\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedsClient } from '../../contexts/StreamFeedsContext';\nimport type { FeedsClientState } from '../../../../feeds-client';\n\n/**\n * A React hook that returns the websocket connection state of `FeedsClient`.\n */\nexport const useWsConnectionState = () => {\n const client = useFeedsClient();\n\n const { is_healthy } = useStateStore(client?.state, selector) ?? {}\n\n return { is_healthy };\n};\n\nconst selector = (nextState: FeedsClientState) => ({\n is_healthy: nextState.is_ws_connection_healthy,\n});\n","import { createContext, useContext } from 'react';\n\nimport type { Feed } from '../../../feed';\n\nexport const StreamFeedContext = createContext<Feed | undefined>(undefined);\n\n/**\n * The props for the StreamFeedProvider component.\n */\nexport type StreamFeedContextProps = {\n feed: Feed;\n};\n\n/**\n * Hook to access the nearest Feed instance.\n */\nexport const useFeedContext = () => {\n return useContext(StreamFeedContext);\n};\n","import { useCallback, useRef } from 'react';\n\nexport type StableCallback<A extends unknown[], R> = (...args: A) => R;\n\n/**\n * A utility hook implementing a stable callback. It takes in an unstable method that\n * is supposed to be invoked somewhere deeper in the DOM tree without making it\n * change its reference every time the parent component rerenders. It will also return\n * the value of the callback if it does return one.\n * A common use-case would be having a function whose invocation depends on state\n * somewhere high up in the DOM tree and wanting to use the same function deeper\n * down, for example in a leaf node and simply using useCallback results in\n * cascading dependency hell. If we wrap it in useStableCallback, we would be able\n * to:\n * - Use the same function as a dependency of another hook (since it is stable)\n * - Still invoke it and get the latest state\n *\n * **Caveats:**\n * - Never wrap a function that is supposed to return a React.ReactElement in\n * useStableCallback, since React will not know that the DOM needs to be updated\n * whenever the callback value changes (for example, renderItem from FlatList must\n * never be wrapped in this hook)\n * - Always prefer using a standard useCallback/stable function wherever possible\n * (the purpose of useStableCallback is to bridge the gap between top level contexts\n * and cascading rereders in downstream components - **not** as an escape hatch)\n * @param callback - the callback we want to stabilize\n */\nexport const useStableCallback = <A extends unknown[], R>(\n callback: StableCallback<A, R>,\n): StableCallback<A, R> => {\n const ref = useRef(callback);\n ref.current = callback;\n\n return useCallback<StableCallback<A, R>>((...args) => {\n return ref.current(...args);\n }, []);\n};\n","import { useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { useStableCallback } from '../internal';\nimport type { Feed, FeedState } from '../../../../feed';\n\n/**\n * A React hook that returns a reactive object containing the current activities,\n * loading state and whether there is a next page to paginate to or not.\n */\nexport const useFeedActivities = (feedFromProps?: Feed) => {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const data = useStateStore(feed?.state, selector);\n\n const loadNextPage = useStableCallback(async () => {\n if (!feed || !data?.has_next_page || data?.is_loading) {\n return;\n }\n\n await feed.getNextPage();\n });\n\n return useMemo(() => ({ ...data, loadNextPage }), [data, loadNextPage]);\n};\n\nconst selector = ({\n is_loading_activities,\n next,\n activities = [],\n}: FeedState) => ({\n is_loading: is_loading_activities,\n has_next_page: typeof next !== 'undefined',\n activities,\n});\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { checkHasAnotherPage, isCommentResponse } from '../../../../utils';\nimport type { ActivityResponse, CommentResponse } from '../../../../gen/models';\nimport type { Feed, FeedState } from '../../../../feed';\nimport type { CommentParent } from '../../../../types';\n\ntype UseCommentsReturnType<T extends ActivityResponse | CommentResponse> = {\n comments: NonNullable<\n FeedState['comments_by_entity_id'][T['id']]\n >['comments'];\n comments_pagination: NonNullable<\n FeedState['comments_by_entity_id'][T['id']]\n >['pagination'];\n has_next_page: boolean;\n is_loading_next_page: boolean;\n loadNextPage: (\n request?: T extends CommentResponse\n ? Parameters<Feed['loadNextPageCommentReplies']>[1]\n : Parameters<Feed['loadNextPageActivityComments']>[1],\n ) => Promise<void>;\n};\n\n/**\n * @deprecated Use `useActivityComments` instead.\n * @param\n */\nexport function useComments<T extends CommentParent>(_: {\n feed: Feed;\n parent: T;\n}): UseCommentsReturnType<T>;\nexport function useComments<T extends CommentParent>(_: {\n feed?: Feed;\n parent: T;\n}): UseCommentsReturnType<T> | undefined;\nexport function useComments<T extends CommentParent>({\n feed: feedFromProps,\n parent,\n}: {\n feed?: Feed;\n /**\n * The parent (activity or comment) for which to fetch comments.\n */\n parent: T;\n}) {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const selector = useCallback(\n (state: FeedState) => ({\n comments: state.comments_by_entity_id?.[parent.id]?.comments,\n comments_pagination: state.comments_by_entity_id?.[parent.id]?.pagination,\n }),\n [parent.id],\n );\n\n const data = useStateStore(feed?.state, selector);\n\n const loadNextPage = useMemo<\n UseCommentsReturnType<T>['loadNextPage'] | undefined\n >(() => {\n if (!feed) return undefined;\n\n return (request) => {\n if (isCommentResponse(parent)) {\n return feed.loadNextPageCommentReplies(parent, request);\n } else {\n return feed.loadNextPageActivityComments(parent, request);\n }\n };\n }, [feed, parent]);\n\n return useMemo(() => {\n if (!data) {\n return undefined;\n }\n\n return {\n ...data,\n has_next_page: checkHasAnotherPage(\n data.comments,\n data.comments_pagination?.next,\n ),\n is_loading_next_page:\n data?.comments_pagination?.loading_next_page ?? false,\n loadNextPage,\n };\n }, [data, loadNextPage]);\n}\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\nimport type { FeedOwnCapability } from '../../../../gen/models';\nimport { useFeedsClient } from '../../contexts/StreamFeedsContext';\n\nconst stableEmptyArray: readonly FeedOwnCapability[] = [];\n\nconst selector = (currentState: FeedState) => {\n return {\n feedOwnCapabilities: currentState.own_capabilities ?? stableEmptyArray,\n };\n};\n\nexport const useOwnCapabilities = (feedFromProps?: Feed | string) => {\n const client = useFeedsClient();\n const feedFromContext = useFeedContext();\n let feed = feedFromProps ?? feedFromContext;\n if (typeof feed === 'string') {\n const [groupId, id] = feed.split(':');\n feed = groupId && id ? client?.feed(groupId, id) : undefined;\n }\n\n const { feedOwnCapabilities = stableEmptyArray } =\n useStateStore(feed?.state, selector) ?? {};\n\n return feedOwnCapabilities;\n};\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\nimport { checkHasAnotherPage } from '../../../../utils';\n\nconst selector = ({\n follower_count,\n followers,\n followers_pagination,\n}: FeedState) => ({\n follower_count,\n followers,\n followers_pagination,\n});\n\ntype UseFollowersReturnType = ReturnType<typeof selector> & {\n is_loading_next_page: boolean;\n has_next_page: boolean;\n loadNextPage: (\n ...options: Parameters<Feed['loadNextPageFollowers']>\n ) => Promise<void>;\n};\n\nexport function useFollowers(feed: Feed): UseFollowersReturnType;\nexport function useFollowers(feed?: Feed): UseFollowersReturnType | undefined;\nexport function useFollowers(feedFromProps?: Feed) {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const data = useStateStore(feed?.state, selector);\n\n const loadNextPage = useCallback(\n (...options: Parameters<Feed['loadNextPageFollowers']>) =>\n feed?.loadNextPageFollowers(...options),\n [feed],\n );\n\n return useMemo(() => {\n if (!data) {\n return undefined;\n }\n\n return {\n ...data,\n is_loading_next_page:\n data.followers_pagination?.loading_next_page ?? false,\n has_next_page: checkHasAnotherPage(\n data.followers,\n data.followers_pagination?.next,\n ),\n loadNextPage,\n };\n }, [data, loadNextPage]);\n}\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { checkHasAnotherPage } from '../../../../utils';\nimport type { Feed, FeedState } from '../../../../feed';\n\nconst selector = ({\n following_count,\n following,\n following_pagination,\n}: FeedState) => ({\n following_count,\n following,\n following_pagination,\n});\n\ntype UseFollowingReturnType = ReturnType<typeof selector> & {\n is_loading_next_page: boolean;\n has_next_page: boolean;\n loadNextPage: (\n ...options: Parameters<Feed['loadNextPageFollowers']>\n ) => Promise<void>;\n};\n\nexport function useFollowing(feed: Feed): UseFollowingReturnType;\nexport function useFollowing(feed?: Feed): UseFollowingReturnType | undefined;\nexport function useFollowing(feedFromProps?: Feed) {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const data = useStateStore(feed?.state, selector);\n\n const loadNextPage = useCallback(\n (...options: Parameters<Feed['loadNextPageFollowing']>) =>\n feed?.loadNextPageFollowing(...options),\n [feed],\n );\n\n return useMemo(() => {\n if (!data) {\n return undefined;\n }\n\n return {\n ...data,\n is_loading_next_page:\n data.following_pagination?.loading_next_page ?? false,\n has_next_page: checkHasAnotherPage(\n data.following,\n data.following_pagination?.next,\n ),\n loadNextPage,\n };\n }, [data, loadNextPage]);\n}\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\n\n/**\n * A React hook that returns a reactive object containing some often used\n * metadata for a feed.\n */\nexport const useFeedMetadata = (feedFromProps?: Feed) => {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n return useStateStore(feed?.state, selector);\n};\n\nconst selector = ({\n follower_count = 0,\n following_count = 0,\n created_by,\n created_at,\n updated_at,\n}: FeedState) => ({\n created_by,\n follower_count,\n following_count,\n created_at,\n updated_at,\n});\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\n\n/**\n * A React hook that returns a reactive array of feeds that the current user\n * owns and are following the respective feed that we are observing.\n */\nexport const useOwnFollows = (feedFromProps?: Feed) => {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n return useStateStore(feed?.state, selector);\n};\n\nconst selector = ({ own_follows }: FeedState) => ({\n own_follows,\n});\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\nimport type { NotificationStatusResponse } from '../../../../gen/models';\n\nconst selector = ({ notification_status }: FeedState) =>\n ({\n unread: notification_status?.unread ?? 0,\n unseen: notification_status?.unseen ?? 0,\n last_read_at: notification_status?.last_read_at,\n last_seen_at: notification_status?.last_seen_at,\n read_activities: notification_status?.read_activities,\n seen_activities: notification_status?.seen_activities,\n }) satisfies NotificationStatusResponse;\n\ntype UseNotificationStatusReturnType = ReturnType<typeof selector>;\n\nexport function useNotificationStatus(\n feed: Feed,\n): UseNotificationStatusReturnType;\nexport function useNotificationStatus(\n feed?: Feed,\n): UseNotificationStatusReturnType | undefined;\nexport function useNotificationStatus(feedFromProps?: Feed) {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n return useStateStore(feed?.state, selector);\n}\n","import { useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { useStableCallback } from '../internal';\nimport type { Feed, FeedState } from '../../../../feed';\n\nconst selector = ({\n is_loading_activities,\n next,\n aggregated_activities = [],\n}: FeedState) => ({\n is_loading: is_loading_activities,\n has_next_page: typeof next !== 'undefined',\n aggregated_activities,\n});\n\ntype UseAggregatedActivitiesReturnType = ReturnType<typeof selector> & {\n loadNextPage: () => Promise<void>;\n};\n\n/**\n * A React hook that returns a reactive object containing the current aggregated activities,\n * loading state and whether there is a next page to paginate to or not.\n */\nexport function useAggregatedActivities(\n feedFromProps: Feed,\n): UseAggregatedActivitiesReturnType;\nexport function useAggregatedActivities(\n feedFromProps?: Feed,\n): UseAggregatedActivitiesReturnType | undefined;\nexport function useAggregatedActivities(feedFromProps?: Feed) {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const data = useStateStore(feed?.state, selector);\n\n const loadNextPage = useStableCallback(async () => {\n if (!feed || !data?.has_next_page || data?.is_loading) {\n return;\n }\n\n await feed.getNextPage();\n });\n\n return useMemo(\n () => (data ? { ...data, loadNextPage } : undefined),\n [data, loadNextPage],\n );\n}\n","import { useMemo } from 'react';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { useNotificationStatus } from './useNotificationStatus';\nimport type { Feed } from '../../../../feed';\nimport type { AggregatedActivityResponse } from '../../../../gen/models';\n\nexport const useIsAggregatedActivityRead = ({\n feed: feedFromProps,\n aggregatedActivity,\n}: {\n feed?: Feed;\n aggregatedActivity: AggregatedActivityResponse;\n}) => {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const { read_activities: readActivities, last_read_at: lastReadAt } =\n useNotificationStatus(feed) ?? {};\n\n const group = aggregatedActivity.group;\n\n return useMemo(\n () =>\n (lastReadAt &&\n aggregatedActivity.updated_at.getTime() <= lastReadAt.getTime()) ||\n (readActivities ?? []).includes(group),\n [lastReadAt, aggregatedActivity.updated_at, readActivities, group],\n );\n};\n","import { useMemo } from 'react';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { useNotificationStatus } from './useNotificationStatus';\nimport type { Feed } from '../../../../feed';\nimport type { AggregatedActivityResponse } from '../../../../gen/models';\n\nexport const useIsAggregatedActivitySeen = ({\n feed: feedFromProps,\n aggregatedActivity,\n}: {\n feed?: Feed;\n aggregatedActivity: AggregatedActivityResponse;\n}) => {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const { seen_activities: seenActivities, last_seen_at: lastSeenAt } =\n useNotificationStatus(feed) ?? {};\n\n const group = aggregatedActivity.group;\n\n return useMemo(\n () =>\n (lastSeenAt &&\n aggregatedActivity.updated_at.getTime() < lastSeenAt.getTime()) ||\n (seenActivities ?? []).includes(group),\n [lastSeenAt, aggregatedActivity.updated_at, seenActivities, group],\n );\n};\n","import { createContext, useContext } from 'react';\n\nimport type { ActivityWithStateUpdates } from '../../../activity-with-state-updates/activity-with-state-updates';\n\nexport const StreamActivityWithStateUpdatesContext = createContext<ActivityWithStateUpdates | undefined>(undefined);\n\n/**\n * The props for the StreamActivityWithStateUpdatesProvider component.\n */\nexport type StreamActivityWithStateUpdatesContextProps = {\n activityWithStateUpdates: ActivityWithStateUpdates;\n};\n\n/**\n * Hook to access the nearest ActivityWithStateUpdates instance.\n */\nexport const useActivityWithStateUpdatesContext = () => {\n return useContext(StreamActivityWithStateUpdatesContext);\n};\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\nimport type { StateStore } from '@stream-io/state-store';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport { checkHasAnotherPage } from '../../../../utils';\nimport type { Feed, FeedState } from '../../../../feed';\nimport type { ActivityState, ActivityWithStateUpdates } from '../../../../activity-with-state-updates/activity-with-state-updates';\nimport type { ActivityResponse, CommentResponse } from '../../../../gen/models';\nimport { useActivityWithStateUpdatesContext } from '../../contexts/StreamActivityWithStateUpdatesContext';\n\nconst canLoadComments = (\n feedOrActivity: Feed | ActivityResponse | ActivityWithStateUpdates,\n): feedOrActivity is ActivityWithStateUpdates | Feed => {\n return (\n 'loadNextPageCommentReplies' in feedOrActivity &&\n 'loadNextPageActivityComments' in feedOrActivity\n );\n};\n\ntype UseCommentsReturnType<T extends ActivityResponse | CommentResponse> = {\n comments: NonNullable<\n FeedState['comments_by_entity_id'][T['id']]\n >['comments'];\n comments_pagination: NonNullable<\n FeedState['comments_by_entity_id'][T['id']]\n >['pagination'];\n has_next_page: boolean;\n is_loading_next_page: boolean;\n loadNextPage: (\n request?: T extends CommentResponse\n ? Parameters<Feed['loadNextPageCommentReplies']>[1]\n : Parameters<Feed['loadNextPageActivityComments']>[1],\n ) => Promise<void>;\n};\n\nexport function useActivityComments({\n feed: feedFromProps,\n parentComment,\n activity: activityFromProps,\n}: {\n feed?: Feed;\n parentComment?: CommentResponse;\n activity?: ActivityResponse | ActivityWithStateUpdates;\n} = {}) {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n const activityFromContext = useActivityWithStateUpdatesContext();\n const activity = activityFromProps ?? activityFromContext;\n const feedOrActivity = (activity && canLoadComments(activity)) ? activity : feed;\n\n if (!feedOrActivity) {\n throw new Error('Feed or activity is required');\n }\n\n if (!canLoadComments(feedOrActivity)) {\n throw new Error('Feed or activity does not support loading comments');\n }\n\n if (!(activity || parentComment)) {\n throw new Error('Activity or parent comment is required');\n }\n\n const entityId = parentComment?.id ?? activity?.id ?? '';\n const selector = useCallback(\n (state: FeedState | ActivityState) => ({\n comments: state.comments_by_entity_id?.[entityId]?.comments,\n comments_pagination: state.comments_by_entity_id?.[entityId]?.pagination,\n }),\n [entityId],\n );\n\n const data = useStateStore(\n feedOrActivity.state as StateStore<FeedState | ActivityState>,\n selector,\n );\n\n const loadNextPage = useCallback<\n UseCommentsReturnType<ActivityResponse | CommentResponse>['loadNextPage']\n >(\n (request) => {\n if (parentComment) {\n return feedOrActivity.loadNextPageCommentReplies(\n parentComment,\n request,\n );\n } else {\n if (activity && canLoadComments(activity)) {\n return activity.loadNextPageActivityComments(request);\n } else if (feed) {\n return feed.loadNextPageActivityComments(activity?.id ?? '', request);\n } else {\n throw new Error('Activity or feed is required');\n }\n }\n },\n [feedOrActivity, feed, parentComment, activity],\n );\n\n return useMemo(() => {\n return {\n ...data,\n has_next_page: checkHasAnotherPage(\n data.comments,\n data.comments_pagination?.next,\n ),\n is_loading_next_page:\n data?.comments_pagination?.loading_next_page ?? false,\n loadNextPage,\n };\n }, [data, loadNextPage]);\n}\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\n\n/**\n * A React hook that returns a reactive array of feeds that the feeds's owner is following and is owned by the current user.\n */\nexport const useOwnFollowings = (feedFromProps?: Feed) => {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n return useStateStore(feed?.state, selector);\n};\n\nconst selector = ({ own_followings }: FeedState) => ({\n own_followings,\n});\n","import { useCallback, useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\nimport { useFeedContext } from '../../contexts/StreamFeedContext';\nimport type { Feed, FeedState } from '../../../../feed';\nimport { checkHasAnotherPage } from '../../../../utils';\n\nconst selector = ({\n member_count,\n members,\n member_pagination,\n}: FeedState) => ({\n member_count,\n members,\n member_pagination,\n});\n\ntype UseMembersReturnType = ReturnType<typeof selector> & {\n is_loading_next_page: boolean;\n has_next_page: boolean;\n loadNextPage: (\n ...options: Parameters<Feed['loadNextPageMembers']>\n ) => Promise<void>;\n};\n\nexport function useMembers(feed: Feed): UseMembersReturnType;\nexport function useMembers(feed?: Feed): UseMembersReturnType | undefined;\nexport function useMembers(feedFromProps?: Feed) {\n const feedFromContext = useFeedContext();\n const feed = feedFromProps ?? feedFromContext;\n\n const data = useStateStore(feed?.state, selector);\n\n const loadNextPage = useCallback(\n (...options: Parameters<Feed['loadNextPageMembers']>) =>\n feed?.loadNextPageMembers(...options),\n [feed],\n );\n\n return useMemo(() => {\n if (!data) {\n return undefined;\n }\n\n return {\n ...data,\n is_loading_next_page:\n data.member_pagination?.loading_next_page ?? false,\n has_next_page: checkHasAnotherPage(\n data.members,\n data.member_pagination?.next,\n ),\n loadNextPage,\n };\n }, [data, loadNextPage]);\n}\n","import { createContext, useContext } from 'react';\n\nimport type { SearchSource } from '../../../common/search';\n\nexport const StreamSearchResultsContext = createContext<\n SearchSource | undefined\n>(undefined);\n\n/**\n * The props for the StreamSearchResultsProvider component.\n */\nexport type StreamSearchResultsContextProps = {\n source: SearchSource;\n};\n\n/**\n * Hook to access the nearest SearchSource instance.\n */\nexport const useSearchResultsContext = () => {\n return useContext(StreamSearchResultsContext);\n};\n","import { useMemo } from 'react';\nimport { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useSearchResultsContext } from '../../contexts/StreamSearchResultsContext';\nimport { useStableCallback } from '../internal';\nimport type { SearchSourceState } from '../../../../common/types';\nimport type { SearchSource } from '../../../../common/search';\n\nexport const useSearchResult = (sourceFromProps?: SearchSource) => {\n const sourceFromContext = useSearchResultsContext();\n const source = sourceFromProps ?? sourceFromContext;\n\n const { items, error, isLoading, hasNext } =\n useStateStore(source?.state, selector) ?? {};\n\n const loadMore = useStableCallback(async () => {\n if (hasNext) {\n source?.search();\n }\n });\n\n return useMemo(\n () => ({ items, error, isLoading, hasNext, loadMore }),\n [error, hasNext, isLoading, items, loadMore],\n );\n};\n\nconst selector = ({\n items,\n isLoading,\n hasNext,\n lastQueryError,\n}: SearchSourceState) => ({\n items,\n isLoading,\n hasNext,\n error: lastQueryError,\n});\n","import { createContext, useContext } from 'react';\n\nimport type { SearchController } from '../../../common/search';\n\nexport const StreamSearchContext = createContext<SearchController | undefined>(undefined);\n\n/**\n * The props for the StreamSearchProvider component.\n */\nexport type StreamSearchContextProps = {\n searchController: SearchController;\n};\n\n/**\n * Hook to access the nearest SearchController instance.\n */\nexport const useSearchContext = () => {\n return useContext(StreamSearchContext);\n};\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport type {\n SearchController,\n SearchControllerState,\n} from '../../../../common/search';\nimport { useSearchContext } from '../../contexts/StreamSearchContext';\n\nexport const useSearchQuery = (controllerFromProps?: SearchController) => {\n const controllerFromState = useSearchContext();\n const controller = controllerFromProps ?? controllerFromState;\n\n return useStateStore(controller?.state, selector);\n};\n\nconst selector = ({ searchQuery }: SearchControllerState) => ({\n searchQuery,\n});\n","import { useStateStore } from '@stream-io/state-store/react-bindings';\n\nimport { useSearchContext } from '../../contexts/StreamSearchContext';\nimport type { SearchController, SearchControllerState } from '../../../../common/search';\n\nexport const useSearchSources = (controllerFromProps?: SearchController) => {\n const controllerFromState = useSearchContext();\n const controller = controllerFromProps ?? controllerFromState;\n\n return useStateStore(controller?.state, selector);\n};\n\nconst selector = ({ sources }: SearchControllerState) => ({\n sources,\n});\n","import type { PropsWithChildren } from 'react';\nimport { StreamFeedsContext } from '../contexts/StreamFeedsContext';\nimport type { StreamFeedsContextProps } from '../contexts/StreamFeedsContext';\n\nexport const StreamFeeds = ({ client, children }: PropsWithChildren<StreamFeedsContextProps>) => {\n return (\n <StreamFeedsContext.Provider value={client}>\n {children}\n </StreamFeedsContext.Provider>\n );\n};\n\nStreamFeeds.displayName = 'StreamFeeds';\n","import type { PropsWithChildren } from 'react';\n\nimport { StreamFeedContext } from '../contexts/StreamFeedContext';\nimport type { Feed } from '../../../feed';\n\n/**\n * The props for the StreamFeed component. It accepts a `Feed` instance.\n */\nexport type StreamFeedProps = {\n feed: Feed;\n};\n\nexport const StreamFeed = ({\n feed,\n children,\n}: PropsWithChildren<StreamFeedProps>) => {\n return (\n <StreamFeedContext.Provider value={feed}>\n {children}\n </StreamFeedContext.Provider>\n );\n};\n\nStreamFeed.displayName = 'StreamFeed';\n","import type { PropsWithChildren } from 'react';\n\nimport { StreamActivityWithStateUpdatesContext } from '../contexts/StreamActivityWithStateUpdatesContext';\nimport type { ActivityWithStateUpdates } from '../../../activity-with-state-updates/activity-with-state-updates';\n\n/**\n * The props for the StreamActivityWithStateUpdates component. It accepts an `ActivityWithStateUpdates` instance.\n */\nexport type StreamActivityWithStateUpdatesProps = {\n activityWithStateUpdates: ActivityWithStateUpdates;\n};\n\nexport const StreamActivityWithStateUpdates = ({\n activityWithStateUpdates,\n children,\n}: PropsWithChildren<StreamActivityWithStateUpdatesProps>) => {\n return (\n <StreamActivityWithStateUpdatesContext.Provider value={activityWithStateUpdates}>\n {children}\n </StreamActivityWithStateUpdatesContext.Provider>\n );\n};\n\nStreamActivityWithStateUpdates.displayName = 'StreamActivityWithStateUpdates';\n","import type { PropsWithChildren } from 'react';\n\nimport { StreamSearchContext } from '../contexts/StreamSearchContext';\nimport type { SearchController } from '../../../common/search';\n\n/**\n * The props for the StreamSearch component. It accepts a `SearchController` instance.\n */\nexport type StreamSearchProps = {\n searchController: SearchController | undefined;\n};\n\nexport const StreamSearch = ({\n searchController,\n children,\n}: PropsWithChildren<StreamSearchProps>) => {\n return (\n <StreamSearchContext.Provider value={searchController}>\n {children}\n </StreamSearchContext.Provider>\n );\n};\n\nStreamSearch.displayName = 'StreamSearch';\n","import type { PropsWithChildren } from 'react';\n\nimport { StreamSearchResultsContext } from '../contexts/StreamSearchResultsContext';\nimport type { SearchSource } from '../../../common/search';\n\n/**\n * The props for the StreamSearchResults component. It accepts a `SearchSource` instance.\n */\nexport type StreamSearchResultsProps = {\n source: SearchSource;\n};\n\nexport const StreamSearchResults = ({\n source,\n children,\n}: PropsWithChildren<StreamSearchResultsProps>) => {\n return (\n <StreamSearchResultsContext.Provider value={source}>\n {children}\n </StreamSearchResultsContext.Provider>\n );\n};\n\nStreamSearchResults.displayName = 'StreamSearchResults';\n"],"names":["useState","useEffect","FeedsClient","createContext","useContext","useStateStore","selector","useRef","useCallback","useMemo","isCommentResponse","checkHasAnotherPage"],"mappings":";;;;;;AAUO,MAAM,uBAAuB,CAAC;AAAA,EACnC;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV;AACF,MAKM;AACJ,QAAM,WACJ,wBAAwB,cAAc,SAAY;AAEpD,MAAI,wBAAwB,eAAe,CAAC,iBAAiB;AAC3D,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAEA,QAAM,CAAC,QAAQ,SAAS,IAAIA,MAAAA,SAA6B,IAAI;AAC7D,QAAM,CAAC,OAAO,QAAQ,IAAIA,MAAAA,SAAuB,IAAI;AACrD,QAAM,CAAC,gBAAgB,iBAAiB,IAAIA,MAAAA,SAAS,QAAQ;AAE7D,QAAM,CAAC,aAAa,IAAIA,MAAAA,SAAS,OAAO;AAExC,MAAI,OAAO;AACT,UAAM;AAAA,EACR;AAEA,MAAI,UAAU,OAAO,gBAAgB,IAAI;AACvC,sBAAkB,QAAQ;AAAA,EAC5B;AAEAC,QAAAA,UAAU,MAAM;AACd,UAAM,UAAU,IAAIC,wBAAY,QAAQ,aAAa;AAErD,QAAI;AACJ,QAAI,CAAC,gBAAgB;AACnB,0BAAoB,QAAQ,iBAAA;AAAA,IAC9B,WAAW,oBAAoB,SAAS;AACtC,0BAAoB,QAAQ,aAAa;AAAA,QACvC,MAAM;AAAA,MAAA,CACP;AAAA,IACH,OAAO;AACL,0BAAoB,QAAQ,YAAY,gBAAgB,eAAgB;AAAA,IAC1E;AAEA,wBAAoB,kBACjB,KAAK,MAAM;AACV,eAAS,IAAI;AAAA,IACf,CAAC,EACA,MAAM,CA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ACzC,UACH;AAEJ;AAEA,oBAAoB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/es/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { StateStore } from "@stream-io/state-store";
2
2
  export * from "@stream-io/state-store";
3
- import { d as debounce } from "../feeds-client-CSg4hlZ4.mjs";
4
- import { A, C, a, F, S, b, c, n, m, k, g, e, h, f, j, i, r, s, u, l } from "../feeds-client-CSg4hlZ4.mjs";
3
+ import { d as debounce } from "../feeds-client-ykIZW9Hi.mjs";
4
+ import { A, C, a, F, S, b, c, n, m, k, g, e, h, f, j, i, r, s, u, l } from "../feeds-client-ykIZW9Hi.mjs";
5
5
  import { LogLevelEnum } from "@stream-io/logger";
6
6
  const ownFeedFields = ["own_capabilities", "own_follows", "own_membership"];
7
7
  const ChannelOwnCapability = {