fcr-ui-scene-mobile 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/lib/assets/ground_glass_bg.png +0 -0
  2. package/lib/base.d.ts +11 -0
  3. package/lib/base.js +39 -0
  4. package/lib/common/device-store.d.ts +86 -0
  5. package/lib/common/device-store.js +642 -0
  6. package/lib/common/device-stream-store.d.ts +26 -0
  7. package/lib/common/device-stream-store.js +298 -0
  8. package/lib/common/event-store.d.ts +124 -0
  9. package/lib/common/event-store.js +249 -0
  10. package/lib/common/global-context.d.ts +11 -0
  11. package/lib/common/global-context.js +9 -0
  12. package/lib/common/member-list-data-source.d.ts +28 -0
  13. package/lib/common/member-list-data-source.js +305 -0
  14. package/lib/common/participant-store.d.ts +195 -0
  15. package/lib/common/participant-store.js +1577 -0
  16. package/lib/common/security-store.d.ts +119 -0
  17. package/lib/common/security-store.js +948 -0
  18. package/lib/common/setting-store.d.ts +181 -0
  19. package/lib/common/setting-store.js +797 -0
  20. package/lib/common/type.d.ts +73 -0
  21. package/lib/common/type.js +22 -0
  22. package/lib/config/default-config.d.ts +32 -0
  23. package/lib/config/default-config.js +39 -0
  24. package/lib/config/setting-config.d.ts +16 -0
  25. package/lib/config/setting-config.js +17 -0
  26. package/lib/creator.d.ts +10 -0
  27. package/lib/creator.js +49 -0
  28. package/lib/global.d.ts +8 -0
  29. package/lib/hooks/meeting-time.d.ts +15 -0
  30. package/lib/hooks/meeting-time.js +92 -0
  31. package/lib/hooks/useIsNodePresent.d.ts +4 -0
  32. package/lib/hooks/useIsNodePresent.js +53 -0
  33. package/lib/hooks/useOnRefMount.d.ts +2 -0
  34. package/lib/hooks/useOnRefMount.js +27 -0
  35. package/lib/index.d.ts +6 -0
  36. package/lib/index.js +50 -0
  37. package/lib/mobile-global.css +28 -0
  38. package/lib/modules/action-bar/bottom-icons.d.ts +17 -0
  39. package/lib/modules/action-bar/bottom-icons.js +160 -0
  40. package/lib/modules/action-bar/context.d.ts +2 -0
  41. package/lib/modules/action-bar/context.js +9 -0
  42. package/lib/modules/action-bar/index.css +33 -0
  43. package/lib/modules/action-bar/index.d.ts +27 -0
  44. package/lib/modules/action-bar/index.js +46 -0
  45. package/lib/modules/action-bar/member-list-popup/attendee/index.css +130 -0
  46. package/lib/modules/action-bar/member-list-popup/attendee/index.d.ts +19 -0
  47. package/lib/modules/action-bar/member-list-popup/attendee/index.js +252 -0
  48. package/lib/modules/action-bar/member-list-popup/attendee/list.d.ts +1 -0
  49. package/lib/modules/action-bar/member-list-popup/attendee/list.js +82 -0
  50. package/lib/modules/action-bar/member-list-popup/index.css +35 -0
  51. package/lib/modules/action-bar/member-list-popup/index.d.ts +7 -0
  52. package/lib/modules/action-bar/member-list-popup/index.js +40 -0
  53. package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.css +0 -0
  54. package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.d.ts +12 -0
  55. package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.js +58 -0
  56. package/lib/modules/action-bar/more-popup/index.css +71 -0
  57. package/lib/modules/action-bar/more-popup/index.d.ts +2 -0
  58. package/lib/modules/action-bar/more-popup/index.js +126 -0
  59. package/lib/modules/action-bar/store.d.ts +196 -0
  60. package/lib/modules/action-bar/store.js +1425 -0
  61. package/lib/modules/action-bar/type.d.ts +6 -0
  62. package/lib/modules/action-bar/type.js +13 -0
  63. package/lib/modules/action-bar/view.d.ts +2 -0
  64. package/lib/modules/action-bar/view.js +75 -0
  65. package/lib/modules/audio-stream/ index.d.ts +19 -0
  66. package/lib/modules/audio-stream/ index.js +109 -0
  67. package/lib/modules/audio-stream/index.d.ts +25 -0
  68. package/lib/modules/audio-stream/index.js +135 -0
  69. package/lib/modules/chat/chat-bar/index.css +97 -0
  70. package/lib/modules/chat/chat-bar/index.d.ts +12 -0
  71. package/lib/modules/chat/chat-bar/index.js +129 -0
  72. package/lib/modules/chat/chat-notification/index.css +71 -0
  73. package/lib/modules/chat/chat-notification/index.d.ts +3 -0
  74. package/lib/modules/chat/chat-notification/index.js +75 -0
  75. package/lib/modules/chat/chat-select/index.css +183 -0
  76. package/lib/modules/chat/chat-select/index.d.ts +12 -0
  77. package/lib/modules/chat/chat-select/index.js +223 -0
  78. package/lib/modules/chat/contex.d.ts +2 -0
  79. package/lib/modules/chat/contex.js +9 -0
  80. package/lib/modules/chat/demo-wrapper.d.ts +1 -0
  81. package/lib/modules/chat/demo-wrapper.js +42 -0
  82. package/lib/modules/chat/index.css +108 -0
  83. package/lib/modules/chat/index.d.ts +28 -0
  84. package/lib/modules/chat/index.dev.d.ts +1 -0
  85. package/lib/modules/chat/index.dev.js +58 -0
  86. package/lib/modules/chat/index.js +208 -0
  87. package/lib/modules/chat/message-list.d.ts +22 -0
  88. package/lib/modules/chat/message-list.js +617 -0
  89. package/lib/modules/chat/mock.d.ts +2 -0
  90. package/lib/modules/chat/mock.js +283 -0
  91. package/lib/modules/chat/store.d.ts +183 -0
  92. package/lib/modules/chat/store.js +1101 -0
  93. package/lib/modules/chat/util.d.ts +6 -0
  94. package/lib/modules/chat/util.js +69 -0
  95. package/lib/modules/chat/view.d.ts +11 -0
  96. package/lib/modules/chat/view.js +414 -0
  97. package/lib/modules/layout/bottom-drawer/index.css +34 -0
  98. package/lib/modules/layout/bottom-drawer/index.d.ts +3 -0
  99. package/lib/modules/layout/bottom-drawer/index.js +129 -0
  100. package/lib/modules/layout/components/Layout.d.ts +1 -0
  101. package/lib/modules/layout/components/Layout.js +98 -0
  102. package/lib/modules/layout/components/equip-request-popup/index.css +30 -0
  103. package/lib/modules/layout/components/equip-request-popup/index.d.ts +3 -0
  104. package/lib/modules/layout/components/equip-request-popup/index.js +78 -0
  105. package/lib/modules/layout/components/index.css +78 -0
  106. package/lib/modules/layout/components/index.d.ts +2 -0
  107. package/lib/modules/layout/components/index.js +25 -0
  108. package/lib/modules/layout/context.d.ts +2 -0
  109. package/lib/modules/layout/context.js +9 -0
  110. package/lib/modules/layout/drawer-header/index.css +27 -0
  111. package/lib/modules/layout/drawer-header/index.d.ts +10 -0
  112. package/lib/modules/layout/drawer-header/index.js +54 -0
  113. package/lib/modules/layout/index.css +22 -0
  114. package/lib/modules/layout/index.d.ts +8 -0
  115. package/lib/modules/layout/index.js +47 -0
  116. package/lib/modules/layout/store.d.ts +59 -0
  117. package/lib/modules/layout/store.js +379 -0
  118. package/lib/modules/layout/type.d.ts +65 -0
  119. package/lib/modules/layout/type.js +52 -0
  120. package/lib/modules/layout/view.d.ts +2 -0
  121. package/lib/modules/layout/view.js +10 -0
  122. package/lib/modules/member-layout/context.d.ts +2 -0
  123. package/lib/modules/member-layout/context.js +9 -0
  124. package/lib/modules/member-layout/data.d.ts +2 -0
  125. package/lib/modules/member-layout/data.js +304 -0
  126. package/lib/modules/member-layout/grid/index.css +98 -0
  127. package/lib/modules/member-layout/grid/index.d.ts +21 -0
  128. package/lib/modules/member-layout/grid/index.js +316 -0
  129. package/lib/modules/member-layout/index.css +88 -0
  130. package/lib/modules/member-layout/index.d.ts +8 -0
  131. package/lib/modules/member-layout/index.js +45 -0
  132. package/lib/modules/member-layout/share-toast/index.css +30 -0
  133. package/lib/modules/member-layout/share-toast/index.d.ts +5 -0
  134. package/lib/modules/member-layout/share-toast/index.js +43 -0
  135. package/lib/modules/member-layout/speaker/index.css +30 -0
  136. package/lib/modules/member-layout/speaker/index.d.ts +9 -0
  137. package/lib/modules/member-layout/speaker/index.js +28 -0
  138. package/lib/modules/member-layout/store.d.ts +70 -0
  139. package/lib/modules/member-layout/store.js +479 -0
  140. package/lib/modules/member-layout/user/index.css +121 -0
  141. package/lib/modules/member-layout/user/index.d.ts +34 -0
  142. package/lib/modules/member-layout/user/index.js +355 -0
  143. package/lib/modules/member-layout/user/types.d.ts +16 -0
  144. package/lib/modules/member-layout/user/types.js +6 -0
  145. package/lib/modules/member-layout/view.d.ts +2 -0
  146. package/lib/modules/member-layout/view.js +225 -0
  147. package/lib/modules/state-bar/context.d.ts +2 -0
  148. package/lib/modules/state-bar/context.js +9 -0
  149. package/lib/modules/state-bar/index.css +79 -0
  150. package/lib/modules/state-bar/index.d.ts +17 -0
  151. package/lib/modules/state-bar/index.js +55 -0
  152. package/lib/modules/state-bar/leaving-room/index.css +14 -0
  153. package/lib/modules/state-bar/leaving-room/index.d.ts +7 -0
  154. package/lib/modules/state-bar/leaving-room/index.js +38 -0
  155. package/lib/modules/state-bar/meeting-detail/index.css +72 -0
  156. package/lib/modules/state-bar/meeting-detail/index.d.ts +2 -0
  157. package/lib/modules/state-bar/meeting-detail/index.js +59 -0
  158. package/lib/modules/state-bar/meeting-detail/meeting-info/copy.d.ts +4 -0
  159. package/lib/modules/state-bar/meeting-detail/meeting-info/copy.js +81 -0
  160. package/lib/modules/state-bar/meeting-detail/meeting-info/index.css +92 -0
  161. package/lib/modules/state-bar/meeting-detail/meeting-info/index.d.ts +2 -0
  162. package/lib/modules/state-bar/meeting-detail/meeting-info/index.js +188 -0
  163. package/lib/modules/state-bar/meeting-detail/net-quality/index.css +27 -0
  164. package/lib/modules/state-bar/meeting-detail/net-quality/index.d.ts +2 -0
  165. package/lib/modules/state-bar/meeting-detail/net-quality/index.js +87 -0
  166. package/lib/modules/state-bar/store.d.ts +76 -0
  167. package/lib/modules/state-bar/store.js +561 -0
  168. package/lib/modules/state-bar/view.d.ts +7 -0
  169. package/lib/modules/state-bar/view.js +215 -0
  170. package/lib/modules/whiteboard/app.d.ts +2 -0
  171. package/lib/modules/whiteboard/app.js +41 -0
  172. package/lib/modules/whiteboard/components/control-bar/index.css +53 -0
  173. package/lib/modules/whiteboard/components/control-bar/index.d.ts +2 -0
  174. package/lib/modules/whiteboard/components/control-bar/index.js +156 -0
  175. package/lib/modules/whiteboard/components/control-bar/store.d.ts +35 -0
  176. package/lib/modules/whiteboard/components/control-bar/store.js +288 -0
  177. package/lib/modules/whiteboard/components/loading/index.css +76 -0
  178. package/lib/modules/whiteboard/components/loading/index.d.ts +2 -0
  179. package/lib/modules/whiteboard/components/loading/index.js +68 -0
  180. package/lib/modules/whiteboard/components/loading/loading.png +0 -0
  181. package/lib/modules/whiteboard/components/multi-window/index.css +65 -0
  182. package/lib/modules/whiteboard/components/multi-window/index.d.ts +5 -0
  183. package/lib/modules/whiteboard/components/multi-window/index.js +39 -0
  184. package/lib/modules/whiteboard/components/pagination/index.css +228 -0
  185. package/lib/modules/whiteboard/components/pagination/index.d.ts +15 -0
  186. package/lib/modules/whiteboard/components/pagination/index.js +163 -0
  187. package/lib/modules/whiteboard/components/pagination/store.d.ts +18 -0
  188. package/lib/modules/whiteboard/components/pagination/store.js +17 -0
  189. package/lib/modules/whiteboard/components/progress/index.d.ts +5 -0
  190. package/lib/modules/whiteboard/components/progress/index.js +43 -0
  191. package/lib/modules/whiteboard/components/progress/style.css +52 -0
  192. package/lib/modules/whiteboard/components/scene-pagination.d.ts +1 -0
  193. package/lib/modules/whiteboard/components/scene-pagination.js +30 -0
  194. package/lib/modules/whiteboard/components/switch-theme/index.css +98 -0
  195. package/lib/modules/whiteboard/components/switch-theme/index.d.ts +3 -0
  196. package/lib/modules/whiteboard/components/switch-theme/index.js +89 -0
  197. package/lib/modules/whiteboard/components/switch-theme/item.d.ts +9 -0
  198. package/lib/modules/whiteboard/components/switch-theme/item.js +53 -0
  199. package/lib/modules/whiteboard/components/switch-theme/libs.d.ts +4 -0
  200. package/lib/modules/whiteboard/components/switch-theme/libs.js +29 -0
  201. package/lib/modules/whiteboard/components/toolbar/ style.css +588 -0
  202. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/color.d.ts +5 -0
  203. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/color.js +38 -0
  204. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/panel.d.ts +1 -0
  205. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/panel.js +107 -0
  206. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/picker.d.ts +1 -0
  207. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/picker.js +59 -0
  208. package/lib/modules/whiteboard/components/toolbar/components/color-picker/index.d.ts +2 -0
  209. package/lib/modules/whiteboard/components/toolbar/components/color-picker/index.js +44 -0
  210. package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.d.ts +4 -0
  211. package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.js +89 -0
  212. package/lib/modules/whiteboard/components/toolbar/components/extra-tool-picker.d.ts +1 -0
  213. package/lib/modules/whiteboard/components/toolbar/components/extra-tool-picker.js +63 -0
  214. package/lib/modules/whiteboard/components/toolbar/components/history.d.ts +2 -0
  215. package/lib/modules/whiteboard/components/toolbar/components/history.js +46 -0
  216. package/lib/modules/whiteboard/components/toolbar/components/icons/fold-icon.d.ts +2 -0
  217. package/lib/modules/whiteboard/components/toolbar/components/icons/fold-icon.js +39 -0
  218. package/lib/modules/whiteboard/components/toolbar/components/icons/move-icon.d.ts +1 -0
  219. package/lib/modules/whiteboard/components/toolbar/components/icons/move-icon.js +66 -0
  220. package/lib/modules/whiteboard/components/toolbar/components/move-handle.d.ts +5 -0
  221. package/lib/modules/whiteboard/components/toolbar/components/move-handle.js +134 -0
  222. package/lib/modules/whiteboard/components/toolbar/components/pen-picker.d.ts +4 -0
  223. package/lib/modules/whiteboard/components/toolbar/components/pen-picker.js +106 -0
  224. package/lib/modules/whiteboard/components/toolbar/components/shape-picker.d.ts +4 -0
  225. package/lib/modules/whiteboard/components/toolbar/components/shape-picker.js +168 -0
  226. package/lib/modules/whiteboard/components/toolbar/hooks/index.d.ts +14 -0
  227. package/lib/modules/whiteboard/components/toolbar/hooks/index.js +211 -0
  228. package/lib/modules/whiteboard/components/toolbar/index.d.ts +2 -0
  229. package/lib/modules/whiteboard/components/toolbar/index.js +183 -0
  230. package/lib/modules/whiteboard/components/toolbar/store.d.ts +51 -0
  231. package/lib/modules/whiteboard/components/toolbar/store.js +248 -0
  232. package/lib/modules/whiteboard/context.d.ts +69 -0
  233. package/lib/modules/whiteboard/context.js +36 -0
  234. package/lib/modules/whiteboard/index.d.ts +119 -0
  235. package/lib/modules/whiteboard/index.js +1134 -0
  236. package/lib/modules/whiteboard/style.css +143 -0
  237. package/lib/modules/whiteboard/type.d.ts +94 -0
  238. package/lib/modules/whiteboard/type.js +89 -0
  239. package/lib/modules/whiteboard/utils.d.ts +12 -0
  240. package/lib/modules/whiteboard/utils.js +36 -0
  241. package/lib/plugins/css-preset-plugin.d.ts +1 -0
  242. package/lib/plugins/css-preset-plugin.js +29 -0
  243. package/lib/plugins/module-dev-plugin.d.ts +12 -0
  244. package/lib/plugins/module-dev-plugin.js +183 -0
  245. package/lib/plugins/multi-lang-plugin.d.ts +1 -0
  246. package/lib/plugins/multi-lang-plugin.js +19 -0
  247. package/lib/plugins/rtm-plugin.d.ts +1 -0
  248. package/lib/plugins/rtm-plugin.js +5 -0
  249. package/lib/plugins/web-rtc-plugin.d.ts +1 -0
  250. package/lib/plugins/web-rtc-plugin.js +5 -0
  251. package/lib/translations/enUS.d.ts +1855 -0
  252. package/lib/translations/enUS.js +1895 -0
  253. package/lib/translations/zhCN.d.ts +1852 -0
  254. package/lib/translations/zhCN.js +1892 -0
  255. package/lib/type.d.ts +121 -0
  256. package/lib/type.js +46 -0
  257. package/lib/ui-manager.d.ts +32 -0
  258. package/lib/ui-manager.js +426 -0
  259. package/lib/ui-scene.d.ts +14 -0
  260. package/lib/ui-scene.js +141 -0
  261. package/lib/utilities/board-context.d.ts +4 -0
  262. package/lib/utilities/board-context.js +12 -0
  263. package/lib/utilities/constant.d.ts +286 -0
  264. package/lib/utilities/constant.js +271 -0
  265. package/lib/utilities/copyText.d.ts +2 -0
  266. package/lib/utilities/copyText.js +43 -0
  267. package/lib/utilities/extract.d.ts +5 -0
  268. package/lib/utilities/extract.js +117 -0
  269. package/lib/utilities/hooks.d.ts +14 -0
  270. package/lib/utilities/hooks.js +101 -0
  271. package/lib/utilities/mute-action.d.ts +4 -0
  272. package/lib/utilities/mute-action.js +48 -0
  273. package/lib/utilities/parameters.d.ts +7 -0
  274. package/lib/utilities/parameters.js +20 -0
  275. package/lib/utilities/regex.d.ts +1 -0
  276. package/lib/utilities/regex.js +14 -0
  277. package/lib/utilities/tools.d.ts +27 -0
  278. package/lib/utilities/tools.js +169 -0
  279. package/lib/utilities/useNamespace.d.ts +15 -0
  280. package/lib/utilities/useNamespace.js +66 -0
  281. package/package.json +63 -0
@@ -0,0 +1,6 @@
1
+ import { AllowChatLevelType } from 'agora-ui-foundation/lib/components/chat-manager';
2
+ import { RoleType } from 'agora-ui-foundation/lib/components/message-bubble';
3
+ import { FcrUserRole } from '../../type';
4
+ export declare const handleMessageTime: (time: number | string) => string;
5
+ export declare const breakWord: (str?: string) => string | undefined;
6
+ export declare const handleChatLevelChangedSystemMsg: (t: any, chatLevel: AllowChatLevelType, publisherRole: RoleType | FcrUserRole | undefined, publisherUsername: string | undefined, isSelf: boolean) => string;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.handleMessageTime = exports.handleChatLevelChangedSystemMsg = exports.breakWord = void 0;
8
+ require("core-js/modules/es.array.concat.js");
9
+ require("core-js/modules/es.array.slice.js");
10
+ require("core-js/modules/es.date.to-string.js");
11
+ var _type = require("../../type");
12
+ var handleMessageTime = exports.handleMessageTime = function handleMessageTime(time) {
13
+ if (typeof time === 'string') {
14
+ return time;
15
+ }
16
+ var now = new Date();
17
+ var nowYear = now.getFullYear();
18
+ var date = new Date(time);
19
+ var year = date.getFullYear();
20
+ var month = date.getMonth() + 1;
21
+ var day = date.getDate();
22
+ var hour = date.getHours();
23
+ var minute = date.getMinutes();
24
+ var amOrPm = hour >= 12 ? 'PM' : 'AM';
25
+ var hh = hour % 12;
26
+ var mm = minute < 10 ? '0' + minute : minute;
27
+ if (year === nowYear) {
28
+ // hh:mm (ap / pm)
29
+ if (year === nowYear && date.getMonth() === now.getMonth() && date.getDate() === now.getDate()) {
30
+ return "".concat(hh, ":").concat(mm, " ").concat(amOrPm);
31
+ }
32
+ // mm-dd hh:mm (ap / pm)
33
+ return "".concat(month, "-").concat(day, " ").concat(hh, ":").concat(mm, " ").concat(amOrPm);
34
+ } else {
35
+ // yyyy-mm-dd hh:mm (ap / pm)
36
+ return "".concat(year, "-").concat(month, "-").concat(day, " ").concat(hh, ":").concat(mm, " ").concat(amOrPm);
37
+ }
38
+ };
39
+ var MAX_NAME_LENGTH = 6;
40
+ var breakWord = exports.breakWord = function breakWord(str) {
41
+ if (!str) return str;
42
+ if (str.length <= MAX_NAME_LENGTH) {
43
+ return str;
44
+ }
45
+ return str.slice(0, MAX_NAME_LENGTH - 1) + '...';
46
+ };
47
+ var handleChatLevelChangedSystemMsg = exports.handleChatLevelChangedSystemMsg = function handleChatLevelChangedSystemMsg(t, chatLevel, publisherRole, publisherUsername, isSelf) {
48
+ var needMsgPrefix = chatLevel === 'everyone' || chatLevel === 'no_one';
49
+ var msgPrefix = '';
50
+ if (needMsgPrefix) {
51
+ msgPrefix = "".concat(publisherRole === 'union-host' || publisherRole === _type.FcrUserRole.COHOST ? t('fmt_role_cohost') : t('fmt_role_host'), " (").concat(isSelf ? t('fmt_participant_label_Me') : breakWord(publisherUsername), ") ");
52
+ }
53
+ var msg = msgPrefix;
54
+ switch (chatLevel) {
55
+ case 'everyone':
56
+ msg += t('fmt_chat_tips_freechat');
57
+ break;
58
+ case 'public':
59
+ msg += t('fmt_chat_tips_onlypublic');
60
+ break;
61
+ case 'private_to_manager':
62
+ msg += t('fmt_additional_tips_chatpermissionchange');
63
+ break;
64
+ case 'no_one':
65
+ msg += t('fmt_chat_tips_muteroom');
66
+ break;
67
+ }
68
+ return msg;
69
+ };
@@ -0,0 +1,11 @@
1
+ export declare const View: ({ updateReadIndex, sendMsg, userId: localUserId, singling, handleClickUploadImage, }: {
2
+ updateReadIndex: (data?: {
3
+ index: number;
4
+ msgId: string;
5
+ }) => void;
6
+ sendMsg: (msg: string) => void;
7
+ userId: string;
8
+ singling?: boolean;
9
+ handleClickUploadImage: () => void;
10
+ }) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const ChatAction: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,414 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.define-property.js");
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.View = exports.ChatAction = void 0;
9
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
+ require("core-js/modules/es.array.concat.js");
11
+ require("core-js/modules/es.array.filter.js");
12
+ require("core-js/modules/es.array.find.js");
13
+ require("core-js/modules/es.array.for-each.js");
14
+ require("core-js/modules/es.array.from.js");
15
+ require("core-js/modules/es.array.iterator.js");
16
+ require("core-js/modules/es.array.map.js");
17
+ require("core-js/modules/es.array.push.js");
18
+ require("core-js/modules/es.array.sort.js");
19
+ require("core-js/modules/es.array.unshift.js");
20
+ require("core-js/modules/es.map.js");
21
+ require("core-js/modules/es.object.to-string.js");
22
+ require("core-js/modules/es.string.iterator.js");
23
+ require("core-js/modules/esnext.async-iterator.filter.js");
24
+ require("core-js/modules/esnext.async-iterator.find.js");
25
+ require("core-js/modules/esnext.async-iterator.for-each.js");
26
+ require("core-js/modules/esnext.async-iterator.map.js");
27
+ require("core-js/modules/esnext.iterator.constructor.js");
28
+ require("core-js/modules/esnext.iterator.filter.js");
29
+ require("core-js/modules/esnext.iterator.find.js");
30
+ require("core-js/modules/esnext.iterator.for-each.js");
31
+ require("core-js/modules/esnext.iterator.map.js");
32
+ require("core-js/modules/esnext.map.delete-all.js");
33
+ require("core-js/modules/esnext.map.emplace.js");
34
+ require("core-js/modules/esnext.map.every.js");
35
+ require("core-js/modules/esnext.map.filter.js");
36
+ require("core-js/modules/esnext.map.find.js");
37
+ require("core-js/modules/esnext.map.find-key.js");
38
+ require("core-js/modules/esnext.map.includes.js");
39
+ require("core-js/modules/esnext.map.key-of.js");
40
+ require("core-js/modules/esnext.map.map-keys.js");
41
+ require("core-js/modules/esnext.map.map-values.js");
42
+ require("core-js/modules/esnext.map.merge.js");
43
+ require("core-js/modules/esnext.map.reduce.js");
44
+ require("core-js/modules/esnext.map.some.js");
45
+ require("core-js/modules/esnext.map.update.js");
46
+ require("core-js/modules/web.dom-collections.for-each.js");
47
+ require("core-js/modules/web.dom-collections.iterator.js");
48
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
49
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
50
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
51
+ var _mobxReact = require("mobx-react");
52
+ var _store = require("./store");
53
+ var _messageList = require("./message-list");
54
+ var _contex = require("./contex");
55
+ var _chatWrapperMobile = require("agora-ui-foundation/lib/components/chat-wrapper-mobile");
56
+ var _i18n = require("agora-ui-foundation/lib/i18n");
57
+ var _react = require("react");
58
+ var _chatBar = require("./chat-bar");
59
+ var _type = require("../../type");
60
+ var _util = require("./util");
61
+ var _copyText = require("../../utilities/copyText");
62
+ var _chatManager = require("agora-ui-foundation/lib/components/chat-manager");
63
+ var _type2 = require("fcr-core/lib/room-control/chatroom-control/type");
64
+ var _fcrCore = require("fcr-core");
65
+ var _tabs = require("agora-ui-foundation/lib/components/tabs");
66
+ var _constant = require("../../utilities/constant");
67
+ var _context3 = require("../layout/context");
68
+ var _chatSelect = require("./chat-select");
69
+ var _store2 = require("../layout/store");
70
+ var _jsxRuntime = require("react/jsx-runtime");
71
+ var View = exports.View = (0, _mobxReact.observer)(function (_ref) {
72
+ var updateReadIndex = _ref.updateReadIndex,
73
+ sendMsg = _ref.sendMsg,
74
+ localUserId = _ref.userId,
75
+ singling = _ref.singling,
76
+ handleClickUploadImage = _ref.handleClickUploadImage;
77
+ var t = (0, _i18n.useI18n)();
78
+ var defaultProps = {
79
+ errorMsg: t('fmt_chat_tips_exceedlimit'),
80
+ forbiddenTxt: t('fmt_chat_button_muteall'),
81
+ styles: {
82
+ display: 'flex'
83
+ }
84
+ };
85
+ var styles = defaultProps.styles,
86
+ forbiddenTxt = defaultProps.forbiddenTxt,
87
+ errorMsg = defaultProps.errorMsg;
88
+ var _useContext = (0, _react.useContext)(_contex.StoreContext),
89
+ chatRoomStores = _useContext.chatRoomStores,
90
+ activeTabIndex = _useContext.activeTabIndex,
91
+ handlerActiveTab = _useContext.handlerActiveTab;
92
+ var _ref2 = chatRoomStores[activeTabIndex],
93
+ setTargetUser = _ref2.setTargetUser,
94
+ privateTargetUser = _ref2.privateTargetUser,
95
+ remoteUsers = _ref2.remoteUsers,
96
+ targetUserIsOnline = _ref2.targetUserIsOnline,
97
+ localIsManager = _ref2.localIsManager,
98
+ chatLevel = _ref2.chatLevel,
99
+ messageList = _ref2.messageList,
100
+ textMsgInfo = _ref2.textMsgInfo,
101
+ updateChatTextMsg = _ref2.updateChatTextMsg,
102
+ privateTargetList = _ref2.privateTargetList,
103
+ resetTargetUser = _ref2.resetTargetUser,
104
+ handleToast = _ref2.handleToast,
105
+ chatRoomState = _ref2.chatRoomState,
106
+ isHost = _ref2.isHost,
107
+ hasChatPermission = _ref2.hasChatPermission,
108
+ hasChatSendPrivatePermission = _ref2.hasChatSendPrivatePermission,
109
+ filterChatMember = _ref2.filterChatMember,
110
+ hasSendMessagePermission = _ref2.hasSendMessagePermission;
111
+ var _useContext2 = (0, _react.useContext)(_context3.LayoutStoreContext),
112
+ currentSlotType = _useContext2.currentSlotType,
113
+ updateCurrentModule = _useContext2.updateCurrentModule;
114
+ var handleTargetChange = function handleTargetChange(user) {
115
+ setTargetUser(user);
116
+ updateCurrentModule(_store2.SlotsType.Chat);
117
+ };
118
+ var _useState = (0, _react.useState)(false),
119
+ _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
120
+ multiSelectActive = _useState2[0],
121
+ setMultiSelectActive = _useState2[1];
122
+ var _useState3 = (0, _react.useState)(new Map()),
123
+ _useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
124
+ copyMap = _useState4[0],
125
+ setCopyMap = _useState4[1];
126
+ var _useState5 = (0, _react.useState)(0),
127
+ _useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
128
+ selectCnt = _useState6[0],
129
+ setSelectCnt = _useState6[1];
130
+ var _useState7 = (0, _react.useState)((0, _toConsumableArray2["default"])(privateTargetList)),
131
+ _useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
132
+ targetList = _useState8[0],
133
+ setTargetList = _useState8[1];
134
+ (0, _react.useEffect)(function () {
135
+ var _users$;
136
+ var users = (0, _toConsumableArray2["default"])(targetList);
137
+ if (((_users$ = users[0]) === null || _users$ === void 0 ? void 0 : _users$.userId) === _store.USER_ALL) {
138
+ if (chatLevel !== 'everyone' && chatLevel !== 'public' && !localIsManager) {
139
+ users.shift();
140
+ }
141
+ } else if (chatLevel === 'everyone' || chatLevel == 'public' || localIsManager) {
142
+ users.unshift({
143
+ userId: _store.USER_ALL,
144
+ userName: t('fmt_chat_option_all'),
145
+ userRole: _type.FcrUserRole.ROBOT,
146
+ connectorType: _fcrCore.FcrRoomConnectorType.NONE
147
+ });
148
+ }
149
+ remoteUsers.forEach(function (user) {
150
+ if (!users.find(function (u) {
151
+ return u.userId === user.userId;
152
+ })) {
153
+ users.push(user);
154
+ }
155
+ });
156
+ users = users.filter(function (user) {
157
+ return remoteUsers.find(function (u) {
158
+ return u.userId === user.userId;
159
+ }) || user.userId === privateTargetUser.userId || user.userId === _store.USER_ALL;
160
+ });
161
+ users = users.map(function (user) {
162
+ var _remoteUsers$find;
163
+ return (_remoteUsers$find = remoteUsers.find(function (u) {
164
+ return u.userId === user.userId;
165
+ })) !== null && _remoteUsers$find !== void 0 ? _remoteUsers$find : user;
166
+ });
167
+ users = filterChatMember((0, _toConsumableArray2["default"])(users));
168
+ setTargetList((0, _toConsumableArray2["default"])(users));
169
+ }, [privateTargetList, chatLevel, remoteUsers]);
170
+ var handleMultiCopyMsg = /*#__PURE__*/function () {
171
+ var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
172
+ var msgHandled, msgIndex;
173
+ return _regenerator["default"].wrap(function _callee$(_context) {
174
+ while (1) switch (_context.prev = _context.next) {
175
+ case 0:
176
+ msgHandled = '';
177
+ msgIndex = Array.from(copyMap.keys()).sort();
178
+ msgIndex.forEach(function (msgIdx, arrIdx) {
179
+ var idxMsg = messageList[msgIdx];
180
+ if (idxMsg) {
181
+ var _messageList$prevIdx, _messageList$prevIdx2, _messageList$prevIdx3;
182
+ var msg = idxMsg.msg,
183
+ time = idxMsg.time,
184
+ publisherUid = idxMsg.uid,
185
+ publisherNickName = idxMsg.nickName,
186
+ targetNickname = idxMsg.target,
187
+ isPrivate = idxMsg.isPrivate,
188
+ publisherRole = idxMsg.role;
189
+ var senderNickname = publisherUid === localUserId && isPrivate ? t('fmt_settings_labels_you') : publisherNickName;
190
+ var prevIdx = msgIndex[arrIdx - 1];
191
+ var needLabel = prevIdx ? ((_messageList$prevIdx = messageList[prevIdx]) === null || _messageList$prevIdx === void 0 ? void 0 : _messageList$prevIdx.uid) !== publisherUid || ((_messageList$prevIdx2 = messageList[prevIdx]) === null || _messageList$prevIdx2 === void 0 ? void 0 : _messageList$prevIdx2.isPrivate) !== isPrivate || ((_messageList$prevIdx3 = messageList[prevIdx]) === null || _messageList$prevIdx3 === void 0 ? void 0 : _messageList$prevIdx3.role) !== publisherRole : false;
192
+ // 2. 复制多条消息, 一个人发的多条消息, 时间前缀只会有一个, 消息累加
193
+ if (needLabel) {
194
+ msgHandled += (0, _i18n.getLanguage)() === 'zh' ? "".concat(senderNickname, "\u5BF9").concat(targetNickname, "\u8BF4(").concat((0, _util.handleMessageTime)(time), ")\n").concat(msg, "\n") : "".concat(senderNickname, " said to ").concat(targetNickname, "(").concat((0, _util.handleMessageTime)(time), ")\n").concat(msg, "\n");
195
+ } else {
196
+ msgHandled += "".concat(msg, "\n");
197
+ }
198
+ }
199
+ });
200
+ _context.next = 5;
201
+ return (0, _copyText.copyText)(msgHandled);
202
+ case 5:
203
+ case "end":
204
+ return _context.stop();
205
+ }
206
+ }, _callee);
207
+ }));
208
+ return function handleMultiCopyMsg() {
209
+ return _ref3.apply(this, arguments);
210
+ };
211
+ }();
212
+ (0, _react.useEffect)(function () {
213
+ setSelectCnt(copyMap.size);
214
+ }, [copyMap.size]);
215
+ var resetMultiSelectStates = function resetMultiSelectStates() {
216
+ setMultiSelectActive(false);
217
+ copyMap.clear();
218
+ setCopyMap(copyMap);
219
+ setSelectCnt(0);
220
+ };
221
+ var chatSelectNoTitle = localIsManager || chatLevel === 'everyone' || chatLevel === 'no_one';
222
+ var copyTips = function copyTips() {
223
+ handleToast({
224
+ id: 'copy-multi-msg',
225
+ toastProps: {
226
+ type: 'normal',
227
+ content: t('fmt_statusbar_status_coppied'),
228
+ size: 'small'
229
+ }
230
+ });
231
+ };
232
+ var messageBarTitle = (0, _react.useMemo)(function () {
233
+ return chatSelectNoTitle ? undefined : /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
234
+ className: "assign-host-title",
235
+ children: chatLevel === 'public' ? t('fmt_chat_option_onlypublic') : t('fmt_chat_option_onlyprivate')
236
+ });
237
+ }, [chatLevel, chatSelectNoTitle]);
238
+ return currentSlotType === _store2.SlotsType.ChatSelect ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
239
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
240
+ className: 'fcr-chat-select-tabs-container',
241
+ children: [' ', /*#__PURE__*/(0, _jsxRuntime.jsx)(_chatSelect.ChatSelect, {
242
+ title: messageBarTitle,
243
+ type: "private-chat",
244
+ candidateUsers: (0, _store.sortUsers)(targetList),
245
+ selectedUid: privateTargetUser.userId,
246
+ onSelect: handleTargetChange
247
+ })]
248
+ })
249
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
250
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
251
+ className: "chat-tabs-container",
252
+ children: chatRoomStores[_constant.RoomType.WAITING_ROOM] && chatRoomStores[_constant.RoomType.WAITING_ROOM].userCount > 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_tabs.FcrTabs, {
253
+ items: [{
254
+ label: t('fmt_waitingroom_sidebar_chat_label_meeting'),
255
+ key: _constant.RoomType.MAIN_ROOM
256
+ }, {
257
+ label: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
258
+ className: "chat-container-icon",
259
+ children: [chatRoomStores[_constant.RoomType.WAITING_ROOM].hasNewMsg ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
260
+ className: "chat-container-red"
261
+ }) : null, t('fmt_waitingroom_sidebar_label_waiting', {
262
+ reason1: chatRoomStores[_constant.RoomType.WAITING_ROOM].userCount
263
+ })]
264
+ }),
265
+ key: _constant.RoomType.WAITING_ROOM
266
+ }],
267
+ activeKey: activeTabIndex,
268
+ onChange: function onChange(key) {
269
+ handlerActiveTab(key);
270
+ }
271
+ }) : null
272
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_chatWrapperMobile.ChatWrapper, {
273
+ styles: styles,
274
+ errorMsg: errorMsg,
275
+ forbiddenTxt: forbiddenTxt,
276
+ singling: singling,
277
+ forbidden: !localIsManager && !hasChatPermission && !hasChatSendPrivatePermission,
278
+ isHost: isHost,
279
+ handMsg: function handMsg(msg) {
280
+ if (chatRoomState !== _type2.FcrChatRoomConnectionState.Connected) {
281
+ handleToast({
282
+ id: 'send-msg-offline',
283
+ toastProps: {
284
+ type: 'error',
285
+ content: t('fmt_chat_tips_Networkconnect'),
286
+ size: 'small'
287
+ }
288
+ });
289
+ return;
290
+ }
291
+ if (!localIsManager) {
292
+ if (privateTargetUser.userId === _store.USER_NONE) {
293
+ handleToast({
294
+ id: 'send-msg-to-none',
295
+ toastProps: {
296
+ type: 'normal',
297
+ content: t('fmt_chat_tips_selectchat'),
298
+ size: 'small'
299
+ }
300
+ });
301
+ return;
302
+ }
303
+
304
+ // if (
305
+ // chatLevel === 'no_one' ||
306
+ // (chatLevel !== 'everyone' &&
307
+ // privateTargetUser.userId !== USER_ALL &&
308
+ // !isManager(privateTargetUser.userRole))
309
+ // ) {
310
+ // handleToast({
311
+ // id: 'send-msg-to-none',
312
+ // toastProps: {
313
+ // type: 'normal',
314
+ // content: t('fmt_chat_tips_permissionchange'),
315
+ // size: 'small',
316
+ // },
317
+ // });
318
+ // resetTargetUser();
319
+ // return;
320
+ // }
321
+
322
+ if (privateTargetUser.userId === _store.USER_ALL && !hasSendMessagePermission()) {
323
+ // handleToast({
324
+ // id: 'send-msg-to-none',
325
+ // toastProps: {
326
+ // type: 'normal',
327
+ // content: t('fmt_chat_tips_permissionchange'),
328
+ // size: 'small',
329
+ // },
330
+ // });
331
+ return;
332
+ } else if (privateTargetUser.userId !== _store.USER_ALL && !hasChatSendPrivatePermission) {
333
+ // handleToast({
334
+ // id: 'send-msg-to-none',
335
+ // toastProps: {
336
+ // type: 'normal',
337
+ // content: t('fmt_chat_tips_permissionchange'),
338
+ // size: 'small',
339
+ // },
340
+ // });
341
+ resetTargetUser();
342
+ return;
343
+ }
344
+ }
345
+ sendMsg(msg);
346
+ },
347
+ handleClickUploadImage: handleClickUploadImage,
348
+ msgBarElement: /*#__PURE__*/(0, _jsxRuntime.jsx)(_chatBar.MessageBar, {
349
+ selectedUserId: privateTargetUser.userId,
350
+ users: targetList,
351
+ onTargetChange: handleTargetChange,
352
+ title: messageBarTitle,
353
+ onClick: function onClick() {
354
+ updateCurrentModule(_store2.SlotsType.ChatSelect);
355
+ }
356
+ }),
357
+ targetUserIsOnline: targetUserIsOnline,
358
+ privateTarget: privateTargetUser.userId,
359
+ selectTargetNickname: privateTargetUser.userName,
360
+ multiSelectActive: multiSelectActive,
361
+ selectCnt: selectCnt,
362
+ onSelectCancel: function onSelectCancel() {
363
+ resetMultiSelectStates();
364
+ },
365
+ onSelectConfirm: /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
366
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
367
+ while (1) switch (_context2.prev = _context2.next) {
368
+ case 0:
369
+ _context2.next = 2;
370
+ return handleMultiCopyMsg();
371
+ case 2:
372
+ resetMultiSelectStates();
373
+ copyTips();
374
+ case 4:
375
+ case "end":
376
+ return _context2.stop();
377
+ }
378
+ }, _callee2);
379
+ })),
380
+ defaultMsg: textMsgInfo.textMsg,
381
+ updateChatTextMsg: updateChatTextMsg,
382
+ autoSizeParams: {
383
+ minHeight: 20,
384
+ maxHeight: 160,
385
+ initHeight: (textMsgInfo === null || textMsgInfo === void 0 ? void 0 : textMsgInfo.height) || 20
386
+ },
387
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_messageList.MessageList, {
388
+ updateReadMsgIndex: updateReadIndex,
389
+ userId: localUserId,
390
+ setMultiSelectActive: setMultiSelectActive,
391
+ multiSelectActive: multiSelectActive,
392
+ copyMap: copyMap,
393
+ setCopyMap: setCopyMap,
394
+ selectCnt: selectCnt,
395
+ copyTips: copyTips
396
+ })
397
+ })]
398
+ });
399
+ });
400
+ var ChatAction = exports.ChatAction = (0, _mobxReact.observer)(function () {
401
+ var _useContext3 = (0, _react.useContext)(_contex.StoreContext),
402
+ chatRoomStores = _useContext3.chatRoomStores;
403
+ var _ref5 = chatRoomStores[_constant.RoomType.MAIN_ROOM],
404
+ isHostOrCoHost = _ref5.isHostOrCoHost,
405
+ setAllowChat = _ref5.setAllowChat,
406
+ setAllowChatWithPayload = _ref5.setAllowChatWithPayload,
407
+ chatLevel = _ref5.chatLevel;
408
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_chatManager.ChatManager, {
409
+ isManager: isHostOrCoHost,
410
+ setAllowChat: setAllowChat,
411
+ setAllowChatWithPayload: setAllowChatWithPayload,
412
+ allowChatLevel: chatLevel
413
+ });
414
+ });
@@ -0,0 +1,34 @@
1
+ .fcr-bottom-drawer {
2
+ border-top: 1px solid var(--fcr_ui_scene_line1, rgba(74, 76, 95, 0.5));
3
+ border-top-right-radius: var(--fcr_cornerradius_xxl);
4
+ border-top-left-radius: var(--fcr_cornerradius_xxl);
5
+ background: var(--fcr_mobile_ui_scene_color_popup_fill2);
6
+
7
+ display: flex;
8
+ flex-direction: column;
9
+ align-items: center;
10
+ position: absolute;
11
+ bottom: 0;
12
+ height: 572px;
13
+ width: 100%;
14
+
15
+ box-shadow: 0px -10px 25px 0px var(--fcr_ui_scene_black1);
16
+ }
17
+
18
+ .fcr-bottom-drawer .leave-container {
19
+ width: 100%;
20
+ height: 100%;
21
+ padding: 0 15px;
22
+ max-height: unset;
23
+ position: unset;
24
+ }
25
+
26
+ .fcr-bottom-drawer .leave-container .fcr-no-data {
27
+ position: absolute;
28
+ height: 100%;
29
+ width: 100%;
30
+ }
31
+
32
+ .fcr-bottom-drawer .leave-container .fcr-no-data svg {
33
+ width: 50%;
34
+ }
@@ -0,0 +1,3 @@
1
+ import './index.css';
2
+ declare const BottomDrawerWrapper: () => import("react/jsx-runtime").JSX.Element;
3
+ export default BottomDrawerWrapper;
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.array.iterator.js");
4
+ require("core-js/modules/es.object.define-property.js");
5
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
6
+ require("core-js/modules/es.object.to-string.js");
7
+ require("core-js/modules/es.string.iterator.js");
8
+ require("core-js/modules/es.weak-map.js");
9
+ require("core-js/modules/esnext.weak-map.delete-all.js");
10
+ require("core-js/modules/esnext.weak-map.emplace.js");
11
+ require("core-js/modules/web.dom-collections.iterator.js");
12
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
13
+ var _typeof = require("@babel/runtime/helpers/typeof");
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ exports["default"] = void 0;
18
+ require("core-js/modules/es.array.index-of.js");
19
+ var _objectDestructuringEmpty2 = _interopRequireDefault(require("@babel/runtime/helpers/objectDestructuringEmpty"));
20
+ var _react = _interopRequireWildcard(require("react"));
21
+ var _drawerHeader = require("../drawer-header");
22
+ var _classnames = _interopRequireDefault(require("classnames"));
23
+ require("./index.css");
24
+ var _mobxReact = require("mobx-react");
25
+ var _context = require("../context");
26
+ var _store = require("../store");
27
+ var _i18n = require("agora-ui-foundation/lib/i18n");
28
+ var _popup = require("agora-ui-foundation/lib/components/popup");
29
+ var _jsxRuntime = require("react/jsx-runtime");
30
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
31
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
32
+ var BottomDrawer = (0, _mobxReact.observer)(function (_ref) {
33
+ (0, _objectDestructuringEmpty2["default"])(_ref);
34
+ var _useContext = (0, _react.useContext)(_context.LayoutStoreContext),
35
+ currentModule = _useContext.currentModule,
36
+ currentSlotType = _useContext.currentSlotType,
37
+ closeCurrentModule = _useContext.closeCurrentModule,
38
+ updateCurrentModule = _useContext.updateCurrentModule;
39
+ var cls = (0, _classnames["default"])('fcr-bottom-drawer', {});
40
+ var t = (0, _i18n.useI18n)();
41
+ var title = (0, _react.useMemo)(function () {
42
+ switch (currentSlotType) {
43
+ case _store.SlotsType.Chat:
44
+ return t('fmt_chat_label_chat');
45
+ case _store.SlotsType.ChatSelect:
46
+ return t('fmt_chat_labels_sendto');
47
+ default:
48
+ return '';
49
+ }
50
+ }, [currentSlotType]);
51
+ var keyBoardHeightCache = (0, _react.useRef)(0);
52
+ var bottomDrawerHeight = (0, _react.useRef)(0);
53
+ var bottomDrawerEl = (0, _react.useRef)(null);
54
+ (0, _react.useEffect)(function () {
55
+ if (bottomDrawerEl.current) {
56
+ bottomDrawerHeight.current = bottomDrawerEl.current.offsetHeight;
57
+ }
58
+ }, []);
59
+ (0, _react.useEffect)(function () {
60
+ var drawerEl = document.getElementById('bottom-drawer');
61
+ drawerEl && (drawerEl.style.bottom = '0px');
62
+ }, [currentSlotType, currentModule]);
63
+
64
+ // 键盘唤起时,底部抽屉上移导致 input 不在视窗内
65
+ (0, _react.useEffect)(function () {
66
+ var _keyBoardHeightCache$;
67
+ var u = navigator.userAgent;
68
+ if (!(u.indexOf('Android') > -1) || currentSlotType !== _store.SlotsType.ChatSelect) {
69
+ return;
70
+ }
71
+ var el = document.getElementById('bottom-drawer');
72
+ var initialWindowHeight = window.innerHeight;
73
+ var keyboardHeight = (_keyBoardHeightCache$ = keyBoardHeightCache.current) !== null && _keyBoardHeightCache$ !== void 0 ? _keyBoardHeightCache$ : 0;
74
+ var screenHeight = document.body.offsetHeight;
75
+ var nowHeight = null;
76
+ var handleResize = function handleResize() {
77
+ var currentWindowHeight = window.innerHeight;
78
+ nowHeight = document.body.offsetHeight;
79
+ if (nowHeight && nowHeight < screenHeight) {
80
+ keyboardHeight = initialWindowHeight - currentWindowHeight;
81
+ if (!keyBoardHeightCache.current) {
82
+ keyBoardHeightCache.current = keyboardHeight;
83
+ }
84
+ //键盘唤起
85
+ el && (el.style.bottom = -keyboardHeight + 'px');
86
+ } else {
87
+ //键盘收起
88
+ el && (el.style.bottom = 0 + 'px');
89
+ }
90
+ };
91
+ window.onresize = handleResize;
92
+ return function () {
93
+ window.onresize = null;
94
+ };
95
+ }, [currentSlotType]);
96
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_popup.FcrPopup, {
97
+ elId: 'popup-bottom-drawer',
98
+ showCloseButton: false,
99
+ visible: currentSlotType !== _store.SlotsType.None,
100
+ onMaskClick: function onMaskClick() {
101
+ closeCurrentModule();
102
+ },
103
+ onClose: function onClose() {
104
+ closeCurrentModule();
105
+ },
106
+ bodyStyle: {
107
+ height: '572px'
108
+ },
109
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
110
+ className: cls,
111
+ id: 'bottom-drawer',
112
+ ref: bottomDrawerEl,
113
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_drawerHeader.DrawerHeader, {
114
+ title: title,
115
+ type: currentSlotType === _store.SlotsType.ChatSelect ? 'center' : 'space-between',
116
+ onClose: closeCurrentModule,
117
+ onReturn: currentSlotType === _store.SlotsType.ChatSelect ? function () {
118
+ updateCurrentModule(_store.SlotsType.Chat);
119
+ } : undefined
120
+ }), currentModule]
121
+ })
122
+ });
123
+ });
124
+ var BottomDrawerWrapper = function BottomDrawerWrapper() {
125
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
126
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(BottomDrawer, {})
127
+ });
128
+ };
129
+ var _default = exports["default"] = BottomDrawerWrapper;
@@ -0,0 +1 @@
1
+ export declare const Layout: () => import("react/jsx-runtime").JSX.Element;