@samparkchat/sampark-web-chat 0.0.1
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/README.md +93 -0
- package/package.json +72 -0
- package/sampark/sampark-chat/App.d.ts +4 -0
- package/sampark/sampark-chat/App.js +123 -0
- package/sampark/sampark-chat/App.test.d.ts +1 -0
- package/sampark/sampark-chat/App.test.js +8 -0
- package/sampark/sampark-chat/components/Headers/ChatHeader.d.ts +12 -0
- package/sampark/sampark-chat/components/Headers/ChatHeader.js +142 -0
- package/sampark/sampark-chat/components/Headers/GroupChatHeader.d.ts +17 -0
- package/sampark/sampark-chat/components/Headers/GroupChatHeader.js +227 -0
- package/sampark/sampark-chat/components/Headers/ParticipantHeader.d.ts +9 -0
- package/sampark/sampark-chat/components/Headers/ParticipantHeader.js +71 -0
- package/sampark/sampark-chat/components/Headers/SamparkHeader.d.ts +11 -0
- package/sampark/sampark-chat/components/Headers/SamparkHeader.js +162 -0
- package/sampark/sampark-chat/components/MessageActions.d.ts +19 -0
- package/sampark/sampark-chat/components/MessageActions.js +177 -0
- package/sampark/sampark-chat/components/bottomsheets/GroupBottomSheet.d.ts +11 -0
- package/sampark/sampark-chat/components/bottomsheets/GroupBottomSheet.js +276 -0
- package/sampark/sampark-chat/components/bottomsheets/GroupOptionBottomSheet.d.ts +12 -0
- package/sampark/sampark-chat/components/bottomsheets/GroupOptionBottomSheet.js +239 -0
- package/sampark/sampark-chat/components/lists/ParticipantList.d.ts +12 -0
- package/sampark/sampark-chat/components/lists/ParticipantList.js +207 -0
- package/sampark/sampark-chat/components/lists/ViewParticipents.d.ts +36 -0
- package/sampark/sampark-chat/components/lists/ViewParticipents.js +452 -0
- package/sampark/sampark-chat/index.d.ts +5 -0
- package/sampark/sampark-chat/index.js +17 -0
- package/sampark/sampark-chat/models/deleteModel.d.ts +8 -0
- package/sampark/sampark-chat/models/deleteModel.js +63 -0
- package/sampark/sampark-chat/models/infoModal.d.ts +8 -0
- package/sampark/sampark-chat/models/infoModal.js +75 -0
- package/sampark/sampark-chat/reportWebVitals.d.ts +3 -0
- package/sampark/sampark-chat/reportWebVitals.js +13 -0
- package/sampark/sampark-chat/screens/PeerChatScreen.d.ts +20 -0
- package/sampark/sampark-chat/screens/PeerChatScreen.js +467 -0
- package/sampark/sampark-chat/screens/SamparkChatContext.d.ts +6 -0
- package/sampark/sampark-chat/screens/SamparkChatContext.js +9 -0
- package/sampark/sampark-chat/screens/SamparkChatProvider.d.ts +7 -0
- package/sampark/sampark-chat/screens/SamparkChatProvider.js +69 -0
- package/sampark/sampark-chat/screens/SamparkchatScreen.d.ts +16 -0
- package/sampark/sampark-chat/screens/SamparkchatScreen.js +1317 -0
- package/sampark/sampark-chat/screens/groupChatScreen.d.ts +24 -0
- package/sampark/sampark-chat/screens/groupChatScreen.js +375 -0
- package/sampark/sampark-chat/sdk/client/Groupchat.d.ts +53 -0
- package/sampark/sampark-chat/sdk/client/Groupchat.js +457 -0
- package/sampark/sampark-chat/sdk/client/PeerChat.d.ts +34 -0
- package/sampark/sampark-chat/sdk/client/PeerChat.js +227 -0
- package/sampark/sampark-chat/sdk/client/SamparkChat.d.ts +12 -0
- package/sampark/sampark-chat/sdk/client/SamparkChat.js +101 -0
- package/sampark/sampark-chat/sdk/enum/ActionTypes.d.ts +15 -0
- package/sampark/sampark-chat/sdk/enum/ActionTypes.js +16 -0
- package/sampark/sampark-chat/sdk/enum/constant.d.ts +1 -0
- package/sampark/sampark-chat/sdk/enum/constant.js +3 -0
- package/sampark/sampark-chat/sdk/interface/SamparkChatservice.d.ts +3 -0
- package/sampark/sampark-chat/sdk/interface/SamparkChatservice.js +1 -0
- package/sampark/sampark-chat/sdk/interface/SamparkGroupChatService.d.ts +26 -0
- package/sampark/sampark-chat/sdk/interface/SamparkGroupChatService.js +1 -0
- package/sampark/sampark-chat/sdk/interface/SamparkPeerChatService.d.ts +9 -0
- package/sampark/sampark-chat/sdk/interface/SamparkPeerChatService.js +1 -0
- package/sampark/sampark-chat/sdk/types/AddParticipentRequest.d.ts +16 -0
- package/sampark/sampark-chat/sdk/types/AddParticipentRequest.js +14 -0
- package/sampark/sampark-chat/sdk/types/ChatHistoryRequest.d.ts +10 -0
- package/sampark/sampark-chat/sdk/types/ChatHistoryRequest.js +14 -0
- package/sampark/sampark-chat/sdk/types/CreateChatSession.d.ts +11 -0
- package/sampark/sampark-chat/sdk/types/CreateChatSession.js +15 -0
- package/sampark/sampark-chat/sdk/types/CreateChatUser.d.ts +9 -0
- package/sampark/sampark-chat/sdk/types/CreateChatUser.js +13 -0
- package/sampark/sampark-chat/sdk/types/CreateGroupChatRequest.d.ts +18 -0
- package/sampark/sampark-chat/sdk/types/CreateGroupChatRequest.js +16 -0
- package/sampark/sampark-chat/sdk/types/DeleteGroupRequest.d.ts +15 -0
- package/sampark/sampark-chat/sdk/types/DeleteGroupRequest.js +13 -0
- package/sampark/sampark-chat/sdk/types/GenerateTokenRequest.d.ts +10 -0
- package/sampark/sampark-chat/sdk/types/GenerateTokenRequest.js +14 -0
- package/sampark/sampark-chat/sdk/types/GetGroupsRequest.d.ts +8 -0
- package/sampark/sampark-chat/sdk/types/GetGroupsRequest.js +12 -0
- package/sampark/sampark-chat/sdk/types/GetParticipentRequest.d.ts +8 -0
- package/sampark/sampark-chat/sdk/types/GetParticipentRequest.js +12 -0
- package/sampark/sampark-chat/sdk/types/GetRegisteredUserDetailsRequest.d.ts +8 -0
- package/sampark/sampark-chat/sdk/types/GetRegisteredUserDetailsRequest.js +12 -0
- package/sampark/sampark-chat/sdk/types/GroupChatHistoryRequest.d.ts +12 -0
- package/sampark/sampark-chat/sdk/types/GroupChatHistoryRequest.js +16 -0
- package/sampark/sampark-chat/sdk/types/RemoveParticipentRequest.d.ts +14 -0
- package/sampark/sampark-chat/sdk/types/RemoveParticipentRequest.js +12 -0
- package/sampark/sampark-chat/sdk/types/UpdateGroupAdminRequest.d.ts +10 -0
- package/sampark/sampark-chat/sdk/types/UpdateGroupAdminRequest.js +14 -0
- package/sampark/sampark-chat/sdk/types/UpdateGroupStatus.d.ts +10 -0
- package/sampark/sampark-chat/sdk/types/UpdateGroupStatus.js +14 -0
- package/sampark/sampark-chat/services/Common.d.ts +12 -0
- package/sampark/sampark-chat/services/Common.js +18 -0
- package/sampark/sampark-chat/services/DateFormat.d.ts +2 -0
- package/sampark/sampark-chat/services/DateFormat.js +14 -0
- package/sampark/sampark-chat/setupTests.d.ts +1 -0
- package/sampark/sampark-chat/setupTests.js +5 -0
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
13
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
+
function step(op) {
|
|
26
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
29
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
+
switch (op[0]) {
|
|
31
|
+
case 0: case 1: t = op; break;
|
|
32
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
+
default:
|
|
36
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
+
if (t[2]) _.ops.pop();
|
|
41
|
+
_.trys.pop(); continue;
|
|
42
|
+
}
|
|
43
|
+
op = body.call(thisArg, _);
|
|
44
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
49
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
50
|
+
if (ar || !(i in from)) {
|
|
51
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
52
|
+
ar[i] = from[i];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
56
|
+
};
|
|
57
|
+
import React, { useEffect, useState, useMemo } from 'react';
|
|
58
|
+
import Header from '../Headers/ChatHeader';
|
|
59
|
+
import { getInitials, getProfilePicById } from '../../services/Common';
|
|
60
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
61
|
+
import { faEllipsisV, faEnvelope, faSearch, faTimes, faTrash } from '@fortawesome/free-solid-svg-icons';
|
|
62
|
+
var ViewParticipentList = function (_a) {
|
|
63
|
+
var ViewParticipants = _a.ViewParticipants, setShowHideParticipantScreen = _a.setShowHideParticipantScreen, userId = _a.userId, userName = _a.userName, setViewParticipantsList = _a.setViewParticipantsList, setShowParticipantsList = _a.setShowParticipantsList, client = _a.client, joinRoomId = _a.joinRoomId, setViewParticipants = _a.setViewParticipants, userJoinedGroupRole = _a.userJoinedGroupRole, setPeerUserId = _a.setPeerUserId, setPeerUserName = _a.setPeerUserName, setUserProfilePic = _a.setUserProfilePic, setIsChatInitialized = _a.setIsChatInitialized, setShowUserList = _a.setShowUserList, setIsGroupActive = _a.setIsGroupActive, orgParticipantList = _a.orgParticipantList, onClose = _a.onClose, _b = _a.showHeader, showHeader = _b === void 0 ? true : _b, _c = _a.showActions, showActions = _c === void 0 ? true : _c;
|
|
64
|
+
var _d = useState(''), searchQuery = _d[0], setSearchQuery = _d[1];
|
|
65
|
+
var _e = useState(false), showCancelIcon = _e[0], setShowCancelIcon = _e[1];
|
|
66
|
+
var _f = useState([]), filteredParticipants = _f[0], setFilteredParticipants = _f[1];
|
|
67
|
+
var _g = useState(new Array(ViewParticipants.length).fill(false)), showMeatballTooltips = _g[0], setShowMeatballTooltips = _g[1];
|
|
68
|
+
var _h = useState(null), chatroomid = _h[0], setChatroomId = _h[1];
|
|
69
|
+
useEffect(function () {
|
|
70
|
+
setChatroomId(chatroomid);
|
|
71
|
+
// Create global CSS rules immediately
|
|
72
|
+
var globalStyleId = 'global-participants-scrollbar-hide';
|
|
73
|
+
var globalStyle = document.getElementById(globalStyleId);
|
|
74
|
+
if (!globalStyle) {
|
|
75
|
+
globalStyle = document.createElement('style');
|
|
76
|
+
globalStyle.id = globalStyleId;
|
|
77
|
+
globalStyle.textContent = "\n .participants-scroll,\n .participants-scroll *,\n div[class*=\"participants-scroll\"],\n div[class*=\"participants-scroll\"] * {\n scrollbar-width: none !important;\n -ms-overflow-style: none !important;\n -webkit-overflow-scrolling: touch !important;\n }\n .participants-scroll::-webkit-scrollbar,\n .participants-scroll *::-webkit-scrollbar,\n div[class*=\"participants-scroll\"]::-webkit-scrollbar,\n div[class*=\"participants-scroll\"] *::-webkit-scrollbar {\n display: none !important;\n width: 0px !important;\n height: 0px !important;\n background: transparent !important;\n appearance: none !important;\n -webkit-appearance: none !important;\n }\n .participants-scroll::-webkit-scrollbar-track,\n .participants-scroll *::-webkit-scrollbar-track,\n div[class*=\"participants-scroll\"]::-webkit-scrollbar-track,\n div[class*=\"participants-scroll\"] *::-webkit-scrollbar-track {\n display: none !important;\n background: transparent !important;\n }\n .participants-scroll::-webkit-scrollbar-thumb,\n .participants-scroll *::-webkit-scrollbar-thumb,\n div[class*=\"participants-scroll\"]::-webkit-scrollbar-thumb,\n div[class*=\"participants-scroll\"] *::-webkit-scrollbar-thumb {\n display: none !important;\n background: transparent !important;\n }\n .participants-scroll::-webkit-scrollbar-corner,\n .participants-scroll *::-webkit-scrollbar-corner,\n div[class*=\"participants-scroll\"]::-webkit-scrollbar-corner,\n div[class*=\"participants-scroll\"] *::-webkit-scrollbar-corner {\n display: none !important;\n background: transparent !important;\n }\n .participants-scroll::-webkit-resizer,\n .participants-scroll *::-webkit-resizer,\n div[class*=\"participants-scroll\"]::-webkit-resizer,\n div[class*=\"participants-scroll\"] *::-webkit-resizer {\n display: none !important;\n }\n ";
|
|
78
|
+
document.head.appendChild(globalStyle);
|
|
79
|
+
}
|
|
80
|
+
return function () {
|
|
81
|
+
var existingStyle = document.getElementById(globalStyleId);
|
|
82
|
+
if (existingStyle && document.head.contains(existingStyle)) {
|
|
83
|
+
document.head.removeChild(existingStyle);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}, []);
|
|
87
|
+
var updatedParticipants = useMemo(function () { return __spreadArray([
|
|
88
|
+
{ user_id: userId, user_name: "".concat(userName, " (You)"), user_role: userJoinedGroupRole }
|
|
89
|
+
], ViewParticipants.filter(function (participant) { return participant.user_id !== userId; }), true); }, [ViewParticipants, userId, userName]);
|
|
90
|
+
useEffect(function () {
|
|
91
|
+
setFilteredParticipants(updatedParticipants);
|
|
92
|
+
}, [updatedParticipants]);
|
|
93
|
+
var handleSearch = function (query) {
|
|
94
|
+
setSearchQuery(query);
|
|
95
|
+
setShowCancelIcon(query.length > 0);
|
|
96
|
+
if (query.trim() === '') {
|
|
97
|
+
setFilteredParticipants(updatedParticipants);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
var filteredList = updatedParticipants.filter(function (participant) {
|
|
101
|
+
return participant.user_name.toLowerCase().includes(query.toLowerCase());
|
|
102
|
+
});
|
|
103
|
+
setFilteredParticipants(filteredList);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
var clearSearch = function () {
|
|
107
|
+
setSearchQuery('');
|
|
108
|
+
setShowCancelIcon(false);
|
|
109
|
+
setFilteredParticipants(updatedParticipants);
|
|
110
|
+
};
|
|
111
|
+
var toggleTooltip = function (index) {
|
|
112
|
+
var newTooltips = __spreadArray([], showMeatballTooltips, true);
|
|
113
|
+
newTooltips[index] = !newTooltips[index];
|
|
114
|
+
setShowMeatballTooltips(newTooltips);
|
|
115
|
+
};
|
|
116
|
+
var handleConnectParticipant = function (selectedUser, userProfilePic) {
|
|
117
|
+
setIsGroupActive(false);
|
|
118
|
+
setPeerUserId(selectedUser.user_id);
|
|
119
|
+
setPeerUserName(selectedUser.user_name);
|
|
120
|
+
setUserProfilePic(userProfilePic);
|
|
121
|
+
setIsChatInitialized(true);
|
|
122
|
+
setShowUserList(true);
|
|
123
|
+
setShowHideParticipantScreen(false);
|
|
124
|
+
setViewParticipantsList(false);
|
|
125
|
+
setShowParticipantsList(false);
|
|
126
|
+
};
|
|
127
|
+
var handleRemoveParticipant = function (index) {
|
|
128
|
+
var confirmRemove = window.confirm('Are you sure you want to remove this participant from the group?');
|
|
129
|
+
if (confirmRemove) {
|
|
130
|
+
handleWithdrewCall(index);
|
|
131
|
+
toggleTooltip(index);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
var handleWithdrewCall = function (index) { return __awaiter(void 0, void 0, void 0, function () {
|
|
135
|
+
var participantToRemove, leaveGroups, updatedList, error_1;
|
|
136
|
+
return __generator(this, function (_a) {
|
|
137
|
+
switch (_a.label) {
|
|
138
|
+
case 0:
|
|
139
|
+
participantToRemove = filteredParticipants[index];
|
|
140
|
+
_a.label = 1;
|
|
141
|
+
case 1:
|
|
142
|
+
_a.trys.push([1, 3, , 4]);
|
|
143
|
+
return [4 /*yield*/, client.groupChat.updateGroupStatusByParticipant(participantToRemove.user_id, joinRoomId, 'Removed')];
|
|
144
|
+
case 2:
|
|
145
|
+
leaveGroups = _a.sent();
|
|
146
|
+
if (leaveGroups) {
|
|
147
|
+
updatedList = filteredParticipants.filter(function (_, i) { return i !== index; });
|
|
148
|
+
setViewParticipantsList(updatedList);
|
|
149
|
+
setViewParticipants(updatedList);
|
|
150
|
+
setFilteredParticipants(updatedList);
|
|
151
|
+
toggleTooltip(index);
|
|
152
|
+
}
|
|
153
|
+
return [3 /*break*/, 4];
|
|
154
|
+
case 3:
|
|
155
|
+
error_1 = _a.sent();
|
|
156
|
+
console.error('Error removing participant:', error_1);
|
|
157
|
+
return [3 /*break*/, 4];
|
|
158
|
+
case 4: return [2 /*return*/];
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}); };
|
|
162
|
+
var handleBackPress = function () {
|
|
163
|
+
if (onClose) {
|
|
164
|
+
onClose();
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
setShowHideParticipantScreen(false);
|
|
168
|
+
setViewParticipantsList(false);
|
|
169
|
+
setShowParticipantsList(false);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
var renderItem = function (item, index) {
|
|
173
|
+
var isCurrentUser = item.user_id === userId && item.user_name.includes('(You)');
|
|
174
|
+
var userProfilePic = getProfilePicById(orgParticipantList, item.user_id);
|
|
175
|
+
return (React.createElement("div", { key: item.user_id, style: styles.participantItem },
|
|
176
|
+
userProfilePic ? (React.createElement("img", { src: userProfilePic, alt: "Profile", style: styles.participantImage })) : (React.createElement("div", { style: styles.avatarPlaceholder }, getInitials(item.user_name.split(' (You)')[0]))),
|
|
177
|
+
React.createElement("div", { style: __assign(__assign({}, styles.participantName), (isCurrentUser ? styles.currentUser : {})) },
|
|
178
|
+
item.user_name.split(' (You)')[0],
|
|
179
|
+
item.user_role == 'Admin' && React.createElement("span", { style: styles.youText },
|
|
180
|
+
" (",
|
|
181
|
+
item.user_role,
|
|
182
|
+
")"),
|
|
183
|
+
isCurrentUser && React.createElement("span", { style: styles.youText }, " (You)")),
|
|
184
|
+
React.createElement("div", { style: styles.participantCheckbox }),
|
|
185
|
+
!isCurrentUser && showActions && (React.createElement("div", { style: styles.tooltipContainer },
|
|
186
|
+
React.createElement("button", { style: styles.moreIconContainer, onClick: function () { return toggleTooltip(index); } },
|
|
187
|
+
React.createElement(FontAwesomeIcon, { icon: faEllipsisV, style: styles.moreIcon })),
|
|
188
|
+
showMeatballTooltips[index] && (React.createElement("div", { style: styles.tooltipContent },
|
|
189
|
+
React.createElement("div", { style: styles.tooltipBackdrop, onClick: function () { return toggleTooltip(index); } }),
|
|
190
|
+
React.createElement("div", { style: styles.tooltipMenu },
|
|
191
|
+
React.createElement("button", { style: styles.tooltipOption, onClick: function () { return handleConnectParticipant(item, userProfilePic); } },
|
|
192
|
+
React.createElement("div", { style: styles.tooltipRow },
|
|
193
|
+
React.createElement(FontAwesomeIcon, { icon: faEnvelope, style: styles.tooltipIcon }),
|
|
194
|
+
React.createElement("span", { style: styles.tooltipText }, "Message"))),
|
|
195
|
+
React.createElement("div", { style: styles.tooltipSeparator }),
|
|
196
|
+
userJoinedGroupRole == "Admin" && (React.createElement("button", { style: styles.tooltipOption, onClick: function () { return handleRemoveParticipant(index); } },
|
|
197
|
+
React.createElement("div", { style: styles.tooltipRow },
|
|
198
|
+
React.createElement(FontAwesomeIcon, { icon: faTrash, style: styles.tooltipIcon }),
|
|
199
|
+
React.createElement("span", { style: styles.tooltipText }, "Remove")))))))))));
|
|
200
|
+
};
|
|
201
|
+
return (React.createElement("div", { style: __assign(__assign({}, styles.viewParticipantsContainer), { WebkitOverflowScrolling: 'touch', scrollbarWidth: 'none', msOverflowStyle: 'none' }), className: "view-participants-container" },
|
|
202
|
+
showHeader && (React.createElement(Header
|
|
203
|
+
// userProfilePic={'https://www.pixelstalk.net/wp-content/uploads/2016/07/3D-Nature-Images-Free-Download.jpg'}
|
|
204
|
+
, {
|
|
205
|
+
// userProfilePic={'https://www.pixelstalk.net/wp-content/uploads/2016/07/3D-Nature-Images-Free-Download.jpg'}
|
|
206
|
+
onclick: handleBackPress, showBackButton: true, mainHeading: 'Participants List', headingStyle: {
|
|
207
|
+
fontWeight: 'bold',
|
|
208
|
+
color: '#414141',
|
|
209
|
+
fontSize: '20px',
|
|
210
|
+
marginTop: '15px'
|
|
211
|
+
}, showActionButtons: false })),
|
|
212
|
+
!showHeader && (React.createElement("div", { style: styles.sidePanelHeader },
|
|
213
|
+
React.createElement("div", { style: styles.sidePanelTitle },
|
|
214
|
+
React.createElement("h3", { style: styles.panelHeading }, "Participants List"),
|
|
215
|
+
React.createElement("button", { onClick: handleBackPress, style: styles.closeButton }, "\u2715")))),
|
|
216
|
+
React.createElement("div", { style: styles.container },
|
|
217
|
+
React.createElement("div", { style: styles.searchContainer },
|
|
218
|
+
React.createElement(FontAwesomeIcon, { icon: faSearch, style: styles.searchIcon }),
|
|
219
|
+
React.createElement("input", { type: "text", style: styles.searchInput, placeholder: "Search...", value: searchQuery, onChange: function (e) { return handleSearch(e.target.value); } }),
|
|
220
|
+
showCancelIcon && (React.createElement("button", { style: styles.cancelButton, onClick: clearSearch },
|
|
221
|
+
React.createElement(FontAwesomeIcon, { icon: faTimes, style: styles.cancelIcon })))),
|
|
222
|
+
React.createElement("div", { style: styles.participantCount },
|
|
223
|
+
"Total (",
|
|
224
|
+
filteredParticipants.length,
|
|
225
|
+
")"),
|
|
226
|
+
React.createElement("div", { style: __assign(__assign({}, styles.participantsList), { scrollbarWidth: 'none', msOverflowStyle: 'none', WebkitOverflowScrolling: 'touch' }), className: "participants-scroll" }, filteredParticipants.map(function (item, index) { return renderItem(item, index); })))));
|
|
227
|
+
};
|
|
228
|
+
var styles = {
|
|
229
|
+
viewParticipantsContainer: {
|
|
230
|
+
display: 'flex',
|
|
231
|
+
flexDirection: 'column',
|
|
232
|
+
height: '100%',
|
|
233
|
+
width: '100%',
|
|
234
|
+
overflow: 'hidden',
|
|
235
|
+
},
|
|
236
|
+
container: {
|
|
237
|
+
flex: 1,
|
|
238
|
+
backgroundColor: 'white',
|
|
239
|
+
paddingLeft: '20px',
|
|
240
|
+
paddingRight: '20px',
|
|
241
|
+
overflow: 'hidden',
|
|
242
|
+
display: 'flex',
|
|
243
|
+
flexDirection: 'column',
|
|
244
|
+
},
|
|
245
|
+
participantItem: {
|
|
246
|
+
display: 'flex',
|
|
247
|
+
flexDirection: 'row',
|
|
248
|
+
alignItems: 'center',
|
|
249
|
+
paddingRight: '10px',
|
|
250
|
+
paddingTop: '15px',
|
|
251
|
+
paddingBottom: '15px',
|
|
252
|
+
borderBottom: '0.5px solid #cccccc',
|
|
253
|
+
},
|
|
254
|
+
participantImage: {
|
|
255
|
+
width: '50px',
|
|
256
|
+
height: '50px',
|
|
257
|
+
borderRadius: '25px',
|
|
258
|
+
marginRight: '17px',
|
|
259
|
+
objectFit: 'cover',
|
|
260
|
+
},
|
|
261
|
+
avatarPlaceholder: {
|
|
262
|
+
width: '50px',
|
|
263
|
+
height: '50px',
|
|
264
|
+
borderRadius: '25px',
|
|
265
|
+
marginRight: '17px',
|
|
266
|
+
backgroundColor: '#007bff',
|
|
267
|
+
display: 'flex',
|
|
268
|
+
alignItems: 'center',
|
|
269
|
+
justifyContent: 'center',
|
|
270
|
+
color: 'white',
|
|
271
|
+
fontSize: '18px',
|
|
272
|
+
fontWeight: 'bold',
|
|
273
|
+
},
|
|
274
|
+
participantName: {
|
|
275
|
+
flex: 1,
|
|
276
|
+
fontSize: '14px',
|
|
277
|
+
color: '#414141',
|
|
278
|
+
},
|
|
279
|
+
youText: {
|
|
280
|
+
color: '#000BFF',
|
|
281
|
+
},
|
|
282
|
+
adminText: {
|
|
283
|
+
color: '#000BFF',
|
|
284
|
+
marginLeft: '10px',
|
|
285
|
+
},
|
|
286
|
+
participantCheckbox: {
|
|
287
|
+
height: '25px',
|
|
288
|
+
width: '25px',
|
|
289
|
+
borderRadius: '5px',
|
|
290
|
+
marginTop: '5px',
|
|
291
|
+
},
|
|
292
|
+
currentUser: {
|
|
293
|
+
color: '#414141',
|
|
294
|
+
},
|
|
295
|
+
moreIconContainer: {
|
|
296
|
+
padding: '5px',
|
|
297
|
+
background: 'none',
|
|
298
|
+
border: 'none',
|
|
299
|
+
cursor: 'pointer',
|
|
300
|
+
},
|
|
301
|
+
moreIcon: {
|
|
302
|
+
width: '24px',
|
|
303
|
+
height: '24px',
|
|
304
|
+
color: '#666',
|
|
305
|
+
},
|
|
306
|
+
tooltipContainer: {
|
|
307
|
+
position: 'relative',
|
|
308
|
+
},
|
|
309
|
+
tooltipContent: {
|
|
310
|
+
position: 'fixed',
|
|
311
|
+
top: 0,
|
|
312
|
+
left: 0,
|
|
313
|
+
right: 0,
|
|
314
|
+
bottom: 0,
|
|
315
|
+
zIndex: 1000,
|
|
316
|
+
},
|
|
317
|
+
tooltipBackdrop: {
|
|
318
|
+
position: 'absolute',
|
|
319
|
+
top: 0,
|
|
320
|
+
left: 0,
|
|
321
|
+
right: 0,
|
|
322
|
+
bottom: 0,
|
|
323
|
+
background: 'transparent',
|
|
324
|
+
},
|
|
325
|
+
tooltipMenu: {
|
|
326
|
+
position: 'absolute',
|
|
327
|
+
width: '140px',
|
|
328
|
+
padding: '5px 0',
|
|
329
|
+
backgroundColor: 'white',
|
|
330
|
+
borderRadius: '20px',
|
|
331
|
+
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.25)',
|
|
332
|
+
zIndex: 1001,
|
|
333
|
+
},
|
|
334
|
+
tooltipOption: {
|
|
335
|
+
display: 'flex',
|
|
336
|
+
flexDirection: 'row',
|
|
337
|
+
alignItems: 'center',
|
|
338
|
+
padding: '10px 15px',
|
|
339
|
+
background: 'none',
|
|
340
|
+
border: 'none',
|
|
341
|
+
width: '100%',
|
|
342
|
+
cursor: 'pointer',
|
|
343
|
+
},
|
|
344
|
+
tooltipRow: {
|
|
345
|
+
display: 'flex',
|
|
346
|
+
flexDirection: 'row',
|
|
347
|
+
justifyContent: 'center',
|
|
348
|
+
alignItems: 'center',
|
|
349
|
+
width: '100%',
|
|
350
|
+
},
|
|
351
|
+
tooltipText: {
|
|
352
|
+
marginLeft: '10px',
|
|
353
|
+
fontSize: '13px',
|
|
354
|
+
color: 'black',
|
|
355
|
+
textAlign: 'center',
|
|
356
|
+
marginTop: '2px',
|
|
357
|
+
},
|
|
358
|
+
tooltipSeparator: {
|
|
359
|
+
height: '1px',
|
|
360
|
+
backgroundColor: '#E0E0E0',
|
|
361
|
+
},
|
|
362
|
+
peerHeadingStyle: {
|
|
363
|
+
fontWeight: 'bold',
|
|
364
|
+
color: '#414141',
|
|
365
|
+
fontSize: '20px',
|
|
366
|
+
marginTop: '15px',
|
|
367
|
+
},
|
|
368
|
+
tooltipIcon: {
|
|
369
|
+
width: '20px',
|
|
370
|
+
height: '20px',
|
|
371
|
+
},
|
|
372
|
+
participantCount: {
|
|
373
|
+
color: 'black',
|
|
374
|
+
fontSize: '16px',
|
|
375
|
+
fontWeight: '500',
|
|
376
|
+
marginTop: '10px',
|
|
377
|
+
marginBottom: '10px',
|
|
378
|
+
textAlign: 'center',
|
|
379
|
+
},
|
|
380
|
+
searchContainer: {
|
|
381
|
+
display: 'flex',
|
|
382
|
+
flexDirection: 'row',
|
|
383
|
+
alignItems: 'center',
|
|
384
|
+
height: '40px',
|
|
385
|
+
border: '1px solid #cccccc',
|
|
386
|
+
borderRadius: '8px',
|
|
387
|
+
padding: '0 10px',
|
|
388
|
+
marginTop: '20px',
|
|
389
|
+
marginBottom: '15px',
|
|
390
|
+
},
|
|
391
|
+
searchInput: {
|
|
392
|
+
flex: 1,
|
|
393
|
+
marginLeft: '5px',
|
|
394
|
+
border: 'none',
|
|
395
|
+
outline: 'none',
|
|
396
|
+
fontSize: '14px',
|
|
397
|
+
},
|
|
398
|
+
searchIcon: {
|
|
399
|
+
width: '20px',
|
|
400
|
+
height: '20px',
|
|
401
|
+
color: '#666',
|
|
402
|
+
},
|
|
403
|
+
cancelButton: {
|
|
404
|
+
background: 'none',
|
|
405
|
+
border: 'none',
|
|
406
|
+
cursor: 'pointer',
|
|
407
|
+
padding: '0',
|
|
408
|
+
marginLeft: '10px',
|
|
409
|
+
},
|
|
410
|
+
cancelIcon: {
|
|
411
|
+
width: '20px',
|
|
412
|
+
height: '20px',
|
|
413
|
+
color: '#666',
|
|
414
|
+
},
|
|
415
|
+
participantsList: {
|
|
416
|
+
marginBottom: '10px',
|
|
417
|
+
marginTop: '-15px',
|
|
418
|
+
paddingTop: '15px',
|
|
419
|
+
maxHeight: 'calc(100vh - 200px)',
|
|
420
|
+
overflowY: 'auto',
|
|
421
|
+
overflowX: 'hidden',
|
|
422
|
+
scrollbarWidth: 'none',
|
|
423
|
+
msOverflowStyle: 'none',
|
|
424
|
+
WebkitOverflowScrolling: 'touch',
|
|
425
|
+
},
|
|
426
|
+
sidePanelHeader: {
|
|
427
|
+
padding: '16px 20px',
|
|
428
|
+
borderBottom: '1px solid #e0e0e0',
|
|
429
|
+
backgroundColor: '#f8f9fa',
|
|
430
|
+
},
|
|
431
|
+
sidePanelTitle: {
|
|
432
|
+
display: 'flex',
|
|
433
|
+
justifyContent: 'space-between',
|
|
434
|
+
alignItems: 'center',
|
|
435
|
+
},
|
|
436
|
+
panelHeading: {
|
|
437
|
+
margin: '0',
|
|
438
|
+
fontSize: '18px',
|
|
439
|
+
fontWeight: 'bold',
|
|
440
|
+
color: '#414141',
|
|
441
|
+
},
|
|
442
|
+
closeButton: {
|
|
443
|
+
background: 'none',
|
|
444
|
+
border: 'none',
|
|
445
|
+
fontSize: '18px',
|
|
446
|
+
cursor: 'pointer',
|
|
447
|
+
padding: '4px',
|
|
448
|
+
borderRadius: '4px',
|
|
449
|
+
color: '#666',
|
|
450
|
+
},
|
|
451
|
+
};
|
|
452
|
+
export default ViewParticipentList;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as SamparkChatScreen } from './screens/SamparkchatScreen';
|
|
2
|
+
export { default as SamparkChatProvider } from './screens/SamparkChatProvider';
|
|
3
|
+
export { PeerChat } from "./sdk/client/PeerChat";
|
|
4
|
+
export { GroupChat } from "./sdk/client/Groupchat";
|
|
5
|
+
export { SamparkChat } from "./sdk/client/SamparkChat";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// import React from 'react';
|
|
2
|
+
// import ReactDOM from 'react-dom/client';
|
|
3
|
+
// import './index.css';
|
|
4
|
+
// import App from './App';
|
|
5
|
+
// import reportWebVitals from './reportWebVitals';
|
|
6
|
+
// const root = ReactDOM.createRoot(
|
|
7
|
+
// document.getElementById('root') as HTMLElement
|
|
8
|
+
// );
|
|
9
|
+
// root.render(
|
|
10
|
+
// React.createElement(React.StrictMode, null, React.createElement(App))
|
|
11
|
+
// );
|
|
12
|
+
// reportWebVitals();
|
|
13
|
+
export { default as SamparkChatScreen } from './screens/SamparkchatScreen';
|
|
14
|
+
export { default as SamparkChatProvider } from './screens/SamparkChatProvider';
|
|
15
|
+
export { PeerChat } from "./sdk/client/PeerChat";
|
|
16
|
+
export { GroupChat } from "./sdk/client/Groupchat";
|
|
17
|
+
export { SamparkChat } from "./sdk/client/SamparkChat";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
var DeleteModel = function (_a) {
|
|
3
|
+
var open = _a.open, onClose = _a.onClose, onDelete = _a.onDelete;
|
|
4
|
+
if (!open)
|
|
5
|
+
return null;
|
|
6
|
+
return (React.createElement("div", { style: {
|
|
7
|
+
position: "fixed",
|
|
8
|
+
top: 0,
|
|
9
|
+
left: 0,
|
|
10
|
+
width: "100vw",
|
|
11
|
+
height: "100vh",
|
|
12
|
+
background: "rgba(0,0,0,0.2)",
|
|
13
|
+
display: "flex",
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
justifyContent: "center",
|
|
16
|
+
zIndex: 9999
|
|
17
|
+
} },
|
|
18
|
+
React.createElement("div", { style: {
|
|
19
|
+
background: "#fff",
|
|
20
|
+
borderRadius: 20,
|
|
21
|
+
padding: 32,
|
|
22
|
+
minWidth: 340,
|
|
23
|
+
boxShadow: "0 2px 16px rgba(0,0,0,0.15)",
|
|
24
|
+
textAlign: "center"
|
|
25
|
+
} },
|
|
26
|
+
React.createElement("div", { style: { marginBottom: 24 } },
|
|
27
|
+
React.createElement("div", { style: {
|
|
28
|
+
background: "#f5f5f5",
|
|
29
|
+
borderRadius: "50%",
|
|
30
|
+
width: 100,
|
|
31
|
+
height: 100,
|
|
32
|
+
display: "flex",
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
justifyContent: "center",
|
|
35
|
+
margin: "0 auto"
|
|
36
|
+
} },
|
|
37
|
+
React.createElement("i", { className: "fas fa-trash", style: { color: "#d32f2f", fontSize: 48 } }))),
|
|
38
|
+
React.createElement("h2", { style: { margin: "16px 0 8px 0", fontWeight: 600 } }, "Delete Conversation?"),
|
|
39
|
+
React.createElement("div", { style: { color: "#666", marginBottom: 24 } },
|
|
40
|
+
"Would you like to delete this conversation?",
|
|
41
|
+
React.createElement("br", null),
|
|
42
|
+
"This conversation will be deleted from all of your devices."),
|
|
43
|
+
React.createElement("div", { style: { display: "flex", justifyContent: "center", gap: 16 } },
|
|
44
|
+
React.createElement("button", { onClick: onClose, style: {
|
|
45
|
+
background: "#fff",
|
|
46
|
+
color: "#333",
|
|
47
|
+
border: "1px solid #ddd",
|
|
48
|
+
borderRadius: 8,
|
|
49
|
+
padding: "10px 32px",
|
|
50
|
+
fontWeight: 500,
|
|
51
|
+
cursor: "pointer"
|
|
52
|
+
} }, "Cancel"),
|
|
53
|
+
React.createElement("button", { onClick: onDelete, style: {
|
|
54
|
+
background: "#d32f2f",
|
|
55
|
+
color: "#fff",
|
|
56
|
+
border: "none",
|
|
57
|
+
borderRadius: 8,
|
|
58
|
+
padding: "10px 32px",
|
|
59
|
+
fontWeight: 500,
|
|
60
|
+
cursor: "pointer"
|
|
61
|
+
} }, "Delete")))));
|
|
62
|
+
};
|
|
63
|
+
export default DeleteModel;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
var InfoModal = function (_a) {
|
|
3
|
+
var open = _a.open, message = _a.message, onClose = _a.onClose;
|
|
4
|
+
if (!open)
|
|
5
|
+
return null;
|
|
6
|
+
return (React.createElement("div", { style: styles.overlay },
|
|
7
|
+
React.createElement("div", { style: styles.modal },
|
|
8
|
+
React.createElement("div", { style: styles.header },
|
|
9
|
+
React.createElement("span", { style: styles.title }, "Information")),
|
|
10
|
+
React.createElement("div", { style: styles.body },
|
|
11
|
+
React.createElement("span", { style: styles.message }, message)),
|
|
12
|
+
React.createElement("div", { style: styles.footer },
|
|
13
|
+
React.createElement("button", { style: styles.button, onClick: onClose }, "OK")))));
|
|
14
|
+
};
|
|
15
|
+
var styles = {
|
|
16
|
+
overlay: {
|
|
17
|
+
position: 'fixed',
|
|
18
|
+
top: 0,
|
|
19
|
+
left: 0,
|
|
20
|
+
width: '100vw',
|
|
21
|
+
height: '100vh',
|
|
22
|
+
background: 'rgba(0,0,0,0.3)',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
zIndex: 9999,
|
|
27
|
+
},
|
|
28
|
+
modal: {
|
|
29
|
+
background: 'white',
|
|
30
|
+
borderRadius: '8px',
|
|
31
|
+
boxShadow: '0 2px 8px rgba(0,0,0,0.15)',
|
|
32
|
+
minWidth: '320px',
|
|
33
|
+
maxWidth: '90vw',
|
|
34
|
+
padding: '24px',
|
|
35
|
+
display: 'flex',
|
|
36
|
+
flexDirection: 'column',
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
},
|
|
39
|
+
header: {
|
|
40
|
+
marginBottom: '16px',
|
|
41
|
+
width: '100%',
|
|
42
|
+
textAlign: 'center',
|
|
43
|
+
},
|
|
44
|
+
title: {
|
|
45
|
+
fontSize: '18px',
|
|
46
|
+
fontWeight: 600,
|
|
47
|
+
color: '#333',
|
|
48
|
+
},
|
|
49
|
+
body: {
|
|
50
|
+
marginBottom: '24px',
|
|
51
|
+
width: '100%',
|
|
52
|
+
textAlign: 'center',
|
|
53
|
+
},
|
|
54
|
+
message: {
|
|
55
|
+
fontSize: '16px',
|
|
56
|
+
color: '#444',
|
|
57
|
+
},
|
|
58
|
+
footer: {
|
|
59
|
+
width: '100%',
|
|
60
|
+
display: 'flex',
|
|
61
|
+
justifyContent: 'center',
|
|
62
|
+
},
|
|
63
|
+
button: {
|
|
64
|
+
padding: '8px 24px',
|
|
65
|
+
borderRadius: '4px',
|
|
66
|
+
background: '#1976d2',
|
|
67
|
+
color: 'white',
|
|
68
|
+
border: 'none',
|
|
69
|
+
fontWeight: 500,
|
|
70
|
+
fontSize: '15px',
|
|
71
|
+
cursor: 'pointer',
|
|
72
|
+
boxShadow: '0 1px 2px rgba(0,0,0,0.08)',
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
export default InfoModal;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var reportWebVitals = function (onPerfEntry) {
|
|
2
|
+
if (onPerfEntry && onPerfEntry instanceof Function) {
|
|
3
|
+
import('web-vitals').then(function (_a) {
|
|
4
|
+
var getCLS = _a.getCLS, getFID = _a.getFID, getFCP = _a.getFCP, getLCP = _a.getLCP, getTTFB = _a.getTTFB;
|
|
5
|
+
getCLS(onPerfEntry);
|
|
6
|
+
getFID(onPerfEntry);
|
|
7
|
+
getFCP(onPerfEntry);
|
|
8
|
+
getLCP(onPerfEntry);
|
|
9
|
+
getTTFB(onPerfEntry);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export default reportWebVitals;
|