@selfcommunity/react-ui 0.11.0-alpha.60 → 0.11.0-alpha.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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.js +6 -8
- 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/ComposerIconButton/ComposerIconButton.d.ts +9 -3
- package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +38 -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/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 +6 -3
- 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/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/EventForm/EventForm.js +1 -1
- 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/NavigationMenuIconButton/DefaultDrawerContent.js +7 -5
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +12 -1
- 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/Notification.js +9 -0
- 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/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/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/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/course.d.ts +14 -0
- package/lib/cjs/utils/course.js +39 -0
- 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.js +6 -8
- 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/ComposerIconButton/ComposerIconButton.d.ts +9 -3
- package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +38 -9
- 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/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 +7 -4
- 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/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/EventForm/EventForm.js +1 -1
- 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/NavigationMenuIconButton/DefaultDrawerContent.js +9 -7
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +12 -1
- 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/Notification.js +9 -0
- 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/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/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/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/course.d.ts +14 -0
- package/lib/esm/utils/course.js +32 -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/{a221d3aba0f6753cfbb7.ttf → ba74e493633796d551d1.ttf} +0 -0
- package/lib/umd/{2aa155858f48b8f3911a.eot → c473ce30406a3dad83e1.eot} +0 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +9 -8
- package/lib/umd/239.js +0 -2
- package/lib/umd/36f3af7f155d916c26ff.woff2 +0 -0
- /package/lib/umd/{239.js.LICENSE.txt → 578.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { ToolbarPluginProps } from './plugins/ToolbarPlugin';
|
|
3
|
+
import { MediaPluginProps } from './plugins';
|
|
4
|
+
import { SCMediaType } from '@selfcommunity/types';
|
|
2
5
|
export type EditorRef = {
|
|
3
6
|
focus: () => void;
|
|
4
7
|
};
|
|
@@ -33,11 +36,31 @@ export interface EditorProps {
|
|
|
33
36
|
* @default false
|
|
34
37
|
*/
|
|
35
38
|
uploadImage?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* This editor can upload files
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
uploadFile?: boolean;
|
|
36
44
|
/**
|
|
37
45
|
* Handler for change event of the editor
|
|
38
46
|
* @default null
|
|
39
47
|
* */
|
|
40
48
|
onChange?: (value: string) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Handler for change media in the editor
|
|
51
|
+
* @default null
|
|
52
|
+
* */
|
|
53
|
+
onMediaChange?: (media: SCMediaType) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Props to spread to ToolBar.
|
|
56
|
+
* @default {}
|
|
57
|
+
*/
|
|
58
|
+
ToolBarProps?: ToolbarPluginProps;
|
|
59
|
+
/**
|
|
60
|
+
* Props to spread to MediaPlugin.
|
|
61
|
+
* @default {}
|
|
62
|
+
*/
|
|
63
|
+
MediaPluginProps?: MediaPluginProps;
|
|
41
64
|
/**
|
|
42
65
|
* Handler for blur event of the editor
|
|
43
66
|
* @default null
|
|
@@ -48,6 +71,20 @@ export interface EditorProps {
|
|
|
48
71
|
* @default null
|
|
49
72
|
* */
|
|
50
73
|
onFocus?: (event: FocusEvent) => void;
|
|
74
|
+
/**
|
|
75
|
+
* Action to add to actions
|
|
76
|
+
*/
|
|
77
|
+
action?: React.ReactNode | null;
|
|
78
|
+
/**
|
|
79
|
+
* The text displayed when the editor is empty
|
|
80
|
+
* @default <FormattedMessage id="ui.editor.placeholder" defaultMessage="ui.editor.placeholder" />
|
|
81
|
+
*/
|
|
82
|
+
placeholder?: React.ReactNode;
|
|
83
|
+
/**
|
|
84
|
+
* Prop to customize emoji plugin position
|
|
85
|
+
* @default false
|
|
86
|
+
*/
|
|
87
|
+
isLessonCommentEditor?: boolean;
|
|
51
88
|
}
|
|
52
89
|
declare const _default: React.ForwardRefExoticComponent<EditorProps & React.RefAttributes<EditorRef>>;
|
|
53
90
|
export default _default;
|
|
@@ -15,10 +15,10 @@ const ToolbarPlugin_1 = tslib_1.__importDefault(require("./plugins/ToolbarPlugin
|
|
|
15
15
|
const constants_1 = require("./constants");
|
|
16
16
|
const HorizontalRulePlugin_1 = require("./plugins/HorizontalRulePlugin");
|
|
17
17
|
const LexicalRichTextPlugin_1 = require("./plugins/LexicalRichTextPlugin");
|
|
18
|
-
const LexicalErrorBoundary_1 = require("@lexical/react/LexicalErrorBoundary");
|
|
19
18
|
const plugins_1 = require("./plugins");
|
|
20
19
|
const OnBlurPlugin_1 = tslib_1.__importDefault(require("./plugins/OnBlurPlugin"));
|
|
21
20
|
const OnFocusPlugin_1 = tslib_1.__importDefault(require("./plugins/OnFocusPlugin"));
|
|
21
|
+
const LexicalErrorBoundary_1 = require("@lexical/react/LexicalErrorBoundary");
|
|
22
22
|
const LexicalLinkPlugin_1 = require("@lexical/react/LexicalLinkPlugin");
|
|
23
23
|
const FloatingLinkPlugin_1 = tslib_1.__importDefault(require("./plugins/FloatingLinkPlugin"));
|
|
24
24
|
const ApiPlugin_1 = tslib_1.__importDefault(require("./plugins/ApiPlugin"));
|
|
@@ -107,7 +107,7 @@ const Editor = (inProps, ref) => {
|
|
|
107
107
|
props: inProps,
|
|
108
108
|
name: constants_1.PREFIX
|
|
109
109
|
});
|
|
110
|
-
const { id = 'editor', className = null, defaultValue = '', toolbar = false, uploadImage = false, editable = true, onChange = null, onFocus = null, onBlur = null } = props;
|
|
110
|
+
const { id = 'editor', className = null, defaultValue = '', toolbar = false, uploadImage = false, uploadFile = false, editable = true, onChange = null, onMediaChange = null, onFocus = null, onBlur = null, action = null, ToolBarProps = {}, MediaPluginProps = {}, placeholder = (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editor.placeholder", defaultMessage: "ui.editor.placeholder" }), isLessonCommentEditor = false } = props;
|
|
111
111
|
const apiRef = (0, react_1.useRef)();
|
|
112
112
|
// STATE
|
|
113
113
|
const [focused, setFocused] = (0, react_1.useState)(false);
|
|
@@ -115,6 +115,9 @@ const Editor = (inProps, ref) => {
|
|
|
115
115
|
const handleChange = (value) => {
|
|
116
116
|
onChange && onChange(value);
|
|
117
117
|
};
|
|
118
|
+
const handleMediaChange = (media) => {
|
|
119
|
+
onMediaChange && onMediaChange(media);
|
|
120
|
+
};
|
|
118
121
|
const handleError = (error, editor) => {
|
|
119
122
|
console.log(error);
|
|
120
123
|
};
|
|
@@ -145,6 +148,6 @@ const Editor = (inProps, ref) => {
|
|
|
145
148
|
nodes: [...nodes_1.default],
|
|
146
149
|
theme: editorTheme
|
|
147
150
|
}), [editable]);
|
|
148
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className, { [classes.toolbar]: toolbar, [classes.focused]: focused }) }, { children: (0, jsx_runtime_1.jsxs)(LexicalComposer_1.LexicalComposer, Object.assign({ initialConfig: initialConfig }, { children: [toolbar ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ToolbarPlugin_1.default, { uploadImage: uploadImage }), (0, jsx_runtime_1.jsx)(LexicalListPlugin_1.ListPlugin, {}), (0, jsx_runtime_1.jsx)(HorizontalRulePlugin_1.HorizontalRulePlugin, {})] })) : ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.actions, direction: "row" }, { children: [uploadImage && (0, jsx_runtime_1.jsx)(plugins_1.ImagePlugin, {}), (0, jsx_runtime_1.jsx)(plugins_1.EmojiPlugin, {})] }))), (0, jsx_runtime_1.jsx)(LexicalRichTextPlugin_1.RichTextPlugin, { contentEditable: (0, jsx_runtime_1.jsx)(LexicalContentEditable_1.ContentEditable, { className: classes.content }), placeholder: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.placeholder, onClick: handleFocus }, { children:
|
|
151
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className, { [classes.toolbar]: toolbar, [classes.focused]: focused }) }, { children: (0, jsx_runtime_1.jsxs)(LexicalComposer_1.LexicalComposer, Object.assign({ initialConfig: initialConfig }, { children: [toolbar ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ToolbarPlugin_1.default, Object.assign({ uploadImage: uploadImage, uploadFile: uploadFile, MediaPluginProps: { onMediaAdd: handleMediaChange } }, ToolBarProps)), (0, jsx_runtime_1.jsx)(LexicalListPlugin_1.ListPlugin, {}), (0, jsx_runtime_1.jsx)(HorizontalRulePlugin_1.HorizontalRulePlugin, {})] })) : ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.actions, direction: "row" }, { children: [uploadImage && (0, jsx_runtime_1.jsx)(plugins_1.ImagePlugin, {}), (0, jsx_runtime_1.jsx)(plugins_1.EmojiPlugin, { isLessonCommentEditor: isLessonCommentEditor }), uploadFile && (0, jsx_runtime_1.jsx)(plugins_1.MediaPlugin, Object.assign({}, MediaPluginProps)), action && action] }))), (0, jsx_runtime_1.jsx)(LexicalRichTextPlugin_1.RichTextPlugin, { contentEditable: (0, jsx_runtime_1.jsx)(LexicalContentEditable_1.ContentEditable, { className: classes.content }), placeholder: (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.placeholder, onClick: handleFocus }, { children: placeholder })), ErrorBoundary: LexicalErrorBoundary_1.LexicalErrorBoundary }), (0, jsx_runtime_1.jsx)(plugins_1.DefaultHtmlValuePlugin, { defaultValue: defaultValue }), (0, jsx_runtime_1.jsx)(LexicalHistoryPlugin_1.HistoryPlugin, {}), (0, jsx_runtime_1.jsx)(plugins_1.OnChangePlugin, { onChange: handleChange }), (0, jsx_runtime_1.jsx)(OnBlurPlugin_1.default, { onBlur: handleHasBlur }), (0, jsx_runtime_1.jsx)(OnFocusPlugin_1.default, { onFocus: handleHasFocus }), (0, jsx_runtime_1.jsx)(plugins_1.AutoLinkPlugin, {}), (0, jsx_runtime_1.jsx)(plugins_1.MentionsPlugin, {}), (0, jsx_runtime_1.jsx)(LexicalLinkPlugin_1.LinkPlugin, {}), (0, jsx_runtime_1.jsx)(FloatingLinkPlugin_1.default, {}), (0, jsx_runtime_1.jsx)(ApiPlugin_1.default, { ref: apiRef })] })) })));
|
|
149
152
|
};
|
|
150
153
|
exports.default = (0, react_1.forwardRef)(Editor);
|
|
@@ -9,7 +9,7 @@ const material_1 = require("@mui/material");
|
|
|
9
9
|
const styles_1 = require("@mui/material/styles");
|
|
10
10
|
const EmojiPicker_1 = tslib_1.__importDefault(require("../../../shared/EmojiPicker"));
|
|
11
11
|
const constants_1 = require("../constants");
|
|
12
|
-
function Emoji({ editor, className = '' }) {
|
|
12
|
+
function Emoji({ editor, className = '', isLessonCommentEditor = false }) {
|
|
13
13
|
// STATE
|
|
14
14
|
const theme = (0, material_1.useTheme)();
|
|
15
15
|
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
|
|
@@ -25,13 +25,7 @@ function Emoji({ editor, className = '' }) {
|
|
|
25
25
|
if (isMobile) {
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
28
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: className, onClick: handleOpen }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "sentiment_satisfied_alt" }) })), (0, jsx_runtime_1.jsx)(material_1.Popover, Object.assign({ open: Boolean(emojiAnchorEl), anchorEl: emojiAnchorEl, onClose: () => setEmojiAnchorEl(null), TransitionComponent: material_1.Fade, anchorOrigin: {
|
|
29
|
-
vertical: 'top',
|
|
30
|
-
horizontal: 'right'
|
|
31
|
-
}, transformOrigin: {
|
|
32
|
-
vertical: 'bottom',
|
|
33
|
-
horizontal: 'left'
|
|
34
|
-
}, sx: (theme) => {
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: className, onClick: handleOpen }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "sentiment_satisfied_alt" }) })), (0, jsx_runtime_1.jsx)(material_1.Popover, Object.assign({ open: Boolean(emojiAnchorEl), anchorEl: emojiAnchorEl, onClose: () => setEmojiAnchorEl(null), TransitionComponent: material_1.Fade, anchorOrigin: isLessonCommentEditor ? { vertical: 'bottom', horizontal: 'left' } : { vertical: 'top', horizontal: 'right' }, transformOrigin: isLessonCommentEditor ? { vertical: 'top', horizontal: 'right' } : { vertical: 'bottom', horizontal: 'left' }, sx: (theme) => {
|
|
35
29
|
return { zIndex: theme.zIndex.tooltip };
|
|
36
30
|
} }, { children: (0, jsx_runtime_1.jsx)(EmojiPicker_1.default, { onEmojiClick: handleEmojiClick }) }))] }));
|
|
37
31
|
}
|
|
@@ -42,8 +36,8 @@ const Root = (0, styles_1.styled)(Emoji, {
|
|
|
42
36
|
name: constants_1.PREFIX,
|
|
43
37
|
slot: 'EmojiPluginRoot'
|
|
44
38
|
})(() => ({}));
|
|
45
|
-
function EmojiPlugin() {
|
|
39
|
+
function EmojiPlugin({ isLessonCommentEditor = false }) {
|
|
46
40
|
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
47
|
-
return (0, jsx_runtime_1.jsx)(Root, { editor: editor, className: classes.root });
|
|
41
|
+
return (0, jsx_runtime_1.jsx)(Root, { editor: editor, className: classes.root, isLessonCommentEditor: isLessonCommentEditor });
|
|
48
42
|
}
|
|
49
43
|
exports.default = EmojiPlugin;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LexicalCommand } from 'lexical';
|
|
2
|
+
import { SCMediaType } from '@selfcommunity/types';
|
|
3
|
+
export interface InsertDocPayload {
|
|
4
|
+
src: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const INSERT_DOC_COMMAND: LexicalCommand<InsertDocPayload>;
|
|
9
|
+
export interface MediaPluginProps {
|
|
10
|
+
className?: string;
|
|
11
|
+
onMediaAdd?: (media: SCMediaType) => void | null;
|
|
12
|
+
isUploading?: (boolean: any) => void;
|
|
13
|
+
}
|
|
14
|
+
export default function MediaPlugin(props: MediaPluginProps): JSX.Element;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INSERT_DOC_COMMAND = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const lexical_1 = require("lexical");
|
|
8
|
+
const utils_1 = require("@lexical/utils");
|
|
9
|
+
const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
|
|
10
|
+
const material_1 = require("@mui/material");
|
|
11
|
+
const styles_1 = require("@mui/material/styles");
|
|
12
|
+
const chunked_uploady_1 = tslib_1.__importDefault(require("@rpldy/chunked-uploady"));
|
|
13
|
+
const api_services_1 = require("@selfcommunity/api-services");
|
|
14
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
15
|
+
const MediaChunkUploader_1 = tslib_1.__importDefault(require("../../../shared/MediaChunkUploader"));
|
|
16
|
+
const upload_button_1 = require("@rpldy/upload-button");
|
|
17
|
+
const notistack_1 = require("notistack");
|
|
18
|
+
const ImageNode_1 = require("../nodes/ImageNode");
|
|
19
|
+
const constants_1 = require("../constants");
|
|
20
|
+
const ImagePlugin_1 = require("./ImagePlugin");
|
|
21
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
22
|
+
exports.INSERT_DOC_COMMAND = (0, lexical_1.createCommand)();
|
|
23
|
+
const UploadButton = (0, upload_button_1.asUploadButton)((0, react_1.forwardRef)((_a, ref) => {
|
|
24
|
+
var { progress = null } = _a, rest = tslib_1.__rest(_a, ["progress"]);
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({}, rest, { "aria-label": "upload image", ref: ref }, { children: progress ? (0, jsx_runtime_1.jsx)(material_1.CircularProgress, { variant: "determinate", value: progress, size: "1rem" }) : (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ color: "inherit" }, { children: "attach_file" })) })));
|
|
26
|
+
}));
|
|
27
|
+
const classes = {
|
|
28
|
+
root: `${constants_1.PREFIX}-media-plugin-root`
|
|
29
|
+
};
|
|
30
|
+
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
31
|
+
name: constants_1.PREFIX,
|
|
32
|
+
slot: 'MediaPluginRoot'
|
|
33
|
+
})(() => ({}));
|
|
34
|
+
function MediaPlugin(props) {
|
|
35
|
+
var _a;
|
|
36
|
+
const { className = '', onMediaAdd = null, isUploading } = props;
|
|
37
|
+
// STATE
|
|
38
|
+
const [uploading, setUploading] = (0, react_1.useState)({});
|
|
39
|
+
const [mediaType, setMediaType] = (0, react_1.useState)('');
|
|
40
|
+
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
41
|
+
// CONTEXT
|
|
42
|
+
const scContext = (0, react_core_1.useSCContext)();
|
|
43
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
44
|
+
// HOOKS
|
|
45
|
+
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
46
|
+
(0, react_1.useEffect)(() => {
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
if (!editor.hasNodes([ImageNode_1.ImageNode])) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
return editor.registerCommand(ImagePlugin_1.INSERT_IMAGE_COMMAND, (payload) => {
|
|
53
|
+
const imageNode = (0, ImageNode_1.$createImageNode)({
|
|
54
|
+
src: payload.src,
|
|
55
|
+
altText: payload.altText,
|
|
56
|
+
maxWidth: '100%',
|
|
57
|
+
width: payload.width,
|
|
58
|
+
height: payload.height
|
|
59
|
+
});
|
|
60
|
+
// The image is not editable so it is better to position it near the root element
|
|
61
|
+
(0, utils_1.$insertNodeToNearestRoot)(imageNode);
|
|
62
|
+
return true;
|
|
63
|
+
}, lexical_1.COMMAND_PRIORITY_EDITOR);
|
|
64
|
+
}, [editor]);
|
|
65
|
+
// HANDLERS
|
|
66
|
+
const handleFileUploadFilter = (file) => {
|
|
67
|
+
if (file.type.startsWith('image/')) {
|
|
68
|
+
setMediaType('image');
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
setMediaType('file');
|
|
72
|
+
}
|
|
73
|
+
return file.type.startsWith('image/') || file.type.startsWith('application/');
|
|
74
|
+
};
|
|
75
|
+
const handleUploadSuccess = (media) => {
|
|
76
|
+
if (media.type === 'image') {
|
|
77
|
+
const data = {
|
|
78
|
+
altText: media.title,
|
|
79
|
+
src: media.image,
|
|
80
|
+
width: media.image_width,
|
|
81
|
+
height: media.image_height
|
|
82
|
+
};
|
|
83
|
+
editor.focus();
|
|
84
|
+
editor.dispatchCommand(ImagePlugin_1.INSERT_IMAGE_COMMAND, data);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
const data = {
|
|
88
|
+
src: media.url || media.image,
|
|
89
|
+
name: media.title,
|
|
90
|
+
type: media.type
|
|
91
|
+
};
|
|
92
|
+
editor.focus();
|
|
93
|
+
editor.dispatchCommand(exports.INSERT_DOC_COMMAND, data);
|
|
94
|
+
onMediaAdd && onMediaAdd(media);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
const handleUploadProgress = (chunks) => {
|
|
98
|
+
setUploading(Object.assign({}, chunks));
|
|
99
|
+
isUploading && isUploading(Object.keys(chunks).length !== 0);
|
|
100
|
+
};
|
|
101
|
+
const handleUploadError = (chunk, error) => {
|
|
102
|
+
enqueueSnackbar(error, {
|
|
103
|
+
variant: 'error',
|
|
104
|
+
autoHideDuration: 3000
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
108
|
+
// @ts-ignore
|
|
109
|
+
if (!scUserContext.user || !editor.hasNodes([ImageNode_1.ImageNode])) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: (0, jsx_runtime_1.jsxs)(chunked_uploady_1.default, Object.assign({ destination: {
|
|
113
|
+
url: `${scContext.settings.portal}${api_services_1.Endpoints.ComposerChunkUploadMedia.url()}`,
|
|
114
|
+
headers: ((_a = scContext.settings.session) === null || _a === void 0 ? void 0 : _a.authToken) ? { Authorization: `Bearer ${scContext.settings.session.authToken.accessToken}` } : {},
|
|
115
|
+
method: api_services_1.Endpoints.ComposerChunkUploadMedia.method
|
|
116
|
+
}, chunkSize: 204800, accept: "image/*,application/*", fileFilter: handleFileUploadFilter, multiple: true }, { children: [(0, jsx_runtime_1.jsx)(MediaChunkUploader_1.default, { type: mediaType, onSuccess: handleUploadSuccess, onProgress: handleUploadProgress, onError: handleUploadError }), (0, jsx_runtime_1.jsx)(UploadButton, { className: className, extraProps: {
|
|
117
|
+
disabled: Object.keys(uploading).length !== 0,
|
|
118
|
+
progress: Object.keys(uploading).length !== 0 ? Object.values(uploading)[0].completed : null
|
|
119
|
+
} })] })) })));
|
|
120
|
+
}
|
|
121
|
+
exports.default = MediaPlugin;
|
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
import { MediaPluginProps } from './MediaPlugin';
|
|
8
10
|
export interface ToolbarPluginProps {
|
|
9
11
|
uploadImage: boolean;
|
|
12
|
+
uploadFile?: boolean;
|
|
13
|
+
MediaPluginProps?: MediaPluginProps;
|
|
14
|
+
customLink?: React.ReactNode;
|
|
10
15
|
}
|
|
11
16
|
export default function ToolbarPlugin(inProps: ToolbarPluginProps): JSX.Element;
|
|
@@ -22,6 +22,7 @@ const ImagePlugin_1 = tslib_1.__importDefault(require("./ImagePlugin"));
|
|
|
22
22
|
const EmojiPlugin_1 = tslib_1.__importDefault(require("./EmojiPlugin"));
|
|
23
23
|
const LexicalHorizontalRuleNode_1 = require("@lexical/react/LexicalHorizontalRuleNode");
|
|
24
24
|
const constants_1 = require("../constants");
|
|
25
|
+
const MediaPlugin_1 = tslib_1.__importDefault(require("./MediaPlugin"));
|
|
25
26
|
const blockTypeToBlockIcon = {
|
|
26
27
|
h1: 'format_heading_1',
|
|
27
28
|
h2: 'format_heading_2',
|
|
@@ -128,7 +129,7 @@ function ToolbarPlugin(inProps) {
|
|
|
128
129
|
props: inProps,
|
|
129
130
|
name: constants_1.PREFIX
|
|
130
131
|
});
|
|
131
|
-
const { uploadImage = false } = props;
|
|
132
|
+
const { uploadImage = false, uploadFile = false, MediaPluginProps = {}, customLink = null } = props;
|
|
132
133
|
// STATE
|
|
133
134
|
const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
|
|
134
135
|
const [activeEditor, setActiveEditor] = (0, react_1.useState)(editor);
|
|
@@ -271,6 +272,6 @@ function ToolbarPlugin(inProps) {
|
|
|
271
272
|
activeEditor.dispatchCommand(lexical_1.FORMAT_TEXT_COMMAND, format);
|
|
272
273
|
} }, { children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: `ui.editor.toolbarPlugin.${format}`, defaultMessage: `ui.editor.toolbarPlugin.${format}` }) }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: `format_${format}` }) })) }), format))) })), (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ disabled: !isEditable, onClick: clearFormatting }, { children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editor.toolbarPlugin.clear", defaultMessage: "ui.editor.toolbarPlugin.clear" }) }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "format_clear" }) })) })), (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ disabled: !isEditable, onClick: () => {
|
|
273
274
|
activeEditor.dispatchCommand(LexicalHorizontalRuleNode_1.INSERT_HORIZONTAL_RULE_COMMAND, undefined);
|
|
274
|
-
} }, { children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editor.toolbarPlugin.horizontalRule", defaultMessage: "ui.editor.toolbarPlugin.horizontalRule" }) }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "format_horizontal_rule" }) })) })), uploadImage && (0, jsx_runtime_1.jsx)(ImagePlugin_1.default, {}), (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ disabled: !isEditable, onClick: insertLink }, { children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editor.toolbarPlugin.link", defaultMessage: "ui.editor.toolbarPlugin.link" }) }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "format_link" }) })) })), (0, jsx_runtime_1.jsx)(EmojiPlugin_1.default, {})] })));
|
|
275
|
+
} }, { children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editor.toolbarPlugin.horizontalRule", defaultMessage: "ui.editor.toolbarPlugin.horizontalRule" }) }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "format_horizontal_rule" }) })) })), uploadImage && (0, jsx_runtime_1.jsx)(ImagePlugin_1.default, {}), uploadFile && (0, jsx_runtime_1.jsx)(MediaPlugin_1.default, Object.assign({}, MediaPluginProps)), customLink !== null && customLink !== void 0 ? customLink : ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ disabled: !isEditable, onClick: insertLink }, { children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.editor.toolbarPlugin.link", defaultMessage: "ui.editor.toolbarPlugin.link" }) }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "format_link" }) })) }))), (0, jsx_runtime_1.jsx)(EmojiPlugin_1.default, {})] })));
|
|
275
276
|
}
|
|
276
277
|
exports.default = ToolbarPlugin;
|
|
@@ -5,4 +5,5 @@ import ImagePlugin from './ImagePlugin';
|
|
|
5
5
|
import MentionsPlugin from './MentionsPlugin';
|
|
6
6
|
import OnChangePlugin from './OnChangePlugin';
|
|
7
7
|
import HashtagPlugin from './HashtagPlugin';
|
|
8
|
-
|
|
8
|
+
import MediaPlugin, { MediaPluginProps } from './MediaPlugin';
|
|
9
|
+
export { AutoLinkPlugin, DefaultHtmlValuePlugin, EmojiPlugin, ImagePlugin, MentionsPlugin, OnChangePlugin, HashtagPlugin, MediaPlugin, MediaPluginProps };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HashtagPlugin = exports.OnChangePlugin = exports.MentionsPlugin = exports.ImagePlugin = exports.EmojiPlugin = exports.DefaultHtmlValuePlugin = exports.AutoLinkPlugin = void 0;
|
|
3
|
+
exports.MediaPlugin = exports.HashtagPlugin = exports.OnChangePlugin = exports.MentionsPlugin = exports.ImagePlugin = exports.EmojiPlugin = exports.DefaultHtmlValuePlugin = exports.AutoLinkPlugin = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const AutoLinkPlugin_1 = tslib_1.__importDefault(require("./AutoLinkPlugin"));
|
|
6
6
|
exports.AutoLinkPlugin = AutoLinkPlugin_1.default;
|
|
@@ -16,3 +16,5 @@ const OnChangePlugin_1 = tslib_1.__importDefault(require("./OnChangePlugin"));
|
|
|
16
16
|
exports.OnChangePlugin = OnChangePlugin_1.default;
|
|
17
17
|
const HashtagPlugin_1 = tslib_1.__importDefault(require("./HashtagPlugin"));
|
|
18
18
|
exports.HashtagPlugin = HashtagPlugin_1.default;
|
|
19
|
+
const MediaPlugin_1 = tslib_1.__importDefault(require("./MediaPlugin"));
|
|
20
|
+
exports.MediaPlugin = MediaPlugin_1.default;
|
|
@@ -288,7 +288,7 @@ function EventForm(inProps) {
|
|
|
288
288
|
}
|
|
289
289
|
let __errors = {};
|
|
290
290
|
if ('coverError' in _error) {
|
|
291
|
-
__errors = Object.assign(Object.assign({}, __errors), { ['coverError']: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.
|
|
291
|
+
__errors = Object.assign(Object.assign({}, __errors), { ['coverError']: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.cover.error", defaultMessage: "ui.eventForm.cover.error" }) });
|
|
292
292
|
}
|
|
293
293
|
if ('nameError' in _error || ('nonFieldErrorsError' in _error && _error['nonFieldErrorsError'].error === 'unique')) {
|
|
294
294
|
__errors = Object.assign(Object.assign({}, __errors), { ['nameError']: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.eventForm.name.error.unique", defaultMessage: "ui.eventForm.name.error.unique" }) });
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { SCLessonActionsType } from '../../types';
|
|
2
|
+
export interface LessonAppbarProps {
|
|
3
|
+
/**
|
|
4
|
+
* The appbar title
|
|
5
|
+
*/
|
|
6
|
+
title: string;
|
|
7
|
+
/**
|
|
8
|
+
* If comments are enabled for the lesson showed
|
|
9
|
+
*/
|
|
10
|
+
showComments: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The edit mode
|
|
13
|
+
* @default false
|
|
14
|
+
*/
|
|
15
|
+
editMode: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* onArrowBack Callback
|
|
18
|
+
*/
|
|
19
|
+
onArrowBackClick?: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* onSaveCallback
|
|
22
|
+
*/
|
|
23
|
+
onSave: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* The active panel
|
|
26
|
+
*/
|
|
27
|
+
activePanel: SCLessonActionsType | null;
|
|
28
|
+
/**
|
|
29
|
+
* Handles panel opening
|
|
30
|
+
* @param panel
|
|
31
|
+
*/
|
|
32
|
+
handleOpen: (panel: SCLessonActionsType) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Indicates whether an update is currently in progress.
|
|
35
|
+
*/
|
|
36
|
+
updating: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Any other properties
|
|
39
|
+
*/
|
|
40
|
+
[p: string]: any;
|
|
41
|
+
}
|
|
42
|
+
export default function LessonAppbar(inProps: LessonAppbarProps): JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
const system_1 = require("@mui/system");
|
|
7
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const types_1 = require("../../types");
|
|
11
|
+
const react_intl_1 = require("react-intl");
|
|
12
|
+
const lab_1 = require("@mui/lab");
|
|
13
|
+
const classes = {
|
|
14
|
+
root: `${constants_1.PREFIX}-root`,
|
|
15
|
+
startItems: `${constants_1.PREFIX}-start-items`,
|
|
16
|
+
endItems: `${constants_1.PREFIX}-end-items`,
|
|
17
|
+
title: `${constants_1.PREFIX}-title`
|
|
18
|
+
};
|
|
19
|
+
const Root = (0, styles_1.styled)(material_1.AppBar, {
|
|
20
|
+
name: constants_1.PREFIX,
|
|
21
|
+
slot: 'Root',
|
|
22
|
+
overridesResolver: (props, styles) => [styles.root],
|
|
23
|
+
shouldForwardProp: (prop) => prop !== 'open'
|
|
24
|
+
})(({ theme }) => ({}));
|
|
25
|
+
function LessonAppbar(inProps) {
|
|
26
|
+
// PROPS
|
|
27
|
+
const props = (0, system_1.useThemeProps)({
|
|
28
|
+
props: inProps,
|
|
29
|
+
name: constants_1.PREFIX
|
|
30
|
+
});
|
|
31
|
+
const { className = null, title = '', showComments, activePanel = null, handleOpen, onSave, editMode, onArrowBackClick, updating } = props, rest = tslib_1.__rest(props, ["className", "title", "showComments", "activePanel", "handleOpen", "onSave", "editMode", "onArrowBackClick", "updating"]);
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ position: "fixed", open: Boolean(activePanel), className: (0, classnames_1.default)(classes.root, className) }, rest, { children: (0, jsx_runtime_1.jsxs)(material_1.Toolbar, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.startItems }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ edge: "start", onClick: onArrowBackClick }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "arrow_back" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h6", className: classes.title }, { children: title }))] })), editMode ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: () => handleOpen(types_1.SCLessonActionsType.SETTINGS), color: "primary" }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "settings" }) })), (0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ variant: "contained", size: "small", onClick: onSave, loading: updating }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.lessonAppbar.button.save", defaultMessage: "ui.lessonAppbar.button.save" }) }))] })) : ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.endItems }, { children: [showComments && ((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: () => handleOpen(types_1.SCLessonActionsType.COMMENTS) }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "chat_bubble_outline" }) }))), (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: () => handleOpen(types_1.SCLessonActionsType.LESSONS) }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "courses" }) }))] })))] }) })));
|
|
33
|
+
}
|
|
34
|
+
exports.default = LessonAppbar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PREFIX = "SCLessonAppbar";
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { CardProps } from '@mui/material';
|
|
2
|
+
import { SCCourseCommentType, SCCourseLessonType } from '@selfcommunity/types';
|
|
3
|
+
import { CacheStrategies } from '@selfcommunity/utils';
|
|
4
|
+
export interface LessonCommentObjectProps {
|
|
5
|
+
/**
|
|
6
|
+
* Overrides or extends the styles applied to the component.
|
|
7
|
+
* @default null
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Id of the comment object
|
|
12
|
+
* @default null
|
|
13
|
+
*/
|
|
14
|
+
commentObjectId?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Comment object
|
|
17
|
+
* @default null
|
|
18
|
+
*/
|
|
19
|
+
commentObject?: SCCourseCommentType;
|
|
20
|
+
/**
|
|
21
|
+
* Id of lesson object
|
|
22
|
+
* @default null
|
|
23
|
+
*/
|
|
24
|
+
lessonObjectId?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Feed object
|
|
27
|
+
* @default null
|
|
28
|
+
*/
|
|
29
|
+
lessonObject?: SCCourseLessonType;
|
|
30
|
+
/**
|
|
31
|
+
* Callback on delete the comment
|
|
32
|
+
* @default null
|
|
33
|
+
*/
|
|
34
|
+
onDelete?: (comment: SCCourseCommentType) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Callback on comment edit
|
|
37
|
+
* @default false
|
|
38
|
+
*/
|
|
39
|
+
isEditing?: (editing: boolean) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Props to spread to single comment object skeleton
|
|
42
|
+
* @default {elevation: 0}
|
|
43
|
+
*/
|
|
44
|
+
CommentObjectSkeletonProps?: CardProps;
|
|
45
|
+
/**
|
|
46
|
+
* Props to spread to single comment object CommentObjectReply
|
|
47
|
+
* @default {elevation: 0}
|
|
48
|
+
*/
|
|
49
|
+
CommentObjectReplyProps?: CardProps;
|
|
50
|
+
/**
|
|
51
|
+
* Caching strategies
|
|
52
|
+
* @default CacheStrategies.CACHE_FIRST
|
|
53
|
+
*/
|
|
54
|
+
cacheStrategy?: CacheStrategies;
|
|
55
|
+
/**
|
|
56
|
+
* Other props
|
|
57
|
+
*/
|
|
58
|
+
[p: string]: any;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* > API documentation for the Community-JS Comment Object component. Learn about the available props and the CSS API.
|
|
62
|
+
*
|
|
63
|
+
*
|
|
64
|
+
* This component renders a comment item.
|
|
65
|
+
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/CommentObject)
|
|
66
|
+
|
|
67
|
+
#### Import
|
|
68
|
+
|
|
69
|
+
```jsx
|
|
70
|
+
import {CommentObject} from '@selfcommunity/react-ui';
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
#### Component Name
|
|
74
|
+
|
|
75
|
+
The name `SCCommentObject` can be used when providing style overrides in the theme.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
#### CSS
|
|
79
|
+
|
|
80
|
+
|Rule Name|Global class|Description|
|
|
81
|
+
|---|---|---|
|
|
82
|
+
|root|.SCCommentObject-root|Styles applied to the root element.|
|
|
83
|
+
|comment|.SCCommentObject-comment|Styles applied to comment element.|
|
|
84
|
+
|avatar|.SCCommentObject-avatar|Styles applied to the avatar element.|
|
|
85
|
+
|author|.SCCommentObject-author|Styles applied to the author section.|
|
|
86
|
+
|content|.SCCommentObject-content|Styles applied to content section.|
|
|
87
|
+
|textContent|.SCCommentObject-text-content|Styles applied to text content section.|
|
|
88
|
+
|mediaContent|.SCCommentObject-media-content|Styles applied to media content section.|
|
|
89
|
+
|commentActionsMenu|.SCCommentObject-comment-actions-menu|Styles applied to comment action menu element.|
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
* @param inProps
|
|
93
|
+
*/
|
|
94
|
+
export default function LessonCommentObject(inProps: LessonCommentObjectProps): JSX.Element;
|