@mohou/ui 1.0.20
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/README.md +10 -0
- package/lib/types/blocks/activity-feed.d.ts +12 -0
- package/lib/types/blocks/activity-feed.d.ts.map +1 -0
- package/lib/types/blocks/app-shell.d.ts +17 -0
- package/lib/types/blocks/app-shell.d.ts.map +1 -0
- package/lib/types/blocks/attachment-gallery.d.ts +15 -0
- package/lib/types/blocks/attachment-gallery.d.ts.map +1 -0
- package/lib/types/blocks/bar-chart.d.ts +19 -0
- package/lib/types/blocks/bar-chart.d.ts.map +1 -0
- package/lib/types/blocks/comment-thread.d.ts +17 -0
- package/lib/types/blocks/comment-thread.d.ts.map +1 -0
- package/lib/types/blocks/dashboard-shell.d.ts +35 -0
- package/lib/types/blocks/dashboard-shell.d.ts.map +1 -0
- package/lib/types/blocks/description-list.d.ts +14 -0
- package/lib/types/blocks/description-list.d.ts.map +1 -0
- package/lib/types/blocks/detail-panel.d.ts +16 -0
- package/lib/types/blocks/detail-panel.d.ts.map +1 -0
- package/lib/types/blocks/donut-chart.d.ts +21 -0
- package/lib/types/blocks/donut-chart.d.ts.map +1 -0
- package/lib/types/blocks/env-badge.d.ts +11 -0
- package/lib/types/blocks/env-badge.d.ts.map +1 -0
- package/lib/types/blocks/env-table.d.ts +29 -0
- package/lib/types/blocks/env-table.d.ts.map +1 -0
- package/lib/types/blocks/file-tree.d.ts +12 -0
- package/lib/types/blocks/file-tree.d.ts.map +1 -0
- package/lib/types/blocks/filter-bar.d.ts +15 -0
- package/lib/types/blocks/filter-bar.d.ts.map +1 -0
- package/lib/types/blocks/form-sheet.d.ts +47 -0
- package/lib/types/blocks/form-sheet.d.ts.map +1 -0
- package/lib/types/blocks/gauge.d.ts +14 -0
- package/lib/types/blocks/gauge.d.ts.map +1 -0
- package/lib/types/blocks/list-detail.d.ts +42 -0
- package/lib/types/blocks/list-detail.d.ts.map +1 -0
- package/lib/types/blocks/notification-center.d.ts +16 -0
- package/lib/types/blocks/notification-center.d.ts.map +1 -0
- package/lib/types/blocks/page-header.d.ts +15 -0
- package/lib/types/blocks/page-header.d.ts.map +1 -0
- package/lib/types/blocks/progress-ring.d.ts +13 -0
- package/lib/types/blocks/progress-ring.d.ts.map +1 -0
- package/lib/types/blocks/radar-chart.d.ts +19 -0
- package/lib/types/blocks/radar-chart.d.ts.map +1 -0
- package/lib/types/blocks/request-inspector.d.ts +14 -0
- package/lib/types/blocks/request-inspector.d.ts.map +1 -0
- package/lib/types/blocks/reveal.d.ts +30 -0
- package/lib/types/blocks/reveal.d.ts.map +1 -0
- package/lib/types/blocks/run-timeline.d.ts +12 -0
- package/lib/types/blocks/run-timeline.d.ts.map +1 -0
- package/lib/types/blocks/scrollspy.d.ts +15 -0
- package/lib/types/blocks/scrollspy.d.ts.map +1 -0
- package/lib/types/blocks/settings-split.d.ts +47 -0
- package/lib/types/blocks/settings-split.d.ts.map +1 -0
- package/lib/types/blocks/severity-chip.d.ts +23 -0
- package/lib/types/blocks/severity-chip.d.ts.map +1 -0
- package/lib/types/blocks/sparkline.d.ts +14 -0
- package/lib/types/blocks/sparkline.d.ts.map +1 -0
- package/lib/types/blocks/stat-card.d.ts +17 -0
- package/lib/types/blocks/stat-card.d.ts.map +1 -0
- package/lib/types/blocks/status-badge.d.ts +21 -0
- package/lib/types/blocks/status-badge.d.ts.map +1 -0
- package/lib/types/blocks/table-page.d.ts +35 -0
- package/lib/types/blocks/table-page.d.ts.map +1 -0
- package/lib/types/blocks/terminal.d.ts +12 -0
- package/lib/types/blocks/terminal.d.ts.map +1 -0
- package/lib/types/blocks/test-step-list.d.ts +17 -0
- package/lib/types/blocks/test-step-list.d.ts.map +1 -0
- package/lib/types/blocks/trend-card.d.ts +20 -0
- package/lib/types/blocks/trend-card.d.ts.map +1 -0
- package/lib/types/blocks/wizard-shell.d.ts +47 -0
- package/lib/types/blocks/wizard-shell.d.ts.map +1 -0
- package/lib/types/components/accordion.d.ts +14 -0
- package/lib/types/components/accordion.d.ts.map +1 -0
- package/lib/types/components/alert-dialog.d.ts +26 -0
- package/lib/types/components/alert-dialog.d.ts.map +1 -0
- package/lib/types/components/alert.d.ts +18 -0
- package/lib/types/components/alert.d.ts.map +1 -0
- package/lib/types/components/aspect-ratio.d.ts +9 -0
- package/lib/types/components/aspect-ratio.d.ts.map +1 -0
- package/lib/types/components/attachment.d.ts +28 -0
- package/lib/types/components/attachment.d.ts.map +1 -0
- package/lib/types/components/avatar.d.ts +16 -0
- package/lib/types/components/avatar.d.ts.map +1 -0
- package/lib/types/components/badge.d.ts +15 -0
- package/lib/types/components/badge.d.ts.map +1 -0
- package/lib/types/components/breadcrumb.d.ts +15 -0
- package/lib/types/components/breadcrumb.d.ts.map +1 -0
- package/lib/types/components/bubble.d.ts +21 -0
- package/lib/types/components/bubble.d.ts.map +1 -0
- package/lib/types/components/button-group.d.ts +17 -0
- package/lib/types/components/button-group.d.ts.map +1 -0
- package/lib/types/components/button.d.ts +16 -0
- package/lib/types/components/button.d.ts.map +1 -0
- package/lib/types/components/calendar.d.ts +15 -0
- package/lib/types/components/calendar.d.ts.map +1 -0
- package/lib/types/components/card.d.ts +19 -0
- package/lib/types/components/card.d.ts.map +1 -0
- package/lib/types/components/chart.d.ts +52 -0
- package/lib/types/components/chart.d.ts.map +1 -0
- package/lib/types/components/checkbox.d.ts +9 -0
- package/lib/types/components/checkbox.d.ts.map +1 -0
- package/lib/types/components/collapsible.d.ts +10 -0
- package/lib/types/components/collapsible.d.ts.map +1 -0
- package/lib/types/components/combobox.d.ts +29 -0
- package/lib/types/components/combobox.d.ts.map +1 -0
- package/lib/types/components/command.d.ts +26 -0
- package/lib/types/components/command.d.ts.map +1 -0
- package/lib/types/components/context-menu.d.ts +34 -0
- package/lib/types/components/context-menu.d.ts.map +1 -0
- package/lib/types/components/dialog.d.ts +30 -0
- package/lib/types/components/dialog.d.ts.map +1 -0
- package/lib/types/components/drawer.d.ts +21 -0
- package/lib/types/components/drawer.d.ts.map +1 -0
- package/lib/types/components/dropdown-menu.d.ts +37 -0
- package/lib/types/components/dropdown-menu.d.ts.map +1 -0
- package/lib/types/components/empty.d.ts +24 -0
- package/lib/types/components/empty.d.ts.map +1 -0
- package/lib/types/components/field.d.ts +31 -0
- package/lib/types/components/field.d.ts.map +1 -0
- package/lib/types/components/hover-card.d.ts +10 -0
- package/lib/types/components/hover-card.d.ts.map +1 -0
- package/lib/types/components/input-group.d.ts +23 -0
- package/lib/types/components/input-group.d.ts.map +1 -0
- package/lib/types/components/input.d.ts +11 -0
- package/lib/types/components/input.d.ts.map +1 -0
- package/lib/types/components/item.d.ts +27 -0
- package/lib/types/components/item.d.ts.map +1 -0
- package/lib/types/components/kbd.d.ts +8 -0
- package/lib/types/components/kbd.d.ts.map +1 -0
- package/lib/types/components/label.d.ts +11 -0
- package/lib/types/components/label.d.ts.map +1 -0
- package/lib/types/components/marker.d.ts +15 -0
- package/lib/types/components/marker.d.ts.map +1 -0
- package/lib/types/components/menubar.d.ts +34 -0
- package/lib/types/components/menubar.d.ts.map +1 -0
- package/lib/types/components/message-scroller.d.ts +15 -0
- package/lib/types/components/message-scroller.d.ts.map +1 -0
- package/lib/types/components/message.d.ts +15 -0
- package/lib/types/components/message.d.ts.map +1 -0
- package/lib/types/components/native-select.d.ts +13 -0
- package/lib/types/components/native-select.d.ts.map +1 -0
- package/lib/types/components/navigation-menu.d.ts +16 -0
- package/lib/types/components/navigation-menu.d.ts.map +1 -0
- package/lib/types/components/pagination.d.ts +22 -0
- package/lib/types/components/pagination.d.ts.map +1 -0
- package/lib/types/components/popover.d.ts +17 -0
- package/lib/types/components/popover.d.ts.map +1 -0
- package/lib/types/components/progress.d.ts +15 -0
- package/lib/types/components/progress.d.ts.map +1 -0
- package/lib/types/components/questionnaire.d.ts +24 -0
- package/lib/types/components/questionnaire.d.ts.map +1 -0
- package/lib/types/components/radio-group.d.ts +10 -0
- package/lib/types/components/radio-group.d.ts.map +1 -0
- package/lib/types/components/resizable.d.ts +15 -0
- package/lib/types/components/resizable.d.ts.map +1 -0
- package/lib/types/components/scroll-area.d.ts +9 -0
- package/lib/types/components/scroll-area.d.ts.map +1 -0
- package/lib/types/components/select.d.ts +23 -0
- package/lib/types/components/select.d.ts.map +1 -0
- package/lib/types/components/separator.d.ts +9 -0
- package/lib/types/components/separator.d.ts.map +1 -0
- package/lib/types/components/sheet.d.ts +28 -0
- package/lib/types/components/sheet.d.ts.map +1 -0
- package/lib/types/components/sidebar.d.ts +68 -0
- package/lib/types/components/sidebar.d.ts.map +1 -0
- package/lib/types/components/skeleton.d.ts +10 -0
- package/lib/types/components/skeleton.d.ts.map +1 -0
- package/lib/types/components/slider.d.ts +8 -0
- package/lib/types/components/slider.d.ts.map +1 -0
- package/lib/types/components/spinner.d.ts +9 -0
- package/lib/types/components/spinner.d.ts.map +1 -0
- package/lib/types/components/switch.d.ts +13 -0
- package/lib/types/components/switch.d.ts.map +1 -0
- package/lib/types/components/table.d.ts +18 -0
- package/lib/types/components/table.d.ts.map +1 -0
- package/lib/types/components/tabs.d.ts +18 -0
- package/lib/types/components/tabs.d.ts.map +1 -0
- package/lib/types/components/textarea.d.ts +11 -0
- package/lib/types/components/textarea.d.ts.map +1 -0
- package/lib/types/components/toast.d.ts +35 -0
- package/lib/types/components/toast.d.ts.map +1 -0
- package/lib/types/components/toggle-group.d.ts +16 -0
- package/lib/types/components/toggle-group.d.ts.map +1 -0
- package/lib/types/components/toggle.d.ts +13 -0
- package/lib/types/components/toggle.d.ts.map +1 -0
- package/lib/types/components/tooltip.d.ts +14 -0
- package/lib/types/components/tooltip.d.ts.map +1 -0
- package/lib/types/composites/autocomplete.d.ts +15 -0
- package/lib/types/composites/autocomplete.d.ts.map +1 -0
- package/lib/types/composites/cascader.d.ts +18 -0
- package/lib/types/composites/cascader.d.ts.map +1 -0
- package/lib/types/composites/color-picker.d.ts +12 -0
- package/lib/types/composites/color-picker.d.ts.map +1 -0
- package/lib/types/composites/confirm-dialog.d.ts +17 -0
- package/lib/types/composites/confirm-dialog.d.ts.map +1 -0
- package/lib/types/composites/copyable.d.ts +12 -0
- package/lib/types/composites/copyable.d.ts.map +1 -0
- package/lib/types/composites/currency-input.d.ts +13 -0
- package/lib/types/composites/currency-input.d.ts.map +1 -0
- package/lib/types/composites/date-chrome.d.ts +8 -0
- package/lib/types/composites/date-chrome.d.ts.map +1 -0
- package/lib/types/composites/date-picker.d.ts +17 -0
- package/lib/types/composites/date-picker.d.ts.map +1 -0
- package/lib/types/composites/date-range-picker.d.ts +18 -0
- package/lib/types/composites/date-range-picker.d.ts.map +1 -0
- package/lib/types/composites/date-time-picker.d.ts +18 -0
- package/lib/types/composites/date-time-picker.d.ts.map +1 -0
- package/lib/types/composites/date-time-range-picker.d.ts +17 -0
- package/lib/types/composites/date-time-range-picker.d.ts.map +1 -0
- package/lib/types/composites/duration-input.d.ts +14 -0
- package/lib/types/composites/duration-input.d.ts.map +1 -0
- package/lib/types/composites/live-refresh.d.ts +46 -0
- package/lib/types/composites/live-refresh.d.ts.map +1 -0
- package/lib/types/composites/mini-calendar.d.ts +13 -0
- package/lib/types/composites/mini-calendar.d.ts.map +1 -0
- package/lib/types/composites/number-field.d.ts +15 -0
- package/lib/types/composites/number-field.d.ts.map +1 -0
- package/lib/types/composites/password-field.d.ts +13 -0
- package/lib/types/composites/password-field.d.ts.map +1 -0
- package/lib/types/composites/phone-input.d.ts +12 -0
- package/lib/types/composites/phone-input.d.ts.map +1 -0
- package/lib/types/composites/rating.d.ts +13 -0
- package/lib/types/composites/rating.d.ts.map +1 -0
- package/lib/types/composites/relative-date-picker.d.ts +16 -0
- package/lib/types/composites/relative-date-picker.d.ts.map +1 -0
- package/lib/types/composites/search-input.d.ts +16 -0
- package/lib/types/composites/search-input.d.ts.map +1 -0
- package/lib/types/composites/slider-range.d.ts +14 -0
- package/lib/types/composites/slider-range.d.ts.map +1 -0
- package/lib/types/composites/tag-input.d.ts +14 -0
- package/lib/types/composites/tag-input.d.ts.map +1 -0
- package/lib/types/composites/time-picker.d.ts +28 -0
- package/lib/types/composites/time-picker.d.ts.map +1 -0
- package/lib/types/composites/time-range-picker.d.ts +16 -0
- package/lib/types/composites/time-range-picker.d.ts.map +1 -0
- package/lib/types/composites/timezone-select.d.ts +22 -0
- package/lib/types/composites/timezone-select.d.ts.map +1 -0
- package/lib/types/composites/transfer.d.ts +17 -0
- package/lib/types/composites/transfer.d.ts.map +1 -0
- package/lib/types/composites/user-picker.d.ts +17 -0
- package/lib/types/composites/user-picker.d.ts.map +1 -0
- package/lib/types/hooks/use-html-dark.d.ts +4 -0
- package/lib/types/hooks/use-html-dark.d.ts.map +1 -0
- package/lib/types/hooks/use-mobile.d.ts +2 -0
- package/lib/types/hooks/use-mobile.d.ts.map +1 -0
- package/lib/types/i18n/context.d.ts +310 -0
- package/lib/types/i18n/context.d.ts.map +1 -0
- package/lib/types/i18n/en.d.ts +290 -0
- package/lib/types/i18n/en.d.ts.map +1 -0
- package/lib/types/i18n/zh.d.ts +3 -0
- package/lib/types/i18n/zh.d.ts.map +1 -0
- package/lib/types/index.d.ts +151 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/lib/clipboard.d.ts +3 -0
- package/lib/types/lib/clipboard.d.ts.map +1 -0
- package/lib/types/lib/defined.d.ts +3 -0
- package/lib/types/lib/defined.d.ts.map +1 -0
- package/lib/types/lib/icons.d.ts +16 -0
- package/lib/types/lib/icons.d.ts.map +1 -0
- package/lib/types/lib/illustrations.d.ts +18 -0
- package/lib/types/lib/illustrations.d.ts.map +1 -0
- package/lib/types/lib/utils.d.ts +3 -0
- package/lib/types/lib/utils.d.ts.map +1 -0
- package/lib/types/products/cells.d.ts +13 -0
- package/lib/types/products/cells.d.ts.map +1 -0
- package/lib/types/products/code-block.d.ts +14 -0
- package/lib/types/products/code-block.d.ts.map +1 -0
- package/lib/types/products/code-editor.d.ts +21 -0
- package/lib/types/products/code-editor.d.ts.map +1 -0
- package/lib/types/products/commit-graph.d.ts +38 -0
- package/lib/types/products/commit-graph.d.ts.map +1 -0
- package/lib/types/products/data-grid.d.ts +79 -0
- package/lib/types/products/data-grid.d.ts.map +1 -0
- package/lib/types/products/diff-viewer.d.ts +15 -0
- package/lib/types/products/diff-viewer.d.ts.map +1 -0
- package/lib/types/products/event-calendar.d.ts +23 -0
- package/lib/types/products/event-calendar.d.ts.map +1 -0
- package/lib/types/products/export-csv.d.ts +2 -0
- package/lib/types/products/export-csv.d.ts.map +1 -0
- package/lib/types/products/file-dropzone.d.ts +12 -0
- package/lib/types/products/file-dropzone.d.ts.map +1 -0
- package/lib/types/products/full-calendar/animations.d.ts +12 -0
- package/lib/types/products/full-calendar/animations.d.ts.map +1 -0
- package/lib/types/products/full-calendar/calendar-body.d.ts +2 -0
- package/lib/types/products/full-calendar/calendar-body.d.ts.map +1 -0
- package/lib/types/products/full-calendar/constants.d.ts +3 -0
- package/lib/types/products/full-calendar/constants.d.ts.map +1 -0
- package/lib/types/products/full-calendar/contexts/calendar-context.d.ts +42 -0
- package/lib/types/products/full-calendar/contexts/calendar-context.d.ts.map +1 -0
- package/lib/types/products/full-calendar/contexts/dnd-context.d.ts +16 -0
- package/lib/types/products/full-calendar/contexts/dnd-context.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dialogs/add-edit-event-dialog.d.ts +21 -0
- package/lib/types/products/full-calendar/dialogs/add-edit-event-dialog.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dialogs/delete-event-dialog.d.ts +4 -0
- package/lib/types/products/full-calendar/dialogs/delete-event-dialog.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dialogs/event-details-dialog.d.ts +7 -0
- package/lib/types/products/full-calendar/dialogs/event-details-dialog.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dialogs/events-list-dialog.d.ts +9 -0
- package/lib/types/products/full-calendar/dialogs/events-list-dialog.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dnd/draggable-event.d.ts +11 -0
- package/lib/types/products/full-calendar/dnd/draggable-event.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dnd/droppable-area.d.ts +11 -0
- package/lib/types/products/full-calendar/dnd/droppable-area.d.ts.map +1 -0
- package/lib/types/products/full-calendar/dnd/resizable-event.d.ts +10 -0
- package/lib/types/products/full-calendar/dnd/resizable-event.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/calendar-header.d.ts +2 -0
- package/lib/types/products/full-calendar/header/calendar-header.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/date-navigator.d.ts +9 -0
- package/lib/types/products/full-calendar/header/date-navigator.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/filter.d.ts +2 -0
- package/lib/types/products/full-calendar/header/filter.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/today-button.d.ts +2 -0
- package/lib/types/products/full-calendar/header/today-button.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/user-select.d.ts +2 -0
- package/lib/types/products/full-calendar/header/user-select.d.ts.map +1 -0
- package/lib/types/products/full-calendar/header/view-tabs.d.ts +4 -0
- package/lib/types/products/full-calendar/header/view-tabs.d.ts.map +1 -0
- package/lib/types/products/full-calendar/helpers.d.ts +42 -0
- package/lib/types/products/full-calendar/helpers.d.ts.map +1 -0
- package/lib/types/products/full-calendar/hooks/use-time-range-create.d.ts +25 -0
- package/lib/types/products/full-calendar/hooks/use-time-range-create.d.ts.map +1 -0
- package/lib/types/products/full-calendar/hooks.d.ts +11 -0
- package/lib/types/products/full-calendar/hooks.d.ts.map +1 -0
- package/lib/types/products/full-calendar/interfaces.d.ts +21 -0
- package/lib/types/products/full-calendar/interfaces.d.ts.map +1 -0
- package/lib/types/products/full-calendar/settings/settings.d.ts +2 -0
- package/lib/types/products/full-calendar/settings/settings.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/avatar-group.d.ts +7 -0
- package/lib/types/products/full-calendar/shims/avatar-group.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/day-picker.d.ts +2 -0
- package/lib/types/products/full-calendar/shims/day-picker.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/motion.d.ts +32 -0
- package/lib/types/products/full-calendar/shims/motion.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/next-themes.d.ts +5 -0
- package/lib/types/products/full-calendar/shims/next-themes.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/re-resizable.d.ts +19 -0
- package/lib/types/products/full-calendar/shims/re-resizable.d.ts.map +1 -0
- package/lib/types/products/full-calendar/shims/sonner.d.ts +5 -0
- package/lib/types/products/full-calendar/shims/sonner.d.ts.map +1 -0
- package/lib/types/products/full-calendar/types.d.ts +3 -0
- package/lib/types/products/full-calendar/types.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/agenda-view/agenda-events.d.ts +3 -0
- package/lib/types/products/full-calendar/views/agenda-view/agenda-events.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/month-view/calendar-month-view.d.ts +8 -0
- package/lib/types/products/full-calendar/views/month-view/calendar-month-view.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/month-view/day-cell.d.ts +12 -0
- package/lib/types/products/full-calendar/views/month-view/day-cell.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/month-view/event-bullet.d.ts +6 -0
- package/lib/types/products/full-calendar/views/month-view/event-bullet.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/month-view/month-event-badge.d.ts +17 -0
- package/lib/types/products/full-calendar/views/month-view/month-event-badge.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-day-view.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-day-view.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-time-line.d.ts +2 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-time-line.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-week-view.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/calendar-week-view.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/day-view-multi-day-events-row.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/day-view-multi-day-events-row.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/event-block.d.ts +12 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/event-block.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/render-grouped-events.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/render-grouped-events.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/week-view-multi-day-events-row.d.ts +8 -0
- package/lib/types/products/full-calendar/views/week-and-day-view/week-view-multi-day-events-row.d.ts.map +1 -0
- package/lib/types/products/full-calendar/views/year-view/calendar-year-view.d.ts +8 -0
- package/lib/types/products/full-calendar/views/year-view/calendar-year-view.d.ts.map +1 -0
- package/lib/types/products/gantt.d.ts +17 -0
- package/lib/types/products/gantt.d.ts.map +1 -0
- package/lib/types/products/jira-wiki-parse.d.ts +55 -0
- package/lib/types/products/jira-wiki-parse.d.ts.map +1 -0
- package/lib/types/products/jira-wiki.d.ts +39 -0
- package/lib/types/products/jira-wiki.d.ts.map +1 -0
- package/lib/types/products/jql-input.d.ts +22 -0
- package/lib/types/products/jql-input.d.ts.map +1 -0
- package/lib/types/products/json-viewer.d.ts +12 -0
- package/lib/types/products/json-viewer.d.ts.map +1 -0
- package/lib/types/products/kanban-issue-panel.d.ts +15 -0
- package/lib/types/products/kanban-issue-panel.d.ts.map +1 -0
- package/lib/types/products/kanban.d.ts +43 -0
- package/lib/types/products/kanban.d.ts.map +1 -0
- package/lib/types/products/log-viewer.d.ts +25 -0
- package/lib/types/products/log-viewer.d.ts.map +1 -0
- package/lib/types/products/markdown-editor.d.ts +16 -0
- package/lib/types/products/markdown-editor.d.ts.map +1 -0
- package/lib/types/products/markdown.d.ts +13 -0
- package/lib/types/products/markdown.d.ts.map +1 -0
- package/lib/types/products/rich-text-editor.d.ts +13 -0
- package/lib/types/products/rich-text-editor.d.ts.map +1 -0
- package/lib/types/products/sortable-list.d.ts +16 -0
- package/lib/types/products/sortable-list.d.ts.map +1 -0
- package/lib/types/products/stepper.d.ts +39 -0
- package/lib/types/products/stepper.d.ts.map +1 -0
- package/lib/types/products/timeline.d.ts +17 -0
- package/lib/types/products/timeline.d.ts.map +1 -0
- package/lib/types/products/tree-view.d.ts +17 -0
- package/lib/types/products/tree-view.d.ts.map +1 -0
- package/lib/types/sdk/app-error-boundary.d.ts +33 -0
- package/lib/types/sdk/app-error-boundary.d.ts.map +1 -0
- package/lib/types/sdk/app-id.d.ts +6 -0
- package/lib/types/sdk/app-id.d.ts.map +1 -0
- package/lib/types/sdk/use-app.d.ts +32 -0
- package/lib/types/sdk/use-app.d.ts.map +1 -0
- package/package.json +67 -0
- package/src/blocks/activity-feed.tsx +16 -0
- package/src/blocks/app-shell.tsx +38 -0
- package/src/blocks/attachment-gallery.tsx +36 -0
- package/src/blocks/bar-chart.tsx +46 -0
- package/src/blocks/comment-thread.tsx +37 -0
- package/src/blocks/dashboard-shell.tsx +108 -0
- package/src/blocks/description-list.tsx +23 -0
- package/src/blocks/detail-panel.tsx +43 -0
- package/src/blocks/donut-chart.tsx +54 -0
- package/src/blocks/env-badge.tsx +30 -0
- package/src/blocks/env-table.tsx +315 -0
- package/src/blocks/file-tree.tsx +12 -0
- package/src/blocks/filter-bar.tsx +22 -0
- package/src/blocks/form-sheet.tsx +159 -0
- package/src/blocks/gauge.tsx +36 -0
- package/src/blocks/list-detail.tsx +120 -0
- package/src/blocks/notification-center.tsx +29 -0
- package/src/blocks/page-header.tsx +31 -0
- package/src/blocks/progress-ring.tsx +43 -0
- package/src/blocks/radar-chart.tsx +47 -0
- package/src/blocks/request-inspector.tsx +41 -0
- package/src/blocks/reveal.tsx +56 -0
- package/src/blocks/run-timeline.tsx +12 -0
- package/src/blocks/scrollspy.tsx +48 -0
- package/src/blocks/settings-split.tsx +153 -0
- package/src/blocks/severity-chip.tsx +34 -0
- package/src/blocks/sparkline.tsx +27 -0
- package/src/blocks/stat-card.tsx +50 -0
- package/src/blocks/status-badge.tsx +40 -0
- package/src/blocks/table-page.tsx +82 -0
- package/src/blocks/terminal.tsx +28 -0
- package/src/blocks/test-step-list.tsx +26 -0
- package/src/blocks/trend-card.tsx +57 -0
- package/src/blocks/wizard-shell.tsx +131 -0
- package/src/cdn-modules.d.ts +5 -0
- package/src/components/accordion.tsx +79 -0
- package/src/components/alert-dialog.tsx +192 -0
- package/src/components/alert.tsx +83 -0
- package/src/components/aspect-ratio.tsx +26 -0
- package/src/components/attachment.tsx +211 -0
- package/src/components/avatar.tsx +111 -0
- package/src/components/badge.tsx +59 -0
- package/src/components/breadcrumb.tsx +129 -0
- package/src/components/bubble.tsx +132 -0
- package/src/components/button-group.tsx +93 -0
- package/src/components/button.tsx +65 -0
- package/src/components/calendar.tsx +224 -0
- package/src/components/card.tsx +110 -0
- package/src/components/chart.tsx +378 -0
- package/src/components/checkbox.tsx +33 -0
- package/src/components/collapsible.tsx +23 -0
- package/src/components/combobox.tsx +299 -0
- package/src/components/command.tsx +201 -0
- package/src/components/context-menu.tsx +274 -0
- package/src/components/dialog.tsx +179 -0
- package/src/components/drawer.tsx +230 -0
- package/src/components/dropdown-menu.tsx +274 -0
- package/src/components/empty.tsx +130 -0
- package/src/components/field.tsx +242 -0
- package/src/components/hover-card.tsx +53 -0
- package/src/components/input-group.tsx +161 -0
- package/src/components/input.tsx +27 -0
- package/src/components/item.tsx +205 -0
- package/src/components/kbd.tsx +30 -0
- package/src/components/label.tsx +26 -0
- package/src/components/marker.tsx +75 -0
- package/src/components/menubar.tsx +283 -0
- package/src/components/message-scroller.tsx +133 -0
- package/src/components/message.tsx +96 -0
- package/src/components/native-select.tsx +65 -0
- package/src/components/navigation-menu.tsx +172 -0
- package/src/components/pagination.tsx +138 -0
- package/src/components/popover.tsx +95 -0
- package/src/components/progress.tsx +89 -0
- package/src/components/questionnaire.tsx +332 -0
- package/src/components/radio-group.tsx +40 -0
- package/src/components/resizable.tsx +56 -0
- package/src/components/scroll-area.tsx +56 -0
- package/src/components/select.tsx +207 -0
- package/src/components/separator.tsx +28 -0
- package/src/components/sheet.tsx +158 -0
- package/src/components/sidebar.tsx +725 -0
- package/src/components/skeleton.tsx +20 -0
- package/src/components/slider.tsx +56 -0
- package/src/components/spinner.tsx +16 -0
- package/src/components/switch.tsx +38 -0
- package/src/components/table.tsx +121 -0
- package/src/components/tabs.tsx +88 -0
- package/src/components/textarea.tsx +25 -0
- package/src/components/toast.tsx +273 -0
- package/src/components/toggle-group.tsx +92 -0
- package/src/components/toggle.tsx +47 -0
- package/src/components/tooltip.tsx +72 -0
- package/src/composites/autocomplete.tsx +61 -0
- package/src/composites/cascader.tsx +52 -0
- package/src/composites/color-picker.tsx +25 -0
- package/src/composites/confirm-dialog.tsx +62 -0
- package/src/composites/copyable.tsx +44 -0
- package/src/composites/currency-input.tsx +37 -0
- package/src/composites/date-chrome.tsx +156 -0
- package/src/composites/date-picker.tsx +97 -0
- package/src/composites/date-range-picker.tsx +99 -0
- package/src/composites/date-time-picker.tsx +121 -0
- package/src/composites/date-time-range-picker.tsx +57 -0
- package/src/composites/duration-input.tsx +128 -0
- package/src/composites/live-refresh.tsx +348 -0
- package/src/composites/mini-calendar.tsx +30 -0
- package/src/composites/number-field.tsx +59 -0
- package/src/composites/password-field.tsx +50 -0
- package/src/composites/phone-input.tsx +28 -0
- package/src/composites/rating.tsx +45 -0
- package/src/composites/relative-date-picker.tsx +68 -0
- package/src/composites/search-input.tsx +55 -0
- package/src/composites/slider-range.tsx +36 -0
- package/src/composites/tag-input.tsx +62 -0
- package/src/composites/time-picker.tsx +208 -0
- package/src/composites/time-range-picker.tsx +31 -0
- package/src/composites/timezone-select.tsx +257 -0
- package/src/composites/transfer.tsx +58 -0
- package/src/composites/user-picker.tsx +46 -0
- package/src/hooks/use-html-dark.ts +36 -0
- package/src/hooks/use-mobile.ts +22 -0
- package/src/i18n/context.tsx +71 -0
- package/src/i18n/en.ts +308 -0
- package/src/i18n/zh.ts +290 -0
- package/src/index.ts +151 -0
- package/src/lib/clipboard.ts +10 -0
- package/src/lib/defined.ts +8 -0
- package/src/lib/icons.tsx +16 -0
- package/src/lib/illustrations.tsx +573 -0
- package/src/lib/utils.ts +6 -0
- package/src/products/cells.tsx +18 -0
- package/src/products/code-block.tsx +91 -0
- package/src/products/code-editor.tsx +271 -0
- package/src/products/column-meta.d.ts +9 -0
- package/src/products/commit-graph.tsx +643 -0
- package/src/products/data-grid.tsx +692 -0
- package/src/products/diff-viewer.tsx +224 -0
- package/src/products/event-calendar.tsx +49 -0
- package/src/products/export-csv.ts +26 -0
- package/src/products/file-dropzone.tsx +47 -0
- package/src/products/full-calendar/animations.ts +38 -0
- package/src/products/full-calendar/calendar-body.tsx +76 -0
- package/src/products/full-calendar/constants.ts +10 -0
- package/src/products/full-calendar/contexts/calendar-context.tsx +254 -0
- package/src/products/full-calendar/contexts/dnd-context.tsx +156 -0
- package/src/products/full-calendar/dialogs/add-edit-event-dialog.tsx +186 -0
- package/src/products/full-calendar/dialogs/delete-event-dialog.tsx +39 -0
- package/src/products/full-calendar/dialogs/event-details-dialog.tsx +99 -0
- package/src/products/full-calendar/dialogs/events-list-dialog.tsx +86 -0
- package/src/products/full-calendar/dnd/draggable-event.tsx +45 -0
- package/src/products/full-calendar/dnd/droppable-area.tsx +45 -0
- package/src/products/full-calendar/dnd/resizable-event.tsx +178 -0
- package/src/products/full-calendar/header/calendar-header.tsx +64 -0
- package/src/products/full-calendar/header/date-navigator.tsx +110 -0
- package/src/products/full-calendar/header/filter.tsx +58 -0
- package/src/products/full-calendar/header/today-button.tsx +45 -0
- package/src/products/full-calendar/header/user-select.tsx +64 -0
- package/src/products/full-calendar/header/view-tabs.tsx +36 -0
- package/src/products/full-calendar/helpers.ts +463 -0
- package/src/products/full-calendar/hooks/use-time-range-create.ts +152 -0
- package/src/products/full-calendar/hooks.ts +70 -0
- package/src/products/full-calendar/interfaces.ts +23 -0
- package/src/products/full-calendar/settings/settings.tsx +80 -0
- package/src/products/full-calendar/shims/avatar-group.tsx +16 -0
- package/src/products/full-calendar/shims/day-picker.tsx +1 -0
- package/src/products/full-calendar/shims/motion.tsx +97 -0
- package/src/products/full-calendar/shims/next-themes.ts +6 -0
- package/src/products/full-calendar/shims/re-resizable.tsx +25 -0
- package/src/products/full-calendar/shims/sonner.ts +4 -0
- package/src/products/full-calendar/types.ts +8 -0
- package/src/products/full-calendar/views/agenda-view/agenda-events.tsx +140 -0
- package/src/products/full-calendar/views/month-view/calendar-month-view.tsx +69 -0
- package/src/products/full-calendar/views/month-view/day-cell.tsx +200 -0
- package/src/products/full-calendar/views/month-view/event-bullet.tsx +40 -0
- package/src/products/full-calendar/views/month-view/month-event-badge.tsx +143 -0
- package/src/products/full-calendar/views/week-and-day-view/calendar-day-view.tsx +295 -0
- package/src/products/full-calendar/views/week-and-day-view/calendar-time-line.tsx +35 -0
- package/src/products/full-calendar/views/week-and-day-view/calendar-week-view.tsx +251 -0
- package/src/products/full-calendar/views/week-and-day-view/day-view-multi-day-events-row.tsx +73 -0
- package/src/products/full-calendar/views/week-and-day-view/event-block.tsx +114 -0
- package/src/products/full-calendar/views/week-and-day-view/render-grouped-events.tsx +49 -0
- package/src/products/full-calendar/views/week-and-day-view/week-view-multi-day-events-row.tsx +145 -0
- package/src/products/full-calendar/views/year-view/calendar-year-view.tsx +161 -0
- package/src/products/gantt.tsx +47 -0
- package/src/products/jira-wiki-parse.ts +197 -0
- package/src/products/jira-wiki.tsx +287 -0
- package/src/products/jql-input.tsx +391 -0
- package/src/products/json-viewer.tsx +43 -0
- package/src/products/kanban-issue-panel.tsx +104 -0
- package/src/products/kanban.tsx +245 -0
- package/src/products/log-viewer.tsx +404 -0
- package/src/products/markdown-editor.tsx +77 -0
- package/src/products/markdown.tsx +50 -0
- package/src/products/rich-text-editor.tsx +89 -0
- package/src/products/sortable-list.tsx +67 -0
- package/src/products/stepper.tsx +237 -0
- package/src/products/timeline.tsx +39 -0
- package/src/products/tree-view.tsx +62 -0
- package/src/sdk/app-error-boundary.tsx +240 -0
- package/src/sdk/app-id.ts +7 -0
- package/src/sdk/use-app.ts +43 -0
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
export type WikiInline =
|
|
2
|
+
| { type: 'text'; value: string }
|
|
3
|
+
| { type: 'bold'; children: WikiInline[] }
|
|
4
|
+
| { type: 'italic'; children: WikiInline[] }
|
|
5
|
+
| { type: 'strike'; children: WikiInline[] }
|
|
6
|
+
| { type: 'code'; value: string }
|
|
7
|
+
| { type: 'link'; href: string; label: string }
|
|
8
|
+
| { type: 'attachment'; name: string }
|
|
9
|
+
|
|
10
|
+
export type WikiBlock =
|
|
11
|
+
| { type: 'heading'; level: number; children: WikiInline[] }
|
|
12
|
+
| { type: 'paragraph'; children: WikiInline[] }
|
|
13
|
+
| { type: 'list'; ordered: boolean; items: WikiInline[][] }
|
|
14
|
+
| { type: 'code'; language?: string | undefined; value: string }
|
|
15
|
+
| { type: 'quote'; children: WikiInline[] }
|
|
16
|
+
| { type: 'panel'; title?: string | undefined; children: WikiBlock[] }
|
|
17
|
+
| { type: 'table'; header: WikiInline[][]; rows: WikiInline[][][] }
|
|
18
|
+
| { type: 'hr' }
|
|
19
|
+
|
|
20
|
+
export function parseInline(input: string): WikiInline[] {
|
|
21
|
+
const nodes: WikiInline[] = []
|
|
22
|
+
let rest = input
|
|
23
|
+
while (rest.length) {
|
|
24
|
+
const attachment = /^\[\^([^\]]+)\]/.exec(rest)
|
|
25
|
+
if (attachment) {
|
|
26
|
+
nodes.push({ type: 'attachment', name: attachment[1] ?? '' })
|
|
27
|
+
rest = rest.slice(attachment[0].length)
|
|
28
|
+
continue
|
|
29
|
+
}
|
|
30
|
+
const link = /^\[([^\]|]+)\|([^\]]+)\]/.exec(rest) ?? /^\[([^\]]+)\]/.exec(rest)
|
|
31
|
+
if (link) {
|
|
32
|
+
const label = link[1] ?? ''
|
|
33
|
+
const href = link[2] ?? link[1] ?? ''
|
|
34
|
+
nodes.push({ type: 'link', href, label })
|
|
35
|
+
rest = rest.slice(link[0].length)
|
|
36
|
+
continue
|
|
37
|
+
}
|
|
38
|
+
const code = /^\{\{(.+?)\}\}/.exec(rest)
|
|
39
|
+
if (code) {
|
|
40
|
+
nodes.push({ type: 'code', value: code[1] ?? '' })
|
|
41
|
+
rest = rest.slice(code[0].length)
|
|
42
|
+
continue
|
|
43
|
+
}
|
|
44
|
+
const bold = /^\*([^*\n]+)\*/.exec(rest)
|
|
45
|
+
if (bold) {
|
|
46
|
+
nodes.push({ type: 'bold', children: parseInline(bold[1] ?? '') })
|
|
47
|
+
rest = rest.slice(bold[0].length)
|
|
48
|
+
continue
|
|
49
|
+
}
|
|
50
|
+
const italic = /^_([^_\n]+)_/.exec(rest)
|
|
51
|
+
if (italic) {
|
|
52
|
+
nodes.push({ type: 'italic', children: parseInline(italic[1] ?? '') })
|
|
53
|
+
rest = rest.slice(italic[0].length)
|
|
54
|
+
continue
|
|
55
|
+
}
|
|
56
|
+
const strike = /^-([^-]+)-(?=$|[\s.,;:!?)"]])/.exec(rest)
|
|
57
|
+
if (strike) {
|
|
58
|
+
nodes.push({ type: 'strike', children: parseInline(strike[1] ?? '') })
|
|
59
|
+
rest = rest.slice(strike[0].length)
|
|
60
|
+
continue
|
|
61
|
+
}
|
|
62
|
+
const next = rest.search(/[\[*{_-]/)
|
|
63
|
+
if (next <= 0) {
|
|
64
|
+
const take = next === 0 ? 1 : rest.length
|
|
65
|
+
const last = nodes.at(-1)
|
|
66
|
+
if (last?.type === 'text') last.value += rest.slice(0, take)
|
|
67
|
+
else nodes.push({ type: 'text', value: rest.slice(0, take) })
|
|
68
|
+
rest = rest.slice(take)
|
|
69
|
+
continue
|
|
70
|
+
}
|
|
71
|
+
const last = nodes.at(-1)
|
|
72
|
+
if (last?.type === 'text') last.value += rest.slice(0, next)
|
|
73
|
+
else nodes.push({ type: 'text', value: rest.slice(0, next) })
|
|
74
|
+
rest = rest.slice(next)
|
|
75
|
+
}
|
|
76
|
+
return nodes
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function splitCells(line: string, delim: '||' | '|') {
|
|
80
|
+
const trimmed = line.trim()
|
|
81
|
+
const inner =
|
|
82
|
+
delim === '||'
|
|
83
|
+
? trimmed.replace(/^\|\|/, '').replace(/\|\|$/, '')
|
|
84
|
+
: trimmed.replace(/^\|/, '').replace(/\|$/, '')
|
|
85
|
+
return inner.split(delim === '||' ? '||' : '|').map(cell => parseInline(cell.trim()))
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function isTableRow(line: string) {
|
|
89
|
+
return line.startsWith('|') && line.endsWith('|') && line.length >= 2
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function collectFence(lines: string[], start: number, close: string) {
|
|
93
|
+
const body: string[] = []
|
|
94
|
+
let i = start + 1
|
|
95
|
+
while (i < lines.length && lines[i]?.trim() !== close) {
|
|
96
|
+
body.push(lines[i] ?? '')
|
|
97
|
+
i += 1
|
|
98
|
+
}
|
|
99
|
+
return { body: body.join('\n'), end: i }
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function parseJiraWiki(input: string): WikiBlock[] {
|
|
103
|
+
const lines = input.replace(/\r\n/g, '\n').split('\n')
|
|
104
|
+
const blocks: WikiBlock[] = []
|
|
105
|
+
let i = 0
|
|
106
|
+
while (i < lines.length) {
|
|
107
|
+
const line = lines[i] ?? ''
|
|
108
|
+
const trimmed = line.trim()
|
|
109
|
+
if (!trimmed) {
|
|
110
|
+
i += 1
|
|
111
|
+
continue
|
|
112
|
+
}
|
|
113
|
+
if (trimmed === '----') {
|
|
114
|
+
blocks.push({ type: 'hr' })
|
|
115
|
+
i += 1
|
|
116
|
+
continue
|
|
117
|
+
}
|
|
118
|
+
const heading = /^h([1-6])\.\s+(.*)$/.exec(trimmed)
|
|
119
|
+
if (heading) {
|
|
120
|
+
blocks.push({
|
|
121
|
+
type: 'heading',
|
|
122
|
+
level: Number(heading[1]),
|
|
123
|
+
children: parseInline(heading[2] ?? ''),
|
|
124
|
+
})
|
|
125
|
+
i += 1
|
|
126
|
+
continue
|
|
127
|
+
}
|
|
128
|
+
const codeOpen = /^\{code(?::([a-zA-Z0-9+-]+))?\}$/.exec(trimmed)
|
|
129
|
+
if (codeOpen) {
|
|
130
|
+
const fence = collectFence(lines, i, '{code}')
|
|
131
|
+
blocks.push({ type: 'code', language: codeOpen[1], value: fence.body })
|
|
132
|
+
i = fence.end + 1
|
|
133
|
+
continue
|
|
134
|
+
}
|
|
135
|
+
if (trimmed === '{noformat}') {
|
|
136
|
+
const fence = collectFence(lines, i, '{noformat}')
|
|
137
|
+
blocks.push({ type: 'code', value: fence.body })
|
|
138
|
+
i = fence.end + 1
|
|
139
|
+
continue
|
|
140
|
+
}
|
|
141
|
+
if (trimmed === '{quote}') {
|
|
142
|
+
const fence = collectFence(lines, i, '{quote}')
|
|
143
|
+
blocks.push({ type: 'quote', children: parseInline(fence.body.replace(/\n/g, ' ')) })
|
|
144
|
+
i = fence.end + 1
|
|
145
|
+
continue
|
|
146
|
+
}
|
|
147
|
+
const panelOpen = /^\{panel(?::title=([^}]+))?\}$/.exec(trimmed)
|
|
148
|
+
if (panelOpen) {
|
|
149
|
+
const fence = collectFence(lines, i, '{panel}')
|
|
150
|
+
blocks.push({
|
|
151
|
+
type: 'panel',
|
|
152
|
+
title: panelOpen[1],
|
|
153
|
+
children: parseJiraWiki(fence.body),
|
|
154
|
+
})
|
|
155
|
+
i = fence.end + 1
|
|
156
|
+
continue
|
|
157
|
+
}
|
|
158
|
+
if (isTableRow(trimmed)) {
|
|
159
|
+
const collected: { header: boolean; cells: WikiInline[][] }[] = []
|
|
160
|
+
while (i < lines.length) {
|
|
161
|
+
const row = lines[i]?.trim() ?? ''
|
|
162
|
+
if (!isTableRow(row)) break
|
|
163
|
+
const header = row.startsWith('||')
|
|
164
|
+
collected.push({ header, cells: splitCells(row, header ? '||' : '|') })
|
|
165
|
+
i += 1
|
|
166
|
+
}
|
|
167
|
+
const headerRows = collected.filter(row => row.header).map(row => row.cells)
|
|
168
|
+
const rows = collected.filter(row => !row.header).map(row => row.cells)
|
|
169
|
+
const header = headerRows[0] ?? rows.shift() ?? []
|
|
170
|
+
blocks.push({ type: 'table', header, rows })
|
|
171
|
+
continue
|
|
172
|
+
}
|
|
173
|
+
if (/^[*#-]\s+/.test(trimmed)) {
|
|
174
|
+
const ordered = trimmed.startsWith('#')
|
|
175
|
+
const items: WikiInline[][] = []
|
|
176
|
+
while (i < lines.length) {
|
|
177
|
+
const item = lines[i]?.trim() ?? ''
|
|
178
|
+
const match = ordered ? /^#\s+(.*)$/.exec(item) : /^[*#-]\s+(.*)$/.exec(item)
|
|
179
|
+
if (!match) break
|
|
180
|
+
items.push(parseInline(match[1] ?? ''))
|
|
181
|
+
i += 1
|
|
182
|
+
}
|
|
183
|
+
blocks.push({ type: 'list', ordered, items })
|
|
184
|
+
continue
|
|
185
|
+
}
|
|
186
|
+
const para: string[] = [trimmed]
|
|
187
|
+
i += 1
|
|
188
|
+
while (i < lines.length) {
|
|
189
|
+
const next = lines[i]?.trim() ?? ''
|
|
190
|
+
if (!next || /^(h[1-6]\.|----|\{code|\{panel|\{quote|\{noformat|\||[*#-]\s)/.test(next)) break
|
|
191
|
+
para.push(next)
|
|
192
|
+
i += 1
|
|
193
|
+
}
|
|
194
|
+
blocks.push({ type: 'paragraph', children: parseInline(para.join(' ')) })
|
|
195
|
+
}
|
|
196
|
+
return blocks
|
|
197
|
+
}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import { Paperclip } from 'lucide-react'
|
|
4
|
+
|
|
5
|
+
import { cn } from '@mohou/ui/lib/utils'
|
|
6
|
+
import { skipUndef } from '@mohou/ui/lib/defined'
|
|
7
|
+
import { useLabels } from '@mohou/ui/i18n/context'
|
|
8
|
+
import {
|
|
9
|
+
parseJiraWiki,
|
|
10
|
+
type WikiBlock,
|
|
11
|
+
type WikiInline,
|
|
12
|
+
} from './jira-wiki-parse'
|
|
13
|
+
|
|
14
|
+
export type JiraWikiClassNames = {
|
|
15
|
+
root?: string | undefined
|
|
16
|
+
heading?: string | undefined
|
|
17
|
+
paragraph?: string | undefined
|
|
18
|
+
list?: string | undefined
|
|
19
|
+
listItem?: string | undefined
|
|
20
|
+
code?: string | undefined
|
|
21
|
+
inlineCode?: string | undefined
|
|
22
|
+
quote?: string | undefined
|
|
23
|
+
panel?: string | undefined
|
|
24
|
+
panelTitle?: string | undefined
|
|
25
|
+
table?: string | undefined
|
|
26
|
+
th?: string | undefined
|
|
27
|
+
td?: string | undefined
|
|
28
|
+
hr?: string | undefined
|
|
29
|
+
link?: string | undefined
|
|
30
|
+
attachment?: string | undefined
|
|
31
|
+
strike?: string | undefined
|
|
32
|
+
bold?: string | undefined
|
|
33
|
+
italic?: string | undefined
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function InlineView({
|
|
37
|
+
nodes,
|
|
38
|
+
classNames,
|
|
39
|
+
onAttachmentClick,
|
|
40
|
+
}: {
|
|
41
|
+
nodes: WikiInline[]
|
|
42
|
+
classNames?: JiraWikiClassNames | undefined
|
|
43
|
+
onAttachmentClick?: ((name: string) => void) | undefined
|
|
44
|
+
}) {
|
|
45
|
+
const extra = skipUndef({ classNames, onAttachmentClick })
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
{nodes.map((node, index) => {
|
|
49
|
+
if (node.type === 'text') return <span key={index}>{node.value}</span>
|
|
50
|
+
if (node.type === 'bold')
|
|
51
|
+
return (
|
|
52
|
+
<strong key={index} className={cn('font-semibold', classNames?.bold)}>
|
|
53
|
+
<InlineView nodes={node.children} {...extra} />
|
|
54
|
+
</strong>
|
|
55
|
+
)
|
|
56
|
+
if (node.type === 'italic')
|
|
57
|
+
return (
|
|
58
|
+
<em key={index} className={cn('italic', classNames?.italic)}>
|
|
59
|
+
<InlineView nodes={node.children} {...extra} />
|
|
60
|
+
</em>
|
|
61
|
+
)
|
|
62
|
+
if (node.type === 'strike')
|
|
63
|
+
return (
|
|
64
|
+
<s key={index} className={cn('text-muted-foreground', classNames?.strike)}>
|
|
65
|
+
<InlineView nodes={node.children} {...extra} />
|
|
66
|
+
</s>
|
|
67
|
+
)
|
|
68
|
+
if (node.type === 'code')
|
|
69
|
+
return (
|
|
70
|
+
<code
|
|
71
|
+
key={index}
|
|
72
|
+
className={cn('rounded-md bg-muted px-1 py-0.5 font-mono text-[0.85em]', classNames?.inlineCode)}
|
|
73
|
+
>
|
|
74
|
+
{node.value}
|
|
75
|
+
</code>
|
|
76
|
+
)
|
|
77
|
+
if (node.type === 'attachment')
|
|
78
|
+
return (
|
|
79
|
+
<button
|
|
80
|
+
key={index}
|
|
81
|
+
type="button"
|
|
82
|
+
className={cn(
|
|
83
|
+
'inline-flex items-center gap-1 rounded-md border bg-muted/50 px-1.5 py-0.5 align-middle text-xs font-medium hover:bg-muted',
|
|
84
|
+
classNames?.attachment,
|
|
85
|
+
)}
|
|
86
|
+
onClick={() => onAttachmentClick?.(node.name)}
|
|
87
|
+
>
|
|
88
|
+
<Paperclip className="size-3" />
|
|
89
|
+
{node.name}
|
|
90
|
+
</button>
|
|
91
|
+
)
|
|
92
|
+
return (
|
|
93
|
+
<a
|
|
94
|
+
key={index}
|
|
95
|
+
href={node.href}
|
|
96
|
+
className={cn('text-primary underline decoration-primary/40 underline-offset-2 hover:decoration-primary', classNames?.link)}
|
|
97
|
+
target="_blank"
|
|
98
|
+
rel="noreferrer"
|
|
99
|
+
>
|
|
100
|
+
{node.label}
|
|
101
|
+
</a>
|
|
102
|
+
)
|
|
103
|
+
})}
|
|
104
|
+
</>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function Blocks({
|
|
109
|
+
blocks,
|
|
110
|
+
classNames,
|
|
111
|
+
onAttachmentClick,
|
|
112
|
+
}: {
|
|
113
|
+
blocks: WikiBlock[]
|
|
114
|
+
classNames?: JiraWikiClassNames | undefined
|
|
115
|
+
onAttachmentClick?: ((name: string) => void) | undefined
|
|
116
|
+
}) {
|
|
117
|
+
const inline = skipUndef({ classNames, onAttachmentClick })
|
|
118
|
+
return (
|
|
119
|
+
<>
|
|
120
|
+
{blocks.map((block, index) => {
|
|
121
|
+
if (block.type === 'heading') {
|
|
122
|
+
const level = Math.min(6, Math.max(1, block.level))
|
|
123
|
+
return React.createElement(
|
|
124
|
+
`h${level}`,
|
|
125
|
+
{
|
|
126
|
+
key: index,
|
|
127
|
+
className: cn(
|
|
128
|
+
'font-semibold tracking-tight first:mt-0',
|
|
129
|
+
level <= 1 && 'mt-6 mb-2 text-xl',
|
|
130
|
+
level === 2 && 'mt-5 mb-2 text-base',
|
|
131
|
+
level >= 3 && 'mt-4 mb-1.5 text-sm',
|
|
132
|
+
classNames?.heading,
|
|
133
|
+
),
|
|
134
|
+
},
|
|
135
|
+
<InlineView nodes={block.children} {...inline} />,
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
if (block.type === 'paragraph')
|
|
139
|
+
return (
|
|
140
|
+
<p key={index} className={cn('mb-3 last:mb-0', classNames?.paragraph)}>
|
|
141
|
+
<InlineView nodes={block.children} {...inline} />
|
|
142
|
+
</p>
|
|
143
|
+
)
|
|
144
|
+
if (block.type === 'list') {
|
|
145
|
+
const Tag = block.ordered ? 'ol' : 'ul'
|
|
146
|
+
return (
|
|
147
|
+
<Tag
|
|
148
|
+
key={index}
|
|
149
|
+
className={cn(
|
|
150
|
+
'mb-3 ml-5 space-y-1 last:mb-0',
|
|
151
|
+
block.ordered ? 'list-decimal' : 'list-disc',
|
|
152
|
+
classNames?.list,
|
|
153
|
+
)}
|
|
154
|
+
>
|
|
155
|
+
{block.items.map((item, itemIndex) => (
|
|
156
|
+
<li key={itemIndex} className={cn('pl-0.5', classNames?.listItem)}>
|
|
157
|
+
<InlineView nodes={item} {...inline} />
|
|
158
|
+
</li>
|
|
159
|
+
))}
|
|
160
|
+
</Tag>
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
if (block.type === 'code')
|
|
164
|
+
return (
|
|
165
|
+
<pre
|
|
166
|
+
key={index}
|
|
167
|
+
className={cn(
|
|
168
|
+
'mb-3 overflow-auto rounded-lg border bg-muted/40 p-3 font-mono text-[0.85em] last:mb-0',
|
|
169
|
+
classNames?.code,
|
|
170
|
+
)}
|
|
171
|
+
>
|
|
172
|
+
<code>{block.value}</code>
|
|
173
|
+
</pre>
|
|
174
|
+
)
|
|
175
|
+
if (block.type === 'quote')
|
|
176
|
+
return (
|
|
177
|
+
<blockquote
|
|
178
|
+
key={index}
|
|
179
|
+
className={cn(
|
|
180
|
+
'mb-3 border-l-2 border-foreground/20 pl-3 text-muted-foreground italic last:mb-0',
|
|
181
|
+
classNames?.quote,
|
|
182
|
+
)}
|
|
183
|
+
>
|
|
184
|
+
<InlineView nodes={block.children} {...inline} />
|
|
185
|
+
</blockquote>
|
|
186
|
+
)
|
|
187
|
+
if (block.type === 'panel')
|
|
188
|
+
return (
|
|
189
|
+
<div
|
|
190
|
+
key={index}
|
|
191
|
+
className={cn(
|
|
192
|
+
'mb-3 rounded-lg border border-l-2 border-l-primary/70 bg-muted/30 px-3 py-2 last:mb-0',
|
|
193
|
+
classNames?.panel,
|
|
194
|
+
)}
|
|
195
|
+
>
|
|
196
|
+
{block.title ? (
|
|
197
|
+
<div className={cn('mb-1 text-xs font-semibold tracking-wide uppercase', classNames?.panelTitle)}>
|
|
198
|
+
{block.title}
|
|
199
|
+
</div>
|
|
200
|
+
) : null}
|
|
201
|
+
<Blocks blocks={block.children} {...inline} />
|
|
202
|
+
</div>
|
|
203
|
+
)
|
|
204
|
+
if (block.type === 'table')
|
|
205
|
+
return (
|
|
206
|
+
<div key={index} className="mb-3 overflow-x-auto last:mb-0">
|
|
207
|
+
<table className={cn('w-full border-collapse overflow-hidden rounded-lg text-sm', classNames?.table)}>
|
|
208
|
+
{block.header.length ? (
|
|
209
|
+
<thead>
|
|
210
|
+
<tr>
|
|
211
|
+
{block.header.map((cell, cellIndex) => (
|
|
212
|
+
<th
|
|
213
|
+
key={cellIndex}
|
|
214
|
+
className={cn(
|
|
215
|
+
'border border-border bg-muted/60 px-2.5 py-1.5 text-left text-xs font-semibold',
|
|
216
|
+
classNames?.th,
|
|
217
|
+
)}
|
|
218
|
+
>
|
|
219
|
+
<InlineView nodes={cell} {...inline} />
|
|
220
|
+
</th>
|
|
221
|
+
))}
|
|
222
|
+
</tr>
|
|
223
|
+
</thead>
|
|
224
|
+
) : null}
|
|
225
|
+
<tbody>
|
|
226
|
+
{block.rows.map((row, rowIndex) => (
|
|
227
|
+
<tr key={rowIndex}>
|
|
228
|
+
{row.map((cell, cellIndex) => (
|
|
229
|
+
<td
|
|
230
|
+
key={cellIndex}
|
|
231
|
+
className={cn('border border-border px-2.5 py-1.5', classNames?.td)}
|
|
232
|
+
>
|
|
233
|
+
<InlineView nodes={cell} {...inline} />
|
|
234
|
+
</td>
|
|
235
|
+
))}
|
|
236
|
+
</tr>
|
|
237
|
+
))}
|
|
238
|
+
</tbody>
|
|
239
|
+
</table>
|
|
240
|
+
</div>
|
|
241
|
+
)
|
|
242
|
+
return <hr key={index} className={cn('my-4 border-border', classNames?.hr)} />
|
|
243
|
+
})}
|
|
244
|
+
</>
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Render Jira wiki markup to tokens (headings, lists, tables, [^file], -strike-).
|
|
250
|
+
* Style via className / classNames; full control via parseJiraWiki().
|
|
251
|
+
* @when Jira description / comment body
|
|
252
|
+
* @example
|
|
253
|
+
* <JiraWiki classNames={{ heading: "text-base" }}>{`h2. Title\n* item`}</JiraWiki>
|
|
254
|
+
* @family Rich text
|
|
255
|
+
*/
|
|
256
|
+
export function JiraWiki({
|
|
257
|
+
children,
|
|
258
|
+
className,
|
|
259
|
+
classNames,
|
|
260
|
+
onAttachmentClick,
|
|
261
|
+
}: {
|
|
262
|
+
children: string
|
|
263
|
+
className?: string | undefined
|
|
264
|
+
classNames?: JiraWikiClassNames | undefined
|
|
265
|
+
onAttachmentClick?: ((name: string) => void) | undefined
|
|
266
|
+
}) {
|
|
267
|
+
const t = useLabels('jiraWiki')
|
|
268
|
+
const blocks = parseJiraWiki(children)
|
|
269
|
+
if (!blocks.length) {
|
|
270
|
+
return (
|
|
271
|
+
<p data-testid="jira-wiki" className={cn('text-muted-foreground text-sm', classNames?.root, className)}>
|
|
272
|
+
{t.empty}
|
|
273
|
+
</p>
|
|
274
|
+
)
|
|
275
|
+
}
|
|
276
|
+
return (
|
|
277
|
+
<div
|
|
278
|
+
data-testid="jira-wiki"
|
|
279
|
+
className={cn('text-sm leading-relaxed text-foreground', classNames?.root, className)}
|
|
280
|
+
>
|
|
281
|
+
<Blocks blocks={blocks} {...skipUndef({ classNames, onAttachmentClick })} />
|
|
282
|
+
</div>
|
|
283
|
+
)
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
export { parseJiraWiki } from './jira-wiki-parse'
|
|
287
|
+
export type { WikiBlock, WikiInline } from './jira-wiki-parse'
|