@elementor/editor-controls 4.3.0-953 → 4.3.0-955
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.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/hooks/use-query-autocomplete.ts +13 -5
package/dist/index.mjs
CHANGED
|
@@ -4187,7 +4187,7 @@ var UrlControl = createControl(
|
|
|
4187
4187
|
|
|
4188
4188
|
// src/controls/link-control.tsx
|
|
4189
4189
|
import * as React73 from "react";
|
|
4190
|
-
import { useEffect as
|
|
4190
|
+
import { useEffect as useEffect14, useState as useState12 } from "react";
|
|
4191
4191
|
import { getLinkInLinkRestriction } from "@elementor/editor-elements";
|
|
4192
4192
|
import { linkPropTypeUtil } from "@elementor/editor-props";
|
|
4193
4193
|
import { __privateUseListenTo as useListenTo, commandEndEvent } from "@elementor/editor-v1-adapters";
|
|
@@ -4415,7 +4415,7 @@ function factoryFilter(newValue, options, minInputLength) {
|
|
|
4415
4415
|
}
|
|
4416
4416
|
|
|
4417
4417
|
// src/hooks/use-query-autocomplete.ts
|
|
4418
|
-
import { useMemo as useMemo9, useState as useState11 } from "react";
|
|
4418
|
+
import { useEffect as useEffect13, useMemo as useMemo9, useState as useState11 } from "react";
|
|
4419
4419
|
import { numberPropTypeUtil as numberPropTypeUtil2, stringPropTypeUtil as stringPropTypeUtil8 } from "@elementor/editor-props";
|
|
4420
4420
|
import { httpService as httpService2 } from "@elementor/http-client";
|
|
4421
4421
|
import { debounce as debounce2 } from "@elementor/utils";
|
|
@@ -4439,12 +4439,19 @@ function useQueryAutocomplete({
|
|
|
4439
4439
|
),
|
|
4440
4440
|
[url, excludeIdSet]
|
|
4441
4441
|
);
|
|
4442
|
+
useEffect13(() => {
|
|
4443
|
+
if (minInputLength === 0 && url) {
|
|
4444
|
+
fetchOptions(url, { ...params, term: "" }).then((newOptions) => {
|
|
4445
|
+
setOptions(formatOptions(filterExcludedOptions(newOptions, excludeIdSet)));
|
|
4446
|
+
});
|
|
4447
|
+
}
|
|
4448
|
+
}, [url, minInputLength, excludeIdSet, params]);
|
|
4442
4449
|
const updateOptions = (term) => {
|
|
4443
|
-
|
|
4444
|
-
if (!
|
|
4450
|
+
const termStr = term ?? "";
|
|
4451
|
+
if (!url || termStr.length < minInputLength) {
|
|
4445
4452
|
return;
|
|
4446
4453
|
}
|
|
4447
|
-
debounceFetch({ ...params, term });
|
|
4454
|
+
debounceFetch({ ...params, term: termStr });
|
|
4448
4455
|
};
|
|
4449
4456
|
return { options, updateOptions };
|
|
4450
4457
|
}
|
|
@@ -4609,7 +4616,7 @@ var LinkControl = createControl((props) => {
|
|
|
4609
4616
|
},
|
|
4610
4617
|
[debouncedCheckRestriction]
|
|
4611
4618
|
);
|
|
4612
|
-
|
|
4619
|
+
useEffect14(() => {
|
|
4613
4620
|
debouncedCheckRestriction();
|
|
4614
4621
|
const handleInlineLinkChanged = () => {
|
|
4615
4622
|
debouncedCheckRestriction();
|
|
@@ -5162,7 +5169,7 @@ var Control4 = ({
|
|
|
5162
5169
|
|
|
5163
5170
|
// src/controls/aspect-ratio-control.tsx
|
|
5164
5171
|
import * as React79 from "react";
|
|
5165
|
-
import { useEffect as
|
|
5172
|
+
import { useEffect as useEffect15, useState as useState14 } from "react";
|
|
5166
5173
|
import { stringPropTypeUtil as stringPropTypeUtil13 } from "@elementor/editor-props";
|
|
5167
5174
|
import { MenuListItem as MenuListItem5 } from "@elementor/editor-ui";
|
|
5168
5175
|
import { ArrowsMoveHorizontalIcon, ArrowsMoveVerticalIcon } from "@elementor/icons";
|
|
@@ -5195,7 +5202,7 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
5195
5202
|
const [selectedValue, setSelectedValue] = useState14(
|
|
5196
5203
|
isCustomSelected ? CUSTOM_RATIO : aspectRatioValue || ""
|
|
5197
5204
|
);
|
|
5198
|
-
|
|
5205
|
+
useEffect15(() => {
|
|
5199
5206
|
const isCustomValue = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
5200
5207
|
if (isCustomValue) {
|
|
5201
5208
|
const [width, height] = aspectRatioValue.split("/");
|
|
@@ -7046,7 +7053,7 @@ var TransformBasePopoverTrigger = ({
|
|
|
7046
7053
|
|
|
7047
7054
|
// src/controls/transition-control/transition-repeater-control.tsx
|
|
7048
7055
|
import * as React108 from "react";
|
|
7049
|
-
import { useEffect as
|
|
7056
|
+
import { useEffect as useEffect16, useMemo as useMemo16, useState as useState18 } from "react";
|
|
7050
7057
|
import {
|
|
7051
7058
|
createArrayPropUtils as createArrayPropUtils3,
|
|
7052
7059
|
selectionSizePropTypeUtil as selectionSizePropTypeUtil2
|
|
@@ -7612,7 +7619,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
7612
7619
|
});
|
|
7613
7620
|
return set;
|
|
7614
7621
|
}, [proInstalled]);
|
|
7615
|
-
|
|
7622
|
+
useEffect16(() => {
|
|
7616
7623
|
if (!value || value.length === 0) {
|
|
7617
7624
|
return;
|
|
7618
7625
|
}
|
|
@@ -7624,7 +7631,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
7624
7631
|
setValue(sanitized);
|
|
7625
7632
|
}
|
|
7626
7633
|
}, [allowedTransitionSet]);
|
|
7627
|
-
|
|
7634
|
+
useEffect16(() => {
|
|
7628
7635
|
recentlyUsedListGetter().then(setRecentlyUsedList);
|
|
7629
7636
|
}, [recentlyUsedListGetter]);
|
|
7630
7637
|
const allPropertiesUsed = useMemo16(() => areAllPropertiesUsed(value), [value]);
|
|
@@ -7910,14 +7917,14 @@ var BoundTimeStringControl = ({ bind, ariaLabel }) => {
|
|
|
7910
7917
|
|
|
7911
7918
|
// src/controls/inline-editing-control.tsx
|
|
7912
7919
|
import * as React115 from "react";
|
|
7913
|
-
import { useCallback as useCallback4, useEffect as
|
|
7920
|
+
import { useCallback as useCallback4, useEffect as useEffect18, useMemo as useMemo17 } from "react";
|
|
7914
7921
|
import { htmlV3PropTypeUtil, parseHtmlChildren, stringPropTypeUtil as stringPropTypeUtil20 } from "@elementor/editor-props";
|
|
7915
7922
|
import { Box as Box25 } from "@elementor/ui";
|
|
7916
7923
|
import { debounce as debounce3 } from "@elementor/utils";
|
|
7917
7924
|
|
|
7918
7925
|
// src/components/inline-editor.tsx
|
|
7919
7926
|
import * as React114 from "react";
|
|
7920
|
-
import { useEffect as
|
|
7927
|
+
import { useEffect as useEffect17, useRef as useRef28 } from "react";
|
|
7921
7928
|
import { Box as Box24 } from "@elementor/ui";
|
|
7922
7929
|
import Bold from "@tiptap/extension-bold";
|
|
7923
7930
|
import Document from "@tiptap/extension-document";
|
|
@@ -8070,7 +8077,7 @@ var InlineEditor = React114.forwardRef((props, ref) => {
|
|
|
8070
8077
|
});
|
|
8071
8078
|
var useOnUpdate = (callback, dependencies) => {
|
|
8072
8079
|
const hasMounted = useRef28(false);
|
|
8073
|
-
|
|
8080
|
+
useEffect17(() => {
|
|
8074
8081
|
if (hasMounted.current) {
|
|
8075
8082
|
callback();
|
|
8076
8083
|
} else {
|
|
@@ -8110,7 +8117,7 @@ var InlineEditingControl = createControl(
|
|
|
8110
8117
|
},
|
|
8111
8118
|
[setValue, value?.children, debouncedParse]
|
|
8112
8119
|
);
|
|
8113
|
-
|
|
8120
|
+
useEffect18(() => () => debouncedParse.cancel(), [debouncedParse]);
|
|
8114
8121
|
return /* @__PURE__ */ React115.createElement(ControlActions, null, /* @__PURE__ */ React115.createElement(
|
|
8115
8122
|
Box25,
|
|
8116
8123
|
{
|
|
@@ -8627,7 +8634,7 @@ var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /*
|
|
|
8627
8634
|
|
|
8628
8635
|
// src/components/repeater/repeater.tsx
|
|
8629
8636
|
import * as React126 from "react";
|
|
8630
|
-
import { useEffect as
|
|
8637
|
+
import { useEffect as useEffect19, useState as useState21 } from "react";
|
|
8631
8638
|
import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, PlusIcon as PlusIcon5, XIcon as XIcon4 } from "@elementor/icons";
|
|
8632
8639
|
import {
|
|
8633
8640
|
bindPopover as bindPopover8,
|
|
@@ -8835,7 +8842,7 @@ var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
|
8835
8842
|
const [ref, setRef] = useState21(null);
|
|
8836
8843
|
const popoverState = usePopupState10({ variant: "popover" });
|
|
8837
8844
|
const popoverProps = bindPopover8(popoverState);
|
|
8838
|
-
|
|
8845
|
+
useEffect19(() => {
|
|
8839
8846
|
if (openOnMount && ref) {
|
|
8840
8847
|
popoverState.open(ref);
|
|
8841
8848
|
onOpen?.();
|
|
@@ -8855,7 +8862,7 @@ var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
|
8855
8862
|
|
|
8856
8863
|
// src/components/inline-editor-toolbar.tsx
|
|
8857
8864
|
import * as React128 from "react";
|
|
8858
|
-
import { useEffect as
|
|
8865
|
+
import { useEffect as useEffect21, useMemo as useMemo18, useRef as useRef32, useState as useState22 } from "react";
|
|
8859
8866
|
import { getContainer as getContainer3, getElementSetting } from "@elementor/editor-elements";
|
|
8860
8867
|
import {
|
|
8861
8868
|
BoldIcon,
|
|
@@ -8881,7 +8888,7 @@ import { __ as __64 } from "@wordpress/i18n";
|
|
|
8881
8888
|
|
|
8882
8889
|
// src/components/url-popover.tsx
|
|
8883
8890
|
import * as React127 from "react";
|
|
8884
|
-
import { useEffect as
|
|
8891
|
+
import { useEffect as useEffect20, useRef as useRef31 } from "react";
|
|
8885
8892
|
import { ExternalLinkIcon } from "@elementor/icons";
|
|
8886
8893
|
import { bindPopover as bindPopover9, Popover as Popover8, Stack as Stack23, TextField as TextField13, ToggleButton as ToggleButton2, Tooltip as Tooltip13 } from "@elementor/ui";
|
|
8887
8894
|
import { __ as __63 } from "@wordpress/i18n";
|
|
@@ -8895,7 +8902,7 @@ var UrlPopover = ({
|
|
|
8895
8902
|
onToggleNewTab
|
|
8896
8903
|
}) => {
|
|
8897
8904
|
const inputRef = useRef31(null);
|
|
8898
|
-
|
|
8905
|
+
useEffect20(() => {
|
|
8899
8906
|
if (popupState.isOpen) {
|
|
8900
8907
|
requestAnimationFrame(() => inputRef.current?.focus());
|
|
8901
8908
|
}
|
|
@@ -8991,7 +8998,7 @@ var InlineEditorToolbar = ({ editor, elementId, sx = {} }) => {
|
|
|
8991
8998
|
}
|
|
8992
8999
|
linkPopupState.close();
|
|
8993
9000
|
};
|
|
8994
|
-
|
|
9001
|
+
useEffect21(() => {
|
|
8995
9002
|
editor?.commands?.focus();
|
|
8996
9003
|
}, [editor]);
|
|
8997
9004
|
return /* @__PURE__ */ React128.createElement(
|