@elementor/editor-controls 4.0.0-682 → 4.0.0-beta5
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/index.d.mts +138 -74
- package/dist/index.d.ts +138 -74
- package/dist/index.js +822 -203
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +799 -185
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/inline-editor.tsx +16 -57
- package/src/controls/email-form-action-control.tsx +5 -5
- package/src/controls/size-control/hooks/use-size-unit-keyboard.tsx +12 -1
- package/src/controls/size-control/hooks/use-size-value.ts +12 -16
- package/src/controls/size-control/size-component.tsx +38 -17
- package/src/controls/size-control/size-field.tsx +37 -13
- package/src/controls/size-control/sync/get-units.ts +15 -1
- package/src/controls/size-control/types.ts +8 -0
- package/src/controls/size-control/unstable-size-control.tsx +86 -0
- package/src/controls/size-control/utils/has-size-value.ts +5 -0
- package/src/controls/size-control/utils/resolve-bound-prop-value.ts +72 -0
- package/src/controls/size-control/utils/resolve-size-value.ts +4 -3
- package/src/controls/size-control/utils/settings/get-default-unit.ts +7 -0
- package/src/controls/size-control/utils/settings/get-prop-type-settings.ts +12 -0
- package/src/controls/size-control/utils/settings/get-size-units.ts +23 -0
- package/src/controls/size-control/utils/should-nullify-value.ts +15 -0
- package/src/controls/svg-media-control.tsx +5 -4
- package/src/controls/transition-control/data.ts +3 -3
- package/src/controls/transition-control/transition-repeater-control.tsx +8 -2
- package/src/index.ts +2 -0
- package/src/controls/size-control/utils/is-numeric-value.ts +0 -11
package/dist/index.mjs
CHANGED
|
@@ -653,14 +653,14 @@ var TextFieldInnerSelection = forwardRef2(
|
|
|
653
653
|
id
|
|
654
654
|
}, ref) => {
|
|
655
655
|
const { placeholder: boundPropPlaceholder } = useBoundProp(sizePropTypeUtil);
|
|
656
|
-
const
|
|
656
|
+
const getCursorStyle3 = () => ({
|
|
657
657
|
input: { cursor: InputProps.readOnly ? "default !important" : void 0 }
|
|
658
658
|
});
|
|
659
659
|
return /* @__PURE__ */ React17.createElement(
|
|
660
660
|
NumberInput,
|
|
661
661
|
{
|
|
662
662
|
ref,
|
|
663
|
-
sx:
|
|
663
|
+
sx: getCursorStyle3(),
|
|
664
664
|
size: "tiny",
|
|
665
665
|
fullWidth: true,
|
|
666
666
|
type,
|
|
@@ -3980,7 +3980,7 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
3980
3980
|
import * as React71 from "react";
|
|
3981
3981
|
import { useState as useState14 } from "react";
|
|
3982
3982
|
import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
|
|
3983
|
-
import {
|
|
3983
|
+
import { svgSrcPropTypeUtil, urlPropTypeUtil as urlPropTypeUtil3 } from "@elementor/editor-props";
|
|
3984
3984
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
3985
3985
|
import { Button as Button4, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress3, Stack as Stack13, styled as styled7, ThemeProvider } from "@elementor/ui";
|
|
3986
3986
|
import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
|
|
@@ -4072,8 +4072,9 @@ var StyledCardMediaContainer = styled7(Stack13)`
|
|
|
4072
4072
|
var MODE_BROWSE = { mode: "browse" };
|
|
4073
4073
|
var MODE_UPLOAD = { mode: "upload" };
|
|
4074
4074
|
var SvgMediaControl = createControl(() => {
|
|
4075
|
-
const { value, setValue } = useBoundProp(
|
|
4076
|
-
const
|
|
4075
|
+
const { value, setValue } = useBoundProp(svgSrcPropTypeUtil);
|
|
4076
|
+
const id = value?.id;
|
|
4077
|
+
const url = value?.url;
|
|
4077
4078
|
const { data: attachment, isFetching } = useWpMediaAttachment2(id?.value || null);
|
|
4078
4079
|
const src = attachment?.url ?? url?.value ?? null;
|
|
4079
4080
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
@@ -4089,7 +4090,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
4089
4090
|
$$type: "image-attachment-id",
|
|
4090
4091
|
value: selectedAttachment.id
|
|
4091
4092
|
},
|
|
4092
|
-
url:
|
|
4093
|
+
url: urlPropTypeUtil3.create(selectedAttachment.url)
|
|
4093
4094
|
});
|
|
4094
4095
|
}
|
|
4095
4096
|
});
|
|
@@ -5741,6 +5742,7 @@ import {
|
|
|
5741
5742
|
} from "@elementor/editor-props";
|
|
5742
5743
|
import { InfoCircleFilledIcon as InfoCircleFilledIcon3 } from "@elementor/icons";
|
|
5743
5744
|
import { Alert as Alert2, AlertTitle as AlertTitle3, Box as Box20, Typography as Typography8 } from "@elementor/ui";
|
|
5745
|
+
import { hasProInstalled as hasProInstalled2 } from "@elementor/utils";
|
|
5744
5746
|
import { __ as __50 } from "@wordpress/i18n";
|
|
5745
5747
|
|
|
5746
5748
|
// src/controls/selection-size-control.tsx
|
|
@@ -5794,9 +5796,9 @@ var MIN_PRO_VERSION = "3.35";
|
|
|
5794
5796
|
var getIsSiteRtl = () => {
|
|
5795
5797
|
return !!window.elementorFrontend?.config?.is_rtl;
|
|
5796
5798
|
};
|
|
5797
|
-
var
|
|
5799
|
+
var shouldShowAllTransitionProperties = () => {
|
|
5798
5800
|
if (!hasProInstalled()) {
|
|
5799
|
-
return
|
|
5801
|
+
return true;
|
|
5800
5802
|
}
|
|
5801
5803
|
const proVersion = window.elementorPro?.config?.version;
|
|
5802
5804
|
if (!proVersion) {
|
|
@@ -5933,7 +5935,7 @@ var createTransitionPropertiesList = () => {
|
|
|
5933
5935
|
]
|
|
5934
5936
|
}
|
|
5935
5937
|
];
|
|
5936
|
-
return
|
|
5938
|
+
return shouldShowAllTransitionProperties() ? baseProperties : [baseProperties[0]];
|
|
5937
5939
|
};
|
|
5938
5940
|
var transitionProperties = createTransitionPropertiesList();
|
|
5939
5941
|
var transitionsItemsList = transitionProperties.map((category) => ({
|
|
@@ -6282,6 +6284,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
6282
6284
|
}) => {
|
|
6283
6285
|
const currentStyleIsNormal = currentStyleState === null;
|
|
6284
6286
|
const [recentlyUsedList, setRecentlyUsedList] = useState16([]);
|
|
6287
|
+
const proInstalled = hasProInstalled2();
|
|
6285
6288
|
const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
6286
6289
|
const { allDisabled: disabledItems, proDisabled: proDisabledItems } = useMemo13(
|
|
6287
6290
|
() => getDisabledItemLabels(value),
|
|
@@ -6290,10 +6293,14 @@ var TransitionRepeaterControl = createControl(
|
|
|
6290
6293
|
const allowedTransitionSet = useMemo13(() => {
|
|
6291
6294
|
const set = /* @__PURE__ */ new Set();
|
|
6292
6295
|
transitionProperties.forEach((category) => {
|
|
6293
|
-
category.properties.forEach((prop) =>
|
|
6296
|
+
category.properties.forEach((prop) => {
|
|
6297
|
+
if (!prop.isDisabled || proInstalled) {
|
|
6298
|
+
set.add(prop.value);
|
|
6299
|
+
}
|
|
6300
|
+
});
|
|
6294
6301
|
});
|
|
6295
6302
|
return set;
|
|
6296
|
-
}, []);
|
|
6303
|
+
}, [proInstalled]);
|
|
6297
6304
|
useEffect11(() => {
|
|
6298
6305
|
if (!value || value.length === 0) {
|
|
6299
6306
|
return;
|
|
@@ -6422,11 +6429,8 @@ import { debounce as debounce4 } from "@elementor/utils";
|
|
|
6422
6429
|
|
|
6423
6430
|
// src/components/inline-editor.tsx
|
|
6424
6431
|
import * as React100 from "react";
|
|
6425
|
-
import {
|
|
6426
|
-
|
|
6427
|
-
useRef as useRef24
|
|
6428
|
-
} from "react";
|
|
6429
|
-
import { Box as Box22, ClickAwayListener } from "@elementor/ui";
|
|
6432
|
+
import { useEffect as useEffect12, useRef as useRef24 } from "react";
|
|
6433
|
+
import { Box as Box22 } from "@elementor/ui";
|
|
6430
6434
|
import Bold from "@tiptap/extension-bold";
|
|
6431
6435
|
import Document from "@tiptap/extension-document";
|
|
6432
6436
|
import HardBreak from "@tiptap/extension-hard-break";
|
|
@@ -6467,9 +6471,12 @@ var InlineEditor = React100.forwardRef((props, ref) => {
|
|
|
6467
6471
|
expectedTag = null,
|
|
6468
6472
|
onEditorCreate,
|
|
6469
6473
|
wrapperClassName,
|
|
6470
|
-
onSelectionEnd
|
|
6474
|
+
onSelectionEnd,
|
|
6475
|
+
mountElement = null
|
|
6471
6476
|
} = props;
|
|
6472
6477
|
const containerRef = useRef24(null);
|
|
6478
|
+
const onBlurRef = useRef24(onBlur);
|
|
6479
|
+
onBlurRef.current = onBlur;
|
|
6473
6480
|
const documentContentSettings = !!expectedTag ? "block+" : "inline*";
|
|
6474
6481
|
const onUpdate = ({ editor: updatedEditor }) => {
|
|
6475
6482
|
const newValue = updatedEditor.getHTML();
|
|
@@ -6477,7 +6484,7 @@ var InlineEditor = React100.forwardRef((props, ref) => {
|
|
|
6477
6484
|
};
|
|
6478
6485
|
const onKeyDown = (_, event) => {
|
|
6479
6486
|
if (event.key === "Escape") {
|
|
6480
|
-
|
|
6487
|
+
onBlurRef.current?.();
|
|
6481
6488
|
}
|
|
6482
6489
|
if (!event.metaKey && !event.ctrlKey || event.altKey) {
|
|
6483
6490
|
return;
|
|
@@ -6491,6 +6498,7 @@ var InlineEditor = React100.forwardRef((props, ref) => {
|
|
|
6491
6498
|
class: elementClasses
|
|
6492
6499
|
});
|
|
6493
6500
|
const editor = useEditor({
|
|
6501
|
+
...mountElement ? { element: mountElement } : {},
|
|
6494
6502
|
extensions: [
|
|
6495
6503
|
Document.extend({
|
|
6496
6504
|
content: documentContentSettings
|
|
@@ -6544,6 +6552,7 @@ var InlineEditor = React100.forwardRef((props, ref) => {
|
|
|
6544
6552
|
}
|
|
6545
6553
|
},
|
|
6546
6554
|
onCreate: onEditorCreate ? ({ editor: mountedEditor }) => onEditorCreate(mountedEditor) : void 0,
|
|
6555
|
+
onBlur: mountElement ? void 0 : () => onBlurRef.current?.(),
|
|
6547
6556
|
onSelectionUpdate: onSelectionEnd ? ({ editor: updatedEditor }) => onSelectionEnd(updatedEditor.view) : void 0
|
|
6548
6557
|
});
|
|
6549
6558
|
useOnUpdate(() => {
|
|
@@ -6555,33 +6564,11 @@ var InlineEditor = React100.forwardRef((props, ref) => {
|
|
|
6555
6564
|
editor.commands.setContent(value, { emitUpdate: false });
|
|
6556
6565
|
}
|
|
6557
6566
|
}, [editor, value]);
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
editor,
|
|
6563
|
-
sx,
|
|
6564
|
-
onBlur,
|
|
6565
|
-
className: wrapperClassName
|
|
6566
|
-
},
|
|
6567
|
-
/* @__PURE__ */ React100.createElement(EditorContent, { ref, editor })
|
|
6568
|
-
));
|
|
6567
|
+
if (mountElement) {
|
|
6568
|
+
return null;
|
|
6569
|
+
}
|
|
6570
|
+
return /* @__PURE__ */ React100.createElement(Box22, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React100.createElement(EditorContent, { ref, editor }));
|
|
6569
6571
|
});
|
|
6570
|
-
var Wrapper = ({ children, containerRef, editor, sx, onBlur, className }) => {
|
|
6571
|
-
const wrappedChildren = /* @__PURE__ */ React100.createElement(Box22, { ref: containerRef, ...sx, className }, children);
|
|
6572
|
-
return onBlur ? /* @__PURE__ */ React100.createElement(
|
|
6573
|
-
ClickAwayListener,
|
|
6574
|
-
{
|
|
6575
|
-
onClickAway: (event) => {
|
|
6576
|
-
if (containerRef.current?.contains(event.target) || editor.view.dom.contains(event.target)) {
|
|
6577
|
-
return;
|
|
6578
|
-
}
|
|
6579
|
-
onBlur?.();
|
|
6580
|
-
}
|
|
6581
|
-
},
|
|
6582
|
-
wrappedChildren
|
|
6583
|
-
) : /* @__PURE__ */ React100.createElement(React100.Fragment, null, wrappedChildren);
|
|
6584
|
-
};
|
|
6585
6572
|
var useOnUpdate = (callback, dependencies) => {
|
|
6586
6573
|
const hasMounted = useRef24(false);
|
|
6587
6574
|
useEffect12(() => {
|
|
@@ -6679,7 +6666,7 @@ var SendToField = () => /* @__PURE__ */ React102.createElement(
|
|
|
6679
6666
|
EmailField,
|
|
6680
6667
|
{
|
|
6681
6668
|
bind: "to",
|
|
6682
|
-
label: __51("Send
|
|
6669
|
+
label: __51("Send to", "elementor"),
|
|
6683
6670
|
placeholder: __51("Where should we send new submissions?", "elementor")
|
|
6684
6671
|
}
|
|
6685
6672
|
);
|
|
@@ -6687,7 +6674,7 @@ var SubjectField = () => /* @__PURE__ */ React102.createElement(
|
|
|
6687
6674
|
EmailField,
|
|
6688
6675
|
{
|
|
6689
6676
|
bind: "subject",
|
|
6690
|
-
label: __51("Email
|
|
6677
|
+
label: __51("Email subject", "elementor"),
|
|
6691
6678
|
placeholder: __51("New form submission", "elementor")
|
|
6692
6679
|
}
|
|
6693
6680
|
);
|
|
@@ -6705,7 +6692,7 @@ var FromEmailField = () => /* @__PURE__ */ React102.createElement(
|
|
|
6705
6692
|
{
|
|
6706
6693
|
bind: "from",
|
|
6707
6694
|
label: __51("From email", "elementor"),
|
|
6708
|
-
placeholder: __51("What email
|
|
6695
|
+
placeholder: __51("What email should appear as the sender?", "elementor")
|
|
6709
6696
|
}
|
|
6710
6697
|
);
|
|
6711
6698
|
var FromNameField = () => /* @__PURE__ */ React102.createElement(
|
|
@@ -6719,7 +6706,7 @@ var FromNameField = () => /* @__PURE__ */ React102.createElement(
|
|
|
6719
6706
|
var ReplyToField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "reply-to", label: __51("Reply-to", "elementor") });
|
|
6720
6707
|
var CcField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "cc", label: __51("Cc", "elementor") });
|
|
6721
6708
|
var BccField = () => /* @__PURE__ */ React102.createElement(EmailField, { bind: "bcc", label: __51("Bcc", "elementor") });
|
|
6722
|
-
var MetaDataField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React102.createElement(Stack17, { gap: 0.5 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, __51("
|
|
6709
|
+
var MetaDataField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React102.createElement(Stack17, { gap: 0.5 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, __51("Metadata", "elementor")), /* @__PURE__ */ React102.createElement(
|
|
6723
6710
|
ChipsControl,
|
|
6724
6711
|
{
|
|
6725
6712
|
options: [
|
|
@@ -6743,25 +6730,650 @@ var SendAsField = () => /* @__PURE__ */ React102.createElement(PropKeyProvider,
|
|
|
6743
6730
|
var AdvancedSettings = () => /* @__PURE__ */ React102.createElement(CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React102.createElement(Box24, { sx: { pt: 2 } }, /* @__PURE__ */ React102.createElement(Stack17, { gap: 2 }, /* @__PURE__ */ React102.createElement(FromNameField, null), /* @__PURE__ */ React102.createElement(ReplyToField, null), /* @__PURE__ */ React102.createElement(CcField, null), /* @__PURE__ */ React102.createElement(BccField, null), /* @__PURE__ */ React102.createElement(Divider5, null), /* @__PURE__ */ React102.createElement(MetaDataField, null), /* @__PURE__ */ React102.createElement(SendAsField, null))));
|
|
6744
6731
|
var EmailFormActionControl = createControl(() => {
|
|
6745
6732
|
const { value, setValue, ...propContext } = useBoundProp(emailPropTypeUtil);
|
|
6746
|
-
return /* @__PURE__ */ React102.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React102.createElement(Stack17, { gap: 2 }, /* @__PURE__ */ React102.createElement(
|
|
6733
|
+
return /* @__PURE__ */ React102.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React102.createElement(Stack17, { gap: 2 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, __51("Email settings", "elementor")), /* @__PURE__ */ React102.createElement(SendToField, null), /* @__PURE__ */ React102.createElement(SubjectField, null), /* @__PURE__ */ React102.createElement(MessageField, null), /* @__PURE__ */ React102.createElement(FromEmailField, null), /* @__PURE__ */ React102.createElement(AdvancedSettings, null)));
|
|
6747
6734
|
});
|
|
6748
6735
|
|
|
6749
|
-
// src/
|
|
6736
|
+
// src/controls/size-control/unstable-size-control.tsx
|
|
6737
|
+
import * as React108 from "react";
|
|
6738
|
+
import { sizePropTypeUtil as sizePropTypeUtil6 } from "@elementor/editor-props";
|
|
6739
|
+
|
|
6740
|
+
// src/controls/size-control/size-component.tsx
|
|
6741
|
+
import * as React107 from "react";
|
|
6742
|
+
import { useEffect as useEffect15 } from "react";
|
|
6743
|
+
import { useActiveBreakpoint as useActiveBreakpoint4 } from "@elementor/editor-responsive";
|
|
6744
|
+
import { Box as Box25, usePopupState as usePopupState9 } from "@elementor/ui";
|
|
6745
|
+
|
|
6746
|
+
// src/controls/size-control/size-field.tsx
|
|
6747
|
+
import * as React105 from "react";
|
|
6748
|
+
import { MathFunctionIcon as MathFunctionIcon3 } from "@elementor/icons";
|
|
6749
|
+
import { InputAdornment as InputAdornment5 } from "@elementor/ui";
|
|
6750
|
+
|
|
6751
|
+
// src/controls/size-control/sync/get-units.ts
|
|
6752
|
+
var getLengthUnits = () => {
|
|
6753
|
+
return window.elementor?.config?.size_units?.length ?? [];
|
|
6754
|
+
};
|
|
6755
|
+
var getAngleUnits = () => {
|
|
6756
|
+
return window.elementor?.config?.size_units?.angle ?? [];
|
|
6757
|
+
};
|
|
6758
|
+
var getTimeUnits = () => {
|
|
6759
|
+
return window.elementor?.config?.size_units?.time ?? [];
|
|
6760
|
+
};
|
|
6761
|
+
var getExtendedUnits = () => {
|
|
6762
|
+
return window.elementor?.config?.size_units?.extended_units ?? [];
|
|
6763
|
+
};
|
|
6764
|
+
|
|
6765
|
+
// src/controls/size-control/utils/is-extended-unit.ts
|
|
6766
|
+
var isExtendedUnit = (unit) => {
|
|
6767
|
+
const extendedUnits = getExtendedUnits();
|
|
6768
|
+
return extendedUnits.includes(unit);
|
|
6769
|
+
};
|
|
6770
|
+
|
|
6771
|
+
// src/controls/size-control/hooks/use-size-unit-keyboard.tsx
|
|
6772
|
+
var UNIT_KEY_PATTERN = /^[a-zA-Z%]$/;
|
|
6773
|
+
var useSizeUnitKeyboard = ({ unit, units: units2, onUnitChange }) => {
|
|
6774
|
+
const { appendKey, startsWith } = useTypingBuffer();
|
|
6775
|
+
const onUnitKeyDown = (event) => {
|
|
6776
|
+
if (units2.length === 0) {
|
|
6777
|
+
return;
|
|
6778
|
+
}
|
|
6779
|
+
const { key, altKey, ctrlKey, metaKey } = event;
|
|
6780
|
+
if (altKey || ctrlKey || metaKey) {
|
|
6781
|
+
return;
|
|
6782
|
+
}
|
|
6783
|
+
if (isExtendedUnit(unit) && isNumericValue(key)) {
|
|
6784
|
+
const [defaultUnit] = units2;
|
|
6785
|
+
if (defaultUnit) {
|
|
6786
|
+
onUnitChange(defaultUnit);
|
|
6787
|
+
}
|
|
6788
|
+
return;
|
|
6789
|
+
}
|
|
6790
|
+
if (!UNIT_KEY_PATTERN.test(key)) {
|
|
6791
|
+
return;
|
|
6792
|
+
}
|
|
6793
|
+
event.preventDefault();
|
|
6794
|
+
const updatedBuffer = appendKey(key.toLowerCase());
|
|
6795
|
+
const matchedUnit = units2.find((u) => startsWith(u, updatedBuffer));
|
|
6796
|
+
if (matchedUnit) {
|
|
6797
|
+
onUnitChange(matchedUnit);
|
|
6798
|
+
}
|
|
6799
|
+
};
|
|
6800
|
+
return { onUnitKeyDown };
|
|
6801
|
+
};
|
|
6802
|
+
var isNumericValue = (value) => {
|
|
6803
|
+
if (typeof value === "number") {
|
|
6804
|
+
return !isNaN(value);
|
|
6805
|
+
}
|
|
6806
|
+
if (typeof value === "string") {
|
|
6807
|
+
return value.trim() !== "" && !isNaN(Number(value));
|
|
6808
|
+
}
|
|
6809
|
+
return false;
|
|
6810
|
+
};
|
|
6811
|
+
|
|
6812
|
+
// src/controls/size-control/hooks/use-size-value.ts
|
|
6813
|
+
import { useMemo as useMemo15 } from "react";
|
|
6814
|
+
|
|
6815
|
+
// src/controls/size-control/utils/resolve-size-value.ts
|
|
6816
|
+
var DEFAULT_SIZE2 = "";
|
|
6817
|
+
var EXTENDED_UNITS = {
|
|
6818
|
+
auto: "auto",
|
|
6819
|
+
custom: "custom"
|
|
6820
|
+
};
|
|
6821
|
+
var resolveSizeValue = (value, context) => {
|
|
6822
|
+
if (!value) {
|
|
6823
|
+
return value;
|
|
6824
|
+
}
|
|
6825
|
+
const { units: units2, defaultUnit } = context;
|
|
6826
|
+
const unit = resolveFallbackUnit(value.unit, units2, defaultUnit);
|
|
6827
|
+
if (unit === EXTENDED_UNITS.auto) {
|
|
6828
|
+
return { size: DEFAULT_SIZE2, unit };
|
|
6829
|
+
}
|
|
6830
|
+
if (unit === EXTENDED_UNITS.custom) {
|
|
6831
|
+
return { size: String(value.size ?? DEFAULT_SIZE2), unit };
|
|
6832
|
+
}
|
|
6833
|
+
return {
|
|
6834
|
+
size: sanitizeSize(value.size) ?? DEFAULT_SIZE2,
|
|
6835
|
+
unit
|
|
6836
|
+
};
|
|
6837
|
+
};
|
|
6838
|
+
var resolveSizeOnUnitChange = (size, unit) => {
|
|
6839
|
+
return isExtendedUnit(unit) ? DEFAULT_SIZE2 : size;
|
|
6840
|
+
};
|
|
6841
|
+
var createDefaultSizeValue = (units2, defaultUnit) => {
|
|
6842
|
+
let [unit] = units2;
|
|
6843
|
+
if (defaultUnit !== void 0) {
|
|
6844
|
+
unit = resolveFallbackUnit(defaultUnit, units2);
|
|
6845
|
+
}
|
|
6846
|
+
return { size: DEFAULT_SIZE2, unit };
|
|
6847
|
+
};
|
|
6848
|
+
var resolveFallbackUnit = (unit, units2, defaultUnit) => {
|
|
6849
|
+
if (units2.includes(unit)) {
|
|
6850
|
+
return unit;
|
|
6851
|
+
}
|
|
6852
|
+
if (defaultUnit && units2.includes(defaultUnit)) {
|
|
6853
|
+
return defaultUnit;
|
|
6854
|
+
}
|
|
6855
|
+
return units2[0] ?? "";
|
|
6856
|
+
};
|
|
6857
|
+
var sanitizeSize = (size) => {
|
|
6858
|
+
if (typeof size === "number" && isNaN(size)) {
|
|
6859
|
+
return DEFAULT_SIZE2;
|
|
6860
|
+
}
|
|
6861
|
+
return size;
|
|
6862
|
+
};
|
|
6863
|
+
|
|
6864
|
+
// src/controls/size-control/hooks/use-size-value.ts
|
|
6865
|
+
var useSizeValue = ({
|
|
6866
|
+
value,
|
|
6867
|
+
setValue,
|
|
6868
|
+
units: units2,
|
|
6869
|
+
defaultUnit
|
|
6870
|
+
}) => {
|
|
6871
|
+
const resolvedValue = useMemo15(
|
|
6872
|
+
() => resolveSizeValue(value, { units: units2, defaultUnit }),
|
|
6873
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6874
|
+
[value?.size, value?.unit, defaultUnit]
|
|
6875
|
+
);
|
|
6876
|
+
const [sizeValue, setSizeValue] = useSyncExternalState({
|
|
6877
|
+
external: resolvedValue,
|
|
6878
|
+
setExternal: (newState, options, meta) => {
|
|
6879
|
+
if (newState !== null) {
|
|
6880
|
+
setValue(newState, options, meta);
|
|
6881
|
+
}
|
|
6882
|
+
},
|
|
6883
|
+
persistWhen: (next) => hasChanged(next, resolvedValue),
|
|
6884
|
+
fallback: () => createDefaultSizeValue(units2, defaultUnit)
|
|
6885
|
+
});
|
|
6886
|
+
const setSize = (newSize, isInputValid = true) => {
|
|
6887
|
+
if (isExtendedUnit(sizeValue.unit)) {
|
|
6888
|
+
return;
|
|
6889
|
+
}
|
|
6890
|
+
const trimmed = newSize.trim();
|
|
6891
|
+
const parsed = Number(trimmed);
|
|
6892
|
+
const newState = {
|
|
6893
|
+
...sizeValue,
|
|
6894
|
+
size: trimmed && !isNaN(parsed) ? parsed : ""
|
|
6895
|
+
};
|
|
6896
|
+
setSizeValue(newState, void 0, { validation: () => isInputValid });
|
|
6897
|
+
};
|
|
6898
|
+
const setUnit = (unit) => {
|
|
6899
|
+
setSizeValue({ unit, size: resolveSizeOnUnitChange(sizeValue.size, unit) });
|
|
6900
|
+
};
|
|
6901
|
+
return {
|
|
6902
|
+
size: sizeValue.size,
|
|
6903
|
+
unit: sizeValue.unit,
|
|
6904
|
+
setSize,
|
|
6905
|
+
setUnit
|
|
6906
|
+
};
|
|
6907
|
+
};
|
|
6908
|
+
var hasChanged = (next, current) => {
|
|
6909
|
+
return next?.size !== current?.size || next?.unit !== current?.unit;
|
|
6910
|
+
};
|
|
6911
|
+
|
|
6912
|
+
// src/controls/size-control/ui/size-input.tsx
|
|
6913
|
+
import * as React103 from "react";
|
|
6914
|
+
import { forwardRef as forwardRef11 } from "react";
|
|
6915
|
+
var SizeInput2 = forwardRef11(
|
|
6916
|
+
({
|
|
6917
|
+
id,
|
|
6918
|
+
type,
|
|
6919
|
+
value,
|
|
6920
|
+
onBlur,
|
|
6921
|
+
onKeyUp,
|
|
6922
|
+
focused,
|
|
6923
|
+
disabled,
|
|
6924
|
+
onChange,
|
|
6925
|
+
onKeyDown,
|
|
6926
|
+
InputProps,
|
|
6927
|
+
inputProps,
|
|
6928
|
+
placeholder
|
|
6929
|
+
}, ref) => {
|
|
6930
|
+
return /* @__PURE__ */ React103.createElement(
|
|
6931
|
+
NumberInput,
|
|
6932
|
+
{
|
|
6933
|
+
id,
|
|
6934
|
+
ref,
|
|
6935
|
+
size: "tiny",
|
|
6936
|
+
fullWidth: true,
|
|
6937
|
+
type,
|
|
6938
|
+
value,
|
|
6939
|
+
placeholder,
|
|
6940
|
+
onKeyUp,
|
|
6941
|
+
focused,
|
|
6942
|
+
disabled,
|
|
6943
|
+
onKeyDown,
|
|
6944
|
+
onInput: onChange,
|
|
6945
|
+
onBlur,
|
|
6946
|
+
InputProps,
|
|
6947
|
+
inputProps,
|
|
6948
|
+
sx: getCursorStyle(InputProps?.readOnly ?? false)
|
|
6949
|
+
}
|
|
6950
|
+
);
|
|
6951
|
+
}
|
|
6952
|
+
);
|
|
6953
|
+
var getCursorStyle = (readOnly) => ({
|
|
6954
|
+
input: { cursor: readOnly ? "default !important" : void 0 }
|
|
6955
|
+
});
|
|
6956
|
+
|
|
6957
|
+
// src/controls/size-control/ui/unit-selector.tsx
|
|
6750
6958
|
import * as React104 from "react";
|
|
6751
|
-
import {
|
|
6959
|
+
import { useId as useId3 } from "react";
|
|
6960
|
+
import { MenuListItem as MenuListItem7 } from "@elementor/editor-ui";
|
|
6961
|
+
import { bindMenu as bindMenu2, bindTrigger as bindTrigger6, Button as Button6, Menu as Menu3, styled as styled9, usePopupState as usePopupState8 } from "@elementor/ui";
|
|
6962
|
+
var menuItemContentStyles = {
|
|
6963
|
+
display: "flex",
|
|
6964
|
+
flexDirection: "column",
|
|
6965
|
+
justifyContent: "center"
|
|
6966
|
+
};
|
|
6967
|
+
var UnitSelector = ({
|
|
6968
|
+
value,
|
|
6969
|
+
isActive,
|
|
6970
|
+
onSelect,
|
|
6971
|
+
options,
|
|
6972
|
+
disabled,
|
|
6973
|
+
menuItemsAttributes = {},
|
|
6974
|
+
optionLabelOverrides = {}
|
|
6975
|
+
}) => {
|
|
6976
|
+
const popupState = usePopupState8({
|
|
6977
|
+
variant: "popover",
|
|
6978
|
+
popupId: useId3()
|
|
6979
|
+
});
|
|
6980
|
+
const handleMenuItemClick = (option) => {
|
|
6981
|
+
onSelect(option);
|
|
6982
|
+
popupState.close();
|
|
6983
|
+
};
|
|
6984
|
+
return /* @__PURE__ */ React104.createElement(React104.Fragment, null, /* @__PURE__ */ React104.createElement(StyledButton2, { isActive, disabled, size: "small", ...bindTrigger6(popupState) }, optionLabelOverrides[value] ?? value), /* @__PURE__ */ React104.createElement(Menu3, { MenuListProps: { dense: true }, ...bindMenu2(popupState) }, options.map((option) => /* @__PURE__ */ React104.createElement(
|
|
6985
|
+
MenuListItem7,
|
|
6986
|
+
{
|
|
6987
|
+
key: option,
|
|
6988
|
+
onClick: () => handleMenuItemClick(option),
|
|
6989
|
+
...menuItemsAttributes?.[option],
|
|
6990
|
+
primaryTypographyProps: {
|
|
6991
|
+
variant: "caption",
|
|
6992
|
+
sx: {
|
|
6993
|
+
...menuItemContentStyles,
|
|
6994
|
+
lineHeight: "1"
|
|
6995
|
+
}
|
|
6996
|
+
},
|
|
6997
|
+
menuItemTextProps: {
|
|
6998
|
+
sx: menuItemContentStyles
|
|
6999
|
+
}
|
|
7000
|
+
},
|
|
7001
|
+
optionLabelOverrides[option] ?? option.toUpperCase()
|
|
7002
|
+
))));
|
|
7003
|
+
};
|
|
7004
|
+
var StyledButton2 = styled9(Button6, {
|
|
7005
|
+
shouldForwardProp: (prop) => prop !== "isActive"
|
|
7006
|
+
})(({ isActive, theme }) => ({
|
|
7007
|
+
color: isActive ? theme.palette.text.primary : theme.palette.text.tertiary,
|
|
7008
|
+
font: "inherit",
|
|
7009
|
+
minWidth: "initial",
|
|
7010
|
+
textTransform: "uppercase"
|
|
7011
|
+
}));
|
|
7012
|
+
|
|
7013
|
+
// src/controls/size-control/utils/has-size-value.ts
|
|
7014
|
+
var hasSizeValue = (size) => {
|
|
7015
|
+
return Boolean(size) || size === 0;
|
|
7016
|
+
};
|
|
7017
|
+
|
|
7018
|
+
// src/controls/size-control/size-field.tsx
|
|
7019
|
+
var UNIT_DISPLAY_LABELS_OVERRIDES = {
|
|
7020
|
+
custom: /* @__PURE__ */ React105.createElement(MathFunctionIcon3, { fontSize: "tiny" })
|
|
7021
|
+
};
|
|
7022
|
+
var SizeField = ({
|
|
7023
|
+
value,
|
|
7024
|
+
focused,
|
|
7025
|
+
disabled,
|
|
7026
|
+
InputProps,
|
|
7027
|
+
defaultUnit,
|
|
7028
|
+
placeholder,
|
|
7029
|
+
onUnitChange,
|
|
7030
|
+
startIcon,
|
|
7031
|
+
ariaLabel,
|
|
7032
|
+
onKeyDown,
|
|
7033
|
+
setValue,
|
|
7034
|
+
onBlur,
|
|
7035
|
+
units: units2,
|
|
7036
|
+
min,
|
|
7037
|
+
unitSelectorProps
|
|
7038
|
+
}) => {
|
|
7039
|
+
const { size, unit, setSize, setUnit } = useSizeValue({ value, setValue, units: units2, defaultUnit });
|
|
7040
|
+
const handleUnitChange = (newUnit) => {
|
|
7041
|
+
setUnit(newUnit);
|
|
7042
|
+
onUnitChange?.(newUnit);
|
|
7043
|
+
};
|
|
7044
|
+
const { onUnitKeyDown } = useSizeUnitKeyboard({ unit, onUnitChange: handleUnitChange, units: units2 });
|
|
7045
|
+
const handleKeyDown = (event) => {
|
|
7046
|
+
onUnitKeyDown(event);
|
|
7047
|
+
onKeyDown?.(event);
|
|
7048
|
+
};
|
|
7049
|
+
const handleChange = (event) => {
|
|
7050
|
+
const newSize = event.target.value;
|
|
7051
|
+
const isInputValid = event.target.validity.valid;
|
|
7052
|
+
setSize(newSize, isInputValid);
|
|
7053
|
+
};
|
|
7054
|
+
const inputType = isExtendedUnit(unit) ? "text" : "number";
|
|
7055
|
+
return /* @__PURE__ */ React105.createElement(
|
|
7056
|
+
SizeInput2,
|
|
7057
|
+
{
|
|
7058
|
+
disabled,
|
|
7059
|
+
focused,
|
|
7060
|
+
type: inputType,
|
|
7061
|
+
value: size,
|
|
7062
|
+
placeholder,
|
|
7063
|
+
onBlur,
|
|
7064
|
+
onKeyDown: handleKeyDown,
|
|
7065
|
+
onChange: handleChange,
|
|
7066
|
+
InputProps: {
|
|
7067
|
+
...InputProps,
|
|
7068
|
+
autoComplete: "off",
|
|
7069
|
+
readOnly: isExtendedUnit(unit),
|
|
7070
|
+
startAdornment: startIcon && /* @__PURE__ */ React105.createElement(InputAdornment5, { position: "start", disabled }, startIcon),
|
|
7071
|
+
endAdornment: /* @__PURE__ */ React105.createElement(InputAdornment5, { position: "end" }, /* @__PURE__ */ React105.createElement(
|
|
7072
|
+
UnitSelector,
|
|
7073
|
+
{
|
|
7074
|
+
options: units2,
|
|
7075
|
+
value: unit,
|
|
7076
|
+
onSelect: handleUnitChange,
|
|
7077
|
+
isActive: unitSelectorProps?.isActive ?? hasSizeValue(size),
|
|
7078
|
+
...unitSelectorProps,
|
|
7079
|
+
optionLabelOverrides: UNIT_DISPLAY_LABELS_OVERRIDES
|
|
7080
|
+
}
|
|
7081
|
+
))
|
|
7082
|
+
},
|
|
7083
|
+
inputProps: { min, step: "any", "arial-label": ariaLabel }
|
|
7084
|
+
}
|
|
7085
|
+
);
|
|
7086
|
+
};
|
|
7087
|
+
|
|
7088
|
+
// src/controls/size-control/ui/text-field-popover.tsx
|
|
7089
|
+
import * as React106 from "react";
|
|
7090
|
+
import { useEffect as useEffect14, useRef as useRef25 } from "react";
|
|
7091
|
+
import { PopoverHeader as PopoverHeader4 } from "@elementor/editor-ui";
|
|
7092
|
+
import { MathFunctionIcon as MathFunctionIcon4 } from "@elementor/icons";
|
|
7093
|
+
import { bindPopover as bindPopover7, Popover as Popover7, TextField as TextField9 } from "@elementor/ui";
|
|
7094
|
+
import { __ as __52 } from "@wordpress/i18n";
|
|
7095
|
+
var SIZE10 = "tiny";
|
|
7096
|
+
var TextFieldPopover2 = ({ popupState, anchorRef, value, onChange, onClose }) => {
|
|
7097
|
+
const inputRef = useRef25(null);
|
|
7098
|
+
useEffect14(() => {
|
|
7099
|
+
if (popupState.isOpen) {
|
|
7100
|
+
requestAnimationFrame(() => {
|
|
7101
|
+
if (inputRef.current) {
|
|
7102
|
+
inputRef.current.focus();
|
|
7103
|
+
}
|
|
7104
|
+
});
|
|
7105
|
+
}
|
|
7106
|
+
}, [popupState.isOpen]);
|
|
7107
|
+
const handleKeyDown = (event) => {
|
|
7108
|
+
if (event.key.toLowerCase() === "enter") {
|
|
7109
|
+
handleClose();
|
|
7110
|
+
}
|
|
7111
|
+
};
|
|
7112
|
+
const handleClose = () => {
|
|
7113
|
+
onClose?.();
|
|
7114
|
+
popupState.close();
|
|
7115
|
+
};
|
|
7116
|
+
return /* @__PURE__ */ React106.createElement(
|
|
7117
|
+
Popover7,
|
|
7118
|
+
{
|
|
7119
|
+
disablePortal: true,
|
|
7120
|
+
slotProps: {
|
|
7121
|
+
paper: {
|
|
7122
|
+
sx: {
|
|
7123
|
+
borderRadius: 2,
|
|
7124
|
+
width: anchorRef.current?.offsetWidth + "px"
|
|
7125
|
+
}
|
|
7126
|
+
}
|
|
7127
|
+
},
|
|
7128
|
+
...bindPopover7(popupState),
|
|
7129
|
+
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
7130
|
+
transformOrigin: { vertical: "top", horizontal: "center" },
|
|
7131
|
+
onClose: handleClose
|
|
7132
|
+
},
|
|
7133
|
+
/* @__PURE__ */ React106.createElement(
|
|
7134
|
+
PopoverHeader4,
|
|
7135
|
+
{
|
|
7136
|
+
title: __52("CSS function", "elementor"),
|
|
7137
|
+
onClose: handleClose,
|
|
7138
|
+
icon: /* @__PURE__ */ React106.createElement(MathFunctionIcon4, { fontSize: SIZE10 })
|
|
7139
|
+
}
|
|
7140
|
+
),
|
|
7141
|
+
/* @__PURE__ */ React106.createElement(
|
|
7142
|
+
TextField9,
|
|
7143
|
+
{
|
|
7144
|
+
value,
|
|
7145
|
+
onChange,
|
|
7146
|
+
onKeyDown: handleKeyDown,
|
|
7147
|
+
size: "tiny",
|
|
7148
|
+
type: "text",
|
|
7149
|
+
fullWidth: true,
|
|
7150
|
+
inputProps: {
|
|
7151
|
+
ref: inputRef
|
|
7152
|
+
},
|
|
7153
|
+
sx: { pt: 0, pr: 1.5, pb: 1.5, pl: 1.5 }
|
|
7154
|
+
}
|
|
7155
|
+
)
|
|
7156
|
+
);
|
|
7157
|
+
};
|
|
7158
|
+
|
|
7159
|
+
// src/controls/size-control/size-component.tsx
|
|
7160
|
+
var SizeComponent = ({
|
|
7161
|
+
anchorRef,
|
|
7162
|
+
isUnitActive,
|
|
7163
|
+
SizeFieldWrapper = React107.Fragment,
|
|
7164
|
+
...sizeFieldProps
|
|
7165
|
+
}) => {
|
|
7166
|
+
const popupState = usePopupState9({ variant: "popover" });
|
|
7167
|
+
const activeBreakpoint = useActiveBreakpoint4();
|
|
7168
|
+
const isCustomUnit = sizeFieldProps?.value?.unit === EXTENDED_UNITS.custom;
|
|
7169
|
+
const hasCustomUnitOption = sizeFieldProps.units.includes(EXTENDED_UNITS.custom);
|
|
7170
|
+
useEffect15(() => {
|
|
7171
|
+
if (popupState && popupState.isOpen) {
|
|
7172
|
+
popupState.close();
|
|
7173
|
+
}
|
|
7174
|
+
}, [activeBreakpoint]);
|
|
7175
|
+
const handleCustomSizeChange = (event) => {
|
|
7176
|
+
sizeFieldProps.setValue({
|
|
7177
|
+
size: event.target.value,
|
|
7178
|
+
unit: EXTENDED_UNITS.custom
|
|
7179
|
+
});
|
|
7180
|
+
};
|
|
7181
|
+
const handleSizeFieldClick = (event) => {
|
|
7182
|
+
if (event.target.closest("input") && isCustomUnit) {
|
|
7183
|
+
popupState.open(anchorRef?.current);
|
|
7184
|
+
}
|
|
7185
|
+
};
|
|
7186
|
+
const handleUnitChange = (unit) => {
|
|
7187
|
+
if (unit === EXTENDED_UNITS.custom && anchorRef?.current) {
|
|
7188
|
+
popupState.open(anchorRef.current);
|
|
7189
|
+
}
|
|
7190
|
+
};
|
|
7191
|
+
const popupAttributes = {
|
|
7192
|
+
"aria-controls": popupState.isOpen ? popupState.popupId : void 0,
|
|
7193
|
+
"aria-haspopup": true
|
|
7194
|
+
};
|
|
7195
|
+
return /* @__PURE__ */ React107.createElement(React107.Fragment, null, /* @__PURE__ */ React107.createElement(SizeFieldWrapper, null, /* @__PURE__ */ React107.createElement(Box25, null, /* @__PURE__ */ React107.createElement(
|
|
7196
|
+
SizeField,
|
|
7197
|
+
{
|
|
7198
|
+
focused: popupState.isOpen ? true : void 0,
|
|
7199
|
+
onUnitChange: handleUnitChange,
|
|
7200
|
+
InputProps: {
|
|
7201
|
+
...popupAttributes,
|
|
7202
|
+
onClick: handleSizeFieldClick
|
|
7203
|
+
},
|
|
7204
|
+
unitSelectorProps: {
|
|
7205
|
+
menuItemsAttributes: hasCustomUnitOption ? { custom: popupAttributes } : void 0,
|
|
7206
|
+
isActive: isUnitActive
|
|
7207
|
+
},
|
|
7208
|
+
...sizeFieldProps
|
|
7209
|
+
}
|
|
7210
|
+
))), popupState.isOpen && anchorRef?.current && /* @__PURE__ */ React107.createElement(
|
|
7211
|
+
TextFieldPopover2,
|
|
7212
|
+
{
|
|
7213
|
+
popupState,
|
|
7214
|
+
anchorRef,
|
|
7215
|
+
value: String(sizeFieldProps?.value?.size ?? ""),
|
|
7216
|
+
onChange: handleCustomSizeChange,
|
|
7217
|
+
onClose: () => {
|
|
7218
|
+
}
|
|
7219
|
+
}
|
|
7220
|
+
));
|
|
7221
|
+
};
|
|
7222
|
+
|
|
7223
|
+
// src/controls/size-control/utils/resolve-bound-prop-value.ts
|
|
7224
|
+
import { sizePropTypeUtil as sizePropTypeUtil5 } from "@elementor/editor-props";
|
|
7225
|
+
var resolveBoundPropValue = (value, boundPropPlaceholder, propPlaceholder) => {
|
|
7226
|
+
let sizeValue = null;
|
|
7227
|
+
if (validateSizeValue(value)) {
|
|
7228
|
+
sizeValue = value;
|
|
7229
|
+
} else if (validateSizeValue(boundPropPlaceholder)) {
|
|
7230
|
+
sizeValue = { size: "", unit: boundPropPlaceholder?.unit };
|
|
7231
|
+
}
|
|
7232
|
+
return {
|
|
7233
|
+
sizeValue,
|
|
7234
|
+
isUnitHighlighted: shouldHighlightUnit(value),
|
|
7235
|
+
placeholder: resolvePlaceholder(propPlaceholder, boundPropPlaceholder)
|
|
7236
|
+
};
|
|
7237
|
+
};
|
|
7238
|
+
var validateSizeValue = (value) => {
|
|
7239
|
+
if (!value) {
|
|
7240
|
+
return false;
|
|
7241
|
+
}
|
|
7242
|
+
const sizePropValue = sizePropTypeUtil5.create(value);
|
|
7243
|
+
return sizePropTypeUtil5.isValid(sizePropValue);
|
|
7244
|
+
};
|
|
7245
|
+
var resolvePlaceholder = (propPlaceholder, boundPropPlaceholder) => {
|
|
7246
|
+
if (propPlaceholder) {
|
|
7247
|
+
return propPlaceholder;
|
|
7248
|
+
}
|
|
7249
|
+
const size = boundPropPlaceholder?.size;
|
|
7250
|
+
if (size === void 0) {
|
|
7251
|
+
return void 0;
|
|
7252
|
+
}
|
|
7253
|
+
if (typeof size === "number") {
|
|
7254
|
+
return size.toString();
|
|
7255
|
+
}
|
|
7256
|
+
return size;
|
|
7257
|
+
};
|
|
7258
|
+
var shouldHighlightUnit = (value) => {
|
|
7259
|
+
if (!value) {
|
|
7260
|
+
return false;
|
|
7261
|
+
}
|
|
7262
|
+
if (value.unit === EXTENDED_UNITS.auto) {
|
|
7263
|
+
return true;
|
|
7264
|
+
}
|
|
7265
|
+
return hasSizeValue(value.size);
|
|
7266
|
+
};
|
|
7267
|
+
|
|
7268
|
+
// src/controls/size-control/utils/settings/get-prop-type-settings.ts
|
|
7269
|
+
var getPropTypeSettings = (propType) => {
|
|
7270
|
+
return propType.settings;
|
|
7271
|
+
};
|
|
7272
|
+
|
|
7273
|
+
// src/controls/size-control/utils/settings/get-default-unit.ts
|
|
7274
|
+
var getDefaultUnit = (propType) => {
|
|
7275
|
+
return getPropTypeSettings(propType)?.default_unit;
|
|
7276
|
+
};
|
|
7277
|
+
|
|
7278
|
+
// src/controls/size-control/utils/settings/get-size-units.ts
|
|
7279
|
+
var getVariantUnits = (variant) => {
|
|
7280
|
+
const map = {
|
|
7281
|
+
length: getLengthUnits,
|
|
7282
|
+
angle: getAngleUnits,
|
|
7283
|
+
time: getTimeUnits
|
|
7284
|
+
};
|
|
7285
|
+
return map[variant]();
|
|
7286
|
+
};
|
|
7287
|
+
var getSettingsUnits = (propType) => {
|
|
7288
|
+
return getPropTypeSettings(propType)?.units;
|
|
7289
|
+
};
|
|
7290
|
+
var getSizeUnits = (propType, variant) => {
|
|
7291
|
+
return getSettingsUnits(propType) ?? getVariantUnits(variant);
|
|
7292
|
+
};
|
|
7293
|
+
|
|
7294
|
+
// src/controls/size-control/utils/should-nullify-value.ts
|
|
7295
|
+
var conditions = [
|
|
7296
|
+
(value) => value?.size === null || value?.size === void 0 || value?.size === "",
|
|
7297
|
+
(value) => value?.unit !== EXTENDED_UNITS.auto,
|
|
7298
|
+
(value) => value?.unit !== EXTENDED_UNITS.custom
|
|
7299
|
+
];
|
|
7300
|
+
var shouldNullifyValue = (value) => {
|
|
7301
|
+
return conditions.every((condition) => condition(value));
|
|
7302
|
+
};
|
|
7303
|
+
|
|
7304
|
+
// src/controls/size-control/unstable-size-control.tsx
|
|
7305
|
+
var UnstableSizeControl = createControl(
|
|
7306
|
+
({ variant = "length", placeholder: propPlaceholder, anchorRef, startIcon, ariaLabel, min }) => {
|
|
7307
|
+
const {
|
|
7308
|
+
value,
|
|
7309
|
+
setValue,
|
|
7310
|
+
propType,
|
|
7311
|
+
placeholder: boundPropPlaceholder,
|
|
7312
|
+
restoreValue
|
|
7313
|
+
} = useBoundProp(sizePropTypeUtil6);
|
|
7314
|
+
const { sizeValue, isUnitHighlighted, placeholder } = resolveBoundPropValue(
|
|
7315
|
+
value,
|
|
7316
|
+
boundPropPlaceholder,
|
|
7317
|
+
propPlaceholder
|
|
7318
|
+
);
|
|
7319
|
+
const units2 = getSizeUnits(propType, variant);
|
|
7320
|
+
const defaultUnit = getDefaultUnit(propType);
|
|
7321
|
+
const handleBlur = () => {
|
|
7322
|
+
const isRequired = propType.settings.required;
|
|
7323
|
+
if (shouldNullifyValue(value) && !isRequired) {
|
|
7324
|
+
setValue(null);
|
|
7325
|
+
}
|
|
7326
|
+
if (isRequired) {
|
|
7327
|
+
restoreValue();
|
|
7328
|
+
}
|
|
7329
|
+
};
|
|
7330
|
+
const handleChange = (newValue, options, meta) => {
|
|
7331
|
+
setValue(newValue, options, {
|
|
7332
|
+
...meta,
|
|
7333
|
+
validation: () => {
|
|
7334
|
+
if (propType.settings.required) {
|
|
7335
|
+
return newValue.size !== "";
|
|
7336
|
+
}
|
|
7337
|
+
return meta?.validation ? meta.validation(newValue) : true;
|
|
7338
|
+
}
|
|
7339
|
+
});
|
|
7340
|
+
};
|
|
7341
|
+
return /* @__PURE__ */ React108.createElement(
|
|
7342
|
+
SizeComponent,
|
|
7343
|
+
{
|
|
7344
|
+
units: units2,
|
|
7345
|
+
value: sizeValue,
|
|
7346
|
+
anchorRef,
|
|
7347
|
+
placeholder,
|
|
7348
|
+
defaultUnit,
|
|
7349
|
+
isUnitActive: isUnitHighlighted,
|
|
7350
|
+
onBlur: handleBlur,
|
|
7351
|
+
setValue: handleChange,
|
|
7352
|
+
SizeFieldWrapper: ControlActions,
|
|
7353
|
+
startIcon,
|
|
7354
|
+
ariaLabel,
|
|
7355
|
+
min
|
|
7356
|
+
}
|
|
7357
|
+
);
|
|
7358
|
+
}
|
|
7359
|
+
);
|
|
7360
|
+
|
|
7361
|
+
// src/components/promotions/display-conditions-control.tsx
|
|
7362
|
+
import * as React110 from "react";
|
|
7363
|
+
import { useRef as useRef26 } from "react";
|
|
6752
7364
|
import { SitemapIcon } from "@elementor/icons";
|
|
6753
7365
|
import { IconButton as IconButton8, Stack as Stack18, Tooltip as Tooltip9 } from "@elementor/ui";
|
|
6754
|
-
import { __ as
|
|
7366
|
+
import { __ as __53 } from "@wordpress/i18n";
|
|
6755
7367
|
|
|
6756
7368
|
// src/components/promotions/promotion-trigger.tsx
|
|
6757
|
-
import * as
|
|
6758
|
-
import { forwardRef as
|
|
7369
|
+
import * as React109 from "react";
|
|
7370
|
+
import { forwardRef as forwardRef12, useCallback as useCallback4, useImperativeHandle, useState as useState17 } from "react";
|
|
6759
7371
|
import { PromotionChip as PromotionChip2, PromotionInfotip } from "@elementor/editor-ui";
|
|
6760
|
-
import { Box as
|
|
7372
|
+
import { Box as Box26 } from "@elementor/ui";
|
|
6761
7373
|
function getV4Promotion(key) {
|
|
6762
7374
|
return window.elementor?.config?.v4Promotions?.[key];
|
|
6763
7375
|
}
|
|
6764
|
-
var PromotionTrigger =
|
|
7376
|
+
var PromotionTrigger = forwardRef12(
|
|
6765
7377
|
({ promotionKey, children, trackingData }, ref) => {
|
|
6766
7378
|
const [isOpen, setIsOpen] = useState17(false);
|
|
6767
7379
|
const promotion = getV4Promotion(promotionKey);
|
|
@@ -6774,7 +7386,7 @@ var PromotionTrigger = forwardRef11(
|
|
|
6774
7386
|
});
|
|
6775
7387
|
}, [trackingData]);
|
|
6776
7388
|
useImperativeHandle(ref, () => ({ toggle }), [toggle]);
|
|
6777
|
-
return /* @__PURE__ */
|
|
7389
|
+
return /* @__PURE__ */ React109.createElement(React109.Fragment, null, promotion && /* @__PURE__ */ React109.createElement(
|
|
6778
7390
|
PromotionInfotip,
|
|
6779
7391
|
{
|
|
6780
7392
|
title: promotion.title,
|
|
@@ -6788,8 +7400,8 @@ var PromotionTrigger = forwardRef11(
|
|
|
6788
7400
|
},
|
|
6789
7401
|
onCtaClick: () => trackUpgradePromotionClick(trackingData)
|
|
6790
7402
|
},
|
|
6791
|
-
/* @__PURE__ */
|
|
6792
|
-
|
|
7403
|
+
/* @__PURE__ */ React109.createElement(
|
|
7404
|
+
Box26,
|
|
6793
7405
|
{
|
|
6794
7406
|
onClick: (e) => {
|
|
6795
7407
|
e.stopPropagation();
|
|
@@ -6797,18 +7409,18 @@ var PromotionTrigger = forwardRef11(
|
|
|
6797
7409
|
},
|
|
6798
7410
|
sx: { cursor: "pointer", display: "inline-flex" }
|
|
6799
7411
|
},
|
|
6800
|
-
children ?? /* @__PURE__ */
|
|
7412
|
+
children ?? /* @__PURE__ */ React109.createElement(PromotionChip2, null)
|
|
6801
7413
|
)
|
|
6802
7414
|
));
|
|
6803
7415
|
}
|
|
6804
7416
|
);
|
|
6805
7417
|
|
|
6806
7418
|
// src/components/promotions/display-conditions-control.tsx
|
|
6807
|
-
var ARIA_LABEL =
|
|
7419
|
+
var ARIA_LABEL = __53("Display Conditions", "elementor");
|
|
6808
7420
|
var TRACKING_DATA = { target_name: "display_conditions", location_l2: "general" };
|
|
6809
7421
|
var DisplayConditionsControl = createControl(() => {
|
|
6810
|
-
const triggerRef =
|
|
6811
|
-
return /* @__PURE__ */
|
|
7422
|
+
const triggerRef = useRef26(null);
|
|
7423
|
+
return /* @__PURE__ */ React110.createElement(
|
|
6812
7424
|
Stack18,
|
|
6813
7425
|
{
|
|
6814
7426
|
direction: "row",
|
|
@@ -6818,8 +7430,8 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
6818
7430
|
alignItems: "center"
|
|
6819
7431
|
}
|
|
6820
7432
|
},
|
|
6821
|
-
/* @__PURE__ */
|
|
6822
|
-
/* @__PURE__ */
|
|
7433
|
+
/* @__PURE__ */ React110.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions", trackingData: TRACKING_DATA }),
|
|
7434
|
+
/* @__PURE__ */ React110.createElement(Tooltip9, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React110.createElement(
|
|
6823
7435
|
IconButton8,
|
|
6824
7436
|
{
|
|
6825
7437
|
size: "tiny",
|
|
@@ -6832,22 +7444,22 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
6832
7444
|
borderRadius: 1
|
|
6833
7445
|
}
|
|
6834
7446
|
},
|
|
6835
|
-
/* @__PURE__ */
|
|
7447
|
+
/* @__PURE__ */ React110.createElement(SitemapIcon, { fontSize: "tiny", color: "disabled" })
|
|
6836
7448
|
))
|
|
6837
7449
|
);
|
|
6838
7450
|
});
|
|
6839
7451
|
|
|
6840
7452
|
// src/components/promotions/attributes-control.tsx
|
|
6841
|
-
import * as
|
|
6842
|
-
import { useRef as
|
|
7453
|
+
import * as React111 from "react";
|
|
7454
|
+
import { useRef as useRef27 } from "react";
|
|
6843
7455
|
import { PlusIcon as PlusIcon3 } from "@elementor/icons";
|
|
6844
7456
|
import { Stack as Stack19, Tooltip as Tooltip10 } from "@elementor/ui";
|
|
6845
|
-
import { __ as
|
|
6846
|
-
var ARIA_LABEL2 =
|
|
7457
|
+
import { __ as __54 } from "@wordpress/i18n";
|
|
7458
|
+
var ARIA_LABEL2 = __54("Attributes", "elementor");
|
|
6847
7459
|
var TRACKING_DATA2 = { target_name: "attributes", location_l2: "general" };
|
|
6848
7460
|
var AttributesControl = createControl(() => {
|
|
6849
|
-
const triggerRef =
|
|
6850
|
-
return /* @__PURE__ */
|
|
7461
|
+
const triggerRef = useRef27(null);
|
|
7462
|
+
return /* @__PURE__ */ React111.createElement(
|
|
6851
7463
|
Stack19,
|
|
6852
7464
|
{
|
|
6853
7465
|
direction: "row",
|
|
@@ -6857,8 +7469,8 @@ var AttributesControl = createControl(() => {
|
|
|
6857
7469
|
alignItems: "center"
|
|
6858
7470
|
}
|
|
6859
7471
|
},
|
|
6860
|
-
/* @__PURE__ */
|
|
6861
|
-
/* @__PURE__ */
|
|
7472
|
+
/* @__PURE__ */ React111.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes", trackingData: TRACKING_DATA2 }),
|
|
7473
|
+
/* @__PURE__ */ React111.createElement(Tooltip10, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React111.createElement(
|
|
6862
7474
|
PlusIcon3,
|
|
6863
7475
|
{
|
|
6864
7476
|
"aria-label": ARIA_LABEL2,
|
|
@@ -6872,30 +7484,30 @@ var AttributesControl = createControl(() => {
|
|
|
6872
7484
|
});
|
|
6873
7485
|
|
|
6874
7486
|
// src/components/icon-buttons/clear-icon-button.tsx
|
|
6875
|
-
import * as
|
|
7487
|
+
import * as React112 from "react";
|
|
6876
7488
|
import { BrushBigIcon } from "@elementor/icons";
|
|
6877
|
-
import { IconButton as IconButton9, styled as
|
|
6878
|
-
var CustomIconButton =
|
|
7489
|
+
import { IconButton as IconButton9, styled as styled10, Tooltip as Tooltip11 } from "@elementor/ui";
|
|
7490
|
+
var CustomIconButton = styled10(IconButton9)(({ theme }) => ({
|
|
6879
7491
|
width: theme.spacing(2.5),
|
|
6880
7492
|
height: theme.spacing(2.5)
|
|
6881
7493
|
}));
|
|
6882
|
-
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */
|
|
7494
|
+
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React112.createElement(Tooltip11, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React112.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React112.createElement(BrushBigIcon, { fontSize: size })));
|
|
6883
7495
|
|
|
6884
7496
|
// src/components/repeater/repeater.tsx
|
|
6885
|
-
import * as
|
|
6886
|
-
import { useEffect as
|
|
7497
|
+
import * as React113 from "react";
|
|
7498
|
+
import { useEffect as useEffect16, useState as useState18 } from "react";
|
|
6887
7499
|
import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, PlusIcon as PlusIcon4, XIcon as XIcon4 } from "@elementor/icons";
|
|
6888
7500
|
import {
|
|
6889
|
-
bindPopover as
|
|
6890
|
-
bindTrigger as
|
|
6891
|
-
Box as
|
|
7501
|
+
bindPopover as bindPopover8,
|
|
7502
|
+
bindTrigger as bindTrigger7,
|
|
7503
|
+
Box as Box27,
|
|
6892
7504
|
IconButton as IconButton10,
|
|
6893
7505
|
Infotip as Infotip4,
|
|
6894
7506
|
Tooltip as Tooltip12,
|
|
6895
|
-
usePopupState as
|
|
7507
|
+
usePopupState as usePopupState10
|
|
6896
7508
|
} from "@elementor/ui";
|
|
6897
|
-
import { __ as
|
|
6898
|
-
var
|
|
7509
|
+
import { __ as __55 } from "@wordpress/i18n";
|
|
7510
|
+
var SIZE11 = "tiny";
|
|
6899
7511
|
var EMPTY_OPEN_ITEM2 = -1;
|
|
6900
7512
|
var Repeater3 = ({
|
|
6901
7513
|
label,
|
|
@@ -6975,20 +7587,20 @@ var Repeater3 = ({
|
|
|
6975
7587
|
};
|
|
6976
7588
|
const isButtonDisabled = disabled || disableAddItemButton;
|
|
6977
7589
|
const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
|
|
6978
|
-
const addButton = /* @__PURE__ */
|
|
7590
|
+
const addButton = /* @__PURE__ */ React113.createElement(
|
|
6979
7591
|
IconButton10,
|
|
6980
7592
|
{
|
|
6981
|
-
size:
|
|
7593
|
+
size: SIZE11,
|
|
6982
7594
|
sx: {
|
|
6983
7595
|
ml: "auto"
|
|
6984
7596
|
},
|
|
6985
7597
|
disabled: isButtonDisabled,
|
|
6986
7598
|
onClick: addRepeaterItem,
|
|
6987
|
-
"aria-label":
|
|
7599
|
+
"aria-label": __55("Add item", "elementor")
|
|
6988
7600
|
},
|
|
6989
|
-
/* @__PURE__ */
|
|
7601
|
+
/* @__PURE__ */ React113.createElement(PlusIcon4, { fontSize: SIZE11 })
|
|
6990
7602
|
);
|
|
6991
|
-
return /* @__PURE__ */
|
|
7603
|
+
return /* @__PURE__ */ React113.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React113.createElement(RepeaterHeader, { label, adornment: ControlAdornments }, shouldShowInfotip ? /* @__PURE__ */ React113.createElement(
|
|
6992
7604
|
Infotip4,
|
|
6993
7605
|
{
|
|
6994
7606
|
placement: "right",
|
|
@@ -6996,20 +7608,20 @@ var Repeater3 = ({
|
|
|
6996
7608
|
color: "secondary",
|
|
6997
7609
|
slotProps: { popper: { sx: { width: 300 } } }
|
|
6998
7610
|
},
|
|
6999
|
-
/* @__PURE__ */
|
|
7000
|
-
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */
|
|
7611
|
+
/* @__PURE__ */ React113.createElement(Box27, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
|
|
7612
|
+
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React113.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
|
|
7001
7613
|
const index = uniqueKeys.indexOf(key);
|
|
7002
7614
|
const value = items2[index];
|
|
7003
7615
|
if (!value) {
|
|
7004
7616
|
return null;
|
|
7005
7617
|
}
|
|
7006
|
-
return /* @__PURE__ */
|
|
7618
|
+
return /* @__PURE__ */ React113.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React113.createElement(
|
|
7007
7619
|
RepeaterItem,
|
|
7008
7620
|
{
|
|
7009
7621
|
disabled,
|
|
7010
7622
|
propDisabled: value?.disabled,
|
|
7011
|
-
label: /* @__PURE__ */
|
|
7012
|
-
startIcon: /* @__PURE__ */
|
|
7623
|
+
label: /* @__PURE__ */ React113.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React113.createElement(itemSettings.Label, { value, index })),
|
|
7624
|
+
startIcon: /* @__PURE__ */ React113.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React113.createElement(itemSettings.Icon, { value })),
|
|
7013
7625
|
removeItem: () => removeRepeaterItem(index),
|
|
7014
7626
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
7015
7627
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
@@ -7021,7 +7633,7 @@ var Repeater3 = ({
|
|
|
7021
7633
|
actions: itemSettings.actions,
|
|
7022
7634
|
value
|
|
7023
7635
|
},
|
|
7024
|
-
(props) => /* @__PURE__ */
|
|
7636
|
+
(props) => /* @__PURE__ */ React113.createElement(
|
|
7025
7637
|
itemSettings.Content,
|
|
7026
7638
|
{
|
|
7027
7639
|
...props,
|
|
@@ -7051,27 +7663,27 @@ var RepeaterItem = ({
|
|
|
7051
7663
|
value
|
|
7052
7664
|
}) => {
|
|
7053
7665
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
7054
|
-
const duplicateLabel =
|
|
7055
|
-
const toggleLabel = propDisabled ?
|
|
7056
|
-
const removeLabel =
|
|
7057
|
-
return /* @__PURE__ */
|
|
7666
|
+
const duplicateLabel = __55("Duplicate", "elementor");
|
|
7667
|
+
const toggleLabel = propDisabled ? __55("Show", "elementor") : __55("Hide", "elementor");
|
|
7668
|
+
const removeLabel = __55("Remove", "elementor");
|
|
7669
|
+
return /* @__PURE__ */ React113.createElement(React113.Fragment, null, /* @__PURE__ */ React113.createElement(
|
|
7058
7670
|
RepeaterTag,
|
|
7059
7671
|
{
|
|
7060
7672
|
disabled,
|
|
7061
7673
|
label,
|
|
7062
7674
|
ref: setRef,
|
|
7063
|
-
"aria-label":
|
|
7064
|
-
...
|
|
7675
|
+
"aria-label": __55("Open item", "elementor"),
|
|
7676
|
+
...bindTrigger7(popoverState),
|
|
7065
7677
|
startIcon,
|
|
7066
|
-
actions: /* @__PURE__ */
|
|
7678
|
+
actions: /* @__PURE__ */ React113.createElement(React113.Fragment, null, showDuplicate && /* @__PURE__ */ React113.createElement(Tooltip12, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(IconButton10, { size: SIZE11, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React113.createElement(CopyIcon2, { fontSize: SIZE11 }))), showToggle && /* @__PURE__ */ React113.createElement(Tooltip12, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(IconButton10, { size: SIZE11, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React113.createElement(EyeOffIcon2, { fontSize: SIZE11 }) : /* @__PURE__ */ React113.createElement(EyeIcon2, { fontSize: SIZE11 }))), actions?.(value), showRemove && /* @__PURE__ */ React113.createElement(Tooltip12, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React113.createElement(IconButton10, { size: SIZE11, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React113.createElement(XIcon4, { fontSize: SIZE11 }))))
|
|
7067
7679
|
}
|
|
7068
|
-
), /* @__PURE__ */
|
|
7680
|
+
), /* @__PURE__ */ React113.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React113.createElement(Box27, null, children({ anchorEl: ref }))));
|
|
7069
7681
|
};
|
|
7070
7682
|
var usePopover = (openOnMount, onOpen) => {
|
|
7071
7683
|
const [ref, setRef] = useState18(null);
|
|
7072
|
-
const popoverState =
|
|
7073
|
-
const popoverProps =
|
|
7074
|
-
|
|
7684
|
+
const popoverState = usePopupState10({ variant: "popover" });
|
|
7685
|
+
const popoverProps = bindPopover8(popoverState);
|
|
7686
|
+
useEffect16(() => {
|
|
7075
7687
|
if (openOnMount && ref) {
|
|
7076
7688
|
popoverState.open(ref);
|
|
7077
7689
|
onOpen?.();
|
|
@@ -7086,8 +7698,8 @@ var usePopover = (openOnMount, onOpen) => {
|
|
|
7086
7698
|
};
|
|
7087
7699
|
|
|
7088
7700
|
// src/components/inline-editor-toolbar.tsx
|
|
7089
|
-
import * as
|
|
7090
|
-
import { useMemo as
|
|
7701
|
+
import * as React115 from "react";
|
|
7702
|
+
import { useMemo as useMemo16, useRef as useRef29, useState as useState19 } from "react";
|
|
7091
7703
|
import { getContainer, getElementSetting } from "@elementor/editor-elements";
|
|
7092
7704
|
import {
|
|
7093
7705
|
BoldIcon,
|
|
@@ -7100,23 +7712,23 @@ import {
|
|
|
7100
7712
|
UnderlineIcon
|
|
7101
7713
|
} from "@elementor/icons";
|
|
7102
7714
|
import {
|
|
7103
|
-
Box as
|
|
7715
|
+
Box as Box28,
|
|
7104
7716
|
IconButton as IconButton11,
|
|
7105
7717
|
ToggleButton as ToggleButton3,
|
|
7106
7718
|
ToggleButtonGroup as ToggleButtonGroup2,
|
|
7107
7719
|
toggleButtonGroupClasses,
|
|
7108
7720
|
Tooltip as Tooltip14,
|
|
7109
|
-
usePopupState as
|
|
7721
|
+
usePopupState as usePopupState11
|
|
7110
7722
|
} from "@elementor/ui";
|
|
7111
7723
|
import { useEditorState } from "@tiptap/react";
|
|
7112
|
-
import { __ as
|
|
7724
|
+
import { __ as __57 } from "@wordpress/i18n";
|
|
7113
7725
|
|
|
7114
7726
|
// src/components/url-popover.tsx
|
|
7115
|
-
import * as
|
|
7116
|
-
import { useEffect as
|
|
7727
|
+
import * as React114 from "react";
|
|
7728
|
+
import { useEffect as useEffect17, useRef as useRef28 } from "react";
|
|
7117
7729
|
import { ExternalLinkIcon } from "@elementor/icons";
|
|
7118
|
-
import { bindPopover as
|
|
7119
|
-
import { __ as
|
|
7730
|
+
import { bindPopover as bindPopover9, Popover as Popover8, Stack as Stack20, TextField as TextField10, ToggleButton as ToggleButton2, Tooltip as Tooltip13 } from "@elementor/ui";
|
|
7731
|
+
import { __ as __56 } from "@wordpress/i18n";
|
|
7120
7732
|
var UrlPopover = ({
|
|
7121
7733
|
popupState,
|
|
7122
7734
|
restoreValue,
|
|
@@ -7126,8 +7738,8 @@ var UrlPopover = ({
|
|
|
7126
7738
|
openInNewTab,
|
|
7127
7739
|
onToggleNewTab
|
|
7128
7740
|
}) => {
|
|
7129
|
-
const inputRef =
|
|
7130
|
-
|
|
7741
|
+
const inputRef = useRef28(null);
|
|
7742
|
+
useEffect17(() => {
|
|
7131
7743
|
if (popupState.isOpen) {
|
|
7132
7744
|
requestAnimationFrame(() => inputRef.current?.focus());
|
|
7133
7745
|
}
|
|
@@ -7136,41 +7748,41 @@ var UrlPopover = ({
|
|
|
7136
7748
|
restoreValue();
|
|
7137
7749
|
popupState.close();
|
|
7138
7750
|
};
|
|
7139
|
-
return /* @__PURE__ */
|
|
7140
|
-
|
|
7751
|
+
return /* @__PURE__ */ React114.createElement(
|
|
7752
|
+
Popover8,
|
|
7141
7753
|
{
|
|
7142
7754
|
slotProps: {
|
|
7143
7755
|
paper: { sx: { borderRadius: "16px", width: anchorRef.current?.offsetWidth + "px", marginTop: -1 } }
|
|
7144
7756
|
},
|
|
7145
|
-
...
|
|
7757
|
+
...bindPopover9(popupState),
|
|
7146
7758
|
anchorOrigin: { vertical: "top", horizontal: "left" },
|
|
7147
7759
|
transformOrigin: { vertical: "top", horizontal: "left" },
|
|
7148
7760
|
onClose: handleClose
|
|
7149
7761
|
},
|
|
7150
|
-
/* @__PURE__ */
|
|
7151
|
-
|
|
7762
|
+
/* @__PURE__ */ React114.createElement(Stack20, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React114.createElement(
|
|
7763
|
+
TextField10,
|
|
7152
7764
|
{
|
|
7153
7765
|
value,
|
|
7154
7766
|
onChange,
|
|
7155
7767
|
size: "tiny",
|
|
7156
7768
|
fullWidth: true,
|
|
7157
|
-
placeholder:
|
|
7769
|
+
placeholder: __56("Type a URL", "elementor"),
|
|
7158
7770
|
inputProps: { ref: inputRef },
|
|
7159
7771
|
color: "secondary",
|
|
7160
7772
|
InputProps: { sx: { borderRadius: "8px" } },
|
|
7161
7773
|
onKeyUp: (event) => event.key === "Enter" && handleClose()
|
|
7162
7774
|
}
|
|
7163
|
-
), /* @__PURE__ */
|
|
7775
|
+
), /* @__PURE__ */ React114.createElement(Tooltip13, { title: __56("Open in a new tab", "elementor") }, /* @__PURE__ */ React114.createElement(
|
|
7164
7776
|
ToggleButton2,
|
|
7165
7777
|
{
|
|
7166
7778
|
size: "tiny",
|
|
7167
7779
|
value: "newTab",
|
|
7168
7780
|
selected: openInNewTab,
|
|
7169
7781
|
onClick: onToggleNewTab,
|
|
7170
|
-
"aria-label":
|
|
7782
|
+
"aria-label": __56("Open in a new tab", "elementor"),
|
|
7171
7783
|
sx: { borderRadius: "8px" }
|
|
7172
7784
|
},
|
|
7173
|
-
/* @__PURE__ */
|
|
7785
|
+
/* @__PURE__ */ React114.createElement(ExternalLinkIcon, { fontSize: "tiny" })
|
|
7174
7786
|
)))
|
|
7175
7787
|
);
|
|
7176
7788
|
};
|
|
@@ -7179,14 +7791,14 @@ var UrlPopover = ({
|
|
|
7179
7791
|
var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
7180
7792
|
const [urlValue, setUrlValue] = useState19("");
|
|
7181
7793
|
const [openInNewTab, setOpenInNewTab] = useState19(false);
|
|
7182
|
-
const toolbarRef =
|
|
7183
|
-
const linkPopupState =
|
|
7794
|
+
const toolbarRef = useRef29(null);
|
|
7795
|
+
const linkPopupState = usePopupState11({ variant: "popover" });
|
|
7184
7796
|
const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
|
|
7185
7797
|
const editorState = useEditorState({
|
|
7186
7798
|
editor,
|
|
7187
7799
|
selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
|
|
7188
7800
|
});
|
|
7189
|
-
const formatButtonsList =
|
|
7801
|
+
const formatButtonsList = useMemo16(() => {
|
|
7190
7802
|
const buttons = Object.values(formatButtons);
|
|
7191
7803
|
if (isElementClickable) {
|
|
7192
7804
|
return buttons.filter((button) => button.action !== "link");
|
|
@@ -7223,11 +7835,11 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7223
7835
|
}
|
|
7224
7836
|
linkPopupState.close();
|
|
7225
7837
|
};
|
|
7226
|
-
|
|
7838
|
+
React115.useEffect(() => {
|
|
7227
7839
|
editor?.commands?.focus();
|
|
7228
7840
|
}, [editor]);
|
|
7229
|
-
return /* @__PURE__ */
|
|
7230
|
-
|
|
7841
|
+
return /* @__PURE__ */ React115.createElement(
|
|
7842
|
+
Box28,
|
|
7231
7843
|
{
|
|
7232
7844
|
ref: toolbarRef,
|
|
7233
7845
|
sx: {
|
|
@@ -7243,8 +7855,8 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7243
7855
|
...sx
|
|
7244
7856
|
}
|
|
7245
7857
|
},
|
|
7246
|
-
/* @__PURE__ */
|
|
7247
|
-
/* @__PURE__ */
|
|
7858
|
+
/* @__PURE__ */ React115.createElement(Tooltip14, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React115.createElement(IconButton11, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
|
|
7859
|
+
/* @__PURE__ */ React115.createElement(
|
|
7248
7860
|
ToggleButtonGroup2,
|
|
7249
7861
|
{
|
|
7250
7862
|
value: editorState,
|
|
@@ -7266,7 +7878,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7266
7878
|
}
|
|
7267
7879
|
}
|
|
7268
7880
|
},
|
|
7269
|
-
formatButtonsList.map((button) => /* @__PURE__ */
|
|
7881
|
+
formatButtonsList.map((button) => /* @__PURE__ */ React115.createElement(Tooltip14, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React115.createElement(
|
|
7270
7882
|
ToggleButton3,
|
|
7271
7883
|
{
|
|
7272
7884
|
value: button.action,
|
|
@@ -7284,7 +7896,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
7284
7896
|
button.icon
|
|
7285
7897
|
)))
|
|
7286
7898
|
),
|
|
7287
|
-
/* @__PURE__ */
|
|
7899
|
+
/* @__PURE__ */ React115.createElement(
|
|
7288
7900
|
UrlPopover,
|
|
7289
7901
|
{
|
|
7290
7902
|
popupState: linkPopupState,
|
|
@@ -7307,64 +7919,64 @@ var checkIfElementIsClickable = (elementId) => {
|
|
|
7307
7919
|
};
|
|
7308
7920
|
var toolbarButtons = {
|
|
7309
7921
|
clear: {
|
|
7310
|
-
label:
|
|
7311
|
-
icon: /* @__PURE__ */
|
|
7922
|
+
label: __57("Clear", "elementor"),
|
|
7923
|
+
icon: /* @__PURE__ */ React115.createElement(MinusIcon2, { fontSize: "tiny" }),
|
|
7312
7924
|
action: "clear",
|
|
7313
7925
|
method: (editor) => {
|
|
7314
7926
|
editor.chain().focus().clearNodes().unsetAllMarks().run();
|
|
7315
7927
|
}
|
|
7316
7928
|
},
|
|
7317
7929
|
bold: {
|
|
7318
|
-
label:
|
|
7319
|
-
icon: /* @__PURE__ */
|
|
7930
|
+
label: __57("Bold", "elementor"),
|
|
7931
|
+
icon: /* @__PURE__ */ React115.createElement(BoldIcon, { fontSize: "tiny" }),
|
|
7320
7932
|
action: "bold",
|
|
7321
7933
|
method: (editor) => {
|
|
7322
7934
|
editor.chain().focus().toggleBold().run();
|
|
7323
7935
|
}
|
|
7324
7936
|
},
|
|
7325
7937
|
italic: {
|
|
7326
|
-
label:
|
|
7327
|
-
icon: /* @__PURE__ */
|
|
7938
|
+
label: __57("Italic", "elementor"),
|
|
7939
|
+
icon: /* @__PURE__ */ React115.createElement(ItalicIcon, { fontSize: "tiny" }),
|
|
7328
7940
|
action: "italic",
|
|
7329
7941
|
method: (editor) => {
|
|
7330
7942
|
editor.chain().focus().toggleItalic().run();
|
|
7331
7943
|
}
|
|
7332
7944
|
},
|
|
7333
7945
|
underline: {
|
|
7334
|
-
label:
|
|
7335
|
-
icon: /* @__PURE__ */
|
|
7946
|
+
label: __57("Underline", "elementor"),
|
|
7947
|
+
icon: /* @__PURE__ */ React115.createElement(UnderlineIcon, { fontSize: "tiny" }),
|
|
7336
7948
|
action: "underline",
|
|
7337
7949
|
method: (editor) => {
|
|
7338
7950
|
editor.chain().focus().toggleUnderline().run();
|
|
7339
7951
|
}
|
|
7340
7952
|
},
|
|
7341
7953
|
strike: {
|
|
7342
|
-
label:
|
|
7343
|
-
icon: /* @__PURE__ */
|
|
7954
|
+
label: __57("Strikethrough", "elementor"),
|
|
7955
|
+
icon: /* @__PURE__ */ React115.createElement(StrikethroughIcon, { fontSize: "tiny" }),
|
|
7344
7956
|
action: "strike",
|
|
7345
7957
|
method: (editor) => {
|
|
7346
7958
|
editor.chain().focus().toggleStrike().run();
|
|
7347
7959
|
}
|
|
7348
7960
|
},
|
|
7349
7961
|
superscript: {
|
|
7350
|
-
label:
|
|
7351
|
-
icon: /* @__PURE__ */
|
|
7962
|
+
label: __57("Superscript", "elementor"),
|
|
7963
|
+
icon: /* @__PURE__ */ React115.createElement(SuperscriptIcon, { fontSize: "tiny" }),
|
|
7352
7964
|
action: "superscript",
|
|
7353
7965
|
method: (editor) => {
|
|
7354
7966
|
editor.chain().focus().toggleSuperscript().run();
|
|
7355
7967
|
}
|
|
7356
7968
|
},
|
|
7357
7969
|
subscript: {
|
|
7358
|
-
label:
|
|
7359
|
-
icon: /* @__PURE__ */
|
|
7970
|
+
label: __57("Subscript", "elementor"),
|
|
7971
|
+
icon: /* @__PURE__ */ React115.createElement(SubscriptIcon, { fontSize: "tiny" }),
|
|
7360
7972
|
action: "subscript",
|
|
7361
7973
|
method: (editor) => {
|
|
7362
7974
|
editor.chain().focus().toggleSubscript().run();
|
|
7363
7975
|
}
|
|
7364
7976
|
},
|
|
7365
7977
|
link: {
|
|
7366
|
-
label:
|
|
7367
|
-
icon: /* @__PURE__ */
|
|
7978
|
+
label: __57("Link", "elementor"),
|
|
7979
|
+
icon: /* @__PURE__ */ React115.createElement(LinkIcon3, { fontSize: "tiny" }),
|
|
7368
7980
|
action: "link",
|
|
7369
7981
|
method: null
|
|
7370
7982
|
}
|
|
@@ -7373,13 +7985,13 @@ var { clear: clearButton, ...formatButtons } = toolbarButtons;
|
|
|
7373
7985
|
var possibleFormats = Object.keys(formatButtons);
|
|
7374
7986
|
|
|
7375
7987
|
// src/components/size/unstable-size-field.tsx
|
|
7376
|
-
import * as
|
|
7377
|
-
import { InputAdornment as
|
|
7988
|
+
import * as React118 from "react";
|
|
7989
|
+
import { InputAdornment as InputAdornment6 } from "@elementor/ui";
|
|
7378
7990
|
|
|
7379
7991
|
// src/hooks/use-size-value.ts
|
|
7380
7992
|
var DEFAULT_UNIT2 = "px";
|
|
7381
|
-
var
|
|
7382
|
-
var
|
|
7993
|
+
var DEFAULT_SIZE3 = "";
|
|
7994
|
+
var useSizeValue2 = (externalValue, onChange, defaultUnit) => {
|
|
7383
7995
|
const [sizeValue, setSizeValue] = useSyncExternalState({
|
|
7384
7996
|
external: externalValue,
|
|
7385
7997
|
setExternal: (newState) => {
|
|
@@ -7388,7 +8000,7 @@ var useSizeValue = (externalValue, onChange, defaultUnit) => {
|
|
|
7388
8000
|
}
|
|
7389
8001
|
},
|
|
7390
8002
|
persistWhen: (newState) => differsFromExternal(newState, externalValue),
|
|
7391
|
-
fallback: () => ({ size:
|
|
8003
|
+
fallback: () => ({ size: DEFAULT_SIZE3, unit: defaultUnit ?? DEFAULT_UNIT2 })
|
|
7392
8004
|
});
|
|
7393
8005
|
const setSize = (value) => {
|
|
7394
8006
|
const newState = {
|
|
@@ -7416,44 +8028,44 @@ var differsFromExternal = (newState, externalState) => {
|
|
|
7416
8028
|
};
|
|
7417
8029
|
|
|
7418
8030
|
// src/components/size/unit-select.tsx
|
|
7419
|
-
import * as
|
|
7420
|
-
import { useId as
|
|
7421
|
-
import { MenuListItem as
|
|
7422
|
-
import { bindMenu as
|
|
7423
|
-
var
|
|
8031
|
+
import * as React116 from "react";
|
|
8032
|
+
import { useId as useId4 } from "react";
|
|
8033
|
+
import { MenuListItem as MenuListItem8 } from "@elementor/editor-ui";
|
|
8034
|
+
import { bindMenu as bindMenu3, bindTrigger as bindTrigger8, Button as Button7, Menu as Menu4, styled as styled11, usePopupState as usePopupState12 } from "@elementor/ui";
|
|
8035
|
+
var menuItemContentStyles2 = {
|
|
7424
8036
|
display: "flex",
|
|
7425
8037
|
flexDirection: "column",
|
|
7426
8038
|
justifyContent: "center"
|
|
7427
8039
|
};
|
|
7428
8040
|
var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
|
|
7429
|
-
const popupState =
|
|
8041
|
+
const popupState = usePopupState12({
|
|
7430
8042
|
variant: "popover",
|
|
7431
|
-
popupId:
|
|
8043
|
+
popupId: useId4()
|
|
7432
8044
|
});
|
|
7433
8045
|
const handleMenuItemClick = (index) => {
|
|
7434
8046
|
onClick(options[index]);
|
|
7435
8047
|
popupState.close();
|
|
7436
8048
|
};
|
|
7437
|
-
return /* @__PURE__ */
|
|
7438
|
-
|
|
8049
|
+
return /* @__PURE__ */ React116.createElement(React116.Fragment, null, /* @__PURE__ */ React116.createElement(StyledButton3, { isPrimaryColor: showPrimaryColor, size: "small", ...bindTrigger8(popupState) }, value), /* @__PURE__ */ React116.createElement(Menu4, { MenuListProps: { dense: true }, ...bindMenu3(popupState) }, options.map((option, index) => /* @__PURE__ */ React116.createElement(
|
|
8050
|
+
MenuListItem8,
|
|
7439
8051
|
{
|
|
7440
8052
|
key: option,
|
|
7441
8053
|
onClick: () => handleMenuItemClick(index),
|
|
7442
8054
|
primaryTypographyProps: {
|
|
7443
8055
|
variant: "caption",
|
|
7444
8056
|
sx: {
|
|
7445
|
-
...
|
|
8057
|
+
...menuItemContentStyles2,
|
|
7446
8058
|
lineHeight: "1"
|
|
7447
8059
|
}
|
|
7448
8060
|
},
|
|
7449
8061
|
menuItemTextProps: {
|
|
7450
|
-
sx:
|
|
8062
|
+
sx: menuItemContentStyles2
|
|
7451
8063
|
}
|
|
7452
8064
|
},
|
|
7453
8065
|
option.toUpperCase()
|
|
7454
8066
|
))));
|
|
7455
8067
|
};
|
|
7456
|
-
var
|
|
8068
|
+
var StyledButton3 = styled11(Button7, {
|
|
7457
8069
|
shouldForwardProp: (prop) => prop !== "isPrimaryColor"
|
|
7458
8070
|
})(({ isPrimaryColor, theme }) => ({
|
|
7459
8071
|
color: isPrimaryColor ? theme.palette.text.primary : theme.palette.text.tertiary,
|
|
@@ -7463,11 +8075,11 @@ var StyledButton2 = styled10(Button6, {
|
|
|
7463
8075
|
}));
|
|
7464
8076
|
|
|
7465
8077
|
// src/components/size/unstable-size-input.tsx
|
|
7466
|
-
import * as
|
|
7467
|
-
import { forwardRef as
|
|
7468
|
-
var UnstableSizeInput =
|
|
8078
|
+
import * as React117 from "react";
|
|
8079
|
+
import { forwardRef as forwardRef13 } from "react";
|
|
8080
|
+
var UnstableSizeInput = forwardRef13(
|
|
7469
8081
|
({ type, value, onChange, onKeyDown, onKeyUp, InputProps, onBlur, focused, disabled }, ref) => {
|
|
7470
|
-
return /* @__PURE__ */
|
|
8082
|
+
return /* @__PURE__ */ React117.createElement(
|
|
7471
8083
|
NumberInput,
|
|
7472
8084
|
{
|
|
7473
8085
|
ref,
|
|
@@ -7482,12 +8094,12 @@ var UnstableSizeInput = forwardRef12(
|
|
|
7482
8094
|
onInput: onChange,
|
|
7483
8095
|
onBlur,
|
|
7484
8096
|
InputProps,
|
|
7485
|
-
sx:
|
|
8097
|
+
sx: getCursorStyle2(InputProps?.readOnly ?? false)
|
|
7486
8098
|
}
|
|
7487
8099
|
);
|
|
7488
8100
|
}
|
|
7489
8101
|
);
|
|
7490
|
-
var
|
|
8102
|
+
var getCursorStyle2 = (readOnly) => ({
|
|
7491
8103
|
input: { cursor: readOnly ? "default !important" : void 0 }
|
|
7492
8104
|
});
|
|
7493
8105
|
|
|
@@ -7501,11 +8113,11 @@ var UnstableSizeField = ({
|
|
|
7501
8113
|
defaultUnit,
|
|
7502
8114
|
startIcon
|
|
7503
8115
|
}) => {
|
|
7504
|
-
const { size, unit, setSize, setUnit } =
|
|
7505
|
-
const
|
|
8116
|
+
const { size, unit, setSize, setUnit } = useSizeValue2(value, onChange, defaultUnit);
|
|
8117
|
+
const shouldHighlightUnit2 = () => {
|
|
7506
8118
|
return hasValue(size);
|
|
7507
8119
|
};
|
|
7508
|
-
return /* @__PURE__ */
|
|
8120
|
+
return /* @__PURE__ */ React118.createElement(
|
|
7509
8121
|
UnstableSizeInput,
|
|
7510
8122
|
{
|
|
7511
8123
|
type: "number",
|
|
@@ -7514,14 +8126,14 @@ var UnstableSizeField = ({
|
|
|
7514
8126
|
onChange: (event) => setSize(event.target.value),
|
|
7515
8127
|
InputProps: {
|
|
7516
8128
|
...InputProps,
|
|
7517
|
-
startAdornment: startIcon && /* @__PURE__ */
|
|
7518
|
-
endAdornment: /* @__PURE__ */
|
|
8129
|
+
startAdornment: startIcon && /* @__PURE__ */ React118.createElement(InputAdornment6, { position: "start" }, startIcon),
|
|
8130
|
+
endAdornment: /* @__PURE__ */ React118.createElement(InputAdornment6, { position: "end" }, /* @__PURE__ */ React118.createElement(
|
|
7519
8131
|
UnitSelect,
|
|
7520
8132
|
{
|
|
7521
8133
|
options: units2,
|
|
7522
8134
|
value: unit,
|
|
7523
8135
|
onClick: setUnit,
|
|
7524
|
-
showPrimaryColor:
|
|
8136
|
+
showPrimaryColor: shouldHighlightUnit2()
|
|
7525
8137
|
}
|
|
7526
8138
|
))
|
|
7527
8139
|
}
|
|
@@ -7533,7 +8145,7 @@ var hasValue = (value) => {
|
|
|
7533
8145
|
};
|
|
7534
8146
|
|
|
7535
8147
|
// src/hooks/use-font-families.ts
|
|
7536
|
-
import { useMemo as
|
|
8148
|
+
import { useMemo as useMemo17 } from "react";
|
|
7537
8149
|
import { getElementorConfig } from "@elementor/editor-v1-adapters";
|
|
7538
8150
|
var getFontControlConfig = () => {
|
|
7539
8151
|
const { controls } = getElementorConfig();
|
|
@@ -7541,7 +8153,7 @@ var getFontControlConfig = () => {
|
|
|
7541
8153
|
};
|
|
7542
8154
|
var useFontFamilies = () => {
|
|
7543
8155
|
const { groups, options } = getFontControlConfig();
|
|
7544
|
-
return
|
|
8156
|
+
return useMemo17(() => {
|
|
7545
8157
|
if (!groups || !options) {
|
|
7546
8158
|
return [];
|
|
7547
8159
|
}
|
|
@@ -7606,6 +8218,7 @@ export {
|
|
|
7606
8218
|
Repeater3 as Repeater,
|
|
7607
8219
|
SelectControl,
|
|
7608
8220
|
SelectControlWrapper,
|
|
8221
|
+
SizeComponent,
|
|
7609
8222
|
SizeControl,
|
|
7610
8223
|
StrokeControl,
|
|
7611
8224
|
SvgMediaControl,
|
|
@@ -7617,6 +8230,7 @@ export {
|
|
|
7617
8230
|
TransformRepeaterControl,
|
|
7618
8231
|
TransformSettingsControl,
|
|
7619
8232
|
TransitionRepeaterControl,
|
|
8233
|
+
UnstableSizeControl,
|
|
7620
8234
|
UnstableSizeField,
|
|
7621
8235
|
UrlControl,
|
|
7622
8236
|
VideoMediaControl,
|