@elementor/editor-controls 3.35.0-437 → 3.35.0-439
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 +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +81 -55
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/controls/transform-control/transform-repeater-control.tsx +7 -1
- package/src/controls/transform-control/transform-settings-control.tsx +10 -4
- package/src/hooks/use-element-can-have-children.ts +17 -0
- package/src/index.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -4901,6 +4901,21 @@ import { AdjustmentsIcon as AdjustmentsIcon2, InfoCircleFilledIcon as InfoCircle
|
|
|
4901
4901
|
import { bindTrigger as bindTrigger4, Box as Box18, IconButton as IconButton7, Tooltip as Tooltip8, Typography as Typography6, usePopupState as usePopupState6 } from "@elementor/ui";
|
|
4902
4902
|
import { __ as __46 } from "@wordpress/i18n";
|
|
4903
4903
|
|
|
4904
|
+
// src/hooks/use-element-can-have-children.ts
|
|
4905
|
+
import { useMemo as useMemo11 } from "react";
|
|
4906
|
+
import { getContainer, useSelectedElement } from "@elementor/editor-elements";
|
|
4907
|
+
var useElementCanHaveChildren = () => {
|
|
4908
|
+
const { element } = useSelectedElement();
|
|
4909
|
+
const elementId = element?.id || "";
|
|
4910
|
+
return useMemo11(() => {
|
|
4911
|
+
const container = getContainer(elementId);
|
|
4912
|
+
if (!container) {
|
|
4913
|
+
return false;
|
|
4914
|
+
}
|
|
4915
|
+
return container.model.get("elType") !== "widget";
|
|
4916
|
+
}, [elementId]);
|
|
4917
|
+
};
|
|
4918
|
+
|
|
4904
4919
|
// src/controls/transform-control/initial-values.ts
|
|
4905
4920
|
import {
|
|
4906
4921
|
numberPropTypeUtil as numberPropTypeUtil4,
|
|
@@ -5380,7 +5395,8 @@ var ControlFields2 = ({ control }) => {
|
|
|
5380
5395
|
var SIZE7 = "tiny";
|
|
5381
5396
|
var TransformSettingsControl = ({
|
|
5382
5397
|
popupState,
|
|
5383
|
-
anchorRef
|
|
5398
|
+
anchorRef,
|
|
5399
|
+
showChildrenPerspective
|
|
5384
5400
|
}) => {
|
|
5385
5401
|
const popupProps = bindPopover5({
|
|
5386
5402
|
...popupState,
|
|
@@ -5410,7 +5426,7 @@ var TransformSettingsControl = ({
|
|
|
5410
5426
|
}
|
|
5411
5427
|
),
|
|
5412
5428
|
/* @__PURE__ */ React93.createElement(Divider4, null),
|
|
5413
|
-
/* @__PURE__ */ React93.createElement(PopoverContent, { sx: { px: 2, py: 1.5 } }, /* @__PURE__ */ React93.createElement(PropKeyProvider, { bind: "transform-origin" }, /* @__PURE__ */ React93.createElement(TransformOriginControl, null)), /* @__PURE__ */ React93.createElement(Box17, { sx: { my: 0.5 } }, /* @__PURE__ */ React93.createElement(Divider4, null)), /* @__PURE__ */ React93.createElement(ChildrenPerspectiveControl, null))
|
|
5429
|
+
/* @__PURE__ */ React93.createElement(PopoverContent, { sx: { px: 2, py: 1.5 } }, /* @__PURE__ */ React93.createElement(PropKeyProvider, { bind: "transform-origin" }, /* @__PURE__ */ React93.createElement(TransformOriginControl, null)), showChildrenPerspective && /* @__PURE__ */ React93.createElement(React93.Fragment, null, /* @__PURE__ */ React93.createElement(Box17, { sx: { my: 0.5 } }, /* @__PURE__ */ React93.createElement(Divider4, null)), /* @__PURE__ */ React93.createElement(ChildrenPerspectiveControl, null)))
|
|
5414
5430
|
);
|
|
5415
5431
|
};
|
|
5416
5432
|
|
|
@@ -5420,7 +5436,15 @@ var TransformRepeaterControl = createControl(() => {
|
|
|
5420
5436
|
const context = useBoundProp(transformPropTypeUtil);
|
|
5421
5437
|
const headerRef = useRef21(null);
|
|
5422
5438
|
const popupState = usePopupState6({ variant: "popover" });
|
|
5423
|
-
|
|
5439
|
+
const showChildrenPerspective = useElementCanHaveChildren();
|
|
5440
|
+
return /* @__PURE__ */ React94.createElement(PropProvider, { ...context }, /* @__PURE__ */ React94.createElement(
|
|
5441
|
+
TransformSettingsControl,
|
|
5442
|
+
{
|
|
5443
|
+
popupState,
|
|
5444
|
+
anchorRef: headerRef,
|
|
5445
|
+
showChildrenPerspective
|
|
5446
|
+
}
|
|
5447
|
+
), /* @__PURE__ */ React94.createElement(PropKeyProvider, { bind: "transform-functions" }, /* @__PURE__ */ React94.createElement(Repeater2, { headerRef, propType: context.propType, popupState })));
|
|
5424
5448
|
});
|
|
5425
5449
|
var ToolTip = /* @__PURE__ */ React94.createElement(
|
|
5426
5450
|
Box18,
|
|
@@ -5490,7 +5514,7 @@ var TransformBasePopoverTrigger = ({
|
|
|
5490
5514
|
|
|
5491
5515
|
// src/controls/transition-control/transition-repeater-control.tsx
|
|
5492
5516
|
import * as React97 from "react";
|
|
5493
|
-
import { useEffect as useEffect9, useMemo as
|
|
5517
|
+
import { useEffect as useEffect9, useMemo as useMemo13, useState as useState17 } from "react";
|
|
5494
5518
|
import {
|
|
5495
5519
|
createArrayPropUtils as createArrayPropUtils2,
|
|
5496
5520
|
selectionSizePropTypeUtil as selectionSizePropTypeUtil2
|
|
@@ -5501,7 +5525,7 @@ import { __ as __49 } from "@wordpress/i18n";
|
|
|
5501
5525
|
|
|
5502
5526
|
// src/controls/selection-size-control.tsx
|
|
5503
5527
|
import * as React95 from "react";
|
|
5504
|
-
import { useMemo as
|
|
5528
|
+
import { useMemo as useMemo12, useRef as useRef22 } from "react";
|
|
5505
5529
|
import { selectionSizePropTypeUtil } from "@elementor/editor-props";
|
|
5506
5530
|
import { Grid as Grid28 } from "@elementor/ui";
|
|
5507
5531
|
var SelectionSizeControl = createControl(
|
|
@@ -5509,7 +5533,7 @@ var SelectionSizeControl = createControl(
|
|
|
5509
5533
|
const { value, setValue, propType } = useBoundProp(selectionSizePropTypeUtil);
|
|
5510
5534
|
const rowRef = useRef22(null);
|
|
5511
5535
|
const sizeFieldId = sizeLabel.replace(/\s+/g, "-").toLowerCase();
|
|
5512
|
-
const currentSizeConfig =
|
|
5536
|
+
const currentSizeConfig = useMemo12(() => {
|
|
5513
5537
|
switch (value.selection.$$type) {
|
|
5514
5538
|
case "key-value":
|
|
5515
5539
|
return sizeConfigMap[value?.selection?.value.value.value || ""];
|
|
@@ -5818,8 +5842,8 @@ var TransitionRepeaterControl = createControl(
|
|
|
5818
5842
|
const currentStyleIsNormal = currentStyleState === null;
|
|
5819
5843
|
const [recentlyUsedList, setRecentlyUsedList] = useState17([]);
|
|
5820
5844
|
const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
5821
|
-
const disabledItems =
|
|
5822
|
-
const allowedTransitionSet =
|
|
5845
|
+
const disabledItems = useMemo13(() => getDisabledItemLabels(value), [value]);
|
|
5846
|
+
const allowedTransitionSet = useMemo13(() => {
|
|
5823
5847
|
const set = /* @__PURE__ */ new Set();
|
|
5824
5848
|
transitionProperties.forEach((category) => {
|
|
5825
5849
|
category.properties.forEach((prop) => set.add(prop.value));
|
|
@@ -5841,7 +5865,7 @@ var TransitionRepeaterControl = createControl(
|
|
|
5841
5865
|
useEffect9(() => {
|
|
5842
5866
|
recentlyUsedListGetter().then(setRecentlyUsedList);
|
|
5843
5867
|
}, [recentlyUsedListGetter]);
|
|
5844
|
-
const allPropertiesUsed =
|
|
5868
|
+
const allPropertiesUsed = useMemo13(() => areAllPropertiesUsed(value), [value]);
|
|
5845
5869
|
const isAddItemDisabled = !currentStyleIsNormal || allPropertiesUsed;
|
|
5846
5870
|
return /* @__PURE__ */ React97.createElement(
|
|
5847
5871
|
RepeatableControl,
|
|
@@ -5981,7 +6005,7 @@ function isEmpty(value = "") {
|
|
|
5981
6005
|
|
|
5982
6006
|
// src/components/inline-editor-toolbar.tsx
|
|
5983
6007
|
import * as React100 from "react";
|
|
5984
|
-
import { useMemo as
|
|
6008
|
+
import { useMemo as useMemo14, useRef as useRef25, useState as useState18 } from "react";
|
|
5985
6009
|
import { getElementSetting } from "@elementor/editor-elements";
|
|
5986
6010
|
import {
|
|
5987
6011
|
BoldIcon,
|
|
@@ -6147,7 +6171,7 @@ var InlineEditorToolbar = ({ editor, elementId }) => {
|
|
|
6147
6171
|
editor,
|
|
6148
6172
|
selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
|
|
6149
6173
|
});
|
|
6150
|
-
const formatButtonsList =
|
|
6174
|
+
const formatButtonsList = useMemo14(() => {
|
|
6151
6175
|
const buttons = Object.values(formatButtons);
|
|
6152
6176
|
if (hasLinkOnElement) {
|
|
6153
6177
|
return buttons.filter((button) => button.action !== "link");
|
|
@@ -6772,6 +6796,7 @@ export {
|
|
|
6772
6796
|
transitionsItemsList,
|
|
6773
6797
|
useBoundProp,
|
|
6774
6798
|
useControlActions,
|
|
6799
|
+
useElementCanHaveChildren,
|
|
6775
6800
|
useFloatingActionsBar,
|
|
6776
6801
|
useSyncExternalState
|
|
6777
6802
|
};
|