@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,227 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useGetChannelsByUserQuery,
|
|
3
|
+
useGetChannelsByUserLazyQuery,
|
|
4
|
+
useGetOrganizationTeamsQuery,
|
|
5
|
+
useGetOrganizationTeamQuery,
|
|
6
|
+
useViewChannelDetailQuery,
|
|
7
|
+
useViewChannelDetailLazyQuery,
|
|
8
|
+
useGetOrganizationMembersQuery,
|
|
9
|
+
useGetOrganizationMembersWithChannelsQuery,
|
|
10
|
+
useGetUserOrganizationsQuery,
|
|
11
|
+
useGetOrganizationDetailQuery,
|
|
12
|
+
useGetOrganizationDetailLazyQuery,
|
|
13
|
+
useGetUserByIdQuery,
|
|
14
|
+
useGetUserAccountByAuth0IdLazyQuery,
|
|
15
|
+
useGetAllUsersQuery,
|
|
16
|
+
useGetOrganizationSharableLinkQuery,
|
|
17
|
+
GetChannelsByUserDocument,
|
|
18
|
+
// Mutations
|
|
19
|
+
useAddChannelMutation as AddChannelMutation,
|
|
20
|
+
useCreateTeamMutation as CreateTeamMutation,
|
|
21
|
+
useAddDirectChannelMutation as AddDirectChannelMutation,
|
|
22
|
+
useAddMemberToChannelMutation as AddMemberToChannelMutation,
|
|
23
|
+
useSaveMembersToChannelMutation as SaveMembersToChannelMutation,
|
|
24
|
+
useCreateOrganizationMutation as CreateOrganizationMutation,
|
|
25
|
+
useSendOrganizationInvitationMutation as SendOrganizationInvitationMutation,
|
|
26
|
+
useUpdateUserProfileMutation as UpdateUserProfileMutation,
|
|
27
|
+
} from 'common/graphql';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Channel Queries
|
|
31
|
+
*/
|
|
32
|
+
export const useChannelsQuery = (options: any = {}) => {
|
|
33
|
+
return useGetChannelsByUserQuery({
|
|
34
|
+
fetchPolicy: 'cache-and-network',
|
|
35
|
+
...options,
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const useChannelsLazyQuery = (options: any = {}) => {
|
|
40
|
+
return useGetChannelsByUserLazyQuery({
|
|
41
|
+
fetchPolicy: 'cache-and-network',
|
|
42
|
+
...options,
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const useChannelDetailQuery = (channelId: string, options: any = {}) => {
|
|
47
|
+
return useViewChannelDetailQuery({
|
|
48
|
+
variables: { id: channelId },
|
|
49
|
+
fetchPolicy: 'cache-and-network',
|
|
50
|
+
nextFetchPolicy: 'cache-first',
|
|
51
|
+
notifyOnNetworkStatusChange: true,
|
|
52
|
+
...options,
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const useChannelDetailLazyQuery = (options: any = {}) => {
|
|
57
|
+
return useViewChannelDetailLazyQuery({
|
|
58
|
+
fetchPolicy: 'cache-and-network',
|
|
59
|
+
...options,
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Team Queries
|
|
65
|
+
*/
|
|
66
|
+
export const useTeamsQuery = (options: any = {}) => {
|
|
67
|
+
return useGetOrganizationTeamsQuery({
|
|
68
|
+
fetchPolicy: 'cache-and-network',
|
|
69
|
+
nextFetchPolicy: 'cache-first',
|
|
70
|
+
notifyOnNetworkStatusChange: true,
|
|
71
|
+
...options,
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const useTeamQuery = (orgName: string, teamId: string, options: any = {}) => {
|
|
76
|
+
return useGetOrganizationTeamQuery({
|
|
77
|
+
variables: { orgName, teamId },
|
|
78
|
+
fetchPolicy: 'cache-and-network',
|
|
79
|
+
skip: !orgName || !teamId,
|
|
80
|
+
...options,
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Organization Queries
|
|
86
|
+
*/
|
|
87
|
+
export const useOrganizationMembersQuery = (orgName: string, options: any = {}) => {
|
|
88
|
+
return useGetOrganizationMembersQuery({
|
|
89
|
+
variables: { orgName },
|
|
90
|
+
fetchPolicy: 'cache-and-network',
|
|
91
|
+
...options,
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const useOrganizationMembersWithChannelsQuery = (orgName: string, options: any = {}) => {
|
|
96
|
+
return useGetOrganizationMembersWithChannelsQuery({
|
|
97
|
+
variables: { orgName },
|
|
98
|
+
fetchPolicy: 'cache-and-network',
|
|
99
|
+
...options,
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export const useUserOrganizationsQuery = (options: any = {}) => {
|
|
104
|
+
return useGetUserOrganizationsQuery({
|
|
105
|
+
fetchPolicy: 'cache-and-network',
|
|
106
|
+
...options,
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const useOrganizationDetailQuery = (orgName: string, options: any = {}) => {
|
|
111
|
+
return useGetOrganizationDetailQuery({
|
|
112
|
+
variables: { where: { name: orgName } },
|
|
113
|
+
fetchPolicy: 'cache-and-network',
|
|
114
|
+
...options,
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const useOrganizationDetailLazyQuery = (options: any = {}) => {
|
|
119
|
+
return useGetOrganizationDetailLazyQuery({
|
|
120
|
+
fetchPolicy: 'cache-and-network',
|
|
121
|
+
...options,
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* User Queries
|
|
127
|
+
*/
|
|
128
|
+
export const useUserByIdQuery = (userId: string, options: any = {}) => {
|
|
129
|
+
return useGetUserByIdQuery({
|
|
130
|
+
variables: { userId },
|
|
131
|
+
fetchPolicy: 'cache-and-network',
|
|
132
|
+
...options,
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
export const useUserAccountByAuth0IdLazyQuery = (options: any = {}) => {
|
|
137
|
+
return useGetUserAccountByAuth0IdLazyQuery({
|
|
138
|
+
fetchPolicy: 'cache-and-network',
|
|
139
|
+
...options,
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export const useAllUsersQuery = (options: any = {}) => {
|
|
144
|
+
return useGetAllUsersQuery({
|
|
145
|
+
fetchPolicy: 'cache-and-network',
|
|
146
|
+
...options,
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const useOrganizationSharableLinkQuery = (orgName: string, options: any = {}) => {
|
|
151
|
+
return useGetOrganizationSharableLinkQuery({
|
|
152
|
+
variables: { orgName },
|
|
153
|
+
fetchPolicy: 'cache-and-network',
|
|
154
|
+
...options,
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Channel Mutations
|
|
160
|
+
*/
|
|
161
|
+
export const useAddChannelMutation = (options: any = {}) => {
|
|
162
|
+
return AddChannelMutation({
|
|
163
|
+
...options,
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export const useAddDirectChannelMutation = (options: any = {}) => {
|
|
168
|
+
return AddDirectChannelMutation({
|
|
169
|
+
...options,
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export const useAddMemberToChannelMutation = (options: any = {}) => {
|
|
174
|
+
return AddMemberToChannelMutation({
|
|
175
|
+
...options,
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
export const useSaveMembersToChannelMutation = (options: any = {}) => {
|
|
180
|
+
return SaveMembersToChannelMutation({
|
|
181
|
+
...options,
|
|
182
|
+
});
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Team Mutations
|
|
187
|
+
*/
|
|
188
|
+
export const useCreateTeamMutation = (options: any = {}) => {
|
|
189
|
+
return CreateTeamMutation({
|
|
190
|
+
...options,
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Organization Mutations
|
|
196
|
+
*/
|
|
197
|
+
export const useCreateOrganizationMutation = (options: any = {}) => {
|
|
198
|
+
return CreateOrganizationMutation({
|
|
199
|
+
...options,
|
|
200
|
+
});
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export const useSendOrganizationInvitationMutation = (options: any = {}) => {
|
|
204
|
+
return SendOrganizationInvitationMutation({
|
|
205
|
+
...options,
|
|
206
|
+
});
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* User Mutations
|
|
211
|
+
*/
|
|
212
|
+
export const useUpdateUserProfileMutation = (options: any = {}) => {
|
|
213
|
+
return UpdateUserProfileMutation({
|
|
214
|
+
...options,
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
// Export document for direct use in components if needed
|
|
219
|
+
export { GetChannelsByUserDocument };
|
|
220
|
+
|
|
221
|
+
// Re-export underlying hooks directly for SSR prefetch compatibility
|
|
222
|
+
// The SSR plugin detects `use<Name>Query` and generates `<Name>Document` imports
|
|
223
|
+
// So we need to re-export with the original names to get the correct documents
|
|
224
|
+
export {
|
|
225
|
+
useGetOrganizationMembersQuery,
|
|
226
|
+
useGetOrganizationDetailQuery,
|
|
227
|
+
};
|