@messenger-box/slack-ui-browser 10.0.3-alpha.176
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 +8 -0
- package/LICENSE +21 -0
- package/lib/components/Home/Channels.js +62 -0
- package/lib/components/Home/Channels.js.map +1 -0
- package/lib/components/Home/DirectChannels.js +92 -0
- package/lib/components/Home/DirectChannels.js.map +1 -0
- package/lib/components/Home/InviteMembers.js +70 -0
- package/lib/components/Home/InviteMembers.js.map +1 -0
- package/lib/components/Home/Teams.js +62 -0
- package/lib/components/Home/Teams.js.map +1 -0
- package/lib/components/Home/TopCommonSlider.js +35 -0
- package/lib/components/Home/TopCommonSlider.js.map +1 -0
- package/lib/compute.js +223 -0
- package/lib/compute.js.map +1 -0
- package/lib/constants/routes.js +63 -0
- package/lib/constants/routes.js.map +1 -0
- package/lib/hooks/useOptimizedChannelsQueries.js +107 -0
- package/lib/hooks/useOptimizedChannelsQueries.js.map +1 -0
- package/lib/hooks/useRouteState.js +193 -0
- package/lib/hooks/useRouteState.js.map +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -0
- package/lib/machines/routeMachine.js +804 -0
- package/lib/machines/routeMachine.js.map +1 -0
- package/lib/module.js +3 -0
- package/lib/module.js.map +1 -0
- package/lib/queries/slackuiQueries.js +144 -0
- package/lib/queries/slackuiQueries.js.map +1 -0
- package/lib/routes.json +260 -0
- package/lib/screens/Home/HomeScreen.js +664 -0
- package/lib/screens/Home/HomeScreen.js.map +1 -0
- package/lib/screens/Home/index.js +1 -0
- package/lib/screens/Home/index.js.map +1 -0
- package/package.json +52 -0
- package/rollup.config.mjs +41 -0
- package/src/components/Home/Channels.tsx +135 -0
- package/src/components/Home/DirectChannels.tsx +185 -0
- package/src/components/Home/InviteMembers.tsx +134 -0
- package/src/components/Home/Teams.tsx +129 -0
- package/src/components/Home/TopCommonSlider.tsx +70 -0
- package/src/components/Home/index.ts +5 -0
- package/src/components/index.ts +1 -0
- package/src/compute.ts +156 -0
- package/src/constants/index.ts +1 -0
- package/src/constants/routes.ts +92 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useOptimizedChannelsQueries.ts +165 -0
- package/src/hooks/useRouteState.ts +253 -0
- package/src/icons.ts +137 -0
- package/src/index.ts +11 -0
- package/src/machines/index.ts +9 -0
- package/src/machines/routeMachine.ts +682 -0
- package/src/module.tsx +6 -0
- package/src/queries/index.ts +1 -0
- package/src/queries/slackuiQueries.ts +227 -0
- package/src/screens/Home/HomeScreen.tsx +1308 -0
- package/src/screens/Home/index.ts +4 -0
- package/src/screens/NewChannel/NewChannelScreen.tsx +188 -0
- package/src/screens/NewChannel/index.ts +2 -0
- package/src/screens/index.ts +1 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { useMemo, useCallback } from 'react';
|
|
2
|
+
import { RoomType } from 'common';
|
|
3
|
+
import { useChannelsQuery } from '../queries/slackuiQueries';
|
|
4
|
+
import { orderBy, uniqBy, take } from 'lodash-es';
|
|
5
|
+
|
|
6
|
+
interface UseOptimizedChannelsQueriesProps {
|
|
7
|
+
orgName: string;
|
|
8
|
+
teamId?: string | null;
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface ChannelFilters {
|
|
13
|
+
includeChannels?: boolean;
|
|
14
|
+
includeDirectMessages?: boolean;
|
|
15
|
+
channelLimit?: number;
|
|
16
|
+
directMessageLimit?: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const defaultChannelTypes = [RoomType.Channel, RoomType.Private, RoomType.Public];
|
|
20
|
+
|
|
21
|
+
export const useOptimizedChannelsQueries = ({
|
|
22
|
+
orgName,
|
|
23
|
+
teamId = null,
|
|
24
|
+
enabled = true,
|
|
25
|
+
}: UseOptimizedChannelsQueriesProps) => {
|
|
26
|
+
// Single optimized query that fetches all channel types at once
|
|
27
|
+
const {
|
|
28
|
+
data: allChannelsData,
|
|
29
|
+
loading,
|
|
30
|
+
error,
|
|
31
|
+
refetch: refetchAllChannels,
|
|
32
|
+
} = useChannelsQuery({
|
|
33
|
+
variables: {
|
|
34
|
+
criteria: {
|
|
35
|
+
orgName,
|
|
36
|
+
type: [...defaultChannelTypes, RoomType.Direct],
|
|
37
|
+
team: teamId,
|
|
38
|
+
},
|
|
39
|
+
limit: 100,
|
|
40
|
+
},
|
|
41
|
+
fetchPolicy: 'cache-and-network',
|
|
42
|
+
nextFetchPolicy: 'cache-first',
|
|
43
|
+
skip: !enabled || !orgName,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// Memoized data selectors for different channel types
|
|
47
|
+
const channelsData = useMemo(() => {
|
|
48
|
+
if (!allChannelsData?.channelsByUser) return [];
|
|
49
|
+
|
|
50
|
+
return orderBy(
|
|
51
|
+
uniqBy(
|
|
52
|
+
allChannelsData.channelsByUser.filter(
|
|
53
|
+
(channel: any) => defaultChannelTypes.includes(channel.type) && channel.type !== RoomType.Direct,
|
|
54
|
+
),
|
|
55
|
+
'id',
|
|
56
|
+
),
|
|
57
|
+
[(ch: any) => ch.title?.toLowerCase()],
|
|
58
|
+
['asc'],
|
|
59
|
+
);
|
|
60
|
+
}, [allChannelsData?.channelsByUser]);
|
|
61
|
+
|
|
62
|
+
const directChannelsData = useMemo(() => {
|
|
63
|
+
if (!allChannelsData?.channelsByUser) return [];
|
|
64
|
+
|
|
65
|
+
return orderBy(
|
|
66
|
+
uniqBy(
|
|
67
|
+
allChannelsData.channelsByUser.filter((channel: any) => channel.type === RoomType.Direct),
|
|
68
|
+
'id',
|
|
69
|
+
),
|
|
70
|
+
[(ch: any) => ch.members?.[0]?.user?.givenName || ''],
|
|
71
|
+
['asc'],
|
|
72
|
+
);
|
|
73
|
+
}, [allChannelsData?.channelsByUser]);
|
|
74
|
+
|
|
75
|
+
// Optimized refetch function that accepts filters
|
|
76
|
+
const refetchChannels = useCallback(
|
|
77
|
+
(filters?: ChannelFilters) => {
|
|
78
|
+
const { includeChannels = true, includeDirectMessages = true } = filters || {};
|
|
79
|
+
|
|
80
|
+
const types: RoomType[] = [];
|
|
81
|
+
if (includeChannels) types.push(...defaultChannelTypes);
|
|
82
|
+
if (includeDirectMessages) types.push(RoomType.Direct);
|
|
83
|
+
|
|
84
|
+
const finalTypes = types.length > 0 ? types : [...defaultChannelTypes, RoomType.Direct];
|
|
85
|
+
|
|
86
|
+
return refetchAllChannels({
|
|
87
|
+
criteria: {
|
|
88
|
+
orgName,
|
|
89
|
+
type: finalTypes,
|
|
90
|
+
team: teamId,
|
|
91
|
+
},
|
|
92
|
+
limit: 100,
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
[orgName, teamId, refetchAllChannels],
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
// Specific data selectors with limits for different use cases
|
|
99
|
+
const getChannelsForHome = useCallback(
|
|
100
|
+
(limit: number = 10) => {
|
|
101
|
+
return take(channelsData, limit);
|
|
102
|
+
},
|
|
103
|
+
[channelsData],
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
const getDirectChannelsForHome = useCallback(
|
|
107
|
+
(limit: number = 20) => {
|
|
108
|
+
return take(directChannelsData, limit);
|
|
109
|
+
},
|
|
110
|
+
[directChannelsData],
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const getChannelsForTeam = useCallback(() => {
|
|
114
|
+
return channelsData;
|
|
115
|
+
}, [channelsData]);
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
// Raw data
|
|
119
|
+
allChannelsData: allChannelsData?.channelsByUser || [],
|
|
120
|
+
channelsData,
|
|
121
|
+
directChannelsData,
|
|
122
|
+
|
|
123
|
+
// Loading states
|
|
124
|
+
loading,
|
|
125
|
+
error,
|
|
126
|
+
|
|
127
|
+
// Refetch functions
|
|
128
|
+
refetchChannels,
|
|
129
|
+
refetchAllChannels,
|
|
130
|
+
|
|
131
|
+
// Selectors with built-in limits
|
|
132
|
+
getChannelsForHome,
|
|
133
|
+
getDirectChannelsForHome,
|
|
134
|
+
getChannelsForTeam,
|
|
135
|
+
|
|
136
|
+
// Utility functions
|
|
137
|
+
hasChannels: channelsData.length > 0,
|
|
138
|
+
hasDirectChannels: directChannelsData.length > 0,
|
|
139
|
+
totalChannelCount: channelsData.length,
|
|
140
|
+
totalDirectChannelCount: directChannelsData.length,
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// Additional hook for specific channel type queries (for backward compatibility)
|
|
145
|
+
export const useChannelTypeQuery = (
|
|
146
|
+
orgName: string,
|
|
147
|
+
channelType: RoomType | RoomType[],
|
|
148
|
+
options: { teamId?: string; limit?: number; enabled?: boolean } = {},
|
|
149
|
+
) => {
|
|
150
|
+
const { teamId = null, limit = 50, enabled = true } = options;
|
|
151
|
+
|
|
152
|
+
return useChannelsQuery({
|
|
153
|
+
variables: {
|
|
154
|
+
criteria: {
|
|
155
|
+
orgName,
|
|
156
|
+
type: channelType,
|
|
157
|
+
team: teamId,
|
|
158
|
+
},
|
|
159
|
+
limit,
|
|
160
|
+
},
|
|
161
|
+
fetchPolicy: 'cache-and-network',
|
|
162
|
+
nextFetchPolicy: 'cache-first',
|
|
163
|
+
skip: !enabled || !orgName,
|
|
164
|
+
});
|
|
165
|
+
};
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo } from 'react';
|
|
2
|
+
import { useMachine } from '@xstate/react';
|
|
3
|
+
import { useLocation, useNavigate, useParams } from '@remix-run/react';
|
|
4
|
+
import {
|
|
5
|
+
routeMachine,
|
|
6
|
+
RouteAction,
|
|
7
|
+
RouteState,
|
|
8
|
+
parsePathname,
|
|
9
|
+
getPathForRouteState
|
|
10
|
+
} from '../machines/routeMachine';
|
|
11
|
+
import { slackUiRoutePaths, SLACK_UI_ROUTE_KEYS } from '../constants/routes';
|
|
12
|
+
|
|
13
|
+
export interface UseRouteStateReturn {
|
|
14
|
+
// Current state
|
|
15
|
+
currentState: RouteState;
|
|
16
|
+
currentRouteKey: string | null;
|
|
17
|
+
channelName: string | null;
|
|
18
|
+
teamName: string | null;
|
|
19
|
+
orgSlug: string;
|
|
20
|
+
|
|
21
|
+
// State checks
|
|
22
|
+
isHome: boolean;
|
|
23
|
+
isChannelView: boolean;
|
|
24
|
+
isChannelNew: boolean;
|
|
25
|
+
isMessageView: boolean;
|
|
26
|
+
isMessageNew: boolean;
|
|
27
|
+
isTeamView: boolean;
|
|
28
|
+
isTeamNew: boolean;
|
|
29
|
+
isThreads: boolean;
|
|
30
|
+
isActivity: boolean;
|
|
31
|
+
isDrafts: boolean;
|
|
32
|
+
isSaved: boolean;
|
|
33
|
+
isFiles: boolean;
|
|
34
|
+
isSearch: boolean;
|
|
35
|
+
isInvite: boolean;
|
|
36
|
+
isInviteContacts: boolean;
|
|
37
|
+
isInviteEmail: boolean;
|
|
38
|
+
isInviteLink: boolean;
|
|
39
|
+
|
|
40
|
+
// Navigation methods
|
|
41
|
+
navigateToHome: () => void;
|
|
42
|
+
navigateToChannel: (channelName: string) => void;
|
|
43
|
+
navigateToChannelNew: () => void;
|
|
44
|
+
navigateToMessage: (channelName: string) => void;
|
|
45
|
+
navigateToMessageNew: () => void;
|
|
46
|
+
navigateToTeam: (teamName: string) => void;
|
|
47
|
+
navigateToTeamNew: () => void;
|
|
48
|
+
navigateToThreads: () => void;
|
|
49
|
+
navigateToActivity: () => void;
|
|
50
|
+
navigateToDrafts: () => void;
|
|
51
|
+
navigateToSaved: () => void;
|
|
52
|
+
navigateToFiles: () => void;
|
|
53
|
+
navigateToSearch: () => void;
|
|
54
|
+
navigateToInvite: () => void;
|
|
55
|
+
navigateToInviteContacts: () => void;
|
|
56
|
+
navigateToInviteEmail: () => void;
|
|
57
|
+
navigateToInviteLink: () => void;
|
|
58
|
+
|
|
59
|
+
// Utils
|
|
60
|
+
goBack: () => void;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Custom hook for managing route state using XState
|
|
65
|
+
* Syncs React Router location with XState machine
|
|
66
|
+
*/
|
|
67
|
+
export function useRouteState(orgSlug: string): UseRouteStateReturn {
|
|
68
|
+
const location = useLocation();
|
|
69
|
+
const navigate = useNavigate();
|
|
70
|
+
const params = useParams();
|
|
71
|
+
|
|
72
|
+
// Initialize machine with current route context
|
|
73
|
+
const [state, send] = useMachine(routeMachine, {
|
|
74
|
+
input: {
|
|
75
|
+
orgSlug,
|
|
76
|
+
currentPath: location.pathname,
|
|
77
|
+
currentRouteKey: parsePathname(location.pathname, orgSlug).routeKey,
|
|
78
|
+
channelName: params.channelName || null,
|
|
79
|
+
teamName: params.teamName || null,
|
|
80
|
+
previousPath: null,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// Sync location changes with machine
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
send({ type: RouteAction.UPDATE_FROM_PATHNAME, pathname: location.pathname });
|
|
87
|
+
}, [location.pathname, send]);
|
|
88
|
+
|
|
89
|
+
// Derive current state from parsed pathname
|
|
90
|
+
const parsedRoute = useMemo(() =>
|
|
91
|
+
parsePathname(location.pathname, orgSlug),
|
|
92
|
+
[location.pathname, orgSlug]
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
// State checks
|
|
96
|
+
const isHome = parsedRoute.state === RouteState.Home || parsedRoute.state === RouteState.Idle;
|
|
97
|
+
const isChannelView = parsedRoute.state === RouteState.ChannelsView;
|
|
98
|
+
const isChannelNew = parsedRoute.state === RouteState.ChannelsNew;
|
|
99
|
+
const isMessageView = parsedRoute.state === RouteState.MessagesView;
|
|
100
|
+
const isMessageNew = parsedRoute.state === RouteState.MessagesNew;
|
|
101
|
+
const isTeamView = parsedRoute.state === RouteState.TeamsView;
|
|
102
|
+
const isTeamNew = parsedRoute.state === RouteState.TeamsNew;
|
|
103
|
+
const isThreads = parsedRoute.state === RouteState.Threads;
|
|
104
|
+
const isActivity = parsedRoute.state === RouteState.Activity;
|
|
105
|
+
const isDrafts = parsedRoute.state === RouteState.Drafts;
|
|
106
|
+
const isSaved = parsedRoute.state === RouteState.Saved;
|
|
107
|
+
const isFiles = parsedRoute.state === RouteState.Files;
|
|
108
|
+
const isSearch = parsedRoute.state === RouteState.Search;
|
|
109
|
+
const isInvite = parsedRoute.state === RouteState.Invite;
|
|
110
|
+
const isInviteContacts = parsedRoute.state === RouteState.InviteContacts;
|
|
111
|
+
const isInviteEmail = parsedRoute.state === RouteState.InviteEmail;
|
|
112
|
+
const isInviteLink = parsedRoute.state === RouteState.InviteLink;
|
|
113
|
+
|
|
114
|
+
// Navigation methods - both update machine and navigate
|
|
115
|
+
const navigateToHome = useCallback(() => {
|
|
116
|
+
send({ type: RouteAction.NAVIGATE_HOME });
|
|
117
|
+
navigate(slackUiRoutePaths.home(orgSlug));
|
|
118
|
+
}, [send, navigate, orgSlug]);
|
|
119
|
+
|
|
120
|
+
const navigateToChannel = useCallback((channelName: string) => {
|
|
121
|
+
send({ type: RouteAction.NAVIGATE_CHANNEL, channelName });
|
|
122
|
+
navigate(slackUiRoutePaths.channel(orgSlug, channelName));
|
|
123
|
+
}, [send, navigate, orgSlug]);
|
|
124
|
+
|
|
125
|
+
const navigateToChannelNew = useCallback(() => {
|
|
126
|
+
send({ type: RouteAction.NAVIGATE_CHANNEL_NEW });
|
|
127
|
+
navigate(slackUiRoutePaths.channelNew(orgSlug));
|
|
128
|
+
}, [send, navigate, orgSlug]);
|
|
129
|
+
|
|
130
|
+
const navigateToMessage = useCallback((channelName: string) => {
|
|
131
|
+
send({ type: RouteAction.NAVIGATE_MESSAGE, channelName });
|
|
132
|
+
navigate(slackUiRoutePaths.message(orgSlug, channelName));
|
|
133
|
+
}, [send, navigate, orgSlug]);
|
|
134
|
+
|
|
135
|
+
const navigateToMessageNew = useCallback(() => {
|
|
136
|
+
send({ type: RouteAction.NAVIGATE_MESSAGE_NEW });
|
|
137
|
+
navigate(slackUiRoutePaths.messageNew(orgSlug));
|
|
138
|
+
}, [send, navigate, orgSlug]);
|
|
139
|
+
|
|
140
|
+
const navigateToTeam = useCallback((teamName: string) => {
|
|
141
|
+
send({ type: RouteAction.NAVIGATE_TEAM, teamName });
|
|
142
|
+
navigate(slackUiRoutePaths.team(orgSlug, teamName));
|
|
143
|
+
}, [send, navigate, orgSlug]);
|
|
144
|
+
|
|
145
|
+
const navigateToTeamNew = useCallback(() => {
|
|
146
|
+
send({ type: RouteAction.NAVIGATE_TEAM_NEW });
|
|
147
|
+
navigate(slackUiRoutePaths.teamNew(orgSlug));
|
|
148
|
+
}, [send, navigate, orgSlug]);
|
|
149
|
+
|
|
150
|
+
const navigateToThreads = useCallback(() => {
|
|
151
|
+
send({ type: RouteAction.NAVIGATE_THREADS });
|
|
152
|
+
navigate(slackUiRoutePaths.threads(orgSlug));
|
|
153
|
+
}, [send, navigate, orgSlug]);
|
|
154
|
+
|
|
155
|
+
const navigateToActivity = useCallback(() => {
|
|
156
|
+
send({ type: RouteAction.NAVIGATE_ACTIVITY });
|
|
157
|
+
navigate(slackUiRoutePaths.activity(orgSlug));
|
|
158
|
+
}, [send, navigate, orgSlug]);
|
|
159
|
+
|
|
160
|
+
const navigateToDrafts = useCallback(() => {
|
|
161
|
+
send({ type: RouteAction.NAVIGATE_DRAFTS });
|
|
162
|
+
navigate(slackUiRoutePaths.drafts(orgSlug));
|
|
163
|
+
}, [send, navigate, orgSlug]);
|
|
164
|
+
|
|
165
|
+
const navigateToSaved = useCallback(() => {
|
|
166
|
+
send({ type: RouteAction.NAVIGATE_SAVED });
|
|
167
|
+
navigate(slackUiRoutePaths.saved(orgSlug));
|
|
168
|
+
}, [send, navigate, orgSlug]);
|
|
169
|
+
|
|
170
|
+
const navigateToFiles = useCallback(() => {
|
|
171
|
+
send({ type: RouteAction.NAVIGATE_FILES });
|
|
172
|
+
navigate(slackUiRoutePaths.files(orgSlug));
|
|
173
|
+
}, [send, navigate, orgSlug]);
|
|
174
|
+
|
|
175
|
+
const navigateToSearch = useCallback(() => {
|
|
176
|
+
send({ type: RouteAction.NAVIGATE_SEARCH });
|
|
177
|
+
navigate(slackUiRoutePaths.search(orgSlug));
|
|
178
|
+
}, [send, navigate, orgSlug]);
|
|
179
|
+
|
|
180
|
+
const navigateToInvite = useCallback(() => {
|
|
181
|
+
send({ type: RouteAction.NAVIGATE_INVITE });
|
|
182
|
+
navigate(slackUiRoutePaths.invite(orgSlug));
|
|
183
|
+
}, [send, navigate, orgSlug]);
|
|
184
|
+
|
|
185
|
+
const navigateToInviteContacts = useCallback(() => {
|
|
186
|
+
send({ type: RouteAction.NAVIGATE_INVITE_CONTACTS });
|
|
187
|
+
navigate(slackUiRoutePaths.inviteContacts(orgSlug));
|
|
188
|
+
}, [send, navigate, orgSlug]);
|
|
189
|
+
|
|
190
|
+
const navigateToInviteEmail = useCallback(() => {
|
|
191
|
+
send({ type: RouteAction.NAVIGATE_INVITE_EMAIL });
|
|
192
|
+
navigate(slackUiRoutePaths.inviteEmail(orgSlug));
|
|
193
|
+
}, [send, navigate, orgSlug]);
|
|
194
|
+
|
|
195
|
+
const navigateToInviteLink = useCallback(() => {
|
|
196
|
+
send({ type: RouteAction.NAVIGATE_INVITE_LINK });
|
|
197
|
+
navigate(slackUiRoutePaths.inviteLink(orgSlug));
|
|
198
|
+
}, [send, navigate, orgSlug]);
|
|
199
|
+
|
|
200
|
+
const goBack = useCallback(() => {
|
|
201
|
+
navigate(-1);
|
|
202
|
+
}, [navigate]);
|
|
203
|
+
|
|
204
|
+
return {
|
|
205
|
+
// Current state
|
|
206
|
+
currentState: parsedRoute.state,
|
|
207
|
+
currentRouteKey: parsedRoute.routeKey,
|
|
208
|
+
channelName: parsedRoute.channelName || params.channelName || null,
|
|
209
|
+
teamName: parsedRoute.teamName || params.teamName || null,
|
|
210
|
+
orgSlug,
|
|
211
|
+
|
|
212
|
+
// State checks
|
|
213
|
+
isHome,
|
|
214
|
+
isChannelView,
|
|
215
|
+
isChannelNew,
|
|
216
|
+
isMessageView,
|
|
217
|
+
isMessageNew,
|
|
218
|
+
isTeamView,
|
|
219
|
+
isTeamNew,
|
|
220
|
+
isThreads,
|
|
221
|
+
isActivity,
|
|
222
|
+
isDrafts,
|
|
223
|
+
isSaved,
|
|
224
|
+
isFiles,
|
|
225
|
+
isSearch,
|
|
226
|
+
isInvite,
|
|
227
|
+
isInviteContacts,
|
|
228
|
+
isInviteEmail,
|
|
229
|
+
isInviteLink,
|
|
230
|
+
|
|
231
|
+
// Navigation methods
|
|
232
|
+
navigateToHome,
|
|
233
|
+
navigateToChannel,
|
|
234
|
+
navigateToChannelNew,
|
|
235
|
+
navigateToMessage,
|
|
236
|
+
navigateToMessageNew,
|
|
237
|
+
navigateToTeam,
|
|
238
|
+
navigateToTeamNew,
|
|
239
|
+
navigateToThreads,
|
|
240
|
+
navigateToActivity,
|
|
241
|
+
navigateToDrafts,
|
|
242
|
+
navigateToSaved,
|
|
243
|
+
navigateToFiles,
|
|
244
|
+
navigateToSearch,
|
|
245
|
+
navigateToInvite,
|
|
246
|
+
navigateToInviteContacts,
|
|
247
|
+
navigateToInviteEmail,
|
|
248
|
+
navigateToInviteLink,
|
|
249
|
+
|
|
250
|
+
// Utils
|
|
251
|
+
goBack,
|
|
252
|
+
};
|
|
253
|
+
}
|
package/src/icons.ts
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized icon exports using @react-icons/all-files
|
|
3
|
+
* This file provides consistent icon usage across the slack-ui browser package
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Feather Icons (Fi)
|
|
7
|
+
export { FiChevronDown } from '@react-icons/all-files/fi/FiChevronDown.js';
|
|
8
|
+
export { FiChevronRight } from '@react-icons/all-files/fi/FiChevronRight.js';
|
|
9
|
+
export { FiChevronLeft } from '@react-icons/all-files/fi/FiChevronLeft.js';
|
|
10
|
+
export { FiPlus } from '@react-icons/all-files/fi/FiPlus.js';
|
|
11
|
+
export { FiSearch } from '@react-icons/all-files/fi/FiSearch.js';
|
|
12
|
+
export { FiHash } from '@react-icons/all-files/fi/FiHash.js';
|
|
13
|
+
export { FiLock } from '@react-icons/all-files/fi/FiLock.js';
|
|
14
|
+
export { FiRefreshCw } from '@react-icons/all-files/fi/FiRefreshCw.js';
|
|
15
|
+
export { FiUser } from '@react-icons/all-files/fi/FiUser.js';
|
|
16
|
+
export { FiUserPlus } from '@react-icons/all-files/fi/FiUserPlus.js';
|
|
17
|
+
export { FiShare2 } from '@react-icons/all-files/fi/FiShare2.js';
|
|
18
|
+
export { FiMail } from '@react-icons/all-files/fi/FiMail.js';
|
|
19
|
+
export { FiX } from '@react-icons/all-files/fi/FiX.js';
|
|
20
|
+
export { FiEdit } from '@react-icons/all-files/fi/FiEdit.js';
|
|
21
|
+
export { FiEdit2 } from '@react-icons/all-files/fi/FiEdit2.js';
|
|
22
|
+
export { FiMessageSquare } from '@react-icons/all-files/fi/FiMessageSquare.js';
|
|
23
|
+
export { FiBookmark } from '@react-icons/all-files/fi/FiBookmark.js';
|
|
24
|
+
export { FiSend } from '@react-icons/all-files/fi/FiSend.js';
|
|
25
|
+
export { FiMoreHorizontal } from '@react-icons/all-files/fi/FiMoreHorizontal.js';
|
|
26
|
+
export { FiMoreVertical } from '@react-icons/all-files/fi/FiMoreVertical.js';
|
|
27
|
+
export { FiSettings } from '@react-icons/all-files/fi/FiSettings.js';
|
|
28
|
+
export { FiHome } from '@react-icons/all-files/fi/FiHome.js';
|
|
29
|
+
export { FiInbox } from '@react-icons/all-files/fi/FiInbox.js';
|
|
30
|
+
export { FiUsers } from '@react-icons/all-files/fi/FiUsers.js';
|
|
31
|
+
export { FiMessageCircle } from '@react-icons/all-files/fi/FiMessageCircle.js';
|
|
32
|
+
export { FiBell } from '@react-icons/all-files/fi/FiBell.js';
|
|
33
|
+
export { FiLogOut } from '@react-icons/all-files/fi/FiLogOut.js';
|
|
34
|
+
export { FiMenu } from '@react-icons/all-files/fi/FiMenu.js';
|
|
35
|
+
export { FiTrash2 } from '@react-icons/all-files/fi/FiTrash2.js';
|
|
36
|
+
export { FiCopy } from '@react-icons/all-files/fi/FiCopy.js';
|
|
37
|
+
export { FiCheck } from '@react-icons/all-files/fi/FiCheck.js';
|
|
38
|
+
export { FiAlertCircle } from '@react-icons/all-files/fi/FiAlertCircle.js';
|
|
39
|
+
export { FiInfo } from '@react-icons/all-files/fi/FiInfo.js';
|
|
40
|
+
|
|
41
|
+
// VS Code Icons (Vsc)
|
|
42
|
+
export { VscChromeClose } from '@react-icons/all-files/vsc/VscChromeClose.js';
|
|
43
|
+
export { VscAdd } from '@react-icons/all-files/vsc/VscAdd.js';
|
|
44
|
+
export { VscSearch } from '@react-icons/all-files/vsc/VscSearch.js';
|
|
45
|
+
export { VscMenu } from '@react-icons/all-files/vsc/VscMenu.js';
|
|
46
|
+
|
|
47
|
+
// Go Icons (Go)
|
|
48
|
+
export { GoGlobe } from '@react-icons/all-files/go/GoGlobe.js';
|
|
49
|
+
export { GoOrganization } from '@react-icons/all-files/go/GoOrganization.js';
|
|
50
|
+
export { GoPerson } from '@react-icons/all-files/go/GoPerson.js';
|
|
51
|
+
export { GoComment } from '@react-icons/all-files/go/GoComment.js';
|
|
52
|
+
|
|
53
|
+
// Remix Icons (Ri)
|
|
54
|
+
export { RiAdminFill } from '@react-icons/all-files/ri/RiAdminFill.js';
|
|
55
|
+
export { RiAdminLine } from '@react-icons/all-files/ri/RiAdminLine.js';
|
|
56
|
+
export { RiTeamLine } from '@react-icons/all-files/ri/RiTeamLine.js';
|
|
57
|
+
export { RiTeamFill } from '@react-icons/all-files/ri/RiTeamFill.js';
|
|
58
|
+
|
|
59
|
+
// Ant Design Icons (Ai)
|
|
60
|
+
export { AiOutlineHome } from '@react-icons/all-files/ai/AiOutlineHome.js';
|
|
61
|
+
export { AiOutlineInbox } from '@react-icons/all-files/ai/AiOutlineInbox.js';
|
|
62
|
+
export { AiOutlineMessage } from '@react-icons/all-files/ai/AiOutlineMessage.js';
|
|
63
|
+
export { AiOutlineTeam } from '@react-icons/all-files/ai/AiOutlineTeam.js';
|
|
64
|
+
export { AiOutlineSetting } from '@react-icons/all-files/ai/AiOutlineSetting.js';
|
|
65
|
+
export { AiOutlineUser } from '@react-icons/all-files/ai/AiOutlineUser.js';
|
|
66
|
+
export { AiOutlinePlus } from '@react-icons/all-files/ai/AiOutlinePlus.js';
|
|
67
|
+
export { AiOutlineClose } from '@react-icons/all-files/ai/AiOutlineClose.js';
|
|
68
|
+
export { AiOutlineSearch } from '@react-icons/all-files/ai/AiOutlineSearch.js';
|
|
69
|
+
export { AiOutlineEdit } from '@react-icons/all-files/ai/AiOutlineEdit.js';
|
|
70
|
+
export { AiOutlineDelete } from '@react-icons/all-files/ai/AiOutlineDelete.js';
|
|
71
|
+
export { AiOutlineSend } from '@react-icons/all-files/ai/AiOutlineSend.js';
|
|
72
|
+
export { AiOutlineBell } from '@react-icons/all-files/ai/AiOutlineBell.js';
|
|
73
|
+
export { AiOutlineLogout } from '@react-icons/all-files/ai/AiOutlineLogout.js';
|
|
74
|
+
export { AiOutlineMenu } from '@react-icons/all-files/ai/AiOutlineMenu.js';
|
|
75
|
+
export { AiOutlineCopy } from '@react-icons/all-files/ai/AiOutlineCopy.js';
|
|
76
|
+
export { AiOutlineCheck } from '@react-icons/all-files/ai/AiOutlineCheck.js';
|
|
77
|
+
export { AiOutlineWarning } from '@react-icons/all-files/ai/AiOutlineWarning.js';
|
|
78
|
+
export { AiOutlineInfoCircle } from '@react-icons/all-files/ai/AiOutlineInfoCircle.js';
|
|
79
|
+
|
|
80
|
+
// Bootstrap Icons (Bs)
|
|
81
|
+
export { BsHash } from '@react-icons/all-files/bs/BsHash.js';
|
|
82
|
+
export { BsLock } from '@react-icons/all-files/bs/BsLock.js';
|
|
83
|
+
export { BsPeople } from '@react-icons/all-files/bs/BsPeople.js';
|
|
84
|
+
export { BsPerson } from '@react-icons/all-files/bs/BsPerson.js';
|
|
85
|
+
export { BsChat } from '@react-icons/all-files/bs/BsChat.js';
|
|
86
|
+
export { BsChatDots } from '@react-icons/all-files/bs/BsChatDots.js';
|
|
87
|
+
export { BsThreeDots } from '@react-icons/all-files/bs/BsThreeDots.js';
|
|
88
|
+
export { BsThreeDotsVertical } from '@react-icons/all-files/bs/BsThreeDotsVertical.js';
|
|
89
|
+
|
|
90
|
+
// Heroicons (Hi)
|
|
91
|
+
export { HiOutlineHashtag } from '@react-icons/all-files/hi/HiOutlineHashtag.js';
|
|
92
|
+
export { HiOutlineLockClosed } from '@react-icons/all-files/hi/HiOutlineLockClosed.js';
|
|
93
|
+
export { HiOutlineUserGroup } from '@react-icons/all-files/hi/HiOutlineUserGroup.js';
|
|
94
|
+
export { HiOutlineUser } from '@react-icons/all-files/hi/HiOutlineUser.js';
|
|
95
|
+
export { HiOutlineChat } from '@react-icons/all-files/hi/HiOutlineChat.js';
|
|
96
|
+
export { HiOutlinePencil } from '@react-icons/all-files/hi/HiOutlinePencil.js';
|
|
97
|
+
export { HiOutlineDotsHorizontal } from '@react-icons/all-files/hi/HiOutlineDotsHorizontal.js';
|
|
98
|
+
export { HiOutlineDotsVertical } from '@react-icons/all-files/hi/HiOutlineDotsVertical.js';
|
|
99
|
+
export { HiOutlinePlus } from '@react-icons/all-files/hi/HiOutlinePlus.js';
|
|
100
|
+
export { HiOutlineX } from '@react-icons/all-files/hi/HiOutlineX.js';
|
|
101
|
+
export { HiOutlineSearch } from '@react-icons/all-files/hi/HiOutlineSearch.js';
|
|
102
|
+
export { HiOutlineHome } from '@react-icons/all-files/hi/HiOutlineHome.js';
|
|
103
|
+
export { HiOutlineInbox } from '@react-icons/all-files/hi/HiOutlineInbox.js';
|
|
104
|
+
export { HiOutlineBell } from '@react-icons/all-files/hi/HiOutlineBell.js';
|
|
105
|
+
export { HiOutlineCog } from '@react-icons/all-files/hi/HiOutlineCog.js';
|
|
106
|
+
|
|
107
|
+
// IO Icons (Io)
|
|
108
|
+
export { IoMdAdd } from '@react-icons/all-files/io/IoMdAdd.js';
|
|
109
|
+
export { IoMdClose } from '@react-icons/all-files/io/IoMdClose.js';
|
|
110
|
+
export { IoMdSearch } from '@react-icons/all-files/io/IoMdSearch.js';
|
|
111
|
+
export { IoMdMenu } from '@react-icons/all-files/io/IoMdMenu.js';
|
|
112
|
+
export { IoMdSettings } from '@react-icons/all-files/io/IoMdSettings.js';
|
|
113
|
+
export { IoMdPerson } from '@react-icons/all-files/io/IoMdPerson.js';
|
|
114
|
+
export { IoMdPeople } from '@react-icons/all-files/io/IoMdPeople.js';
|
|
115
|
+
export { IoMdChatbubbles } from '@react-icons/all-files/io/IoMdChatbubbles.js';
|
|
116
|
+
export { IoMdNotifications } from '@react-icons/all-files/io/IoMdNotifications.js';
|
|
117
|
+
|
|
118
|
+
// Material Design Icons (Md)
|
|
119
|
+
export { MdAdd } from '@react-icons/all-files/md/MdAdd.js';
|
|
120
|
+
export { MdClose } from '@react-icons/all-files/md/MdClose.js';
|
|
121
|
+
export { MdSearch } from '@react-icons/all-files/md/MdSearch.js';
|
|
122
|
+
export { MdMenu } from '@react-icons/all-files/md/MdMenu.js';
|
|
123
|
+
export { MdSettings } from '@react-icons/all-files/md/MdSettings.js';
|
|
124
|
+
export { MdPerson } from '@react-icons/all-files/md/MdPerson.js';
|
|
125
|
+
export { MdPeople } from '@react-icons/all-files/md/MdPeople.js';
|
|
126
|
+
export { MdChat } from '@react-icons/all-files/md/MdChat.js';
|
|
127
|
+
export { MdNotifications } from '@react-icons/all-files/md/MdNotifications.js';
|
|
128
|
+
export { MdHome } from '@react-icons/all-files/md/MdHome.js';
|
|
129
|
+
export { MdInbox } from '@react-icons/all-files/md/MdInbox.js';
|
|
130
|
+
export { MdEdit } from '@react-icons/all-files/md/MdEdit.js';
|
|
131
|
+
export { MdDelete } from '@react-icons/all-files/md/MdDelete.js';
|
|
132
|
+
export { MdSend } from '@react-icons/all-files/md/MdSend.js';
|
|
133
|
+
export { MdRefresh } from '@react-icons/all-files/md/MdRefresh.js';
|
|
134
|
+
export { MdMoreHoriz } from '@react-icons/all-files/md/MdMoreHoriz.js';
|
|
135
|
+
export { MdMoreVert } from '@react-icons/all-files/md/MdMoreVert.js';
|
|
136
|
+
export { MdLock } from '@react-icons/all-files/md/MdLock.js';
|
|
137
|
+
export { MdPublic } from '@react-icons/all-files/md/MdPublic.js';
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Feature } from '@common-stack/client-react';
|
|
2
|
+
import SlackUIModule from './module';
|
|
3
|
+
|
|
4
|
+
export * from './screens';
|
|
5
|
+
export * from './components';
|
|
6
|
+
export * from './hooks';
|
|
7
|
+
export * from './queries';
|
|
8
|
+
export * from './icons';
|
|
9
|
+
export * from './constants';
|
|
10
|
+
|
|
11
|
+
export default new Feature(SlackUIModule);
|