@stream-io/feeds-client 0.3.26 → 0.3.28
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 +14 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react-bindings.js +60 -931
- package/dist/cjs/react-bindings.js.map +1 -1
- package/dist/es/index.mjs +2 -2
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/react-bindings.mjs +9 -885
- package/dist/es/react-bindings.mjs.map +1 -1
- package/dist/{feeds-client-BNiazJbH.mjs → feeds-client-Dr24iZo9.mjs} +8 -9
- package/dist/{feeds-client-BNiazJbH.mjs.map → feeds-client-Dr24iZo9.mjs.map} +1 -1
- package/dist/{feeds-client-K0WzrfH-.js → feeds-client-c90oNdsU.js} +8 -9
- package/dist/{feeds-client-K0WzrfH-.js.map → feeds-client-c90oNdsU.js.map} +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/dist/types/activity-with-state-updates/activity-with-state-updates.d.ts +4 -4
- package/dist/types/activity-with-state-updates/activity-with-state-updates.d.ts.map +1 -1
- package/dist/types/activity-with-state-updates/get-feed.d.ts +2 -2
- package/dist/types/bindings/react/contexts/StreamFeedContext.d.ts +2 -2
- package/dist/types/bindings/react/contexts/StreamFeedContext.d.ts.map +1 -1
- package/dist/types/bindings/react/contexts/StreamFeedsContext.d.ts +2 -2
- package/dist/types/bindings/react/contexts/StreamFeedsContext.d.ts.map +1 -1
- package/dist/types/bindings/react/contexts/StreamSearchContext.d.ts +2 -2
- package/dist/types/bindings/react/contexts/StreamSearchContext.d.ts.map +1 -1
- package/dist/types/bindings/react/contexts/StreamSearchResultsContext.d.ts +2 -2
- package/dist/types/bindings/react/contexts/StreamSearchResultsContext.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/client-state-hooks/useClientConnectedUser.d.ts +1 -1
- package/dist/types/bindings/react/hooks/client-state-hooks/useClientConnectedUser.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/client-state-hooks/useWsConnectionState.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useActivityComments.d.ts +5 -3
- package/dist/types/bindings/react/hooks/feed-state-hooks/useActivityComments.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.d.ts +2 -2
- package/dist/types/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useComments.d.ts +3 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useComments.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFeedActivities.d.ts +3 -3
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFeedActivities.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFeedMetadata.d.ts +2 -2
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFeedMetadata.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFollowers.d.ts +4 -4
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFollowers.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFollowing.d.ts +4 -4
- package/dist/types/bindings/react/hooks/feed-state-hooks/useFollowing.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.d.ts +2 -1
- 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 +2 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useNotificationStatus.d.ts +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useNotificationStatus.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.d.ts +2 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnFollows.d.ts +2 -2
- package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnFollows.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/search-state-hooks/useSearchQuery.d.ts +1 -1
- package/dist/types/bindings/react/hooks/search-state-hooks/useSearchQuery.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/search-state-hooks/useSearchResult.d.ts +2 -2
- package/dist/types/bindings/react/hooks/search-state-hooks/useSearchResult.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/search-state-hooks/useSearchSources.d.ts +2 -2
- package/dist/types/bindings/react/hooks/search-state-hooks/useSearchSources.d.ts.map +1 -1
- package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts +4 -1
- package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts.map +1 -1
- package/dist/types/bindings/react/wrappers/StreamFeed.d.ts +2 -2
- package/dist/types/bindings/react/wrappers/StreamFeed.d.ts.map +1 -1
- package/dist/types/bindings/react/wrappers/StreamFeeds.d.ts +2 -2
- package/dist/types/bindings/react/wrappers/StreamSearch.d.ts +2 -2
- package/dist/types/bindings/react/wrappers/StreamSearch.d.ts.map +1 -1
- package/dist/types/bindings/react/wrappers/StreamSearchResults.d.ts +2 -2
- package/dist/types/bindings/react/wrappers/StreamSearchResults.d.ts.map +1 -1
- package/dist/types/common/ApiClient.d.ts +3 -3
- package/dist/types/common/EventDispatcher.d.ts +1 -1
- package/dist/types/common/Poll.d.ts +2 -2
- package/dist/types/common/rate-limit.d.ts +1 -1
- package/dist/types/common/real-time/StableWSConnection.d.ts +6 -6
- package/dist/types/common/real-time/event-models.d.ts +2 -1
- package/dist/types/common/real-time/event-models.d.ts.map +1 -1
- package/dist/types/common/search/ActivitySearchSource.d.ts +3 -3
- package/dist/types/common/search/BaseSearchSource.d.ts +2 -2
- package/dist/types/common/search/FeedSearchSource.d.ts +3 -3
- package/dist/types/common/search/SearchController.d.ts +1 -1
- package/dist/types/common/search/UserSearchSource.d.ts +4 -4
- package/dist/types/common/types.d.ts +1 -1
- package/dist/types/feed/event-handlers/activity/handle-activity-added.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-deleted.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-feedback.d.ts +2 -2
- package/dist/types/feed/event-handlers/activity/handle-activity-feedback.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/activity/handle-activity-marked.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-pinned.d.ts +2 -2
- package/dist/types/feed/event-handlers/activity/handle-activity-reaction-added.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-reaction-deleted.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-reaction-updated.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity/handle-activity-removed-from-feed.d.ts +2 -2
- package/dist/types/feed/event-handlers/activity/handle-activity-unpinned.d.ts +2 -2
- package/dist/types/feed/event-handlers/activity/handle-activity-updated.d.ts +3 -3
- package/dist/types/feed/event-handlers/activity-updater.d.ts +15 -15
- package/dist/types/feed/event-handlers/add-aggregated-activities-to-state.d.ts +2 -2
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-added.d.ts +3 -3
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-deleted.d.ts +3 -3
- package/dist/types/feed/event-handlers/bookmark/handle-bookmark-updated.d.ts +3 -3
- package/dist/types/feed/event-handlers/comment/handle-comment-added.d.ts +2 -2
- package/dist/types/feed/event-handlers/comment/handle-comment-deleted.d.ts +3 -2
- package/dist/types/feed/event-handlers/comment/handle-comment-reaction-added.d.ts +3 -2
- package/dist/types/feed/event-handlers/comment/handle-comment-reaction-deleted.d.ts +3 -2
- package/dist/types/feed/event-handlers/comment/handle-comment-reaction-updated.d.ts +3 -2
- package/dist/types/feed/event-handlers/comment/handle-comment-updated.d.ts +3 -2
- package/dist/types/feed/event-handlers/comment/utils/update-comment-count.d.ts +2 -1
- package/dist/types/feed/event-handlers/comment/utils/update-comment-count.d.ts.map +1 -1
- package/dist/types/feed/event-handlers/feed/handle-feed-updated.d.ts +2 -2
- package/dist/types/feed/event-handlers/feed-member/handle-feed-member-added.d.ts +2 -2
- package/dist/types/feed/event-handlers/feed-member/handle-feed-member-removed.d.ts +2 -2
- package/dist/types/feed/event-handlers/feed-member/handle-feed-member-updated.d.ts +2 -2
- package/dist/types/feed/event-handlers/follow/handle-follow-created.d.ts +3 -3
- package/dist/types/feed/event-handlers/follow/handle-follow-deleted.d.ts +3 -3
- package/dist/types/feed/event-handlers/follow/handle-follow-updated.d.ts +2 -2
- package/dist/types/feed/event-handlers/is-activity-pin.d.ts +1 -1
- package/dist/types/feed/event-handlers/notification-feed/handle-notification-feed-updated.d.ts +3 -3
- package/dist/types/feed/event-handlers/story-feeds/handle-story-feeds-updated.d.ts +3 -3
- package/dist/types/feed/event-handlers/watch/handle-watch-started.d.ts +1 -1
- package/dist/types/feed/event-handlers/watch/handle-watch-stopped.d.ts +1 -1
- package/dist/types/feed/feed.d.ts +9 -9
- package/dist/types/feeds-client/active-activity.d.ts +1 -1
- package/dist/types/feeds-client/event-handlers/user/handle-user-updated.d.ts +2 -2
- package/dist/types/feeds-client/feeds-client.d.ts +22 -22
- package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
- package/dist/types/feeds-client/get-or-create-active-feed.d.ts +2 -2
- package/dist/types/gen/feeds/FeedApi.d.ts +2 -2
- package/dist/types/gen/feeds/FeedsApi.d.ts +2 -2
- package/dist/types/gen/model-decoders/event-decoder-mapping.d.ts +1 -1
- package/dist/types/gen/models/index.d.ts +1 -1
- package/dist/types/gen/models/index.d.ts.map +1 -1
- package/dist/types/gen/moderation/ModerationApi.d.ts +2 -2
- package/dist/types/types-internal.d.ts +1 -1
- package/dist/types/types.d.ts +5 -4
- package/dist/types/utils/check-own-fields-equality.d.ts +2 -2
- package/dist/types/utils/event-triggered-by-connected-user.d.ts +2 -2
- package/dist/types/utils/own-feed-fields.d.ts +1 -1
- package/dist/types/utils/state-update-queue.d.ts +4 -4
- package/dist/types/utils/throttling/throttled-get-batched-own-capabilities.d.ts +2 -2
- package/dist/types/utils/throttling/throttled-get-batched-own-capabilities.d.ts.map +1 -1
- package/dist/types/utils/type-assertions.d.ts +2 -2
- package/package.json +11 -12
- package/src/activity-with-state-updates/activity-with-state-updates.ts +2 -2
- package/src/bindings/react/contexts/StreamFeedContext.tsx +2 -1
- package/src/bindings/react/contexts/StreamFeedsContext.tsx +2 -1
- package/src/bindings/react/contexts/StreamSearchContext.tsx +2 -1
- package/src/bindings/react/contexts/StreamSearchResultsContext.tsx +2 -1
- package/src/bindings/react/hooks/client-state-hooks/useClientConnectedUser.ts +2 -1
- package/src/bindings/react/hooks/client-state-hooks/useWsConnectionState.ts +2 -1
- package/src/bindings/react/hooks/feed-state-hooks/useActivityComments.ts +7 -11
- package/src/bindings/react/hooks/feed-state-hooks/useAggregatedActivities.ts +3 -2
- package/src/bindings/react/hooks/feed-state-hooks/useComments.ts +5 -9
- package/src/bindings/react/hooks/feed-state-hooks/useFeedActivities.ts +4 -3
- package/src/bindings/react/hooks/feed-state-hooks/useFeedMetadata.ts +3 -2
- package/src/bindings/react/hooks/feed-state-hooks/useFollowers.ts +2 -1
- package/src/bindings/react/hooks/feed-state-hooks/useFollowing.ts +3 -1
- package/src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivityRead.ts +4 -2
- package/src/bindings/react/hooks/feed-state-hooks/useIsAggregatedActivitySeen.ts +4 -2
- package/src/bindings/react/hooks/feed-state-hooks/useNotificationStatus.ts +3 -1
- package/src/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.ts +5 -2
- package/src/bindings/react/hooks/feed-state-hooks/useOwnFollows.ts +3 -2
- package/src/bindings/react/hooks/search-state-hooks/useSearchQuery.ts +6 -2
- package/src/bindings/react/hooks/search-state-hooks/useSearchResult.ts +4 -2
- package/src/bindings/react/hooks/search-state-hooks/useSearchSources.ts +3 -5
- package/src/bindings/react/hooks/useCreateFeedsClient.ts +5 -6
- package/src/bindings/react/wrappers/StreamFeed.tsx +2 -1
- package/src/bindings/react/wrappers/StreamSearch.tsx +2 -1
- package/src/bindings/react/wrappers/StreamSearchResults.tsx +2 -1
- package/src/common/real-time/event-models.ts +2 -2
- package/src/feed/event-handlers/activity/handle-activity-feedback.ts +4 -8
- package/src/feed/event-handlers/comment/utils/update-comment-count.ts +2 -2
- package/src/feeds-client/feeds-client.ts +10 -12
- package/src/gen/models/index.ts +2 -2
- package/src/utils/throttling/throttled-get-batched-own-capabilities.ts +1 -1
|
@@ -1,404 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
require("
|
|
5
|
-
const feedsClient = require("../feeds-client-
|
|
6
|
-
|
|
7
|
-
var useSyncExternalStoreShim_production = {};
|
|
8
|
-
/**
|
|
9
|
-
* @license React
|
|
10
|
-
* use-sync-external-store-shim.production.js
|
|
11
|
-
*
|
|
12
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the MIT license found in the
|
|
15
|
-
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/
|
|
17
|
-
var hasRequiredUseSyncExternalStoreShim_production;
|
|
18
|
-
function requireUseSyncExternalStoreShim_production() {
|
|
19
|
-
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
20
|
-
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
21
|
-
var React = require$$0;
|
|
22
|
-
function is(x, y) {
|
|
23
|
-
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
24
|
-
}
|
|
25
|
-
var objectIs = "function" === typeof Object.is ? Object.is : is, useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue;
|
|
26
|
-
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
27
|
-
var value = getSnapshot(), _useState = useState({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
28
|
-
useLayoutEffect(
|
|
29
|
-
function() {
|
|
30
|
-
inst.value = value;
|
|
31
|
-
inst.getSnapshot = getSnapshot;
|
|
32
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
33
|
-
},
|
|
34
|
-
[subscribe, value, getSnapshot]
|
|
35
|
-
);
|
|
36
|
-
useEffect(
|
|
37
|
-
function() {
|
|
38
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
39
|
-
return subscribe(function() {
|
|
40
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
41
|
-
});
|
|
42
|
-
},
|
|
43
|
-
[subscribe]
|
|
44
|
-
);
|
|
45
|
-
useDebugValue(value);
|
|
46
|
-
return value;
|
|
47
|
-
}
|
|
48
|
-
function checkIfSnapshotChanged(inst) {
|
|
49
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
50
|
-
inst = inst.value;
|
|
51
|
-
try {
|
|
52
|
-
var nextValue = latestGetSnapshot();
|
|
53
|
-
return !objectIs(inst, nextValue);
|
|
54
|
-
} catch (error) {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
59
|
-
return getSnapshot();
|
|
60
|
-
}
|
|
61
|
-
var shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
62
|
-
useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim2;
|
|
63
|
-
return useSyncExternalStoreShim_production;
|
|
64
|
-
}
|
|
65
|
-
var useSyncExternalStoreShim_development = {};
|
|
66
|
-
/**
|
|
67
|
-
* @license React
|
|
68
|
-
* use-sync-external-store-shim.development.js
|
|
69
|
-
*
|
|
70
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
71
|
-
*
|
|
72
|
-
* This source code is licensed under the MIT license found in the
|
|
73
|
-
* LICENSE file in the root directory of this source tree.
|
|
74
|
-
*/
|
|
75
|
-
var hasRequiredUseSyncExternalStoreShim_development;
|
|
76
|
-
function requireUseSyncExternalStoreShim_development() {
|
|
77
|
-
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
78
|
-
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
79
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
80
|
-
function is(x, y) {
|
|
81
|
-
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
82
|
-
}
|
|
83
|
-
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
84
|
-
didWarnOld18Alpha || void 0 === React.startTransition || (didWarnOld18Alpha = true, console.error(
|
|
85
|
-
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
86
|
-
));
|
|
87
|
-
var value = getSnapshot();
|
|
88
|
-
if (!didWarnUncachedGetSnapshot) {
|
|
89
|
-
var cachedValue = getSnapshot();
|
|
90
|
-
objectIs(value, cachedValue) || (console.error(
|
|
91
|
-
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
92
|
-
), didWarnUncachedGetSnapshot = true);
|
|
93
|
-
}
|
|
94
|
-
cachedValue = useState({
|
|
95
|
-
inst: { value, getSnapshot }
|
|
96
|
-
});
|
|
97
|
-
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
|
|
98
|
-
useLayoutEffect(
|
|
99
|
-
function() {
|
|
100
|
-
inst.value = value;
|
|
101
|
-
inst.getSnapshot = getSnapshot;
|
|
102
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
103
|
-
},
|
|
104
|
-
[subscribe, value, getSnapshot]
|
|
105
|
-
);
|
|
106
|
-
useEffect(
|
|
107
|
-
function() {
|
|
108
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
109
|
-
return subscribe(function() {
|
|
110
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
111
|
-
});
|
|
112
|
-
},
|
|
113
|
-
[subscribe]
|
|
114
|
-
);
|
|
115
|
-
useDebugValue(value);
|
|
116
|
-
return value;
|
|
117
|
-
}
|
|
118
|
-
function checkIfSnapshotChanged(inst) {
|
|
119
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
120
|
-
inst = inst.value;
|
|
121
|
-
try {
|
|
122
|
-
var nextValue = latestGetSnapshot();
|
|
123
|
-
return !objectIs(inst, nextValue);
|
|
124
|
-
} catch (error) {
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
129
|
-
return getSnapshot();
|
|
130
|
-
}
|
|
131
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
132
|
-
var React = require$$0, objectIs = "function" === typeof Object.is ? Object.is : is, useState = React.useState, useEffect = React.useEffect, useLayoutEffect = React.useLayoutEffect, useDebugValue = React.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
133
|
-
useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim2;
|
|
134
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
135
|
-
}();
|
|
136
|
-
return useSyncExternalStoreShim_development;
|
|
137
|
-
}
|
|
138
|
-
var hasRequiredShim;
|
|
139
|
-
function requireShim() {
|
|
140
|
-
if (hasRequiredShim) return shim.exports;
|
|
141
|
-
hasRequiredShim = 1;
|
|
142
|
-
if (process.env.NODE_ENV === "production") {
|
|
143
|
-
shim.exports = requireUseSyncExternalStoreShim_production();
|
|
144
|
-
} else {
|
|
145
|
-
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
146
|
-
}
|
|
147
|
-
return shim.exports;
|
|
148
|
-
}
|
|
149
|
-
var shimExports = requireShim();
|
|
150
|
-
const isPatch = (value) => typeof value === "function";
|
|
151
|
-
const noop$1 = () => {
|
|
152
|
-
};
|
|
153
|
-
class StateStore {
|
|
154
|
-
constructor(value) {
|
|
155
|
-
this.value = value;
|
|
156
|
-
this.handlers = /* @__PURE__ */ new Set();
|
|
157
|
-
this.preprocessors = /* @__PURE__ */ new Set();
|
|
158
|
-
this.partialNext = (partial) => this.next((current) => ({ ...current, ...partial }));
|
|
159
|
-
this.subscribeWithSelector = (selector2, handler) => {
|
|
160
|
-
let previouslySelectedValues;
|
|
161
|
-
const wrappedHandler = (nextValue) => {
|
|
162
|
-
const newlySelectedValues = selector2(nextValue);
|
|
163
|
-
const selectionsAreEqual = StateStore.doSelectionsEqual(previouslySelectedValues, newlySelectedValues);
|
|
164
|
-
if (selectionsAreEqual)
|
|
165
|
-
return;
|
|
166
|
-
const previouslySelectedValuesCopy = previouslySelectedValues;
|
|
167
|
-
previouslySelectedValues = newlySelectedValues;
|
|
168
|
-
handler(newlySelectedValues, previouslySelectedValuesCopy);
|
|
169
|
-
};
|
|
170
|
-
return this.subscribe(wrappedHandler);
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Allows merging two stores only if their keys differ otherwise there's no way to ensure the data type stability.
|
|
175
|
-
* @experimental
|
|
176
|
-
* This method is experimental and may change in future versions.
|
|
177
|
-
*/
|
|
178
|
-
merge(stateStore) {
|
|
179
|
-
return new MergedStateStore({
|
|
180
|
-
original: this,
|
|
181
|
-
merged: stateStore
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
next(newValueOrPatch) {
|
|
185
|
-
const newValue = isPatch(newValueOrPatch) ? newValueOrPatch(this.value) : newValueOrPatch;
|
|
186
|
-
if (Object.is(newValue, this.value))
|
|
187
|
-
return;
|
|
188
|
-
this.preprocessors.forEach((preprocessor) => preprocessor(newValue, this.value));
|
|
189
|
-
const oldValue = this.value;
|
|
190
|
-
this.value = newValue;
|
|
191
|
-
this.handlers.forEach((handler) => handler(this.value, oldValue));
|
|
192
|
-
}
|
|
193
|
-
getLatestValue() {
|
|
194
|
-
return this.value;
|
|
195
|
-
}
|
|
196
|
-
subscribe(handler) {
|
|
197
|
-
handler(this.value, void 0);
|
|
198
|
-
this.handlers.add(handler);
|
|
199
|
-
return () => {
|
|
200
|
-
this.handlers.delete(handler);
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
static doSelectionsEqual(previouslySelectedValues, newlySelectedValues) {
|
|
204
|
-
let selectionsAreEqual;
|
|
205
|
-
if (selectionsAreEqual = typeof previouslySelectedValues !== "undefined") {
|
|
206
|
-
for (const key in newlySelectedValues) {
|
|
207
|
-
if (Object.is(previouslySelectedValues[key], newlySelectedValues[key])) {
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
selectionsAreEqual = false;
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return selectionsAreEqual;
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Registers a preprocessor function that will be called before the state is updated.
|
|
218
|
-
*
|
|
219
|
-
* Preprocessors are invoked with the new and previous values whenever `next` or `partialNext` methods
|
|
220
|
-
* are called, allowing you to mutate or react to the new value before it is set. Preprocessors run in the
|
|
221
|
-
* order they were registered.
|
|
222
|
-
*
|
|
223
|
-
* @example
|
|
224
|
-
* ```ts
|
|
225
|
-
* const store = new StateStore<{ count: number; isMaxValue: bool; }>({ count: 0, isMaxValue: false });
|
|
226
|
-
*
|
|
227
|
-
* store.addPreprocessor((nextValue, prevValue) => {
|
|
228
|
-
* if (nextValue.count > 10) {
|
|
229
|
-
* nextValue.count = 10; // Clamp the value to a maximum of 10
|
|
230
|
-
* }
|
|
231
|
-
*
|
|
232
|
-
* if (nextValue.count === 10) {
|
|
233
|
-
* nextValue.isMaxValue = true; // Set isMaxValue to true if count is 10
|
|
234
|
-
* } else {
|
|
235
|
-
* nextValue.isMaxValue = false; // Reset isMaxValue otherwise
|
|
236
|
-
* }
|
|
237
|
-
* });
|
|
238
|
-
*
|
|
239
|
-
* store.partialNext({ count: 15 });
|
|
240
|
-
*
|
|
241
|
-
* store.getLatestValue(); // { count: 10, isMaxValue: true }
|
|
242
|
-
*
|
|
243
|
-
* store.partialNext({ count: 5 });
|
|
244
|
-
*
|
|
245
|
-
* store.getLatestValue(); // { count: 5, isMaxValue: false }
|
|
246
|
-
* ```
|
|
247
|
-
*
|
|
248
|
-
* @param preprocessor - The function to be called with the next and previous values before the state is updated.
|
|
249
|
-
* @returns A `RemovePreprocessor` function that removes the preprocessor when called.
|
|
250
|
-
*/
|
|
251
|
-
addPreprocessor(preprocessor) {
|
|
252
|
-
this.preprocessors.add(preprocessor);
|
|
253
|
-
return () => {
|
|
254
|
-
this.preprocessors.delete(preprocessor);
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
class MergedStateStore extends StateStore {
|
|
259
|
-
constructor({ original, merged }) {
|
|
260
|
-
const originalValue = original.getLatestValue();
|
|
261
|
-
const mergedValue = merged.getLatestValue();
|
|
262
|
-
super({
|
|
263
|
-
...originalValue,
|
|
264
|
-
...mergedValue
|
|
265
|
-
});
|
|
266
|
-
this.next = () => {
|
|
267
|
-
console.warn(`${MergedStateStore.name}.next is disabled, call original.next or merged.next instead`);
|
|
268
|
-
};
|
|
269
|
-
this.partialNext = () => {
|
|
270
|
-
console.warn(`${MergedStateStore.name}.partialNext is disabled, call original.partialNext or merged.partialNext instead`);
|
|
271
|
-
};
|
|
272
|
-
this.cachedOriginalValue = originalValue;
|
|
273
|
-
this.cachedMergedValue = mergedValue;
|
|
274
|
-
this.original = original;
|
|
275
|
-
this.merged = merged;
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Subscribes to changes in the merged state store.
|
|
279
|
-
*
|
|
280
|
-
* This method extends the base subscribe functionality to handle the merged nature of this store:
|
|
281
|
-
* 1. The first subscriber triggers registration of helper subscribers that listen to both source stores
|
|
282
|
-
* 2. Changes from either source store are propagated to this merged store
|
|
283
|
-
* 3. Source store values are cached to prevent unnecessary updates
|
|
284
|
-
*
|
|
285
|
-
* When the first subscriber is added, the method sets up listeners on both original and merged stores.
|
|
286
|
-
* These listeners update the combined store value whenever either source store changes.
|
|
287
|
-
* All subscriptions (helpers and the actual handler) are tracked so they can be properly cleaned up.
|
|
288
|
-
*
|
|
289
|
-
* @param handler - The callback function that will be executed when the state changes
|
|
290
|
-
* @returns An unsubscribe function that, when called, removes the subscription and any helper subscriptions
|
|
291
|
-
*/
|
|
292
|
-
subscribe(handler) {
|
|
293
|
-
const unsubscribeFunctions = [];
|
|
294
|
-
if (!this.handlers.size) {
|
|
295
|
-
const base = (nextValue) => {
|
|
296
|
-
super.next((currentValue) => ({
|
|
297
|
-
...currentValue,
|
|
298
|
-
...nextValue
|
|
299
|
-
}));
|
|
300
|
-
};
|
|
301
|
-
unsubscribeFunctions.push(this.original.subscribe((nextValue) => {
|
|
302
|
-
if (nextValue === this.cachedOriginalValue)
|
|
303
|
-
return;
|
|
304
|
-
this.cachedOriginalValue = nextValue;
|
|
305
|
-
base(nextValue);
|
|
306
|
-
}), this.merged.subscribe((nextValue) => {
|
|
307
|
-
if (nextValue === this.cachedMergedValue)
|
|
308
|
-
return;
|
|
309
|
-
this.cachedMergedValue = nextValue;
|
|
310
|
-
base(nextValue);
|
|
311
|
-
}));
|
|
312
|
-
}
|
|
313
|
-
unsubscribeFunctions.push(super.subscribe(handler));
|
|
314
|
-
return () => {
|
|
315
|
-
unsubscribeFunctions.forEach((unsubscribe) => unsubscribe());
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Retrieves the latest combined state from both original and merged stores.
|
|
320
|
-
*
|
|
321
|
-
* This method extends the base getLatestValue functionality to ensure the merged store
|
|
322
|
-
* remains in sync with its source stores even when there are no active subscribers.
|
|
323
|
-
*
|
|
324
|
-
* When there are no handlers registered, the method:
|
|
325
|
-
* 1. Fetches the latest values from both source stores
|
|
326
|
-
* 2. Compares them with the cached values to detect changes
|
|
327
|
-
* 3. If changes are detected, updates the internal value and caches
|
|
328
|
-
* the new source values to maintain consistency
|
|
329
|
-
*
|
|
330
|
-
* This approach ensures that calling getLatestValue() always returns the most
|
|
331
|
-
* up-to-date combined state, even if the merged store hasn't been actively
|
|
332
|
-
* receiving updates through subscriptions.
|
|
333
|
-
*
|
|
334
|
-
* @returns The latest combined state from both original and merged stores
|
|
335
|
-
*/
|
|
336
|
-
getLatestValue() {
|
|
337
|
-
if (!this.handlers.size) {
|
|
338
|
-
const originalValue = this.original.getLatestValue();
|
|
339
|
-
const mergedValue = this.merged.getLatestValue();
|
|
340
|
-
if (originalValue !== this.cachedOriginalValue || mergedValue !== this.cachedMergedValue) {
|
|
341
|
-
this.value = {
|
|
342
|
-
...originalValue,
|
|
343
|
-
...mergedValue
|
|
344
|
-
};
|
|
345
|
-
this.cachedMergedValue = mergedValue;
|
|
346
|
-
this.cachedOriginalValue = originalValue;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
return super.getLatestValue();
|
|
350
|
-
}
|
|
351
|
-
addPreprocessor() {
|
|
352
|
-
console.warn(`${MergedStateStore.name}.addPreprocessor is disabled, call original.addPreprocessor or merged.addPreprocessor instead`);
|
|
353
|
-
return noop$1;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
const noop = () => {
|
|
357
|
-
};
|
|
358
|
-
function useStateStore(store, selector2) {
|
|
359
|
-
const wrappedSubscription = require$$0.useCallback((onStoreChange) => {
|
|
360
|
-
const unsubscribe = store?.subscribeWithSelector(selector2, onStoreChange);
|
|
361
|
-
return unsubscribe ?? noop;
|
|
362
|
-
}, [store, selector2]);
|
|
363
|
-
const wrappedSnapshot = require$$0.useMemo(() => {
|
|
364
|
-
let cachedTuple;
|
|
365
|
-
return () => {
|
|
366
|
-
const currentValue = store?.getLatestValue();
|
|
367
|
-
if (!currentValue)
|
|
368
|
-
return void 0;
|
|
369
|
-
if (cachedTuple && Object.is(cachedTuple[0], currentValue)) {
|
|
370
|
-
return cachedTuple[1];
|
|
371
|
-
}
|
|
372
|
-
const newlySelected = selector2(currentValue);
|
|
373
|
-
const selectionsAreEqual = StateStore.doSelectionsEqual(cachedTuple?.[1], newlySelected);
|
|
374
|
-
if (selectionsAreEqual)
|
|
375
|
-
return cachedTuple[1];
|
|
376
|
-
cachedTuple = [currentValue, newlySelected];
|
|
377
|
-
return cachedTuple[1];
|
|
378
|
-
};
|
|
379
|
-
}, [store, selector2]);
|
|
380
|
-
const state = shimExports.useSyncExternalStore(wrappedSubscription, wrappedSnapshot);
|
|
381
|
-
return state;
|
|
382
|
-
}
|
|
3
|
+
const reactBindings = require("@stream-io/state-store/react-bindings");
|
|
4
|
+
const react = require("react");
|
|
5
|
+
const feedsClient = require("../feeds-client-c90oNdsU.js");
|
|
6
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
383
7
|
const useCreateFeedsClient = ({
|
|
384
8
|
apiKey,
|
|
385
9
|
tokenOrProvider,
|
|
386
10
|
userData,
|
|
387
11
|
options
|
|
388
12
|
}) => {
|
|
389
|
-
const [client, setClient] =
|
|
13
|
+
const [client, setClient] = react.useState(
|
|
390
14
|
() => new feedsClient.FeedsClient(apiKey, options)
|
|
391
15
|
);
|
|
392
|
-
const [error, setError] =
|
|
393
|
-
const [cachedUserData, setCachedUserData] =
|
|
394
|
-
const [cachedOptions] =
|
|
16
|
+
const [error, setError] = react.useState(null);
|
|
17
|
+
const [cachedUserData, setCachedUserData] = react.useState(userData);
|
|
18
|
+
const [cachedOptions] = react.useState(options);
|
|
395
19
|
if (error) {
|
|
396
20
|
throw error;
|
|
397
21
|
}
|
|
398
22
|
if (userData.id !== cachedUserData.id) {
|
|
399
23
|
setCachedUserData(userData);
|
|
400
24
|
}
|
|
401
|
-
|
|
25
|
+
react.useEffect(() => {
|
|
402
26
|
const _client = new feedsClient.FeedsClient(apiKey, cachedOptions);
|
|
403
27
|
const connectionPromise = _client.connectUser(cachedUserData, tokenOrProvider).then(() => {
|
|
404
28
|
setError(null);
|
|
@@ -418,13 +42,13 @@ const useCreateFeedsClient = ({
|
|
|
418
42
|
}, [apiKey, cachedUserData, cachedOptions, tokenOrProvider]);
|
|
419
43
|
return client;
|
|
420
44
|
};
|
|
421
|
-
const StreamFeedsContext =
|
|
45
|
+
const StreamFeedsContext = react.createContext(void 0);
|
|
422
46
|
const useFeedsClient = () => {
|
|
423
|
-
return
|
|
47
|
+
return react.useContext(StreamFeedsContext);
|
|
424
48
|
};
|
|
425
49
|
const useClientConnectedUser = () => {
|
|
426
50
|
const client = useFeedsClient();
|
|
427
|
-
const { user } = useStateStore(client?.state, selector$b) ?? {};
|
|
51
|
+
const { user } = reactBindings.useStateStore(client?.state, selector$b) ?? {};
|
|
428
52
|
return user;
|
|
429
53
|
};
|
|
430
54
|
const selector$b = (nextState) => ({
|
|
@@ -432,34 +56,34 @@ const selector$b = (nextState) => ({
|
|
|
432
56
|
});
|
|
433
57
|
const useWsConnectionState = () => {
|
|
434
58
|
const client = useFeedsClient();
|
|
435
|
-
const { is_healthy } = useStateStore(client?.state, selector$a) ?? {};
|
|
59
|
+
const { is_healthy } = reactBindings.useStateStore(client?.state, selector$a) ?? {};
|
|
436
60
|
return { is_healthy };
|
|
437
61
|
};
|
|
438
62
|
const selector$a = (nextState) => ({
|
|
439
63
|
is_healthy: nextState.is_ws_connection_healthy
|
|
440
64
|
});
|
|
441
|
-
const StreamFeedContext =
|
|
65
|
+
const StreamFeedContext = react.createContext(void 0);
|
|
442
66
|
const useFeedContext = () => {
|
|
443
|
-
return
|
|
67
|
+
return react.useContext(StreamFeedContext);
|
|
444
68
|
};
|
|
445
69
|
const useStableCallback = (callback) => {
|
|
446
|
-
const ref =
|
|
70
|
+
const ref = react.useRef(callback);
|
|
447
71
|
ref.current = callback;
|
|
448
|
-
return
|
|
72
|
+
return react.useCallback((...args) => {
|
|
449
73
|
return ref.current(...args);
|
|
450
74
|
}, []);
|
|
451
75
|
};
|
|
452
76
|
const useFeedActivities = (feedFromProps) => {
|
|
453
77
|
const feedFromContext = useFeedContext();
|
|
454
78
|
const feed = feedFromProps ?? feedFromContext;
|
|
455
|
-
const data = useStateStore(feed?.state, selector$9);
|
|
79
|
+
const data = reactBindings.useStateStore(feed?.state, selector$9);
|
|
456
80
|
const loadNextPage = useStableCallback(async () => {
|
|
457
81
|
if (!feed || !data?.has_next_page || data?.is_loading) {
|
|
458
82
|
return;
|
|
459
83
|
}
|
|
460
84
|
await feed.getNextPage();
|
|
461
85
|
});
|
|
462
|
-
return
|
|
86
|
+
return react.useMemo(() => ({ ...data, loadNextPage }), [data, loadNextPage]);
|
|
463
87
|
};
|
|
464
88
|
const selector$9 = ({
|
|
465
89
|
is_loading_activities,
|
|
@@ -476,15 +100,15 @@ function useComments({
|
|
|
476
100
|
}) {
|
|
477
101
|
const feedFromContext = useFeedContext();
|
|
478
102
|
const feed = feedFromProps ?? feedFromContext;
|
|
479
|
-
const selector2 =
|
|
103
|
+
const selector2 = react.useCallback(
|
|
480
104
|
(state) => ({
|
|
481
105
|
comments: state.comments_by_entity_id?.[parent.id]?.comments,
|
|
482
106
|
comments_pagination: state.comments_by_entity_id?.[parent.id]?.pagination
|
|
483
107
|
}),
|
|
484
108
|
[parent.id]
|
|
485
109
|
);
|
|
486
|
-
const data = useStateStore(feed?.state, selector2);
|
|
487
|
-
const loadNextPage =
|
|
110
|
+
const data = reactBindings.useStateStore(feed?.state, selector2);
|
|
111
|
+
const loadNextPage = react.useMemo(() => {
|
|
488
112
|
if (!feed) return void 0;
|
|
489
113
|
return (request) => {
|
|
490
114
|
if (feedsClient.isCommentResponse(parent)) {
|
|
@@ -494,7 +118,7 @@ function useComments({
|
|
|
494
118
|
}
|
|
495
119
|
};
|
|
496
120
|
}, [feed, parent]);
|
|
497
|
-
return
|
|
121
|
+
return react.useMemo(() => {
|
|
498
122
|
if (!data) {
|
|
499
123
|
return void 0;
|
|
500
124
|
}
|
|
@@ -515,7 +139,7 @@ const useOwnCapabilities = (feedFromProps) => {
|
|
|
515
139
|
const feedFromContext = useFeedContext();
|
|
516
140
|
const feed = feedFromProps ?? feedFromContext;
|
|
517
141
|
const fid = typeof feed === "string" ? feed : feed?.feed;
|
|
518
|
-
const selector2 =
|
|
142
|
+
const selector2 = react.useCallback(
|
|
519
143
|
(currentState) => {
|
|
520
144
|
if (!fid) {
|
|
521
145
|
return { feedOwnCapabilities: stableEmptyArray };
|
|
@@ -526,7 +150,7 @@ const useOwnCapabilities = (feedFromProps) => {
|
|
|
526
150
|
},
|
|
527
151
|
[fid]
|
|
528
152
|
);
|
|
529
|
-
const { feedOwnCapabilities = stableEmptyArray } = useStateStore(client?.state, selector2) ?? {};
|
|
153
|
+
const { feedOwnCapabilities = stableEmptyArray } = reactBindings.useStateStore(client?.state, selector2) ?? {};
|
|
530
154
|
return feedOwnCapabilities;
|
|
531
155
|
};
|
|
532
156
|
const selector$8 = ({
|
|
@@ -541,12 +165,12 @@ const selector$8 = ({
|
|
|
541
165
|
function useFollowers(feedFromProps) {
|
|
542
166
|
const feedFromContext = useFeedContext();
|
|
543
167
|
const feed = feedFromProps ?? feedFromContext;
|
|
544
|
-
const data = useStateStore(feed?.state, selector$8);
|
|
545
|
-
const loadNextPage =
|
|
168
|
+
const data = reactBindings.useStateStore(feed?.state, selector$8);
|
|
169
|
+
const loadNextPage = react.useCallback(
|
|
546
170
|
(...options) => feed?.loadNextPageFollowers(...options),
|
|
547
171
|
[feed]
|
|
548
172
|
);
|
|
549
|
-
return
|
|
173
|
+
return react.useMemo(() => {
|
|
550
174
|
if (!data) {
|
|
551
175
|
return void 0;
|
|
552
176
|
}
|
|
@@ -573,12 +197,12 @@ const selector$7 = ({
|
|
|
573
197
|
function useFollowing(feedFromProps) {
|
|
574
198
|
const feedFromContext = useFeedContext();
|
|
575
199
|
const feed = feedFromProps ?? feedFromContext;
|
|
576
|
-
const data = useStateStore(feed?.state, selector$7);
|
|
577
|
-
const loadNextPage =
|
|
200
|
+
const data = reactBindings.useStateStore(feed?.state, selector$7);
|
|
201
|
+
const loadNextPage = react.useCallback(
|
|
578
202
|
(...options) => feed?.loadNextPageFollowing(...options),
|
|
579
203
|
[feed]
|
|
580
204
|
);
|
|
581
|
-
return
|
|
205
|
+
return react.useMemo(() => {
|
|
582
206
|
if (!data) {
|
|
583
207
|
return void 0;
|
|
584
208
|
}
|
|
@@ -596,7 +220,7 @@ function useFollowing(feedFromProps) {
|
|
|
596
220
|
const useFeedMetadata = (feedFromProps) => {
|
|
597
221
|
const feedFromContext = useFeedContext();
|
|
598
222
|
const feed = feedFromProps ?? feedFromContext;
|
|
599
|
-
return useStateStore(feed?.state, selector$6);
|
|
223
|
+
return reactBindings.useStateStore(feed?.state, selector$6);
|
|
600
224
|
};
|
|
601
225
|
const selector$6 = ({
|
|
602
226
|
follower_count = 0,
|
|
@@ -614,7 +238,7 @@ const selector$6 = ({
|
|
|
614
238
|
const useOwnFollows = (feedFromProps) => {
|
|
615
239
|
const feedFromContext = useFeedContext();
|
|
616
240
|
const feed = feedFromProps ?? feedFromContext;
|
|
617
|
-
return useStateStore(feed?.state, selector$5);
|
|
241
|
+
return reactBindings.useStateStore(feed?.state, selector$5);
|
|
618
242
|
};
|
|
619
243
|
const selector$5 = ({ own_follows }) => ({
|
|
620
244
|
own_follows
|
|
@@ -630,7 +254,7 @@ const selector$4 = ({ notification_status }) => ({
|
|
|
630
254
|
function useNotificationStatus(feedFromProps) {
|
|
631
255
|
const feedFromContext = useFeedContext();
|
|
632
256
|
const feed = feedFromProps ?? feedFromContext;
|
|
633
|
-
return useStateStore(feed?.state, selector$4);
|
|
257
|
+
return reactBindings.useStateStore(feed?.state, selector$4);
|
|
634
258
|
}
|
|
635
259
|
const selector$3 = ({
|
|
636
260
|
is_loading_activities,
|
|
@@ -644,14 +268,14 @@ const selector$3 = ({
|
|
|
644
268
|
function useAggregatedActivities(feedFromProps) {
|
|
645
269
|
const feedFromContext = useFeedContext();
|
|
646
270
|
const feed = feedFromProps ?? feedFromContext;
|
|
647
|
-
const data = useStateStore(feed?.state, selector$3);
|
|
271
|
+
const data = reactBindings.useStateStore(feed?.state, selector$3);
|
|
648
272
|
const loadNextPage = useStableCallback(async () => {
|
|
649
273
|
if (!feed || !data?.has_next_page || data?.is_loading) {
|
|
650
274
|
return;
|
|
651
275
|
}
|
|
652
276
|
await feed.getNextPage();
|
|
653
277
|
});
|
|
654
|
-
return
|
|
278
|
+
return react.useMemo(
|
|
655
279
|
() => data ? { ...data, loadNextPage } : void 0,
|
|
656
280
|
[data, loadNextPage]
|
|
657
281
|
);
|
|
@@ -664,7 +288,7 @@ const useIsAggregatedActivityRead = ({
|
|
|
664
288
|
const feed = feedFromProps ?? feedFromContext;
|
|
665
289
|
const { read_activities: readActivities, last_read_at: lastReadAt } = useNotificationStatus(feed) ?? {};
|
|
666
290
|
const group = aggregatedActivity.group;
|
|
667
|
-
return
|
|
291
|
+
return react.useMemo(
|
|
668
292
|
() => lastReadAt && aggregatedActivity.updated_at.getTime() <= lastReadAt.getTime() || (readActivities ?? []).includes(group),
|
|
669
293
|
[lastReadAt, aggregatedActivity.updated_at, readActivities, group]
|
|
670
294
|
);
|
|
@@ -677,7 +301,7 @@ const useIsAggregatedActivitySeen = ({
|
|
|
677
301
|
const feed = feedFromProps ?? feedFromContext;
|
|
678
302
|
const { seen_activities: seenActivities, last_seen_at: lastSeenAt } = useNotificationStatus(feed) ?? {};
|
|
679
303
|
const group = aggregatedActivity.group;
|
|
680
|
-
return
|
|
304
|
+
return react.useMemo(
|
|
681
305
|
() => lastSeenAt && aggregatedActivity.updated_at.getTime() < lastSeenAt.getTime() || (seenActivities ?? []).includes(group),
|
|
682
306
|
[lastSeenAt, aggregatedActivity.updated_at, seenActivities, group]
|
|
683
307
|
);
|
|
@@ -703,18 +327,18 @@ function useActivityComments({
|
|
|
703
327
|
throw new Error("Activity or parent comment is required");
|
|
704
328
|
}
|
|
705
329
|
const entityId = parentComment?.id ?? activity?.id ?? "";
|
|
706
|
-
const selector2 =
|
|
330
|
+
const selector2 = react.useCallback(
|
|
707
331
|
(state) => ({
|
|
708
332
|
comments: state.comments_by_entity_id?.[entityId]?.comments,
|
|
709
333
|
comments_pagination: state.comments_by_entity_id?.[entityId]?.pagination
|
|
710
334
|
}),
|
|
711
335
|
[entityId]
|
|
712
336
|
);
|
|
713
|
-
const data = useStateStore(
|
|
337
|
+
const data = reactBindings.useStateStore(
|
|
714
338
|
feedOrActivity.state,
|
|
715
339
|
selector2
|
|
716
340
|
);
|
|
717
|
-
const loadNextPage =
|
|
341
|
+
const loadNextPage = react.useCallback(
|
|
718
342
|
(request) => {
|
|
719
343
|
if (parentComment) {
|
|
720
344
|
return feedOrActivity.loadNextPageCommentReplies(
|
|
@@ -733,7 +357,7 @@ function useActivityComments({
|
|
|
733
357
|
},
|
|
734
358
|
[feedOrActivity, feed, parentComment, activity]
|
|
735
359
|
);
|
|
736
|
-
return
|
|
360
|
+
return react.useMemo(() => {
|
|
737
361
|
return {
|
|
738
362
|
...data,
|
|
739
363
|
has_next_page: feedsClient.checkHasAnotherPage(
|
|
@@ -745,20 +369,20 @@ function useActivityComments({
|
|
|
745
369
|
};
|
|
746
370
|
}, [data, loadNextPage]);
|
|
747
371
|
}
|
|
748
|
-
const StreamSearchResultsContext =
|
|
372
|
+
const StreamSearchResultsContext = react.createContext(void 0);
|
|
749
373
|
const useSearchResultsContext = () => {
|
|
750
|
-
return
|
|
374
|
+
return react.useContext(StreamSearchResultsContext);
|
|
751
375
|
};
|
|
752
376
|
const useSearchResult = (sourceFromProps) => {
|
|
753
377
|
const sourceFromContext = useSearchResultsContext();
|
|
754
378
|
const source = sourceFromProps ?? sourceFromContext;
|
|
755
|
-
const { items, error, isLoading, hasNext } = useStateStore(source?.state, selector$2) ?? {};
|
|
379
|
+
const { items, error, isLoading, hasNext } = reactBindings.useStateStore(source?.state, selector$2) ?? {};
|
|
756
380
|
const loadMore = useStableCallback(async () => {
|
|
757
381
|
if (hasNext) {
|
|
758
382
|
source?.search();
|
|
759
383
|
}
|
|
760
384
|
});
|
|
761
|
-
return
|
|
385
|
+
return react.useMemo(
|
|
762
386
|
() => ({ items, error, isLoading, hasNext, loadMore }),
|
|
763
387
|
[error, hasNext, isLoading, items, loadMore]
|
|
764
388
|
);
|
|
@@ -774,14 +398,14 @@ const selector$2 = ({
|
|
|
774
398
|
hasNext,
|
|
775
399
|
error: lastQueryError
|
|
776
400
|
});
|
|
777
|
-
const StreamSearchContext =
|
|
401
|
+
const StreamSearchContext = react.createContext(void 0);
|
|
778
402
|
const useSearchContext = () => {
|
|
779
|
-
return
|
|
403
|
+
return react.useContext(StreamSearchContext);
|
|
780
404
|
};
|
|
781
405
|
const useSearchQuery = (controllerFromProps) => {
|
|
782
406
|
const controllerFromState = useSearchContext();
|
|
783
407
|
const controller = controllerFromProps ?? controllerFromState;
|
|
784
|
-
return useStateStore(controller?.state, selector$1);
|
|
408
|
+
return reactBindings.useStateStore(controller?.state, selector$1);
|
|
785
409
|
};
|
|
786
410
|
const selector$1 = ({ searchQuery }) => ({
|
|
787
411
|
searchQuery
|
|
@@ -789,534 +413,34 @@ const selector$1 = ({ searchQuery }) => ({
|
|
|
789
413
|
const useSearchSources = (controllerFromProps) => {
|
|
790
414
|
const controllerFromState = useSearchContext();
|
|
791
415
|
const controller = controllerFromProps ?? controllerFromState;
|
|
792
|
-
return useStateStore(controller?.state, selector);
|
|
416
|
+
return reactBindings.useStateStore(controller?.state, selector);
|
|
793
417
|
};
|
|
794
418
|
const selector = ({ sources }) => ({
|
|
795
419
|
sources
|
|
796
420
|
});
|
|
797
|
-
var jsxRuntime = { exports: {} };
|
|
798
|
-
var reactJsxRuntime_production = {};
|
|
799
|
-
/**
|
|
800
|
-
* @license React
|
|
801
|
-
* react-jsx-runtime.production.js
|
|
802
|
-
*
|
|
803
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
804
|
-
*
|
|
805
|
-
* This source code is licensed under the MIT license found in the
|
|
806
|
-
* LICENSE file in the root directory of this source tree.
|
|
807
|
-
*/
|
|
808
|
-
var hasRequiredReactJsxRuntime_production;
|
|
809
|
-
function requireReactJsxRuntime_production() {
|
|
810
|
-
if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
|
|
811
|
-
hasRequiredReactJsxRuntime_production = 1;
|
|
812
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
813
|
-
function jsxProd(type, config, maybeKey) {
|
|
814
|
-
var key = null;
|
|
815
|
-
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
816
|
-
void 0 !== config.key && (key = "" + config.key);
|
|
817
|
-
if ("key" in config) {
|
|
818
|
-
maybeKey = {};
|
|
819
|
-
for (var propName in config)
|
|
820
|
-
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
821
|
-
} else maybeKey = config;
|
|
822
|
-
config = maybeKey.ref;
|
|
823
|
-
return {
|
|
824
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
825
|
-
type,
|
|
826
|
-
key,
|
|
827
|
-
ref: void 0 !== config ? config : null,
|
|
828
|
-
props: maybeKey
|
|
829
|
-
};
|
|
830
|
-
}
|
|
831
|
-
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
832
|
-
reactJsxRuntime_production.jsx = jsxProd;
|
|
833
|
-
reactJsxRuntime_production.jsxs = jsxProd;
|
|
834
|
-
return reactJsxRuntime_production;
|
|
835
|
-
}
|
|
836
|
-
var reactJsxRuntime_development = {};
|
|
837
|
-
/**
|
|
838
|
-
* @license React
|
|
839
|
-
* react-jsx-runtime.development.js
|
|
840
|
-
*
|
|
841
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
842
|
-
*
|
|
843
|
-
* This source code is licensed under the MIT license found in the
|
|
844
|
-
* LICENSE file in the root directory of this source tree.
|
|
845
|
-
*/
|
|
846
|
-
var hasRequiredReactJsxRuntime_development;
|
|
847
|
-
function requireReactJsxRuntime_development() {
|
|
848
|
-
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
849
|
-
hasRequiredReactJsxRuntime_development = 1;
|
|
850
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
851
|
-
function getComponentNameFromType(type) {
|
|
852
|
-
if (null == type) return null;
|
|
853
|
-
if ("function" === typeof type)
|
|
854
|
-
return type.$$typeof === REACT_CLIENT_REFERENCE$2 ? null : type.displayName || type.name || null;
|
|
855
|
-
if ("string" === typeof type) return type;
|
|
856
|
-
switch (type) {
|
|
857
|
-
case REACT_FRAGMENT_TYPE:
|
|
858
|
-
return "Fragment";
|
|
859
|
-
case REACT_PORTAL_TYPE:
|
|
860
|
-
return "Portal";
|
|
861
|
-
case REACT_PROFILER_TYPE:
|
|
862
|
-
return "Profiler";
|
|
863
|
-
case REACT_STRICT_MODE_TYPE:
|
|
864
|
-
return "StrictMode";
|
|
865
|
-
case REACT_SUSPENSE_TYPE:
|
|
866
|
-
return "Suspense";
|
|
867
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
868
|
-
return "SuspenseList";
|
|
869
|
-
}
|
|
870
|
-
if ("object" === typeof type)
|
|
871
|
-
switch ("number" === typeof type.tag && console.error(
|
|
872
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
873
|
-
), type.$$typeof) {
|
|
874
|
-
case REACT_CONTEXT_TYPE:
|
|
875
|
-
return (type.displayName || "Context") + ".Provider";
|
|
876
|
-
case REACT_CONSUMER_TYPE:
|
|
877
|
-
return (type._context.displayName || "Context") + ".Consumer";
|
|
878
|
-
case REACT_FORWARD_REF_TYPE:
|
|
879
|
-
var innerType = type.render;
|
|
880
|
-
type = type.displayName;
|
|
881
|
-
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
882
|
-
return type;
|
|
883
|
-
case REACT_MEMO_TYPE:
|
|
884
|
-
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
885
|
-
case REACT_LAZY_TYPE:
|
|
886
|
-
innerType = type._payload;
|
|
887
|
-
type = type._init;
|
|
888
|
-
try {
|
|
889
|
-
return getComponentNameFromType(type(innerType));
|
|
890
|
-
} catch (x) {
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
return null;
|
|
894
|
-
}
|
|
895
|
-
function testStringCoercion(value) {
|
|
896
|
-
return "" + value;
|
|
897
|
-
}
|
|
898
|
-
function checkKeyStringCoercion(value) {
|
|
899
|
-
try {
|
|
900
|
-
testStringCoercion(value);
|
|
901
|
-
var JSCompiler_inline_result = false;
|
|
902
|
-
} catch (e) {
|
|
903
|
-
JSCompiler_inline_result = true;
|
|
904
|
-
}
|
|
905
|
-
if (JSCompiler_inline_result) {
|
|
906
|
-
JSCompiler_inline_result = console;
|
|
907
|
-
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
908
|
-
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
909
|
-
JSCompiler_temp_const.call(
|
|
910
|
-
JSCompiler_inline_result,
|
|
911
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
912
|
-
JSCompiler_inline_result$jscomp$0
|
|
913
|
-
);
|
|
914
|
-
return testStringCoercion(value);
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
function disabledLog() {
|
|
918
|
-
}
|
|
919
|
-
function disableLogs() {
|
|
920
|
-
if (0 === disabledDepth) {
|
|
921
|
-
prevLog = console.log;
|
|
922
|
-
prevInfo = console.info;
|
|
923
|
-
prevWarn = console.warn;
|
|
924
|
-
prevError = console.error;
|
|
925
|
-
prevGroup = console.group;
|
|
926
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
927
|
-
prevGroupEnd = console.groupEnd;
|
|
928
|
-
var props = {
|
|
929
|
-
configurable: true,
|
|
930
|
-
enumerable: true,
|
|
931
|
-
value: disabledLog,
|
|
932
|
-
writable: true
|
|
933
|
-
};
|
|
934
|
-
Object.defineProperties(console, {
|
|
935
|
-
info: props,
|
|
936
|
-
log: props,
|
|
937
|
-
warn: props,
|
|
938
|
-
error: props,
|
|
939
|
-
group: props,
|
|
940
|
-
groupCollapsed: props,
|
|
941
|
-
groupEnd: props
|
|
942
|
-
});
|
|
943
|
-
}
|
|
944
|
-
disabledDepth++;
|
|
945
|
-
}
|
|
946
|
-
function reenableLogs() {
|
|
947
|
-
disabledDepth--;
|
|
948
|
-
if (0 === disabledDepth) {
|
|
949
|
-
var props = { configurable: true, enumerable: true, writable: true };
|
|
950
|
-
Object.defineProperties(console, {
|
|
951
|
-
log: assign({}, props, { value: prevLog }),
|
|
952
|
-
info: assign({}, props, { value: prevInfo }),
|
|
953
|
-
warn: assign({}, props, { value: prevWarn }),
|
|
954
|
-
error: assign({}, props, { value: prevError }),
|
|
955
|
-
group: assign({}, props, { value: prevGroup }),
|
|
956
|
-
groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
|
|
957
|
-
groupEnd: assign({}, props, { value: prevGroupEnd })
|
|
958
|
-
});
|
|
959
|
-
}
|
|
960
|
-
0 > disabledDepth && console.error(
|
|
961
|
-
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
|
|
962
|
-
);
|
|
963
|
-
}
|
|
964
|
-
function describeBuiltInComponentFrame(name) {
|
|
965
|
-
if (void 0 === prefix)
|
|
966
|
-
try {
|
|
967
|
-
throw Error();
|
|
968
|
-
} catch (x) {
|
|
969
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
970
|
-
prefix = match && match[1] || "";
|
|
971
|
-
suffix = -1 < x.stack.indexOf("\n at") ? " (<anonymous>)" : -1 < x.stack.indexOf("@") ? "@unknown:0:0" : "";
|
|
972
|
-
}
|
|
973
|
-
return "\n" + prefix + name + suffix;
|
|
974
|
-
}
|
|
975
|
-
function describeNativeComponentFrame(fn, construct) {
|
|
976
|
-
if (!fn || reentry) return "";
|
|
977
|
-
var frame = componentFrameCache.get(fn);
|
|
978
|
-
if (void 0 !== frame) return frame;
|
|
979
|
-
reentry = true;
|
|
980
|
-
frame = Error.prepareStackTrace;
|
|
981
|
-
Error.prepareStackTrace = void 0;
|
|
982
|
-
var previousDispatcher = null;
|
|
983
|
-
previousDispatcher = ReactSharedInternals.H;
|
|
984
|
-
ReactSharedInternals.H = null;
|
|
985
|
-
disableLogs();
|
|
986
|
-
try {
|
|
987
|
-
var RunInRootFrame = {
|
|
988
|
-
DetermineComponentFrameRoot: function() {
|
|
989
|
-
try {
|
|
990
|
-
if (construct) {
|
|
991
|
-
var Fake = function() {
|
|
992
|
-
throw Error();
|
|
993
|
-
};
|
|
994
|
-
Object.defineProperty(Fake.prototype, "props", {
|
|
995
|
-
set: function() {
|
|
996
|
-
throw Error();
|
|
997
|
-
}
|
|
998
|
-
});
|
|
999
|
-
if ("object" === typeof Reflect && Reflect.construct) {
|
|
1000
|
-
try {
|
|
1001
|
-
Reflect.construct(Fake, []);
|
|
1002
|
-
} catch (x) {
|
|
1003
|
-
var control = x;
|
|
1004
|
-
}
|
|
1005
|
-
Reflect.construct(fn, [], Fake);
|
|
1006
|
-
} else {
|
|
1007
|
-
try {
|
|
1008
|
-
Fake.call();
|
|
1009
|
-
} catch (x$0) {
|
|
1010
|
-
control = x$0;
|
|
1011
|
-
}
|
|
1012
|
-
fn.call(Fake.prototype);
|
|
1013
|
-
}
|
|
1014
|
-
} else {
|
|
1015
|
-
try {
|
|
1016
|
-
throw Error();
|
|
1017
|
-
} catch (x$1) {
|
|
1018
|
-
control = x$1;
|
|
1019
|
-
}
|
|
1020
|
-
(Fake = fn()) && "function" === typeof Fake.catch && Fake.catch(function() {
|
|
1021
|
-
});
|
|
1022
|
-
}
|
|
1023
|
-
} catch (sample) {
|
|
1024
|
-
if (sample && control && "string" === typeof sample.stack)
|
|
1025
|
-
return [sample.stack, control.stack];
|
|
1026
|
-
}
|
|
1027
|
-
return [null, null];
|
|
1028
|
-
}
|
|
1029
|
-
};
|
|
1030
|
-
RunInRootFrame.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
|
|
1031
|
-
var namePropDescriptor = Object.getOwnPropertyDescriptor(
|
|
1032
|
-
RunInRootFrame.DetermineComponentFrameRoot,
|
|
1033
|
-
"name"
|
|
1034
|
-
);
|
|
1035
|
-
namePropDescriptor && namePropDescriptor.configurable && Object.defineProperty(
|
|
1036
|
-
RunInRootFrame.DetermineComponentFrameRoot,
|
|
1037
|
-
"name",
|
|
1038
|
-
{ value: "DetermineComponentFrameRoot" }
|
|
1039
|
-
);
|
|
1040
|
-
var _RunInRootFrame$Deter = RunInRootFrame.DetermineComponentFrameRoot(), sampleStack = _RunInRootFrame$Deter[0], controlStack = _RunInRootFrame$Deter[1];
|
|
1041
|
-
if (sampleStack && controlStack) {
|
|
1042
|
-
var sampleLines = sampleStack.split("\n"), controlLines = controlStack.split("\n");
|
|
1043
|
-
for (_RunInRootFrame$Deter = namePropDescriptor = 0; namePropDescriptor < sampleLines.length && !sampleLines[namePropDescriptor].includes(
|
|
1044
|
-
"DetermineComponentFrameRoot"
|
|
1045
|
-
); )
|
|
1046
|
-
namePropDescriptor++;
|
|
1047
|
-
for (; _RunInRootFrame$Deter < controlLines.length && !controlLines[_RunInRootFrame$Deter].includes(
|
|
1048
|
-
"DetermineComponentFrameRoot"
|
|
1049
|
-
); )
|
|
1050
|
-
_RunInRootFrame$Deter++;
|
|
1051
|
-
if (namePropDescriptor === sampleLines.length || _RunInRootFrame$Deter === controlLines.length)
|
|
1052
|
-
for (namePropDescriptor = sampleLines.length - 1, _RunInRootFrame$Deter = controlLines.length - 1; 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter && sampleLines[namePropDescriptor] !== controlLines[_RunInRootFrame$Deter]; )
|
|
1053
|
-
_RunInRootFrame$Deter--;
|
|
1054
|
-
for (; 1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter; namePropDescriptor--, _RunInRootFrame$Deter--)
|
|
1055
|
-
if (sampleLines[namePropDescriptor] !== controlLines[_RunInRootFrame$Deter]) {
|
|
1056
|
-
if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) {
|
|
1057
|
-
do
|
|
1058
|
-
if (namePropDescriptor--, _RunInRootFrame$Deter--, 0 > _RunInRootFrame$Deter || sampleLines[namePropDescriptor] !== controlLines[_RunInRootFrame$Deter]) {
|
|
1059
|
-
var _frame = "\n" + sampleLines[namePropDescriptor].replace(
|
|
1060
|
-
" at new ",
|
|
1061
|
-
" at "
|
|
1062
|
-
);
|
|
1063
|
-
fn.displayName && _frame.includes("<anonymous>") && (_frame = _frame.replace("<anonymous>", fn.displayName));
|
|
1064
|
-
"function" === typeof fn && componentFrameCache.set(fn, _frame);
|
|
1065
|
-
return _frame;
|
|
1066
|
-
}
|
|
1067
|
-
while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter);
|
|
1068
|
-
}
|
|
1069
|
-
break;
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
} finally {
|
|
1073
|
-
reentry = false, ReactSharedInternals.H = previousDispatcher, reenableLogs(), Error.prepareStackTrace = frame;
|
|
1074
|
-
}
|
|
1075
|
-
sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "") ? describeBuiltInComponentFrame(sampleLines) : "";
|
|
1076
|
-
"function" === typeof fn && componentFrameCache.set(fn, sampleLines);
|
|
1077
|
-
return sampleLines;
|
|
1078
|
-
}
|
|
1079
|
-
function describeUnknownElementTypeFrameInDEV(type) {
|
|
1080
|
-
if (null == type) return "";
|
|
1081
|
-
if ("function" === typeof type) {
|
|
1082
|
-
var prototype = type.prototype;
|
|
1083
|
-
return describeNativeComponentFrame(
|
|
1084
|
-
type,
|
|
1085
|
-
!(!prototype || !prototype.isReactComponent)
|
|
1086
|
-
);
|
|
1087
|
-
}
|
|
1088
|
-
if ("string" === typeof type) return describeBuiltInComponentFrame(type);
|
|
1089
|
-
switch (type) {
|
|
1090
|
-
case REACT_SUSPENSE_TYPE:
|
|
1091
|
-
return describeBuiltInComponentFrame("Suspense");
|
|
1092
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
1093
|
-
return describeBuiltInComponentFrame("SuspenseList");
|
|
1094
|
-
}
|
|
1095
|
-
if ("object" === typeof type)
|
|
1096
|
-
switch (type.$$typeof) {
|
|
1097
|
-
case REACT_FORWARD_REF_TYPE:
|
|
1098
|
-
return type = describeNativeComponentFrame(type.render, false), type;
|
|
1099
|
-
case REACT_MEMO_TYPE:
|
|
1100
|
-
return describeUnknownElementTypeFrameInDEV(type.type);
|
|
1101
|
-
case REACT_LAZY_TYPE:
|
|
1102
|
-
prototype = type._payload;
|
|
1103
|
-
type = type._init;
|
|
1104
|
-
try {
|
|
1105
|
-
return describeUnknownElementTypeFrameInDEV(type(prototype));
|
|
1106
|
-
} catch (x) {
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
return "";
|
|
1110
|
-
}
|
|
1111
|
-
function getOwner() {
|
|
1112
|
-
var dispatcher = ReactSharedInternals.A;
|
|
1113
|
-
return null === dispatcher ? null : dispatcher.getOwner();
|
|
1114
|
-
}
|
|
1115
|
-
function hasValidKey(config) {
|
|
1116
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
1117
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
1118
|
-
if (getter && getter.isReactWarning) return false;
|
|
1119
|
-
}
|
|
1120
|
-
return void 0 !== config.key;
|
|
1121
|
-
}
|
|
1122
|
-
function defineKeyPropWarningGetter(props, displayName) {
|
|
1123
|
-
function warnAboutAccessingKey() {
|
|
1124
|
-
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
|
1125
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
1126
|
-
displayName
|
|
1127
|
-
));
|
|
1128
|
-
}
|
|
1129
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
1130
|
-
Object.defineProperty(props, "key", {
|
|
1131
|
-
get: warnAboutAccessingKey,
|
|
1132
|
-
configurable: true
|
|
1133
|
-
});
|
|
1134
|
-
}
|
|
1135
|
-
function elementRefGetterWithDeprecationWarning() {
|
|
1136
|
-
var componentName = getComponentNameFromType(this.type);
|
|
1137
|
-
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
|
1138
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
1139
|
-
));
|
|
1140
|
-
componentName = this.props.ref;
|
|
1141
|
-
return void 0 !== componentName ? componentName : null;
|
|
1142
|
-
}
|
|
1143
|
-
function ReactElement(type, key, self, source, owner, props) {
|
|
1144
|
-
self = props.ref;
|
|
1145
|
-
type = {
|
|
1146
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
1147
|
-
type,
|
|
1148
|
-
key,
|
|
1149
|
-
props,
|
|
1150
|
-
_owner: owner
|
|
1151
|
-
};
|
|
1152
|
-
null !== (void 0 !== self ? self : null) ? Object.defineProperty(type, "ref", {
|
|
1153
|
-
enumerable: false,
|
|
1154
|
-
get: elementRefGetterWithDeprecationWarning
|
|
1155
|
-
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
1156
|
-
type._store = {};
|
|
1157
|
-
Object.defineProperty(type._store, "validated", {
|
|
1158
|
-
configurable: false,
|
|
1159
|
-
enumerable: false,
|
|
1160
|
-
writable: true,
|
|
1161
|
-
value: 0
|
|
1162
|
-
});
|
|
1163
|
-
Object.defineProperty(type, "_debugInfo", {
|
|
1164
|
-
configurable: false,
|
|
1165
|
-
enumerable: false,
|
|
1166
|
-
writable: true,
|
|
1167
|
-
value: null
|
|
1168
|
-
});
|
|
1169
|
-
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
1170
|
-
return type;
|
|
1171
|
-
}
|
|
1172
|
-
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, source, self) {
|
|
1173
|
-
if ("string" === typeof type || "function" === typeof type || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_OFFSCREEN_TYPE || "object" === typeof type && null !== type && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE$1 || void 0 !== type.getModuleId)) {
|
|
1174
|
-
var children = config.children;
|
|
1175
|
-
if (void 0 !== children)
|
|
1176
|
-
if (isStaticChildren)
|
|
1177
|
-
if (isArrayImpl(children)) {
|
|
1178
|
-
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
|
|
1179
|
-
validateChildKeys(children[isStaticChildren], type);
|
|
1180
|
-
Object.freeze && Object.freeze(children);
|
|
1181
|
-
} else
|
|
1182
|
-
console.error(
|
|
1183
|
-
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
1184
|
-
);
|
|
1185
|
-
else validateChildKeys(children, type);
|
|
1186
|
-
} else {
|
|
1187
|
-
children = "";
|
|
1188
|
-
if (void 0 === type || "object" === typeof type && null !== type && 0 === Object.keys(type).length)
|
|
1189
|
-
children += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
1190
|
-
null === type ? isStaticChildren = "null" : isArrayImpl(type) ? isStaticChildren = "array" : void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE ? (isStaticChildren = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />", children = " Did you accidentally export a JSX literal instead of a component?") : isStaticChildren = typeof type;
|
|
1191
|
-
console.error(
|
|
1192
|
-
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
|
|
1193
|
-
isStaticChildren,
|
|
1194
|
-
children
|
|
1195
|
-
);
|
|
1196
|
-
}
|
|
1197
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
1198
|
-
children = getComponentNameFromType(type);
|
|
1199
|
-
var keys = Object.keys(config).filter(function(k) {
|
|
1200
|
-
return "key" !== k;
|
|
1201
|
-
});
|
|
1202
|
-
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1203
|
-
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
1204
|
-
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
1205
|
-
isStaticChildren,
|
|
1206
|
-
children,
|
|
1207
|
-
keys,
|
|
1208
|
-
children
|
|
1209
|
-
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
|
1210
|
-
}
|
|
1211
|
-
children = null;
|
|
1212
|
-
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
|
1213
|
-
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
|
1214
|
-
if ("key" in config) {
|
|
1215
|
-
maybeKey = {};
|
|
1216
|
-
for (var propName in config)
|
|
1217
|
-
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
1218
|
-
} else maybeKey = config;
|
|
1219
|
-
children && defineKeyPropWarningGetter(
|
|
1220
|
-
maybeKey,
|
|
1221
|
-
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
1222
|
-
);
|
|
1223
|
-
return ReactElement(type, children, self, source, getOwner(), maybeKey);
|
|
1224
|
-
}
|
|
1225
|
-
function validateChildKeys(node, parentType) {
|
|
1226
|
-
if ("object" === typeof node && node && node.$$typeof !== REACT_CLIENT_REFERENCE) {
|
|
1227
|
-
if (isArrayImpl(node))
|
|
1228
|
-
for (var i = 0; i < node.length; i++) {
|
|
1229
|
-
var child = node[i];
|
|
1230
|
-
isValidElement(child) && validateExplicitKey(child, parentType);
|
|
1231
|
-
}
|
|
1232
|
-
else if (isValidElement(node))
|
|
1233
|
-
node._store && (node._store.validated = 1);
|
|
1234
|
-
else if (null === node || "object" !== typeof node ? i = null : (i = MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL] || node["@@iterator"], i = "function" === typeof i ? i : null), "function" === typeof i && i !== node.entries && (i = i.call(node), i !== node))
|
|
1235
|
-
for (; !(node = i.next()).done; )
|
|
1236
|
-
isValidElement(node.value) && validateExplicitKey(node.value, parentType);
|
|
1237
|
-
}
|
|
1238
|
-
}
|
|
1239
|
-
function isValidElement(object) {
|
|
1240
|
-
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1241
|
-
}
|
|
1242
|
-
function validateExplicitKey(element, parentType) {
|
|
1243
|
-
if (element._store && !element._store.validated && null == element.key && (element._store.validated = 1, parentType = getCurrentComponentErrorInfo(parentType), !ownerHasKeyUseWarning[parentType])) {
|
|
1244
|
-
ownerHasKeyUseWarning[parentType] = true;
|
|
1245
|
-
var childOwner = "";
|
|
1246
|
-
element && null != element._owner && element._owner !== getOwner() && (childOwner = null, "number" === typeof element._owner.tag ? childOwner = getComponentNameFromType(element._owner.type) : "string" === typeof element._owner.name && (childOwner = element._owner.name), childOwner = " It was passed a child from " + childOwner + ".");
|
|
1247
|
-
var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
|
|
1248
|
-
ReactSharedInternals.getCurrentStack = function() {
|
|
1249
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type);
|
|
1250
|
-
prevGetCurrentStack && (stack += prevGetCurrentStack() || "");
|
|
1251
|
-
return stack;
|
|
1252
|
-
};
|
|
1253
|
-
console.error(
|
|
1254
|
-
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
|
1255
|
-
parentType,
|
|
1256
|
-
childOwner
|
|
1257
|
-
);
|
|
1258
|
-
ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
|
|
1259
|
-
}
|
|
1260
|
-
}
|
|
1261
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
1262
|
-
var info = "", owner = getOwner();
|
|
1263
|
-
owner && (owner = getComponentNameFromType(owner.type)) && (info = "\n\nCheck the render method of `" + owner + "`.");
|
|
1264
|
-
info || (parentType = getComponentNameFromType(parentType)) && (info = "\n\nCheck the top-level render call using <" + parentType + ">.");
|
|
1265
|
-
return info;
|
|
1266
|
-
}
|
|
1267
|
-
var React = require$$0, REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
1268
|
-
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, assign = Object.assign, REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, disabledDepth = 0, prevLog, prevInfo, prevWarn, prevError, prevGroup, prevGroupCollapsed, prevGroupEnd;
|
|
1269
|
-
disabledLog.__reactDisabledLog = true;
|
|
1270
|
-
var prefix, suffix, reentry = false;
|
|
1271
|
-
var componentFrameCache = new ("function" === typeof WeakMap ? WeakMap : Map)();
|
|
1272
|
-
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), specialPropKeyWarningShown;
|
|
1273
|
-
var didWarnAboutElementRef = {};
|
|
1274
|
-
var didWarnAboutKeySpread = {}, ownerHasKeyUseWarning = {};
|
|
1275
|
-
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
1276
|
-
reactJsxRuntime_development.jsx = function(type, config, maybeKey, source, self) {
|
|
1277
|
-
return jsxDEVImpl(type, config, maybeKey, false, source, self);
|
|
1278
|
-
};
|
|
1279
|
-
reactJsxRuntime_development.jsxs = function(type, config, maybeKey, source, self) {
|
|
1280
|
-
return jsxDEVImpl(type, config, maybeKey, true, source, self);
|
|
1281
|
-
};
|
|
1282
|
-
}();
|
|
1283
|
-
return reactJsxRuntime_development;
|
|
1284
|
-
}
|
|
1285
|
-
var hasRequiredJsxRuntime;
|
|
1286
|
-
function requireJsxRuntime() {
|
|
1287
|
-
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
1288
|
-
hasRequiredJsxRuntime = 1;
|
|
1289
|
-
if (process.env.NODE_ENV === "production") {
|
|
1290
|
-
jsxRuntime.exports = requireReactJsxRuntime_production();
|
|
1291
|
-
} else {
|
|
1292
|
-
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
1293
|
-
}
|
|
1294
|
-
return jsxRuntime.exports;
|
|
1295
|
-
}
|
|
1296
|
-
var jsxRuntimeExports = requireJsxRuntime();
|
|
1297
421
|
const StreamFeeds = ({ client, children }) => {
|
|
1298
|
-
return /* @__PURE__ */
|
|
422
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StreamFeedsContext.Provider, { value: client, children });
|
|
1299
423
|
};
|
|
1300
424
|
StreamFeeds.displayName = "StreamFeeds";
|
|
1301
425
|
const StreamFeed = ({
|
|
1302
426
|
feed,
|
|
1303
427
|
children
|
|
1304
428
|
}) => {
|
|
1305
|
-
return /* @__PURE__ */
|
|
429
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StreamFeedContext.Provider, { value: feed, children });
|
|
1306
430
|
};
|
|
1307
431
|
StreamFeed.displayName = "StreamFeed";
|
|
1308
432
|
const StreamSearch = ({
|
|
1309
433
|
searchController,
|
|
1310
434
|
children
|
|
1311
435
|
}) => {
|
|
1312
|
-
return /* @__PURE__ */
|
|
436
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StreamSearchContext.Provider, { value: searchController, children });
|
|
1313
437
|
};
|
|
1314
438
|
StreamSearch.displayName = "StreamSearch";
|
|
1315
439
|
const StreamSearchResults = ({
|
|
1316
440
|
source,
|
|
1317
441
|
children
|
|
1318
442
|
}) => {
|
|
1319
|
-
return /* @__PURE__ */
|
|
443
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StreamSearchResultsContext.Provider, { value: source, children });
|
|
1320
444
|
};
|
|
1321
445
|
StreamSearchResults.displayName = "StreamSearchResults";
|
|
1322
446
|
exports.StreamFeed = StreamFeed;
|
|
@@ -1348,6 +472,11 @@ exports.useSearchQuery = useSearchQuery;
|
|
|
1348
472
|
exports.useSearchResult = useSearchResult;
|
|
1349
473
|
exports.useSearchResultsContext = useSearchResultsContext;
|
|
1350
474
|
exports.useSearchSources = useSearchSources;
|
|
1351
|
-
exports.useStateStore = useStateStore;
|
|
1352
475
|
exports.useWsConnectionState = useWsConnectionState;
|
|
476
|
+
Object.keys(reactBindings).forEach((k) => {
|
|
477
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
478
|
+
enumerable: true,
|
|
479
|
+
get: () => reactBindings[k]
|
|
480
|
+
});
|
|
481
|
+
});
|
|
1353
482
|
//# sourceMappingURL=react-bindings.js.map
|