@povio/ui 3.1.0 → 3.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/dist/assets/icons/AlignCenter.js +26 -11
- package/dist/assets/icons/AlignLeft.js +26 -11
- package/dist/assets/icons/AlignLeftRight.js +26 -11
- package/dist/assets/icons/AlignRight.js +26 -11
- package/dist/assets/icons/ArrowDropDown.js +26 -11
- package/dist/assets/icons/ArrowDropUp.js +26 -11
- package/dist/assets/icons/ArrowLeft.js +26 -11
- package/dist/assets/icons/ArrowRight.js +26 -11
- package/dist/assets/icons/Bold.js +26 -11
- package/dist/assets/icons/BulletedList.js +26 -11
- package/dist/assets/icons/Calendar.js +28 -13
- package/dist/assets/icons/Check.js +28 -13
- package/dist/assets/icons/CheckCircle.js +26 -11
- package/dist/assets/icons/CheckboxCheckmark.js +29 -14
- package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
- package/dist/assets/icons/ChevronDown.js +28 -13
- package/dist/assets/icons/ChevronLeft.js +28 -13
- package/dist/assets/icons/ChevronRight.js +28 -13
- package/dist/assets/icons/ChevronUp.js +28 -13
- package/dist/assets/icons/ChevronsLeft.js +28 -13
- package/dist/assets/icons/ChevronsRight.js +28 -13
- package/dist/assets/icons/Clock.js +26 -11
- package/dist/assets/icons/Close.js +26 -11
- package/dist/assets/icons/DateTime.js +35 -14
- package/dist/assets/icons/DragIndicator.js +26 -11
- package/dist/assets/icons/File.js +28 -13
- package/dist/assets/icons/Highlight.js +26 -11
- package/dist/assets/icons/HighlightOn.js +49 -15
- package/dist/assets/icons/Home.js +26 -11
- package/dist/assets/icons/Info.js +37 -16
- package/dist/assets/icons/Italic.js +26 -11
- package/dist/assets/icons/Link.js +26 -11
- package/dist/assets/icons/Menu.js +26 -11
- package/dist/assets/icons/NumberedList.js +26 -11
- package/dist/assets/icons/PointerHorizontal.js +26 -11
- package/dist/assets/icons/PointerVertical.js +26 -11
- package/dist/assets/icons/Search.js +26 -11
- package/dist/assets/icons/Send.js +28 -13
- package/dist/assets/icons/Strikethrough.js +26 -11
- package/dist/assets/icons/TextColor.js +48 -14
- package/dist/assets/icons/Today.js +26 -11
- package/dist/assets/icons/Underlined.js +28 -13
- package/dist/assets/icons/Upload.js +35 -14
- package/dist/assets/icons/Visibility.js +26 -11
- package/dist/assets/icons/VisibilityOff.js +26 -11
- package/dist/assets/icons/WarningFilled.js +28 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
- package/dist/components/Menu/Menu.js +18 -2
- package/dist/components/Menu/MenuDesktop.js +41 -7
- package/dist/components/Menu/MenuItem.js +32 -9
- package/dist/components/Menu/MenuMobile.js +102 -39
- package/dist/components/Menu/MenuPopover.js +105 -29
- package/dist/components/buttons/Button/button.cva.d.ts +3 -3
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +55 -17
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
- package/dist/components/buttons/TextButton/TextButton.js +30 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +201 -35
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +380 -75
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +499 -186
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +14 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +280 -46
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +7 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +616 -121
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +342 -119
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +310 -103
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +233 -98
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DateField.js +288 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +14 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +359 -129
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +18 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +104 -11
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +83 -28
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
- package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +211 -65
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +5 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +32 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +41 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +99 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
- package/dist/components/inputs/File/FileUpload.js +91 -46
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- package/dist/components/inputs/File/index.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +104 -41
- package/dist/components/inputs/File/shared/FileCardList.js +47 -12
- package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
- package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
- package/dist/components/inputs/File/shared/InputUploadContent.js +148 -34
- package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
- package/dist/components/inputs/File/shared/ProgressBar.js +102 -15
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +0 -11
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -18
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +25 -5
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
- package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +13 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +14 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +446 -97
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +574 -0
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +8 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
- package/dist/components/inputs/Input/TextArea/TextArea.js +305 -90
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +429 -90
- package/dist/components/inputs/Input/shared/InputContent.js +193 -59
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
- package/dist/components/inputs/Inputs/InputItem.js +69 -14
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +353 -61
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +45 -0
- package/dist/components/inputs/RadioGroup/radio.cva.js +48 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +217 -22
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +107 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +37 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +178 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +227 -18
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +393 -138
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +397 -116
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +9 -3
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +14 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +43 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +67 -36
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +6 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +8 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +54 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +83 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +612 -0
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -76
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +447 -98
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +214 -37
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +21 -11
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +88 -12
- package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
- package/dist/components/inputs/shared/input.cva.d.ts +28 -0
- package/dist/components/inputs/shared/input.cva.js +38 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +8 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +15 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +112 -0
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/navigation/Stepper/StepperItem.js +104 -31
- package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
- package/dist/components/overlays/Drawer/Drawer.js +62 -20
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +85 -28
- package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
- package/dist/components/segment/Segment.js +218 -57
- package/dist/components/segment/SegmentItem.js +67 -10
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.js +167 -64
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Toast/Toast.js +28 -14
- package/dist/components/status/Toast/toast.cva.d.ts +1 -1
- package/dist/components/status/Toast/useToast.js +62 -57
- package/dist/components/table/ColumnConfig.js +158 -54
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.js +84 -18
- package/dist/components/table/Table.js +28 -27
- package/dist/components/text/Link/Link.js +19 -7
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +23 -9
- package/dist/config/router.context.js +42 -16
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.d.ts +20 -6
- package/dist/config/uiConfig.context.js +68 -14
- package/dist/config/uiOverrides.context.d.ts +30 -11
- package/dist/config/uiOverrides.context.js +54 -14
- package/dist/helpers/dynamicInputs.d.ts +12 -9
- package/dist/helpers/dynamicInputs.js +13 -8
- package/dist/hooks/useAutosave.d.ts +2 -1
- package/dist/hooks/useAutosave.js +12 -4
- package/dist/hooks/useAutosave.spec.d.ts +1 -0
- package/dist/hooks/useBreakpoint.js +16 -3
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFilters.js +125 -64
- package/dist/hooks/useForm.js +42 -8
- package/dist/hooks/useFormAutosave.d.ts +3 -1
- package/dist/hooks/useFormAutosave.js +122 -30
- package/dist/hooks/useFormAutosave.spec.d.ts +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +91 -24
- package/dist/hooks/useKeyInteractions.d.ts +20 -0
- package/dist/hooks/useKeyInteractions.js +54 -0
- package/dist/hooks/useKeyInteractions.spec.d.ts +1 -0
- package/dist/hooks/useLocalStorage.js +43 -10
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.js +49 -19
- package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
- package/dist/hooks/useQueryAutocomplete.js +72 -0
- package/dist/hooks/useScrollableListBox.js +37 -16
- package/dist/hooks/useSorting.js +69 -28
- package/dist/hooks/useStateAndRef.js +21 -7
- package/dist/hooks/useTableColumnConfig.js +124 -31
- package/dist/hooks/useTranslationMemo.js +25 -5
- package/dist/index.d.ts +18 -3
- package/dist/index.js +15 -5
- package/dist/tw-ui-plugin.js +6 -0
- package/dist/utils/date-time.utils.d.ts +38 -10
- package/dist/utils/date-time.utils.js +136 -22
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/dist/utils/zod.utils.d.ts +2 -0
- package/dist/utils/zod.utils.js +5 -0
- package/package.json +2 -2
|
@@ -4,53 +4,125 @@ import { Typography } from "../../../text/Typography/Typography.js";
|
|
|
4
4
|
import { useInputCva } from "../../shared/input.cva.js";
|
|
5
5
|
import { popoverDefinition } from "../../../shared/popover.cva.js";
|
|
6
6
|
import { ColorPicker } from "./ColorPicker.js";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { clsx } from "clsx";
|
|
9
10
|
import { useState } from "react";
|
|
10
11
|
import { Button, Dialog, DialogTrigger, Popover } from "react-aria-components";
|
|
11
12
|
//#region src/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.tsx
|
|
12
|
-
var ColorPickerDropdown = (
|
|
13
|
+
var ColorPickerDropdown = (t0) => {
|
|
14
|
+
const $ = c(28);
|
|
15
|
+
const { colors, value, onChange, isDisabled, children } = t0;
|
|
13
16
|
const inputCva = useInputCva();
|
|
14
17
|
const popoverCva = UIOverrides.useCva("popover.cva", popoverDefinition);
|
|
15
18
|
const [isOpen, setIsOpen] = useState(false);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
let t1;
|
|
20
|
+
if ($[0] !== onChange) {
|
|
21
|
+
t1 = (color) => {
|
|
22
|
+
onChange(color);
|
|
23
|
+
setIsOpen(false);
|
|
24
|
+
};
|
|
25
|
+
$[0] = onChange;
|
|
26
|
+
$[1] = t1;
|
|
27
|
+
} else t1 = $[1];
|
|
28
|
+
const handleChange = t1;
|
|
29
|
+
let t2;
|
|
30
|
+
if ($[2] !== inputCva) {
|
|
31
|
+
t2 = inputCva({
|
|
32
|
+
as: "inline",
|
|
33
|
+
className: clsx("flex items-center justify-between gap-2")
|
|
34
|
+
});
|
|
35
|
+
$[2] = inputCva;
|
|
36
|
+
$[3] = t2;
|
|
37
|
+
} else t2 = $[3];
|
|
38
|
+
let t3;
|
|
39
|
+
if ($[4] !== children) {
|
|
40
|
+
t3 = /* @__PURE__ */ jsx(Typography, {
|
|
41
|
+
size: "label-1",
|
|
42
|
+
className: "truncate",
|
|
43
|
+
children
|
|
44
|
+
});
|
|
45
|
+
$[4] = children;
|
|
46
|
+
$[5] = t3;
|
|
47
|
+
} else t3 = $[5];
|
|
48
|
+
const t4 = isOpen && "rotate-180";
|
|
49
|
+
let t5;
|
|
50
|
+
if ($[6] !== t4) {
|
|
51
|
+
t5 = clsx("size-6 shrink-0", t4);
|
|
52
|
+
$[6] = t4;
|
|
53
|
+
$[7] = t5;
|
|
54
|
+
} else t5 = $[7];
|
|
55
|
+
let t6;
|
|
56
|
+
if ($[8] !== t5) {
|
|
57
|
+
t6 = /* @__PURE__ */ jsx(ArrowDropDownIcon, {
|
|
58
|
+
className: t5,
|
|
59
|
+
"aria-hidden": "true"
|
|
60
|
+
});
|
|
61
|
+
$[8] = t5;
|
|
62
|
+
$[9] = t6;
|
|
63
|
+
} else t6 = $[9];
|
|
64
|
+
let t7;
|
|
65
|
+
if ($[10] !== isDisabled || $[11] !== t2 || $[12] !== t3 || $[13] !== t6) {
|
|
66
|
+
t7 = /* @__PURE__ */ jsxs(Button, {
|
|
67
|
+
className: t2,
|
|
28
68
|
isDisabled,
|
|
29
|
-
children: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
69
|
+
children: [t3, t6]
|
|
70
|
+
});
|
|
71
|
+
$[10] = isDisabled;
|
|
72
|
+
$[11] = t2;
|
|
73
|
+
$[12] = t3;
|
|
74
|
+
$[13] = t6;
|
|
75
|
+
$[14] = t7;
|
|
76
|
+
} else t7 = $[14];
|
|
77
|
+
let t8;
|
|
78
|
+
if ($[15] !== popoverCva) {
|
|
79
|
+
t8 = clsx(popoverCva({}), "flex justify-center overflow-hidden p-2");
|
|
80
|
+
$[15] = popoverCva;
|
|
81
|
+
$[16] = t8;
|
|
82
|
+
} else t8 = $[16];
|
|
83
|
+
let t9;
|
|
84
|
+
if ($[17] !== colors || $[18] !== handleChange || $[19] !== value) {
|
|
85
|
+
t9 = /* @__PURE__ */ jsx(ColorPicker, {
|
|
86
|
+
colors,
|
|
87
|
+
value,
|
|
88
|
+
onChange: handleChange
|
|
89
|
+
});
|
|
90
|
+
$[17] = colors;
|
|
91
|
+
$[18] = handleChange;
|
|
92
|
+
$[19] = value;
|
|
93
|
+
$[20] = t9;
|
|
94
|
+
} else t9 = $[20];
|
|
95
|
+
let t10;
|
|
96
|
+
if ($[21] !== t8 || $[22] !== t9) {
|
|
97
|
+
t10 = /* @__PURE__ */ jsx(Popover, {
|
|
38
98
|
className: "my-4 w-40 outline-none",
|
|
39
99
|
offset: 0,
|
|
40
100
|
placement: "bottom start",
|
|
41
101
|
children: /* @__PURE__ */ jsx(Dialog, {
|
|
42
102
|
className: "outline-none",
|
|
43
103
|
children: /* @__PURE__ */ jsx("div", {
|
|
44
|
-
className:
|
|
45
|
-
children:
|
|
46
|
-
colors,
|
|
47
|
-
value,
|
|
48
|
-
onChange: handleChange
|
|
49
|
-
})
|
|
104
|
+
className: t8,
|
|
105
|
+
children: t9
|
|
50
106
|
})
|
|
51
107
|
})
|
|
52
|
-
})
|
|
53
|
-
|
|
108
|
+
});
|
|
109
|
+
$[21] = t8;
|
|
110
|
+
$[22] = t9;
|
|
111
|
+
$[23] = t10;
|
|
112
|
+
} else t10 = $[23];
|
|
113
|
+
let t11;
|
|
114
|
+
if ($[24] !== isOpen || $[25] !== t10 || $[26] !== t7) {
|
|
115
|
+
t11 = /* @__PURE__ */ jsxs(DialogTrigger, {
|
|
116
|
+
isOpen,
|
|
117
|
+
onOpenChange: setIsOpen,
|
|
118
|
+
children: [t7, t10]
|
|
119
|
+
});
|
|
120
|
+
$[24] = isOpen;
|
|
121
|
+
$[25] = t10;
|
|
122
|
+
$[26] = t7;
|
|
123
|
+
$[27] = t11;
|
|
124
|
+
} else t11 = $[27];
|
|
125
|
+
return t11;
|
|
54
126
|
};
|
|
55
127
|
//#endregion
|
|
56
128
|
export { ColorPickerDropdown };
|
|
@@ -4,69 +4,218 @@ import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconBu
|
|
|
4
4
|
import "../../../../config/i18n.js";
|
|
5
5
|
import { TextInput } from "../../Input/TextInput/TextInput.js";
|
|
6
6
|
import { ResponsivePopover } from "../../../overlays/ResponsivePopover/ResponsivePopover.js";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { clsx } from "clsx";
|
|
9
10
|
import { useEffect, useState } from "react";
|
|
10
11
|
import { useTranslation } from "react-i18next";
|
|
11
12
|
//#region src/components/inputs/TextEditor/Toolbar/HyperlinkAction.tsx
|
|
12
|
-
var HyperlinkAction = (
|
|
13
|
+
var HyperlinkAction = (t0) => {
|
|
14
|
+
const $ = c(49);
|
|
15
|
+
const { editor } = t0;
|
|
13
16
|
const { t } = useTranslation("ui");
|
|
14
17
|
const [isOpen, setIsOpen] = useState(false);
|
|
15
18
|
const [url, setUrl] = useState("");
|
|
16
|
-
const isLinkEnabled = !!editor.extensionManager.extensions.find(
|
|
19
|
+
const isLinkEnabled = !!editor.extensionManager.extensions.find(_temp);
|
|
17
20
|
const linkHref = editor.getAttributes("link")?.href;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
let t1;
|
|
22
|
+
let t2;
|
|
23
|
+
if ($[0] !== linkHref) {
|
|
24
|
+
t1 = () => {
|
|
25
|
+
setUrl(linkHref || "");
|
|
26
|
+
};
|
|
27
|
+
t2 = [linkHref];
|
|
28
|
+
$[0] = linkHref;
|
|
29
|
+
$[1] = t1;
|
|
30
|
+
$[2] = t2;
|
|
31
|
+
} else {
|
|
32
|
+
t1 = $[1];
|
|
33
|
+
t2 = $[2];
|
|
34
|
+
}
|
|
35
|
+
useEffect(t1, t2);
|
|
21
36
|
if (!isLinkEnabled) return null;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
let t3;
|
|
38
|
+
if ($[3] !== editor) {
|
|
39
|
+
t3 = () => {
|
|
40
|
+
editor.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
41
|
+
setIsOpen(false);
|
|
42
|
+
};
|
|
43
|
+
$[3] = editor;
|
|
44
|
+
$[4] = t3;
|
|
45
|
+
} else t3 = $[4];
|
|
46
|
+
const onRemove = t3;
|
|
47
|
+
let t4;
|
|
48
|
+
if ($[5] !== editor || $[6] !== url) {
|
|
49
|
+
t4 = () => {
|
|
50
|
+
editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
|
|
51
|
+
setIsOpen(false);
|
|
52
|
+
};
|
|
53
|
+
$[5] = editor;
|
|
54
|
+
$[6] = url;
|
|
55
|
+
$[7] = t4;
|
|
56
|
+
} else t4 = $[7];
|
|
57
|
+
const onApply = t4;
|
|
58
|
+
let t5;
|
|
59
|
+
if ($[8] !== t) {
|
|
60
|
+
t5 = t(_temp2);
|
|
61
|
+
$[8] = t;
|
|
62
|
+
$[9] = t5;
|
|
63
|
+
} else t5 = $[9];
|
|
64
|
+
let t6;
|
|
65
|
+
if ($[10] !== t) {
|
|
66
|
+
t6 = t(_temp3);
|
|
67
|
+
$[10] = t;
|
|
68
|
+
$[11] = t6;
|
|
69
|
+
} else t6 = $[11];
|
|
70
|
+
let t7;
|
|
71
|
+
if ($[12] !== editor) {
|
|
72
|
+
t7 = clsx(editor.isActive("link") && "!text-interactive-text-primary-idle");
|
|
73
|
+
$[12] = editor;
|
|
74
|
+
$[13] = t7;
|
|
75
|
+
} else t7 = $[13];
|
|
76
|
+
const t8 = !editor.isEditable;
|
|
77
|
+
let t9;
|
|
78
|
+
if ($[14] !== t6 || $[15] !== t7 || $[16] !== t8) {
|
|
79
|
+
t9 = /* @__PURE__ */ jsx(InlineIconButton, {
|
|
35
80
|
color: "secondary",
|
|
36
|
-
label:
|
|
81
|
+
label: t6,
|
|
37
82
|
icon: LinkIcon,
|
|
38
|
-
className:
|
|
39
|
-
isDisabled:
|
|
40
|
-
})
|
|
41
|
-
|
|
83
|
+
className: t7,
|
|
84
|
+
isDisabled: t8
|
|
85
|
+
});
|
|
86
|
+
$[14] = t6;
|
|
87
|
+
$[15] = t7;
|
|
88
|
+
$[16] = t8;
|
|
89
|
+
$[17] = t9;
|
|
90
|
+
} else t9 = $[17];
|
|
91
|
+
let t10;
|
|
92
|
+
if ($[18] !== t) {
|
|
93
|
+
t10 = t(_temp4);
|
|
94
|
+
$[18] = t;
|
|
95
|
+
$[19] = t10;
|
|
96
|
+
} else t10 = $[19];
|
|
97
|
+
let t11;
|
|
98
|
+
if ($[20] !== t) {
|
|
99
|
+
t11 = t(_temp5);
|
|
100
|
+
$[20] = t;
|
|
101
|
+
$[21] = t11;
|
|
102
|
+
} else t11 = $[21];
|
|
103
|
+
let t12;
|
|
104
|
+
if ($[22] !== t10 || $[23] !== t11 || $[24] !== url) {
|
|
105
|
+
t12 = /* @__PURE__ */ jsx(TextInput, {
|
|
42
106
|
variant: "outlined",
|
|
43
107
|
hideLabel: true,
|
|
44
|
-
label:
|
|
45
|
-
placeholder:
|
|
108
|
+
label: t10,
|
|
109
|
+
placeholder: t11,
|
|
46
110
|
value: url,
|
|
47
111
|
onChange: setUrl,
|
|
48
112
|
className: "mb-4"
|
|
49
|
-
})
|
|
113
|
+
});
|
|
114
|
+
$[22] = t10;
|
|
115
|
+
$[23] = t11;
|
|
116
|
+
$[24] = url;
|
|
117
|
+
$[25] = t12;
|
|
118
|
+
} else t12 = $[25];
|
|
119
|
+
const t13 = !url;
|
|
120
|
+
let t14;
|
|
121
|
+
if ($[26] !== t) {
|
|
122
|
+
t14 = t(_temp6);
|
|
123
|
+
$[26] = t;
|
|
124
|
+
$[27] = t14;
|
|
125
|
+
} else t14 = $[27];
|
|
126
|
+
let t15;
|
|
127
|
+
if ($[28] !== onApply || $[29] !== t13 || $[30] !== t14) {
|
|
128
|
+
t15 = /* @__PURE__ */ jsx(Button, {
|
|
129
|
+
variant: "contained",
|
|
130
|
+
color: "secondary",
|
|
131
|
+
size: "xs",
|
|
132
|
+
width: "hug",
|
|
133
|
+
onPress: onApply,
|
|
134
|
+
isDisabled: t13,
|
|
135
|
+
children: t14
|
|
136
|
+
});
|
|
137
|
+
$[28] = onApply;
|
|
138
|
+
$[29] = t13;
|
|
139
|
+
$[30] = t14;
|
|
140
|
+
$[31] = t15;
|
|
141
|
+
} else t15 = $[31];
|
|
142
|
+
let t16;
|
|
143
|
+
if ($[32] !== editor) {
|
|
144
|
+
t16 = editor.isActive("link");
|
|
145
|
+
$[32] = editor;
|
|
146
|
+
$[33] = t16;
|
|
147
|
+
} else t16 = $[33];
|
|
148
|
+
const t17 = !t16;
|
|
149
|
+
let t18;
|
|
150
|
+
if ($[34] !== t) {
|
|
151
|
+
t18 = t(_temp7);
|
|
152
|
+
$[34] = t;
|
|
153
|
+
$[35] = t18;
|
|
154
|
+
} else t18 = $[35];
|
|
155
|
+
let t19;
|
|
156
|
+
if ($[36] !== onRemove || $[37] !== t17 || $[38] !== t18) {
|
|
157
|
+
t19 = /* @__PURE__ */ jsx(Button, {
|
|
158
|
+
variant: "outlined",
|
|
159
|
+
color: "secondary",
|
|
160
|
+
size: "xs",
|
|
161
|
+
width: "hug",
|
|
162
|
+
onPress: onRemove,
|
|
163
|
+
isDisabled: t17,
|
|
164
|
+
children: t18
|
|
165
|
+
});
|
|
166
|
+
$[36] = onRemove;
|
|
167
|
+
$[37] = t17;
|
|
168
|
+
$[38] = t18;
|
|
169
|
+
$[39] = t19;
|
|
170
|
+
} else t19 = $[39];
|
|
171
|
+
let t20;
|
|
172
|
+
if ($[40] !== t15 || $[41] !== t19) {
|
|
173
|
+
t20 = /* @__PURE__ */ jsxs("div", {
|
|
50
174
|
className: "flex justify-between",
|
|
51
|
-
children: [
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
175
|
+
children: [t15, t19]
|
|
176
|
+
});
|
|
177
|
+
$[40] = t15;
|
|
178
|
+
$[41] = t19;
|
|
179
|
+
$[42] = t20;
|
|
180
|
+
} else t20 = $[42];
|
|
181
|
+
let t21;
|
|
182
|
+
if ($[43] !== isOpen || $[44] !== t12 || $[45] !== t20 || $[46] !== t5 || $[47] !== t9) {
|
|
183
|
+
t21 = /* @__PURE__ */ jsxs(ResponsivePopover, {
|
|
184
|
+
isOpen,
|
|
185
|
+
onOpenChange: setIsOpen,
|
|
186
|
+
sheetLabel: t5,
|
|
187
|
+
trigger: t9,
|
|
188
|
+
children: [t12, t20]
|
|
189
|
+
});
|
|
190
|
+
$[43] = isOpen;
|
|
191
|
+
$[44] = t12;
|
|
192
|
+
$[45] = t20;
|
|
193
|
+
$[46] = t5;
|
|
194
|
+
$[47] = t9;
|
|
195
|
+
$[48] = t21;
|
|
196
|
+
} else t21 = $[48];
|
|
197
|
+
return t21;
|
|
70
198
|
};
|
|
199
|
+
function _temp(extension) {
|
|
200
|
+
return extension.name === "link";
|
|
201
|
+
}
|
|
202
|
+
function _temp2($) {
|
|
203
|
+
return $.ui.textEditor.link.label;
|
|
204
|
+
}
|
|
205
|
+
function _temp3($_0) {
|
|
206
|
+
return $_0.ui.textEditor.link.label;
|
|
207
|
+
}
|
|
208
|
+
function _temp4($_1) {
|
|
209
|
+
return $_1.ui.textEditor.link.urlLabel;
|
|
210
|
+
}
|
|
211
|
+
function _temp5($_2) {
|
|
212
|
+
return $_2.ui.textEditor.link.urlPlaceholder;
|
|
213
|
+
}
|
|
214
|
+
function _temp6($_3) {
|
|
215
|
+
return $_3.ui.textEditor.link.apply;
|
|
216
|
+
}
|
|
217
|
+
function _temp7($_4) {
|
|
218
|
+
return $_4.ui.textEditor.link.remove;
|
|
219
|
+
}
|
|
71
220
|
//#endregion
|
|
72
221
|
export { HyperlinkAction };
|
|
@@ -4,43 +4,103 @@ import { AlignLeftRightIcon } from "../../../../assets/icons/AlignLeftRight.js";
|
|
|
4
4
|
import { AlignRightIcon } from "../../../../assets/icons/AlignRight.js";
|
|
5
5
|
import "../../../../config/i18n.js";
|
|
6
6
|
import { Select } from "../../Selection/Select/Select.js";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
7
8
|
import { jsx } from "react/jsx-runtime";
|
|
8
9
|
import { useTranslation } from "react-i18next";
|
|
9
10
|
//#region src/components/inputs/TextEditor/Toolbar/TextAlignSelect.tsx
|
|
10
|
-
var TextAlignSelect = (
|
|
11
|
+
var TextAlignSelect = (t0) => {
|
|
12
|
+
const $0 = c(18);
|
|
13
|
+
const { editor } = t0;
|
|
11
14
|
const { t } = useTranslation("ui");
|
|
12
|
-
if (!!!editor.extensionManager.extensions.find(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
if (!!!editor.extensionManager.extensions.find(_temp)) return null;
|
|
16
|
+
let t1;
|
|
17
|
+
if ($0[0] !== editor) {
|
|
18
|
+
t1 = (val) => {
|
|
19
|
+
if (val) editor.chain().focus().setTextAlign(val).run();
|
|
20
|
+
else editor.chain().focus().unsetTextAlign().run();
|
|
21
|
+
};
|
|
22
|
+
$0[0] = editor;
|
|
23
|
+
$0[1] = t1;
|
|
24
|
+
} else t1 = $0[1];
|
|
25
|
+
const onChange = t1;
|
|
26
|
+
let t2;
|
|
27
|
+
if ($0[2] !== editor || $0[3] !== t) {
|
|
28
|
+
t2 = (id, Icon) => ({
|
|
19
29
|
id,
|
|
20
30
|
label: t(($) => $.ui.textEditor.textAlign[id]),
|
|
21
31
|
content: /* @__PURE__ */ jsx(Icon, { className: "size-6" }),
|
|
22
32
|
isActive: editor.isActive({ textAlign: id }),
|
|
23
33
|
can: editor.can().setTextAlign(id)
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
});
|
|
35
|
+
$0[2] = editor;
|
|
36
|
+
$0[3] = t;
|
|
37
|
+
$0[4] = t2;
|
|
38
|
+
} else t2 = $0[4];
|
|
39
|
+
const getItem = t2;
|
|
40
|
+
let t3;
|
|
41
|
+
if ($0[5] !== getItem) {
|
|
42
|
+
t3 = [
|
|
43
|
+
getItem("left", AlignLeftIcon),
|
|
44
|
+
getItem("center", AlignCenterIcon),
|
|
45
|
+
getItem("right", AlignRightIcon),
|
|
46
|
+
getItem("justify", AlignLeftRightIcon)
|
|
47
|
+
].filter(_temp2);
|
|
48
|
+
$0[5] = getItem;
|
|
49
|
+
$0[6] = t3;
|
|
50
|
+
} else t3 = $0[6];
|
|
51
|
+
const enabledItems = t3;
|
|
52
|
+
let t4;
|
|
53
|
+
if ($0[7] !== t) {
|
|
54
|
+
t4 = t(_temp3);
|
|
55
|
+
$0[7] = t;
|
|
56
|
+
$0[8] = t4;
|
|
57
|
+
} else t4 = $0[8];
|
|
58
|
+
let t5;
|
|
59
|
+
if ($0[9] !== t) {
|
|
60
|
+
t5 = t(_temp4);
|
|
61
|
+
$0[9] = t;
|
|
62
|
+
$0[10] = t5;
|
|
63
|
+
} else t5 = $0[10];
|
|
64
|
+
const t6 = enabledItems.find(_temp5)?.id || "left";
|
|
65
|
+
const t7 = !editor.isEditable;
|
|
66
|
+
let t8;
|
|
67
|
+
if ($0[11] !== enabledItems || $0[12] !== onChange || $0[13] !== t4 || $0[14] !== t5 || $0[15] !== t6 || $0[16] !== t7) {
|
|
68
|
+
t8 = /* @__PURE__ */ jsx(Select, {
|
|
69
|
+
as: "inline",
|
|
70
|
+
label: t4,
|
|
71
|
+
placeholder: t5,
|
|
72
|
+
hideLabel: true,
|
|
73
|
+
ignoreTriggerWidth: true,
|
|
74
|
+
showSelectionContent: true,
|
|
75
|
+
onChange,
|
|
76
|
+
items: enabledItems,
|
|
77
|
+
value: t6,
|
|
78
|
+
isDisabled: t7
|
|
79
|
+
});
|
|
80
|
+
$0[11] = enabledItems;
|
|
81
|
+
$0[12] = onChange;
|
|
82
|
+
$0[13] = t4;
|
|
83
|
+
$0[14] = t5;
|
|
84
|
+
$0[15] = t6;
|
|
85
|
+
$0[16] = t7;
|
|
86
|
+
$0[17] = t8;
|
|
87
|
+
} else t8 = $0[17];
|
|
88
|
+
return t8;
|
|
44
89
|
};
|
|
90
|
+
function _temp(extension) {
|
|
91
|
+
return extension.name === "textAlign";
|
|
92
|
+
}
|
|
93
|
+
function _temp2(item) {
|
|
94
|
+
return item.can;
|
|
95
|
+
}
|
|
96
|
+
function _temp3($_0) {
|
|
97
|
+
return $_0.ui.textEditor.textAlign.label;
|
|
98
|
+
}
|
|
99
|
+
function _temp4($_1) {
|
|
100
|
+
return $_1.ui.textEditor.textAlign.label;
|
|
101
|
+
}
|
|
102
|
+
function _temp5(item_0) {
|
|
103
|
+
return item_0.isActive;
|
|
104
|
+
}
|
|
45
105
|
//#endregion
|
|
46
106
|
export { TextAlignSelect };
|
|
@@ -1,24 +1,58 @@
|
|
|
1
1
|
import { TextColorIcon } from "../../../../assets/icons/TextColor.js";
|
|
2
2
|
import { ColorPickerDropdown } from "./ColorPickerDropdown.js";
|
|
3
3
|
import { defaultColors } from "../textEditor.types.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/components/inputs/TextEditor/Toolbar/TextColorSelect.tsx
|
|
6
|
-
var TextColorSelect = (
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
var TextColorSelect = (t0) => {
|
|
8
|
+
const $ = c(11);
|
|
9
|
+
const { editor } = t0;
|
|
10
|
+
if (!editor.extensionManager.extensions.some(_temp)) return null;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] !== editor) {
|
|
13
|
+
t1 = (color) => {
|
|
14
|
+
editor.chain().focus().setColor(color).run();
|
|
15
|
+
};
|
|
16
|
+
$[0] = editor;
|
|
17
|
+
$[1] = t1;
|
|
18
|
+
} else t1 = $[1];
|
|
19
|
+
const onChange = t1;
|
|
20
|
+
let t2;
|
|
21
|
+
if ($[2] !== editor) {
|
|
22
|
+
t2 = editor.getAttributes("textStyle").color || "#000000";
|
|
23
|
+
$[2] = editor;
|
|
24
|
+
$[3] = t2;
|
|
25
|
+
} else t2 = $[3];
|
|
26
|
+
const textColor = t2;
|
|
27
|
+
const t3 = !editor.isEditable;
|
|
28
|
+
let t4;
|
|
29
|
+
if ($[4] !== textColor) {
|
|
30
|
+
t4 = /* @__PURE__ */ jsx(TextColorIcon, {
|
|
18
31
|
className: "size-6",
|
|
19
32
|
textColor
|
|
20
|
-
})
|
|
21
|
-
|
|
33
|
+
});
|
|
34
|
+
$[4] = textColor;
|
|
35
|
+
$[5] = t4;
|
|
36
|
+
} else t4 = $[5];
|
|
37
|
+
let t5;
|
|
38
|
+
if ($[6] !== onChange || $[7] !== t3 || $[8] !== t4 || $[9] !== textColor) {
|
|
39
|
+
t5 = /* @__PURE__ */ jsx(ColorPickerDropdown, {
|
|
40
|
+
value: textColor,
|
|
41
|
+
onChange,
|
|
42
|
+
colors: defaultColors,
|
|
43
|
+
isDisabled: t3,
|
|
44
|
+
children: t4
|
|
45
|
+
});
|
|
46
|
+
$[6] = onChange;
|
|
47
|
+
$[7] = t3;
|
|
48
|
+
$[8] = t4;
|
|
49
|
+
$[9] = textColor;
|
|
50
|
+
$[10] = t5;
|
|
51
|
+
} else t5 = $[10];
|
|
52
|
+
return t5;
|
|
22
53
|
};
|
|
54
|
+
function _temp(extension) {
|
|
55
|
+
return extension.name === "color";
|
|
56
|
+
}
|
|
23
57
|
//#endregion
|
|
24
58
|
export { TextColorSelect };
|