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