@soul-refiner/design-system 1.6.1-alpha.3 → 1.6.2
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/dist/common/colors.d.ts +1 -1
- package/dist/common/colors.js +135 -0
- package/dist/common/date.js +28 -0
- package/dist/common/index.js +3 -0
- package/dist/common/styles.js +63 -0
- package/dist/components/actions/button/button.d.ts +1 -1
- package/dist/components/actions/button/button.js +280 -0
- package/dist/components/actions/button/index.js +1 -0
- package/dist/components/actions/dropdown/dropdown.js +227 -0
- package/dist/components/actions/dropdown/index.js +1 -0
- package/dist/components/actions/index.js +6 -0
- package/dist/components/actions/rate/index.js +1 -0
- package/dist/components/actions/rate/rate.js +46 -0
- package/dist/components/actions/switch/index.js +1 -0
- package/dist/components/actions/switch/switch.js +72 -0
- package/dist/components/actions/toggle/index.js +1 -0
- package/dist/components/actions/toggle/toggle.js +57 -0
- package/dist/components/actions/upload/index.js +1 -0
- package/dist/components/actions/upload/upload.js +156 -0
- package/dist/components/atoms/box/box.js +16 -0
- package/dist/components/atoms/box/index.js +1 -0
- package/dist/components/atoms/colors/colors.js +35 -0
- package/dist/components/atoms/colors/index.js +1 -0
- package/dist/components/atoms/hide/hide.js +9 -0
- package/dist/components/atoms/hide/index.js +1 -0
- package/dist/components/atoms/index.js +5 -0
- package/dist/components/atoms/seconds_to_duration/index.js +1 -0
- package/dist/components/atoms/seconds_to_duration/seconds_to_duration.js +27 -0
- package/dist/components/atoms/time_ago/index.js +1 -0
- package/dist/components/atoms/time_ago/time_ago.js +31 -0
- package/dist/components/atoms/typography/display.js +10 -0
- package/dist/components/atoms/typography/heading.js +35 -0
- package/dist/components/atoms/typography/index.js +4 -0
- package/dist/components/atoms/typography/paragraph.js +18 -0
- package/dist/components/atoms/typography/typography.js +12 -0
- package/dist/components/card/action/action.js +65 -0
- package/dist/components/card/action/index.js +1 -0
- package/dist/components/card/audio/audio.js +113 -0
- package/dist/components/card/audio/index.js +1 -0
- package/dist/components/card/card.js +25 -0
- package/dist/components/card/feature/feature.js +187 -0
- package/dist/components/card/feature/index.js +1 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/card/meeting/index.js +1 -0
- package/dist/components/card/meeting/meeting.js +130 -0
- package/dist/components/card/person/index.js +1 -0
- package/dist/components/card/person/person.js +68 -0
- package/dist/components/card/price/index.js +1 -0
- package/dist/components/card/price/price.js +75 -0
- package/dist/components/card/regular/index.js +1 -0
- package/dist/components/card/regular/regular.js +32 -0
- package/dist/components/card/video/index.js +1 -0
- package/dist/components/card/video/video.js +111 -0
- package/dist/components/card/written/index.js +1 -0
- package/dist/components/card/written/written.js +114 -0
- package/dist/components/custom/courses_selection/courses_selection.js +129 -0
- package/dist/components/custom/courses_selection/index.js +1 -0
- package/dist/components/custom/index.js +2 -0
- package/dist/components/custom/users_selection/index.js +1 -0
- package/dist/components/custom/users_selection/users_selection.js +120 -0
- package/dist/components/editor/constants.js +49 -0
- package/dist/components/editor/context.js +8 -0
- package/dist/components/editor/editor.js +102 -0
- package/dist/components/editor/icons/border-all.js +3 -0
- package/dist/components/editor/icons/border-bottom.js +3 -0
- package/dist/components/editor/icons/border-left.js +3 -0
- package/dist/components/editor/icons/border-none.js +3 -0
- package/dist/components/editor/icons/border-right.js +3 -0
- package/dist/components/editor/icons/border-top.js +3 -0
- package/dist/components/editor/icons/index.js +6 -0
- package/dist/components/editor/index.js +2 -0
- package/dist/components/editor/navbar/alignment_dropdown.js +97 -0
- package/dist/components/editor/navbar/button_modal.js +55 -0
- package/dist/components/editor/navbar/index.js +1 -0
- package/dist/components/editor/navbar/navbar.js +201 -0
- package/dist/components/editor/navbar/style_dropdown.js +65 -0
- package/dist/components/editor/plugins/blocks/blockquote.js +8 -0
- package/dist/components/editor/plugins/blocks/blocks.d.ts +1 -1
- package/dist/components/editor/plugins/blocks/blocks.js +50 -0
- package/dist/components/editor/plugins/blocks/buttons.js +81 -0
- package/dist/components/editor/plugins/blocks/dropdown-menu.js +62 -0
- package/dist/components/editor/plugins/blocks/image.js +36 -0
- package/dist/components/editor/plugins/blocks/index.js +1 -0
- package/dist/components/editor/plugins/blocks/list.js +17 -0
- package/dist/components/editor/plugins/blocks/media-popover.js +32 -0
- package/dist/components/editor/plugins/blocks/plate-button.d.ts +2 -2
- package/dist/components/editor/plugins/blocks/plate-button.js +37 -0
- package/dist/components/editor/plugins/blocks/popover.js +11 -0
- package/dist/components/editor/plugins/blocks/qa.js +45 -0
- package/dist/components/editor/plugins/blocks/resizable.d.ts +2 -2
- package/dist/components/editor/plugins/blocks/resizable.js +37 -0
- package/dist/components/editor/plugins/blocks/separator.js +19 -0
- package/dist/components/editor/plugins/blocks/table-cell.js +38 -0
- package/dist/components/editor/plugins/blocks/table-row.js +7 -0
- package/dist/components/editor/plugins/blocks/table.js +82 -0
- package/dist/components/editor/plugins/blocks/text.js +82 -0
- package/dist/components/editor/plugins/blocks/video.js +32 -0
- package/dist/components/editor/plugins/index.js +4 -0
- package/dist/components/editor/plugins/leafs/index.js +1 -0
- package/dist/components/editor/plugins/leafs/leafs.js +33 -0
- package/dist/components/editor/plugins/leafs/link.js +74 -0
- package/dist/components/editor/plugins/marks/index.js +1 -0
- package/dist/components/editor/plugins/marks/marks.js +12 -0
- package/dist/components/editor/plugins/plate.js +37 -0
- package/dist/components/editor/plugins/utils/exitBreak.js +31 -0
- package/dist/components/editor/plugins/utils/index.js +1 -0
- package/dist/components/editor/plugins/utils/resetBlockType.js +22 -0
- package/dist/components/editor/plugins/utils/selectOnBackspace.js +6 -0
- package/dist/components/editor/plugins/utils/softBreak.js +14 -0
- package/dist/components/editor/plugins/utils/utils.js +12 -0
- package/dist/components/editor/simple_editor/index.js +1 -0
- package/dist/components/editor/simple_editor/navbar.js +136 -0
- package/dist/components/editor/simple_editor/plugins.js +89 -0
- package/dist/components/editor/simple_editor/simple_editor.js +89 -0
- package/dist/components/feedback/animated_toast/animated_toast.js +55 -0
- package/dist/components/feedback/animated_toast/index.js +1 -0
- package/dist/components/feedback/badge/badge.js +66 -0
- package/dist/components/feedback/badge/index.js +1 -0
- package/dist/components/feedback/banner/banner.js +80 -0
- package/dist/components/feedback/banner/index.js +1 -0
- package/dist/components/feedback/chip/chip.js +94 -0
- package/dist/components/feedback/chip/index.js +1 -0
- package/dist/components/feedback/index.js +8 -0
- package/dist/components/feedback/loader/index.js +1 -0
- package/dist/components/feedback/loader/loader.js +34 -0
- package/dist/components/feedback/notification/index.js +1 -0
- package/dist/components/feedback/notification/notification.js +72 -0
- package/dist/components/feedback/progress/index.js +1 -0
- package/dist/components/feedback/progress/progress.js +87 -0
- package/dist/components/feedback/toast/index.js +1 -0
- package/dist/components/feedback/toast/toast.js +112 -0
- package/dist/components/feedback/tooltip/index.js +1 -0
- package/dist/components/feedback/tooltip/tooltip.js +26 -0
- package/dist/components/iconography/avatar/avatar.d.ts +1 -2
- package/dist/components/iconography/avatar/avatar.js +169 -0
- package/dist/components/iconography/avatar/icons/approved.js +5 -0
- package/dist/components/iconography/avatar/icons/busy.js +5 -0
- package/dist/components/iconography/avatar/icons/declined.js +5 -0
- package/dist/components/iconography/avatar/icons/default.js +4 -0
- package/dist/components/iconography/avatar/icons/focus.js +5 -0
- package/dist/components/iconography/avatar/icons/index.js +9 -0
- package/dist/components/iconography/avatar/icons/locked.js +5 -0
- package/dist/components/iconography/avatar/icons/offline.js +5 -0
- package/dist/components/iconography/avatar/icons/online.js +4 -0
- package/dist/components/iconography/avatar/icons/subscribed.js +9 -0
- package/dist/components/iconography/avatar/index.js +1 -0
- package/dist/components/iconography/icon/icon.js +10 -0
- package/dist/components/iconography/icon/index.js +1 -0
- package/dist/components/iconography/index.js +2 -0
- package/dist/components/index.js +12 -0
- package/dist/components/input/calendar/calendar.js +249 -0
- package/dist/components/input/calendar/index.js +1 -0
- package/dist/components/input/checkbox/checkbox.js +23 -0
- package/dist/components/input/checkbox/index.js +1 -0
- package/dist/components/input/date/date.js +517 -0
- package/dist/components/input/date/index.js +1 -0
- package/dist/components/input/filter/filter.js +304 -0
- package/dist/components/input/filter/filter_option.js +70 -0
- package/dist/components/input/filter/index.js +1 -0
- package/dist/components/input/index.js +10 -0
- package/dist/components/input/radio/index.js +1 -0
- package/dist/components/input/radio/radio.js +78 -0
- package/dist/components/input/search/index.js +1 -0
- package/dist/components/input/search/search.js +138 -0
- package/dist/components/input/select/index.js +1 -0
- package/dist/components/input/select/select.js +47 -0
- package/dist/components/input/text_area/index.js +1 -0
- package/dist/components/input/text_area/text_area.js +110 -0
- package/dist/components/input/text_input/index.js +1 -0
- package/dist/components/input/text_input/text_input.d.ts +0 -1
- package/dist/components/input/text_input/text_input.js +147 -0
- package/dist/components/input/time/index.js +1 -0
- package/dist/components/input/time/time.js +69 -0
- package/dist/components/media/common.js +1 -0
- package/dist/components/media/index.js +2 -0
- package/dist/components/media/video/index.js +1 -0
- package/dist/components/media/video/video.js +31 -0
- package/dist/components/media/video-player/index.js +1 -0
- package/dist/components/media/video-player/playlist-item.d.ts +2 -2
- package/dist/components/media/video-player/playlist-item.js +37 -0
- package/dist/components/media/video-player/video.d.ts +3 -13
- package/dist/components/media/video-player/video.js +178 -0
- package/dist/components/navigation/breadcrumb/breadcrumb.js +109 -0
- package/dist/components/navigation/breadcrumb/index.js +1 -0
- package/dist/components/navigation/index.js +3 -0
- package/dist/components/navigation/inner/index.js +1 -0
- package/dist/components/navigation/inner/inner.js +185 -0
- package/dist/components/navigation/tabs/index.js +1 -0
- package/dist/components/navigation/tabs/tabs.js +150 -0
- package/dist/components/surfaces/accordion/accordion.js +47 -0
- package/dist/components/surfaces/accordion/index.js +1 -0
- package/dist/components/surfaces/calendar_date/calendar_date.js +45 -0
- package/dist/components/surfaces/calendar_date/index.js +1 -0
- package/dist/components/surfaces/carousel/card/card.js +96 -0
- package/dist/components/surfaces/carousel/card/index.js +1 -0
- package/dist/components/surfaces/carousel/index.js +1 -0
- package/dist/components/surfaces/comment/comment.js +188 -0
- package/dist/components/surfaces/comment/helpers.js +26 -0
- package/dist/components/surfaces/comment/index.js +1 -0
- package/dist/components/surfaces/drawer/drawer.js +130 -0
- package/dist/components/surfaces/drawer/index.js +1 -0
- package/dist/components/surfaces/index.js +9 -0
- package/dist/components/surfaces/message/index.js +1 -0
- package/dist/components/surfaces/message/message.js +44 -0
- package/dist/components/surfaces/modal/index.js +1 -0
- package/dist/components/surfaces/modal/modal.js +127 -0
- package/dist/components/surfaces/portal/index.js +1 -0
- package/dist/components/surfaces/portal/portal.js +26 -0
- package/dist/components/surfaces/post/index.js +1 -0
- package/dist/components/surfaces/post/post.js +129 -0
- package/dist/components/table/index.js +1 -0
- package/dist/components/table/table/index.js +1 -0
- package/dist/components/table/table/table.js +184 -0
- package/dist/emoji/emojis.json +17577 -0
- package/dist/icons/arrow/arrow_all.js +6 -0
- package/dist/icons/arrow/arrow_all_diagonal.js +6 -0
- package/dist/icons/arrow/arrow_both_downwards.js +6 -0
- package/dist/icons/arrow/arrow_both_upwards.js +6 -0
- package/dist/icons/arrow/arrow_circle_left.js +6 -0
- package/dist/icons/arrow/arrow_circle_left_double.js +6 -0
- package/dist/icons/arrow/arrow_circle_left_double_alert.js +8 -0
- package/dist/icons/arrow/arrow_circle_right.js +6 -0
- package/dist/icons/arrow/arrow_circle_right_double.js +6 -0
- package/dist/icons/arrow/arrow_circle_right_double_alert.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_down_left.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_down_left_circle.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_down_right.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_down_right_circle.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_up_left.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_up_left_circle.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_up_right.js +6 -0
- package/dist/icons/arrow/arrow_diagonal_up_right_circle.js +6 -0
- package/dist/icons/arrow/arrow_down.js +6 -0
- package/dist/icons/arrow/arrow_down_bold.js +6 -0
- package/dist/icons/arrow/arrow_down_circle.js +6 -0
- package/dist/icons/arrow/arrow_left.js +6 -0
- package/dist/icons/arrow/arrow_left_bold.js +6 -0
- package/dist/icons/arrow/arrow_left_circle.js +6 -0
- package/dist/icons/arrow/arrow_left_curved.js +6 -0
- package/dist/icons/arrow/arrow_left_curved_circle.js +6 -0
- package/dist/icons/arrow/arrow_right.js +6 -0
- package/dist/icons/arrow/arrow_right_bold.js +6 -0
- package/dist/icons/arrow/arrow_right_circle.js +6 -0
- package/dist/icons/arrow/arrow_right_curved.js +6 -0
- package/dist/icons/arrow/arrow_right_curved_circle.js +6 -0
- package/dist/icons/arrow/arrow_up.js +6 -0
- package/dist/icons/arrow/arrow_up_bold.js +6 -0
- package/dist/icons/arrow/arrow_up_circle.js +6 -0
- package/dist/icons/arrow/chevron_down.js +6 -0
- package/dist/icons/arrow/chevron_down_circle.js +6 -0
- package/dist/icons/arrow/chevron_down_double.js +6 -0
- package/dist/icons/arrow/chevron_down_double_circle.js +6 -0
- package/dist/icons/arrow/chevron_left.js +6 -0
- package/dist/icons/arrow/chevron_left_circle.js +6 -0
- package/dist/icons/arrow/chevron_left_double.js +6 -0
- package/dist/icons/arrow/chevron_left_double_circle.js +6 -0
- package/dist/icons/arrow/chevron_right.js +6 -0
- package/dist/icons/arrow/chevron_right_circle.js +6 -0
- package/dist/icons/arrow/chevron_right_double.js +6 -0
- package/dist/icons/arrow/chevron_right_double_circle.js +6 -0
- package/dist/icons/arrow/chevron_scroll.js +6 -0
- package/dist/icons/arrow/chevron_up.js +6 -0
- package/dist/icons/arrow/chevron_up_circle.js +6 -0
- package/dist/icons/arrow/chevron_up_double.js +6 -0
- package/dist/icons/arrow/chevron_up_double_circle.js +6 -0
- package/dist/icons/arrow/forward_all.js +6 -0
- package/dist/icons/arrow/forward_all_bold.js +6 -0
- package/dist/icons/arrow/forward_bold.js +6 -0
- package/dist/icons/arrow/index.js +62 -0
- package/dist/icons/arrow/redo.js +6 -0
- package/dist/icons/arrow/redo_bold.js +6 -0
- package/dist/icons/arrow/reply.js +6 -0
- package/dist/icons/arrow/reply_all.js +6 -0
- package/dist/icons/arrow/reply_all_bold.js +6 -0
- package/dist/icons/arrow/reply_bold.js +6 -0
- package/dist/icons/arrow/undo.js +6 -0
- package/dist/icons/arrow/undo_bold.js +6 -0
- package/dist/icons/audio_video/drag_indicator.js +6 -0
- package/dist/icons/audio_video/eject.js +6 -0
- package/dist/icons/audio_video/equalizer.js +6 -0
- package/dist/icons/audio_video/fast_forward.js +6 -0
- package/dist/icons/audio_video/fast_forward_30.js +6 -0
- package/dist/icons/audio_video/fullscreen.js +6 -0
- package/dist/icons/audio_video/headphones.js +6 -0
- package/dist/icons/audio_video/index.js +38 -0
- package/dist/icons/audio_video/library_add.js +6 -0
- package/dist/icons/audio_video/library_delay.js +6 -0
- package/dist/icons/audio_video/library_music.js +6 -0
- package/dist/icons/audio_video/library_queue.js +6 -0
- package/dist/icons/audio_video/microphone.js +6 -0
- package/dist/icons/audio_video/musical_note.js +6 -0
- package/dist/icons/audio_video/next.js +6 -0
- package/dist/icons/audio_video/pause.js +6 -0
- package/dist/icons/audio_video/pause_circle.js +6 -0
- package/dist/icons/audio_video/play.js +6 -0
- package/dist/icons/audio_video/play_circle.js +6 -0
- package/dist/icons/audio_video/play_display.js +6 -0
- package/dist/icons/audio_video/play_pause.js +6 -0
- package/dist/icons/audio_video/play_solid.js +6 -0
- package/dist/icons/audio_video/player_list.js +6 -0
- package/dist/icons/audio_video/player_list_add.js +6 -0
- package/dist/icons/audio_video/player_list_play.js +6 -0
- package/dist/icons/audio_video/previous.js +6 -0
- package/dist/icons/audio_video/radio.js +6 -0
- package/dist/icons/audio_video/record.js +6 -0
- package/dist/icons/audio_video/repeat.js +6 -0
- package/dist/icons/audio_video/rewind.js +6 -0
- package/dist/icons/audio_video/rewind_30.js +6 -0
- package/dist/icons/audio_video/shuffle.js +6 -0
- package/dist/icons/audio_video/sound_wave.js +6 -0
- package/dist/icons/audio_video/stop.js +6 -0
- package/dist/icons/audio_video/stop_circle.js +6 -0
- package/dist/icons/audio_video/subscriptions.js +6 -0
- package/dist/icons/audio_video/tuner.js +6 -0
- package/dist/icons/audio_video/volume.js +6 -0
- package/dist/icons/audio_video/volume_high.js +6 -0
- package/dist/icons/audio_video/volume_low.js +6 -0
- package/dist/icons/audio_video/volume_slash.js +6 -0
- package/dist/icons/basic/aa_sansserif.js +7 -0
- package/dist/icons/basic/aa_serif.js +7 -0
- package/dist/icons/basic/anchor.js +8 -0
- package/dist/icons/basic/bible.js +6 -0
- package/dist/icons/basic/bold.js +6 -0
- package/dist/icons/basic/book.js +6 -0
- package/dist/icons/basic/book_open.js +6 -0
- package/dist/icons/basic/bookmark.js +6 -0
- package/dist/icons/basic/bookmark_add.js +6 -0
- package/dist/icons/basic/bookmark_slash.js +6 -0
- package/dist/icons/basic/bookmarks.js +6 -0
- package/dist/icons/basic/books.js +9 -0
- package/dist/icons/basic/box.js +6 -0
- package/dist/icons/basic/briefcase.js +6 -0
- package/dist/icons/basic/browse_activity.js +6 -0
- package/dist/icons/basic/browser.js +6 -0
- package/dist/icons/basic/browser_slash.js +6 -0
- package/dist/icons/basic/calculator.js +6 -0
- package/dist/icons/basic/camera.js +6 -0
- package/dist/icons/basic/camera_add.js +6 -0
- package/dist/icons/basic/camera_slash.js +6 -0
- package/dist/icons/basic/checkmark.js +6 -0
- package/dist/icons/basic/checkmark_circle.js +8 -0
- package/dist/icons/basic/checkmark_filled.js +6 -0
- package/dist/icons/basic/checkmarks.js +6 -0
- package/dist/icons/basic/circle.js +6 -0
- package/dist/icons/basic/circle_slash.js +8 -0
- package/dist/icons/basic/clear_text_style.js +6 -0
- package/dist/icons/basic/close.js +6 -0
- package/dist/icons/basic/close_circle.js +6 -0
- package/dist/icons/basic/close_filled.js +6 -0
- package/dist/icons/basic/copy.js +6 -0
- package/dist/icons/basic/delete.js +6 -0
- package/dist/icons/basic/detail.js +6 -0
- package/dist/icons/basic/dot.js +6 -0
- package/dist/icons/basic/download.js +6 -0
- package/dist/icons/basic/download_arrow.js +6 -0
- package/dist/icons/basic/droplet.js +8 -0
- package/dist/icons/basic/ellipsis_horizontal.js +6 -0
- package/dist/icons/basic/ellipsis_horizontal_circle.js +6 -0
- package/dist/icons/basic/ellipsis_vertical.js +6 -0
- package/dist/icons/basic/ellipsis_vertical_circle.js +6 -0
- package/dist/icons/basic/eye.js +6 -0
- package/dist/icons/basic/eye_slash.js +6 -0
- package/dist/icons/basic/fingerprint.js +6 -0
- package/dist/icons/basic/flag.js +6 -0
- package/dist/icons/basic/flag_wave.js +6 -0
- package/dist/icons/basic/flag_wave_filled.js +6 -0
- package/dist/icons/basic/flame.js +6 -0
- package/dist/icons/basic/gauge.js +6 -0
- package/dist/icons/basic/glasses.js +6 -0
- package/dist/icons/basic/graduation_cap.js +6 -0
- package/dist/icons/basic/hashmark.js +6 -0
- package/dist/icons/basic/heart.js +6 -0
- package/dist/icons/basic/heart_slash.js +6 -0
- package/dist/icons/basic/highlighter.js +6 -0
- package/dist/icons/basic/home.js +6 -0
- package/dist/icons/basic/image.js +6 -0
- package/dist/icons/basic/inbox.js +6 -0
- package/dist/icons/basic/index.js +131 -0
- package/dist/icons/basic/italic.js +6 -0
- package/dist/icons/basic/layers.js +6 -0
- package/dist/icons/basic/lightening.js +6 -0
- package/dist/icons/basic/lightening_slash.js +6 -0
- package/dist/icons/basic/link.js +6 -0
- package/dist/icons/basic/link_slash.js +6 -0
- package/dist/icons/basic/loudspeaker.js +6 -0
- package/dist/icons/basic/maximize.js +6 -0
- package/dist/icons/basic/menu.js +6 -0
- package/dist/icons/basic/menu_circle.js +6 -0
- package/dist/icons/basic/menu_dots.js +6 -0
- package/dist/icons/basic/microphone_slash.js +6 -0
- package/dist/icons/basic/minimize.js +6 -0
- package/dist/icons/basic/minus.js +6 -0
- package/dist/icons/basic/minus_circle.js +6 -0
- package/dist/icons/basic/move_item.js +6 -0
- package/dist/icons/basic/new.js +6 -0
- package/dist/icons/basic/newspaper.js +6 -0
- package/dist/icons/basic/node.js +6 -0
- package/dist/icons/basic/note_pad.js +7 -0
- package/dist/icons/basic/options.js +6 -0
- package/dist/icons/basic/paint_brush.js +6 -0
- package/dist/icons/basic/paperclip.js +6 -0
- package/dist/icons/basic/paperclip_slash.js +6 -0
- package/dist/icons/basic/pencil.js +6 -0
- package/dist/icons/basic/pencil_pad.js +6 -0
- package/dist/icons/basic/plus.js +6 -0
- package/dist/icons/basic/plus_circle.js +6 -0
- package/dist/icons/basic/presentation.js +6 -0
- package/dist/icons/basic/printer.js +6 -0
- package/dist/icons/basic/profile.js +6 -0
- package/dist/icons/basic/profile_check.js +6 -0
- package/dist/icons/basic/pulse.js +6 -0
- package/dist/icons/basic/qr_code.js +6 -0
- package/dist/icons/basic/resize.js +8 -0
- package/dist/icons/basic/scan.js +6 -0
- package/dist/icons/basic/scissors.js +6 -0
- package/dist/icons/basic/screenshot.js +6 -0
- package/dist/icons/basic/search.js +6 -0
- package/dist/icons/basic/select_item.js +7 -0
- package/dist/icons/basic/settings.js +6 -0
- package/dist/icons/basic/share.js +6 -0
- package/dist/icons/basic/share_external.js +6 -0
- package/dist/icons/basic/square.js +6 -0
- package/dist/icons/basic/star.js +6 -0
- package/dist/icons/basic/star_circle.js +6 -0
- package/dist/icons/basic/star_filled.js +6 -0
- package/dist/icons/basic/star_filled_half.js +6 -0
- package/dist/icons/basic/star_slash.js +6 -0
- package/dist/icons/basic/sticker.js +6 -0
- package/dist/icons/basic/strikethrough.js +6 -0
- package/dist/icons/basic/subtask.js +7 -0
- package/dist/icons/basic/tax.js +9 -0
- package/dist/icons/basic/text_bg_color.js +6 -0
- package/dist/icons/basic/text_color.js +6 -0
- package/dist/icons/basic/textbox.js +6 -0
- package/dist/icons/basic/thumbs_down.js +6 -0
- package/dist/icons/basic/thumbs_up.js +6 -0
- package/dist/icons/basic/thumbs_up_filled.js +6 -0
- package/dist/icons/basic/toggle_left.js +6 -0
- package/dist/icons/basic/toggle_right.js +6 -0
- package/dist/icons/basic/translate.js +6 -0
- package/dist/icons/basic/trash.js +6 -0
- package/dist/icons/basic/trash_slash.js +6 -0
- package/dist/icons/basic/underline.js +6 -0
- package/dist/icons/basic/upload.js +6 -0
- package/dist/icons/basic/video.js +6 -0
- package/dist/icons/basic/video_add.js +7 -0
- package/dist/icons/basic/video_slash.js +6 -0
- package/dist/icons/basic/wrench.js +6 -0
- package/dist/icons/basic/zoom_in.js +6 -0
- package/dist/icons/basic/zoom_out.js +6 -0
- package/dist/icons/data/bar_chart.js +6 -0
- package/dist/icons/data/bar_chart_downward.js +6 -0
- package/dist/icons/data/bar_chart_downward_outline.js +6 -0
- package/dist/icons/data/bar_chart_upward.js +6 -0
- package/dist/icons/data/bar_chart_upward_outline.js +6 -0
- package/dist/icons/data/candlestick_chart.js +6 -0
- package/dist/icons/data/four_circles.js +6 -0
- package/dist/icons/data/index.js +20 -0
- package/dist/icons/data/legend_toggle.js +6 -0
- package/dist/icons/data/line_chart.js +6 -0
- package/dist/icons/data/line_chart_area.js +6 -0
- package/dist/icons/data/line_chart_area_shaded.js +6 -0
- package/dist/icons/data/line_chart_double.js +6 -0
- package/dist/icons/data/line_chart_downward.js +6 -0
- package/dist/icons/data/line_chart_node.js +6 -0
- package/dist/icons/data/line_chart_outline.js +6 -0
- package/dist/icons/data/line_chart_search.js +6 -0
- package/dist/icons/data/line_chart_stars.js +6 -0
- package/dist/icons/data/line_chart_upward.js +6 -0
- package/dist/icons/data/pie_chart.js +7 -0
- package/dist/icons/data/tree.js +6 -0
- package/dist/icons/email/index.js +8 -0
- package/dist/icons/email/mail.js +6 -0
- package/dist/icons/email/mail_check.js +6 -0
- package/dist/icons/email/mail_minus.js +6 -0
- package/dist/icons/email/mail_send.js +6 -0
- package/dist/icons/email/send.js +6 -0
- package/dist/icons/email/send_close.js +6 -0
- package/dist/icons/email/send_schedule.js +6 -0
- package/dist/icons/email/send_text.js +6 -0
- package/dist/icons/emoji/emoji_add.js +6 -0
- package/dist/icons/emoji/index.js +6 -0
- package/dist/icons/emoji/laughing.js +6 -0
- package/dist/icons/emoji/neutral.js +6 -0
- package/dist/icons/emoji/sad.js +6 -0
- package/dist/icons/emoji/shocked.js +6 -0
- package/dist/icons/emoji/smile.js +6 -0
- package/dist/icons/file/clipboard.js +6 -0
- package/dist/icons/file/clipboard_check.js +6 -0
- package/dist/icons/file/clipboard_close.js +6 -0
- package/dist/icons/file/clipboard_minus.js +6 -0
- package/dist/icons/file/clipboard_plus.js +6 -0
- package/dist/icons/file/clipboard_text.js +6 -0
- package/dist/icons/file/file.js +6 -0
- package/dist/icons/file/file_add.js +6 -0
- package/dist/icons/file/file_check.js +6 -0
- package/dist/icons/file/file_close.js +6 -0
- package/dist/icons/file/file_code.js +6 -0
- package/dist/icons/file/file_download.js +6 -0
- package/dist/icons/file/file_draft.js +6 -0
- package/dist/icons/file/file_gear.js +7 -0
- package/dist/icons/file/file_minus.js +6 -0
- package/dist/icons/file/file_plus.js +6 -0
- package/dist/icons/file/file_scan.js +6 -0
- package/dist/icons/file/file_shred.js +6 -0
- package/dist/icons/file/file_text.js +6 -0
- package/dist/icons/file/file_upload.js +6 -0
- package/dist/icons/file/folder.js +6 -0
- package/dist/icons/file/folder_add.js +6 -0
- package/dist/icons/file/folder_arrow.js +6 -0
- package/dist/icons/file/folder_check.js +6 -0
- package/dist/icons/file/folder_close.js +6 -0
- package/dist/icons/file/folder_cloud.js +6 -0
- package/dist/icons/file/folder_gear.js +7 -0
- package/dist/icons/file/folder_minus.js +6 -0
- package/dist/icons/file/folder_music.js +6 -0
- package/dist/icons/file/folder_open.js +6 -0
- package/dist/icons/file/folder_plus.js +6 -0
- package/dist/icons/file/folder_zip.js +6 -0
- package/dist/icons/file/index.js +36 -0
- package/dist/icons/file/note.js +6 -0
- package/dist/icons/file/note_text.js +6 -0
- package/dist/icons/file/pdf.js +6 -0
- package/dist/icons/file/photo.js +6 -0
- package/dist/icons/finance/bitcoin.js +6 -0
- package/dist/icons/finance/coins.js +10 -0
- package/dist/icons/finance/credit_card.js +6 -0
- package/dist/icons/finance/credit_card_add.js +6 -0
- package/dist/icons/finance/credit_card_face.js +6 -0
- package/dist/icons/finance/credit_card_member.js +6 -0
- package/dist/icons/finance/credit_card_outcome.js +6 -0
- package/dist/icons/finance/credit_card_scan.js +6 -0
- package/dist/icons/finance/credit_card_share.js +6 -0
- package/dist/icons/finance/credit_card_slash.js +6 -0
- package/dist/icons/finance/currency_exchange.js +6 -0
- package/dist/icons/finance/dollar.js +6 -0
- package/dist/icons/finance/ethereum.js +6 -0
- package/dist/icons/finance/index.js +16 -0
- package/dist/icons/finance/paypass.js +6 -0
- package/dist/icons/finance/strongbox.js +6 -0
- package/dist/icons/finance/wallet.js +6 -0
- package/dist/icons/index.js +22 -0
- package/dist/icons/layout/block_align_bottom.js +6 -0
- package/dist/icons/layout/block_align_center.js +6 -0
- package/dist/icons/layout/block_align_left.js +6 -0
- package/dist/icons/layout/block_align_middle.js +6 -0
- package/dist/icons/layout/block_align_right.js +6 -0
- package/dist/icons/layout/block_align_top.js +6 -0
- package/dist/icons/layout/block_horizontal.js +6 -0
- package/dist/icons/layout/block_vertical.js +6 -0
- package/dist/icons/layout/edit_shape.js +6 -0
- package/dist/icons/layout/elements.js +6 -0
- package/dist/icons/layout/elements_add.js +6 -0
- package/dist/icons/layout/elements_filled.js +6 -0
- package/dist/icons/layout/elements_masonry.js +6 -0
- package/dist/icons/layout/frame.js +6 -0
- package/dist/icons/layout/frame_stack.js +6 -0
- package/dist/icons/layout/grid.js +6 -0
- package/dist/icons/layout/grid_column_three.js +6 -0
- package/dist/icons/layout/grid_column_two.js +6 -0
- package/dist/icons/layout/grid_dynamic.js +6 -0
- package/dist/icons/layout/grid_frame.js +6 -0
- package/dist/icons/layout/grid_row_three.js +6 -0
- package/dist/icons/layout/grid_row_two.js +6 -0
- package/dist/icons/layout/grid_six.js +6 -0
- package/dist/icons/layout/grid_small.js +6 -0
- package/dist/icons/layout/iframe.js +6 -0
- package/dist/icons/layout/index.js +44 -0
- package/dist/icons/layout/kanban.js +6 -0
- package/dist/icons/layout/layout.js +6 -0
- package/dist/icons/layout/list.js +6 -0
- package/dist/icons/layout/list_filled.js +11 -0
- package/dist/icons/layout/padding.js +6 -0
- package/dist/icons/layout/page_break.js +6 -0
- package/dist/icons/layout/rotate_left.js +6 -0
- package/dist/icons/layout/rotate_right.js +6 -0
- package/dist/icons/layout/ruler.js +6 -0
- package/dist/icons/layout/segment.js +6 -0
- package/dist/icons/layout/select_area.js +6 -0
- package/dist/icons/layout/select_boundary.js +6 -0
- package/dist/icons/layout/sidebar_left.js +6 -0
- package/dist/icons/layout/sidebar_right.js +6 -0
- package/dist/icons/layout/slides.js +6 -0
- package/dist/icons/layout/slides_horizontal.js +6 -0
- package/dist/icons/layout/slides_vertical.js +11 -0
- package/dist/icons/layout/stack.js +6 -0
- package/dist/icons/layout/text.js +6 -0
- package/dist/icons/maps/atlas.js +6 -0
- package/dist/icons/maps/compass.js +6 -0
- package/dist/icons/maps/direction.js +6 -0
- package/dist/icons/maps/direction_angled.js +6 -0
- package/dist/icons/maps/globe.js +6 -0
- package/dist/icons/maps/globe_slash.js +6 -0
- package/dist/icons/maps/index.js +22 -0
- package/dist/icons/maps/location.js +6 -0
- package/dist/icons/maps/location_slash.js +6 -0
- package/dist/icons/maps/map.js +6 -0
- package/dist/icons/maps/marker.js +6 -0
- package/dist/icons/maps/panorama.js +6 -0
- package/dist/icons/maps/pin.js +6 -0
- package/dist/icons/maps/pin_arrow.js +6 -0
- package/dist/icons/maps/pin_location.js +6 -0
- package/dist/icons/maps/pin_plus.js +6 -0
- package/dist/icons/maps/pin_question.js +6 -0
- package/dist/icons/maps/pin_slash.js +6 -0
- package/dist/icons/maps/push_pin.js +6 -0
- package/dist/icons/maps/push_pin_filled.js +6 -0
- package/dist/icons/maps/push_pin_slash.js +6 -0
- package/dist/icons/maps/radar.js +6 -0
- package/dist/icons/maps/route.js +6 -0
- package/dist/icons/message/bubble.js +6 -0
- package/dist/icons/message/bubble_question.js +6 -0
- package/dist/icons/message/comment.js +6 -0
- package/dist/icons/message/comment_add.js +6 -0
- package/dist/icons/message/comment_check.js +6 -0
- package/dist/icons/message/comment_close.js +6 -0
- package/dist/icons/message/comment_minus.js +6 -0
- package/dist/icons/message/comment_text.js +6 -0
- package/dist/icons/message/index.js +8 -0
- package/dist/icons/misc/advertisement.js +6 -0
- package/dist/icons/misc/atom.js +6 -0
- package/dist/icons/misc/bone.js +6 -0
- package/dist/icons/misc/brightness_high.js +6 -0
- package/dist/icons/misc/brightness_low.js +6 -0
- package/dist/icons/misc/contrast.js +6 -0
- package/dist/icons/misc/crosshairs.js +6 -0
- package/dist/icons/misc/crown.js +6 -0
- package/dist/icons/misc/footprint.js +6 -0
- package/dist/icons/misc/form.js +6 -0
- package/dist/icons/misc/funnel.js +6 -0
- package/dist/icons/misc/index.js +25 -0
- package/dist/icons/misc/infinite.js +6 -0
- package/dist/icons/misc/insert_button.js +6 -0
- package/dist/icons/misc/light_bulb.js +6 -0
- package/dist/icons/misc/moon.js +6 -0
- package/dist/icons/misc/nut.js +6 -0
- package/dist/icons/misc/planet.js +6 -0
- package/dist/icons/misc/plus_thick.js +6 -0
- package/dist/icons/misc/pocket.js +6 -0
- package/dist/icons/misc/rocket.js +6 -0
- package/dist/icons/misc/soup.js +10 -0
- package/dist/icons/misc/sun.js +6 -0
- package/dist/icons/misc/toy_horse.js +6 -0
- package/dist/icons/misc/trophy.js +6 -0
- package/dist/icons/misc/watercloset.js +6 -0
- package/dist/icons/notifications/alert_circle.js +6 -0
- package/dist/icons/notifications/alert_octogon.js +6 -0
- package/dist/icons/notifications/alert_triangle.js +6 -0
- package/dist/icons/notifications/app_notification.js +6 -0
- package/dist/icons/notifications/bell.js +6 -0
- package/dist/icons/notifications/bell_alert.js +6 -0
- package/dist/icons/notifications/bell_checkmark.js +6 -0
- package/dist/icons/notifications/bell_minus.js +6 -0
- package/dist/icons/notifications/bell_plus.js +6 -0
- package/dist/icons/notifications/bell_ring.js +8 -0
- package/dist/icons/notifications/bell_slash.js +6 -0
- package/dist/icons/notifications/close_octogon.js +6 -0
- package/dist/icons/notifications/index.js +14 -0
- package/dist/icons/notifications/information.js +6 -0
- package/dist/icons/notifications/minus_octogon.js +6 -0
- package/dist/icons/notifications/question_circle.js +6 -0
- package/dist/icons/people/group.js +6 -0
- package/dist/icons/people/group_add.js +6 -0
- package/dist/icons/people/group_chat.js +8 -0
- package/dist/icons/people/group_remove.js +6 -0
- package/dist/icons/people/group_send.js +7 -0
- package/dist/icons/people/groups.js +6 -0
- package/dist/icons/people/index.js +13 -0
- package/dist/icons/people/person.js +6 -0
- package/dist/icons/people/person_add.js +6 -0
- package/dist/icons/people/person_checkmark.js +6 -0
- package/dist/icons/people/person_circle.js +8 -0
- package/dist/icons/people/person_close.js +8 -0
- package/dist/icons/people/person_remove.js +6 -0
- package/dist/icons/people/person_slash.js +8 -0
- package/dist/icons/phone/index.js +14 -0
- package/dist/icons/phone/keypad.js +6 -0
- package/dist/icons/phone/phone.js +6 -0
- package/dist/icons/phone/phone_add.js +6 -0
- package/dist/icons/phone/phone_calling.js +6 -0
- package/dist/icons/phone/phone_check.js +6 -0
- package/dist/icons/phone/phone_close.js +6 -0
- package/dist/icons/phone/phone_decline.js +6 -0
- package/dist/icons/phone/phone_end.js +6 -0
- package/dist/icons/phone/phone_forwarded.js +6 -0
- package/dist/icons/phone/phone_hash.js +6 -0
- package/dist/icons/phone/phone_incoming.js +6 -0
- package/dist/icons/phone/phone_missed.js +6 -0
- package/dist/icons/phone/phone_outgoing.js +6 -0
- package/dist/icons/phone/phone_pause.js +6 -0
- package/dist/icons/phone/phone_slash.js +6 -0
- package/dist/icons/phone/voicemail.js +6 -0
- package/dist/icons/security/index.js +11 -0
- package/dist/icons/security/key.js +6 -0
- package/dist/icons/security/key_slash.js +6 -0
- package/dist/icons/security/lock.js +6 -0
- package/dist/icons/security/lock_circle.js +6 -0
- package/dist/icons/security/lock_open.js +6 -0
- package/dist/icons/security/lock_slash.js +6 -0
- package/dist/icons/security/shield.js +6 -0
- package/dist/icons/security/shield_checkmark.js +6 -0
- package/dist/icons/security/shield_lock.js +6 -0
- package/dist/icons/security/shield_slash.js +6 -0
- package/dist/icons/security/verified.js +6 -0
- package/dist/icons/shopping/basket.js +6 -0
- package/dist/icons/shopping/cart.js +6 -0
- package/dist/icons/shopping/cart_filled.js +6 -0
- package/dist/icons/shopping/coupon.js +6 -0
- package/dist/icons/shopping/coupon_cut.js +6 -0
- package/dist/icons/shopping/delivery.js +6 -0
- package/dist/icons/shopping/discount.js +6 -0
- package/dist/icons/shopping/gift.js +6 -0
- package/dist/icons/shopping/gift_bag.js +6 -0
- package/dist/icons/shopping/index.js +15 -0
- package/dist/icons/shopping/inventory.js +6 -0
- package/dist/icons/shopping/point_of_sale.js +6 -0
- package/dist/icons/shopping/shirt.js +6 -0
- package/dist/icons/shopping/tag.js +6 -0
- package/dist/icons/shopping/tag_diagonal.js +6 -0
- package/dist/icons/shopping/tote.js +6 -0
- package/dist/icons/special/index.js +4 -0
- package/dist/icons/special/upload_audio.js +11 -0
- package/dist/icons/special/upload_file.js +6 -0
- package/dist/icons/special/upload_image.js +8 -0
- package/dist/icons/special/upload_video.js +9 -0
- package/dist/icons/symbols/at.js +6 -0
- package/dist/icons/symbols/cc.js +6 -0
- package/dist/icons/symbols/cmd.js +6 -0
- package/dist/icons/symbols/facebook.js +6 -0
- package/dist/icons/symbols/google.js +9 -0
- package/dist/icons/symbols/hash.js +6 -0
- package/dist/icons/symbols/index.js +9 -0
- package/dist/icons/symbols/instagram.js +18 -0
- package/dist/icons/symbols/messenger.js +12 -0
- package/dist/icons/symbols/twitter.js +6 -0
- package/dist/icons/technology/battery.js +6 -0
- package/dist/icons/technology/battery_100.js +6 -0
- package/dist/icons/technology/battery_20.js +6 -0
- package/dist/icons/technology/battery_40.js +6 -0
- package/dist/icons/technology/battery_60.js +6 -0
- package/dist/icons/technology/battery_80.js +6 -0
- package/dist/icons/technology/battery_charging.js +6 -0
- package/dist/icons/technology/battery_slash.js +6 -0
- package/dist/icons/technology/devices.js +6 -0
- package/dist/icons/technology/floppy_disk.js +6 -0
- package/dist/icons/technology/index.js +17 -0
- package/dist/icons/technology/iphone.js +6 -0
- package/dist/icons/technology/laptop.js +6 -0
- package/dist/icons/technology/mobile.js +6 -0
- package/dist/icons/technology/monitor.js +6 -0
- package/dist/icons/technology/server.js +6 -0
- package/dist/icons/technology/sim_card.js +6 -0
- package/dist/icons/technology/usb_stick.js +6 -0
- package/dist/icons/text/align_center.js +6 -0
- package/dist/icons/text/align_justified.js +6 -0
- package/dist/icons/text/align_left.js +6 -0
- package/dist/icons/text/align_right.js +6 -0
- package/dist/icons/text/code_block.js +6 -0
- package/dist/icons/text/divider.js +6 -0
- package/dist/icons/text/footnote.js +8 -0
- package/dist/icons/text/indent_decrease.js +6 -0
- package/dist/icons/text/indent_increase.js +6 -0
- package/dist/icons/text/index.js +13 -0
- package/dist/icons/text/list_ordered.js +6 -0
- package/dist/icons/text/list_unordered.js +6 -0
- package/dist/icons/text/quote.js +6 -0
- package/dist/icons/text/table.js +6 -0
- package/dist/icons/time/alarm.js +6 -0
- package/dist/icons/time/alarm_checkmark.js +6 -0
- package/dist/icons/time/alarm_minus.js +6 -0
- package/dist/icons/time/alarm_plus.js +6 -0
- package/dist/icons/time/alarm_slash.js +6 -0
- package/dist/icons/time/alarm_snooze.js +6 -0
- package/dist/icons/time/calendar.js +6 -0
- package/dist/icons/time/calendar_add.js +6 -0
- package/dist/icons/time/calendar_checkmark.js +6 -0
- package/dist/icons/time/calendar_close.js +6 -0
- package/dist/icons/time/calendar_dates.js +6 -0
- package/dist/icons/time/calendar_minus.js +6 -0
- package/dist/icons/time/calendar_plus.js +6 -0
- package/dist/icons/time/calendar_scroll.js +8 -0
- package/dist/icons/time/clock.js +6 -0
- package/dist/icons/time/clock_history.js +6 -0
- package/dist/icons/time/index.js +19 -0
- package/dist/icons/time/stopwatch.js +6 -0
- package/dist/icons/time/timer.js +6 -0
- package/dist/icons/time/watch.js +6 -0
- package/dist/index.js +5 -2
- package/dist/styles/output.css +1771 -0
- package/dist/types/attributes.js +1 -0
- package/dist/types/index.js +1 -0
- package/dist/utils/date.d.ts +1 -1
- package/dist/utils/date.js +98 -0
- package/dist/utils/function.js +1 -0
- package/dist/utils/index.js +2 -0
- package/package.json +2 -5
- package/dist/components/actions/dropdown/dropdown.stories.d.ts +0 -5
- package/dist/components/custom/courses_selection/courses_selection.stories.d.ts +0 -5
- package/dist/components/custom/users_selection/users_selection.stories.d.ts +0 -5
- package/dist/components/editor/editor.stories.d.ts +0 -6
- package/dist/components/iconography/avatar/avatar.stories.d.ts +0 -7
- package/dist/components/media/video-player/video.stories.d.ts +0 -6
- package/dist/main.js.LICENSE.txt +0 -90
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createPluginFactory, PlateElement, } from '@udecode/plate';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { ELEMENT_QA } from '../../constants';
|
|
5
|
+
import { EditorContext } from '../../context';
|
|
6
|
+
import { Button } from '../../../actions';
|
|
7
|
+
import { Box } from '../../../atoms/box';
|
|
8
|
+
import { HideButRender } from '../../../atoms/hide';
|
|
9
|
+
import { H } from '../../../atoms/typography';
|
|
10
|
+
import { ChevronDown } from '../../../../icons/arrow/chevron_down';
|
|
11
|
+
import { ChevronUp } from '../../../../icons/arrow/chevron_up';
|
|
12
|
+
export const QuestionAnswerElement = React.forwardRef(({ children, element, ...props }, ref) => {
|
|
13
|
+
const { questionAnswerId } = element;
|
|
14
|
+
const { commentInputLoader: CommentInput, commentLoader: Comments } = React.useContext(EditorContext);
|
|
15
|
+
const [showAnswers, setShowAnswers] = React.useState(false);
|
|
16
|
+
return (React.createElement(PlateElement, { asChild: true, element: element, ref: ref, ...props },
|
|
17
|
+
React.createElement(React.Fragment, null,
|
|
18
|
+
React.createElement(Question, null,
|
|
19
|
+
React.createElement(H, { as: "p", "$fontSize": 18, "$lineHeight": 26, "$mediumBold": true }, children)),
|
|
20
|
+
React.createElement(Box, { "$dir": "column", "$gap": 24, "$padding": 24, ...{ contentEditable: false } },
|
|
21
|
+
React.createElement(Button, { as: "div", icon: showAnswers ? (React.createElement(ChevronUp, { color: "grey-3" })) : (React.createElement(ChevronDown, { color: "grey-3" })), onClick: () => setShowAnswers((prev) => !prev), size: "small", sx: `
|
|
22
|
+
width: fit-content;
|
|
23
|
+
flex-direction: row-reverse;
|
|
24
|
+
color: var(--color-grey-5);
|
|
25
|
+
&:not(:hover) svg {
|
|
26
|
+
fill: var(--color-grey-3);
|
|
27
|
+
}
|
|
28
|
+
`, type: "text", ...{ contentEditable: false } }, showAnswers ? 'Hide answers' : 'Show answers'),
|
|
29
|
+
React.createElement(HideButRender, { show: showAnswers },
|
|
30
|
+
React.createElement(Comments, { questionAnswerId: questionAnswerId })),
|
|
31
|
+
React.createElement(CommentInput, { questionAnswerId: questionAnswerId })))));
|
|
32
|
+
});
|
|
33
|
+
const Question = styled.div `
|
|
34
|
+
margin-bottom: 8px;
|
|
35
|
+
padding: 16px;
|
|
36
|
+
border-left: 8px solid var(--color-hue-blue-1);
|
|
37
|
+
border-radius: 8px;
|
|
38
|
+
background-color: var(--color-hue-blue-3);
|
|
39
|
+
`;
|
|
40
|
+
export const createQAPlugin = createPluginFactory({
|
|
41
|
+
key: ELEMENT_QA,
|
|
42
|
+
type: ELEMENT_QA,
|
|
43
|
+
isElement: true,
|
|
44
|
+
component: QuestionAnswerElement,
|
|
45
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export declare const mediaResizeHandleVariants: (props?: ({
|
|
3
|
-
direction?: "
|
|
3
|
+
direction?: "right" | "left" | null | undefined;
|
|
4
4
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
5
5
|
export declare const ResizeHandle: React.ForwardRefExoticComponent<Omit<{
|
|
6
6
|
as?: React.ElementType<any> | undefined;
|
|
@@ -35,5 +35,5 @@ export declare const ResizeHandle: React.ForwardRefExoticComponent<Omit<{
|
|
|
35
35
|
export declare const Resizable: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement> & {
|
|
36
36
|
options: import("@udecode/plate-resizable").ResizableOptions;
|
|
37
37
|
} & React.RefAttributes<HTMLDivElement>, "ref"> & import("class-variance-authority").VariantProps<(props?: ({
|
|
38
|
-
align?: "
|
|
38
|
+
align?: "center" | "right" | "left" | null | undefined;
|
|
39
39
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { cn, withRef, withVariants } from '@udecode/cn';
|
|
4
|
+
import { Resizable as ResizablePrimitive, ResizeHandle as ResizeHandlePrimitive, } from '@udecode/plate-resizable';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
export const mediaResizeHandleVariants = cva(cn('top-0 flex w-6 select-none flex-col justify-center', "after:flex after:h-16 after:w-[3px] after:rounded-[6px] after:bg-ring after:opacity-0 after:content-['_'] group-hover:after:opacity-100"), {
|
|
7
|
+
variants: {
|
|
8
|
+
direction: {
|
|
9
|
+
left: '-left-3 -ml-3 pl-3',
|
|
10
|
+
right: '-right-3 -mr-3 items-end pr-3',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
const resizeHandleVariants = cva(cn('absolute z-40'), {
|
|
15
|
+
variants: {
|
|
16
|
+
direction: {
|
|
17
|
+
left: 'h-full cursor-col-resize',
|
|
18
|
+
right: 'h-full cursor-col-resize',
|
|
19
|
+
top: 'w-full cursor-row-resize',
|
|
20
|
+
bottom: 'w-full cursor-row-resize',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
const ResizeHandleVariants = withVariants(ResizeHandlePrimitive, resizeHandleVariants, ['direction']);
|
|
25
|
+
export const ResizeHandle = withRef((props, ref) => (React.createElement(ResizeHandleVariants, { ref: ref, direction: props.options?.direction, ...props })));
|
|
26
|
+
const resizableVariants = cva('', {
|
|
27
|
+
variants: {
|
|
28
|
+
align: {
|
|
29
|
+
left: 'mr-auto',
|
|
30
|
+
center: 'mx-auto',
|
|
31
|
+
right: 'ml-auto',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
export const Resizable = withVariants(ResizablePrimitive, resizableVariants, [
|
|
36
|
+
'align',
|
|
37
|
+
]);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
3
|
+
import { withProps, withVariants } from '@udecode/cn';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
const separatorVariants = cva('shrink-0 bg-border', {
|
|
6
|
+
variants: {
|
|
7
|
+
orientation: {
|
|
8
|
+
horizontal: 'h-[1px] w-full',
|
|
9
|
+
vertical: 'h-full w-[1px]',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
orientation: 'horizontal',
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export const Separator = withVariants(withProps(SeparatorPrimitive.Root, {
|
|
17
|
+
orientation: 'horizontal',
|
|
18
|
+
decorative: true,
|
|
19
|
+
}), separatorVariants);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { cn, withProps, withRef } from '@udecode/cn';
|
|
3
|
+
import { PlateElement } from '@udecode/plate-common';
|
|
4
|
+
import { useTableCellElement, useTableCellElementResizable, useTableCellElementResizableState, useTableCellElementState, } from '@udecode/plate-table';
|
|
5
|
+
import { ResizeHandle } from './resizable';
|
|
6
|
+
export const TableCellElement = withRef(({ children, className, style, hideBorder, isHeader, ...props }, ref) => {
|
|
7
|
+
const { element } = props;
|
|
8
|
+
const { colIndex, rowIndex, readOnly, selected, hovered, hoveredLeft, rowSize, borders, isSelectingCell, colSpan, } = useTableCellElementState();
|
|
9
|
+
const { props: cellProps } = useTableCellElement({ element: props.element });
|
|
10
|
+
const resizableState = useTableCellElementResizableState({
|
|
11
|
+
colIndex,
|
|
12
|
+
rowIndex,
|
|
13
|
+
colSpan,
|
|
14
|
+
});
|
|
15
|
+
const { rightProps, bottomProps, leftProps, hiddenLeft } = useTableCellElementResizable(resizableState);
|
|
16
|
+
const Cell = isHeader ? 'th' : 'td';
|
|
17
|
+
return (React.createElement(PlateElement, { ref: ref, asChild: true, className: cn('relative h-full overflow-visible border-none bg-background p-0', hideBorder && 'before:border-none', element.background ? 'bg-[--cellBackground]' : 'bg-background', !hideBorder &&
|
|
18
|
+
cn(isHeader && 'text-left [&_>_*]:m-0', 'before:h-full before:w-full', selected && 'before:z-10 before:bg-muted', "before:absolute before:box-border before:select-none before:content-['']", borders &&
|
|
19
|
+
cn(borders.bottom?.size &&
|
|
20
|
+
`before:border-b before:border-b-border`, borders.right?.size && `before:border-r before:border-r-border`, borders.left?.size && `before:border-l before:border-l-border`, borders.top?.size && `before:border-t before:border-t-border`)), className), ...cellProps, ...props, style: {
|
|
21
|
+
'--cellBackground': element.background,
|
|
22
|
+
...style,
|
|
23
|
+
} },
|
|
24
|
+
React.createElement(Cell, null,
|
|
25
|
+
React.createElement("div", { className: "relative z-20 box-border h-full px-3 py-2", style: {
|
|
26
|
+
minHeight: rowSize,
|
|
27
|
+
} }, children),
|
|
28
|
+
!isSelectingCell && (React.createElement("div", { className: "group absolute top-0 h-full w-full select-none", contentEditable: false, suppressContentEditableWarning: true }, !readOnly && (React.createElement(React.Fragment, null,
|
|
29
|
+
React.createElement(ResizeHandle, { ...rightProps, className: "-top-3 right-[-5px] w-[10px]" }),
|
|
30
|
+
React.createElement(ResizeHandle, { ...bottomProps, className: "bottom-[-5px] h-[10px]" }),
|
|
31
|
+
!hiddenLeft && (React.createElement(ResizeHandle, { ...leftProps, className: "-top-3 left-[-5px] w-[10px]" })),
|
|
32
|
+
hovered && (React.createElement("div", { className: cn('absolute -top-3 z-30 h-[calc(100%_+_12px)] w-1 bg-ring', 'right-[-1.5px]') })),
|
|
33
|
+
hoveredLeft && (React.createElement("div", { className: cn('absolute -top-3 z-30 h-[calc(100%_+_12px)] w-1 bg-ring', 'left-[-1.5px]') })))))))));
|
|
34
|
+
});
|
|
35
|
+
TableCellElement.displayName = 'TableCellElement';
|
|
36
|
+
export const TableCellHeaderElement = withProps(TableCellElement, {
|
|
37
|
+
isHeader: true,
|
|
38
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { cn, withRef } from '@udecode/cn';
|
|
3
|
+
import { PlateElement } from '@udecode/plate-common';
|
|
4
|
+
export const TableRowElement = withRef(({ hideBorder, children, ...props }, ref) => {
|
|
5
|
+
return (React.createElement(PlateElement, { asChild: true, ref: ref, className: cn('h-full', hideBorder && 'border-none'), ...props },
|
|
6
|
+
React.createElement("tr", null, children)));
|
|
7
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { cn, withRef } from '@udecode/cn';
|
|
3
|
+
import { isSelectionExpanded, PlateElement, useEditorRef, useEditorSelector, useElement, useRemoveNodeButton, withHOC, } from '@udecode/plate-common';
|
|
4
|
+
import { mergeTableCells, TableProvider, unmergeTableCells, useTableBordersDropdownMenuContentState, useTableElement, useTableElementState, useTableMergeState, } from '@udecode/plate-table';
|
|
5
|
+
import { useReadOnly, useSelected } from 'slate-react';
|
|
6
|
+
import { PopoverAnchor } from '@radix-ui/react-popover';
|
|
7
|
+
import { Combine, Trash, Ungroup } from 'lucide-react';
|
|
8
|
+
import { Button } from './plate-button';
|
|
9
|
+
import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuPortal, DropdownMenuTrigger, } from './dropdown-menu';
|
|
10
|
+
import { Popover, PopoverContent, popoverVariants } from './popover';
|
|
11
|
+
import { Separator } from './separator';
|
|
12
|
+
import { BorderAll, BorderBottom, BorderLeft, BorderNone, BorderRight, BorderTop, } from '../../icons';
|
|
13
|
+
export const TableBordersDropdownMenuContent = withRef((props, ref) => {
|
|
14
|
+
const { getOnSelectTableBorder, hasOuterBorders, hasBottomBorder, hasLeftBorder, hasNoBorders, hasRightBorder, hasTopBorder, } = useTableBordersDropdownMenuContentState();
|
|
15
|
+
return (React.createElement(DropdownMenuContent, { ref: ref, className: cn('min-w-[220px]'), side: "right", align: "start", sideOffset: 0, ...props },
|
|
16
|
+
React.createElement(DropdownMenuCheckboxItem, { checked: hasBottomBorder, onCheckedChange: getOnSelectTableBorder('bottom') },
|
|
17
|
+
React.createElement(BorderBottom, { className: "mr-2 h-4 w-4" }),
|
|
18
|
+
React.createElement("div", null, "Bottom Border")),
|
|
19
|
+
React.createElement(DropdownMenuCheckboxItem, { checked: hasTopBorder, onCheckedChange: getOnSelectTableBorder('top') },
|
|
20
|
+
React.createElement(BorderTop, { className: "mr-2 h-4 w-4" }),
|
|
21
|
+
React.createElement("div", null, "Top Border")),
|
|
22
|
+
React.createElement(DropdownMenuCheckboxItem, { checked: hasLeftBorder, onCheckedChange: getOnSelectTableBorder('left') },
|
|
23
|
+
React.createElement(BorderLeft, { className: "mr-2 h-4 w-4" }),
|
|
24
|
+
React.createElement("div", null, "Left Border")),
|
|
25
|
+
React.createElement(DropdownMenuCheckboxItem, { checked: hasRightBorder, onCheckedChange: getOnSelectTableBorder('right') },
|
|
26
|
+
React.createElement(BorderRight, { className: "mr-2 h-4 w-4" }),
|
|
27
|
+
React.createElement("div", null, "Right Border")),
|
|
28
|
+
React.createElement(Separator, null),
|
|
29
|
+
React.createElement(DropdownMenuCheckboxItem, { checked: hasNoBorders, onCheckedChange: getOnSelectTableBorder('none') },
|
|
30
|
+
React.createElement(BorderNone, { className: "mr-2 h-4 w-4" }),
|
|
31
|
+
React.createElement("div", null, "No Border")),
|
|
32
|
+
React.createElement(DropdownMenuCheckboxItem, { checked: hasOuterBorders, onCheckedChange: getOnSelectTableBorder('outer') },
|
|
33
|
+
React.createElement(BorderAll, { className: "mr-2 h-4 w-4" }),
|
|
34
|
+
React.createElement("div", null, "Outside Borders"))));
|
|
35
|
+
});
|
|
36
|
+
export const TableFloatingToolbar = withRef(({ children, ...props }, ref) => {
|
|
37
|
+
const element = useElement();
|
|
38
|
+
const { props: buttonProps } = useRemoveNodeButton({ element });
|
|
39
|
+
const selectionCollapsed = useEditorSelector((editor) => !isSelectionExpanded(editor), []);
|
|
40
|
+
const readOnly = useReadOnly();
|
|
41
|
+
const selected = useSelected();
|
|
42
|
+
const editor = useEditorRef();
|
|
43
|
+
const collapsed = !readOnly && selected && selectionCollapsed;
|
|
44
|
+
const open = !readOnly && selected;
|
|
45
|
+
const { canMerge, canUnmerge } = useTableMergeState();
|
|
46
|
+
const mergeContent = canMerge && (React.createElement(Button, { contentEditable: false, variant: "ghost", isMenu: true, onClick: () => mergeTableCells(editor) },
|
|
47
|
+
React.createElement(Combine, { className: "mr-2 h-4 w-4" }),
|
|
48
|
+
"Merge"));
|
|
49
|
+
const unmergeButton = canUnmerge && (React.createElement(Button, { contentEditable: false, variant: "ghost", isMenu: true, onClick: () => unmergeTableCells(editor) },
|
|
50
|
+
React.createElement(Ungroup, { className: "mr-2 h-4 w-4" }),
|
|
51
|
+
"Unmerge"));
|
|
52
|
+
const bordersContent = collapsed && (React.createElement(React.Fragment, null,
|
|
53
|
+
React.createElement(DropdownMenu, { modal: false },
|
|
54
|
+
React.createElement(DropdownMenuTrigger, { asChild: true },
|
|
55
|
+
React.createElement(Button, { variant: "ghost", isMenu: true },
|
|
56
|
+
React.createElement(BorderAll, { className: "mr-2 h-4 w-4" }),
|
|
57
|
+
"Borders")),
|
|
58
|
+
React.createElement(DropdownMenuPortal, null,
|
|
59
|
+
React.createElement(TableBordersDropdownMenuContent, null))),
|
|
60
|
+
React.createElement(Button, { contentEditable: false, variant: "ghost", isMenu: true, ...buttonProps },
|
|
61
|
+
React.createElement(Trash, { className: "mr-2 h-4 w-4" }),
|
|
62
|
+
"Delete")));
|
|
63
|
+
return (React.createElement(Popover, { open: open, modal: false },
|
|
64
|
+
React.createElement(PopoverAnchor, { asChild: true }, children),
|
|
65
|
+
(canMerge || canUnmerge || collapsed) && (React.createElement(PopoverContent, { ref: ref, className: cn(popoverVariants(), 'flex w-[220px] flex-col gap-1 p-1'), onOpenAutoFocus: (e) => e.preventDefault(), ...props },
|
|
66
|
+
unmergeButton,
|
|
67
|
+
mergeContent,
|
|
68
|
+
bordersContent))));
|
|
69
|
+
});
|
|
70
|
+
export const TableElement = withHOC(TableProvider, withRef(({ className, children, ...props }, ref) => {
|
|
71
|
+
const { colSizes, isSelectingCell, minColumnWidth, marginLeft } = useTableElementState();
|
|
72
|
+
const { props: tableProps, colGroupProps } = useTableElement();
|
|
73
|
+
return (React.createElement(TableFloatingToolbar, null,
|
|
74
|
+
React.createElement("div", { style: { paddingLeft: marginLeft } },
|
|
75
|
+
React.createElement(PlateElement, { ref: ref, asChild: true, className: cn('my-4 ml-px mr-0 table h-px w-full table-fixed border-collapse', isSelectingCell && '[&_*::selection]:bg-none', className), ...tableProps, ...props },
|
|
76
|
+
React.createElement("table", null,
|
|
77
|
+
React.createElement("colgroup", { ...colGroupProps }, colSizes.map((width, index) => (React.createElement("col", { key: index, style: {
|
|
78
|
+
minWidth: minColumnWidth,
|
|
79
|
+
width: width || undefined,
|
|
80
|
+
} })))),
|
|
81
|
+
React.createElement("tbody", { className: "min-w-full" }, children))))));
|
|
82
|
+
}));
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createPluginFactory, PlateElement, } from '@udecode/plate';
|
|
3
|
+
import { P } from '../../../atoms/typography/paragraph';
|
|
4
|
+
import { H } from '../../../atoms/typography/heading';
|
|
5
|
+
import * as Elements from '../../constants';
|
|
6
|
+
export const ParagraphElement = React.forwardRef(({ children, ...props }, ref) => {
|
|
7
|
+
const textAlign = props?.style?.textAlign;
|
|
8
|
+
return (React.createElement(PlateElement, { asChild: true, ref: ref, ...props },
|
|
9
|
+
React.createElement(React.Fragment, null,
|
|
10
|
+
React.createElement(P, { as: "div", "$textAlign": textAlign }, children))));
|
|
11
|
+
});
|
|
12
|
+
export const createParagraphPlugin = createPluginFactory({
|
|
13
|
+
key: Elements.ELEMENT_PARAGRAPH,
|
|
14
|
+
type: Elements.ELEMENT_PARAGRAPH,
|
|
15
|
+
isElement: true,
|
|
16
|
+
});
|
|
17
|
+
export const HOneElement = React.forwardRef(({ children, ...props }, ref) => {
|
|
18
|
+
const textAlign = props?.style?.textAlign;
|
|
19
|
+
return (React.createElement(PlateElement, { asChild: true, ref: ref, ...props },
|
|
20
|
+
React.createElement(React.Fragment, null,
|
|
21
|
+
React.createElement(H.One, { "$textAlign": textAlign }, children))));
|
|
22
|
+
});
|
|
23
|
+
export const createHOnePlugin = createPluginFactory({
|
|
24
|
+
key: Elements.ELEMENT_H1,
|
|
25
|
+
type: Elements.ELEMENT_H1,
|
|
26
|
+
isElement: true,
|
|
27
|
+
});
|
|
28
|
+
export const HTwoElement = React.forwardRef(({ children, ...props }, ref) => {
|
|
29
|
+
const textAlign = props?.style?.textAlign;
|
|
30
|
+
return (React.createElement(PlateElement, { asChild: true, ref: ref, ...props },
|
|
31
|
+
React.createElement(React.Fragment, null,
|
|
32
|
+
React.createElement(H.Two, { "$textAlign": textAlign }, children))));
|
|
33
|
+
});
|
|
34
|
+
export const createHTwoPlugin = createPluginFactory({
|
|
35
|
+
key: Elements.ELEMENT_H2,
|
|
36
|
+
type: Elements.ELEMENT_H2,
|
|
37
|
+
isElement: true,
|
|
38
|
+
});
|
|
39
|
+
export const HThreeElement = React.forwardRef(({ children, ...props }, ref) => {
|
|
40
|
+
const textAlign = props?.style?.textAlign;
|
|
41
|
+
return (React.createElement(PlateElement, { asChild: true, ref: ref, ...props },
|
|
42
|
+
React.createElement(React.Fragment, null,
|
|
43
|
+
React.createElement(H.Three, { "$textAlign": textAlign }, children))));
|
|
44
|
+
});
|
|
45
|
+
export const createHThreePlugin = createPluginFactory({
|
|
46
|
+
key: Elements.ELEMENT_H3,
|
|
47
|
+
type: Elements.ELEMENT_H3,
|
|
48
|
+
isElement: true,
|
|
49
|
+
});
|
|
50
|
+
export const HFourElement = React.forwardRef(({ children, ...props }, ref) => {
|
|
51
|
+
const textAlign = props?.style?.textAlign;
|
|
52
|
+
return (React.createElement(PlateElement, { asChild: true, ref: ref, ...props },
|
|
53
|
+
React.createElement(React.Fragment, null,
|
|
54
|
+
React.createElement(H.Four, { "$textAlign": textAlign }, children))));
|
|
55
|
+
});
|
|
56
|
+
export const createHFourPlugin = createPluginFactory({
|
|
57
|
+
key: Elements.ELEMENT_H4,
|
|
58
|
+
type: Elements.ELEMENT_H4,
|
|
59
|
+
isElement: true,
|
|
60
|
+
});
|
|
61
|
+
export const HFiveElement = React.forwardRef(({ children, ...props }, ref) => {
|
|
62
|
+
const textAlign = props?.style?.textAlign;
|
|
63
|
+
return (React.createElement(PlateElement, { asChild: true, ref: ref, ...props },
|
|
64
|
+
React.createElement(React.Fragment, null,
|
|
65
|
+
React.createElement(H.Five, { "$textAlign": textAlign }, children))));
|
|
66
|
+
});
|
|
67
|
+
export const createHFivePlugin = createPluginFactory({
|
|
68
|
+
key: Elements.ELEMENT_H5,
|
|
69
|
+
type: Elements.ELEMENT_H5,
|
|
70
|
+
isElement: true,
|
|
71
|
+
});
|
|
72
|
+
export const HSixElement = React.forwardRef(({ children, ...props }, ref) => {
|
|
73
|
+
const textAlign = props?.style?.textAlign;
|
|
74
|
+
return (React.createElement(PlateElement, { asChild: true, ref: ref, ...props },
|
|
75
|
+
React.createElement(React.Fragment, null,
|
|
76
|
+
React.createElement(H.Six, { "$textAlign": textAlign }, children))));
|
|
77
|
+
});
|
|
78
|
+
export const createHSixPlugin = createPluginFactory({
|
|
79
|
+
key: Elements.ELEMENT_H6,
|
|
80
|
+
type: Elements.ELEMENT_H6,
|
|
81
|
+
isElement: true,
|
|
82
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createPluginFactory, isEditorReadOnly, PlateElement, } from '@udecode/plate';
|
|
3
|
+
import { ELEMENT_H2, ELEMENT_VIDEO } from '../../constants';
|
|
4
|
+
import { EditorContext } from '../../context';
|
|
5
|
+
export const VideoTitleElement = React.forwardRef(function VideoTitle({ editor, element, ...props }, ref) {
|
|
6
|
+
const editable = !isEditorReadOnly(editor);
|
|
7
|
+
const { id } = element;
|
|
8
|
+
const { handleVideoClick, videoTitleLoader: VideoTitle } = React.useContext(EditorContext);
|
|
9
|
+
const handleClick = () => {
|
|
10
|
+
if (handleVideoClick && !editable) {
|
|
11
|
+
handleVideoClick(id);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
return (React.createElement(PlateElement, { asChild: true, editor: editor, element: element, ref: ref, ...props },
|
|
15
|
+
React.createElement("div", { contentEditable: false, onClick: handleClick, style: { cursor: editable ? 'initial' : 'pointer' } },
|
|
16
|
+
React.createElement(VideoTitle, { courseMediaId: id }))));
|
|
17
|
+
});
|
|
18
|
+
export const createVideoTitlePlugin = createPluginFactory({
|
|
19
|
+
key: ELEMENT_VIDEO,
|
|
20
|
+
type: ELEMENT_VIDEO,
|
|
21
|
+
isElement: true,
|
|
22
|
+
isVoid: true,
|
|
23
|
+
component: VideoTitleElement,
|
|
24
|
+
then: () => ({
|
|
25
|
+
inject: {
|
|
26
|
+
props: {
|
|
27
|
+
classNames: undefined,
|
|
28
|
+
validTypes: [ELEMENT_H2],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { leafs } from './leafs';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createAlignPlugin, createCodePlugin, createIndentPlugin, createLineHeightPlugin, } from '@udecode/plate';
|
|
2
|
+
import { createLinkPlugin } from '@udecode/plate-link';
|
|
3
|
+
import { LinkFloatingMenu } from './link';
|
|
4
|
+
import { ELEMENT_PARAGRAPH, ELEMENT_H1, ELEMENT_H2, ELEMENT_H3, ELEMENT_H4, ELEMENT_H5, ELEMENT_H6, } from '../../constants';
|
|
5
|
+
export const leafs = [
|
|
6
|
+
createAlignPlugin({
|
|
7
|
+
inject: {
|
|
8
|
+
props: {
|
|
9
|
+
validTypes: [
|
|
10
|
+
ELEMENT_PARAGRAPH,
|
|
11
|
+
ELEMENT_H1,
|
|
12
|
+
ELEMENT_H2,
|
|
13
|
+
ELEMENT_H3,
|
|
14
|
+
ELEMENT_H4,
|
|
15
|
+
ELEMENT_H5,
|
|
16
|
+
ELEMENT_H6,
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
}),
|
|
21
|
+
createIndentPlugin({
|
|
22
|
+
inject: {
|
|
23
|
+
props: {
|
|
24
|
+
validTypes: [ELEMENT_PARAGRAPH, ELEMENT_H1],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
}),
|
|
28
|
+
createLineHeightPlugin(),
|
|
29
|
+
createCodePlugin(),
|
|
30
|
+
createLinkPlugin({
|
|
31
|
+
renderBeforeEditable: LinkFloatingMenu,
|
|
32
|
+
}),
|
|
33
|
+
];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { FloatingLinkUrlInput, LinkOpenButton, PlateElement, useFloatingLinkEdit, useFloatingLinkEditState, useFloatingLinkInsert, useFloatingLinkInsertState, useFloatingLinkSelectors, useLink, } from '@udecode/plate';
|
|
4
|
+
import { Box } from '../../..';
|
|
5
|
+
import { AASansSerif, Link, Upload } from '../../../../icons';
|
|
6
|
+
export const LinkElement = React.forwardRef(({ children, ...props }, ref) => {
|
|
7
|
+
const { props: linkProps } = useLink({ element: props.element });
|
|
8
|
+
return (React.createElement(PlateElement, { asChild: true, ref: ref, ...linkProps, ...props },
|
|
9
|
+
React.createElement("a", null, children)));
|
|
10
|
+
});
|
|
11
|
+
export const LinkFloatingMenu = ({ readOnly }) => {
|
|
12
|
+
const isEditing = useFloatingLinkSelectors().isEditing();
|
|
13
|
+
const state = useFloatingLinkInsertState();
|
|
14
|
+
const { props: insertProps, ref: insertRef, textInputProps, } = useFloatingLinkInsert(state);
|
|
15
|
+
const editState = useFloatingLinkEditState();
|
|
16
|
+
const { props: editProps, ref: editRef, editButtonProps, } = useFloatingLinkEdit(editState);
|
|
17
|
+
if (readOnly)
|
|
18
|
+
return null;
|
|
19
|
+
const input = (React.createElement(Box, { "$dir": "column", sx: `
|
|
20
|
+
background-color: var(--color-white);
|
|
21
|
+
gap: 16px;
|
|
22
|
+
padding: 16px;
|
|
23
|
+
border-radius: 16px;
|
|
24
|
+
box-shadow: var(--elevation-2);
|
|
25
|
+
` },
|
|
26
|
+
React.createElement(Box, { "$align": "center", "$justify": "center", "$gap": 8 },
|
|
27
|
+
React.createElement(Box, { "$align": "center", "$justify": "center" },
|
|
28
|
+
React.createElement(Link, null)),
|
|
29
|
+
React.createElement(FloatingLinkUrlInput, { style: {
|
|
30
|
+
border: 'none',
|
|
31
|
+
outline: 'none',
|
|
32
|
+
padding: '8px 12px',
|
|
33
|
+
}, placeholder: "Paste link" })),
|
|
34
|
+
React.createElement(Box, { "$align": "center", "$justify": "center", "$gap": 8 },
|
|
35
|
+
React.createElement(Box, { "$align": "center", "$justify": "center" },
|
|
36
|
+
React.createElement(AASansSerif, null)),
|
|
37
|
+
React.createElement(Input, { placeholder: "Text to display", ...textInputProps }))));
|
|
38
|
+
const editContent = isEditing ? (input) : (React.createElement(Box, { "$align": "center", "$justify": "center", sx: `
|
|
39
|
+
box-sizing: box-content;
|
|
40
|
+
background-color: var(--color-white);
|
|
41
|
+
gap: 8px;
|
|
42
|
+
padding: 16px;
|
|
43
|
+
border-radius: 16px;
|
|
44
|
+
box-shadow: var(--elevation-2);
|
|
45
|
+
|
|
46
|
+
a,
|
|
47
|
+
button {
|
|
48
|
+
padding: 8px 12px;
|
|
49
|
+
background-color: transparent;
|
|
50
|
+
outline: none;
|
|
51
|
+
border: none;
|
|
52
|
+
border-radius: 8px;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
width: max-content;
|
|
55
|
+
font-size: 16px;
|
|
56
|
+
line-height: 16px;
|
|
57
|
+
|
|
58
|
+
&:hover {
|
|
59
|
+
background-color: var(--color-grey-9);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`, "$gap": 8 },
|
|
63
|
+
React.createElement("button", { type: "button", ...editButtonProps }, "Edit link"),
|
|
64
|
+
React.createElement(LinkOpenButton, null,
|
|
65
|
+
React.createElement(Upload, null))));
|
|
66
|
+
return (React.createElement(React.Fragment, null,
|
|
67
|
+
React.createElement("div", { ref: insertRef, ...insertProps }, input),
|
|
68
|
+
React.createElement("div", { ref: editRef, ...editProps }, editContent)));
|
|
69
|
+
};
|
|
70
|
+
const Input = styled.input `
|
|
71
|
+
border: none;
|
|
72
|
+
outline: none;
|
|
73
|
+
padding: 8px 12px;
|
|
74
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { marks } from './marks';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createBoldPlugin, createFontBackgroundColorPlugin, createFontSizePlugin, createFontFamilyPlugin, createItalicPlugin, createStrikethroughPlugin, createSubscriptPlugin, createSuperscriptPlugin, createUnderlinePlugin, } from '@udecode/plate';
|
|
2
|
+
export const marks = [
|
|
3
|
+
createBoldPlugin(),
|
|
4
|
+
createFontBackgroundColorPlugin(),
|
|
5
|
+
createFontSizePlugin(),
|
|
6
|
+
createFontFamilyPlugin(),
|
|
7
|
+
createItalicPlugin(),
|
|
8
|
+
createStrikethroughPlugin(),
|
|
9
|
+
createSubscriptPlugin(),
|
|
10
|
+
createSuperscriptPlugin(),
|
|
11
|
+
createUnderlinePlugin(),
|
|
12
|
+
];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { withProps } from '@udecode/cn';
|
|
2
|
+
import { PlateLeaf } from '@udecode/plate-common';
|
|
3
|
+
import { BlockquoteElement } from './blocks/blockquote';
|
|
4
|
+
import { Button } from './blocks/buttons';
|
|
5
|
+
import { ImageElement } from './blocks/image';
|
|
6
|
+
import { ListElement } from './blocks/list';
|
|
7
|
+
import { TableElement } from './blocks/table';
|
|
8
|
+
import { TableCellElement, TableCellHeaderElement } from './blocks/table-cell';
|
|
9
|
+
import { TableRowElement } from './blocks/table-row';
|
|
10
|
+
import { ParagraphElement, HOneElement, HTwoElement, HThreeElement, HFourElement, HFiveElement, HSixElement, } from './blocks/text';
|
|
11
|
+
import { LinkElement } from './leafs/link';
|
|
12
|
+
import * as Elements from '../constants';
|
|
13
|
+
export const plateUI = {
|
|
14
|
+
[Elements.ELEMENT_PARAGRAPH]: ParagraphElement,
|
|
15
|
+
[Elements.ELEMENT_H1]: HOneElement,
|
|
16
|
+
[Elements.ELEMENT_H2]: HTwoElement,
|
|
17
|
+
[Elements.ELEMENT_H3]: HThreeElement,
|
|
18
|
+
[Elements.ELEMENT_H4]: HFourElement,
|
|
19
|
+
[Elements.ELEMENT_H5]: HFiveElement,
|
|
20
|
+
[Elements.ELEMENT_H6]: HSixElement,
|
|
21
|
+
[Elements.ELEMENT_BLOCKQUOTE]: BlockquoteElement,
|
|
22
|
+
[Elements.ELEMENT_LINK]: LinkElement,
|
|
23
|
+
[Elements.ELEMENT_OL]: withProps(ListElement, {
|
|
24
|
+
variant: Elements.ELEMENT_OL,
|
|
25
|
+
}),
|
|
26
|
+
[Elements.ELEMENT_UL]: withProps(ListElement, {
|
|
27
|
+
variant: Elements.ELEMENT_UL,
|
|
28
|
+
}),
|
|
29
|
+
[Elements.ELEMENT_IMAGE]: ImageElement,
|
|
30
|
+
[Elements.ELEMENT_BUTTON]: Button,
|
|
31
|
+
[Elements.ELEMENT_TABLE]: TableElement,
|
|
32
|
+
[Elements.ELEMENT_TD]: TableCellElement,
|
|
33
|
+
[Elements.ELEMENT_TH]: TableCellHeaderElement,
|
|
34
|
+
[Elements.ELEMENT_TR]: TableRowElement,
|
|
35
|
+
[Elements.MARK_SUBSCRIPT]: withProps(PlateLeaf, { as: 'sub' }),
|
|
36
|
+
[Elements.MARK_SUPERSCRIPT]: withProps(PlateLeaf, { as: 'sup' }),
|
|
37
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { KEYS_HEADING } from '@udecode/plate';
|
|
2
|
+
import { ELEMENT_BLOCKQUOTE, ELEMENT_BUTTON, ELEMENT_MEDIA, ELEMENT_MEDIA_EMBED, ELEMENT_OL, ELEMENT_UL, } from '../../constants';
|
|
3
|
+
export const exitBreakPlugin = {
|
|
4
|
+
options: {
|
|
5
|
+
rules: [
|
|
6
|
+
{
|
|
7
|
+
hotkey: 'mod+enter',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
hotkey: 'mod+shift+enter',
|
|
11
|
+
before: true,
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
hotkey: 'enter',
|
|
15
|
+
query: {
|
|
16
|
+
start: true,
|
|
17
|
+
end: true,
|
|
18
|
+
allow: [
|
|
19
|
+
ELEMENT_BLOCKQUOTE,
|
|
20
|
+
ELEMENT_BUTTON,
|
|
21
|
+
ELEMENT_MEDIA,
|
|
22
|
+
ELEMENT_MEDIA_EMBED,
|
|
23
|
+
ELEMENT_OL,
|
|
24
|
+
ELEMENT_UL,
|
|
25
|
+
...KEYS_HEADING,
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { utils } from './utils';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isBlockAboveEmpty, isSelectionAtBlockStart } from '@udecode/plate';
|
|
2
|
+
import { ELEMENT_BLOCKQUOTE, ELEMENT_PARAGRAPH, ELEMENT_TODO_LI, } from '../../constants';
|
|
3
|
+
const resetBlockTypesCommonRule = {
|
|
4
|
+
types: [ELEMENT_BLOCKQUOTE, ELEMENT_TODO_LI],
|
|
5
|
+
defaultType: ELEMENT_PARAGRAPH,
|
|
6
|
+
};
|
|
7
|
+
export const resetBlockTypePlugin = {
|
|
8
|
+
options: {
|
|
9
|
+
rules: [
|
|
10
|
+
{
|
|
11
|
+
...resetBlockTypesCommonRule,
|
|
12
|
+
hotkey: 'Enter',
|
|
13
|
+
predicate: isBlockAboveEmpty,
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
...resetBlockTypesCommonRule,
|
|
17
|
+
hotkey: 'Backspace',
|
|
18
|
+
predicate: isSelectionAtBlockStart,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ELEMENT_BLOCKQUOTE, ELEMENT_CODE_BLOCK, ELEMENT_TD, } from '@udecode/plate';
|
|
2
|
+
export const softBreakPlugin = {
|
|
3
|
+
options: {
|
|
4
|
+
rules: [
|
|
5
|
+
{ hotkey: 'shift+enter' },
|
|
6
|
+
{
|
|
7
|
+
hotkey: 'enter',
|
|
8
|
+
query: {
|
|
9
|
+
allow: [ELEMENT_CODE_BLOCK, ELEMENT_BLOCKQUOTE, ELEMENT_TD],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
],
|
|
13
|
+
},
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createResetNodePlugin, createExitBreakPlugin, createHistoryPlugin, createSelectOnBackspacePlugin, createSoftBreakPlugin, } from '@udecode/plate';
|
|
2
|
+
import { exitBreakPlugin } from './exitBreak';
|
|
3
|
+
import { resetBlockTypePlugin } from './resetBlockType';
|
|
4
|
+
import { selectOnBackspace } from './selectOnBackspace';
|
|
5
|
+
import { softBreakPlugin } from './softBreak';
|
|
6
|
+
export const utils = [
|
|
7
|
+
createExitBreakPlugin(exitBreakPlugin),
|
|
8
|
+
createHistoryPlugin(),
|
|
9
|
+
createResetNodePlugin(resetBlockTypePlugin),
|
|
10
|
+
createSelectOnBackspacePlugin(selectOnBackspace),
|
|
11
|
+
createSoftBreakPlugin(softBreakPlugin),
|
|
12
|
+
];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SimpleEditor } from './simple_editor';
|