@samparkchat/sampark-web-chat 0.0.2 → 0.0.4

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.
Files changed (29) hide show
  1. package/package.json +1 -1
  2. package/sampark/sampark-chat/components/Actions/GroupMessageActions.d.ts +1 -0
  3. package/sampark/sampark-chat/components/Actions/GroupMessageActions.js +56 -31
  4. package/sampark/sampark-chat/components/Actions/MessageActions.d.ts +2 -1
  5. package/sampark/sampark-chat/components/Actions/MessageActions.js +161 -158
  6. package/sampark/sampark-chat/components/AttachmentFileSharing.js +2 -1
  7. package/sampark/sampark-chat/components/Headers/ChatHeader.d.ts +1 -0
  8. package/sampark/sampark-chat/components/Headers/ChatHeader.js +4 -4
  9. package/sampark/sampark-chat/components/Headers/GroupChatHeader.d.ts +1 -0
  10. package/sampark/sampark-chat/components/Headers/GroupChatHeader.js +3 -1
  11. package/sampark/sampark-chat/components/Headers/SearchHeader.d.ts +8 -0
  12. package/sampark/sampark-chat/components/Headers/SearchHeader.js +57 -0
  13. package/sampark/sampark-chat/components/ThreadConversation.d.ts +50 -0
  14. package/sampark/sampark-chat/components/ThreadConversation.js +293 -0
  15. package/sampark/sampark-chat/components/lists/ViewParticipents.d.ts +1 -0
  16. package/sampark/sampark-chat/components/lists/ViewParticipents.js +9 -5
  17. package/sampark/sampark-chat/index.d.ts +5 -0
  18. package/sampark/sampark-chat/index.js +5 -5
  19. package/sampark/sampark-chat/screens/PeerChatScreen.js +191 -172
  20. package/sampark/sampark-chat/screens/SamparkChatProvider.d.ts +1 -1
  21. package/sampark/sampark-chat/screens/SamparkchatScreen.d.ts +1 -1
  22. package/sampark/sampark-chat/screens/SamparkchatScreen.js +1 -1
  23. package/sampark/sampark-chat/screens/groupChatScreen.js +110 -107
  24. package/sampark/sampark-chat/theme/colors.d.ts +1 -0
  25. package/sampark/sampark-chat/theme/colors.js +1 -0
  26. package/sampark/sampark-chat/theme/fonts.d.ts +12 -0
  27. package/sampark/sampark-chat/theme/fonts.js +12 -1
  28. package/sampark/sampark-chat/theme/icons.d.ts +70 -0
  29. package/sampark/sampark-chat/theme/icons.js +16 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@samparkchat/sampark-web-chat",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "main": "sampark/sampark-web-chat/index.js",
5
5
  "types": "sampark/sampark-web-chat/index.d.ts",
6
6
  "private": false,
@@ -11,6 +11,7 @@ interface GroupMessageActionsProps {
11
11
  onCloseMenu: () => void;
12
12
  message: string;
13
13
  position?: 'left' | 'right';
14
+ inline?: boolean;
14
15
  canEdit?: boolean;
15
16
  onEditClick?: () => void;
16
17
  onReplyClick?: () => void;
@@ -1,9 +1,21 @@
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
+ };
1
12
  import React from 'react';
2
13
  import EmojiPicker from 'emoji-picker-react';
3
14
  var GroupMessageActions = function (_a) {
4
15
  var _b;
5
- var showEmojiPicker = _a.showEmojiPicker, showMenu = _a.showMenu, onEmojiClick = _a.onEmojiClick, onMenuClick = _a.onMenuClick, onEmojiSelect = _a.onEmojiSelect, onCloseEmojiPicker = _a.onCloseEmojiPicker, onCloseMenu = _a.onCloseMenu, message = _a.message, _c = _a.position, position = _c === void 0 ? 'right' : _c, _d = _a.canEdit, canEdit = _d === void 0 ? false : _d, onEditClick = _a.onEditClick, onReplyClick = _a.onReplyClick;
6
- var _e = React.useState(false), copied = _e[0], setCopied = _e[1];
16
+ var showEmojiPicker = _a.showEmojiPicker, showMenu = _a.showMenu, onEmojiClick = _a.onEmojiClick, onMenuClick = _a.onMenuClick, onEmojiSelect = _a.onEmojiSelect, onCloseEmojiPicker = _a.onCloseEmojiPicker, onCloseMenu = _a.onCloseMenu, message = _a.message, _c = _a.position, position = _c === void 0 ? 'right' : _c, _d = _a.inline, inline = _d === void 0 ? false : _d, _e = _a.canEdit, canEdit = _e === void 0 ? false : _e, onEditClick = _a.onEditClick, onReplyClick = _a.onReplyClick;
17
+ var _f = React.useState(false), copied = _f[0], setCopied = _f[1];
18
+ var _g = React.useState(false), isHovered = _g[0], setIsHovered = _g[1];
7
19
  var handleCopy = function () {
8
20
  if (navigator && navigator.clipboard) {
9
21
  navigator.clipboard.writeText(message);
@@ -11,22 +23,30 @@ var GroupMessageActions = function (_a) {
11
23
  setTimeout(function () { return setCopied(false); }, 1200);
12
24
  }
13
25
  };
14
- return (React.createElement("div", { className: "chat-message-icons", style: (_b = {
15
- display: 'flex',
16
- flexDirection: 'row',
17
- alignItems: 'center',
18
- gap: '7px',
19
- position: 'absolute'
20
- },
21
- _b[position === 'right' ? 'right' : 'left'] = '-60px',
22
- _b.top = '50%',
23
- _b.transform = 'translateY(-50%)',
24
- _b.opacity = 0,
25
- _b.pointerEvents = 'none',
26
- _b.zIndex = 10,
27
- _b.minWidth = '80px',
28
- _b.transition = 'opacity 0.2s',
29
- _b) },
26
+ var baseStyle = {
27
+ display: 'flex',
28
+ flexDirection: 'row',
29
+ alignItems: 'center',
30
+ gap: '7px',
31
+ opacity: isHovered || showEmojiPicker || showMenu ? 1 : 0,
32
+ pointerEvents: 'auto',
33
+ zIndex: 10,
34
+ minWidth: '80px',
35
+ transition: 'opacity 0.15s, transform 0.12s',
36
+ };
37
+ var inlineStyle = inline ? {
38
+ position: 'relative',
39
+ marginLeft: 10,
40
+ top: 'auto',
41
+ transform: 'translateY(0)'
42
+ } : (_b = {
43
+ position: 'absolute'
44
+ },
45
+ _b[position === 'right' ? 'right' : 'left'] = '-60px',
46
+ _b.top = '50%',
47
+ _b.transform = 'translateY(-50%)',
48
+ _b);
49
+ return (React.createElement("div", { className: "chat-message-icons", style: __assign(__assign({}, baseStyle), inlineStyle), onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } },
30
50
  React.createElement("span", { style: {
31
51
  display: 'flex',
32
52
  alignItems: 'center',
@@ -48,7 +68,10 @@ var GroupMessageActions = function (_a) {
48
68
  display: 'flex',
49
69
  alignItems: 'center',
50
70
  justifyContent: 'center',
51
- }, onClick: onEmojiClick },
71
+ }, onClick: function (e) {
72
+ e.stopPropagation();
73
+ onEmojiClick();
74
+ } },
52
75
  React.createElement("i", { className: "fas fa-smile" }))),
53
76
  React.createElement("span", { style: {
54
77
  display: 'flex',
@@ -71,10 +94,15 @@ var GroupMessageActions = function (_a) {
71
94
  display: 'flex',
72
95
  alignItems: 'center',
73
96
  justifyContent: 'center',
74
- }, onClick: onMenuClick },
97
+ }, onClick: function (e) {
98
+ e.stopPropagation();
99
+ onMenuClick();
100
+ } },
75
101
  React.createElement("i", { className: "fas fa-ellipsis-h" }))),
76
- showEmojiPicker && (React.createElement("div", { className: "emoji-picker-container", style: {
102
+ showEmojiPicker && (React.createElement("div", { className: "emoji-picker-container", onClick: function (e) { return e.stopPropagation(); }, style: {
77
103
  position: 'absolute',
104
+ bottom: '100%',
105
+ marginBottom: '8px',
78
106
  zIndex: 9999,
79
107
  backgroundColor: 'white',
80
108
  borderRadius: '12px',
@@ -92,11 +120,11 @@ var GroupMessageActions = function (_a) {
92
120
  position: 'absolute',
93
121
  zIndex: 9999,
94
122
  background: '#fff',
95
- borderRadius: '16px',
96
- boxShadow: '0 4px 20px rgba(0,0,0,0.15)',
97
- border: '1px solid #e0e0e0',
98
- minWidth: '170px',
99
- padding: '12px 0',
123
+ borderRadius: '14px',
124
+ boxShadow: '0 8px 30px rgba(16,24,40,0.12)',
125
+ border: '1px solid rgba(16,24,40,0.06)',
126
+ minWidth: '190px',
127
+ padding: '8px 0',
100
128
  display: 'flex',
101
129
  flexDirection: 'column',
102
130
  gap: '2px',
@@ -107,11 +135,8 @@ var GroupMessageActions = function (_a) {
107
135
  width: '100%',
108
136
  display: 'flex',
109
137
  alignItems: 'center',
110
- gap: '14px',
111
- padding: '12px 24px',
112
- fontSize: '16px',
113
- color: '#444',
114
- cursor: 'pointer',
138
+ gap: '14px', padding: '12px 24px',
139
+ fontSize: '16px', color: '#444', cursor: 'pointer',
115
140
  }, onClick: function () {
116
141
  onCloseMenu();
117
142
  onReplyClick === null || onReplyClick === void 0 ? void 0 : onReplyClick();
@@ -3,6 +3,7 @@ interface MessageActionsProps {
3
3
  showEmojiPicker: boolean;
4
4
  showMenu: boolean;
5
5
  onEmojiClick: () => void;
6
+ allowReact?: boolean;
6
7
  onMenuClick: () => void;
7
8
  onEmojiSelect: (emoji: {
8
9
  emoji: string;
@@ -13,7 +14,7 @@ interface MessageActionsProps {
13
14
  position?: 'left' | 'right';
14
15
  canEdit?: boolean;
15
16
  onEditClick?: () => void;
16
- onReplyClick?: () => void;
17
+ onThreadClick?: () => void;
17
18
  }
18
19
  declare const MessageActions: React.FC<MessageActionsProps>;
19
20
  export default MessageActions;
@@ -1,9 +1,12 @@
1
1
  import React from 'react';
2
2
  import EmojiPicker from 'emoji-picker-react';
3
+ import { AppIcons } from '../../theme/icons';
4
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3
5
  var MessageActions = function (_a) {
4
6
  var _b;
5
- var showEmojiPicker = _a.showEmojiPicker, showMenu = _a.showMenu, onEmojiClick = _a.onEmojiClick, onMenuClick = _a.onMenuClick, onEmojiSelect = _a.onEmojiSelect, onCloseEmojiPicker = _a.onCloseEmojiPicker, onCloseMenu = _a.onCloseMenu, message = _a.message, _c = _a.position, position = _c === void 0 ? 'right' : _c, _d = _a.canEdit, canEdit = _d === void 0 ? false : _d, onEditClick = _a.onEditClick, onReplyClick = _a.onReplyClick;
6
- var _e = React.useState(false), copied = _e[0], setCopied = _e[1];
7
+ var showEmojiPicker = _a.showEmojiPicker, showMenu = _a.showMenu, onEmojiClick = _a.onEmojiClick, onMenuClick = _a.onMenuClick, onEmojiSelect = _a.onEmojiSelect, onCloseEmojiPicker = _a.onCloseEmojiPicker, onCloseMenu = _a.onCloseMenu, message = _a.message, _c = _a.position, position = _c === void 0 ? 'right' : _c, _d = _a.canEdit, canEdit = _d === void 0 ? false : _d, _e = _a.allowReact, allowReact = _e === void 0 ? true : _e, onEditClick = _a.onEditClick, onThreadClick = _a.onThreadClick;
8
+ var _f = React.useState(false), copied = _f[0], setCopied = _f[1];
9
+ var _g = React.useState(false), isHovered = _g[0], setIsHovered = _g[1];
7
10
  var handleCopy = function () {
8
11
  if (navigator && navigator.clipboard) {
9
12
  navigator.clipboard.writeText(message);
@@ -11,173 +14,173 @@ var MessageActions = function (_a) {
11
14
  setTimeout(function () { return setCopied(false); }, 1200);
12
15
  }
13
16
  };
14
- return (React.createElement("div", { className: "chat-message-icons", style: (_b = {
15
- display: 'flex',
16
- flexDirection: 'row',
17
- alignItems: 'center',
18
- gap: '7px',
19
- position: 'absolute'
20
- },
21
- _b[position === 'right' ? 'right' : 'left'] = '-60px',
22
- _b.top = '50%',
23
- _b.transform = 'translateY(-50%)',
24
- _b.opacity = 0,
25
- _b.pointerEvents = 'none',
26
- _b.zIndex = 10,
27
- _b.minWidth = '80px',
28
- _b.transition = 'opacity 0.2s',
29
- _b) },
30
- React.createElement("span", { style: {
31
- display: 'flex',
32
- alignItems: 'center',
33
- justifyContent: 'center',
34
- width: '30px',
35
- height: '30px',
36
- background: '#fff',
37
- borderRadius: '50%',
38
- boxShadow: '0 2px 8px rgba(0,0,0,0.10)',
39
- border: '1px solid #eee',
40
- } },
41
- React.createElement("button", { style: {
42
- background: 'none',
43
- border: 'none',
44
- padding: 0,
45
- cursor: 'pointer',
46
- color: '#888',
47
- fontSize: '20px',
17
+ return (React.createElement(React.Fragment, null,
18
+ React.createElement("style", null, "\n @keyframes fadeInScale {\n from { opacity: 0; transform: scale(0.98); }\n to { opacity: 1; transform: scale(1); }\n }\n .message-menu-container button:hover { background: rgba(0,0,0,0.04); }\n .message-menu-container i { width: 18px; text-align: center; }\n .chat-message-icons span button:hover { transform: translateY(-2px); }\n "),
19
+ React.createElement("div", { className: "chat-message-icons", style: (_b = {
48
20
  display: 'flex',
21
+ flexDirection: 'row',
49
22
  alignItems: 'center',
50
- justifyContent: 'center',
51
- }, onClick: onEmojiClick },
52
- React.createElement("i", { className: "fas fa-smile" }))),
53
- React.createElement("span", { style: {
54
- display: 'flex',
55
- alignItems: 'center',
56
- justifyContent: 'center',
57
- width: '30px',
58
- height: '30px',
59
- background: '#fff',
60
- borderRadius: '50%',
61
- boxShadow: '0 2px 8px rgba(0,0,0,0.10)',
62
- border: '1px solid #eee',
63
- } },
64
- React.createElement("button", { style: {
65
- background: 'none',
66
- border: 'none',
67
- padding: 0,
68
- cursor: 'pointer',
69
- color: '#888',
70
- fontSize: '20px',
23
+ gap: '8px',
24
+ position: 'absolute'
25
+ },
26
+ _b[position === 'right' ? 'right' : 'left'] = position === 'right' ? '-64px' : '-64px',
27
+ _b.top = '50%',
28
+ _b.transform = 'translateY(-50%)',
29
+ _b.opacity = isHovered || showEmojiPicker || showMenu ? 1 : 0,
30
+ _b.pointerEvents = 'auto',
31
+ _b.zIndex = 10,
32
+ _b.minWidth = '48px',
33
+ _b.transition = 'opacity 0.2s',
34
+ _b), onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } },
35
+ allowReact && (React.createElement("span", { style: {
71
36
  display: 'flex',
72
37
  alignItems: 'center',
73
38
  justifyContent: 'center',
74
- }, onClick: onMenuClick },
75
- React.createElement("i", { className: "fas fa-ellipsis-h" }))),
76
- showEmojiPicker && (React.createElement("div", { className: "emoji-picker-container", style: {
77
- position: 'absolute',
78
- zIndex: 9999,
79
- backgroundColor: 'white',
80
- borderRadius: '12px',
81
- boxShadow: '0 4px 20px rgba(0,0,0,0.15)',
82
- border: '1px solid #e0e0e0',
83
- } },
84
- React.createElement(EmojiPicker, { onEmojiClick: function (emojiData) {
85
- var _a;
86
- var emojiId = emojiData.unified; // unique
87
- var rawType = ((_a = emojiData.names) === null || _a === void 0 ? void 0 : _a[0]) || "unknown"; // no slug in type
88
- var emojiType = rawType.toLowerCase().replace(/\s+/g, "_");
89
- onEmojiSelect({ emojiId: emojiId, emojiType: emojiType });
90
- }, width: 300, height: 300, previewConfig: { showPreview: false }, searchDisabled: true }))),
91
- showMenu && (React.createElement("div", { className: "message-menu-container", style: {
92
- position: 'absolute',
93
- zIndex: 9999,
94
- background: '#fff',
95
- borderRadius: '16px',
96
- boxShadow: '0 4px 20px rgba(0,0,0,0.15)',
97
- border: '1px solid #e0e0e0',
98
- minWidth: '170px',
99
- padding: '12px 0',
100
- display: 'flex',
101
- flexDirection: 'column',
102
- gap: '2px',
103
- } },
104
- React.createElement("button", { style: {
105
- background: 'none',
106
- border: 'none',
107
- width: '100%',
108
- display: 'flex',
109
- alignItems: 'center',
110
- gap: '14px',
111
- padding: '12px 24px',
112
- fontSize: '16px',
113
- color: '#444',
114
- cursor: 'pointer',
115
- }, onClick: function () {
116
- onCloseMenu();
117
- onReplyClick === null || onReplyClick === void 0 ? void 0 : onReplyClick();
39
+ width: '30px',
40
+ height: '30px',
41
+ background: '#fff',
42
+ borderRadius: '50%',
43
+ boxShadow: '0 2px 8px rgba(0,0,0,0.10)',
44
+ border: '1px solid #eee',
118
45
  } },
119
- React.createElement("i", { className: "fas fa-reply", style: { fontSize: '18px', color: '#888' } }),
120
- " Reply"),
121
- React.createElement("button", { style: {
122
- background: 'none',
123
- border: 'none',
124
- width: '100%',
125
- display: 'flex',
126
- alignItems: 'center',
127
- gap: '14px',
128
- padding: '12px 24px',
129
- fontSize: '16px',
130
- color: copied ? '#007bff' : '#444',
131
- cursor: 'pointer',
132
- position: 'relative',
133
- }, onClick: handleCopy },
134
- React.createElement("i", { className: "fas fa-copy", style: { fontSize: '18px', color: copied ? '#007bff' : '#888' } }),
135
- " ",
136
- copied ? 'Copied' : 'Copy'),
137
- canEdit && (React.createElement("button", { style: {
138
- background: 'none',
139
- border: 'none',
140
- width: '100%',
46
+ React.createElement("button", { style: {
47
+ background: 'none',
48
+ border: 'none',
49
+ padding: 0,
50
+ cursor: 'pointer',
51
+ color: '#888',
52
+ fontSize: '20px',
53
+ display: 'flex',
54
+ alignItems: 'center',
55
+ justifyContent: 'center',
56
+ }, onClick: function (e) {
57
+ e.stopPropagation();
58
+ onEmojiClick();
59
+ } },
60
+ React.createElement("i", { className: "fas fa-smile" })))),
61
+ React.createElement("span", { style: {
141
62
  display: 'flex',
142
63
  alignItems: 'center',
143
- gap: '14px',
144
- padding: '12px 24px',
145
- fontSize: '16px',
146
- color: '#444',
147
- cursor: 'pointer',
148
- }, onClick: function () {
149
- onCloseMenu();
150
- onEditClick && onEditClick();
64
+ justifyContent: 'center',
65
+ width: '30px',
66
+ height: '30px',
67
+ background: '#fff',
68
+ borderRadius: '50%',
69
+ boxShadow: '0 2px 8px rgba(0,0,0,0.10)',
70
+ border: '1px solid #eee',
151
71
  } },
152
- React.createElement("i", { className: "fas fa-pencil-alt", style: { fontSize: '18px', color: '#888' } }),
153
- " Edit")),
154
- React.createElement("button", { style: {
155
- background: 'none',
156
- border: 'none',
157
- width: '100%',
158
- display: 'flex',
159
- alignItems: 'center',
160
- gap: '14px',
161
- padding: '12px 24px',
162
- fontSize: '16px',
163
- color: '#444',
164
- cursor: 'pointer',
72
+ React.createElement("button", { style: {
73
+ background: 'none',
74
+ border: 'none',
75
+ padding: 0,
76
+ cursor: 'pointer',
77
+ color: '#888',
78
+ fontSize: '20px',
79
+ display: 'flex',
80
+ alignItems: 'center',
81
+ justifyContent: 'center',
82
+ }, onClick: function (e) {
83
+ e.stopPropagation();
84
+ onMenuClick();
85
+ } },
86
+ React.createElement("i", { className: "fas fa-ellipsis-h" }))),
87
+ showEmojiPicker && allowReact && (React.createElement("div", { className: "emoji-picker-container", onClick: function (e) { return e.stopPropagation(); }, style: {
88
+ position: 'absolute',
89
+ bottom: '100%',
90
+ marginBottom: '8px',
91
+ zIndex: 9999,
92
+ backgroundColor: 'white',
93
+ borderRadius: '12px',
94
+ boxShadow: '0 4px 20px rgba(0,0,0,0.15)',
95
+ border: '1px solid #e0e0e0',
165
96
  } },
166
- React.createElement("i", { className: "fas fa-info-circle", style: { fontSize: '18px', color: '#888' } }),
167
- " Info"),
168
- React.createElement("button", { style: {
169
- background: 'none',
170
- border: 'none',
171
- width: '100%',
97
+ React.createElement(EmojiPicker, { onEmojiClick: function (emojiData) {
98
+ var _a;
99
+ var emojiId = emojiData.unified; // unique
100
+ var rawType = ((_a = emojiData.names) === null || _a === void 0 ? void 0 : _a[0]) || "unknown"; // no slug in type
101
+ var emojiType = rawType.toLowerCase().replace(/\s+/g, "_");
102
+ onEmojiSelect({ emojiId: emojiId, emojiType: emojiType });
103
+ }, width: 300, height: 300, previewConfig: { showPreview: false }, searchDisabled: true }))),
104
+ showMenu && (React.createElement("div", { className: "message-menu-container", style: {
105
+ position: 'absolute',
106
+ bottom: '100%',
107
+ right: position === 'right' ? '0' : 'auto',
108
+ left: position === 'left' ? '0' : 'auto',
109
+ marginBottom: '8px',
110
+ zIndex: 9999,
111
+ background: '#fff',
112
+ borderRadius: '10px',
113
+ boxShadow: '0 8px 24px rgba(0,0,0,0.10)',
114
+ border: '1px solid rgba(15,23,42,0.06)',
115
+ minWidth: '160px',
116
+ padding: '6px 0',
172
117
  display: 'flex',
173
- alignItems: 'center',
174
- gap: '14px',
175
- padding: '12px 24px',
176
- fontSize: '16px',
177
- color: '#444',
178
- cursor: 'pointer',
118
+ flexDirection: 'column',
119
+ gap: '0',
120
+ animation: 'fadeInScale 0.12s ease-out'
179
121
  } },
180
- React.createElement("i", { className: "fas fa-trash", style: { fontSize: '18px', color: '#888' } }),
181
- " Delete")))));
122
+ React.createElement("button", { style: {
123
+ background: 'none',
124
+ border: 'none',
125
+ width: '100%',
126
+ display: 'flex',
127
+ alignItems: 'center',
128
+ gap: '12px',
129
+ padding: '10px 16px',
130
+ fontSize: '14px',
131
+ color: '#444',
132
+ cursor: 'pointer',
133
+ }, onClick: function () {
134
+ onCloseMenu();
135
+ onThreadClick === null || onThreadClick === void 0 ? void 0 : onThreadClick();
136
+ } },
137
+ React.createElement(FontAwesomeIcon, { icon: AppIcons.faCommentDots.icon, style: { fontSize: AppIcons.faCommentDots.size, color: AppIcons.faCommentDots.color }, "aria-hidden": true }),
138
+ "Thread"),
139
+ React.createElement("button", { style: {
140
+ background: 'none',
141
+ border: 'none',
142
+ width: '100%',
143
+ display: 'flex',
144
+ alignItems: 'center',
145
+ gap: '12px',
146
+ padding: '10px 16px',
147
+ fontSize: '14px',
148
+ color: copied ? '#007bff' : '#444',
149
+ cursor: 'pointer',
150
+ position: 'relative',
151
+ }, onClick: handleCopy },
152
+ React.createElement(FontAwesomeIcon, { icon: AppIcons.faCopy.icon, style: { fontSize: AppIcons.faCopy.size, color: AppIcons.faCopy.color }, "aria-hidden": true }),
153
+ copied ? 'Copied' : 'Copy'),
154
+ canEdit && (React.createElement("button", { style: {
155
+ background: 'none',
156
+ border: 'none',
157
+ width: '100%',
158
+ display: 'flex',
159
+ alignItems: 'center',
160
+ gap: '12px',
161
+ padding: '10px 16px',
162
+ fontSize: '14px',
163
+ color: '#444',
164
+ cursor: 'pointer',
165
+ }, onClick: function () {
166
+ onCloseMenu();
167
+ onEditClick && onEditClick();
168
+ } },
169
+ React.createElement(FontAwesomeIcon, { icon: AppIcons.faPenToSquare.icon, style: { fontSize: AppIcons.faPenToSquare.size, color: AppIcons.faPenToSquare.color }, "aria-hidden": true }),
170
+ "Edit")),
171
+ React.createElement("button", { style: {
172
+ background: 'none',
173
+ border: 'none',
174
+ width: '100%',
175
+ display: 'flex',
176
+ alignItems: 'center',
177
+ gap: '12px',
178
+ padding: '10px 16px',
179
+ fontSize: '14px',
180
+ color: '#444',
181
+ cursor: 'pointer',
182
+ } },
183
+ React.createElement(FontAwesomeIcon, { icon: AppIcons.faReply.icon, style: { fontSize: AppIcons.faReply.size, color: AppIcons.faReply.color }, "aria-hidden": true }),
184
+ "Reply"))))));
182
185
  };
183
186
  export default MessageActions;
@@ -35,6 +35,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  }
36
36
  };
37
37
  import React, { useRef } from 'react';
38
+ import colors from '../theme/colors';
38
39
  var AttachmentFileSharing = function (_a) {
39
40
  var isVisible = _a.isVisible, onClose = _a.onClose, onAttachImage = _a.onAttachImage, onAttachVideo = _a.onAttachVideo, onAttachAudio = _a.onAttachAudio, onAttachFile = _a.onAttachFile, client = _a.client, roomId = _a.roomId, userId = _a.userId, userName = _a.userName, _b = _a.uploadSource, uploadSource = _b === void 0 ? 'peer_chat' : _b, onFileUpload = _a.onFileUpload;
40
41
  var imageInputRef = useRef(null);
@@ -112,7 +113,7 @@ var AttachmentFileSharing = function (_a) {
112
113
  attachmentIcon: {
113
114
  width: '32px',
114
115
  height: '32px',
115
- backgroundColor: '#6c5ce7',
116
+ background: colors.headerGradient,
116
117
  borderRadius: '8px',
117
118
  display: 'flex',
118
119
  alignItems: 'center',
@@ -11,6 +11,7 @@ type PeerChatHeaderProps = {
11
11
  onAudioCall?: () => void;
12
12
  onUserClick?: () => void;
13
13
  showVideoCall?: boolean;
14
+ onSearch?: () => void;
14
15
  };
15
16
  declare const PeerChatHeader: React.FC<PeerChatHeaderProps>;
16
17
  export default PeerChatHeader;
@@ -16,7 +16,7 @@ import CustomIcons from "../../theme/icons";
16
16
  import colors from "../../theme/colors";
17
17
  import fonts from "../../theme/fonts";
18
18
  var PeerChatHeader = function (_a) {
19
- var userProfilePic = _a.userProfilePic, onclick = _a.onclick, _b = _a.showBackButton, showBackButton = _b === void 0 ? true : _b, mainHeading = _a.mainHeading, _c = _a.headingStyle, headingStyle = _c === void 0 ? {} : _c, isPeerOnline = _a.isPeerOnline, _d = _a.showActionButtons, showActionButtons = _d === void 0 ? true : _d, onVideoCall = _a.onVideoCall, onAudioCall = _a.onAudioCall, onUserClick = _a.onUserClick, _e = _a.showVideoCall, showVideoCall = _e === void 0 ? false : _e;
19
+ var userProfilePic = _a.userProfilePic, onclick = _a.onclick, _b = _a.showBackButton, showBackButton = _b === void 0 ? true : _b, mainHeading = _a.mainHeading, _c = _a.headingStyle, headingStyle = _c === void 0 ? {} : _c, isPeerOnline = _a.isPeerOnline, _d = _a.showActionButtons, showActionButtons = _d === void 0 ? true : _d, onVideoCall = _a.onVideoCall, onAudioCall = _a.onAudioCall, onUserClick = _a.onUserClick, _e = _a.showVideoCall, showVideoCall = _e === void 0 ? false : _e, onSearch = _a.onSearch;
20
20
  return (React.createElement("div", { style: styles.headerContainer },
21
21
  showBackButton && (React.createElement("button", { onClick: onclick, style: styles.backButton },
22
22
  React.createElement(FontAwesomeIcon, { icon: CustomIcons.BackArrow.icon, style: { fontSize: CustomIcons.BackArrow.size, color: CustomIcons.BackArrow.color } }))),
@@ -33,11 +33,11 @@ var PeerChatHeader = function (_a) {
33
33
  mainHeading),
34
34
  React.createElement("span", { style: __assign(__assign({}, styles.onlineStatus), { color: isPeerOnline ? colors.onlineColor : colors.disabledColor }) }))),
35
35
  showActionButtons && (React.createElement("div", { style: styles.actionButtons },
36
- React.createElement("button", { disabled: !isPeerOnline || showVideoCall, style: __assign(__assign({}, styles.actionButton), { opacity: (!isPeerOnline || showVideoCall) ? 0.5 : 1 }), title: "Call", onClick: onAudioCall },
36
+ React.createElement("button", { disabled: !isPeerOnline || showVideoCall, style: __assign(__assign({}, styles.actionButton), { opacity: (!isPeerOnline || showVideoCall) ? 0.5 : 1 }), "aria-label": "Call", onClick: onAudioCall },
37
37
  React.createElement(FontAwesomeIcon, { icon: CustomIcons.faPhone.icon, style: { fontSize: CustomIcons.faPhone.size, color: colors.white } })),
38
- React.createElement("button", { disabled: !isPeerOnline || showVideoCall, style: __assign(__assign({}, styles.actionButton), { opacity: (!isPeerOnline || showVideoCall) ? 0.5 : 1 }), title: "Video Call", onClick: onVideoCall },
38
+ React.createElement("button", { disabled: !isPeerOnline || showVideoCall, style: __assign(__assign({}, styles.actionButton), { opacity: (!isPeerOnline || showVideoCall) ? 0.5 : 1 }), "aria-label": "Video Call", onClick: onVideoCall },
39
39
  React.createElement(FontAwesomeIcon, { icon: CustomIcons.faVideo.icon, style: { fontSize: CustomIcons.faVideo.size, color: colors.white } })),
40
- React.createElement("button", { style: styles.actionButton, title: "Search" },
40
+ React.createElement("button", { style: styles.actionButton, "aria-label": "Search", onClick: onSearch },
41
41
  React.createElement(FontAwesomeIcon, { icon: CustomIcons.faSearch.icon, style: { fontSize: CustomIcons.faSearch.size, color: colors.white } }))))));
42
42
  };
43
43
  var styles = {
@@ -8,6 +8,7 @@ type props = {
8
8
  setShowHideParticipantScreen: (value: boolean) => void;
9
9
  setViewParticipantsList: any;
10
10
  setShowGroupOptionBottomSheet: (value: boolean) => void;
11
+ onSearch?: () => void;
11
12
  userJoinedGroupStatus: string;
12
13
  groupType?: string;
13
14
  participantsCount?: number;
@@ -50,7 +50,7 @@ import InfoModal from '../../models/infoModal';
50
50
  import colors from '../../theme/colors';
51
51
  import fonts from '../../theme/fonts';
52
52
  var GroupChatHeader = function (_a) {
53
- var onClick = _a.onClick, showBackButton = _a.showBackButton, mainHeading = _a.mainHeading, setShowParticipantsList = _a.setShowParticipantsList, headingStyle = _a.headingStyle, setShowHideParticipantScreen = _a.setShowHideParticipantScreen, setViewParticipantsList = _a.setViewParticipantsList, setShowGroupOptionBottomSheet = _a.setShowGroupOptionBottomSheet, userJoinedGroupStatus = _a.userJoinedGroupStatus, _b = _a.groupType, groupType = _b === void 0 ? 'public' : _b, _c = _a.participantsCount, participantsCount = _c === void 0 ? 0 : _c, onHeaderClick = _a.onHeaderClick, handleVideoCall = _a.handleVideoCall, handleAudioCall = _a.handleAudioCall, rejoinGroupCall = _a.rejoinGroupCall, _d = _a.showJoinGroupCallBtn, showJoinGroupCallBtn = _d === void 0 ? false : _d, _e = _a.showVideoCall, showVideoCall = _e === void 0 ? false : _e;
53
+ var onClick = _a.onClick, showBackButton = _a.showBackButton, mainHeading = _a.mainHeading, setShowParticipantsList = _a.setShowParticipantsList, headingStyle = _a.headingStyle, setShowHideParticipantScreen = _a.setShowHideParticipantScreen, setViewParticipantsList = _a.setViewParticipantsList, setShowGroupOptionBottomSheet = _a.setShowGroupOptionBottomSheet, onSearch = _a.onSearch, userJoinedGroupStatus = _a.userJoinedGroupStatus, _b = _a.groupType, groupType = _b === void 0 ? 'public' : _b, _c = _a.participantsCount, participantsCount = _c === void 0 ? 0 : _c, onHeaderClick = _a.onHeaderClick, handleVideoCall = _a.handleVideoCall, handleAudioCall = _a.handleAudioCall, rejoinGroupCall = _a.rejoinGroupCall, _d = _a.showJoinGroupCallBtn, showJoinGroupCallBtn = _d === void 0 ? false : _d, _e = _a.showVideoCall, showVideoCall = _e === void 0 ? false : _e;
54
54
  var _f = React.useState(false), showInfoModal = _f[0], setShowInfoModal = _f[1];
55
55
  var _g = React.useState(""), infoModalMessage = _g[0], setInfoModalMessage = _g[1];
56
56
  var handleOpenPress = function () {
@@ -115,6 +115,8 @@ var GroupChatHeader = function (_a) {
115
115
  React.createElement("i", { className: "fas fa-video", style: styles.actionIcon })),
116
116
  showJoinGroupCallBtn && React.createElement("button", { style: __assign(__assign({}, styles.actionButton), { opacity: showVideoCall ? 0.5 : 1 }), disabled: showVideoCall, onClick: rejoinGroupCall },
117
117
  React.createElement("i", { className: "fas fa-video", style: { color: 'red', fontSize: '20px' } })),
118
+ React.createElement("button", { onClick: function () { return onSearch && onSearch(); }, style: styles.actionButton, "aria-label": "Search" },
119
+ React.createElement("i", { className: "fas fa-search", style: styles.actionIcon })),
118
120
  React.createElement("button", { onClick: handleOpenPress, style: styles.actionButton },
119
121
  React.createElement("i", { className: "fas fa-ellipsis-v", style: styles.actionIcon }))))),
120
122
  React.createElement(InfoModal, { open: showInfoModal, message: infoModalMessage, onClose: function () { return setShowInfoModal(false); } })));
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type SearchHeaderProps = {
3
+ onClose: () => void;
4
+ onSearch?: (q: string) => void;
5
+ context?: 'group' | 'peer';
6
+ };
7
+ declare const SearchHeader: React.FC<SearchHeaderProps>;
8
+ export default SearchHeader;