@soul-refiner/design-system 2.0.1-alpha.1 → 2.0.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.js +140 -1
- package/dist/common/date.js +34 -1
- package/dist/common/styles.js +62 -30
- package/dist/components/actions/button/button.js +111 -21
- package/dist/components/actions/dropdown/dropdown.js +176 -21
- package/dist/components/actions/rate/rate.js +55 -4
- package/dist/components/actions/switch/switch.js +39 -5
- package/dist/components/actions/toggle/toggle.js +33 -6
- package/dist/components/actions/upload/upload.js +167 -9
- package/dist/components/atoms/box/box.js +18 -4
- package/dist/components/atoms/hide/hide.js +18 -1
- package/dist/components/atoms/seconds_to_duration/seconds_to_duration.js +36 -1
- package/dist/components/atoms/time_ago/time_ago.js +39 -1
- package/dist/components/atoms/typography/display.js +18 -5
- package/dist/components/atoms/typography/heading.js +43 -6
- package/dist/components/atoms/typography/paragraph.js +20 -7
- package/dist/components/atoms/typography/typography.js +10 -3
- package/dist/components/card/action/action.js +41 -8
- package/dist/components/card/audio/audio.js +57 -7
- package/dist/components/card/card.js +33 -1
- package/dist/components/card/feature/feature.js +86 -14
- package/dist/components/card/meeting/meeting.js +102 -8
- package/dist/components/card/person/person.js +39 -6
- package/dist/components/card/price/price.js +49 -7
- package/dist/components/card/regular/regular.js +26 -5
- package/dist/components/card/styles.js +9 -2
- package/dist/components/card/video/video.js +57 -7
- package/dist/components/card/written/written.js +57 -7
- package/dist/components/custom/courses_selection/courses_selection.js +104 -12
- package/dist/components/custom/users_selection/users_selection.js +86 -12
- package/dist/components/editor/constants.js +195 -1
- package/dist/components/editor/context.js +17 -1
- package/dist/components/editor/editor.js +45 -5
- package/dist/components/editor/icons/border-all.js +12 -1
- package/dist/components/editor/icons/border-bottom.js +12 -1
- package/dist/components/editor/icons/border-left.js +12 -1
- package/dist/components/editor/icons/border-none.js +12 -1
- package/dist/components/editor/icons/border-right.js +12 -1
- package/dist/components/editor/icons/border-top.js +12 -1
- package/dist/components/editor/navbar/alignment_dropdown.js +106 -1
- package/dist/components/editor/navbar/button_modal.js +60 -3
- package/dist/components/editor/navbar/navbar.js +178 -7
- package/dist/components/editor/navbar/style_dropdown.js +74 -1
- package/dist/components/editor/plugins/blocks/blockquote.js +17 -1
- package/dist/components/editor/plugins/blocks/blocks.js +54 -1
- package/dist/components/editor/plugins/blocks/buttons.js +70 -8
- package/dist/components/editor/plugins/blocks/dropdown-menu.js +77 -1
- package/dist/components/editor/plugins/blocks/image.js +60 -1
- package/dist/components/editor/plugins/blocks/list.js +20 -2
- package/dist/components/editor/plugins/blocks/media-popover.js +41 -1
- package/dist/components/editor/plugins/blocks/plate-button.js +63 -1
- package/dist/components/editor/plugins/blocks/popover.js +38 -1
- package/dist/components/editor/plugins/blocks/qa.js +44 -3
- package/dist/components/editor/plugins/blocks/resizable.js +47 -1
- package/dist/components/editor/plugins/blocks/separator.js +43 -1
- package/dist/components/editor/plugins/blocks/table-cell.js +48 -1
- package/dist/components/editor/plugins/blocks/table-row.js +16 -1
- package/dist/components/editor/plugins/blocks/table.js +98 -1
- package/dist/components/editor/plugins/blocks/text.js +103 -1
- package/dist/components/editor/plugins/blocks/video.js +42 -1
- package/dist/components/editor/plugins/leafs/leafs.js +37 -1
- package/dist/components/editor/plugins/leafs/link.js +55 -4
- package/dist/components/editor/plugins/marks/marks.js +17 -1
- package/dist/components/editor/plugins/plate.js +43 -1
- package/dist/components/editor/plugins/utils/exitBreak.js +36 -1
- package/dist/components/editor/plugins/utils/resetBlockType.js +26 -1
- package/dist/components/editor/plugins/utils/selectOnBackspace.js +11 -1
- package/dist/components/editor/plugins/utils/softBreak.js +19 -1
- package/dist/components/editor/plugins/utils/utils.js +17 -1
- package/dist/components/editor/simple_editor/navbar.js +110 -4
- package/dist/components/editor/simple_editor/plugins.js +93 -1
- package/dist/components/editor/simple_editor/simple_editor.js +34 -3
- package/dist/components/editor/styles/menu_button.js +9 -3
- package/dist/components/feedback/animated_toast/animated_toast.js +32 -3
- package/dist/components/feedback/badge/badge.js +56 -7
- package/dist/components/feedback/banner/banner.js +60 -6
- package/dist/components/feedback/chip/chip.js +81 -8
- package/dist/components/feedback/loader/loader.js +33 -9
- package/dist/components/feedback/notification/notification.js +59 -6
- package/dist/components/feedback/progress/progress.js +76 -14
- package/dist/components/feedback/toast/toast.js +55 -7
- package/dist/components/feedback/tooltip/tooltip.js +34 -1
- package/dist/components/iconography/avatar/avatar.js +141 -22
- package/dist/components/iconography/avatar/icons/approved.js +14 -1
- package/dist/components/iconography/avatar/icons/busy.js +14 -1
- package/dist/components/iconography/avatar/icons/declined.js +14 -1
- package/dist/components/iconography/avatar/icons/default.js +13 -1
- package/dist/components/iconography/avatar/icons/focus.js +14 -1
- package/dist/components/iconography/avatar/icons/locked.js +14 -1
- package/dist/components/iconography/avatar/icons/offline.js +14 -1
- package/dist/components/iconography/avatar/icons/online.js +13 -1
- package/dist/components/iconography/avatar/icons/subscribed.js +18 -1
- package/dist/components/iconography/icon/icon.js +18 -3
- package/dist/components/input/calendar/calendar.js +139 -13
- package/dist/components/input/checkbox/checkbox.js +23 -5
- package/dist/components/input/date/date.js +241 -13
- package/dist/components/input/filter/filter.js +212 -13
- package/dist/components/input/filter/filter_option.js +50 -9
- package/dist/components/input/radio/radio.js +45 -7
- package/dist/components/input/search/search.js +83 -17
- package/dist/components/input/select/select.js +27 -6
- package/dist/components/input/text_area/text_area.js +60 -15
- package/dist/components/input/text_input/text_input.js +102 -21
- package/dist/components/input/time/time.js +47 -3
- package/dist/components/media/video/video.js +42 -1
- package/dist/components/media/video-player/playlist-item.js +37 -4
- package/dist/components/media/video-player/video.js +121 -13
- package/dist/components/navigation/breadcrumb/breadcrumb.js +66 -11
- package/dist/components/navigation/inner/inner.js +130 -14
- package/dist/components/navigation/tabs/tabs.js +101 -15
- package/dist/components/surfaces/accordion/accordion.js +46 -5
- package/dist/components/surfaces/calendar_date/calendar_date.js +39 -10
- package/dist/components/surfaces/carousel/card/card.js +55 -7
- package/dist/components/surfaces/comment/comment.js +152 -19
- package/dist/components/surfaces/comment/helpers.js +30 -1
- package/dist/components/surfaces/drawer/drawer.js +75 -7
- package/dist/components/surfaces/message/message.js +39 -4
- package/dist/components/surfaces/modal/modal.js +99 -8
- package/dist/components/surfaces/portal/portal.js +35 -1
- package/dist/components/surfaces/post/post.js +161 -19
- package/dist/components/table/table/table.js +120 -29
- package/dist/emoji/emojis.json.js +36331 -1
- package/dist/icons/arrow/arrow_all.js +15 -1
- package/dist/icons/arrow/arrow_all_diagonal.js +15 -1
- package/dist/icons/arrow/arrow_both_downwards.js +15 -1
- package/dist/icons/arrow/arrow_both_upwards.js +15 -1
- package/dist/icons/arrow/arrow_circle_left.js +15 -1
- package/dist/icons/arrow/arrow_circle_left_double.js +15 -1
- package/dist/icons/arrow/arrow_circle_left_double_alert.js +17 -1
- package/dist/icons/arrow/arrow_circle_right.js +15 -1
- package/dist/icons/arrow/arrow_circle_right_double.js +15 -1
- package/dist/icons/arrow/arrow_circle_right_double_alert.js +15 -1
- package/dist/icons/arrow/arrow_diagonal_down_left.js +15 -1
- package/dist/icons/arrow/arrow_diagonal_down_left_circle.js +15 -1
- package/dist/icons/arrow/arrow_diagonal_down_right.js +15 -1
- package/dist/icons/arrow/arrow_diagonal_down_right_circle.js +15 -1
- package/dist/icons/arrow/arrow_diagonal_up_left.js +15 -1
- package/dist/icons/arrow/arrow_diagonal_up_left_circle.js +15 -1
- package/dist/icons/arrow/arrow_diagonal_up_right.js +15 -1
- package/dist/icons/arrow/arrow_diagonal_up_right_circle.js +15 -1
- package/dist/icons/arrow/arrow_down.js +15 -1
- package/dist/icons/arrow/arrow_down_bold.js +15 -1
- package/dist/icons/arrow/arrow_down_circle.js +15 -1
- package/dist/icons/arrow/arrow_left.js +15 -1
- package/dist/icons/arrow/arrow_left_bold.js +15 -1
- package/dist/icons/arrow/arrow_left_circle.js +15 -1
- package/dist/icons/arrow/arrow_left_curved.js +15 -1
- package/dist/icons/arrow/arrow_left_curved_circle.js +15 -1
- package/dist/icons/arrow/arrow_right.js +15 -1
- package/dist/icons/arrow/arrow_right_bold.js +15 -1
- package/dist/icons/arrow/arrow_right_circle.js +15 -1
- package/dist/icons/arrow/arrow_right_curved.js +15 -1
- package/dist/icons/arrow/arrow_right_curved_circle.js +15 -1
- package/dist/icons/arrow/arrow_up.js +15 -1
- package/dist/icons/arrow/arrow_up_bold.js +15 -1
- package/dist/icons/arrow/arrow_up_circle.js +15 -1
- package/dist/icons/arrow/chevron_down.js +15 -1
- package/dist/icons/arrow/chevron_down_circle.js +15 -1
- package/dist/icons/arrow/chevron_down_double.js +15 -1
- package/dist/icons/arrow/chevron_down_double_circle.js +15 -1
- package/dist/icons/arrow/chevron_left.js +15 -1
- package/dist/icons/arrow/chevron_left_circle.js +15 -1
- package/dist/icons/arrow/chevron_left_double.js +15 -1
- package/dist/icons/arrow/chevron_left_double_circle.js +15 -1
- package/dist/icons/arrow/chevron_right.js +15 -1
- package/dist/icons/arrow/chevron_right_circle.js +15 -1
- package/dist/icons/arrow/chevron_right_double.js +15 -1
- package/dist/icons/arrow/chevron_right_double_circle.js +15 -1
- package/dist/icons/arrow/chevron_scroll.js +15 -1
- package/dist/icons/arrow/chevron_up.js +15 -1
- package/dist/icons/arrow/chevron_up_circle.js +15 -1
- package/dist/icons/arrow/chevron_up_double.js +15 -1
- package/dist/icons/arrow/chevron_up_double_circle.js +15 -1
- package/dist/icons/arrow/forward_all.js +15 -1
- package/dist/icons/arrow/forward_all_bold.js +15 -1
- package/dist/icons/arrow/forward_bold.js +15 -1
- package/dist/icons/arrow/redo.js +15 -1
- package/dist/icons/arrow/redo_bold.js +15 -1
- package/dist/icons/arrow/reply.js +15 -1
- package/dist/icons/arrow/reply_all.js +15 -1
- package/dist/icons/arrow/reply_all_bold.js +15 -1
- package/dist/icons/arrow/reply_bold.js +15 -1
- package/dist/icons/arrow/undo.js +15 -1
- package/dist/icons/arrow/undo_bold.js +15 -1
- package/dist/icons/audio_video/drag_indicator.js +15 -1
- package/dist/icons/audio_video/eject.js +15 -1
- package/dist/icons/audio_video/equalizer.js +15 -1
- package/dist/icons/audio_video/fast_forward.js +15 -1
- package/dist/icons/audio_video/fast_forward_30.js +15 -1
- package/dist/icons/audio_video/fullscreen.js +15 -1
- package/dist/icons/audio_video/headphones.js +15 -1
- package/dist/icons/audio_video/library_add.js +15 -1
- package/dist/icons/audio_video/library_music.js +15 -1
- package/dist/icons/audio_video/microphone.js +15 -1
- package/dist/icons/audio_video/musical_note.js +15 -1
- package/dist/icons/audio_video/next.js +15 -1
- package/dist/icons/audio_video/pause.js +15 -1
- package/dist/icons/audio_video/pause_circle.js +15 -1
- package/dist/icons/audio_video/play.js +15 -1
- package/dist/icons/audio_video/play_circle.js +15 -1
- package/dist/icons/audio_video/play_display.js +15 -1
- package/dist/icons/audio_video/play_pause.js +15 -1
- package/dist/icons/audio_video/play_solid.js +15 -1
- package/dist/icons/audio_video/player_list.js +15 -1
- package/dist/icons/audio_video/player_list_add.js +15 -1
- package/dist/icons/audio_video/player_list_play.js +15 -1
- package/dist/icons/audio_video/previous.js +15 -1
- package/dist/icons/audio_video/radio.js +15 -1
- package/dist/icons/audio_video/record.js +15 -1
- package/dist/icons/audio_video/repeat.js +15 -1
- package/dist/icons/audio_video/rewind.js +15 -1
- package/dist/icons/audio_video/rewind_30.js +15 -1
- package/dist/icons/audio_video/shuffle.js +15 -1
- package/dist/icons/audio_video/sound_wave.js +15 -1
- package/dist/icons/audio_video/stop.js +15 -1
- package/dist/icons/audio_video/stop_circle.js +15 -1
- package/dist/icons/audio_video/subscriptions.js +15 -1
- package/dist/icons/audio_video/tuner.js +15 -1
- package/dist/icons/audio_video/volume.js +15 -1
- package/dist/icons/audio_video/volume_high.js +15 -1
- package/dist/icons/audio_video/volume_low.js +15 -1
- package/dist/icons/audio_video/volume_slash.js +15 -1
- package/dist/icons/basic/aa_sansserif.js +16 -1
- package/dist/icons/basic/aa_serif.js +16 -1
- package/dist/icons/basic/anchor.js +17 -1
- package/dist/icons/basic/bible.js +15 -1
- package/dist/icons/basic/bold.js +15 -1
- package/dist/icons/basic/book.js +15 -1
- package/dist/icons/basic/book_open.js +15 -1
- package/dist/icons/basic/bookmark.js +15 -1
- package/dist/icons/basic/bookmark_add.js +15 -1
- package/dist/icons/basic/bookmark_slash.js +15 -1
- package/dist/icons/basic/bookmarks.js +15 -1
- package/dist/icons/basic/books.js +18 -1
- package/dist/icons/basic/box.js +15 -1
- package/dist/icons/basic/briefcase.js +15 -1
- package/dist/icons/basic/browse_activity.js +15 -1
- package/dist/icons/basic/browser.js +15 -1
- package/dist/icons/basic/browser_slash.js +15 -1
- package/dist/icons/basic/calculator.js +15 -1
- package/dist/icons/basic/camera.js +15 -1
- package/dist/icons/basic/camera_add.js +15 -1
- package/dist/icons/basic/camera_slash.js +15 -1
- package/dist/icons/basic/checkmark.js +15 -1
- package/dist/icons/basic/checkmark_circle.js +17 -1
- package/dist/icons/basic/checkmark_filled.js +15 -1
- package/dist/icons/basic/checkmarks.js +15 -1
- package/dist/icons/basic/circle.js +15 -1
- package/dist/icons/basic/circle_slash.js +17 -1
- package/dist/icons/basic/clear_text_style.js +15 -1
- package/dist/icons/basic/close.js +15 -1
- package/dist/icons/basic/close_circle.js +15 -1
- package/dist/icons/basic/close_filled.js +15 -1
- package/dist/icons/basic/copy.js +15 -1
- package/dist/icons/basic/delete.js +15 -1
- package/dist/icons/basic/detail.js +15 -1
- package/dist/icons/basic/dot.js +15 -1
- package/dist/icons/basic/download.js +15 -1
- package/dist/icons/basic/download_arrow.js +15 -1
- package/dist/icons/basic/droplet.js +17 -1
- package/dist/icons/basic/ellipsis_horizontal.js +15 -1
- package/dist/icons/basic/ellipsis_horizontal_circle.js +15 -1
- package/dist/icons/basic/ellipsis_vertical.js +15 -1
- package/dist/icons/basic/ellipsis_vertical_circle.js +15 -1
- package/dist/icons/basic/eye.js +15 -1
- package/dist/icons/basic/eye_slash.js +15 -1
- package/dist/icons/basic/fingerprint.js +15 -1
- package/dist/icons/basic/flag.js +15 -1
- package/dist/icons/basic/flag_wave.js +15 -1
- package/dist/icons/basic/flag_wave_filled.js +15 -1
- package/dist/icons/basic/flame.js +15 -1
- package/dist/icons/basic/gauge.js +15 -1
- package/dist/icons/basic/glasses.js +15 -1
- package/dist/icons/basic/graduation_cap.js +15 -1
- package/dist/icons/basic/hashmark.js +15 -1
- package/dist/icons/basic/heart.js +15 -1
- package/dist/icons/basic/heart_slash.js +15 -1
- package/dist/icons/basic/highlighter.js +15 -1
- package/dist/icons/basic/home.js +15 -1
- package/dist/icons/basic/image.js +15 -1
- package/dist/icons/basic/inbox.js +15 -1
- package/dist/icons/basic/italic.js +15 -1
- package/dist/icons/basic/layers.js +15 -1
- package/dist/icons/basic/lightening.js +15 -1
- package/dist/icons/basic/lightening_slash.js +15 -1
- package/dist/icons/basic/link.js +15 -1
- package/dist/icons/basic/link_slash.js +15 -1
- package/dist/icons/basic/loudspeaker.js +15 -1
- package/dist/icons/basic/maximize.js +15 -1
- package/dist/icons/basic/menu.js +15 -1
- package/dist/icons/basic/menu_circle.js +15 -1
- package/dist/icons/basic/menu_dots.js +15 -1
- package/dist/icons/basic/microphone_slash.js +15 -1
- package/dist/icons/basic/minimize.js +15 -1
- package/dist/icons/basic/minus.js +15 -1
- package/dist/icons/basic/minus_circle.js +15 -1
- package/dist/icons/basic/move_item.js +15 -1
- package/dist/icons/basic/new.js +15 -1
- package/dist/icons/basic/newspaper.js +15 -1
- package/dist/icons/basic/node.js +15 -1
- package/dist/icons/basic/note_pad.js +16 -1
- package/dist/icons/basic/options.js +15 -1
- package/dist/icons/basic/paint_brush.js +15 -1
- package/dist/icons/basic/paperclip.js +15 -1
- package/dist/icons/basic/paperclip_slash.js +15 -1
- package/dist/icons/basic/pencil.js +15 -1
- package/dist/icons/basic/pencil_pad.js +15 -1
- package/dist/icons/basic/plus.js +15 -1
- package/dist/icons/basic/plus_circle.js +15 -1
- package/dist/icons/basic/presentation.js +15 -1
- package/dist/icons/basic/printer.js +15 -1
- package/dist/icons/basic/profile.js +15 -1
- package/dist/icons/basic/profile_check.js +15 -1
- package/dist/icons/basic/pulse.js +15 -1
- package/dist/icons/basic/qr_code.js +15 -1
- package/dist/icons/basic/resize.js +17 -1
- package/dist/icons/basic/scan.js +15 -1
- package/dist/icons/basic/scissors.js +15 -1
- package/dist/icons/basic/screenshot.js +15 -1
- package/dist/icons/basic/search.js +15 -1
- package/dist/icons/basic/select_item.js +16 -1
- package/dist/icons/basic/settings.js +15 -1
- package/dist/icons/basic/share.js +15 -1
- package/dist/icons/basic/share_external.js +15 -1
- package/dist/icons/basic/square.js +15 -1
- package/dist/icons/basic/star.js +15 -1
- package/dist/icons/basic/star_circle.js +15 -1
- package/dist/icons/basic/star_filled.js +15 -1
- package/dist/icons/basic/star_filled_half.js +15 -1
- package/dist/icons/basic/star_slash.js +15 -1
- package/dist/icons/basic/sticker.js +15 -1
- package/dist/icons/basic/strikethrough.js +15 -1
- package/dist/icons/basic/subtask.js +16 -1
- package/dist/icons/basic/tax.js +18 -1
- package/dist/icons/basic/text_bg_color.js +15 -1
- package/dist/icons/basic/text_color.js +15 -1
- package/dist/icons/basic/textbox.js +15 -1
- package/dist/icons/basic/thumbs_down.js +15 -1
- package/dist/icons/basic/thumbs_up.js +15 -1
- package/dist/icons/basic/thumbs_up_filled.js +15 -1
- package/dist/icons/basic/toggle_left.js +15 -1
- package/dist/icons/basic/toggle_right.js +15 -1
- package/dist/icons/basic/translate.js +15 -1
- package/dist/icons/basic/trash.js +15 -1
- package/dist/icons/basic/trash_slash.js +15 -1
- package/dist/icons/basic/underline.js +15 -1
- package/dist/icons/basic/upload.js +15 -1
- package/dist/icons/basic/video.js +15 -1
- package/dist/icons/basic/video_add.js +16 -1
- package/dist/icons/basic/video_slash.js +15 -1
- package/dist/icons/basic/wrench.js +15 -1
- package/dist/icons/basic/zoom_in.js +15 -1
- package/dist/icons/basic/zoom_out.js +15 -1
- package/dist/icons/data/bar_chart.js +15 -1
- package/dist/icons/data/bar_chart_downward.js +15 -1
- package/dist/icons/data/bar_chart_downward_outline.js +15 -1
- package/dist/icons/data/bar_chart_upward.js +15 -1
- package/dist/icons/data/bar_chart_upward_outline.js +15 -1
- package/dist/icons/data/candlestick_chart.js +15 -1
- package/dist/icons/data/four_circles.js +15 -1
- package/dist/icons/data/legend_toggle.js +15 -1
- package/dist/icons/data/line_chart.js +15 -1
- package/dist/icons/data/line_chart_area.js +15 -1
- package/dist/icons/data/line_chart_area_shaded.js +15 -1
- package/dist/icons/data/line_chart_double.js +15 -1
- package/dist/icons/data/line_chart_downward.js +15 -1
- package/dist/icons/data/line_chart_node.js +15 -1
- package/dist/icons/data/line_chart_outline.js +15 -1
- package/dist/icons/data/line_chart_search.js +15 -1
- package/dist/icons/data/line_chart_stars.js +15 -1
- package/dist/icons/data/line_chart_upward.js +15 -1
- package/dist/icons/data/pie_chart.js +16 -1
- package/dist/icons/data/tree.js +15 -1
- package/dist/icons/email/mail.js +15 -1
- package/dist/icons/email/mail_check.js +15 -1
- package/dist/icons/email/mail_minus.js +15 -1
- package/dist/icons/email/mail_send.js +15 -1
- package/dist/icons/email/send.js +15 -1
- package/dist/icons/email/send_close.js +15 -1
- package/dist/icons/email/send_schedule.js +15 -1
- package/dist/icons/email/send_text.js +15 -1
- package/dist/icons/emoji/emoji_add.js +15 -1
- package/dist/icons/emoji/laughing.js +15 -1
- package/dist/icons/emoji/neutral.js +15 -1
- package/dist/icons/emoji/sad.js +15 -1
- package/dist/icons/emoji/shocked.js +15 -1
- package/dist/icons/emoji/smile.js +15 -1
- package/dist/icons/file/clipboard.js +15 -1
- package/dist/icons/file/clipboard_check.js +15 -1
- package/dist/icons/file/clipboard_close.js +15 -1
- package/dist/icons/file/clipboard_minus.js +15 -1
- package/dist/icons/file/clipboard_plus.js +15 -1
- package/dist/icons/file/clipboard_text.js +15 -1
- package/dist/icons/file/file.js +15 -1
- package/dist/icons/file/file_add.js +15 -1
- package/dist/icons/file/file_check.js +15 -1
- package/dist/icons/file/file_close.js +15 -1
- package/dist/icons/file/file_code.js +15 -1
- package/dist/icons/file/file_download.js +15 -1
- package/dist/icons/file/file_draft.js +15 -1
- package/dist/icons/file/file_gear.js +16 -1
- package/dist/icons/file/file_minus.js +15 -1
- package/dist/icons/file/file_plus.js +15 -1
- package/dist/icons/file/file_scan.js +15 -1
- package/dist/icons/file/file_shred.js +15 -1
- package/dist/icons/file/file_text.js +15 -1
- package/dist/icons/file/file_upload.js +15 -1
- package/dist/icons/file/folder.js +15 -1
- package/dist/icons/file/folder_add.js +15 -1
- package/dist/icons/file/folder_arrow.js +15 -1
- package/dist/icons/file/folder_check.js +15 -1
- package/dist/icons/file/folder_close.js +15 -1
- package/dist/icons/file/folder_cloud.js +15 -1
- package/dist/icons/file/folder_gear.js +16 -1
- package/dist/icons/file/folder_minus.js +15 -1
- package/dist/icons/file/folder_music.js +15 -1
- package/dist/icons/file/folder_open.js +15 -1
- package/dist/icons/file/folder_plus.js +15 -1
- package/dist/icons/file/folder_zip.js +15 -1
- package/dist/icons/file/note.js +15 -1
- package/dist/icons/file/note_text.js +15 -1
- package/dist/icons/file/pdf.js +15 -1
- package/dist/icons/file/photo.js +15 -1
- package/dist/icons/finance/bitcoin.js +15 -1
- package/dist/icons/finance/coins.js +19 -1
- package/dist/icons/finance/credit_card.js +15 -1
- package/dist/icons/finance/credit_card_add.js +15 -1
- package/dist/icons/finance/credit_card_face.js +15 -1
- package/dist/icons/finance/credit_card_member.js +15 -1
- package/dist/icons/finance/credit_card_outcome.js +15 -1
- package/dist/icons/finance/credit_card_scan.js +15 -1
- package/dist/icons/finance/credit_card_share.js +15 -1
- package/dist/icons/finance/credit_card_slash.js +15 -1
- package/dist/icons/finance/currency_exchange.js +15 -1
- package/dist/icons/finance/dollar.js +15 -1
- package/dist/icons/finance/ethereum.js +15 -1
- package/dist/icons/finance/paypass.js +15 -1
- package/dist/icons/finance/strongbox.js +15 -1
- package/dist/icons/finance/wallet.js +15 -1
- package/dist/icons/index.js +1095 -1
- package/dist/icons/layout/block_align_bottom.js +15 -1
- package/dist/icons/layout/block_align_center.js +15 -1
- package/dist/icons/layout/block_align_left.js +15 -1
- package/dist/icons/layout/block_align_middle.js +15 -1
- package/dist/icons/layout/block_align_right.js +15 -1
- package/dist/icons/layout/block_align_top.js +15 -1
- package/dist/icons/layout/block_horizontal.js +15 -1
- package/dist/icons/layout/block_vertical.js +15 -1
- package/dist/icons/layout/edit_shape.js +15 -1
- package/dist/icons/layout/elements.js +15 -1
- package/dist/icons/layout/elements_add.js +15 -1
- package/dist/icons/layout/elements_filled.js +15 -1
- package/dist/icons/layout/elements_masonry.js +15 -1
- package/dist/icons/layout/frame.js +15 -1
- package/dist/icons/layout/frame_stack.js +15 -1
- package/dist/icons/layout/grid.js +15 -1
- package/dist/icons/layout/grid_column_three.js +15 -1
- package/dist/icons/layout/grid_column_two.js +15 -1
- package/dist/icons/layout/grid_dynamic.js +15 -1
- package/dist/icons/layout/grid_frame.js +15 -1
- package/dist/icons/layout/grid_row_three.js +15 -1
- package/dist/icons/layout/grid_row_two.js +15 -1
- package/dist/icons/layout/grid_six.js +15 -1
- package/dist/icons/layout/grid_small.js +15 -1
- package/dist/icons/layout/iframe.js +15 -1
- package/dist/icons/layout/kanban.js +15 -1
- package/dist/icons/layout/layout.js +15 -1
- package/dist/icons/layout/list.js +15 -1
- package/dist/icons/layout/list_filled.js +20 -1
- package/dist/icons/layout/padding.js +15 -1
- package/dist/icons/layout/page_break.js +15 -1
- package/dist/icons/layout/rotate_left.js +15 -1
- package/dist/icons/layout/rotate_right.js +15 -1
- package/dist/icons/layout/ruler.js +15 -1
- package/dist/icons/layout/segment.js +15 -1
- package/dist/icons/layout/select_area.js +15 -1
- package/dist/icons/layout/select_boundary.js +15 -1
- package/dist/icons/layout/sidebar_left.js +15 -1
- package/dist/icons/layout/sidebar_right.js +15 -1
- package/dist/icons/layout/slides.js +15 -1
- package/dist/icons/layout/slides_horizontal.js +15 -1
- package/dist/icons/layout/slides_vertical.js +20 -1
- package/dist/icons/layout/stack.js +15 -1
- package/dist/icons/layout/text.js +15 -1
- package/dist/icons/maps/atlas.js +15 -1
- package/dist/icons/maps/compass.js +15 -1
- package/dist/icons/maps/direction.js +15 -1
- package/dist/icons/maps/direction_angled.js +15 -1
- package/dist/icons/maps/globe.js +15 -1
- package/dist/icons/maps/globe_slash.js +15 -1
- package/dist/icons/maps/location.js +15 -1
- package/dist/icons/maps/location_slash.js +15 -1
- package/dist/icons/maps/map.js +15 -1
- package/dist/icons/maps/marker.js +15 -1
- package/dist/icons/maps/panorama.js +15 -1
- package/dist/icons/maps/pin.js +15 -1
- package/dist/icons/maps/pin_arrow.js +15 -1
- package/dist/icons/maps/pin_location.js +15 -1
- package/dist/icons/maps/pin_plus.js +15 -1
- package/dist/icons/maps/pin_question.js +15 -1
- package/dist/icons/maps/pin_slash.js +15 -1
- package/dist/icons/maps/push_pin.js +15 -1
- package/dist/icons/maps/push_pin_filled.js +15 -1
- package/dist/icons/maps/push_pin_slash.js +15 -1
- package/dist/icons/maps/radar.js +15 -1
- package/dist/icons/maps/route.js +15 -1
- package/dist/icons/message/bubble.js +15 -1
- package/dist/icons/message/bubble_question.js +15 -1
- package/dist/icons/message/comment.js +15 -1
- package/dist/icons/message/comment_add.js +15 -1
- package/dist/icons/message/comment_check.js +15 -1
- package/dist/icons/message/comment_close.js +15 -1
- package/dist/icons/message/comment_minus.js +15 -1
- package/dist/icons/message/comment_text.js +15 -1
- package/dist/icons/misc/advertisement.js +15 -1
- package/dist/icons/misc/atom.js +15 -1
- package/dist/icons/misc/bone.js +15 -1
- package/dist/icons/misc/brightness_high.js +15 -1
- package/dist/icons/misc/brightness_low.js +15 -1
- package/dist/icons/misc/contrast.js +15 -1
- package/dist/icons/misc/crosshairs.js +15 -1
- package/dist/icons/misc/crown.js +15 -1
- package/dist/icons/misc/footprint.js +15 -1
- package/dist/icons/misc/form.js +15 -1
- package/dist/icons/misc/funnel.js +15 -1
- package/dist/icons/misc/infinite.js +15 -1
- package/dist/icons/misc/insert_button.js +15 -1
- package/dist/icons/misc/light_bulb.js +15 -1
- package/dist/icons/misc/moon.js +15 -1
- package/dist/icons/misc/nut.js +15 -1
- package/dist/icons/misc/planet.js +15 -1
- package/dist/icons/misc/plus_thick.js +15 -1
- package/dist/icons/misc/pocket.js +15 -1
- package/dist/icons/misc/rocket.js +15 -1
- package/dist/icons/misc/soup.js +19 -1
- package/dist/icons/misc/sun.js +15 -1
- package/dist/icons/misc/toy_horse.js +15 -1
- package/dist/icons/misc/trophy.js +15 -1
- package/dist/icons/misc/watercloset.js +15 -1
- package/dist/icons/notifications/alert_circle.js +15 -1
- package/dist/icons/notifications/alert_octogon.js +15 -1
- package/dist/icons/notifications/alert_triangle.js +15 -1
- package/dist/icons/notifications/app_notification.js +15 -1
- package/dist/icons/notifications/bell.js +15 -1
- package/dist/icons/notifications/bell_alert.js +15 -1
- package/dist/icons/notifications/bell_checkmark.js +15 -1
- package/dist/icons/notifications/bell_minus.js +15 -1
- package/dist/icons/notifications/bell_plus.js +15 -1
- package/dist/icons/notifications/bell_ring.js +17 -1
- package/dist/icons/notifications/bell_slash.js +15 -1
- package/dist/icons/notifications/information.js +15 -1
- package/dist/icons/notifications/minus_octogon.js +15 -1
- package/dist/icons/notifications/question_circle.js +15 -1
- package/dist/icons/people/group.js +15 -1
- package/dist/icons/people/group_add.js +15 -1
- package/dist/icons/people/group_chat.js +17 -1
- package/dist/icons/people/group_remove.js +15 -1
- package/dist/icons/people/group_send.js +16 -1
- package/dist/icons/people/groups.js +15 -1
- package/dist/icons/people/person.js +15 -1
- package/dist/icons/people/person_add.js +15 -1
- package/dist/icons/people/person_checkmark.js +15 -1
- package/dist/icons/people/person_circle.js +17 -1
- package/dist/icons/people/person_close.js +17 -1
- package/dist/icons/people/person_remove.js +15 -1
- package/dist/icons/people/person_slash.js +17 -1
- package/dist/icons/phone/keypad.js +15 -1
- package/dist/icons/phone/phone.js +15 -1
- package/dist/icons/phone/phone_add.js +15 -1
- package/dist/icons/phone/phone_calling.js +15 -1
- package/dist/icons/phone/phone_check.js +15 -1
- package/dist/icons/phone/phone_close.js +15 -1
- package/dist/icons/phone/phone_decline.js +15 -1
- package/dist/icons/phone/phone_forwarded.js +15 -1
- package/dist/icons/phone/phone_hash.js +15 -1
- package/dist/icons/phone/phone_incoming.js +15 -1
- package/dist/icons/phone/phone_outgoing.js +15 -1
- package/dist/icons/phone/phone_pause.js +15 -1
- package/dist/icons/phone/phone_slash.js +15 -1
- package/dist/icons/phone/voicemail.js +15 -1
- package/dist/icons/security/key.js +15 -1
- package/dist/icons/security/key_slash.js +15 -1
- package/dist/icons/security/lock.js +15 -1
- package/dist/icons/security/lock_circle.js +15 -1
- package/dist/icons/security/lock_open.js +15 -1
- package/dist/icons/security/lock_slash.js +15 -1
- package/dist/icons/security/shield.js +15 -1
- package/dist/icons/security/shield_checkmark.js +15 -1
- package/dist/icons/security/shield_lock.js +15 -1
- package/dist/icons/security/shield_slash.js +15 -1
- package/dist/icons/security/verified.js +15 -1
- package/dist/icons/shopping/basket.js +15 -1
- package/dist/icons/shopping/cart.js +15 -1
- package/dist/icons/shopping/cart_filled.js +15 -1
- package/dist/icons/shopping/coupon.js +15 -1
- package/dist/icons/shopping/coupon_cut.js +15 -1
- package/dist/icons/shopping/delivery.js +15 -1
- package/dist/icons/shopping/discount.js +15 -1
- package/dist/icons/shopping/gift.js +15 -1
- package/dist/icons/shopping/gift_bag.js +15 -1
- package/dist/icons/shopping/inventory.js +15 -1
- package/dist/icons/shopping/point_of_sale.js +15 -1
- package/dist/icons/shopping/shirt.js +15 -1
- package/dist/icons/shopping/tag.js +15 -1
- package/dist/icons/shopping/tag_diagonal.js +15 -1
- package/dist/icons/shopping/tote.js +15 -1
- package/dist/icons/special/upload_audio.js +20 -1
- package/dist/icons/special/upload_file.js +15 -1
- package/dist/icons/special/upload_image.js +17 -1
- package/dist/icons/special/upload_video.js +18 -1
- package/dist/icons/symbols/at.js +15 -1
- package/dist/icons/symbols/cc.js +15 -1
- package/dist/icons/symbols/cmd.js +15 -1
- package/dist/icons/symbols/facebook.js +15 -1
- package/dist/icons/symbols/google.js +18 -1
- package/dist/icons/symbols/hash.js +15 -1
- package/dist/icons/symbols/instagram.js +27 -1
- package/dist/icons/symbols/messenger.js +21 -1
- package/dist/icons/symbols/twitter.js +15 -1
- package/dist/icons/technology/battery.js +15 -1
- package/dist/icons/technology/battery_100.js +15 -1
- package/dist/icons/technology/battery_20.js +15 -1
- package/dist/icons/technology/battery_40.js +15 -1
- package/dist/icons/technology/battery_60.js +15 -1
- package/dist/icons/technology/battery_80.js +15 -1
- package/dist/icons/technology/battery_charging.js +15 -1
- package/dist/icons/technology/battery_slash.js +15 -1
- package/dist/icons/technology/devices.js +15 -1
- package/dist/icons/technology/floppy_disk.js +15 -1
- package/dist/icons/technology/iphone.js +15 -1
- package/dist/icons/technology/laptop.js +15 -1
- package/dist/icons/technology/mobile.js +15 -1
- package/dist/icons/technology/monitor.js +15 -1
- package/dist/icons/technology/server.js +15 -1
- package/dist/icons/technology/sim_card.js +15 -1
- package/dist/icons/technology/usb_stick.js +15 -1
- package/dist/icons/text/align_center.js +15 -1
- package/dist/icons/text/align_justified.js +15 -1
- package/dist/icons/text/align_left.js +15 -1
- package/dist/icons/text/align_right.js +15 -1
- package/dist/icons/text/code_block.js +15 -1
- package/dist/icons/text/divider.js +15 -1
- package/dist/icons/text/footnote.js +17 -1
- package/dist/icons/text/indent_decrease.js +15 -1
- package/dist/icons/text/indent_increase.js +15 -1
- package/dist/icons/text/list_ordered.js +15 -1
- package/dist/icons/text/list_unordered.js +15 -1
- package/dist/icons/text/quote.js +15 -1
- package/dist/icons/text/table.js +15 -1
- package/dist/icons/time/alarm.js +15 -1
- package/dist/icons/time/alarm_checkmark.js +15 -1
- package/dist/icons/time/alarm_minus.js +15 -1
- package/dist/icons/time/alarm_plus.js +15 -1
- package/dist/icons/time/alarm_slash.js +15 -1
- package/dist/icons/time/alarm_snooze.js +15 -1
- package/dist/icons/time/calendar.js +15 -1
- package/dist/icons/time/calendar_add.js +15 -1
- package/dist/icons/time/calendar_checkmark.js +15 -1
- package/dist/icons/time/calendar_close.js +15 -1
- package/dist/icons/time/calendar_dates.js +15 -1
- package/dist/icons/time/calendar_minus.js +15 -1
- package/dist/icons/time/calendar_plus.js +15 -1
- package/dist/icons/time/calendar_scroll.js +17 -1
- package/dist/icons/time/clock.js +15 -1
- package/dist/icons/time/clock_history.js +15 -1
- package/dist/icons/time/stopwatch.js +15 -1
- package/dist/icons/time/timer.js +15 -1
- package/dist/icons/time/watch.js +15 -1
- package/dist/index.js +117 -1
- package/dist/utils/date.js +73 -1
- package/dist/utils/function.js +5 -1
- package/package.json +2 -4
- package/dist/styles/output.css +0 -1776
|
@@ -1 +1,60 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var cn = require('@udecode/cn');
|
|
5
|
+
var plateCommon = require('@udecode/plate-common');
|
|
6
|
+
var plateMedia = require('@udecode/plate-media');
|
|
7
|
+
var plateResizable = require('@udecode/plate-resizable');
|
|
8
|
+
var resizable = require('./resizable.js');
|
|
9
|
+
var context = require('../../context.js');
|
|
10
|
+
var mediaPopover = require('./media-popover.js');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
15
|
+
|
|
16
|
+
const ImageElement = plateCommon.withHOC(plateResizable.ResizableProvider, cn.withRef(({ className, children, element, nodeProps, ...props }, ref) => {
|
|
17
|
+
const { imageSrcLoader } = React__default.default.useContext(context.EditorContext);
|
|
18
|
+
const { readOnly, focused, selected, align = 'center' } = plateMedia.useMediaState();
|
|
19
|
+
const { id, url, ...restElement } = element;
|
|
20
|
+
const [src, setSrc] = React__default.default.useState(null);
|
|
21
|
+
React__default.default.useEffect(() => {
|
|
22
|
+
(async () => {
|
|
23
|
+
if (!id || !imageSrcLoader)
|
|
24
|
+
return;
|
|
25
|
+
const source = await imageSrcLoader(id);
|
|
26
|
+
if (source)
|
|
27
|
+
setSrc(source);
|
|
28
|
+
})();
|
|
29
|
+
}, [id, imageSrcLoader]);
|
|
30
|
+
if (!src && !!url) {
|
|
31
|
+
return (React__default.default.createElement(mediaPopover.MediaPopover, { pluginKey: plateMedia.ELEMENT_IMAGE },
|
|
32
|
+
React__default.default.createElement(plateCommon.PlateElement, { ref: ref, element: element, className: cn.cn('py-2.5', className), ...props },
|
|
33
|
+
React__default.default.createElement("figure", { className: "group relative m-0", contentEditable: false },
|
|
34
|
+
React__default.default.createElement(resizable.Resizable, { align: align, options: {
|
|
35
|
+
align,
|
|
36
|
+
readOnly,
|
|
37
|
+
} },
|
|
38
|
+
React__default.default.createElement(resizable.ResizeHandle, { options: { direction: 'left' }, className: resizable.mediaResizeHandleVariants({ direction: 'left' }) }),
|
|
39
|
+
React__default.default.createElement(plateMedia.Image, { className: cn.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 }),
|
|
40
|
+
React__default.default.createElement(resizable.ResizeHandle, { options: { direction: 'right' }, className: resizable.mediaResizeHandleVariants({
|
|
41
|
+
direction: 'right',
|
|
42
|
+
}) }))),
|
|
43
|
+
children)));
|
|
44
|
+
}
|
|
45
|
+
return (React__default.default.createElement(mediaPopover.MediaPopover, { pluginKey: plateMedia.ELEMENT_IMAGE },
|
|
46
|
+
React__default.default.createElement(plateCommon.PlateElement, { ref: ref, className: cn.cn('py-2.5', className), element: restElement, ...props },
|
|
47
|
+
!src ? null : (React__default.default.createElement("figure", { className: "group relative m-0", contentEditable: false },
|
|
48
|
+
React__default.default.createElement(resizable.Resizable, { align: align, options: {
|
|
49
|
+
align,
|
|
50
|
+
readOnly,
|
|
51
|
+
} },
|
|
52
|
+
React__default.default.createElement(resizable.ResizeHandle, { options: { direction: 'left' }, className: resizable.mediaResizeHandleVariants({ direction: 'left' }) }),
|
|
53
|
+
React__default.default.createElement(plateMedia.Image, { className: cn.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 }),
|
|
54
|
+
React__default.default.createElement(resizable.ResizeHandle, { options: { direction: 'right' }, className: resizable.mediaResizeHandleVariants({
|
|
55
|
+
direction: 'right',
|
|
56
|
+
}) })))),
|
|
57
|
+
children)));
|
|
58
|
+
}));
|
|
59
|
+
|
|
60
|
+
exports.ImageElement = ImageElement;
|
|
@@ -1,8 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var plate = require('@udecode/plate');
|
|
5
|
+
var styled = require('styled-components');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
10
|
+
|
|
11
|
+
const ListElement = ({ children, variant = 'ul', ...props }) => {
|
|
12
|
+
const Element = variant;
|
|
13
|
+
return (React__default.default.createElement(plate.PlateElement, { asChild: true, ...props },
|
|
14
|
+
React__default.default.createElement(React__default.default.Fragment, null,
|
|
15
|
+
React__default.default.createElement(Element, null, React__default.default.Children.map(children, (child) => (React__default.default.createElement(Li, null, child)))))));
|
|
16
|
+
};
|
|
17
|
+
const Li = styled.styled.li `
|
|
2
18
|
margin: 16px 0px;
|
|
3
19
|
padding-left: 8px;
|
|
4
20
|
|
|
5
21
|
&::marker {
|
|
6
22
|
color: var(--color-grey-4);
|
|
7
23
|
}
|
|
8
|
-
`;
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
exports.ListElement = ListElement;
|
|
@@ -1 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var plateCommon = require('@udecode/plate-common');
|
|
5
|
+
var plateMedia = require('@udecode/plate-media');
|
|
6
|
+
var slateReact = require('slate-react');
|
|
7
|
+
var plateButton = require('./plate-button.js');
|
|
8
|
+
var popover = require('./popover.js');
|
|
9
|
+
var lucideReact = require('lucide-react');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
12
|
+
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
14
|
+
|
|
15
|
+
function MediaPopover({ children }) {
|
|
16
|
+
const readOnly = slateReact.useReadOnly();
|
|
17
|
+
const selected = slateReact.useSelected();
|
|
18
|
+
const selectionCollapsed = plateCommon.useEditorSelector((editor) => !plateCommon.isSelectionExpanded(editor), []);
|
|
19
|
+
const isOpen = !readOnly && selected && selectionCollapsed;
|
|
20
|
+
const isEditing = plateMedia.useFloatingMediaSelectors().isEditing();
|
|
21
|
+
React.useEffect(() => {
|
|
22
|
+
if (!isOpen && isEditing) {
|
|
23
|
+
plateMedia.floatingMediaActions.isEditing(false);
|
|
24
|
+
}
|
|
25
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
26
|
+
}, [isOpen]);
|
|
27
|
+
const element = plateCommon.useElement();
|
|
28
|
+
const { props: buttonProps } = plateCommon.useRemoveNodeButton({ element });
|
|
29
|
+
if (readOnly)
|
|
30
|
+
return React__default.default.createElement(React__default.default.Fragment, null, children);
|
|
31
|
+
return (React__default.default.createElement(popover.Popover, { open: isOpen, modal: false },
|
|
32
|
+
React__default.default.createElement(popover.PopoverAnchor, null, children),
|
|
33
|
+
React__default.default.createElement(popover.PopoverContent, { className: "w-auto p-1", onOpenAutoFocus: (e) => e.preventDefault() }, isEditing ? (React__default.default.createElement("div", { className: "flex w-[330px] flex-col" },
|
|
34
|
+
React__default.default.createElement("div", { className: "flex items-center" },
|
|
35
|
+
React__default.default.createElement("div", { className: "flex items-center pl-3 text-muted-foreground" },
|
|
36
|
+
React__default.default.createElement(lucideReact.Link, { className: "h-4 w-4" }))))) : (React__default.default.createElement("div", { className: "box-content flex h-9 items-center gap-1" },
|
|
37
|
+
React__default.default.createElement(plateButton.Button, { variant: "ghost", size: "sms", ...buttonProps },
|
|
38
|
+
React__default.default.createElement(lucideReact.Trash, { className: "h-4 w-4" })))))));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
exports.MediaPopover = MediaPopover;
|
|
@@ -1 +1,63 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var reactSlot = require('@radix-ui/react-slot');
|
|
5
|
+
var cn = require('@udecode/cn');
|
|
6
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
7
|
+
|
|
8
|
+
function _interopNamespaceCompat(e) {
|
|
9
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
27
|
+
|
|
28
|
+
const buttonVariants = classVarianceAuthority.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', {
|
|
29
|
+
variants: {
|
|
30
|
+
variant: {
|
|
31
|
+
default: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
32
|
+
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
|
|
33
|
+
outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
|
|
34
|
+
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
35
|
+
ghost: 'hover:bg-accent hover:text-accent-foreground',
|
|
36
|
+
link: 'text-primary underline-offset-4 hover:underline',
|
|
37
|
+
inlineLink: 'text-base text-primary underline underline-offset-4',
|
|
38
|
+
},
|
|
39
|
+
size: {
|
|
40
|
+
default: 'h-10 px-4 py-2',
|
|
41
|
+
xs: 'h-8 rounded-md px-3',
|
|
42
|
+
sm: 'h-9 rounded-md px-3',
|
|
43
|
+
sms: 'h-9 w-9 rounded-md px-0',
|
|
44
|
+
lg: 'h-11 rounded-md px-8',
|
|
45
|
+
icon: 'h-10 w-10',
|
|
46
|
+
none: '',
|
|
47
|
+
},
|
|
48
|
+
isMenu: {
|
|
49
|
+
true: 'h-auto w-full cursor-pointer justify-start',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
defaultVariants: {
|
|
53
|
+
variant: 'default',
|
|
54
|
+
size: 'default',
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
const Button = cn.withRef(({ className, isMenu, variant, size, asChild = false, ...props }, ref) => {
|
|
58
|
+
const Comp = asChild ? reactSlot.Slot : 'button';
|
|
59
|
+
return (React__namespace.createElement(Comp, { className: cn.cn(buttonVariants({ isMenu, variant, size, className })), ref: ref, ...props }));
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
exports.Button = Button;
|
|
63
|
+
exports.buttonVariants = buttonVariants;
|
|
@@ -1,2 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
6
|
+
var cn = require('@udecode/cn');
|
|
7
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
8
|
+
|
|
9
|
+
function _interopNamespaceCompat(e) {
|
|
10
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
11
|
+
var n = Object.create(null);
|
|
12
|
+
if (e) {
|
|
13
|
+
Object.keys(e).forEach(function (k) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return e[k]; }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
28
|
+
var PopoverPrimitive__namespace = /*#__PURE__*/_interopNamespaceCompat(PopoverPrimitive);
|
|
29
|
+
|
|
30
|
+
const Popover = PopoverPrimitive__namespace.Root;
|
|
31
|
+
const PopoverAnchor = PopoverPrimitive__namespace.Anchor;
|
|
32
|
+
const popoverVariants = classVarianceAuthority.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');
|
|
33
|
+
const PopoverContent = cn.withRef(({ className, style, align = 'center', sideOffset = 4, ...props }, ref) => (React__namespace.createElement(PopoverPrimitive__namespace.Portal, null,
|
|
34
|
+
React__namespace.createElement(PopoverPrimitive__namespace.Content, { ref: ref, align: align, sideOffset: sideOffset, className: cn.cn(popoverVariants(), className), style: { zIndex: 1000, ...style }, ...props }))));
|
|
35
|
+
|
|
36
|
+
exports.Popover = Popover;
|
|
37
|
+
exports.PopoverAnchor = PopoverAnchor;
|
|
38
|
+
exports.PopoverContent = PopoverContent;
|
|
39
|
+
exports.popoverVariants = popoverVariants;
|
|
@@ -1,14 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var plate = require('@udecode/plate');
|
|
5
|
+
var styled = require('styled-components');
|
|
6
|
+
var constants = require('../../constants.js');
|
|
7
|
+
var context = require('../../context.js');
|
|
8
|
+
var button = require('../../../actions/button/button.js');
|
|
9
|
+
var box = require('../../../atoms/box/box.js');
|
|
10
|
+
var hide = require('../../../atoms/hide/hide.js');
|
|
11
|
+
var heading = require('../../../atoms/typography/heading.js');
|
|
12
|
+
var chevron_down = require('../../../../icons/arrow/chevron_down.js');
|
|
13
|
+
var chevron_up = require('../../../../icons/arrow/chevron_up.js');
|
|
14
|
+
|
|
15
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
16
|
+
|
|
17
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
18
|
+
|
|
19
|
+
const QuestionAnswerElement = React__default.default.forwardRef(({ children, element, ...props }, ref) => {
|
|
20
|
+
const { questionAnswerId } = element;
|
|
21
|
+
const { commentInputLoader: CommentInput, commentLoader: Comments } = React__default.default.useContext(context.EditorContext);
|
|
22
|
+
const [showAnswers, setShowAnswers] = React__default.default.useState(false);
|
|
23
|
+
return (React__default.default.createElement(plate.PlateElement, { asChild: true, element: element, ref: ref, ...props },
|
|
24
|
+
React__default.default.createElement(React__default.default.Fragment, null,
|
|
25
|
+
React__default.default.createElement(Question, null,
|
|
26
|
+
React__default.default.createElement(heading.H, { as: "p", "$fontSize": 18, "$lineHeight": 26, "$mediumBold": true }, children)),
|
|
27
|
+
React__default.default.createElement(box.Box, { "$dir": "column", "$gap": 24, "$padding": 24, ...{ contentEditable: false } },
|
|
28
|
+
React__default.default.createElement(button.Button, { as: "div", icon: showAnswers ? (React__default.default.createElement(chevron_up.ChevronUp, { color: "grey-3" })) : (React__default.default.createElement(chevron_down.ChevronDown, { color: "grey-3" })), onClick: () => setShowAnswers((prev) => !prev), size: "small", sx: `
|
|
2
29
|
width: fit-content;
|
|
3
30
|
flex-direction: row-reverse;
|
|
4
31
|
color: var(--color-grey-5);
|
|
5
32
|
&:not(:hover) svg {
|
|
6
33
|
fill: var(--color-grey-3);
|
|
7
34
|
}
|
|
8
|
-
`,type:"text",contentEditable
|
|
35
|
+
`, type: "text", ...{ contentEditable: false } }, showAnswers ? 'Hide answers' : 'Show answers'),
|
|
36
|
+
React__default.default.createElement(hide.HideButRender, { show: showAnswers },
|
|
37
|
+
React__default.default.createElement(Comments, { questionAnswerId: questionAnswerId })),
|
|
38
|
+
React__default.default.createElement(CommentInput, { questionAnswerId: questionAnswerId, onComment: () => setShowAnswers(true) })))));
|
|
39
|
+
});
|
|
40
|
+
const Question = styled.styled.div `
|
|
9
41
|
margin-bottom: 8px;
|
|
10
42
|
padding: 16px;
|
|
11
43
|
border-left: 8px solid var(--color-hue-blue-1);
|
|
12
44
|
border-radius: 8px;
|
|
13
45
|
background-color: var(--color-hue-blue-3);
|
|
14
|
-
|
|
46
|
+
`;
|
|
47
|
+
const createQAPlugin = plate.createPluginFactory({
|
|
48
|
+
key: constants.ELEMENT_QA,
|
|
49
|
+
type: constants.ELEMENT_QA,
|
|
50
|
+
isElement: true,
|
|
51
|
+
component: QuestionAnswerElement,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
exports.QuestionAnswerElement = QuestionAnswerElement;
|
|
55
|
+
exports.createQAPlugin = createQAPlugin;
|
|
@@ -1,2 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var cn = require('@udecode/cn');
|
|
6
|
+
var plateResizable = require('@udecode/plate-resizable');
|
|
7
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
12
|
+
|
|
13
|
+
const mediaResizeHandleVariants = classVarianceAuthority.cva(cn.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"), {
|
|
14
|
+
variants: {
|
|
15
|
+
direction: {
|
|
16
|
+
left: '-left-3 -ml-3 pl-3',
|
|
17
|
+
right: '-right-3 -mr-3 items-end pr-3',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
const resizeHandleVariants = classVarianceAuthority.cva(cn.cn('absolute z-40'), {
|
|
22
|
+
variants: {
|
|
23
|
+
direction: {
|
|
24
|
+
left: 'h-full cursor-col-resize',
|
|
25
|
+
right: 'h-full cursor-col-resize',
|
|
26
|
+
top: 'w-full cursor-row-resize',
|
|
27
|
+
bottom: 'w-full cursor-row-resize',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const ResizeHandleVariants = cn.withVariants(plateResizable.ResizeHandle, resizeHandleVariants, ['direction']);
|
|
32
|
+
const ResizeHandle = cn.withRef((props, ref) => (React__default.default.createElement(ResizeHandleVariants, { ref: ref, direction: props.options?.direction, ...props })));
|
|
33
|
+
const resizableVariants = classVarianceAuthority.cva('', {
|
|
34
|
+
variants: {
|
|
35
|
+
align: {
|
|
36
|
+
left: 'mr-auto',
|
|
37
|
+
center: 'mx-auto',
|
|
38
|
+
right: 'ml-auto',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
const Resizable = cn.withVariants(plateResizable.Resizable, resizableVariants, [
|
|
43
|
+
'align',
|
|
44
|
+
]);
|
|
45
|
+
|
|
46
|
+
exports.Resizable = Resizable;
|
|
47
|
+
exports.ResizeHandle = ResizeHandle;
|
|
48
|
+
exports.mediaResizeHandleVariants = mediaResizeHandleVariants;
|
|
@@ -1,2 +1,44 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var SeparatorPrimitive = require('@radix-ui/react-separator');
|
|
5
|
+
var cn = require('@udecode/cn');
|
|
6
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
7
|
+
|
|
8
|
+
function _interopNamespaceCompat(e) {
|
|
9
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var SeparatorPrimitive__namespace = /*#__PURE__*/_interopNamespaceCompat(SeparatorPrimitive);
|
|
27
|
+
|
|
28
|
+
const separatorVariants = classVarianceAuthority.cva('shrink-0 bg-border', {
|
|
29
|
+
variants: {
|
|
30
|
+
orientation: {
|
|
31
|
+
horizontal: 'h-[1px] w-full',
|
|
32
|
+
vertical: 'h-full w-[1px]',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
defaultVariants: {
|
|
36
|
+
orientation: 'horizontal',
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
const Separator = cn.withVariants(cn.withProps(SeparatorPrimitive__namespace.Root, {
|
|
40
|
+
orientation: 'horizontal',
|
|
41
|
+
decorative: true,
|
|
42
|
+
}), separatorVariants);
|
|
43
|
+
|
|
44
|
+
exports.Separator = Separator;
|
|
@@ -1 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var cn = require('@udecode/cn');
|
|
5
|
+
var plateCommon = require('@udecode/plate-common');
|
|
6
|
+
var plateTable = require('@udecode/plate-table');
|
|
7
|
+
var resizable = require('./resizable.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
12
|
+
|
|
13
|
+
const TableCellElement = cn.withRef(({ children, className, style, hideBorder, isHeader, ...props }, ref) => {
|
|
14
|
+
const { element } = props;
|
|
15
|
+
const { colIndex, rowIndex, readOnly, selected, hovered, hoveredLeft, rowSize, borders, isSelectingCell, colSpan, } = plateTable.useTableCellElementState();
|
|
16
|
+
const { props: cellProps } = plateTable.useTableCellElement({ element: props.element });
|
|
17
|
+
const resizableState = plateTable.useTableCellElementResizableState({
|
|
18
|
+
colIndex,
|
|
19
|
+
rowIndex,
|
|
20
|
+
colSpan,
|
|
21
|
+
});
|
|
22
|
+
const { rightProps, bottomProps, leftProps, hiddenLeft } = plateTable.useTableCellElementResizable(resizableState);
|
|
23
|
+
const Cell = isHeader ? 'th' : 'td';
|
|
24
|
+
return (React__default.default.createElement(plateCommon.PlateElement, { ref: ref, asChild: true, className: cn.cn('relative h-full overflow-visible border-none bg-background p-0', hideBorder && 'before:border-none', element.background ? 'bg-[--cellBackground]' : 'bg-background', !hideBorder &&
|
|
25
|
+
cn.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 &&
|
|
26
|
+
cn.cn(borders.bottom?.size &&
|
|
27
|
+
`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: {
|
|
28
|
+
'--cellBackground': element.background,
|
|
29
|
+
...style,
|
|
30
|
+
} },
|
|
31
|
+
React__default.default.createElement(Cell, null,
|
|
32
|
+
React__default.default.createElement("div", { className: "relative z-20 box-border h-full px-3 py-2", style: {
|
|
33
|
+
minHeight: rowSize,
|
|
34
|
+
} }, children),
|
|
35
|
+
!isSelectingCell && (React__default.default.createElement("div", { className: "group absolute top-0 h-full w-full select-none", contentEditable: false, suppressContentEditableWarning: true }, !readOnly && (React__default.default.createElement(React__default.default.Fragment, null,
|
|
36
|
+
React__default.default.createElement(resizable.ResizeHandle, { ...rightProps, className: "-top-3 right-[-5px] w-[10px]" }),
|
|
37
|
+
React__default.default.createElement(resizable.ResizeHandle, { ...bottomProps, className: "bottom-[-5px] h-[10px]" }),
|
|
38
|
+
!hiddenLeft && (React__default.default.createElement(resizable.ResizeHandle, { ...leftProps, className: "-top-3 left-[-5px] w-[10px]" })),
|
|
39
|
+
hovered && (React__default.default.createElement("div", { className: cn.cn('absolute -top-3 z-30 h-[calc(100%_+_12px)] w-1 bg-ring', 'right-[-1.5px]') })),
|
|
40
|
+
hoveredLeft && (React__default.default.createElement("div", { className: cn.cn('absolute -top-3 z-30 h-[calc(100%_+_12px)] w-1 bg-ring', 'left-[-1.5px]') })))))))));
|
|
41
|
+
});
|
|
42
|
+
TableCellElement.displayName = 'TableCellElement';
|
|
43
|
+
const TableCellHeaderElement = cn.withProps(TableCellElement, {
|
|
44
|
+
isHeader: true,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
exports.TableCellElement = TableCellElement;
|
|
48
|
+
exports.TableCellHeaderElement = TableCellHeaderElement;
|
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var cn = require('@udecode/cn');
|
|
5
|
+
var plateCommon = require('@udecode/plate-common');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
10
|
+
|
|
11
|
+
const TableRowElement = cn.withRef(({ hideBorder, children, ...props }, ref) => {
|
|
12
|
+
return (React__default.default.createElement(plateCommon.PlateElement, { asChild: true, ref: ref, className: cn.cn('h-full', hideBorder && 'border-none'), ...props },
|
|
13
|
+
React__default.default.createElement("tr", null, children)));
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
exports.TableRowElement = TableRowElement;
|
|
@@ -1 +1,98 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var cn = require('@udecode/cn');
|
|
5
|
+
var plateCommon = require('@udecode/plate-common');
|
|
6
|
+
var plateTable = require('@udecode/plate-table');
|
|
7
|
+
var slateReact = require('slate-react');
|
|
8
|
+
var PopoverPrimitive = require('@radix-ui/react-popover');
|
|
9
|
+
var lucideReact = require('lucide-react');
|
|
10
|
+
var plateButton = require('./plate-button.js');
|
|
11
|
+
var dropdownMenu = require('./dropdown-menu.js');
|
|
12
|
+
var popover = require('./popover.js');
|
|
13
|
+
var separator = require('./separator.js');
|
|
14
|
+
var borderAll = require('../../icons/border-all.js');
|
|
15
|
+
var borderBottom = require('../../icons/border-bottom.js');
|
|
16
|
+
var borderLeft = require('../../icons/border-left.js');
|
|
17
|
+
var borderNone = require('../../icons/border-none.js');
|
|
18
|
+
var borderRight = require('../../icons/border-right.js');
|
|
19
|
+
var borderTop = require('../../icons/border-top.js');
|
|
20
|
+
|
|
21
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
22
|
+
|
|
23
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
24
|
+
|
|
25
|
+
const TableBordersDropdownMenuContent = cn.withRef((props, ref) => {
|
|
26
|
+
const { getOnSelectTableBorder, hasOuterBorders, hasBottomBorder, hasLeftBorder, hasNoBorders, hasRightBorder, hasTopBorder, } = plateTable.useTableBordersDropdownMenuContentState();
|
|
27
|
+
return (React__default.default.createElement(dropdownMenu.DropdownMenuContent, { ref: ref, className: cn.cn('min-w-[220px]'), side: "right", align: "start", sideOffset: 0, ...props },
|
|
28
|
+
React__default.default.createElement(dropdownMenu.DropdownMenuCheckboxItem, { checked: hasBottomBorder, onCheckedChange: getOnSelectTableBorder('bottom') },
|
|
29
|
+
React__default.default.createElement(borderBottom.BorderBottom, { className: "mr-2 h-4 w-4" }),
|
|
30
|
+
React__default.default.createElement("div", null, "Bottom Border")),
|
|
31
|
+
React__default.default.createElement(dropdownMenu.DropdownMenuCheckboxItem, { checked: hasTopBorder, onCheckedChange: getOnSelectTableBorder('top') },
|
|
32
|
+
React__default.default.createElement(borderTop.BorderTop, { className: "mr-2 h-4 w-4" }),
|
|
33
|
+
React__default.default.createElement("div", null, "Top Border")),
|
|
34
|
+
React__default.default.createElement(dropdownMenu.DropdownMenuCheckboxItem, { checked: hasLeftBorder, onCheckedChange: getOnSelectTableBorder('left') },
|
|
35
|
+
React__default.default.createElement(borderLeft.BorderLeft, { className: "mr-2 h-4 w-4" }),
|
|
36
|
+
React__default.default.createElement("div", null, "Left Border")),
|
|
37
|
+
React__default.default.createElement(dropdownMenu.DropdownMenuCheckboxItem, { checked: hasRightBorder, onCheckedChange: getOnSelectTableBorder('right') },
|
|
38
|
+
React__default.default.createElement(borderRight.BorderRight, { className: "mr-2 h-4 w-4" }),
|
|
39
|
+
React__default.default.createElement("div", null, "Right Border")),
|
|
40
|
+
React__default.default.createElement(separator.Separator, null),
|
|
41
|
+
React__default.default.createElement(dropdownMenu.DropdownMenuCheckboxItem, { checked: hasNoBorders, onCheckedChange: getOnSelectTableBorder('none') },
|
|
42
|
+
React__default.default.createElement(borderNone.BorderNone, { className: "mr-2 h-4 w-4" }),
|
|
43
|
+
React__default.default.createElement("div", null, "No Border")),
|
|
44
|
+
React__default.default.createElement(dropdownMenu.DropdownMenuCheckboxItem, { checked: hasOuterBorders, onCheckedChange: getOnSelectTableBorder('outer') },
|
|
45
|
+
React__default.default.createElement(borderAll.BorderAll, { className: "mr-2 h-4 w-4" }),
|
|
46
|
+
React__default.default.createElement("div", null, "Outside Borders"))));
|
|
47
|
+
});
|
|
48
|
+
const TableFloatingToolbar = cn.withRef(({ children, ...props }, ref) => {
|
|
49
|
+
const element = plateCommon.useElement();
|
|
50
|
+
const { props: buttonProps } = plateCommon.useRemoveNodeButton({ element });
|
|
51
|
+
const selectionCollapsed = plateCommon.useEditorSelector((editor) => !plateCommon.isSelectionExpanded(editor), []);
|
|
52
|
+
const readOnly = slateReact.useReadOnly();
|
|
53
|
+
const selected = slateReact.useSelected();
|
|
54
|
+
const editor = plateCommon.useEditorRef();
|
|
55
|
+
const collapsed = !readOnly && selected && selectionCollapsed;
|
|
56
|
+
const open = !readOnly && selected;
|
|
57
|
+
const { canMerge, canUnmerge } = plateTable.useTableMergeState();
|
|
58
|
+
const mergeContent = canMerge && (React__default.default.createElement(plateButton.Button, { contentEditable: false, variant: "ghost", isMenu: true, onClick: () => plateTable.mergeTableCells(editor) },
|
|
59
|
+
React__default.default.createElement(lucideReact.Combine, { className: "mr-2 h-4 w-4" }),
|
|
60
|
+
"Merge"));
|
|
61
|
+
const unmergeButton = canUnmerge && (React__default.default.createElement(plateButton.Button, { contentEditable: false, variant: "ghost", isMenu: true, onClick: () => plateTable.unmergeTableCells(editor) },
|
|
62
|
+
React__default.default.createElement(lucideReact.Ungroup, { className: "mr-2 h-4 w-4" }),
|
|
63
|
+
"Unmerge"));
|
|
64
|
+
const bordersContent = collapsed && (React__default.default.createElement(React__default.default.Fragment, null,
|
|
65
|
+
React__default.default.createElement(dropdownMenu.DropdownMenu, { modal: false },
|
|
66
|
+
React__default.default.createElement(dropdownMenu.DropdownMenuTrigger, { asChild: true },
|
|
67
|
+
React__default.default.createElement(plateButton.Button, { variant: "ghost", isMenu: true },
|
|
68
|
+
React__default.default.createElement(borderAll.BorderAll, { className: "mr-2 h-4 w-4" }),
|
|
69
|
+
"Borders")),
|
|
70
|
+
React__default.default.createElement(dropdownMenu.DropdownMenuPortal, null,
|
|
71
|
+
React__default.default.createElement(TableBordersDropdownMenuContent, null))),
|
|
72
|
+
React__default.default.createElement(plateButton.Button, { contentEditable: false, variant: "ghost", isMenu: true, ...buttonProps },
|
|
73
|
+
React__default.default.createElement(lucideReact.Trash, { className: "mr-2 h-4 w-4" }),
|
|
74
|
+
"Delete")));
|
|
75
|
+
return (React__default.default.createElement(popover.Popover, { open: open, modal: false },
|
|
76
|
+
React__default.default.createElement(PopoverPrimitive.PopoverAnchor, { asChild: true }, children),
|
|
77
|
+
(canMerge || canUnmerge || collapsed) && (React__default.default.createElement(popover.PopoverContent, { ref: ref, className: cn.cn(popover.popoverVariants(), 'flex w-[220px] flex-col gap-1 p-1'), onOpenAutoFocus: (e) => e.preventDefault(), ...props },
|
|
78
|
+
unmergeButton,
|
|
79
|
+
mergeContent,
|
|
80
|
+
bordersContent))));
|
|
81
|
+
});
|
|
82
|
+
const TableElement = plateCommon.withHOC(plateTable.TableProvider, cn.withRef(({ className, children, ...props }, ref) => {
|
|
83
|
+
const { colSizes, isSelectingCell, minColumnWidth, marginLeft } = plateTable.useTableElementState();
|
|
84
|
+
const { props: tableProps, colGroupProps } = plateTable.useTableElement();
|
|
85
|
+
return (React__default.default.createElement(TableFloatingToolbar, null,
|
|
86
|
+
React__default.default.createElement("div", { style: { paddingLeft: marginLeft } },
|
|
87
|
+
React__default.default.createElement(plateCommon.PlateElement, { ref: ref, asChild: true, className: cn.cn('my-4 ml-px mr-0 table h-px w-full table-fixed border-collapse', isSelectingCell && '[&_*::selection]:bg-none', className), ...tableProps, ...props },
|
|
88
|
+
React__default.default.createElement("table", null,
|
|
89
|
+
React__default.default.createElement("colgroup", { ...colGroupProps }, colSizes.map((width, index) => (React__default.default.createElement("col", { key: index, style: {
|
|
90
|
+
minWidth: minColumnWidth,
|
|
91
|
+
width: width || undefined,
|
|
92
|
+
} })))),
|
|
93
|
+
React__default.default.createElement("tbody", { className: "min-w-full" }, children))))));
|
|
94
|
+
}));
|
|
95
|
+
|
|
96
|
+
exports.TableBordersDropdownMenuContent = TableBordersDropdownMenuContent;
|
|
97
|
+
exports.TableElement = TableElement;
|
|
98
|
+
exports.TableFloatingToolbar = TableFloatingToolbar;
|