@elementor/editor-controls 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/dist/index.d.mts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +777 -629
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +617 -458
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/components/font-family-selector.tsx +54 -56
- package/src/components/repeater.tsx +22 -11
- package/src/components/size-control/size-input.tsx +4 -4
- package/src/controls/color-control.tsx +12 -1
- package/src/controls/filter-control/drop-shadow-item-content.tsx +69 -0
- package/src/controls/filter-control/drop-shadow-item-label.tsx +20 -0
- package/src/controls/filter-repeater-control.tsx +108 -21
- package/src/controls/key-value-control.tsx +57 -46
- package/src/controls/repeatable-control.tsx +48 -29
- package/src/controls/size-control.tsx +25 -12
- package/src/controls/text-control.tsx +33 -18
- package/src/utils/size-control.ts +4 -2
package/dist/index.mjs
CHANGED
|
@@ -289,7 +289,7 @@ import { styled, UnstableFloatingActionBar } from "@elementor/ui";
|
|
|
289
289
|
import * as React6 from "react";
|
|
290
290
|
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
291
291
|
var Context = createContext4(null);
|
|
292
|
-
var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */ React6.createElement(Context.Provider, { value: { items } }, children);
|
|
292
|
+
var ControlActionsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React6.createElement(Context.Provider, { value: { items: items2 } }, children);
|
|
293
293
|
var useControlActions = () => {
|
|
294
294
|
const context = useContext4(Context);
|
|
295
295
|
if (!context) {
|
|
@@ -311,12 +311,12 @@ var FloatingBarContainer = styled("span")`
|
|
|
311
311
|
}
|
|
312
312
|
`;
|
|
313
313
|
function ControlActions({ children }) {
|
|
314
|
-
const { items } = useControlActions();
|
|
314
|
+
const { items: items2 } = useControlActions();
|
|
315
315
|
const { disabled } = useBoundProp();
|
|
316
|
-
if (
|
|
316
|
+
if (items2.length === 0 || disabled) {
|
|
317
317
|
return children;
|
|
318
318
|
}
|
|
319
|
-
const menuItems =
|
|
319
|
+
const menuItems = items2.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React7.createElement(MenuItem2, { key: id }));
|
|
320
320
|
return /* @__PURE__ */ React7.createElement(FloatingBarContainer, null, /* @__PURE__ */ React7.createElement(UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
321
321
|
}
|
|
322
322
|
|
|
@@ -432,21 +432,31 @@ var ImageSizeControl = ({ sizes }) => {
|
|
|
432
432
|
import * as React11 from "react";
|
|
433
433
|
import { stringPropTypeUtil as stringPropTypeUtil2 } from "@elementor/editor-props";
|
|
434
434
|
import { TextField } from "@elementor/ui";
|
|
435
|
-
var TextControl = createControl(
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
435
|
+
var TextControl = createControl(
|
|
436
|
+
({
|
|
437
|
+
placeholder,
|
|
438
|
+
error,
|
|
439
|
+
inputValue,
|
|
440
|
+
inputDisabled,
|
|
441
|
+
sx
|
|
442
|
+
}) => {
|
|
443
|
+
const { value, setValue, disabled } = useBoundProp(stringPropTypeUtil2);
|
|
444
|
+
const handleChange = (event) => setValue(event.target.value);
|
|
445
|
+
return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
|
|
446
|
+
TextField,
|
|
447
|
+
{
|
|
448
|
+
size: "tiny",
|
|
449
|
+
fullWidth: true,
|
|
450
|
+
disabled: inputDisabled ?? disabled,
|
|
451
|
+
value: inputValue ?? value ?? "",
|
|
452
|
+
onChange: handleChange,
|
|
453
|
+
placeholder,
|
|
454
|
+
error,
|
|
455
|
+
sx
|
|
456
|
+
}
|
|
457
|
+
));
|
|
458
|
+
}
|
|
459
|
+
);
|
|
450
460
|
|
|
451
461
|
// src/controls/text-area-control.tsx
|
|
452
462
|
import * as React12 from "react";
|
|
@@ -772,12 +782,12 @@ var SizeControl = createControl((props) => {
|
|
|
772
782
|
return !!newState?.numeric || newState?.numeric === 0;
|
|
773
783
|
},
|
|
774
784
|
fallback: (newState) => ({
|
|
775
|
-
unit: newState?.unit ??
|
|
785
|
+
unit: newState?.unit ?? defaultUnit,
|
|
776
786
|
numeric: newState?.numeric ?? DEFAULT_SIZE,
|
|
777
787
|
custom: newState?.custom ?? ""
|
|
778
788
|
})
|
|
779
789
|
});
|
|
780
|
-
const { size: controlSize = DEFAULT_SIZE, unit: controlUnit =
|
|
790
|
+
const { size: controlSize = DEFAULT_SIZE, unit: controlUnit = defaultUnit } = extractValueFromState(state) || {};
|
|
781
791
|
const handleUnitChange = (newUnit) => {
|
|
782
792
|
if (newUnit === "custom") {
|
|
783
793
|
popupState.open(anchorRef?.current);
|
|
@@ -807,9 +817,13 @@ var SizeControl = createControl((props) => {
|
|
|
807
817
|
}
|
|
808
818
|
};
|
|
809
819
|
useEffect2(() => {
|
|
810
|
-
const newState = createStateFromSizeProp(sizeValue, defaultUnit);
|
|
811
|
-
const
|
|
812
|
-
const mergedStates = {
|
|
820
|
+
const newState = createStateFromSizeProp(sizeValue, state.unit === "custom" ? state.unit : defaultUnit);
|
|
821
|
+
const currentUnitType = isUnitExtendedOption(state.unit) ? "custom" : "numeric";
|
|
822
|
+
const mergedStates = {
|
|
823
|
+
...state,
|
|
824
|
+
unit: newState.unit ?? state.unit,
|
|
825
|
+
[currentUnitType]: newState[currentUnitType]
|
|
826
|
+
};
|
|
813
827
|
if (mergedStates.unit !== "auto" && areStatesEqual(state, mergedStates)) {
|
|
814
828
|
return;
|
|
815
829
|
}
|
|
@@ -911,7 +925,8 @@ import { colorPropTypeUtil } from "@elementor/editor-props";
|
|
|
911
925
|
import { UnstableColorField } from "@elementor/ui";
|
|
912
926
|
var ColorControl = createControl(
|
|
913
927
|
({ propTypeUtil = colorPropTypeUtil, anchorEl, slotProps = {}, ...props }) => {
|
|
914
|
-
const { value, setValue, disabled } = useBoundProp(propTypeUtil);
|
|
928
|
+
const { value, setValue, placeholder: boundPropPlaceholder, disabled } = useBoundProp(propTypeUtil);
|
|
929
|
+
const placeholder = props.placeholder ?? boundPropPlaceholder;
|
|
915
930
|
const handleChange = (selectedColor) => {
|
|
916
931
|
setValue(selectedColor || null);
|
|
917
932
|
};
|
|
@@ -921,6 +936,7 @@ var ColorControl = createControl(
|
|
|
921
936
|
size: "tiny",
|
|
922
937
|
fullWidth: true,
|
|
923
938
|
value: value ?? "",
|
|
939
|
+
placeholder: placeholder ?? "",
|
|
924
940
|
onChange: handleChange,
|
|
925
941
|
...props,
|
|
926
942
|
disabled,
|
|
@@ -935,6 +951,14 @@ var ColorControl = createControl(
|
|
|
935
951
|
transformOrigin: {
|
|
936
952
|
vertical: "top",
|
|
937
953
|
horizontal: -10
|
|
954
|
+
},
|
|
955
|
+
slotProps: {
|
|
956
|
+
colorIndicator: {
|
|
957
|
+
value: value ?? placeholder ?? ""
|
|
958
|
+
},
|
|
959
|
+
colorBox: {
|
|
960
|
+
value: value ?? placeholder ?? ""
|
|
961
|
+
}
|
|
938
962
|
}
|
|
939
963
|
}
|
|
940
964
|
}
|
|
@@ -997,7 +1021,7 @@ import * as React23 from "react";
|
|
|
997
1021
|
import * as React22 from "react";
|
|
998
1022
|
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
999
1023
|
var Context2 = createContext5(null);
|
|
1000
|
-
var ControlAdornmentsProvider = ({ children, items }) => /* @__PURE__ */ React22.createElement(Context2.Provider, { value: { items } }, children);
|
|
1024
|
+
var ControlAdornmentsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React22.createElement(Context2.Provider, { value: { items: items2 } }, children);
|
|
1001
1025
|
var useControlAdornments = () => {
|
|
1002
1026
|
const context = useContext5(Context2);
|
|
1003
1027
|
return context?.items ?? [];
|
|
@@ -1005,11 +1029,11 @@ var useControlAdornments = () => {
|
|
|
1005
1029
|
|
|
1006
1030
|
// src/control-adornments/control-adornments.tsx
|
|
1007
1031
|
function ControlAdornments() {
|
|
1008
|
-
const
|
|
1009
|
-
if (
|
|
1032
|
+
const items2 = useControlAdornments();
|
|
1033
|
+
if (items2?.length === 0) {
|
|
1010
1034
|
return null;
|
|
1011
1035
|
}
|
|
1012
|
-
return /* @__PURE__ */ React23.createElement(React23.Fragment, null,
|
|
1036
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, null, items2.map(({ Adornment, id }) => /* @__PURE__ */ React23.createElement(Adornment, { key: id })));
|
|
1013
1037
|
}
|
|
1014
1038
|
|
|
1015
1039
|
// src/locations.ts
|
|
@@ -1110,16 +1134,17 @@ var Repeater = ({
|
|
|
1110
1134
|
setValues: setRepeaterValues,
|
|
1111
1135
|
showDuplicate = true,
|
|
1112
1136
|
showToggle = true,
|
|
1113
|
-
isSortable = true
|
|
1137
|
+
isSortable = true,
|
|
1138
|
+
collectionPropUtil
|
|
1114
1139
|
}) => {
|
|
1115
1140
|
const [openItem, setOpenItem] = useState4(EMPTY_OPEN_ITEM);
|
|
1116
|
-
const [
|
|
1141
|
+
const [items2, setItems] = useSyncExternalState({
|
|
1117
1142
|
external: repeaterValues,
|
|
1118
1143
|
// @ts-expect-error - as long as persistWhen => true, value will never be null
|
|
1119
1144
|
setExternal: setRepeaterValues,
|
|
1120
1145
|
persistWhen: () => true
|
|
1121
1146
|
});
|
|
1122
|
-
const [uniqueKeys, setUniqueKeys] = useState4(
|
|
1147
|
+
const [uniqueKeys, setUniqueKeys] = useState4(items2.map((_, index) => index));
|
|
1123
1148
|
const generateNextKey = (source) => {
|
|
1124
1149
|
return 1 + Math.max(0, ...source);
|
|
1125
1150
|
};
|
|
@@ -1127,10 +1152,10 @@ var Repeater = ({
|
|
|
1127
1152
|
const newItem = structuredClone(itemSettings.initialValues);
|
|
1128
1153
|
const newKey = generateNextKey(uniqueKeys);
|
|
1129
1154
|
if (addToBottom) {
|
|
1130
|
-
setItems([...
|
|
1155
|
+
setItems([...items2, newItem]);
|
|
1131
1156
|
setUniqueKeys([...uniqueKeys, newKey]);
|
|
1132
1157
|
} else {
|
|
1133
|
-
setItems([newItem, ...
|
|
1158
|
+
setItems([newItem, ...items2]);
|
|
1134
1159
|
setUniqueKeys([newKey, ...uniqueKeys]);
|
|
1135
1160
|
}
|
|
1136
1161
|
if (openOnAdd) {
|
|
@@ -1138,10 +1163,10 @@ var Repeater = ({
|
|
|
1138
1163
|
}
|
|
1139
1164
|
};
|
|
1140
1165
|
const duplicateRepeaterItem = (index) => {
|
|
1141
|
-
const newItem = structuredClone(
|
|
1166
|
+
const newItem = structuredClone(items2[index]);
|
|
1142
1167
|
const newKey = generateNextKey(uniqueKeys);
|
|
1143
1168
|
const atPosition = 1 + index;
|
|
1144
|
-
setItems([...
|
|
1169
|
+
setItems([...items2.slice(0, atPosition), newItem, ...items2.slice(atPosition)]);
|
|
1145
1170
|
setUniqueKeys([...uniqueKeys.slice(0, atPosition), newKey, ...uniqueKeys.slice(atPosition)]);
|
|
1146
1171
|
};
|
|
1147
1172
|
const removeRepeaterItem = (index) => {
|
|
@@ -1151,14 +1176,14 @@ var Repeater = ({
|
|
|
1151
1176
|
})
|
|
1152
1177
|
);
|
|
1153
1178
|
setItems(
|
|
1154
|
-
|
|
1179
|
+
items2.filter((_, pos) => {
|
|
1155
1180
|
return pos !== index;
|
|
1156
1181
|
})
|
|
1157
1182
|
);
|
|
1158
1183
|
};
|
|
1159
1184
|
const toggleDisableRepeaterItem = (index) => {
|
|
1160
1185
|
setItems(
|
|
1161
|
-
|
|
1186
|
+
items2.map((value, pos) => {
|
|
1162
1187
|
if (pos === index) {
|
|
1163
1188
|
const { disabled: propDisabled, ...rest } = value;
|
|
1164
1189
|
return { ...rest, ...propDisabled ? {} : { disabled: true } };
|
|
@@ -1199,7 +1224,7 @@ var Repeater = ({
|
|
|
1199
1224
|
/* @__PURE__ */ React25.createElement(PlusIcon, { fontSize: SIZE })
|
|
1200
1225
|
)
|
|
1201
1226
|
), 0 < uniqueKeys.length && /* @__PURE__ */ React25.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key, index) => {
|
|
1202
|
-
const value =
|
|
1227
|
+
const value = items2[index];
|
|
1203
1228
|
if (!value) {
|
|
1204
1229
|
return null;
|
|
1205
1230
|
}
|
|
@@ -1216,7 +1241,8 @@ var Repeater = ({
|
|
|
1216
1241
|
openOnMount: openOnAdd && openItem === key,
|
|
1217
1242
|
onOpen: () => setOpenItem(EMPTY_OPEN_ITEM),
|
|
1218
1243
|
showDuplicate,
|
|
1219
|
-
showToggle
|
|
1244
|
+
showToggle,
|
|
1245
|
+
collectionPropUtil
|
|
1220
1246
|
},
|
|
1221
1247
|
(props) => /* @__PURE__ */ React25.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
1222
1248
|
));
|
|
@@ -1234,7 +1260,8 @@ var RepeaterItem = ({
|
|
|
1234
1260
|
onOpen,
|
|
1235
1261
|
showDuplicate,
|
|
1236
1262
|
showToggle,
|
|
1237
|
-
disabled
|
|
1263
|
+
disabled,
|
|
1264
|
+
collectionPropUtil
|
|
1238
1265
|
}) => {
|
|
1239
1266
|
const [anchorEl, setAnchorEl] = useState4(null);
|
|
1240
1267
|
const { popoverState, popoverProps, ref, setRef } = usePopover(openOnMount, onOpen);
|
|
@@ -1269,7 +1296,7 @@ var RepeaterItem = ({
|
|
|
1269
1296
|
...popoverProps,
|
|
1270
1297
|
anchorEl: ref
|
|
1271
1298
|
},
|
|
1272
|
-
/* @__PURE__ */ React25.createElement(Box2, null, children({ anchorEl }))
|
|
1299
|
+
/* @__PURE__ */ React25.createElement(Box2, null, children({ anchorEl, collectionPropUtil }))
|
|
1273
1300
|
));
|
|
1274
1301
|
};
|
|
1275
1302
|
var usePopover = (openOnMount, onOpen) => {
|
|
@@ -1376,16 +1403,24 @@ var initialShadow = {
|
|
|
1376
1403
|
};
|
|
1377
1404
|
|
|
1378
1405
|
// src/controls/filter-repeater-control.tsx
|
|
1379
|
-
import * as
|
|
1380
|
-
import { useRef as
|
|
1406
|
+
import * as React30 from "react";
|
|
1407
|
+
import { useRef as useRef5 } from "react";
|
|
1381
1408
|
import {
|
|
1382
1409
|
blurFilterPropTypeUtil,
|
|
1383
1410
|
brightnessFilterPropTypeUtil,
|
|
1384
|
-
|
|
1411
|
+
contrastFilterPropTypeUtil,
|
|
1412
|
+
dropShadowFilterPropTypeUtil,
|
|
1413
|
+
filterPropTypeUtil,
|
|
1414
|
+
grayscaleFilterPropTypeUtil,
|
|
1415
|
+
hueRotateFilterPropTypeUtil,
|
|
1416
|
+
invertFilterPropTypeUtil,
|
|
1417
|
+
saturateFilterPropTypeUtil,
|
|
1418
|
+
sepiaFilterPropTypeUtil
|
|
1385
1419
|
} from "@elementor/editor-props";
|
|
1420
|
+
import { backdropFilterPropTypeUtil } from "@elementor/editor-props";
|
|
1386
1421
|
import { MenuListItem as MenuListItem3 } from "@elementor/editor-ui";
|
|
1387
|
-
import { Box as
|
|
1388
|
-
import { __ as
|
|
1422
|
+
import { Box as Box4, Grid as Grid6, Select as Select2 } from "@elementor/ui";
|
|
1423
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
1389
1424
|
|
|
1390
1425
|
// src/components/control-label.tsx
|
|
1391
1426
|
import * as React27 from "react";
|
|
@@ -1394,39 +1429,145 @@ var ControlLabel = ({ children }) => {
|
|
|
1394
1429
|
return /* @__PURE__ */ React27.createElement(Stack6, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React27.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React27.createElement(ControlAdornments, null));
|
|
1395
1430
|
};
|
|
1396
1431
|
|
|
1432
|
+
// src/controls/filter-control/drop-shadow-item-content.tsx
|
|
1433
|
+
import * as React28 from "react";
|
|
1434
|
+
import { useRef as useRef4 } from "react";
|
|
1435
|
+
import { Grid as Grid5 } from "@elementor/ui";
|
|
1436
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
1437
|
+
var items = [
|
|
1438
|
+
{
|
|
1439
|
+
bind: "xAxis",
|
|
1440
|
+
label: __6("X-axis", "elementor"),
|
|
1441
|
+
rowIndex: 0
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
bind: "yAxis",
|
|
1445
|
+
label: __6("Y-axis", "elementor"),
|
|
1446
|
+
rowIndex: 0
|
|
1447
|
+
},
|
|
1448
|
+
{
|
|
1449
|
+
bind: "blur",
|
|
1450
|
+
label: __6("Blur", "elementor"),
|
|
1451
|
+
rowIndex: 1
|
|
1452
|
+
},
|
|
1453
|
+
{
|
|
1454
|
+
bind: "color",
|
|
1455
|
+
label: __6("Color", "elementor"),
|
|
1456
|
+
rowIndex: 1
|
|
1457
|
+
}
|
|
1458
|
+
];
|
|
1459
|
+
var DropShadowItemContent = ({
|
|
1460
|
+
propType,
|
|
1461
|
+
units: units2,
|
|
1462
|
+
anchorEl
|
|
1463
|
+
}) => {
|
|
1464
|
+
const context = useBoundProp(propType);
|
|
1465
|
+
const rowRefs = [useRef4(null), useRef4(null)];
|
|
1466
|
+
return /* @__PURE__ */ React28.createElement(PropProvider, { ...context }, items.map((item) => /* @__PURE__ */ React28.createElement(PopoverGridContainer, { key: item.bind, ref: rowRefs[item.rowIndex] ?? null }, /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React28.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React28.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React28.createElement(Grid5, { item: true, xs: 6 }, item.bind === "color" ? /* @__PURE__ */ React28.createElement(ColorControl, { anchorEl }) : /* @__PURE__ */ React28.createElement(SizeControl, { anchorRef: rowRefs[item.rowIndex], units: units2, defaultUnit: "px" }))))));
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1469
|
+
// src/controls/filter-control/drop-shadow-item-label.tsx
|
|
1470
|
+
import * as React29 from "react";
|
|
1471
|
+
import { Box as Box3 } from "@elementor/ui";
|
|
1472
|
+
var DropShadowItemLabel = ({ value }) => {
|
|
1473
|
+
const { xAxis, yAxis, blur } = value.value;
|
|
1474
|
+
const xValue = `${xAxis?.value?.size ?? 0}${xAxis?.value?.unit ?? "px"}`;
|
|
1475
|
+
const yValue = `${yAxis?.value?.size ?? 0}${yAxis?.value?.unit ?? "px"}`;
|
|
1476
|
+
const blurValue = `${blur?.value?.size ?? 10}${blur?.value?.unit ?? "px"}`;
|
|
1477
|
+
return /* @__PURE__ */ React29.createElement(Box3, { component: "span" }, /* @__PURE__ */ React29.createElement(Box3, { component: "span", style: { textTransform: "capitalize" } }, "Drop shadow:"), `${xValue} ${yValue} ${blurValue}`);
|
|
1478
|
+
};
|
|
1479
|
+
|
|
1397
1480
|
// src/controls/filter-repeater-control.tsx
|
|
1398
1481
|
var DEFAULT_FILTER_KEY = "blur";
|
|
1399
1482
|
var filterConfig = {
|
|
1400
1483
|
blur: {
|
|
1401
1484
|
defaultValue: { $$type: "radius", radius: { $$type: "size", value: { size: 0, unit: "px" } } },
|
|
1402
|
-
name:
|
|
1403
|
-
valueName:
|
|
1485
|
+
name: __7("Blur", "elementor"),
|
|
1486
|
+
valueName: __7("Radius", "elementor"),
|
|
1404
1487
|
propType: blurFilterPropTypeUtil,
|
|
1405
1488
|
units: defaultUnits.filter((unit) => unit !== "%")
|
|
1406
1489
|
},
|
|
1490
|
+
"drop-shadow": {
|
|
1491
|
+
defaultValue: {
|
|
1492
|
+
$$type: "drop-shadow",
|
|
1493
|
+
value: {
|
|
1494
|
+
xAxis: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
1495
|
+
yAxis: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
1496
|
+
blur: { $$type: "size", value: { size: 10, unit: "px" } },
|
|
1497
|
+
color: { $$type: "color", value: "rgba(0, 0, 0, 1)" }
|
|
1498
|
+
}
|
|
1499
|
+
},
|
|
1500
|
+
name: __7("Drop shadow", "elementor"),
|
|
1501
|
+
valueName: __7("Drop-shadow", "elementor"),
|
|
1502
|
+
propType: dropShadowFilterPropTypeUtil,
|
|
1503
|
+
units: defaultUnits.filter((unit) => unit !== "%")
|
|
1504
|
+
},
|
|
1407
1505
|
brightness: {
|
|
1408
1506
|
defaultValue: { $$type: "amount", amount: { $$type: "size", value: { size: 100, unit: "%" } } },
|
|
1409
|
-
name:
|
|
1410
|
-
valueName:
|
|
1507
|
+
name: __7("Brightness", "elementor"),
|
|
1508
|
+
valueName: __7("Amount", "elementor"),
|
|
1411
1509
|
propType: brightnessFilterPropTypeUtil,
|
|
1412
1510
|
units: ["%"]
|
|
1511
|
+
},
|
|
1512
|
+
contrast: {
|
|
1513
|
+
defaultValue: { $$type: "contrast", contrast: { $$type: "size", value: { size: 100, unit: "%" } } },
|
|
1514
|
+
name: __7("Contrast", "elementor"),
|
|
1515
|
+
valueName: __7("Amount", "elementor"),
|
|
1516
|
+
propType: contrastFilterPropTypeUtil,
|
|
1517
|
+
units: ["%"]
|
|
1518
|
+
},
|
|
1519
|
+
"hue-rotate": {
|
|
1520
|
+
defaultValue: { $$type: "hue-rotate", "hue-rotate": { $$type: "size", value: { size: 0, unit: "deg" } } },
|
|
1521
|
+
name: __7("Hue Rotate", "elementor"),
|
|
1522
|
+
valueName: __7("Angle", "elementor"),
|
|
1523
|
+
propType: hueRotateFilterPropTypeUtil,
|
|
1524
|
+
units: ["deg", "rad", "grad", "turn"]
|
|
1525
|
+
},
|
|
1526
|
+
saturate: {
|
|
1527
|
+
defaultValue: { $$type: "saturate", saturate: { $$type: "size", value: { size: 100, unit: "%" } } },
|
|
1528
|
+
name: __7("Saturate", "elementor"),
|
|
1529
|
+
valueName: __7("Amount", "elementor"),
|
|
1530
|
+
propType: saturateFilterPropTypeUtil,
|
|
1531
|
+
units: ["%"]
|
|
1532
|
+
},
|
|
1533
|
+
grayscale: {
|
|
1534
|
+
defaultValue: { $$type: "grayscale", grayscale: { $$type: "size", value: { size: 0, unit: "%" } } },
|
|
1535
|
+
name: __7("Grayscale", "elementor"),
|
|
1536
|
+
valueName: __7("Amount", "elementor"),
|
|
1537
|
+
propType: grayscaleFilterPropTypeUtil,
|
|
1538
|
+
units: ["%"]
|
|
1539
|
+
},
|
|
1540
|
+
invert: {
|
|
1541
|
+
defaultValue: { $$type: "invert", invert: { $$type: "size", value: { size: 0, unit: "%" } } },
|
|
1542
|
+
name: __7("Invert", "elementor"),
|
|
1543
|
+
valueName: __7("Amount", "elementor"),
|
|
1544
|
+
propType: invertFilterPropTypeUtil,
|
|
1545
|
+
units: ["%"]
|
|
1546
|
+
},
|
|
1547
|
+
sepia: {
|
|
1548
|
+
defaultValue: { $$type: "sepia", sepia: { $$type: "size", value: { size: 0, unit: "%" } } },
|
|
1549
|
+
name: __7("Sepia", "elementor"),
|
|
1550
|
+
valueName: __7("Amount", "elementor"),
|
|
1551
|
+
propType: sepiaFilterPropTypeUtil,
|
|
1552
|
+
units: ["%"]
|
|
1413
1553
|
}
|
|
1414
1554
|
};
|
|
1415
1555
|
var filterKeys = Object.keys(filterConfig);
|
|
1416
|
-
var
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
})
|
|
1420
|
-
|
|
1421
|
-
const { propType, value: filterValues, setValue, disabled } = useBoundProp(
|
|
1422
|
-
return /* @__PURE__ */
|
|
1556
|
+
var isSingleSize = (key) => {
|
|
1557
|
+
return !["drop-shadow"].includes(key);
|
|
1558
|
+
};
|
|
1559
|
+
var FilterRepeaterControl = createControl(({ filterPropName = "filter" }) => {
|
|
1560
|
+
const [propUtil, label] = filterPropName === "backdrop-filter" ? [backdropFilterPropTypeUtil, __7("Backdrop Filters", "elementor")] : [filterPropTypeUtil, __7("Filters", "elementor")];
|
|
1561
|
+
const { propType, value: filterValues, setValue, disabled } = useBoundProp(propUtil);
|
|
1562
|
+
return /* @__PURE__ */ React30.createElement(PropProvider, { propType, value: filterValues, setValue }, /* @__PURE__ */ React30.createElement(
|
|
1423
1563
|
Repeater,
|
|
1424
1564
|
{
|
|
1425
1565
|
openOnAdd: true,
|
|
1426
1566
|
disabled,
|
|
1427
1567
|
values: filterValues ?? [],
|
|
1428
1568
|
setValues: setValue,
|
|
1429
|
-
label
|
|
1569
|
+
label,
|
|
1570
|
+
collectionPropUtil: propUtil,
|
|
1430
1571
|
itemSettings: {
|
|
1431
1572
|
Icon: ItemIcon2,
|
|
1432
1573
|
Label: ItemLabel2,
|
|
@@ -1439,21 +1580,24 @@ var FilterRepeaterControl = createControl(() => {
|
|
|
1439
1580
|
}
|
|
1440
1581
|
));
|
|
1441
1582
|
});
|
|
1442
|
-
var ItemIcon2 = () => /* @__PURE__ */
|
|
1443
|
-
var ItemLabel2 = (
|
|
1444
|
-
|
|
1445
|
-
return singleSizeFilterNames.includes($$type) && /* @__PURE__ */ React28.createElement(SingleSizeItemLabel, { value: props.value });
|
|
1583
|
+
var ItemIcon2 = () => /* @__PURE__ */ React30.createElement(React30.Fragment, null);
|
|
1584
|
+
var ItemLabel2 = ({ value }) => {
|
|
1585
|
+
return isSingleSize(value.$$type) ? /* @__PURE__ */ React30.createElement(SingleSizeItemLabel, { value }) : /* @__PURE__ */ React30.createElement(DropShadowItemLabel, { value });
|
|
1446
1586
|
};
|
|
1447
1587
|
var SingleSizeItemLabel = ({ value }) => {
|
|
1448
1588
|
const { $$type, value: sizeValue } = value;
|
|
1449
1589
|
const { $$type: key } = filterConfig[$$type].defaultValue;
|
|
1450
1590
|
const defaultUnit = filterConfig[$$type].defaultValue[key].value.unit;
|
|
1451
1591
|
const { unit, size } = sizeValue[key]?.value ?? { unit: defaultUnit, size: 0 };
|
|
1452
|
-
const label = /* @__PURE__ */
|
|
1453
|
-
return /* @__PURE__ */
|
|
1592
|
+
const label = /* @__PURE__ */ React30.createElement(Box4, { component: "span", style: { textTransform: "capitalize" } }, value.$$type, ":");
|
|
1593
|
+
return /* @__PURE__ */ React30.createElement(Box4, { component: "span" }, label, unit !== "custom" ? ` ${size ?? 0}${unit ?? defaultUnit}` : size);
|
|
1454
1594
|
};
|
|
1455
|
-
var ItemContent2 = ({
|
|
1456
|
-
|
|
1595
|
+
var ItemContent2 = ({
|
|
1596
|
+
bind,
|
|
1597
|
+
collectionPropUtil,
|
|
1598
|
+
anchorEl
|
|
1599
|
+
}) => {
|
|
1600
|
+
const { value: filterValues, setValue } = useBoundProp(collectionPropUtil ?? filterPropTypeUtil);
|
|
1457
1601
|
const itemIndex = parseInt(bind, 10);
|
|
1458
1602
|
const item = filterValues?.[itemIndex];
|
|
1459
1603
|
const handleChange = (e) => {
|
|
@@ -1461,11 +1605,11 @@ var ItemContent2 = ({ bind }) => {
|
|
|
1461
1605
|
const filterType = e.target.value;
|
|
1462
1606
|
newFilterValues[itemIndex] = {
|
|
1463
1607
|
$$type: filterType,
|
|
1464
|
-
value: filterConfig[filterType].defaultValue
|
|
1608
|
+
value: { ...filterConfig[filterType].defaultValue }
|
|
1465
1609
|
};
|
|
1466
1610
|
setValue(newFilterValues);
|
|
1467
1611
|
};
|
|
1468
|
-
return /* @__PURE__ */
|
|
1612
|
+
return /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React30.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React30.createElement(PopoverGridContainer, null, /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, __7("Filter", "elementor"))), /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(
|
|
1469
1613
|
Select2,
|
|
1470
1614
|
{
|
|
1471
1615
|
sx: { overflow: "hidden" },
|
|
@@ -1474,27 +1618,29 @@ var ItemContent2 = ({ bind }) => {
|
|
|
1474
1618
|
onChange: handleChange,
|
|
1475
1619
|
fullWidth: true
|
|
1476
1620
|
},
|
|
1477
|
-
filterKeys.map((filterKey) => /* @__PURE__ */
|
|
1478
|
-
))), /* @__PURE__ */
|
|
1621
|
+
filterKeys.map((filterKey) => /* @__PURE__ */ React30.createElement(MenuListItem3, { key: filterKey, value: filterKey }, filterConfig[filterKey].name))
|
|
1622
|
+
))), /* @__PURE__ */ React30.createElement(Content2, { filterType: item?.$$type, anchorEl })));
|
|
1479
1623
|
};
|
|
1480
|
-
var Content2 = ({ filterType }) => {
|
|
1481
|
-
|
|
1624
|
+
var Content2 = ({ filterType, anchorEl }) => {
|
|
1625
|
+
const { propType, units: units2 = [] } = filterConfig[filterType];
|
|
1626
|
+
return isSingleSize(filterType) ? /* @__PURE__ */ React30.createElement(SingleSizeItemContent, { filterType }) : /* @__PURE__ */ React30.createElement(DropShadowItemContent, { propType, units: units2, anchorEl });
|
|
1482
1627
|
};
|
|
1483
1628
|
var SingleSizeItemContent = ({ filterType }) => {
|
|
1484
1629
|
const { propType, valueName, defaultValue, units: units2 } = filterConfig[filterType];
|
|
1485
1630
|
const { $$type } = defaultValue;
|
|
1486
1631
|
const context = useBoundProp(propType);
|
|
1487
|
-
const rowRef =
|
|
1488
|
-
|
|
1632
|
+
const rowRef = useRef5(null);
|
|
1633
|
+
const defaultUnit = defaultValue[$$type].value.unit;
|
|
1634
|
+
return /* @__PURE__ */ React30.createElement(PropProvider, { ...context }, /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind: $$type }, /* @__PURE__ */ React30.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, valueName)), /* @__PURE__ */ React30.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(SizeControl, { anchorRef: rowRef, units: units2, defaultUnit })))));
|
|
1489
1635
|
};
|
|
1490
1636
|
|
|
1491
1637
|
// src/controls/toggle-control.tsx
|
|
1492
|
-
import * as
|
|
1638
|
+
import * as React33 from "react";
|
|
1493
1639
|
import { stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
|
|
1494
1640
|
|
|
1495
1641
|
// src/components/control-toggle-button-group.tsx
|
|
1496
|
-
import * as
|
|
1497
|
-
import { useEffect as useEffect4, useMemo as useMemo2, useRef as
|
|
1642
|
+
import * as React32 from "react";
|
|
1643
|
+
import { useEffect as useEffect4, useMemo as useMemo2, useRef as useRef6, useState as useState5 } from "react";
|
|
1498
1644
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
1499
1645
|
import {
|
|
1500
1646
|
ListItemText,
|
|
@@ -1508,14 +1654,14 @@ import {
|
|
|
1508
1654
|
} from "@elementor/ui";
|
|
1509
1655
|
|
|
1510
1656
|
// src/components/conditional-tooltip.tsx
|
|
1511
|
-
import * as
|
|
1657
|
+
import * as React31 from "react";
|
|
1512
1658
|
import { Tooltip as Tooltip2 } from "@elementor/ui";
|
|
1513
1659
|
var ConditionalTooltip = ({
|
|
1514
1660
|
showTooltip,
|
|
1515
1661
|
children,
|
|
1516
1662
|
label
|
|
1517
1663
|
}) => {
|
|
1518
|
-
return showTooltip && label ? /* @__PURE__ */
|
|
1664
|
+
return showTooltip && label ? /* @__PURE__ */ React31.createElement(Tooltip2, { title: label, disableFocusListener: true, placement: "top" }, children) : children;
|
|
1519
1665
|
};
|
|
1520
1666
|
|
|
1521
1667
|
// src/components/control-toggle-button-group.tsx
|
|
@@ -1539,15 +1685,15 @@ var ControlToggleButtonGroup = ({
|
|
|
1539
1685
|
size = "tiny",
|
|
1540
1686
|
value,
|
|
1541
1687
|
onChange,
|
|
1542
|
-
items,
|
|
1688
|
+
items: items2,
|
|
1543
1689
|
maxItems,
|
|
1544
1690
|
exclusive = false,
|
|
1545
1691
|
fullWidth = false,
|
|
1546
1692
|
disabled
|
|
1547
1693
|
}) => {
|
|
1548
|
-
const shouldSliceItems = exclusive && maxItems !== void 0 &&
|
|
1549
|
-
const menuItems = shouldSliceItems ?
|
|
1550
|
-
const fixedItems = shouldSliceItems ?
|
|
1694
|
+
const shouldSliceItems = exclusive && maxItems !== void 0 && items2.length > maxItems;
|
|
1695
|
+
const menuItems = shouldSliceItems ? items2.slice(maxItems - 1) : [];
|
|
1696
|
+
const fixedItems = shouldSliceItems ? items2.slice(0, maxItems - 1) : items2;
|
|
1551
1697
|
const isRtl = "rtl" === useTheme().direction;
|
|
1552
1698
|
const handleChange = (_, newValue) => {
|
|
1553
1699
|
onChange(newValue);
|
|
@@ -1558,7 +1704,7 @@ var ControlToggleButtonGroup = ({
|
|
|
1558
1704
|
const templateColumnsSuffix = isOffLimits ? "auto" : "";
|
|
1559
1705
|
return `repeat(${itemsCount}, minmax(0, 25%)) ${templateColumnsSuffix}`;
|
|
1560
1706
|
}, [menuItems?.length, fixedItems.length]);
|
|
1561
|
-
return /* @__PURE__ */
|
|
1707
|
+
return /* @__PURE__ */ React32.createElement(ControlActions, null, /* @__PURE__ */ React32.createElement(
|
|
1562
1708
|
StyledToggleButtonGroup,
|
|
1563
1709
|
{
|
|
1564
1710
|
justify,
|
|
@@ -1573,16 +1719,16 @@ var ControlToggleButtonGroup = ({
|
|
|
1573
1719
|
width: `100%`
|
|
1574
1720
|
}
|
|
1575
1721
|
},
|
|
1576
|
-
fixedItems.map(({ label, value: buttonValue, renderContent: Content5, showTooltip }) => /* @__PURE__ */
|
|
1722
|
+
fixedItems.map(({ label, value: buttonValue, renderContent: Content5, showTooltip }) => /* @__PURE__ */ React32.createElement(
|
|
1577
1723
|
ConditionalTooltip,
|
|
1578
1724
|
{
|
|
1579
1725
|
key: buttonValue,
|
|
1580
1726
|
label,
|
|
1581
1727
|
showTooltip: showTooltip || false
|
|
1582
1728
|
},
|
|
1583
|
-
/* @__PURE__ */
|
|
1729
|
+
/* @__PURE__ */ React32.createElement(ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React32.createElement(Content5, { size }))
|
|
1584
1730
|
)),
|
|
1585
|
-
menuItems.length && exclusive && /* @__PURE__ */
|
|
1731
|
+
menuItems.length && exclusive && /* @__PURE__ */ React32.createElement(
|
|
1586
1732
|
SplitButtonGroup,
|
|
1587
1733
|
{
|
|
1588
1734
|
size,
|
|
@@ -1597,13 +1743,13 @@ var ControlToggleButtonGroup = ({
|
|
|
1597
1743
|
var SplitButtonGroup = ({
|
|
1598
1744
|
size = "tiny",
|
|
1599
1745
|
onChange,
|
|
1600
|
-
items,
|
|
1746
|
+
items: items2,
|
|
1601
1747
|
fullWidth,
|
|
1602
1748
|
value
|
|
1603
1749
|
}) => {
|
|
1604
|
-
const previewButton = usePreviewButton(
|
|
1750
|
+
const previewButton = usePreviewButton(items2, value);
|
|
1605
1751
|
const [isMenuOpen, setIsMenuOpen] = useState5(false);
|
|
1606
|
-
const menuButtonRef =
|
|
1752
|
+
const menuButtonRef = useRef6(null);
|
|
1607
1753
|
const onMenuToggle = (ev) => {
|
|
1608
1754
|
setIsMenuOpen((prev) => !prev);
|
|
1609
1755
|
ev.preventDefault();
|
|
@@ -1616,7 +1762,7 @@ var SplitButtonGroup = ({
|
|
|
1616
1762
|
const shouldRemove = newValue === value;
|
|
1617
1763
|
onChange(shouldRemove ? null : newValue);
|
|
1618
1764
|
};
|
|
1619
|
-
return /* @__PURE__ */
|
|
1765
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(
|
|
1620
1766
|
ToggleButton,
|
|
1621
1767
|
{
|
|
1622
1768
|
value: previewButton.value,
|
|
@@ -1630,7 +1776,7 @@ var SplitButtonGroup = ({
|
|
|
1630
1776
|
ref: menuButtonRef
|
|
1631
1777
|
},
|
|
1632
1778
|
previewButton.renderContent({ size })
|
|
1633
|
-
), /* @__PURE__ */
|
|
1779
|
+
), /* @__PURE__ */ React32.createElement(
|
|
1634
1780
|
ToggleButton,
|
|
1635
1781
|
{
|
|
1636
1782
|
size,
|
|
@@ -1641,8 +1787,8 @@ var SplitButtonGroup = ({
|
|
|
1641
1787
|
ref: menuButtonRef,
|
|
1642
1788
|
value: "__chevron-icon-button__"
|
|
1643
1789
|
},
|
|
1644
|
-
/* @__PURE__ */
|
|
1645
|
-
), /* @__PURE__ */
|
|
1790
|
+
/* @__PURE__ */ React32.createElement(ChevronDownIcon, { fontSize: size })
|
|
1791
|
+
), /* @__PURE__ */ React32.createElement(
|
|
1646
1792
|
Menu2,
|
|
1647
1793
|
{
|
|
1648
1794
|
open: isMenuOpen,
|
|
@@ -1660,27 +1806,27 @@ var SplitButtonGroup = ({
|
|
|
1660
1806
|
mt: 0.5
|
|
1661
1807
|
}
|
|
1662
1808
|
},
|
|
1663
|
-
|
|
1809
|
+
items2.map(({ label, value: buttonValue }) => /* @__PURE__ */ React32.createElement(
|
|
1664
1810
|
MenuItem,
|
|
1665
1811
|
{
|
|
1666
1812
|
key: buttonValue,
|
|
1667
1813
|
selected: buttonValue === value,
|
|
1668
1814
|
onClick: () => onMenuItemClick(buttonValue)
|
|
1669
1815
|
},
|
|
1670
|
-
/* @__PURE__ */
|
|
1816
|
+
/* @__PURE__ */ React32.createElement(ListItemText, null, /* @__PURE__ */ React32.createElement(Typography3, { sx: { fontSize: "14px" } }, label))
|
|
1671
1817
|
))
|
|
1672
1818
|
));
|
|
1673
1819
|
};
|
|
1674
|
-
var usePreviewButton = (
|
|
1820
|
+
var usePreviewButton = (items2, value) => {
|
|
1675
1821
|
const [previewButton, setPreviewButton] = useState5(
|
|
1676
|
-
|
|
1822
|
+
items2.find((item) => item.value === value) ?? items2[0]
|
|
1677
1823
|
);
|
|
1678
1824
|
useEffect4(() => {
|
|
1679
|
-
const selectedButton =
|
|
1825
|
+
const selectedButton = items2.find((item) => item.value === value);
|
|
1680
1826
|
if (selectedButton) {
|
|
1681
1827
|
setPreviewButton(selectedButton);
|
|
1682
1828
|
}
|
|
1683
|
-
}, [
|
|
1829
|
+
}, [items2, value]);
|
|
1684
1830
|
return previewButton;
|
|
1685
1831
|
};
|
|
1686
1832
|
|
|
@@ -1707,7 +1853,7 @@ var ToggleControl = createControl(
|
|
|
1707
1853
|
fullWidth,
|
|
1708
1854
|
size
|
|
1709
1855
|
};
|
|
1710
|
-
return exclusive ? /* @__PURE__ */
|
|
1856
|
+
return exclusive ? /* @__PURE__ */ React33.createElement(
|
|
1711
1857
|
ControlToggleButtonGroup,
|
|
1712
1858
|
{
|
|
1713
1859
|
...toggleButtonGroupProps,
|
|
@@ -1716,7 +1862,7 @@ var ToggleControl = createControl(
|
|
|
1716
1862
|
disabled,
|
|
1717
1863
|
exclusive: true
|
|
1718
1864
|
}
|
|
1719
|
-
) : /* @__PURE__ */
|
|
1865
|
+
) : /* @__PURE__ */ React33.createElement(
|
|
1720
1866
|
ControlToggleButtonGroup,
|
|
1721
1867
|
{
|
|
1722
1868
|
...toggleButtonGroupProps,
|
|
@@ -1730,7 +1876,7 @@ var ToggleControl = createControl(
|
|
|
1730
1876
|
);
|
|
1731
1877
|
|
|
1732
1878
|
// src/controls/number-control.tsx
|
|
1733
|
-
import * as
|
|
1879
|
+
import * as React34 from "react";
|
|
1734
1880
|
import { numberPropTypeUtil } from "@elementor/editor-props";
|
|
1735
1881
|
import { TextField as TextField5 } from "@elementor/ui";
|
|
1736
1882
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
@@ -1753,7 +1899,7 @@ var NumberControl = createControl(
|
|
|
1753
1899
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
1754
1900
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
1755
1901
|
};
|
|
1756
|
-
return /* @__PURE__ */
|
|
1902
|
+
return /* @__PURE__ */ React34.createElement(ControlActions, null, /* @__PURE__ */ React34.createElement(
|
|
1757
1903
|
TextField5,
|
|
1758
1904
|
{
|
|
1759
1905
|
size: "tiny",
|
|
@@ -1775,15 +1921,15 @@ var NumberControl = createControl(
|
|
|
1775
1921
|
);
|
|
1776
1922
|
|
|
1777
1923
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1778
|
-
import * as
|
|
1779
|
-
import { useId as useId2, useRef as
|
|
1924
|
+
import * as React35 from "react";
|
|
1925
|
+
import { useId as useId2, useRef as useRef7 } from "react";
|
|
1780
1926
|
import { sizePropTypeUtil as sizePropTypeUtil2 } from "@elementor/editor-props";
|
|
1781
1927
|
import { isExperimentActive as isExperimentActive2 } from "@elementor/editor-v1-adapters";
|
|
1782
|
-
import { bindPopover as bindPopover3, bindToggle, Grid as
|
|
1783
|
-
import { __ as
|
|
1784
|
-
var isEqualSizes = (propValue,
|
|
1928
|
+
import { bindPopover as bindPopover3, bindToggle, Grid as Grid7, Popover as Popover3, Stack as Stack7, ToggleButton as ToggleButton2, Tooltip as Tooltip3, usePopupState as usePopupState4 } from "@elementor/ui";
|
|
1929
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
1930
|
+
var isEqualSizes = (propValue, items2) => {
|
|
1785
1931
|
const values = Object.values(propValue);
|
|
1786
|
-
if (values.length !==
|
|
1932
|
+
if (values.length !== items2.length) {
|
|
1787
1933
|
return false;
|
|
1788
1934
|
}
|
|
1789
1935
|
const [firstValue, ...restValues] = values;
|
|
@@ -1795,7 +1941,7 @@ function EqualUnequalSizesControl({
|
|
|
1795
1941
|
label,
|
|
1796
1942
|
icon,
|
|
1797
1943
|
tooltipLabel,
|
|
1798
|
-
items,
|
|
1944
|
+
items: items2,
|
|
1799
1945
|
multiSizePropTypeUtil
|
|
1800
1946
|
}) {
|
|
1801
1947
|
const popupId = useId2();
|
|
@@ -1807,12 +1953,12 @@ function EqualUnequalSizesControl({
|
|
|
1807
1953
|
disabled: multiSizeDisabled
|
|
1808
1954
|
} = useBoundProp(multiSizePropTypeUtil);
|
|
1809
1955
|
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(sizePropTypeUtil2);
|
|
1810
|
-
const rowRefs = [
|
|
1956
|
+
const rowRefs = [useRef7(null), useRef7(null)];
|
|
1811
1957
|
const splitEqualValue = () => {
|
|
1812
1958
|
if (!sizeValue) {
|
|
1813
1959
|
return null;
|
|
1814
1960
|
}
|
|
1815
|
-
return
|
|
1961
|
+
return items2.reduce(
|
|
1816
1962
|
(acc, { bind }) => ({ ...acc, [bind]: sizePropTypeUtil2.create(sizeValue) }),
|
|
1817
1963
|
{}
|
|
1818
1964
|
);
|
|
@@ -1822,7 +1968,7 @@ function EqualUnequalSizesControl({
|
|
|
1822
1968
|
...multiSizeValue ?? splitEqualValue(),
|
|
1823
1969
|
...newValue
|
|
1824
1970
|
};
|
|
1825
|
-
const isEqual = isEqualSizes(newMappedValues,
|
|
1971
|
+
const isEqual = isEqualSizes(newMappedValues, items2);
|
|
1826
1972
|
if (isEqual) {
|
|
1827
1973
|
return setSizeValue(Object.values(newMappedValues)[0]?.value);
|
|
1828
1974
|
}
|
|
@@ -1836,13 +1982,13 @@ function EqualUnequalSizesControl({
|
|
|
1836
1982
|
};
|
|
1837
1983
|
const isShowingGeneralIndicator = !isExperimentActive2("e_v_3_30") || !popupState.isOpen;
|
|
1838
1984
|
const isMixed = !!multiSizeValue;
|
|
1839
|
-
return /* @__PURE__ */
|
|
1985
|
+
return /* @__PURE__ */ React35.createElement(React35.Fragment, null, /* @__PURE__ */ React35.createElement(Grid7, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: rowRefs[0] }, /* @__PURE__ */ React35.createElement(Grid7, { item: true, xs: 6 }, !isShowingGeneralIndicator ? /* @__PURE__ */ React35.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React35.createElement(ControlLabel, null, label)), /* @__PURE__ */ React35.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(Stack7, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React35.createElement(
|
|
1840
1986
|
SizeControl,
|
|
1841
1987
|
{
|
|
1842
|
-
placeholder: isMixed ?
|
|
1988
|
+
placeholder: isMixed ? __8("Mixed", "elementor") : void 0,
|
|
1843
1989
|
anchorRef: rowRefs[0]
|
|
1844
1990
|
}
|
|
1845
|
-
), /* @__PURE__ */
|
|
1991
|
+
), /* @__PURE__ */ React35.createElement(Tooltip3, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React35.createElement(
|
|
1846
1992
|
ToggleButton2,
|
|
1847
1993
|
{
|
|
1848
1994
|
size: "tiny",
|
|
@@ -1853,7 +1999,7 @@ function EqualUnequalSizesControl({
|
|
|
1853
1999
|
"aria-label": tooltipLabel
|
|
1854
2000
|
},
|
|
1855
2001
|
icon
|
|
1856
|
-
))))), /* @__PURE__ */
|
|
2002
|
+
))))), /* @__PURE__ */ React35.createElement(
|
|
1857
2003
|
Popover3,
|
|
1858
2004
|
{
|
|
1859
2005
|
disablePortal: true,
|
|
@@ -1871,7 +2017,7 @@ function EqualUnequalSizesControl({
|
|
|
1871
2017
|
paper: { sx: { mt: 0.5, width: rowRefs[0].current?.getBoundingClientRect().width } }
|
|
1872
2018
|
}
|
|
1873
2019
|
},
|
|
1874
|
-
/* @__PURE__ */
|
|
2020
|
+
/* @__PURE__ */ React35.createElement(
|
|
1875
2021
|
PropProvider,
|
|
1876
2022
|
{
|
|
1877
2023
|
propType: multiSizePropType,
|
|
@@ -1879,23 +2025,23 @@ function EqualUnequalSizesControl({
|
|
|
1879
2025
|
setValue: setNestedProp,
|
|
1880
2026
|
isDisabled: () => multiSizeDisabled
|
|
1881
2027
|
},
|
|
1882
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ React35.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React35.createElement(PopoverGridContainer, { ref: rowRefs[1] }, /* @__PURE__ */ React35.createElement(MultiSizeValueControl, { item: items2[0], rowRef: rowRefs[1] }), /* @__PURE__ */ React35.createElement(MultiSizeValueControl, { item: items2[1], rowRef: rowRefs[1] })), /* @__PURE__ */ React35.createElement(PopoverGridContainer, { ref: rowRefs[2] }, /* @__PURE__ */ React35.createElement(MultiSizeValueControl, { item: items2[2], rowRef: rowRefs[2] }), /* @__PURE__ */ React35.createElement(MultiSizeValueControl, { item: items2[3], rowRef: rowRefs[2] })))
|
|
1883
2029
|
)
|
|
1884
2030
|
));
|
|
1885
2031
|
}
|
|
1886
2032
|
var MultiSizeValueControl = ({ item, rowRef }) => {
|
|
1887
2033
|
const isUsingNestedProps = isExperimentActive2("e_v_3_30");
|
|
1888
|
-
return /* @__PURE__ */
|
|
2034
|
+
return /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React35.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(Grid7, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React35.createElement(Grid7, { item: true, xs: 12 }, isUsingNestedProps ? /* @__PURE__ */ React35.createElement(ControlLabel, null, item.label) : /* @__PURE__ */ React35.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React35.createElement(Grid7, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(SizeControl, { startIcon: item.icon, anchorRef: rowRef })))));
|
|
1889
2035
|
};
|
|
1890
2036
|
|
|
1891
2037
|
// src/controls/linked-dimensions-control.tsx
|
|
1892
|
-
import * as
|
|
1893
|
-
import { useRef as
|
|
2038
|
+
import * as React36 from "react";
|
|
2039
|
+
import { useRef as useRef8 } from "react";
|
|
1894
2040
|
import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil3 } from "@elementor/editor-props";
|
|
1895
2041
|
import { isExperimentActive as isExperimentActive3 } from "@elementor/editor-v1-adapters";
|
|
1896
2042
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
1897
|
-
import { Grid as
|
|
1898
|
-
import { __ as
|
|
2043
|
+
import { Grid as Grid8, Stack as Stack8, ToggleButton as ToggleButton3, Tooltip as Tooltip4 } from "@elementor/ui";
|
|
2044
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
1899
2045
|
var LinkedDimensionsControl = createControl(
|
|
1900
2046
|
({
|
|
1901
2047
|
label,
|
|
@@ -1903,7 +2049,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1903
2049
|
extendedOptions
|
|
1904
2050
|
}) => {
|
|
1905
2051
|
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil3);
|
|
1906
|
-
const gridRowRefs = [
|
|
2052
|
+
const gridRowRefs = [useRef8(null), useRef8(null)];
|
|
1907
2053
|
const {
|
|
1908
2054
|
value: dimensionsValue,
|
|
1909
2055
|
setValue: setDimensionsValue,
|
|
@@ -1927,10 +2073,10 @@ var LinkedDimensionsControl = createControl(
|
|
|
1927
2073
|
};
|
|
1928
2074
|
const tooltipLabel = label.toLowerCase();
|
|
1929
2075
|
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
1930
|
-
const linkedLabel =
|
|
1931
|
-
const unlinkedLabel =
|
|
2076
|
+
const linkedLabel = __9("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2077
|
+
const unlinkedLabel = __9("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1932
2078
|
const disabled = sizeDisabled || dimensionsDisabled;
|
|
1933
|
-
return /* @__PURE__ */
|
|
2079
|
+
return /* @__PURE__ */ React36.createElement(
|
|
1934
2080
|
PropProvider,
|
|
1935
2081
|
{
|
|
1936
2082
|
propType,
|
|
@@ -1938,7 +2084,7 @@ var LinkedDimensionsControl = createControl(
|
|
|
1938
2084
|
setValue: setDimensionsValue,
|
|
1939
2085
|
isDisabled: () => disabled
|
|
1940
2086
|
},
|
|
1941
|
-
/* @__PURE__ */
|
|
2087
|
+
/* @__PURE__ */ React36.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap" }, isUsingNestedProps ? /* @__PURE__ */ React36.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React36.createElement(ControlLabel, null, label), /* @__PURE__ */ React36.createElement(Tooltip4, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React36.createElement(
|
|
1942
2088
|
ToggleButton3,
|
|
1943
2089
|
{
|
|
1944
2090
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -1949,9 +2095,9 @@ var LinkedDimensionsControl = createControl(
|
|
|
1949
2095
|
onChange: onLinkToggle,
|
|
1950
2096
|
disabled
|
|
1951
2097
|
},
|
|
1952
|
-
/* @__PURE__ */
|
|
2098
|
+
/* @__PURE__ */ React36.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1953
2099
|
))),
|
|
1954
|
-
getCssMarginProps(isSiteRtl).map((row, index) => /* @__PURE__ */
|
|
2100
|
+
getCssMarginProps(isSiteRtl).map((row, index) => /* @__PURE__ */ React36.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap", key: index, ref: gridRowRefs[index] }, row.map(({ icon, ...props }) => /* @__PURE__ */ React36.createElement(Grid8, { container: true, gap: 0.75, alignItems: "center", key: props.bind }, /* @__PURE__ */ React36.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(Label, { ...props })), /* @__PURE__ */ React36.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(
|
|
1955
2101
|
Control3,
|
|
1956
2102
|
{
|
|
1957
2103
|
bind: props.bind,
|
|
@@ -1972,60 +2118,60 @@ var Control3 = ({
|
|
|
1972
2118
|
anchorRef
|
|
1973
2119
|
}) => {
|
|
1974
2120
|
if (isLinked) {
|
|
1975
|
-
return /* @__PURE__ */
|
|
2121
|
+
return /* @__PURE__ */ React36.createElement(SizeControl, { startIcon, extendedOptions, anchorRef });
|
|
1976
2122
|
}
|
|
1977
|
-
return /* @__PURE__ */
|
|
2123
|
+
return /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React36.createElement(SizeControl, { startIcon, extendedOptions, anchorRef }));
|
|
1978
2124
|
};
|
|
1979
2125
|
var Label = ({ label, bind }) => {
|
|
1980
2126
|
const isUsingNestedProps = isExperimentActive3("e_v_3_30");
|
|
1981
2127
|
if (!isUsingNestedProps) {
|
|
1982
|
-
return /* @__PURE__ */
|
|
2128
|
+
return /* @__PURE__ */ React36.createElement(ControlFormLabel, null, label);
|
|
1983
2129
|
}
|
|
1984
|
-
return /* @__PURE__ */
|
|
2130
|
+
return /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React36.createElement(ControlLabel, null, label));
|
|
1985
2131
|
};
|
|
1986
2132
|
function getCssMarginProps(isSiteRtl) {
|
|
1987
2133
|
return [
|
|
1988
2134
|
[
|
|
1989
2135
|
{
|
|
1990
2136
|
bind: "block-start",
|
|
1991
|
-
label:
|
|
1992
|
-
icon: /* @__PURE__ */
|
|
2137
|
+
label: __9("Top", "elementor"),
|
|
2138
|
+
icon: /* @__PURE__ */ React36.createElement(SideTopIcon, { fontSize: "tiny" })
|
|
1993
2139
|
},
|
|
1994
2140
|
{
|
|
1995
2141
|
bind: "inline-end",
|
|
1996
|
-
label: isSiteRtl ?
|
|
1997
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2142
|
+
label: isSiteRtl ? __9("Left", "elementor") : __9("Right", "elementor"),
|
|
2143
|
+
icon: isSiteRtl ? /* @__PURE__ */ React36.createElement(SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React36.createElement(SideRightIcon, { fontSize: "tiny" })
|
|
1998
2144
|
}
|
|
1999
2145
|
],
|
|
2000
2146
|
[
|
|
2001
2147
|
{
|
|
2002
2148
|
bind: "block-end",
|
|
2003
|
-
label:
|
|
2004
|
-
icon: /* @__PURE__ */
|
|
2149
|
+
label: __9("Bottom", "elementor"),
|
|
2150
|
+
icon: /* @__PURE__ */ React36.createElement(SideBottomIcon, { fontSize: "tiny" })
|
|
2005
2151
|
},
|
|
2006
2152
|
{
|
|
2007
2153
|
bind: "inline-start",
|
|
2008
|
-
label: isSiteRtl ?
|
|
2009
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2154
|
+
label: isSiteRtl ? __9("Right", "elementor") : __9("Left", "elementor"),
|
|
2155
|
+
icon: isSiteRtl ? /* @__PURE__ */ React36.createElement(SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React36.createElement(SideLeftIcon, { fontSize: "tiny" })
|
|
2010
2156
|
}
|
|
2011
2157
|
]
|
|
2012
2158
|
];
|
|
2013
2159
|
}
|
|
2014
2160
|
|
|
2015
2161
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2016
|
-
import * as
|
|
2162
|
+
import * as React38 from "react";
|
|
2017
2163
|
import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
|
|
2018
2164
|
import { ChevronDownIcon as ChevronDownIcon2 } from "@elementor/icons";
|
|
2019
2165
|
import { bindPopover as bindPopover4, bindTrigger as bindTrigger3, Popover as Popover4, UnstableTag as UnstableTag2, usePopupState as usePopupState5 } from "@elementor/ui";
|
|
2020
2166
|
|
|
2021
2167
|
// src/components/font-family-selector.tsx
|
|
2022
|
-
import * as
|
|
2168
|
+
import * as React37 from "react";
|
|
2023
2169
|
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
2024
|
-
import { PopoverHeader, PopoverMenuList,
|
|
2170
|
+
import { PopoverBody, PopoverHeader, PopoverMenuList, PopoverSearch } from "@elementor/editor-ui";
|
|
2025
2171
|
import { TextIcon } from "@elementor/icons";
|
|
2026
|
-
import { Box as
|
|
2172
|
+
import { Box as Box5, Divider as Divider2, Link, Stack as Stack9, Typography as Typography4 } from "@elementor/ui";
|
|
2027
2173
|
import { debounce } from "@elementor/utils";
|
|
2028
|
-
import { __ as
|
|
2174
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
2029
2175
|
|
|
2030
2176
|
// src/controls/font-family-control/enqueue-font.tsx
|
|
2031
2177
|
var enqueueFont = (fontFamily, context = "editor") => {
|
|
@@ -2067,21 +2213,21 @@ var FontFamilySelector = ({
|
|
|
2067
2213
|
setSearchValue("");
|
|
2068
2214
|
onClose();
|
|
2069
2215
|
};
|
|
2070
|
-
return /* @__PURE__ */
|
|
2216
|
+
return /* @__PURE__ */ React37.createElement(PopoverBody, { width: sectionWidth }, /* @__PURE__ */ React37.createElement(
|
|
2071
2217
|
PopoverHeader,
|
|
2072
2218
|
{
|
|
2073
|
-
title:
|
|
2219
|
+
title: __10("Font Family", "elementor"),
|
|
2074
2220
|
onClose: handleClose,
|
|
2075
|
-
icon: /* @__PURE__ */
|
|
2221
|
+
icon: /* @__PURE__ */ React37.createElement(TextIcon, { fontSize: SIZE2 })
|
|
2076
2222
|
}
|
|
2077
|
-
), /* @__PURE__ */
|
|
2223
|
+
), /* @__PURE__ */ React37.createElement(
|
|
2078
2224
|
PopoverSearch,
|
|
2079
2225
|
{
|
|
2080
2226
|
value: searchValue,
|
|
2081
2227
|
onSearch: handleSearch,
|
|
2082
|
-
placeholder:
|
|
2228
|
+
placeholder: __10("Search", "elementor")
|
|
2083
2229
|
}
|
|
2084
|
-
), /* @__PURE__ */
|
|
2230
|
+
), /* @__PURE__ */ React37.createElement(Divider2, null), filteredFontFamilies.length > 0 ? /* @__PURE__ */ React37.createElement(
|
|
2085
2231
|
FontList,
|
|
2086
2232
|
{
|
|
2087
2233
|
fontListItems: filteredFontFamilies,
|
|
@@ -2089,7 +2235,7 @@ var FontFamilySelector = ({
|
|
|
2089
2235
|
handleClose,
|
|
2090
2236
|
fontFamily
|
|
2091
2237
|
}
|
|
2092
|
-
) : /* @__PURE__ */
|
|
2238
|
+
) : /* @__PURE__ */ React37.createElement(
|
|
2093
2239
|
Stack9,
|
|
2094
2240
|
{
|
|
2095
2241
|
alignItems: "center",
|
|
@@ -2099,8 +2245,8 @@ var FontFamilySelector = ({
|
|
|
2099
2245
|
gap: 1.5,
|
|
2100
2246
|
overflow: "hidden"
|
|
2101
2247
|
},
|
|
2102
|
-
/* @__PURE__ */
|
|
2103
|
-
/* @__PURE__ */
|
|
2248
|
+
/* @__PURE__ */ React37.createElement(TextIcon, { fontSize: "large" }),
|
|
2249
|
+
/* @__PURE__ */ React37.createElement(Box5, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React37.createElement(Typography4, { align: "center", variant: "subtitle2", color: "text.secondary" }, __10("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React37.createElement(
|
|
2104
2250
|
Typography4,
|
|
2105
2251
|
{
|
|
2106
2252
|
variant: "subtitle2",
|
|
@@ -2111,11 +2257,11 @@ var FontFamilySelector = ({
|
|
|
2111
2257
|
justifyContent: "center"
|
|
2112
2258
|
}
|
|
2113
2259
|
},
|
|
2114
|
-
/* @__PURE__ */
|
|
2115
|
-
/* @__PURE__ */
|
|
2116
|
-
/* @__PURE__ */
|
|
2260
|
+
/* @__PURE__ */ React37.createElement("span", null, "\u201C"),
|
|
2261
|
+
/* @__PURE__ */ React37.createElement("span", { style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" } }, searchValue),
|
|
2262
|
+
/* @__PURE__ */ React37.createElement("span", null, "\u201D.")
|
|
2117
2263
|
)),
|
|
2118
|
-
/* @__PURE__ */
|
|
2264
|
+
/* @__PURE__ */ React37.createElement(
|
|
2119
2265
|
Typography4,
|
|
2120
2266
|
{
|
|
2121
2267
|
align: "center",
|
|
@@ -2123,8 +2269,8 @@ var FontFamilySelector = ({
|
|
|
2123
2269
|
color: "text.secondary",
|
|
2124
2270
|
sx: { display: "flex", flexDirection: "column" }
|
|
2125
2271
|
},
|
|
2126
|
-
|
|
2127
|
-
/* @__PURE__ */
|
|
2272
|
+
__10("Try something else.", "elementor"),
|
|
2273
|
+
/* @__PURE__ */ React37.createElement(
|
|
2128
2274
|
Link,
|
|
2129
2275
|
{
|
|
2130
2276
|
color: "secondary",
|
|
@@ -2132,10 +2278,10 @@ var FontFamilySelector = ({
|
|
|
2132
2278
|
component: "button",
|
|
2133
2279
|
onClick: () => setSearchValue("")
|
|
2134
2280
|
},
|
|
2135
|
-
|
|
2281
|
+
__10("Clear & try again", "elementor")
|
|
2136
2282
|
)
|
|
2137
2283
|
)
|
|
2138
|
-
))
|
|
2284
|
+
));
|
|
2139
2285
|
};
|
|
2140
2286
|
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
2141
2287
|
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
@@ -2147,7 +2293,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
2147
2293
|
}
|
|
2148
2294
|
});
|
|
2149
2295
|
}, 100);
|
|
2150
|
-
return /* @__PURE__ */
|
|
2296
|
+
return /* @__PURE__ */ React37.createElement(
|
|
2151
2297
|
PopoverMenuList,
|
|
2152
2298
|
{
|
|
2153
2299
|
items: fontListItems,
|
|
@@ -2172,12 +2318,12 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2172
2318
|
const { value: fontFamily, setValue: setFontFamily, disabled, placeholder } = useBoundProp(stringPropTypeUtil5);
|
|
2173
2319
|
const popoverState = usePopupState5({ variant: "popover" });
|
|
2174
2320
|
const isShowingPlaceholder = !fontFamily && placeholder;
|
|
2175
|
-
return /* @__PURE__ */
|
|
2321
|
+
return /* @__PURE__ */ React38.createElement(React38.Fragment, null, /* @__PURE__ */ React38.createElement(ControlActions, null, /* @__PURE__ */ React38.createElement(
|
|
2176
2322
|
UnstableTag2,
|
|
2177
2323
|
{
|
|
2178
2324
|
variant: "outlined",
|
|
2179
2325
|
label: fontFamily || placeholder,
|
|
2180
|
-
endIcon: /* @__PURE__ */
|
|
2326
|
+
endIcon: /* @__PURE__ */ React38.createElement(ChevronDownIcon2, { fontSize: SIZE3 }),
|
|
2181
2327
|
...bindTrigger3(popoverState),
|
|
2182
2328
|
fullWidth: true,
|
|
2183
2329
|
disabled,
|
|
@@ -2188,7 +2334,7 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2188
2334
|
textTransform: "capitalize"
|
|
2189
2335
|
} : void 0
|
|
2190
2336
|
}
|
|
2191
|
-
)), /* @__PURE__ */
|
|
2337
|
+
)), /* @__PURE__ */ React38.createElement(
|
|
2192
2338
|
Popover4,
|
|
2193
2339
|
{
|
|
2194
2340
|
disablePortal: true,
|
|
@@ -2198,7 +2344,7 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2198
2344
|
sx: { my: 1.5 },
|
|
2199
2345
|
...bindPopover4(popoverState)
|
|
2200
2346
|
},
|
|
2201
|
-
/* @__PURE__ */
|
|
2347
|
+
/* @__PURE__ */ React38.createElement(
|
|
2202
2348
|
FontFamilySelector,
|
|
2203
2349
|
{
|
|
2204
2350
|
fontFamilies,
|
|
@@ -2212,13 +2358,13 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2212
2358
|
});
|
|
2213
2359
|
|
|
2214
2360
|
// src/controls/url-control.tsx
|
|
2215
|
-
import * as
|
|
2361
|
+
import * as React39 from "react";
|
|
2216
2362
|
import { urlPropTypeUtil } from "@elementor/editor-props";
|
|
2217
2363
|
import { TextField as TextField6 } from "@elementor/ui";
|
|
2218
2364
|
var UrlControl = createControl(({ placeholder }) => {
|
|
2219
2365
|
const { value, setValue, disabled } = useBoundProp(urlPropTypeUtil);
|
|
2220
2366
|
const handleChange = (event) => setValue(event.target.value);
|
|
2221
|
-
return /* @__PURE__ */
|
|
2367
|
+
return /* @__PURE__ */ React39.createElement(ControlActions, null, /* @__PURE__ */ React39.createElement(
|
|
2222
2368
|
TextField6,
|
|
2223
2369
|
{
|
|
2224
2370
|
size: "tiny",
|
|
@@ -2232,7 +2378,7 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
2232
2378
|
});
|
|
2233
2379
|
|
|
2234
2380
|
// src/controls/link-control.tsx
|
|
2235
|
-
import * as
|
|
2381
|
+
import * as React42 from "react";
|
|
2236
2382
|
import { useMemo as useMemo3, useState as useState7 } from "react";
|
|
2237
2383
|
import { getLinkInLinkRestriction, selectElement } from "@elementor/editor-elements";
|
|
2238
2384
|
import {
|
|
@@ -2247,17 +2393,17 @@ import { isExperimentActive as isExperimentActive4 } from "@elementor/editor-v1-
|
|
|
2247
2393
|
import { httpService as httpService2 } from "@elementor/http-client";
|
|
2248
2394
|
import { AlertTriangleIcon, MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
2249
2395
|
import { useSessionStorage } from "@elementor/session";
|
|
2250
|
-
import { Box as
|
|
2396
|
+
import { Box as Box7, Collapse, Grid as Grid9, IconButton as IconButton3, Infotip, Stack as Stack10, Switch as Switch2 } from "@elementor/ui";
|
|
2251
2397
|
import { debounce as debounce2 } from "@elementor/utils";
|
|
2252
|
-
import { __ as
|
|
2398
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
2253
2399
|
|
|
2254
2400
|
// src/components/autocomplete.tsx
|
|
2255
|
-
import * as
|
|
2401
|
+
import * as React40 from "react";
|
|
2256
2402
|
import { forwardRef as forwardRef4 } from "react";
|
|
2257
2403
|
import { XIcon as XIcon2 } from "@elementor/icons";
|
|
2258
2404
|
import {
|
|
2259
2405
|
Autocomplete as AutocompleteBase,
|
|
2260
|
-
Box as
|
|
2406
|
+
Box as Box6,
|
|
2261
2407
|
IconButton as IconButton2,
|
|
2262
2408
|
InputAdornment as InputAdornment3,
|
|
2263
2409
|
TextField as TextField7
|
|
@@ -2278,7 +2424,7 @@ var Autocomplete = forwardRef4((props, ref) => {
|
|
|
2278
2424
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
2279
2425
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
2280
2426
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
2281
|
-
return /* @__PURE__ */
|
|
2427
|
+
return /* @__PURE__ */ React40.createElement(
|
|
2282
2428
|
AutocompleteBase,
|
|
2283
2429
|
{
|
|
2284
2430
|
...restProps,
|
|
@@ -2296,8 +2442,8 @@ var Autocomplete = forwardRef4((props, ref) => {
|
|
|
2296
2442
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
2297
2443
|
isOptionEqualToValue,
|
|
2298
2444
|
filterOptions: () => optionKeys,
|
|
2299
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
2300
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2445
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React40.createElement(Box6, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
2446
|
+
renderInput: (params) => /* @__PURE__ */ React40.createElement(
|
|
2301
2447
|
TextInput,
|
|
2302
2448
|
{
|
|
2303
2449
|
params,
|
|
@@ -2320,7 +2466,7 @@ var TextInput = ({
|
|
|
2320
2466
|
const onChange = (event) => {
|
|
2321
2467
|
handleChange(event.target.value);
|
|
2322
2468
|
};
|
|
2323
|
-
return /* @__PURE__ */
|
|
2469
|
+
return /* @__PURE__ */ React40.createElement(
|
|
2324
2470
|
TextField7,
|
|
2325
2471
|
{
|
|
2326
2472
|
...params,
|
|
@@ -2333,7 +2479,7 @@ var TextInput = ({
|
|
|
2333
2479
|
},
|
|
2334
2480
|
InputProps: {
|
|
2335
2481
|
...params.InputProps,
|
|
2336
|
-
endAdornment: /* @__PURE__ */
|
|
2482
|
+
endAdornment: /* @__PURE__ */ React40.createElement(ClearButton, { params, allowClear, handleChange })
|
|
2337
2483
|
}
|
|
2338
2484
|
}
|
|
2339
2485
|
);
|
|
@@ -2342,7 +2488,7 @@ var ClearButton = ({
|
|
|
2342
2488
|
allowClear,
|
|
2343
2489
|
handleChange,
|
|
2344
2490
|
params
|
|
2345
|
-
}) => /* @__PURE__ */
|
|
2491
|
+
}) => /* @__PURE__ */ React40.createElement(InputAdornment3, { position: "end" }, allowClear && /* @__PURE__ */ React40.createElement(IconButton2, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React40.createElement(XIcon2, { fontSize: params.size })));
|
|
2346
2492
|
function findMatchingOption(options, optionId = null) {
|
|
2347
2493
|
const formattedOption = (optionId || "").toString();
|
|
2348
2494
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -2364,7 +2510,7 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
2364
2510
|
}
|
|
2365
2511
|
|
|
2366
2512
|
// src/controls/switch-control.tsx
|
|
2367
|
-
import * as
|
|
2513
|
+
import * as React41 from "react";
|
|
2368
2514
|
import { booleanPropTypeUtil } from "@elementor/editor-props";
|
|
2369
2515
|
import { Switch } from "@elementor/ui";
|
|
2370
2516
|
var SwitchControl = createControl(() => {
|
|
@@ -2372,7 +2518,7 @@ var SwitchControl = createControl(() => {
|
|
|
2372
2518
|
const handleChange = (event) => {
|
|
2373
2519
|
setValue(event.target.checked);
|
|
2374
2520
|
};
|
|
2375
|
-
return /* @__PURE__ */
|
|
2521
|
+
return /* @__PURE__ */ React41.createElement("div", { style: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React41.createElement(
|
|
2376
2522
|
Switch,
|
|
2377
2523
|
{
|
|
2378
2524
|
checked: !!value,
|
|
@@ -2389,7 +2535,7 @@ var SwitchControl = createControl(() => {
|
|
|
2389
2535
|
// src/controls/link-control.tsx
|
|
2390
2536
|
var SIZE4 = "tiny";
|
|
2391
2537
|
var learnMoreButton = {
|
|
2392
|
-
label:
|
|
2538
|
+
label: __11("Learn More", "elementor"),
|
|
2393
2539
|
href: "https://go.elementor.com/element-link-inside-link-infotip"
|
|
2394
2540
|
};
|
|
2395
2541
|
var LinkControl = createControl((props) => {
|
|
@@ -2402,7 +2548,7 @@ var LinkControl = createControl((props) => {
|
|
|
2402
2548
|
placeholder,
|
|
2403
2549
|
minInputLength = 2,
|
|
2404
2550
|
context: { elementId },
|
|
2405
|
-
label =
|
|
2551
|
+
label = __11("Link", "elementor")
|
|
2406
2552
|
} = props || {};
|
|
2407
2553
|
const [linkInLinkRestriction, setLinkInLinkRestriction] = useState7(getLinkInLinkRestriction(elementId));
|
|
2408
2554
|
const [options, setOptions] = useState7(
|
|
@@ -2465,7 +2611,7 @@ var LinkControl = createControl((props) => {
|
|
|
2465
2611
|
),
|
|
2466
2612
|
[endpoint]
|
|
2467
2613
|
);
|
|
2468
|
-
return /* @__PURE__ */
|
|
2614
|
+
return /* @__PURE__ */ React42.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React42.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(
|
|
2469
2615
|
Stack10,
|
|
2470
2616
|
{
|
|
2471
2617
|
direction: "row",
|
|
@@ -2475,17 +2621,17 @@ var LinkControl = createControl((props) => {
|
|
|
2475
2621
|
marginInlineEnd: -0.75
|
|
2476
2622
|
}
|
|
2477
2623
|
},
|
|
2478
|
-
/* @__PURE__ */
|
|
2479
|
-
/* @__PURE__ */
|
|
2624
|
+
/* @__PURE__ */ React42.createElement(ControlFormLabel, null, label),
|
|
2625
|
+
/* @__PURE__ */ React42.createElement(ConditionalInfoTip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React42.createElement(
|
|
2480
2626
|
ToggleIconControl,
|
|
2481
2627
|
{
|
|
2482
2628
|
disabled: shouldDisableAddingLink,
|
|
2483
2629
|
active: isActive,
|
|
2484
2630
|
onIconClick: onEnabledChange,
|
|
2485
|
-
label:
|
|
2631
|
+
label: __11("Toggle link", "elementor")
|
|
2486
2632
|
}
|
|
2487
2633
|
))
|
|
2488
|
-
), /* @__PURE__ */
|
|
2634
|
+
), /* @__PURE__ */ React42.createElement(Collapse, { in: isActive, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React42.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React42.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React42.createElement(ControlActions, null, /* @__PURE__ */ React42.createElement(
|
|
2489
2635
|
Autocomplete,
|
|
2490
2636
|
{
|
|
2491
2637
|
options,
|
|
@@ -2496,21 +2642,21 @@ var LinkControl = createControl((props) => {
|
|
|
2496
2642
|
onTextChange,
|
|
2497
2643
|
minInputLength
|
|
2498
2644
|
}
|
|
2499
|
-
))), /* @__PURE__ */
|
|
2645
|
+
))), /* @__PURE__ */ React42.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React42.createElement(Grid9, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React42.createElement(Grid9, { item: true }, /* @__PURE__ */ React42.createElement(ControlFormLabel, null, __11("Open in a new tab", "elementor"))), /* @__PURE__ */ React42.createElement(Grid9, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React42.createElement(SwitchControlComponent, { disabled: propContext.disabled || !value }))))))));
|
|
2500
2646
|
});
|
|
2501
2647
|
var ToggleIconControl = ({ disabled, active, onIconClick, label }) => {
|
|
2502
|
-
return /* @__PURE__ */
|
|
2648
|
+
return /* @__PURE__ */ React42.createElement(IconButton3, { size: SIZE4, onClick: onIconClick, "aria-label": label, disabled }, active ? /* @__PURE__ */ React42.createElement(MinusIcon, { fontSize: SIZE4 }) : /* @__PURE__ */ React42.createElement(PlusIcon2, { fontSize: SIZE4 }));
|
|
2503
2649
|
};
|
|
2504
2650
|
var SwitchControlComponent = ({ disabled }) => {
|
|
2505
2651
|
const { value, setValue } = useBoundProp(booleanPropTypeUtil2);
|
|
2506
2652
|
const isVersion331Active = isExperimentActive4("e_v_3_31");
|
|
2507
2653
|
if (isVersion331Active) {
|
|
2508
|
-
return /* @__PURE__ */
|
|
2654
|
+
return /* @__PURE__ */ React42.createElement(SwitchControl, null);
|
|
2509
2655
|
}
|
|
2510
2656
|
const onClick = () => {
|
|
2511
2657
|
setValue(!value);
|
|
2512
2658
|
};
|
|
2513
|
-
return /* @__PURE__ */
|
|
2659
|
+
return /* @__PURE__ */ React42.createElement(
|
|
2514
2660
|
Switch2,
|
|
2515
2661
|
{
|
|
2516
2662
|
checked: value ?? false,
|
|
@@ -2557,38 +2703,38 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2557
2703
|
selectElement(elementId);
|
|
2558
2704
|
}
|
|
2559
2705
|
};
|
|
2560
|
-
return shouldRestrict && isVisible ? /* @__PURE__ */
|
|
2706
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React42.createElement(
|
|
2561
2707
|
Infotip,
|
|
2562
2708
|
{
|
|
2563
2709
|
placement: "right",
|
|
2564
|
-
content: /* @__PURE__ */
|
|
2710
|
+
content: /* @__PURE__ */ React42.createElement(
|
|
2565
2711
|
InfoTipCard,
|
|
2566
2712
|
{
|
|
2567
2713
|
content: INFOTIP_CONTENT[reason],
|
|
2568
|
-
svgIcon: /* @__PURE__ */
|
|
2714
|
+
svgIcon: /* @__PURE__ */ React42.createElement(AlertTriangleIcon, null),
|
|
2569
2715
|
learnMoreButton,
|
|
2570
2716
|
ctaButton: {
|
|
2571
|
-
label:
|
|
2717
|
+
label: __11("Take me there", "elementor"),
|
|
2572
2718
|
onClick: handleTakeMeClick
|
|
2573
2719
|
}
|
|
2574
2720
|
}
|
|
2575
2721
|
)
|
|
2576
2722
|
},
|
|
2577
|
-
/* @__PURE__ */
|
|
2578
|
-
) : /* @__PURE__ */
|
|
2723
|
+
/* @__PURE__ */ React42.createElement(Box7, null, children)
|
|
2724
|
+
) : /* @__PURE__ */ React42.createElement(React42.Fragment, null, children);
|
|
2579
2725
|
};
|
|
2580
2726
|
var INFOTIP_CONTENT = {
|
|
2581
|
-
descendant: /* @__PURE__ */
|
|
2582
|
-
ancestor: /* @__PURE__ */
|
|
2727
|
+
descendant: /* @__PURE__ */ React42.createElement(React42.Fragment, null, __11("To add a link to this container,", "elementor"), /* @__PURE__ */ React42.createElement("br", null), __11("first remove the link from the elements inside of it.", "elementor")),
|
|
2728
|
+
ancestor: /* @__PURE__ */ React42.createElement(React42.Fragment, null, __11("To add a link to this element,", "elementor"), /* @__PURE__ */ React42.createElement("br", null), __11("first remove the link from its parent container.", "elementor"))
|
|
2583
2729
|
};
|
|
2584
2730
|
|
|
2585
2731
|
// src/controls/gap-control.tsx
|
|
2586
|
-
import * as
|
|
2587
|
-
import { useRef as
|
|
2732
|
+
import * as React43 from "react";
|
|
2733
|
+
import { useRef as useRef9 } from "react";
|
|
2588
2734
|
import { layoutDirectionPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil4 } from "@elementor/editor-props";
|
|
2589
2735
|
import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/icons";
|
|
2590
|
-
import { Grid as
|
|
2591
|
-
import { __ as
|
|
2736
|
+
import { Grid as Grid10, Stack as Stack11, ToggleButton as ToggleButton4, Tooltip as Tooltip5 } from "@elementor/ui";
|
|
2737
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
2592
2738
|
var GapControl = createControl(({ label }) => {
|
|
2593
2739
|
const {
|
|
2594
2740
|
value: directionValue,
|
|
@@ -2596,7 +2742,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
2596
2742
|
propType,
|
|
2597
2743
|
disabled: directionDisabled
|
|
2598
2744
|
} = useBoundProp(layoutDirectionPropTypeUtil);
|
|
2599
|
-
const stackRef =
|
|
2745
|
+
const stackRef = useRef9(null);
|
|
2600
2746
|
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil4);
|
|
2601
2747
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
2602
2748
|
const onLinkToggle = () => {
|
|
@@ -2612,10 +2758,10 @@ var GapControl = createControl(({ label }) => {
|
|
|
2612
2758
|
};
|
|
2613
2759
|
const tooltipLabel = label.toLowerCase();
|
|
2614
2760
|
const LinkedIcon = isLinked ? LinkIcon2 : DetachIcon2;
|
|
2615
|
-
const linkedLabel =
|
|
2616
|
-
const unlinkedLabel =
|
|
2761
|
+
const linkedLabel = __12("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2762
|
+
const unlinkedLabel = __12("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
2617
2763
|
const disabled = sizeDisabled || directionDisabled;
|
|
2618
|
-
return /* @__PURE__ */
|
|
2764
|
+
return /* @__PURE__ */ React43.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React43.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React43.createElement(ControlLabel, null, label), /* @__PURE__ */ React43.createElement(Tooltip5, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React43.createElement(
|
|
2619
2765
|
ToggleButton4,
|
|
2620
2766
|
{
|
|
2621
2767
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -2626,8 +2772,8 @@ var GapControl = createControl(({ label }) => {
|
|
|
2626
2772
|
onChange: onLinkToggle,
|
|
2627
2773
|
disabled
|
|
2628
2774
|
},
|
|
2629
|
-
/* @__PURE__ */
|
|
2630
|
-
))), /* @__PURE__ */
|
|
2775
|
+
/* @__PURE__ */ React43.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2776
|
+
))), /* @__PURE__ */ React43.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap", ref: stackRef }, /* @__PURE__ */ React43.createElement(Grid10, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React43.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(ControlFormLabel, null, __12("Column", "elementor"))), /* @__PURE__ */ React43.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(Control4, { bind: "column", isLinked, anchorRef: stackRef }))), /* @__PURE__ */ React43.createElement(Grid10, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React43.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(ControlFormLabel, null, __12("Row", "elementor"))), /* @__PURE__ */ React43.createElement(Grid10, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(Control4, { bind: "row", isLinked, anchorRef: stackRef })))));
|
|
2631
2777
|
});
|
|
2632
2778
|
var Control4 = ({
|
|
2633
2779
|
bind,
|
|
@@ -2635,21 +2781,21 @@ var Control4 = ({
|
|
|
2635
2781
|
anchorRef
|
|
2636
2782
|
}) => {
|
|
2637
2783
|
if (isLinked) {
|
|
2638
|
-
return /* @__PURE__ */
|
|
2784
|
+
return /* @__PURE__ */ React43.createElement(SizeControl, { anchorRef });
|
|
2639
2785
|
}
|
|
2640
|
-
return /* @__PURE__ */
|
|
2786
|
+
return /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React43.createElement(SizeControl, { anchorRef }));
|
|
2641
2787
|
};
|
|
2642
2788
|
|
|
2643
2789
|
// src/controls/aspect-ratio-control.tsx
|
|
2644
|
-
import * as
|
|
2790
|
+
import * as React44 from "react";
|
|
2645
2791
|
import { useEffect as useEffect6, useState as useState8 } from "react";
|
|
2646
2792
|
import { stringPropTypeUtil as stringPropTypeUtil7 } from "@elementor/editor-props";
|
|
2647
2793
|
import { MenuListItem as MenuListItem4 } from "@elementor/editor-ui";
|
|
2648
2794
|
import { ArrowsMoveHorizontalIcon, ArrowsMoveVerticalIcon } from "@elementor/icons";
|
|
2649
|
-
import { Grid as
|
|
2650
|
-
import { __ as
|
|
2795
|
+
import { Grid as Grid11, Select as Select3, Stack as Stack12, TextField as TextField8 } from "@elementor/ui";
|
|
2796
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
2651
2797
|
var RATIO_OPTIONS = [
|
|
2652
|
-
{ label:
|
|
2798
|
+
{ label: __13("Auto", "elementor"), value: "auto" },
|
|
2653
2799
|
{ label: "1/1", value: "1/1" },
|
|
2654
2800
|
{ label: "4/3", value: "4/3" },
|
|
2655
2801
|
{ label: "3/4", value: "3/4" },
|
|
@@ -2708,7 +2854,7 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2708
2854
|
setAspectRatioValue(`${customWidth}/${newHeight}`);
|
|
2709
2855
|
}
|
|
2710
2856
|
};
|
|
2711
|
-
return /* @__PURE__ */
|
|
2857
|
+
return /* @__PURE__ */ React44.createElement(ControlActions, null, /* @__PURE__ */ React44.createElement(Stack12, { direction: "column", gap: 2 }, /* @__PURE__ */ React44.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(ControlLabel, null, label)), /* @__PURE__ */ React44.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(
|
|
2712
2858
|
Select3,
|
|
2713
2859
|
{
|
|
2714
2860
|
size: "tiny",
|
|
@@ -2719,10 +2865,10 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2719
2865
|
onChange: handleSelectChange,
|
|
2720
2866
|
fullWidth: true
|
|
2721
2867
|
},
|
|
2722
|
-
[...RATIO_OPTIONS, { label:
|
|
2723
|
-
({ label: optionLabel, ...props }) => /* @__PURE__ */
|
|
2868
|
+
[...RATIO_OPTIONS, { label: __13("Custom", "elementor"), value: CUSTOM_RATIO }].map(
|
|
2869
|
+
({ label: optionLabel, ...props }) => /* @__PURE__ */ React44.createElement(MenuListItem4, { key: props.value, ...props, value: props.value ?? "" }, optionLabel)
|
|
2724
2870
|
)
|
|
2725
|
-
))), isCustom && /* @__PURE__ */
|
|
2871
|
+
))), isCustom && /* @__PURE__ */ React44.createElement(Grid11, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React44.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(
|
|
2726
2872
|
TextField8,
|
|
2727
2873
|
{
|
|
2728
2874
|
size: "tiny",
|
|
@@ -2732,10 +2878,10 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2732
2878
|
value: customWidth,
|
|
2733
2879
|
onChange: handleCustomWidthChange,
|
|
2734
2880
|
InputProps: {
|
|
2735
|
-
startAdornment: /* @__PURE__ */
|
|
2881
|
+
startAdornment: /* @__PURE__ */ React44.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
2736
2882
|
}
|
|
2737
2883
|
}
|
|
2738
|
-
)), /* @__PURE__ */
|
|
2884
|
+
)), /* @__PURE__ */ React44.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React44.createElement(
|
|
2739
2885
|
TextField8,
|
|
2740
2886
|
{
|
|
2741
2887
|
size: "tiny",
|
|
@@ -2745,23 +2891,23 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
2745
2891
|
value: customHeight,
|
|
2746
2892
|
onChange: handleCustomHeightChange,
|
|
2747
2893
|
InputProps: {
|
|
2748
|
-
startAdornment: /* @__PURE__ */
|
|
2894
|
+
startAdornment: /* @__PURE__ */ React44.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
2749
2895
|
}
|
|
2750
2896
|
}
|
|
2751
2897
|
)))));
|
|
2752
2898
|
});
|
|
2753
2899
|
|
|
2754
2900
|
// src/controls/svg-media-control.tsx
|
|
2755
|
-
import * as
|
|
2901
|
+
import * as React46 from "react";
|
|
2756
2902
|
import { useState as useState10 } from "react";
|
|
2757
2903
|
import { imageSrcPropTypeUtil as imageSrcPropTypeUtil2 } from "@elementor/editor-props";
|
|
2758
2904
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
2759
2905
|
import { Button as Button4, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress3, Stack as Stack13, styled as styled4 } from "@elementor/ui";
|
|
2760
2906
|
import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
|
|
2761
|
-
import { __ as
|
|
2907
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
2762
2908
|
|
|
2763
2909
|
// src/components/enable-unfiltered-modal.tsx
|
|
2764
|
-
import * as
|
|
2910
|
+
import * as React45 from "react";
|
|
2765
2911
|
import { useState as useState9 } from "react";
|
|
2766
2912
|
import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
|
|
2767
2913
|
import {
|
|
@@ -2775,19 +2921,19 @@ import {
|
|
|
2775
2921
|
DialogTitle,
|
|
2776
2922
|
Divider as Divider3
|
|
2777
2923
|
} from "@elementor/ui";
|
|
2778
|
-
import { __ as
|
|
2779
|
-
var ADMIN_TITLE_TEXT =
|
|
2780
|
-
var ADMIN_CONTENT_TEXT =
|
|
2924
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
2925
|
+
var ADMIN_TITLE_TEXT = __14("Enable Unfiltered Uploads", "elementor");
|
|
2926
|
+
var ADMIN_CONTENT_TEXT = __14(
|
|
2781
2927
|
"Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.",
|
|
2782
2928
|
"elementor"
|
|
2783
2929
|
);
|
|
2784
|
-
var NON_ADMIN_TITLE_TEXT =
|
|
2785
|
-
var NON_ADMIN_CONTENT_TEXT =
|
|
2930
|
+
var NON_ADMIN_TITLE_TEXT = __14("Sorry, you can't upload that file yet", "elementor");
|
|
2931
|
+
var NON_ADMIN_CONTENT_TEXT = __14(
|
|
2786
2932
|
"This is because this file type may pose a security risk. To upload them anyway, ask the site administrator to enable unfiltered file uploads.",
|
|
2787
2933
|
"elementor"
|
|
2788
2934
|
);
|
|
2789
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT1 =
|
|
2790
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT2 =
|
|
2935
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT1 = __14("Failed to enable unfiltered files upload.", "elementor");
|
|
2936
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT2 = __14(
|
|
2791
2937
|
"You can try again, if the problem persists, please contact support.",
|
|
2792
2938
|
"elementor"
|
|
2793
2939
|
);
|
|
@@ -2814,9 +2960,9 @@ var EnableUnfilteredModal = (props) => {
|
|
|
2814
2960
|
}
|
|
2815
2961
|
};
|
|
2816
2962
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
2817
|
-
return canManageOptions ? /* @__PURE__ */
|
|
2963
|
+
return canManageOptions ? /* @__PURE__ */ React45.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React45.createElement(NonAdminDialog, { ...dialogProps });
|
|
2818
2964
|
};
|
|
2819
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
2965
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React45.createElement(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React45.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React45.createElement(DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React45.createElement(Divider3, null), /* @__PURE__ */ React45.createElement(DialogContent, null, /* @__PURE__ */ React45.createElement(DialogContentText, null, isError ? /* @__PURE__ */ React45.createElement(React45.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ React45.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React45.createElement(DialogActions, null, /* @__PURE__ */ React45.createElement(Button3, { size: "medium", color: "secondary", onClick: () => onClose(false) }, __14("Cancel", "elementor")), /* @__PURE__ */ React45.createElement(
|
|
2820
2966
|
Button3,
|
|
2821
2967
|
{
|
|
2822
2968
|
size: "medium",
|
|
@@ -2825,9 +2971,9 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
2825
2971
|
color: "primary",
|
|
2826
2972
|
disabled: isPending
|
|
2827
2973
|
},
|
|
2828
|
-
isPending ? /* @__PURE__ */
|
|
2974
|
+
isPending ? /* @__PURE__ */ React45.createElement(CircularProgress2, { size: 24 }) : __14("Enable", "elementor")
|
|
2829
2975
|
)));
|
|
2830
|
-
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */
|
|
2976
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React45.createElement(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React45.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React45.createElement(DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React45.createElement(Divider3, null), /* @__PURE__ */ React45.createElement(DialogContent, null, /* @__PURE__ */ React45.createElement(DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React45.createElement(DialogActions, null, /* @__PURE__ */ React45.createElement(Button3, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, __14("Got it", "elementor"))));
|
|
2831
2977
|
|
|
2832
2978
|
// src/controls/svg-media-control.tsx
|
|
2833
2979
|
var TILE_SIZE = 8;
|
|
@@ -2888,15 +3034,15 @@ var SvgMediaControl = createControl(() => {
|
|
|
2888
3034
|
open(openOptions);
|
|
2889
3035
|
}
|
|
2890
3036
|
};
|
|
2891
|
-
return /* @__PURE__ */
|
|
3037
|
+
return /* @__PURE__ */ React46.createElement(Stack13, { gap: 1 }, /* @__PURE__ */ React46.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React46.createElement(ControlActions, null, /* @__PURE__ */ React46.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React46.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React46.createElement(CircularProgress3, { role: "progressbar" }) : /* @__PURE__ */ React46.createElement(
|
|
2892
3038
|
CardMedia2,
|
|
2893
3039
|
{
|
|
2894
3040
|
component: "img",
|
|
2895
3041
|
image: src,
|
|
2896
|
-
alt:
|
|
3042
|
+
alt: __15("Preview SVG", "elementor"),
|
|
2897
3043
|
sx: { maxHeight: "140px", width: "50px" }
|
|
2898
3044
|
}
|
|
2899
|
-
)), /* @__PURE__ */
|
|
3045
|
+
)), /* @__PURE__ */ React46.createElement(
|
|
2900
3046
|
CardOverlay2,
|
|
2901
3047
|
{
|
|
2902
3048
|
sx: {
|
|
@@ -2905,7 +3051,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2905
3051
|
}
|
|
2906
3052
|
}
|
|
2907
3053
|
},
|
|
2908
|
-
/* @__PURE__ */
|
|
3054
|
+
/* @__PURE__ */ React46.createElement(Stack13, { gap: 1 }, /* @__PURE__ */ React46.createElement(
|
|
2909
3055
|
Button4,
|
|
2910
3056
|
{
|
|
2911
3057
|
size: "tiny",
|
|
@@ -2913,46 +3059,46 @@ var SvgMediaControl = createControl(() => {
|
|
|
2913
3059
|
variant: "outlined",
|
|
2914
3060
|
onClick: () => handleClick(MODE_BROWSE)
|
|
2915
3061
|
},
|
|
2916
|
-
|
|
2917
|
-
), /* @__PURE__ */
|
|
3062
|
+
__15("Select SVG", "elementor")
|
|
3063
|
+
), /* @__PURE__ */ React46.createElement(
|
|
2918
3064
|
Button4,
|
|
2919
3065
|
{
|
|
2920
3066
|
size: "tiny",
|
|
2921
3067
|
variant: "text",
|
|
2922
3068
|
color: "inherit",
|
|
2923
|
-
startIcon: /* @__PURE__ */
|
|
3069
|
+
startIcon: /* @__PURE__ */ React46.createElement(UploadIcon2, null),
|
|
2924
3070
|
onClick: () => handleClick(MODE_UPLOAD)
|
|
2925
3071
|
},
|
|
2926
|
-
|
|
3072
|
+
__15("Upload", "elementor")
|
|
2927
3073
|
))
|
|
2928
3074
|
))));
|
|
2929
3075
|
});
|
|
2930
3076
|
|
|
2931
3077
|
// src/controls/background-control/background-control.tsx
|
|
2932
|
-
import * as
|
|
3078
|
+
import * as React53 from "react";
|
|
2933
3079
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
2934
3080
|
import { isExperimentActive as isExperimentActive5 } from "@elementor/editor-v1-adapters";
|
|
2935
|
-
import { Grid as
|
|
2936
|
-
import { __ as
|
|
3081
|
+
import { Grid as Grid16 } from "@elementor/ui";
|
|
3082
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
2937
3083
|
|
|
2938
3084
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
2939
|
-
import * as
|
|
3085
|
+
import * as React52 from "react";
|
|
2940
3086
|
import {
|
|
2941
3087
|
backgroundColorOverlayPropTypeUtil as backgroundColorOverlayPropTypeUtil2,
|
|
2942
3088
|
backgroundImageOverlayPropTypeUtil as backgroundImageOverlayPropTypeUtil2,
|
|
2943
3089
|
backgroundOverlayPropTypeUtil,
|
|
2944
3090
|
colorPropTypeUtil as colorPropTypeUtil3
|
|
2945
3091
|
} from "@elementor/editor-props";
|
|
2946
|
-
import { Box as
|
|
3092
|
+
import { Box as Box8, CardMedia as CardMedia3, styled as styled5, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
2947
3093
|
import { useWpMediaAttachment as useWpMediaAttachment3 } from "@elementor/wp-media";
|
|
2948
|
-
import { __ as
|
|
3094
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
2949
3095
|
|
|
2950
3096
|
// src/env.ts
|
|
2951
3097
|
import { parseEnv } from "@elementor/env";
|
|
2952
3098
|
var { env } = parseEnv("@elementor/editor-controls");
|
|
2953
3099
|
|
|
2954
3100
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
2955
|
-
import * as
|
|
3101
|
+
import * as React47 from "react";
|
|
2956
3102
|
import {
|
|
2957
3103
|
backgroundGradientOverlayPropTypeUtil,
|
|
2958
3104
|
colorPropTypeUtil as colorPropTypeUtil2,
|
|
@@ -2999,7 +3145,7 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2999
3145
|
positions: positions?.value.split(" ")
|
|
3000
3146
|
};
|
|
3001
3147
|
};
|
|
3002
|
-
return /* @__PURE__ */
|
|
3148
|
+
return /* @__PURE__ */ React47.createElement(ControlActions, null, /* @__PURE__ */ React47.createElement(
|
|
3003
3149
|
UnstableGradientBox,
|
|
3004
3150
|
{
|
|
3005
3151
|
sx: { width: "auto", padding: 1.5 },
|
|
@@ -3024,53 +3170,53 @@ var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.cre
|
|
|
3024
3170
|
});
|
|
3025
3171
|
|
|
3026
3172
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
3027
|
-
import * as
|
|
3173
|
+
import * as React48 from "react";
|
|
3028
3174
|
import { PinIcon, PinnedOffIcon } from "@elementor/icons";
|
|
3029
|
-
import { Grid as
|
|
3030
|
-
import { __ as
|
|
3175
|
+
import { Grid as Grid12 } from "@elementor/ui";
|
|
3176
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
3031
3177
|
var attachmentControlOptions = [
|
|
3032
3178
|
{
|
|
3033
3179
|
value: "fixed",
|
|
3034
|
-
label:
|
|
3035
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3180
|
+
label: __16("Fixed", "elementor"),
|
|
3181
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(PinIcon, { fontSize: size }),
|
|
3036
3182
|
showTooltip: true
|
|
3037
3183
|
},
|
|
3038
3184
|
{
|
|
3039
3185
|
value: "scroll",
|
|
3040
|
-
label:
|
|
3041
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3186
|
+
label: __16("Scroll", "elementor"),
|
|
3187
|
+
renderContent: ({ size }) => /* @__PURE__ */ React48.createElement(PinnedOffIcon, { fontSize: size }),
|
|
3042
3188
|
showTooltip: true
|
|
3043
3189
|
}
|
|
3044
3190
|
];
|
|
3045
3191
|
var BackgroundImageOverlayAttachment = () => {
|
|
3046
|
-
return /* @__PURE__ */
|
|
3192
|
+
return /* @__PURE__ */ React48.createElement(PopoverGridContainer, null, /* @__PURE__ */ React48.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React48.createElement(ControlFormLabel, null, __16("Attachment", "elementor"))), /* @__PURE__ */ React48.createElement(Grid12, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React48.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
3047
3193
|
};
|
|
3048
3194
|
|
|
3049
3195
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
3050
|
-
import * as
|
|
3051
|
-
import { useRef as
|
|
3196
|
+
import * as React49 from "react";
|
|
3197
|
+
import { useRef as useRef10 } from "react";
|
|
3052
3198
|
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil9 } from "@elementor/editor-props";
|
|
3053
3199
|
import { MenuListItem as MenuListItem5 } from "@elementor/editor-ui";
|
|
3054
3200
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
3055
|
-
import { Grid as
|
|
3056
|
-
import { __ as
|
|
3201
|
+
import { Grid as Grid13, Select as Select4 } from "@elementor/ui";
|
|
3202
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
3057
3203
|
var backgroundPositionOptions = [
|
|
3058
|
-
{ label:
|
|
3059
|
-
{ label:
|
|
3060
|
-
{ label:
|
|
3061
|
-
{ label:
|
|
3062
|
-
{ label:
|
|
3063
|
-
{ label:
|
|
3064
|
-
{ label:
|
|
3065
|
-
{ label:
|
|
3066
|
-
{ label:
|
|
3067
|
-
{ label:
|
|
3204
|
+
{ label: __17("Center center", "elementor"), value: "center center" },
|
|
3205
|
+
{ label: __17("Center left", "elementor"), value: "center left" },
|
|
3206
|
+
{ label: __17("Center right", "elementor"), value: "center right" },
|
|
3207
|
+
{ label: __17("Top center", "elementor"), value: "top center" },
|
|
3208
|
+
{ label: __17("Top left", "elementor"), value: "top left" },
|
|
3209
|
+
{ label: __17("Top right", "elementor"), value: "top right" },
|
|
3210
|
+
{ label: __17("Bottom center", "elementor"), value: "bottom center" },
|
|
3211
|
+
{ label: __17("Bottom left", "elementor"), value: "bottom left" },
|
|
3212
|
+
{ label: __17("Bottom right", "elementor"), value: "bottom right" },
|
|
3213
|
+
{ label: __17("Custom", "elementor"), value: "custom" }
|
|
3068
3214
|
];
|
|
3069
3215
|
var BackgroundImageOverlayPosition = () => {
|
|
3070
3216
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
3071
3217
|
const stringPropContext = useBoundProp(stringPropTypeUtil9);
|
|
3072
3218
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
3073
|
-
const rowRef =
|
|
3219
|
+
const rowRef = useRef10(null);
|
|
3074
3220
|
const handlePositionChange = (event) => {
|
|
3075
3221
|
const value = event.target.value || null;
|
|
3076
3222
|
if (value === "custom") {
|
|
@@ -3079,7 +3225,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3079
3225
|
stringPropContext.setValue(value);
|
|
3080
3226
|
}
|
|
3081
3227
|
};
|
|
3082
|
-
return /* @__PURE__ */
|
|
3228
|
+
return /* @__PURE__ */ React49.createElement(Grid13, { container: true, spacing: 1.5 }, /* @__PURE__ */ React49.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(PopoverGridContainer, null, /* @__PURE__ */ React49.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(ControlFormLabel, null, __17("Position", "elementor"))), /* @__PURE__ */ React49.createElement(Grid13, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React49.createElement(
|
|
3083
3229
|
Select4,
|
|
3084
3230
|
{
|
|
3085
3231
|
fullWidth: true,
|
|
@@ -3088,60 +3234,60 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3088
3234
|
disabled: stringPropContext.disabled,
|
|
3089
3235
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
|
|
3090
3236
|
},
|
|
3091
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
3092
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3237
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React49.createElement(MenuListItem5, { key: value, value: value ?? "" }, label))
|
|
3238
|
+
)))), isCustom ? /* @__PURE__ */ React49.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React49.createElement(Grid13, { item: true, xs: 12 }, /* @__PURE__ */ React49.createElement(Grid13, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React49.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React49.createElement(
|
|
3093
3239
|
SizeControl,
|
|
3094
3240
|
{
|
|
3095
|
-
startIcon: /* @__PURE__ */
|
|
3241
|
+
startIcon: /* @__PURE__ */ React49.createElement(LetterXIcon, { fontSize: "tiny" }),
|
|
3096
3242
|
anchorRef: rowRef
|
|
3097
3243
|
}
|
|
3098
|
-
))), /* @__PURE__ */
|
|
3244
|
+
))), /* @__PURE__ */ React49.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React49.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React49.createElement(
|
|
3099
3245
|
SizeControl,
|
|
3100
3246
|
{
|
|
3101
|
-
startIcon: /* @__PURE__ */
|
|
3247
|
+
startIcon: /* @__PURE__ */ React49.createElement(LetterYIcon, { fontSize: "tiny" }),
|
|
3102
3248
|
anchorRef: rowRef
|
|
3103
3249
|
}
|
|
3104
3250
|
)))))) : null);
|
|
3105
3251
|
};
|
|
3106
3252
|
|
|
3107
3253
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
3108
|
-
import * as
|
|
3254
|
+
import * as React50 from "react";
|
|
3109
3255
|
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon3 } from "@elementor/icons";
|
|
3110
|
-
import { Grid as
|
|
3111
|
-
import { __ as
|
|
3256
|
+
import { Grid as Grid14 } from "@elementor/ui";
|
|
3257
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
3112
3258
|
var repeatControlOptions = [
|
|
3113
3259
|
{
|
|
3114
3260
|
value: "repeat",
|
|
3115
|
-
label:
|
|
3116
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3261
|
+
label: __18("Repeat", "elementor"),
|
|
3262
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(GridDotsIcon, { fontSize: size }),
|
|
3117
3263
|
showTooltip: true
|
|
3118
3264
|
},
|
|
3119
3265
|
{
|
|
3120
3266
|
value: "repeat-x",
|
|
3121
|
-
label:
|
|
3122
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3267
|
+
label: __18("Repeat-x", "elementor"),
|
|
3268
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(DotsHorizontalIcon, { fontSize: size }),
|
|
3123
3269
|
showTooltip: true
|
|
3124
3270
|
},
|
|
3125
3271
|
{
|
|
3126
3272
|
value: "repeat-y",
|
|
3127
|
-
label:
|
|
3128
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3273
|
+
label: __18("Repeat-y", "elementor"),
|
|
3274
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(DotsVerticalIcon, { fontSize: size }),
|
|
3129
3275
|
showTooltip: true
|
|
3130
3276
|
},
|
|
3131
3277
|
{
|
|
3132
3278
|
value: "no-repeat",
|
|
3133
|
-
label:
|
|
3134
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3279
|
+
label: __18("No-repeat", "elementor"),
|
|
3280
|
+
renderContent: ({ size }) => /* @__PURE__ */ React50.createElement(XIcon3, { fontSize: size }),
|
|
3135
3281
|
showTooltip: true
|
|
3136
3282
|
}
|
|
3137
3283
|
];
|
|
3138
3284
|
var BackgroundImageOverlayRepeat = () => {
|
|
3139
|
-
return /* @__PURE__ */
|
|
3285
|
+
return /* @__PURE__ */ React50.createElement(PopoverGridContainer, null, /* @__PURE__ */ React50.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React50.createElement(ControlFormLabel, null, __18("Repeat", "elementor"))), /* @__PURE__ */ React50.createElement(Grid14, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React50.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
3140
3286
|
};
|
|
3141
3287
|
|
|
3142
3288
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
3143
|
-
import * as
|
|
3144
|
-
import { useRef as
|
|
3289
|
+
import * as React51 from "react";
|
|
3290
|
+
import { useRef as useRef11 } from "react";
|
|
3145
3291
|
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil10 } from "@elementor/editor-props";
|
|
3146
3292
|
import {
|
|
3147
3293
|
ArrowBarBothIcon,
|
|
@@ -3151,31 +3297,31 @@ import {
|
|
|
3151
3297
|
LetterAIcon,
|
|
3152
3298
|
PencilIcon as PencilIcon2
|
|
3153
3299
|
} from "@elementor/icons";
|
|
3154
|
-
import { Grid as
|
|
3155
|
-
import { __ as
|
|
3300
|
+
import { Grid as Grid15 } from "@elementor/ui";
|
|
3301
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
3156
3302
|
var sizeControlOptions = [
|
|
3157
3303
|
{
|
|
3158
3304
|
value: "auto",
|
|
3159
|
-
label:
|
|
3160
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3305
|
+
label: __19("Auto", "elementor"),
|
|
3306
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(LetterAIcon, { fontSize: size }),
|
|
3161
3307
|
showTooltip: true
|
|
3162
3308
|
},
|
|
3163
3309
|
{
|
|
3164
3310
|
value: "cover",
|
|
3165
|
-
label:
|
|
3166
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3311
|
+
label: __19("Cover", "elementor"),
|
|
3312
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(ArrowsMaximizeIcon, { fontSize: size }),
|
|
3167
3313
|
showTooltip: true
|
|
3168
3314
|
},
|
|
3169
3315
|
{
|
|
3170
3316
|
value: "contain",
|
|
3171
|
-
label:
|
|
3172
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3317
|
+
label: __19("Contain", "elementor"),
|
|
3318
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(ArrowBarBothIcon, { fontSize: size }),
|
|
3173
3319
|
showTooltip: true
|
|
3174
3320
|
},
|
|
3175
3321
|
{
|
|
3176
3322
|
value: "custom",
|
|
3177
|
-
label:
|
|
3178
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3323
|
+
label: __19("Custom", "elementor"),
|
|
3324
|
+
renderContent: ({ size }) => /* @__PURE__ */ React51.createElement(PencilIcon2, { fontSize: size }),
|
|
3179
3325
|
showTooltip: true
|
|
3180
3326
|
}
|
|
3181
3327
|
];
|
|
@@ -3183,7 +3329,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3183
3329
|
const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
|
|
3184
3330
|
const stringPropContext = useBoundProp(stringPropTypeUtil10);
|
|
3185
3331
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
3186
|
-
const rowRef =
|
|
3332
|
+
const rowRef = useRef11(null);
|
|
3187
3333
|
const handleSizeChange = (size) => {
|
|
3188
3334
|
if (size === "custom") {
|
|
3189
3335
|
backgroundImageScaleContext.setValue({ width: null, height: null });
|
|
@@ -3191,7 +3337,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3191
3337
|
stringPropContext.setValue(size);
|
|
3192
3338
|
}
|
|
3193
3339
|
};
|
|
3194
|
-
return /* @__PURE__ */
|
|
3340
|
+
return /* @__PURE__ */ React51.createElement(Grid15, { container: true, spacing: 1.5 }, /* @__PURE__ */ React51.createElement(Grid15, { item: true, xs: 12 }, /* @__PURE__ */ React51.createElement(PopoverGridContainer, null, /* @__PURE__ */ React51.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(ControlFormLabel, null, __19("Size", "elementor"))), /* @__PURE__ */ React51.createElement(Grid15, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React51.createElement(
|
|
3195
3341
|
ControlToggleButtonGroup,
|
|
3196
3342
|
{
|
|
3197
3343
|
exclusive: true,
|
|
@@ -3200,17 +3346,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3200
3346
|
disabled: stringPropContext.disabled,
|
|
3201
3347
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
|
|
3202
3348
|
}
|
|
3203
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3349
|
+
)))), isCustom ? /* @__PURE__ */ React51.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React51.createElement(Grid15, { item: true, xs: 12, ref: rowRef }, /* @__PURE__ */ React51.createElement(PopoverGridContainer, null, /* @__PURE__ */ React51.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React51.createElement(
|
|
3204
3350
|
SizeControl,
|
|
3205
3351
|
{
|
|
3206
|
-
startIcon: /* @__PURE__ */
|
|
3352
|
+
startIcon: /* @__PURE__ */ React51.createElement(ArrowsMoveHorizontalIcon2, { fontSize: "tiny" }),
|
|
3207
3353
|
extendedOptions: ["auto"],
|
|
3208
3354
|
anchorRef: rowRef
|
|
3209
3355
|
}
|
|
3210
|
-
))), /* @__PURE__ */
|
|
3356
|
+
))), /* @__PURE__ */ React51.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React51.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React51.createElement(
|
|
3211
3357
|
SizeControl,
|
|
3212
3358
|
{
|
|
3213
|
-
startIcon: /* @__PURE__ */
|
|
3359
|
+
startIcon: /* @__PURE__ */ React51.createElement(ArrowsMoveVerticalIcon2, { fontSize: "tiny" }),
|
|
3214
3360
|
extendedOptions: ["auto"],
|
|
3215
3361
|
anchorRef: rowRef
|
|
3216
3362
|
}
|
|
@@ -3218,7 +3364,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3218
3364
|
};
|
|
3219
3365
|
|
|
3220
3366
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
3221
|
-
import { useRef as
|
|
3367
|
+
import { useRef as useRef12 } from "react";
|
|
3222
3368
|
import {
|
|
3223
3369
|
backgroundColorOverlayPropTypeUtil,
|
|
3224
3370
|
backgroundGradientOverlayPropTypeUtil as backgroundGradientOverlayPropTypeUtil2,
|
|
@@ -3243,7 +3389,7 @@ var useBackgroundTabsHistory = ({
|
|
|
3243
3389
|
return "image";
|
|
3244
3390
|
};
|
|
3245
3391
|
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(getCurrentOverlayType());
|
|
3246
|
-
const valuesHistory =
|
|
3392
|
+
const valuesHistory = useRef12({
|
|
3247
3393
|
image: initialBackgroundImageOverlay,
|
|
3248
3394
|
color: initialBackgroundColorOverlay2,
|
|
3249
3395
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -3311,21 +3457,21 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
3311
3457
|
}
|
|
3312
3458
|
});
|
|
3313
3459
|
var backgroundResolutionOptions = [
|
|
3314
|
-
{ label:
|
|
3315
|
-
{ label:
|
|
3316
|
-
{ label:
|
|
3317
|
-
{ label:
|
|
3460
|
+
{ label: __20("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
3461
|
+
{ label: __20("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
3462
|
+
{ label: __20("Large 1024 x 1024", "elementor"), value: "large" },
|
|
3463
|
+
{ label: __20("Full", "elementor"), value: "full" }
|
|
3318
3464
|
];
|
|
3319
3465
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
3320
3466
|
const { propType, value: overlayValues, setValue, disabled } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
3321
|
-
return /* @__PURE__ */
|
|
3467
|
+
return /* @__PURE__ */ React52.createElement(PropProvider, { propType, value: overlayValues, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React52.createElement(
|
|
3322
3468
|
Repeater,
|
|
3323
3469
|
{
|
|
3324
3470
|
openOnAdd: true,
|
|
3325
3471
|
disabled,
|
|
3326
3472
|
values: overlayValues ?? [],
|
|
3327
3473
|
setValues: setValue,
|
|
3328
|
-
label:
|
|
3474
|
+
label: __20("Overlay", "elementor"),
|
|
3329
3475
|
itemSettings: {
|
|
3330
3476
|
Icon: ItemIcon3,
|
|
3331
3477
|
Label: ItemLabel3,
|
|
@@ -3336,7 +3482,7 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
3336
3482
|
));
|
|
3337
3483
|
});
|
|
3338
3484
|
var ItemContent3 = ({ anchorEl = null, bind }) => {
|
|
3339
|
-
return /* @__PURE__ */
|
|
3485
|
+
return /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React52.createElement(Content3, { anchorEl }));
|
|
3340
3486
|
};
|
|
3341
3487
|
var Content3 = ({ anchorEl }) => {
|
|
3342
3488
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
@@ -3344,27 +3490,27 @@ var Content3 = ({ anchorEl }) => {
|
|
|
3344
3490
|
color: initialBackgroundColorOverlay.value,
|
|
3345
3491
|
gradient: initialBackgroundGradientOverlay.value
|
|
3346
3492
|
});
|
|
3347
|
-
return /* @__PURE__ */
|
|
3493
|
+
return /* @__PURE__ */ React52.createElement(Box8, { sx: { width: "100%" } }, /* @__PURE__ */ React52.createElement(Box8, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React52.createElement(
|
|
3348
3494
|
Tabs,
|
|
3349
3495
|
{
|
|
3350
3496
|
size: "small",
|
|
3351
3497
|
variant: "fullWidth",
|
|
3352
3498
|
...getTabsProps(),
|
|
3353
|
-
"aria-label":
|
|
3499
|
+
"aria-label": __20("Background Overlay", "elementor")
|
|
3354
3500
|
},
|
|
3355
|
-
/* @__PURE__ */
|
|
3356
|
-
/* @__PURE__ */
|
|
3357
|
-
/* @__PURE__ */
|
|
3358
|
-
)), /* @__PURE__ */
|
|
3501
|
+
/* @__PURE__ */ React52.createElement(Tab, { label: __20("Image", "elementor"), ...getTabProps("image") }),
|
|
3502
|
+
/* @__PURE__ */ React52.createElement(Tab, { label: __20("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
3503
|
+
/* @__PURE__ */ React52.createElement(Tab, { label: __20("Color", "elementor"), ...getTabProps("color") })
|
|
3504
|
+
)), /* @__PURE__ */ React52.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React52.createElement(PopoverContent, null, /* @__PURE__ */ React52.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React52.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React52.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React52.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React52.createElement(PopoverContent, null, /* @__PURE__ */ React52.createElement(ColorOverlayContent, { anchorEl }))));
|
|
3359
3505
|
};
|
|
3360
3506
|
var ItemIcon3 = ({ value }) => {
|
|
3361
3507
|
switch (value.$$type) {
|
|
3362
3508
|
case "background-image-overlay":
|
|
3363
|
-
return /* @__PURE__ */
|
|
3509
|
+
return /* @__PURE__ */ React52.createElement(ItemIconImage, { value });
|
|
3364
3510
|
case "background-color-overlay":
|
|
3365
|
-
return /* @__PURE__ */
|
|
3511
|
+
return /* @__PURE__ */ React52.createElement(ItemIconColor, { value });
|
|
3366
3512
|
case "background-gradient-overlay":
|
|
3367
|
-
return /* @__PURE__ */
|
|
3513
|
+
return /* @__PURE__ */ React52.createElement(ItemIconGradient, { value });
|
|
3368
3514
|
default:
|
|
3369
3515
|
return null;
|
|
3370
3516
|
}
|
|
@@ -3377,11 +3523,11 @@ var extractColorFrom = (prop) => {
|
|
|
3377
3523
|
};
|
|
3378
3524
|
var ItemIconColor = ({ value: prop }) => {
|
|
3379
3525
|
const color = extractColorFrom(prop);
|
|
3380
|
-
return /* @__PURE__ */
|
|
3526
|
+
return /* @__PURE__ */ React52.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: color });
|
|
3381
3527
|
};
|
|
3382
3528
|
var ItemIconImage = ({ value }) => {
|
|
3383
3529
|
const { imageUrl } = useImage(value);
|
|
3384
|
-
return /* @__PURE__ */
|
|
3530
|
+
return /* @__PURE__ */ React52.createElement(
|
|
3385
3531
|
CardMedia3,
|
|
3386
3532
|
{
|
|
3387
3533
|
image: imageUrl,
|
|
@@ -3396,41 +3542,41 @@ var ItemIconImage = ({ value }) => {
|
|
|
3396
3542
|
};
|
|
3397
3543
|
var ItemIconGradient = ({ value }) => {
|
|
3398
3544
|
const gradient = getGradientValue(value);
|
|
3399
|
-
return /* @__PURE__ */
|
|
3545
|
+
return /* @__PURE__ */ React52.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
3400
3546
|
};
|
|
3401
3547
|
var ItemLabel3 = ({ value }) => {
|
|
3402
3548
|
switch (value.$$type) {
|
|
3403
3549
|
case "background-image-overlay":
|
|
3404
|
-
return /* @__PURE__ */
|
|
3550
|
+
return /* @__PURE__ */ React52.createElement(ItemLabelImage, { value });
|
|
3405
3551
|
case "background-color-overlay":
|
|
3406
|
-
return /* @__PURE__ */
|
|
3552
|
+
return /* @__PURE__ */ React52.createElement(ItemLabelColor, { value });
|
|
3407
3553
|
case "background-gradient-overlay":
|
|
3408
|
-
return /* @__PURE__ */
|
|
3554
|
+
return /* @__PURE__ */ React52.createElement(ItemLabelGradient, { value });
|
|
3409
3555
|
default:
|
|
3410
3556
|
return null;
|
|
3411
3557
|
}
|
|
3412
3558
|
};
|
|
3413
3559
|
var ItemLabelColor = ({ value: prop }) => {
|
|
3414
3560
|
const color = extractColorFrom(prop);
|
|
3415
|
-
return /* @__PURE__ */
|
|
3561
|
+
return /* @__PURE__ */ React52.createElement("span", null, color);
|
|
3416
3562
|
};
|
|
3417
3563
|
var ItemLabelImage = ({ value }) => {
|
|
3418
3564
|
const { imageTitle } = useImage(value);
|
|
3419
|
-
return /* @__PURE__ */
|
|
3565
|
+
return /* @__PURE__ */ React52.createElement("span", null, imageTitle);
|
|
3420
3566
|
};
|
|
3421
3567
|
var ItemLabelGradient = ({ value }) => {
|
|
3422
3568
|
if (value.value.type.value === "linear") {
|
|
3423
|
-
return /* @__PURE__ */
|
|
3569
|
+
return /* @__PURE__ */ React52.createElement("span", null, __20("Linear Gradient", "elementor"));
|
|
3424
3570
|
}
|
|
3425
|
-
return /* @__PURE__ */
|
|
3571
|
+
return /* @__PURE__ */ React52.createElement("span", null, __20("Radial Gradient", "elementor"));
|
|
3426
3572
|
};
|
|
3427
3573
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
3428
3574
|
const propContext = useBoundProp(backgroundColorOverlayPropTypeUtil2);
|
|
3429
|
-
return /* @__PURE__ */
|
|
3575
|
+
return /* @__PURE__ */ React52.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React52.createElement(ColorControl, { anchorEl })));
|
|
3430
3576
|
};
|
|
3431
3577
|
var ImageOverlayContent = () => {
|
|
3432
3578
|
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil2);
|
|
3433
|
-
return /* @__PURE__ */
|
|
3579
|
+
return /* @__PURE__ */ React52.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React52.createElement(ImageControl, { sizes: backgroundResolutionOptions })), /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React52.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React52.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React52.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React52.createElement(BackgroundImageOverlayAttachment, null)));
|
|
3434
3580
|
};
|
|
3435
3581
|
var StyledUnstableColorIndicator = styled5(UnstableColorIndicator2)(({ theme }) => ({
|
|
3436
3582
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
@@ -3469,15 +3615,15 @@ var getGradientValue = (value) => {
|
|
|
3469
3615
|
var BackgroundControl = createControl(() => {
|
|
3470
3616
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
3471
3617
|
const isUsingNestedProps = isExperimentActive5("e_v_3_30");
|
|
3472
|
-
const colorLabel =
|
|
3473
|
-
return /* @__PURE__ */
|
|
3618
|
+
const colorLabel = __21("Color", "elementor");
|
|
3619
|
+
return /* @__PURE__ */ React53.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React53.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React53.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React53.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React53.createElement(Grid16, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React53.createElement(Grid16, { item: true, xs: 6 }, isUsingNestedProps ? /* @__PURE__ */ React53.createElement(ControlLabel, null, colorLabel) : /* @__PURE__ */ React53.createElement(ControlFormLabel, null, colorLabel)), /* @__PURE__ */ React53.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React53.createElement(ColorControl, null)))));
|
|
3474
3620
|
});
|
|
3475
3621
|
|
|
3476
3622
|
// src/controls/repeatable-control.tsx
|
|
3477
|
-
import * as
|
|
3623
|
+
import * as React54 from "react";
|
|
3478
3624
|
import { useMemo as useMemo4 } from "react";
|
|
3479
3625
|
import { createArrayPropUtils } from "@elementor/editor-props";
|
|
3480
|
-
import { Box as
|
|
3626
|
+
import { Box as Box9 } from "@elementor/ui";
|
|
3481
3627
|
|
|
3482
3628
|
// src/hooks/use-repeatable-control-context.ts
|
|
3483
3629
|
import { createContext as createContext6, useContext as useContext6 } from "react";
|
|
@@ -3491,6 +3637,7 @@ var useRepeatableControlContext = () => {
|
|
|
3491
3637
|
};
|
|
3492
3638
|
|
|
3493
3639
|
// src/controls/repeatable-control.tsx
|
|
3640
|
+
var PLACEHOLDER_REGEX = /\$\{([^}]+)\}/g;
|
|
3494
3641
|
var RepeatableControl = createControl(
|
|
3495
3642
|
({
|
|
3496
3643
|
repeaterLabel,
|
|
@@ -3518,7 +3665,7 @@ var RepeatableControl = createControl(
|
|
|
3518
3665
|
[childControlConfig, placeholder, patternLabel]
|
|
3519
3666
|
);
|
|
3520
3667
|
const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
3521
|
-
return /* @__PURE__ */
|
|
3668
|
+
return /* @__PURE__ */ React54.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React54.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React54.createElement(
|
|
3522
3669
|
Repeater,
|
|
3523
3670
|
{
|
|
3524
3671
|
openOnAdd: true,
|
|
@@ -3539,21 +3686,38 @@ var RepeatableControl = createControl(
|
|
|
3539
3686
|
}
|
|
3540
3687
|
);
|
|
3541
3688
|
var ItemContent4 = ({ bind }) => {
|
|
3542
|
-
return /* @__PURE__ */
|
|
3689
|
+
return /* @__PURE__ */ React54.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React54.createElement(Content4, null));
|
|
3543
3690
|
};
|
|
3544
|
-
var ItemIcon4 = () => /* @__PURE__ */
|
|
3691
|
+
var ItemIcon4 = () => /* @__PURE__ */ React54.createElement(React54.Fragment, null);
|
|
3545
3692
|
var Content4 = () => {
|
|
3546
3693
|
const { component: ChildControl, props = {} } = useRepeatableControlContext();
|
|
3547
|
-
return /* @__PURE__ */
|
|
3694
|
+
return /* @__PURE__ */ React54.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React54.createElement(PopoverGridContainer, null, /* @__PURE__ */ React54.createElement(ChildControl, { ...props })));
|
|
3548
3695
|
};
|
|
3549
3696
|
var interpolate = (template, data) => {
|
|
3550
3697
|
if (!data) {
|
|
3551
3698
|
return template;
|
|
3552
3699
|
}
|
|
3553
|
-
return
|
|
3700
|
+
return template.replace(PLACEHOLDER_REGEX, (_, path) => {
|
|
3701
|
+
const value = getNestedValue(data, path);
|
|
3702
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
3703
|
+
if (value.name) {
|
|
3704
|
+
return value.name;
|
|
3705
|
+
}
|
|
3706
|
+
return JSON.stringify(value);
|
|
3707
|
+
}
|
|
3708
|
+
if (Array.isArray(value)) {
|
|
3709
|
+
return value.join(", ");
|
|
3710
|
+
}
|
|
3711
|
+
return String(value ?? "");
|
|
3712
|
+
});
|
|
3554
3713
|
};
|
|
3555
3714
|
var getNestedValue = (obj, path) => {
|
|
3556
|
-
return path.split(".").reduce((current, key) =>
|
|
3715
|
+
return path.split(".").reduce((current, key) => {
|
|
3716
|
+
if (current && typeof current === "object") {
|
|
3717
|
+
return current[key];
|
|
3718
|
+
}
|
|
3719
|
+
return {};
|
|
3720
|
+
}, obj);
|
|
3557
3721
|
};
|
|
3558
3722
|
var isEmptyValue = (val) => {
|
|
3559
3723
|
if (typeof val === "string") {
|
|
@@ -3565,8 +3729,8 @@ var isEmptyValue = (val) => {
|
|
|
3565
3729
|
if (Array.isArray(val)) {
|
|
3566
3730
|
return val.length === 0;
|
|
3567
3731
|
}
|
|
3568
|
-
if (typeof val === "object" && val !== null
|
|
3569
|
-
return
|
|
3732
|
+
if (typeof val === "object" && val !== null) {
|
|
3733
|
+
return Object.keys(val).length === 0;
|
|
3570
3734
|
}
|
|
3571
3735
|
return false;
|
|
3572
3736
|
};
|
|
@@ -3587,64 +3751,75 @@ var shouldShowPlaceholder = (pattern, data) => {
|
|
|
3587
3751
|
var ItemLabel4 = ({ value }) => {
|
|
3588
3752
|
const { placeholder, patternLabel } = useRepeatableControlContext();
|
|
3589
3753
|
const label = shouldShowPlaceholder(patternLabel, value) ? placeholder : interpolate(patternLabel, value);
|
|
3590
|
-
return /* @__PURE__ */
|
|
3754
|
+
return /* @__PURE__ */ React54.createElement(Box9, { component: "span", color: "text.tertiary" }, label);
|
|
3591
3755
|
};
|
|
3592
3756
|
var getAllProperties = (pattern) => {
|
|
3593
|
-
const properties = pattern.match(
|
|
3594
|
-
(match) => match.slice(2, -1)
|
|
3595
|
-
) || [];
|
|
3757
|
+
const properties = pattern.match(PLACEHOLDER_REGEX)?.map((match) => match.slice(2, -1)) || [];
|
|
3596
3758
|
return properties;
|
|
3597
3759
|
};
|
|
3598
3760
|
|
|
3599
3761
|
// src/controls/key-value-control.tsx
|
|
3600
|
-
import * as
|
|
3762
|
+
import * as React55 from "react";
|
|
3601
3763
|
import { useMemo as useMemo5, useState as useState11 } from "react";
|
|
3602
|
-
import {
|
|
3603
|
-
|
|
3604
|
-
|
|
3764
|
+
import {
|
|
3765
|
+
isTransformable,
|
|
3766
|
+
keyValuePropTypeUtil,
|
|
3767
|
+
stringPropTypeUtil as stringPropTypeUtil11
|
|
3768
|
+
} from "@elementor/editor-props";
|
|
3769
|
+
import { FormHelperText, FormLabel as FormLabel3, Grid as Grid17 } from "@elementor/ui";
|
|
3770
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
3605
3771
|
var KeyValueControl = createControl((props = {}) => {
|
|
3606
|
-
const { value, setValue } = useBoundProp(keyValuePropTypeUtil);
|
|
3607
|
-
const [keyError, setKeyError] = useState11(
|
|
3608
|
-
const [valueError, setValueError] = useState11(
|
|
3772
|
+
const { value, setValue, ...propContext } = useBoundProp(keyValuePropTypeUtil);
|
|
3773
|
+
const [keyError, setKeyError] = useState11("");
|
|
3774
|
+
const [valueError, setValueError] = useState11("");
|
|
3609
3775
|
const [sessionState, setSessionState] = useState11({
|
|
3610
3776
|
key: value?.key?.value || "",
|
|
3611
3777
|
value: value?.value?.value || ""
|
|
3612
3778
|
});
|
|
3613
|
-
const keyLabel = props.keyName ||
|
|
3614
|
-
const valueLabel = props.valueName ||
|
|
3779
|
+
const keyLabel = props.keyName || __22("Key", "elementor");
|
|
3780
|
+
const valueLabel = props.valueName || __22("Value", "elementor");
|
|
3615
3781
|
const [keyRegex, valueRegex, errMsg] = useMemo5(
|
|
3616
3782
|
() => [
|
|
3617
3783
|
props.regexKey ? new RegExp(props.regexKey) : void 0,
|
|
3618
3784
|
props.regexValue ? new RegExp(props.regexValue) : void 0,
|
|
3619
|
-
props.validationErrorMessage ||
|
|
3785
|
+
props.validationErrorMessage || __22("Invalid Format", "elementor")
|
|
3620
3786
|
],
|
|
3621
3787
|
[props.regexKey, props.regexValue, props.validationErrorMessage]
|
|
3622
3788
|
);
|
|
3623
3789
|
const validate = (newValue, fieldType) => {
|
|
3624
3790
|
if (fieldType === "key" && keyRegex) {
|
|
3625
3791
|
const isValid = keyRegex.test(newValue);
|
|
3626
|
-
setKeyError(isValid ?
|
|
3792
|
+
setKeyError(isValid ? "" : errMsg);
|
|
3627
3793
|
return isValid;
|
|
3628
3794
|
} else if (fieldType === "value" && valueRegex) {
|
|
3629
3795
|
const isValid = valueRegex.test(newValue);
|
|
3630
|
-
setValueError(isValid ?
|
|
3796
|
+
setValueError(isValid ? "" : errMsg);
|
|
3631
3797
|
return isValid;
|
|
3632
3798
|
}
|
|
3633
3799
|
return true;
|
|
3634
3800
|
};
|
|
3635
|
-
const handleChange = (
|
|
3636
|
-
const
|
|
3801
|
+
const handleChange = (newValue, options, meta) => {
|
|
3802
|
+
const fieldType = meta?.bind;
|
|
3803
|
+
if (!fieldType) {
|
|
3804
|
+
return;
|
|
3805
|
+
}
|
|
3806
|
+
const newChangedValue = newValue[fieldType];
|
|
3807
|
+
if (isTransformable(newChangedValue) && newChangedValue.$$type === "dynamic") {
|
|
3808
|
+
setValue({
|
|
3809
|
+
...value,
|
|
3810
|
+
[fieldType]: newChangedValue
|
|
3811
|
+
});
|
|
3812
|
+
return;
|
|
3813
|
+
}
|
|
3814
|
+
const extractedValue = stringPropTypeUtil11.extract(newChangedValue);
|
|
3637
3815
|
setSessionState((prev) => ({
|
|
3638
3816
|
...prev,
|
|
3639
|
-
[fieldType]:
|
|
3817
|
+
[fieldType]: extractedValue
|
|
3640
3818
|
}));
|
|
3641
|
-
if (validate(
|
|
3819
|
+
if (extractedValue && validate(extractedValue, fieldType)) {
|
|
3642
3820
|
setValue({
|
|
3643
3821
|
...value,
|
|
3644
|
-
[fieldType]:
|
|
3645
|
-
value: newValue,
|
|
3646
|
-
$$type: "string"
|
|
3647
|
-
}
|
|
3822
|
+
[fieldType]: newChangedValue
|
|
3648
3823
|
});
|
|
3649
3824
|
} else {
|
|
3650
3825
|
setValue({
|
|
@@ -3656,62 +3831,46 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
3656
3831
|
});
|
|
3657
3832
|
}
|
|
3658
3833
|
};
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
return /* @__PURE__ */ React53.createElement(ControlActions, null, /* @__PURE__ */ React53.createElement(Grid16, { container: true, gap: 1.5 }, /* @__PURE__ */ React53.createElement(Grid16, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(FormLabel3, { size: "tiny" }, keyLabel), /* @__PURE__ */ React53.createElement(
|
|
3662
|
-
TextField9,
|
|
3663
|
-
{
|
|
3664
|
-
autoFocus: true,
|
|
3665
|
-
sx: { pt: 1 },
|
|
3666
|
-
size: "tiny",
|
|
3667
|
-
fullWidth: true,
|
|
3668
|
-
value: sessionState.key,
|
|
3669
|
-
onChange: (e) => handleChange(e, "key"),
|
|
3670
|
-
error: isKeyInvalid
|
|
3671
|
-
}
|
|
3672
|
-
), isKeyInvalid && /* @__PURE__ */ React53.createElement(FormHelperText, { error: true }, keyError)), /* @__PURE__ */ React53.createElement(Grid16, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(FormLabel3, { size: "tiny" }, valueLabel), /* @__PURE__ */ React53.createElement(
|
|
3673
|
-
TextField9,
|
|
3834
|
+
return /* @__PURE__ */ React55.createElement(PropProvider, { ...propContext, value, setValue: handleChange }, /* @__PURE__ */ React55.createElement(Grid17, { container: true, gap: 1.5 }, /* @__PURE__ */ React55.createElement(Grid17, { item: true, xs: 12 }, /* @__PURE__ */ React55.createElement(FormLabel3, { size: "tiny" }, keyLabel), /* @__PURE__ */ React55.createElement(PropKeyProvider, { bind: "key" }, /* @__PURE__ */ React55.createElement(TextControl, { inputValue: sessionState.key, error: !!keyError, sx: { pt: 1 } })), !!keyError && /* @__PURE__ */ React55.createElement(FormHelperText, { error: true }, keyError)), /* @__PURE__ */ React55.createElement(Grid17, { item: true, xs: 12 }, /* @__PURE__ */ React55.createElement(FormLabel3, { size: "tiny" }, valueLabel), /* @__PURE__ */ React55.createElement(PropKeyProvider, { bind: "value" }, /* @__PURE__ */ React55.createElement(
|
|
3835
|
+
TextControl,
|
|
3674
3836
|
{
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
onChange: (e) => handleChange(e, "value"),
|
|
3680
|
-
disabled: isKeyInvalid,
|
|
3681
|
-
error: isValueInvalid
|
|
3837
|
+
inputValue: sessionState.value,
|
|
3838
|
+
error: !!valueError,
|
|
3839
|
+
inputDisabled: !!keyError,
|
|
3840
|
+
sx: { pt: 1 }
|
|
3682
3841
|
}
|
|
3683
|
-
),
|
|
3842
|
+
)), !!valueError && /* @__PURE__ */ React55.createElement(FormHelperText, { error: true }, valueError))));
|
|
3684
3843
|
});
|
|
3685
3844
|
|
|
3686
3845
|
// src/controls/position-control.tsx
|
|
3687
|
-
import * as
|
|
3846
|
+
import * as React56 from "react";
|
|
3688
3847
|
import { useMemo as useMemo6 } from "react";
|
|
3689
|
-
import { positionPropTypeUtil, stringPropTypeUtil as
|
|
3848
|
+
import { positionPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil12 } from "@elementor/editor-props";
|
|
3690
3849
|
import { MenuListItem as MenuListItem6 } from "@elementor/editor-ui";
|
|
3691
3850
|
import { isExperimentActive as isExperimentActive6 } from "@elementor/editor-v1-adapters";
|
|
3692
3851
|
import { LetterXIcon as LetterXIcon2, LetterYIcon as LetterYIcon2 } from "@elementor/icons";
|
|
3693
|
-
import { Grid as
|
|
3694
|
-
import { __ as
|
|
3852
|
+
import { Grid as Grid18, Select as Select5 } from "@elementor/ui";
|
|
3853
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
3695
3854
|
var positionOptions = [
|
|
3696
|
-
{ label:
|
|
3697
|
-
{ label:
|
|
3698
|
-
{ label:
|
|
3699
|
-
{ label:
|
|
3700
|
-
{ label:
|
|
3701
|
-
{ label:
|
|
3702
|
-
{ label:
|
|
3703
|
-
{ label:
|
|
3704
|
-
{ label:
|
|
3855
|
+
{ label: __23("Center center", "elementor"), value: "center center" },
|
|
3856
|
+
{ label: __23("Center left", "elementor"), value: "center left" },
|
|
3857
|
+
{ label: __23("Center right", "elementor"), value: "center right" },
|
|
3858
|
+
{ label: __23("Top center", "elementor"), value: "top center" },
|
|
3859
|
+
{ label: __23("Top left", "elementor"), value: "top left" },
|
|
3860
|
+
{ label: __23("Top right", "elementor"), value: "top right" },
|
|
3861
|
+
{ label: __23("Bottom center", "elementor"), value: "bottom center" },
|
|
3862
|
+
{ label: __23("Bottom left", "elementor"), value: "bottom left" },
|
|
3863
|
+
{ label: __23("Bottom right", "elementor"), value: "bottom right" }
|
|
3705
3864
|
];
|
|
3706
3865
|
var PositionControl = () => {
|
|
3707
3866
|
const positionContext = useBoundProp(positionPropTypeUtil);
|
|
3708
|
-
const stringPropContext = useBoundProp(
|
|
3867
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil12);
|
|
3709
3868
|
const isVersion331Active = isExperimentActive6("e_v_3_31");
|
|
3710
3869
|
const isCustom = !!positionContext.value && isVersion331Active;
|
|
3711
3870
|
const availablePositionOptions = useMemo6(() => {
|
|
3712
3871
|
const options = [...positionOptions];
|
|
3713
3872
|
if (isVersion331Active) {
|
|
3714
|
-
options.push({ label:
|
|
3873
|
+
options.push({ label: __23("Custom", "elementor"), value: "custom" });
|
|
3715
3874
|
}
|
|
3716
3875
|
return options;
|
|
3717
3876
|
}, [isVersion331Active]);
|
|
@@ -3723,7 +3882,7 @@ var PositionControl = () => {
|
|
|
3723
3882
|
stringPropContext.setValue(value);
|
|
3724
3883
|
}
|
|
3725
3884
|
};
|
|
3726
|
-
return /* @__PURE__ */
|
|
3885
|
+
return /* @__PURE__ */ React56.createElement(Grid18, { container: true, spacing: 1.5 }, /* @__PURE__ */ React56.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React56.createElement(Grid18, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React56.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(ControlFormLabel, null, __23("Object position", "elementor"))), /* @__PURE__ */ React56.createElement(Grid18, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React56.createElement(
|
|
3727
3886
|
Select5,
|
|
3728
3887
|
{
|
|
3729
3888
|
size: "tiny",
|
|
@@ -3732,102 +3891,102 @@ var PositionControl = () => {
|
|
|
3732
3891
|
onChange: handlePositionChange,
|
|
3733
3892
|
fullWidth: true
|
|
3734
3893
|
},
|
|
3735
|
-
availablePositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
3736
|
-
)))), isCustom && /* @__PURE__ */
|
|
3894
|
+
availablePositionOptions.map(({ label, value }) => /* @__PURE__ */ React56.createElement(MenuListItem6, { key: value, value: value ?? "" }, label))
|
|
3895
|
+
)))), isCustom && /* @__PURE__ */ React56.createElement(PropProvider, { ...positionContext }, /* @__PURE__ */ React56.createElement(Grid18, { item: true, xs: 12 }, /* @__PURE__ */ React56.createElement(Grid18, { container: true, spacing: 1.5 }, /* @__PURE__ */ React56.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React56.createElement(SizeControl, { startIcon: /* @__PURE__ */ React56.createElement(LetterXIcon2, { fontSize: "tiny" }) }))), /* @__PURE__ */ React56.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React56.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React56.createElement(SizeControl, { startIcon: /* @__PURE__ */ React56.createElement(LetterYIcon2, { fontSize: "tiny" }) })))))));
|
|
3737
3896
|
};
|
|
3738
3897
|
|
|
3739
3898
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
3740
|
-
import * as
|
|
3899
|
+
import * as React62 from "react";
|
|
3741
3900
|
import { transformPropTypeUtil } from "@elementor/editor-props";
|
|
3742
|
-
import { __ as
|
|
3901
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
3743
3902
|
|
|
3744
3903
|
// src/controls/transform-control/transform-content.tsx
|
|
3745
|
-
import * as
|
|
3746
|
-
import { Box as
|
|
3747
|
-
import { __ as
|
|
3904
|
+
import * as React59 from "react";
|
|
3905
|
+
import { Box as Box10, Tab as Tab2, TabPanel as TabPanel2, Tabs as Tabs2, useTabs as useTabs2 } from "@elementor/ui";
|
|
3906
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
3748
3907
|
|
|
3749
3908
|
// src/controls/transform-control/functions/move.tsx
|
|
3750
|
-
import * as
|
|
3751
|
-
import { useRef as
|
|
3909
|
+
import * as React58 from "react";
|
|
3910
|
+
import { useRef as useRef13 } from "react";
|
|
3752
3911
|
import { moveTransformPropTypeUtil } from "@elementor/editor-props";
|
|
3753
3912
|
import { ArrowDownLeftIcon, ArrowDownSmallIcon, ArrowRightIcon } from "@elementor/icons";
|
|
3754
|
-
import { Grid as
|
|
3755
|
-
import { __ as
|
|
3913
|
+
import { Grid as Grid20 } from "@elementor/ui";
|
|
3914
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
3756
3915
|
|
|
3757
3916
|
// src/controls/transform-control/functions/axis-row.tsx
|
|
3758
|
-
import * as
|
|
3759
|
-
import { Grid as
|
|
3917
|
+
import * as React57 from "react";
|
|
3918
|
+
import { Grid as Grid19 } from "@elementor/ui";
|
|
3760
3919
|
var AxisRow = ({ label, bindValue, startIcon, anchorRef }) => {
|
|
3761
|
-
return /* @__PURE__ */
|
|
3920
|
+
return /* @__PURE__ */ React57.createElement(Grid19, { item: true, xs: 12 }, /* @__PURE__ */ React57.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React57.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(ControlLabel, null, label)), /* @__PURE__ */ React57.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React57.createElement(PropKeyProvider, { bind: bindValue }, /* @__PURE__ */ React57.createElement(SizeControl, { anchorRef, startIcon })))));
|
|
3762
3921
|
};
|
|
3763
3922
|
|
|
3764
3923
|
// src/controls/transform-control/functions/move.tsx
|
|
3765
3924
|
var moveAxisControls = [
|
|
3766
3925
|
{
|
|
3767
|
-
label:
|
|
3926
|
+
label: __24("Move X", "elementor"),
|
|
3768
3927
|
bindValue: "x",
|
|
3769
|
-
startIcon: /* @__PURE__ */
|
|
3928
|
+
startIcon: /* @__PURE__ */ React58.createElement(ArrowRightIcon, { fontSize: "tiny" })
|
|
3770
3929
|
},
|
|
3771
3930
|
{
|
|
3772
|
-
label:
|
|
3931
|
+
label: __24("Move Y", "elementor"),
|
|
3773
3932
|
bindValue: "y",
|
|
3774
|
-
startIcon: /* @__PURE__ */
|
|
3933
|
+
startIcon: /* @__PURE__ */ React58.createElement(ArrowDownSmallIcon, { fontSize: "tiny" })
|
|
3775
3934
|
},
|
|
3776
3935
|
{
|
|
3777
|
-
label:
|
|
3936
|
+
label: __24("Move Z", "elementor"),
|
|
3778
3937
|
bindValue: "z",
|
|
3779
|
-
startIcon: /* @__PURE__ */
|
|
3938
|
+
startIcon: /* @__PURE__ */ React58.createElement(ArrowDownLeftIcon, { fontSize: "tiny" })
|
|
3780
3939
|
}
|
|
3781
3940
|
];
|
|
3782
3941
|
var Move = () => {
|
|
3783
3942
|
const context = useBoundProp(moveTransformPropTypeUtil);
|
|
3784
|
-
const rowRef =
|
|
3785
|
-
return /* @__PURE__ */
|
|
3943
|
+
const rowRef = useRef13(null);
|
|
3944
|
+
return /* @__PURE__ */ React58.createElement(Grid20, { container: true, spacing: 1.5 }, /* @__PURE__ */ React58.createElement(PropProvider, { ...context }, /* @__PURE__ */ React58.createElement(PropKeyProvider, { bind: "transform-move" }, moveAxisControls.map((control) => /* @__PURE__ */ React58.createElement(AxisRow, { key: control.bindValue, ...control, anchorRef: rowRef })))));
|
|
3786
3945
|
};
|
|
3787
3946
|
|
|
3788
3947
|
// src/controls/transform-control/transform-content.tsx
|
|
3789
3948
|
var TransformContent = ({ bind }) => {
|
|
3790
3949
|
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs2("transform-move");
|
|
3791
|
-
return /* @__PURE__ */
|
|
3950
|
+
return /* @__PURE__ */ React59.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React59.createElement(PopoverContent, null, /* @__PURE__ */ React59.createElement(Box10, { sx: { width: "100%" } }, /* @__PURE__ */ React59.createElement(Box10, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React59.createElement(
|
|
3792
3951
|
Tabs2,
|
|
3793
3952
|
{
|
|
3794
3953
|
size: "small",
|
|
3795
3954
|
variant: "fullWidth",
|
|
3796
3955
|
...getTabsProps(),
|
|
3797
|
-
"aria-label":
|
|
3956
|
+
"aria-label": __25("Transform", "elementor")
|
|
3798
3957
|
},
|
|
3799
|
-
/* @__PURE__ */
|
|
3800
|
-
)), /* @__PURE__ */
|
|
3958
|
+
/* @__PURE__ */ React59.createElement(Tab2, { label: __25("Move", "elementor"), ...getTabProps("transform-move") })
|
|
3959
|
+
)), /* @__PURE__ */ React59.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps("transform-move") }, /* @__PURE__ */ React59.createElement(Move, null)))));
|
|
3801
3960
|
};
|
|
3802
3961
|
|
|
3803
3962
|
// src/controls/transform-control/transform-icon.tsx
|
|
3804
|
-
import * as
|
|
3963
|
+
import * as React60 from "react";
|
|
3805
3964
|
import { ArrowsMaximizeIcon as ArrowsMaximizeIcon2 } from "@elementor/icons";
|
|
3806
3965
|
var TransformIcon = ({ value }) => {
|
|
3807
3966
|
switch (value.$$type) {
|
|
3808
3967
|
case "transform-move":
|
|
3809
|
-
return /* @__PURE__ */
|
|
3968
|
+
return /* @__PURE__ */ React60.createElement(ArrowsMaximizeIcon2, { fontSize: "tiny" });
|
|
3810
3969
|
default:
|
|
3811
3970
|
return null;
|
|
3812
3971
|
}
|
|
3813
3972
|
};
|
|
3814
3973
|
|
|
3815
3974
|
// src/controls/transform-control/transform-label.tsx
|
|
3816
|
-
import * as
|
|
3817
|
-
import { Box as
|
|
3818
|
-
import { __ as
|
|
3975
|
+
import * as React61 from "react";
|
|
3976
|
+
import { Box as Box11 } from "@elementor/ui";
|
|
3977
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
3819
3978
|
var transformMoveValue = (value) => Object.values(value).map((axis) => `${axis?.value.size}${axis?.value.unit}`).join(", ");
|
|
3820
3979
|
var TransformLabel = (props) => {
|
|
3821
3980
|
const { $$type, value } = props.value;
|
|
3822
3981
|
switch ($$type) {
|
|
3823
3982
|
case "transform-move":
|
|
3824
|
-
return /* @__PURE__ */
|
|
3983
|
+
return /* @__PURE__ */ React61.createElement(Label2, { label: __26("Move", "elementor"), value: transformMoveValue(value) });
|
|
3825
3984
|
default:
|
|
3826
3985
|
return "";
|
|
3827
3986
|
}
|
|
3828
3987
|
};
|
|
3829
3988
|
var Label2 = ({ label, value }) => {
|
|
3830
|
-
return /* @__PURE__ */
|
|
3989
|
+
return /* @__PURE__ */ React61.createElement(Box11, { component: "span" }, label, ": ", value);
|
|
3831
3990
|
};
|
|
3832
3991
|
|
|
3833
3992
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
@@ -3841,14 +4000,14 @@ var initialTransformValue = {
|
|
|
3841
4000
|
};
|
|
3842
4001
|
var TransformRepeaterControl = createControl(() => {
|
|
3843
4002
|
const { propType, value: transformValues, setValue, disabled } = useBoundProp(transformPropTypeUtil);
|
|
3844
|
-
return /* @__PURE__ */
|
|
4003
|
+
return /* @__PURE__ */ React62.createElement(PropProvider, { propType, value: transformValues, setValue }, /* @__PURE__ */ React62.createElement(
|
|
3845
4004
|
Repeater,
|
|
3846
4005
|
{
|
|
3847
4006
|
openOnAdd: true,
|
|
3848
4007
|
disabled,
|
|
3849
4008
|
values: transformValues ?? [],
|
|
3850
4009
|
setValues: setValue,
|
|
3851
|
-
label:
|
|
4010
|
+
label: __27("Transform", "elementor"),
|
|
3852
4011
|
showDuplicate: false,
|
|
3853
4012
|
itemSettings: {
|
|
3854
4013
|
Icon: TransformIcon,
|