@100mslive/react-native-room-kit 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (362) hide show
  1. package/lib/commonjs/HMSRoomSetup.js +49 -0
  2. package/lib/commonjs/HMSRoomSetup.js.map +1 -1
  3. package/lib/commonjs/Icons/Add/assets/add-circle.png +0 -0
  4. package/lib/commonjs/Icons/Add/assets/add-circle@2x.png +0 -0
  5. package/lib/commonjs/Icons/Add/assets/add-circle@3x.png +0 -0
  6. package/lib/commonjs/Icons/Add/index.js +35 -0
  7. package/lib/commonjs/Icons/Add/index.js.map +1 -0
  8. package/lib/commonjs/Icons/CheckBox/assets/checkbox-checked.png +0 -0
  9. package/lib/commonjs/Icons/CheckBox/assets/checkbox-checked@2x.png +0 -0
  10. package/lib/commonjs/Icons/CheckBox/assets/checkbox-checked@3x.png +0 -0
  11. package/lib/commonjs/Icons/CheckBox/assets/checkbox.png +0 -0
  12. package/lib/commonjs/Icons/CheckBox/assets/checkbox@2x.png +0 -0
  13. package/lib/commonjs/Icons/CheckBox/assets/checkbox@3x.png +0 -0
  14. package/lib/commonjs/Icons/CheckBox/index.js +34 -0
  15. package/lib/commonjs/Icons/CheckBox/index.js.map +1 -0
  16. package/lib/commonjs/Icons/Poll/assets/poll.png +0 -0
  17. package/lib/commonjs/Icons/Poll/assets/poll@2x.png +0 -0
  18. package/lib/commonjs/Icons/Poll/assets/poll@3x.png +0 -0
  19. package/lib/commonjs/Icons/Poll/index.js +33 -0
  20. package/lib/commonjs/Icons/Poll/index.js.map +1 -0
  21. package/lib/commonjs/Icons/PollVote/assets/poll-vote.png +0 -0
  22. package/lib/commonjs/Icons/PollVote/assets/poll-vote@2x.png +0 -0
  23. package/lib/commonjs/Icons/PollVote/assets/poll-vote@3x.png +0 -0
  24. package/lib/commonjs/Icons/PollVote/index.js +33 -0
  25. package/lib/commonjs/Icons/PollVote/index.js.map +1 -0
  26. package/lib/commonjs/Icons/Quiz/assets/quiz.png +0 -0
  27. package/lib/commonjs/Icons/Quiz/assets/quiz@2x.png +0 -0
  28. package/lib/commonjs/Icons/Quiz/assets/quiz@3x.png +0 -0
  29. package/lib/commonjs/Icons/Quiz/index.js +33 -0
  30. package/lib/commonjs/Icons/Quiz/index.js.map +1 -0
  31. package/lib/commonjs/Icons/TrashBin/assets/trash-bin.png +0 -0
  32. package/lib/commonjs/Icons/TrashBin/assets/trash-bin@2x.png +0 -0
  33. package/lib/commonjs/Icons/TrashBin/assets/trash-bin@3x.png +0 -0
  34. package/lib/commonjs/Icons/TrashBin/index.js +34 -0
  35. package/lib/commonjs/Icons/TrashBin/index.js.map +1 -0
  36. package/lib/commonjs/Icons/index.js +66 -0
  37. package/lib/commonjs/Icons/index.js.map +1 -1
  38. package/lib/commonjs/components/CheckboxInputRow.js +53 -0
  39. package/lib/commonjs/components/CheckboxInputRow.js.map +1 -0
  40. package/lib/commonjs/components/CreatePoll.js +163 -0
  41. package/lib/commonjs/components/CreatePoll.js.map +1 -0
  42. package/lib/commonjs/components/Footer.js +6 -1
  43. package/lib/commonjs/components/Footer.js.map +1 -1
  44. package/lib/commonjs/components/HLSPlayerEmoticons.js +2 -3
  45. package/lib/commonjs/components/HLSPlayerEmoticons.js.map +1 -1
  46. package/lib/commonjs/components/HMSBaseButton.js +4 -2
  47. package/lib/commonjs/components/HMSBaseButton.js.map +1 -1
  48. package/lib/commonjs/components/HMSNotification.js +5 -1
  49. package/lib/commonjs/components/HMSNotification.js.map +1 -1
  50. package/lib/commonjs/components/HMSNotifications.js +4 -0
  51. package/lib/commonjs/components/HMSNotifications.js.map +1 -1
  52. package/lib/commonjs/components/HMSPollsQuizzesNotification.js +95 -0
  53. package/lib/commonjs/components/HMSPollsQuizzesNotification.js.map +1 -0
  54. package/lib/commonjs/components/HMSRoomOptions.js +2 -1
  55. package/lib/commonjs/components/HMSRoomOptions.js.map +1 -1
  56. package/lib/commonjs/components/HMSSecondaryButton.js +56 -0
  57. package/lib/commonjs/components/HMSSecondaryButton.js.map +1 -0
  58. package/lib/commonjs/components/PollAndQuizQuestionResponseCard.js +185 -0
  59. package/lib/commonjs/components/PollAndQuizQuestionResponseCard.js.map +1 -0
  60. package/lib/commonjs/components/PollAndQuizVoting.js +136 -0
  61. package/lib/commonjs/components/PollAndQuizVoting.js.map +1 -0
  62. package/lib/commonjs/components/PollAndQuizzStateLabel.js +72 -0
  63. package/lib/commonjs/components/PollAndQuizzStateLabel.js.map +1 -0
  64. package/lib/commonjs/components/PollQDeleteConfirmationSheetView.js +68 -0
  65. package/lib/commonjs/components/PollQDeleteConfirmationSheetView.js.map +1 -0
  66. package/lib/commonjs/components/PollQuestion.js +368 -0
  67. package/lib/commonjs/components/PollQuestion.js.map +1 -0
  68. package/lib/commonjs/components/PollQuestionDeleteConfirmation.js +97 -0
  69. package/lib/commonjs/components/PollQuestionDeleteConfirmation.js.map +1 -0
  70. package/lib/commonjs/components/PollQuestions.js +189 -0
  71. package/lib/commonjs/components/PollQuestions.js.map +1 -0
  72. package/lib/commonjs/components/PollResponseProgressView.js +68 -0
  73. package/lib/commonjs/components/PollResponseProgressView.js.map +1 -0
  74. package/lib/commonjs/components/PollsAndQuizBottomSheet.js +59 -0
  75. package/lib/commonjs/components/PollsAndQuizBottomSheet.js.map +1 -0
  76. package/lib/commonjs/components/PollsAndQuizzesCard.js +97 -0
  77. package/lib/commonjs/components/PollsAndQuizzesCard.js.map +1 -0
  78. package/lib/commonjs/components/PollsAndQuizzesModalContent.js +159 -0
  79. package/lib/commonjs/components/PollsAndQuizzesModalContent.js.map +1 -0
  80. package/lib/commonjs/components/PollsConfigAndList.js +32 -0
  81. package/lib/commonjs/components/PollsConfigAndList.js.map +1 -0
  82. package/lib/commonjs/components/PreviousPollsAndQuizzesList.js +76 -0
  83. package/lib/commonjs/components/PreviousPollsAndQuizzesList.js.map +1 -0
  84. package/lib/commonjs/components/RadioInput.js +42 -0
  85. package/lib/commonjs/components/RadioInput.js.map +1 -0
  86. package/lib/commonjs/components/RadioInputRow.js +57 -0
  87. package/lib/commonjs/components/RadioInputRow.js.map +1 -0
  88. package/lib/commonjs/components/RoomSettingsModalContent.js +31 -6
  89. package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
  90. package/lib/commonjs/components/SwitchRow.js +2 -1
  91. package/lib/commonjs/components/SwitchRow.js.map +1 -1
  92. package/lib/commonjs/hooks-util.js +26 -1
  93. package/lib/commonjs/hooks-util.js.map +1 -1
  94. package/lib/commonjs/redux/actionTypes.js +38 -1
  95. package/lib/commonjs/redux/actionTypes.js.map +1 -1
  96. package/lib/commonjs/redux/actions/index.js +140 -1
  97. package/lib/commonjs/redux/actions/index.js.map +1 -1
  98. package/lib/commonjs/redux/reducers/index.js +3 -1
  99. package/lib/commonjs/redux/reducers/index.js.map +1 -1
  100. package/lib/commonjs/redux/reducers/polls.js +251 -0
  101. package/lib/commonjs/redux/reducers/polls.js.map +1 -0
  102. package/lib/commonjs/types.js +1 -0
  103. package/lib/commonjs/types.js.map +1 -1
  104. package/lib/commonjs/utils/functions.js +6 -1
  105. package/lib/commonjs/utils/functions.js.map +1 -1
  106. package/lib/commonjs/utils/types.js +1 -0
  107. package/lib/commonjs/utils/types.js.map +1 -1
  108. package/lib/module/HMSRoomSetup.js +52 -3
  109. package/lib/module/HMSRoomSetup.js.map +1 -1
  110. package/lib/module/Icons/Add/assets/add-circle.png +0 -0
  111. package/lib/module/Icons/Add/assets/add-circle@2x.png +0 -0
  112. package/lib/module/Icons/Add/assets/add-circle@3x.png +0 -0
  113. package/lib/module/Icons/Add/index.js +27 -0
  114. package/lib/module/Icons/Add/index.js.map +1 -0
  115. package/lib/module/Icons/CheckBox/assets/checkbox-checked.png +0 -0
  116. package/lib/module/Icons/CheckBox/assets/checkbox-checked@2x.png +0 -0
  117. package/lib/module/Icons/CheckBox/assets/checkbox-checked@3x.png +0 -0
  118. package/lib/module/Icons/CheckBox/assets/checkbox.png +0 -0
  119. package/lib/module/Icons/CheckBox/assets/checkbox@2x.png +0 -0
  120. package/lib/module/Icons/CheckBox/assets/checkbox@3x.png +0 -0
  121. package/lib/module/Icons/CheckBox/index.js +26 -0
  122. package/lib/module/Icons/CheckBox/index.js.map +1 -0
  123. package/lib/module/Icons/Poll/assets/poll.png +0 -0
  124. package/lib/module/Icons/Poll/assets/poll@2x.png +0 -0
  125. package/lib/module/Icons/Poll/assets/poll@3x.png +0 -0
  126. package/lib/module/Icons/Poll/index.js +25 -0
  127. package/lib/module/Icons/Poll/index.js.map +1 -0
  128. package/lib/module/Icons/PollVote/assets/poll-vote.png +0 -0
  129. package/lib/module/Icons/PollVote/assets/poll-vote@2x.png +0 -0
  130. package/lib/module/Icons/PollVote/assets/poll-vote@3x.png +0 -0
  131. package/lib/module/Icons/PollVote/index.js +25 -0
  132. package/lib/module/Icons/PollVote/index.js.map +1 -0
  133. package/lib/module/Icons/Quiz/assets/quiz.png +0 -0
  134. package/lib/module/Icons/Quiz/assets/quiz@2x.png +0 -0
  135. package/lib/module/Icons/Quiz/assets/quiz@3x.png +0 -0
  136. package/lib/module/Icons/Quiz/index.js +25 -0
  137. package/lib/module/Icons/Quiz/index.js.map +1 -0
  138. package/lib/module/Icons/TrashBin/assets/trash-bin.png +0 -0
  139. package/lib/module/Icons/TrashBin/assets/trash-bin@2x.png +0 -0
  140. package/lib/module/Icons/TrashBin/assets/trash-bin@3x.png +0 -0
  141. package/lib/module/Icons/TrashBin/index.js +26 -0
  142. package/lib/module/Icons/TrashBin/index.js.map +1 -0
  143. package/lib/module/Icons/index.js +6 -0
  144. package/lib/module/Icons/index.js.map +1 -1
  145. package/lib/module/components/CheckboxInputRow.js +45 -0
  146. package/lib/module/components/CheckboxInputRow.js.map +1 -0
  147. package/lib/module/components/CreatePoll.js +155 -0
  148. package/lib/module/components/CreatePoll.js.map +1 -0
  149. package/lib/module/components/Footer.js +6 -1
  150. package/lib/module/components/Footer.js.map +1 -1
  151. package/lib/module/components/HLSPlayerEmoticons.js +2 -3
  152. package/lib/module/components/HLSPlayerEmoticons.js.map +1 -1
  153. package/lib/module/components/HMSBaseButton.js +5 -3
  154. package/lib/module/components/HMSBaseButton.js.map +1 -1
  155. package/lib/module/components/HMSNotification.js +5 -1
  156. package/lib/module/components/HMSNotification.js.map +1 -1
  157. package/lib/module/components/HMSNotifications.js +4 -0
  158. package/lib/module/components/HMSNotifications.js.map +1 -1
  159. package/lib/module/components/HMSPollsQuizzesNotification.js +86 -0
  160. package/lib/module/components/HMSPollsQuizzesNotification.js.map +1 -0
  161. package/lib/module/components/HMSRoomOptions.js +2 -1
  162. package/lib/module/components/HMSRoomOptions.js.map +1 -1
  163. package/lib/module/components/HMSSecondaryButton.js +47 -0
  164. package/lib/module/components/HMSSecondaryButton.js.map +1 -0
  165. package/lib/module/components/PollAndQuizQuestionResponseCard.js +176 -0
  166. package/lib/module/components/PollAndQuizQuestionResponseCard.js.map +1 -0
  167. package/lib/module/components/PollAndQuizVoting.js +127 -0
  168. package/lib/module/components/PollAndQuizVoting.js.map +1 -0
  169. package/lib/module/components/PollAndQuizzStateLabel.js +63 -0
  170. package/lib/module/components/PollAndQuizzStateLabel.js.map +1 -0
  171. package/lib/module/components/PollQDeleteConfirmationSheetView.js +60 -0
  172. package/lib/module/components/PollQDeleteConfirmationSheetView.js.map +1 -0
  173. package/lib/module/components/PollQuestion.js +359 -0
  174. package/lib/module/components/PollQuestion.js.map +1 -0
  175. package/lib/module/components/PollQuestionDeleteConfirmation.js +88 -0
  176. package/lib/module/components/PollQuestionDeleteConfirmation.js.map +1 -0
  177. package/lib/module/components/PollQuestions.js +180 -0
  178. package/lib/module/components/PollQuestions.js.map +1 -0
  179. package/lib/module/components/PollResponseProgressView.js +59 -0
  180. package/lib/module/components/PollResponseProgressView.js.map +1 -0
  181. package/lib/module/components/PollsAndQuizBottomSheet.js +50 -0
  182. package/lib/module/components/PollsAndQuizBottomSheet.js.map +1 -0
  183. package/lib/module/components/PollsAndQuizzesCard.js +88 -0
  184. package/lib/module/components/PollsAndQuizzesCard.js.map +1 -0
  185. package/lib/module/components/PollsAndQuizzesModalContent.js +150 -0
  186. package/lib/module/components/PollsAndQuizzesModalContent.js.map +1 -0
  187. package/lib/module/components/PollsConfigAndList.js +23 -0
  188. package/lib/module/components/PollsConfigAndList.js.map +1 -0
  189. package/lib/module/components/PreviousPollsAndQuizzesList.js +67 -0
  190. package/lib/module/components/PreviousPollsAndQuizzesList.js.map +1 -0
  191. package/lib/module/components/RadioInput.js +34 -0
  192. package/lib/module/components/RadioInput.js.map +1 -0
  193. package/lib/module/components/RadioInputRow.js +49 -0
  194. package/lib/module/components/RadioInputRow.js.map +1 -0
  195. package/lib/module/components/RoomSettingsModalContent.js +32 -7
  196. package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
  197. package/lib/module/components/SwitchRow.js +2 -1
  198. package/lib/module/components/SwitchRow.js.map +1 -1
  199. package/lib/module/hooks-util.js +26 -2
  200. package/lib/module/hooks-util.js.map +1 -1
  201. package/lib/module/redux/actionTypes.js +39 -0
  202. package/lib/module/redux/actionTypes.js.map +1 -1
  203. package/lib/module/redux/actions/index.js +116 -1
  204. package/lib/module/redux/actions/index.js.map +1 -1
  205. package/lib/module/redux/reducers/index.js +3 -1
  206. package/lib/module/redux/reducers/index.js.map +1 -1
  207. package/lib/module/redux/reducers/polls.js +245 -0
  208. package/lib/module/redux/reducers/polls.js.map +1 -0
  209. package/lib/module/types.js +1 -0
  210. package/lib/module/types.js.map +1 -1
  211. package/lib/module/utils/functions.js +5 -1
  212. package/lib/module/utils/functions.js.map +1 -1
  213. package/lib/module/utils/types.js +1 -0
  214. package/lib/module/utils/types.js.map +1 -1
  215. package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
  216. package/lib/typescript/Icons/Add/index.d.ts +8 -0
  217. package/lib/typescript/Icons/Add/index.d.ts.map +1 -0
  218. package/lib/typescript/Icons/CheckBox/index.d.ts +8 -0
  219. package/lib/typescript/Icons/CheckBox/index.d.ts.map +1 -0
  220. package/lib/typescript/Icons/Poll/index.d.ts +7 -0
  221. package/lib/typescript/Icons/Poll/index.d.ts.map +1 -0
  222. package/lib/typescript/Icons/PollVote/index.d.ts +7 -0
  223. package/lib/typescript/Icons/PollVote/index.d.ts.map +1 -0
  224. package/lib/typescript/Icons/Quiz/index.d.ts +7 -0
  225. package/lib/typescript/Icons/Quiz/index.d.ts.map +1 -0
  226. package/lib/typescript/Icons/TrashBin/index.d.ts +7 -0
  227. package/lib/typescript/Icons/TrashBin/index.d.ts.map +1 -0
  228. package/lib/typescript/Icons/index.d.ts +6 -0
  229. package/lib/typescript/Icons/index.d.ts.map +1 -1
  230. package/lib/typescript/components/CheckboxInputRow.d.ts +13 -0
  231. package/lib/typescript/components/CheckboxInputRow.d.ts.map +1 -0
  232. package/lib/typescript/components/CreatePoll.d.ts +5 -0
  233. package/lib/typescript/components/CreatePoll.d.ts.map +1 -0
  234. package/lib/typescript/components/Footer.d.ts.map +1 -1
  235. package/lib/typescript/components/HLSPlayerEmoticons.d.ts.map +1 -1
  236. package/lib/typescript/components/HMSBaseButton.d.ts +2 -1
  237. package/lib/typescript/components/HMSBaseButton.d.ts.map +1 -1
  238. package/lib/typescript/components/HMSNotifications.d.ts.map +1 -1
  239. package/lib/typescript/components/HMSPollsQuizzesNotification.d.ts +7 -0
  240. package/lib/typescript/components/HMSPollsQuizzesNotification.d.ts.map +1 -0
  241. package/lib/typescript/components/HMSPrimaryButton.d.ts +1 -1
  242. package/lib/typescript/components/HMSPrimaryButton.d.ts.map +1 -1
  243. package/lib/typescript/components/HMSRoomOptions.d.ts.map +1 -1
  244. package/lib/typescript/components/HMSSecondaryButton.d.ts +15 -0
  245. package/lib/typescript/components/HMSSecondaryButton.d.ts.map +1 -0
  246. package/lib/typescript/components/PollAndQuizQuestionResponseCard.d.ts +13 -0
  247. package/lib/typescript/components/PollAndQuizQuestionResponseCard.d.ts.map +1 -0
  248. package/lib/typescript/components/PollAndQuizVoting.d.ts +6 -0
  249. package/lib/typescript/components/PollAndQuizVoting.d.ts.map +1 -0
  250. package/lib/typescript/components/PollAndQuizzStateLabel.d.ts +7 -0
  251. package/lib/typescript/components/PollAndQuizzStateLabel.d.ts.map +1 -0
  252. package/lib/typescript/components/PollQDeleteConfirmationSheetView.d.ts +6 -0
  253. package/lib/typescript/components/PollQDeleteConfirmationSheetView.d.ts.map +1 -0
  254. package/lib/typescript/components/PollQuestion.d.ts +14 -0
  255. package/lib/typescript/components/PollQuestion.d.ts.map +1 -0
  256. package/lib/typescript/components/PollQuestionDeleteConfirmation.d.ts +6 -0
  257. package/lib/typescript/components/PollQuestionDeleteConfirmation.d.ts.map +1 -0
  258. package/lib/typescript/components/PollQuestions.d.ts +6 -0
  259. package/lib/typescript/components/PollQuestions.d.ts.map +1 -0
  260. package/lib/typescript/components/PollResponseProgressView.d.ts +9 -0
  261. package/lib/typescript/components/PollResponseProgressView.d.ts.map +1 -0
  262. package/lib/typescript/components/PollsAndQuizBottomSheet.d.ts +3 -0
  263. package/lib/typescript/components/PollsAndQuizBottomSheet.d.ts.map +1 -0
  264. package/lib/typescript/components/PollsAndQuizzesCard.d.ts +7 -0
  265. package/lib/typescript/components/PollsAndQuizzesCard.d.ts.map +1 -0
  266. package/lib/typescript/components/PollsAndQuizzesModalContent.d.ts +7 -0
  267. package/lib/typescript/components/PollsAndQuizzesModalContent.d.ts.map +1 -0
  268. package/lib/typescript/components/PollsConfigAndList.d.ts +5 -0
  269. package/lib/typescript/components/PollsConfigAndList.d.ts.map +1 -0
  270. package/lib/typescript/components/PreviousPollsAndQuizzesList.d.ts +5 -0
  271. package/lib/typescript/components/PreviousPollsAndQuizzesList.d.ts.map +1 -0
  272. package/lib/typescript/components/RadioInput.d.ts +9 -0
  273. package/lib/typescript/components/RadioInput.d.ts.map +1 -0
  274. package/lib/typescript/components/RadioInputRow.d.ts +16 -0
  275. package/lib/typescript/components/RadioInputRow.d.ts.map +1 -0
  276. package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
  277. package/lib/typescript/components/SwitchRow.d.ts +2 -1
  278. package/lib/typescript/components/SwitchRow.d.ts.map +1 -1
  279. package/lib/typescript/hooks-util.d.ts +1 -0
  280. package/lib/typescript/hooks-util.d.ts.map +1 -1
  281. package/lib/typescript/redux/actionTypes.d.ts +161 -0
  282. package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
  283. package/lib/typescript/redux/actions/index.d.ts +36 -2
  284. package/lib/typescript/redux/actions/index.d.ts.map +1 -1
  285. package/lib/typescript/redux/index.d.ts +13 -0
  286. package/lib/typescript/redux/index.d.ts.map +1 -1
  287. package/lib/typescript/redux/reducers/index.d.ts +13 -0
  288. package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
  289. package/lib/typescript/redux/reducers/polls.d.ts +19 -0
  290. package/lib/typescript/redux/reducers/polls.d.ts.map +1 -0
  291. package/lib/typescript/types.d.ts +3 -1
  292. package/lib/typescript/types.d.ts.map +1 -1
  293. package/lib/typescript/utils/functions.d.ts +2 -0
  294. package/lib/typescript/utils/functions.d.ts.map +1 -1
  295. package/lib/typescript/utils/types.d.ts +1 -0
  296. package/lib/typescript/utils/types.d.ts.map +1 -1
  297. package/package.json +2 -2
  298. package/src/HMSRoomSetup.tsx +61 -0
  299. package/src/Icons/Add/assets/add-circle.png +0 -0
  300. package/src/Icons/Add/assets/add-circle@2x.png +0 -0
  301. package/src/Icons/Add/assets/add-circle@3x.png +0 -0
  302. package/src/Icons/Add/index.tsx +37 -0
  303. package/src/Icons/CheckBox/assets/checkbox-checked.png +0 -0
  304. package/src/Icons/CheckBox/assets/checkbox-checked@2x.png +0 -0
  305. package/src/Icons/CheckBox/assets/checkbox-checked@3x.png +0 -0
  306. package/src/Icons/CheckBox/assets/checkbox.png +0 -0
  307. package/src/Icons/CheckBox/assets/checkbox@2x.png +0 -0
  308. package/src/Icons/CheckBox/assets/checkbox@3x.png +0 -0
  309. package/src/Icons/CheckBox/index.tsx +40 -0
  310. package/src/Icons/Poll/assets/poll.png +0 -0
  311. package/src/Icons/Poll/assets/poll@2x.png +0 -0
  312. package/src/Icons/Poll/assets/poll@3x.png +0 -0
  313. package/src/Icons/Poll/index.tsx +30 -0
  314. package/src/Icons/PollVote/assets/poll-vote.png +0 -0
  315. package/src/Icons/PollVote/assets/poll-vote@2x.png +0 -0
  316. package/src/Icons/PollVote/assets/poll-vote@3x.png +0 -0
  317. package/src/Icons/PollVote/index.tsx +33 -0
  318. package/src/Icons/Quiz/assets/quiz.png +0 -0
  319. package/src/Icons/Quiz/assets/quiz@2x.png +0 -0
  320. package/src/Icons/Quiz/assets/quiz@3x.png +0 -0
  321. package/src/Icons/Quiz/index.tsx +30 -0
  322. package/src/Icons/TrashBin/assets/trash-bin.png +0 -0
  323. package/src/Icons/TrashBin/assets/trash-bin@2x.png +0 -0
  324. package/src/Icons/TrashBin/assets/trash-bin@3x.png +0 -0
  325. package/src/Icons/TrashBin/index.tsx +34 -0
  326. package/src/Icons/index.ts +6 -0
  327. package/src/components/CheckboxInputRow.tsx +68 -0
  328. package/src/components/CreatePoll.tsx +176 -0
  329. package/src/components/Footer.tsx +7 -1
  330. package/src/components/HLSPlayerEmoticons.tsx +2 -3
  331. package/src/components/HMSBaseButton.tsx +8 -3
  332. package/src/components/HMSNotification.tsx +1 -1
  333. package/src/components/HMSNotifications.tsx +7 -0
  334. package/src/components/HMSPollsQuizzesNotification.tsx +110 -0
  335. package/src/components/HMSPrimaryButton.tsx +1 -1
  336. package/src/components/HMSRoomOptions.tsx +3 -0
  337. package/src/components/HMSSecondaryButton.tsx +72 -0
  338. package/src/components/PollAndQuizQuestionResponseCard.tsx +311 -0
  339. package/src/components/PollAndQuizVoting.tsx +157 -0
  340. package/src/components/PollAndQuizzStateLabel.tsx +83 -0
  341. package/src/components/PollQDeleteConfirmationSheetView.tsx +82 -0
  342. package/src/components/PollQuestion.tsx +553 -0
  343. package/src/components/PollQuestionDeleteConfirmation.tsx +110 -0
  344. package/src/components/PollQuestions.tsx +259 -0
  345. package/src/components/PollResponseProgressView.tsx +77 -0
  346. package/src/components/PollsAndQuizBottomSheet.tsx +83 -0
  347. package/src/components/PollsAndQuizzesCard.tsx +111 -0
  348. package/src/components/PollsAndQuizzesModalContent.tsx +198 -0
  349. package/src/components/PollsConfigAndList.tsx +29 -0
  350. package/src/components/PreviousPollsAndQuizzesList.tsx +103 -0
  351. package/src/components/RadioInput.tsx +44 -0
  352. package/src/components/RadioInputRow.tsx +73 -0
  353. package/src/components/RoomSettingsModalContent.tsx +23 -0
  354. package/src/components/SwitchRow.tsx +4 -2
  355. package/src/hooks-util.ts +41 -0
  356. package/src/redux/actionTypes.ts +221 -0
  357. package/src/redux/actions/index.ts +218 -1
  358. package/src/redux/reducers/index.ts +2 -0
  359. package/src/redux/reducers/polls.ts +328 -0
  360. package/src/types.ts +2 -0
  361. package/src/utils/functions.ts +14 -0
  362. package/src/utils/types.ts +1 -0
@@ -0,0 +1,328 @@
1
+ import { HMSPollQuestionType } from '@100mslive/react-native-hms';
2
+ import type { HMSPoll } from '@100mslive/react-native-hms';
3
+
4
+ import {
5
+ PollsStateActionTypes,
6
+ CreatePollStages,
7
+ HmsStateActionTypes,
8
+ } from '../actionTypes';
9
+ import type {
10
+ PollConfig,
11
+ PollQuestionUI,
12
+ PollsActionType,
13
+ } from '../actionTypes';
14
+
15
+ function getDefaultQuestionObj() {
16
+ return {
17
+ title: '',
18
+ responseEditable: false,
19
+ saved: false,
20
+ skippable: false,
21
+ type: HMSPollQuestionType.singleChoice,
22
+ options: ['', ''],
23
+ };
24
+ }
25
+
26
+ type IntialStateType = {
27
+ pollName: string;
28
+ pollConfig: PollConfig;
29
+ stage: CreatePollStages;
30
+ questions: PollQuestionUI[];
31
+ deleteConfirmationVisible: boolean;
32
+ selectedPollQuestionIndex: number | null;
33
+ launchingPoll: boolean;
34
+ selectedPollId: string | null;
35
+ cuedPollIds: HMSPoll['pollId'][]; // In case of HLSViewer, pollIds should be aligned with onCue event
36
+ polls: Record<string, HMSPoll>;
37
+ pollsResponses: Record<string, Record<number, number | number[]>>;
38
+ };
39
+
40
+ const INITIAL_STATE: IntialStateType = {
41
+ pollName: '',
42
+ pollConfig: {
43
+ voteCountHidden: false,
44
+ resultsAnonymous: false,
45
+ },
46
+ stage: CreatePollStages.POLL_CONFIG,
47
+ questions: [getDefaultQuestionObj()],
48
+ deleteConfirmationVisible: false,
49
+ selectedPollQuestionIndex: null,
50
+ launchingPoll: false,
51
+ selectedPollId: null,
52
+ cuedPollIds: [],
53
+ polls: {},
54
+ pollsResponses: {},
55
+ };
56
+
57
+ const hmsStatesReducer = (
58
+ state = INITIAL_STATE,
59
+ action: PollsActionType
60
+ ): IntialStateType => {
61
+ switch (action.type) {
62
+ case PollsStateActionTypes.SET_DELETE_CONFIRMATION_VISIBLE:
63
+ return {
64
+ ...state,
65
+ deleteConfirmationVisible: action.deleteConfirmationVisible,
66
+ };
67
+ case PollsStateActionTypes.SET_POLL_NAME:
68
+ return {
69
+ ...state,
70
+ pollName: action.pollName,
71
+ };
72
+ case PollsStateActionTypes.SET_POLL_CONFIG:
73
+ return {
74
+ ...state,
75
+ pollConfig: {
76
+ ...state.pollConfig,
77
+ ...action.pollConfig,
78
+ },
79
+ selectedPollQuestionIndex: null,
80
+ };
81
+ case PollsStateActionTypes.SET_POLL_STAGE:
82
+ return {
83
+ ...state,
84
+ stage: action.pollStage,
85
+ selectedPollQuestionIndex: null,
86
+ };
87
+ case PollsStateActionTypes.ADD_POLL_QUESTION:
88
+ return {
89
+ ...state,
90
+ questions: [...state.questions, getDefaultQuestionObj()],
91
+ selectedPollQuestionIndex: null,
92
+ };
93
+ case PollsStateActionTypes.DELETE_POLL_QUESTION:
94
+ let updatedQuestions = state.questions;
95
+
96
+ if (state.selectedPollQuestionIndex === null) {
97
+ return state;
98
+ }
99
+
100
+ if (updatedQuestions.length > state.selectedPollQuestionIndex) {
101
+ updatedQuestions = updatedQuestions.filter(
102
+ (_, idx) => idx !== state.selectedPollQuestionIndex
103
+ );
104
+ }
105
+ if (updatedQuestions === state.questions) {
106
+ return state;
107
+ }
108
+ return {
109
+ ...state,
110
+ questions: updatedQuestions,
111
+ selectedPollQuestionIndex: null,
112
+ };
113
+ case PollsStateActionTypes.SET_SELECTED_QUESTION_INDEX:
114
+ return {
115
+ ...state,
116
+ selectedPollQuestionIndex: action.index,
117
+ };
118
+ case PollsStateActionTypes.SET_QUESTION_TYPE:
119
+ return {
120
+ ...state,
121
+ questions: state.questions.map((question, idx) =>
122
+ idx === action.questionIndex
123
+ ? {
124
+ ...question,
125
+ options:
126
+ action.questionType === HMSPollQuestionType.shortAnswer ||
127
+ action.questionType === HMSPollQuestionType.longAnswer
128
+ ? undefined
129
+ : question.options,
130
+ type: action.questionType,
131
+ }
132
+ : question
133
+ ),
134
+ };
135
+ case PollsStateActionTypes.SET_QUESTION_TITLE:
136
+ return {
137
+ ...state,
138
+ questions: state.questions.map((question, idx) =>
139
+ idx === action.questionIndex
140
+ ? {
141
+ ...question,
142
+ title: action.title,
143
+ }
144
+ : question
145
+ ),
146
+ };
147
+ case PollsStateActionTypes.ADD_QUESTION_OPTION:
148
+ return {
149
+ ...state,
150
+ questions: state.questions.map((question, idx) =>
151
+ idx === action.questionIndex
152
+ ? {
153
+ ...question,
154
+ options: [...(question.options || []), ''],
155
+ }
156
+ : question
157
+ ),
158
+ };
159
+ case PollsStateActionTypes.DELETE_QUESTION_OPTION:
160
+ return {
161
+ ...state,
162
+ questions: state.questions.map((question, idx) =>
163
+ idx === action.questionIndex
164
+ ? {
165
+ ...question,
166
+ options:
167
+ question.options &&
168
+ question.options.filter((_, idx) => idx !== action.index),
169
+ }
170
+ : question
171
+ ),
172
+ };
173
+ case PollsStateActionTypes.EDIT_QUESTION_OPTION:
174
+ return {
175
+ ...state,
176
+ questions: state.questions.map((question, idx) =>
177
+ idx === action.questionIndex
178
+ ? {
179
+ ...question,
180
+ options:
181
+ question.options &&
182
+ question.options.map((option, idx) =>
183
+ idx === action.optionIndex ? action.option : option
184
+ ),
185
+ }
186
+ : question
187
+ ),
188
+ };
189
+ case PollsStateActionTypes.SET_QUESTION_SKIPPABLE:
190
+ return {
191
+ ...state,
192
+ questions: state.questions.map((question, idx) =>
193
+ idx === action.questionIndex
194
+ ? {
195
+ ...question,
196
+ skippable: action.skippable,
197
+ }
198
+ : question
199
+ ),
200
+ };
201
+ case PollsStateActionTypes.SET_QUESTION_RES_EDITABLE:
202
+ return {
203
+ ...state,
204
+ questions: state.questions.map((question, idx) =>
205
+ idx === action.questionIndex
206
+ ? {
207
+ ...question,
208
+ responseEditable: action.responseEditable,
209
+ }
210
+ : question
211
+ ),
212
+ };
213
+ case PollsStateActionTypes.SET_QUESTION_SAVED:
214
+ return {
215
+ ...state,
216
+ questions: state.questions.map((question, idx) =>
217
+ idx === action.questionIndex
218
+ ? {
219
+ ...question,
220
+ saved: action.saved,
221
+ }
222
+ : question
223
+ ),
224
+ };
225
+ case PollsStateActionTypes.SET_LAUNCHING_POLL:
226
+ return {
227
+ ...state,
228
+ launchingPoll: action.launching,
229
+ questions: action.launching
230
+ ? state.questions.map((question) => ({ ...question, saved: true }))
231
+ : state.questions,
232
+ };
233
+ case PollsStateActionTypes.SET_SELECTED_POLL_ID:
234
+ return {
235
+ ...state,
236
+ selectedPollId: action.pollId,
237
+ };
238
+ case PollsStateActionTypes.ADD_POLL:
239
+ return {
240
+ ...state,
241
+ polls: {
242
+ ...state.polls,
243
+ [action.poll.pollId]: action.poll,
244
+ },
245
+ };
246
+ case PollsStateActionTypes.UPDATE_POLL:
247
+ return {
248
+ ...state,
249
+ polls: {
250
+ ...state.polls,
251
+ [action.poll.pollId]: {
252
+ ...state.polls[action.poll.pollId],
253
+ ...action.poll,
254
+ },
255
+ },
256
+ };
257
+ case PollsStateActionTypes.SET_POLL_QUESTION_RESPONSE:
258
+ return {
259
+ ...state,
260
+ pollsResponses: {
261
+ ...state.pollsResponses,
262
+ [action.pollId]: {
263
+ ...state.pollsResponses[action.pollId],
264
+ [action.questionIndex]: action.response,
265
+ },
266
+ },
267
+ };
268
+ case PollsStateActionTypes.ADD_POLL_QUESTION_RESPONSE:
269
+ const prevResponses =
270
+ state.pollsResponses[action.pollId]?.[action.questionIndex];
271
+ const newResponses = prevResponses
272
+ ? Array.isArray(prevResponses)
273
+ ? [...prevResponses, action.response]
274
+ : [prevResponses, action.response]
275
+ : [action.response];
276
+ return {
277
+ ...state,
278
+ pollsResponses: {
279
+ ...state.pollsResponses,
280
+ [action.pollId]: {
281
+ ...state.pollsResponses[action.pollId],
282
+ [action.questionIndex]: newResponses,
283
+ },
284
+ },
285
+ };
286
+ case PollsStateActionTypes.REMOVE_POLL_QUESTION_RESPONSE: {
287
+ const prevResponses =
288
+ state.pollsResponses[action.pollId]?.[action.questionIndex];
289
+ const newResponses = prevResponses
290
+ ? Array.isArray(prevResponses)
291
+ ? prevResponses.filter((res) => res !== action.response)
292
+ : prevResponses === action.response
293
+ ? []
294
+ : action.response
295
+ : [];
296
+ return {
297
+ ...state,
298
+ pollsResponses: {
299
+ ...state.pollsResponses,
300
+ [action.pollId]: {
301
+ ...state.pollsResponses[action.pollId],
302
+ [action.questionIndex]: newResponses,
303
+ },
304
+ },
305
+ };
306
+ }
307
+ case PollsStateActionTypes.ADD_CUED_POLL_ID: {
308
+ return {
309
+ ...state,
310
+ cuedPollIds: [...state.cuedPollIds, action.pollId],
311
+ };
312
+ }
313
+ case PollsStateActionTypes.CLEAR_POLL_FORM_STATE: {
314
+ return {
315
+ ...INITIAL_STATE,
316
+ polls: state.polls,
317
+ selectedPollId: state.selectedPollId,
318
+ };
319
+ }
320
+ case PollsStateActionTypes.CLEAR_POLLS_STATE:
321
+ case HmsStateActionTypes.CLEAR_STATES:
322
+ return INITIAL_STATE;
323
+ default:
324
+ return state;
325
+ }
326
+ };
327
+
328
+ export default hmsStatesReducer;
package/src/types.ts CHANGED
@@ -71,6 +71,7 @@ export enum NotificationTypes {
71
71
  LOCAL_SCREENSHARE = 'local_screenshare',
72
72
  ERROR = 'error',
73
73
  TERMINAL_ERROR = 'terminal_error',
74
+ POLLS_AND_QUIZZES = 'polls_and_quizzes',
74
75
  }
75
76
 
76
77
  export type Notification =
@@ -81,6 +82,7 @@ export type Notification =
81
82
  icon?: string;
82
83
  message?: string;
83
84
  title: string;
85
+ payload?: any;
84
86
  }
85
87
  | { id: string; type: NotificationTypes; icon?: string; peer: HMSPeer }
86
88
  | {
@@ -12,7 +12,9 @@ import {
12
12
  HMSTrackSource,
13
13
  HMSVideoTrack,
14
14
  HMSRole,
15
+ HMSPollType,
15
16
  } from '@100mslive/react-native-hms';
17
+ import type { HMSPoll } from '@100mslive/react-native-hms';
16
18
 
17
19
  import type { PeerTrackNode } from './types';
18
20
 
@@ -471,3 +473,15 @@ export const isParticipantHostOrBroadcaster = (role: HMSRole): boolean => {
471
473
 
472
474
  return Boolean(allowed && allowed.length > 0 && canChangeRole);
473
475
  };
476
+
477
+ export const visiblePollsSelector = (
478
+ polls: HMSPoll[],
479
+ isHLSViewer: boolean,
480
+ hlsCuedPollIds: HMSPoll['pollId'][]
481
+ ) => {
482
+ return polls.filter(
483
+ (poll) =>
484
+ poll.type !== HMSPollType.quiz &&
485
+ (isHLSViewer ? hlsCuedPollIds.includes(poll.pollId) : true) // Hiding quizzes from UI
486
+ );
487
+ };
@@ -58,6 +58,7 @@ export enum ModalTypes {
58
58
  CHAT_FILTER = 'chatFilter',
59
59
  CHAT_MORE_ACTIONS = 'chatMoreActions',
60
60
  MESSAGE_OPTIONS = 'messageOptions',
61
+ POLLS_AND_QUIZZES = 'pollsAndQuizzes',
61
62
  DEFAULT = '',
62
63
  }
63
64