@povio/ui 6.0.0-rc.12 → 6.0.0-rc.13
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 +469 -42
- package/dist/{Accordion-Cup5eRZz.d.ts → Accordion-CR9oomZY.d.ts} +29 -17
- package/dist/{Accordion-ORBin0EZ.js → Accordion-gUW7u1Zn.js} +41 -41
- package/dist/Alert-DwnALnFY.d.ts +36 -0
- package/dist/AlertDialog-BcRiqY_n.d.ts +70 -0
- package/dist/Autocomplete-CV4Aa1Ok.js +319 -0
- package/dist/Autocomplete-DRwQxx0U.d.ts +123 -0
- package/dist/Badge-CO-ZsmbR.d.ts +67 -0
- package/dist/{BottomSheet-CGipksM_.js → BottomSheet-APVu5TUd.js} +8 -8
- package/dist/BottomSheet-Be0HtQzP.d.ts +65 -0
- package/dist/{BottomSheet.lazy-CuJMUeJP.d.ts → BottomSheet.lazy-NNB7ivkW.d.ts} +1 -1
- package/dist/{Breadcrumbs-CcB0oOF8.d.ts → Breadcrumbs-Bn3fqVYx.d.ts} +6 -3
- package/dist/{Breadcrumbs-a1-q_he0.js → Breadcrumbs-Cd75RPbS.js} +33 -17
- package/dist/{Button-C1YB5dOw.js → Button-BJJkLVNj.js} +1 -5
- package/dist/{Button-BaODzvZd.js → Button-CzEs3tcV.js} +1 -1
- package/dist/{Button-0SswSdDg.d.ts → Button-Hk8zm9q_.d.ts} +2 -2
- package/dist/ButtonBase-Cp1w00t2.d.ts +47 -0
- package/dist/{ButtonBase-s-VV7oCa.js → ButtonBase-aGz6DYum.js} +10 -18
- package/dist/{ButtonContent-Dztbuz3q.js → ButtonContent-2KsbdWRO.js} +5 -5
- package/dist/{Calendar-yaQubCWK.js → Calendar-DN-i_b-_.js} +19 -17
- package/dist/{Calendar.lazy-DcVss9Bk.js → Calendar.lazy-CqmyDSND.js} +4 -4
- package/dist/{Checkbox-Bjsbx-wK.js → Checkbox-CzKXZw_w.js} +35 -9
- package/dist/Checkbox-D32MOIhF.d.ts +49 -0
- package/dist/CheckboxCheckmark-DDU_Ie7-.js +42 -0
- package/dist/CheckboxGroup-B5Mn1G3u.d.ts +52 -0
- package/dist/{CheckboxGroup-B3O3IUiu.js → CheckboxGroup-BqWt09kZ.js} +75 -35
- package/dist/DatePicker-CmoVbapu.d.ts +80 -0
- package/dist/{DatePicker-bme8zGBo.js → DatePicker-DQewd1By.js} +80 -41
- package/dist/{DatePickerInput-vLlL5ATh.d.ts → DatePickerInput-B9VnExeA.d.ts} +3 -3
- package/dist/{DatePickerInput-C2881tvS.js → DatePickerInput-Bp9ZIN5E.js} +37 -26
- package/dist/{DateRangePicker-Blg158JD.js → DateRangePicker-DRZ1hLlR.js} +86 -158
- package/dist/DateRangePicker-LX1VJlnD.d.ts +102 -0
- package/dist/DateTimePicker-D9pODhAj.d.ts +83 -0
- package/dist/{DateTimePicker-CdRFt8WM.js → DateTimePicker-DWtKPaE6.js} +70 -35
- package/dist/{Dialog-C9H9_BmK.js → Dialog-BJ13KRQo.js} +1 -1
- package/dist/{Dialog-DN5703sy.js → Dialog-BzQYDPJ9.js} +23 -19
- package/dist/Dialog-D0SeePPz.d.ts +66 -0
- package/dist/{Disclosure-BRSkMbZQ.js → Disclosure-Bjm5IOpg.js} +1 -1
- package/dist/Drawer-o018RqIt.d.ts +42 -0
- package/dist/DropdownMenu-DTr7b-XO.d.ts +51 -0
- package/dist/{DropdownMenu-DS0RaEfH.js → DropdownMenu-DrshB60h.js} +33 -21
- package/dist/{DropdownMenuDesktop-DGPIfex-.js → DropdownMenuDesktop-DxGA0yvx.js} +14 -8
- package/dist/FileInput-Bokcp9nH.d.ts +61 -0
- package/dist/{FileInput-BUwtAF2-.js → FileInput-LMhFxlqB.js} +75 -80
- package/dist/FileUpload-BqXd4_nz.d.ts +181 -0
- package/dist/FileUpload-CJZrkr_U.js +679 -0
- package/dist/{FormField-dduTMkNH.js → FormField-TI8Vx5aC.js} +10 -10
- package/dist/FormField-XQbjfGSv.d.ts +70 -0
- package/dist/{FormFieldError-BT4uxbKY.d.ts → FormFieldError-C7yOdjzQ.d.ts} +1 -0
- package/dist/FormFieldHeaderTooltip-DB7KrrcD.js +22 -0
- package/dist/HiddenFormValue-DZ2d9eoA.js +20 -0
- package/dist/IconButton-CQLHX8-Y.d.ts +24 -0
- package/dist/{IconSlot-CqNuZl0E.js → IconSlot-TAWTJ6iK.js} +2 -4
- package/dist/{InlineTooltipWrapper-CKTiFpZn.js → InlineTooltipWrapper-CjDUsi2I.js} +1 -1
- package/dist/{Input-CG5LQ0zs.js → Input-CeRJeAoR.js} +94 -59
- package/dist/Input-onUj0DKg.d.ts +56 -0
- package/dist/{InputContent-Fx2E4UXl.js → InputContent-B8OCdbVP.js} +15 -13
- package/dist/InputContent-D5ZkB9hO.d.ts +39 -0
- package/dist/Link-BdnWVYL9.d.ts +15 -0
- package/dist/{ListBox-DhR5kojP.js → ListBox-gR4iSV7N.js} +3 -3
- package/dist/{Modal-DcLWF9cB.js → Modal-DAMsCwzb.js} +1 -1
- package/dist/{NumberField-DxuikBcr.js → NumberField-6Q9LHGSo.js} +91 -62
- package/dist/NumberField-Sb30Qao3.d.ts +41 -0
- package/dist/{NumberRangeInput-8bOjNEnS.js → NumberRangeInput-BDSkcHVJ.js} +152 -101
- package/dist/NumberRangeInput-Dvq8mOUY.d.ts +89 -0
- package/dist/{PageHeader-DTfzf-dA.d.ts → PageHeader-eJk6GNK6.d.ts} +6 -5
- package/dist/{PasswordInput.bound-Dfq5c3JQ.js → PasswordInput-BcHpV0Ie.js} +6 -6
- package/dist/PasswordInput-VHzP4VPU.d.ts +16 -0
- package/dist/Popover-qplPGDnR.d.ts +51 -0
- package/dist/Progress-DH-w99MU.d.ts +26 -0
- package/dist/Progress-WzWvbvtp.js +180 -0
- package/dist/ProgressBar-BsSimmJF.js +46 -0
- package/dist/RadioGroup-CC8bKtBN.d.ts +52 -0
- package/dist/{RadioGroup-IL4Y8XHO.js → RadioGroup-PKqFHoKP.js} +66 -26
- package/dist/{RangeCalendar-DT63UD8K.js → RangeCalendar-DqCTlIuy.js} +12 -10
- package/dist/Select-CSyfDyxG.d.ts +248 -0
- package/dist/{Select-BM8PNrjC.js → Select-D3fuXwVt.js} +435 -184
- package/dist/{SelectListBox-BFSZxDSi.js → SelectListBox-DqAxkT1f.js} +46 -37
- package/dist/{SidebarWorkspaces-DJknAfS9.js → SidebarWorkspaces-BGl_PIsH.js} +280 -363
- package/dist/{SidebarWorkspaces-DDHJAdNH.d.ts → SidebarWorkspaces-CdtK2M-C.d.ts} +31 -17
- package/dist/{Slider-DCsCCPFx.js → Slider-BCUiALjE.js} +69 -12
- package/dist/Slider-DxalZD3o.d.ts +57 -0
- package/dist/Spinner-BTrEbNFy.d.ts +13 -0
- package/dist/SplitButton-Dv5l8p5t.d.ts +25 -0
- package/dist/Stepper-B1IOUcSI.d.ts +49 -0
- package/dist/{Stepper-Dyhxp0Tl.js → Stepper-DA2G546I.js} +116 -88
- package/dist/{Switch-BfpSMMpv.js → Switch-Ce-bJOVw.js} +54 -12
- package/dist/Switch-urNrop0P.d.ts +42 -0
- package/dist/{TabsFilters-DybNturW.js → TabsFilters-Cweij8He.js} +44 -33
- package/dist/TabsFilters-M5Ld7eb8.d.ts +59 -0
- package/dist/Tag-BKR1AZFa.d.ts +26 -0
- package/dist/TextArea-D7YVclaz.d.ts +33 -0
- package/dist/{TextArea-Blsip3ZC.js → TextArea-P8F0oD_A.js} +59 -32
- package/dist/TimePicker-Ai1M2TGW.d.ts +63 -0
- package/dist/{TimePicker-4hV5zbgd.js → TimePicker-l4Ysk2AX.js} +99 -50
- package/dist/{TimePickerForm-DD9VA_td.js → TimePickerForm-BMqNpDPT.js} +5 -5
- package/dist/{ToastContainer-Dd0LPykL.js → ToastContainer-BeklfvlK.js} +4 -4
- package/dist/{ToggleButton-HUZ8ij6i.d.ts → ToggleButton-DWw53pTt.d.ts} +2 -2
- package/dist/ToggleGroup-BQk3k0at.d.ts +95 -0
- package/dist/ToggleGroup-BdIgqoqA.js +500 -0
- package/dist/{Tooltip-DRB6lo0U.js → Tooltip-BkXPEBqw.js} +2 -2
- package/dist/Tooltip-H8OB7CqY.d.ts +33 -0
- package/dist/TooltipEllipsis-7QF00kXk.d.ts +21 -0
- package/dist/{TooltipWrapper-BSY31JMc.js → TooltipWrapper-ubbBHHVD.js} +6 -6
- package/dist/{Typography-DJojwiXV.d.ts → Typography-Cx1oRGxd.d.ts} +5 -1
- package/dist/{badgeButton.cva-t5PQOH4M.js → badge.cva-BpoxNggB.js} +20 -22
- package/dist/{button.cva-Ciga0rdG.js → button.cva-C2aoXMh-.js} +10 -16
- package/dist/{buttonContent.cva-BapnODby.d.ts → buttonContent.cva-Dyy_RUZU.d.ts} +1 -1
- package/dist/{checkbox.cva-aLJS7v4z.js → checkbox.cva-qU_q0lSX.js} +14 -14
- package/dist/components/accordion.d.ts +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/alert-dialog.d.ts +2 -2
- package/dist/components/alert-dialog.js +174 -128
- package/dist/components/alert.d.ts +1 -1
- package/dist/components/alert.js +17 -15
- package/dist/components/autocomplete.d.ts +2 -2
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/badge.d.ts +2 -2
- package/dist/components/badge.js +159 -81
- package/dist/components/bottom-sheet-header.d.ts +1 -1
- package/dist/components/bottom-sheet-header.js +4 -4
- package/dist/components/bottom-sheet.d.ts +2 -2
- package/dist/components/bottom-sheet.js +2 -2
- package/dist/components/breadcrumbs.d.ts +1 -1
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/checkbox-group.d.ts +2 -2
- package/dist/components/checkbox-group.js +1 -1
- package/dist/components/checkbox.d.ts +2 -2
- package/dist/components/checkbox.js +1 -1
- package/dist/components/date-picker.d.ts +2 -2
- package/dist/components/date-picker.js +1 -1
- package/dist/components/date-range-picker.d.ts +4 -41
- package/dist/components/date-range-picker.js +4 -2
- package/dist/components/date-range-presets.d.ts +2 -0
- package/dist/components/date-range-presets.js +3 -0
- package/dist/components/date-time-picker.d.ts +2 -2
- package/dist/components/date-time-picker.js +1 -1
- package/dist/components/dialog.d.ts +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/drawer.d.ts +1 -1
- package/dist/components/drawer.js +16 -80
- package/dist/components/dropdown-menu.d.ts +2 -3
- package/dist/components/dropdown-menu.js +2 -3
- package/dist/components/file-input.d.ts +2 -2
- package/dist/components/file-input.js +1 -1
- package/dist/components/file-upload.d.ts +2 -3
- package/dist/components/file-upload.js +1 -1
- package/dist/components/form-field.d.ts +3 -2
- package/dist/components/form-field.js +1 -1
- package/dist/components/icon-button.d.ts +1 -1
- package/dist/components/icon-button.js +22 -25
- package/dist/components/icon-slot.d.ts +1 -2
- package/dist/components/icon-slot.js +2 -2
- package/dist/components/input-frame.d.ts +6 -10
- package/dist/components/input-frame.js +29 -26
- package/dist/components/input.d.ts +2 -2
- package/dist/components/input.js +2 -2
- package/dist/components/link.d.ts +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/number-field.d.ts +2 -2
- package/dist/components/number-field.js +2 -2
- package/dist/components/number-range-input.d.ts +2 -2
- package/dist/components/number-range-input.js +1 -1
- package/dist/components/page-header.d.ts +1 -1
- package/dist/components/page-header.js +5 -5
- package/dist/components/password-input.d.ts +2 -2
- package/dist/components/password-input.js +1 -22
- package/dist/components/popover.d.ts +1 -1
- package/dist/components/popover.js +105 -87
- package/dist/components/progress.d.ts +2 -2
- package/dist/components/progress.js +1 -1
- package/dist/components/radio-group.d.ts +2 -2
- package/dist/components/radio-group.js +1 -1
- package/dist/components/select.d.ts +2 -2
- package/dist/components/select.js +1 -1
- package/dist/components/sidebar.d.ts +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/slider.d.ts +2 -2
- package/dist/components/slider.js +1 -1
- package/dist/components/spinner.d.ts +1 -1
- package/dist/components/spinner.js +71 -1
- package/dist/components/split-button.d.ts +1 -1
- package/dist/components/split-button.js +15 -4
- package/dist/components/stepper.d.ts +1 -1
- package/dist/components/stepper.js +1 -1
- package/dist/components/style-definitions.d.ts +2 -2
- package/dist/components/style-definitions.js +33 -18
- package/dist/components/switch.d.ts +2 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/tabs-filters.d.ts +1 -1
- package/dist/components/tabs-filters.js +1 -1
- package/dist/components/tag.d.ts +1 -1
- package/dist/components/tag.js +50 -64
- package/dist/components/text-area.d.ts +2 -2
- package/dist/components/text-area.js +1 -1
- package/dist/components/time-picker.d.ts +2 -2
- package/dist/components/time-picker.js +1 -1
- package/dist/components/toast.d.ts +3 -3
- package/dist/components/toast.js +4 -3
- package/dist/components/toggle-button.d.ts +1 -1
- package/dist/components/toggle-button.js +1 -1
- package/dist/components/toggle-group.d.ts +2 -2
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/tooltip-ellipsis.d.ts +1 -1
- package/dist/components/tooltip-ellipsis.js +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/typography.d.ts +2 -2
- package/dist/components/use-toast.d.ts +2 -2
- package/dist/components/use-toast.js +1 -41
- package/dist/config/component-configuration.d.ts +1 -1
- package/dist/config/component-configuration.js +53 -2
- package/dist/config/confirmation.d.ts +1 -1
- package/dist/config/confirmation.js +1 -1
- package/dist/config/link-context.d.ts +3 -3
- package/dist/config/link-context.js +1 -1
- package/dist/config/resources.d.ts +1 -1
- package/dist/config/resources.js +1 -1
- package/dist/config/ui-config.d.ts +2 -2
- package/dist/config/ui-config.js +1 -1
- package/dist/config/ui-router.d.ts +1 -1
- package/dist/config/ui-router.js +1 -1
- package/dist/confirmation.context-BflM4Vxg.js +93 -0
- package/dist/confirmation.context-C_js9qNv.d.ts +32 -0
- package/dist/{datePickerInput.cva-Du0Zn04v.js → datePickerInput.cva-CWkV2fut.js} +1 -1
- package/dist/dateRangePreset.utils-Bnb-rjTt.js +116 -0
- package/dist/{dialog.cva-BIpz6HcA.js → dialog.cva-BjVggO5l.js} +1 -1
- package/dist/{dist-DEZzXa0W.js → dist-DZOoWaZz.js} +63 -38
- package/dist/{dropdownMenu.cva-DwSOcbmR.js → dropdownMenu.cva-BopsvbOy.js} +19 -7
- package/dist/{exports-BNrTn8Tj.js → exports-DeBGRThC.js} +3 -3
- package/dist/{file.utils-Crb-mIHs.d.ts → file.utils-DUADtzdt.d.ts} +3 -3
- package/dist/{file.utils-DqQxnuAm.js → file.utils-X6tkeWaz.js} +2 -6
- package/dist/fileInputButton.cva-gbqRUf1g.js +39 -0
- package/dist/{fileUpload.cva-BYzXGc9C.js → fileUpload.cva-MH5ziWUe.js} +2 -2
- package/dist/form-field-Bw7U_ZPI.d.ts +1 -0
- package/dist/form.binding-Brdjq2yr.js +161 -0
- package/dist/form.binding-DSXB2AOD.d.ts +127 -0
- package/dist/form.types-a2WVJDQX.d.ts +43 -0
- package/dist/formReset-CnZl_yze.js +35 -0
- package/dist/hints-B09_WDhL.d.ts +17 -0
- package/dist/hooks/use-async-list.d.ts +1 -1
- package/dist/hooks/use-async-list.js +1 -1
- package/dist/hooks/use-breakpoint.d.ts +3 -0
- package/dist/hooks/use-breakpoint.js +2 -0
- package/dist/hooks/use-filters.d.ts +2 -2
- package/dist/hooks/use-filters.js +1 -1
- package/dist/{i18n-DM-PUcxQ.d.ts → i18n-B3PeqBM7.d.ts} +100 -4
- package/dist/{i18n-D8vXIoiq.js → i18n-DQs7jPjv.js} +99 -9
- package/dist/iconSlot.cva-DyhOI7EK.js +5 -0
- package/dist/{import-C7W0Wv2r.js → import-C73fI3WD.js} +2 -2
- package/dist/index.d.ts +64 -83
- package/dist/index.js +55 -90
- package/dist/{input.cva-DZii82eS.js → input.cva-mm1dnfKP.js} +27 -23
- package/dist/inputLayout-CIVpuUBq.js +7 -0
- package/dist/inputRow.clsx-BbcaXVta.js +6 -0
- package/dist/{label.cva-DTfT6FrX.js → label.cva-DJ5Dmbz5.js} +7 -7
- package/dist/link.context-BcBuP9ZT.d.ts +20 -0
- package/dist/{link.context-TPjDtjw3.js → link.context-CD5h_b5O.js} +12 -11
- package/dist/link.cva-D6L1c2wq.d.ts +2157 -0
- package/dist/{logger-CqZjM-sn.js → logger-CW24po62.js} +10 -1
- package/dist/{progress.cva-CsGaGVJ-.js → progress.cva-mkJxrrac.js} +2 -2
- package/dist/{radio.cva-DistaZtZ.js → radio.cva-Dt5N2ul2.js} +7 -7
- package/dist/rich-text-editor.d.ts +44 -2
- package/dist/rich-text-editor.js +733 -1
- package/dist/router.context-B6j_M4cN.js +151 -0
- package/dist/router.context-CSd9JYQ4.d.ts +33 -0
- package/dist/{selectDesktop.cva-DStkOdwm.js → selectDesktop.cva-30JAvtgB.js} +1 -1
- package/dist/sidebar.cva-BgxTCejU.js +150 -0
- package/dist/spinner.cva-j4kGmIWC.js +17 -0
- package/dist/{staticDateTimeSegments-CVuAhDDl.js → staticDateTimeSegments-BYk1tcxs.js} +43 -13
- package/dist/{status.cva-CYgi3Htz.js → status.cva-WLEqUAjH.js} +9 -9
- package/dist/styles/input.d.ts +1 -1
- package/dist/tanstack/form.d.ts +3 -3
- package/dist/tanstack/form.js +3 -3
- package/dist/tanstack/table.d.ts +5 -3
- package/dist/tanstack/table.js +1 -1
- package/dist/tanstack-ABeiJISz.js +10 -0
- package/dist/tanstack-bLXoUPDY.d.ts +165 -0
- package/dist/tanstack.d.ts +64 -83
- package/dist/tanstack.js +55 -90
- package/dist/{toast.cva-B6NXTwbZ.js → toast.cva-C3oA7He3.js} +8 -8
- package/dist/toast.runtime-BHXdSTXV.js +25 -0
- package/dist/{toggleGroup.cva-CJ-3Ps7j.js → toggleGroup.cva-CvNS5QO1.js} +2 -2
- package/dist/uiConfig.context-CN_QgxGO.d.ts +19 -0
- package/dist/{uiConfig.context-3DN9w6oU.js → uiConfig.context-CjnLnQOo.js} +5 -7
- package/dist/{uiConfig.context-BnCORTNm.d.ts → uiConfig.types-B0sPL7nN.d.ts} +34 -34
- package/dist/{useAsyncList-Ct74ve3i.js → useAsyncList-CQgkDfjW.js} +140 -35
- package/dist/useAsyncList-F-328rtE.d.ts +25 -0
- package/dist/useAutoFocus-K-bfNxa2.js +16 -0
- package/dist/{useBreakpoint-CJ3mx7UF.js → useBreakpoint-BrJrvp9_.js} +5 -1
- package/dist/useBreakpoint-D-SVcBeQ.d.ts +9 -0
- package/dist/useDebounceCallback-BjePw6y4.js +90 -0
- package/dist/useFilters-CybBXUAA.js +217 -0
- package/dist/useFilters-DrfBFNLw.d.ts +57 -0
- package/dist/useFormAutosave-BN-zueci.js +419 -0
- package/dist/{useFormAutosave-BBLm3Ujo.d.ts → useFormAutosave-ClMnzVE7.d.ts} +1 -1
- package/dist/{useIntersectionObserver-DFAhTsV0.js → useIntersectionObserver-B8msnQTR.js} +15 -3
- package/dist/{numberStatic.utils-BIyZuILs.js → useLiveNumberFieldState-B7qGzySj.js} +103 -2
- package/dist/useRemoveButton-B6-IGvpY.js +98 -0
- package/dist/useResolveDateRangePreset-C_L-doA6.js +26 -0
- package/dist/useResolveDateRangePreset-DOSzJR-N.d.ts +64 -0
- package/dist/{useScrollableListBox-oYKqU3Hp.js → useScrollableListBox-C8chM7c-.js} +1 -1
- package/dist/{useStaticInputHandoff-BN0fOerH.js → useStaticInputHandoff-DrNFrvD7.js} +6 -1
- package/dist/{useTableColumnConfig-CXYgj5xi.js → useTableColumnConfig-B9cYBKo3.js} +956 -535
- package/dist/useTableNav-rP1wDkhV.d.ts +372 -0
- package/dist/useToast-D2C9pROU.d.ts +78 -0
- package/dist/useToast-DSoOiSw0.js +63 -0
- package/dist/utils/file.d.ts +1 -1
- package/dist/utils/file.js +1 -1
- package/dist/utils/logger.js +1 -1
- package/llms.txt +3116 -0
- package/package.json +13 -121
- package/MIGRATION.md +0 -655
- package/dist/Alert-D4X7OWiv.d.ts +0 -34
- package/dist/AlertDialog-DklLDjmw.d.ts +0 -26
- package/dist/Autocomplete-BgFz3kuR.d.ts +0 -23
- package/dist/Autocomplete-Bn13u0zu.js +0 -145
- package/dist/Autocomplete.bound-CpHZZ3C9.d.ts +0 -9
- package/dist/Autocomplete.bound-Dwh__y-Z.js +0 -28
- package/dist/Badge-Db1ndK67.d.ts +0 -30
- package/dist/BadgeButton-BPhWDAnc.d.ts +0 -15
- package/dist/BottomSheet-BZmDJBR-.d.ts +0 -33
- package/dist/ButtonBase-CZuEy3Pk.d.ts +0 -32
- package/dist/Checkbox-w2j5hLOQ.d.ts +0 -27
- package/dist/Checkbox.bound-D2nBglJz.js +0 -33
- package/dist/Checkbox.bound-DD_RCjVm.d.ts +0 -9
- package/dist/CheckboxCheckmark-DWsYVZuu.js +0 -25
- package/dist/CheckboxGroup-BYI15Y09.d.ts +0 -30
- package/dist/CheckboxGroup.bound-DY0HKGSh.js +0 -32
- package/dist/CheckboxGroup.bound-QiJ-P0KR.d.ts +0 -9
- package/dist/ComboBox-ChsdI0lt.js +0 -212
- package/dist/DatePicker-QzfQf21b.d.ts +0 -56
- package/dist/DatePicker.bound-DoCAqhM4.d.ts +0 -9
- package/dist/DatePicker.bound-M2cjR37s.js +0 -36
- package/dist/DateRangePicker-32D4pWJg.d.ts +0 -97
- package/dist/DateRangePicker.bound-CVtoVsho.d.ts +0 -9
- package/dist/DateRangePicker.bound-CkIDsAUf.js +0 -35
- package/dist/DateTimePicker-BTRIUagV.d.ts +0 -55
- package/dist/DateTimePicker.bound-X4DTyQ1b.d.ts +0 -9
- package/dist/DateTimePicker.bound-nSCVUqd0.js +0 -32
- package/dist/Dialog-CO9xljD3.d.ts +0 -21
- package/dist/Drawer-D1cHiBFO.d.ts +0 -18
- package/dist/DropdownMenu-D_9z9ond.d.ts +0 -25
- package/dist/FileInput-BEaECoBS.d.ts +0 -75
- package/dist/FileInput.bound-C12mOKpg.js +0 -30
- package/dist/FileInput.bound-D2HuuqSb.d.ts +0 -8
- package/dist/FileUpload-BUTSqHVk.d.ts +0 -11
- package/dist/FileUpload-D7FMYm-k.js +0 -749
- package/dist/FileUpload.bound-CGQXb4iT.d.ts +0 -16
- package/dist/FileUpload.bound-DmkuulOi.js +0 -30
- package/dist/FileUploadContainer-Dzg5aXXZ.d.ts +0 -5
- package/dist/FormField-DGyCDxOp.d.ts +0 -42
- package/dist/FormFieldHeaderTooltip-Dt-g40Tc.js +0 -17
- package/dist/IconButton-shH_9wcl.d.ts +0 -25
- package/dist/Input-CTp_9mS9.d.ts +0 -34
- package/dist/Input.bound-B9a62ylL.d.ts +0 -9
- package/dist/Input.bound-DYoXyRGy.js +0 -31
- package/dist/InputContent-BCNkN4Fx.d.ts +0 -27
- package/dist/Link-PvYB_M-j.d.ts +0 -30
- package/dist/MenuItem-U3-pu1j5.d.ts +0 -6
- package/dist/NumberField-WXebfxjK.d.ts +0 -34
- package/dist/NumberField.bound-ChJnNyJS.js +0 -32
- package/dist/NumberField.bound-Dy0A5iVc.d.ts +0 -9
- package/dist/NumberRangeInput-BCKQaGpy.d.ts +0 -50
- package/dist/NumberRangeInput.bound-BF6P_ega.js +0 -32
- package/dist/NumberRangeInput.bound-BNXxIQ0b.d.ts +0 -9
- package/dist/PasswordInput-EhQjYyJS.d.ts +0 -11
- package/dist/PasswordInput.bound-CK5GwKL4.d.ts +0 -9
- package/dist/Popover-D_t1XDPA.d.ts +0 -20
- package/dist/Progress-Ckfpi_-M.d.ts +0 -45
- package/dist/Progress-RiEGGxNG.js +0 -119
- package/dist/RadioGroup-6e-Z6jW8.d.ts +0 -26
- package/dist/RadioGroup.bound-BFWSq-on.js +0 -32
- package/dist/RadioGroup.bound-w3SZqSkH.d.ts +0 -9
- package/dist/RichTextEditor-DHhuBeT6.d.ts +0 -28
- package/dist/RichTextEditor-DfwVdm45.js +0 -651
- package/dist/Select-C34ENdjq.d.ts +0 -119
- package/dist/Select.bound--Az1Xwgm.js +0 -34
- package/dist/Select.bound-qOihchei.d.ts +0 -17
- package/dist/Slider-DRg8zKRM.d.ts +0 -23
- package/dist/Slider.bound-CByTXPTr.js +0 -31
- package/dist/Slider.bound-CaEF19um.d.ts +0 -9
- package/dist/Spinner-Cvy_6zgD.d.ts +0 -30
- package/dist/Spinner-DqjP06T1.js +0 -101
- package/dist/SplitButton-V1f2NWfh.d.ts +0 -15
- package/dist/Stepper-k91x_m-E.d.ts +0 -114
- package/dist/Switch-ELVPkPx0.d.ts +0 -24
- package/dist/Switch.bound-DeEdVvZV.d.ts +0 -9
- package/dist/Switch.bound-Dv0cHsMM.js +0 -33
- package/dist/TableDnd-CuHxANWh.js +0 -133
- package/dist/TableRowDetails-D8HFTghI.d.ts +0 -109
- package/dist/TabsFilters-DePddjCk.d.ts +0 -30
- package/dist/Tag-B2_ZiSE-.d.ts +0 -44
- package/dist/TextArea-iqUeB2QY.d.ts +0 -26
- package/dist/TextArea.bound-BJHyCogp.d.ts +0 -9
- package/dist/TextArea.bound-DeaskY6r.js +0 -28
- package/dist/TimePicker-BZ1ocsBX.d.ts +0 -45
- package/dist/TimePicker.bound-8DmjMXuE.d.ts +0 -9
- package/dist/TimePicker.bound-BFSXJvE_.js +0 -32
- package/dist/Toast-D9pdadZ4.d.ts +0 -16
- package/dist/ToggleGroup-CrDoeLN0.js +0 -333
- package/dist/ToggleGroup-DvjnSinl.d.ts +0 -42
- package/dist/ToggleGroup.bound-B03ISHQ8.d.ts +0 -9
- package/dist/ToggleGroup.bound-DCnYwmBt.js +0 -67
- package/dist/Tooltip-B8DTURLQ.d.ts +0 -16
- package/dist/TooltipEllipsis-Di9Dvd4x.d.ts +0 -11
- package/dist/badgeButton.cva-CBFIhr1S.d.ts +0 -41
- package/dist/button.cva-C8LGtNJ3.d.ts +0 -94
- package/dist/checkbox.cva-CCh_UlrC.d.ts +0 -76
- package/dist/components/badge-button.d.ts +0 -2
- package/dist/components/badge-button.js +0 -74
- package/dist/components/file-upload-container.d.ts +0 -3
- package/dist/components/file-upload-container.js +0 -15
- package/dist/confirmation.context-Bc2yEVp_.js +0 -114
- package/dist/confirmation.context-C_GDRn3a.d.ts +0 -23
- package/dist/fileUpload.types-C-ke21yY.d.ts +0 -110
- package/dist/form.binding-DOR5gIQf.js +0 -49
- package/dist/form.types-C8P4sznq.d.ts +0 -22
- package/dist/formFieldHelper.cva-DRmSyRZN.js +0 -14
- package/dist/iconSlot.cva-CLB5Tlsr.d.ts +0 -9
- package/dist/icons.d.ts +0 -4
- package/dist/icons.js +0 -3
- package/dist/input.cva-BjuHsDGy.d.ts +0 -80
- package/dist/inputLayout-KdAtunGk.js +0 -5
- package/dist/link.context-BCHn7NSy.d.ts +0 -12
- package/dist/radio.cva-D7M1hqLe.d.ts +0 -56
- package/dist/router.context-CtafjXV7.d.ts +0 -16
- package/dist/router.context-MckTbHw9.js +0 -63
- package/dist/routing.utils-DfxEt0_Y.js +0 -30
- package/dist/style-definitions-Dx6aFDiR.d.ts +0 -1038
- package/dist/switch.cva-r6vcS25Q.d.ts +0 -16
- package/dist/tanstack/autocomplete.d.ts +0 -3
- package/dist/tanstack/autocomplete.js +0 -2
- package/dist/tanstack/checkbox-group.d.ts +0 -3
- package/dist/tanstack/checkbox-group.js +0 -2
- package/dist/tanstack/checkbox.d.ts +0 -3
- package/dist/tanstack/checkbox.js +0 -2
- package/dist/tanstack/date-picker.d.ts +0 -3
- package/dist/tanstack/date-picker.js +0 -2
- package/dist/tanstack/date-range-picker.d.ts +0 -3
- package/dist/tanstack/date-range-picker.js +0 -2
- package/dist/tanstack/date-time-picker.d.ts +0 -3
- package/dist/tanstack/date-time-picker.js +0 -2
- package/dist/tanstack/file-input.d.ts +0 -3
- package/dist/tanstack/file-input.js +0 -2
- package/dist/tanstack/file-upload.d.ts +0 -4
- package/dist/tanstack/file-upload.js +0 -2
- package/dist/tanstack/input.d.ts +0 -3
- package/dist/tanstack/input.js +0 -2
- package/dist/tanstack/number-field.d.ts +0 -3
- package/dist/tanstack/number-field.js +0 -2
- package/dist/tanstack/number-range-input.d.ts +0 -3
- package/dist/tanstack/number-range-input.js +0 -2
- package/dist/tanstack/password-input.d.ts +0 -2
- package/dist/tanstack/password-input.js +0 -2
- package/dist/tanstack/radio-group.d.ts +0 -3
- package/dist/tanstack/radio-group.js +0 -2
- package/dist/tanstack/rich-text-editor.d.ts +0 -9
- package/dist/tanstack/rich-text-editor.js +0 -28
- package/dist/tanstack/select.d.ts +0 -3
- package/dist/tanstack/select.js +0 -2
- package/dist/tanstack/slider.d.ts +0 -3
- package/dist/tanstack/slider.js +0 -2
- package/dist/tanstack/switch.d.ts +0 -3
- package/dist/tanstack/switch.js +0 -2
- package/dist/tanstack/text-area.d.ts +0 -3
- package/dist/tanstack/text-area.js +0 -2
- package/dist/tanstack/time-picker.d.ts +0 -3
- package/dist/tanstack/time-picker.js +0 -2
- package/dist/tanstack/toggle-group.d.ts +0 -3
- package/dist/tanstack/toggle-group.js +0 -2
- package/dist/tanstack-Bgdv0qU1.js +0 -19
- package/dist/tanstack-wNbE6b-h.d.ts +0 -566
- package/dist/toast.cva-AmLw6Cf5.d.ts +0 -61
- package/dist/toast.runtime-Drd2IJ_j.js +0 -17
- package/dist/toastActivation.store-BELtcr76.js +0 -16
- package/dist/toggleGroup.cva-DA4U21gn.d.ts +0 -26
- package/dist/typography.cva-BCHlTHdM.d.ts +0 -36
- package/dist/useAsyncList-Cu-Y8If2.d.ts +0 -9
- package/dist/useFilters-BxRScJdn.d.ts +0 -11
- package/dist/useFilters-DMi94RZK.js +0 -190
- package/dist/useForm-Cb7KWLds.js +0 -217
- package/dist/useForm-I6z23FXf.d.ts +0 -51
- package/dist/useFormAutosave-BPGlChiY.js +0 -216
- package/dist/useTableNav-BusSFEVC.d.ts +0 -197
- package/dist/useToast-DsA8CVoY.d.ts +0 -16
package/dist/rich-text-editor.js
CHANGED
|
@@ -1,2 +1,734 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as clsx } from "./clsx-CnD0nOiA.js";
|
|
2
|
+
import { t as UIOverrides } from "./uiOverrides.context-DNEQlTx0.js";
|
|
3
|
+
import { t as IconSlot } from "./IconSlot-TAWTJ6iK.js";
|
|
4
|
+
import { a as $7230ffa83bc0c2cf$export$c245e6201fed2f75, n as $7230ffa83bc0c2cf$export$29f1550f4b0d4415, r as $7230ffa83bc0c2cf$export$4d86445c2cf5e3, s as $7230ffa83bc0c2cf$export$df3a06d6289f983e } from "./utils-BkLF-JA3.js";
|
|
5
|
+
import { l as $542a13ca2fa5b484$export$5b6b19405a83ff9d, n as $f2ff30fde7b014be$export$3ddf2d174ce01153, t as $f2ff30fde7b014be$export$2e1e1122cf0cba88 } from "./Dialog-BJ13KRQo.js";
|
|
6
|
+
import { n as $7705c033048f6da7$export$353f5b6fc5456de1 } from "./Button-BJJkLVNj.js";
|
|
7
|
+
import { t as Select } from "./Select-D3fuXwVt.js";
|
|
8
|
+
import { t as $aa5f63badbfee5df$exports } from "./intlStrings-Cu1YN1tA.js";
|
|
9
|
+
import { a as $928221da08ecbc62$export$a11e76429ed99b4, t as $928221da08ecbc62$export$41f133550aa26f48 } from "./ListBox-gR4iSV7N.js";
|
|
10
|
+
import { t as popoverAnimationClassName } from "./popoverAnimation-DEZSvKP8.js";
|
|
11
|
+
import { t as Typography } from "./Typography-DCLnPa3P.js";
|
|
12
|
+
import "./i18n-DQs7jPjv.js";
|
|
13
|
+
import { t as isEqual } from "./isEqual-LFw0W5rU.js";
|
|
14
|
+
import { t as UIConfig } from "./uiConfig.context-CjnLnQOo.js";
|
|
15
|
+
import { n as uiOutlineClass } from "./outline.clsx-DGGQQRkM.js";
|
|
16
|
+
import { t as Button } from "./Button-CzEs3tcV.js";
|
|
17
|
+
import { IconButton } from "./components/icon-button.js";
|
|
18
|
+
import { n as FieldController } from "./form.binding-Brdjq2yr.js";
|
|
19
|
+
import { r as $a8ea2faf2ebe4d2f$re_export$mergeRefs } from "./import-D_3dPATF.js";
|
|
20
|
+
import { t as useFieldAccessibility } from "./useFieldAccessibility-eZIMECmG.js";
|
|
21
|
+
import { n as FormFieldLabel, t as FormField } from "./FormField-TI8Vx5aC.js";
|
|
22
|
+
import { i as inputSideDefinition, o as useInputCva } from "./input.cva-mm1dnfKP.js";
|
|
23
|
+
import { n as resolveInputLayout } from "./inputLayout-CIVpuUBq.js";
|
|
24
|
+
import { t as popoverDefinition } from "./popover.cva-DAbfSma6.js";
|
|
25
|
+
import { t as Input } from "./Input-CeRJeAoR.js";
|
|
26
|
+
import { Popover } from "./components/popover.js";
|
|
27
|
+
import $ahdqC$react, { createContext, forwardRef, memo, useContext, useEffect, useId, useMemo, useState } from "react";
|
|
28
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
29
|
+
import { AlignCenter, AlignJustify, AlignLeft, AlignRight, Baseline, Bold, ChevronDown, Highlighter, Italic, Link, List, ListOrdered, Strikethrough, Underline } from "lucide-react";
|
|
30
|
+
import { mergeProps } from "react-aria/mergeProps";
|
|
31
|
+
import { filterDOMProps } from "react-aria/filterDOMProps";
|
|
32
|
+
import { useLocale } from "react-aria/I18nProvider";
|
|
33
|
+
import { useColorSwatch } from "react-aria/useColorSwatch";
|
|
34
|
+
import { parseColor } from "react-stately/Color";
|
|
35
|
+
import { useColorPickerState } from "react-stately/useColorPickerState";
|
|
36
|
+
import { useLocalizedStringFormatter } from "react-aria/useLocalizedStringFormatter";
|
|
37
|
+
import { useTranslation } from "react-i18next";
|
|
38
|
+
import { useFocusVisible, useFocusWithin, useHover } from "@react-aria/interactions";
|
|
39
|
+
import { Color } from "@tiptap/extension-color";
|
|
40
|
+
import { Highlight } from "@tiptap/extension-highlight";
|
|
41
|
+
import { Link as Link$1 } from "@tiptap/extension-link";
|
|
42
|
+
import { Placeholder } from "@tiptap/extension-placeholder";
|
|
43
|
+
import { TextAlign } from "@tiptap/extension-text-align";
|
|
44
|
+
import { TextStyle } from "@tiptap/extension-text-style";
|
|
45
|
+
import { Underline as Underline$1 } from "@tiptap/extension-underline";
|
|
46
|
+
import { EditorContent, useEditor } from "@tiptap/react";
|
|
47
|
+
import { StarterKit } from "@tiptap/starter-kit";
|
|
48
|
+
//#region ../../node_modules/.bun/react-aria-components@1.22.1+67f6792bdf102c28/node_modules/react-aria-components/dist/private/ColorSwatch.mjs
|
|
49
|
+
const $eeaff5a2d2421ecc$export$83cc445538396800 = /*#__PURE__*/ createContext(null);
|
|
50
|
+
const $eeaff5a2d2421ecc$export$cae13e90592f246a = /*#__PURE__*/ forwardRef(function ColorSwatch(props, ref) {
|
|
51
|
+
[props, ref] = $7230ffa83bc0c2cf$export$29f1550f4b0d4415(props, ref, $eeaff5a2d2421ecc$export$83cc445538396800);
|
|
52
|
+
let { colorSwatchProps, color } = useColorSwatch(props);
|
|
53
|
+
let renderProps = $7230ffa83bc0c2cf$export$4d86445c2cf5e3({
|
|
54
|
+
...props,
|
|
55
|
+
defaultClassName: "react-aria-ColorSwatch",
|
|
56
|
+
defaultStyle: colorSwatchProps.style,
|
|
57
|
+
values: { color }
|
|
58
|
+
});
|
|
59
|
+
let DOMProps = filterDOMProps(props, { global: true });
|
|
60
|
+
return /*#__PURE__*/ $ahdqC$react.createElement($7230ffa83bc0c2cf$export$df3a06d6289f983e.div, {
|
|
61
|
+
...mergeProps(DOMProps, colorSwatchProps, renderProps),
|
|
62
|
+
slot: props.slot || void 0,
|
|
63
|
+
ref
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region ../../node_modules/.bun/react-aria-components@1.22.1+67f6792bdf102c28/node_modules/react-aria-components/dist/private/ColorSwatchPicker.mjs
|
|
68
|
+
function $parcel$interopDefault(a) {
|
|
69
|
+
return a && a.__esModule ? a.default : a;
|
|
70
|
+
}
|
|
71
|
+
const $a36727cf8b43b57f$export$7214f50881fc1eaf = /*#__PURE__*/ createContext(null);
|
|
72
|
+
const $a36727cf8b43b57f$var$ColorMapContext = /*#__PURE__*/ createContext(null);
|
|
73
|
+
const $a36727cf8b43b57f$export$b46792416e3d8515 = /*#__PURE__*/ forwardRef(function ColorSwatchPicker(props, ref) {
|
|
74
|
+
[props, ref] = $7230ffa83bc0c2cf$export$29f1550f4b0d4415(props, ref, $a36727cf8b43b57f$export$7214f50881fc1eaf);
|
|
75
|
+
let state = useColorPickerState(props);
|
|
76
|
+
let colorMap = useMemo(() => /* @__PURE__ */ new Map(), []);
|
|
77
|
+
let formatter = useLocalizedStringFormatter($parcel$interopDefault($aa5f63badbfee5df$exports), "react-aria-components");
|
|
78
|
+
return /*#__PURE__*/ $ahdqC$react.createElement($928221da08ecbc62$export$41f133550aa26f48, {
|
|
79
|
+
...filterDOMProps(props, { labelable: true }),
|
|
80
|
+
ref,
|
|
81
|
+
className: props.className || "react-aria-ColorSwatchPicker",
|
|
82
|
+
style: props.style,
|
|
83
|
+
"aria-label": props["aria-label"] || (!props["aria-labelledby"] ? formatter.format("colorSwatchPicker") : void 0),
|
|
84
|
+
layout: props.layout || "grid",
|
|
85
|
+
selectionMode: "single",
|
|
86
|
+
selectedKeys: [state.color.toString("hexa")],
|
|
87
|
+
onSelectionChange: (keys) => {
|
|
88
|
+
if (keys !== "all") state.setColor(colorMap.get([...keys][0]));
|
|
89
|
+
},
|
|
90
|
+
disallowEmptySelection: true
|
|
91
|
+
}, /*#__PURE__*/ $ahdqC$react.createElement($a36727cf8b43b57f$var$ColorMapContext.Provider, { value: colorMap }, props.children));
|
|
92
|
+
});
|
|
93
|
+
const $a36727cf8b43b57f$export$abcd89c27081c2ef = /*#__PURE__*/ forwardRef(function ColorSwatchPickerItem(props, ref) {
|
|
94
|
+
let propColor = props.color || "#0000";
|
|
95
|
+
let color = useMemo(() => typeof propColor === "string" ? parseColor(propColor) : propColor, [propColor]);
|
|
96
|
+
let { locale } = useLocale();
|
|
97
|
+
let map = useContext($a36727cf8b43b57f$var$ColorMapContext);
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
let key = color.toString("hexa");
|
|
100
|
+
map.set(key, color);
|
|
101
|
+
return () => {
|
|
102
|
+
map.delete(key);
|
|
103
|
+
};
|
|
104
|
+
}, [color, map]);
|
|
105
|
+
let wrap = (v) => {
|
|
106
|
+
if (typeof v === "function") return (renderProps) => v({
|
|
107
|
+
...renderProps,
|
|
108
|
+
color
|
|
109
|
+
});
|
|
110
|
+
return v;
|
|
111
|
+
};
|
|
112
|
+
return /*#__PURE__*/ $ahdqC$react.createElement($928221da08ecbc62$export$a11e76429ed99b4, {
|
|
113
|
+
...props,
|
|
114
|
+
render: props.render,
|
|
115
|
+
ref,
|
|
116
|
+
id: color.toString("hexa"),
|
|
117
|
+
textValue: color.getColorName(locale),
|
|
118
|
+
className: wrap(props.className || "react-aria-ColorSwatchPickerItem"),
|
|
119
|
+
style: wrap(props.style)
|
|
120
|
+
}, $7230ffa83bc0c2cf$export$c245e6201fed2f75(wrap(props.children), (children) => /*#__PURE__*/ $ahdqC$react.createElement($eeaff5a2d2421ecc$export$83cc445538396800.Provider, { value: { color } }, children)));
|
|
121
|
+
});
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region src/components/inputs/RichTextEditor/Toolbar/HyperlinkAction.tsx
|
|
124
|
+
const HyperlinkAction = ({ editor }) => {
|
|
125
|
+
const { t } = useTranslation("ui");
|
|
126
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
127
|
+
const [url, setUrl] = useState("");
|
|
128
|
+
const isLinkEnabled = !!editor.extensionManager.extensions.find((extension) => extension.name === "link");
|
|
129
|
+
const linkHref = editor.getAttributes("link")?.href;
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
setUrl(linkHref || "");
|
|
132
|
+
}, [linkHref]);
|
|
133
|
+
if (!isLinkEnabled) return null;
|
|
134
|
+
const onRemove = () => {
|
|
135
|
+
editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
136
|
+
setIsOpen(false);
|
|
137
|
+
};
|
|
138
|
+
const onApply = () => {
|
|
139
|
+
editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
|
|
140
|
+
setIsOpen(false);
|
|
141
|
+
};
|
|
142
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
143
|
+
isOpen,
|
|
144
|
+
onOpenChange: setIsOpen,
|
|
145
|
+
label: t(($) => $.ui.textEditor.link.label),
|
|
146
|
+
trigger: /* @__PURE__ */ jsx(IconButton, {
|
|
147
|
+
color: "secondary",
|
|
148
|
+
label: t(($) => $.ui.textEditor.link.label),
|
|
149
|
+
icon: Link,
|
|
150
|
+
className: clsx(editor.isActive("link") && "bg-accent! text-accent-foreground!"),
|
|
151
|
+
isDisabled: !editor.isEditable,
|
|
152
|
+
variant: "text",
|
|
153
|
+
width: "hug",
|
|
154
|
+
disableTooltip: true,
|
|
155
|
+
size: "sm"
|
|
156
|
+
}),
|
|
157
|
+
children: [/* @__PURE__ */ jsx(Input, {
|
|
158
|
+
variant: "outlined",
|
|
159
|
+
hideLabel: true,
|
|
160
|
+
label: t(($) => $.ui.textEditor.link.urlLabel),
|
|
161
|
+
placeholder: t(($) => $.ui.textEditor.link.urlPlaceholder),
|
|
162
|
+
value: url,
|
|
163
|
+
onChange: setUrl,
|
|
164
|
+
className: "mb-4"
|
|
165
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
166
|
+
className: "flex justify-between",
|
|
167
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
168
|
+
variant: "contained",
|
|
169
|
+
color: "secondary",
|
|
170
|
+
size: "sm",
|
|
171
|
+
width: "hug",
|
|
172
|
+
onPress: onApply,
|
|
173
|
+
isDisabled: !url,
|
|
174
|
+
children: t(($) => $.ui.textEditor.link.apply)
|
|
175
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
176
|
+
variant: "outlined",
|
|
177
|
+
color: "secondary",
|
|
178
|
+
size: "sm",
|
|
179
|
+
width: "hug",
|
|
180
|
+
onPress: onRemove,
|
|
181
|
+
isDisabled: !editor.isActive("link"),
|
|
182
|
+
children: t(($) => $.ui.textEditor.link.remove)
|
|
183
|
+
})]
|
|
184
|
+
})]
|
|
185
|
+
});
|
|
186
|
+
};
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region src/components/inputs/RichTextEditor/Toolbar/TextAlignSelect.tsx
|
|
189
|
+
const TextAlignSelect = ({ editor }) => {
|
|
190
|
+
const { t } = useTranslation("ui");
|
|
191
|
+
if (!!!editor.extensionManager.extensions.find((extension) => extension.name === "textAlign")) return null;
|
|
192
|
+
const onChange = (val) => {
|
|
193
|
+
if (val) editor.chain().focus().setTextAlign(val).run();
|
|
194
|
+
else editor.chain().focus().unsetTextAlign().run();
|
|
195
|
+
};
|
|
196
|
+
const getItem = (id, Icon) => {
|
|
197
|
+
return {
|
|
198
|
+
id,
|
|
199
|
+
label: t(($) => $.ui.textEditor.textAlign[id]),
|
|
200
|
+
content: /* @__PURE__ */ jsx(IconSlot, { icon: Icon }),
|
|
201
|
+
isActive: editor.isActive({ textAlign: id }),
|
|
202
|
+
can: editor.can().setTextAlign(id)
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
const enabledItems = [
|
|
206
|
+
getItem("left", AlignLeft),
|
|
207
|
+
getItem("center", AlignCenter),
|
|
208
|
+
getItem("right", AlignRight),
|
|
209
|
+
getItem("justify", AlignJustify)
|
|
210
|
+
].filter((item) => item.can);
|
|
211
|
+
return /* @__PURE__ */ jsx(Select, {
|
|
212
|
+
layout: "inline",
|
|
213
|
+
label: t(($) => $.ui.textEditor.textAlign.label),
|
|
214
|
+
placeholder: t(($) => $.ui.textEditor.textAlign.label),
|
|
215
|
+
hideLabel: true,
|
|
216
|
+
ignoreTriggerWidth: true,
|
|
217
|
+
showSelectionContent: true,
|
|
218
|
+
onChange,
|
|
219
|
+
items: enabledItems,
|
|
220
|
+
value: enabledItems.find((item) => item.isActive)?.id || "left",
|
|
221
|
+
isDisabled: !editor.isEditable
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region src/components/inputs/RichTextEditor/Toolbar/ColorPicker.tsx
|
|
226
|
+
const ColorPicker = ({ label, colors, value, onChange }) => {
|
|
227
|
+
return /* @__PURE__ */ jsx($a36727cf8b43b57f$export$b46792416e3d8515, {
|
|
228
|
+
"aria-label": label,
|
|
229
|
+
value,
|
|
230
|
+
onChange: (color) => onChange(color.toString("hex")),
|
|
231
|
+
className: "grid w-full grid-cols-[repeat(auto-fit,minmax(1rem,1fr))] gap-1",
|
|
232
|
+
children: colors.map((color) => /* @__PURE__ */ jsx($a36727cf8b43b57f$export$abcd89c27081c2ef, {
|
|
233
|
+
color,
|
|
234
|
+
className: "group",
|
|
235
|
+
children: /* @__PURE__ */ jsx($eeaff5a2d2421ecc$export$cae13e90592f246a, { className: clsx("size-4 rounded-sm border border-border border-solid shadow-xs", "group-selected:border-ring group-selected:ring-[3px] group-selected:ring-ring/50", "cursor-pointer") })
|
|
236
|
+
}, color))
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region src/components/inputs/RichTextEditor/Toolbar/ColorPickerDropdown.tsx
|
|
241
|
+
const ColorPickerDropdown = ({ label, colors, value, onChange, isDisabled, children }) => {
|
|
242
|
+
const inputCva = useInputCva();
|
|
243
|
+
const popoverCva = UIOverrides.useCva("popover.cva", popoverDefinition);
|
|
244
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
245
|
+
const handleChange = (color) => {
|
|
246
|
+
onChange(color);
|
|
247
|
+
setIsOpen(false);
|
|
248
|
+
};
|
|
249
|
+
return /* @__PURE__ */ jsxs($f2ff30fde7b014be$export$2e1e1122cf0cba88, {
|
|
250
|
+
isOpen,
|
|
251
|
+
onOpenChange: setIsOpen,
|
|
252
|
+
children: [/* @__PURE__ */ jsxs($7705c033048f6da7$export$353f5b6fc5456de1, {
|
|
253
|
+
"aria-label": label,
|
|
254
|
+
className: inputCva({
|
|
255
|
+
as: "inline",
|
|
256
|
+
className: clsx("flex items-center justify-between gap-2")
|
|
257
|
+
}),
|
|
258
|
+
isDisabled,
|
|
259
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
260
|
+
size: "large",
|
|
261
|
+
className: "truncate",
|
|
262
|
+
children
|
|
263
|
+
}), /* @__PURE__ */ jsx(IconSlot, {
|
|
264
|
+
icon: ChevronDown,
|
|
265
|
+
className: clsx(isOpen && "rotate-180"),
|
|
266
|
+
"aria-hidden": "true"
|
|
267
|
+
})]
|
|
268
|
+
}), /* @__PURE__ */ jsx($542a13ca2fa5b484$export$5b6b19405a83ff9d, {
|
|
269
|
+
className: clsx("my-1 w-40 outline-none", popoverAnimationClassName),
|
|
270
|
+
offset: 0,
|
|
271
|
+
placement: "bottom start",
|
|
272
|
+
children: /* @__PURE__ */ jsx($f2ff30fde7b014be$export$3ddf2d174ce01153, {
|
|
273
|
+
"aria-label": label,
|
|
274
|
+
className: "outline-none",
|
|
275
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
276
|
+
className: clsx(popoverCva({}), "flex justify-center overflow-hidden p-2"),
|
|
277
|
+
children: /* @__PURE__ */ jsx(ColorPicker, {
|
|
278
|
+
label,
|
|
279
|
+
colors,
|
|
280
|
+
value,
|
|
281
|
+
onChange: handleChange
|
|
282
|
+
})
|
|
283
|
+
})
|
|
284
|
+
})
|
|
285
|
+
})]
|
|
286
|
+
});
|
|
287
|
+
};
|
|
288
|
+
//#endregion
|
|
289
|
+
//#region src/components/inputs/RichTextEditor/richTextEditor.types.ts
|
|
290
|
+
const defaultColors = [
|
|
291
|
+
"#000000",
|
|
292
|
+
"#e60000",
|
|
293
|
+
"#ff9900",
|
|
294
|
+
"#ffff00",
|
|
295
|
+
"#008a00",
|
|
296
|
+
"#0066cc",
|
|
297
|
+
"#9933ff",
|
|
298
|
+
"#ffffff",
|
|
299
|
+
"#facccc",
|
|
300
|
+
"#ffebcc",
|
|
301
|
+
"#ffffcc",
|
|
302
|
+
"#cce8cc",
|
|
303
|
+
"#cce0f5",
|
|
304
|
+
"#ebd6ff",
|
|
305
|
+
"#bbbbbb",
|
|
306
|
+
"#f06666",
|
|
307
|
+
"#ffc266",
|
|
308
|
+
"#ffff66",
|
|
309
|
+
"#66b966",
|
|
310
|
+
"#66a3e0",
|
|
311
|
+
"#c285ff",
|
|
312
|
+
"#888888",
|
|
313
|
+
"#a10000",
|
|
314
|
+
"#b26b00",
|
|
315
|
+
"#b2b200",
|
|
316
|
+
"#006100",
|
|
317
|
+
"#0047b2",
|
|
318
|
+
"#6b24b2",
|
|
319
|
+
"#444444",
|
|
320
|
+
"#5c0000",
|
|
321
|
+
"#663d00",
|
|
322
|
+
"#666600",
|
|
323
|
+
"#003700",
|
|
324
|
+
"#002966",
|
|
325
|
+
"#3d1466"
|
|
326
|
+
];
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region src/components/inputs/RichTextEditor/Toolbar/TextColorSelect.tsx
|
|
329
|
+
const TextColorSelect = ({ editor }) => {
|
|
330
|
+
const { t } = useTranslation("ui");
|
|
331
|
+
if (!editor.extensionManager.extensions.some((extension) => extension.name === "color")) return null;
|
|
332
|
+
const onChange = (color) => {
|
|
333
|
+
editor.chain().focus().setColor(color).run();
|
|
334
|
+
};
|
|
335
|
+
const textColor = editor.getAttributes("textStyle").color || "#000000";
|
|
336
|
+
return /* @__PURE__ */ jsx(ColorPickerDropdown, {
|
|
337
|
+
label: t(($) => $.ui.textEditor.textColor),
|
|
338
|
+
value: textColor,
|
|
339
|
+
onChange,
|
|
340
|
+
colors: defaultColors,
|
|
341
|
+
isDisabled: !editor.isEditable,
|
|
342
|
+
children: /* @__PURE__ */ jsx(IconSlot, { icon: /* @__PURE__ */ jsx(Baseline, { style: { color: textColor } }) })
|
|
343
|
+
});
|
|
344
|
+
};
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region src/components/inputs/RichTextEditor/Toolbar/TextHighlightSelect.tsx
|
|
347
|
+
const TextHighlightSelect = ({ editor }) => {
|
|
348
|
+
const { t } = useTranslation("ui");
|
|
349
|
+
if (!editor.extensionManager.extensions.some((extension) => extension.name === "highlight")) return null;
|
|
350
|
+
const onChange = (color) => {
|
|
351
|
+
if (color === "#FFFFFF") editor.chain().focus().unsetHighlight().run();
|
|
352
|
+
else editor.chain().focus().setHighlight({ color }).run();
|
|
353
|
+
};
|
|
354
|
+
const highlightColor = editor.getAttributes("highlight").color || "#FFFFFF";
|
|
355
|
+
return /* @__PURE__ */ jsx(ColorPickerDropdown, {
|
|
356
|
+
label: t(($) => $.ui.textEditor.highlight),
|
|
357
|
+
value: highlightColor,
|
|
358
|
+
onChange,
|
|
359
|
+
colors: defaultColors,
|
|
360
|
+
isDisabled: !editor.isEditable,
|
|
361
|
+
children: highlightColor ? /* @__PURE__ */ jsx(IconSlot, { icon: /* @__PURE__ */ jsx(Highlighter, { style: { color: highlightColor } }) }) : /* @__PURE__ */ jsx(IconSlot, { icon: Highlighter })
|
|
362
|
+
});
|
|
363
|
+
};
|
|
364
|
+
//#endregion
|
|
365
|
+
//#region src/components/inputs/RichTextEditor/Toolbar/TextListActions.tsx
|
|
366
|
+
const TextListActions = ({ editor }) => {
|
|
367
|
+
const { t } = useTranslation("ui");
|
|
368
|
+
const enabledActions = [{
|
|
369
|
+
can: !!editor.extensionManager.extensions.find((extension) => extension.name === "bulletList"),
|
|
370
|
+
isEnabled: () => editor.isEditable && editor.can().toggleBulletList(),
|
|
371
|
+
label: t(($) => $.ui.textEditor.lists.bullet),
|
|
372
|
+
icon: List,
|
|
373
|
+
onPress: () => {
|
|
374
|
+
editor.chain().focus().toggleBulletList().run();
|
|
375
|
+
},
|
|
376
|
+
isActive: () => editor.isActive("bulletList")
|
|
377
|
+
}, {
|
|
378
|
+
can: !!editor.extensionManager.extensions.find((extension) => extension.name === "orderedList"),
|
|
379
|
+
isEnabled: () => editor.isEditable && editor.can().toggleOrderedList(),
|
|
380
|
+
label: t(($) => $.ui.textEditor.lists.ordered),
|
|
381
|
+
icon: ListOrdered,
|
|
382
|
+
onPress: () => {
|
|
383
|
+
editor.chain().focus().toggleOrderedList().run();
|
|
384
|
+
},
|
|
385
|
+
isActive: () => editor.isActive("orderedList")
|
|
386
|
+
}].filter((action) => action.can);
|
|
387
|
+
if (enabledActions.length === 0) return null;
|
|
388
|
+
return /* @__PURE__ */ jsx("div", {
|
|
389
|
+
className: "flex h-full items-center gap-3",
|
|
390
|
+
children: enabledActions.map((action) => /* @__PURE__ */ jsx(IconButton, {
|
|
391
|
+
color: "secondary",
|
|
392
|
+
label: action.label,
|
|
393
|
+
onPress: action.onPress,
|
|
394
|
+
icon: action.icon,
|
|
395
|
+
isDisabled: !action.isEnabled(),
|
|
396
|
+
className: clsx(action.isActive() && "bg-accent! text-accent-foreground!"),
|
|
397
|
+
variant: "text",
|
|
398
|
+
width: "hug",
|
|
399
|
+
disableTooltip: true,
|
|
400
|
+
size: "sm"
|
|
401
|
+
}, action.label))
|
|
402
|
+
});
|
|
403
|
+
};
|
|
404
|
+
//#endregion
|
|
405
|
+
//#region src/components/inputs/RichTextEditor/Toolbar/TextMarksActions.tsx
|
|
406
|
+
const TextMarksActions = ({ editor }) => {
|
|
407
|
+
const { t } = useTranslation("ui");
|
|
408
|
+
const enabledActions = [
|
|
409
|
+
{
|
|
410
|
+
can: !!editor.extensionManager.extensions.find((extension) => extension.name === "bold"),
|
|
411
|
+
isEnabled: () => editor.isEditable && editor.can().toggleBold(),
|
|
412
|
+
label: t(($) => $.ui.textEditor.marks.bold),
|
|
413
|
+
icon: Bold,
|
|
414
|
+
onPress: () => {
|
|
415
|
+
editor.chain().focus().toggleBold().run();
|
|
416
|
+
},
|
|
417
|
+
isActive: () => editor.isActive("bold")
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
can: !!editor.extensionManager.extensions.find((extension) => extension.name === "italic"),
|
|
421
|
+
isEnabled: () => editor.isEditable && editor.can().toggleItalic(),
|
|
422
|
+
label: t(($) => $.ui.textEditor.marks.italic),
|
|
423
|
+
icon: Italic,
|
|
424
|
+
onPress: () => {
|
|
425
|
+
editor.chain().focus().toggleItalic().run();
|
|
426
|
+
},
|
|
427
|
+
isActive: () => editor.isActive("italic")
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
can: !!editor.extensionManager.extensions.find((extension) => extension.name === "strike"),
|
|
431
|
+
isEnabled: () => editor.isEditable && editor.can().toggleStrike(),
|
|
432
|
+
label: t(($) => $.ui.textEditor.marks.strikethrough),
|
|
433
|
+
icon: Strikethrough,
|
|
434
|
+
onPress: () => {
|
|
435
|
+
editor.chain().focus().toggleStrike().run();
|
|
436
|
+
},
|
|
437
|
+
isActive: () => editor.isActive("strike")
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
can: !!editor.extensionManager.extensions.find((extension) => extension.name === "underline"),
|
|
441
|
+
isEnabled: () => editor.isEditable && editor.can().toggleUnderline(),
|
|
442
|
+
label: t(($) => $.ui.textEditor.marks.underline),
|
|
443
|
+
icon: Underline,
|
|
444
|
+
onPress: () => {
|
|
445
|
+
editor.chain().focus().toggleUnderline().run();
|
|
446
|
+
},
|
|
447
|
+
isActive: () => editor.isActive("underline")
|
|
448
|
+
}
|
|
449
|
+
].filter((action) => action.can);
|
|
450
|
+
if (enabledActions.length === 0) return null;
|
|
451
|
+
return /* @__PURE__ */ jsx("div", {
|
|
452
|
+
className: "flex h-full items-center gap-3",
|
|
453
|
+
children: enabledActions.map((action) => /* @__PURE__ */ jsx(IconButton, {
|
|
454
|
+
color: "secondary",
|
|
455
|
+
label: action.label,
|
|
456
|
+
onPress: action.onPress,
|
|
457
|
+
icon: action.icon,
|
|
458
|
+
isDisabled: !action.isEnabled(),
|
|
459
|
+
className: clsx(action.isActive() && "bg-accent! text-accent-foreground!"),
|
|
460
|
+
variant: "text",
|
|
461
|
+
width: "hug",
|
|
462
|
+
disableTooltip: true,
|
|
463
|
+
size: "sm"
|
|
464
|
+
}, action.label))
|
|
465
|
+
});
|
|
466
|
+
};
|
|
467
|
+
//#endregion
|
|
468
|
+
//#region src/components/inputs/RichTextEditor/Toolbar/TextStyleSelect.tsx
|
|
469
|
+
const TextStyleSelect = ({ editor }) => {
|
|
470
|
+
const { t } = useTranslation("ui");
|
|
471
|
+
if (!!!editor.extensionManager.extensions.find((extension) => extension.name === "heading")) return null;
|
|
472
|
+
const getItem = (level) => {
|
|
473
|
+
return {
|
|
474
|
+
id: level,
|
|
475
|
+
label: t(($) => $.ui.textEditor.textStyle[`heading${level}`]),
|
|
476
|
+
content: /* @__PURE__ */ jsx(Typography, {
|
|
477
|
+
size: {
|
|
478
|
+
1: "h1",
|
|
479
|
+
2: "h2",
|
|
480
|
+
3: "h3",
|
|
481
|
+
4: "h4",
|
|
482
|
+
5: "lead",
|
|
483
|
+
6: "large"
|
|
484
|
+
}[level],
|
|
485
|
+
children: t(($) => $.ui.textEditor.textStyle[`heading${level}`])
|
|
486
|
+
})
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
const onChange = (val) => {
|
|
490
|
+
if (!val) {
|
|
491
|
+
const currentLevel = editor.getAttributes("heading")?.level;
|
|
492
|
+
if (!currentLevel) return;
|
|
493
|
+
editor.chain().focus().toggleHeading({ level: currentLevel }).run();
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
if (!editor.can().setHeading({ level: val })) return;
|
|
497
|
+
editor.chain().focus().setHeading({ level: val }).run();
|
|
498
|
+
};
|
|
499
|
+
return /* @__PURE__ */ jsx(Select, {
|
|
500
|
+
layout: "inline",
|
|
501
|
+
placeholder: t(($) => $.ui.textEditor.textStyle.label),
|
|
502
|
+
label: t(($) => $.ui.textEditor.textStyle.label),
|
|
503
|
+
hideLabel: true,
|
|
504
|
+
ignoreTriggerWidth: true,
|
|
505
|
+
onChange,
|
|
506
|
+
items: [
|
|
507
|
+
{
|
|
508
|
+
id: 0,
|
|
509
|
+
label: t(($) => $.ui.textEditor.textStyle.normal)
|
|
510
|
+
},
|
|
511
|
+
...editor.can().toggleHeading({ level: 1 }) ? [getItem(1)] : [],
|
|
512
|
+
...editor.can().toggleHeading({ level: 2 }) ? [getItem(2)] : [],
|
|
513
|
+
...editor.can().toggleHeading({ level: 3 }) ? [getItem(3)] : [],
|
|
514
|
+
...editor.can().toggleHeading({ level: 4 }) ? [getItem(4)] : [],
|
|
515
|
+
...editor.can().toggleHeading({ level: 5 }) ? [getItem(5)] : [],
|
|
516
|
+
...editor.can().toggleHeading({ level: 6 }) ? [getItem(6)] : []
|
|
517
|
+
],
|
|
518
|
+
value: editor.getAttributes("heading")?.level || 0,
|
|
519
|
+
isDisabled: !editor.isEditable
|
|
520
|
+
});
|
|
521
|
+
};
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region src/components/inputs/RichTextEditor/Toolbar/RichTextEditorToolbar.tsx
|
|
524
|
+
const RichTextEditorToolbar = ({ editor }) => {
|
|
525
|
+
if (!editor) return null;
|
|
526
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
527
|
+
className: "flex w-full flex-wrap items-center gap-x-7 gap-y-1 border-b border-solid p-2",
|
|
528
|
+
children: [
|
|
529
|
+
/* @__PURE__ */ jsxs("div", {
|
|
530
|
+
className: "flex flex-wrap gap-1",
|
|
531
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
532
|
+
className: "flex items-center gap-1",
|
|
533
|
+
children: [/* @__PURE__ */ jsx(TextStyleSelect, { editor }), /* @__PURE__ */ jsx(TextAlignSelect, { editor })]
|
|
534
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
535
|
+
className: "flex items-center gap-1",
|
|
536
|
+
children: [/* @__PURE__ */ jsx(TextColorSelect, { editor }), /* @__PURE__ */ jsx(TextHighlightSelect, { editor })]
|
|
537
|
+
})]
|
|
538
|
+
}),
|
|
539
|
+
/* @__PURE__ */ jsx(TextMarksActions, { editor }),
|
|
540
|
+
/* @__PURE__ */ jsx(TextListActions, { editor }),
|
|
541
|
+
/* @__PURE__ */ jsx(HyperlinkAction, { editor })
|
|
542
|
+
]
|
|
543
|
+
});
|
|
544
|
+
};
|
|
545
|
+
//#endregion
|
|
546
|
+
//#region src/components/inputs/RichTextEditor/RichTextEditor.tsx
|
|
547
|
+
const extensions = [
|
|
548
|
+
StarterKit.configure({
|
|
549
|
+
heading: { levels: [
|
|
550
|
+
1,
|
|
551
|
+
2,
|
|
552
|
+
3
|
|
553
|
+
] },
|
|
554
|
+
link: false,
|
|
555
|
+
underline: false
|
|
556
|
+
}),
|
|
557
|
+
TextAlign.configure({ types: ["heading", "paragraph"] }),
|
|
558
|
+
Underline$1,
|
|
559
|
+
TextStyle,
|
|
560
|
+
Color,
|
|
561
|
+
Highlight.configure({ multicolor: true }),
|
|
562
|
+
Link$1.configure({
|
|
563
|
+
openOnClick: false,
|
|
564
|
+
defaultProtocol: "https"
|
|
565
|
+
})
|
|
566
|
+
];
|
|
567
|
+
const TextEditorBase = ({ ref, layout: layoutProp, placeholder, label, hideLabel: hideLabelProp, tooltipText, helperText, isRequired, rightContent, isDisabled, headerClassName, errorClassName, error, value, className, editorClassName, isDirty, onChange, onBlur }) => {
|
|
568
|
+
const ui = UIConfig.useConfig();
|
|
569
|
+
const as = resolveInputLayout(layoutProp, ui.input.layout);
|
|
570
|
+
const hideLabel = hideLabelProp ?? ui.input.hideLabel;
|
|
571
|
+
const { hoverProps, isHovered } = useHover({ isDisabled });
|
|
572
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
573
|
+
const { focusWithinProps } = useFocusWithin({ onFocusWithinChange: setIsFocused });
|
|
574
|
+
const { isFocusVisible } = useFocusVisible();
|
|
575
|
+
const inputSideCva = UIOverrides.useCva("input.sideCva", inputSideDefinition);
|
|
576
|
+
const { describedBy, errorMessageId, helperTextId } = useFieldAccessibility({
|
|
577
|
+
error,
|
|
578
|
+
helperText
|
|
579
|
+
});
|
|
580
|
+
const formFieldProps = {
|
|
581
|
+
errorMessageId,
|
|
582
|
+
helperTextId,
|
|
583
|
+
error,
|
|
584
|
+
label,
|
|
585
|
+
tooltipText,
|
|
586
|
+
helperText,
|
|
587
|
+
isRequired,
|
|
588
|
+
rightContent,
|
|
589
|
+
hideLabel: hideLabel || as === "filter" || as === "floating",
|
|
590
|
+
isDisabled,
|
|
591
|
+
headerClassName,
|
|
592
|
+
errorClassName
|
|
593
|
+
};
|
|
594
|
+
const editorId = useId();
|
|
595
|
+
const labelId = useId();
|
|
596
|
+
const hasLabelElement = as !== "filter";
|
|
597
|
+
const editorAttributes = useMemo(() => {
|
|
598
|
+
const attributes = {
|
|
599
|
+
class: clsx("min-h-40 rounded-b-sm p-2 outline-none", editorClassName),
|
|
600
|
+
id: editorId,
|
|
601
|
+
role: "textbox",
|
|
602
|
+
"aria-multiline": "true"
|
|
603
|
+
};
|
|
604
|
+
if (hasLabelElement) attributes["aria-labelledby"] = labelId;
|
|
605
|
+
else attributes["aria-label"] = label;
|
|
606
|
+
if (describedBy) attributes["aria-describedby"] = describedBy;
|
|
607
|
+
if (isRequired) attributes["aria-required"] = "true";
|
|
608
|
+
if (error) attributes["aria-invalid"] = "true";
|
|
609
|
+
if (errorMessageId) attributes["aria-errormessage"] = errorMessageId;
|
|
610
|
+
if (isDisabled) attributes["aria-disabled"] = "true";
|
|
611
|
+
return attributes;
|
|
612
|
+
}, [
|
|
613
|
+
editorClassName,
|
|
614
|
+
editorId,
|
|
615
|
+
hasLabelElement,
|
|
616
|
+
labelId,
|
|
617
|
+
label,
|
|
618
|
+
describedBy,
|
|
619
|
+
isRequired,
|
|
620
|
+
error,
|
|
621
|
+
errorMessageId,
|
|
622
|
+
isDisabled
|
|
623
|
+
]);
|
|
624
|
+
const editor = useEditor({
|
|
625
|
+
extensions: [...extensions, Placeholder.configure({ placeholder: as === "floating" ? "" : placeholder })],
|
|
626
|
+
editorProps: { attributes: editorAttributes },
|
|
627
|
+
onUpdate: (event) => {
|
|
628
|
+
onChange?.({
|
|
629
|
+
json: event.editor.getJSON(),
|
|
630
|
+
html: event.editor.getHTML()
|
|
631
|
+
});
|
|
632
|
+
},
|
|
633
|
+
immediatelyRender: false,
|
|
634
|
+
editable: !isDisabled,
|
|
635
|
+
onBlur
|
|
636
|
+
}, [isDisabled]);
|
|
637
|
+
useEffect(() => {
|
|
638
|
+
if (editor && !editor.isDestroyed) editor.setOptions({ editorProps: { attributes: editorAttributes } });
|
|
639
|
+
}, [editor, editorAttributes]);
|
|
640
|
+
useEffect(() => {
|
|
641
|
+
if (!editor || editor.isDestroyed) return;
|
|
642
|
+
const content = value?.json ?? null;
|
|
643
|
+
if (!isEqual(content, editor.getJSON())) editor.commands.setContent(content, { emitUpdate: false });
|
|
644
|
+
}, [editor, value]);
|
|
645
|
+
const labelProps = {
|
|
646
|
+
id: labelId,
|
|
647
|
+
onClick: () => {
|
|
648
|
+
if (!isDisabled) editor?.commands.focus();
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
const headerProps = {
|
|
652
|
+
label,
|
|
653
|
+
tooltipText,
|
|
654
|
+
helperText,
|
|
655
|
+
isRequired,
|
|
656
|
+
rightContent,
|
|
657
|
+
isHeaderHidden: hideLabel,
|
|
658
|
+
isDisabled,
|
|
659
|
+
className: headerClassName,
|
|
660
|
+
labelProps
|
|
661
|
+
};
|
|
662
|
+
return /* @__PURE__ */ jsx(FormField, {
|
|
663
|
+
...formFieldProps,
|
|
664
|
+
ref,
|
|
665
|
+
layout: as,
|
|
666
|
+
labelProps,
|
|
667
|
+
className: clsx("group w-full", className),
|
|
668
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
669
|
+
className: clsx("group/text-editor relative", "h-full w-full rounded-md border border-input border-solid bg-transparent text-foreground shadow-xs transition-[color,box-shadow] dark:bg-input/30", uiOutlineClass, "focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50", "invalid:border-destructive invalid:ring-destructive/20 dark:invalid:ring-destructive/40", "disabled:cursor-not-allowed disabled:opacity-50"),
|
|
670
|
+
"data-text-editor": true,
|
|
671
|
+
"data-rac": "",
|
|
672
|
+
"data-hovered": isHovered || void 0,
|
|
673
|
+
"data-invalid": !!error || void 0,
|
|
674
|
+
"data-disabled": isDisabled || void 0,
|
|
675
|
+
"data-is-disabled": isDisabled || void 0,
|
|
676
|
+
"data-focus-within": isFocused || void 0,
|
|
677
|
+
"data-focus-visible": isFocused && isFocusVisible || void 0,
|
|
678
|
+
"data-is-filled": !editor?.isEmpty,
|
|
679
|
+
"data-is-required": isRequired || void 0,
|
|
680
|
+
"data-is-dirty": isDirty || void 0,
|
|
681
|
+
...hoverProps,
|
|
682
|
+
...focusWithinProps,
|
|
683
|
+
children: [/* @__PURE__ */ jsx(RichTextEditorToolbar, { editor }), /* @__PURE__ */ jsxs("div", {
|
|
684
|
+
className: clsx("relative overflow-auto", as === "floating" && "pt-3"),
|
|
685
|
+
children: [as === "floating" && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
686
|
+
as,
|
|
687
|
+
...headerProps,
|
|
688
|
+
className: clsx(headerProps.className, inputSideCva({
|
|
689
|
+
size: "default",
|
|
690
|
+
type: "left"
|
|
691
|
+
}))
|
|
692
|
+
}), /* @__PURE__ */ jsx(EditorContent, {
|
|
693
|
+
editor,
|
|
694
|
+
placeholder: as === "floating" ? "" : placeholder,
|
|
695
|
+
className: clsx(as === "floating" && editor?.isEmpty && "[&_p:before]:opacity-0")
|
|
696
|
+
})]
|
|
697
|
+
})]
|
|
698
|
+
})
|
|
699
|
+
});
|
|
700
|
+
};
|
|
701
|
+
const StandaloneRichTextEditor = ({ defaultValue, value, onChange, ...props }) => {
|
|
702
|
+
const [internalValue, setInternalValue] = useState(defaultValue ?? null);
|
|
703
|
+
return /* @__PURE__ */ jsx(TextEditorBase, {
|
|
704
|
+
...props,
|
|
705
|
+
value: value === void 0 ? internalValue : value,
|
|
706
|
+
onChange: (nextValue) => {
|
|
707
|
+
if (value === void 0) setInternalValue(nextValue);
|
|
708
|
+
onChange?.(nextValue);
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
};
|
|
712
|
+
const ControlledRichTextEditor = (props) => {
|
|
713
|
+
const { field, ref, ...innerProps } = props;
|
|
714
|
+
return /* @__PURE__ */ jsx(FieldController, {
|
|
715
|
+
control: field.form,
|
|
716
|
+
name: field.name,
|
|
717
|
+
onValueChange: field.onValueChange,
|
|
718
|
+
onBlur: field.onBlur,
|
|
719
|
+
render: ({ field, fieldState: { error, isDirty } }) => /* @__PURE__ */ jsx(TextEditorBase, {
|
|
720
|
+
...innerProps,
|
|
721
|
+
ref: $a8ea2faf2ebe4d2f$re_export$mergeRefs(ref, field.ref),
|
|
722
|
+
value: field.value,
|
|
723
|
+
onChange: field.onChange,
|
|
724
|
+
onBlur: field.onBlur,
|
|
725
|
+
isDirty,
|
|
726
|
+
isDisabled: field.disabled || props.isDisabled,
|
|
727
|
+
error: props.error ?? error?.message
|
|
728
|
+
})
|
|
729
|
+
});
|
|
730
|
+
};
|
|
731
|
+
const RichTextEditorComponent = (props) => props.field ? /* @__PURE__ */ jsx(ControlledRichTextEditor, { ...props }) : /* @__PURE__ */ jsx(StandaloneRichTextEditor, { ...props });
|
|
732
|
+
const RichTextEditor = memo(RichTextEditorComponent);
|
|
733
|
+
//#endregion
|
|
2
734
|
export { RichTextEditor };
|