@stream-io/feeds-client 0.3.51 → 1.1.0
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.
- package/CHANGELOG.md +21 -0
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react-bindings.js +5 -19
- package/dist/cjs/react-bindings.js.map +1 -1
- package/dist/es/index.mjs +15 -14
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/react-bindings.mjs +5 -19
- package/dist/es/react-bindings.mjs.map +1 -1
- package/dist/{feeds-client-B4zeBggL.js → feeds-client-C1c6lcS3.js} +705 -214
- package/dist/feeds-client-C1c6lcS3.js.map +1 -0
- package/dist/{feeds-client-DeAqnd1a.mjs → feeds-client-jtUTE4AC.mjs} +711 -220
- package/dist/feeds-client-jtUTE4AC.mjs.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/types/activity-with-state-updates/activity-with-state-updates.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.d.ts +6 -2
- package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.d.ts +6 -2
- package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.d.ts.map +1 -1
- package/dist/types/feed/activity-filter.d.ts +11 -0
- package/dist/types/feed/activity-filter.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/activity/handle-activity-added.d.ts +3 -2
- package/dist/types/feed/event-handlers/activity/handle-activity-added.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity/handle-activity-deleted.d.ts +3 -2
- package/dist/types/feed/event-handlers/activity/handle-activity-deleted.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity/handle-activity-feedback.d.ts +5 -0
- package/dist/types/feed/event-handlers/activity/handle-activity-feedback.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity/handle-activity-pinned.d.ts +3 -2
- package/dist/types/feed/event-handlers/activity/handle-activity-pinned.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity/handle-activity-unpinned.d.ts +3 -2
- package/dist/types/feed/event-handlers/activity/handle-activity-unpinned.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity/handle-activity-updated.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity/index.d.ts +3 -1
- package/dist/types/feed/event-handlers/activity/index.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity-updater.d.ts +1 -0
- package/dist/types/feed/event-handlers/activity-updater.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/add-aggregated-activities-to-state.d.ts +1 -1
- package/dist/types/feed/event-handlers/add-aggregated-activities-to-state.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-added.d.ts +6 -5
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-added.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-deleted.d.ts +6 -5
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-deleted.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-updated.d.ts +6 -5
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-updated.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/comment/handle-comment-updated.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/feed/handle-feed-deleted.d.ts +4 -0
- package/dist/types/feed/event-handlers/feed/handle-feed-deleted.d.ts.map +1 -0
- package/dist/types/feed/event-handlers/feed/handle-feed-updated.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/feed/index.d.ts +1 -0
- package/dist/types/feed/event-handlers/feed/index.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/feed-member/handle-feed-member-added.d.ts +3 -2
- package/dist/types/feed/event-handlers/feed-member/handle-feed-member-added.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/feed-member/handle-feed-member-removed.d.ts +3 -2
- package/dist/types/feed/event-handlers/feed-member/handle-feed-member-removed.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/feed-member/handle-feed-member-updated.d.ts +3 -2
- package/dist/types/feed/event-handlers/feed-member/handle-feed-member-updated.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/follow/handle-follow-created.d.ts +2 -2
- package/dist/types/feed/event-handlers/follow/handle-follow-created.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/follow/handle-follow-updated.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/notification-feed/handle-notification-feed-updated.d.ts +3 -2
- package/dist/types/feed/event-handlers/notification-feed/handle-notification-feed-updated.d.ts.map +1 -1
- package/dist/types/feed/feed.d.ts +17 -12
- package/dist/types/feed/feed.d.ts.map +1 -1
- package/dist/types/feeds-client/apply-new-activity-to-active-feeds.d.ts +4 -0
- package/dist/types/feeds-client/apply-new-activity-to-active-feeds.d.ts.map +1 -0
- package/dist/types/feeds-client/feeds-client.d.ts +29 -8
- package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
- package/dist/types/gen/feeds/FeedsApi.d.ts +6 -4
- package/dist/types/gen/feeds/FeedsApi.d.ts.map +1 -1
- package/dist/types/gen/models/index.d.ts +40 -2
- package/dist/types/gen/models/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +15 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/state-update-queue.d.ts +11 -2
- package/dist/types/utils/state-update-queue.d.ts.map +1 -1
- package/dist/types/utils/unique-array-merge.d.ts +1 -1
- package/dist/types/utils/unique-array-merge.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/activity-with-state-updates/activity-with-state-updates.ts +8 -2
- package/src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.ts +6 -20
- package/src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.ts +6 -20
- package/src/feed/activity-filter.ts +44 -0
- package/src/feed/event-handlers/activity/handle-activity-added.ts +22 -8
- package/src/feed/event-handlers/activity/handle-activity-deleted.ts +28 -2
- package/src/feed/event-handlers/activity/handle-activity-feedback.ts +17 -7
- package/src/feed/event-handlers/activity/handle-activity-pinned.ts +25 -3
- package/src/feed/event-handlers/activity/handle-activity-unpinned.ts +25 -2
- package/src/feed/event-handlers/activity/handle-activity-updated.ts +5 -1
- package/src/feed/event-handlers/activity/index.ts +3 -1
- package/src/feed/event-handlers/add-aggregated-activities-to-state.ts +11 -2
- package/src/feed/event-handlers/bookmark/handle-bookmark-added.ts +20 -11
- package/src/feed/event-handlers/bookmark/handle-bookmark-deleted.ts +21 -11
- package/src/feed/event-handlers/bookmark/handle-bookmark-updated.ts +24 -10
- package/src/feed/event-handlers/comment/handle-comment-updated.ts +11 -10
- package/src/feed/event-handlers/feed/handle-feed-deleted.ts +12 -0
- package/src/feed/event-handlers/feed/handle-feed-updated.ts +8 -0
- package/src/feed/event-handlers/feed/index.ts +1 -0
- package/src/feed/event-handlers/feed-member/handle-feed-member-added.ts +25 -2
- package/src/feed/event-handlers/feed-member/handle-feed-member-removed.ts +25 -2
- package/src/feed/event-handlers/feed-member/handle-feed-member-updated.ts +25 -2
- package/src/feed/event-handlers/follow/handle-follow-created.ts +18 -1
- package/src/feed/event-handlers/follow/handle-follow-updated.ts +14 -0
- package/src/feed/event-handlers/notification-feed/handle-notification-feed-updated.ts +68 -2
- package/src/feed/event-handlers/story-feeds/handle-story-feeds-updated.ts +1 -1
- package/src/feed/feed.ts +79 -26
- package/src/feeds-client/apply-new-activity-to-active-feeds.ts +9 -0
- package/src/feeds-client/feeds-client.ts +301 -28
- package/src/gen/feeds/FeedsApi.ts +79 -12
- package/src/gen/model-decoders/decoders.ts +7 -0
- package/src/gen/models/index.ts +66 -4
- package/src/index.ts +1 -0
- package/src/types.ts +17 -0
- package/src/utils/state-update-queue.ts +42 -28
- package/src/utils/unique-array-merge.ts +11 -3
- package/dist/feeds-client-B4zeBggL.js.map +0 -1
- package/dist/feeds-client-DeAqnd1a.mjs.map +0 -1
- package/dist/types/feed/event-handlers/activity/handle-activity-marked.d.ts +0 -12
- package/dist/types/feed/event-handlers/activity/handle-activity-marked.d.ts.map +0 -1
- package/src/feed/event-handlers/activity/handle-activity-marked.ts +0 -68
|
@@ -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-
|
|
5
|
+
const feedsClient = require("../feeds-client-C1c6lcS3.js");
|
|
6
6
|
const jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
const useCreateFeedsClient = ({
|
|
8
8
|
apiKey,
|
|
@@ -292,30 +292,16 @@ function useAggregatedActivities(feedFromProps) {
|
|
|
292
292
|
);
|
|
293
293
|
}
|
|
294
294
|
const useIsAggregatedActivityRead = ({
|
|
295
|
-
feed:
|
|
295
|
+
feed: _,
|
|
296
296
|
aggregatedActivity
|
|
297
297
|
}) => {
|
|
298
|
-
|
|
299
|
-
const feed = feedFromProps ?? feedFromContext;
|
|
300
|
-
const { read_activities: readActivities, last_read_at: lastReadAt } = useNotificationStatus(feed) ?? {};
|
|
301
|
-
const group = aggregatedActivity.group;
|
|
302
|
-
return react.useMemo(
|
|
303
|
-
() => lastReadAt && aggregatedActivity.updated_at.getTime() <= lastReadAt.getTime() || (readActivities ?? []).includes(group),
|
|
304
|
-
[lastReadAt, aggregatedActivity.updated_at, readActivities, group]
|
|
305
|
-
);
|
|
298
|
+
return aggregatedActivity.is_read;
|
|
306
299
|
};
|
|
307
300
|
const useIsAggregatedActivitySeen = ({
|
|
308
|
-
feed:
|
|
301
|
+
feed: _,
|
|
309
302
|
aggregatedActivity
|
|
310
303
|
}) => {
|
|
311
|
-
|
|
312
|
-
const feed = feedFromProps ?? feedFromContext;
|
|
313
|
-
const { seen_activities: seenActivities, last_seen_at: lastSeenAt } = useNotificationStatus(feed) ?? {};
|
|
314
|
-
const group = aggregatedActivity.group;
|
|
315
|
-
return react.useMemo(
|
|
316
|
-
() => lastSeenAt && aggregatedActivity.updated_at.getTime() < lastSeenAt.getTime() || (seenActivities ?? []).includes(group),
|
|
317
|
-
[lastSeenAt, aggregatedActivity.updated_at, seenActivities, group]
|
|
318
|
-
);
|
|
304
|
+
return aggregatedActivity.is_seen;
|
|
319
305
|
};
|
|
320
306
|
const StreamActivityWithStateUpdatesContext = react.createContext(void 0);
|
|
321
307
|
const useActivityWithStateUpdatesContext = () => {
|
|
@@ -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/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,CAAC,QAAQ;AACd,e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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 type { Feed } from '../../../../feed';\nimport type { AggregatedActivityResponse } from '../../../../gen/models';\n\n/**\n * @deprecated use aggregatedActivity.is_read instead\n * @returns\n */\nexport const useIsAggregatedActivityRead = ({\n feed: _,\n aggregatedActivity,\n}: {\n feed?: Feed;\n aggregatedActivity: AggregatedActivityResponse;\n}) => {\n return aggregatedActivity.is_read;\n};\n","import type { Feed } from '../../../../feed';\nimport type { AggregatedActivityResponse } from '../../../../gen/models';\n\n/**\n * @deprecated use aggregatedActivity.is_seen instead\n * @returns\n */\nexport const useIsAggregatedActivitySeen = ({\n feed: _,\n aggregatedActivity,\n}: {\n feed?: Feed;\n aggregatedActivity: AggregatedActivityResponse;\n}) => {\n return aggregatedActivity.is_seen;\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,gB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AAW,CAAC,EAAE,mBAA0C;AAAA,EAC5D;AACF;ACZO,MAAM,mBAAmB,CAAC,wBAA2C;AAC1E,QAAM,sBAAsB,iBAAA;AAC5B,QAAM,aAAa,uBAAuB;AAE1C,SAAOD,4BAAc,YAAY,OAAO,QAAQ;AAClD;AAEA,MAAM,WAAW,CAAC,EAAE,eAAsC;AAAA,EACxD;AACF;ACVO,MAAM,cAAc,CAAC,EAAE,QAAQ,eAA2D;AAC/F,wCACG,mBAAmB,UAAnB,EAA4B,OAAO,QACjC,UACH;AAEJ;AAEA,YAAY,cAAc;ACAnB,MAAM,aAAa,CAAC;AAAA,EACzB;AAAA,EACA;AACF,MAA0C;AACxC,wCACG,kBAAkB,UAAlB,EAA2B,OAAO,MAChC,UACH;AAEJ;AAEA,WAAW,cAAc;ACXlB,MAAM,iCAAiC,CAAC;AAAA,EAC7C;AAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
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-
|
|
4
|
-
import { A, C,
|
|
3
|
+
import { d as debounce } from "../feeds-client-jtUTE4AC.mjs";
|
|
4
|
+
import { A, C, b, F, S, c, a, e, o, n, l, h, f, j, g, k, i, r, s, u, m } from "../feeds-client-jtUTE4AC.mjs";
|
|
5
5
|
import { LogLevelEnum } from "@stream-io/logger";
|
|
6
6
|
const ownFeedFields = ["own_capabilities", "own_follows", "own_membership"];
|
|
7
7
|
const ChannelOwnCapability = {
|
|
@@ -443,29 +443,30 @@ export {
|
|
|
443
443
|
BaseSearchSourceSync,
|
|
444
444
|
ChannelOwnCapability,
|
|
445
445
|
C as Constants,
|
|
446
|
-
|
|
446
|
+
b as Feed,
|
|
447
447
|
FeedOwnCapability,
|
|
448
448
|
FeedSearchSource,
|
|
449
449
|
F as FeedsClient,
|
|
450
450
|
LogLevelEnum,
|
|
451
451
|
SearchController,
|
|
452
452
|
S as StreamApiError,
|
|
453
|
-
|
|
453
|
+
c as StreamPoll,
|
|
454
454
|
UserSearchSource,
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
455
|
+
a as activityFilter,
|
|
456
|
+
e as checkHasAnotherPage,
|
|
457
|
+
o as ensureExhausted,
|
|
458
|
+
n as feedsLoggerSystem,
|
|
459
|
+
l as getStateUpdateQueueId,
|
|
460
|
+
h as isCommentResponse,
|
|
461
|
+
f as isFollowResponse,
|
|
462
|
+
j as isImageFile,
|
|
463
|
+
g as isReactionResponse,
|
|
464
|
+
k as isVideoFile,
|
|
464
465
|
i as isVoteAnswer,
|
|
465
466
|
ownFeedFields,
|
|
466
467
|
r as replaceUniqueArrayMerge,
|
|
467
468
|
s as shouldUpdateState,
|
|
468
469
|
u as uniqueArrayMerge,
|
|
469
|
-
|
|
470
|
+
m as updateEntityInArray
|
|
470
471
|
};
|
|
471
472
|
//# sourceMappingURL=index.mjs.map
|