@selfcommunity/react-ui 0.11.0-alpha.60 → 0.11.0-alpha.62

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 (571) hide show
  1. package/lib/cjs/assets/courses/clapping.d.ts +1 -0
  2. package/lib/cjs/assets/courses/clapping.js +4 -0
  3. package/lib/cjs/components/BottomNavigation/BottomNavigation.js +17 -2
  4. package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.js +6 -8
  5. package/lib/cjs/components/CommentObject/CommentObject.d.ts +5 -0
  6. package/lib/cjs/components/CommentObject/CommentObject.js +2 -2
  7. package/lib/cjs/components/CommentObjectReply/CommentObjectReply.d.ts +24 -2
  8. package/lib/cjs/components/CommentObjectReply/CommentObjectReply.js +17 -4
  9. package/lib/cjs/components/Composer/Content/ContentLesson/ContentLesson.d.ts +38 -0
  10. package/lib/cjs/components/Composer/Content/ContentLesson/ContentLesson.js +67 -0
  11. package/lib/cjs/components/Composer/Content/ContentLesson/index.d.ts +3 -0
  12. package/lib/cjs/components/Composer/Content/ContentLesson/index.js +5 -0
  13. package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +2 -2
  14. package/lib/cjs/components/ComposerIconButton/ComposerIconButton.d.ts +9 -3
  15. package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +38 -9
  16. package/lib/cjs/components/Course/Course.d.ts +92 -0
  17. package/lib/cjs/components/Course/Course.js +185 -0
  18. package/lib/cjs/components/Course/CreatePlaceholder.d.ts +39 -0
  19. package/lib/cjs/components/Course/CreatePlaceholder.js +59 -0
  20. package/lib/cjs/components/Course/Skeleton.d.ts +51 -0
  21. package/lib/cjs/components/Course/Skeleton.js +77 -0
  22. package/lib/cjs/components/Course/constants.d.ts +1 -0
  23. package/lib/cjs/components/Course/constants.js +4 -0
  24. package/lib/cjs/components/Course/index.d.ts +4 -0
  25. package/lib/cjs/components/Course/index.js +8 -0
  26. package/lib/cjs/components/CourseCompletedDialog/CourseCompletedDialog.d.ts +9 -0
  27. package/lib/cjs/components/CourseCompletedDialog/CourseCompletedDialog.js +40 -0
  28. package/lib/cjs/components/CourseCompletedDialog/index.d.ts +3 -0
  29. package/lib/cjs/components/CourseCompletedDialog/index.js +5 -0
  30. package/lib/cjs/components/CourseContentMenu/CourseContentMenu.d.ts +25 -0
  31. package/lib/cjs/components/CourseContentMenu/CourseContentMenu.js +47 -0
  32. package/lib/cjs/components/CourseContentMenu/constants.d.ts +1 -0
  33. package/lib/cjs/components/CourseContentMenu/constants.js +4 -0
  34. package/lib/cjs/components/CourseContentMenu/index.d.ts +3 -0
  35. package/lib/cjs/components/CourseContentMenu/index.js +5 -0
  36. package/lib/cjs/components/CourseDashboard/Header/Skeleton.d.ts +1 -0
  37. package/lib/cjs/components/CourseDashboard/Header/Skeleton.js +16 -0
  38. package/lib/cjs/components/CourseDashboard/Header.d.ts +9 -0
  39. package/lib/cjs/components/CourseDashboard/Header.js +44 -0
  40. package/lib/cjs/components/CourseDashboard/Student/ActionButton.d.ts +8 -0
  41. package/lib/cjs/components/CourseDashboard/Student/ActionButton.js +16 -0
  42. package/lib/cjs/components/CourseDashboard/Student/Skeleton.d.ts +1 -0
  43. package/lib/cjs/components/CourseDashboard/Student/Skeleton.js +30 -0
  44. package/lib/cjs/components/CourseDashboard/Student.d.ts +11 -0
  45. package/lib/cjs/components/CourseDashboard/Student.js +203 -0
  46. package/lib/cjs/components/CourseDashboard/Teacher/Comments.d.ts +9 -0
  47. package/lib/cjs/components/CourseDashboard/Teacher/Comments.js +108 -0
  48. package/lib/cjs/components/CourseDashboard/Teacher/Info.d.ts +11 -0
  49. package/lib/cjs/components/CourseDashboard/Teacher/Info.js +19 -0
  50. package/lib/cjs/components/CourseDashboard/Teacher/Skeleton.d.ts +1 -0
  51. package/lib/cjs/components/CourseDashboard/Teacher/Skeleton.js +25 -0
  52. package/lib/cjs/components/CourseDashboard/Teacher/Students.d.ts +10 -0
  53. package/lib/cjs/components/CourseDashboard/Teacher/Students.js +71 -0
  54. package/lib/cjs/components/CourseDashboard/Teacher.d.ts +11 -0
  55. package/lib/cjs/components/CourseDashboard/Teacher.js +62 -0
  56. package/lib/cjs/components/CourseDashboard/constants.d.ts +1 -0
  57. package/lib/cjs/components/CourseDashboard/constants.js +4 -0
  58. package/lib/cjs/components/CourseDashboard/index.d.ts +11 -0
  59. package/lib/cjs/components/CourseDashboard/index.js +11 -0
  60. package/lib/cjs/components/CourseDashboard/types.d.ts +8 -0
  61. package/lib/cjs/components/CourseDashboard/types.js +13 -0
  62. package/lib/cjs/components/CourseForm/CourseForm.d.ts +74 -0
  63. package/lib/cjs/components/CourseForm/CourseForm.js +273 -0
  64. package/lib/cjs/components/CourseForm/Dialog.d.ts +8 -0
  65. package/lib/cjs/components/CourseForm/Dialog.js +19 -0
  66. package/lib/cjs/components/CourseForm/Edit.d.ts +24 -0
  67. package/lib/cjs/components/CourseForm/Edit.js +53 -0
  68. package/lib/cjs/components/CourseForm/Skeleton.d.ts +1 -0
  69. package/lib/cjs/components/CourseForm/Skeleton.js +17 -0
  70. package/lib/cjs/components/CourseForm/UploadCourseCover.d.ts +45 -0
  71. package/lib/cjs/components/CourseForm/UploadCourseCover.js +94 -0
  72. package/lib/cjs/components/CourseForm/constants.d.ts +1 -0
  73. package/lib/cjs/components/CourseForm/constants.js +4 -0
  74. package/lib/cjs/components/CourseForm/index.d.ts +4 -0
  75. package/lib/cjs/components/CourseForm/index.js +8 -0
  76. package/lib/cjs/components/CourseFormDialog/CourseFormDialog.d.ts +48 -0
  77. package/lib/cjs/components/CourseFormDialog/CourseFormDialog.js +67 -0
  78. package/lib/cjs/components/CourseFormDialog/constants.d.ts +1 -0
  79. package/lib/cjs/components/CourseFormDialog/constants.js +4 -0
  80. package/lib/cjs/components/CourseFormDialog/index.d.ts +3 -0
  81. package/lib/cjs/components/CourseFormDialog/index.js +5 -0
  82. package/lib/cjs/components/CourseJoinButton/CourseJoinButton.d.ts +56 -0
  83. package/lib/cjs/components/CourseJoinButton/CourseJoinButton.js +148 -0
  84. package/lib/cjs/components/CourseJoinButton/index.d.ts +3 -0
  85. package/lib/cjs/components/CourseJoinButton/index.js +5 -0
  86. package/lib/cjs/components/CourseParticipantsButton/CourseParticipantsButton.d.ts +53 -0
  87. package/lib/cjs/components/CourseParticipantsButton/CourseParticipantsButton.js +150 -0
  88. package/lib/cjs/components/CourseParticipantsButton/index.d.ts +3 -0
  89. package/lib/cjs/components/CourseParticipantsButton/index.js +5 -0
  90. package/lib/cjs/components/Courses/Courses.d.ts +100 -0
  91. package/lib/cjs/components/Courses/Courses.js +237 -0
  92. package/lib/cjs/components/Courses/Skeleton.d.ts +54 -0
  93. package/lib/cjs/components/Courses/Skeleton.js +45 -0
  94. package/lib/cjs/components/Courses/constants.d.ts +1 -0
  95. package/lib/cjs/components/Courses/constants.js +4 -0
  96. package/lib/cjs/components/Courses/index.d.ts +4 -0
  97. package/lib/cjs/components/Courses/index.js +8 -0
  98. package/lib/cjs/components/Courses/prefetchedCourses.d.ts +81 -0
  99. package/lib/cjs/components/Courses/prefetchedCourses.js +186 -0
  100. package/lib/cjs/components/CreateCourseButton/CreateCourseButton.d.ts +38 -0
  101. package/lib/cjs/components/CreateCourseButton/CreateCourseButton.js +81 -0
  102. package/lib/cjs/components/CreateCourseButton/index.d.ts +3 -0
  103. package/lib/cjs/components/CreateCourseButton/index.js +5 -0
  104. package/lib/cjs/components/EditCourse/Customize.d.ts +9 -0
  105. package/lib/cjs/components/EditCourse/Customize.js +31 -0
  106. package/lib/cjs/components/EditCourse/EditCourse.d.ts +13 -0
  107. package/lib/cjs/components/EditCourse/EditCourse.js +110 -0
  108. package/lib/cjs/components/EditCourse/Lessons/AddButton.d.ts +9 -0
  109. package/lib/cjs/components/EditCourse/Lessons/AddButton.js +29 -0
  110. package/lib/cjs/components/EditCourse/Lessons/ChangeLessonStatus.d.ts +13 -0
  111. package/lib/cjs/components/EditCourse/Lessons/ChangeLessonStatus.js +92 -0
  112. package/lib/cjs/components/EditCourse/Lessons/FieldName.d.ts +15 -0
  113. package/lib/cjs/components/EditCourse/Lessons/FieldName.js +83 -0
  114. package/lib/cjs/components/EditCourse/Lessons/LessonRow.d.ts +15 -0
  115. package/lib/cjs/components/EditCourse/Lessons/LessonRow.js +68 -0
  116. package/lib/cjs/components/EditCourse/Lessons/SectionRow.d.ts +14 -0
  117. package/lib/cjs/components/EditCourse/Lessons/SectionRow.js +158 -0
  118. package/lib/cjs/components/EditCourse/Lessons/Skeleton.d.ts +1 -0
  119. package/lib/cjs/components/EditCourse/Lessons/Skeleton.js +20 -0
  120. package/lib/cjs/components/EditCourse/Lessons.d.ts +11 -0
  121. package/lib/cjs/components/EditCourse/Lessons.js +196 -0
  122. package/lib/cjs/components/EditCourse/MenuRow.d.ts +9 -0
  123. package/lib/cjs/components/EditCourse/MenuRow.js +25 -0
  124. package/lib/cjs/components/EditCourse/Options/Skeleton.d.ts +1 -0
  125. package/lib/cjs/components/EditCourse/Options/Skeleton.js +15 -0
  126. package/lib/cjs/components/EditCourse/Options/SwitchForm.d.ts +11 -0
  127. package/lib/cjs/components/EditCourse/Options/SwitchForm.js +20 -0
  128. package/lib/cjs/components/EditCourse/Options.d.ts +9 -0
  129. package/lib/cjs/components/EditCourse/Options.js +96 -0
  130. package/lib/cjs/components/EditCourse/Requests.d.ts +12 -0
  131. package/lib/cjs/components/EditCourse/Requests.js +97 -0
  132. package/lib/cjs/components/EditCourse/Skeleton.d.ts +8 -0
  133. package/lib/cjs/components/EditCourse/Skeleton.js +28 -0
  134. package/lib/cjs/components/EditCourse/Status.d.ts +9 -0
  135. package/lib/cjs/components/EditCourse/Status.js +33 -0
  136. package/lib/cjs/components/EditCourse/Users/Skeleton.d.ts +1 -0
  137. package/lib/cjs/components/EditCourse/Users/Skeleton.js +15 -0
  138. package/lib/cjs/components/EditCourse/Users.d.ts +11 -0
  139. package/lib/cjs/components/EditCourse/Users.js +140 -0
  140. package/lib/cjs/components/EditCourse/constants.d.ts +1 -0
  141. package/lib/cjs/components/EditCourse/constants.js +4 -0
  142. package/lib/cjs/components/EditCourse/hooks.d.ts +3 -0
  143. package/lib/cjs/components/EditCourse/hooks.js +22 -0
  144. package/lib/cjs/components/EditCourse/index.d.ts +4 -0
  145. package/lib/cjs/components/EditCourse/index.js +8 -0
  146. package/lib/cjs/components/EditCourse/types.d.ts +29 -0
  147. package/lib/cjs/components/EditCourse/types.js +19 -0
  148. package/lib/cjs/components/Editor/Editor.d.ts +37 -0
  149. package/lib/cjs/components/Editor/Editor.js +6 -3
  150. package/lib/cjs/components/Editor/plugins/EmojiPlugin.d.ts +3 -1
  151. package/lib/cjs/components/Editor/plugins/EmojiPlugin.js +4 -10
  152. package/lib/cjs/components/Editor/plugins/MediaPlugin.d.ts +14 -0
  153. package/lib/cjs/components/Editor/plugins/MediaPlugin.js +121 -0
  154. package/lib/cjs/components/Editor/plugins/ToolbarPlugin.d.ts +5 -0
  155. package/lib/cjs/components/Editor/plugins/ToolbarPlugin.js +3 -2
  156. package/lib/cjs/components/Editor/plugins/index.d.ts +2 -1
  157. package/lib/cjs/components/Editor/plugins/index.js +3 -1
  158. package/lib/cjs/components/EventForm/EventForm.js +1 -1
  159. package/lib/cjs/components/LessonAppbar/LessonAppbar.d.ts +42 -0
  160. package/lib/cjs/components/LessonAppbar/LessonAppbar.js +34 -0
  161. package/lib/cjs/components/LessonAppbar/constants.d.ts +1 -0
  162. package/lib/cjs/components/LessonAppbar/constants.js +4 -0
  163. package/lib/cjs/components/LessonAppbar/index.d.ts +3 -0
  164. package/lib/cjs/components/LessonAppbar/index.js +5 -0
  165. package/lib/cjs/components/LessonCommentObject/LessonCommentObject.d.ts +94 -0
  166. package/lib/cjs/components/LessonCommentObject/LessonCommentObject.js +202 -0
  167. package/lib/cjs/components/LessonCommentObject/Skeleton.d.ts +21 -0
  168. package/lib/cjs/components/LessonCommentObject/Skeleton.js +46 -0
  169. package/lib/cjs/components/LessonCommentObject/constants.d.ts +1 -0
  170. package/lib/cjs/components/LessonCommentObject/constants.js +4 -0
  171. package/lib/cjs/components/LessonCommentObject/index.d.ts +4 -0
  172. package/lib/cjs/components/LessonCommentObject/index.js +8 -0
  173. package/lib/cjs/components/LessonCommentObjects/LessonCommentObjects.d.ts +76 -0
  174. package/lib/cjs/components/LessonCommentObjects/LessonCommentObjects.js +185 -0
  175. package/lib/cjs/components/LessonCommentObjects/Skeleton.d.ts +23 -0
  176. package/lib/cjs/components/LessonCommentObjects/Skeleton.js +40 -0
  177. package/lib/cjs/components/LessonCommentObjects/constants.d.ts +1 -0
  178. package/lib/cjs/components/LessonCommentObjects/constants.js +4 -0
  179. package/lib/cjs/components/LessonCommentObjects/index.d.ts +4 -0
  180. package/lib/cjs/components/LessonCommentObjects/index.js +8 -0
  181. package/lib/cjs/components/LessonDrawer/LessonDrawer.d.ts +50 -0
  182. package/lib/cjs/components/LessonDrawer/LessonDrawer.js +37 -0
  183. package/lib/cjs/components/LessonDrawer/constants.d.ts +1 -0
  184. package/lib/cjs/components/LessonDrawer/constants.js +4 -0
  185. package/lib/cjs/components/LessonDrawer/index.d.ts +3 -0
  186. package/lib/cjs/components/LessonDrawer/index.js +5 -0
  187. package/lib/cjs/components/LessonEditForm/LessonEditForm.d.ts +24 -0
  188. package/lib/cjs/components/LessonEditForm/LessonEditForm.js +45 -0
  189. package/lib/cjs/components/LessonEditForm/constants.d.ts +1 -0
  190. package/lib/cjs/components/LessonEditForm/constants.js +4 -0
  191. package/lib/cjs/components/LessonEditForm/index.d.ts +3 -0
  192. package/lib/cjs/components/LessonEditForm/index.js +5 -0
  193. package/lib/cjs/components/LessonObject/LessonObject.d.ts +40 -0
  194. package/lib/cjs/components/LessonObject/LessonObject.js +70 -0
  195. package/lib/cjs/components/LessonObject/constants.d.ts +1 -0
  196. package/lib/cjs/components/LessonObject/constants.js +4 -0
  197. package/lib/cjs/components/LessonObject/index.d.ts +3 -0
  198. package/lib/cjs/components/LessonObject/index.js +5 -0
  199. package/lib/cjs/components/LessonReleaseMenu/LessonReleaseMenu.d.ts +26 -0
  200. package/lib/cjs/components/LessonReleaseMenu/LessonReleaseMenu.js +172 -0
  201. package/lib/cjs/components/LessonReleaseMenu/constants.d.ts +5 -0
  202. package/lib/cjs/components/LessonReleaseMenu/constants.js +9 -0
  203. package/lib/cjs/components/LessonReleaseMenu/index.d.ts +3 -0
  204. package/lib/cjs/components/LessonReleaseMenu/index.js +5 -0
  205. package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerContent.js +7 -5
  206. package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +12 -1
  207. package/lib/cjs/components/Notification/Course/Course.d.ts +15 -0
  208. package/lib/cjs/components/Notification/Course/Course.js +89 -0
  209. package/lib/cjs/components/Notification/Course/index.d.ts +3 -0
  210. package/lib/cjs/components/Notification/Course/index.js +5 -0
  211. package/lib/cjs/components/Notification/Course/utils.d.ts +5 -0
  212. package/lib/cjs/components/Notification/Course/utils.js +44 -0
  213. package/lib/cjs/components/Notification/Notification.js +9 -0
  214. package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +9 -0
  215. package/lib/cjs/components/TagAutocomplete/TagAutocomplete.js +2 -2
  216. package/lib/cjs/components/ToastNotifications/ToastNotifications.js +9 -0
  217. package/lib/cjs/components/UserCreatedCoursesWidget/Skeleton.d.ts +21 -0
  218. package/lib/cjs/components/UserCreatedCoursesWidget/Skeleton.js +43 -0
  219. package/lib/cjs/components/UserCreatedCoursesWidget/UserCreatedCoursesWidget.d.ts +63 -0
  220. package/lib/cjs/components/UserCreatedCoursesWidget/UserCreatedCoursesWidget.js +154 -0
  221. package/lib/cjs/components/UserCreatedCoursesWidget/constants.d.ts +1 -0
  222. package/lib/cjs/components/UserCreatedCoursesWidget/constants.js +4 -0
  223. package/lib/cjs/components/UserCreatedCoursesWidget/index.d.ts +4 -0
  224. package/lib/cjs/components/UserCreatedCoursesWidget/index.js +8 -0
  225. package/lib/cjs/constants/Course.d.ts +6 -0
  226. package/lib/cjs/constants/Course.js +10 -0
  227. package/lib/cjs/constants/PubSub.d.ts +14 -0
  228. package/lib/cjs/constants/PubSub.js +16 -1
  229. package/lib/cjs/index.d.ts +23 -2
  230. package/lib/cjs/index.js +60 -5
  231. package/lib/cjs/shared/AccordionLessons/AccordionLessons.d.ts +8 -0
  232. package/lib/cjs/shared/AccordionLessons/AccordionLessons.js +65 -0
  233. package/lib/cjs/shared/AccordionLessons/Skeleton.d.ts +1 -0
  234. package/lib/cjs/shared/AccordionLessons/Skeleton.js +21 -0
  235. package/lib/cjs/shared/AccordionLessons/constants.d.ts +1 -0
  236. package/lib/cjs/shared/AccordionLessons/constants.js +4 -0
  237. package/lib/cjs/shared/AccordionLessons/index.d.ts +4 -0
  238. package/lib/cjs/shared/AccordionLessons/index.js +8 -0
  239. package/lib/cjs/shared/AddUsersButton/AddUsersButton.d.ts +29 -0
  240. package/lib/cjs/shared/AddUsersButton/AddUsersButton.js +136 -0
  241. package/lib/cjs/shared/AddUsersButton/index.d.ts +3 -0
  242. package/lib/cjs/shared/AddUsersButton/index.js +5 -0
  243. package/lib/cjs/shared/CourseTypePopover/CourseTypePopover.d.ts +9 -0
  244. package/lib/cjs/shared/CourseTypePopover/CourseTypePopover.js +48 -0
  245. package/lib/cjs/shared/CourseTypePopover/index.d.ts +3 -0
  246. package/lib/cjs/shared/CourseTypePopover/index.js +5 -0
  247. package/lib/cjs/shared/CourseUsersTable/ChangeUsersStatus.d.ts +9 -0
  248. package/lib/cjs/shared/CourseUsersTable/ChangeUsersStatus.js +58 -0
  249. package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.d.ts +21 -0
  250. package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.js +155 -0
  251. package/lib/cjs/shared/CourseUsersTable/RemoveButton.d.ts +10 -0
  252. package/lib/cjs/shared/CourseUsersTable/RemoveButton.js +51 -0
  253. package/lib/cjs/shared/CourseUsersTable/RequestButton.d.ts +10 -0
  254. package/lib/cjs/shared/CourseUsersTable/RequestButton.js +79 -0
  255. package/lib/cjs/shared/CourseUsersTable/RowSkeleton.d.ts +8 -0
  256. package/lib/cjs/shared/CourseUsersTable/RowSkeleton.js +14 -0
  257. package/lib/cjs/shared/CourseUsersTable/SeeProgressButton.d.ts +9 -0
  258. package/lib/cjs/shared/CourseUsersTable/SeeProgressButton.js +56 -0
  259. package/lib/cjs/shared/CourseUsersTable/Skeleton.d.ts +1 -0
  260. package/lib/cjs/shared/CourseUsersTable/Skeleton.js +19 -0
  261. package/lib/cjs/shared/CourseUsersTable/constants.d.ts +1 -0
  262. package/lib/cjs/shared/CourseUsersTable/constants.js +4 -0
  263. package/lib/cjs/shared/CourseUsersTable/index.d.ts +4 -0
  264. package/lib/cjs/shared/CourseUsersTable/index.js +8 -0
  265. package/lib/cjs/shared/DateTimeAgo/index.d.ts +1 -1
  266. package/lib/cjs/shared/EmptyStatus/EmptyStatus.d.ts +11 -0
  267. package/lib/cjs/shared/EmptyStatus/EmptyStatus.js +26 -0
  268. package/lib/cjs/shared/EmptyStatus/index.d.ts +3 -0
  269. package/lib/cjs/shared/EmptyStatus/index.js +5 -0
  270. package/lib/cjs/shared/LessonCommentActionsMenu/index.d.ts +41 -0
  271. package/lib/cjs/shared/LessonCommentActionsMenu/index.js +197 -0
  272. package/lib/cjs/shared/LessonFilePreview/index.d.ts +12 -0
  273. package/lib/cjs/shared/LessonFilePreview/index.js +29 -0
  274. package/lib/cjs/shared/Media/Link/UrlTextField/index.js +2 -3
  275. package/lib/cjs/types/course.d.ts +40 -0
  276. package/lib/cjs/types/course.js +33 -0
  277. package/lib/cjs/types/index.d.ts +2 -1
  278. package/lib/cjs/types/index.js +6 -1
  279. package/lib/cjs/utils/course.d.ts +14 -0
  280. package/lib/cjs/utils/course.js +39 -0
  281. package/lib/esm/assets/courses/clapping.d.ts +1 -0
  282. package/lib/esm/assets/courses/clapping.js +1 -0
  283. package/lib/esm/components/BottomNavigation/BottomNavigation.js +17 -2
  284. package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.js +6 -8
  285. package/lib/esm/components/CommentObject/CommentObject.d.ts +5 -0
  286. package/lib/esm/components/CommentObject/CommentObject.js +2 -2
  287. package/lib/esm/components/CommentObjectReply/CommentObjectReply.d.ts +24 -2
  288. package/lib/esm/components/CommentObjectReply/CommentObjectReply.js +18 -5
  289. package/lib/esm/components/Composer/Content/ContentLesson/ContentLesson.d.ts +38 -0
  290. package/lib/esm/components/Composer/Content/ContentLesson/ContentLesson.js +64 -0
  291. package/lib/esm/components/Composer/Content/ContentLesson/index.d.ts +3 -0
  292. package/lib/esm/components/Composer/Content/ContentLesson/index.js +2 -0
  293. package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +2 -2
  294. package/lib/esm/components/ComposerIconButton/ComposerIconButton.d.ts +9 -3
  295. package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +38 -9
  296. package/lib/esm/components/Course/Course.d.ts +92 -0
  297. package/lib/esm/components/Course/Course.js +182 -0
  298. package/lib/esm/components/Course/CreatePlaceholder.d.ts +39 -0
  299. package/lib/esm/components/Course/CreatePlaceholder.js +56 -0
  300. package/lib/esm/components/Course/Skeleton.d.ts +51 -0
  301. package/lib/esm/components/Course/Skeleton.js +74 -0
  302. package/lib/esm/components/Course/constants.d.ts +1 -0
  303. package/lib/esm/components/Course/constants.js +1 -0
  304. package/lib/esm/components/Course/index.d.ts +4 -0
  305. package/lib/esm/components/Course/index.js +4 -0
  306. package/lib/esm/components/CourseCompletedDialog/CourseCompletedDialog.d.ts +9 -0
  307. package/lib/esm/components/CourseCompletedDialog/CourseCompletedDialog.js +37 -0
  308. package/lib/esm/components/CourseCompletedDialog/index.d.ts +3 -0
  309. package/lib/esm/components/CourseCompletedDialog/index.js +2 -0
  310. package/lib/esm/components/CourseContentMenu/CourseContentMenu.d.ts +25 -0
  311. package/lib/esm/components/CourseContentMenu/CourseContentMenu.js +44 -0
  312. package/lib/esm/components/CourseContentMenu/constants.d.ts +1 -0
  313. package/lib/esm/components/CourseContentMenu/constants.js +1 -0
  314. package/lib/esm/components/CourseContentMenu/index.d.ts +3 -0
  315. package/lib/esm/components/CourseContentMenu/index.js +2 -0
  316. package/lib/esm/components/CourseDashboard/Header/Skeleton.d.ts +1 -0
  317. package/lib/esm/components/CourseDashboard/Header/Skeleton.js +13 -0
  318. package/lib/esm/components/CourseDashboard/Header.d.ts +9 -0
  319. package/lib/esm/components/CourseDashboard/Header.js +41 -0
  320. package/lib/esm/components/CourseDashboard/Student/ActionButton.d.ts +8 -0
  321. package/lib/esm/components/CourseDashboard/Student/ActionButton.js +13 -0
  322. package/lib/esm/components/CourseDashboard/Student/Skeleton.d.ts +1 -0
  323. package/lib/esm/components/CourseDashboard/Student/Skeleton.js +26 -0
  324. package/lib/esm/components/CourseDashboard/Student.d.ts +11 -0
  325. package/lib/esm/components/CourseDashboard/Student.js +201 -0
  326. package/lib/esm/components/CourseDashboard/Teacher/Comments.d.ts +9 -0
  327. package/lib/esm/components/CourseDashboard/Teacher/Comments.js +106 -0
  328. package/lib/esm/components/CourseDashboard/Teacher/Info.d.ts +11 -0
  329. package/lib/esm/components/CourseDashboard/Teacher/Info.js +16 -0
  330. package/lib/esm/components/CourseDashboard/Teacher/Skeleton.d.ts +1 -0
  331. package/lib/esm/components/CourseDashboard/Teacher/Skeleton.js +21 -0
  332. package/lib/esm/components/CourseDashboard/Teacher/Students.d.ts +10 -0
  333. package/lib/esm/components/CourseDashboard/Teacher/Students.js +68 -0
  334. package/lib/esm/components/CourseDashboard/Teacher.d.ts +11 -0
  335. package/lib/esm/components/CourseDashboard/Teacher.js +60 -0
  336. package/lib/esm/components/CourseDashboard/constants.d.ts +1 -0
  337. package/lib/esm/components/CourseDashboard/constants.js +1 -0
  338. package/lib/esm/components/CourseDashboard/index.d.ts +11 -0
  339. package/lib/esm/components/CourseDashboard/index.js +6 -0
  340. package/lib/esm/components/CourseDashboard/types.d.ts +8 -0
  341. package/lib/esm/components/CourseDashboard/types.js +10 -0
  342. package/lib/esm/components/CourseForm/CourseForm.d.ts +74 -0
  343. package/lib/esm/components/CourseForm/CourseForm.js +270 -0
  344. package/lib/esm/components/CourseForm/Dialog.d.ts +8 -0
  345. package/lib/esm/components/CourseForm/Dialog.js +16 -0
  346. package/lib/esm/components/CourseForm/Edit.d.ts +24 -0
  347. package/lib/esm/components/CourseForm/Edit.js +50 -0
  348. package/lib/esm/components/CourseForm/Skeleton.d.ts +1 -0
  349. package/lib/esm/components/CourseForm/Skeleton.js +14 -0
  350. package/lib/esm/components/CourseForm/UploadCourseCover.d.ts +45 -0
  351. package/lib/esm/components/CourseForm/UploadCourseCover.js +91 -0
  352. package/lib/esm/components/CourseForm/constants.d.ts +1 -0
  353. package/lib/esm/components/CourseForm/constants.js +1 -0
  354. package/lib/esm/components/CourseForm/index.d.ts +4 -0
  355. package/lib/esm/components/CourseForm/index.js +4 -0
  356. package/lib/esm/components/CourseFormDialog/CourseFormDialog.d.ts +48 -0
  357. package/lib/esm/components/CourseFormDialog/CourseFormDialog.js +64 -0
  358. package/lib/esm/components/CourseFormDialog/constants.d.ts +1 -0
  359. package/lib/esm/components/CourseFormDialog/constants.js +1 -0
  360. package/lib/esm/components/CourseFormDialog/index.d.ts +3 -0
  361. package/lib/esm/components/CourseFormDialog/index.js +2 -0
  362. package/lib/esm/components/CourseJoinButton/CourseJoinButton.d.ts +56 -0
  363. package/lib/esm/components/CourseJoinButton/CourseJoinButton.js +145 -0
  364. package/lib/esm/components/CourseJoinButton/index.d.ts +3 -0
  365. package/lib/esm/components/CourseJoinButton/index.js +2 -0
  366. package/lib/esm/components/CourseParticipantsButton/CourseParticipantsButton.d.ts +53 -0
  367. package/lib/esm/components/CourseParticipantsButton/CourseParticipantsButton.js +147 -0
  368. package/lib/esm/components/CourseParticipantsButton/index.d.ts +3 -0
  369. package/lib/esm/components/CourseParticipantsButton/index.js +2 -0
  370. package/lib/esm/components/Courses/Courses.d.ts +100 -0
  371. package/lib/esm/components/Courses/Courses.js +233 -0
  372. package/lib/esm/components/Courses/Skeleton.d.ts +54 -0
  373. package/lib/esm/components/Courses/Skeleton.js +42 -0
  374. package/lib/esm/components/Courses/constants.d.ts +1 -0
  375. package/lib/esm/components/Courses/constants.js +1 -0
  376. package/lib/esm/components/Courses/index.d.ts +4 -0
  377. package/lib/esm/components/Courses/index.js +4 -0
  378. package/lib/esm/components/Courses/prefetchedCourses.d.ts +81 -0
  379. package/lib/esm/components/Courses/prefetchedCourses.js +183 -0
  380. package/lib/esm/components/CreateCourseButton/CreateCourseButton.d.ts +38 -0
  381. package/lib/esm/components/CreateCourseButton/CreateCourseButton.js +78 -0
  382. package/lib/esm/components/CreateCourseButton/index.d.ts +3 -0
  383. package/lib/esm/components/CreateCourseButton/index.js +2 -0
  384. package/lib/esm/components/EditCourse/Customize.d.ts +9 -0
  385. package/lib/esm/components/EditCourse/Customize.js +28 -0
  386. package/lib/esm/components/EditCourse/EditCourse.d.ts +13 -0
  387. package/lib/esm/components/EditCourse/EditCourse.js +107 -0
  388. package/lib/esm/components/EditCourse/Lessons/AddButton.d.ts +9 -0
  389. package/lib/esm/components/EditCourse/Lessons/AddButton.js +27 -0
  390. package/lib/esm/components/EditCourse/Lessons/ChangeLessonStatus.d.ts +13 -0
  391. package/lib/esm/components/EditCourse/Lessons/ChangeLessonStatus.js +89 -0
  392. package/lib/esm/components/EditCourse/Lessons/FieldName.d.ts +15 -0
  393. package/lib/esm/components/EditCourse/Lessons/FieldName.js +80 -0
  394. package/lib/esm/components/EditCourse/Lessons/LessonRow.d.ts +15 -0
  395. package/lib/esm/components/EditCourse/Lessons/LessonRow.js +65 -0
  396. package/lib/esm/components/EditCourse/Lessons/SectionRow.d.ts +14 -0
  397. package/lib/esm/components/EditCourse/Lessons/SectionRow.js +155 -0
  398. package/lib/esm/components/EditCourse/Lessons/Skeleton.d.ts +1 -0
  399. package/lib/esm/components/EditCourse/Lessons/Skeleton.js +17 -0
  400. package/lib/esm/components/EditCourse/Lessons.d.ts +11 -0
  401. package/lib/esm/components/EditCourse/Lessons.js +193 -0
  402. package/lib/esm/components/EditCourse/MenuRow.d.ts +9 -0
  403. package/lib/esm/components/EditCourse/MenuRow.js +22 -0
  404. package/lib/esm/components/EditCourse/Options/Skeleton.d.ts +1 -0
  405. package/lib/esm/components/EditCourse/Options/Skeleton.js +12 -0
  406. package/lib/esm/components/EditCourse/Options/SwitchForm.d.ts +11 -0
  407. package/lib/esm/components/EditCourse/Options/SwitchForm.js +18 -0
  408. package/lib/esm/components/EditCourse/Options.d.ts +9 -0
  409. package/lib/esm/components/EditCourse/Options.js +93 -0
  410. package/lib/esm/components/EditCourse/Requests.d.ts +12 -0
  411. package/lib/esm/components/EditCourse/Requests.js +94 -0
  412. package/lib/esm/components/EditCourse/Skeleton.d.ts +8 -0
  413. package/lib/esm/components/EditCourse/Skeleton.js +25 -0
  414. package/lib/esm/components/EditCourse/Status.d.ts +9 -0
  415. package/lib/esm/components/EditCourse/Status.js +29 -0
  416. package/lib/esm/components/EditCourse/Users/Skeleton.d.ts +1 -0
  417. package/lib/esm/components/EditCourse/Users/Skeleton.js +12 -0
  418. package/lib/esm/components/EditCourse/Users.d.ts +11 -0
  419. package/lib/esm/components/EditCourse/Users.js +137 -0
  420. package/lib/esm/components/EditCourse/constants.d.ts +1 -0
  421. package/lib/esm/components/EditCourse/constants.js +1 -0
  422. package/lib/esm/components/EditCourse/hooks.d.ts +3 -0
  423. package/lib/esm/components/EditCourse/hooks.js +17 -0
  424. package/lib/esm/components/EditCourse/index.d.ts +4 -0
  425. package/lib/esm/components/EditCourse/index.js +4 -0
  426. package/lib/esm/components/EditCourse/types.d.ts +29 -0
  427. package/lib/esm/components/EditCourse/types.js +16 -0
  428. package/lib/esm/components/Editor/Editor.d.ts +37 -0
  429. package/lib/esm/components/Editor/Editor.js +7 -4
  430. package/lib/esm/components/Editor/plugins/EmojiPlugin.d.ts +3 -1
  431. package/lib/esm/components/Editor/plugins/EmojiPlugin.js +4 -10
  432. package/lib/esm/components/Editor/plugins/MediaPlugin.d.ts +14 -0
  433. package/lib/esm/components/Editor/plugins/MediaPlugin.js +117 -0
  434. package/lib/esm/components/Editor/plugins/ToolbarPlugin.d.ts +5 -0
  435. package/lib/esm/components/Editor/plugins/ToolbarPlugin.js +3 -2
  436. package/lib/esm/components/Editor/plugins/index.d.ts +2 -1
  437. package/lib/esm/components/Editor/plugins/index.js +2 -1
  438. package/lib/esm/components/EventForm/EventForm.js +1 -1
  439. package/lib/esm/components/LessonAppbar/LessonAppbar.d.ts +42 -0
  440. package/lib/esm/components/LessonAppbar/LessonAppbar.js +31 -0
  441. package/lib/esm/components/LessonAppbar/constants.d.ts +1 -0
  442. package/lib/esm/components/LessonAppbar/constants.js +1 -0
  443. package/lib/esm/components/LessonAppbar/index.d.ts +3 -0
  444. package/lib/esm/components/LessonAppbar/index.js +2 -0
  445. package/lib/esm/components/LessonCommentObject/LessonCommentObject.d.ts +94 -0
  446. package/lib/esm/components/LessonCommentObject/LessonCommentObject.js +199 -0
  447. package/lib/esm/components/LessonCommentObject/Skeleton.d.ts +21 -0
  448. package/lib/esm/components/LessonCommentObject/Skeleton.js +43 -0
  449. package/lib/esm/components/LessonCommentObject/constants.d.ts +1 -0
  450. package/lib/esm/components/LessonCommentObject/constants.js +1 -0
  451. package/lib/esm/components/LessonCommentObject/index.d.ts +4 -0
  452. package/lib/esm/components/LessonCommentObject/index.js +4 -0
  453. package/lib/esm/components/LessonCommentObjects/LessonCommentObjects.d.ts +76 -0
  454. package/lib/esm/components/LessonCommentObjects/LessonCommentObjects.js +182 -0
  455. package/lib/esm/components/LessonCommentObjects/Skeleton.d.ts +23 -0
  456. package/lib/esm/components/LessonCommentObjects/Skeleton.js +37 -0
  457. package/lib/esm/components/LessonCommentObjects/constants.d.ts +1 -0
  458. package/lib/esm/components/LessonCommentObjects/constants.js +1 -0
  459. package/lib/esm/components/LessonCommentObjects/index.d.ts +4 -0
  460. package/lib/esm/components/LessonCommentObjects/index.js +4 -0
  461. package/lib/esm/components/LessonDrawer/LessonDrawer.d.ts +50 -0
  462. package/lib/esm/components/LessonDrawer/LessonDrawer.js +34 -0
  463. package/lib/esm/components/LessonDrawer/constants.d.ts +1 -0
  464. package/lib/esm/components/LessonDrawer/constants.js +1 -0
  465. package/lib/esm/components/LessonDrawer/index.d.ts +3 -0
  466. package/lib/esm/components/LessonDrawer/index.js +2 -0
  467. package/lib/esm/components/LessonEditForm/LessonEditForm.d.ts +24 -0
  468. package/lib/esm/components/LessonEditForm/LessonEditForm.js +42 -0
  469. package/lib/esm/components/LessonEditForm/constants.d.ts +1 -0
  470. package/lib/esm/components/LessonEditForm/constants.js +1 -0
  471. package/lib/esm/components/LessonEditForm/index.d.ts +3 -0
  472. package/lib/esm/components/LessonEditForm/index.js +2 -0
  473. package/lib/esm/components/LessonObject/LessonObject.d.ts +40 -0
  474. package/lib/esm/components/LessonObject/LessonObject.js +67 -0
  475. package/lib/esm/components/LessonObject/constants.d.ts +1 -0
  476. package/lib/esm/components/LessonObject/constants.js +1 -0
  477. package/lib/esm/components/LessonObject/index.d.ts +3 -0
  478. package/lib/esm/components/LessonObject/index.js +2 -0
  479. package/lib/esm/components/LessonReleaseMenu/LessonReleaseMenu.d.ts +26 -0
  480. package/lib/esm/components/LessonReleaseMenu/LessonReleaseMenu.js +169 -0
  481. package/lib/esm/components/LessonReleaseMenu/constants.d.ts +5 -0
  482. package/lib/esm/components/LessonReleaseMenu/constants.js +6 -0
  483. package/lib/esm/components/LessonReleaseMenu/index.d.ts +3 -0
  484. package/lib/esm/components/LessonReleaseMenu/index.js +2 -0
  485. package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerContent.js +9 -7
  486. package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +12 -1
  487. package/lib/esm/components/Notification/Course/Course.d.ts +15 -0
  488. package/lib/esm/components/Notification/Course/Course.js +86 -0
  489. package/lib/esm/components/Notification/Course/index.d.ts +3 -0
  490. package/lib/esm/components/Notification/Course/index.js +2 -0
  491. package/lib/esm/components/Notification/Course/utils.d.ts +5 -0
  492. package/lib/esm/components/Notification/Course/utils.js +39 -0
  493. package/lib/esm/components/Notification/Notification.js +9 -0
  494. package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +9 -0
  495. package/lib/esm/components/TagAutocomplete/TagAutocomplete.js +2 -2
  496. package/lib/esm/components/ToastNotifications/ToastNotifications.js +9 -0
  497. package/lib/esm/components/UserCreatedCoursesWidget/Skeleton.d.ts +21 -0
  498. package/lib/esm/components/UserCreatedCoursesWidget/Skeleton.js +39 -0
  499. package/lib/esm/components/UserCreatedCoursesWidget/UserCreatedCoursesWidget.d.ts +63 -0
  500. package/lib/esm/components/UserCreatedCoursesWidget/UserCreatedCoursesWidget.js +151 -0
  501. package/lib/esm/components/UserCreatedCoursesWidget/constants.d.ts +1 -0
  502. package/lib/esm/components/UserCreatedCoursesWidget/constants.js +1 -0
  503. package/lib/esm/components/UserCreatedCoursesWidget/index.d.ts +4 -0
  504. package/lib/esm/components/UserCreatedCoursesWidget/index.js +4 -0
  505. package/lib/esm/constants/Course.d.ts +6 -0
  506. package/lib/esm/constants/Course.js +7 -0
  507. package/lib/esm/constants/PubSub.d.ts +14 -0
  508. package/lib/esm/constants/PubSub.js +15 -0
  509. package/lib/esm/index.d.ts +23 -2
  510. package/lib/esm/index.js +26 -5
  511. package/lib/esm/shared/AccordionLessons/AccordionLessons.d.ts +8 -0
  512. package/lib/esm/shared/AccordionLessons/AccordionLessons.js +61 -0
  513. package/lib/esm/shared/AccordionLessons/Skeleton.d.ts +1 -0
  514. package/lib/esm/shared/AccordionLessons/Skeleton.js +18 -0
  515. package/lib/esm/shared/AccordionLessons/constants.d.ts +1 -0
  516. package/lib/esm/shared/AccordionLessons/constants.js +1 -0
  517. package/lib/esm/shared/AccordionLessons/index.d.ts +4 -0
  518. package/lib/esm/shared/AccordionLessons/index.js +4 -0
  519. package/lib/esm/shared/AddUsersButton/AddUsersButton.d.ts +29 -0
  520. package/lib/esm/shared/AddUsersButton/AddUsersButton.js +134 -0
  521. package/lib/esm/shared/AddUsersButton/index.d.ts +3 -0
  522. package/lib/esm/shared/AddUsersButton/index.js +2 -0
  523. package/lib/esm/shared/CourseTypePopover/CourseTypePopover.d.ts +9 -0
  524. package/lib/esm/shared/CourseTypePopover/CourseTypePopover.js +45 -0
  525. package/lib/esm/shared/CourseTypePopover/index.d.ts +3 -0
  526. package/lib/esm/shared/CourseTypePopover/index.js +2 -0
  527. package/lib/esm/shared/CourseUsersTable/ChangeUsersStatus.d.ts +9 -0
  528. package/lib/esm/shared/CourseUsersTable/ChangeUsersStatus.js +56 -0
  529. package/lib/esm/shared/CourseUsersTable/CourseUsersTable.d.ts +21 -0
  530. package/lib/esm/shared/CourseUsersTable/CourseUsersTable.js +152 -0
  531. package/lib/esm/shared/CourseUsersTable/RemoveButton.d.ts +10 -0
  532. package/lib/esm/shared/CourseUsersTable/RemoveButton.js +48 -0
  533. package/lib/esm/shared/CourseUsersTable/RequestButton.d.ts +10 -0
  534. package/lib/esm/shared/CourseUsersTable/RequestButton.js +76 -0
  535. package/lib/esm/shared/CourseUsersTable/RowSkeleton.d.ts +8 -0
  536. package/lib/esm/shared/CourseUsersTable/RowSkeleton.js +11 -0
  537. package/lib/esm/shared/CourseUsersTable/SeeProgressButton.d.ts +9 -0
  538. package/lib/esm/shared/CourseUsersTable/SeeProgressButton.js +53 -0
  539. package/lib/esm/shared/CourseUsersTable/Skeleton.d.ts +1 -0
  540. package/lib/esm/shared/CourseUsersTable/Skeleton.js +15 -0
  541. package/lib/esm/shared/CourseUsersTable/constants.d.ts +1 -0
  542. package/lib/esm/shared/CourseUsersTable/constants.js +1 -0
  543. package/lib/esm/shared/CourseUsersTable/index.d.ts +4 -0
  544. package/lib/esm/shared/CourseUsersTable/index.js +4 -0
  545. package/lib/esm/shared/DateTimeAgo/index.d.ts +1 -1
  546. package/lib/esm/shared/EmptyStatus/EmptyStatus.d.ts +11 -0
  547. package/lib/esm/shared/EmptyStatus/EmptyStatus.js +23 -0
  548. package/lib/esm/shared/EmptyStatus/index.d.ts +3 -0
  549. package/lib/esm/shared/EmptyStatus/index.js +2 -0
  550. package/lib/esm/shared/LessonCommentActionsMenu/index.d.ts +41 -0
  551. package/lib/esm/shared/LessonCommentActionsMenu/index.js +194 -0
  552. package/lib/esm/shared/LessonFilePreview/index.d.ts +12 -0
  553. package/lib/esm/shared/LessonFilePreview/index.js +25 -0
  554. package/lib/esm/shared/Media/Link/UrlTextField/index.js +3 -4
  555. package/lib/esm/types/course.d.ts +40 -0
  556. package/lib/esm/types/course.js +30 -0
  557. package/lib/esm/types/index.d.ts +2 -1
  558. package/lib/esm/types/index.js +2 -1
  559. package/lib/esm/utils/course.d.ts +14 -0
  560. package/lib/esm/utils/course.js +32 -0
  561. package/lib/umd/578.js +2 -0
  562. package/lib/umd/60a7fdeaadfe844bc015.woff2 +0 -0
  563. package/lib/umd/assets/icons.svg +9 -3
  564. package/lib/umd/{c3528e120c4e831db2ae.woff → b6dbec3d5816ff8baef1.woff} +0 -0
  565. package/lib/umd/{a221d3aba0f6753cfbb7.ttf → ba74e493633796d551d1.ttf} +0 -0
  566. package/lib/umd/{2aa155858f48b8f3911a.eot → c473ce30406a3dad83e1.eot} +0 -0
  567. package/lib/umd/react-ui.js +1 -1
  568. package/package.json +9 -8
  569. package/lib/umd/239.js +0 -2
  570. package/lib/umd/36f3af7f155d916c26ff.woff2 +0 -0
  571. /package/lib/umd/{239.js.LICENSE.txt → 578.js.LICENSE.txt} +0 -0
@@ -0,0 +1,94 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Stack, Typography } from '@mui/material';
3
+ import { FormattedMessage } from 'react-intl';
4
+ import { memo, useCallback, useEffect, useReducer, useRef } from 'react';
5
+ import { CacheStrategies, Logger } from '@selfcommunity/utils';
6
+ import { SCOPE_SC_UI } from '../../constants/Errors';
7
+ import Status from './Status';
8
+ import CourseUsersTable from '../../shared/CourseUsersTable';
9
+ import { DEFAULT_PAGINATION_OFFSET } from '../../constants/Pagination';
10
+ import { SCCache, useSCUser } from '@selfcommunity/react-core';
11
+ import { actionWidgetTypes, dataWidgetReducer, stateWidgetInitializer } from '../../utils/widget';
12
+ import { CourseService, Endpoints } from '@selfcommunity/api-services';
13
+ import { PREFIX } from './constants';
14
+ import PubSub from 'pubsub-js';
15
+ import { SCCourseEventType, SCTopicType } from '../../constants/PubSub';
16
+ import { SCCourseUsersTableModeType } from '../../types/course';
17
+ const classes = {
18
+ usersStatusWrapper: `${PREFIX}-users-status-wrapper`,
19
+ contrastColor: `${PREFIX}-contrast-color`
20
+ };
21
+ const headerCells = [
22
+ {
23
+ id: 'ui.editCourse.tab.users.table.header.name'
24
+ },
25
+ {
26
+ id: 'ui.editCourse.tab.users.table.header.registration'
27
+ },
28
+ {
29
+ id: 'ui.editCourse.tab.users.table.header.latestActivity'
30
+ },
31
+ {}
32
+ ];
33
+ function Requests(props) {
34
+ // PROPS
35
+ const { course, endpointQueryParams = {
36
+ limit: 6,
37
+ offset: DEFAULT_PAGINATION_OFFSET
38
+ }, handleTabChange } = props;
39
+ // STATES
40
+ const [state, dispatch] = useReducer(dataWidgetReducer, {
41
+ isLoadingPrevious: false,
42
+ isLoadingNext: false,
43
+ next: null,
44
+ cacheKey: SCCache.getWidgetStateCacheKey(SCCache.USERS_REQUESTS_COURSES_STATE_CACHE_PREFIX_KEY, course.id),
45
+ cacheStrategy: CacheStrategies.NETWORK_ONLY,
46
+ visibleItems: endpointQueryParams.limit
47
+ }, stateWidgetInitializer);
48
+ // CONTEXTS
49
+ const scUserContext = useSCUser();
50
+ // REFS
51
+ const updatedUsers = useRef(null);
52
+ // CALLBACKS
53
+ const _init = useCallback(() => {
54
+ if (!state.initialized && !state.isLoadingNext) {
55
+ dispatch({ type: actionWidgetTypes.LOADING_NEXT });
56
+ CourseService.getCourseWaitingApproval(course.id, Object.assign({}, endpointQueryParams))
57
+ .then((payload) => {
58
+ dispatch({ type: actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: Object.assign(Object.assign({}, payload), { initialized: true }) });
59
+ })
60
+ .catch((error) => {
61
+ dispatch({ type: actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
62
+ Logger.error(SCOPE_SC_UI, error);
63
+ });
64
+ }
65
+ }, [state.isLoadingNext, state.initialized, course, dispatch, endpointQueryParams]);
66
+ // HANDLERS
67
+ const handleRejectUser = useCallback((_msg, user) => {
68
+ dispatch({
69
+ type: actionWidgetTypes.SET_RESULTS,
70
+ payload: { count: state.results.length - 1, results: state.results.filter((result) => result.id !== user.id) }
71
+ });
72
+ }, [state.count, state.results, dispatch]);
73
+ // EFFECTS
74
+ useEffect(() => {
75
+ let _t;
76
+ if (scUserContext.user) {
77
+ _t = setTimeout(_init);
78
+ return () => {
79
+ clearTimeout(_t);
80
+ };
81
+ }
82
+ }, [scUserContext.user, _init]);
83
+ useEffect(() => {
84
+ updatedUsers.current = PubSub.subscribe(`${SCTopicType.COURSE}.${SCCourseEventType.REJECT_MEMBER}`, handleRejectUser);
85
+ return () => {
86
+ updatedUsers.current && PubSub.unsubscribe(updatedUsers.current);
87
+ };
88
+ }, [handleRejectUser]);
89
+ return (_jsxs(Box, { children: [_jsx(Typography, Object.assign({ variant: "h6", className: classes.contrastColor }, { children: _jsx(FormattedMessage, { id: "ui.editCourse.tab.requests.title", defaultMessage: "ui.editCourse.tab.requests.title", values: { requestsNumber: state.results.length } }) })), _jsx(Stack, Object.assign({ className: classes.usersStatusWrapper }, { children: _jsx(Status, { course: course, handleTabChange: handleTabChange }) })), _jsx(CourseUsersTable, { state: state, dispatch: dispatch, course: course, endpointSearch: {
90
+ url: () => Endpoints.GetCourseWaitingApproval.url({ id: course.id }),
91
+ method: Endpoints.GetCourseWaitingApproval.method
92
+ }, headerCells: headerCells, mode: SCCourseUsersTableModeType.REQUESTS, emptyStatusTitle: "ui.courseUsersTable.empty.requests.title" })] }));
93
+ }
94
+ export default memo(Requests);
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { SCCourseEditTabType } from '../../types';
3
+ interface EditCourseSkeletonProps {
4
+ tab?: SCCourseEditTabType;
5
+ }
6
+ declare function EditCourseSkeleton(props: EditCourseSkeletonProps): JSX.Element;
7
+ declare const _default: import("react").MemoExoticComponent<typeof EditCourseSkeleton>;
8
+ export default _default;
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { PREFIX } from './constants';
3
+ import { Box, Skeleton, Stack, styled } from '@mui/material';
4
+ import LessonsSkeleton from './Lessons/Skeleton';
5
+ import UsersSkeleton from './Users/Skeleton';
6
+ import CourseFormSkeleton from '../CourseForm/Skeleton';
7
+ import OptionsSkeleton from './Options/Skeleton';
8
+ import { SCCourseEditTabType } from '../../types';
9
+ import { memo } from 'react';
10
+ const classes = {
11
+ root: `${PREFIX}-skeleton-root`,
12
+ header: `${PREFIX}-header`,
13
+ tabList: `${PREFIX}-tab-list`
14
+ };
15
+ const Root = styled(Box, {
16
+ name: PREFIX,
17
+ slot: 'SkeletonRoot',
18
+ overridesResolver: (_props, styles) => styles.skeletonRoot
19
+ })(() => ({}));
20
+ function EditCourseSkeleton(props) {
21
+ // PROPS
22
+ const { tab } = props;
23
+ return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [_jsxs(Stack, Object.assign({ className: classes.header }, { children: [_jsx(Skeleton, { animation: "wave", variant: "rectangular", width: "14px", height: "14px" }), _jsx(Skeleton, { animation: "wave", variant: "text", width: "125px", height: "21px" })] })), _jsx(Stack, Object.assign({ className: classes.tabList }, { children: Array.from(new Array(5)).map((_, i) => (_jsx(Skeleton, { animation: "wave", variant: "text", width: "80px", height: "21px" }, i))) })), tab === SCCourseEditTabType.LESSONS && _jsx(LessonsSkeleton, {}), tab === SCCourseEditTabType.CUSTOMIZE && _jsx(CourseFormSkeleton, {}), tab === SCCourseEditTabType.USERS && _jsx(UsersSkeleton, {}), tab === SCCourseEditTabType.REQUESTS && _jsx(UsersSkeleton, {}), tab === SCCourseEditTabType.OPTIONS && _jsx(OptionsSkeleton, {})] })));
24
+ }
25
+ export default memo(EditCourseSkeleton);
@@ -0,0 +1,9 @@
1
+ import { SCCourseType } from '@selfcommunity/types';
2
+ import { SyntheticEvent } from 'react';
3
+ import { SCCourseEditTabType } from '../../types';
4
+ interface StatusProps {
5
+ course: SCCourseType;
6
+ handleTabChange: (_e: SyntheticEvent, newTabValue: SCCourseEditTabType) => void;
7
+ }
8
+ export default function Status(props: StatusProps): JSX.Element;
9
+ export {};
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Button, Chip, Typography } from '@mui/material';
3
+ import { useIntl } from 'react-intl';
4
+ import { PREFIX } from './constants';
5
+ import { SCCoursePrivacyType } from '@selfcommunity/types';
6
+ import classNames from 'classnames';
7
+ import { useCallback } from 'react';
8
+ import { SCCourseEditTabType } from '../../types';
9
+ const classes = {
10
+ status: `${PREFIX}-status`,
11
+ contrastColor: `${PREFIX}-contrast-color`
12
+ };
13
+ export default function Status(props) {
14
+ // STATES
15
+ const { course, handleTabChange } = props;
16
+ // HOOKS
17
+ const intl = useIntl();
18
+ // HANDLERS
19
+ const handleClick = useCallback(() => {
20
+ handleTabChange(null, SCCourseEditTabType.CUSTOMIZE);
21
+ }, [handleTabChange]);
22
+ return (_jsx(Chip, { label: _jsx(Button, Object.assign({ size: "small", variant: "text", color: "inherit", onClick: handleClick }, { children: _jsx(Typography, Object.assign({ variant: "body1" }, { children: intl.formatMessage({ id: 'ui.editCourse.tab.lessons.status', defaultMessage: 'ui.editCourse.tab.lessons.status' }, {
23
+ status: intl.formatMessage({
24
+ id: `ui.course.privacy.${course.privacy === SCCoursePrivacyType.DRAFT ? 'draft' : course.privacy}`,
25
+ defaultMessage: `ui.course.privacy.${course.privacy === SCCoursePrivacyType.DRAFT ? 'draft' : course.privacy}`
26
+ }),
27
+ b: (chunks) => (_jsx(Typography, Object.assign({ component: "b", fontWeight: "bold" }, { children: chunks })))
28
+ }) })) })), className: classNames(classes.status, classes.contrastColor) }));
29
+ }
@@ -0,0 +1 @@
1
+ export default function UsersSkeleton(): JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Skeleton, Stack } from '@mui/material';
3
+ import { PREFIX } from '../constants';
4
+ import { CourseUsersTableSkeleton } from '../../../shared/CourseUsersTable';
5
+ import { Fragment } from 'react';
6
+ const classes = {
7
+ root: `${PREFIX}-skeleton-root`,
8
+ usersStatusWrapper: `${PREFIX}-users-status-wrapper`
9
+ };
10
+ export default function UsersSkeleton() {
11
+ return (_jsxs(Fragment, { children: [_jsx(Skeleton, { animation: "wave", variant: "text", width: "136px", height: "22px" }), _jsxs(Stack, Object.assign({ className: classes.usersStatusWrapper }, { children: [_jsx(Skeleton, { animation: "wave", variant: "rectangular", width: "122px", height: "32px" }), _jsx(Skeleton, { animation: "wave", variant: "rounded", width: "154px", height: "29px" })] })), _jsx(CourseUsersTableSkeleton, {})] }));
12
+ }
@@ -0,0 +1,11 @@
1
+ import { SyntheticEvent } from 'react';
2
+ import { SCCourseType } from '@selfcommunity/types';
3
+ import { SCCourseEditTabType } from '../../types/course';
4
+ interface UsersProps {
5
+ course: SCCourseType;
6
+ endpointQueryParams?: Record<string, string | number>;
7
+ handleTabChange: (_e: SyntheticEvent, newTabValue: SCCourseEditTabType) => void;
8
+ }
9
+ declare function Users(props: UsersProps): JSX.Element;
10
+ declare const _default: import("react").MemoExoticComponent<typeof Users>;
11
+ export default _default;
@@ -0,0 +1,137 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Box, Stack, Typography } from '@mui/material';
3
+ import { FormattedMessage } from 'react-intl';
4
+ import AddUsersButton from '../../shared/AddUsersButton';
5
+ import { memo, useCallback, useEffect, useReducer, useRef } from 'react';
6
+ import { SCCourseJoinStatusType } from '@selfcommunity/types';
7
+ import { CacheStrategies, Logger } from '@selfcommunity/utils';
8
+ import { SCOPE_SC_UI } from '../../constants/Errors';
9
+ import { useSnackbar } from 'notistack';
10
+ import Status from './Status';
11
+ import { PREFIX } from './constants';
12
+ import CourseUsersTable from '../../shared/CourseUsersTable';
13
+ import { DEFAULT_PAGINATION_OFFSET } from '../../constants/Pagination';
14
+ import { SCCache, useSCUser } from '@selfcommunity/react-core';
15
+ import { actionWidgetTypes, dataWidgetReducer, stateWidgetInitializer } from '../../utils/widget';
16
+ import { CourseService, Endpoints } from '@selfcommunity/api-services';
17
+ import PubSub from 'pubsub-js';
18
+ import { SCCourseEventType, SCTopicType } from '../../constants/PubSub';
19
+ import { SCCourseUsersTableModeType } from '../../types/course';
20
+ const classes = {
21
+ usersStatusWrapper: `${PREFIX}-users-status-wrapper`,
22
+ contrastColor: `${PREFIX}-contrast-color`
23
+ };
24
+ const headerCells = [
25
+ {
26
+ id: 'ui.editCourse.tab.users.table.header.name'
27
+ },
28
+ {
29
+ id: 'ui.editCourse.tab.users.table.header.role'
30
+ },
31
+ {
32
+ id: 'ui.editCourse.tab.users.table.header.registration'
33
+ },
34
+ {
35
+ id: 'ui.editCourse.tab.users.table.header.latestActivity'
36
+ },
37
+ {}
38
+ ];
39
+ function Users(props) {
40
+ // PROPS
41
+ const { course, endpointQueryParams = {
42
+ limit: 6,
43
+ offset: DEFAULT_PAGINATION_OFFSET,
44
+ statuses: JSON.stringify([SCCourseJoinStatusType.JOINED, SCCourseJoinStatusType.MANAGER, SCCourseJoinStatusType.CREATOR])
45
+ }, handleTabChange } = props;
46
+ // STATES
47
+ const [state, dispatch] = useReducer(dataWidgetReducer, {
48
+ isLoadingNext: false,
49
+ next: null,
50
+ cacheKey: SCCache.getWidgetStateCacheKey(SCCache.USERS_PARTECIPANTS_COURSES_STATE_CACHE_PREFIX_KEY, course.id),
51
+ cacheStrategy: CacheStrategies.NETWORK_ONLY,
52
+ visibleItems: endpointQueryParams.limit
53
+ }, stateWidgetInitializer);
54
+ // CONTEXTS
55
+ const scUserContext = useSCUser();
56
+ // HOOKS
57
+ const { enqueueSnackbar } = useSnackbar();
58
+ // REFS
59
+ const updatedUsers = useRef(null);
60
+ const removedUsers = useRef(null);
61
+ // CALLBACKS
62
+ const _init = useCallback(() => {
63
+ if (!state.initialized && !state.isLoadingNext) {
64
+ dispatch({ type: actionWidgetTypes.LOADING_NEXT });
65
+ CourseService.getCourseDashboardUsers(course.id, Object.assign({}, endpointQueryParams))
66
+ .then((payload) => {
67
+ dispatch({ type: actionWidgetTypes.LOAD_NEXT_SUCCESS, payload: Object.assign(Object.assign({}, payload), { initialized: true }) });
68
+ })
69
+ .catch((error) => {
70
+ dispatch({ type: actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
71
+ Logger.error(SCOPE_SC_UI, error);
72
+ });
73
+ }
74
+ }, [state.isLoadingNext, state.initialized, course, dispatch, endpointQueryParams]);
75
+ // HANDLERS
76
+ const handleAddUser = useCallback((_msg, user) => {
77
+ dispatch({ type: actionWidgetTypes.LOAD_PREVIOUS_SUCCESS, payload: { count: state.count + 1, results: [user], initialized: true } });
78
+ }, [state.count, dispatch]);
79
+ const handleRemoveUser = useCallback((_msg, user) => {
80
+ dispatch({
81
+ type: actionWidgetTypes.SET_RESULTS,
82
+ payload: { count: state.count - 1, results: state.results.filter((result) => result.id !== user.id), initialized: true }
83
+ });
84
+ }, [state.count, state.results, dispatch]);
85
+ // EFFECTS
86
+ useEffect(() => {
87
+ let _t;
88
+ if (scUserContext.user) {
89
+ _t = setTimeout(_init);
90
+ return () => {
91
+ clearTimeout(_t);
92
+ };
93
+ }
94
+ }, [scUserContext.user, _init]);
95
+ useEffect(() => {
96
+ updatedUsers.current = PubSub.subscribe(`${SCTopicType.COURSE}.${SCCourseEventType.ADD_MEMBER}`, handleAddUser);
97
+ removedUsers.current = PubSub.subscribe(`${SCTopicType.COURSE}.${SCCourseEventType.REMOVE_MEMBER}`, handleRemoveUser);
98
+ return () => {
99
+ updatedUsers.current && PubSub.unsubscribe(updatedUsers.current);
100
+ removedUsers.current && PubSub.unsubscribe(removedUsers.current);
101
+ };
102
+ }, [handleAddUser, handleRemoveUser]);
103
+ const handleConfirm = useCallback((newUsers) => {
104
+ const data = {
105
+ joined: newUsers.map((user) => user.id)
106
+ };
107
+ CourseService.changeCourseUserRole(course.id, data)
108
+ .then(() => {
109
+ dispatch({
110
+ type: actionWidgetTypes.LOAD_PREVIOUS_SUCCESS,
111
+ payload: { count: state.count + newUsers.length, results: newUsers, initialized: true }
112
+ });
113
+ enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.editCourse.tab.users.table.snackbar.success", defaultMessage: "ui.editCourse.tab.users.table.snackbar.success" }), {
114
+ variant: 'success',
115
+ autoHideDuration: 3000
116
+ });
117
+ })
118
+ .catch((error) => {
119
+ dispatch({ type: actionWidgetTypes.LOAD_NEXT_FAILURE, payload: { errorLoadNext: error } });
120
+ Logger.error(SCOPE_SC_UI, error);
121
+ enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
122
+ variant: 'error',
123
+ autoHideDuration: 3000
124
+ });
125
+ });
126
+ }, [course, dispatch]);
127
+ return (_jsxs(Box, { children: [_jsx(Typography, Object.assign({ variant: "h6", className: classes.contrastColor }, { children: _jsx(FormattedMessage, { id: "ui.editCourse.tab.users.title", defaultMessage: "ui.editCourse.tab.users.title", values: { usersNumber: state.count } }) })), _jsxs(Stack, Object.assign({ className: classes.usersStatusWrapper }, { children: [_jsx(Status, { course: course, handleTabChange: handleTabChange }), _jsx(AddUsersButton, { label: "ui.editCourse.tab.users.addUsersButton.label", endpoint: {
128
+ url: () => Endpoints.GetCourseSuggestedUsers.url({ id: course.id }),
129
+ method: Endpoints.GetCourseSuggestedUsers.method
130
+ }, onConfirm: handleConfirm })] })), _jsx(CourseUsersTable, { state: state, dispatch: dispatch, course: course, endpointSearch: {
131
+ url: () => Endpoints.GetCourseDashboardUsers.url({ id: course.id }),
132
+ method: Endpoints.GetCourseDashboardUsers.method
133
+ }, endpointQueryParamsSearch: {
134
+ statuses: JSON.stringify([SCCourseJoinStatusType.JOINED, SCCourseJoinStatusType.MANAGER, SCCourseJoinStatusType.CREATOR])
135
+ }, headerCells: headerCells, mode: SCCourseUsersTableModeType.EDIT, emptyStatusTitle: "ui.courseUsersTable.empty.users.title", emptyStatusDescription: "ui.courseUsersTable.empty.users.description" })] }));
136
+ }
137
+ export default memo(Users);
@@ -0,0 +1 @@
1
+ export declare const PREFIX = "SCEditCourse";
@@ -0,0 +1 @@
1
+ export const PREFIX = 'SCEditCourse';
@@ -0,0 +1,3 @@
1
+ export declare const useIsDisabled: () => {
2
+ isDisabled: boolean;
3
+ };
@@ -0,0 +1,17 @@
1
+ import { useEffect, useRef, useState } from 'react';
2
+ import PubSub from 'pubsub-js';
3
+ import { SCGroupEventType, SCTopicType } from '../../constants/PubSub';
4
+ export const useIsDisabled = () => {
5
+ // STATES
6
+ const [isDisabled, setIsDisabled] = useState(false);
7
+ // REFS
8
+ const updateDragStatus = useRef(null);
9
+ // EFFECTS
10
+ useEffect(() => {
11
+ updateDragStatus.current = PubSub.subscribe(`${SCTopicType.COURSE}.${SCGroupEventType.UPDATE}`, (_msg, data) => setIsDisabled(data));
12
+ return () => {
13
+ updateDragStatus.current && PubSub.unsubscribe(updateDragStatus.current);
14
+ };
15
+ }, [setIsDisabled]);
16
+ return { isDisabled };
17
+ };
@@ -0,0 +1,4 @@
1
+ import EditCourse, { EditCourseProps } from './EditCourse';
2
+ import EditCourseSkeleton from './Skeleton';
3
+ export default EditCourse;
4
+ export { EditCourseProps, EditCourseSkeleton };
@@ -0,0 +1,4 @@
1
+ import EditCourse from './EditCourse';
2
+ import EditCourseSkeleton from './Skeleton';
3
+ export default EditCourse;
4
+ export { EditCourseSkeleton };
@@ -0,0 +1,29 @@
1
+ import { SCCourseLessonType, SCCourseSectionType } from '@selfcommunity/types';
2
+ export declare enum ActionLessonType {
3
+ ADD = "add",
4
+ RENAME = "rename",
5
+ DELETE = "delete",
6
+ UPDATE = "update",
7
+ ADD_UPDATE = "add_update",
8
+ RENAME_UPDATE = "rename_update",
9
+ DELETE_UPDATE = "delete_update",
10
+ UPDATE_UPDATE = "update_update"
11
+ }
12
+ export interface OptionsData {
13
+ enforce_lessons_order: boolean;
14
+ new_comment_notification_enabled: boolean;
15
+ hide_member_count: boolean;
16
+ }
17
+ export declare enum RowType {
18
+ SECTION = "section",
19
+ LESSON = "lesson"
20
+ }
21
+ export interface DeleteRowProps {
22
+ row: RowType;
23
+ section: SCCourseSectionType;
24
+ lesson?: SCCourseLessonType;
25
+ }
26
+ export interface DeleteRowRef {
27
+ handleDeleteSection?: (section: SCCourseSectionType) => void;
28
+ handleDeleteLesson: (section: SCCourseSectionType, lesson: SCCourseLessonType) => void;
29
+ }
@@ -0,0 +1,16 @@
1
+ export var ActionLessonType;
2
+ (function (ActionLessonType) {
3
+ ActionLessonType["ADD"] = "add";
4
+ ActionLessonType["RENAME"] = "rename";
5
+ ActionLessonType["DELETE"] = "delete";
6
+ ActionLessonType["UPDATE"] = "update";
7
+ ActionLessonType["ADD_UPDATE"] = "add_update";
8
+ ActionLessonType["RENAME_UPDATE"] = "rename_update";
9
+ ActionLessonType["DELETE_UPDATE"] = "delete_update";
10
+ ActionLessonType["UPDATE_UPDATE"] = "update_update";
11
+ })(ActionLessonType || (ActionLessonType = {}));
12
+ export var RowType;
13
+ (function (RowType) {
14
+ RowType["SECTION"] = "section";
15
+ RowType["LESSON"] = "lesson";
16
+ })(RowType || (RowType = {}));
@@ -1,4 +1,7 @@
1
1
  import React from 'react';
2
+ import { ToolbarPluginProps } from './plugins/ToolbarPlugin';
3
+ import { MediaPluginProps } from './plugins';
4
+ import { SCMediaType } from '@selfcommunity/types';
2
5
  export type EditorRef = {
3
6
  focus: () => void;
4
7
  };
@@ -33,11 +36,31 @@ export interface EditorProps {
33
36
  * @default false
34
37
  */
35
38
  uploadImage?: boolean;
39
+ /**
40
+ * This editor can upload files
41
+ * @default false
42
+ */
43
+ uploadFile?: boolean;
36
44
  /**
37
45
  * Handler for change event of the editor
38
46
  * @default null
39
47
  * */
40
48
  onChange?: (value: string) => void;
49
+ /**
50
+ * Handler for change media in the editor
51
+ * @default null
52
+ * */
53
+ onMediaChange?: (media: SCMediaType) => void;
54
+ /**
55
+ * Props to spread to ToolBar.
56
+ * @default {}
57
+ */
58
+ ToolBarProps?: ToolbarPluginProps;
59
+ /**
60
+ * Props to spread to MediaPlugin.
61
+ * @default {}
62
+ */
63
+ MediaPluginProps?: MediaPluginProps;
41
64
  /**
42
65
  * Handler for blur event of the editor
43
66
  * @default null
@@ -48,6 +71,20 @@ export interface EditorProps {
48
71
  * @default null
49
72
  * */
50
73
  onFocus?: (event: FocusEvent) => void;
74
+ /**
75
+ * Action to add to actions
76
+ */
77
+ action?: React.ReactNode | null;
78
+ /**
79
+ * The text displayed when the editor is empty
80
+ * @default <FormattedMessage id="ui.editor.placeholder" defaultMessage="ui.editor.placeholder" />
81
+ */
82
+ placeholder?: React.ReactNode;
83
+ /**
84
+ * Prop to customize emoji plugin position
85
+ * @default false
86
+ */
87
+ isLessonCommentEditor?: boolean;
51
88
  }
52
89
  declare const _default: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<EditorRef>>;
53
90
  export default _default;
@@ -12,10 +12,10 @@ import ToolbarPlugin from './plugins/ToolbarPlugin';
12
12
  import { PREFIX } from './constants';
13
13
  import { HorizontalRulePlugin } from './plugins/HorizontalRulePlugin';
14
14
  import { RichTextPlugin } from './plugins/LexicalRichTextPlugin';
15
- import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary';
16
- import { AutoLinkPlugin, DefaultHtmlValuePlugin, EmojiPlugin, ImagePlugin, MentionsPlugin, OnChangePlugin } from './plugins';
15
+ import { AutoLinkPlugin, DefaultHtmlValuePlugin, EmojiPlugin, ImagePlugin, MentionsPlugin, OnChangePlugin, MediaPlugin } from './plugins';
17
16
  import OnBlurPlugin from './plugins/OnBlurPlugin';
18
17
  import OnFocusPlugin from './plugins/OnFocusPlugin';
18
+ import { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary';
19
19
  import { LinkPlugin } from '@lexical/react/LexicalLinkPlugin';
20
20
  import FloatingLinkPlugin from './plugins/FloatingLinkPlugin';
21
21
  import ApiPlugin from './plugins/ApiPlugin';
@@ -104,7 +104,7 @@ const Editor = (inProps, ref) => {
104
104
  props: inProps,
105
105
  name: PREFIX
106
106
  });
107
- const { id = 'editor', className = null, defaultValue = '', toolbar = false, uploadImage = false, editable = true, onChange = null, onFocus = null, onBlur = null } = props;
107
+ const { id = 'editor', className = null, defaultValue = '', toolbar = false, uploadImage = false, uploadFile = false, editable = true, onChange = null, onMediaChange = null, onFocus = null, onBlur = null, action = null, ToolBarProps = {}, MediaPluginProps = {}, placeholder = _jsx(FormattedMessage, { id: "ui.editor.placeholder", defaultMessage: "ui.editor.placeholder" }), isLessonCommentEditor = false } = props;
108
108
  const apiRef = useRef();
109
109
  // STATE
110
110
  const [focused, setFocused] = useState(false);
@@ -112,6 +112,9 @@ const Editor = (inProps, ref) => {
112
112
  const handleChange = (value) => {
113
113
  onChange && onChange(value);
114
114
  };
115
+ const handleMediaChange = (media) => {
116
+ onMediaChange && onMediaChange(media);
117
+ };
115
118
  const handleError = (error, editor) => {
116
119
  console.log(error);
117
120
  };
@@ -142,6 +145,6 @@ const Editor = (inProps, ref) => {
142
145
  nodes: [...nodes],
143
146
  theme: editorTheme
144
147
  }), [editable]);
145
- return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className, { [classes.toolbar]: toolbar, [classes.focused]: focused }) }, { children: _jsxs(LexicalComposer, Object.assign({ initialConfig: initialConfig }, { children: [toolbar ? (_jsxs(_Fragment, { children: [_jsx(ToolbarPlugin, { uploadImage: uploadImage }), _jsx(ListPlugin, {}), _jsx(HorizontalRulePlugin, {})] })) : (_jsxs(Stack, Object.assign({ className: classes.actions, direction: "row" }, { children: [uploadImage && _jsx(ImagePlugin, {}), _jsx(EmojiPlugin, {})] }))), _jsx(RichTextPlugin, { contentEditable: _jsx(ContentEditable, { className: classes.content }), placeholder: _jsx(Box, Object.assign({ className: classes.placeholder, onClick: handleFocus }, { children: _jsx(FormattedMessage, { id: "ui.editor.placeholder", defaultMessage: "ui.editor.placeholder" }) })), ErrorBoundary: LexicalErrorBoundary }), _jsx(DefaultHtmlValuePlugin, { defaultValue: defaultValue }), _jsx(HistoryPlugin, {}), _jsx(OnChangePlugin, { onChange: handleChange }), _jsx(OnBlurPlugin, { onBlur: handleHasBlur }), _jsx(OnFocusPlugin, { onFocus: handleHasFocus }), _jsx(AutoLinkPlugin, {}), _jsx(MentionsPlugin, {}), _jsx(LinkPlugin, {}), _jsx(FloatingLinkPlugin, {}), _jsx(ApiPlugin, { ref: apiRef })] })) })));
148
+ return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className, { [classes.toolbar]: toolbar, [classes.focused]: focused }) }, { children: _jsxs(LexicalComposer, Object.assign({ initialConfig: initialConfig }, { children: [toolbar ? (_jsxs(_Fragment, { children: [_jsx(ToolbarPlugin, Object.assign({ uploadImage: uploadImage, uploadFile: uploadFile, MediaPluginProps: { onMediaAdd: handleMediaChange } }, ToolBarProps)), _jsx(ListPlugin, {}), _jsx(HorizontalRulePlugin, {})] })) : (_jsxs(Stack, Object.assign({ className: classes.actions, direction: "row" }, { children: [uploadImage && _jsx(ImagePlugin, {}), _jsx(EmojiPlugin, { isLessonCommentEditor: isLessonCommentEditor }), uploadFile && _jsx(MediaPlugin, Object.assign({}, MediaPluginProps)), action && action] }))), _jsx(RichTextPlugin, { contentEditable: _jsx(ContentEditable, { className: classes.content }), placeholder: _jsx(Box, Object.assign({ className: classes.placeholder, onClick: handleFocus }, { children: placeholder })), ErrorBoundary: LexicalErrorBoundary }), _jsx(DefaultHtmlValuePlugin, { defaultValue: defaultValue }), _jsx(HistoryPlugin, {}), _jsx(OnChangePlugin, { onChange: handleChange }), _jsx(OnBlurPlugin, { onBlur: handleHasBlur }), _jsx(OnFocusPlugin, { onFocus: handleHasFocus }), _jsx(AutoLinkPlugin, {}), _jsx(MentionsPlugin, {}), _jsx(LinkPlugin, {}), _jsx(FloatingLinkPlugin, {}), _jsx(ApiPlugin, { ref: apiRef })] })) })));
146
149
  };
147
150
  export default forwardRef(Editor);
@@ -1 +1,3 @@
1
- export default function EmojiPlugin(): JSX.Element;
1
+ export default function EmojiPlugin({ isLessonCommentEditor }: {
2
+ isLessonCommentEditor?: boolean;
3
+ }): JSX.Element;
@@ -6,7 +6,7 @@ import { Fade, Icon, IconButton, Popover, useMediaQuery, useTheme } from '@mui/m
6
6
  import { styled } from '@mui/material/styles';
7
7
  import EmojiPicker from '../../../shared/EmojiPicker';
8
8
  import { PREFIX } from '../constants';
9
- function Emoji({ editor, className = '' }) {
9
+ function Emoji({ editor, className = '', isLessonCommentEditor = false }) {
10
10
  // STATE
11
11
  const theme = useTheme();
12
12
  const isMobile = useMediaQuery(theme.breakpoints.down('md'));
@@ -22,13 +22,7 @@ function Emoji({ editor, className = '' }) {
22
22
  if (isMobile) {
23
23
  return null;
24
24
  }
25
- return (_jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ className: className, onClick: handleOpen }, { children: _jsx(Icon, { children: "sentiment_satisfied_alt" }) })), _jsx(Popover, Object.assign({ open: Boolean(emojiAnchorEl), anchorEl: emojiAnchorEl, onClose: () => setEmojiAnchorEl(null), TransitionComponent: Fade, anchorOrigin: {
26
- vertical: 'top',
27
- horizontal: 'right'
28
- }, transformOrigin: {
29
- vertical: 'bottom',
30
- horizontal: 'left'
31
- }, sx: (theme) => {
25
+ return (_jsxs(_Fragment, { children: [_jsx(IconButton, Object.assign({ className: className, onClick: handleOpen }, { children: _jsx(Icon, { children: "sentiment_satisfied_alt" }) })), _jsx(Popover, Object.assign({ open: Boolean(emojiAnchorEl), anchorEl: emojiAnchorEl, onClose: () => setEmojiAnchorEl(null), TransitionComponent: Fade, anchorOrigin: isLessonCommentEditor ? { vertical: 'bottom', horizontal: 'left' } : { vertical: 'top', horizontal: 'right' }, transformOrigin: isLessonCommentEditor ? { vertical: 'top', horizontal: 'right' } : { vertical: 'bottom', horizontal: 'left' }, sx: (theme) => {
32
26
  return { zIndex: theme.zIndex.tooltip };
33
27
  } }, { children: _jsx(EmojiPicker, { onEmojiClick: handleEmojiClick }) }))] }));
34
28
  }
@@ -39,7 +33,7 @@ const Root = styled(Emoji, {
39
33
  name: PREFIX,
40
34
  slot: 'EmojiPluginRoot'
41
35
  })(() => ({}));
42
- export default function EmojiPlugin() {
36
+ export default function EmojiPlugin({ isLessonCommentEditor = false }) {
43
37
  const [editor] = useLexicalComposerContext();
44
- return _jsx(Root, { editor: editor, className: classes.root });
38
+ return _jsx(Root, { editor: editor, className: classes.root, isLessonCommentEditor: isLessonCommentEditor });
45
39
  }
@@ -0,0 +1,14 @@
1
+ import { LexicalCommand } from 'lexical';
2
+ import { SCMediaType } from '@selfcommunity/types';
3
+ export interface InsertDocPayload {
4
+ src: string;
5
+ name: string;
6
+ type: string;
7
+ }
8
+ export declare const INSERT_DOC_COMMAND: LexicalCommand<InsertDocPayload>;
9
+ export interface MediaPluginProps {
10
+ className?: string;
11
+ onMediaAdd?: (media: SCMediaType) => void | null;
12
+ isUploading?: (boolean: any) => void;
13
+ }
14
+ export default function MediaPlugin(props: MediaPluginProps): JSX.Element;