@stream-io/video-react-sdk 1.21.3 → 1.23.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 +27 -0
- package/README.md +1 -0
- package/dist/index.cjs.js +48 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +48 -5
- package/dist/index.es.js.map +1 -1
- package/dist/src/utilities/filter.d.ts +16 -1
- package/index.ts +1 -0
- package/package.json +4 -4
- package/src/components/CallParticipantsList/CallParticipantsList.tsx +3 -1
- package/src/utilities/filter.test.ts +20 -0
- package/src/utilities/filter.ts +54 -2
package/dist/index.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export * from './src/components';
|
|
|
5
5
|
export * from './src/wrappers';
|
|
6
6
|
export * from './src/translations';
|
|
7
7
|
export { useHorizontalScrollPosition, useVerticalScrollPosition, useRequestPermission, usePersistedDevicePreferences, useDeviceList, } from './src/hooks';
|
|
8
|
+
export { applyFilter, type Filter } from './src/utilities/filter';
|
package/dist/index.es.js
CHANGED
|
@@ -1901,10 +1901,11 @@ const CallParticipantsList = ({ onClose, activeUsersSearchFn, blockedUsersSearch
|
|
|
1901
1901
|
};
|
|
1902
1902
|
const CallParticipantListContentHeader = ({ userListType, setUserListType, }) => {
|
|
1903
1903
|
const call = useCall();
|
|
1904
|
+
const { t } = useI18n();
|
|
1904
1905
|
const muteAll = useCallback(() => {
|
|
1905
1906
|
call?.muteAllUsers('audio');
|
|
1906
1907
|
}, [call]);
|
|
1907
|
-
return (jsxs("div", { className: "str-video__participant-list__content-header", children: [jsx("div", { className: "str-video__participant-list__content-header-title", children: userListType === 'active' && (jsx(Restricted, { requiredGrants: [OwnCapability.MUTE_USERS], hasPermissionsOnly: true, children: jsx(TextButton, { onClick: muteAll, children:
|
|
1908
|
+
return (jsxs("div", { className: "str-video__participant-list__content-header", children: [jsx("div", { className: "str-video__participant-list__content-header-title", children: userListType === 'active' && (jsx(Restricted, { requiredGrants: [OwnCapability.MUTE_USERS], hasPermissionsOnly: true, children: jsx(TextButton, { onClick: muteAll, children: t('Mute all') }) })) }), jsx(MenuToggle, { placement: "bottom-end", ToggleButton: ToggleButton$1, children: jsx(GenericMenu, { children: Object.keys(UserListTypes).map((lt) => (jsx(GenericMenuButtonItem, { "aria-selected": lt === userListType, onClick: () => setUserListType(lt), children: UserListTypes[lt] }, lt))) }) })] }));
|
|
1908
1909
|
};
|
|
1909
1910
|
const ActiveUsersSearchResults = ({ searchQuery, activeUsersSearchFn: activeUsersSearchFnFromProps, debounceSearchInterval, }) => {
|
|
1910
1911
|
const { useParticipants } = useCallStateHooks();
|
|
@@ -2473,15 +2474,26 @@ function applyFilter(obj, filter) {
|
|
|
2473
2474
|
}
|
|
2474
2475
|
return checkConditions(obj, filter);
|
|
2475
2476
|
}
|
|
2477
|
+
const isDateString = (value) => typeof value === 'string' &&
|
|
2478
|
+
/^((?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))(Z|[+-]\d{2}:\d{2})?)$/.test(value);
|
|
2476
2479
|
function checkConditions(obj, conditions) {
|
|
2477
2480
|
let match = true;
|
|
2478
2481
|
for (const key of Object.keys(conditions)) {
|
|
2479
2482
|
const operator = conditions[key];
|
|
2480
2483
|
const maybeOperator = operator && typeof operator === 'object';
|
|
2481
|
-
|
|
2484
|
+
let value = obj[key];
|
|
2485
|
+
if (value instanceof Date) {
|
|
2486
|
+
value = value.getTime();
|
|
2487
|
+
}
|
|
2488
|
+
else if (isDateString(value)) {
|
|
2489
|
+
value = new Date(value).getTime();
|
|
2490
|
+
}
|
|
2482
2491
|
if (maybeOperator && '$eq' in operator) {
|
|
2483
2492
|
const eqOperator = operator;
|
|
2484
|
-
|
|
2493
|
+
const eqOperatorValue = isDateString(eqOperator.$eq)
|
|
2494
|
+
? new Date(eqOperator.$eq).getTime()
|
|
2495
|
+
: eqOperator.$eq;
|
|
2496
|
+
match && (match = eqOperatorValue === value);
|
|
2485
2497
|
}
|
|
2486
2498
|
else if (maybeOperator && '$neq' in operator) {
|
|
2487
2499
|
const neqOperator = operator;
|
|
@@ -2500,6 +2512,37 @@ function checkConditions(obj, conditions) {
|
|
|
2500
2512
|
match = false;
|
|
2501
2513
|
}
|
|
2502
2514
|
}
|
|
2515
|
+
else if (maybeOperator && '$gt' in operator) {
|
|
2516
|
+
const gtOperator = operator;
|
|
2517
|
+
const gtOperatorValue = isDateString(gtOperator.$gt)
|
|
2518
|
+
? new Date(gtOperator.$gt).getTime()
|
|
2519
|
+
: gtOperator.$gt;
|
|
2520
|
+
match && (match = value > gtOperatorValue);
|
|
2521
|
+
}
|
|
2522
|
+
else if (maybeOperator && '$gte' in operator) {
|
|
2523
|
+
const gteOperator = operator;
|
|
2524
|
+
const gteOperatorValue = isDateString(gteOperator.$gte)
|
|
2525
|
+
? new Date(gteOperator.$gte).getTime()
|
|
2526
|
+
: gteOperator.$gte;
|
|
2527
|
+
match && (match = value >= gteOperatorValue);
|
|
2528
|
+
}
|
|
2529
|
+
else if (maybeOperator && '$lt' in operator) {
|
|
2530
|
+
const ltOperator = operator;
|
|
2531
|
+
const ltOperatorValue = isDateString(ltOperator.$lt)
|
|
2532
|
+
? new Date(ltOperator.$lt).getTime()
|
|
2533
|
+
: ltOperator.$lt;
|
|
2534
|
+
match && (match = value < ltOperatorValue);
|
|
2535
|
+
}
|
|
2536
|
+
else if (maybeOperator && '$lte' in operator) {
|
|
2537
|
+
const lteOperator = operator;
|
|
2538
|
+
const lteOperatorValue = isDateString(lteOperator.$lte)
|
|
2539
|
+
? new Date(lteOperator.$lte).getTime()
|
|
2540
|
+
: lteOperator.$lte;
|
|
2541
|
+
match && (match = value <= lteOperatorValue);
|
|
2542
|
+
// } else if (maybeOperator && '$autocomplete' in operator) {
|
|
2543
|
+
// TODO: regexp solution maybe?
|
|
2544
|
+
// match &&= false;
|
|
2545
|
+
}
|
|
2503
2546
|
else {
|
|
2504
2547
|
const eqValue = operator;
|
|
2505
2548
|
match && (match = eqValue === value);
|
|
@@ -2973,7 +3016,7 @@ const checkCanJoinEarly = (startsAt, joinAheadTimeSeconds) => {
|
|
|
2973
3016
|
return Date.now() >= +startsAt - (joinAheadTimeSeconds ?? 0) * 1000;
|
|
2974
3017
|
};
|
|
2975
3018
|
|
|
2976
|
-
const [major, minor, patch] = ("1.
|
|
3019
|
+
const [major, minor, patch] = ("1.23.0").split('.');
|
|
2977
3020
|
setSdkInfo({
|
|
2978
3021
|
type: SfuModels.SdkType.REACT,
|
|
2979
3022
|
major,
|
|
@@ -2981,5 +3024,5 @@ setSdkInfo({
|
|
|
2981
3024
|
patch,
|
|
2982
3025
|
});
|
|
2983
3026
|
|
|
2984
|
-
export { AcceptCallButton, Audio, Avatar, AvatarFallback, BackgroundFiltersProvider, BackstageLayout, BaseVideo, CallControls, CallParticipantListing, CallParticipantListingItem, CallParticipantsList, CallPreview, CallRecordingList, CallRecordingListHeader, CallRecordingListItem, CallStats, CallStatsButton, CancelCallButton, CancelCallConfirmButton, CompositeButton, DefaultParticipantViewUI, DefaultReactionsMenu, DefaultScreenShareOverlay, DefaultVideoPlaceholder, DeviceSelector, DeviceSelectorAudioInput, DeviceSelectorAudioOutput, DeviceSelectorVideo, DeviceSettings, DropDownSelect, DropDownSelectOption, EmptyCallRecordingListing, GenericMenu, GenericMenuButtonItem, Icon, IconButton, LivestreamLayout, LivestreamPlayer, LoadingCallRecordingListing, LoadingIndicator, MenuToggle, MenuVisualType, NoiseCancellationProvider, Notification, PaginatedGridLayout, ParticipantActionsContextMenu, ParticipantDetails, ParticipantView, ParticipantViewContext, ParticipantsAudio, PermissionNotification, PermissionRequestList, PermissionRequests, PipLayout, Reaction, ReactionsButton, RecordCallButton, RecordCallConfirmationButton, RecordingInProgressNotification, RingingCall, RingingCallControls, ScreenShareButton, SearchInput, SearchResults, SpeakerLayout, SpeakingWhileMutedNotification, SpeechIndicator, StatCard, StreamCall, StreamTheme, StreamVideo, TextButton, ToggleAudioOutputButton, ToggleAudioPreviewButton, ToggleAudioPublishingButton, ToggleVideoPreviewButton, ToggleVideoPublishingButton, Tooltip, Video$1 as Video, VideoPreview, WithTooltip, defaultEmojiReactionMap, defaultReactions, translations, useBackgroundFilters, useDeviceList, useFilteredParticipants, useHorizontalScrollPosition, useMenuContext, useNoiseCancellation, useParticipantViewContext, usePersistedDevicePreferences, useRequestPermission, useTrackElementVisibility, useVerticalScrollPosition };
|
|
3027
|
+
export { AcceptCallButton, Audio, Avatar, AvatarFallback, BackgroundFiltersProvider, BackstageLayout, BaseVideo, CallControls, CallParticipantListing, CallParticipantListingItem, CallParticipantsList, CallPreview, CallRecordingList, CallRecordingListHeader, CallRecordingListItem, CallStats, CallStatsButton, CancelCallButton, CancelCallConfirmButton, CompositeButton, DefaultParticipantViewUI, DefaultReactionsMenu, DefaultScreenShareOverlay, DefaultVideoPlaceholder, DeviceSelector, DeviceSelectorAudioInput, DeviceSelectorAudioOutput, DeviceSelectorVideo, DeviceSettings, DropDownSelect, DropDownSelectOption, EmptyCallRecordingListing, GenericMenu, GenericMenuButtonItem, Icon, IconButton, LivestreamLayout, LivestreamPlayer, LoadingCallRecordingListing, LoadingIndicator, MenuToggle, MenuVisualType, NoiseCancellationProvider, Notification, PaginatedGridLayout, ParticipantActionsContextMenu, ParticipantDetails, ParticipantView, ParticipantViewContext, ParticipantsAudio, PermissionNotification, PermissionRequestList, PermissionRequests, PipLayout, Reaction, ReactionsButton, RecordCallButton, RecordCallConfirmationButton, RecordingInProgressNotification, RingingCall, RingingCallControls, ScreenShareButton, SearchInput, SearchResults, SpeakerLayout, SpeakingWhileMutedNotification, SpeechIndicator, StatCard, StreamCall, StreamTheme, StreamVideo, TextButton, ToggleAudioOutputButton, ToggleAudioPreviewButton, ToggleAudioPublishingButton, ToggleVideoPreviewButton, ToggleVideoPublishingButton, Tooltip, Video$1 as Video, VideoPreview, WithTooltip, applyFilter, defaultEmojiReactionMap, defaultReactions, translations, useBackgroundFilters, useDeviceList, useFilteredParticipants, useHorizontalScrollPosition, useMenuContext, useNoiseCancellation, useParticipantViewContext, usePersistedDevicePreferences, useRequestPermission, useTrackElementVisibility, useVerticalScrollPosition };
|
|
2985
3028
|
//# sourceMappingURL=index.es.js.map
|