@iamsaroj/smart-ui 0.2.0
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/CHANGELOG.md +35 -0
- package/LICENSE +21 -0
- package/README.md +49 -0
- package/dist/calendar-engine/agenda-view.d.ts +8 -0
- package/dist/calendar-engine/agenda-view.d.ts.map +1 -0
- package/dist/calendar-engine/agenda-view.js +26 -0
- package/dist/calendar-engine/agenda-view.js.map +1 -0
- package/dist/calendar-engine/booking.d.ts +13 -0
- package/dist/calendar-engine/booking.d.ts.map +1 -0
- package/dist/calendar-engine/booking.js +45 -0
- package/dist/calendar-engine/booking.js.map +1 -0
- package/dist/calendar-engine/calendar-utils.d.ts +74 -0
- package/dist/calendar-engine/calendar-utils.d.ts.map +1 -0
- package/dist/calendar-engine/calendar-utils.js +221 -0
- package/dist/calendar-engine/calendar-utils.js.map +1 -0
- package/dist/calendar-engine/calendar.d.ts +62 -0
- package/dist/calendar-engine/calendar.d.ts.map +1 -0
- package/dist/calendar-engine/calendar.js +81 -0
- package/dist/calendar-engine/calendar.js.map +1 -0
- package/dist/calendar-engine/event-color.d.ts +20 -0
- package/dist/calendar-engine/event-color.d.ts.map +1 -0
- package/dist/calendar-engine/event-color.js +59 -0
- package/dist/calendar-engine/event-color.js.map +1 -0
- package/dist/calendar-engine/index.d.ts +11 -0
- package/dist/calendar-engine/index.d.ts.map +1 -0
- package/dist/calendar-engine/index.js +6 -0
- package/dist/calendar-engine/index.js.map +1 -0
- package/dist/calendar-engine/month-view.d.ts +10 -0
- package/dist/calendar-engine/month-view.d.ts.map +1 -0
- package/dist/calendar-engine/month-view.js +72 -0
- package/dist/calendar-engine/month-view.js.map +1 -0
- package/dist/calendar-engine/recurrence.d.ts +47 -0
- package/dist/calendar-engine/recurrence.d.ts.map +1 -0
- package/dist/calendar-engine/recurrence.js +209 -0
- package/dist/calendar-engine/recurrence.js.map +1 -0
- package/dist/calendar-engine/shared.d.ts +72 -0
- package/dist/calendar-engine/shared.d.ts.map +1 -0
- package/dist/calendar-engine/shared.js +34 -0
- package/dist/calendar-engine/shared.js.map +1 -0
- package/dist/calendar-engine/time-grid-view.d.ts +13 -0
- package/dist/calendar-engine/time-grid-view.d.ts.map +1 -0
- package/dist/calendar-engine/time-grid-view.js +203 -0
- package/dist/calendar-engine/time-grid-view.js.map +1 -0
- package/dist/calendar-engine/types.d.ts +138 -0
- package/dist/calendar-engine/types.d.ts.map +1 -0
- package/dist/calendar-engine/types.js +2 -0
- package/dist/calendar-engine/types.js.map +1 -0
- package/dist/calendar-engine/use-calendar.d.ts +7 -0
- package/dist/calendar-engine/use-calendar.d.ts.map +1 -0
- package/dist/calendar-engine/use-calendar.js +25 -0
- package/dist/calendar-engine/use-calendar.js.map +1 -0
- package/dist/components/accordion.d.ts +7 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +10 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +19 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +18 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +11 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +20 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.d.ts +5 -0
- package/dist/components/aspect-ratio.d.ts.map +1 -0
- package/dist/components/aspect-ratio.js +7 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/avatar.d.ts +12 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +11 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +8 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +33 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +11 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +23 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button.d.ts +9 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +34 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +11 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +77 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +12 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +11 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +29 -0
- package/dist/components/carousel.d.ts.map +1 -0
- package/dist/components/carousel.js +94 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.d.ts +45 -0
- package/dist/components/chart.d.ts.map +1 -0
- package/dist/components/chart.js +133 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +4 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +8 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/collapsible.d.ts +6 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +7 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.d.ts +35 -0
- package/dist/components/combobox.d.ts.map +1 -0
- package/dist/components/combobox.js +45 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command.d.ts +20 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +18 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/context-menu.d.ts +30 -0
- package/dist/components/context-menu.d.ts.map +1 -0
- package/dist/components/context-menu.js +22 -0
- package/dist/components/context-menu.js.map +1 -0
- package/dist/components/data-table.d.ts +12 -0
- package/dist/components/data-table.d.ts.map +1 -0
- package/dist/components/data-table.js +44 -0
- package/dist/components/data-table.js.map +1 -0
- package/dist/components/date-picker.d.ts +33 -0
- package/dist/components/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker.js +29 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +18 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +18 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.d.ts +14 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +15 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +30 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +22 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/hover-card.d.ts +6 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +8 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +19 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +46 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.d.ts +12 -0
- package/dist/components/input-otp.d.ts.map +1 -0
- package/dist/components/input-otp.js +16 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.d.ts +4 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +6 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/kbd.d.ts +5 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +6 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +5 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/menubar.d.ts +30 -0
- package/dist/components/menubar.d.ts.map +1 -0
- package/dist/components/menubar.js +24 -0
- package/dist/components/menubar.js.map +1 -0
- package/dist/components/navigation-menu.d.ts +12 -0
- package/dist/components/navigation-menu.d.ts.map +1 -0
- package/dist/components/navigation-menu.js +18 -0
- package/dist/components/navigation-menu.js.map +1 -0
- package/dist/components/pagination.d.ts +18 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +13 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +10 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +12 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +8 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +10 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +6 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +9 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/scroll-area.d.ts +5 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +8 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +16 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +16 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +4 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +6 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +15 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +18 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/sidebar.d.ts +64 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/components/sidebar.js +224 -0
- package/dist/components/sidebar.js.map +1 -0
- package/dist/components/skeleton.d.ts +3 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +5 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +4 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +13 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/sonner.d.ts +4 -0
- package/dist/components/sonner.d.ts.map +1 -0
- package/dist/components/sonner.js +25 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/switch.d.ts +6 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +7 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +11 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +12 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +11 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +23 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +4 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +5 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/toggle-group.d.ts +11 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +22 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +9 -0
- package/dist/components/toggle.d.ts.map +1 -0
- package/dist/components/toggle.js +25 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.d.ts +7 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +10 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/data-grid/action-column-cell.d.ts +41 -0
- package/dist/data-grid/action-column-cell.d.ts.map +1 -0
- package/dist/data-grid/action-column-cell.js +114 -0
- package/dist/data-grid/action-column-cell.js.map +1 -0
- package/dist/data-grid/action-column.d.ts +144 -0
- package/dist/data-grid/action-column.d.ts.map +1 -0
- package/dist/data-grid/action-column.js +156 -0
- package/dist/data-grid/action-column.js.map +1 -0
- package/dist/data-grid/create-page-fetcher.d.ts +57 -0
- package/dist/data-grid/create-page-fetcher.d.ts.map +1 -0
- package/dist/data-grid/create-page-fetcher.js +41 -0
- package/dist/data-grid/create-page-fetcher.js.map +1 -0
- package/dist/data-grid/data-grid.d.ts +65 -0
- package/dist/data-grid/data-grid.d.ts.map +1 -0
- package/dist/data-grid/data-grid.js +95 -0
- package/dist/data-grid/data-grid.js.map +1 -0
- package/dist/data-grid/empty-state.d.ts +13 -0
- package/dist/data-grid/empty-state.d.ts.map +1 -0
- package/dist/data-grid/empty-state.js +6 -0
- package/dist/data-grid/empty-state.js.map +1 -0
- package/dist/data-grid/formula-guard.d.ts +22 -0
- package/dist/data-grid/formula-guard.d.ts.map +1 -0
- package/dist/data-grid/formula-guard.js +28 -0
- package/dist/data-grid/formula-guard.js.map +1 -0
- package/dist/data-grid/grid-internals.d.ts +16 -0
- package/dist/data-grid/grid-internals.d.ts.map +1 -0
- package/dist/data-grid/grid-internals.js +73 -0
- package/dist/data-grid/grid-internals.js.map +1 -0
- package/dist/data-grid/grid-theme.d.ts +8 -0
- package/dist/data-grid/grid-theme.d.ts.map +1 -0
- package/dist/data-grid/grid-theme.js +23 -0
- package/dist/data-grid/grid-theme.js.map +1 -0
- package/dist/data-grid/grid-toolbar.d.ts +40 -0
- package/dist/data-grid/grid-toolbar.d.ts.map +1 -0
- package/dist/data-grid/grid-toolbar.js +13 -0
- package/dist/data-grid/grid-toolbar.js.map +1 -0
- package/dist/data-grid/index.d.ts +10 -0
- package/dist/data-grid/index.d.ts.map +1 -0
- package/dist/data-grid/index.js +9 -0
- package/dist/data-grid/index.js.map +1 -0
- package/dist/data-grid/pagination.d.ts +146 -0
- package/dist/data-grid/pagination.d.ts.map +1 -0
- package/dist/data-grid/pagination.js +128 -0
- package/dist/data-grid/pagination.js.map +1 -0
- package/dist/data-grid/server-data-grid.d.ts +109 -0
- package/dist/data-grid/server-data-grid.d.ts.map +1 -0
- package/dist/data-grid/server-data-grid.js +240 -0
- package/dist/data-grid/server-data-grid.js.map +1 -0
- package/dist/data-grid/server-grid-internals.d.ts +79 -0
- package/dist/data-grid/server-grid-internals.d.ts.map +1 -0
- package/dist/data-grid/server-grid-internals.js +137 -0
- package/dist/data-grid/server-grid-internals.js.map +1 -0
- package/dist/data-grid/use-action-column.d.ts +22 -0
- package/dist/data-grid/use-action-column.d.ts.map +1 -0
- package/dist/data-grid/use-action-column.js +63 -0
- package/dist/data-grid/use-action-column.js.map +1 -0
- package/dist/data-grid/use-server-grid-selection.d.ts +35 -0
- package/dist/data-grid/use-server-grid-selection.d.ts.map +1 -0
- package/dist/data-grid/use-server-grid-selection.js +81 -0
- package/dist/data-grid/use-server-grid-selection.js.map +1 -0
- package/dist/form-engine/base.d.ts +19 -0
- package/dist/form-engine/base.d.ts.map +1 -0
- package/dist/form-engine/base.js +2 -0
- package/dist/form-engine/base.js.map +1 -0
- package/dist/form-engine/field-registry.d.ts +285 -0
- package/dist/form-engine/field-registry.d.ts.map +1 -0
- package/dist/form-engine/field-registry.js +306 -0
- package/dist/form-engine/field-registry.js.map +1 -0
- package/dist/form-engine/field-types.d.ts +201 -0
- package/dist/form-engine/field-types.d.ts.map +1 -0
- package/dist/form-engine/field-types.js +14 -0
- package/dist/form-engine/field-types.js.map +1 -0
- package/dist/form-engine/index.d.ts +20 -0
- package/dist/form-engine/index.d.ts.map +1 -0
- package/dist/form-engine/index.js +21 -0
- package/dist/form-engine/index.js.map +1 -0
- package/dist/form-engine/smart-checkbox-field.d.ts +5 -0
- package/dist/form-engine/smart-checkbox-field.d.ts.map +1 -0
- package/dist/form-engine/smart-checkbox-field.js +9 -0
- package/dist/form-engine/smart-checkbox-field.js.map +1 -0
- package/dist/form-engine/smart-checkbox-group-field.d.ts +10 -0
- package/dist/form-engine/smart-checkbox-group-field.d.ts.map +1 -0
- package/dist/form-engine/smart-checkbox-group-field.js +5 -0
- package/dist/form-engine/smart-checkbox-group-field.js.map +1 -0
- package/dist/form-engine/smart-combobox-field.d.ts +11 -0
- package/dist/form-engine/smart-combobox-field.d.ts.map +1 -0
- package/dist/form-engine/smart-combobox-field.js +5 -0
- package/dist/form-engine/smart-combobox-field.js.map +1 -0
- package/dist/form-engine/smart-date-field.d.ts +8 -0
- package/dist/form-engine/smart-date-field.d.ts.map +1 -0
- package/dist/form-engine/smart-date-field.js +17 -0
- package/dist/form-engine/smart-date-field.js.map +1 -0
- package/dist/form-engine/smart-date-range-field.d.ts +15 -0
- package/dist/form-engine/smart-date-range-field.d.ts.map +1 -0
- package/dist/form-engine/smart-date-range-field.js +25 -0
- package/dist/form-engine/smart-date-range-field.js.map +1 -0
- package/dist/form-engine/smart-datetime-field.d.ts +12 -0
- package/dist/form-engine/smart-datetime-field.d.ts.map +1 -0
- package/dist/form-engine/smart-datetime-field.js +12 -0
- package/dist/form-engine/smart-datetime-field.js.map +1 -0
- package/dist/form-engine/smart-form-internals.d.ts +14 -0
- package/dist/form-engine/smart-form-internals.d.ts.map +1 -0
- package/dist/form-engine/smart-form-internals.js +64 -0
- package/dist/form-engine/smart-form-internals.js.map +1 -0
- package/dist/form-engine/smart-form.d.ts +55 -0
- package/dist/form-engine/smart-form.d.ts.map +1 -0
- package/dist/form-engine/smart-form.js +229 -0
- package/dist/form-engine/smart-form.js.map +1 -0
- package/dist/form-engine/smart-input-field.d.ts +9 -0
- package/dist/form-engine/smart-input-field.d.ts.map +1 -0
- package/dist/form-engine/smart-input-field.js +5 -0
- package/dist/form-engine/smart-input-field.js.map +1 -0
- package/dist/form-engine/smart-month-field.d.ts +8 -0
- package/dist/form-engine/smart-month-field.d.ts.map +1 -0
- package/dist/form-engine/smart-month-field.js +12 -0
- package/dist/form-engine/smart-month-field.js.map +1 -0
- package/dist/form-engine/smart-multi-select-field.d.ts +11 -0
- package/dist/form-engine/smart-multi-select-field.d.ts.map +1 -0
- package/dist/form-engine/smart-multi-select-field.js +5 -0
- package/dist/form-engine/smart-multi-select-field.js.map +1 -0
- package/dist/form-engine/smart-number-field.d.ts +22 -0
- package/dist/form-engine/smart-number-field.d.ts.map +1 -0
- package/dist/form-engine/smart-number-field.js +115 -0
- package/dist/form-engine/smart-number-field.js.map +1 -0
- package/dist/form-engine/smart-password-field.d.ts +7 -0
- package/dist/form-engine/smart-password-field.d.ts.map +1 -0
- package/dist/form-engine/smart-password-field.js +5 -0
- package/dist/form-engine/smart-password-field.js.map +1 -0
- package/dist/form-engine/smart-radio-group-field.d.ts +10 -0
- package/dist/form-engine/smart-radio-group-field.d.ts.map +1 -0
- package/dist/form-engine/smart-radio-group-field.js +5 -0
- package/dist/form-engine/smart-radio-group-field.js.map +1 -0
- package/dist/form-engine/smart-segmented-field.d.ts +9 -0
- package/dist/form-engine/smart-segmented-field.d.ts.map +1 -0
- package/dist/form-engine/smart-segmented-field.js +5 -0
- package/dist/form-engine/smart-segmented-field.js.map +1 -0
- package/dist/form-engine/smart-select-field.d.ts +10 -0
- package/dist/form-engine/smart-select-field.d.ts.map +1 -0
- package/dist/form-engine/smart-select-field.js +5 -0
- package/dist/form-engine/smart-select-field.js.map +1 -0
- package/dist/form-engine/smart-slug-field.d.ts +12 -0
- package/dist/form-engine/smart-slug-field.d.ts.map +1 -0
- package/dist/form-engine/smart-slug-field.js +14 -0
- package/dist/form-engine/smart-slug-field.js.map +1 -0
- package/dist/form-engine/smart-switch-field.d.ts +5 -0
- package/dist/form-engine/smart-switch-field.d.ts.map +1 -0
- package/dist/form-engine/smart-switch-field.js +9 -0
- package/dist/form-engine/smart-switch-field.js.map +1 -0
- package/dist/form-engine/smart-tel-field.d.ts +7 -0
- package/dist/form-engine/smart-tel-field.d.ts.map +1 -0
- package/dist/form-engine/smart-tel-field.js +6 -0
- package/dist/form-engine/smart-tel-field.js.map +1 -0
- package/dist/form-engine/smart-text-editor-field.d.ts +15 -0
- package/dist/form-engine/smart-text-editor-field.d.ts.map +1 -0
- package/dist/form-engine/smart-text-editor-field.js +5 -0
- package/dist/form-engine/smart-text-editor-field.js.map +1 -0
- package/dist/form-engine/smart-textarea-field.d.ts +8 -0
- package/dist/form-engine/smart-textarea-field.d.ts.map +1 -0
- package/dist/form-engine/smart-textarea-field.js +5 -0
- package/dist/form-engine/smart-textarea-field.js.map +1 -0
- package/dist/form-engine/smart-time-field.d.ts +10 -0
- package/dist/form-engine/smart-time-field.d.ts.map +1 -0
- package/dist/form-engine/smart-time-field.js +5 -0
- package/dist/form-engine/smart-time-field.js.map +1 -0
- package/dist/form-engine/smart-time-range-field.d.ts +13 -0
- package/dist/form-engine/smart-time-range-field.d.ts.map +1 -0
- package/dist/form-engine/smart-time-range-field.js +5 -0
- package/dist/form-engine/smart-time-range-field.js.map +1 -0
- package/dist/form-engine/smart-year-field.d.ts +8 -0
- package/dist/form-engine/smart-year-field.d.ts.map +1 -0
- package/dist/form-engine/smart-year-field.js +5 -0
- package/dist/form-engine/smart-year-field.js.map +1 -0
- package/dist/form-engine/smart-yesno-field.d.ts +12 -0
- package/dist/form-engine/smart-yesno-field.d.ts.map +1 -0
- package/dist/form-engine/smart-yesno-field.js +14 -0
- package/dist/form-engine/smart-yesno-field.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +17 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/lexical-text-editor/SmartTextEditor.d.ts +61 -0
- package/dist/lexical-text-editor/SmartTextEditor.d.ts.map +1 -0
- package/dist/lexical-text-editor/SmartTextEditor.js +145 -0
- package/dist/lexical-text-editor/SmartTextEditor.js.map +1 -0
- package/dist/lexical-text-editor/editor-nodes.d.ts +3 -0
- package/dist/lexical-text-editor/editor-nodes.d.ts.map +1 -0
- package/dist/lexical-text-editor/editor-nodes.js +25 -0
- package/dist/lexical-text-editor/editor-nodes.js.map +1 -0
- package/dist/lexical-text-editor/editor-theme.d.ts +3 -0
- package/dist/lexical-text-editor/editor-theme.d.ts.map +1 -0
- package/dist/lexical-text-editor/editor-theme.js +78 -0
- package/dist/lexical-text-editor/editor-theme.js.map +1 -0
- package/dist/lexical-text-editor/index.d.ts +8 -0
- package/dist/lexical-text-editor/index.d.ts.map +1 -0
- package/dist/lexical-text-editor/index.js +6 -0
- package/dist/lexical-text-editor/index.js.map +1 -0
- package/dist/lexical-text-editor/nodes/image-node.d.ts +41 -0
- package/dist/lexical-text-editor/nodes/image-node.d.ts.map +1 -0
- package/dist/lexical-text-editor/nodes/image-node.js +89 -0
- package/dist/lexical-text-editor/nodes/image-node.js.map +1 -0
- package/dist/lexical-text-editor/nodes/page-break-node.d.ts +25 -0
- package/dist/lexical-text-editor/nodes/page-break-node.d.ts.map +1 -0
- package/dist/lexical-text-editor/nodes/page-break-node.js +84 -0
- package/dist/lexical-text-editor/nodes/page-break-node.js.map +1 -0
- package/dist/lexical-text-editor/plugins/auto-link-plugin.d.ts +3 -0
- package/dist/lexical-text-editor/plugins/auto-link-plugin.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/auto-link-plugin.js +12 -0
- package/dist/lexical-text-editor/plugins/auto-link-plugin.js.map +1 -0
- package/dist/lexical-text-editor/plugins/code-highlight-plugin.d.ts +6 -0
- package/dist/lexical-text-editor/plugins/code-highlight-plugin.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/code-highlight-plugin.js +14 -0
- package/dist/lexical-text-editor/plugins/code-highlight-plugin.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/align-menu.d.ts +7 -0
- package/dist/lexical-text-editor/plugins/toolbar/align-menu.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/align-menu.js +8 -0
- package/dist/lexical-text-editor/plugins/toolbar/align-menu.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.d.ts +20 -0
- package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.js +78 -0
- package/dist/lexical-text-editor/plugins/toolbar/block-format-menu.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/constants.d.ts +36 -0
- package/dist/lexical-text-editor/plugins/toolbar/constants.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/constants.js +67 -0
- package/dist/lexical-text-editor/plugins/toolbar/constants.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/inline-marks.d.ts +14 -0
- package/dist/lexical-text-editor/plugins/toolbar/inline-marks.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/inline-marks.js +129 -0
- package/dist/lexical-text-editor/plugins/toolbar/inline-marks.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/insert-menu.d.ts +8 -0
- package/dist/lexical-text-editor/plugins/toolbar/insert-menu.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/insert-menu.js +87 -0
- package/dist/lexical-text-editor/plugins/toolbar/insert-menu.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/link-editor.d.ts +11 -0
- package/dist/lexical-text-editor/plugins/toolbar/link-editor.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/link-editor.js +51 -0
- package/dist/lexical-text-editor/plugins/toolbar/link-editor.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/primitives.d.ts +39 -0
- package/dist/lexical-text-editor/plugins/toolbar/primitives.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/primitives.js +47 -0
- package/dist/lexical-text-editor/plugins/toolbar/primitives.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.d.ts +9 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.js +29 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-insert-commands.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.d.ts +30 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.js +128 -0
- package/dist/lexical-text-editor/plugins/toolbar/use-toolbar-state.js.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar-plugin.d.ts +8 -0
- package/dist/lexical-text-editor/plugins/toolbar-plugin.d.ts.map +1 -0
- package/dist/lexical-text-editor/plugins/toolbar-plugin.js +51 -0
- package/dist/lexical-text-editor/plugins/toolbar-plugin.js.map +1 -0
- package/dist/lexical-text-editor/sanitize.d.ts +24 -0
- package/dist/lexical-text-editor/sanitize.d.ts.map +1 -0
- package/dist/lexical-text-editor/sanitize.js +140 -0
- package/dist/lexical-text-editor/sanitize.js.map +1 -0
- package/dist/lib/format.d.ts +17 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +40 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/leading-space.d.ts +28 -0
- package/dist/lib/leading-space.d.ts.map +1 -0
- package/dist/lib/leading-space.js +34 -0
- package/dist/lib/leading-space.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +4 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/xlsx.d.ts +80 -0
- package/dist/lib/xlsx.d.ts.map +1 -0
- package/dist/lib/xlsx.js +377 -0
- package/dist/lib/xlsx.js.map +1 -0
- package/dist/search-engine/build-query.d.ts +29 -0
- package/dist/search-engine/build-query.d.ts.map +1 -0
- package/dist/search-engine/build-query.js +51 -0
- package/dist/search-engine/build-query.js.map +1 -0
- package/dist/search-engine/index.d.ts +15 -0
- package/dist/search-engine/index.d.ts.map +1 -0
- package/dist/search-engine/index.js +13 -0
- package/dist/search-engine/index.js.map +1 -0
- package/dist/search-engine/smart-search-form.d.ts +92 -0
- package/dist/search-engine/smart-search-form.d.ts.map +1 -0
- package/dist/search-engine/smart-search-form.js +136 -0
- package/dist/search-engine/smart-search-form.js.map +1 -0
- package/dist/search-engine/types.d.ts +40 -0
- package/dist/search-engine/types.d.ts.map +1 -0
- package/dist/search-engine/types.js +11 -0
- package/dist/search-engine/types.js.map +1 -0
- package/dist/smart-components/buttons/action-button.d.ts +66 -0
- package/dist/smart-components/buttons/action-button.d.ts.map +1 -0
- package/dist/smart-components/buttons/action-button.js +79 -0
- package/dist/smart-components/buttons/action-button.js.map +1 -0
- package/dist/smart-components/buttons/action-buttons.d.ts +122 -0
- package/dist/smart-components/buttons/action-buttons.d.ts.map +1 -0
- package/dist/smart-components/buttons/action-buttons.js +42 -0
- package/dist/smart-components/buttons/action-buttons.js.map +1 -0
- package/dist/smart-components/buttons/action-config.d.ts +181 -0
- package/dist/smart-components/buttons/action-config.d.ts.map +1 -0
- package/dist/smart-components/buttons/action-config.js +128 -0
- package/dist/smart-components/buttons/action-config.js.map +1 -0
- package/dist/smart-components/buttons/index.d.ts +4 -0
- package/dist/smart-components/buttons/index.d.ts.map +1 -0
- package/dist/smart-components/buttons/index.js +7 -0
- package/dist/smart-components/buttons/index.js.map +1 -0
- package/dist/smart-components/loading-overlay.d.ts +16 -0
- package/dist/smart-components/loading-overlay.d.ts.map +1 -0
- package/dist/smart-components/loading-overlay.js +13 -0
- package/dist/smart-components/loading-overlay.js.map +1 -0
- package/dist/smart-components/page/index.d.ts +19 -0
- package/dist/smart-components/page/index.d.ts.map +1 -0
- package/dist/smart-components/page/index.js +33 -0
- package/dist/smart-components/page/index.js.map +1 -0
- package/dist/smart-components/page/layouts/page-states.d.ts +17 -0
- package/dist/smart-components/page/layouts/page-states.d.ts.map +1 -0
- package/dist/smart-components/page/layouts/page-states.js +12 -0
- package/dist/smart-components/page/layouts/page-states.js.map +1 -0
- package/dist/smart-components/page/layouts/slot-buckets.d.ts +21 -0
- package/dist/smart-components/page/layouts/slot-buckets.d.ts.map +1 -0
- package/dist/smart-components/page/layouts/slot-buckets.js +2 -0
- package/dist/smart-components/page/layouts/slot-buckets.js.map +1 -0
- package/dist/smart-components/page/layouts/split-layout.d.ts +13 -0
- package/dist/smart-components/page/layouts/split-layout.d.ts.map +1 -0
- package/dist/smart-components/page/layouts/split-layout.js +14 -0
- package/dist/smart-components/page/layouts/split-layout.js.map +1 -0
- package/dist/smart-components/page/layouts/standard-layout.d.ts +18 -0
- package/dist/smart-components/page/layouts/standard-layout.d.ts.map +1 -0
- package/dist/smart-components/page/layouts/standard-layout.js +61 -0
- package/dist/smart-components/page/layouts/standard-layout.js.map +1 -0
- package/dist/smart-components/page/page-context.d.ts +51 -0
- package/dist/smart-components/page/page-context.d.ts.map +1 -0
- package/dist/smart-components/page/page-context.js +21 -0
- package/dist/smart-components/page/page-context.js.map +1 -0
- package/dist/smart-components/page/slot.d.ts +19 -0
- package/dist/smart-components/page/slot.d.ts.map +1 -0
- package/dist/smart-components/page/slot.js +18 -0
- package/dist/smart-components/page/slot.js.map +1 -0
- package/dist/smart-components/page/smart-grid-area.d.ts +75 -0
- package/dist/smart-components/page/smart-grid-area.d.ts.map +1 -0
- package/dist/smart-components/page/smart-grid-area.js +61 -0
- package/dist/smart-components/page/smart-grid-area.js.map +1 -0
- package/dist/smart-components/page/smart-page-container.d.ts +66 -0
- package/dist/smart-components/page/smart-page-container.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-container.js +93 -0
- package/dist/smart-components/page/smart-page-container.js.map +1 -0
- package/dist/smart-components/page/smart-page-content.d.ts +70 -0
- package/dist/smart-components/page/smart-page-content.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-content.js +78 -0
- package/dist/smart-components/page/smart-page-content.js.map +1 -0
- package/dist/smart-components/page/smart-page-empty.d.ts +47 -0
- package/dist/smart-components/page/smart-page-empty.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-empty.js +37 -0
- package/dist/smart-components/page/smart-page-empty.js.map +1 -0
- package/dist/smart-components/page/smart-page-error.d.ts +59 -0
- package/dist/smart-components/page/smart-page-error.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-error.js +45 -0
- package/dist/smart-components/page/smart-page-error.js.map +1 -0
- package/dist/smart-components/page/smart-page-filters.d.ts +38 -0
- package/dist/smart-components/page/smart-page-filters.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-filters.js +33 -0
- package/dist/smart-components/page/smart-page-filters.js.map +1 -0
- package/dist/smart-components/page/smart-page-footer.d.ts +49 -0
- package/dist/smart-components/page/smart-page-footer.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-footer.js +49 -0
- package/dist/smart-components/page/smart-page-footer.js.map +1 -0
- package/dist/smart-components/page/smart-page-header.d.ts +145 -0
- package/dist/smart-components/page/smart-page-header.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-header.js +129 -0
- package/dist/smart-components/page/smart-page-header.js.map +1 -0
- package/dist/smart-components/page/smart-page-hero.d.ts +43 -0
- package/dist/smart-components/page/smart-page-hero.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-hero.js +42 -0
- package/dist/smart-components/page/smart-page-hero.js.map +1 -0
- package/dist/smart-components/page/smart-page-loading.d.ts +31 -0
- package/dist/smart-components/page/smart-page-loading.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-loading.js +29 -0
- package/dist/smart-components/page/smart-page-loading.js.map +1 -0
- package/dist/smart-components/page/smart-page-search.d.ts +39 -0
- package/dist/smart-components/page/smart-page-search.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-search.js +38 -0
- package/dist/smart-components/page/smart-page-search.js.map +1 -0
- package/dist/smart-components/page/smart-page-section.d.ts +55 -0
- package/dist/smart-components/page/smart-page-section.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-section.js +41 -0
- package/dist/smart-components/page/smart-page-section.js.map +1 -0
- package/dist/smart-components/page/smart-page-status-bar.d.ts +34 -0
- package/dist/smart-components/page/smart-page-status-bar.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-status-bar.js +33 -0
- package/dist/smart-components/page/smart-page-status-bar.js.map +1 -0
- package/dist/smart-components/page/smart-page-tabs.d.ts +93 -0
- package/dist/smart-components/page/smart-page-tabs.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page-tabs.js +87 -0
- package/dist/smart-components/page/smart-page-tabs.js.map +1 -0
- package/dist/smart-components/page/smart-page.d.ts +141 -0
- package/dist/smart-components/page/smart-page.d.ts.map +1 -0
- package/dist/smart-components/page/smart-page.js +295 -0
- package/dist/smart-components/page/smart-page.js.map +1 -0
- package/dist/smart-components/page/smart-sidebar.d.ts +70 -0
- package/dist/smart-components/page/smart-sidebar.d.ts.map +1 -0
- package/dist/smart-components/page/smart-sidebar.js +54 -0
- package/dist/smart-components/page/smart-sidebar.js.map +1 -0
- package/dist/smart-components/page/smart-toolbar.d.ts +40 -0
- package/dist/smart-components/page/smart-toolbar.d.ts.map +1 -0
- package/dist/smart-components/page/smart-toolbar.js +39 -0
- package/dist/smart-components/page/smart-toolbar.js.map +1 -0
- package/dist/smart-components/search-input.d.ts +20 -0
- package/dist/smart-components/search-input.d.ts.map +1 -0
- package/dist/smart-components/search-input.js +12 -0
- package/dist/smart-components/search-input.js.map +1 -0
- package/dist/smart-components/smart-accordion.d.ts +53 -0
- package/dist/smart-components/smart-accordion.d.ts.map +1 -0
- package/dist/smart-components/smart-accordion.js +33 -0
- package/dist/smart-components/smart-accordion.js.map +1 -0
- package/dist/smart-components/smart-alert.d.ts +44 -0
- package/dist/smart-components/smart-alert.d.ts.map +1 -0
- package/dist/smart-components/smart-alert.js +27 -0
- package/dist/smart-components/smart-alert.js.map +1 -0
- package/dist/smart-components/smart-avatar.d.ts +3 -0
- package/dist/smart-components/smart-avatar.d.ts.map +1 -0
- package/dist/smart-components/smart-avatar.js +4 -0
- package/dist/smart-components/smart-avatar.js.map +1 -0
- package/dist/smart-components/smart-badge.d.ts +28 -0
- package/dist/smart-components/smart-badge.d.ts.map +1 -0
- package/dist/smart-components/smart-badge.js +24 -0
- package/dist/smart-components/smart-badge.js.map +1 -0
- package/dist/smart-components/smart-breadcrumb.d.ts +43 -0
- package/dist/smart-components/smart-breadcrumb.d.ts.map +1 -0
- package/dist/smart-components/smart-breadcrumb.js +37 -0
- package/dist/smart-components/smart-breadcrumb.js.map +1 -0
- package/dist/smart-components/smart-button.d.ts +22 -0
- package/dist/smart-components/smart-button.d.ts.map +1 -0
- package/dist/smart-components/smart-button.js +15 -0
- package/dist/smart-components/smart-button.js.map +1 -0
- package/dist/smart-components/smart-calendar.d.ts +78 -0
- package/dist/smart-components/smart-calendar.d.ts.map +1 -0
- package/dist/smart-components/smart-calendar.js +45 -0
- package/dist/smart-components/smart-calendar.js.map +1 -0
- package/dist/smart-components/smart-card.d.ts +55 -0
- package/dist/smart-components/smart-card.d.ts.map +1 -0
- package/dist/smart-components/smart-card.js +37 -0
- package/dist/smart-components/smart-card.js.map +1 -0
- package/dist/smart-components/smart-checkbox-group.d.ts +48 -0
- package/dist/smart-components/smart-checkbox-group.d.ts.map +1 -0
- package/dist/smart-components/smart-checkbox-group.js +48 -0
- package/dist/smart-components/smart-checkbox-group.js.map +1 -0
- package/dist/smart-components/smart-checkbox.d.ts +34 -0
- package/dist/smart-components/smart-checkbox.d.ts.map +1 -0
- package/dist/smart-components/smart-checkbox.js +34 -0
- package/dist/smart-components/smart-checkbox.js.map +1 -0
- package/dist/smart-components/smart-combobox.d.ts +36 -0
- package/dist/smart-components/smart-combobox.d.ts.map +1 -0
- package/dist/smart-components/smart-combobox.js +32 -0
- package/dist/smart-components/smart-combobox.js.map +1 -0
- package/dist/smart-components/smart-confirm-dialog.d.ts +63 -0
- package/dist/smart-components/smart-confirm-dialog.d.ts.map +1 -0
- package/dist/smart-components/smart-confirm-dialog.js +45 -0
- package/dist/smart-components/smart-confirm-dialog.js.map +1 -0
- package/dist/smart-components/smart-context-menu.d.ts +58 -0
- package/dist/smart-components/smart-context-menu.d.ts.map +1 -0
- package/dist/smart-components/smart-context-menu.js +38 -0
- package/dist/smart-components/smart-context-menu.js.map +1 -0
- package/dist/smart-components/smart-date-picker.d.ts +99 -0
- package/dist/smart-components/smart-date-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-date-picker.js +78 -0
- package/dist/smart-components/smart-date-picker.js.map +1 -0
- package/dist/smart-components/smart-date-range-picker.d.ts +37 -0
- package/dist/smart-components/smart-date-range-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-date-range-picker.js +38 -0
- package/dist/smart-components/smart-date-range-picker.js.map +1 -0
- package/dist/smart-components/smart-dialog.d.ts +75 -0
- package/dist/smart-components/smart-dialog.d.ts.map +1 -0
- package/dist/smart-components/smart-dialog.js +61 -0
- package/dist/smart-components/smart-dialog.js.map +1 -0
- package/dist/smart-components/smart-drawer.d.ts +48 -0
- package/dist/smart-components/smart-drawer.d.ts.map +1 -0
- package/dist/smart-components/smart-drawer.js +32 -0
- package/dist/smart-components/smart-drawer.js.map +1 -0
- package/dist/smart-components/smart-field.d.ts +47 -0
- package/dist/smart-components/smart-field.d.ts.map +1 -0
- package/dist/smart-components/smart-field.js +44 -0
- package/dist/smart-components/smart-field.js.map +1 -0
- package/dist/smart-components/smart-input-group.d.ts +60 -0
- package/dist/smart-components/smart-input-group.d.ts.map +1 -0
- package/dist/smart-components/smart-input-group.js +40 -0
- package/dist/smart-components/smart-input-group.js.map +1 -0
- package/dist/smart-components/smart-input.d.ts +46 -0
- package/dist/smart-components/smart-input.d.ts.map +1 -0
- package/dist/smart-components/smart-input.js +36 -0
- package/dist/smart-components/smart-input.js.map +1 -0
- package/dist/smart-components/smart-label.d.ts +22 -0
- package/dist/smart-components/smart-label.d.ts.map +1 -0
- package/dist/smart-components/smart-label.js +17 -0
- package/dist/smart-components/smart-label.js.map +1 -0
- package/dist/smart-components/smart-month-picker.d.ts +30 -0
- package/dist/smart-components/smart-month-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-month-picker.js +53 -0
- package/dist/smart-components/smart-month-picker.js.map +1 -0
- package/dist/smart-components/smart-multi-select.d.ts +38 -0
- package/dist/smart-components/smart-multi-select.d.ts.map +1 -0
- package/dist/smart-components/smart-multi-select.js +56 -0
- package/dist/smart-components/smart-multi-select.js.map +1 -0
- package/dist/smart-components/smart-native-select.d.ts +45 -0
- package/dist/smart-components/smart-native-select.d.ts.map +1 -0
- package/dist/smart-components/smart-native-select.js +33 -0
- package/dist/smart-components/smart-native-select.js.map +1 -0
- package/dist/smart-components/smart-nav-sidebar.d.ts +47 -0
- package/dist/smart-components/smart-nav-sidebar.d.ts.map +1 -0
- package/dist/smart-components/smart-nav-sidebar.js +37 -0
- package/dist/smart-components/smart-nav-sidebar.js.map +1 -0
- package/dist/smart-components/smart-password-input.d.ts +31 -0
- package/dist/smart-components/smart-password-input.d.ts.map +1 -0
- package/dist/smart-components/smart-password-input.js +30 -0
- package/dist/smart-components/smart-password-input.js.map +1 -0
- package/dist/smart-components/smart-radio-group.d.ts +58 -0
- package/dist/smart-components/smart-radio-group.d.ts.map +1 -0
- package/dist/smart-components/smart-radio-group.js +49 -0
- package/dist/smart-components/smart-radio-group.js.map +1 -0
- package/dist/smart-components/smart-segmented.d.ts +33 -0
- package/dist/smart-components/smart-segmented.d.ts.map +1 -0
- package/dist/smart-components/smart-segmented.js +25 -0
- package/dist/smart-components/smart-segmented.js.map +1 -0
- package/dist/smart-components/smart-select.d.ts +71 -0
- package/dist/smart-components/smart-select.d.ts.map +1 -0
- package/dist/smart-components/smart-select.js +44 -0
- package/dist/smart-components/smart-select.js.map +1 -0
- package/dist/smart-components/smart-separator.d.ts +3 -0
- package/dist/smart-components/smart-separator.d.ts.map +1 -0
- package/dist/smart-components/smart-separator.js +4 -0
- package/dist/smart-components/smart-separator.js.map +1 -0
- package/dist/smart-components/smart-sheet.d.ts +79 -0
- package/dist/smart-components/smart-sheet.d.ts.map +1 -0
- package/dist/smart-components/smart-sheet.js +47 -0
- package/dist/smart-components/smart-sheet.js.map +1 -0
- package/dist/smart-components/smart-stat-card.d.ts +47 -0
- package/dist/smart-components/smart-stat-card.d.ts.map +1 -0
- package/dist/smart-components/smart-stat-card.js +35 -0
- package/dist/smart-components/smart-stat-card.js.map +1 -0
- package/dist/smart-components/smart-stepper.d.ts +24 -0
- package/dist/smart-components/smart-stepper.d.ts.map +1 -0
- package/dist/smart-components/smart-stepper.js +24 -0
- package/dist/smart-components/smart-stepper.js.map +1 -0
- package/dist/smart-components/smart-switch.d.ts +34 -0
- package/dist/smart-components/smart-switch.d.ts.map +1 -0
- package/dist/smart-components/smart-switch.js +34 -0
- package/dist/smart-components/smart-switch.js.map +1 -0
- package/dist/smart-components/smart-textarea.d.ts +38 -0
- package/dist/smart-components/smart-textarea.d.ts.map +1 -0
- package/dist/smart-components/smart-textarea.js +28 -0
- package/dist/smart-components/smart-textarea.js.map +1 -0
- package/dist/smart-components/smart-time-picker.d.ts +59 -0
- package/dist/smart-components/smart-time-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-time-picker.js +129 -0
- package/dist/smart-components/smart-time-picker.js.map +1 -0
- package/dist/smart-components/smart-time-range-picker.d.ts +39 -0
- package/dist/smart-components/smart-time-range-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-time-range-picker.js +26 -0
- package/dist/smart-components/smart-time-range-picker.js.map +1 -0
- package/dist/smart-components/smart-toaster.d.ts +10 -0
- package/dist/smart-components/smart-toaster.d.ts.map +1 -0
- package/dist/smart-components/smart-toaster.js +21 -0
- package/dist/smart-components/smart-toaster.js.map +1 -0
- package/dist/smart-components/smart-year-picker.d.ts +29 -0
- package/dist/smart-components/smart-year-picker.d.ts.map +1 -0
- package/dist/smart-components/smart-year-picker.js +43 -0
- package/dist/smart-components/smart-year-picker.js.map +1 -0
- package/dist/smart-components/spinner.d.ts +10 -0
- package/dist/smart-components/spinner.d.ts.map +1 -0
- package/dist/smart-components/spinner.js +5 -0
- package/dist/smart-components/spinner.js.map +1 -0
- package/dist/transfer-list-engine/index.d.ts +5 -0
- package/dist/transfer-list-engine/index.d.ts.map +1 -0
- package/dist/transfer-list-engine/index.js +3 -0
- package/dist/transfer-list-engine/index.js.map +1 -0
- package/dist/transfer-list-engine/transfer-list.d.ts +53 -0
- package/dist/transfer-list-engine/transfer-list.d.ts.map +1 -0
- package/dist/transfer-list-engine/transfer-list.js +190 -0
- package/dist/transfer-list-engine/transfer-list.js.map +1 -0
- package/dist/transfer-list-engine/transfer-utils.d.ts +30 -0
- package/dist/transfer-list-engine/transfer-utils.d.ts.map +1 -0
- package/dist/transfer-list-engine/transfer-utils.js +69 -0
- package/dist/transfer-list-engine/transfer-utils.js.map +1 -0
- package/dist/transfer-list-engine/types.d.ts +51 -0
- package/dist/transfer-list-engine/types.d.ts.map +1 -0
- package/dist/transfer-list-engine/types.js +2 -0
- package/dist/transfer-list-engine/types.js.map +1 -0
- package/dist/tree-engine/index.d.ts +6 -0
- package/dist/tree-engine/index.d.ts.map +1 -0
- package/dist/tree-engine/index.js +3 -0
- package/dist/tree-engine/index.js.map +1 -0
- package/dist/tree-engine/tree-utils.d.ts +84 -0
- package/dist/tree-engine/tree-utils.d.ts.map +1 -0
- package/dist/tree-engine/tree-utils.js +271 -0
- package/dist/tree-engine/tree-utils.js.map +1 -0
- package/dist/tree-engine/tree.d.ts +98 -0
- package/dist/tree-engine/tree.d.ts.map +1 -0
- package/dist/tree-engine/tree.js +430 -0
- package/dist/tree-engine/tree.js.map +1 -0
- package/dist/tree-engine/types.d.ts +85 -0
- package/dist/tree-engine/types.d.ts.map +1 -0
- package/dist/tree-engine/types.js +2 -0
- package/dist/tree-engine/types.js.map +1 -0
- package/dist/tree-engine/use-tree.d.ts +12 -0
- package/dist/tree-engine/use-tree.d.ts.map +1 -0
- package/dist/tree-engine/use-tree.js +34 -0
- package/dist/tree-engine/use-tree.js.map +1 -0
- package/package.json +158 -0
- package/src/styles/globals.css +161 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { TextFormatType } from "lexical";
|
|
2
|
+
/**
|
|
3
|
+
* Shared data and types for the toolbar sections. Pure module — no components —
|
|
4
|
+
* so every section imports from here without pulling in React render code.
|
|
5
|
+
*/
|
|
6
|
+
export type BlockType = "paragraph" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "bullet" | "number" | "check" | "quote" | "code";
|
|
7
|
+
export declare const BLOCK_TYPE_LABELS: Record<BlockType, string>;
|
|
8
|
+
export declare const MIN_FONT_SIZE = 8;
|
|
9
|
+
export declare const MAX_FONT_SIZE = 96;
|
|
10
|
+
export declare const DEFAULT_FONT_SIZE = 14;
|
|
11
|
+
export declare const FONT_SIZES: number[];
|
|
12
|
+
export declare const FONT_FAMILIES: Array<{
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}>;
|
|
16
|
+
export declare const TEXT_COLORS: Array<{
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const HIGHLIGHT_COLORS: Array<{
|
|
21
|
+
label: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const CODE_LANGUAGE_OPTIONS: [string, string][];
|
|
25
|
+
export declare const ALL_TEXT_FORMATS: TextFormatType[];
|
|
26
|
+
/**
|
|
27
|
+
* Which dropdown menu is open, and the callbacks to toggle/close it. The
|
|
28
|
+
* `ToolbarPlugin` owns this single-open-at-a-time state and threads it into
|
|
29
|
+
* every section that renders a `PortalDropdown`.
|
|
30
|
+
*/
|
|
31
|
+
export interface ToolbarMenuControls {
|
|
32
|
+
openMenu: string | null;
|
|
33
|
+
toggleMenu: (name: string) => void;
|
|
34
|
+
closeMenu: () => void;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/lexical-text-editor/plugins/toolbar/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAG7C;;;GAGG;AAEH,MAAM,MAAM,SAAS,GACjB,WAAW,GACX,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,OAAO,GACP,MAAM,CAAA;AAEV,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAavD,CAAA;AAED,eAAO,MAAM,aAAa,IAAI,CAAA;AAC9B,eAAO,MAAM,aAAa,KAAK,CAAA;AAC/B,eAAO,MAAM,iBAAiB,KAAK,CAAA;AAEnC,eAAO,MAAM,UAAU,UAGtB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAQjE,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAY/D,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAUpE,CAAA;AAED,eAAO,MAAM,qBAAqB,oBAA2B,CAAA;AAE7D,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAS5C,CAAA;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,SAAS,EAAE,MAAM,IAAI,CAAA;CACtB"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { getCodeLanguageOptions } from "@lexical/code";
|
|
2
|
+
export const BLOCK_TYPE_LABELS = {
|
|
3
|
+
paragraph: "Normal",
|
|
4
|
+
h1: "Heading 1",
|
|
5
|
+
h2: "Heading 2",
|
|
6
|
+
h3: "Heading 3",
|
|
7
|
+
h4: "Heading 4",
|
|
8
|
+
h5: "Heading 5",
|
|
9
|
+
h6: "Heading 6",
|
|
10
|
+
bullet: "Bullet List",
|
|
11
|
+
number: "Numbered List",
|
|
12
|
+
check: "Checklist",
|
|
13
|
+
quote: "Quote",
|
|
14
|
+
code: "Code Block",
|
|
15
|
+
};
|
|
16
|
+
export const MIN_FONT_SIZE = 8;
|
|
17
|
+
export const MAX_FONT_SIZE = 96;
|
|
18
|
+
export const DEFAULT_FONT_SIZE = 14;
|
|
19
|
+
export const FONT_SIZES = [
|
|
20
|
+
8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 24, 28, 32, 36, 40, 48, 56, 64, 72,
|
|
21
|
+
96,
|
|
22
|
+
];
|
|
23
|
+
export const FONT_FAMILIES = [
|
|
24
|
+
{ label: "Default", value: "" },
|
|
25
|
+
{ label: "Arial", value: "Arial, sans-serif" },
|
|
26
|
+
{ label: "Courier New", value: "'Courier New', monospace" },
|
|
27
|
+
{ label: "Georgia", value: "Georgia, serif" },
|
|
28
|
+
{ label: "Times New Roman", value: "'Times New Roman', serif" },
|
|
29
|
+
{ label: "Trebuchet MS", value: "'Trebuchet MS', sans-serif" },
|
|
30
|
+
{ label: "Verdana", value: "Verdana, sans-serif" },
|
|
31
|
+
];
|
|
32
|
+
export const TEXT_COLORS = [
|
|
33
|
+
{ label: "Default", value: "" },
|
|
34
|
+
{ label: "Gray", value: "#6b7280" },
|
|
35
|
+
{ label: "Red", value: "#dc2626" },
|
|
36
|
+
{ label: "Orange", value: "#ea580c" },
|
|
37
|
+
{ label: "Amber", value: "#d97706" },
|
|
38
|
+
{ label: "Green", value: "#16a34a" },
|
|
39
|
+
{ label: "Teal", value: "#0d9488" },
|
|
40
|
+
{ label: "Blue", value: "#2563eb" },
|
|
41
|
+
{ label: "Indigo", value: "#4f46e5" },
|
|
42
|
+
{ label: "Purple", value: "#9333ea" },
|
|
43
|
+
{ label: "Pink", value: "#db2777" },
|
|
44
|
+
];
|
|
45
|
+
export const HIGHLIGHT_COLORS = [
|
|
46
|
+
{ label: "None", value: "" },
|
|
47
|
+
{ label: "Yellow", value: "#fef08a" },
|
|
48
|
+
{ label: "Green", value: "#bbf7d0" },
|
|
49
|
+
{ label: "Blue", value: "#bfdbfe" },
|
|
50
|
+
{ label: "Purple", value: "#e9d5ff" },
|
|
51
|
+
{ label: "Pink", value: "#fbcfe8" },
|
|
52
|
+
{ label: "Red", value: "#fecaca" },
|
|
53
|
+
{ label: "Orange", value: "#fed7aa" },
|
|
54
|
+
{ label: "Gray", value: "#e5e7eb" },
|
|
55
|
+
];
|
|
56
|
+
export const CODE_LANGUAGE_OPTIONS = getCodeLanguageOptions();
|
|
57
|
+
export const ALL_TEXT_FORMATS = [
|
|
58
|
+
"bold",
|
|
59
|
+
"italic",
|
|
60
|
+
"underline",
|
|
61
|
+
"strikethrough",
|
|
62
|
+
"code",
|
|
63
|
+
"superscript",
|
|
64
|
+
"subscript",
|
|
65
|
+
"highlight",
|
|
66
|
+
];
|
|
67
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/lexical-text-editor/plugins/toolbar/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAqBtD,MAAM,CAAC,MAAM,iBAAiB,GAA8B;IAC1D,SAAS,EAAE,QAAQ;IACnB,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,WAAW;IACf,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,eAAe;IACvB,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,YAAY;CACnB,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAA;AAC9B,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAA;AAC/B,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAEnC,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;IAC5E,EAAE;CACH,CAAA;AAED,MAAM,CAAC,MAAM,aAAa,GAA4C;IACpE,EAAE,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E,KAAK,EAAE,EAAE,EAAE;IAC5B,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE;IACrC,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE;IACpC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;IACnC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE;IACrC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;IACnC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE;IAClC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE;IACrC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE;CACpC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,sBAAsB,EAAE,CAAA;AAE7D,MAAM,CAAC,MAAM,gBAAgB,GAAqB;IAChD,MAAM;IACN,QAAQ;IACR,WAAW;IACX,eAAe;IACf,MAAM;IACN,aAAa;IACb,WAAW;IACX,WAAW;CACZ,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type LexicalEditor } from "lexical";
|
|
2
|
+
import { type ToolbarMenuControls } from "./constants";
|
|
3
|
+
import type { ToolbarState } from "./use-toolbar-state";
|
|
4
|
+
/**
|
|
5
|
+
* The inline text-styling section: font family + size, the text-format toggle
|
|
6
|
+
* buttons (bold/italic/…/inline-code), and text/highlight color palettes.
|
|
7
|
+
* Rendered in place of the code-language control for non-code blocks.
|
|
8
|
+
*/
|
|
9
|
+
export declare const InlineMarks: ({ editor, state, menu, }: {
|
|
10
|
+
editor: LexicalEditor;
|
|
11
|
+
state: ToolbarState;
|
|
12
|
+
menu: ToolbarMenuControls;
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=inline-marks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-marks.d.ts","sourceRoot":"","sources":["../../../../src/lexical-text-editor/plugins/toolbar/inline-marks.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,SAAS,CAAA;AAwBhB,OAAO,EAQL,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAiPvD;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,0BAIzB;IACD,MAAM,EAAE,aAAa,CAAA;IACrB,KAAK,EAAE,YAAY,CAAA;IACnB,IAAI,EAAE,mBAAmB,CAAA;CAC1B,4CAqCA,CAAA"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { $getSelection, FORMAT_TEXT_COMMAND, } from "lexical";
|
|
4
|
+
import { $patchStyleText } from "@lexical/selection";
|
|
5
|
+
import { cn } from "@iamsaroj/smart-ui/lib/utils";
|
|
6
|
+
import { Baseline, Bold, Code, Highlighter, Italic, Minus, PaintBucket, Plus, Strikethrough, Subscript, Superscript, Type, Underline, } from "lucide-react";
|
|
7
|
+
import { DropdownItem, PortalDropdown, ToolbarButton, ToolbarSeparator, } from "./primitives";
|
|
8
|
+
import { DEFAULT_FONT_SIZE, FONT_FAMILIES, FONT_SIZES, HIGHLIGHT_COLORS, MAX_FONT_SIZE, MIN_FONT_SIZE, TEXT_COLORS, } from "./constants";
|
|
9
|
+
// Smart font-size stepping — bigger sizes step by bigger amounts.
|
|
10
|
+
// Matches the Lexical playground's calculateNextFontSize.
|
|
11
|
+
const calculateNextFontSize = (current, delta) => {
|
|
12
|
+
if (delta === -1) {
|
|
13
|
+
if (current > MAX_FONT_SIZE)
|
|
14
|
+
return MAX_FONT_SIZE;
|
|
15
|
+
if (current >= 48)
|
|
16
|
+
return current - 12;
|
|
17
|
+
if (current >= 24)
|
|
18
|
+
return current - 4;
|
|
19
|
+
if (current >= 14)
|
|
20
|
+
return current - 2;
|
|
21
|
+
if (current >= 9)
|
|
22
|
+
return current - 1;
|
|
23
|
+
return MIN_FONT_SIZE;
|
|
24
|
+
}
|
|
25
|
+
if (current < MIN_FONT_SIZE)
|
|
26
|
+
return MIN_FONT_SIZE;
|
|
27
|
+
if (current < 12)
|
|
28
|
+
return current + 1;
|
|
29
|
+
if (current < 20)
|
|
30
|
+
return current + 2;
|
|
31
|
+
if (current < 36)
|
|
32
|
+
return current + 4;
|
|
33
|
+
if (current <= 60)
|
|
34
|
+
return current + 12;
|
|
35
|
+
return MAX_FONT_SIZE;
|
|
36
|
+
};
|
|
37
|
+
const ColorPaletteDropdown = ({ editor, colors, styleProperty, icon, title, menuName, menu, }) => {
|
|
38
|
+
const apply = (value) => {
|
|
39
|
+
editor.update(() => {
|
|
40
|
+
const sel = $getSelection();
|
|
41
|
+
if (sel !== null) {
|
|
42
|
+
$patchStyleText(sel, { [styleProperty]: value || null });
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
menu.closeMenu();
|
|
46
|
+
};
|
|
47
|
+
return (_jsx(PortalDropdown, { isOpen: menu.openMenu === menuName, onToggle: () => menu.toggleMenu(menuName), onClose: menu.closeMenu, title: title, chevron: false, panelClassName: "w-40 p-2", label: icon, children: _jsx("div", { className: "grid grid-cols-6 gap-1", children: colors.map((c) => (_jsx("button", { type: "button", title: c.label, "aria-label": c.label, onClick: () => apply(c.value), className: cn("size-5 rounded border border-border transition-transform hover:scale-110", !c.value &&
|
|
48
|
+
"bg-background bg-[linear-gradient(to_top_left,transparent_46%,var(--destructive)_48%,var(--destructive)_52%,transparent_54%)]"), style: c.value ? { backgroundColor: c.value } : undefined }, c.label))) }) }));
|
|
49
|
+
};
|
|
50
|
+
const FontFamilyControl = ({ editor, value, menu, }) => {
|
|
51
|
+
const current = FONT_FAMILIES.find((f) => f.value === value) ?? FONT_FAMILIES[0];
|
|
52
|
+
const apply = (family) => {
|
|
53
|
+
editor.update(() => {
|
|
54
|
+
const sel = $getSelection();
|
|
55
|
+
if (sel !== null) {
|
|
56
|
+
$patchStyleText(sel, { "font-family": family || null });
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
menu.closeMenu();
|
|
60
|
+
};
|
|
61
|
+
return (_jsx(PortalDropdown, { isOpen: menu.openMenu === "fontFamily", onToggle: () => menu.toggleMenu("fontFamily"), onClose: menu.closeMenu, title: "Font family", panelClassName: "w-44", label: _jsxs("span", { className: "flex items-center gap-1", children: [_jsx(Type, { className: "size-3" }), _jsx("span", { className: "max-w-[5rem] truncate", children: current.label })] }), children: FONT_FAMILIES.map((f) => (_jsx(DropdownItem, { label: f.label, active: f.value === value || (!f.value && !value), onClick: () => apply(f.value), style: f.value ? { fontFamily: f.value } : undefined }, f.label))) }));
|
|
62
|
+
};
|
|
63
|
+
const FontSizeControl = ({ editor, value, menu, }) => {
|
|
64
|
+
const px = parseInt(value) || DEFAULT_FONT_SIZE;
|
|
65
|
+
const apply = (newPx) => {
|
|
66
|
+
const clamped = Math.max(MIN_FONT_SIZE, Math.min(MAX_FONT_SIZE, newPx));
|
|
67
|
+
editor.update(() => {
|
|
68
|
+
const sel = $getSelection();
|
|
69
|
+
if (sel !== null)
|
|
70
|
+
$patchStyleText(sel, { "font-size": `${clamped}px` });
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
return (_jsxs("div", { className: "flex items-center gap-0.5", children: [_jsx(ToolbarButton, { title: "Decrease font size", disabled: px <= MIN_FONT_SIZE, onClick: () => apply(calculateNextFontSize(px, -1)), children: _jsx(Minus, {}) }), _jsx(PortalDropdown, { isOpen: menu.openMenu === "fontSize", onToggle: () => menu.toggleMenu("fontSize"), onClose: menu.closeMenu, title: "Font size", chevron: false, panelClassName: "w-20 max-h-64 overflow-y-auto", label: _jsx("span", { className: "w-5 text-center tabular-nums", children: px }), children: FONT_SIZES.map((sz) => (_jsx(DropdownItem, { label: String(sz), active: px === sz, onClick: () => {
|
|
74
|
+
apply(sz);
|
|
75
|
+
menu.closeMenu();
|
|
76
|
+
} }, sz))) }), _jsx(ToolbarButton, { title: "Increase font size", disabled: px >= MAX_FONT_SIZE, onClick: () => apply(calculateNextFontSize(px, 1)), children: _jsx(Plus, {}) })] }));
|
|
77
|
+
};
|
|
78
|
+
const FORMAT_BUTTONS = [
|
|
79
|
+
{
|
|
80
|
+
format: "bold",
|
|
81
|
+
title: "Bold (Ctrl+B)",
|
|
82
|
+
icon: _jsx(Bold, {}),
|
|
83
|
+
stateKey: "isBold",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
format: "italic",
|
|
87
|
+
title: "Italic (Ctrl+I)",
|
|
88
|
+
icon: _jsx(Italic, {}),
|
|
89
|
+
stateKey: "isItalic",
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
format: "underline",
|
|
93
|
+
title: "Underline (Ctrl+U)",
|
|
94
|
+
icon: _jsx(Underline, {}),
|
|
95
|
+
stateKey: "isUnderline",
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
format: "strikethrough",
|
|
99
|
+
title: "Strikethrough",
|
|
100
|
+
icon: _jsx(Strikethrough, {}),
|
|
101
|
+
stateKey: "isStrikethrough",
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
format: "superscript",
|
|
105
|
+
title: "Superscript",
|
|
106
|
+
icon: _jsx(Superscript, {}),
|
|
107
|
+
stateKey: "isSuperscript",
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
format: "subscript",
|
|
111
|
+
title: "Subscript",
|
|
112
|
+
icon: _jsx(Subscript, {}),
|
|
113
|
+
stateKey: "isSubscript",
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
format: "highlight",
|
|
117
|
+
title: "Highlight",
|
|
118
|
+
icon: _jsx(Highlighter, {}),
|
|
119
|
+
stateKey: "isHighlight",
|
|
120
|
+
},
|
|
121
|
+
{ format: "code", title: "Inline code", icon: _jsx(Code, {}), stateKey: "isCode" },
|
|
122
|
+
];
|
|
123
|
+
/**
|
|
124
|
+
* The inline text-styling section: font family + size, the text-format toggle
|
|
125
|
+
* buttons (bold/italic/…/inline-code), and text/highlight color palettes.
|
|
126
|
+
* Rendered in place of the code-language control for non-code blocks.
|
|
127
|
+
*/
|
|
128
|
+
export const InlineMarks = ({ editor, state, menu, }) => (_jsxs(_Fragment, { children: [_jsx(FontFamilyControl, { editor: editor, value: state.fontFamily, menu: menu }), _jsx(FontSizeControl, { editor: editor, value: state.fontSize, menu: menu }), _jsx(ToolbarSeparator, {}), FORMAT_BUTTONS.map(({ format, title, icon, stateKey }) => (_jsx(ToolbarButton, { active: state[stateKey], title: title, onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, format), children: icon }, format))), _jsx(ColorPaletteDropdown, { editor: editor, colors: TEXT_COLORS, styleProperty: "color", icon: _jsx(Baseline, { className: "size-3" }), title: "Text color", menuName: "textColor", menu: menu }), _jsx(ColorPaletteDropdown, { editor: editor, colors: HIGHLIGHT_COLORS, styleProperty: "background-color", icon: _jsx(PaintBucket, { className: "size-3" }), title: "Highlight color", menuName: "bgColor", menu: menu })] }));
|
|
129
|
+
//# sourceMappingURL=inline-marks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-marks.js","sourceRoot":"","sources":["../../../../src/lexical-text-editor/plugins/toolbar/inline-marks.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,EACL,aAAa,EACb,mBAAmB,GAGpB,MAAM,SAAS,CAAA;AAChB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,EAAE,EAAE,MAAM,8BAA8B,CAAA;AACjD,OAAO,EACL,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,MAAM,EACN,KAAK,EACL,WAAW,EACX,IA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AAa,EAAC,OAAO,EACrB,IAAI,EAAE,KAAC,QAAQ,IAAC,SAAS,EAAC,QAAQ,GAAG,EACrC,KAAK,EAAC,YAAY,EAClB,QAAQ,EAAC,WAAW,EACpB,IAAI,EAAE,IAAI,GACV,EACF,KAAC,oBAAoB,IACnB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,gBAAgB,EACxB,aAAa,EAAC,kBAAkB,EAChC,IAAI,EAAE,KAAC,WAAW,IAAC,SAAS,EAAC,QAAQ,GAAG,EACxC,KAAK,EAAC,iBAAiB,EACvB,QAAQ,EAAC,SAAS,EAClB,IAAI,EAAE,IAAI,GACV,IACD,CACJ,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type LexicalEditor } from "lexical";
|
|
2
|
+
import type { ToolbarMenuControls } from "./constants";
|
|
3
|
+
/** The "Insert" dropdown: horizontal rule, page break, table builder, image. */
|
|
4
|
+
export declare const InsertMenu: ({ editor, menu, }: {
|
|
5
|
+
editor: LexicalEditor;
|
|
6
|
+
menu: ToolbarMenuControls;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=insert-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert-menu.d.ts","sourceRoot":"","sources":["../../../../src/lexical-text-editor/plugins/toolbar/insert-menu.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,aAAa,EAEnB,MAAM,SAAS,CAAA;AAchB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAItD,gFAAgF;AAChF,eAAO,MAAM,UAAU,GAAI,mBAGxB;IACD,MAAM,EAAE,aAAa,CAAA;IACrB,IAAI,EAAE,mBAAmB,CAAA;CAC1B,4CAyLA,CAAA"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useMemo, useState } from "react";
|
|
4
|
+
import { $addUpdateTag, $createParagraphNode, SKIP_SELECTION_FOCUS_TAG, } from "lexical";
|
|
5
|
+
import { $createTableCellNode, $createTableNode, $createTableRowNode, TableCellHeaderStates, } from "@lexical/table";
|
|
6
|
+
import { $insertNodeToNearestRoot } from "@lexical/utils";
|
|
7
|
+
import { INSERT_HORIZONTAL_RULE_COMMAND } from "@lexical/react/LexicalHorizontalRuleNode";
|
|
8
|
+
import { Image, Minus, Plus, SeparatorHorizontal, Table } from "lucide-react";
|
|
9
|
+
import { Button } from "@iamsaroj/smart-ui/components/button";
|
|
10
|
+
import { INSERT_IMAGE_COMMAND } from "../../nodes/image-node";
|
|
11
|
+
import { INSERT_PAGE_BREAK_COMMAND } from "../../nodes/page-break-node";
|
|
12
|
+
import { DropdownItem, PortalDropdown } from "./primitives";
|
|
13
|
+
/** The "Insert" dropdown: horizontal rule, page break, table builder, image. */
|
|
14
|
+
export const InsertMenu = ({ editor, menu, }) => {
|
|
15
|
+
const isOpen = menu.openMenu === "insert";
|
|
16
|
+
const onClose = menu.closeMenu;
|
|
17
|
+
const [mode, setMode] = useState(null);
|
|
18
|
+
const [imageUrl, setImageUrl] = useState("");
|
|
19
|
+
const [imageAlt, setImageAlt] = useState("");
|
|
20
|
+
const [tableRows, setTableRows] = useState("3");
|
|
21
|
+
const [tableCols, setTableCols] = useState("3");
|
|
22
|
+
// Reset the form when the menu closes. Adjusting state during render off a
|
|
23
|
+
// previous-value snapshot avoids a setState-in-effect cascade.
|
|
24
|
+
const [wasOpen, setWasOpen] = useState(isOpen);
|
|
25
|
+
if (wasOpen !== isOpen) {
|
|
26
|
+
setWasOpen(isOpen);
|
|
27
|
+
if (!isOpen) {
|
|
28
|
+
setMode(null);
|
|
29
|
+
setImageUrl("");
|
|
30
|
+
setImageAlt("");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const insertImage = () => {
|
|
34
|
+
if (!imageUrl.trim())
|
|
35
|
+
return;
|
|
36
|
+
editor.dispatchCommand(INSERT_IMAGE_COMMAND, {
|
|
37
|
+
src: imageUrl.trim(),
|
|
38
|
+
alt: imageAlt.trim() || "image",
|
|
39
|
+
});
|
|
40
|
+
onClose();
|
|
41
|
+
};
|
|
42
|
+
const insertTable = () => {
|
|
43
|
+
const rows = Math.max(1, Math.min(20, parseInt(tableRows) || 3));
|
|
44
|
+
const cols = Math.max(1, Math.min(20, parseInt(tableCols) || 3));
|
|
45
|
+
editor.update(() => {
|
|
46
|
+
$addUpdateTag(SKIP_SELECTION_FOCUS_TAG);
|
|
47
|
+
const tableNode = $createTableNode();
|
|
48
|
+
for (let r = 0; r < rows; r++) {
|
|
49
|
+
const rowNode = $createTableRowNode();
|
|
50
|
+
for (let c = 0; c < cols; c++) {
|
|
51
|
+
const cell = $createTableCellNode(r === 0
|
|
52
|
+
? TableCellHeaderStates.ROW
|
|
53
|
+
: TableCellHeaderStates.NO_STATUS);
|
|
54
|
+
cell.append($createParagraphNode());
|
|
55
|
+
rowNode.append(cell);
|
|
56
|
+
}
|
|
57
|
+
tableNode.append(rowNode);
|
|
58
|
+
}
|
|
59
|
+
$insertNodeToNearestRoot(tableNode);
|
|
60
|
+
});
|
|
61
|
+
onClose();
|
|
62
|
+
};
|
|
63
|
+
const panelContent = useMemo(() => {
|
|
64
|
+
if (mode === "image") {
|
|
65
|
+
return (_jsxs("div", { className: "w-64 space-y-2 p-2.5", children: [_jsx("p", { className: "text-xs font-medium", children: "Insert Image" }), _jsx("input", { type: "url", value: imageUrl, onChange: (e) => setImageUrl(e.target.value), placeholder: "https://example.com/image.png", className: "h-6 w-full rounded border border-border bg-background px-2 text-xs outline-none focus:ring-1 focus:ring-ring", autoFocus: true, onKeyDown: (e) => e.key === "Enter" && insertImage() }), _jsx("input", { type: "text", value: imageAlt, onChange: (e) => setImageAlt(e.target.value), placeholder: "Alt text (optional)", className: "h-6 w-full rounded border border-border bg-background px-2 text-xs outline-none focus:ring-1 focus:ring-ring" }), _jsxs("div", { className: "flex gap-1", children: [_jsx(Button, { size: "xs", onClick: insertImage, children: "Insert" }), _jsx(Button, { size: "xs", variant: "ghost", onClick: () => setMode(null), children: "\u2190 Back" })] })] }));
|
|
66
|
+
}
|
|
67
|
+
if (mode === "table") {
|
|
68
|
+
return (_jsxs("div", { className: "w-52 space-y-2 p-2.5", children: [_jsx("p", { className: "text-xs font-medium", children: "Insert Table" }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-[10px] text-muted-foreground", children: "Rows" }), _jsx("input", { type: "number", value: tableRows, min: "1", max: "20", onChange: (e) => setTableRows(e.target.value), className: "h-6 w-14 rounded border border-border bg-background px-1.5 text-center text-xs outline-none" })] }), _jsx("span", { className: "mt-4 text-muted-foreground", children: "\u00D7" }), _jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-[10px] text-muted-foreground", children: "Columns" }), _jsx("input", { type: "number", value: tableCols, min: "1", max: "20", onChange: (e) => setTableCols(e.target.value), className: "h-6 w-14 rounded border border-border bg-background px-1.5 text-center text-xs outline-none" })] })] }), _jsxs("div", { className: "flex gap-1", children: [_jsx(Button, { size: "xs", onClick: insertTable, children: "Insert" }), _jsx(Button, { size: "xs", variant: "ghost", onClick: () => setMode(null), children: "\u2190 Back" })] })] }));
|
|
69
|
+
}
|
|
70
|
+
return (_jsxs(_Fragment, { children: [_jsx(DropdownItem, { label: "Horizontal Rule", icon: _jsx(Minus, {}), onClick: () => {
|
|
71
|
+
editor.update(() => {
|
|
72
|
+
$addUpdateTag(SKIP_SELECTION_FOCUS_TAG);
|
|
73
|
+
editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined);
|
|
74
|
+
});
|
|
75
|
+
onClose();
|
|
76
|
+
} }), _jsx(DropdownItem, { label: "Page Break", icon: _jsx(SeparatorHorizontal, {}), onClick: () => {
|
|
77
|
+
editor.update(() => {
|
|
78
|
+
$addUpdateTag(SKIP_SELECTION_FOCUS_TAG);
|
|
79
|
+
editor.dispatchCommand(INSERT_PAGE_BREAK_COMMAND, undefined);
|
|
80
|
+
});
|
|
81
|
+
onClose();
|
|
82
|
+
} }), _jsx(DropdownItem, { label: "Table", icon: _jsx(Table, {}), description: "\u2192", onClick: () => setMode("table") }), _jsx(DropdownItem, { label: "Image", icon: _jsx(Image, {}), description: "\u2192", onClick: () => setMode("image") })] }));
|
|
83
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
84
|
+
}, [mode, imageUrl, imageAlt, tableRows, tableCols, editor]);
|
|
85
|
+
return (_jsx(PortalDropdown, { isOpen: isOpen, onToggle: () => menu.toggleMenu("insert"), onClose: onClose, label: _jsxs(_Fragment, { children: [_jsx(Plus, { className: "size-3" }), "Insert"] }), children: panelContent }));
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=insert-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert-menu.js","sourceRoot":"","sources":["../../../../src/lexical-text-editor/plugins/toolbar/insert-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EACL,aAAa,EACb,oBAAoB,EAEpB,wBAAwB,GACzB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAA;AACzF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAA;AAC7D,OAAO,EAAE,oBAAoB,EAAE,M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IACX,KAAK,EAAC,YAAY,EAClB,IAAI,EAAE,KAAC,mBAAmB,KAAG,EAC7B,OAAO,EAAE,GAAG,EAAE;wBACZ,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE;4BACjB,aAAa,CAAC,wBAAwB,CAAC,CAAA;4BACvC,MAAM,CAAC,eAAe,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAA;wBAC9D,CAAC,CAAC,CAAA;wBACF,OAAO,EAAE,CAAA;oBACX,CAAC,GACD,EACF,KAAC,YAAY,IACX,KAAK,EAAC,OAAO,EACb,IAAI,EAAE,KAAC,KAAK,KAAG,EACf,WAAW,EAAC,QAAG,EACf,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAC/B,EACF,KAAC,YAAY,IACX,KAAK,EAAC,OAAO,EACb,IAAI,EAAE,KAAC,KAAK,KAAG,EACf,WAAW,EAAC,QAAG,EACf,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,GAC/B,IACD,CACJ,CAAA;QACD,uDAAuD;IACzD,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAA;IAE5D,OAAO,CACL,KAAC,cAAc,IACb,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EACzC,OAAO,EAAE,OAAO,EAChB,KAAK,EACH,8BACE,KAAC,IAAI,IAAC,SAAS,EAAC,QAAQ,GAAG,cAE1B,YAGJ,YAAY,GACE,CAClB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type LexicalEditor } from "lexical";
|
|
2
|
+
/**
|
|
3
|
+
* The link control: toggles between an "insert/remove link" button and an inline
|
|
4
|
+
* URL input. Owns its own input-open + draft-URL state (ephemeral UI, unrelated
|
|
5
|
+
* to the shared selection state) — `isLink` comes from the toolbar state.
|
|
6
|
+
*/
|
|
7
|
+
export declare const LinkEditor: ({ editor, isLink, }: {
|
|
8
|
+
editor: LexicalEditor;
|
|
9
|
+
isLink: boolean;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=link-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-editor.d.ts","sourceRoot":"","sources":["../../../../src/lexical-text-editor/plugins/toolbar/link-editor.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAA;AAK5C;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,qBAGxB;IACD,MAAM,EAAE,aAAa,CAAA;IACrB,MAAM,EAAE,OAAO,CAAA;CAChB,4CAqEA,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { TOGGLE_LINK_COMMAND } from "@lexical/link";
|
|
5
|
+
import { Check, Link2, Link2Off, X } from "lucide-react";
|
|
6
|
+
import { ToolbarButton } from "./primitives";
|
|
7
|
+
/**
|
|
8
|
+
* The link control: toggles between an "insert/remove link" button and an inline
|
|
9
|
+
* URL input. Owns its own input-open + draft-URL state (ephemeral UI, unrelated
|
|
10
|
+
* to the shared selection state) — `isLink` comes from the toolbar state.
|
|
11
|
+
*/
|
|
12
|
+
export const LinkEditor = ({ editor, isLink, }) => {
|
|
13
|
+
const [showLinkInput, setShowLinkInput] = useState(false);
|
|
14
|
+
const [linkUrl, setLinkUrl] = useState("");
|
|
15
|
+
const linkInputRef = useRef(null);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (showLinkInput)
|
|
18
|
+
linkInputRef.current?.focus();
|
|
19
|
+
}, [showLinkInput]);
|
|
20
|
+
const submitLink = () => {
|
|
21
|
+
const url = linkUrl.trim();
|
|
22
|
+
if (url)
|
|
23
|
+
editor.dispatchCommand(TOGGLE_LINK_COMMAND, url);
|
|
24
|
+
setShowLinkInput(false);
|
|
25
|
+
setLinkUrl("");
|
|
26
|
+
};
|
|
27
|
+
if (showLinkInput) {
|
|
28
|
+
return (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("input", { ref: linkInputRef, type: "url", value: linkUrl, onChange: (e) => setLinkUrl(e.target.value), placeholder: "https://\u2026", className: "h-6 w-44 rounded border border-border bg-background px-2 text-xs outline-none focus:ring-1 focus:ring-ring", onMouseDown: (e) => e.stopPropagation(), onKeyDown: (e) => {
|
|
29
|
+
if (e.key === "Enter") {
|
|
30
|
+
e.preventDefault();
|
|
31
|
+
submitLink();
|
|
32
|
+
}
|
|
33
|
+
if (e.key === "Escape") {
|
|
34
|
+
setShowLinkInput(false);
|
|
35
|
+
setLinkUrl("");
|
|
36
|
+
}
|
|
37
|
+
} }), _jsx(ToolbarButton, { title: "Apply link", onClick: submitLink, children: _jsx(Check, {}) }), _jsx(ToolbarButton, { title: "Cancel", onClick: () => {
|
|
38
|
+
setShowLinkInput(false);
|
|
39
|
+
setLinkUrl("");
|
|
40
|
+
}, children: _jsx(X, {}) })] }));
|
|
41
|
+
}
|
|
42
|
+
return (_jsx(ToolbarButton, { active: isLink, title: isLink ? "Remove link" : "Insert link", onClick: () => {
|
|
43
|
+
if (isLink)
|
|
44
|
+
editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);
|
|
45
|
+
else {
|
|
46
|
+
setLinkUrl("");
|
|
47
|
+
setShowLinkInput(true);
|
|
48
|
+
}
|
|
49
|
+
}, children: isLink ? _jsx(Link2Off, {}) : _jsx(Link2, {}) }));
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=link-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-editor.js","sourceRoot":"","sources":["../../../../src/lexical-text-editor/plugins/tool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KAAC,KAAK,KAAG,GACpB,CACjB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface PortalDropdownProps {
|
|
3
|
+
label: React.ReactNode;
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onToggle: () => void;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
panelClassName?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
title?: string;
|
|
11
|
+
chevron?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Toolbar dropdown whose panel is portalled to `document.body`, mirroring the
|
|
15
|
+
* Lexical playground's DropDown. Rendering outside the editor DOM keeps item
|
|
16
|
+
* clicks from stealing the editor's DOM focus. The panel is positioned beneath
|
|
17
|
+
* the trigger and closes on an outside pointer-down.
|
|
18
|
+
*/
|
|
19
|
+
export declare const PortalDropdown: ({ label, isOpen, onToggle, onClose, children, panelClassName, disabled, title, chevron, }: PortalDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare const DropdownItem: ({ label, icon, active, onClick, description, className, style, }: {
|
|
21
|
+
label: string;
|
|
22
|
+
icon?: React.ReactNode;
|
|
23
|
+
active?: boolean;
|
|
24
|
+
onClick: () => void;
|
|
25
|
+
description?: string;
|
|
26
|
+
className?: string;
|
|
27
|
+
style?: React.CSSProperties;
|
|
28
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const ToolbarButton: ({ active, disabled, onClick, title, children, className, }: {
|
|
30
|
+
active?: boolean;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
onClick: () => void;
|
|
33
|
+
title: string;
|
|
34
|
+
children: React.ReactNode;
|
|
35
|
+
className?: string;
|
|
36
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare const ToolbarSeparator: () => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=primitives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../src/lexical-text-editor/plugins/toolbar/primitives.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAY9B,UAAU,mBAAmB;IAC3B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,MAAM,EAAE,OAAO,CAAA;IACf,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,2FAU5B,mBAAmB,4CAoErB,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,kEAQ1B;IACD,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B,4CAsBA,CAAA;AAID,eAAO,MAAM,aAAa,GAAI,4DAO3B;IACD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,4CAcA,CAAA;AAED,eAAO,MAAM,gBAAgB,+CAE5B,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
import { createPortal } from "react-dom";
|
|
5
|
+
import { ChevronDown } from "lucide-react";
|
|
6
|
+
import { Button } from "@iamsaroj/smart-ui/components/button";
|
|
7
|
+
import { Separator } from "@iamsaroj/smart-ui/components/separator";
|
|
8
|
+
import { cn } from "@iamsaroj/smart-ui/lib/utils";
|
|
9
|
+
// ─── PortalDropdown ───────────────────────────────────────────────────────────
|
|
10
|
+
const DROPDOWN_PADDING = 4;
|
|
11
|
+
/**
|
|
12
|
+
* Toolbar dropdown whose panel is portalled to `document.body`, mirroring the
|
|
13
|
+
* Lexical playground's DropDown. Rendering outside the editor DOM keeps item
|
|
14
|
+
* clicks from stealing the editor's DOM focus. The panel is positioned beneath
|
|
15
|
+
* the trigger and closes on an outside pointer-down.
|
|
16
|
+
*/
|
|
17
|
+
export const PortalDropdown = ({ label, isOpen, onToggle, onClose, children, panelClassName, disabled, title, chevron = true, }) => {
|
|
18
|
+
const triggerRef = useRef(null);
|
|
19
|
+
const panelRef = useRef(null);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
if (!isOpen || !triggerRef.current || !panelRef.current)
|
|
22
|
+
return;
|
|
23
|
+
const { top, left, height } = triggerRef.current.getBoundingClientRect();
|
|
24
|
+
panelRef.current.style.top = `${top + height + DROPDOWN_PADDING}px`;
|
|
25
|
+
panelRef.current.style.left = `${Math.min(left, window.innerWidth - panelRef.current.offsetWidth - 8)}px`;
|
|
26
|
+
}, [isOpen]);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!isOpen)
|
|
29
|
+
return;
|
|
30
|
+
const close = (e) => {
|
|
31
|
+
const target = e.target;
|
|
32
|
+
if (!triggerRef.current?.contains(target) &&
|
|
33
|
+
!panelRef.current?.contains(target)) {
|
|
34
|
+
onClose();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
document.addEventListener("pointerdown", close);
|
|
38
|
+
return () => document.removeEventListener("pointerdown", close);
|
|
39
|
+
}, [isOpen, onClose]);
|
|
40
|
+
return (_jsxs(_Fragment, { children: [_jsxs("button", { ref: triggerRef, type: "button", disabled: disabled, onClick: onToggle, title: title, "aria-label": title, "aria-expanded": isOpen, "aria-haspopup": "listbox", className: cn("inline-flex h-6 items-center gap-1 rounded border border-border bg-background", "px-1.5 text-xs font-medium transition-colors outline-none", "hover:bg-muted focus-visible:ring-1 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50", isOpen && "bg-muted"), children: [label, chevron && (_jsx(ChevronDown, { className: "size-2.5 shrink-0 text-muted-foreground" }))] }), isOpen &&
|
|
41
|
+
createPortal(_jsx("div", { ref: panelRef, role: "listbox", className: cn("fixed z-[9999] min-w-[9rem] rounded-md border border-border", "bg-popover py-1 shadow-lg", panelClassName), children: children }), document.body)] }));
|
|
42
|
+
};
|
|
43
|
+
export const DropdownItem = ({ label, icon, active, onClick, description, className, style, }) => (_jsxs("button", { type: "button", role: "option", "aria-selected": active, onClick: onClick, style: style, className: cn("flex w-full items-center gap-2 px-2.5 py-1.5 text-left text-xs", "transition-colors hover:bg-muted", active && "bg-muted font-medium", className), children: [icon && (_jsx("span", { className: "size-3.5 shrink-0 text-muted-foreground", children: icon })), _jsx("span", { className: "flex-1", children: label }), description && (_jsx("span", { className: "text-[10px] text-muted-foreground", children: description }))] }));
|
|
44
|
+
// ─── Toolbar primitives ───────────────────────────────────────────────────────
|
|
45
|
+
export const ToolbarButton = ({ active, disabled, onClick, title, children, className, }) => (_jsx(Button, { type: "button", variant: active ? "secondary" : "ghost", size: "icon-sm", disabled: disabled, onClick: onClick, title: title, "aria-label": title, "aria-pressed": active, className: className, children: children }));
|
|
46
|
+
export const ToolbarSeparator = () => (_jsx(Separator, { orientation: "vertical", className: "mx-0.5 h-4 self-center" }));
|
|
47
|
+
//# sourceMappingURL=primitives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../../../src/lexical-text-editor/plugins/toolbar/primitives.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAGZ,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,EAAE,EAAE,MAAM,8BAA8B,CAAA;AAEjD,iFAAiF;AAEjF,MAAM,gBAAgB,GAAG,CAAC,CAAA;AAc1B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,KAAK,EACL,OAAO,GAAG,IAAI,GACM,EAAE,EAAE;IACxB,MAAM,UAAU,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAA;IAClD,MAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAE7C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO;YAAE,OAAM;QAC/D,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAA;QACxE,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,GAAG,gBAAgB,IAAI,CAAA;QACnE,QAAQ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ACpC,KAAC,SAAS,IAAC,WAAW,EAAC,UAAU,EAAC,SAAS,EAAC,wBAAwB,GAAG,CACxE,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type LexicalEditor } from "lexical";
|
|
2
|
+
/**
|
|
3
|
+
* Registers the block-level insert commands the {@link InsertMenu} dispatches.
|
|
4
|
+
* Uses `$insertNodeToNearestRoot` (not `$insertNodes`) so block-level decorators
|
|
5
|
+
* land at the root — same as the Lexical playground. Co-located with the insert
|
|
6
|
+
* menu that triggers them.
|
|
7
|
+
*/
|
|
8
|
+
export declare const useRegisterInsertCommands: (editor: LexicalEditor) => void;
|
|
9
|
+
//# sourceMappingURL=use-insert-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-insert-commands.d.ts","sourceRoot":"","sources":["../../../../src/lexical-text-editor/plugins/toolbar/use-insert-commands.ts"],"names":[],"mappings":"AAGA,OAAO,EAIL,KAAK,aAAa,EACnB,MAAM,SAAS,CAAA;AAShB;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,GAAI,QAAQ,aAAa,SAyB9D,CAAA"}
|