@100mslive/roomkit-react 0.3.23-alpha.0 → 0.3.24-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. package/dist/Accordion/Accordion.d.ts +134 -322
  2. package/dist/Accordion/index.d.ts +134 -322
  3. package/dist/Avatar/Avatar.d.ts +47 -141
  4. package/dist/Button/Button.d.ts +47 -141
  5. package/dist/Checkbox/Checkbox.d.ts +134 -322
  6. package/dist/Collapsible/Collapsible.d.ts +201 -483
  7. package/dist/ConferenceScreen-CLPW3BGP.css +2780 -0
  8. package/dist/{HLSView-DDIGCKAW.css.map → ConferenceScreen-CLPW3BGP.css.map} +1 -1
  9. package/dist/ConferenceScreen-M6RBPTAJ.js +1774 -0
  10. package/dist/ConferenceScreen-M6RBPTAJ.js.map +7 -0
  11. package/dist/Divider/Divider.d.ts +134 -322
  12. package/dist/Dropdown/Dropdown.d.ts +804 -1932
  13. package/dist/EmbedView-DDSO7ZCV.js +17 -0
  14. package/dist/EmbedView-DDSO7ZCV.js.map +7 -0
  15. package/dist/EmbedView-HGIUZHKA.css +2780 -0
  16. package/dist/EmbedView-HGIUZHKA.css.map +7 -0
  17. package/dist/EmojiReaction-23JDKJD4.js +11 -0
  18. package/dist/EmojiReaction-23JDKJD4.js.map +7 -0
  19. package/dist/Fieldset/Fieldset.d.ts +47 -141
  20. package/dist/Footer/Footer.d.ts +536 -1288
  21. package/dist/{HLSView-DDIGCKAW.css → HLSView-OW77EAAO.css} +3 -3
  22. package/dist/HLSView-OW77EAAO.css.map +7 -0
  23. package/dist/{HLSView-QZO4JEB7.js → HLSView-Q6GEB3UM.js} +38 -24
  24. package/dist/HLSView-Q6GEB3UM.js.map +7 -0
  25. package/dist/IconButton/IconButton.d.ts +47 -141
  26. package/dist/Input/Input.d.ts +362 -926
  27. package/dist/Label/Label.d.ts +47 -141
  28. package/dist/Layout/Box.d.ts +47 -141
  29. package/dist/Layout/Flex.d.ts +47 -141
  30. package/dist/LeaveScreen-BYTE73MT.js +556 -0
  31. package/dist/LeaveScreen-BYTE73MT.js.map +7 -0
  32. package/dist/LeaveScreen-P7AATEIF.css +2780 -0
  33. package/dist/LeaveScreen-P7AATEIF.css.map +7 -0
  34. package/dist/Link/Link.d.ts +47 -141
  35. package/dist/Modal/Dialog.d.ts +329 -987
  36. package/dist/Modal/DialogContent.d.ts +469 -1127
  37. package/dist/MoreSettings-LV5X2U6K.css +2780 -0
  38. package/dist/MoreSettings-LV5X2U6K.css.map +7 -0
  39. package/dist/MoreSettings-WSHMMNOC.js +16 -0
  40. package/dist/MoreSettings-WSHMMNOC.js.map +7 -0
  41. package/dist/PDFView-RIPRIIH6.css +2780 -0
  42. package/dist/PDFView-RIPRIIH6.css.map +7 -0
  43. package/dist/PDFView-ZFSG2ESE.js +84 -0
  44. package/dist/PDFView-ZFSG2ESE.js.map +7 -0
  45. package/dist/Pagination/StyledPagination.d.ts +268 -644
  46. package/dist/Polls-QWW5LTTB.js +1584 -0
  47. package/dist/Polls-QWW5LTTB.js.map +7 -0
  48. package/dist/Polls-ULYGUPPF.css +2780 -0
  49. package/dist/Polls-ULYGUPPF.css.map +7 -0
  50. package/dist/Popover/index.d.ts +201 -483
  51. package/dist/Prebuilt/IconButton.d.ts +134 -322
  52. package/dist/Prebuilt/components/Chat/ChatBody.d.ts +134 -322
  53. package/dist/Prebuilt/components/Leave/LeaveAtoms.d.ts +335 -805
  54. package/dist/Prebuilt/components/Notifications/DeviceChangeNotifications.d.ts +1 -0
  55. package/dist/Prebuilt/components/Notifications/ErrorNotifications.d.ts +1 -0
  56. package/dist/Prebuilt/components/Notifications/MessageNotifications.d.ts +1 -0
  57. package/dist/Prebuilt/components/Notifications/PollNotificationModal.d.ts +1 -0
  58. package/dist/Prebuilt/components/Notifications/RoleChangeNotification.d.ts +1 -0
  59. package/dist/Prebuilt/components/Settings/common.d.ts +134 -322
  60. package/dist/Progress/index.d.ts +134 -322
  61. package/dist/RadioGroup/RadioGroup.d.ts +201 -483
  62. package/dist/RaiseHand-K7NFLH7H.js +10 -0
  63. package/dist/RaiseHand-K7NFLH7H.js.map +7 -0
  64. package/dist/ReactSelect/ReactSelect.d.ts +670 -1610
  65. package/dist/RoleProminence-235AFT7F.js +116 -0
  66. package/dist/RoleProminence-235AFT7F.js.map +7 -0
  67. package/dist/RoleProminence-6XN3POS5.css +2780 -0
  68. package/dist/RoleProminence-6XN3POS5.css.map +7 -0
  69. package/dist/RoomDetailsPane-O5TFMTPI.css +2780 -0
  70. package/dist/RoomDetailsPane-O5TFMTPI.css.map +7 -0
  71. package/dist/RoomDetailsPane-RF3D3TDR.js +53 -0
  72. package/dist/RoomDetailsPane-RF3D3TDR.js.map +7 -0
  73. package/dist/ScreenshareLayout-KNEB3AJJ.css +2780 -0
  74. package/dist/ScreenshareLayout-KNEB3AJJ.css.map +7 -0
  75. package/dist/ScreenshareLayout-PSQMS3NC.js +358 -0
  76. package/dist/ScreenshareLayout-PSQMS3NC.js.map +7 -0
  77. package/dist/Select/Select.d.ts +201 -483
  78. package/dist/Sheet/Sheet.d.ts +329 -987
  79. package/dist/SidePaneTabs-I6DECE5R.css +2780 -0
  80. package/dist/SidePaneTabs-I6DECE5R.css.map +7 -0
  81. package/dist/SidePaneTabs-NXHBI2JB.js +1354 -0
  82. package/dist/SidePaneTabs-NXHBI2JB.js.map +7 -0
  83. package/dist/Slider/Slider.d.ts +47 -141
  84. package/dist/Stats/StyledStats.d.ts +402 -966
  85. package/dist/Switch/Switch.d.ts +47 -141
  86. package/dist/Tabs/Tabs.d.ts +268 -644
  87. package/dist/Text/Text.d.ts +47 -141
  88. package/dist/TextArea/TextArea.d.ts +47 -141
  89. package/dist/Theme/base.config.d.ts +26 -78
  90. package/dist/Theme/stitches.config.d.ts +1046 -1493
  91. package/dist/TileMenu/StyledMenuTile.d.ts +469 -1127
  92. package/dist/Toast/Toast.d.ts +382 -946
  93. package/dist/VBPicker-2CQ3IIO7.js +322 -0
  94. package/dist/VBPicker-2CQ3IIO7.js.map +7 -0
  95. package/dist/VBPicker-DCNYGO23.css +2780 -0
  96. package/dist/VBPicker-DCNYGO23.css.map +7 -0
  97. package/dist/Video/Video.d.ts +47 -141
  98. package/dist/VideoList/StyledVideoList.d.ts +201 -483
  99. package/dist/VideoTile/StyledVideoTile.d.ts +670 -1610
  100. package/dist/WaitingView-NZIUOXBI.js +10 -0
  101. package/dist/WaitingView-NZIUOXBI.js.map +7 -0
  102. package/dist/WhiteboardLayout-4YLFM3EY.js +96 -0
  103. package/dist/WhiteboardLayout-4YLFM3EY.js.map +7 -0
  104. package/dist/WhiteboardLayout-JUOBDFKY.css +2780 -0
  105. package/dist/WhiteboardLayout-JUOBDFKY.css.map +7 -0
  106. package/dist/android-perm-1.png +0 -0
  107. package/dist/audio-level.png +0 -0
  108. package/dist/chunk-3C7IESSI.js +254 -0
  109. package/dist/chunk-3C7IESSI.js.map +7 -0
  110. package/dist/chunk-7FD3VT6Q.js +114 -0
  111. package/dist/chunk-7FD3VT6Q.js.map +7 -0
  112. package/dist/chunk-AHI4HCY3.js +62 -0
  113. package/dist/chunk-AHI4HCY3.js.map +7 -0
  114. package/dist/chunk-BGSYLCVD.js +6337 -0
  115. package/dist/chunk-BGSYLCVD.js.map +7 -0
  116. package/dist/chunk-DANANDDE.js +418 -0
  117. package/dist/chunk-DANANDDE.js.map +7 -0
  118. package/dist/chunk-ETRNLEWQ.js +2658 -0
  119. package/dist/chunk-ETRNLEWQ.js.map +7 -0
  120. package/dist/chunk-EWPHJFZJ.js +487 -0
  121. package/dist/chunk-EWPHJFZJ.js.map +7 -0
  122. package/dist/chunk-F63YJBI4.js +98 -0
  123. package/dist/chunk-F63YJBI4.js.map +7 -0
  124. package/dist/chunk-GLAJUP3O.js +576 -0
  125. package/dist/chunk-GLAJUP3O.js.map +7 -0
  126. package/dist/chunk-GOXRTCTY.js +90 -0
  127. package/dist/chunk-GOXRTCTY.js.map +7 -0
  128. package/dist/chunk-HMCBZI3A.js +59 -0
  129. package/dist/chunk-HMCBZI3A.js.map +7 -0
  130. package/dist/chunk-HVYTC3PX.js +171 -0
  131. package/dist/chunk-HVYTC3PX.js.map +7 -0
  132. package/dist/chunk-LJVP6AWF.js +262 -0
  133. package/dist/chunk-LJVP6AWF.js.map +7 -0
  134. package/dist/chunk-LXJGCRKM.js +30 -0
  135. package/dist/chunk-LXJGCRKM.js.map +7 -0
  136. package/dist/chunk-MG3UGW66.js +16800 -0
  137. package/dist/chunk-MG3UGW66.js.map +7 -0
  138. package/dist/chunk-MUKUP7JU.js +161 -0
  139. package/dist/chunk-MUKUP7JU.js.map +7 -0
  140. package/dist/chunk-OV6MVDCL.js +41 -0
  141. package/dist/chunk-OV6MVDCL.js.map +7 -0
  142. package/dist/chunk-P6NV2XO4.js +178 -0
  143. package/dist/chunk-P6NV2XO4.js.map +7 -0
  144. package/dist/chunk-REL3HBSD.js +71 -0
  145. package/dist/chunk-REL3HBSD.js.map +7 -0
  146. package/dist/chunk-U4SQBXPZ.js +830 -0
  147. package/dist/chunk-U4SQBXPZ.js.map +7 -0
  148. package/dist/chunk-YEL5ZTFU.js +136 -0
  149. package/dist/chunk-YEL5ZTFU.js.map +7 -0
  150. package/dist/empty-chat.svg +12 -0
  151. package/dist/index.cjs.css +2 -2
  152. package/dist/index.cjs.css.map +1 -1
  153. package/dist/index.cjs.js +21713 -21508
  154. package/dist/index.cjs.js.map +4 -4
  155. package/dist/index.css +2 -2
  156. package/dist/index.css.map +1 -1
  157. package/dist/index.js +25 -15
  158. package/dist/ios-perm-0.png +0 -0
  159. package/dist/meta.cjs.json +5515 -5153
  160. package/dist/meta.esbuild.json +8998 -6138
  161. package/dist/pdf-share.png +0 -0
  162. package/dist/screen-share.png +0 -0
  163. package/dist/transaction_error.svg +12 -0
  164. package/package.json +8 -8
  165. package/src/Avatar/Avatar.tsx +1 -1
  166. package/src/Popover/Popover.stories.tsx +1 -1
  167. package/src/Prebuilt/App.tsx +6 -2
  168. package/src/Prebuilt/components/Chat/Chat.tsx +12 -8
  169. package/src/Prebuilt/components/Chat/ChatFooter.tsx +1 -1
  170. package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +14 -1
  171. package/src/Prebuilt/components/Notifications/DeviceChangeNotifications.tsx +18 -0
  172. package/src/Prebuilt/components/Notifications/ErrorNotifications.tsx +56 -0
  173. package/src/Prebuilt/components/Notifications/MessageNotifications.tsx +24 -0
  174. package/src/Prebuilt/components/Notifications/Notifications.tsx +13 -171
  175. package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +9 -2
  176. package/src/Prebuilt/components/Notifications/PollNotificationModal.tsx +71 -0
  177. package/src/Prebuilt/components/Notifications/ReconnectNotifications.tsx +1 -5
  178. package/src/Prebuilt/components/Notifications/RoleChangeNotification.tsx +24 -0
  179. package/src/Prebuilt/components/Notifications/TrackBulkUnmuteModal.tsx +7 -5
  180. package/src/Prebuilt/components/Notifications/TrackNotifications.tsx +23 -1
  181. package/src/Prebuilt/components/Notifications/TrackUnmuteModal.tsx +13 -5
  182. package/src/Prebuilt/components/StatsForNerds.jsx +122 -9
  183. package/src/Prebuilt/components/VideoLayouts/GridLayout.tsx +43 -31
  184. package/src/Prebuilt/components/VideoLayouts/ProminenceLayout.tsx +2 -2
  185. package/src/Prebuilt/components/VirtualBackground/VBOption.tsx +3 -1
  186. package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +6 -0
  187. package/src/Prebuilt/layouts/HLSView.jsx +1 -0
  188. package/src/Prebuilt/layouts/PDFView.jsx +1 -0
  189. package/src/Prebuilt/layouts/SidePane.tsx +12 -6
  190. package/src/Prebuilt/layouts/VideoStreamingSection.tsx +35 -34
  191. package/src/Prebuilt/layouts/WaitingView.tsx +2 -2
  192. package/dist/HLSView-QZO4JEB7.js.map +0 -7
  193. package/dist/chunk-J2QT7G3M.js +0 -34759
  194. package/dist/chunk-J2QT7G3M.js.map +0 -7
@@ -0,0 +1,114 @@
1
+ import {
2
+ Dropdown,
3
+ useDropdownList,
4
+ useLandscapeHLSStream,
5
+ useMobileHLSStream
6
+ } from "./chunk-DANANDDE.js";
7
+ import {
8
+ Box,
9
+ Flex
10
+ } from "./chunk-GOXRTCTY.js";
11
+ import {
12
+ IconButton_default,
13
+ Tooltip,
14
+ useRoomLayoutConferencingScreen
15
+ } from "./chunk-BGSYLCVD.js";
16
+ import {
17
+ EMOJI_REACTION_TYPE,
18
+ __async,
19
+ config,
20
+ init_define_process_env,
21
+ styled
22
+ } from "./chunk-GLAJUP3O.js";
23
+
24
+ // src/Prebuilt/components/EmojiReaction.jsx
25
+ init_define_process_env();
26
+ import React2, { useState } from "react";
27
+ import { useMedia } from "react-use";
28
+ import data from "@emoji-mart/data/sets/14/apple.json";
29
+ import { init } from "emoji-mart";
30
+ import {
31
+ selectAvailableRoleNames,
32
+ selectIsConnectedToRoom,
33
+ selectLocalPeerID,
34
+ useCustomEvent,
35
+ useHMSStore
36
+ } from "@100mslive/react-sdk";
37
+ import { EmojiIcon } from "@100mslive/react-icons";
38
+
39
+ // src/Prebuilt/components/Footer/EmojiCard.jsx
40
+ init_define_process_env();
41
+ import React from "react";
42
+ var emojiReactionList = [
43
+ [{ emojiId: "+1" }, { emojiId: "-1" }, { emojiId: "wave" }, { emojiId: "clap" }, { emojiId: "fire" }],
44
+ [{ emojiId: "tada" }, { emojiId: "heart_eyes" }, { emojiId: "joy" }, { emojiId: "open_mouth" }, { emojiId: "sob" }]
45
+ ];
46
+ var EmojiCard = ({ sendReaction }) => {
47
+ return emojiReactionList.map((emojiLine, index) => /* @__PURE__ */ React.createElement(Flex, { key: index, justify: "between", css: { mb: "$8" } }, emojiLine.map((emoji) => /* @__PURE__ */ React.createElement(EmojiContainer, { key: emoji.emojiId, onClick: () => sendReaction(emoji.emojiId) }, /* @__PURE__ */ React.createElement("em-emoji", { id: emoji.emojiId, size: "100%", set: "apple" })))));
48
+ };
49
+ var EmojiContainer = styled("span", {
50
+ position: "relative",
51
+ cursor: "pointer",
52
+ width: "$16",
53
+ height: "$16",
54
+ p: "$4",
55
+ "&:hover": {
56
+ p: "7px",
57
+ bg: "$surface_brighter",
58
+ borderRadius: "$1"
59
+ }
60
+ });
61
+
62
+ // src/Prebuilt/components/EmojiReaction.jsx
63
+ init({ data });
64
+ var EmojiReaction = ({ showCard = false }) => {
65
+ const [open, setOpen] = useState(false);
66
+ const isConnected = useHMSStore(selectIsConnectedToRoom);
67
+ const { elements } = useRoomLayoutConferencingScreen();
68
+ useDropdownList({ open, name: "EmojiReaction" });
69
+ const roles = useHMSStore(selectAvailableRoleNames);
70
+ const localPeerId = useHMSStore(selectLocalPeerID);
71
+ const isMobile = useMedia(config.media.md);
72
+ const isLandscape = useMedia(config.media.ls);
73
+ const isMobileHLSStream = useMobileHLSStream();
74
+ const isLandscapeStream = useLandscapeHLSStream();
75
+ const { sendEvent } = useCustomEvent({
76
+ type: EMOJI_REACTION_TYPE
77
+ });
78
+ const sendReaction = (emojiId) => __async(void 0, null, function* () {
79
+ var _a;
80
+ const data2 = {
81
+ type: EMOJI_REACTION_TYPE,
82
+ emojiId,
83
+ senderId: localPeerId
84
+ };
85
+ sendEvent(data2, { roleNames: roles });
86
+ (_a = window.showFlyingEmoji) == null ? void 0 : _a.call(window, { emojiId, senderId: localPeerId });
87
+ });
88
+ if (!isConnected || !elements.emoji_reactions) {
89
+ return null;
90
+ }
91
+ if (showCard) {
92
+ return /* @__PURE__ */ React2.createElement(EmojiCard, { sendReaction });
93
+ }
94
+ return /* @__PURE__ */ React2.createElement(Dropdown.Root, { open, onOpenChange: setOpen }, /* @__PURE__ */ React2.createElement(Dropdown.Trigger, { asChild: true, "data-testid": "emoji_reaction_btn" }, /* @__PURE__ */ React2.createElement(
95
+ IconButton_default,
96
+ {
97
+ css: isMobile || isLandscape ? { bg: "$surface_default", r: "$round", border: "1px solid $border_bright" } : {}
98
+ },
99
+ /* @__PURE__ */ React2.createElement(Tooltip, { title: "Emoji reaction" }, /* @__PURE__ */ React2.createElement(Box, null, /* @__PURE__ */ React2.createElement(EmojiIcon, null)))
100
+ )), /* @__PURE__ */ React2.createElement(
101
+ Dropdown.Content,
102
+ {
103
+ sideOffset: 5,
104
+ align: isMobileHLSStream || isLandscapeStream ? "end" : "center",
105
+ css: { p: "$8", bg: "$surface_default" }
106
+ },
107
+ /* @__PURE__ */ React2.createElement(EmojiCard, { sendReaction })
108
+ ));
109
+ };
110
+
111
+ export {
112
+ EmojiReaction
113
+ };
114
+ //# sourceMappingURL=chunk-7FD3VT6Q.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/Prebuilt/components/EmojiReaction.jsx", "../src/Prebuilt/components/Footer/EmojiCard.jsx"],
4
+ "sourcesContent": ["import React, { useState } from 'react';\nimport { useMedia } from 'react-use';\nimport data from '@emoji-mart/data/sets/14/apple.json';\nimport { init } from 'emoji-mart';\nimport {\n selectAvailableRoleNames,\n selectIsConnectedToRoom,\n selectLocalPeerID,\n useCustomEvent,\n useHMSStore,\n} from '@100mslive/react-sdk';\nimport { EmojiIcon } from '@100mslive/react-icons';\nimport { EmojiCard } from './Footer/EmojiCard';\n// import { ToastManager } from './Toast/ToastManager';\nimport { Dropdown } from '../../Dropdown';\nimport { Box } from '../../Layout';\nimport { config as cssConfig } from '../../Theme';\nimport { Tooltip } from '../../Tooltip';\nimport IconButton from '../IconButton';\nimport { useRoomLayoutConferencingScreen } from '../provider/roomLayoutProvider/hooks/useRoomLayoutScreen';\nimport { useDropdownList } from './hooks/useDropdownList';\nimport { useLandscapeHLSStream, useMobileHLSStream } from '../common/hooks';\nimport { EMOJI_REACTION_TYPE } from '../common/constants';\n\ninit({ data });\n\nexport const EmojiReaction = ({ showCard = false }) => {\n const [open, setOpen] = useState(false);\n const isConnected = useHMSStore(selectIsConnectedToRoom);\n const { elements } = useRoomLayoutConferencingScreen();\n useDropdownList({ open: open, name: 'EmojiReaction' });\n // const hmsActions = useHMSActions();\n const roles = useHMSStore(selectAvailableRoleNames);\n const localPeerId = useHMSStore(selectLocalPeerID);\n // const { isStreamingOn } = useRecordingStreaming();\n const isMobile = useMedia(cssConfig.media.md);\n const isLandscape = useMedia(cssConfig.media.ls);\n const isMobileHLSStream = useMobileHLSStream();\n const isLandscapeStream = useLandscapeHLSStream();\n\n const { sendEvent } = useCustomEvent({\n type: EMOJI_REACTION_TYPE,\n });\n\n const sendReaction = async emojiId => {\n const data = {\n type: EMOJI_REACTION_TYPE,\n emojiId: emojiId,\n senderId: localPeerId,\n };\n // TODO: RT find a way to figure out hls-viewer roles\n sendEvent(data, { roleNames: roles });\n window.showFlyingEmoji?.({ emojiId, senderId: localPeerId });\n /* if (isStreamingOn) {\n try {\n await hmsActions.sendHLSTimedMetadata([\n {\n payload: JSON.stringify(data),\n duration: 2,\n },\n ]);\n } catch (error) {\n console.log(error);\n ToastManager.addToast({ title: error.message });\n }\n } */\n };\n\n if (!isConnected || !elements.emoji_reactions) {\n return null;\n }\n\n if (showCard) {\n return <EmojiCard sendReaction={sendReaction} />;\n }\n return (\n <Dropdown.Root open={open} onOpenChange={setOpen}>\n <Dropdown.Trigger asChild data-testid=\"emoji_reaction_btn\">\n <IconButton\n css={\n isMobile || isLandscape ? { bg: '$surface_default', r: '$round', border: '1px solid $border_bright' } : {}\n }\n >\n <Tooltip title=\"Emoji reaction\">\n <Box>\n <EmojiIcon />\n </Box>\n </Tooltip>\n </IconButton>\n </Dropdown.Trigger>\n <Dropdown.Content\n sideOffset={5}\n align={isMobileHLSStream || isLandscapeStream ? 'end' : 'center'}\n css={{ p: '$8', bg: '$surface_default' }}\n >\n <EmojiCard sendReaction={sendReaction} />\n </Dropdown.Content>\n </Dropdown.Root>\n );\n};\n", "import React from 'react';\nimport { Flex } from '../../../Layout';\nimport { styled } from '../../../Theme';\n\n// When changing emojis in the grid, keep in mind that the payload used in sendHLSTimedMetadata has a limit of 100 characters. Using bigger emoji Ids can cause the limit to be exceeded.\nconst emojiReactionList = [\n [{ emojiId: '+1' }, { emojiId: '-1' }, { emojiId: 'wave' }, { emojiId: 'clap' }, { emojiId: 'fire' }],\n [{ emojiId: 'tada' }, { emojiId: 'heart_eyes' }, { emojiId: 'joy' }, { emojiId: 'open_mouth' }, { emojiId: 'sob' }],\n];\n\nexport const EmojiCard = ({ sendReaction }) => {\n return emojiReactionList.map((emojiLine, index) => (\n <Flex key={index} justify=\"between\" css={{ mb: '$8' }}>\n {emojiLine.map(emoji => (\n <EmojiContainer key={emoji.emojiId} onClick={() => sendReaction(emoji.emojiId)}>\n <em-emoji id={emoji.emojiId} size=\"100%\" set=\"apple\"></em-emoji>\n </EmojiContainer>\n ))}\n </Flex>\n ));\n};\n\nconst EmojiContainer = styled('span', {\n position: 'relative',\n cursor: 'pointer',\n width: '$16',\n height: '$16',\n p: '$4',\n '&:hover': {\n p: '7px',\n bg: '$surface_brighter',\n borderRadius: '$1',\n },\n});\n"],
5
+ "mappings": "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",
6
+ "names": ["React", "data", "React"]
7
+ }
@@ -0,0 +1,62 @@
1
+ import {
2
+ __async,
3
+ init_define_process_env
4
+ } from "./chunk-GLAJUP3O.js";
5
+
6
+ // src/Prebuilt/components/hooks/useMetadata.tsx
7
+ init_define_process_env();
8
+ import { useCallback } from "react";
9
+ import {
10
+ selectHasPeerHandRaised,
11
+ selectLocalPeerID,
12
+ selectPeerMetadata,
13
+ useHMSActions,
14
+ useHMSStore,
15
+ useHMSVanillaStore
16
+ } from "@100mslive/react-sdk";
17
+ var useMyMetadata = () => {
18
+ const hmsActions = useHMSActions();
19
+ const localPeerId = useHMSStore(selectLocalPeerID);
20
+ const vanillaStore = useHMSVanillaStore();
21
+ const metaData = useHMSStore(selectPeerMetadata(localPeerId));
22
+ const isHandRaised = useHMSStore(selectHasPeerHandRaised(localPeerId));
23
+ const update = (updatedFields) => __async(void 0, null, function* () {
24
+ try {
25
+ const currentMetadata = vanillaStore.getState(selectPeerMetadata(localPeerId));
26
+ yield hmsActions.changeMetadata(Object.assign(currentMetadata, updatedFields));
27
+ return true;
28
+ } catch (error) {
29
+ console.error("failed to update metadata ", updatedFields);
30
+ }
31
+ return false;
32
+ });
33
+ const toggleHandRaise = useCallback(() => __async(void 0, null, function* () {
34
+ if (isHandRaised) {
35
+ yield hmsActions.lowerLocalPeerHand();
36
+ yield update({ handRaisedAt: void 0 });
37
+ } else {
38
+ yield hmsActions.raiseLocalPeerHand();
39
+ yield update({ isBRBOn: false, handRaisedAt: Date.now() });
40
+ }
41
+ }), [isHandRaised]);
42
+ const toggleBRB = useCallback(() => __async(void 0, null, function* () {
43
+ const newValue = !(metaData == null ? void 0 : metaData.isBRBOn);
44
+ yield update({ isBRBOn: newValue });
45
+ if (newValue) {
46
+ yield hmsActions.lowerLocalPeerHand();
47
+ }
48
+ }), [metaData == null ? void 0 : metaData.isBRBOn]);
49
+ return {
50
+ isHandRaised,
51
+ isBRBOn: !!(metaData == null ? void 0 : metaData.isBRBOn),
52
+ metaData,
53
+ updateMetaData: update,
54
+ toggleHandRaise,
55
+ toggleBRB
56
+ };
57
+ };
58
+
59
+ export {
60
+ useMyMetadata
61
+ };
62
+ //# sourceMappingURL=chunk-AHI4HCY3.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/Prebuilt/components/hooks/useMetadata.tsx"],
4
+ "sourcesContent": ["import { useCallback } from 'react';\nimport {\n selectHasPeerHandRaised,\n selectLocalPeerID,\n selectPeerMetadata,\n useHMSActions,\n useHMSStore,\n useHMSVanillaStore,\n} from '@100mslive/react-sdk';\n\nexport const useMyMetadata = () => {\n const hmsActions = useHMSActions();\n const localPeerId = useHMSStore(selectLocalPeerID);\n const vanillaStore = useHMSVanillaStore();\n const metaData = useHMSStore(selectPeerMetadata(localPeerId));\n const isHandRaised = useHMSStore(selectHasPeerHandRaised(localPeerId));\n\n const update = async (updatedFields: Record<string, any>) => {\n try {\n // get current state from store and merge updated fields\n const currentMetadata = vanillaStore.getState(selectPeerMetadata(localPeerId));\n await hmsActions.changeMetadata(Object.assign(currentMetadata, updatedFields));\n return true;\n } catch (error) {\n console.error('failed to update metadata ', updatedFields);\n }\n return false;\n };\n\n const toggleHandRaise = useCallback(async () => {\n if (isHandRaised) {\n await hmsActions.lowerLocalPeerHand();\n await update({ handRaisedAt: undefined });\n } else {\n await hmsActions.raiseLocalPeerHand();\n await update({ isBRBOn: false, handRaisedAt: Date.now() });\n }\n }, [isHandRaised]); //eslint-disable-line\n\n const toggleBRB = useCallback(async () => {\n const newValue = !metaData?.isBRBOn;\n await update({ isBRBOn: newValue });\n if (newValue) {\n await hmsActions.lowerLocalPeerHand();\n }\n }, [metaData?.isBRBOn]); //eslint-disable-line\n\n return {\n isHandRaised,\n isBRBOn: !!metaData?.isBRBOn,\n metaData,\n updateMetaData: update,\n toggleHandRaise,\n toggleBRB,\n };\n};\n"],
5
+ "mappings": ";;;;;;AAAA;AAAA,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEA,IAAM,gBAAgB,MAAM;AACjC,QAAM,aAAa,cAAc;AACjC,QAAM,cAAc,YAAY,iBAAiB;AACjD,QAAM,eAAe,mBAAmB;AACxC,QAAM,WAAW,YAAY,mBAAmB,WAAW,CAAC;AAC5D,QAAM,eAAe,YAAY,wBAAwB,WAAW,CAAC;AAErE,QAAM,SAAS,CAAO,kBAAuC;AAC3D,QAAI;AAEF,YAAM,kBAAkB,aAAa,SAAS,mBAAmB,WAAW,CAAC;AAC7E,YAAM,WAAW,eAAe,OAAO,OAAO,iBAAiB,aAAa,CAAC;AAC7E,aAAO;AAAA,IACT,SAAS,OAAO;AACd,cAAQ,MAAM,8BAA8B,aAAa;AAAA,IAC3D;AACA,WAAO;AAAA,EACT;AAEA,QAAM,kBAAkB,YAAY,MAAY;AAC9C,QAAI,cAAc;AAChB,YAAM,WAAW,mBAAmB;AACpC,YAAM,OAAO,EAAE,cAAc,OAAU,CAAC;AAAA,IAC1C,OAAO;AACL,YAAM,WAAW,mBAAmB;AACpC,YAAM,OAAO,EAAE,SAAS,OAAO,cAAc,KAAK,IAAI,EAAE,CAAC;AAAA,IAC3D;AAAA,EACF,IAAG,CAAC,YAAY,CAAC;AAEjB,QAAM,YAAY,YAAY,MAAY;AACxC,UAAM,WAAW,EAAC,qCAAU;AAC5B,UAAM,OAAO,EAAE,SAAS,SAAS,CAAC;AAClC,QAAI,UAAU;AACZ,YAAM,WAAW,mBAAmB;AAAA,IACtC;AAAA,EACF,IAAG,CAAC,qCAAU,OAAO,CAAC;AAEtB,SAAO;AAAA,IACL;AAAA,IACA,SAAS,CAAC,EAAC,qCAAU;AAAA,IACrB;AAAA,IACA,gBAAgB;AAAA,IAChB;AAAA,IACA;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }