@selfcommunity/react-ui 0.11.0-alpha.6 → 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.
- package/lib/cjs/assets/courses/clapping.d.ts +1 -0
- package/lib/cjs/assets/courses/clapping.js +4 -0
- package/lib/cjs/components/BottomNavigation/BottomNavigation.js +17 -2
- package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.d.ts +5 -0
- package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.js +9 -11
- package/lib/cjs/components/CommentObject/CommentObject.d.ts +5 -0
- package/lib/cjs/components/CommentObject/CommentObject.js +2 -2
- package/lib/cjs/components/CommentObjectReply/CommentObjectReply.d.ts +24 -2
- package/lib/cjs/components/CommentObjectReply/CommentObjectReply.js +17 -4
- package/lib/cjs/components/Composer/Content/ContentLesson/ContentLesson.d.ts +38 -0
- package/lib/cjs/components/Composer/Content/ContentLesson/ContentLesson.js +67 -0
- package/lib/cjs/components/Composer/Content/ContentLesson/index.d.ts +3 -0
- package/lib/cjs/components/Composer/Content/ContentLesson/index.js +5 -0
- package/lib/cjs/components/Composer/Layer/AudienceLayer/AudienceLayer.js +2 -2
- package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +1 -1
- package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.js +4 -1
- package/lib/cjs/components/ComposerIconButton/ComposerIconButton.d.ts +9 -3
- package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +46 -9
- package/lib/cjs/components/Course/Course.d.ts +92 -0
- package/lib/cjs/components/Course/Course.js +185 -0
- package/lib/cjs/components/Course/CreatePlaceholder.d.ts +39 -0
- package/lib/cjs/components/Course/CreatePlaceholder.js +59 -0
- package/lib/cjs/components/Course/Skeleton.d.ts +51 -0
- package/lib/cjs/components/Course/Skeleton.js +77 -0
- package/lib/cjs/components/Course/constants.d.ts +1 -0
- package/lib/cjs/components/Course/constants.js +4 -0
- package/lib/cjs/components/Course/index.d.ts +4 -0
- package/lib/cjs/components/Course/index.js +8 -0
- package/lib/cjs/components/CourseCompletedDialog/CourseCompletedDialog.d.ts +9 -0
- package/lib/cjs/components/CourseCompletedDialog/CourseCompletedDialog.js +40 -0
- package/lib/cjs/components/CourseCompletedDialog/index.d.ts +3 -0
- package/lib/cjs/components/CourseCompletedDialog/index.js +5 -0
- package/lib/cjs/components/CourseContentMenu/CourseContentMenu.d.ts +25 -0
- package/lib/cjs/components/CourseContentMenu/CourseContentMenu.js +47 -0
- package/lib/cjs/components/CourseContentMenu/constants.d.ts +1 -0
- package/lib/cjs/components/CourseContentMenu/constants.js +4 -0
- package/lib/cjs/components/CourseContentMenu/index.d.ts +3 -0
- package/lib/cjs/components/CourseContentMenu/index.js +5 -0
- package/lib/cjs/components/CourseDashboard/Header/Skeleton.d.ts +1 -0
- package/lib/cjs/components/CourseDashboard/Header/Skeleton.js +16 -0
- package/lib/cjs/components/CourseDashboard/Header.d.ts +9 -0
- package/lib/cjs/components/CourseDashboard/Header.js +44 -0
- package/lib/cjs/components/CourseDashboard/Student/ActionButton.d.ts +8 -0
- package/lib/cjs/components/CourseDashboard/Student/ActionButton.js +16 -0
- package/lib/cjs/components/CourseDashboard/Student/Skeleton.d.ts +1 -0
- package/lib/cjs/components/CourseDashboard/Student/Skeleton.js +30 -0
- package/lib/cjs/components/CourseDashboard/Student.d.ts +11 -0
- package/lib/cjs/components/CourseDashboard/Student.js +203 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Comments.d.ts +9 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Comments.js +108 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Info.d.ts +11 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Info.js +19 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Skeleton.d.ts +1 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Skeleton.js +25 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Students.d.ts +10 -0
- package/lib/cjs/components/CourseDashboard/Teacher/Students.js +71 -0
- package/lib/cjs/components/CourseDashboard/Teacher.d.ts +11 -0
- package/lib/cjs/components/CourseDashboard/Teacher.js +62 -0
- package/lib/cjs/components/CourseDashboard/constants.d.ts +1 -0
- package/lib/cjs/components/CourseDashboard/constants.js +4 -0
- package/lib/cjs/components/CourseDashboard/index.d.ts +11 -0
- package/lib/cjs/components/CourseDashboard/index.js +11 -0
- package/lib/cjs/components/CourseDashboard/types.d.ts +8 -0
- package/lib/cjs/components/CourseDashboard/types.js +13 -0
- package/lib/cjs/components/CourseForm/CourseForm.d.ts +74 -0
- package/lib/cjs/components/CourseForm/CourseForm.js +273 -0
- package/lib/cjs/components/CourseForm/Dialog.d.ts +8 -0
- package/lib/cjs/components/CourseForm/Dialog.js +19 -0
- package/lib/cjs/components/CourseForm/Edit.d.ts +24 -0
- package/lib/cjs/components/CourseForm/Edit.js +53 -0
- package/lib/cjs/components/CourseForm/Skeleton.d.ts +1 -0
- package/lib/cjs/components/CourseForm/Skeleton.js +17 -0
- package/lib/cjs/components/CourseForm/UploadCourseCover.d.ts +45 -0
- package/lib/cjs/components/CourseForm/UploadCourseCover.js +94 -0
- package/lib/cjs/components/CourseForm/constants.d.ts +1 -0
- package/lib/cjs/components/CourseForm/constants.js +4 -0
- package/lib/cjs/components/CourseForm/index.d.ts +4 -0
- package/lib/cjs/components/CourseForm/index.js +8 -0
- package/lib/cjs/components/CourseFormDialog/CourseFormDialog.d.ts +48 -0
- package/lib/cjs/components/CourseFormDialog/CourseFormDialog.js +67 -0
- package/lib/cjs/components/CourseFormDialog/constants.d.ts +1 -0
- package/lib/cjs/components/CourseFormDialog/constants.js +4 -0
- package/lib/cjs/components/CourseFormDialog/index.d.ts +3 -0
- package/lib/cjs/components/CourseFormDialog/index.js +5 -0
- package/lib/cjs/components/CourseJoinButton/CourseJoinButton.d.ts +56 -0
- package/lib/cjs/components/CourseJoinButton/CourseJoinButton.js +148 -0
- package/lib/cjs/components/CourseJoinButton/index.d.ts +3 -0
- package/lib/cjs/components/CourseJoinButton/index.js +5 -0
- package/lib/cjs/components/CourseParticipantsButton/CourseParticipantsButton.d.ts +53 -0
- package/lib/cjs/components/CourseParticipantsButton/CourseParticipantsButton.js +150 -0
- package/lib/cjs/components/CourseParticipantsButton/index.d.ts +3 -0
- package/lib/cjs/components/CourseParticipantsButton/index.js +5 -0
- package/lib/cjs/components/Courses/Courses.d.ts +100 -0
- package/lib/cjs/components/Courses/Courses.js +237 -0
- package/lib/cjs/components/Courses/Skeleton.d.ts +54 -0
- package/lib/cjs/components/Courses/Skeleton.js +45 -0
- package/lib/cjs/components/Courses/constants.d.ts +1 -0
- package/lib/cjs/components/Courses/constants.js +4 -0
- package/lib/cjs/components/Courses/index.d.ts +4 -0
- package/lib/cjs/components/Courses/index.js +8 -0
- package/lib/cjs/components/Courses/prefetchedCourses.d.ts +81 -0
- package/lib/cjs/components/Courses/prefetchedCourses.js +186 -0
- package/lib/cjs/components/CreateCourseButton/CreateCourseButton.d.ts +38 -0
- package/lib/cjs/components/CreateCourseButton/CreateCourseButton.js +81 -0
- package/lib/cjs/components/CreateCourseButton/index.d.ts +3 -0
- package/lib/cjs/components/CreateCourseButton/index.js +5 -0
- package/lib/cjs/components/CreateEventButton/CreateEventButton.d.ts +1 -1
- package/lib/cjs/components/CreateEventButton/CreateEventButton.js +1 -1
- package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -6
- package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.js +2 -9
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +10 -4
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +17 -11
- package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +10 -2
- package/lib/cjs/components/EditCourse/Customize.d.ts +9 -0
- package/lib/cjs/components/EditCourse/Customize.js +31 -0
- package/lib/cjs/components/EditCourse/EditCourse.d.ts +13 -0
- package/lib/cjs/components/EditCourse/EditCourse.js +110 -0
- package/lib/cjs/components/EditCourse/Lessons/AddButton.d.ts +9 -0
- package/lib/cjs/components/EditCourse/Lessons/AddButton.js +29 -0
- package/lib/cjs/components/EditCourse/Lessons/ChangeLessonStatus.d.ts +13 -0
- package/lib/cjs/components/EditCourse/Lessons/ChangeLessonStatus.js +92 -0
- package/lib/cjs/components/EditCourse/Lessons/FieldName.d.ts +15 -0
- package/lib/cjs/components/EditCourse/Lessons/FieldName.js +83 -0
- package/lib/cjs/components/EditCourse/Lessons/LessonRow.d.ts +15 -0
- package/lib/cjs/components/EditCourse/Lessons/LessonRow.js +68 -0
- package/lib/cjs/components/EditCourse/Lessons/SectionRow.d.ts +14 -0
- package/lib/cjs/components/EditCourse/Lessons/SectionRow.js +158 -0
- package/lib/cjs/components/EditCourse/Lessons/Skeleton.d.ts +1 -0
- package/lib/cjs/components/EditCourse/Lessons/Skeleton.js +20 -0
- package/lib/cjs/components/EditCourse/Lessons.d.ts +11 -0
- package/lib/cjs/components/EditCourse/Lessons.js +196 -0
- package/lib/cjs/components/EditCourse/MenuRow.d.ts +9 -0
- package/lib/cjs/components/EditCourse/MenuRow.js +25 -0
- package/lib/cjs/components/EditCourse/Options/Skeleton.d.ts +1 -0
- package/lib/cjs/components/EditCourse/Options/Skeleton.js +15 -0
- package/lib/cjs/components/EditCourse/Options/SwitchForm.d.ts +11 -0
- package/lib/cjs/components/EditCourse/Options/SwitchForm.js +20 -0
- package/lib/cjs/components/EditCourse/Options.d.ts +9 -0
- package/lib/cjs/components/EditCourse/Options.js +96 -0
- package/lib/cjs/components/EditCourse/Requests.d.ts +12 -0
- package/lib/cjs/components/EditCourse/Requests.js +97 -0
- package/lib/cjs/components/EditCourse/Skeleton.d.ts +8 -0
- package/lib/cjs/components/EditCourse/Skeleton.js +28 -0
- package/lib/cjs/components/EditCourse/Status.d.ts +9 -0
- package/lib/cjs/components/EditCourse/Status.js +33 -0
- package/lib/cjs/components/EditCourse/Users/Skeleton.d.ts +1 -0
- package/lib/cjs/components/EditCourse/Users/Skeleton.js +15 -0
- package/lib/cjs/components/EditCourse/Users.d.ts +11 -0
- package/lib/cjs/components/EditCourse/Users.js +140 -0
- package/lib/cjs/components/EditCourse/constants.d.ts +1 -0
- package/lib/cjs/components/EditCourse/constants.js +4 -0
- package/lib/cjs/components/EditCourse/hooks.d.ts +3 -0
- package/lib/cjs/components/EditCourse/hooks.js +22 -0
- package/lib/cjs/components/EditCourse/index.d.ts +4 -0
- package/lib/cjs/components/EditCourse/index.js +8 -0
- package/lib/cjs/components/EditCourse/types.d.ts +29 -0
- package/lib/cjs/components/EditCourse/types.js +19 -0
- package/lib/cjs/components/Editor/Editor.d.ts +37 -0
- package/lib/cjs/components/Editor/Editor.js +13 -10
- package/lib/cjs/components/Editor/nodes/HashtagNode.js +2 -0
- package/lib/cjs/components/Editor/nodes/MentionNode.js +2 -0
- package/lib/cjs/components/Editor/plugins/EmojiPlugin.d.ts +3 -1
- package/lib/cjs/components/Editor/plugins/EmojiPlugin.js +4 -10
- package/lib/cjs/components/Editor/plugins/HorizontalRulePlugin.d.ts +8 -0
- package/lib/cjs/components/Editor/plugins/HorizontalRulePlugin.js +34 -0
- package/lib/cjs/components/Editor/plugins/LexicalRichTextPlugin.d.ts +2 -2
- package/lib/cjs/components/Editor/plugins/LexicalRichTextPlugin.js +2 -3
- package/lib/cjs/components/Editor/plugins/MediaPlugin.d.ts +14 -0
- package/lib/cjs/components/Editor/plugins/MediaPlugin.js +121 -0
- package/lib/cjs/components/Editor/plugins/ToolbarPlugin.d.ts +5 -0
- package/lib/cjs/components/Editor/plugins/ToolbarPlugin.js +3 -2
- package/lib/cjs/components/Editor/plugins/index.d.ts +2 -1
- package/lib/cjs/components/Editor/plugins/index.js +3 -1
- package/lib/cjs/components/Event/Event.js +6 -3
- package/lib/cjs/components/EventForm/EventAddress.js +1 -1
- package/lib/cjs/components/EventForm/EventForm.js +41 -23
- package/lib/cjs/components/EventForm/utils.d.ts +1 -0
- package/lib/cjs/components/EventForm/utils.js +6 -1
- package/lib/cjs/components/EventFormDialog/EventFormDialog.d.ts +1 -1
- package/lib/cjs/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/cjs/components/EventHeader/EventHeader.js +3 -2
- package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +12 -12
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +8 -8
- package/lib/cjs/components/EventMembersWidget/types.d.ts +4 -5
- package/lib/cjs/components/EventMembersWidget/types.js +7 -7
- package/lib/cjs/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
- package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +1 -1
- package/lib/cjs/components/Events/Events.d.ts +11 -0
- package/lib/cjs/components/Events/Events.js +21 -10
- package/lib/cjs/components/Events/OngoingEventsFilter.d.ts +8 -0
- package/lib/cjs/components/Events/OngoingEventsFilter.js +24 -0
- package/lib/cjs/components/FeedObject/Actions/Share/Share.js +4 -1
- package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/cjs/components/Footer/Footer.js +9 -6
- package/lib/cjs/components/Footer/constants.d.ts +1 -0
- package/lib/cjs/components/Footer/constants.js +2 -1
- package/lib/cjs/components/GroupForm/GroupForm.js +2 -2
- package/lib/cjs/components/GroupInvitedWidget/GroupInvitedWidget.js +1 -1
- package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +1 -1
- package/lib/cjs/components/Groups/Groups.js +18 -16
- package/lib/cjs/components/LessonAppbar/LessonAppbar.d.ts +42 -0
- package/lib/cjs/components/LessonAppbar/LessonAppbar.js +34 -0
- package/lib/cjs/components/LessonAppbar/constants.d.ts +1 -0
- package/lib/cjs/components/LessonAppbar/constants.js +4 -0
- package/lib/cjs/components/LessonAppbar/index.d.ts +3 -0
- package/lib/cjs/components/LessonAppbar/index.js +5 -0
- package/lib/cjs/components/LessonCommentObject/LessonCommentObject.d.ts +94 -0
- package/lib/cjs/components/LessonCommentObject/LessonCommentObject.js +202 -0
- package/lib/cjs/components/LessonCommentObject/Skeleton.d.ts +21 -0
- package/lib/cjs/components/LessonCommentObject/Skeleton.js +46 -0
- package/lib/cjs/components/LessonCommentObject/constants.d.ts +1 -0
- package/lib/cjs/components/LessonCommentObject/constants.js +4 -0
- package/lib/cjs/components/LessonCommentObject/index.d.ts +4 -0
- package/lib/cjs/components/LessonCommentObject/index.js +8 -0
- package/lib/cjs/components/LessonCommentObjects/LessonCommentObjects.d.ts +76 -0
- package/lib/cjs/components/LessonCommentObjects/LessonCommentObjects.js +185 -0
- package/lib/cjs/components/LessonCommentObjects/Skeleton.d.ts +23 -0
- package/lib/cjs/components/LessonCommentObjects/Skeleton.js +40 -0
- package/lib/cjs/components/LessonCommentObjects/constants.d.ts +1 -0
- package/lib/cjs/components/LessonCommentObjects/constants.js +4 -0
- package/lib/cjs/components/LessonCommentObjects/index.d.ts +4 -0
- package/lib/cjs/components/LessonCommentObjects/index.js +8 -0
- package/lib/cjs/components/LessonDrawer/LessonDrawer.d.ts +50 -0
- package/lib/cjs/components/LessonDrawer/LessonDrawer.js +37 -0
- package/lib/cjs/components/LessonDrawer/constants.d.ts +1 -0
- package/lib/cjs/components/LessonDrawer/constants.js +4 -0
- package/lib/cjs/components/LessonDrawer/index.d.ts +3 -0
- package/lib/cjs/components/LessonDrawer/index.js +5 -0
- package/lib/cjs/components/LessonEditForm/LessonEditForm.d.ts +24 -0
- package/lib/cjs/components/LessonEditForm/LessonEditForm.js +45 -0
- package/lib/cjs/components/LessonEditForm/constants.d.ts +1 -0
- package/lib/cjs/components/LessonEditForm/constants.js +4 -0
- package/lib/cjs/components/LessonEditForm/index.d.ts +3 -0
- package/lib/cjs/components/LessonEditForm/index.js +5 -0
- package/lib/cjs/components/LessonObject/LessonObject.d.ts +40 -0
- package/lib/cjs/components/LessonObject/LessonObject.js +70 -0
- package/lib/cjs/components/LessonObject/constants.d.ts +1 -0
- package/lib/cjs/components/LessonObject/constants.js +4 -0
- package/lib/cjs/components/LessonObject/index.d.ts +3 -0
- package/lib/cjs/components/LessonObject/index.js +5 -0
- package/lib/cjs/components/LessonReleaseMenu/LessonReleaseMenu.d.ts +26 -0
- package/lib/cjs/components/LessonReleaseMenu/LessonReleaseMenu.js +172 -0
- package/lib/cjs/components/LessonReleaseMenu/constants.d.ts +5 -0
- package/lib/cjs/components/LessonReleaseMenu/constants.js +9 -0
- package/lib/cjs/components/LessonReleaseMenu/index.d.ts +3 -0
- package/lib/cjs/components/LessonReleaseMenu/index.js +5 -0
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +65 -6
- package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.js +8 -3
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +8 -6
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +3 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +2 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +2 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.d.ts +9 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +106 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.d.ts +4 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.js +37 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +1 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +2 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +3 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +45 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +62 -5
- package/lib/cjs/components/NavigationMenuIconButton/DefaultDrawerContent.js +7 -5
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +3 -1
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +13 -6
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +14 -3
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
- package/lib/cjs/components/Notification/Course/Course.d.ts +15 -0
- package/lib/cjs/components/Notification/Course/Course.js +89 -0
- package/lib/cjs/components/Notification/Course/index.d.ts +3 -0
- package/lib/cjs/components/Notification/Course/index.js +5 -0
- package/lib/cjs/components/Notification/Course/utils.d.ts +5 -0
- package/lib/cjs/components/Notification/Course/utils.js +44 -0
- package/lib/cjs/components/Notification/Event/Event.js +20 -2
- package/lib/cjs/components/Notification/Notification.js +9 -0
- package/lib/cjs/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -2
- package/lib/cjs/components/SearchDialog/SearchDialog.d.ts +4 -1
- package/lib/cjs/components/SearchDialog/SearchDialog.js +2 -2
- package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +9 -0
- package/lib/cjs/components/TagAutocomplete/TagAutocomplete.js +2 -2
- package/lib/cjs/components/ToastNotifications/ToastNotifications.js +9 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/Skeleton.d.ts +21 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/Skeleton.js +43 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/UserCreatedCoursesWidget.d.ts +63 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/UserCreatedCoursesWidget.js +154 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/constants.d.ts +1 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/constants.js +4 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/index.d.ts +4 -0
- package/lib/cjs/components/UserCreatedCoursesWidget/index.js +8 -0
- package/lib/cjs/constants/Course.d.ts +6 -0
- package/lib/cjs/constants/Course.js +10 -0
- package/lib/cjs/constants/LiveStream.d.ts +1 -0
- package/lib/cjs/constants/LiveStream.js +2 -1
- package/lib/cjs/constants/PubSub.d.ts +14 -0
- package/lib/cjs/constants/PubSub.js +16 -1
- package/lib/cjs/index.d.ts +23 -2
- package/lib/cjs/index.js +60 -5
- package/lib/cjs/shared/AccordionLessons/AccordionLessons.d.ts +8 -0
- package/lib/cjs/shared/AccordionLessons/AccordionLessons.js +65 -0
- package/lib/cjs/shared/AccordionLessons/Skeleton.d.ts +1 -0
- package/lib/cjs/shared/AccordionLessons/Skeleton.js +21 -0
- package/lib/cjs/shared/AccordionLessons/constants.d.ts +1 -0
- package/lib/cjs/shared/AccordionLessons/constants.js +4 -0
- package/lib/cjs/shared/AccordionLessons/index.d.ts +4 -0
- package/lib/cjs/shared/AccordionLessons/index.js +8 -0
- package/lib/cjs/shared/AddUsersButton/AddUsersButton.d.ts +29 -0
- package/lib/cjs/shared/AddUsersButton/AddUsersButton.js +136 -0
- package/lib/cjs/shared/AddUsersButton/index.d.ts +3 -0
- package/lib/cjs/shared/AddUsersButton/index.js +5 -0
- package/lib/cjs/shared/CourseTypePopover/CourseTypePopover.d.ts +9 -0
- package/lib/cjs/shared/CourseTypePopover/CourseTypePopover.js +48 -0
- package/lib/cjs/shared/CourseTypePopover/index.d.ts +3 -0
- package/lib/cjs/shared/CourseTypePopover/index.js +5 -0
- package/lib/cjs/shared/CourseUsersTable/ChangeUsersStatus.d.ts +9 -0
- package/lib/cjs/shared/CourseUsersTable/ChangeUsersStatus.js +58 -0
- package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.d.ts +21 -0
- package/lib/cjs/shared/CourseUsersTable/CourseUsersTable.js +155 -0
- package/lib/cjs/shared/CourseUsersTable/RemoveButton.d.ts +10 -0
- package/lib/cjs/shared/CourseUsersTable/RemoveButton.js +51 -0
- package/lib/cjs/shared/CourseUsersTable/RequestButton.d.ts +10 -0
- package/lib/cjs/shared/CourseUsersTable/RequestButton.js +79 -0
- package/lib/cjs/shared/CourseUsersTable/RowSkeleton.d.ts +8 -0
- package/lib/cjs/shared/CourseUsersTable/RowSkeleton.js +14 -0
- package/lib/cjs/shared/CourseUsersTable/SeeProgressButton.d.ts +9 -0
- package/lib/cjs/shared/CourseUsersTable/SeeProgressButton.js +56 -0
- package/lib/cjs/shared/CourseUsersTable/Skeleton.d.ts +1 -0
- package/lib/cjs/shared/CourseUsersTable/Skeleton.js +19 -0
- package/lib/cjs/shared/CourseUsersTable/constants.d.ts +1 -0
- package/lib/cjs/shared/CourseUsersTable/constants.js +4 -0
- package/lib/cjs/shared/CourseUsersTable/index.d.ts +4 -0
- package/lib/cjs/shared/CourseUsersTable/index.js +8 -0
- package/lib/cjs/shared/DateTimeAgo/index.d.ts +1 -1
- package/lib/cjs/shared/EmptyStatus/EmptyStatus.d.ts +11 -0
- package/lib/cjs/shared/EmptyStatus/EmptyStatus.js +26 -0
- package/lib/cjs/shared/EmptyStatus/index.d.ts +3 -0
- package/lib/cjs/shared/EmptyStatus/index.js +5 -0
- package/lib/cjs/shared/EventActionsMenu/index.js +5 -1
- package/lib/cjs/shared/LessonCommentActionsMenu/index.d.ts +41 -0
- package/lib/cjs/shared/LessonCommentActionsMenu/index.js +197 -0
- package/lib/cjs/shared/LessonFilePreview/index.d.ts +12 -0
- package/lib/cjs/shared/LessonFilePreview/index.js +29 -0
- package/lib/cjs/shared/Media/Link/UrlTextField/index.js +2 -3
- package/lib/cjs/shared/UpScalingTierBadge/index.js +9 -0
- package/lib/cjs/types/course.d.ts +40 -0
- package/lib/cjs/types/course.js +33 -0
- package/lib/cjs/types/index.d.ts +2 -1
- package/lib/cjs/types/index.js +6 -1
- package/lib/cjs/utils/buttonCounters.d.ts +1 -0
- package/lib/cjs/utils/buttonCounters.js +4 -3
- package/lib/cjs/utils/course.d.ts +14 -0
- package/lib/cjs/utils/course.js +39 -0
- package/lib/cjs/utils/events.d.ts +1 -0
- package/lib/cjs/utils/events.js +6 -1
- package/lib/esm/assets/courses/clapping.d.ts +1 -0
- package/lib/esm/assets/courses/clapping.js +1 -0
- package/lib/esm/components/BottomNavigation/BottomNavigation.js +17 -2
- package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.d.ts +5 -0
- package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.js +9 -11
- package/lib/esm/components/CommentObject/CommentObject.d.ts +5 -0
- package/lib/esm/components/CommentObject/CommentObject.js +2 -2
- package/lib/esm/components/CommentObjectReply/CommentObjectReply.d.ts +24 -2
- package/lib/esm/components/CommentObjectReply/CommentObjectReply.js +18 -5
- package/lib/esm/components/Composer/Content/ContentLesson/ContentLesson.d.ts +38 -0
- package/lib/esm/components/Composer/Content/ContentLesson/ContentLesson.js +64 -0
- package/lib/esm/components/Composer/Content/ContentLesson/index.d.ts +3 -0
- package/lib/esm/components/Composer/Content/ContentLesson/index.js +2 -0
- package/lib/esm/components/Composer/Layer/AudienceLayer/AudienceLayer.js +2 -2
- package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +1 -1
- package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.js +4 -1
- package/lib/esm/components/ComposerIconButton/ComposerIconButton.d.ts +9 -3
- package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +47 -10
- package/lib/esm/components/Course/Course.d.ts +92 -0
- package/lib/esm/components/Course/Course.js +182 -0
- package/lib/esm/components/Course/CreatePlaceholder.d.ts +39 -0
- package/lib/esm/components/Course/CreatePlaceholder.js +56 -0
- package/lib/esm/components/Course/Skeleton.d.ts +51 -0
- package/lib/esm/components/Course/Skeleton.js +74 -0
- package/lib/esm/components/Course/constants.d.ts +1 -0
- package/lib/esm/components/Course/constants.js +1 -0
- package/lib/esm/components/Course/index.d.ts +4 -0
- package/lib/esm/components/Course/index.js +4 -0
- package/lib/esm/components/CourseCompletedDialog/CourseCompletedDialog.d.ts +9 -0
- package/lib/esm/components/CourseCompletedDialog/CourseCompletedDialog.js +37 -0
- package/lib/esm/components/CourseCompletedDialog/index.d.ts +3 -0
- package/lib/esm/components/CourseCompletedDialog/index.js +2 -0
- package/lib/esm/components/CourseContentMenu/CourseContentMenu.d.ts +25 -0
- package/lib/esm/components/CourseContentMenu/CourseContentMenu.js +44 -0
- package/lib/esm/components/CourseContentMenu/constants.d.ts +1 -0
- package/lib/esm/components/CourseContentMenu/constants.js +1 -0
- package/lib/esm/components/CourseContentMenu/index.d.ts +3 -0
- package/lib/esm/components/CourseContentMenu/index.js +2 -0
- package/lib/esm/components/CourseDashboard/Header/Skeleton.d.ts +1 -0
- package/lib/esm/components/CourseDashboard/Header/Skeleton.js +13 -0
- package/lib/esm/components/CourseDashboard/Header.d.ts +9 -0
- package/lib/esm/components/CourseDashboard/Header.js +41 -0
- package/lib/esm/components/CourseDashboard/Student/ActionButton.d.ts +8 -0
- package/lib/esm/components/CourseDashboard/Student/ActionButton.js +13 -0
- package/lib/esm/components/CourseDashboard/Student/Skeleton.d.ts +1 -0
- package/lib/esm/components/CourseDashboard/Student/Skeleton.js +26 -0
- package/lib/esm/components/CourseDashboard/Student.d.ts +11 -0
- package/lib/esm/components/CourseDashboard/Student.js +201 -0
- package/lib/esm/components/CourseDashboard/Teacher/Comments.d.ts +9 -0
- package/lib/esm/components/CourseDashboard/Teacher/Comments.js +106 -0
- package/lib/esm/components/CourseDashboard/Teacher/Info.d.ts +11 -0
- package/lib/esm/components/CourseDashboard/Teacher/Info.js +16 -0
- package/lib/esm/components/CourseDashboard/Teacher/Skeleton.d.ts +1 -0
- package/lib/esm/components/CourseDashboard/Teacher/Skeleton.js +21 -0
- package/lib/esm/components/CourseDashboard/Teacher/Students.d.ts +10 -0
- package/lib/esm/components/CourseDashboard/Teacher/Students.js +68 -0
- package/lib/esm/components/CourseDashboard/Teacher.d.ts +11 -0
- package/lib/esm/components/CourseDashboard/Teacher.js +60 -0
- package/lib/esm/components/CourseDashboard/constants.d.ts +1 -0
- package/lib/esm/components/CourseDashboard/constants.js +1 -0
- package/lib/esm/components/CourseDashboard/index.d.ts +11 -0
- package/lib/esm/components/CourseDashboard/index.js +6 -0
- package/lib/esm/components/CourseDashboard/types.d.ts +8 -0
- package/lib/esm/components/CourseDashboard/types.js +10 -0
- package/lib/esm/components/CourseForm/CourseForm.d.ts +74 -0
- package/lib/esm/components/CourseForm/CourseForm.js +270 -0
- package/lib/esm/components/CourseForm/Dialog.d.ts +8 -0
- package/lib/esm/components/CourseForm/Dialog.js +16 -0
- package/lib/esm/components/CourseForm/Edit.d.ts +24 -0
- package/lib/esm/components/CourseForm/Edit.js +50 -0
- package/lib/esm/components/CourseForm/Skeleton.d.ts +1 -0
- package/lib/esm/components/CourseForm/Skeleton.js +14 -0
- package/lib/esm/components/CourseForm/UploadCourseCover.d.ts +45 -0
- package/lib/esm/components/CourseForm/UploadCourseCover.js +91 -0
- package/lib/esm/components/CourseForm/constants.d.ts +1 -0
- package/lib/esm/components/CourseForm/constants.js +1 -0
- package/lib/esm/components/CourseForm/index.d.ts +4 -0
- package/lib/esm/components/CourseForm/index.js +4 -0
- package/lib/esm/components/CourseFormDialog/CourseFormDialog.d.ts +48 -0
- package/lib/esm/components/CourseFormDialog/CourseFormDialog.js +64 -0
- package/lib/esm/components/CourseFormDialog/constants.d.ts +1 -0
- package/lib/esm/components/CourseFormDialog/constants.js +1 -0
- package/lib/esm/components/CourseFormDialog/index.d.ts +3 -0
- package/lib/esm/components/CourseFormDialog/index.js +2 -0
- package/lib/esm/components/CourseJoinButton/CourseJoinButton.d.ts +56 -0
- package/lib/esm/components/CourseJoinButton/CourseJoinButton.js +145 -0
- package/lib/esm/components/CourseJoinButton/index.d.ts +3 -0
- package/lib/esm/components/CourseJoinButton/index.js +2 -0
- package/lib/esm/components/CourseParticipantsButton/CourseParticipantsButton.d.ts +53 -0
- package/lib/esm/components/CourseParticipantsButton/CourseParticipantsButton.js +147 -0
- package/lib/esm/components/CourseParticipantsButton/index.d.ts +3 -0
- package/lib/esm/components/CourseParticipantsButton/index.js +2 -0
- package/lib/esm/components/Courses/Courses.d.ts +100 -0
- package/lib/esm/components/Courses/Courses.js +233 -0
- package/lib/esm/components/Courses/Skeleton.d.ts +54 -0
- package/lib/esm/components/Courses/Skeleton.js +42 -0
- package/lib/esm/components/Courses/constants.d.ts +1 -0
- package/lib/esm/components/Courses/constants.js +1 -0
- package/lib/esm/components/Courses/index.d.ts +4 -0
- package/lib/esm/components/Courses/index.js +4 -0
- package/lib/esm/components/Courses/prefetchedCourses.d.ts +81 -0
- package/lib/esm/components/Courses/prefetchedCourses.js +183 -0
- package/lib/esm/components/CreateCourseButton/CreateCourseButton.d.ts +38 -0
- package/lib/esm/components/CreateCourseButton/CreateCourseButton.js +78 -0
- package/lib/esm/components/CreateCourseButton/index.d.ts +3 -0
- package/lib/esm/components/CreateCourseButton/index.js +2 -0
- package/lib/esm/components/CreateEventButton/CreateEventButton.d.ts +1 -1
- package/lib/esm/components/CreateEventButton/CreateEventButton.js +1 -1
- package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -6
- package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.js +2 -9
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +10 -4
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +17 -11
- package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +12 -4
- package/lib/esm/components/EditCourse/Customize.d.ts +9 -0
- package/lib/esm/components/EditCourse/Customize.js +28 -0
- package/lib/esm/components/EditCourse/EditCourse.d.ts +13 -0
- package/lib/esm/components/EditCourse/EditCourse.js +107 -0
- package/lib/esm/components/EditCourse/Lessons/AddButton.d.ts +9 -0
- package/lib/esm/components/EditCourse/Lessons/AddButton.js +27 -0
- package/lib/esm/components/EditCourse/Lessons/ChangeLessonStatus.d.ts +13 -0
- package/lib/esm/components/EditCourse/Lessons/ChangeLessonStatus.js +89 -0
- package/lib/esm/components/EditCourse/Lessons/FieldName.d.ts +15 -0
- package/lib/esm/components/EditCourse/Lessons/FieldName.js +80 -0
- package/lib/esm/components/EditCourse/Lessons/LessonRow.d.ts +15 -0
- package/lib/esm/components/EditCourse/Lessons/LessonRow.js +65 -0
- package/lib/esm/components/EditCourse/Lessons/SectionRow.d.ts +14 -0
- package/lib/esm/components/EditCourse/Lessons/SectionRow.js +155 -0
- package/lib/esm/components/EditCourse/Lessons/Skeleton.d.ts +1 -0
- package/lib/esm/components/EditCourse/Lessons/Skeleton.js +17 -0
- package/lib/esm/components/EditCourse/Lessons.d.ts +11 -0
- package/lib/esm/components/EditCourse/Lessons.js +193 -0
- package/lib/esm/components/EditCourse/MenuRow.d.ts +9 -0
- package/lib/esm/components/EditCourse/MenuRow.js +22 -0
- package/lib/esm/components/EditCourse/Options/Skeleton.d.ts +1 -0
- package/lib/esm/components/EditCourse/Options/Skeleton.js +12 -0
- package/lib/esm/components/EditCourse/Options/SwitchForm.d.ts +11 -0
- package/lib/esm/components/EditCourse/Options/SwitchForm.js +18 -0
- package/lib/esm/components/EditCourse/Options.d.ts +9 -0
- package/lib/esm/components/EditCourse/Options.js +93 -0
- package/lib/esm/components/EditCourse/Requests.d.ts +12 -0
- package/lib/esm/components/EditCourse/Requests.js +94 -0
- package/lib/esm/components/EditCourse/Skeleton.d.ts +8 -0
- package/lib/esm/components/EditCourse/Skeleton.js +25 -0
- package/lib/esm/components/EditCourse/Status.d.ts +9 -0
- package/lib/esm/components/EditCourse/Status.js +29 -0
- package/lib/esm/components/EditCourse/Users/Skeleton.d.ts +1 -0
- package/lib/esm/components/EditCourse/Users/Skeleton.js +12 -0
- package/lib/esm/components/EditCourse/Users.d.ts +11 -0
- package/lib/esm/components/EditCourse/Users.js +137 -0
- package/lib/esm/components/EditCourse/constants.d.ts +1 -0
- package/lib/esm/components/EditCourse/constants.js +1 -0
- package/lib/esm/components/EditCourse/hooks.d.ts +3 -0
- package/lib/esm/components/EditCourse/hooks.js +17 -0
- package/lib/esm/components/EditCourse/index.d.ts +4 -0
- package/lib/esm/components/EditCourse/index.js +4 -0
- package/lib/esm/components/EditCourse/types.d.ts +29 -0
- package/lib/esm/components/EditCourse/types.js +16 -0
- package/lib/esm/components/Editor/Editor.d.ts +37 -0
- package/lib/esm/components/Editor/Editor.js +14 -11
- package/lib/esm/components/Editor/nodes/HashtagNode.js +2 -0
- package/lib/esm/components/Editor/nodes/MentionNode.js +2 -0
- package/lib/esm/components/Editor/plugins/EmojiPlugin.d.ts +3 -1
- package/lib/esm/components/Editor/plugins/EmojiPlugin.js +4 -10
- package/lib/esm/components/Editor/plugins/HorizontalRulePlugin.d.ts +8 -0
- package/lib/esm/components/Editor/plugins/HorizontalRulePlugin.js +30 -0
- package/lib/esm/components/Editor/plugins/LexicalRichTextPlugin.d.ts +2 -2
- package/lib/esm/components/Editor/plugins/LexicalRichTextPlugin.js +1 -1
- package/lib/esm/components/Editor/plugins/MediaPlugin.d.ts +14 -0
- package/lib/esm/components/Editor/plugins/MediaPlugin.js +117 -0
- package/lib/esm/components/Editor/plugins/ToolbarPlugin.d.ts +5 -0
- package/lib/esm/components/Editor/plugins/ToolbarPlugin.js +3 -2
- package/lib/esm/components/Editor/plugins/index.d.ts +2 -1
- package/lib/esm/components/Editor/plugins/index.js +2 -1
- package/lib/esm/components/Event/Event.js +6 -3
- package/lib/esm/components/EventForm/EventAddress.js +1 -1
- package/lib/esm/components/EventForm/EventForm.js +43 -25
- package/lib/esm/components/EventForm/utils.d.ts +1 -0
- package/lib/esm/components/EventForm/utils.js +4 -0
- package/lib/esm/components/EventFormDialog/EventFormDialog.d.ts +1 -1
- package/lib/esm/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/esm/components/EventHeader/EventHeader.js +3 -2
- package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +14 -14
- package/lib/esm/components/EventMembersWidget/TabContentComponent.js +9 -9
- package/lib/esm/components/EventMembersWidget/types.d.ts +4 -5
- package/lib/esm/components/EventMembersWidget/types.js +6 -6
- package/lib/esm/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
- package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +1 -1
- package/lib/esm/components/Events/Events.d.ts +11 -0
- package/lib/esm/components/Events/Events.js +22 -11
- package/lib/esm/components/Events/OngoingEventsFilter.d.ts +8 -0
- package/lib/esm/components/Events/OngoingEventsFilter.js +21 -0
- package/lib/esm/components/FeedObject/Actions/Share/Share.js +4 -1
- package/lib/esm/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/esm/components/Footer/Footer.js +10 -7
- package/lib/esm/components/Footer/constants.d.ts +1 -0
- package/lib/esm/components/Footer/constants.js +1 -0
- package/lib/esm/components/GroupForm/GroupForm.js +2 -2
- package/lib/esm/components/GroupInvitedWidget/GroupInvitedWidget.js +1 -1
- package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +1 -1
- package/lib/esm/components/Groups/Groups.js +21 -19
- package/lib/esm/components/LessonAppbar/LessonAppbar.d.ts +42 -0
- package/lib/esm/components/LessonAppbar/LessonAppbar.js +31 -0
- package/lib/esm/components/LessonAppbar/constants.d.ts +1 -0
- package/lib/esm/components/LessonAppbar/constants.js +1 -0
- package/lib/esm/components/LessonAppbar/index.d.ts +3 -0
- package/lib/esm/components/LessonAppbar/index.js +2 -0
- package/lib/esm/components/LessonCommentObject/LessonCommentObject.d.ts +94 -0
- package/lib/esm/components/LessonCommentObject/LessonCommentObject.js +199 -0
- package/lib/esm/components/LessonCommentObject/Skeleton.d.ts +21 -0
- package/lib/esm/components/LessonCommentObject/Skeleton.js +43 -0
- package/lib/esm/components/LessonCommentObject/constants.d.ts +1 -0
- package/lib/esm/components/LessonCommentObject/constants.js +1 -0
- package/lib/esm/components/LessonCommentObject/index.d.ts +4 -0
- package/lib/esm/components/LessonCommentObject/index.js +4 -0
- package/lib/esm/components/LessonCommentObjects/LessonCommentObjects.d.ts +76 -0
- package/lib/esm/components/LessonCommentObjects/LessonCommentObjects.js +182 -0
- package/lib/esm/components/LessonCommentObjects/Skeleton.d.ts +23 -0
- package/lib/esm/components/LessonCommentObjects/Skeleton.js +37 -0
- package/lib/esm/components/LessonCommentObjects/constants.d.ts +1 -0
- package/lib/esm/components/LessonCommentObjects/constants.js +1 -0
- package/lib/esm/components/LessonCommentObjects/index.d.ts +4 -0
- package/lib/esm/components/LessonCommentObjects/index.js +4 -0
- package/lib/esm/components/LessonDrawer/LessonDrawer.d.ts +50 -0
- package/lib/esm/components/LessonDrawer/LessonDrawer.js +34 -0
- package/lib/esm/components/LessonDrawer/constants.d.ts +1 -0
- package/lib/esm/components/LessonDrawer/constants.js +1 -0
- package/lib/esm/components/LessonDrawer/index.d.ts +3 -0
- package/lib/esm/components/LessonDrawer/index.js +2 -0
- package/lib/esm/components/LessonEditForm/LessonEditForm.d.ts +24 -0
- package/lib/esm/components/LessonEditForm/LessonEditForm.js +42 -0
- package/lib/esm/components/LessonEditForm/constants.d.ts +1 -0
- package/lib/esm/components/LessonEditForm/constants.js +1 -0
- package/lib/esm/components/LessonEditForm/index.d.ts +3 -0
- package/lib/esm/components/LessonEditForm/index.js +2 -0
- package/lib/esm/components/LessonObject/LessonObject.d.ts +40 -0
- package/lib/esm/components/LessonObject/LessonObject.js +67 -0
- package/lib/esm/components/LessonObject/constants.d.ts +1 -0
- package/lib/esm/components/LessonObject/constants.js +1 -0
- package/lib/esm/components/LessonObject/index.d.ts +3 -0
- package/lib/esm/components/LessonObject/index.js +2 -0
- package/lib/esm/components/LessonReleaseMenu/LessonReleaseMenu.d.ts +26 -0
- package/lib/esm/components/LessonReleaseMenu/LessonReleaseMenu.js +169 -0
- package/lib/esm/components/LessonReleaseMenu/constants.d.ts +5 -0
- package/lib/esm/components/LessonReleaseMenu/constants.js +6 -0
- package/lib/esm/components/LessonReleaseMenu/index.d.ts +3 -0
- package/lib/esm/components/LessonReleaseMenu/index.js +2 -0
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +67 -8
- package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.js +8 -3
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +8 -6
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +3 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +2 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +2 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.d.ts +9 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +103 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.d.ts +4 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.js +34 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +1 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +2 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +3 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +45 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +66 -9
- package/lib/esm/components/NavigationMenuIconButton/DefaultDrawerContent.js +9 -7
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +3 -1
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +13 -6
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +14 -3
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
- package/lib/esm/components/Notification/Course/Course.d.ts +15 -0
- package/lib/esm/components/Notification/Course/Course.js +86 -0
- package/lib/esm/components/Notification/Course/index.d.ts +3 -0
- package/lib/esm/components/Notification/Course/index.js +2 -0
- package/lib/esm/components/Notification/Course/utils.d.ts +5 -0
- package/lib/esm/components/Notification/Course/utils.js +39 -0
- package/lib/esm/components/Notification/Event/Event.js +21 -3
- package/lib/esm/components/Notification/Notification.js +9 -0
- package/lib/esm/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -2
- package/lib/esm/components/SearchDialog/SearchDialog.d.ts +4 -1
- package/lib/esm/components/SearchDialog/SearchDialog.js +2 -2
- package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +9 -0
- package/lib/esm/components/TagAutocomplete/TagAutocomplete.js +2 -2
- package/lib/esm/components/ToastNotifications/ToastNotifications.js +9 -0
- package/lib/esm/components/UserCreatedCoursesWidget/Skeleton.d.ts +21 -0
- package/lib/esm/components/UserCreatedCoursesWidget/Skeleton.js +39 -0
- package/lib/esm/components/UserCreatedCoursesWidget/UserCreatedCoursesWidget.d.ts +63 -0
- package/lib/esm/components/UserCreatedCoursesWidget/UserCreatedCoursesWidget.js +151 -0
- package/lib/esm/components/UserCreatedCoursesWidget/constants.d.ts +1 -0
- package/lib/esm/components/UserCreatedCoursesWidget/constants.js +1 -0
- package/lib/esm/components/UserCreatedCoursesWidget/index.d.ts +4 -0
- package/lib/esm/components/UserCreatedCoursesWidget/index.js +4 -0
- package/lib/esm/constants/Course.d.ts +6 -0
- package/lib/esm/constants/Course.js +7 -0
- package/lib/esm/constants/LiveStream.d.ts +1 -0
- package/lib/esm/constants/LiveStream.js +1 -0
- package/lib/esm/constants/PubSub.d.ts +14 -0
- package/lib/esm/constants/PubSub.js +15 -0
- package/lib/esm/index.d.ts +23 -2
- package/lib/esm/index.js +26 -5
- package/lib/esm/shared/AccordionLessons/AccordionLessons.d.ts +8 -0
- package/lib/esm/shared/AccordionLessons/AccordionLessons.js +61 -0
- package/lib/esm/shared/AccordionLessons/Skeleton.d.ts +1 -0
- package/lib/esm/shared/AccordionLessons/Skeleton.js +18 -0
- package/lib/esm/shared/AccordionLessons/constants.d.ts +1 -0
- package/lib/esm/shared/AccordionLessons/constants.js +1 -0
- package/lib/esm/shared/AccordionLessons/index.d.ts +4 -0
- package/lib/esm/shared/AccordionLessons/index.js +4 -0
- package/lib/esm/shared/AddUsersButton/AddUsersButton.d.ts +29 -0
- package/lib/esm/shared/AddUsersButton/AddUsersButton.js +134 -0
- package/lib/esm/shared/AddUsersButton/index.d.ts +3 -0
- package/lib/esm/shared/AddUsersButton/index.js +2 -0
- package/lib/esm/shared/CourseTypePopover/CourseTypePopover.d.ts +9 -0
- package/lib/esm/shared/CourseTypePopover/CourseTypePopover.js +45 -0
- package/lib/esm/shared/CourseTypePopover/index.d.ts +3 -0
- package/lib/esm/shared/CourseTypePopover/index.js +2 -0
- package/lib/esm/shared/CourseUsersTable/ChangeUsersStatus.d.ts +9 -0
- package/lib/esm/shared/CourseUsersTable/ChangeUsersStatus.js +56 -0
- package/lib/esm/shared/CourseUsersTable/CourseUsersTable.d.ts +21 -0
- package/lib/esm/shared/CourseUsersTable/CourseUsersTable.js +152 -0
- package/lib/esm/shared/CourseUsersTable/RemoveButton.d.ts +10 -0
- package/lib/esm/shared/CourseUsersTable/RemoveButton.js +48 -0
- package/lib/esm/shared/CourseUsersTable/RequestButton.d.ts +10 -0
- package/lib/esm/shared/CourseUsersTable/RequestButton.js +76 -0
- package/lib/esm/shared/CourseUsersTable/RowSkeleton.d.ts +8 -0
- package/lib/esm/shared/CourseUsersTable/RowSkeleton.js +11 -0
- package/lib/esm/shared/CourseUsersTable/SeeProgressButton.d.ts +9 -0
- package/lib/esm/shared/CourseUsersTable/SeeProgressButton.js +53 -0
- package/lib/esm/shared/CourseUsersTable/Skeleton.d.ts +1 -0
- package/lib/esm/shared/CourseUsersTable/Skeleton.js +15 -0
- package/lib/esm/shared/CourseUsersTable/constants.d.ts +1 -0
- package/lib/esm/shared/CourseUsersTable/constants.js +1 -0
- package/lib/esm/shared/CourseUsersTable/index.d.ts +4 -0
- package/lib/esm/shared/CourseUsersTable/index.js +4 -0
- package/lib/esm/shared/DateTimeAgo/index.d.ts +1 -1
- package/lib/esm/shared/EmptyStatus/EmptyStatus.d.ts +11 -0
- package/lib/esm/shared/EmptyStatus/EmptyStatus.js +23 -0
- package/lib/esm/shared/EmptyStatus/index.d.ts +3 -0
- package/lib/esm/shared/EmptyStatus/index.js +2 -0
- package/lib/esm/shared/EventActionsMenu/index.js +6 -2
- package/lib/esm/shared/LessonCommentActionsMenu/index.d.ts +41 -0
- package/lib/esm/shared/LessonCommentActionsMenu/index.js +194 -0
- package/lib/esm/shared/LessonFilePreview/index.d.ts +12 -0
- package/lib/esm/shared/LessonFilePreview/index.js +25 -0
- package/lib/esm/shared/Media/Link/UrlTextField/index.js +3 -4
- package/lib/esm/shared/UpScalingTierBadge/index.js +9 -0
- package/lib/esm/types/course.d.ts +40 -0
- package/lib/esm/types/course.js +30 -0
- package/lib/esm/types/index.d.ts +2 -1
- package/lib/esm/types/index.js +2 -1
- package/lib/esm/utils/buttonCounters.d.ts +1 -0
- package/lib/esm/utils/buttonCounters.js +3 -2
- package/lib/esm/utils/course.d.ts +14 -0
- package/lib/esm/utils/course.js +32 -0
- package/lib/esm/utils/events.d.ts +1 -0
- package/lib/esm/utils/events.js +4 -0
- package/lib/umd/578.js +2 -0
- package/lib/umd/60a7fdeaadfe844bc015.woff2 +0 -0
- package/lib/umd/assets/icons.svg +9 -3
- package/lib/umd/{c3528e120c4e831db2ae.woff → b6dbec3d5816ff8baef1.woff} +0 -0
- package/lib/umd/{2aa155858f48b8f3911a.eot → ba74e493633796d551d1.ttf} +0 -0
- package/lib/umd/{a221d3aba0f6753cfbb7.ttf → c473ce30406a3dad83e1.eot} +0 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +16 -14
- package/lib/umd/36f3af7f155d916c26ff.woff2 +0 -0
- package/lib/umd/653.js +0 -2
- /package/lib/umd/{653.js.LICENSE.txt → 578.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LoadingButton } from '@mui/lab';
|
|
3
|
+
import { debounce, Icon, IconButton, Stack, TextField, Typography } from '@mui/material';
|
|
4
|
+
import { Fragment, memo, useCallback, useState } from 'react';
|
|
5
|
+
import { PREFIX } from '../constants';
|
|
6
|
+
import { Logger } from '@selfcommunity/utils';
|
|
7
|
+
import { SCOPE_SC_UI } from '../../../constants/Errors';
|
|
8
|
+
import { FormattedMessage } from 'react-intl';
|
|
9
|
+
import { useSnackbar } from 'notistack';
|
|
10
|
+
import { SCCourseLessonTypologyType } from '@selfcommunity/types';
|
|
11
|
+
import { http } from '@selfcommunity/api-services';
|
|
12
|
+
import { ActionLessonType } from '../types';
|
|
13
|
+
import PubSub from 'pubsub-js';
|
|
14
|
+
import { SCGroupEventType, SCTopicType } from '../../../constants/PubSub';
|
|
15
|
+
const classes = {
|
|
16
|
+
editModeWrapper: `${PREFIX}-edit-mode-wrapper`,
|
|
17
|
+
editModeSaveButton: `${PREFIX}-edit-mode-save-button`,
|
|
18
|
+
editModeCloseButton: `${PREFIX}-edit-mode-close-button`
|
|
19
|
+
};
|
|
20
|
+
function FieldName(props) {
|
|
21
|
+
// PROPS
|
|
22
|
+
const { endpoint, row, isNewRow, handleManageRow, editMode, handleDisableEditMode } = props;
|
|
23
|
+
// STATES
|
|
24
|
+
const [loading, setLoading] = useState(false);
|
|
25
|
+
const [name, setName] = useState(row.name);
|
|
26
|
+
// HOOKS
|
|
27
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
28
|
+
// DEBOUNCE
|
|
29
|
+
const debounceSetData = debounce((newName) => {
|
|
30
|
+
setName(newName);
|
|
31
|
+
}, 300);
|
|
32
|
+
// HANDLERS
|
|
33
|
+
const handleChange = useCallback((e) => {
|
|
34
|
+
debounceSetData(e.target.value);
|
|
35
|
+
}, [debounceSetData]);
|
|
36
|
+
const handleSubmit = useCallback(() => {
|
|
37
|
+
setLoading(true);
|
|
38
|
+
http
|
|
39
|
+
.request({
|
|
40
|
+
url: endpoint.url(),
|
|
41
|
+
method: endpoint.method,
|
|
42
|
+
data: {
|
|
43
|
+
name,
|
|
44
|
+
type: SCCourseLessonTypologyType.LESSON
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
.then((response) => {
|
|
48
|
+
handleManageRow(response.data, isNewRow ? ActionLessonType.ADD : ActionLessonType.RENAME);
|
|
49
|
+
setName(null);
|
|
50
|
+
setLoading(false);
|
|
51
|
+
handleDisableEditMode();
|
|
52
|
+
if (isNewRow) {
|
|
53
|
+
PubSub.publish(`${SCTopicType.COURSE}.${SCGroupEventType.UPDATE}`, false);
|
|
54
|
+
}
|
|
55
|
+
enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.editCourse.tab.lessons.table.snackbar.save", defaultMessage: "ui.editCourse.tab.lessons.table.snackbar.save" }), {
|
|
56
|
+
variant: 'success',
|
|
57
|
+
autoHideDuration: 3000
|
|
58
|
+
});
|
|
59
|
+
})
|
|
60
|
+
.catch((error) => {
|
|
61
|
+
Logger.error(SCOPE_SC_UI, error);
|
|
62
|
+
enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
|
|
63
|
+
variant: 'error',
|
|
64
|
+
autoHideDuration: 3000
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}, [isNewRow, name, endpoint, setLoading, handleDisableEditMode, handleManageRow]);
|
|
68
|
+
const handleClose = useCallback(() => {
|
|
69
|
+
if (isNewRow) {
|
|
70
|
+
handleManageRow(row, ActionLessonType.DELETE, true);
|
|
71
|
+
PubSub.publish(`${SCTopicType.COURSE}.${SCGroupEventType.UPDATE}`, false);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
setName(null);
|
|
75
|
+
handleDisableEditMode();
|
|
76
|
+
}
|
|
77
|
+
}, [row, isNewRow, handleManageRow, setName, handleDisableEditMode]);
|
|
78
|
+
return (_jsx(Fragment, { children: isNewRow || editMode ? (_jsxs(Stack, Object.assign({ className: classes.editModeWrapper }, { children: [_jsx(TextField, { type: "text", variant: "outlined", size: "small", focused: true, autoFocus: true, defaultValue: row.name, onChange: handleChange }), _jsx(LoadingButton, Object.assign({ size: "small", color: "primary", variant: "outlined", onClick: handleSubmit, loading: loading, disabled: loading, className: classes.editModeSaveButton }, { children: _jsx(Icon, { children: "check" }) })), _jsx(IconButton, Object.assign({ color: "default", size: "small", onClick: handleClose, className: classes.editModeCloseButton }, { children: _jsx(Icon, { children: "close" }) }))] }))) : (_jsx(Typography, Object.assign({ variant: "body1" }, { children: row.name }))) }));
|
|
79
|
+
}
|
|
80
|
+
export default memo(FieldName);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DraggableProvided } from '@hello-pangea/dnd';
|
|
3
|
+
import { SCCourseLessonType, SCCourseSectionType, SCCourseType } from '@selfcommunity/types';
|
|
4
|
+
import { ActionLessonType, DeleteRowRef } from '../types';
|
|
5
|
+
interface LessonRowProps {
|
|
6
|
+
provider: DraggableProvided;
|
|
7
|
+
course: SCCourseType;
|
|
8
|
+
section: SCCourseSectionType;
|
|
9
|
+
lesson: SCCourseLessonType;
|
|
10
|
+
isNewRow: boolean;
|
|
11
|
+
handleManageLesson: (lesson: SCCourseLessonType, type: ActionLessonType, newRow?: boolean) => void;
|
|
12
|
+
handleOpenDialog: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<LessonRowProps & import("react").RefAttributes<DeleteRowRef>>>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Icon, MenuItem, Stack, TableCell, TableRow, Typography } from '@mui/material';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { PREFIX } from '../constants';
|
|
5
|
+
import { forwardRef, memo, useCallback, useImperativeHandle, useState } from 'react';
|
|
6
|
+
import MenuRow from '../MenuRow';
|
|
7
|
+
import { FormattedMessage } from 'react-intl';
|
|
8
|
+
import FieldName from './FieldName';
|
|
9
|
+
import ChangeLessonStatus from './ChangeLessonStatus';
|
|
10
|
+
import { CourseService, Endpoints } from '@selfcommunity/api-services';
|
|
11
|
+
import { Logger } from '@selfcommunity/utils';
|
|
12
|
+
import { useSnackbar } from 'notistack';
|
|
13
|
+
import { Link, SCRoutes, useSCRouting } from '@selfcommunity/react-core';
|
|
14
|
+
import { SCOPE_SC_UI } from '../../../constants/Errors';
|
|
15
|
+
import { ActionLessonType } from '../types';
|
|
16
|
+
import { useIsDisabled } from '../hooks';
|
|
17
|
+
import { getUrlLesson } from '../../../utils/course';
|
|
18
|
+
const classes = {
|
|
19
|
+
cellWidth: `${PREFIX}-cell-width`,
|
|
20
|
+
cellAlignRight: `${PREFIX}-cell-align-right`,
|
|
21
|
+
cellPadding: `${PREFIX}-cell-padding`,
|
|
22
|
+
tableBodyIconWrapper: `${PREFIX}-table-body-icon-wrapper`,
|
|
23
|
+
actionsWrapper: `${PREFIX}-actions-wrapper`
|
|
24
|
+
};
|
|
25
|
+
function LessonRow(props, ref) {
|
|
26
|
+
// PROPS
|
|
27
|
+
const { provider, course, section, lesson, isNewRow, handleManageLesson, handleOpenDialog } = props;
|
|
28
|
+
// STATES
|
|
29
|
+
const [editMode, setEditMode] = useState(false);
|
|
30
|
+
// CONTEXTS
|
|
31
|
+
const scRoutingContext = useSCRouting();
|
|
32
|
+
// HOOKS
|
|
33
|
+
const { isDisabled } = useIsDisabled();
|
|
34
|
+
const { enqueueSnackbar } = useSnackbar();
|
|
35
|
+
// HANDLERS
|
|
36
|
+
const handleAbleEditMode = useCallback(() => setTimeout(() => setEditMode(true)), [setEditMode]);
|
|
37
|
+
const handleDisableEditMode = useCallback(() => setEditMode(false), [setEditMode]);
|
|
38
|
+
const handleDeleteLesson = useCallback((deleteSection, deleteLesson) => {
|
|
39
|
+
CourseService.deleteCourseLesson(course.id, deleteSection.id, deleteLesson.id)
|
|
40
|
+
.then(() => {
|
|
41
|
+
handleManageLesson(deleteLesson, ActionLessonType.DELETE);
|
|
42
|
+
enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.editCourse.tab.lessons.table.snackbar.delete", defaultMessage: "ui.editCourse.tab.lessons.table.snackbar.delete" }), {
|
|
43
|
+
variant: 'success',
|
|
44
|
+
autoHideDuration: 3000
|
|
45
|
+
});
|
|
46
|
+
})
|
|
47
|
+
.catch((error) => {
|
|
48
|
+
Logger.error(SCOPE_SC_UI, error);
|
|
49
|
+
enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.common.error.action", defaultMessage: "ui.common.error.action" }), {
|
|
50
|
+
variant: 'error',
|
|
51
|
+
autoHideDuration: 3000
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
}, [course, handleManageLesson]);
|
|
55
|
+
useImperativeHandle(ref, () => ({
|
|
56
|
+
handleDeleteLesson: (deleteSection, deleteLesson) => handleDeleteLesson(deleteSection, deleteLesson)
|
|
57
|
+
}), [handleDeleteLesson]);
|
|
58
|
+
return (_jsxs(TableRow, Object.assign({}, provider.draggableProps, { ref: provider.innerRef }, { children: [_jsx(TableCell, { width: "4%" }), _jsx(TableCell, Object.assign({ component: "th", scope: "row" }, provider.dragHandleProps, { className: classNames(classes.cellWidth, classes.cellPadding) }, { children: _jsx(Stack, Object.assign({ className: classes.tableBodyIconWrapper }, { children: _jsx(Icon, Object.assign({ color: "disabled" }, { children: "drag" })) })) })), _jsx(TableCell, { children: _jsx(FieldName, { endpoint: {
|
|
59
|
+
url: () => isNewRow
|
|
60
|
+
? Endpoints.CreateCourseLesson.url({ id: course.id, section_id: section.id })
|
|
61
|
+
: Endpoints.PatchCourseLesson.url({ id: course.id, section_id: section.id, lesson_id: lesson.id }),
|
|
62
|
+
method: isNewRow ? Endpoints.CreateCourseLesson.method : Endpoints.PatchCourseLesson.method
|
|
63
|
+
}, row: lesson, isNewRow: isNewRow, handleManageRow: handleManageLesson, editMode: editMode, handleDisableEditMode: handleDisableEditMode }) }), _jsx(TableCell, {}), _jsx(TableCell, Object.assign({ className: classes.cellAlignRight }, { children: _jsxs(Stack, Object.assign({ className: classes.actionsWrapper }, { children: [_jsx(ChangeLessonStatus, { course: course, section: section, lesson: lesson, onChange: handleManageLesson, disabled: isDisabled }), _jsxs(MenuRow, Object.assign({ disabled: isDisabled }, { children: [_jsx(MenuItem, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.COURSE_LESSON_EDIT_ROUTE_NAME, getUrlLesson(course, lesson, section)) }, { children: _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.editCourse.tab.lessons.table.menu.edit", defaultMessage: "ui.editCourse.tab.lessons.table.menu.edit" }) })) })), _jsx(MenuItem, Object.assign({ component: Link, to: scRoutingContext.url(SCRoutes.COURSE_LESSON_PREVIEW_ROUTE_NAME, getUrlLesson(course, lesson, section)) }, { children: _jsx(Typography, Object.assign({ variant: "body1" }, { children: _jsx(FormattedMessage, { id: "ui.editCourse.tab.lessons.table.menu.preview", defaultMessage: "ui.editCourse.tab.lessons.table.menu.preview" }) })) })), _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 }, { 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" }) })) }))] }))] })) }))] })));
|
|
64
|
+
}
|
|
65
|
+
export default memo(forwardRef(LessonRow));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DraggableProvided } from '@hello-pangea/dnd';
|
|
3
|
+
import { SCCourseSectionType, SCCourseType } from '@selfcommunity/types';
|
|
4
|
+
import { ActionLessonType, DeleteRowProps, DeleteRowRef } from '../types';
|
|
5
|
+
interface SectionRowProps {
|
|
6
|
+
course: SCCourseType;
|
|
7
|
+
provider: DraggableProvided;
|
|
8
|
+
section: SCCourseSectionType;
|
|
9
|
+
isNewRow: boolean;
|
|
10
|
+
handleManageSection: (section: SCCourseSectionType, type: ActionLessonType, newRow?: boolean) => void;
|
|
11
|
+
handleOpenDialog: (row: DeleteRowProps) => void;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<SectionRowProps & import("react").RefAttributes<DeleteRowRef>>>;
|
|
14
|
+
export default _default;
|
|
@@ -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;
|