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

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,155 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { DragDropContext, Draggable, Droppable } from '@hello-pangea/dnd';
3
+ import { forwardRef, Fragment, memo, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
4
+ import { Collapse, Icon, IconButton, MenuItem, Stack, Table, TableBody, TableCell, TableRow, Typography } from '@mui/material';
5
+ import classNames from 'classnames';
6
+ import { PREFIX } from '../constants';
7
+ import LessonRow from './LessonRow';
8
+ import AddButton from './AddButton';
9
+ import MenuRow from '../MenuRow';
10
+ import { FormattedMessage, useIntl } from 'react-intl';
11
+ import FieldName from './FieldName';
12
+ import { Logger } from '@selfcommunity/utils';
13
+ import { SCOPE_SC_UI } from '../../../constants/Errors';
14
+ import { useSnackbar } from 'notistack';
15
+ import LessonReleaseMenu from '../../LessonReleaseMenu';
16
+ import { SCCourseLessonTypologyType, SCCourseTypologyType } from '@selfcommunity/types';
17
+ import { CourseService, Endpoints } from '@selfcommunity/api-services';
18
+ import { ActionLessonType, RowType } from '../types';
19
+ import { useIsDisabled } from '../hooks';
20
+ const classes = {
21
+ tableBodyIconWrapper: `${PREFIX}-table-body-icon-wrapper`,
22
+ tableBodyAccordion: `${PREFIX}-table-body-accordion`,
23
+ actionsWrapper: `${PREFIX}-actions-wrapper`,
24
+ tableBodyCollapseWrapper: `${PREFIX}-table-body-collapse-wrapper`,
25
+ cellWidth: `${PREFIX}-cell-width`,
26
+ cellAlignRight: `${PREFIX}-cell-align-right`,
27
+ cellAlignCenter: `${PREFIX}-cell-align-center`,
28
+ cellPadding: `${PREFIX}-cell-padding`
29
+ };
30
+ function SectionRow(props, ref) {
31
+ // PROPS
32
+ const { course, provider, section, isNewRow, handleManageSection, handleOpenDialog } = props;
33
+ // STATES
34
+ const [expand, setExpand] = useState(true);
35
+ const [editMode, setEditMode] = useState(false);
36
+ const [lessons, setLessons] = useState([]);
37
+ // REFS
38
+ const innerRef = useRef(null);
39
+ // HOOKS
40
+ const { isDisabled } = useIsDisabled();
41
+ const intl = useIntl();
42
+ const { enqueueSnackbar } = useSnackbar();
43
+ // EFFECTS
44
+ useEffect(() => {
45
+ if (section.lessons) {
46
+ setLessons(section.lessons);
47
+ }
48
+ }, [section]);
49
+ // MEMOS
50
+ const isNewLocalRow = useMemo(() => { var _a; return lessons.length > ((_a = section.lessons) === null || _a === void 0 ? void 0 : _a.length); }, [lessons, section]);
51
+ // FUNCTIONS
52
+ const getLesson = useCallback((id, type = SCCourseLessonTypologyType.LESSON) => {
53
+ return {
54
+ id,
55
+ type,
56
+ name: intl.formatMessage({ id: 'ui.editCourse.tab.lessons.table.newLesson', defaultMessage: 'ui.editCourse.tab.lessons.table.newLesson' }, { num: id })
57
+ };
58
+ }, []);
59
+ const handleExpandAccordion = useCallback(() => setExpand((prev) => !prev), [setExpand]);
60
+ const handleDragEnd = useCallback((e) => {
61
+ if (!e.destination || e.destination.index === e.source.index) {
62
+ return;
63
+ }
64
+ const tempLessons = Array.from(section.lessons);
65
+ const [sourceData] = tempLessons.splice(e.source.index, 1);
66
+ tempLessons.splice(e.destination.index, 0, sourceData);
67
+ const tempSection = Object.assign(Object.assign({}, section), { lessons: tempLessons });
68
+ const data = {
69
+ lessons_order: tempLessons.map((tempLesson) => tempLesson.id)
70
+ };
71
+ CourseService.patchCourseSection(course.id, section.id, data)
72
+ .then(() => {
73
+ handleManageSection(tempSection, ActionLessonType.UPDATE);
74
+ enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.editCourse.tab.lessons.table.snackbar.save", defaultMessage: "ui.editCourse.tab.lessons.table.snackbar.save" }), {
75
+ variant: 'success',
76
+ autoHideDuration: 3000
77
+ });
78
+ })
79
+ .catch((error) => {
80
+ Logger.error(SCOPE_SC_UI, error);
81
+ enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
82
+ variant: 'error',
83
+ autoHideDuration: 3000
84
+ });
85
+ });
86
+ }, [course, section, handleManageSection]);
87
+ const handleAddTempLesson = useCallback(() => {
88
+ setLessons((prevLessons) => ((prevLessons === null || prevLessons === void 0 ? void 0 : prevLessons.length) > 0 ? [...prevLessons, getLesson(prevLessons.length + 1)] : [getLesson(1)]));
89
+ }, [setLessons, getLesson]);
90
+ const handleAbleEditMode = useCallback(() => setTimeout(() => setEditMode(true)), [setEditMode]);
91
+ const handleDisableEditMode = useCallback(() => setEditMode(false), [setEditMode]);
92
+ const handleDeleteSection = useCallback((deleteSection) => {
93
+ CourseService.deleteCourseSection(course.id, deleteSection.id)
94
+ .then(() => {
95
+ var _a;
96
+ const tempSection = Object.assign(Object.assign({}, deleteSection), { num_lessons: ((_a = deleteSection.lessons) === null || _a === void 0 ? void 0 : _a.length) || 0 });
97
+ handleManageSection(tempSection, ActionLessonType.DELETE);
98
+ enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.editCourse.tab.lessons.table.snackbar.delete", defaultMessage: "ui.editCourse.tab.lessons.table.snackbar.delete" }), {
99
+ variant: 'success',
100
+ autoHideDuration: 3000
101
+ });
102
+ })
103
+ .catch((error) => {
104
+ Logger.error(SCOPE_SC_UI, error);
105
+ enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
106
+ variant: 'error',
107
+ autoHideDuration: 3000
108
+ });
109
+ });
110
+ }, [course, handleManageSection]);
111
+ const handleManageLesson = useCallback((lesson, type, newRow) => {
112
+ switch (type) {
113
+ case ActionLessonType.ADD: {
114
+ const tempSection = Object.assign(Object.assign({}, section), { lessons: section.lessons ? [...section.lessons, lesson] : [lesson] });
115
+ handleManageSection(tempSection, ActionLessonType.ADD_UPDATE);
116
+ break;
117
+ }
118
+ case ActionLessonType.RENAME: {
119
+ const tempSection = Object.assign(Object.assign({}, section), { lessons: section.lessons.map((prevLesson) => {
120
+ if (prevLesson.id === lesson.id) {
121
+ return Object.assign(Object.assign({}, prevLesson), { name: lesson.name });
122
+ }
123
+ return prevLesson;
124
+ }) });
125
+ handleManageSection(tempSection, ActionLessonType.RENAME_UPDATE);
126
+ break;
127
+ }
128
+ case ActionLessonType.DELETE: {
129
+ const tempSection = Object.assign(Object.assign({}, section), { lessons: section.lessons.filter((prevLesson) => prevLesson.id !== lesson.id) });
130
+ handleManageSection(tempSection, ActionLessonType.DELETE_UPDATE, newRow);
131
+ break;
132
+ }
133
+ case ActionLessonType.UPDATE: {
134
+ const tempSection = Object.assign(Object.assign({}, section), { lessons: section.lessons.map((prevLesson) => {
135
+ if (prevLesson.id === lesson.id) {
136
+ return Object.assign(Object.assign({}, prevLesson), { status: lesson.status });
137
+ }
138
+ return prevLesson;
139
+ }) });
140
+ handleManageSection(tempSection, ActionLessonType.UPDATE_UPDATE);
141
+ }
142
+ }
143
+ }, [section, handleManageSection]);
144
+ useImperativeHandle(ref, () => ({
145
+ handleDeleteSection: (deleteSection) => handleDeleteSection(deleteSection),
146
+ handleDeleteLesson: (deleteSection, deleteLesson) => innerRef.current.handleDeleteLesson(deleteSection, deleteLesson)
147
+ }), [handleDeleteSection]);
148
+ return (_jsxs(Fragment, { children: [_jsxs(TableRow, Object.assign({}, provider.draggableProps, { ref: provider.innerRef, className: classes.tableBodyAccordion }, { children: [_jsx(TableCell, Object.assign({ component: "th", scope: "row" }, provider.dragHandleProps, { className: classNames(classes.cellWidth, classes.cellPadding) }, { children: _jsxs(Stack, Object.assign({ className: classes.tableBodyIconWrapper }, { children: [_jsx(IconButton, Object.assign({ "aria-label": "expand row", size: "small", onClick: handleExpandAccordion }, { children: expand ? _jsx(Icon, { children: "expand_less" }) : _jsx(Icon, { children: "expand_more" }) })), _jsx(Icon, Object.assign({ color: "disabled" }, { children: "drag" }))] })) })), _jsx(TableCell, { children: _jsx(FieldName, { endpoint: {
149
+ url: () => isNewRow
150
+ ? Endpoints.CreateCourseSection.url({ id: course.id })
151
+ : Endpoints.PatchCourseSection.url({ id: course.id, section_id: section.id }),
152
+ method: isNewRow ? Endpoints.CreateCourseSection.method : Endpoints.PatchCourseSection.method
153
+ }, row: section, isNewRow: isNewRow, handleManageRow: handleManageSection, editMode: editMode, handleDisableEditMode: handleDisableEditMode }) }), course.type !== SCCourseTypologyType.SELF && (_jsx(TableCell, Object.assign({ className: classes.cellAlignCenter }, { children: _jsx(LessonReleaseMenu, { course: course, section: section }) }))), _jsx(TableCell, Object.assign({ className: classes.cellAlignRight }, { children: _jsxs(Stack, Object.assign({ className: classes.actionsWrapper }, { children: [_jsx(AddButton, { label: "ui.editCourse.tab.lessons.table.lesson", handleAddRow: handleAddTempLesson, color: "primary", variant: "outlined", disabled: isDisabled }), _jsxs(MenuRow, Object.assign({ disabled: isDisabled }, { children: [_jsx(MenuItem, Object.assign({ onClick: handleAbleEditMode }, { children: _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.editCourse.tab.lessons.table.menu.rename", defaultMessage: "ui.editCourse.tab.lessons.table.menu.rename" }) })) })), _jsx(MenuItem, Object.assign({ onClick: () => handleOpenDialog({ row: RowType.SECTION, section }) }, { children: _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.editCourse.tab.lessons.table.menu.delete", defaultMessage: "ui.editCourse.tab.lessons.table.menu.delete" }) })) }))] }))] })) }))] })), _jsx(TableRow, { children: _jsx(TableCell, Object.assign({ className: classes.tableBodyCollapseWrapper, colSpan: 4 }, { children: _jsx(Collapse, Object.assign({ in: expand, timeout: "auto", unmountOnExit: true }, { children: _jsx(DragDropContext, Object.assign({ onDragEnd: handleDragEnd }, { children: _jsx(Table, { children: _jsx(Droppable, Object.assign({ droppableId: "droppable-2" }, { children: (outerProvider) => (_jsxs(TableBody, Object.assign({ ref: outerProvider.innerRef }, outerProvider.droppableProps, { children: [lessons.map((lesson, i, array) => (_jsx(Draggable, Object.assign({ draggableId: i.toString(), index: i, isDragDisabled: isDisabled }, { children: (innerProvider) => (_jsx(LessonRow, { provider: innerProvider, course: course, section: section, lesson: lesson, isNewRow: isNewLocalRow && i + 1 === array.length, handleManageLesson: handleManageLesson, handleOpenDialog: () => handleOpenDialog({ row: RowType.LESSON, section, lesson }), ref: innerRef }, i)) }), i))), outerProvider.placeholder] }))) })) }) })) })) })) })] }));
154
+ }
155
+ export default memo(forwardRef(SectionRow));
@@ -0,0 +1 @@
1
+ export default function LessonsSkeleton(): JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Stack, Skeleton, TableContainer, Table, TableHead, TableRow, TableCell, TableBody, Box } from '@mui/material';
3
+ import { PREFIX } from '../constants';
4
+ const classes = {
5
+ lessonTitle: `${PREFIX}-lesson-title`,
6
+ lessonInfoWrapper: `${PREFIX}-lesson-info-wrapper`,
7
+ lessonInfo: `${PREFIX}-lesson-info`,
8
+ lessonsSectionsWrapper: `${PREFIX}-lessons-sections-wrapper`,
9
+ lessonsSections: `${PREFIX}-lessons-sections`,
10
+ tableContainer: `${PREFIX}-table-container`,
11
+ margin: `${PREFIX}-margin`,
12
+ marginLeft: `${PREFIX}-margin-left`,
13
+ actionsWrapper: `${PREFIX}-actions-wrapper`
14
+ };
15
+ export default function LessonsSkeleton() {
16
+ return (_jsxs(Box, { children: [_jsx(Skeleton, { animation: "wave", variant: "text", width: "150px", height: "21px", className: classes.lessonTitle }), _jsxs(Stack, Object.assign({ className: classes.lessonInfoWrapper }, { children: [_jsxs(Stack, Object.assign({ className: classes.lessonInfo }, { children: [_jsx(Skeleton, { animation: "wave", variant: "rectangular", width: "14px", height: "14px" }), _jsx(Skeleton, { animation: "wave", variant: "text", width: "150px", height: "21px" })] })), _jsx(Skeleton, { animation: "wave", variant: "rectangular", width: "105px", height: "32px" })] })), _jsxs(Stack, Object.assign({ className: classes.lessonsSectionsWrapper }, { children: [_jsx(Skeleton, { animation: "wave", width: "159px", height: "21px" }), _jsx(Skeleton, { animation: "wave", width: "100px", height: "32px" })] })), _jsx(TableContainer, Object.assign({ className: classes.tableContainer }, { children: _jsxs(Table, { children: [_jsx(TableHead, { children: _jsxs(TableRow, { children: [_jsx(TableCell, {}), _jsx(TableCell, { children: _jsx(Skeleton, { animation: "wave", variant: "text", width: "102px", height: "32px" }) }), _jsx(TableCell, { children: _jsx(Skeleton, { animation: "wave", variant: "text", width: "87px", height: "32px", className: classes.margin }) }), _jsx(TableCell, { children: _jsx(Skeleton, { animation: "wave", variant: "text", width: "48px", height: "32px", className: classes.marginLeft }) })] }) }), _jsx(TableBody, { children: _jsxs(TableRow, { children: [_jsx(TableCell, {}), _jsx(TableCell, { children: _jsx(Skeleton, { animation: "wave", variant: "text", width: "102px", height: "21px" }) }), _jsx(TableCell, { children: _jsx(Skeleton, { animation: "wave", variant: "rectangular", width: "250px", height: "54px", className: classes.margin }) }), _jsx(TableCell, { children: _jsxs(Stack, Object.assign({ className: classes.actionsWrapper }, { children: [_jsx(Skeleton, { animation: "wave", variant: "rounded", width: "105px", height: "37px" }), _jsx(Skeleton, { animation: "wave", variant: "circular", width: "36px", height: "36px" })] })) })] }) })] }) }))] }));
17
+ }
@@ -0,0 +1,11 @@
1
+ import { SyntheticEvent } from 'react';
2
+ import { SCCourseType } from '@selfcommunity/types';
3
+ import { SCCourseEditTabType } from '../../types';
4
+ interface LessonsProps {
5
+ course: SCCourseType;
6
+ setCourse: (course: SCCourseType) => void;
7
+ handleTabChange: (_e: SyntheticEvent, newTabValue: SCCourseEditTabType) => void;
8
+ }
9
+ declare function Lessons(props: LessonsProps): JSX.Element;
10
+ declare const _default: import("react").MemoExoticComponent<typeof Lessons>;
11
+ export default _default;
@@ -0,0 +1,193 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { FormattedMessage, useIntl } from 'react-intl';
3
+ import { PREFIX } from './constants';
4
+ import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
5
+ import { DragDropContext, Draggable, Droppable } from '@hello-pangea/dnd';
6
+ import { SCCourseTypologyType } from '@selfcommunity/types';
7
+ import { CourseService } from '@selfcommunity/api-services';
8
+ import { Logger } from '@selfcommunity/utils';
9
+ import { SCOPE_SC_UI } from '../../constants/Errors';
10
+ import { useSnackbar } from 'notistack';
11
+ import { Box, Stack, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Typography } from '@mui/material';
12
+ import Status from './Status';
13
+ import EmptyStatus from '../../shared/EmptyStatus';
14
+ import AddButton from './Lessons/AddButton';
15
+ import SectionRow from './Lessons/SectionRow';
16
+ import { ActionLessonType, RowType } from './types';
17
+ import { useIsDisabled } from './hooks';
18
+ import ConfirmDialog from '../../shared/ConfirmDialog/ConfirmDialog';
19
+ import CourseTypePopover from '../../shared/CourseTypePopover';
20
+ import classNames from 'classnames';
21
+ const classes = {
22
+ lessonTitle: `${PREFIX}-lesson-title`,
23
+ lessonInfoWrapper: `${PREFIX}-lesson-info-wrapper`,
24
+ lessonsInnerWrapper: `${PREFIX}-lessons-inner-wrapper`,
25
+ lessonsSectionsWrapper: `${PREFIX}-lessons-sections-wrapper`,
26
+ lessonsSections: `${PREFIX}-lessons-sections`,
27
+ circle: `${PREFIX}-circle`,
28
+ tableContainer: `${PREFIX}-table-container`,
29
+ table: `${PREFIX}-table`,
30
+ tableHeader: `${PREFIX}-table-header`,
31
+ tableHeaderTypography: `${PREFIX}-table-header-typography`,
32
+ tableBody: `${PREFIX}-table-body`,
33
+ cellWidth: `${PREFIX}-cell-width`,
34
+ cellAlignRight: `${PREFIX}-cell-align-right`,
35
+ cellAlignCenter: `${PREFIX}-cell-align-center`,
36
+ lessonEmptyStatus: `${PREFIX}-lesson-empty-status`,
37
+ emptyStatusButton: `${PREFIX}-empty-status-button`,
38
+ contrastColor: `${PREFIX}-contrast-color`
39
+ };
40
+ function Lessons(props) {
41
+ // PROPS
42
+ const { course, setCourse, handleTabChange } = props;
43
+ // STATES
44
+ const [sections, setSections] = useState([]);
45
+ const [dialog, setDialog] = useState(null);
46
+ // REFS
47
+ const ref = useRef(null);
48
+ // HOOKS
49
+ const { isDisabled } = useIsDisabled();
50
+ const { enqueueSnackbar } = useSnackbar();
51
+ const intl = useIntl();
52
+ // EFFECTS
53
+ useEffect(() => {
54
+ if (course.sections) {
55
+ setSections(course.sections);
56
+ }
57
+ }, [course]);
58
+ // MEMOS
59
+ const isNewRow = useMemo(() => { var _a; return sections.length > ((_a = course.sections) === null || _a === void 0 ? void 0 : _a.length); }, [course, sections]);
60
+ const headerCells = useMemo(() => [
61
+ {
62
+ className: undefined,
63
+ id: 'ui.editCourse.tab.lessons.table.header.lessonName'
64
+ },
65
+ ...(course.type !== SCCourseTypologyType.SELF
66
+ ? [
67
+ {
68
+ className: classes.cellAlignCenter,
69
+ id: 'ui.editCourse.tab.lessons.table.header.calendar'
70
+ }
71
+ ]
72
+ : []),
73
+ {
74
+ className: classes.cellAlignRight,
75
+ id: 'ui.editCourse.tab.lessons.table.header.actions'
76
+ }
77
+ ], [course]);
78
+ // FUNCTIONS
79
+ const getSection = useCallback((id) => {
80
+ return {
81
+ id,
82
+ name: intl.formatMessage({ id: 'ui.editCourse.tab.lessons.table.newSection', defaultMessage: 'ui.editCourse.tab.lessons.table.newSection' }, { num: id })
83
+ };
84
+ }, []);
85
+ // HANDLERS
86
+ const handleDragEnd = useCallback((e) => {
87
+ if (!e.destination || e.destination.index === e.source.index) {
88
+ return;
89
+ }
90
+ const tempSections = Array.from(course.sections);
91
+ const [sourceData] = tempSections.splice(e.source.index, 1);
92
+ tempSections.splice(e.destination.index, 0, sourceData);
93
+ const data = {
94
+ sections_order: tempSections.map((tempSection) => tempSection.id)
95
+ };
96
+ CourseService.patchCourse(course.id, data)
97
+ .then(() => {
98
+ setCourse(Object.assign(Object.assign({}, course), { sections: tempSections }));
99
+ enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.editCourse.tab.lessons.table.snackbar.save", defaultMessage: "ui.editCourse.tab.lessons.table.snackbar.save" }), {
100
+ variant: 'success',
101
+ autoHideDuration: 3000
102
+ });
103
+ })
104
+ .catch((error) => {
105
+ Logger.error(SCOPE_SC_UI, error);
106
+ enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
107
+ variant: 'error',
108
+ autoHideDuration: 3000
109
+ });
110
+ });
111
+ }, [course]);
112
+ const handleAddTempSection = useCallback(() => {
113
+ setSections((prevSections) => (prevSections.length > 0 ? [...prevSections, getSection(prevSections.length + 1)] : [getSection(1)]));
114
+ }, [setSections]);
115
+ const handleManageSection = useCallback((section, type, newRow = false) => {
116
+ switch (type) {
117
+ case ActionLessonType.ADD: {
118
+ const newSection = Object.assign(Object.assign({}, section), { lessons: [] });
119
+ setCourse(Object.assign(Object.assign({}, course), { num_sections: course.num_sections + 1, sections: [...course.sections, newSection] }));
120
+ break;
121
+ }
122
+ case ActionLessonType.RENAME:
123
+ setCourse(Object.assign(Object.assign({}, course), { sections: course.sections.map((prevSection) => {
124
+ if (prevSection.id === section.id) {
125
+ return Object.assign(Object.assign({}, prevSection), { name: section.name });
126
+ }
127
+ return prevSection;
128
+ }) }));
129
+ break;
130
+ case ActionLessonType.DELETE: {
131
+ if (newRow) {
132
+ setCourse(Object.assign(Object.assign({}, course), { sections: course.sections.filter((prevSection) => prevSection.id !== section.id) }));
133
+ }
134
+ else {
135
+ setCourse(Object.assign(Object.assign({}, course), { num_sections: course.num_sections - 1, num_lessons: course.num_lessons - section.num_lessons, sections: course.sections.filter((prevSection) => prevSection.id !== section.id) }));
136
+ }
137
+ break;
138
+ }
139
+ case ActionLessonType.UPDATE:
140
+ setCourse(Object.assign(Object.assign({}, course), { sections: course.sections.map((prevSection) => {
141
+ if (prevSection.id === section.id) {
142
+ return Object.assign(Object.assign({}, prevSection), { lessons: section.lessons });
143
+ }
144
+ return prevSection;
145
+ }) }));
146
+ break;
147
+ case type.endsWith(ActionLessonType.UPDATE) && type: {
148
+ if (newRow) {
149
+ setCourse(Object.assign(Object.assign({}, course), { sections: course.sections.map((prevSection) => {
150
+ if (prevSection.id === section.id) {
151
+ return section;
152
+ }
153
+ return prevSection;
154
+ }) }));
155
+ }
156
+ else {
157
+ let numLessons = course.num_lessons;
158
+ if (type === ActionLessonType.ADD_UPDATE) {
159
+ numLessons = course.num_lessons + 1;
160
+ }
161
+ else if (type === ActionLessonType.DELETE_UPDATE) {
162
+ numLessons = course.num_lessons - 1;
163
+ }
164
+ setCourse(Object.assign(Object.assign({}, course), { num_lessons: numLessons, sections: course.sections.map((prevSection) => {
165
+ if (prevSection.id === section.id) {
166
+ return section;
167
+ }
168
+ return prevSection;
169
+ }) }));
170
+ }
171
+ }
172
+ }
173
+ }, [course]);
174
+ const handleOpenDialog = useCallback((row) => {
175
+ setDialog(row);
176
+ }, [setDialog]);
177
+ const handleDeleteRow = useCallback(() => {
178
+ switch (dialog.row) {
179
+ case RowType.SECTION:
180
+ ref.current.handleDeleteSection(dialog.section);
181
+ break;
182
+ case RowType.LESSON:
183
+ ref.current.handleDeleteLesson(dialog.section, dialog.lesson);
184
+ }
185
+ handleOpenDialog(null);
186
+ }, [dialog, handleOpenDialog]);
187
+ return (_jsxs(Box, { children: [_jsx(Typography, Object.assign({ className: classNames(classes.lessonTitle, classes.contrastColor), variant: "h4" }, { children: _jsx(FormattedMessage, { id: "ui.editCourse.tab.lessons", defaultMessage: "ui.editCourse.tab.lessons" }) })), _jsxs(Stack, Object.assign({ className: classes.lessonInfoWrapper }, { children: [_jsx(CourseTypePopover, { course: course }), _jsx(Status, { course: course, handleTabChange: handleTabChange })] })), sections.length === 0 && (_jsx(EmptyStatus, { icon: "courses", title: "ui.editCourse.tab.lessons.table.empty.title", description: "ui.editCourse.tab.lessons.table.empty.description", actions: _jsx(AddButton, { className: classes.emptyStatusButton, label: "ui.editCourse.tab.lessons.table.section", handleAddRow: handleAddTempSection, color: "inherit", variant: "outlined" }), className: classes.lessonEmptyStatus })), sections.length > 0 && (_jsxs(Box, Object.assign({ className: classes.lessonsInnerWrapper }, { children: [_jsxs(Stack, Object.assign({ className: classes.lessonsSectionsWrapper }, { children: [_jsxs(Stack, Object.assign({ className: classes.lessonsSections }, { children: [_jsx(Typography, Object.assign({ variant: "h5" }, { children: _jsx(FormattedMessage, { id: "ui.course.table.sections.title", defaultMessage: "ui.course.table.sections.title", values: {
188
+ sectionsNumber: course.num_sections
189
+ } }) })), _jsx(Box, { className: classes.circle }), _jsx(Typography, Object.assign({ variant: "h5" }, { children: _jsx(FormattedMessage, { id: "ui.course.table.lessons.title", defaultMessage: "ui.course.table.lessons.title", values: {
190
+ lessonsNumber: course.num_lessons
191
+ } }) }))] })), _jsx(AddButton, { label: "ui.editCourse.tab.lessons.table.section", handleAddRow: handleAddTempSection, color: "primary", variant: "contained", disabled: isDisabled })] })), _jsx(DragDropContext, Object.assign({ onDragEnd: handleDragEnd }, { children: _jsx(TableContainer, Object.assign({ className: classes.tableContainer }, { children: _jsxs(Table, Object.assign({ className: classes.table }, { children: [_jsx(TableHead, Object.assign({ className: classes.tableHeader }, { children: _jsxs(TableRow, { children: [_jsx(TableCell, { className: classes.cellWidth }), headerCells.map((cell, i) => (_jsx(TableCell, Object.assign({ className: cell.className }, { children: _jsx(Typography, Object.assign({ className: classes.tableHeaderTypography, variant: "overline" }, { children: _jsx(FormattedMessage, { id: cell.id, defaultMessage: cell.id }) })) }), i)))] }) })), _jsx(Droppable, Object.assign({ droppableId: "droppable-1" }, { children: (outerProvider) => (_jsxs(TableBody, Object.assign({ ref: outerProvider.innerRef }, outerProvider.droppableProps, { className: classes.tableBody }, { children: [sections.map((section, i, array) => (_jsx(Draggable, Object.assign({ draggableId: i.toString(), index: i, isDragDisabled: isDisabled }, { children: (innerProvider) => (_jsx(SectionRow, { course: course, provider: innerProvider, section: section, isNewRow: isNewRow && i + 1 === array.length, handleManageSection: handleManageSection, handleOpenDialog: handleOpenDialog, ref: ref }, i)) }), i))), outerProvider.placeholder] }))) }))] })) })) })), dialog && _jsx(ConfirmDialog, { open: true, onClose: () => handleOpenDialog(null), onConfirm: handleDeleteRow })] })))] }));
192
+ }
193
+ export default memo(Lessons);
@@ -0,0 +1,9 @@
1
+ import { HTMLAttributes, PropsWithChildren, ReactNode } from 'react';
2
+ interface MenuRowProps extends PropsWithChildren {
3
+ icon?: ReactNode;
4
+ buttonClassName?: HTMLAttributes<HTMLButtonElement>['className'];
5
+ disabled?: boolean;
6
+ }
7
+ declare function MenuRow(props: MenuRowProps): JSX.Element;
8
+ declare const _default: import("react").MemoExoticComponent<typeof MenuRow>;
9
+ export default _default;
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Menu from '@mui/material/Menu';
3
+ import { Icon, IconButton, SwipeableDrawer, useMediaQuery, useTheme } from '@mui/material';
4
+ import { Fragment, memo, useCallback, useState } from 'react';
5
+ function MenuRow(props) {
6
+ // PROPS
7
+ const { icon = _jsx(Icon, { children: "more_vert" }), buttonClassName, disabled, children } = props;
8
+ // STATES
9
+ const [anchorEl, setAnchorEl] = useState(null);
10
+ // HOOKS
11
+ const theme = useTheme();
12
+ const isMobile = useMediaQuery(theme.breakpoints.down('md'));
13
+ // HANDLERS
14
+ const handleClick = useCallback((e) => {
15
+ setAnchorEl(e.currentTarget);
16
+ }, [anchorEl]);
17
+ const handleClose = useCallback(() => {
18
+ setAnchorEl(null);
19
+ }, [anchorEl]);
20
+ return (_jsxs(Fragment, { children: [_jsx(IconButton, Object.assign({ className: buttonClassName, onClick: handleClick, disabled: disabled }, { children: icon })), isMobile ? (_jsx(SwipeableDrawer, Object.assign({ open: Boolean(anchorEl), onClick: handleClose, onClose: handleClose, onOpen: () => null, anchor: "bottom", disableSwipeToOpen: true }, { children: children }))) : (_jsx(Menu, Object.assign({ anchorEl: anchorEl, open: Boolean(anchorEl), onClick: handleClose }, { children: children })))] }));
21
+ }
22
+ export default memo(MenuRow);
@@ -0,0 +1 @@
1
+ export default function OptionsSkeleton(): JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Divider, FormControl, FormControlLabel, FormLabel, Skeleton, Stack, Switch } from '@mui/material';
3
+ import { PREFIX } from '../constants';
4
+ import { Fragment } from 'react';
5
+ const classes = {
6
+ optionsWrapper: `${PREFIX}-options-wrapper`,
7
+ optionsDivider: `${PREFIX}-options-divider`,
8
+ optionsButtonWrapper: `${PREFIX}-options-button-wrapper`
9
+ };
10
+ export default function OptionsSkeleton() {
11
+ return (_jsxs(Fragment, { children: [_jsx(Stack, Object.assign({ className: classes.optionsWrapper }, { children: Array.from(Array(3)).map((_, i) => (_jsxs(FormControl, Object.assign({ component: "fieldset", variant: "standard" }, { children: [_jsx(FormLabel, Object.assign({ component: "legend" }, { children: _jsx(Skeleton, { animation: "wave", variant: "text", width: "52px", height: "21px" }) })), _jsx(FormControlLabel, { control: _jsx(Switch, {}), label: _jsx(Skeleton, { animation: "wave", variant: "text", width: "215px", height: "38px" }) })] }), i))) })), _jsx(Divider, { className: classes.optionsDivider }), _jsx(Stack, Object.assign({ className: classes.optionsButtonWrapper }, { children: _jsx(Skeleton, { animation: "wave", variant: "rounded", width: "133px", height: "33px" }) }))] }));
12
+ }
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ interface SwitchFormProps {
3
+ name: string;
4
+ title: string;
5
+ description: string;
6
+ checked: boolean;
7
+ handleChangeOptions: (key: string, value: boolean) => void;
8
+ }
9
+ declare function SwitchForm(props: SwitchFormProps): JSX.Element;
10
+ declare const _default: import("react").MemoExoticComponent<typeof SwitchForm>;
11
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { FormControl, FormControlLabel, FormLabel, Switch, Typography } from '@mui/material';
3
+ import { memo, useCallback, useState } from 'react';
4
+ import { FormattedMessage } from 'react-intl';
5
+ function SwitchForm(props) {
6
+ // PROPS
7
+ const { name, title, description, checked, handleChangeOptions } = props;
8
+ // STATES
9
+ const [value, setValue] = useState(checked);
10
+ // HANDLERS
11
+ const handleChange = useCallback((e) => {
12
+ const _checked = e.target.checked;
13
+ setValue(_checked);
14
+ handleChangeOptions(name, _checked);
15
+ }, [setValue]);
16
+ return (_jsxs(FormControl, Object.assign({ component: "fieldset", variant: "standard" }, { children: [_jsx(FormLabel, Object.assign({ component: "legend" }, { children: _jsx(Typography, Object.assign({ variant: "h5" }, { children: _jsx(FormattedMessage, { id: title, defaultMessage: title }) })) })), _jsx(FormControlLabel, { control: _jsx(Switch, { color: "primary", checked: value, name: name, onChange: handleChange }), label: _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: description, defaultMessage: description }) })) })] })));
17
+ }
18
+ export default memo(SwitchForm);
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { SCCourseType } from '@selfcommunity/types';
3
+ interface OptionsProps {
4
+ course: SCCourseType;
5
+ setCourse: (course: SCCourseType) => void;
6
+ }
7
+ declare function Options(props: OptionsProps): JSX.Element;
8
+ declare const _default: import("react").MemoExoticComponent<typeof Options>;
9
+ export default _default;
@@ -0,0 +1,93 @@
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 { PREFIX } from './constants';
5
+ import { memo, useCallback, useState } from 'react';
6
+ import { Logger } from '@selfcommunity/utils';
7
+ import { SCOPE_SC_UI } from '../../constants/Errors';
8
+ import { useSnackbar } from 'notistack';
9
+ import SwitchForm from './Options/SwitchForm';
10
+ import useDeepCompareEffect from 'use-deep-compare-effect';
11
+ import { LoadingButton } from '@mui/lab';
12
+ import { CourseService } from '@selfcommunity/api-services';
13
+ const classes = {
14
+ optionsContainer: `${PREFIX}-options-container`,
15
+ optionsWrapper: `${PREFIX}-options-wrapper`,
16
+ optionsDivider: `${PREFIX}-options-divider`,
17
+ optionsButtonWrapper: `${PREFIX}-options-button-wrapper`
18
+ };
19
+ const OPTIONS = {
20
+ enforce_lessons_order: {
21
+ title: 'ui.editCourse.tab.options',
22
+ description: 'ui.editCourse.tab.options.description'
23
+ },
24
+ new_comment_notification_enabled: {
25
+ title: 'ui.editCourse.tab.options.notifications',
26
+ description: 'ui.editCourse.tab.options.notifications.description'
27
+ },
28
+ hide_member_count: {
29
+ title: 'ui.editCourse.tab.options.permissions',
30
+ description: 'ui.editCourse.tab.options.permissions.description'
31
+ }
32
+ };
33
+ function Options(props) {
34
+ // PROPS
35
+ const { course, setCourse } = props;
36
+ // STATES
37
+ const [tempOptions, setTempOptions] = useState(null);
38
+ const [canSave, setCanSave] = useState(false);
39
+ const [loading, setLoading] = useState(false);
40
+ // HOOKS
41
+ const { enqueueSnackbar } = useSnackbar();
42
+ // EFFECTS
43
+ useDeepCompareEffect(() => {
44
+ if (!tempOptions) {
45
+ return;
46
+ }
47
+ if (course.enforce_lessons_order !== tempOptions.enforce_lessons_order ||
48
+ course.new_comment_notification_enabled !== tempOptions.new_comment_notification_enabled ||
49
+ course.hide_member_count !== tempOptions.hide_member_count) {
50
+ setCanSave(true);
51
+ }
52
+ else {
53
+ setCanSave(false);
54
+ }
55
+ }, [course, tempOptions, setCanSave]);
56
+ // HANDLERS
57
+ const handleChange = useCallback((key, value) => {
58
+ setTempOptions((prevOptions) => {
59
+ if (!prevOptions) {
60
+ return {
61
+ enforce_lessons_order: course.enforce_lessons_order,
62
+ new_comment_notification_enabled: course.new_comment_notification_enabled,
63
+ hide_member_count: course.hide_member_count,
64
+ [key]: value
65
+ };
66
+ }
67
+ return Object.assign(Object.assign({}, prevOptions), { [key]: value });
68
+ });
69
+ }, [setTempOptions, course]);
70
+ const handleSubmit = useCallback(() => {
71
+ setLoading(true);
72
+ CourseService.patchCourse(course.id, Object.assign({ id: course.id }, tempOptions))
73
+ .then((data) => {
74
+ setCourse(Object.assign(Object.assign({}, course), data));
75
+ setTempOptions(null);
76
+ setCanSave(false);
77
+ setLoading(false);
78
+ enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.contributionActionMenu.actionSuccess", defaultMessage: "ui.contributionActionMenu.actionSuccess" }), {
79
+ variant: 'success',
80
+ autoHideDuration: 3000
81
+ });
82
+ })
83
+ .catch((error) => {
84
+ Logger.error(SCOPE_SC_UI, error);
85
+ enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
86
+ variant: 'error',
87
+ autoHideDuration: 3000
88
+ });
89
+ });
90
+ }, [course, tempOptions, setCanSave, setLoading]);
91
+ return (_jsxs(Box, Object.assign({ className: classes.optionsContainer }, { children: [_jsx(Stack, Object.assign({ className: classes.optionsWrapper }, { children: Object.entries(OPTIONS).map(([key, value], i) => (_jsx(SwitchForm, { name: key, title: value.title, description: value.description, checked: course[key], handleChangeOptions: handleChange }, i))) })), _jsx(Stack, Object.assign({ className: classes.optionsButtonWrapper }, { children: _jsx(LoadingButton, Object.assign({ size: "small", variant: "contained", disabled: !canSave, onClick: handleSubmit, loading: loading }, { children: _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.editCourse.tab.options.button.save", defaultMessage: "ui.editCourse.tab.options.button.save" }) })) })) }))] })));
92
+ }
93
+ export default memo(Options);
@@ -0,0 +1,12 @@
1
+ import { SyntheticEvent } from 'react';
2
+ import { SCCourseType } from '@selfcommunity/types';
3
+ import { BaseGetParams } from '@selfcommunity/api-services';
4
+ import { SCCourseEditTabType } from '../../types/course';
5
+ interface RequestsProps {
6
+ course: SCCourseType;
7
+ endpointQueryParams?: BaseGetParams;
8
+ handleTabChange: (_e: SyntheticEvent, newTabValue: SCCourseEditTabType) => void;
9
+ }
10
+ declare function Requests(props: RequestsProps): JSX.Element;
11
+ declare const _default: import("react").MemoExoticComponent<typeof Requests>;
12
+ export default _default;