@stream-io/feeds-client 0.1.8 → 0.1.10
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/@react-bindings/hooks/search-state-hooks/index.ts +3 -0
- package/@react-bindings/hooks/util/index.ts +1 -0
- package/@react-bindings/index.ts +5 -0
- package/CHANGELOG.md +22 -0
- package/dist/@react-bindings/contexts/StreamSearchContext.d.ts +12 -0
- package/dist/@react-bindings/contexts/StreamSearchResultsContext.d.ts +12 -0
- package/dist/@react-bindings/hooks/search-state-hooks/index.d.ts +3 -0
- package/dist/@react-bindings/hooks/search-state-hooks/useSearchQuery.d.ts +4 -0
- package/dist/@react-bindings/hooks/search-state-hooks/useSearchResult.d.ts +8 -0
- package/dist/@react-bindings/hooks/search-state-hooks/useSearchSources.d.ts +4 -0
- package/dist/@react-bindings/hooks/util/index.d.ts +1 -0
- package/dist/@react-bindings/hooks/util/useBookmarkActions.d.ts +13 -0
- package/dist/@react-bindings/hooks/util/useReactionActions.d.ts +1 -1
- package/dist/@react-bindings/index.d.ts +5 -0
- package/dist/@react-bindings/wrappers/StreamSearch.d.ts +12 -0
- package/dist/@react-bindings/wrappers/StreamSearchResults.d.ts +12 -0
- package/dist/index-react-bindings.browser.cjs +431 -156
- package/dist/index-react-bindings.browser.cjs.map +1 -1
- package/dist/index-react-bindings.browser.js +422 -157
- package/dist/index-react-bindings.browser.js.map +1 -1
- package/dist/index-react-bindings.node.cjs +431 -156
- package/dist/index-react-bindings.node.cjs.map +1 -1
- package/dist/index-react-bindings.node.js +422 -157
- package/dist/index-react-bindings.node.js.map +1 -1
- package/dist/index.browser.cjs +346 -264
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +346 -265
- package/dist/index.browser.js.map +1 -1
- package/dist/index.node.cjs +346 -264
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +346 -265
- package/dist/index.node.js.map +1 -1
- package/dist/src/Feed.d.ts +40 -9
- package/dist/src/FeedsClient.d.ts +8 -1
- package/dist/src/common/BaseSearchSource.d.ts +3 -1
- package/dist/src/common/FeedSearchSource.d.ts +5 -1
- package/dist/src/common/SearchController.d.ts +2 -0
- package/dist/src/gen-imports.d.ts +1 -1
- package/dist/src/state-updates/follow-utils.d.ts +19 -0
- package/dist/src/state-updates/state-update-queue.d.ts +15 -0
- package/dist/src/utils.d.ts +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/Feed.ts +226 -192
- package/src/FeedsClient.ts +75 -3
- package/src/common/ActivitySearchSource.ts +5 -15
- package/src/common/BaseSearchSource.ts +9 -9
- package/src/common/FeedSearchSource.ts +20 -65
- package/src/common/SearchController.ts +2 -0
- package/src/common/UserSearchSource.ts +9 -61
- package/src/gen-imports.ts +1 -1
- package/src/state-updates/activity-reaction-utils.test.ts +1 -0
- package/src/state-updates/activity-utils.test.ts +1 -0
- package/src/state-updates/follow-utils.test.ts +552 -0
- package/src/state-updates/follow-utils.ts +126 -0
- package/src/state-updates/state-update-queue.test.ts +53 -0
- package/src/state-updates/state-update-queue.ts +35 -0
- package/src/utils.test.ts +175 -0
- package/src/utils.ts +20 -0
package/@react-bindings/index.ts
CHANGED
|
@@ -5,14 +5,19 @@ export * from './hooks/useCreateFeedsClient';
|
|
|
5
5
|
|
|
6
6
|
export * from './hooks/client-state-hooks';
|
|
7
7
|
export * from './hooks/feed-state-hooks';
|
|
8
|
+
export * from './hooks/search-state-hooks';
|
|
8
9
|
export * from './hooks/util';
|
|
9
10
|
|
|
10
11
|
// Contexts
|
|
11
12
|
|
|
12
13
|
export * from './contexts/StreamFeedsContext';
|
|
13
14
|
export * from './contexts/StreamFeedContext';
|
|
15
|
+
export * from './contexts/StreamSearchContext';
|
|
16
|
+
export * from './contexts/StreamSearchResultsContext';
|
|
14
17
|
|
|
15
18
|
// Wrappers
|
|
16
19
|
|
|
17
20
|
export * from './wrappers/StreamFeeds';
|
|
18
21
|
export * from './wrappers/StreamFeed';
|
|
22
|
+
export * from './wrappers/StreamSearch';
|
|
23
|
+
export * from './wrappers/StreamSearchResults';
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.1.10](https://github.com/GetStream/stream-feeds-js/compare/@stream-io/feeds-client-0.1.9...@stream-io/feeds-client-0.1.10) (2025-07-28)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* search implementation and bindings ([#78](https://github.com/GetStream/stream-feeds-js/issues/78)) ([02d7dd1](https://github.com/GetStream/stream-feeds-js/commit/02d7dd1fd1f01df411e92db328106987c366e4d4))
|
|
11
|
+
|
|
12
|
+
## [0.1.9](https://github.com/GetStream/stream-feeds-js/compare/@stream-io/feeds-client-0.1.8...@stream-io/feeds-client-0.1.9) (2025-07-28)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* comments and activity actions ([#76](https://github.com/GetStream/stream-feeds-js/issues/76)) ([5484864](https://github.com/GetStream/stream-feeds-js/commit/54848641043c379e9c9b3d290260375dee5ccfa6))
|
|
18
|
+
* consider `depth` option for `loadNextPageComments` ([#65](https://github.com/GetStream/stream-feeds-js/issues/65)) ([5ffc786](https://github.com/GetStream/stream-feeds-js/commit/5ffc78626a8415f2c77d24d234810712b2f1e52c))
|
|
19
|
+
* enable queryFeeds without watch: true ([#75](https://github.com/GetStream/stream-feeds-js/issues/75)) ([fbd2851](https://github.com/GetStream/stream-feeds-js/commit/fbd285146fb4cec99711ec4fb18b22e5ae0847e6)), closes [/github.com/GetStream/stream-feeds-js/pull/75/files#diff-5fe26340feefe9212a93cb4f25c7996731c1245bb6253d4c106ef98afbcc3a17](https://github.com/GetStream//github.com/GetStream/stream-feeds-js/pull/75/files/issues/diff-5fe26340feefe9212a93cb4f25c7996731c1245bb6253d4c106ef98afbcc3a17) [/github.com/GetStream/stream-feeds-js/pull/75/files#diff-20886f4c7cbf4a14b78ed974d55bb6d44f278117f37d1864e494443c3ee8f73dR30](https://github.com/GetStream//github.com/GetStream/stream-feeds-js/pull/75/files/issues/diff-20886f4c7cbf4a14b78ed974d55bb6d44f278117f37d1864e494443c3ee8f73dR30)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* adjust how we merge/update members ([#74](https://github.com/GetStream/stream-feeds-js/issues/74)) ([220aa07](https://github.com/GetStream/stream-feeds-js/commit/220aa07868bd56637c37f4b1434020ae548b5a9b))
|
|
25
|
+
* catch irrelevant error to avoid test failiure ([#77](https://github.com/GetStream/stream-feeds-js/issues/77)) ([836a8bb](https://github.com/GetStream/stream-feeds-js/commit/836a8bbb58d4d0fe150f4c370d0a05dcc26252cb))
|
|
26
|
+
|
|
5
27
|
## [0.1.8](https://github.com/GetStream/stream-feeds-js/compare/@stream-io/feeds-client-0.1.7...@stream-io/feeds-client-0.1.8) (2025-07-23)
|
|
6
28
|
|
|
7
29
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SearchController } from '../../src/common/SearchController';
|
|
2
|
+
export declare const StreamSearchContext: import("react").Context<SearchController | undefined>;
|
|
3
|
+
/**
|
|
4
|
+
* The props for the StreamSearchProvider component.
|
|
5
|
+
*/
|
|
6
|
+
export type StreamSearchContextProps = {
|
|
7
|
+
searchController: SearchController;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Hook to access the nearest SearchController instance.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useSearchContext: () => SearchController | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SearchSource } from '../../src/common/BaseSearchSource';
|
|
2
|
+
export declare const StreamSearchResultsContext: import("react").Context<SearchSource<any> | undefined>;
|
|
3
|
+
/**
|
|
4
|
+
* The props for the StreamSearchResultsProvider component.
|
|
5
|
+
*/
|
|
6
|
+
export type StreamSearchResultsContextProps = {
|
|
7
|
+
source: SearchSource;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Hook to access the nearest SearchSource instance.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useSearchResultsContext: () => SearchSource<any> | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SearchSource } from '../../../src/common/BaseSearchSource';
|
|
2
|
+
export declare const useSearchResult: (sourceFromProps?: SearchSource) => {
|
|
3
|
+
items: any[] | undefined;
|
|
4
|
+
error: Error | undefined;
|
|
5
|
+
isLoading: boolean | undefined;
|
|
6
|
+
hasNext: boolean | undefined;
|
|
7
|
+
loadMore: import("../internal").StableCallback<[], Promise<void>>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ActivityResponse } from '../../../src/gen/models';
|
|
2
|
+
/**
|
|
3
|
+
* A utility hook that takes in an entity and creates bookmark actions
|
|
4
|
+
* that can then be used on the UI. The entity is expected to be an ActivityResponse.
|
|
5
|
+
* @param entity - The entity to which we want to apply reaction actions, expects an ActivityResponse.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useBookmarkActions: ({ entity, }: {
|
|
8
|
+
entity: ActivityResponse;
|
|
9
|
+
}) => {
|
|
10
|
+
addBookmark: import("../internal").StableCallback<[], Promise<void>>;
|
|
11
|
+
removeBookmark: import("../internal").StableCallback<[], Promise<void>>;
|
|
12
|
+
toggleBookmark: import("../internal").StableCallback<[], Promise<void>>;
|
|
13
|
+
};
|
|
@@ -4,7 +4,7 @@ import { CommentParent } from '../../../src/types';
|
|
|
4
4
|
* that can then be used on the UI. The entity can be either an ActivityResponse or a CommentResponse
|
|
5
5
|
* as the hook determines internally which APIs it is supposed to use, while taking the
|
|
6
6
|
* correct ownCapabilities into account.
|
|
7
|
-
* @param entity - The entity to which we want to
|
|
7
|
+
* @param entity - The entity to which we want to apply reaction actions, can be either ActivityResponse or CommentResponse.
|
|
8
8
|
* @param type - The type of reaction we want to add or remove.
|
|
9
9
|
*/
|
|
10
10
|
export declare const useReactionActions: ({ entity, type, }: {
|
|
@@ -2,8 +2,13 @@ export * from './hooks/useStateStore';
|
|
|
2
2
|
export * from './hooks/useCreateFeedsClient';
|
|
3
3
|
export * from './hooks/client-state-hooks';
|
|
4
4
|
export * from './hooks/feed-state-hooks';
|
|
5
|
+
export * from './hooks/search-state-hooks';
|
|
5
6
|
export * from './hooks/util';
|
|
6
7
|
export * from './contexts/StreamFeedsContext';
|
|
7
8
|
export * from './contexts/StreamFeedContext';
|
|
9
|
+
export * from './contexts/StreamSearchContext';
|
|
10
|
+
export * from './contexts/StreamSearchResultsContext';
|
|
8
11
|
export * from './wrappers/StreamFeeds';
|
|
9
12
|
export * from './wrappers/StreamFeed';
|
|
13
|
+
export * from './wrappers/StreamSearch';
|
|
14
|
+
export * from './wrappers/StreamSearchResults';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import type { SearchController } from '../../src/common/SearchController';
|
|
3
|
+
/**
|
|
4
|
+
* The props for the StreamSearch component. It accepts a `SearchController` instance.
|
|
5
|
+
*/
|
|
6
|
+
export type StreamSearchProps = {
|
|
7
|
+
searchController: SearchController | undefined;
|
|
8
|
+
};
|
|
9
|
+
export declare const StreamSearch: {
|
|
10
|
+
({ searchController, children, }: PropsWithChildren<StreamSearchProps>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import type { SearchSource } from '../../src/common/BaseSearchSource';
|
|
3
|
+
/**
|
|
4
|
+
* The props for the StreamSearchResults component. It accepts a `SearchSource` instance.
|
|
5
|
+
*/
|
|
6
|
+
export type StreamSearchResultsProps = {
|
|
7
|
+
source: SearchSource;
|
|
8
|
+
};
|
|
9
|
+
export declare const StreamSearchResults: {
|
|
10
|
+
({ source, children, }: PropsWithChildren<StreamSearchResultsProps>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|