@soul-refiner/design-system 1.7.22 → 2.0.0-alpha.1
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/components/editor/plugins/blocks/plate-button.d.ts +2 -2
- package/dist/components/editor/plugins/blocks/separator.d.ts +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +48153 -5
- package/package.json +15 -14
- package/dist/common/colors.js +0 -135
- package/dist/common/date.js +0 -28
- package/dist/common/index.js +0 -3
- package/dist/common/styles.js +0 -63
- package/dist/components/actions/button/button.js +0 -318
- package/dist/components/actions/button/index.js +0 -1
- package/dist/components/actions/dropdown/dropdown.js +0 -227
- package/dist/components/actions/dropdown/index.js +0 -1
- package/dist/components/actions/index.js +0 -6
- package/dist/components/actions/rate/index.js +0 -1
- package/dist/components/actions/rate/rate.js +0 -47
- package/dist/components/actions/switch/index.js +0 -1
- package/dist/components/actions/switch/switch.js +0 -72
- package/dist/components/actions/toggle/index.js +0 -1
- package/dist/components/actions/toggle/toggle.js +0 -57
- package/dist/components/actions/upload/index.js +0 -1
- package/dist/components/actions/upload/upload.js +0 -156
- package/dist/components/atoms/box/box.js +0 -16
- package/dist/components/atoms/box/index.js +0 -1
- package/dist/components/atoms/colors/colors.js +0 -35
- package/dist/components/atoms/colors/index.js +0 -1
- package/dist/components/atoms/hide/hide.js +0 -9
- package/dist/components/atoms/hide/index.js +0 -1
- package/dist/components/atoms/index.js +0 -5
- package/dist/components/atoms/seconds_to_duration/index.js +0 -1
- package/dist/components/atoms/seconds_to_duration/seconds_to_duration.js +0 -27
- package/dist/components/atoms/time_ago/index.js +0 -1
- package/dist/components/atoms/time_ago/time_ago.js +0 -31
- package/dist/components/atoms/typography/display.js +0 -10
- package/dist/components/atoms/typography/heading.js +0 -35
- package/dist/components/atoms/typography/index.js +0 -4
- package/dist/components/atoms/typography/paragraph.js +0 -18
- package/dist/components/atoms/typography/typography.js +0 -12
- package/dist/components/card/action/action.js +0 -72
- package/dist/components/card/action/index.js +0 -1
- package/dist/components/card/audio/audio.js +0 -130
- package/dist/components/card/audio/index.js +0 -1
- package/dist/components/card/card.js +0 -35
- package/dist/components/card/feature/feature.js +0 -188
- package/dist/components/card/feature/index.js +0 -1
- package/dist/components/card/index.js +0 -1
- package/dist/components/card/meeting/index.js +0 -1
- package/dist/components/card/meeting/meeting.js +0 -130
- package/dist/components/card/person/index.js +0 -1
- package/dist/components/card/person/person.js +0 -69
- package/dist/components/card/price/index.js +0 -1
- package/dist/components/card/price/price.js +0 -75
- package/dist/components/card/regular/index.js +0 -1
- package/dist/components/card/regular/regular.js +0 -33
- package/dist/components/card/video/index.js +0 -1
- package/dist/components/card/video/video.js +0 -127
- package/dist/components/card/written/index.js +0 -1
- package/dist/components/card/written/written.js +0 -130
- package/dist/components/custom/courses_selection/courses_selection.js +0 -127
- package/dist/components/custom/courses_selection/index.js +0 -1
- package/dist/components/custom/index.js +0 -2
- package/dist/components/custom/users_selection/index.js +0 -1
- package/dist/components/custom/users_selection/users_selection.js +0 -120
- package/dist/components/editor/constants.js +0 -49
- package/dist/components/editor/context.js +0 -8
- package/dist/components/editor/editor.js +0 -102
- package/dist/components/editor/icons/border-all.js +0 -3
- package/dist/components/editor/icons/border-bottom.js +0 -3
- package/dist/components/editor/icons/border-left.js +0 -3
- package/dist/components/editor/icons/border-none.js +0 -3
- package/dist/components/editor/icons/border-right.js +0 -3
- package/dist/components/editor/icons/border-top.js +0 -3
- package/dist/components/editor/icons/index.js +0 -6
- package/dist/components/editor/index.js +0 -2
- package/dist/components/editor/navbar/alignment_dropdown.js +0 -97
- package/dist/components/editor/navbar/button_modal.js +0 -55
- package/dist/components/editor/navbar/index.js +0 -1
- package/dist/components/editor/navbar/navbar.js +0 -201
- package/dist/components/editor/navbar/style_dropdown.js +0 -65
- package/dist/components/editor/plugins/blocks/blockquote.js +0 -8
- package/dist/components/editor/plugins/blocks/blocks.js +0 -50
- package/dist/components/editor/plugins/blocks/buttons.js +0 -81
- package/dist/components/editor/plugins/blocks/dropdown-menu.js +0 -62
- package/dist/components/editor/plugins/blocks/image.js +0 -51
- package/dist/components/editor/plugins/blocks/index.js +0 -1
- package/dist/components/editor/plugins/blocks/list.js +0 -17
- package/dist/components/editor/plugins/blocks/media-popover.js +0 -32
- package/dist/components/editor/plugins/blocks/plate-button.js +0 -37
- package/dist/components/editor/plugins/blocks/popover.js +0 -11
- package/dist/components/editor/plugins/blocks/qa.js +0 -45
- package/dist/components/editor/plugins/blocks/resizable.js +0 -37
- package/dist/components/editor/plugins/blocks/separator.js +0 -19
- package/dist/components/editor/plugins/blocks/table-cell.js +0 -38
- package/dist/components/editor/plugins/blocks/table-row.js +0 -7
- package/dist/components/editor/plugins/blocks/table.js +0 -82
- package/dist/components/editor/plugins/blocks/text.js +0 -82
- package/dist/components/editor/plugins/blocks/video.js +0 -32
- package/dist/components/editor/plugins/index.js +0 -4
- package/dist/components/editor/plugins/leafs/index.js +0 -1
- package/dist/components/editor/plugins/leafs/leafs.js +0 -33
- package/dist/components/editor/plugins/leafs/link.js +0 -74
- package/dist/components/editor/plugins/marks/index.js +0 -1
- package/dist/components/editor/plugins/marks/marks.js +0 -12
- package/dist/components/editor/plugins/plate.js +0 -37
- package/dist/components/editor/plugins/utils/exitBreak.js +0 -31
- package/dist/components/editor/plugins/utils/index.js +0 -1
- package/dist/components/editor/plugins/utils/resetBlockType.js +0 -22
- package/dist/components/editor/plugins/utils/selectOnBackspace.js +0 -6
- package/dist/components/editor/plugins/utils/softBreak.js +0 -14
- package/dist/components/editor/plugins/utils/utils.js +0 -12
- package/dist/components/editor/simple_editor/index.js +0 -1
- package/dist/components/editor/simple_editor/navbar.js +0 -140
- package/dist/components/editor/simple_editor/plugins.js +0 -89
- package/dist/components/editor/simple_editor/simple_editor.js +0 -89
- package/dist/components/feedback/animated_toast/animated_toast.js +0 -55
- package/dist/components/feedback/animated_toast/index.js +0 -1
- package/dist/components/feedback/badge/badge.js +0 -66
- package/dist/components/feedback/badge/index.js +0 -1
- package/dist/components/feedback/banner/banner.js +0 -80
- package/dist/components/feedback/banner/index.js +0 -1
- package/dist/components/feedback/chip/chip.js +0 -94
- package/dist/components/feedback/chip/index.js +0 -1
- package/dist/components/feedback/index.js +0 -8
- package/dist/components/feedback/loader/index.js +0 -1
- package/dist/components/feedback/loader/loader.js +0 -34
- package/dist/components/feedback/notification/index.js +0 -1
- package/dist/components/feedback/notification/notification.js +0 -72
- package/dist/components/feedback/progress/index.js +0 -1
- package/dist/components/feedback/progress/progress.js +0 -87
- package/dist/components/feedback/toast/index.js +0 -1
- package/dist/components/feedback/toast/toast.js +0 -112
- package/dist/components/feedback/tooltip/index.js +0 -1
- package/dist/components/feedback/tooltip/tooltip.js +0 -26
- package/dist/components/iconography/avatar/avatar.js +0 -171
- package/dist/components/iconography/avatar/icons/approved.js +0 -5
- package/dist/components/iconography/avatar/icons/busy.js +0 -5
- package/dist/components/iconography/avatar/icons/declined.js +0 -5
- package/dist/components/iconography/avatar/icons/default.js +0 -4
- package/dist/components/iconography/avatar/icons/focus.js +0 -5
- package/dist/components/iconography/avatar/icons/index.js +0 -9
- package/dist/components/iconography/avatar/icons/locked.js +0 -5
- package/dist/components/iconography/avatar/icons/offline.js +0 -5
- package/dist/components/iconography/avatar/icons/online.js +0 -4
- package/dist/components/iconography/avatar/icons/subscribed.js +0 -9
- package/dist/components/iconography/avatar/index.js +0 -1
- package/dist/components/iconography/icon/icon.js +0 -10
- package/dist/components/iconography/icon/index.js +0 -1
- package/dist/components/iconography/index.js +0 -2
- package/dist/components/index.js +0 -12
- package/dist/components/input/calendar/calendar.js +0 -255
- package/dist/components/input/calendar/index.js +0 -1
- package/dist/components/input/checkbox/checkbox.js +0 -23
- package/dist/components/input/checkbox/index.js +0 -1
- package/dist/components/input/date/date.js +0 -517
- package/dist/components/input/date/index.js +0 -1
- package/dist/components/input/filter/filter.js +0 -319
- package/dist/components/input/filter/filter_option.js +0 -70
- package/dist/components/input/filter/index.js +0 -1
- package/dist/components/input/index.js +0 -10
- package/dist/components/input/radio/index.js +0 -1
- package/dist/components/input/radio/radio.js +0 -83
- package/dist/components/input/search/index.js +0 -1
- package/dist/components/input/search/search.js +0 -138
- package/dist/components/input/select/index.js +0 -1
- package/dist/components/input/select/select.js +0 -47
- package/dist/components/input/text_area/index.js +0 -1
- package/dist/components/input/text_area/text_area.js +0 -110
- package/dist/components/input/text_input/index.js +0 -1
- package/dist/components/input/text_input/text_input.js +0 -147
- package/dist/components/input/time/index.js +0 -1
- package/dist/components/input/time/time.js +0 -71
- package/dist/components/media/common.js +0 -1
- package/dist/components/media/index.js +0 -2
- package/dist/components/media/video/index.js +0 -1
- package/dist/components/media/video/video.js +0 -31
- package/dist/components/media/video-player/index.js +0 -1
- package/dist/components/media/video-player/playlist-item.js +0 -37
- package/dist/components/media/video-player/video.js +0 -197
- package/dist/components/navigation/breadcrumb/breadcrumb.js +0 -109
- package/dist/components/navigation/breadcrumb/index.js +0 -1
- package/dist/components/navigation/index.js +0 -3
- package/dist/components/navigation/inner/index.js +0 -1
- package/dist/components/navigation/inner/inner.js +0 -187
- package/dist/components/navigation/tabs/index.js +0 -1
- package/dist/components/navigation/tabs/tabs.js +0 -150
- package/dist/components/surfaces/accordion/accordion.js +0 -47
- package/dist/components/surfaces/accordion/index.js +0 -1
- package/dist/components/surfaces/calendar_date/calendar_date.js +0 -45
- package/dist/components/surfaces/calendar_date/index.js +0 -1
- package/dist/components/surfaces/carousel/card/card.js +0 -96
- package/dist/components/surfaces/carousel/card/index.js +0 -1
- package/dist/components/surfaces/carousel/index.js +0 -1
- package/dist/components/surfaces/comment/comment.js +0 -188
- package/dist/components/surfaces/comment/helpers.js +0 -26
- package/dist/components/surfaces/comment/index.js +0 -1
- package/dist/components/surfaces/drawer/drawer.js +0 -130
- package/dist/components/surfaces/drawer/index.js +0 -1
- package/dist/components/surfaces/index.js +0 -9
- package/dist/components/surfaces/message/index.js +0 -1
- package/dist/components/surfaces/message/message.js +0 -44
- package/dist/components/surfaces/modal/index.js +0 -1
- package/dist/components/surfaces/modal/modal.js +0 -127
- package/dist/components/surfaces/portal/index.js +0 -1
- package/dist/components/surfaces/portal/portal.js +0 -26
- package/dist/components/surfaces/post/index.js +0 -1
- package/dist/components/surfaces/post/post.js +0 -230
- package/dist/components/table/index.js +0 -1
- package/dist/components/table/table/index.js +0 -1
- package/dist/components/table/table/table.js +0 -184
- package/dist/emoji/emojis.json +0 -17577
- package/dist/icons/arrow/arrow_all.js +0 -6
- package/dist/icons/arrow/arrow_all_diagonal.js +0 -6
- package/dist/icons/arrow/arrow_both_downwards.js +0 -6
- package/dist/icons/arrow/arrow_both_upwards.js +0 -6
- package/dist/icons/arrow/arrow_circle_left.js +0 -6
- package/dist/icons/arrow/arrow_circle_left_double.js +0 -6
- package/dist/icons/arrow/arrow_circle_left_double_alert.js +0 -8
- package/dist/icons/arrow/arrow_circle_right.js +0 -6
- package/dist/icons/arrow/arrow_circle_right_double.js +0 -6
- package/dist/icons/arrow/arrow_circle_right_double_alert.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_down_left.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_down_left_circle.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_down_right.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_down_right_circle.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_up_left.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_up_left_circle.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_up_right.js +0 -6
- package/dist/icons/arrow/arrow_diagonal_up_right_circle.js +0 -6
- package/dist/icons/arrow/arrow_down.js +0 -6
- package/dist/icons/arrow/arrow_down_bold.js +0 -6
- package/dist/icons/arrow/arrow_down_circle.js +0 -6
- package/dist/icons/arrow/arrow_left.js +0 -6
- package/dist/icons/arrow/arrow_left_bold.js +0 -6
- package/dist/icons/arrow/arrow_left_circle.js +0 -6
- package/dist/icons/arrow/arrow_left_curved.js +0 -6
- package/dist/icons/arrow/arrow_left_curved_circle.js +0 -6
- package/dist/icons/arrow/arrow_right.js +0 -6
- package/dist/icons/arrow/arrow_right_bold.js +0 -6
- package/dist/icons/arrow/arrow_right_circle.js +0 -6
- package/dist/icons/arrow/arrow_right_curved.js +0 -6
- package/dist/icons/arrow/arrow_right_curved_circle.js +0 -6
- package/dist/icons/arrow/arrow_up.js +0 -6
- package/dist/icons/arrow/arrow_up_bold.js +0 -6
- package/dist/icons/arrow/arrow_up_circle.js +0 -6
- package/dist/icons/arrow/chevron_down.js +0 -6
- package/dist/icons/arrow/chevron_down_circle.js +0 -6
- package/dist/icons/arrow/chevron_down_double.js +0 -6
- package/dist/icons/arrow/chevron_down_double_circle.js +0 -6
- package/dist/icons/arrow/chevron_left.js +0 -6
- package/dist/icons/arrow/chevron_left_circle.js +0 -6
- package/dist/icons/arrow/chevron_left_double.js +0 -6
- package/dist/icons/arrow/chevron_left_double_circle.js +0 -6
- package/dist/icons/arrow/chevron_right.js +0 -6
- package/dist/icons/arrow/chevron_right_circle.js +0 -6
- package/dist/icons/arrow/chevron_right_double.js +0 -6
- package/dist/icons/arrow/chevron_right_double_circle.js +0 -6
- package/dist/icons/arrow/chevron_scroll.js +0 -6
- package/dist/icons/arrow/chevron_up.js +0 -6
- package/dist/icons/arrow/chevron_up_circle.js +0 -6
- package/dist/icons/arrow/chevron_up_double.js +0 -6
- package/dist/icons/arrow/chevron_up_double_circle.js +0 -6
- package/dist/icons/arrow/forward_all.js +0 -6
- package/dist/icons/arrow/forward_all_bold.js +0 -6
- package/dist/icons/arrow/forward_bold.js +0 -6
- package/dist/icons/arrow/index.js +0 -62
- package/dist/icons/arrow/redo.js +0 -6
- package/dist/icons/arrow/redo_bold.js +0 -6
- package/dist/icons/arrow/reply.js +0 -6
- package/dist/icons/arrow/reply_all.js +0 -6
- package/dist/icons/arrow/reply_all_bold.js +0 -6
- package/dist/icons/arrow/reply_bold.js +0 -6
- package/dist/icons/arrow/undo.js +0 -6
- package/dist/icons/arrow/undo_bold.js +0 -6
- package/dist/icons/audio_video/drag_indicator.js +0 -6
- package/dist/icons/audio_video/eject.js +0 -6
- package/dist/icons/audio_video/equalizer.js +0 -6
- package/dist/icons/audio_video/fast_forward.js +0 -6
- package/dist/icons/audio_video/fast_forward_30.js +0 -6
- package/dist/icons/audio_video/fullscreen.js +0 -6
- package/dist/icons/audio_video/headphones.js +0 -6
- package/dist/icons/audio_video/index.js +0 -38
- package/dist/icons/audio_video/library_add.js +0 -6
- package/dist/icons/audio_video/library_delay.js +0 -6
- package/dist/icons/audio_video/library_music.js +0 -6
- package/dist/icons/audio_video/library_queue.js +0 -6
- package/dist/icons/audio_video/microphone.js +0 -6
- package/dist/icons/audio_video/musical_note.js +0 -6
- package/dist/icons/audio_video/next.js +0 -6
- package/dist/icons/audio_video/pause.js +0 -6
- package/dist/icons/audio_video/pause_circle.js +0 -6
- package/dist/icons/audio_video/play.js +0 -6
- package/dist/icons/audio_video/play_circle.js +0 -6
- package/dist/icons/audio_video/play_display.js +0 -6
- package/dist/icons/audio_video/play_pause.js +0 -6
- package/dist/icons/audio_video/play_solid.js +0 -6
- package/dist/icons/audio_video/player_list.js +0 -6
- package/dist/icons/audio_video/player_list_add.js +0 -6
- package/dist/icons/audio_video/player_list_play.js +0 -6
- package/dist/icons/audio_video/previous.js +0 -6
- package/dist/icons/audio_video/radio.js +0 -6
- package/dist/icons/audio_video/record.js +0 -6
- package/dist/icons/audio_video/repeat.js +0 -6
- package/dist/icons/audio_video/rewind.js +0 -6
- package/dist/icons/audio_video/rewind_30.js +0 -6
- package/dist/icons/audio_video/shuffle.js +0 -6
- package/dist/icons/audio_video/sound_wave.js +0 -6
- package/dist/icons/audio_video/stop.js +0 -6
- package/dist/icons/audio_video/stop_circle.js +0 -6
- package/dist/icons/audio_video/subscriptions.js +0 -6
- package/dist/icons/audio_video/tuner.js +0 -6
- package/dist/icons/audio_video/volume.js +0 -6
- package/dist/icons/audio_video/volume_high.js +0 -6
- package/dist/icons/audio_video/volume_low.js +0 -6
- package/dist/icons/audio_video/volume_slash.js +0 -6
- package/dist/icons/basic/aa_sansserif.js +0 -7
- package/dist/icons/basic/aa_serif.js +0 -7
- package/dist/icons/basic/anchor.js +0 -8
- package/dist/icons/basic/bible.js +0 -6
- package/dist/icons/basic/bold.js +0 -6
- package/dist/icons/basic/book.js +0 -6
- package/dist/icons/basic/book_open.js +0 -6
- package/dist/icons/basic/bookmark.js +0 -6
- package/dist/icons/basic/bookmark_add.js +0 -6
- package/dist/icons/basic/bookmark_slash.js +0 -6
- package/dist/icons/basic/bookmarks.js +0 -6
- package/dist/icons/basic/books.js +0 -9
- package/dist/icons/basic/box.js +0 -6
- package/dist/icons/basic/briefcase.js +0 -6
- package/dist/icons/basic/browse_activity.js +0 -6
- package/dist/icons/basic/browser.js +0 -6
- package/dist/icons/basic/browser_slash.js +0 -6
- package/dist/icons/basic/calculator.js +0 -6
- package/dist/icons/basic/camera.js +0 -6
- package/dist/icons/basic/camera_add.js +0 -6
- package/dist/icons/basic/camera_slash.js +0 -6
- package/dist/icons/basic/checkmark.js +0 -6
- package/dist/icons/basic/checkmark_circle.js +0 -8
- package/dist/icons/basic/checkmark_filled.js +0 -6
- package/dist/icons/basic/checkmarks.js +0 -6
- package/dist/icons/basic/circle.js +0 -6
- package/dist/icons/basic/circle_slash.js +0 -8
- package/dist/icons/basic/clear_text_style.js +0 -6
- package/dist/icons/basic/close.js +0 -6
- package/dist/icons/basic/close_circle.js +0 -6
- package/dist/icons/basic/close_filled.js +0 -6
- package/dist/icons/basic/copy.js +0 -6
- package/dist/icons/basic/delete.js +0 -6
- package/dist/icons/basic/detail.js +0 -6
- package/dist/icons/basic/dot.js +0 -6
- package/dist/icons/basic/download.js +0 -6
- package/dist/icons/basic/download_arrow.js +0 -6
- package/dist/icons/basic/droplet.js +0 -8
- package/dist/icons/basic/ellipsis_horizontal.js +0 -6
- package/dist/icons/basic/ellipsis_horizontal_circle.js +0 -6
- package/dist/icons/basic/ellipsis_vertical.js +0 -6
- package/dist/icons/basic/ellipsis_vertical_circle.js +0 -6
- package/dist/icons/basic/eye.js +0 -6
- package/dist/icons/basic/eye_slash.js +0 -6
- package/dist/icons/basic/fingerprint.js +0 -6
- package/dist/icons/basic/flag.js +0 -6
- package/dist/icons/basic/flag_wave.js +0 -6
- package/dist/icons/basic/flag_wave_filled.js +0 -6
- package/dist/icons/basic/flame.js +0 -6
- package/dist/icons/basic/gauge.js +0 -6
- package/dist/icons/basic/glasses.js +0 -6
- package/dist/icons/basic/graduation_cap.js +0 -6
- package/dist/icons/basic/hashmark.js +0 -6
- package/dist/icons/basic/heart.js +0 -6
- package/dist/icons/basic/heart_slash.js +0 -6
- package/dist/icons/basic/highlighter.js +0 -6
- package/dist/icons/basic/home.js +0 -6
- package/dist/icons/basic/image.js +0 -6
- package/dist/icons/basic/inbox.js +0 -6
- package/dist/icons/basic/index.js +0 -131
- package/dist/icons/basic/italic.js +0 -6
- package/dist/icons/basic/layers.js +0 -6
- package/dist/icons/basic/lightening.js +0 -6
- package/dist/icons/basic/lightening_slash.js +0 -6
- package/dist/icons/basic/link.js +0 -6
- package/dist/icons/basic/link_slash.js +0 -6
- package/dist/icons/basic/loudspeaker.js +0 -6
- package/dist/icons/basic/maximize.js +0 -6
- package/dist/icons/basic/menu.js +0 -6
- package/dist/icons/basic/menu_circle.js +0 -6
- package/dist/icons/basic/menu_dots.js +0 -6
- package/dist/icons/basic/microphone_slash.js +0 -6
- package/dist/icons/basic/minimize.js +0 -6
- package/dist/icons/basic/minus.js +0 -6
- package/dist/icons/basic/minus_circle.js +0 -6
- package/dist/icons/basic/move_item.js +0 -6
- package/dist/icons/basic/new.js +0 -6
- package/dist/icons/basic/newspaper.js +0 -6
- package/dist/icons/basic/node.js +0 -6
- package/dist/icons/basic/note_pad.js +0 -7
- package/dist/icons/basic/options.js +0 -6
- package/dist/icons/basic/paint_brush.js +0 -6
- package/dist/icons/basic/paperclip.js +0 -6
- package/dist/icons/basic/paperclip_slash.js +0 -6
- package/dist/icons/basic/pencil.js +0 -6
- package/dist/icons/basic/pencil_pad.js +0 -6
- package/dist/icons/basic/plus.js +0 -6
- package/dist/icons/basic/plus_circle.js +0 -6
- package/dist/icons/basic/presentation.js +0 -6
- package/dist/icons/basic/printer.js +0 -6
- package/dist/icons/basic/profile.js +0 -6
- package/dist/icons/basic/profile_check.js +0 -6
- package/dist/icons/basic/pulse.js +0 -6
- package/dist/icons/basic/qr_code.js +0 -6
- package/dist/icons/basic/resize.js +0 -8
- package/dist/icons/basic/scan.js +0 -6
- package/dist/icons/basic/scissors.js +0 -6
- package/dist/icons/basic/screenshot.js +0 -6
- package/dist/icons/basic/search.js +0 -6
- package/dist/icons/basic/select_item.js +0 -7
- package/dist/icons/basic/settings.js +0 -6
- package/dist/icons/basic/share.js +0 -6
- package/dist/icons/basic/share_external.js +0 -6
- package/dist/icons/basic/square.js +0 -6
- package/dist/icons/basic/star.js +0 -6
- package/dist/icons/basic/star_circle.js +0 -6
- package/dist/icons/basic/star_filled.js +0 -6
- package/dist/icons/basic/star_filled_half.js +0 -6
- package/dist/icons/basic/star_slash.js +0 -6
- package/dist/icons/basic/sticker.js +0 -6
- package/dist/icons/basic/strikethrough.js +0 -6
- package/dist/icons/basic/subtask.js +0 -7
- package/dist/icons/basic/tax.js +0 -9
- package/dist/icons/basic/text_bg_color.js +0 -6
- package/dist/icons/basic/text_color.js +0 -6
- package/dist/icons/basic/textbox.js +0 -6
- package/dist/icons/basic/thumbs_down.js +0 -6
- package/dist/icons/basic/thumbs_up.js +0 -6
- package/dist/icons/basic/thumbs_up_filled.js +0 -6
- package/dist/icons/basic/toggle_left.js +0 -6
- package/dist/icons/basic/toggle_right.js +0 -6
- package/dist/icons/basic/translate.js +0 -6
- package/dist/icons/basic/trash.js +0 -6
- package/dist/icons/basic/trash_slash.js +0 -6
- package/dist/icons/basic/underline.js +0 -6
- package/dist/icons/basic/upload.js +0 -6
- package/dist/icons/basic/video.js +0 -6
- package/dist/icons/basic/video_add.js +0 -7
- package/dist/icons/basic/video_slash.js +0 -6
- package/dist/icons/basic/wrench.js +0 -6
- package/dist/icons/basic/zoom_in.js +0 -6
- package/dist/icons/basic/zoom_out.js +0 -6
- package/dist/icons/data/bar_chart.js +0 -6
- package/dist/icons/data/bar_chart_downward.js +0 -6
- package/dist/icons/data/bar_chart_downward_outline.js +0 -6
- package/dist/icons/data/bar_chart_upward.js +0 -6
- package/dist/icons/data/bar_chart_upward_outline.js +0 -6
- package/dist/icons/data/candlestick_chart.js +0 -6
- package/dist/icons/data/four_circles.js +0 -6
- package/dist/icons/data/index.js +0 -20
- package/dist/icons/data/legend_toggle.js +0 -6
- package/dist/icons/data/line_chart.js +0 -6
- package/dist/icons/data/line_chart_area.js +0 -6
- package/dist/icons/data/line_chart_area_shaded.js +0 -6
- package/dist/icons/data/line_chart_double.js +0 -6
- package/dist/icons/data/line_chart_downward.js +0 -6
- package/dist/icons/data/line_chart_node.js +0 -6
- package/dist/icons/data/line_chart_outline.js +0 -6
- package/dist/icons/data/line_chart_search.js +0 -6
- package/dist/icons/data/line_chart_stars.js +0 -6
- package/dist/icons/data/line_chart_upward.js +0 -6
- package/dist/icons/data/pie_chart.js +0 -7
- package/dist/icons/data/tree.js +0 -6
- package/dist/icons/email/index.js +0 -8
- package/dist/icons/email/mail.js +0 -6
- package/dist/icons/email/mail_check.js +0 -6
- package/dist/icons/email/mail_minus.js +0 -6
- package/dist/icons/email/mail_send.js +0 -6
- package/dist/icons/email/send.js +0 -6
- package/dist/icons/email/send_close.js +0 -6
- package/dist/icons/email/send_schedule.js +0 -6
- package/dist/icons/email/send_text.js +0 -6
- package/dist/icons/emoji/emoji_add.js +0 -6
- package/dist/icons/emoji/index.js +0 -6
- package/dist/icons/emoji/laughing.js +0 -6
- package/dist/icons/emoji/neutral.js +0 -6
- package/dist/icons/emoji/sad.js +0 -6
- package/dist/icons/emoji/shocked.js +0 -6
- package/dist/icons/emoji/smile.js +0 -6
- package/dist/icons/file/clipboard.js +0 -6
- package/dist/icons/file/clipboard_check.js +0 -6
- package/dist/icons/file/clipboard_close.js +0 -6
- package/dist/icons/file/clipboard_minus.js +0 -6
- package/dist/icons/file/clipboard_plus.js +0 -6
- package/dist/icons/file/clipboard_text.js +0 -6
- package/dist/icons/file/file.js +0 -6
- package/dist/icons/file/file_add.js +0 -6
- package/dist/icons/file/file_check.js +0 -6
- package/dist/icons/file/file_close.js +0 -6
- package/dist/icons/file/file_code.js +0 -6
- package/dist/icons/file/file_download.js +0 -6
- package/dist/icons/file/file_draft.js +0 -6
- package/dist/icons/file/file_gear.js +0 -7
- package/dist/icons/file/file_minus.js +0 -6
- package/dist/icons/file/file_plus.js +0 -6
- package/dist/icons/file/file_scan.js +0 -6
- package/dist/icons/file/file_shred.js +0 -6
- package/dist/icons/file/file_text.js +0 -6
- package/dist/icons/file/file_upload.js +0 -6
- package/dist/icons/file/folder.js +0 -6
- package/dist/icons/file/folder_add.js +0 -6
- package/dist/icons/file/folder_arrow.js +0 -6
- package/dist/icons/file/folder_check.js +0 -6
- package/dist/icons/file/folder_close.js +0 -6
- package/dist/icons/file/folder_cloud.js +0 -6
- package/dist/icons/file/folder_gear.js +0 -7
- package/dist/icons/file/folder_minus.js +0 -6
- package/dist/icons/file/folder_music.js +0 -6
- package/dist/icons/file/folder_open.js +0 -6
- package/dist/icons/file/folder_plus.js +0 -6
- package/dist/icons/file/folder_zip.js +0 -6
- package/dist/icons/file/index.js +0 -36
- package/dist/icons/file/note.js +0 -6
- package/dist/icons/file/note_text.js +0 -6
- package/dist/icons/file/pdf.js +0 -6
- package/dist/icons/file/photo.js +0 -6
- package/dist/icons/finance/bitcoin.js +0 -6
- package/dist/icons/finance/coins.js +0 -10
- package/dist/icons/finance/credit_card.js +0 -6
- package/dist/icons/finance/credit_card_add.js +0 -6
- package/dist/icons/finance/credit_card_face.js +0 -6
- package/dist/icons/finance/credit_card_member.js +0 -6
- package/dist/icons/finance/credit_card_outcome.js +0 -6
- package/dist/icons/finance/credit_card_scan.js +0 -6
- package/dist/icons/finance/credit_card_share.js +0 -6
- package/dist/icons/finance/credit_card_slash.js +0 -6
- package/dist/icons/finance/currency_exchange.js +0 -6
- package/dist/icons/finance/dollar.js +0 -6
- package/dist/icons/finance/ethereum.js +0 -6
- package/dist/icons/finance/index.js +0 -16
- package/dist/icons/finance/paypass.js +0 -6
- package/dist/icons/finance/strongbox.js +0 -6
- package/dist/icons/finance/wallet.js +0 -6
- package/dist/icons/index.js +0 -22
- package/dist/icons/layout/block_align_bottom.js +0 -6
- package/dist/icons/layout/block_align_center.js +0 -6
- package/dist/icons/layout/block_align_left.js +0 -6
- package/dist/icons/layout/block_align_middle.js +0 -6
- package/dist/icons/layout/block_align_right.js +0 -6
- package/dist/icons/layout/block_align_top.js +0 -6
- package/dist/icons/layout/block_horizontal.js +0 -6
- package/dist/icons/layout/block_vertical.js +0 -6
- package/dist/icons/layout/edit_shape.js +0 -6
- package/dist/icons/layout/elements.js +0 -6
- package/dist/icons/layout/elements_add.js +0 -6
- package/dist/icons/layout/elements_filled.js +0 -6
- package/dist/icons/layout/elements_masonry.js +0 -6
- package/dist/icons/layout/frame.js +0 -6
- package/dist/icons/layout/frame_stack.js +0 -6
- package/dist/icons/layout/grid.js +0 -6
- package/dist/icons/layout/grid_column_three.js +0 -6
- package/dist/icons/layout/grid_column_two.js +0 -6
- package/dist/icons/layout/grid_dynamic.js +0 -6
- package/dist/icons/layout/grid_frame.js +0 -6
- package/dist/icons/layout/grid_row_three.js +0 -6
- package/dist/icons/layout/grid_row_two.js +0 -6
- package/dist/icons/layout/grid_six.js +0 -6
- package/dist/icons/layout/grid_small.js +0 -6
- package/dist/icons/layout/iframe.js +0 -6
- package/dist/icons/layout/index.js +0 -44
- package/dist/icons/layout/kanban.js +0 -6
- package/dist/icons/layout/layout.js +0 -6
- package/dist/icons/layout/list.js +0 -6
- package/dist/icons/layout/list_filled.js +0 -11
- package/dist/icons/layout/padding.js +0 -6
- package/dist/icons/layout/page_break.js +0 -6
- package/dist/icons/layout/rotate_left.js +0 -6
- package/dist/icons/layout/rotate_right.js +0 -6
- package/dist/icons/layout/ruler.js +0 -6
- package/dist/icons/layout/segment.js +0 -6
- package/dist/icons/layout/select_area.js +0 -6
- package/dist/icons/layout/select_boundary.js +0 -6
- package/dist/icons/layout/sidebar_left.js +0 -6
- package/dist/icons/layout/sidebar_right.js +0 -6
- package/dist/icons/layout/slides.js +0 -6
- package/dist/icons/layout/slides_horizontal.js +0 -6
- package/dist/icons/layout/slides_vertical.js +0 -11
- package/dist/icons/layout/stack.js +0 -6
- package/dist/icons/layout/text.js +0 -6
- package/dist/icons/maps/atlas.js +0 -6
- package/dist/icons/maps/compass.js +0 -6
- package/dist/icons/maps/direction.js +0 -6
- package/dist/icons/maps/direction_angled.js +0 -6
- package/dist/icons/maps/globe.js +0 -6
- package/dist/icons/maps/globe_slash.js +0 -6
- package/dist/icons/maps/index.js +0 -22
- package/dist/icons/maps/location.js +0 -6
- package/dist/icons/maps/location_slash.js +0 -6
- package/dist/icons/maps/map.js +0 -6
- package/dist/icons/maps/marker.js +0 -6
- package/dist/icons/maps/panorama.js +0 -6
- package/dist/icons/maps/pin.js +0 -6
- package/dist/icons/maps/pin_arrow.js +0 -6
- package/dist/icons/maps/pin_location.js +0 -6
- package/dist/icons/maps/pin_plus.js +0 -6
- package/dist/icons/maps/pin_question.js +0 -6
- package/dist/icons/maps/pin_slash.js +0 -6
- package/dist/icons/maps/push_pin.js +0 -6
- package/dist/icons/maps/push_pin_filled.js +0 -6
- package/dist/icons/maps/push_pin_slash.js +0 -6
- package/dist/icons/maps/radar.js +0 -6
- package/dist/icons/maps/route.js +0 -6
- package/dist/icons/message/bubble.js +0 -6
- package/dist/icons/message/bubble_question.js +0 -6
- package/dist/icons/message/comment.js +0 -6
- package/dist/icons/message/comment_add.js +0 -6
- package/dist/icons/message/comment_check.js +0 -6
- package/dist/icons/message/comment_close.js +0 -6
- package/dist/icons/message/comment_minus.js +0 -6
- package/dist/icons/message/comment_text.js +0 -6
- package/dist/icons/message/index.js +0 -8
- package/dist/icons/misc/advertisement.js +0 -6
- package/dist/icons/misc/atom.js +0 -6
- package/dist/icons/misc/bone.js +0 -6
- package/dist/icons/misc/brightness_high.js +0 -6
- package/dist/icons/misc/brightness_low.js +0 -6
- package/dist/icons/misc/contrast.js +0 -6
- package/dist/icons/misc/crosshairs.js +0 -6
- package/dist/icons/misc/crown.js +0 -6
- package/dist/icons/misc/footprint.js +0 -6
- package/dist/icons/misc/form.js +0 -6
- package/dist/icons/misc/funnel.js +0 -6
- package/dist/icons/misc/index.js +0 -25
- package/dist/icons/misc/infinite.js +0 -6
- package/dist/icons/misc/insert_button.js +0 -6
- package/dist/icons/misc/light_bulb.js +0 -6
- package/dist/icons/misc/moon.js +0 -6
- package/dist/icons/misc/nut.js +0 -6
- package/dist/icons/misc/planet.js +0 -6
- package/dist/icons/misc/plus_thick.js +0 -6
- package/dist/icons/misc/pocket.js +0 -6
- package/dist/icons/misc/rocket.js +0 -6
- package/dist/icons/misc/soup.js +0 -10
- package/dist/icons/misc/sun.js +0 -6
- package/dist/icons/misc/toy_horse.js +0 -6
- package/dist/icons/misc/trophy.js +0 -6
- package/dist/icons/misc/watercloset.js +0 -6
- package/dist/icons/notifications/alert_circle.js +0 -6
- package/dist/icons/notifications/alert_octogon.js +0 -6
- package/dist/icons/notifications/alert_triangle.js +0 -6
- package/dist/icons/notifications/app_notification.js +0 -6
- package/dist/icons/notifications/bell.js +0 -6
- package/dist/icons/notifications/bell_alert.js +0 -6
- package/dist/icons/notifications/bell_checkmark.js +0 -6
- package/dist/icons/notifications/bell_minus.js +0 -6
- package/dist/icons/notifications/bell_plus.js +0 -6
- package/dist/icons/notifications/bell_ring.js +0 -8
- package/dist/icons/notifications/bell_slash.js +0 -6
- package/dist/icons/notifications/close_octogon.js +0 -6
- package/dist/icons/notifications/index.js +0 -14
- package/dist/icons/notifications/information.js +0 -6
- package/dist/icons/notifications/minus_octogon.js +0 -6
- package/dist/icons/notifications/question_circle.js +0 -6
- package/dist/icons/people/group.js +0 -6
- package/dist/icons/people/group_add.js +0 -6
- package/dist/icons/people/group_chat.js +0 -8
- package/dist/icons/people/group_remove.js +0 -6
- package/dist/icons/people/group_send.js +0 -7
- package/dist/icons/people/groups.js +0 -6
- package/dist/icons/people/index.js +0 -13
- package/dist/icons/people/person.js +0 -6
- package/dist/icons/people/person_add.js +0 -6
- package/dist/icons/people/person_checkmark.js +0 -6
- package/dist/icons/people/person_circle.js +0 -8
- package/dist/icons/people/person_close.js +0 -8
- package/dist/icons/people/person_remove.js +0 -6
- package/dist/icons/people/person_slash.js +0 -8
- package/dist/icons/phone/index.js +0 -14
- package/dist/icons/phone/keypad.js +0 -6
- package/dist/icons/phone/phone.js +0 -6
- package/dist/icons/phone/phone_add.js +0 -6
- package/dist/icons/phone/phone_calling.js +0 -6
- package/dist/icons/phone/phone_check.js +0 -6
- package/dist/icons/phone/phone_close.js +0 -6
- package/dist/icons/phone/phone_decline.js +0 -6
- package/dist/icons/phone/phone_end.js +0 -6
- package/dist/icons/phone/phone_forwarded.js +0 -6
- package/dist/icons/phone/phone_hash.js +0 -6
- package/dist/icons/phone/phone_incoming.js +0 -6
- package/dist/icons/phone/phone_missed.js +0 -6
- package/dist/icons/phone/phone_outgoing.js +0 -6
- package/dist/icons/phone/phone_pause.js +0 -6
- package/dist/icons/phone/phone_slash.js +0 -6
- package/dist/icons/phone/voicemail.js +0 -6
- package/dist/icons/security/index.js +0 -11
- package/dist/icons/security/key.js +0 -6
- package/dist/icons/security/key_slash.js +0 -6
- package/dist/icons/security/lock.js +0 -6
- package/dist/icons/security/lock_circle.js +0 -6
- package/dist/icons/security/lock_open.js +0 -6
- package/dist/icons/security/lock_slash.js +0 -6
- package/dist/icons/security/shield.js +0 -6
- package/dist/icons/security/shield_checkmark.js +0 -6
- package/dist/icons/security/shield_lock.js +0 -6
- package/dist/icons/security/shield_slash.js +0 -6
- package/dist/icons/security/verified.js +0 -6
- package/dist/icons/shopping/basket.js +0 -6
- package/dist/icons/shopping/cart.js +0 -6
- package/dist/icons/shopping/cart_filled.js +0 -6
- package/dist/icons/shopping/coupon.js +0 -6
- package/dist/icons/shopping/coupon_cut.js +0 -6
- package/dist/icons/shopping/delivery.js +0 -6
- package/dist/icons/shopping/discount.js +0 -6
- package/dist/icons/shopping/gift.js +0 -6
- package/dist/icons/shopping/gift_bag.js +0 -6
- package/dist/icons/shopping/index.js +0 -15
- package/dist/icons/shopping/inventory.js +0 -6
- package/dist/icons/shopping/point_of_sale.js +0 -6
- package/dist/icons/shopping/shirt.js +0 -6
- package/dist/icons/shopping/tag.js +0 -6
- package/dist/icons/shopping/tag_diagonal.js +0 -6
- package/dist/icons/shopping/tote.js +0 -6
- package/dist/icons/special/index.js +0 -4
- package/dist/icons/special/upload_audio.js +0 -11
- package/dist/icons/special/upload_file.js +0 -6
- package/dist/icons/special/upload_image.js +0 -8
- package/dist/icons/special/upload_video.js +0 -9
- package/dist/icons/symbols/at.js +0 -6
- package/dist/icons/symbols/cc.js +0 -6
- package/dist/icons/symbols/cmd.js +0 -6
- package/dist/icons/symbols/facebook.js +0 -6
- package/dist/icons/symbols/google.js +0 -9
- package/dist/icons/symbols/hash.js +0 -6
- package/dist/icons/symbols/index.js +0 -9
- package/dist/icons/symbols/instagram.js +0 -18
- package/dist/icons/symbols/messenger.js +0 -12
- package/dist/icons/symbols/twitter.js +0 -6
- package/dist/icons/technology/battery.js +0 -6
- package/dist/icons/technology/battery_100.js +0 -6
- package/dist/icons/technology/battery_20.js +0 -6
- package/dist/icons/technology/battery_40.js +0 -6
- package/dist/icons/technology/battery_60.js +0 -6
- package/dist/icons/technology/battery_80.js +0 -6
- package/dist/icons/technology/battery_charging.js +0 -6
- package/dist/icons/technology/battery_slash.js +0 -6
- package/dist/icons/technology/devices.js +0 -6
- package/dist/icons/technology/floppy_disk.js +0 -6
- package/dist/icons/technology/index.js +0 -17
- package/dist/icons/technology/iphone.js +0 -6
- package/dist/icons/technology/laptop.js +0 -6
- package/dist/icons/technology/mobile.js +0 -6
- package/dist/icons/technology/monitor.js +0 -6
- package/dist/icons/technology/server.js +0 -6
- package/dist/icons/technology/sim_card.js +0 -6
- package/dist/icons/technology/usb_stick.js +0 -6
- package/dist/icons/text/align_center.js +0 -6
- package/dist/icons/text/align_justified.js +0 -6
- package/dist/icons/text/align_left.js +0 -6
- package/dist/icons/text/align_right.js +0 -6
- package/dist/icons/text/code_block.js +0 -6
- package/dist/icons/text/divider.js +0 -6
- package/dist/icons/text/footnote.js +0 -8
- package/dist/icons/text/indent_decrease.js +0 -6
- package/dist/icons/text/indent_increase.js +0 -6
- package/dist/icons/text/index.js +0 -13
- package/dist/icons/text/list_ordered.js +0 -6
- package/dist/icons/text/list_unordered.js +0 -6
- package/dist/icons/text/quote.js +0 -6
- package/dist/icons/text/table.js +0 -6
- package/dist/icons/time/alarm.js +0 -6
- package/dist/icons/time/alarm_checkmark.js +0 -6
- package/dist/icons/time/alarm_minus.js +0 -6
- package/dist/icons/time/alarm_plus.js +0 -6
- package/dist/icons/time/alarm_slash.js +0 -6
- package/dist/icons/time/alarm_snooze.js +0 -6
- package/dist/icons/time/calendar.js +0 -6
- package/dist/icons/time/calendar_add.js +0 -6
- package/dist/icons/time/calendar_checkmark.js +0 -6
- package/dist/icons/time/calendar_close.js +0 -6
- package/dist/icons/time/calendar_dates.js +0 -6
- package/dist/icons/time/calendar_minus.js +0 -6
- package/dist/icons/time/calendar_plus.js +0 -6
- package/dist/icons/time/calendar_scroll.js +0 -8
- package/dist/icons/time/clock.js +0 -6
- package/dist/icons/time/clock_history.js +0 -6
- package/dist/icons/time/index.js +0 -19
- package/dist/icons/time/stopwatch.js +0 -6
- package/dist/icons/time/timer.js +0 -6
- package/dist/icons/time/watch.js +0 -6
- package/dist/styles/output.css +0 -1771
- package/dist/types/attributes.js +0 -1
- package/dist/types/index.js +0 -1
- package/dist/utils/date.js +0 -98
- package/dist/utils/function.js +0 -1
- package/dist/utils/index.js +0 -2
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import { getPluginType, insertNodes, insertTable, toggleNodeType, useLinkToolbarButton, useLinkToolbarButtonState, useListToolbarButton, useListToolbarButtonState, useMarkToolbarButton, useMarkToolbarButtonState, useEditorRef, useEditorState, } from '@udecode/plate';
|
|
4
|
-
import { Tooltip } from '../../';
|
|
5
|
-
import { Bold, FileCode, Grid, Headphones, Image, Italic, Link, ListOrdered, ListUnordered, Quote, Redo, Strikethrough, Underline, Undo, Video, } from '../../../icons';
|
|
6
|
-
import { ELEMENT_BLOCKQUOTE, ELEMENT_BUTTON, ELEMENT_OL, ELEMENT_UL, MARK_BOLD, MARK_CODE, MARK_ITALIC, MARK_STRIKETHROUGH, MARK_UNDERLINE, } from '../constants';
|
|
7
|
-
import { AlignmentDropdown } from './alignment_dropdown';
|
|
8
|
-
import { ButtonModal } from './button_modal';
|
|
9
|
-
import { StyleDropdown } from './style_dropdown';
|
|
10
|
-
export const EditorBar = () => {
|
|
11
|
-
const editorRef = useEditorRef('main');
|
|
12
|
-
const stateEditor = useEditorState();
|
|
13
|
-
const audioRef = React.useRef(null);
|
|
14
|
-
const imageRef = React.useRef(null);
|
|
15
|
-
const videoRef = React.useRef(null);
|
|
16
|
-
const boldState = useMarkToolbarButtonState({ nodeType: MARK_BOLD });
|
|
17
|
-
const { props: { pressed: currBold, onClick: handleBold }, } = useMarkToolbarButton(boldState);
|
|
18
|
-
const italicState = useMarkToolbarButtonState({ nodeType: MARK_ITALIC });
|
|
19
|
-
const { props: { pressed: currItalic, onClick: handleItalic }, } = useMarkToolbarButton(italicState);
|
|
20
|
-
const strikethroughState = useMarkToolbarButtonState({
|
|
21
|
-
nodeType: MARK_STRIKETHROUGH,
|
|
22
|
-
});
|
|
23
|
-
const { props: { pressed: currStrikethrough, onClick: handleStrikethrough }, } = useMarkToolbarButton(strikethroughState);
|
|
24
|
-
const underlineState = useMarkToolbarButtonState({
|
|
25
|
-
nodeType: MARK_UNDERLINE,
|
|
26
|
-
});
|
|
27
|
-
const { props: { pressed: currUnderline, onClick: handleUnderline }, } = useMarkToolbarButton(underlineState);
|
|
28
|
-
const inlineCodeState = useMarkToolbarButtonState({ nodeType: MARK_CODE });
|
|
29
|
-
const { props: { pressed: currInlineCode, onClick: handleInlineCode }, } = useMarkToolbarButton(inlineCodeState);
|
|
30
|
-
const linkState = useLinkToolbarButtonState();
|
|
31
|
-
const { props: { pressed: currLink, onClick: handleLink }, } = useLinkToolbarButton(linkState);
|
|
32
|
-
const orderedListState = useListToolbarButtonState({ nodeType: ELEMENT_OL });
|
|
33
|
-
const { props: { pressed: currOrderedList, onClick: handleOrderedList }, } = useListToolbarButton(orderedListState);
|
|
34
|
-
const unorderedListState = useListToolbarButtonState({
|
|
35
|
-
nodeType: ELEMENT_UL,
|
|
36
|
-
});
|
|
37
|
-
const { props: { pressed: currUnorderedList, onClick: handleUnorderedList }, } = useListToolbarButton(unorderedListState);
|
|
38
|
-
const handleAudioChange = async (event) => {
|
|
39
|
-
const file = event.target?.files?.[0];
|
|
40
|
-
if (!file)
|
|
41
|
-
return;
|
|
42
|
-
/**
|
|
43
|
-
* TODO: Insert audio component
|
|
44
|
-
*/
|
|
45
|
-
};
|
|
46
|
-
const handleBlockquote = () => {
|
|
47
|
-
toggleNodeType(stateEditor, { activeType: ELEMENT_BLOCKQUOTE });
|
|
48
|
-
};
|
|
49
|
-
const handleButton = (type) => {
|
|
50
|
-
insertNodes(editorRef, [
|
|
51
|
-
{
|
|
52
|
-
type: getPluginType(editorRef, ELEMENT_BUTTON),
|
|
53
|
-
buttonType: type,
|
|
54
|
-
children: [
|
|
55
|
-
{
|
|
56
|
-
text: 'Subscribe',
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
]);
|
|
61
|
-
};
|
|
62
|
-
const handleRedo = () => editorRef.redo();
|
|
63
|
-
const handleUndo = () => editorRef.undo();
|
|
64
|
-
const handleVideoChange = async () => {
|
|
65
|
-
const files = videoRef.current?.files;
|
|
66
|
-
if (!files)
|
|
67
|
-
return;
|
|
68
|
-
/**
|
|
69
|
-
* TODO: Insert video component
|
|
70
|
-
*/
|
|
71
|
-
};
|
|
72
|
-
return (React.createElement(Wrapper, null,
|
|
73
|
-
React.createElement(Menu, { "aria-label": "editor-navigation" },
|
|
74
|
-
React.createElement(MenuSection, null,
|
|
75
|
-
React.createElement(Tooltip, { content: "Undo", place: "top" },
|
|
76
|
-
React.createElement(MenuButton, { "$active": false, onClick: handleUndo },
|
|
77
|
-
React.createElement(Undo, { size: 24, color: "grey-5" }))),
|
|
78
|
-
React.createElement(Tooltip, { content: "Redo", place: "top" },
|
|
79
|
-
React.createElement(MenuButton, { "$active": false, onClick: handleRedo },
|
|
80
|
-
React.createElement(Redo, { size: 24, color: "grey-5" })))),
|
|
81
|
-
React.createElement(Divider, null),
|
|
82
|
-
React.createElement(MenuSection, null,
|
|
83
|
-
React.createElement(StyleDropdown, { editorRef: editorRef })),
|
|
84
|
-
React.createElement(Divider, null),
|
|
85
|
-
React.createElement(MenuSection, null,
|
|
86
|
-
React.createElement(Tooltip, { content: "Bold", place: "top" },
|
|
87
|
-
React.createElement(MenuButton, { "$active": currBold, onClick: handleBold },
|
|
88
|
-
React.createElement(Bold, { size: 24, color: "grey-5" }))),
|
|
89
|
-
React.createElement(Tooltip, { content: "Italic", place: "top" },
|
|
90
|
-
React.createElement(MenuButton, { "$active": currItalic, onClick: handleItalic },
|
|
91
|
-
React.createElement(Italic, { size: 24, color: "grey-5" }))),
|
|
92
|
-
React.createElement(Tooltip, { content: "Underline", place: "top" },
|
|
93
|
-
React.createElement(MenuButton, { "$active": currUnderline, onClick: handleUnderline },
|
|
94
|
-
React.createElement(Underline, { size: 24, color: "grey-5" }))),
|
|
95
|
-
React.createElement(Tooltip, { content: "Strikethrough", place: "top" },
|
|
96
|
-
React.createElement(MenuButton, { "$active": currStrikethrough, onClick: handleStrikethrough },
|
|
97
|
-
React.createElement(Strikethrough, { size: 24, color: "grey-5" }))),
|
|
98
|
-
React.createElement(Tooltip, { content: "Inline code", place: "top" },
|
|
99
|
-
React.createElement(MenuButton, { "$active": currInlineCode, onClick: handleInlineCode },
|
|
100
|
-
React.createElement(FileCode, { size: 24, color: "grey-5" })))),
|
|
101
|
-
React.createElement(Divider, null),
|
|
102
|
-
React.createElement(MenuSection, null,
|
|
103
|
-
React.createElement(MenuButton, { "$active": false, as: "div" },
|
|
104
|
-
React.createElement(AlignmentDropdown, { editorRef: editorRef }))),
|
|
105
|
-
React.createElement(Divider, null),
|
|
106
|
-
React.createElement(MenuSection, null,
|
|
107
|
-
React.createElement(Tooltip, { content: "Link", place: "top" },
|
|
108
|
-
React.createElement(MenuButton, { "$active": currLink, onClick: handleLink },
|
|
109
|
-
React.createElement(Link, { size: 24, color: "grey-5" }))),
|
|
110
|
-
React.createElement(Tooltip, { content: "Image", place: "top" },
|
|
111
|
-
React.createElement(MenuButton, { "$active": false, as: "label" },
|
|
112
|
-
React.createElement("div", null,
|
|
113
|
-
React.createElement("input", { accept: "image/*", ref: imageRef, style: { display: 'none' }, type: "file" }),
|
|
114
|
-
React.createElement(Image, { size: 24, color: "grey-5" })))),
|
|
115
|
-
React.createElement(Tooltip, { content: "Video", place: "top" },
|
|
116
|
-
React.createElement(MenuButton, { "$active": false, as: "label", onChange: handleVideoChange },
|
|
117
|
-
React.createElement("div", { onClick: () => videoRef.current?.click() },
|
|
118
|
-
React.createElement("input", { accept: "video/*", ref: videoRef, style: { display: 'none' }, type: "file" }),
|
|
119
|
-
React.createElement(Video, { size: 24, color: "grey-5" })))),
|
|
120
|
-
React.createElement(Tooltip, { content: "Audio", place: "top" },
|
|
121
|
-
React.createElement(MenuButton, { "$active": false, as: "label", onChange: handleAudioChange },
|
|
122
|
-
React.createElement("div", { onClick: () => audioRef.current?.click() },
|
|
123
|
-
React.createElement("input", { accept: "audio/*", ref: audioRef, style: { display: 'none' }, type: "file" }),
|
|
124
|
-
React.createElement(Headphones, { size: 24, color: "grey-5" })))),
|
|
125
|
-
React.createElement(Tooltip, { content: "Blockquote", place: "top" },
|
|
126
|
-
React.createElement(MenuButton, { "$active": false, onClick: handleBlockquote },
|
|
127
|
-
React.createElement(Quote, { size: 24, color: "grey-5" }))),
|
|
128
|
-
React.createElement(Tooltip, { content: "Add a button", place: "top" },
|
|
129
|
-
React.createElement(ButtonModal, { onButtonInsert: handleButton }))),
|
|
130
|
-
React.createElement(Divider, null),
|
|
131
|
-
React.createElement(MenuSection, null,
|
|
132
|
-
React.createElement(Tooltip, { content: "Unordered List", place: "top" },
|
|
133
|
-
React.createElement(MenuButton, { "$active": currUnorderedList, onClick: handleUnorderedList },
|
|
134
|
-
React.createElement(ListUnordered, { size: 24, color: "grey-5" }))),
|
|
135
|
-
React.createElement(Tooltip, { content: "Ordered List", place: "top" },
|
|
136
|
-
React.createElement(MenuButton, { "$active": currOrderedList, onClick: handleOrderedList },
|
|
137
|
-
React.createElement(ListOrdered, { size: 24, color: "grey-5" }))),
|
|
138
|
-
React.createElement(Tooltip, { content: "Add a button", place: "top" },
|
|
139
|
-
React.createElement(MenuButton, { "$active": currOrderedList, onClick: () => {
|
|
140
|
-
insertTable(editorRef);
|
|
141
|
-
} },
|
|
142
|
-
React.createElement(Grid, { size: 24, color: "grey-5" })))))));
|
|
143
|
-
};
|
|
144
|
-
const Wrapper = styled.div `
|
|
145
|
-
position: sticky;
|
|
146
|
-
z-index: 2;
|
|
147
|
-
left: 0;
|
|
148
|
-
right: 0;
|
|
149
|
-
top: 0;
|
|
150
|
-
`;
|
|
151
|
-
const Menu = styled.nav `
|
|
152
|
-
display: flex;
|
|
153
|
-
gap: 12px;
|
|
154
|
-
justify-content: center;
|
|
155
|
-
max-width: 1200px;
|
|
156
|
-
width: 100%;
|
|
157
|
-
margin: 0 auto;
|
|
158
|
-
padding: 14px 24px;
|
|
159
|
-
background-color: var(--color-white);
|
|
160
|
-
`;
|
|
161
|
-
const MenuSection = styled.div `
|
|
162
|
-
display: flex;
|
|
163
|
-
gap: 16px;
|
|
164
|
-
align-items: center;
|
|
165
|
-
width: fit-content;
|
|
166
|
-
flex-shrink: 0;
|
|
167
|
-
`;
|
|
168
|
-
export const MenuButton = styled.button `
|
|
169
|
-
padding: 2px;
|
|
170
|
-
border: none;
|
|
171
|
-
outline: none;
|
|
172
|
-
cursor: pointer;
|
|
173
|
-
box-sizing: border-box;
|
|
174
|
-
height: 28px;
|
|
175
|
-
width: 28px;
|
|
176
|
-
border-radius: 2px;
|
|
177
|
-
|
|
178
|
-
&:hover:not(:disabled) {
|
|
179
|
-
padding: 1px;
|
|
180
|
-
border: 1px solid var(--color-grey-8);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
&:active:not(:disabled) {
|
|
184
|
-
background-color: var(--color-grey-9);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
&:disabled {
|
|
188
|
-
background-color: var(--color-white) !important;
|
|
189
|
-
cursor: initial;
|
|
190
|
-
svg {
|
|
191
|
-
fill: var(--color-grey-7) !important;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
background-color: ${({ $active }) => $active ? 'var(--color-grey-9)' : 'transparent'};
|
|
196
|
-
`;
|
|
197
|
-
const Divider = styled.div `
|
|
198
|
-
width: 1px;
|
|
199
|
-
height: 28px;
|
|
200
|
-
background-color: var(--color-grey-9);
|
|
201
|
-
`;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { findNode, isBlock, isCollapsed, toggleNodeType, } from '@udecode/plate';
|
|
3
|
-
import { Button, Dropdown } from '../../';
|
|
4
|
-
import { ELEMENT_H1, ELEMENT_H2, ELEMENT_H3, ELEMENT_H4, ELEMENT_H5, ELEMENT_H6, ELEMENT_PARAGRAPH, } from '../constants';
|
|
5
|
-
const items = [
|
|
6
|
-
{
|
|
7
|
-
value: ELEMENT_PARAGRAPH,
|
|
8
|
-
label: 'Paragraph',
|
|
9
|
-
description: 'Paragraph',
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
value: ELEMENT_H1,
|
|
13
|
-
label: 'Heading 1',
|
|
14
|
-
description: 'Heading 1',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
value: ELEMENT_H2,
|
|
18
|
-
label: 'Heading 2',
|
|
19
|
-
description: 'Heading 2',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
value: ELEMENT_H3,
|
|
23
|
-
label: 'Heading 3',
|
|
24
|
-
description: 'Heading 3',
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
value: ELEMENT_H4,
|
|
28
|
-
label: 'Heading 4',
|
|
29
|
-
description: 'Heading 4',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
value: ELEMENT_H5,
|
|
33
|
-
label: 'Heading 5',
|
|
34
|
-
description: 'Heading 5',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
value: ELEMENT_H6,
|
|
38
|
-
label: 'Heading 6',
|
|
39
|
-
description: 'Heading 6',
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
// eslint-disable-next-line
|
|
43
|
-
const defaultItem = items.find((item) => item.value === ELEMENT_PARAGRAPH);
|
|
44
|
-
export const StyleDropdown = ({ editorRef }) => {
|
|
45
|
-
let value = ELEMENT_PARAGRAPH;
|
|
46
|
-
const handleChange = (event) => {
|
|
47
|
-
const value = event.target.getAttribute('data-value');
|
|
48
|
-
if (!value)
|
|
49
|
-
return;
|
|
50
|
-
toggleNodeType(editorRef, { activeType: value });
|
|
51
|
-
};
|
|
52
|
-
if (isCollapsed(editorRef?.selection)) {
|
|
53
|
-
const entry = findNode(editorRef, {
|
|
54
|
-
match: (n) => isBlock(editorRef, n),
|
|
55
|
-
});
|
|
56
|
-
if (entry) {
|
|
57
|
-
value =
|
|
58
|
-
items.find((item) => item.value === entry[0].type)?.value ??
|
|
59
|
-
ELEMENT_PARAGRAPH;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const selectedItem = items.find((item) => item.value === value) ?? defaultItem;
|
|
63
|
-
const { label: selectedItemLabel } = selectedItem;
|
|
64
|
-
return (React.createElement(Dropdown, { maintainState: false, onChange: handleChange, options: items, trigger: React.createElement(Button, { type: "special", size: "small", sx: "padding: 1px 4px; & > * { color: var(--color-grey-5); }" }, selectedItemLabel) }));
|
|
65
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PlateElement, } from '@udecode/plate';
|
|
3
|
-
import { P } from '../../../atoms/typography';
|
|
4
|
-
export const BlockquoteElement = React.forwardRef(({ children, ...props }, ref) => {
|
|
5
|
-
return (React.createElement(PlateElement, { asChild: true, ref: ref, ...props },
|
|
6
|
-
React.createElement(React.Fragment, null,
|
|
7
|
-
React.createElement(P, { as: "blockquote", sx: "padding-left: 16px; border-left: 1px solid var(--color-grey-8);" }, children))));
|
|
8
|
-
});
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { createBlockquotePlugin, createCodeBlockPlugin, createHeadingPlugin, createHorizontalRulePlugin, createIndentListPlugin, createImagePlugin, createTextIndentPlugin, createListPlugin, createMediaEmbedPlugin, createResetNodePlugin, createTablePlugin, } from '@udecode/plate';
|
|
2
|
-
import { createButtonsPlugin } from './buttons';
|
|
3
|
-
import { createQAPlugin } from './qa';
|
|
4
|
-
import { createParagraphPlugin, createHOnePlugin, createHTwoPlugin, createHThreePlugin, createHFourPlugin, createHFivePlugin, createHSixPlugin, } from './text';
|
|
5
|
-
import { createVideoTitlePlugin } from './video';
|
|
6
|
-
import { ELEMENT_PARAGRAPH, ELEMENT_H1, ELEMENT_H2, ELEMENT_H3, ELEMENT_H4, ELEMENT_H5, ELEMENT_H6, ELEMENT_OL, ELEMENT_UL, } from '../../constants';
|
|
7
|
-
export const blocks = [
|
|
8
|
-
createButtonsPlugin(),
|
|
9
|
-
createBlockquotePlugin(),
|
|
10
|
-
createCodeBlockPlugin(),
|
|
11
|
-
createHeadingPlugin(),
|
|
12
|
-
createHorizontalRulePlugin(),
|
|
13
|
-
createImagePlugin({
|
|
14
|
-
options: {
|
|
15
|
-
disableUploadInsert: true,
|
|
16
|
-
disableEmbedInsert: true,
|
|
17
|
-
},
|
|
18
|
-
}),
|
|
19
|
-
createQAPlugin(),
|
|
20
|
-
createTextIndentPlugin(),
|
|
21
|
-
createIndentListPlugin({
|
|
22
|
-
inject: {
|
|
23
|
-
props: {
|
|
24
|
-
validTypes: [
|
|
25
|
-
ELEMENT_PARAGRAPH,
|
|
26
|
-
ELEMENT_H1,
|
|
27
|
-
ELEMENT_H2,
|
|
28
|
-
ELEMENT_H3,
|
|
29
|
-
ELEMENT_H4,
|
|
30
|
-
ELEMENT_H5,
|
|
31
|
-
ELEMENT_H6,
|
|
32
|
-
ELEMENT_OL,
|
|
33
|
-
ELEMENT_UL,
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
}),
|
|
38
|
-
createListPlugin(),
|
|
39
|
-
createMediaEmbedPlugin(),
|
|
40
|
-
createParagraphPlugin(),
|
|
41
|
-
createHOnePlugin(),
|
|
42
|
-
createHTwoPlugin(),
|
|
43
|
-
createHThreePlugin(),
|
|
44
|
-
createHFourPlugin(),
|
|
45
|
-
createHFivePlugin(),
|
|
46
|
-
createHSixPlugin(),
|
|
47
|
-
createResetNodePlugin(),
|
|
48
|
-
createTablePlugin(),
|
|
49
|
-
createVideoTitlePlugin(),
|
|
50
|
-
];
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import { createPluginFactory, getBlockAbove, getPluginType, isEditorReadOnly, setNodes, someNode, PlateElement, } from '@udecode/plate';
|
|
4
|
-
import { Button as UIButton } from '../../..';
|
|
5
|
-
import { COLORS, ELEMENT_BUTTON, ELEMENT_PARAGRAPH } from '../../constants';
|
|
6
|
-
export const Button = React.forwardRef(({ children, editor, element, ...props }, ref) => {
|
|
7
|
-
const { buttonType, color } = element;
|
|
8
|
-
const pressed = !!editor?.selection &&
|
|
9
|
-
someNode(editor, {
|
|
10
|
-
match: { type: getPluginType(editor, ELEMENT_BUTTON) },
|
|
11
|
-
});
|
|
12
|
-
const currBlock = getBlockAbove(editor, {
|
|
13
|
-
at: editor.selection?.focus,
|
|
14
|
-
match: {
|
|
15
|
-
type: getPluginType(editor, ELEMENT_BUTTON),
|
|
16
|
-
buttonType: buttonType,
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
const editable = !isEditorReadOnly(editor);
|
|
20
|
-
const handleColorChange = (color) => {
|
|
21
|
-
if (currBlock) {
|
|
22
|
-
setNodes(editor, {
|
|
23
|
-
color,
|
|
24
|
-
}, {
|
|
25
|
-
at: currBlock ? currBlock[1] : undefined,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
const ColorMenu = () => !pressed || !editable ? null : (React.createElement(ColorMenuComponent, { contentEditable: false }, COLORS.map((color) => (React.createElement(ColorItem, { "$color": color, contentEditable: false, key: color, onClick: (event) => {
|
|
30
|
-
event.stopPropagation();
|
|
31
|
-
handleColorChange(color);
|
|
32
|
-
} })))));
|
|
33
|
-
return (React.createElement(PlateElement, { asChild: true, editor: editor, element: element, ref: ref, ...props },
|
|
34
|
-
React.createElement(React.Fragment, null,
|
|
35
|
-
React.createElement(ColorMenu, null),
|
|
36
|
-
React.createElement(UIButton, { size: "small", sx: `
|
|
37
|
-
margin-left: auto !important;
|
|
38
|
-
margin-right: auto !important;
|
|
39
|
-
background-color: ${color ? color : 'var(--color-blue-5)'} !important;
|
|
40
|
-
border-color: ${color ? color : 'var(--color-blue-5)'} !important;
|
|
41
|
-
&:hover {
|
|
42
|
-
background-color: ${color ? color : 'var(--color-blue-5)'} !important;
|
|
43
|
-
filter: brightness(85%);
|
|
44
|
-
}
|
|
45
|
-
` }, children))));
|
|
46
|
-
});
|
|
47
|
-
const ColorMenuComponent = styled.div `
|
|
48
|
-
display: flex;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
align-items: center;
|
|
51
|
-
gap: 16px;
|
|
52
|
-
z-index: 5;
|
|
53
|
-
position: absolute;
|
|
54
|
-
transform: translateY(24px);
|
|
55
|
-
left: calc(50% - 148px);
|
|
56
|
-
border-radius: 16px;
|
|
57
|
-
padding: 8px 16px;
|
|
58
|
-
box-shadow: var(--elevation-1);
|
|
59
|
-
background-color: var(--color-white);
|
|
60
|
-
`;
|
|
61
|
-
const ColorItem = styled.div `
|
|
62
|
-
width: 24px;
|
|
63
|
-
height: 24px;
|
|
64
|
-
border-radius: 50%;
|
|
65
|
-
background-color: ${({ $color }) => $color};
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
`;
|
|
68
|
-
export const createButtonsPlugin = createPluginFactory({
|
|
69
|
-
key: ELEMENT_BUTTON,
|
|
70
|
-
type: ELEMENT_BUTTON,
|
|
71
|
-
isElement: true,
|
|
72
|
-
component: Button,
|
|
73
|
-
then: () => ({
|
|
74
|
-
inject: {
|
|
75
|
-
props: {
|
|
76
|
-
classNames: undefined,
|
|
77
|
-
validTypes: [ELEMENT_PARAGRAPH],
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
}),
|
|
81
|
-
});
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import { useCallback, useState } from 'react';
|
|
4
|
-
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
5
|
-
import { cn, createPrimitiveElement, withCn, withProps, withRef, withVariants, } from '@udecode/cn';
|
|
6
|
-
import { cva } from 'class-variance-authority';
|
|
7
|
-
import { ChevronRight } from '../../../../icons/arrow/chevron_right';
|
|
8
|
-
import { Checkmark } from '../../../../icons/basic/checkmark';
|
|
9
|
-
export const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
10
|
-
export const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
11
|
-
export const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
12
|
-
export const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
13
|
-
export const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
14
|
-
export const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
15
|
-
export const DropdownMenuSubTrigger = withRef(({ className, inset, children, ...props }, ref) => (React.createElement(DropdownMenuPrimitive.SubTrigger, { ref: ref, className: cn('flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent', 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50', inset && 'pl-8', className), ...props },
|
|
16
|
-
children,
|
|
17
|
-
React.createElement(ChevronRight, { className: "ml-auto h-4 w-4" }))));
|
|
18
|
-
export const DropdownMenuSubContent = withCn(DropdownMenuPrimitive.SubContent, 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2');
|
|
19
|
-
const DropdownMenuContentVariants = withProps(DropdownMenuPrimitive.Content, {
|
|
20
|
-
sideOffset: 4,
|
|
21
|
-
className: cn('z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2'),
|
|
22
|
-
});
|
|
23
|
-
export const DropdownMenuContent = withRef(({ ...props }, ref) => (React.createElement(DropdownMenuPrimitive.Portal, null,
|
|
24
|
-
React.createElement(DropdownMenuContentVariants, { ref: ref, ...props }))));
|
|
25
|
-
const menuItemVariants = cva(cn('relative flex h-9 cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors', 'focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50'), {
|
|
26
|
-
variants: {
|
|
27
|
-
inset: {
|
|
28
|
-
true: 'pl-8',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
export const DropdownMenuItem = withVariants(DropdownMenuPrimitive.Item, menuItemVariants, ['inset']);
|
|
33
|
-
export const DropdownMenuCheckboxItem = withRef(({ className, children, ...props }, ref) => (React.createElement(DropdownMenuPrimitive.CheckboxItem, { ref: ref, className: cn('relative flex select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', 'cursor-pointer', className), ...props },
|
|
34
|
-
React.createElement("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center" },
|
|
35
|
-
React.createElement(DropdownMenuPrimitive.ItemIndicator, null,
|
|
36
|
-
React.createElement(Checkmark, { className: "h-4 w-4" }))),
|
|
37
|
-
children)));
|
|
38
|
-
export const DropdownMenuRadioItem = withRef(({ className, children, hideIcon, ...props }, ref) => (React.createElement(DropdownMenuPrimitive.RadioItem, { ref: ref, className: cn('relative flex select-none items-center rounded-sm pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', 'h-9 cursor-pointer px-2 data-[state=checked]:bg-accent data-[state=checked]:text-accent-foreground', className), ...props },
|
|
39
|
-
!hideIcon && (React.createElement("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center" },
|
|
40
|
-
React.createElement(DropdownMenuPrimitive.ItemIndicator, null,
|
|
41
|
-
React.createElement(Checkmark, { className: "h-4 w-4" })))),
|
|
42
|
-
children)));
|
|
43
|
-
const dropdownMenuLabelVariants = cva(cn('select-none px-2 py-1.5 text-sm font-semibold'), {
|
|
44
|
-
variants: {
|
|
45
|
-
inset: {
|
|
46
|
-
true: 'pl-8',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
export const DropdownMenuLabel = withVariants(DropdownMenuPrimitive.Label, dropdownMenuLabelVariants, ['inset']);
|
|
51
|
-
export const DropdownMenuSeparator = withCn(DropdownMenuPrimitive.Separator, '-mx-1 my-1 h-px bg-muted');
|
|
52
|
-
export const DropdownMenuShortcut = withCn(createPrimitiveElement('span'), 'ml-auto text-xs tracking-widest opacity-60');
|
|
53
|
-
export const useOpenState = () => {
|
|
54
|
-
const [open, setOpen] = useState(false);
|
|
55
|
-
const onOpenChange = useCallback((_value = !open) => {
|
|
56
|
-
setOpen(_value);
|
|
57
|
-
}, [open]);
|
|
58
|
-
return {
|
|
59
|
-
open,
|
|
60
|
-
onOpenChange,
|
|
61
|
-
};
|
|
62
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { cn, withRef } from '@udecode/cn';
|
|
3
|
-
import { PlateElement, withHOC } from '@udecode/plate-common';
|
|
4
|
-
import { ELEMENT_IMAGE, Image, useMediaState } from '@udecode/plate-media';
|
|
5
|
-
import { ResizableProvider } from '@udecode/plate-resizable';
|
|
6
|
-
import { MediaPopover } from './media-popover';
|
|
7
|
-
import { mediaResizeHandleVariants, Resizable, ResizeHandle, } from './resizable';
|
|
8
|
-
import { EditorContext } from '../../context';
|
|
9
|
-
export const ImageElement = withHOC(ResizableProvider, withRef(({ className, children, element, nodeProps, ...props }, ref) => {
|
|
10
|
-
const { imageSrcLoader } = React.useContext(EditorContext);
|
|
11
|
-
const { readOnly, focused, selected, align = 'center' } = useMediaState();
|
|
12
|
-
const { id, url, ...restElement } = element;
|
|
13
|
-
const [src, setSrc] = React.useState(null);
|
|
14
|
-
React.useEffect(() => {
|
|
15
|
-
(async () => {
|
|
16
|
-
if (!id || !imageSrcLoader)
|
|
17
|
-
return;
|
|
18
|
-
const source = await imageSrcLoader(id);
|
|
19
|
-
if (source)
|
|
20
|
-
setSrc(source);
|
|
21
|
-
})();
|
|
22
|
-
}, [id, imageSrcLoader]);
|
|
23
|
-
if (!src && !!url) {
|
|
24
|
-
return (React.createElement(MediaPopover, { pluginKey: ELEMENT_IMAGE },
|
|
25
|
-
React.createElement(PlateElement, { ref: ref, element: element, className: cn('py-2.5', className), ...props },
|
|
26
|
-
React.createElement("figure", { className: "group relative m-0", contentEditable: false },
|
|
27
|
-
React.createElement(Resizable, { align: align, options: {
|
|
28
|
-
align,
|
|
29
|
-
readOnly,
|
|
30
|
-
} },
|
|
31
|
-
React.createElement(ResizeHandle, { options: { direction: 'left' }, className: mediaResizeHandleVariants({ direction: 'left' }) }),
|
|
32
|
-
React.createElement(Image, { className: cn('block w-full max-w-full cursor-pointer object-cover px-0', 'rounded-sm', focused && selected && 'ring-2 ring-ring ring-offset-2'), alt: "", ...nodeProps }),
|
|
33
|
-
React.createElement(ResizeHandle, { options: { direction: 'right' }, className: mediaResizeHandleVariants({
|
|
34
|
-
direction: 'right',
|
|
35
|
-
}) }))),
|
|
36
|
-
children)));
|
|
37
|
-
}
|
|
38
|
-
return (React.createElement(MediaPopover, { pluginKey: ELEMENT_IMAGE },
|
|
39
|
-
React.createElement(PlateElement, { ref: ref, className: cn('py-2.5', className), element: restElement, ...props },
|
|
40
|
-
!src ? null : (React.createElement("figure", { className: "group relative m-0", contentEditable: false },
|
|
41
|
-
React.createElement(Resizable, { align: align, options: {
|
|
42
|
-
align,
|
|
43
|
-
readOnly,
|
|
44
|
-
} },
|
|
45
|
-
React.createElement(ResizeHandle, { options: { direction: 'left' }, className: mediaResizeHandleVariants({ direction: 'left' }) }),
|
|
46
|
-
React.createElement(Image, { className: cn('block w-full max-w-full cursor-pointer object-cover px-0', 'rounded-sm', focused && selected && 'ring-2 ring-ring ring-offset-2'), alt: "", ...nodeProps, src: src }),
|
|
47
|
-
React.createElement(ResizeHandle, { options: { direction: 'right' }, className: mediaResizeHandleVariants({
|
|
48
|
-
direction: 'right',
|
|
49
|
-
}) })))),
|
|
50
|
-
children)));
|
|
51
|
-
}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { blocks } from './blocks';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PlateElement } from '@udecode/plate';
|
|
3
|
-
import { styled } from 'styled-components';
|
|
4
|
-
export const ListElement = ({ children, variant = 'ul', ...props }) => {
|
|
5
|
-
const Element = variant;
|
|
6
|
-
return (React.createElement(PlateElement, { asChild: true, ...props },
|
|
7
|
-
React.createElement(React.Fragment, null,
|
|
8
|
-
React.createElement(Element, null, React.Children.map(children, (child) => (React.createElement(Li, null, child)))))));
|
|
9
|
-
};
|
|
10
|
-
const Li = styled.li `
|
|
11
|
-
margin: 16px 0px;
|
|
12
|
-
padding-left: 8px;
|
|
13
|
-
|
|
14
|
-
&::marker {
|
|
15
|
-
color: var(--color-grey-4);
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
|
-
import { isSelectionExpanded, useEditorSelector, useElement, useRemoveNodeButton, } from '@udecode/plate-common';
|
|
3
|
-
import { floatingMediaActions, useFloatingMediaSelectors, } from '@udecode/plate-media';
|
|
4
|
-
import { useReadOnly, useSelected } from 'slate-react';
|
|
5
|
-
import { Button } from './plate-button';
|
|
6
|
-
import { Popover, PopoverAnchor, PopoverContent } from './popover';
|
|
7
|
-
import { Link, Trash } from 'lucide-react';
|
|
8
|
-
export function MediaPopover({ children }) {
|
|
9
|
-
const readOnly = useReadOnly();
|
|
10
|
-
const selected = useSelected();
|
|
11
|
-
const selectionCollapsed = useEditorSelector((editor) => !isSelectionExpanded(editor), []);
|
|
12
|
-
const isOpen = !readOnly && selected && selectionCollapsed;
|
|
13
|
-
const isEditing = useFloatingMediaSelectors().isEditing();
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
if (!isOpen && isEditing) {
|
|
16
|
-
floatingMediaActions.isEditing(false);
|
|
17
|
-
}
|
|
18
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
|
-
}, [isOpen]);
|
|
20
|
-
const element = useElement();
|
|
21
|
-
const { props: buttonProps } = useRemoveNodeButton({ element });
|
|
22
|
-
if (readOnly)
|
|
23
|
-
return React.createElement(React.Fragment, null, children);
|
|
24
|
-
return (React.createElement(Popover, { open: isOpen, modal: false },
|
|
25
|
-
React.createElement(PopoverAnchor, null, children),
|
|
26
|
-
React.createElement(PopoverContent, { className: "w-auto p-1", onOpenAutoFocus: (e) => e.preventDefault() }, isEditing ? (React.createElement("div", { className: "flex w-[330px] flex-col" },
|
|
27
|
-
React.createElement("div", { className: "flex items-center" },
|
|
28
|
-
React.createElement("div", { className: "flex items-center pl-3 text-muted-foreground" },
|
|
29
|
-
React.createElement(Link, { className: "h-4 w-4" }))))) : (React.createElement("div", { className: "box-content flex h-9 items-center gap-1" },
|
|
30
|
-
React.createElement(Button, { variant: "ghost", size: "sms", ...buttonProps },
|
|
31
|
-
React.createElement(Trash, { className: "h-4 w-4" })))))));
|
|
32
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
import { cn, withRef } from '@udecode/cn';
|
|
4
|
-
import { cva } from 'class-variance-authority';
|
|
5
|
-
export const buttonVariants = cva('inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', {
|
|
6
|
-
variants: {
|
|
7
|
-
variant: {
|
|
8
|
-
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
9
|
-
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
|
|
10
|
-
outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
|
|
11
|
-
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
12
|
-
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
13
|
-
link: 'text-primary underline-offset-4 hover:underline',
|
|
14
|
-
inlineLink: 'text-base text-primary underline underline-offset-4',
|
|
15
|
-
},
|
|
16
|
-
size: {
|
|
17
|
-
default: 'h-10 px-4 py-2',
|
|
18
|
-
xs: 'h-8 rounded-md px-3',
|
|
19
|
-
sm: 'h-9 rounded-md px-3',
|
|
20
|
-
sms: 'h-9 w-9 rounded-md px-0',
|
|
21
|
-
lg: 'h-11 rounded-md px-8',
|
|
22
|
-
icon: 'h-10 w-10',
|
|
23
|
-
none: '',
|
|
24
|
-
},
|
|
25
|
-
isMenu: {
|
|
26
|
-
true: 'h-auto w-full cursor-pointer justify-start',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
defaultVariants: {
|
|
30
|
-
variant: 'default',
|
|
31
|
-
size: 'default',
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
export const Button = withRef(({ className, isMenu, variant, size, asChild = false, ...props }, ref) => {
|
|
35
|
-
const Comp = asChild ? Slot : 'button';
|
|
36
|
-
return (React.createElement(Comp, { className: cn(buttonVariants({ isMenu, variant, size, className })), ref: ref, ...props }));
|
|
37
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
4
|
-
import { cn, withRef } from '@udecode/cn';
|
|
5
|
-
import { cva } from 'class-variance-authority';
|
|
6
|
-
export const Popover = PopoverPrimitive.Root;
|
|
7
|
-
export const PopoverTrigger = PopoverPrimitive.Trigger;
|
|
8
|
-
export const PopoverAnchor = PopoverPrimitive.Anchor;
|
|
9
|
-
export const popoverVariants = cva('w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 print:hidden');
|
|
10
|
-
export const PopoverContent = withRef(({ className, style, align = 'center', sideOffset = 4, ...props }, ref) => (React.createElement(PopoverPrimitive.Portal, null,
|
|
11
|
-
React.createElement(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, className: cn(popoverVariants(), className), style: { zIndex: 1000, ...style }, ...props }))));
|