@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,391 @@
|
|
|
1
|
+
|
|
2
|
+
import { useEffect, useRef, useState } from 'react'
|
|
3
|
+
|
|
4
|
+
import { useHtmlDark } from '@mohou/ui/hooks/use-html-dark'
|
|
5
|
+
import { useLabels } from '@mohou/ui/i18n/context'
|
|
6
|
+
import { cn } from '@mohou/ui/lib/utils'
|
|
7
|
+
|
|
8
|
+
export type JqlSuggestItem = { name: string; type?: string | undefined }
|
|
9
|
+
|
|
10
|
+
/** JQL words that are never a field name or a value. */
|
|
11
|
+
const KEYWORDS = [
|
|
12
|
+
'AND',
|
|
13
|
+
'OR',
|
|
14
|
+
'NOT',
|
|
15
|
+
'IN',
|
|
16
|
+
'IS',
|
|
17
|
+
'EMPTY',
|
|
18
|
+
'NULL',
|
|
19
|
+
'WAS',
|
|
20
|
+
'CHANGED',
|
|
21
|
+
'ON',
|
|
22
|
+
'BY',
|
|
23
|
+
'ORDER',
|
|
24
|
+
'GROUP',
|
|
25
|
+
'ASC',
|
|
26
|
+
'DESC',
|
|
27
|
+
'BEFORE',
|
|
28
|
+
'AFTER',
|
|
29
|
+
'DURING',
|
|
30
|
+
'FOLLOWED',
|
|
31
|
+
'TO',
|
|
32
|
+
'FROM',
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
const OPERATORS = ['=', '!=', '>', '>=', '<', '<=', '~', '!~']
|
|
36
|
+
|
|
37
|
+
/** Words that start a clause, so `ORDER` + `BY` completes as one pair. */
|
|
38
|
+
const PHRASES = ['ORDER BY', 'GROUP BY', 'IS EMPTY', 'IS NOT NULL', 'FOLLOWED BY', 'CHANGED ON', 'WAS BEFORE', 'IN (']
|
|
39
|
+
|
|
40
|
+
const FUNCTIONS = [
|
|
41
|
+
'now()',
|
|
42
|
+
'startOfDay()',
|
|
43
|
+
'startOfWeek()',
|
|
44
|
+
'startOfMonth()',
|
|
45
|
+
'startOfQuarter()',
|
|
46
|
+
'startOfYear()',
|
|
47
|
+
'-1d',
|
|
48
|
+
'-7d',
|
|
49
|
+
'+2w',
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
function bare(module: unknown): Record<string, unknown> {
|
|
53
|
+
if (typeof module !== 'object' || module === null) return {}
|
|
54
|
+
const record = module as Record<string, unknown>
|
|
55
|
+
const nested = record.default
|
|
56
|
+
if (typeof nested === 'object' && nested !== null) return nested as Record<string, unknown>
|
|
57
|
+
return record
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
type CmView = {
|
|
61
|
+
state: { doc: { toString(): string; length: number } }
|
|
62
|
+
destroy(): void
|
|
63
|
+
dispatch(change: { changes: { from: number; to: number; insert: string } }): void
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
type CmUpdate = {
|
|
67
|
+
docChanged: boolean
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
type CompletionContext = {
|
|
71
|
+
state: { doc: { sliceString(from: number, to: number): string } }
|
|
72
|
+
pos: number
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
type EditorViewCtor = {
|
|
76
|
+
new (config: { parent: HTMLElement; doc: string; extensions: unknown[] }): CmView
|
|
77
|
+
lineWrapping: unknown
|
|
78
|
+
theme(spec: unknown): unknown
|
|
79
|
+
darkTheme: { of(value: boolean): unknown }
|
|
80
|
+
updateListener: { of(listener: (update: CmUpdate) => void): unknown }
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
type CmCore = {
|
|
84
|
+
EditorView: EditorViewCtor
|
|
85
|
+
keymap: { of(value: unknown): unknown }
|
|
86
|
+
placeholder: (text: string) => unknown
|
|
87
|
+
syntaxHighlighting: (style: unknown) => unknown
|
|
88
|
+
HighlightStyle: { define(spec: unknown): unknown }
|
|
89
|
+
StreamLanguage: { define(spec: { name: string; token(stream: TokenStream): string | null }): unknown }
|
|
90
|
+
autocompletion: (config: unknown) => unknown
|
|
91
|
+
completionKeymap: unknown
|
|
92
|
+
tags: Record<string, unknown>
|
|
93
|
+
EditorState: unknown
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** CodeMirror 6 core, loaded once per page (esm.sh, never npm). */
|
|
97
|
+
let corePromise: Promise<CmCore> | null = null
|
|
98
|
+
function loadCore(): Promise<CmCore> {
|
|
99
|
+
corePromise ??= (async () => {
|
|
100
|
+
const [viewMod, stateMod, langMod, acMod, tagsMod] = await Promise.all([
|
|
101
|
+
import('https://esm.sh/@codemirror/view@6'),
|
|
102
|
+
import('https://esm.sh/@codemirror/state@6'),
|
|
103
|
+
import('https://esm.sh/@codemirror/language@6'),
|
|
104
|
+
import('https://esm.sh/@codemirror/autocomplete@6'),
|
|
105
|
+
import('https://esm.sh/@lezer/highlight@1'),
|
|
106
|
+
])
|
|
107
|
+
const view = bare(viewMod)
|
|
108
|
+
const state = bare(stateMod)
|
|
109
|
+
const lang = bare(langMod)
|
|
110
|
+
const ac = bare(acMod)
|
|
111
|
+
const hl = bare(tagsMod)
|
|
112
|
+
return {
|
|
113
|
+
EditorView: view.EditorView as CmCore['EditorView'],
|
|
114
|
+
keymap: view.keymap as CmCore['keymap'],
|
|
115
|
+
placeholder: view.placeholder as CmCore['placeholder'],
|
|
116
|
+
EditorState: state.EditorState,
|
|
117
|
+
syntaxHighlighting: lang.syntaxHighlighting as CmCore['syntaxHighlighting'],
|
|
118
|
+
HighlightStyle: lang.HighlightStyle as CmCore['HighlightStyle'],
|
|
119
|
+
StreamLanguage: lang.StreamLanguage as CmCore['StreamLanguage'],
|
|
120
|
+
autocompletion: ac.autocompletion as CmCore['autocompletion'],
|
|
121
|
+
completionKeymap: ac.completionKeymap,
|
|
122
|
+
tags: (hl.tags ?? {}) as CmCore['tags'],
|
|
123
|
+
}
|
|
124
|
+
})().catch((err) => {
|
|
125
|
+
corePromise = null
|
|
126
|
+
throw err
|
|
127
|
+
})
|
|
128
|
+
return corePromise
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Stream tokenizer: `"quoted"` / `'quoted'`, numbers, dates, relative intervals,
|
|
133
|
+
* operators, keywords, then a word is a **field** when an operator follows it.
|
|
134
|
+
*/
|
|
135
|
+
/**
|
|
136
|
+
* The subset of CodeMirror's `StringStream` this tokenizer touches. `StreamLanguage` arrives
|
|
137
|
+
* as `any` (the module is loaded from a CDN at runtime), so without this the `token`
|
|
138
|
+
* parameter silently degrades to an implicit any and the guard calls go unchecked.
|
|
139
|
+
*/
|
|
140
|
+
type TokenStream = {
|
|
141
|
+
eatSpace(): boolean
|
|
142
|
+
next(): string | false
|
|
143
|
+
match(re: RegExp, consume?: boolean): RegExpMatchArray | null | undefined
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function jqlLanguage(core: CmCore) {
|
|
147
|
+
const kw = new Set(KEYWORDS)
|
|
148
|
+
return core.StreamLanguage.define({
|
|
149
|
+
name: 'jql',
|
|
150
|
+
token(stream: TokenStream) {
|
|
151
|
+
if (stream.eatSpace()) return null
|
|
152
|
+
if (stream.match(/^'[^']*'/) || stream.match(/^"[^"]*"/)) return 'string'
|
|
153
|
+
if (stream.match(/^[+-]?\d+(h|d|w|mo|q|y)\b/)) return 'number'
|
|
154
|
+
if (stream.match(/^\d{4}-\d{2}-\d{2}/)) return 'number'
|
|
155
|
+
if (stream.match(/^[+-]?\d+(\.\d+)?/)) return 'number'
|
|
156
|
+
if (stream.match(/^(!=|>=|<=|!~|=|>|<|~)/)) return 'operator'
|
|
157
|
+
if (stream.match(/^[,()[\]]/)) return 'operator'
|
|
158
|
+
const word = stream.match(/^[A-Za-z_][\w.()-]*/)
|
|
159
|
+
if (word) {
|
|
160
|
+
const raw = String(word[0])
|
|
161
|
+
if (kw.has(raw.toUpperCase())) return 'keyword'
|
|
162
|
+
const followedByOp =
|
|
163
|
+
stream.match(/^\s*(=|!=|>=|<=|>|<|~|!~)/, false) ||
|
|
164
|
+
stream.match(/^\s*(IN|IS|WAS|CHANGED|FOLLOWED|ORDER|GROUP)\b/i, false)
|
|
165
|
+
return followedByOp ? 'property' : 'value'
|
|
166
|
+
}
|
|
167
|
+
if (stream.match(/^[^\s]+/)) return 'value'
|
|
168
|
+
stream.next()
|
|
169
|
+
return null
|
|
170
|
+
},
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** Token classes are coloured from CSS vars so light/dark and palettes apply. */
|
|
175
|
+
function jqlHighlight(core: CmCore) {
|
|
176
|
+
const { tags } = core
|
|
177
|
+
return core.HighlightStyle.define([
|
|
178
|
+
{ tag: tags.keyword, class: 'cm-jql-kw' },
|
|
179
|
+
{ tag: tags.propertyName, class: 'cm-jql-prop' },
|
|
180
|
+
{ tag: tags.string, class: 'cm-jql-str' },
|
|
181
|
+
{ tag: tags.number, class: 'cm-jql-num' },
|
|
182
|
+
{ tag: tags.operator, class: 'cm-jql-op' },
|
|
183
|
+
])
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function jqlTheme(core: CmCore, dark: boolean) {
|
|
187
|
+
return core.EditorView.theme({
|
|
188
|
+
'&': { backgroundColor: 'transparent', color: 'var(--foreground)', height: '100%' },
|
|
189
|
+
'.cm-scroller': { overflow: 'auto', fontFamily: 'var(--font-mono, ui-monospace, monospace)' },
|
|
190
|
+
'.cm-content': { caretColor: 'var(--foreground)', padding: '8px 12px' },
|
|
191
|
+
'.cm-cursor, .cm-dropCursor': { borderLeftColor: 'var(--foreground)' },
|
|
192
|
+
'.cm-activeLine': { backgroundColor: 'transparent' },
|
|
193
|
+
'.cm-selectionBackground, ::selection': {
|
|
194
|
+
backgroundColor: dark ? 'rgba(99,130,255,.32)' : 'color-mix(in oklch, var(--primary) 22%, transparent)',
|
|
195
|
+
},
|
|
196
|
+
'.cm-jql-kw': { color: 'var(--primary)', fontWeight: '600' },
|
|
197
|
+
'.cm-jql-prop': { color: 'var(--foreground)', fontWeight: '600' },
|
|
198
|
+
'.cm-jql-str': { color: 'var(--secondary)' },
|
|
199
|
+
'.cm-jql-num': { color: 'var(--accent)' },
|
|
200
|
+
'.cm-jql-op': { color: 'var(--muted-foreground)' },
|
|
201
|
+
// Completion pop-up follows the panel tokens instead of CM's defaults.
|
|
202
|
+
'.cm-tooltip': {
|
|
203
|
+
backgroundColor: 'var(--card)',
|
|
204
|
+
border: '1px solid var(--border)',
|
|
205
|
+
borderRadius: '10px',
|
|
206
|
+
color: 'var(--card-foreground)',
|
|
207
|
+
fontSize: '12px',
|
|
208
|
+
},
|
|
209
|
+
'.cm-tooltip-autocomplete ul li[aria-selected]': {
|
|
210
|
+
backgroundColor: 'color-mix(in oklch, var(--primary) 18%, transparent)',
|
|
211
|
+
color: 'var(--card-foreground)',
|
|
212
|
+
},
|
|
213
|
+
})
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
type Opt = { label: string; detail?: string | undefined; type?: string | undefined; boost?: number | undefined }
|
|
217
|
+
|
|
218
|
+
function optionFor(name: string, kind: string): Opt {
|
|
219
|
+
return { label: name, type: kind }
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Field names → operators → values, based on what precedes the cursor.
|
|
224
|
+
*/
|
|
225
|
+
function complete(fields: JqlSuggestItem[]) {
|
|
226
|
+
const fieldNames = fields.map(f => f.name)
|
|
227
|
+
const byName = new Map(fields.map(f => [f.name, f]))
|
|
228
|
+
const WORD = /([\w."'-]*)$/
|
|
229
|
+
|
|
230
|
+
return (ctx: CompletionContext) => {
|
|
231
|
+
const before = ctx.state.doc.sliceString(0, ctx.pos)
|
|
232
|
+
const word = String(WORD.exec(before)?.[0] ?? '')
|
|
233
|
+
const from = ctx.pos - word.length
|
|
234
|
+
const clause = before.slice(before.lastIndexOf('\n') + 1)
|
|
235
|
+
const options: Opt[] = []
|
|
236
|
+
|
|
237
|
+
// `field <op> ` → values for that field (plus functions and phrases).
|
|
238
|
+
const assign = /([\w.]+)\s*(=|!=|>=|<=|>|<|~|!~|IS|IN|WAS)\s*$/i.exec(clause)
|
|
239
|
+
if (assign) {
|
|
240
|
+
const name = assign[1]
|
|
241
|
+
if (name !== undefined && byName.has(name)) {
|
|
242
|
+
// quoted literal first, then the values worth trying for this field
|
|
243
|
+
options.push({ label: '\"...\"', detail: 'literal', type: 'text', boost: 999 })
|
|
244
|
+
for (const v of sampleValues(name)) options.push({ label: v, detail: name, type: 'value', boost: 500 })
|
|
245
|
+
}
|
|
246
|
+
for (const fn of FUNCTIONS) options.push({ label: fn, detail: 'jql value', type: 'function', boost: 400 })
|
|
247
|
+
return { from, options, validFor: /^[\w."'-]*$/ }
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Just typed a field name → offer operators.
|
|
251
|
+
if (/([\w.]+)\s*$/i.test(clause) && !/\s(and|or|not|by|in|is|was)$/i.test(clause)) {
|
|
252
|
+
for (const op of OPERATORS) options.push({ label: op, type: 'operator', boost: 600 })
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Otherwise: fields and clause keywords.
|
|
256
|
+
for (const f of fieldNames) options.push(optionFor(f, 'property'))
|
|
257
|
+
for (const p of PHRASES) options.push({ label: p, type: 'keyword', boost: -100 })
|
|
258
|
+
for (const k of KEYWORDS) options.push({ label: k, type: 'keyword', boost: -200 })
|
|
259
|
+
return { from, options, validFor: /^[\w."'-]*$/ }
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** Values worth offering per field — real installs would fetch these from the backend. */
|
|
264
|
+
function sampleValues(field: string): string[] {
|
|
265
|
+
const table: Record<string, string[]> = {
|
|
266
|
+
status: ['Open', 'In Progress', 'Blocked', 'Done'],
|
|
267
|
+
assignee: ['currentUser()', 'pwang12', 'unassigned'],
|
|
268
|
+
reporter: ['currentUser()'],
|
|
269
|
+
priority: ['Blocker', 'Critical', 'Major', 'Minor', 'Trivial'],
|
|
270
|
+
resolution: ['Done', "Won't Do", 'Duplicate'],
|
|
271
|
+
issuetype: ['Bug', 'Task', 'Story', 'Sub-task'],
|
|
272
|
+
labels: ['cn', 'stg', 'hotfix'],
|
|
273
|
+
project: ['TMS', 'GLS', 'LMA'],
|
|
274
|
+
}
|
|
275
|
+
return table[field.toLowerCase()] ?? []
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* JQL query field: CodeMirror 6 (esm.sh, on demand) with syntax highlighting and
|
|
280
|
+
* field/operator/value completion that opens as you type. Falls back to a plain
|
|
281
|
+
* textarea when the CDN is unreachable — the query still edits.
|
|
282
|
+
* @when Issue search / saved filters. Needs a real field list: pass `fields`.
|
|
283
|
+
* @example
|
|
284
|
+
* <JqlInput value={jql} onChange={setJql} fields={[{ name: "status" }, { name: "assignee" }]} />
|
|
285
|
+
* @family Form
|
|
286
|
+
*/
|
|
287
|
+
export function JqlInput({
|
|
288
|
+
value,
|
|
289
|
+
onChange,
|
|
290
|
+
fields = [],
|
|
291
|
+
className,
|
|
292
|
+
height = '88px',
|
|
293
|
+
}: {
|
|
294
|
+
value: string
|
|
295
|
+
onChange?: (value: string) => void
|
|
296
|
+
/** Field names offered by completion (from your JQL backend). */
|
|
297
|
+
fields?: JqlSuggestItem[] | undefined
|
|
298
|
+
className?: string | undefined
|
|
299
|
+
height?: string | undefined
|
|
300
|
+
}) {
|
|
301
|
+
const t = useLabels('jqlInput')
|
|
302
|
+
const hostRef = useRef<HTMLDivElement>(null)
|
|
303
|
+
const viewRef = useRef<CmView | null>(null)
|
|
304
|
+
const onChangeRef = useRef(onChange)
|
|
305
|
+
onChangeRef.current = onChange
|
|
306
|
+
const valueRef = useRef(value)
|
|
307
|
+
valueRef.current = value
|
|
308
|
+
const fieldsRef = useRef(fields)
|
|
309
|
+
fieldsRef.current = fields
|
|
310
|
+
const [cm, setCm] = useState(false)
|
|
311
|
+
const dark = useHtmlDark()
|
|
312
|
+
|
|
313
|
+
useEffect(() => {
|
|
314
|
+
if (!hostRef.current) return
|
|
315
|
+
let cancelled = false
|
|
316
|
+
;(async () => {
|
|
317
|
+
try {
|
|
318
|
+
const core = await loadCore()
|
|
319
|
+
if (cancelled || !hostRef.current) return
|
|
320
|
+
const view = new core.EditorView({
|
|
321
|
+
parent: hostRef.current,
|
|
322
|
+
doc: valueRef.current,
|
|
323
|
+
extensions: [
|
|
324
|
+
core.EditorView.lineWrapping,
|
|
325
|
+
jqlLanguage(core),
|
|
326
|
+
core.syntaxHighlighting(jqlHighlight(core)),
|
|
327
|
+
core.EditorView.darkTheme.of(dark),
|
|
328
|
+
jqlTheme(core, dark),
|
|
329
|
+
core.placeholder(t.placeholder),
|
|
330
|
+
core.autocompletion({
|
|
331
|
+
activateOnTyping: true,
|
|
332
|
+
icons: false,
|
|
333
|
+
defaultTable: undefined,
|
|
334
|
+
override: [complete(fieldsRef.current)],
|
|
335
|
+
}),
|
|
336
|
+
core.keymap.of(core.completionKeymap),
|
|
337
|
+
core.EditorView.updateListener.of((update: CmUpdate) => {
|
|
338
|
+
if (update.docChanged) onChangeRef.current?.(view.state.doc.toString())
|
|
339
|
+
}),
|
|
340
|
+
],
|
|
341
|
+
})
|
|
342
|
+
viewRef.current = view
|
|
343
|
+
setCm(true)
|
|
344
|
+
} catch (err) {
|
|
345
|
+
// CDN down or build failure: the textarea fallback still edits the query.
|
|
346
|
+
console.warn('[JqlInput] CodeMirror unavailable, using plain textarea', err)
|
|
347
|
+
}
|
|
348
|
+
})()
|
|
349
|
+
return () => {
|
|
350
|
+
cancelled = true
|
|
351
|
+
viewRef.current?.destroy()
|
|
352
|
+
viewRef.current = null
|
|
353
|
+
}
|
|
354
|
+
// `fields` is read through a ref so a new list never remounts the editor.
|
|
355
|
+
}, [dark, t.placeholder])
|
|
356
|
+
|
|
357
|
+
useEffect(() => {
|
|
358
|
+
const view = viewRef.current
|
|
359
|
+
if (!view) return
|
|
360
|
+
const cur = view.state.doc.toString()
|
|
361
|
+
if (value === cur) return
|
|
362
|
+
view.dispatch({ changes: { from: 0, to: view.state.doc.length, insert: value } })
|
|
363
|
+
}, [value])
|
|
364
|
+
|
|
365
|
+
return (
|
|
366
|
+
<div
|
|
367
|
+
className={cn(
|
|
368
|
+
'overflow-hidden rounded-xl border border-border bg-card',
|
|
369
|
+
className,
|
|
370
|
+
)}
|
|
371
|
+
>
|
|
372
|
+
{!cm && (
|
|
373
|
+
<textarea
|
|
374
|
+
data-testid="jql-input"
|
|
375
|
+
value={value}
|
|
376
|
+
onChange={e => onChange?.(e.target.value)}
|
|
377
|
+
placeholder={t.placeholder}
|
|
378
|
+
spellCheck={false}
|
|
379
|
+
className="w-full resize-y overflow-auto bg-transparent px-3 py-2 font-mono text-xs leading-6 outline-none"
|
|
380
|
+
style={{ height }}
|
|
381
|
+
/>
|
|
382
|
+
)}
|
|
383
|
+
<div
|
|
384
|
+
ref={hostRef}
|
|
385
|
+
data-testid={cm ? 'jql-input' : undefined}
|
|
386
|
+
className={cn('[&_.cm-editor]:h-full [&_.cm-editor]:outline-none', !cm && 'hidden')}
|
|
387
|
+
style={{ height: cm ? height : undefined, minHeight: cm ? height : 0 }}
|
|
388
|
+
/>
|
|
389
|
+
</div>
|
|
390
|
+
)
|
|
391
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
function Node({ label, value, depth }: { label?: string; value: unknown; depth: number }) {
|
|
5
|
+
const [open, setOpen] = React.useState(depth < 2)
|
|
6
|
+
if (value !== null && typeof value === 'object') {
|
|
7
|
+
const entries = Object.entries(value as Record<string, unknown>)
|
|
8
|
+
return (
|
|
9
|
+
<div style={{ paddingLeft: depth * 12 }}>
|
|
10
|
+
<button type="button" className="text-left font-mono text-xs" onClick={() => setOpen(v => !v)}>
|
|
11
|
+
{open ? '▾' : '▸'} {label ? `${label}: ` : ''}
|
|
12
|
+
{Array.isArray(value) ? `Array(${entries.length})` : 'Object'}
|
|
13
|
+
</button>
|
|
14
|
+
{open
|
|
15
|
+
? entries.map(([key, child]) => (
|
|
16
|
+
<Node key={key} label={key} value={child} depth={depth + 1} />
|
|
17
|
+
))
|
|
18
|
+
: null}
|
|
19
|
+
</div>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
return (
|
|
23
|
+
<div className="font-mono text-xs" style={{ paddingLeft: depth * 12 }}>
|
|
24
|
+
{label ? `${label}: ` : ''}
|
|
25
|
+
<span className="text-muted-foreground">{JSON.stringify(value)}</span>
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Collapsible JSON tree.
|
|
32
|
+
* @when API responses/config. Plain text with wrapping → `CodeBlock`.
|
|
33
|
+
* @example
|
|
34
|
+
* <JsonViewer value={data} />
|
|
35
|
+
* @family Discovery & inspect
|
|
36
|
+
*/
|
|
37
|
+
export function JsonViewer({ value }: { value: unknown }) {
|
|
38
|
+
return (
|
|
39
|
+
<div data-testid="json-viewer" className="rounded-xl border bg-card p-3">
|
|
40
|
+
<Node value={value} depth={0} />
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
|
|
2
|
+
import { Avatar, AvatarFallback } from '@mohou/ui/components/avatar'
|
|
3
|
+
import { Badge } from '@mohou/ui/components/badge'
|
|
4
|
+
import { Separator } from '@mohou/ui/components/separator'
|
|
5
|
+
import {
|
|
6
|
+
Sheet,
|
|
7
|
+
SheetContent,
|
|
8
|
+
SheetDescription,
|
|
9
|
+
SheetHeader,
|
|
10
|
+
SheetTitle,
|
|
11
|
+
} from '@mohou/ui/components/sheet'
|
|
12
|
+
import { CommentThread } from '@mohou/ui/blocks/comment-thread'
|
|
13
|
+
import { DescriptionList } from '@mohou/ui/blocks/description-list'
|
|
14
|
+
import { SeverityChip } from '@mohou/ui/blocks/severity-chip'
|
|
15
|
+
import { StatusBadge } from '@mohou/ui/blocks/status-badge'
|
|
16
|
+
import type { KanbanCard } from '@mohou/ui/products/kanban'
|
|
17
|
+
import { useLabels } from '@mohou/ui/i18n/context'
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Slide-over detail panel for a `Kanban` card.
|
|
21
|
+
* @when Board + click-to-edit issue. Pair with `Kanban`'s selected card.
|
|
22
|
+
* @example
|
|
23
|
+
* <KanbanIssuePanel card={card} open={open} onOpenChange={setOpen} />
|
|
24
|
+
* @family Surface
|
|
25
|
+
*/
|
|
26
|
+
export function KanbanIssuePanel({
|
|
27
|
+
card,
|
|
28
|
+
columnTitle,
|
|
29
|
+
open,
|
|
30
|
+
onOpenChange,
|
|
31
|
+
}: {
|
|
32
|
+
card: KanbanCard | null
|
|
33
|
+
columnTitle?: string
|
|
34
|
+
open: boolean
|
|
35
|
+
onOpenChange: (open: boolean) => void
|
|
36
|
+
}) {
|
|
37
|
+
const t = useLabels('kanbanIssue')
|
|
38
|
+
if (!card) return null
|
|
39
|
+
return (
|
|
40
|
+
<Sheet open={open} onOpenChange={onOpenChange}>
|
|
41
|
+
<SheetContent className="sm:max-w-lg" data-testid="kanban-issue-panel">
|
|
42
|
+
<SheetHeader>
|
|
43
|
+
<SheetDescription className="font-mono text-xs">
|
|
44
|
+
{card.key ?? card.id}
|
|
45
|
+
{card.type ? ` · ${card.type}` : ''}
|
|
46
|
+
</SheetDescription>
|
|
47
|
+
<SheetTitle>{card.title}</SheetTitle>
|
|
48
|
+
</SheetHeader>
|
|
49
|
+
<div className="flex flex-1 flex-col gap-4 overflow-y-auto px-4 pb-6">
|
|
50
|
+
<div className="flex flex-wrap gap-2">
|
|
51
|
+
{card.status ? <StatusBadge status={card.status} /> : null}
|
|
52
|
+
{card.priority ? <SeverityChip severity={card.priority} /> : null}
|
|
53
|
+
{columnTitle ? <Badge variant="outline">{columnTitle}</Badge> : null}
|
|
54
|
+
</div>
|
|
55
|
+
<DescriptionList
|
|
56
|
+
items={[
|
|
57
|
+
{ label: t.assignee, value: card.assignee ?? t.unassigned },
|
|
58
|
+
{ label: t.reporter, value: card.reporter ?? '—' },
|
|
59
|
+
{ label: t.updated, value: card.updated ?? '—' },
|
|
60
|
+
]}
|
|
61
|
+
/>
|
|
62
|
+
{card.tags?.length ? (
|
|
63
|
+
<div className="flex flex-wrap gap-1">
|
|
64
|
+
{card.tags.map(tag => (
|
|
65
|
+
<Badge key={tag} variant="secondary">
|
|
66
|
+
{tag}
|
|
67
|
+
</Badge>
|
|
68
|
+
))}
|
|
69
|
+
</div>
|
|
70
|
+
) : null}
|
|
71
|
+
<div>
|
|
72
|
+
<div className="mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase">
|
|
73
|
+
{t.description}
|
|
74
|
+
</div>
|
|
75
|
+
<p className="text-sm leading-6 whitespace-pre-wrap">
|
|
76
|
+
{card.description ?? t.noDescription}
|
|
77
|
+
</p>
|
|
78
|
+
</div>
|
|
79
|
+
<Separator />
|
|
80
|
+
<div>
|
|
81
|
+
<div className="mb-2 text-xs font-medium tracking-wide text-muted-foreground uppercase">
|
|
82
|
+
{t.comments}
|
|
83
|
+
</div>
|
|
84
|
+
{card.comments?.length ? (
|
|
85
|
+
<CommentThread comments={card.comments} />
|
|
86
|
+
) : (
|
|
87
|
+
<p className="text-muted-foreground text-sm">{t.noComments}</p>
|
|
88
|
+
)}
|
|
89
|
+
</div>
|
|
90
|
+
{card.assignee ? (
|
|
91
|
+
<div className="mt-auto flex items-center gap-2 text-sm">
|
|
92
|
+
<Avatar className="size-6">
|
|
93
|
+
<AvatarFallback className="text-[10px]">
|
|
94
|
+
{card.assignee.slice(0, 2).toUpperCase()}
|
|
95
|
+
</AvatarFallback>
|
|
96
|
+
</Avatar>
|
|
97
|
+
{card.assignee}
|
|
98
|
+
</div>
|
|
99
|
+
) : null}
|
|
100
|
+
</div>
|
|
101
|
+
</SheetContent>
|
|
102
|
+
</Sheet>
|
|
103
|
+
)
|
|
104
|
+
}
|