@elementor/editor-controls 3.32.0-84 → 3.32.0-86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1359 -1514
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1157 -1316
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -14
- package/src/components/unstable-repeater/context/repeater-context.tsx +1 -1
- package/src/components/unstable-repeater/items/edit-item-popover.tsx +2 -4
- package/src/components/unstable-repeater/items/item.tsx +10 -1
- package/src/controls/box-shadow-repeater-control.tsx +30 -26
- package/src/controls/filter-control/configs.ts +49 -0
- package/src/controls/filter-control/context/filter-config-context.tsx +49 -0
- package/src/controls/filter-control/{drop-shadow-item-content.tsx → drop-shadow/drop-shadow-item-content.tsx} +11 -14
- package/src/controls/filter-control/filter-content.tsx +78 -0
- package/src/controls/filter-control/filter-icon.tsx +21 -0
- package/src/controls/filter-control/filter-label.tsx +13 -0
- package/src/controls/filter-control/filter-repeater-control.tsx +93 -0
- package/src/controls/filter-control/single-size/single-size-item-content.tsx +48 -0
- package/src/controls/filter-control/single-size/single-size-item-label.tsx +30 -0
- package/src/controls/filter-control/utils.ts +130 -0
- package/src/controls/size-control.tsx +1 -1
- package/src/index.ts +1 -1
- package/src/controls/filter-repeater-control.tsx +0 -322
- /package/src/controls/filter-control/{drop-shadow-item-label.tsx → drop-shadow/drop-shadow-item-label.tsx} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1021,7 +1021,7 @@ var SizeControl = createControl(
|
|
|
1021
1021
|
popupState,
|
|
1022
1022
|
min
|
|
1023
1023
|
}
|
|
1024
|
-
), anchorRef?.current && /* @__PURE__ */ React18.createElement(
|
|
1024
|
+
), anchorRef?.current && popupState.isOpen && /* @__PURE__ */ React18.createElement(
|
|
1025
1025
|
TextFieldPopover,
|
|
1026
1026
|
{
|
|
1027
1027
|
popupState,
|
|
@@ -1151,11 +1151,11 @@ var StrokeControl = createControl(() => {
|
|
|
1151
1151
|
var Control = forwardRef3(({ bind, label, children }, ref) => /* @__PURE__ */ React21.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React21.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref }, /* @__PURE__ */ React21.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React21.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React21.createElement(Grid2, { item: true, xs: 6 }, children))));
|
|
1152
1152
|
|
|
1153
1153
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1154
|
-
import * as
|
|
1154
|
+
import * as React37 from "react";
|
|
1155
1155
|
import { useRef as useRef4 } from "react";
|
|
1156
1156
|
import { boxShadowPropTypeUtil, shadowPropTypeUtil } from "@elementor/editor-props";
|
|
1157
|
-
import { FormLabel as FormLabel2, Grid as Grid4, UnstableColorIndicator } from "@elementor/ui";
|
|
1158
|
-
import { __ as
|
|
1157
|
+
import { FormLabel as FormLabel2, Grid as Grid4, styled as styled4, UnstableColorIndicator } from "@elementor/ui";
|
|
1158
|
+
import { __ as __10 } from "@wordpress/i18n";
|
|
1159
1159
|
|
|
1160
1160
|
// src/components/popover-content.tsx
|
|
1161
1161
|
import * as React22 from "react";
|
|
@@ -1170,34 +1170,138 @@ var PopoverGridContainer = forwardRef4(
|
|
|
1170
1170
|
({ gap = 1.5, alignItems = "center", flexWrap = "nowrap", children }, ref) => /* @__PURE__ */ React23.createElement(Grid3, { container: true, gap, alignItems, flexWrap, ref }, children)
|
|
1171
1171
|
);
|
|
1172
1172
|
|
|
1173
|
-
// src/components/repeater.tsx
|
|
1174
|
-
import * as
|
|
1175
|
-
import {
|
|
1176
|
-
import {
|
|
1177
|
-
import {
|
|
1178
|
-
bindPopover as bindPopover2,
|
|
1179
|
-
bindTrigger as bindTrigger2,
|
|
1180
|
-
Box as Box2,
|
|
1181
|
-
IconButton,
|
|
1182
|
-
Popover as Popover2,
|
|
1183
|
-
Stack as Stack5,
|
|
1184
|
-
Tooltip,
|
|
1185
|
-
Typography as Typography2,
|
|
1186
|
-
UnstableTag,
|
|
1187
|
-
usePopupState as usePopupState3
|
|
1188
|
-
} from "@elementor/ui";
|
|
1173
|
+
// src/components/unstable-repeater/actions/tooltip-add-item-action.tsx
|
|
1174
|
+
import * as React25 from "react";
|
|
1175
|
+
import { PlusIcon } from "@elementor/icons";
|
|
1176
|
+
import { Box as Box2, IconButton, Infotip } from "@elementor/ui";
|
|
1189
1177
|
import { __ as __5 } from "@wordpress/i18n";
|
|
1190
1178
|
|
|
1179
|
+
// src/components/unstable-repeater/context/repeater-context.tsx
|
|
1180
|
+
import * as React24 from "react";
|
|
1181
|
+
import { createContext as createContext6, useState as useState6 } from "react";
|
|
1182
|
+
import { usePopupState as usePopupState3 } from "@elementor/ui";
|
|
1183
|
+
var RepeaterContext = createContext6(null);
|
|
1184
|
+
var EMPTY_OPEN_ITEM = -1;
|
|
1185
|
+
var useRepeaterContext = () => {
|
|
1186
|
+
const context = React24.useContext(RepeaterContext);
|
|
1187
|
+
if (!context) {
|
|
1188
|
+
throw new Error("useRepeaterContext must be used within a RepeaterContextProvider");
|
|
1189
|
+
}
|
|
1190
|
+
return context;
|
|
1191
|
+
};
|
|
1192
|
+
var RepeaterContextProvider = ({
|
|
1193
|
+
children,
|
|
1194
|
+
initial,
|
|
1195
|
+
propTypeUtil
|
|
1196
|
+
}) => {
|
|
1197
|
+
const { value: repeaterValues, setValue: setRepeaterValues } = useBoundProp(propTypeUtil);
|
|
1198
|
+
const [items2, setItems] = useSyncExternalState({
|
|
1199
|
+
external: repeaterValues,
|
|
1200
|
+
fallback: () => [],
|
|
1201
|
+
setExternal: setRepeaterValues,
|
|
1202
|
+
persistWhen: () => true
|
|
1203
|
+
});
|
|
1204
|
+
const [itemsWithKeys, setItemsWithKeys] = useState6(() => {
|
|
1205
|
+
return items2?.map((item) => ({ key: generateUniqueKey(), item })) ?? [];
|
|
1206
|
+
});
|
|
1207
|
+
React24.useEffect(() => {
|
|
1208
|
+
setItemsWithKeys((prevItemsWithKeys) => {
|
|
1209
|
+
const newItemsWithKeys = items2?.map((item) => {
|
|
1210
|
+
const existingItem = prevItemsWithKeys.find((i) => i.item === item);
|
|
1211
|
+
return existingItem || { key: generateUniqueKey(), item };
|
|
1212
|
+
}) ?? [];
|
|
1213
|
+
return newItemsWithKeys;
|
|
1214
|
+
});
|
|
1215
|
+
}, [items2]);
|
|
1216
|
+
const handleSetItems = (newItemsWithKeys) => {
|
|
1217
|
+
setItems(newItemsWithKeys.map(({ item }) => item));
|
|
1218
|
+
};
|
|
1219
|
+
const [openItemIndex, setOpenItemIndex] = useState6(EMPTY_OPEN_ITEM);
|
|
1220
|
+
const [rowRef, setRowRef] = useState6(null);
|
|
1221
|
+
const isOpen = openItemIndex !== EMPTY_OPEN_ITEM;
|
|
1222
|
+
const popoverState = usePopupState3({ variant: "popover" });
|
|
1223
|
+
const addItem = (ev, config) => {
|
|
1224
|
+
const item = config?.item ?? { ...initial };
|
|
1225
|
+
const newIndex = config?.index ?? items2.length;
|
|
1226
|
+
const newItems = [...items2];
|
|
1227
|
+
newItems.splice(newIndex, 0, item);
|
|
1228
|
+
setItems(newItems);
|
|
1229
|
+
setOpenItemIndex(newIndex);
|
|
1230
|
+
popoverState.open(rowRef ?? ev);
|
|
1231
|
+
};
|
|
1232
|
+
const removeItem = (index) => {
|
|
1233
|
+
setItems(items2.filter((_, pos) => pos !== index));
|
|
1234
|
+
};
|
|
1235
|
+
const updateItem = (updatedItem, index) => {
|
|
1236
|
+
const newItems = [...items2.slice(0, index), updatedItem, ...items2.slice(index + 1)];
|
|
1237
|
+
setItems(newItems);
|
|
1238
|
+
};
|
|
1239
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1240
|
+
RepeaterContext.Provider,
|
|
1241
|
+
{
|
|
1242
|
+
value: {
|
|
1243
|
+
isOpen,
|
|
1244
|
+
openItemIndex,
|
|
1245
|
+
setOpenItemIndex,
|
|
1246
|
+
items: itemsWithKeys ?? [],
|
|
1247
|
+
setItems: handleSetItems,
|
|
1248
|
+
popoverState,
|
|
1249
|
+
initial,
|
|
1250
|
+
updateItem,
|
|
1251
|
+
addItem,
|
|
1252
|
+
removeItem,
|
|
1253
|
+
rowRef,
|
|
1254
|
+
setRowRef
|
|
1255
|
+
}
|
|
1256
|
+
},
|
|
1257
|
+
children
|
|
1258
|
+
);
|
|
1259
|
+
};
|
|
1260
|
+
var generateUniqueKey = () => {
|
|
1261
|
+
return Date.now() + Math.floor(Math.random() * 1e6);
|
|
1262
|
+
};
|
|
1263
|
+
|
|
1264
|
+
// src/components/unstable-repeater/actions/tooltip-add-item-action.tsx
|
|
1265
|
+
var SIZE2 = "tiny";
|
|
1266
|
+
var TooltipAddItemAction = ({
|
|
1267
|
+
disabled = false,
|
|
1268
|
+
enableTooltip = false,
|
|
1269
|
+
tooltipContent = null,
|
|
1270
|
+
newItemIndex
|
|
1271
|
+
}) => {
|
|
1272
|
+
const { addItem } = useRepeaterContext();
|
|
1273
|
+
const onClick = (ev) => addItem(ev, { index: newItemIndex });
|
|
1274
|
+
return /* @__PURE__ */ React25.createElement(ConditionalToolTip, { content: tooltipContent, enable: enableTooltip }, /* @__PURE__ */ React25.createElement(Box2, { component: "span", sx: { cursor: disabled ? "not-allowed" : "pointer" } }, /* @__PURE__ */ React25.createElement(
|
|
1275
|
+
IconButton,
|
|
1276
|
+
{
|
|
1277
|
+
size: SIZE2,
|
|
1278
|
+
disabled,
|
|
1279
|
+
onClick,
|
|
1280
|
+
"aria-label": __5("Add item", "elementor")
|
|
1281
|
+
},
|
|
1282
|
+
/* @__PURE__ */ React25.createElement(PlusIcon, { fontSize: SIZE2 })
|
|
1283
|
+
)));
|
|
1284
|
+
};
|
|
1285
|
+
var ConditionalToolTip = ({
|
|
1286
|
+
children,
|
|
1287
|
+
enable,
|
|
1288
|
+
content
|
|
1289
|
+
}) => enable && content ? /* @__PURE__ */ React25.createElement(Infotip, { placement: "right", color: "secondary", content }, children) : children;
|
|
1290
|
+
|
|
1291
|
+
// src/components/unstable-repeater/header/header.tsx
|
|
1292
|
+
import * as React28 from "react";
|
|
1293
|
+
import { Box as Box3, Stack as Stack5, Typography as Typography2 } from "@elementor/ui";
|
|
1294
|
+
|
|
1191
1295
|
// src/control-adornments/control-adornments.tsx
|
|
1192
|
-
import * as
|
|
1296
|
+
import * as React27 from "react";
|
|
1193
1297
|
|
|
1194
1298
|
// src/control-adornments/control-adornments-context.tsx
|
|
1195
|
-
import * as
|
|
1196
|
-
import { createContext as
|
|
1197
|
-
var Context2 =
|
|
1198
|
-
var ControlAdornmentsProvider = ({ children, items: items2 }) => /* @__PURE__ */
|
|
1299
|
+
import * as React26 from "react";
|
|
1300
|
+
import { createContext as createContext7, useContext as useContext7 } from "react";
|
|
1301
|
+
var Context2 = createContext7(null);
|
|
1302
|
+
var ControlAdornmentsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React26.createElement(Context2.Provider, { value: { items: items2 } }, children);
|
|
1199
1303
|
var useControlAdornments = () => {
|
|
1200
|
-
const context =
|
|
1304
|
+
const context = useContext7(Context2);
|
|
1201
1305
|
return context?.items ?? [];
|
|
1202
1306
|
};
|
|
1203
1307
|
|
|
@@ -1207,11 +1311,27 @@ function ControlAdornments() {
|
|
|
1207
1311
|
if (items2?.length === 0) {
|
|
1208
1312
|
return null;
|
|
1209
1313
|
}
|
|
1210
|
-
return /* @__PURE__ */
|
|
1314
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, items2.map(({ Adornment, id }) => /* @__PURE__ */ React27.createElement(Adornment, { key: id })));
|
|
1211
1315
|
}
|
|
1212
1316
|
|
|
1317
|
+
// src/components/unstable-repeater/locations.ts
|
|
1318
|
+
import { createLocation, createReplaceableLocation } from "@elementor/locations";
|
|
1319
|
+
var { Slot: RepeaterItemIconSlot, inject: injectIntoRepeaterItemIcon } = createReplaceableLocation();
|
|
1320
|
+
var { Slot: RepeaterItemLabelSlot, inject: injectIntoRepeaterItemLabel } = createReplaceableLocation();
|
|
1321
|
+
var { Slot: RepeaterHeaderActionsSlot, inject: injectIntoRepeaterHeaderActions } = createLocation();
|
|
1322
|
+
var { Slot: RepeaterItemActionsSlot, inject: injectIntoRepeaterItemActions } = createLocation();
|
|
1323
|
+
|
|
1324
|
+
// src/components/unstable-repeater/header/header.tsx
|
|
1325
|
+
var Header = React28.forwardRef(({ label, children }, ref) => {
|
|
1326
|
+
const { value } = useBoundProp();
|
|
1327
|
+
return /* @__PURE__ */ React28.createElement(Stack5, { direction: "row", alignItems: "center", gap: 1, sx: { marginInlineEnd: -0.75, py: 0.25 }, ref }, /* @__PURE__ */ React28.createElement(Box3, { display: "flex", alignItems: "center", gap: 1, sx: { flexGrow: 1 } }, /* @__PURE__ */ React28.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary", sx: { lineHeight: 1 } }, label), /* @__PURE__ */ React28.createElement(ControlAdornments, null)), /* @__PURE__ */ React28.createElement(RepeaterHeaderActionsSlot, { value }), /* @__PURE__ */ React28.createElement(SlotChildren, { whitelist: [TooltipAddItemAction], sorted: true }, children));
|
|
1328
|
+
});
|
|
1329
|
+
|
|
1330
|
+
// src/components/unstable-repeater/items/items-container.tsx
|
|
1331
|
+
import * as React30 from "react";
|
|
1332
|
+
|
|
1213
1333
|
// src/components/sortable.tsx
|
|
1214
|
-
import * as
|
|
1334
|
+
import * as React29 from "react";
|
|
1215
1335
|
import { GripVerticalIcon } from "@elementor/icons";
|
|
1216
1336
|
import {
|
|
1217
1337
|
Divider,
|
|
@@ -1222,10 +1342,10 @@ import {
|
|
|
1222
1342
|
UnstableSortableProvider
|
|
1223
1343
|
} from "@elementor/ui";
|
|
1224
1344
|
var SortableProvider = (props) => {
|
|
1225
|
-
return /* @__PURE__ */
|
|
1345
|
+
return /* @__PURE__ */ React29.createElement(List, { sx: { p: 0, my: -0.5, mx: 0 } }, /* @__PURE__ */ React29.createElement(UnstableSortableProvider, { restrictAxis: true, disableDragOverlay: false, variant: "static", ...props }));
|
|
1226
1346
|
};
|
|
1227
1347
|
var SortableItem = ({ id, children, disabled }) => {
|
|
1228
|
-
return /* @__PURE__ */
|
|
1348
|
+
return /* @__PURE__ */ React29.createElement(
|
|
1229
1349
|
UnstableSortableItem,
|
|
1230
1350
|
{
|
|
1231
1351
|
id,
|
|
@@ -1238,7 +1358,7 @@ var SortableItem = ({ id, children, disabled }) => {
|
|
|
1238
1358
|
showDropIndication,
|
|
1239
1359
|
dropIndicationStyle
|
|
1240
1360
|
}) => {
|
|
1241
|
-
return /* @__PURE__ */
|
|
1361
|
+
return /* @__PURE__ */ React29.createElement(StyledListItem, { ...itemProps, style: itemStyle }, !disabled && /* @__PURE__ */ React29.createElement(SortableTrigger, { ...triggerProps, style: triggerStyle }), children, showDropIndication && /* @__PURE__ */ React29.createElement(StyledDivider, { style: dropIndicationStyle }));
|
|
1242
1362
|
}
|
|
1243
1363
|
}
|
|
1244
1364
|
);
|
|
@@ -1272,7 +1392,7 @@ var StyledListItem = styled3(ListItem)`
|
|
|
1272
1392
|
}
|
|
1273
1393
|
}
|
|
1274
1394
|
`;
|
|
1275
|
-
var SortableTrigger = (props) => /* @__PURE__ */
|
|
1395
|
+
var SortableTrigger = (props) => /* @__PURE__ */ React29.createElement("div", { ...props, role: "button", className: "class-item-sortable-trigger" }, /* @__PURE__ */ React29.createElement(GripVerticalIcon, { fontSize: "tiny" }));
|
|
1276
1396
|
var StyledDivider = styled3(Divider)`
|
|
1277
1397
|
height: 0px;
|
|
1278
1398
|
border: none;
|
|
@@ -1290,252 +1410,224 @@ var StyledDivider = styled3(Divider)`
|
|
|
1290
1410
|
}
|
|
1291
1411
|
`;
|
|
1292
1412
|
|
|
1293
|
-
// src/components/unstable-repeater/
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
var { Slot: RepeaterItemLabelSlot, inject: injectIntoRepeaterItemLabel } = createReplaceableLocation();
|
|
1297
|
-
var { Slot: RepeaterHeaderActionsSlot, inject: injectIntoRepeaterHeaderActions } = createLocation();
|
|
1298
|
-
var { Slot: RepeaterItemActionsSlot, inject: injectIntoRepeaterItemActions } = createLocation();
|
|
1299
|
-
|
|
1300
|
-
// src/components/repeater.tsx
|
|
1301
|
-
var SIZE2 = "tiny";
|
|
1302
|
-
var EMPTY_OPEN_ITEM = -1;
|
|
1303
|
-
var Repeater = ({
|
|
1304
|
-
label,
|
|
1305
|
-
itemSettings,
|
|
1306
|
-
disabled = false,
|
|
1307
|
-
openOnAdd = false,
|
|
1308
|
-
addToBottom = false,
|
|
1309
|
-
values: repeaterValues = [],
|
|
1310
|
-
setValues: setRepeaterValues,
|
|
1311
|
-
showDuplicate = true,
|
|
1312
|
-
showToggle = true,
|
|
1413
|
+
// src/components/unstable-repeater/items/items-container.tsx
|
|
1414
|
+
var ItemsContainer = ({
|
|
1415
|
+
itemTemplate,
|
|
1313
1416
|
isSortable = true,
|
|
1314
|
-
|
|
1417
|
+
children
|
|
1315
1418
|
}) => {
|
|
1316
|
-
const
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
});
|
|
1323
|
-
const [uniqueKeys, setUniqueKeys] = useState6(items2.map((_, index) => index));
|
|
1324
|
-
const generateNextKey = (source) => {
|
|
1325
|
-
return 1 + Math.max(0, ...source);
|
|
1326
|
-
};
|
|
1327
|
-
const addRepeaterItem = () => {
|
|
1328
|
-
const newItem = structuredClone(itemSettings.initialValues);
|
|
1329
|
-
const newKey = generateNextKey(uniqueKeys);
|
|
1330
|
-
if (addToBottom) {
|
|
1331
|
-
setItems([...items2, newItem]);
|
|
1332
|
-
setUniqueKeys([...uniqueKeys, newKey]);
|
|
1333
|
-
} else {
|
|
1334
|
-
setItems([newItem, ...items2]);
|
|
1335
|
-
setUniqueKeys([newKey, ...uniqueKeys]);
|
|
1336
|
-
}
|
|
1337
|
-
if (openOnAdd) {
|
|
1338
|
-
setOpenItem(newKey);
|
|
1339
|
-
}
|
|
1340
|
-
};
|
|
1341
|
-
const duplicateRepeaterItem = (index) => {
|
|
1342
|
-
const newItem = structuredClone(items2[index]);
|
|
1343
|
-
const newKey = generateNextKey(uniqueKeys);
|
|
1344
|
-
const atPosition = 1 + index;
|
|
1345
|
-
setItems([...items2.slice(0, atPosition), newItem, ...items2.slice(atPosition)]);
|
|
1346
|
-
setUniqueKeys([...uniqueKeys.slice(0, atPosition), newKey, ...uniqueKeys.slice(atPosition)]);
|
|
1347
|
-
};
|
|
1348
|
-
const removeRepeaterItem = (index) => {
|
|
1349
|
-
setUniqueKeys(
|
|
1350
|
-
uniqueKeys.filter((_, pos) => {
|
|
1351
|
-
return pos !== index;
|
|
1352
|
-
})
|
|
1353
|
-
);
|
|
1419
|
+
const { items: items2, setItems } = useRepeaterContext();
|
|
1420
|
+
const keys = items2.map(({ key }) => key);
|
|
1421
|
+
if (!itemTemplate) {
|
|
1422
|
+
return null;
|
|
1423
|
+
}
|
|
1424
|
+
const onChangeOrder = (newKeys) => {
|
|
1354
1425
|
setItems(
|
|
1355
|
-
|
|
1356
|
-
|
|
1426
|
+
newKeys.map((key) => {
|
|
1427
|
+
const index = items2.findIndex((item) => item.key === key);
|
|
1428
|
+
return items2[index];
|
|
1357
1429
|
})
|
|
1358
1430
|
);
|
|
1359
1431
|
};
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1432
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(SortableProvider, { value: keys, onChange: onChangeOrder }, keys.map((key, index) => {
|
|
1433
|
+
const value = items2[index].item;
|
|
1434
|
+
return /* @__PURE__ */ React30.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, React30.isValidElement(itemTemplate) ? React30.cloneElement(itemTemplate, {
|
|
1435
|
+
key,
|
|
1436
|
+
value,
|
|
1437
|
+
index,
|
|
1438
|
+
children
|
|
1439
|
+
}) : null);
|
|
1440
|
+
})));
|
|
1441
|
+
};
|
|
1442
|
+
|
|
1443
|
+
// src/components/unstable-repeater/items/item.tsx
|
|
1444
|
+
import * as React34 from "react";
|
|
1445
|
+
import { bindTrigger as bindTrigger2, UnstableTag } from "@elementor/ui";
|
|
1446
|
+
import { __ as __9 } from "@wordpress/i18n";
|
|
1447
|
+
|
|
1448
|
+
// src/components/unstable-repeater/actions/disable-item-action.tsx
|
|
1449
|
+
import * as React31 from "react";
|
|
1450
|
+
import { EyeIcon, EyeOffIcon } from "@elementor/icons";
|
|
1451
|
+
import { IconButton as IconButton2, Tooltip } from "@elementor/ui";
|
|
1452
|
+
import { __ as __6 } from "@wordpress/i18n";
|
|
1453
|
+
var SIZE3 = "tiny";
|
|
1454
|
+
var DisableItemAction = ({ index = -1 }) => {
|
|
1455
|
+
const { items: items2, updateItem } = useRepeaterContext();
|
|
1456
|
+
if (index === -1) {
|
|
1457
|
+
return null;
|
|
1458
|
+
}
|
|
1459
|
+
const propDisabled = items2[index].item.disabled ?? false;
|
|
1460
|
+
const toggleLabel = propDisabled ? __6("Show", "elementor") : __6("Hide", "elementor");
|
|
1461
|
+
const onClick = () => {
|
|
1462
|
+
const self = structuredClone(items2[index].item);
|
|
1463
|
+
self.disabled = !self.disabled;
|
|
1464
|
+
if (!self.disabled) {
|
|
1465
|
+
delete self.disabled;
|
|
1466
|
+
}
|
|
1467
|
+
updateItem(self, index);
|
|
1370
1468
|
};
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1469
|
+
return /* @__PURE__ */ React31.createElement(Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React31.createElement(IconButton2, { size: SIZE3, onClick, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React31.createElement(EyeOffIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React31.createElement(EyeIcon, { fontSize: SIZE3 })));
|
|
1470
|
+
};
|
|
1471
|
+
|
|
1472
|
+
// src/components/unstable-repeater/actions/duplicate-item-action.tsx
|
|
1473
|
+
import * as React32 from "react";
|
|
1474
|
+
import { CopyIcon } from "@elementor/icons";
|
|
1475
|
+
import { IconButton as IconButton3, Tooltip as Tooltip2 } from "@elementor/ui";
|
|
1476
|
+
import { __ as __7 } from "@wordpress/i18n";
|
|
1477
|
+
var SIZE4 = "tiny";
|
|
1478
|
+
var DuplicateItemAction = ({ index = -1 }) => {
|
|
1479
|
+
const { items: items2, addItem } = useRepeaterContext();
|
|
1480
|
+
if (index === -1) {
|
|
1481
|
+
return null;
|
|
1482
|
+
}
|
|
1483
|
+
const duplicateLabel = __7("Duplicate", "elementor");
|
|
1484
|
+
const onClick = (ev) => {
|
|
1485
|
+
const newItem = structuredClone(items2[index]?.item);
|
|
1486
|
+
addItem(ev, { item: newItem, index: index + 1 });
|
|
1379
1487
|
};
|
|
1380
|
-
return /* @__PURE__ */
|
|
1381
|
-
Stack5,
|
|
1382
|
-
{
|
|
1383
|
-
direction: "row",
|
|
1384
|
-
justifyContent: "start",
|
|
1385
|
-
alignItems: "center",
|
|
1386
|
-
gap: 1,
|
|
1387
|
-
sx: { marginInlineEnd: -0.75 }
|
|
1388
|
-
},
|
|
1389
|
-
/* @__PURE__ */ React27.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary" }, label),
|
|
1390
|
-
/* @__PURE__ */ React27.createElement(ControlAdornments, null),
|
|
1391
|
-
/* @__PURE__ */ React27.createElement(
|
|
1392
|
-
IconButton,
|
|
1393
|
-
{
|
|
1394
|
-
size: SIZE2,
|
|
1395
|
-
sx: { ml: "auto" },
|
|
1396
|
-
disabled,
|
|
1397
|
-
onClick: addRepeaterItem,
|
|
1398
|
-
"aria-label": __5("Add item", "elementor")
|
|
1399
|
-
},
|
|
1400
|
-
/* @__PURE__ */ React27.createElement(PlusIcon, { fontSize: SIZE2 })
|
|
1401
|
-
)
|
|
1402
|
-
), 0 < uniqueKeys.length && /* @__PURE__ */ React27.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key, index) => {
|
|
1403
|
-
const value = items2[index];
|
|
1404
|
-
if (!value) {
|
|
1405
|
-
return null;
|
|
1406
|
-
}
|
|
1407
|
-
return /* @__PURE__ */ React27.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React27.createElement(
|
|
1408
|
-
RepeaterItem,
|
|
1409
|
-
{
|
|
1410
|
-
disabled,
|
|
1411
|
-
propDisabled: value?.disabled,
|
|
1412
|
-
label: /* @__PURE__ */ React27.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React27.createElement(itemSettings.Label, { value })),
|
|
1413
|
-
startIcon: /* @__PURE__ */ React27.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React27.createElement(itemSettings.Icon, { value })),
|
|
1414
|
-
removeItem: () => removeRepeaterItem(index),
|
|
1415
|
-
duplicateItem: () => duplicateRepeaterItem(index),
|
|
1416
|
-
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
1417
|
-
openOnMount: openOnAdd && openItem === key,
|
|
1418
|
-
onOpen: () => setOpenItem(EMPTY_OPEN_ITEM),
|
|
1419
|
-
showDuplicate,
|
|
1420
|
-
showToggle,
|
|
1421
|
-
collectionPropUtil
|
|
1422
|
-
},
|
|
1423
|
-
(props) => /* @__PURE__ */ React27.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
1424
|
-
));
|
|
1425
|
-
})));
|
|
1488
|
+
return /* @__PURE__ */ React32.createElement(Tooltip2, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React32.createElement(IconButton3, { size: SIZE4, onClick, "aria-label": duplicateLabel }, /* @__PURE__ */ React32.createElement(CopyIcon, { fontSize: SIZE4 })));
|
|
1426
1489
|
};
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1490
|
+
|
|
1491
|
+
// src/components/unstable-repeater/actions/remove-item-action.tsx
|
|
1492
|
+
import * as React33 from "react";
|
|
1493
|
+
import { XIcon } from "@elementor/icons";
|
|
1494
|
+
import { IconButton as IconButton4, Tooltip as Tooltip3 } from "@elementor/ui";
|
|
1495
|
+
import { __ as __8 } from "@wordpress/i18n";
|
|
1496
|
+
var SIZE5 = "tiny";
|
|
1497
|
+
var RemoveItemAction = ({ index = -1 }) => {
|
|
1498
|
+
const { removeItem } = useRepeaterContext();
|
|
1499
|
+
if (index === -1) {
|
|
1500
|
+
return null;
|
|
1501
|
+
}
|
|
1502
|
+
const removeLabel = __8("Remove", "elementor");
|
|
1503
|
+
const onClick = () => removeItem(index);
|
|
1504
|
+
return /* @__PURE__ */ React33.createElement(Tooltip3, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React33.createElement(IconButton4, { size: SIZE5, onClick, "aria-label": removeLabel }, /* @__PURE__ */ React33.createElement(XIcon, { fontSize: SIZE5 })));
|
|
1505
|
+
};
|
|
1506
|
+
|
|
1507
|
+
// src/components/unstable-repeater/items/item.tsx
|
|
1508
|
+
var Item = ({
|
|
1509
|
+
Label: Label3,
|
|
1510
|
+
Icon,
|
|
1511
|
+
value,
|
|
1512
|
+
index = -1,
|
|
1513
|
+
children
|
|
1441
1514
|
}) => {
|
|
1442
|
-
const
|
|
1443
|
-
const
|
|
1444
|
-
const
|
|
1445
|
-
const
|
|
1446
|
-
|
|
1447
|
-
|
|
1515
|
+
const { items: items2, popoverState, setRowRef, openItemIndex, setOpenItemIndex } = useRepeaterContext();
|
|
1516
|
+
const triggerProps = bindTrigger2(popoverState);
|
|
1517
|
+
const key = items2[index].key ?? -1;
|
|
1518
|
+
const onClick = (ev) => {
|
|
1519
|
+
triggerProps.onClick(ev);
|
|
1520
|
+
setOpenItemIndex(index);
|
|
1521
|
+
};
|
|
1522
|
+
const setRef = (ref) => {
|
|
1523
|
+
if (!ref || openItemIndex !== index || ref === popoverState.anchorEl) {
|
|
1524
|
+
return;
|
|
1525
|
+
}
|
|
1526
|
+
setRowRef(ref);
|
|
1527
|
+
popoverState.setAnchorEl(ref);
|
|
1528
|
+
};
|
|
1529
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(
|
|
1448
1530
|
UnstableTag,
|
|
1449
1531
|
{
|
|
1450
|
-
|
|
1451
|
-
|
|
1532
|
+
key,
|
|
1533
|
+
disabled: false,
|
|
1534
|
+
label: /* @__PURE__ */ React34.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React34.createElement(Label3, { value })),
|
|
1452
1535
|
showActionsOnHover: true,
|
|
1453
1536
|
fullWidth: true,
|
|
1454
1537
|
ref: setRef,
|
|
1455
1538
|
variant: "outlined",
|
|
1456
|
-
"aria-label":
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1539
|
+
"aria-label": __9("Open item", "elementor"),
|
|
1540
|
+
sx: { minHeight: (theme) => theme.spacing(4) },
|
|
1541
|
+
...triggerProps,
|
|
1542
|
+
onClick,
|
|
1543
|
+
startIcon: /* @__PURE__ */ React34.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React34.createElement(Icon, { value })),
|
|
1544
|
+
actions: /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(RepeaterItemActionsSlot, { index: index ?? -1 }), /* @__PURE__ */ React34.createElement(
|
|
1545
|
+
SlotChildren,
|
|
1546
|
+
{
|
|
1547
|
+
whitelist: [DuplicateItemAction, DisableItemAction, RemoveItemAction],
|
|
1548
|
+
props: { index },
|
|
1549
|
+
sorted: true
|
|
1550
|
+
},
|
|
1551
|
+
children
|
|
1552
|
+
))
|
|
1460
1553
|
}
|
|
1461
|
-
)
|
|
1554
|
+
));
|
|
1555
|
+
};
|
|
1556
|
+
|
|
1557
|
+
// src/components/unstable-repeater/unstable-repeater.tsx
|
|
1558
|
+
import * as React36 from "react";
|
|
1559
|
+
|
|
1560
|
+
// src/components/unstable-repeater/items/edit-item-popover.tsx
|
|
1561
|
+
import * as React35 from "react";
|
|
1562
|
+
import { bindPopover as bindPopover2, Box as Box4, Popover as Popover2 } from "@elementor/ui";
|
|
1563
|
+
var EditItemPopover = ({ children }) => {
|
|
1564
|
+
const { popoverState, openItemIndex, isOpen, rowRef, setOpenItemIndex, setRowRef, items: items2 } = useRepeaterContext();
|
|
1565
|
+
if (!isOpen || !rowRef) {
|
|
1566
|
+
return null;
|
|
1567
|
+
}
|
|
1568
|
+
const bind = items2[openItemIndex].item.$$type;
|
|
1569
|
+
const onClose = () => {
|
|
1570
|
+
setRowRef(null);
|
|
1571
|
+
popoverState.setAnchorEl(null);
|
|
1572
|
+
setOpenItemIndex(EMPTY_OPEN_ITEM);
|
|
1573
|
+
};
|
|
1574
|
+
return /* @__PURE__ */ React35.createElement(
|
|
1462
1575
|
Popover2,
|
|
1463
1576
|
{
|
|
1464
1577
|
disablePortal: true,
|
|
1465
1578
|
slotProps: {
|
|
1466
1579
|
paper: {
|
|
1467
|
-
|
|
1468
|
-
sx: { mt: 0.5, width: ref?.getBoundingClientRect().width }
|
|
1580
|
+
sx: { mt: 0.5, width: rowRef.offsetWidth }
|
|
1469
1581
|
}
|
|
1470
1582
|
},
|
|
1471
1583
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1472
|
-
...
|
|
1473
|
-
|
|
1584
|
+
...bindPopover2(popoverState),
|
|
1585
|
+
onClose
|
|
1474
1586
|
},
|
|
1475
|
-
/* @__PURE__ */
|
|
1476
|
-
)
|
|
1587
|
+
/* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: String(openItemIndex) }, /* @__PURE__ */ React35.createElement(Box4, null, React35.isValidElement(children) && React35.cloneElement(children, { bind, index: openItemIndex })))
|
|
1588
|
+
);
|
|
1477
1589
|
};
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
}
|
|
1487
|
-
}, [ref]);
|
|
1488
|
-
return {
|
|
1489
|
-
popoverState,
|
|
1490
|
-
ref,
|
|
1491
|
-
setRef,
|
|
1492
|
-
popoverProps
|
|
1493
|
-
};
|
|
1590
|
+
|
|
1591
|
+
// src/components/unstable-repeater/unstable-repeater.tsx
|
|
1592
|
+
var UnstableRepeater = ({
|
|
1593
|
+
children,
|
|
1594
|
+
initial,
|
|
1595
|
+
propTypeUtil
|
|
1596
|
+
}) => {
|
|
1597
|
+
return /* @__PURE__ */ React36.createElement(SectionContent, null, /* @__PURE__ */ React36.createElement(RepeaterContextProvider, { initial, propTypeUtil }, /* @__PURE__ */ React36.createElement(SlotChildren, { whitelist: [Header, ItemsContainer, EditItemPopover], sorted: true }, children)));
|
|
1494
1598
|
};
|
|
1495
1599
|
|
|
1496
1600
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1497
1601
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
1498
1602
|
const { propType, value, setValue, disabled } = useBoundProp(boxShadowPropTypeUtil);
|
|
1499
|
-
return /* @__PURE__ */
|
|
1500
|
-
Repeater,
|
|
1501
|
-
{
|
|
1502
|
-
openOnAdd: true,
|
|
1503
|
-
disabled,
|
|
1504
|
-
values: value ?? [],
|
|
1505
|
-
setValues: setValue,
|
|
1506
|
-
label: __6("Box shadow", "elementor"),
|
|
1507
|
-
itemSettings: {
|
|
1508
|
-
Icon: ItemIcon,
|
|
1509
|
-
Label: ItemLabel,
|
|
1510
|
-
Content: ItemContent,
|
|
1511
|
-
initialValues: initialShadow
|
|
1512
|
-
}
|
|
1513
|
-
}
|
|
1514
|
-
));
|
|
1603
|
+
return /* @__PURE__ */ React37.createElement(PropProvider, { propType, value, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React37.createElement(UnstableRepeater, { initial: initialShadow, propTypeUtil: boxShadowPropTypeUtil }, /* @__PURE__ */ React37.createElement(Header, { label: __10("Box shadow", "elementor") }, /* @__PURE__ */ React37.createElement(TooltipAddItemAction, { newItemIndex: 0, disabled })), /* @__PURE__ */ React37.createElement(ItemsContainer, { itemTemplate: /* @__PURE__ */ React37.createElement(Item, { Icon: ItemIcon, Label: ItemLabel }) }, /* @__PURE__ */ React37.createElement(DuplicateItemAction, null), /* @__PURE__ */ React37.createElement(DisableItemAction, null), /* @__PURE__ */ React37.createElement(RemoveItemAction, null)), /* @__PURE__ */ React37.createElement(EditItemPopover, null, /* @__PURE__ */ React37.createElement(Content, null))));
|
|
1515
1604
|
});
|
|
1516
|
-
var
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
}
|
|
1520
|
-
|
|
1605
|
+
var StyledUnstableColorIndicator = styled4(UnstableColorIndicator)(({ theme }) => ({
|
|
1606
|
+
height: "1rem",
|
|
1607
|
+
width: "1rem",
|
|
1608
|
+
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
1609
|
+
}));
|
|
1610
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React37.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color?.value });
|
|
1611
|
+
var Content = () => {
|
|
1521
1612
|
const context = useBoundProp(shadowPropTypeUtil);
|
|
1522
1613
|
const rowRef = [useRef4(null), useRef4(null)];
|
|
1523
|
-
|
|
1614
|
+
const { rowRef: anchorEl } = useRepeaterContext();
|
|
1615
|
+
return /* @__PURE__ */ React37.createElement(PropProvider, { ...context }, /* @__PURE__ */ React37.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(Control2, { bind: "color", label: __10("Color", "elementor") }, /* @__PURE__ */ React37.createElement(ColorControl, { anchorEl })), /* @__PURE__ */ React37.createElement(Control2, { bind: "position", label: __10("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React37.createElement(
|
|
1524
1616
|
SelectControl,
|
|
1525
1617
|
{
|
|
1526
1618
|
options: [
|
|
1527
|
-
{ label:
|
|
1528
|
-
{ label:
|
|
1619
|
+
{ label: __10("Inset", "elementor"), value: "inset" },
|
|
1620
|
+
{ label: __10("Outset", "elementor"), value: null }
|
|
1529
1621
|
]
|
|
1530
1622
|
}
|
|
1531
|
-
))), /* @__PURE__ */
|
|
1623
|
+
))), /* @__PURE__ */ React37.createElement(PopoverGridContainer, { ref: rowRef[0] }, /* @__PURE__ */ React37.createElement(Control2, { bind: "hOffset", label: __10("Horizontal", "elementor") }, /* @__PURE__ */ React37.createElement(SizeControl, { anchorRef: rowRef[0] })), /* @__PURE__ */ React37.createElement(Control2, { bind: "vOffset", label: __10("Vertical", "elementor") }, /* @__PURE__ */ React37.createElement(SizeControl, { anchorRef: rowRef[0] }))), /* @__PURE__ */ React37.createElement(PopoverGridContainer, { ref: rowRef[1] }, /* @__PURE__ */ React37.createElement(Control2, { bind: "blur", label: __10("Blur", "elementor") }, /* @__PURE__ */ React37.createElement(SizeControl, { anchorRef: rowRef[1] })), /* @__PURE__ */ React37.createElement(Control2, { bind: "spread", label: __10("Spread", "elementor") }, /* @__PURE__ */ React37.createElement(SizeControl, { anchorRef: rowRef[1] })))));
|
|
1532
1624
|
};
|
|
1533
1625
|
var Control2 = ({
|
|
1534
1626
|
label,
|
|
1535
1627
|
bind,
|
|
1536
1628
|
children,
|
|
1537
1629
|
sx
|
|
1538
|
-
}) => /* @__PURE__ */
|
|
1630
|
+
}) => /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React37.createElement(Grid4, { item: true, xs: 6, sx }, /* @__PURE__ */ React37.createElement(Grid4, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React37.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(FormLabel2, { size: "tiny" }, label)), /* @__PURE__ */ React37.createElement(Grid4, { item: true, xs: 12 }, children))));
|
|
1539
1631
|
var ItemLabel = ({ value }) => {
|
|
1540
1632
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
1541
1633
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -1549,7 +1641,7 @@ var ItemLabel = ({ value }) => {
|
|
|
1549
1641
|
blurSize + blurUnit,
|
|
1550
1642
|
spreadSize + spreadUnit
|
|
1551
1643
|
].join(" ");
|
|
1552
|
-
return /* @__PURE__ */
|
|
1644
|
+
return /* @__PURE__ */ React37.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
1553
1645
|
};
|
|
1554
1646
|
var initialShadow = {
|
|
1555
1647
|
$$type: "shadow",
|
|
@@ -1578,285 +1670,343 @@ var initialShadow = {
|
|
|
1578
1670
|
}
|
|
1579
1671
|
};
|
|
1580
1672
|
|
|
1581
|
-
// src/controls/filter-repeater-control.tsx
|
|
1582
|
-
import * as
|
|
1583
|
-
import { useRef as useRef6 } from "react";
|
|
1673
|
+
// src/controls/filter-control/filter-repeater-control.tsx
|
|
1674
|
+
import * as React46 from "react";
|
|
1584
1675
|
import {
|
|
1585
|
-
|
|
1676
|
+
backdropFilterPropTypeUtil,
|
|
1586
1677
|
filterPropTypeUtil
|
|
1587
1678
|
} from "@elementor/editor-props";
|
|
1588
|
-
import {
|
|
1589
|
-
import { Box as Box4, Grid as Grid6, styled as styled4, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
1590
|
-
import { __ as __8 } from "@wordpress/i18n";
|
|
1679
|
+
import { __ as __15 } from "@wordpress/i18n";
|
|
1591
1680
|
|
|
1592
|
-
// src/controls/filter-control/
|
|
1593
|
-
import * as
|
|
1681
|
+
// src/controls/filter-control/context/filter-config-context.tsx
|
|
1682
|
+
import * as React38 from "react";
|
|
1683
|
+
import { createContext as createContext8, useContext as useContext8, useMemo as useMemo2 } from "react";
|
|
1684
|
+
import { cssFilterFunctionPropUtil } from "@elementor/editor-props";
|
|
1685
|
+
|
|
1686
|
+
// src/controls/filter-control/utils.ts
|
|
1687
|
+
import { __ as __12 } from "@wordpress/i18n";
|
|
1688
|
+
|
|
1689
|
+
// src/controls/filter-control/configs.ts
|
|
1690
|
+
import { __ as __11 } from "@wordpress/i18n";
|
|
1691
|
+
var FILTERS_BY_GROUP = {
|
|
1692
|
+
blur: {
|
|
1693
|
+
blur: {
|
|
1694
|
+
name: __11("Blur", "elementor"),
|
|
1695
|
+
valueName: __11("Radius", "elementor")
|
|
1696
|
+
}
|
|
1697
|
+
},
|
|
1698
|
+
intensity: {
|
|
1699
|
+
brightness: { name: __11("Brightness", "elementor") },
|
|
1700
|
+
contrast: { name: __11("Contrast", "elementor") },
|
|
1701
|
+
saturate: { name: __11("Saturate", "elementor") }
|
|
1702
|
+
},
|
|
1703
|
+
"hue-rotate": {
|
|
1704
|
+
"hue-rotate": {
|
|
1705
|
+
name: __11("Hue Rotate", "elementor"),
|
|
1706
|
+
valueName: __11("Angle", "elementor")
|
|
1707
|
+
}
|
|
1708
|
+
},
|
|
1709
|
+
"color-tone": {
|
|
1710
|
+
grayscale: { name: __11("Grayscale", "elementor") },
|
|
1711
|
+
invert: { name: __11("Invert", "elementor") },
|
|
1712
|
+
sepia: { name: __11("Sepia", "elementor") }
|
|
1713
|
+
},
|
|
1714
|
+
"drop-shadow": {
|
|
1715
|
+
"drop-shadow": { name: __11("Drop shadow", "elementor"), valueName: __11("Drop-shadow", "elementor") }
|
|
1716
|
+
}
|
|
1717
|
+
};
|
|
1718
|
+
|
|
1719
|
+
// src/controls/filter-control/utils.ts
|
|
1720
|
+
var AMOUNT_VALUE_NAME = __12("Amount", "elementor");
|
|
1721
|
+
var DEFAULT_FACTORIES = {
|
|
1722
|
+
"drop-shadow": (propType) => buildDropShadowDefault(propType)
|
|
1723
|
+
};
|
|
1724
|
+
function buildFilterConfig(cssFilterPropType) {
|
|
1725
|
+
function createEntry(filterFunctionGroup, filterFunction, { name, valueName }) {
|
|
1726
|
+
const propType = extractPropType(cssFilterPropType, filterFunctionGroup);
|
|
1727
|
+
const value = DEFAULT_FACTORIES[filterFunction]?.(propType) ?? buildSizeDefault(propType);
|
|
1728
|
+
const defaultValue = createDefaultValue({
|
|
1729
|
+
filterFunction,
|
|
1730
|
+
filterFunctionGroup,
|
|
1731
|
+
value
|
|
1732
|
+
});
|
|
1733
|
+
return [
|
|
1734
|
+
filterFunction,
|
|
1735
|
+
{
|
|
1736
|
+
name,
|
|
1737
|
+
valueName: valueName ?? AMOUNT_VALUE_NAME,
|
|
1738
|
+
defaultValue,
|
|
1739
|
+
filterFunctionGroup
|
|
1740
|
+
}
|
|
1741
|
+
];
|
|
1742
|
+
}
|
|
1743
|
+
const entries = Object.entries(FILTERS_BY_GROUP).flatMap(
|
|
1744
|
+
([filterFunctionGroup, group]) => Object.entries(group).map(
|
|
1745
|
+
([filterFunction, meta]) => createEntry(filterFunctionGroup, filterFunction, meta)
|
|
1746
|
+
)
|
|
1747
|
+
);
|
|
1748
|
+
return Object.fromEntries(entries);
|
|
1749
|
+
}
|
|
1750
|
+
function createDefaultValue({ filterFunction, filterFunctionGroup, value }) {
|
|
1751
|
+
return {
|
|
1752
|
+
$$type: "css-filter-func",
|
|
1753
|
+
value: {
|
|
1754
|
+
func: { $$type: "string", value: filterFunction },
|
|
1755
|
+
args: {
|
|
1756
|
+
$$type: filterFunctionGroup,
|
|
1757
|
+
value
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
};
|
|
1761
|
+
}
|
|
1762
|
+
function buildSizeDefault(propType) {
|
|
1763
|
+
const sizePropType = propType?.shape?.size;
|
|
1764
|
+
return {
|
|
1765
|
+
size: sizePropType?.default
|
|
1766
|
+
};
|
|
1767
|
+
}
|
|
1768
|
+
function buildDropShadowDefault(propType) {
|
|
1769
|
+
const dropShadowPropType = propType.shape;
|
|
1770
|
+
return {
|
|
1771
|
+
blur: dropShadowPropType?.blur?.default,
|
|
1772
|
+
xAxis: dropShadowPropType?.xAxis?.default,
|
|
1773
|
+
yAxis: dropShadowPropType?.yAxis?.default,
|
|
1774
|
+
color: dropShadowPropType?.color?.default ?? (dropShadowPropType?.color).prop_types.color.default
|
|
1775
|
+
};
|
|
1776
|
+
}
|
|
1777
|
+
function extractPropType(propType, filterFunctionGroup) {
|
|
1778
|
+
return propType.shape?.args?.prop_types[filterFunctionGroup];
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
// src/controls/filter-control/context/filter-config-context.tsx
|
|
1782
|
+
var FilterConfigContext = createContext8(null);
|
|
1783
|
+
function FilterConfigProvider({ children }) {
|
|
1784
|
+
const propContext = useBoundProp(cssFilterFunctionPropUtil);
|
|
1785
|
+
const contextValue = useMemo2(() => {
|
|
1786
|
+
const config = buildFilterConfig(propContext.propType.item_prop_type);
|
|
1787
|
+
const filterOptions = Object.entries(config).map(([key, conf]) => ({
|
|
1788
|
+
value: key,
|
|
1789
|
+
label: conf.name
|
|
1790
|
+
}));
|
|
1791
|
+
return {
|
|
1792
|
+
config,
|
|
1793
|
+
filterOptions,
|
|
1794
|
+
getFilterFunctionConfig: (filterFunction) => config[filterFunction],
|
|
1795
|
+
getInitialValue: () => config.blur.defaultValue
|
|
1796
|
+
};
|
|
1797
|
+
}, [propContext.propType]);
|
|
1798
|
+
return /* @__PURE__ */ React38.createElement(FilterConfigContext.Provider, { value: contextValue }, children);
|
|
1799
|
+
}
|
|
1800
|
+
function useFilterConfig() {
|
|
1801
|
+
const context = useContext8(FilterConfigContext);
|
|
1802
|
+
if (!context) {
|
|
1803
|
+
throw new Error("useFilterConfig must be used within FilterConfigProvider");
|
|
1804
|
+
}
|
|
1805
|
+
return context;
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
// src/controls/filter-control/filter-content.tsx
|
|
1809
|
+
import * as React41 from "react";
|
|
1810
|
+
import {
|
|
1811
|
+
cssFilterFunctionPropUtil as cssFilterFunctionPropUtil2
|
|
1812
|
+
} from "@elementor/editor-props";
|
|
1813
|
+
import { Grid as Grid7 } from "@elementor/ui";
|
|
1814
|
+
import { __ as __14 } from "@wordpress/i18n";
|
|
1815
|
+
|
|
1816
|
+
// src/controls/filter-control/drop-shadow/drop-shadow-item-content.tsx
|
|
1817
|
+
import * as React39 from "react";
|
|
1594
1818
|
import { useRef as useRef5 } from "react";
|
|
1595
1819
|
import { dropShadowFilterPropTypeUtil } from "@elementor/editor-props";
|
|
1596
1820
|
import { Grid as Grid5 } from "@elementor/ui";
|
|
1597
|
-
import { __ as
|
|
1821
|
+
import { __ as __13 } from "@wordpress/i18n";
|
|
1598
1822
|
var items = [
|
|
1599
1823
|
{
|
|
1600
1824
|
bind: "xAxis",
|
|
1601
|
-
label:
|
|
1825
|
+
label: __13("X-axis", "elementor"),
|
|
1602
1826
|
rowIndex: 0
|
|
1603
1827
|
},
|
|
1604
1828
|
{
|
|
1605
1829
|
bind: "yAxis",
|
|
1606
|
-
label:
|
|
1830
|
+
label: __13("Y-axis", "elementor"),
|
|
1607
1831
|
rowIndex: 0
|
|
1608
1832
|
},
|
|
1609
1833
|
{
|
|
1610
1834
|
bind: "blur",
|
|
1611
|
-
label:
|
|
1835
|
+
label: __13("Blur", "elementor"),
|
|
1612
1836
|
rowIndex: 1
|
|
1613
1837
|
},
|
|
1614
1838
|
{
|
|
1615
1839
|
bind: "color",
|
|
1616
|
-
label:
|
|
1840
|
+
label: __13("Color", "elementor"),
|
|
1617
1841
|
rowIndex: 1
|
|
1618
1842
|
}
|
|
1619
1843
|
];
|
|
1620
|
-
var DropShadowItemContent = ({
|
|
1621
|
-
units: units2,
|
|
1622
|
-
anchorEl
|
|
1623
|
-
}) => {
|
|
1844
|
+
var DropShadowItemContent = ({ anchorEl }) => {
|
|
1624
1845
|
const context = useBoundProp(dropShadowFilterPropTypeUtil);
|
|
1625
1846
|
const rowRefs = [useRef5(null), useRef5(null)];
|
|
1626
|
-
return /* @__PURE__ */
|
|
1847
|
+
return /* @__PURE__ */ React39.createElement(PropProvider, { ...context }, items.map((item) => /* @__PURE__ */ React39.createElement(PopoverGridContainer, { key: item.bind, ref: rowRefs[item.rowIndex] ?? null }, /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React39.createElement(Grid5, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React39.createElement(Grid5, { item: true, xs: 6 }, item.bind === "color" ? /* @__PURE__ */ React39.createElement(ColorControl, { anchorEl }) : /* @__PURE__ */ React39.createElement(
|
|
1848
|
+
SizeControl,
|
|
1849
|
+
{
|
|
1850
|
+
anchorRef: rowRefs[item.rowIndex],
|
|
1851
|
+
enablePropTypeUnits: true,
|
|
1852
|
+
defaultUnit: "px"
|
|
1853
|
+
}
|
|
1854
|
+
))))));
|
|
1627
1855
|
};
|
|
1628
1856
|
|
|
1629
|
-
// src/controls/filter-control/
|
|
1630
|
-
import
|
|
1631
|
-
import
|
|
1857
|
+
// src/controls/filter-control/single-size/single-size-item-content.tsx
|
|
1858
|
+
import { useRef as useRef6 } from "react";
|
|
1859
|
+
import * as React40 from "react";
|
|
1860
|
+
import {
|
|
1861
|
+
blurFilterPropTypeUtil,
|
|
1862
|
+
colorToneFilterPropTypeUtil,
|
|
1863
|
+
hueRotateFilterPropTypeUtil,
|
|
1864
|
+
intensityFilterPropTypeUtil
|
|
1865
|
+
} from "@elementor/editor-props";
|
|
1866
|
+
import { Grid as Grid6 } from "@elementor/ui";
|
|
1867
|
+
var propTypeMap = {
|
|
1868
|
+
blur: blurFilterPropTypeUtil,
|
|
1869
|
+
intensity: intensityFilterPropTypeUtil,
|
|
1870
|
+
"hue-rotate": hueRotateFilterPropTypeUtil,
|
|
1871
|
+
"color-tone": colorToneFilterPropTypeUtil
|
|
1872
|
+
};
|
|
1873
|
+
var SingleSizeItemContent = ({ filterFunc }) => {
|
|
1874
|
+
const rowRef = useRef6(null);
|
|
1875
|
+
const { getFilterFunctionConfig } = useFilterConfig();
|
|
1876
|
+
const { valueName, filterFunctionGroup } = getFilterFunctionConfig(filterFunc);
|
|
1877
|
+
const context = useBoundProp(propTypeMap[filterFunctionGroup]);
|
|
1878
|
+
return /* @__PURE__ */ React40.createElement(PropProvider, { ...context }, /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: filterFunctionGroup }, /* @__PURE__ */ React40.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React40.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React40.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlFormLabel, null, valueName)), /* @__PURE__ */ React40.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeControl, { anchorRef: rowRef, enablePropTypeUnits: true }))))));
|
|
1879
|
+
};
|
|
1880
|
+
|
|
1881
|
+
// src/controls/filter-control/filter-content.tsx
|
|
1882
|
+
var FilterContent = () => {
|
|
1883
|
+
const propContext = useBoundProp(cssFilterFunctionPropUtil2);
|
|
1884
|
+
const { filterOptions, getFilterFunctionConfig } = useFilterConfig();
|
|
1885
|
+
const handleValueChange = (value, _, meta) => {
|
|
1886
|
+
let newValue = structuredClone(value);
|
|
1887
|
+
const funcConfig = getFilterFunctionConfig(newValue?.func.value);
|
|
1888
|
+
if (meta?.bind === "func") {
|
|
1889
|
+
newValue = funcConfig.defaultValue.value;
|
|
1890
|
+
}
|
|
1891
|
+
if (!newValue.args) {
|
|
1892
|
+
return;
|
|
1893
|
+
}
|
|
1894
|
+
propContext.setValue(newValue);
|
|
1895
|
+
};
|
|
1896
|
+
return /* @__PURE__ */ React41.createElement(PropProvider, { ...propContext, setValue: handleValueChange }, /* @__PURE__ */ React41.createElement(PropKeyProvider, { bind: "css-filter-func" }, /* @__PURE__ */ React41.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React41.createElement(PopoverGridContainer, null, /* @__PURE__ */ React41.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlFormLabel, null, __14("Filter", "elementor"))), /* @__PURE__ */ React41.createElement(Grid7, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(PropKeyProvider, { bind: "func" }, /* @__PURE__ */ React41.createElement(SelectControl, { options: filterOptions })))), /* @__PURE__ */ React41.createElement(PropKeyProvider, { bind: "args" }, /* @__PURE__ */ React41.createElement(FilterValueContent, null)))));
|
|
1897
|
+
};
|
|
1898
|
+
var FilterValueContent = () => {
|
|
1899
|
+
const { openItemIndex, items: items2 } = useRepeaterContext();
|
|
1900
|
+
const currentItem = items2[openItemIndex];
|
|
1901
|
+
const filterFunc = currentItem.item.value.func.value;
|
|
1902
|
+
const isDropShadow = filterFunc === "drop-shadow";
|
|
1903
|
+
if (isDropShadow) {
|
|
1904
|
+
return /* @__PURE__ */ React41.createElement(DropShadowItemContent, null);
|
|
1905
|
+
}
|
|
1906
|
+
return /* @__PURE__ */ React41.createElement(SingleSizeItemContent, { filterFunc });
|
|
1907
|
+
};
|
|
1908
|
+
|
|
1909
|
+
// src/controls/filter-control/filter-icon.tsx
|
|
1910
|
+
import * as React42 from "react";
|
|
1911
|
+
import { styled as styled5, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
1912
|
+
var FilterIcon = ({ value }) => {
|
|
1913
|
+
if (value.value.func.value !== "drop-shadow") {
|
|
1914
|
+
return null;
|
|
1915
|
+
}
|
|
1916
|
+
return /* @__PURE__ */ React42.createElement(
|
|
1917
|
+
StyledUnstableColorIndicator2,
|
|
1918
|
+
{
|
|
1919
|
+
size: "inherit",
|
|
1920
|
+
component: "span",
|
|
1921
|
+
value: value.value.args.value?.color.value
|
|
1922
|
+
}
|
|
1923
|
+
);
|
|
1924
|
+
};
|
|
1925
|
+
var StyledUnstableColorIndicator2 = styled5(UnstableColorIndicator2)(({ theme }) => ({
|
|
1926
|
+
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
1927
|
+
}));
|
|
1928
|
+
|
|
1929
|
+
// src/controls/filter-control/filter-label.tsx
|
|
1930
|
+
import * as React45 from "react";
|
|
1931
|
+
|
|
1932
|
+
// src/controls/filter-control/drop-shadow/drop-shadow-item-label.tsx
|
|
1933
|
+
import * as React43 from "react";
|
|
1934
|
+
import { Box as Box5 } from "@elementor/ui";
|
|
1632
1935
|
var DropShadowItemLabel = ({ value }) => {
|
|
1633
1936
|
const { xAxis, yAxis, blur } = value.value.args.value;
|
|
1634
1937
|
const xValue = `${xAxis?.value?.size ?? 0}${xAxis?.value?.unit ?? "px"}`;
|
|
1635
1938
|
const yValue = `${yAxis?.value?.size ?? 0}${yAxis?.value?.unit ?? "px"}`;
|
|
1636
1939
|
const blurValue = `${blur?.value?.size ?? 10}${blur?.value?.unit ?? "px"}`;
|
|
1637
|
-
return /* @__PURE__ */
|
|
1940
|
+
return /* @__PURE__ */ React43.createElement(Box5, { component: "span" }, /* @__PURE__ */ React43.createElement(Box5, { component: "span", style: { textTransform: "capitalize" } }, "Drop shadow:"), `${xValue} ${yValue} ${blurValue}`);
|
|
1638
1941
|
};
|
|
1639
1942
|
|
|
1640
|
-
// src/controls/filter-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
$$type: "css-filter-func",
|
|
1658
|
-
value: {
|
|
1659
|
-
func: { $$type: "string", value: "brightness" },
|
|
1660
|
-
args: { $$type: "size", value: { size: 100, unit: "%" } }
|
|
1661
|
-
}
|
|
1662
|
-
},
|
|
1663
|
-
name: __8("Brightness", "elementor"),
|
|
1664
|
-
valueName: __8("Amount", "elementor"),
|
|
1665
|
-
units: ["%"]
|
|
1666
|
-
},
|
|
1667
|
-
contrast: {
|
|
1668
|
-
defaultValue: {
|
|
1669
|
-
$$type: "css-filter-func",
|
|
1670
|
-
value: {
|
|
1671
|
-
func: { $$type: "string", value: "contrast" },
|
|
1672
|
-
args: { $$type: "size", value: { size: 100, unit: "%" } }
|
|
1673
|
-
}
|
|
1674
|
-
},
|
|
1675
|
-
name: __8("Contrast", "elementor"),
|
|
1676
|
-
valueName: __8("Amount", "elementor"),
|
|
1677
|
-
units: ["%"]
|
|
1678
|
-
},
|
|
1679
|
-
"hue-rotate": {
|
|
1680
|
-
defaultValue: {
|
|
1681
|
-
$$type: "css-filter-func",
|
|
1682
|
-
value: {
|
|
1683
|
-
func: { $$type: "string", value: "hue-rotate" },
|
|
1684
|
-
args: { $$type: "size", value: { size: 0, unit: "deg" } }
|
|
1685
|
-
}
|
|
1686
|
-
},
|
|
1687
|
-
name: __8("Hue Rotate", "elementor"),
|
|
1688
|
-
valueName: __8("Angle", "elementor"),
|
|
1689
|
-
units: ["deg", "rad", "grad", "turn"]
|
|
1690
|
-
},
|
|
1691
|
-
saturate: {
|
|
1692
|
-
defaultValue: {
|
|
1693
|
-
$$type: "css-filter-func",
|
|
1694
|
-
value: {
|
|
1695
|
-
func: { $$type: "string", value: "saturate" },
|
|
1696
|
-
args: { $$type: "size", value: { size: 100, unit: "%" } }
|
|
1697
|
-
}
|
|
1698
|
-
},
|
|
1699
|
-
name: __8("Saturate", "elementor"),
|
|
1700
|
-
valueName: __8("Amount", "elementor"),
|
|
1701
|
-
units: ["%"]
|
|
1702
|
-
},
|
|
1703
|
-
grayscale: {
|
|
1704
|
-
defaultValue: {
|
|
1705
|
-
$$type: "css-filter-func",
|
|
1706
|
-
value: {
|
|
1707
|
-
func: { $$type: "string", value: "grayscale" },
|
|
1708
|
-
args: { $$type: "size", value: { size: 0, unit: "%" } }
|
|
1709
|
-
}
|
|
1710
|
-
},
|
|
1711
|
-
name: __8("Grayscale", "elementor"),
|
|
1712
|
-
valueName: __8("Amount", "elementor"),
|
|
1713
|
-
units: ["%"]
|
|
1714
|
-
},
|
|
1715
|
-
invert: {
|
|
1716
|
-
defaultValue: {
|
|
1717
|
-
$$type: "css-filter-func",
|
|
1718
|
-
value: {
|
|
1719
|
-
func: { $$type: "string", value: "invert" },
|
|
1720
|
-
args: { $$type: "size", value: { size: 0, unit: "%" } }
|
|
1721
|
-
}
|
|
1722
|
-
},
|
|
1723
|
-
name: __8("Invert", "elementor"),
|
|
1724
|
-
valueName: __8("Amount", "elementor"),
|
|
1725
|
-
units: ["%"]
|
|
1726
|
-
},
|
|
1727
|
-
sepia: {
|
|
1728
|
-
defaultValue: {
|
|
1729
|
-
$$type: "css-filter-func",
|
|
1730
|
-
value: {
|
|
1731
|
-
func: { $$type: "string", value: "sepia" },
|
|
1732
|
-
args: { $$type: "size", value: { size: 0, unit: "%" } }
|
|
1733
|
-
}
|
|
1734
|
-
},
|
|
1735
|
-
name: __8("Sepia", "elementor"),
|
|
1736
|
-
valueName: __8("Amount", "elementor"),
|
|
1737
|
-
units: ["%"]
|
|
1738
|
-
},
|
|
1739
|
-
"drop-shadow": {
|
|
1740
|
-
defaultValue: {
|
|
1741
|
-
$$type: "css-filter-func",
|
|
1742
|
-
value: {
|
|
1743
|
-
func: { $$type: "string", value: "drop-shadow" },
|
|
1744
|
-
args: {
|
|
1745
|
-
$$type: "drop-shadow",
|
|
1746
|
-
value: {
|
|
1747
|
-
xAxis: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
1748
|
-
yAxis: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
1749
|
-
blur: { $$type: "size", value: { size: 10, unit: "px" } },
|
|
1750
|
-
color: { $$type: "color", value: "rgba(0, 0, 0, 1)" }
|
|
1751
|
-
}
|
|
1752
|
-
}
|
|
1753
|
-
}
|
|
1754
|
-
},
|
|
1755
|
-
name: __8("Drop shadow", "elementor"),
|
|
1756
|
-
valueName: __8("Drop-shadow", "elementor"),
|
|
1757
|
-
units: lengthUnits.filter((unit) => unit !== "%")
|
|
1943
|
+
// src/controls/filter-control/single-size/single-size-item-label.tsx
|
|
1944
|
+
import * as React44 from "react";
|
|
1945
|
+
import { Box as Box6 } from "@elementor/ui";
|
|
1946
|
+
var SingleSizeItemLabel = ({ value }) => {
|
|
1947
|
+
const { func, args } = value.value;
|
|
1948
|
+
const { getFilterFunctionConfig } = useFilterConfig();
|
|
1949
|
+
const { defaultValue } = getFilterFunctionConfig(func.value ?? "");
|
|
1950
|
+
const defaultUnit = defaultValue.value.args.value?.size?.value?.unit ?? lengthUnits[0];
|
|
1951
|
+
const { unit, size } = args.value.size?.value ?? { unit: defaultUnit, size: 0 };
|
|
1952
|
+
const label = /* @__PURE__ */ React44.createElement(Box6, { component: "span", style: { textTransform: "capitalize" } }, func.value ?? "", ":");
|
|
1953
|
+
return /* @__PURE__ */ React44.createElement(Box6, { component: "span" }, label, unit !== "custom" ? ` ${size ?? 0}${unit ?? defaultUnit}` : size);
|
|
1954
|
+
};
|
|
1955
|
+
|
|
1956
|
+
// src/controls/filter-control/filter-label.tsx
|
|
1957
|
+
var FilterLabel = ({ value }) => {
|
|
1958
|
+
if (value.value.func.value === "drop-shadow") {
|
|
1959
|
+
return /* @__PURE__ */ React45.createElement(DropShadowItemLabel, { value });
|
|
1758
1960
|
}
|
|
1961
|
+
return /* @__PURE__ */ React45.createElement(SingleSizeItemLabel, { value });
|
|
1759
1962
|
};
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1963
|
+
|
|
1964
|
+
// src/controls/filter-control/filter-repeater-control.tsx
|
|
1965
|
+
var FILTER_CONFIG = {
|
|
1966
|
+
filter: {
|
|
1967
|
+
propTypeUtil: filterPropTypeUtil,
|
|
1968
|
+
label: __15("Filters", "elementor")
|
|
1969
|
+
},
|
|
1970
|
+
"backdrop-filter": {
|
|
1971
|
+
propTypeUtil: backdropFilterPropTypeUtil,
|
|
1972
|
+
label: __15("Backdrop Filters", "elementor")
|
|
1973
|
+
}
|
|
1763
1974
|
};
|
|
1764
1975
|
var FilterRepeaterControl = createControl(({ filterPropName = "filter" }) => {
|
|
1765
|
-
const
|
|
1766
|
-
const { propType, value: filterValues, setValue
|
|
1767
|
-
return /* @__PURE__ */
|
|
1976
|
+
const { propTypeUtil, label } = ensureFilterConfig(filterPropName);
|
|
1977
|
+
const { propType, value: filterValues, setValue } = useBoundProp(propTypeUtil);
|
|
1978
|
+
return /* @__PURE__ */ React46.createElement(FilterConfigProvider, null, /* @__PURE__ */ React46.createElement(PropProvider, { propType, value: filterValues, setValue }, /* @__PURE__ */ React46.createElement(
|
|
1768
1979
|
Repeater,
|
|
1769
1980
|
{
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
values: filterValues ?? [],
|
|
1773
|
-
setValues: setValue,
|
|
1774
|
-
label,
|
|
1775
|
-
collectionPropUtil: propUtil,
|
|
1776
|
-
itemSettings: {
|
|
1777
|
-
Icon: ItemIcon2,
|
|
1778
|
-
Label: ItemLabel2,
|
|
1779
|
-
Content: ItemContent2,
|
|
1780
|
-
initialValues: filterConfig[DEFAULT_FILTER].defaultValue
|
|
1781
|
-
}
|
|
1981
|
+
propTypeUtil,
|
|
1982
|
+
label
|
|
1782
1983
|
}
|
|
1783
|
-
));
|
|
1984
|
+
)));
|
|
1784
1985
|
});
|
|
1785
|
-
var
|
|
1786
|
-
|
|
1787
|
-
}));
|
|
1788
|
-
var ItemIcon2 = ({ value }) => {
|
|
1789
|
-
return isSingleSize(value.value.func.value ?? "") ? /* @__PURE__ */ React31.createElement(React31.Fragment, null) : /* @__PURE__ */ React31.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: value.value.args.value.color.value });
|
|
1790
|
-
};
|
|
1791
|
-
var ItemLabel2 = ({ value }) => {
|
|
1792
|
-
return isSingleSize(value.value.func.value ?? "") ? /* @__PURE__ */ React31.createElement(SingleSizeItemLabel, { value }) : /* @__PURE__ */ React31.createElement(DropShadowItemLabel, { value });
|
|
1793
|
-
};
|
|
1794
|
-
var SingleSizeItemLabel = ({ value }) => {
|
|
1795
|
-
const { func, args } = value.value;
|
|
1796
|
-
const defaultUnit = filterConfig[func.value ?? ""].defaultValue.value.args.value.unit ?? lengthUnits[0];
|
|
1797
|
-
const { unit, size } = args.value ?? { unit: defaultUnit, size: 0 };
|
|
1798
|
-
const label = /* @__PURE__ */ React31.createElement(Box4, { component: "span", style: { textTransform: "capitalize" } }, func.value ?? "", ":");
|
|
1799
|
-
return /* @__PURE__ */ React31.createElement(Box4, { component: "span" }, label, unit !== "custom" ? ` ${size ?? 0}${unit ?? defaultUnit}` : size);
|
|
1800
|
-
};
|
|
1801
|
-
var ItemContent2 = ({
|
|
1802
|
-
bind,
|
|
1803
|
-
collectionPropUtil,
|
|
1804
|
-
anchorEl
|
|
1805
|
-
}) => {
|
|
1806
|
-
const { value: filterValues = [] } = useBoundProp(collectionPropUtil ?? filterPropTypeUtil);
|
|
1807
|
-
const itemIndex = parseInt(bind, 10);
|
|
1808
|
-
const item = filterValues?.[itemIndex];
|
|
1809
|
-
return item ? /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React31.createElement(PropContent, { item, anchorEl })) : null;
|
|
1810
|
-
};
|
|
1811
|
-
var PropContent = ({ item, anchorEl }) => {
|
|
1812
|
-
const propContext = useBoundProp(cssFilterFunctionPropUtil);
|
|
1813
|
-
const handleValueChange = (changedValue, options, meta) => {
|
|
1814
|
-
let newValue = structuredClone(changedValue);
|
|
1815
|
-
const newFuncName = newValue?.func.value ?? "";
|
|
1816
|
-
if (meta?.bind === "func") {
|
|
1817
|
-
newValue = structuredClone(filterConfig[newFuncName].defaultValue.value);
|
|
1818
|
-
}
|
|
1819
|
-
if (!newValue.args) {
|
|
1820
|
-
return;
|
|
1821
|
-
}
|
|
1822
|
-
propContext.setValue(newValue);
|
|
1823
|
-
};
|
|
1824
|
-
return /* @__PURE__ */ React31.createElement(PropProvider, { ...propContext, setValue: handleValueChange }, /* @__PURE__ */ React31.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React31.createElement(PopoverGridContainer, null, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlFormLabel, null, __8("Filter", "elementor"))), /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind: "func" }, /* @__PURE__ */ React31.createElement(
|
|
1825
|
-
SelectControl,
|
|
1826
|
-
{
|
|
1827
|
-
options: filterKeys.map((filterKey) => ({
|
|
1828
|
-
label: filterConfig[filterKey].name,
|
|
1829
|
-
value: filterKey
|
|
1830
|
-
}))
|
|
1831
|
-
}
|
|
1832
|
-
)))), /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind: "args" }, /* @__PURE__ */ React31.createElement(Content2, { filterType: item?.value.func, anchorEl }))));
|
|
1833
|
-
};
|
|
1834
|
-
var Content2 = ({ filterType, anchorEl }) => {
|
|
1835
|
-
const filterName = filterType?.value || DEFAULT_FILTER;
|
|
1836
|
-
const filterItemConfig = filterConfig[filterName];
|
|
1837
|
-
const { units: units2 = [] } = filterItemConfig;
|
|
1838
|
-
return isSingleSize(filterName) ? /* @__PURE__ */ React31.createElement(SingleSizeItemContent, { filterType: filterName }) : /* @__PURE__ */ React31.createElement(DropShadowItemContent, { units: units2, anchorEl });
|
|
1839
|
-
};
|
|
1840
|
-
var SingleSizeItemContent = ({ filterType }) => {
|
|
1841
|
-
const { valueName, defaultValue, units: units2 } = filterConfig[filterType];
|
|
1842
|
-
const rowRef = useRef6(null);
|
|
1843
|
-
const defaultUnit = defaultValue.value.args.value.unit;
|
|
1844
|
-
return /* @__PURE__ */ React31.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlFormLabel, null, valueName)), /* @__PURE__ */ React31.createElement(Grid6, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(SizeControl, { anchorRef: rowRef, units: units2, defaultUnit })));
|
|
1986
|
+
var Repeater = ({ propTypeUtil, label }) => {
|
|
1987
|
+
const { getInitialValue } = useFilterConfig();
|
|
1988
|
+
return /* @__PURE__ */ React46.createElement(UnstableRepeater, { initial: getInitialValue(), propTypeUtil }, /* @__PURE__ */ React46.createElement(Header, { label }, /* @__PURE__ */ React46.createElement(TooltipAddItemAction, { newItemIndex: 0 })), /* @__PURE__ */ React46.createElement(ItemsContainer, { itemTemplate: /* @__PURE__ */ React46.createElement(Item, { Label: FilterLabel, Icon: FilterIcon }) }, /* @__PURE__ */ React46.createElement(DuplicateItemAction, null), /* @__PURE__ */ React46.createElement(DisableItemAction, null), /* @__PURE__ */ React46.createElement(RemoveItemAction, null)), /* @__PURE__ */ React46.createElement(EditItemPopover, null, /* @__PURE__ */ React46.createElement(FilterContent, null)));
|
|
1845
1989
|
};
|
|
1990
|
+
function ensureFilterConfig(name) {
|
|
1991
|
+
if (name && name in FILTER_CONFIG) {
|
|
1992
|
+
return FILTER_CONFIG[name];
|
|
1993
|
+
}
|
|
1994
|
+
return FILTER_CONFIG.filter;
|
|
1995
|
+
}
|
|
1846
1996
|
|
|
1847
1997
|
// src/controls/toggle-control.tsx
|
|
1848
|
-
import * as
|
|
1998
|
+
import * as React49 from "react";
|
|
1849
1999
|
import { stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
|
|
1850
2000
|
|
|
1851
2001
|
// src/components/control-toggle-button-group.tsx
|
|
1852
|
-
import * as
|
|
1853
|
-
import { useEffect as useEffect5, useMemo as
|
|
2002
|
+
import * as React48 from "react";
|
|
2003
|
+
import { useEffect as useEffect5, useMemo as useMemo3, useRef as useRef7, useState as useState7 } from "react";
|
|
1854
2004
|
import { ChevronDownIcon } from "@elementor/icons";
|
|
1855
2005
|
import {
|
|
1856
2006
|
ListItemText,
|
|
1857
2007
|
Menu as Menu2,
|
|
1858
2008
|
MenuItem,
|
|
1859
|
-
styled as
|
|
2009
|
+
styled as styled6,
|
|
1860
2010
|
ToggleButton,
|
|
1861
2011
|
ToggleButtonGroup,
|
|
1862
2012
|
Typography as Typography3,
|
|
@@ -1864,18 +2014,18 @@ import {
|
|
|
1864
2014
|
} from "@elementor/ui";
|
|
1865
2015
|
|
|
1866
2016
|
// src/components/conditional-tooltip.tsx
|
|
1867
|
-
import * as
|
|
1868
|
-
import { Tooltip as
|
|
2017
|
+
import * as React47 from "react";
|
|
2018
|
+
import { Tooltip as Tooltip4 } from "@elementor/ui";
|
|
1869
2019
|
var ConditionalTooltip = ({
|
|
1870
2020
|
showTooltip,
|
|
1871
2021
|
children,
|
|
1872
2022
|
label
|
|
1873
2023
|
}) => {
|
|
1874
|
-
return showTooltip && label ? /* @__PURE__ */
|
|
2024
|
+
return showTooltip && label ? /* @__PURE__ */ React47.createElement(Tooltip4, { title: label, disableFocusListener: true, placement: "top" }, children) : children;
|
|
1875
2025
|
};
|
|
1876
2026
|
|
|
1877
2027
|
// src/components/control-toggle-button-group.tsx
|
|
1878
|
-
var StyledToggleButtonGroup =
|
|
2028
|
+
var StyledToggleButtonGroup = styled6(ToggleButtonGroup)`
|
|
1879
2029
|
${({ justify }) => `justify-content: ${justify};`}
|
|
1880
2030
|
button:not( :last-of-type ) {
|
|
1881
2031
|
border-start-end-radius: 0;
|
|
@@ -1890,7 +2040,7 @@ var StyledToggleButtonGroup = styled5(ToggleButtonGroup)`
|
|
|
1890
2040
|
border-end-end-radius: 8px;
|
|
1891
2041
|
}
|
|
1892
2042
|
`;
|
|
1893
|
-
var StyledToggleButton =
|
|
2043
|
+
var StyledToggleButton = styled6(ToggleButton, {
|
|
1894
2044
|
shouldForwardProp: (prop) => prop !== "isPlaceholder"
|
|
1895
2045
|
})`
|
|
1896
2046
|
${({ theme, isPlaceholder }) => isPlaceholder && `
|
|
@@ -1922,7 +2072,7 @@ var ControlToggleButtonGroup = ({
|
|
|
1922
2072
|
const handleChange = (_, newValue) => {
|
|
1923
2073
|
onChange(newValue);
|
|
1924
2074
|
};
|
|
1925
|
-
const getGridTemplateColumns =
|
|
2075
|
+
const getGridTemplateColumns = useMemo3(() => {
|
|
1926
2076
|
const isOffLimits = menuItems?.length;
|
|
1927
2077
|
const itemsCount = isOffLimits ? fixedItems.length + 1 : fixedItems.length;
|
|
1928
2078
|
const templateColumnsSuffix = isOffLimits ? "auto" : "";
|
|
@@ -1946,7 +2096,7 @@ var ControlToggleButtonGroup = ({
|
|
|
1946
2096
|
return [];
|
|
1947
2097
|
};
|
|
1948
2098
|
const placeholderArray = getPlaceholderArray(placeholder);
|
|
1949
|
-
return /* @__PURE__ */
|
|
2099
|
+
return /* @__PURE__ */ React48.createElement(ControlActions, null, /* @__PURE__ */ React48.createElement(
|
|
1950
2100
|
StyledToggleButtonGroup,
|
|
1951
2101
|
{
|
|
1952
2102
|
justify,
|
|
@@ -1961,16 +2111,16 @@ var ControlToggleButtonGroup = ({
|
|
|
1961
2111
|
width: `100%`
|
|
1962
2112
|
}
|
|
1963
2113
|
},
|
|
1964
|
-
fixedItems.map(({ label, value: buttonValue, renderContent:
|
|
2114
|
+
fixedItems.map(({ label, value: buttonValue, renderContent: Content3, showTooltip }) => {
|
|
1965
2115
|
const isPlaceholder = placeholderArray.length > 0 && placeholderArray.includes(buttonValue) && (shouldShowExclusivePlaceholder || shouldShowNonExclusivePlaceholder);
|
|
1966
|
-
return /* @__PURE__ */
|
|
2116
|
+
return /* @__PURE__ */ React48.createElement(
|
|
1967
2117
|
ConditionalTooltip,
|
|
1968
2118
|
{
|
|
1969
2119
|
key: buttonValue,
|
|
1970
2120
|
label,
|
|
1971
2121
|
showTooltip: showTooltip || false
|
|
1972
2122
|
},
|
|
1973
|
-
/* @__PURE__ */
|
|
2123
|
+
/* @__PURE__ */ React48.createElement(
|
|
1974
2124
|
StyledToggleButton,
|
|
1975
2125
|
{
|
|
1976
2126
|
value: buttonValue,
|
|
@@ -1979,11 +2129,11 @@ var ControlToggleButtonGroup = ({
|
|
|
1979
2129
|
fullWidth,
|
|
1980
2130
|
isPlaceholder
|
|
1981
2131
|
},
|
|
1982
|
-
/* @__PURE__ */
|
|
2132
|
+
/* @__PURE__ */ React48.createElement(Content3, { size })
|
|
1983
2133
|
)
|
|
1984
2134
|
);
|
|
1985
2135
|
}),
|
|
1986
|
-
menuItems.length && exclusive && /* @__PURE__ */
|
|
2136
|
+
menuItems.length && exclusive && /* @__PURE__ */ React48.createElement(
|
|
1987
2137
|
SplitButtonGroup,
|
|
1988
2138
|
{
|
|
1989
2139
|
size,
|
|
@@ -2017,7 +2167,7 @@ var SplitButtonGroup = ({
|
|
|
2017
2167
|
const shouldRemove = newValue === value;
|
|
2018
2168
|
onChange(shouldRemove ? null : newValue);
|
|
2019
2169
|
};
|
|
2020
|
-
return /* @__PURE__ */
|
|
2170
|
+
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(
|
|
2021
2171
|
ToggleButton,
|
|
2022
2172
|
{
|
|
2023
2173
|
value: previewButton.value,
|
|
@@ -2031,7 +2181,7 @@ var SplitButtonGroup = ({
|
|
|
2031
2181
|
ref: menuButtonRef
|
|
2032
2182
|
},
|
|
2033
2183
|
previewButton.renderContent({ size })
|
|
2034
|
-
), /* @__PURE__ */
|
|
2184
|
+
), /* @__PURE__ */ React48.createElement(
|
|
2035
2185
|
ToggleButton,
|
|
2036
2186
|
{
|
|
2037
2187
|
size,
|
|
@@ -2042,8 +2192,8 @@ var SplitButtonGroup = ({
|
|
|
2042
2192
|
ref: menuButtonRef,
|
|
2043
2193
|
value: "__chevron-icon-button__"
|
|
2044
2194
|
},
|
|
2045
|
-
/* @__PURE__ */
|
|
2046
|
-
), /* @__PURE__ */
|
|
2195
|
+
/* @__PURE__ */ React48.createElement(ChevronDownIcon, { fontSize: size })
|
|
2196
|
+
), /* @__PURE__ */ React48.createElement(
|
|
2047
2197
|
Menu2,
|
|
2048
2198
|
{
|
|
2049
2199
|
open: isMenuOpen,
|
|
@@ -2061,14 +2211,14 @@ var SplitButtonGroup = ({
|
|
|
2061
2211
|
mt: 0.5
|
|
2062
2212
|
}
|
|
2063
2213
|
},
|
|
2064
|
-
items2.map(({ label, value: buttonValue }) => /* @__PURE__ */
|
|
2214
|
+
items2.map(({ label, value: buttonValue }) => /* @__PURE__ */ React48.createElement(
|
|
2065
2215
|
MenuItem,
|
|
2066
2216
|
{
|
|
2067
2217
|
key: buttonValue,
|
|
2068
2218
|
selected: buttonValue === value,
|
|
2069
2219
|
onClick: () => onMenuItemClick(buttonValue)
|
|
2070
2220
|
},
|
|
2071
|
-
/* @__PURE__ */
|
|
2221
|
+
/* @__PURE__ */ React48.createElement(ListItemText, null, /* @__PURE__ */ React48.createElement(Typography3, { sx: { fontSize: "14px" } }, label))
|
|
2072
2222
|
))
|
|
2073
2223
|
));
|
|
2074
2224
|
};
|
|
@@ -2109,7 +2259,7 @@ var ToggleControl = createControl(
|
|
|
2109
2259
|
size,
|
|
2110
2260
|
placeholder
|
|
2111
2261
|
};
|
|
2112
|
-
return exclusive ? /* @__PURE__ */
|
|
2262
|
+
return exclusive ? /* @__PURE__ */ React49.createElement(
|
|
2113
2263
|
ControlToggleButtonGroup,
|
|
2114
2264
|
{
|
|
2115
2265
|
...toggleButtonGroupProps,
|
|
@@ -2118,7 +2268,7 @@ var ToggleControl = createControl(
|
|
|
2118
2268
|
disabled,
|
|
2119
2269
|
exclusive: true
|
|
2120
2270
|
}
|
|
2121
|
-
) : /* @__PURE__ */
|
|
2271
|
+
) : /* @__PURE__ */ React49.createElement(
|
|
2122
2272
|
ControlToggleButtonGroup,
|
|
2123
2273
|
{
|
|
2124
2274
|
...toggleButtonGroupProps,
|
|
@@ -2132,7 +2282,7 @@ var ToggleControl = createControl(
|
|
|
2132
2282
|
);
|
|
2133
2283
|
|
|
2134
2284
|
// src/controls/number-control.tsx
|
|
2135
|
-
import * as
|
|
2285
|
+
import * as React50 from "react";
|
|
2136
2286
|
import { numberPropTypeUtil } from "@elementor/editor-props";
|
|
2137
2287
|
import { InputAdornment as InputAdornment3 } from "@elementor/ui";
|
|
2138
2288
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
@@ -2163,7 +2313,7 @@ var NumberControl = createControl(
|
|
|
2163
2313
|
}
|
|
2164
2314
|
setValue(updatedValue, void 0, { validation: () => isInputValid });
|
|
2165
2315
|
};
|
|
2166
|
-
return /* @__PURE__ */
|
|
2316
|
+
return /* @__PURE__ */ React50.createElement(ControlActions, null, /* @__PURE__ */ React50.createElement(
|
|
2167
2317
|
NumberInput,
|
|
2168
2318
|
{
|
|
2169
2319
|
size: "tiny",
|
|
@@ -2176,7 +2326,7 @@ var NumberControl = createControl(
|
|
|
2176
2326
|
placeholder: labelPlaceholder ?? (isEmptyOrNaN(placeholder) ? "" : String(placeholder)),
|
|
2177
2327
|
inputProps: { step, min },
|
|
2178
2328
|
InputProps: {
|
|
2179
|
-
startAdornment: startIcon ? /* @__PURE__ */
|
|
2329
|
+
startAdornment: startIcon ? /* @__PURE__ */ React50.createElement(InputAdornment3, { position: "start", disabled }, startIcon) : void 0
|
|
2180
2330
|
}
|
|
2181
2331
|
}
|
|
2182
2332
|
));
|
|
@@ -2184,17 +2334,17 @@ var NumberControl = createControl(
|
|
|
2184
2334
|
);
|
|
2185
2335
|
|
|
2186
2336
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
2187
|
-
import * as
|
|
2337
|
+
import * as React52 from "react";
|
|
2188
2338
|
import { useId as useId2, useRef as useRef8 } from "react";
|
|
2189
2339
|
import { sizePropTypeUtil as sizePropTypeUtil3 } from "@elementor/editor-props";
|
|
2190
|
-
import { bindPopover as bindPopover3, bindToggle, Grid as
|
|
2191
|
-
import { __ as
|
|
2340
|
+
import { bindPopover as bindPopover3, bindToggle, Grid as Grid8, Popover as Popover3, Stack as Stack7, ToggleButton as ToggleButton2, Tooltip as Tooltip5, usePopupState as usePopupState4 } from "@elementor/ui";
|
|
2341
|
+
import { __ as __16 } from "@wordpress/i18n";
|
|
2192
2342
|
|
|
2193
2343
|
// src/components/control-label.tsx
|
|
2194
|
-
import * as
|
|
2344
|
+
import * as React51 from "react";
|
|
2195
2345
|
import { Stack as Stack6 } from "@elementor/ui";
|
|
2196
2346
|
var ControlLabel = ({ children }) => {
|
|
2197
|
-
return /* @__PURE__ */
|
|
2347
|
+
return /* @__PURE__ */ React51.createElement(Stack6, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React51.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React51.createElement(ControlAdornments, null));
|
|
2198
2348
|
};
|
|
2199
2349
|
|
|
2200
2350
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
@@ -2253,13 +2403,13 @@ function EqualUnequalSizesControl({
|
|
|
2253
2403
|
};
|
|
2254
2404
|
const isShowingGeneralIndicator = !popupState.isOpen;
|
|
2255
2405
|
const isMixed = !!multiSizeValue;
|
|
2256
|
-
return /* @__PURE__ */
|
|
2406
|
+
return /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: rowRefs[0] }, /* @__PURE__ */ React52.createElement(Grid8, { item: true, xs: 6 }, !isShowingGeneralIndicator ? /* @__PURE__ */ React52.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React52.createElement(ControlLabel, null, label)), /* @__PURE__ */ React52.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(Stack7, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React52.createElement(
|
|
2257
2407
|
SizeControl,
|
|
2258
2408
|
{
|
|
2259
|
-
placeholder: isMixed ?
|
|
2409
|
+
placeholder: isMixed ? __16("Mixed", "elementor") : void 0,
|
|
2260
2410
|
anchorRef: rowRefs[0]
|
|
2261
2411
|
}
|
|
2262
|
-
), /* @__PURE__ */
|
|
2412
|
+
), /* @__PURE__ */ React52.createElement(Tooltip5, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React52.createElement(
|
|
2263
2413
|
ToggleButton2,
|
|
2264
2414
|
{
|
|
2265
2415
|
size: "tiny",
|
|
@@ -2270,7 +2420,7 @@ function EqualUnequalSizesControl({
|
|
|
2270
2420
|
"aria-label": tooltipLabel
|
|
2271
2421
|
},
|
|
2272
2422
|
icon
|
|
2273
|
-
))))), /* @__PURE__ */
|
|
2423
|
+
))))), /* @__PURE__ */ React52.createElement(
|
|
2274
2424
|
Popover3,
|
|
2275
2425
|
{
|
|
2276
2426
|
disablePortal: true,
|
|
@@ -2288,7 +2438,7 @@ function EqualUnequalSizesControl({
|
|
|
2288
2438
|
paper: { sx: { mt: 0.5, width: rowRefs[0].current?.getBoundingClientRect().width } }
|
|
2289
2439
|
}
|
|
2290
2440
|
},
|
|
2291
|
-
/* @__PURE__ */
|
|
2441
|
+
/* @__PURE__ */ React52.createElement(
|
|
2292
2442
|
PropProvider,
|
|
2293
2443
|
{
|
|
2294
2444
|
propType: multiSizePropType,
|
|
@@ -2296,21 +2446,21 @@ function EqualUnequalSizesControl({
|
|
|
2296
2446
|
setValue: setNestedProp,
|
|
2297
2447
|
isDisabled: () => multiSizeDisabled
|
|
2298
2448
|
},
|
|
2299
|
-
/* @__PURE__ */
|
|
2449
|
+
/* @__PURE__ */ React52.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React52.createElement(PopoverGridContainer, { ref: rowRefs[1] }, /* @__PURE__ */ React52.createElement(MultiSizeValueControl, { item: items2[0], rowRef: rowRefs[1] }), /* @__PURE__ */ React52.createElement(MultiSizeValueControl, { item: items2[1], rowRef: rowRefs[1] })), /* @__PURE__ */ React52.createElement(PopoverGridContainer, { ref: rowRefs[2] }, /* @__PURE__ */ React52.createElement(MultiSizeValueControl, { item: items2[2], rowRef: rowRefs[2] }), /* @__PURE__ */ React52.createElement(MultiSizeValueControl, { item: items2[3], rowRef: rowRefs[2] })))
|
|
2300
2450
|
)
|
|
2301
2451
|
));
|
|
2302
2452
|
}
|
|
2303
2453
|
var MultiSizeValueControl = ({ item, rowRef }) => {
|
|
2304
|
-
return /* @__PURE__ */
|
|
2454
|
+
return /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React52.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(Grid8, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React52.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React52.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React52.createElement(Grid8, { item: true, xs: 12 }, /* @__PURE__ */ React52.createElement(SizeControl, { startIcon: item.icon, anchorRef: rowRef })))));
|
|
2305
2455
|
};
|
|
2306
2456
|
|
|
2307
2457
|
// src/controls/linked-dimensions-control.tsx
|
|
2308
|
-
import * as
|
|
2458
|
+
import * as React53 from "react";
|
|
2309
2459
|
import { useRef as useRef9 } from "react";
|
|
2310
2460
|
import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil4 } from "@elementor/editor-props";
|
|
2311
2461
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
2312
|
-
import { Grid as
|
|
2313
|
-
import { __ as
|
|
2462
|
+
import { Grid as Grid9, Stack as Stack8, Tooltip as Tooltip6 } from "@elementor/ui";
|
|
2463
|
+
import { __ as __17 } from "@wordpress/i18n";
|
|
2314
2464
|
var LinkedDimensionsControl = ({
|
|
2315
2465
|
label,
|
|
2316
2466
|
isSiteRtl = false,
|
|
@@ -2349,10 +2499,10 @@ var LinkedDimensionsControl = ({
|
|
|
2349
2499
|
};
|
|
2350
2500
|
const tooltipLabel = label.toLowerCase();
|
|
2351
2501
|
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
2352
|
-
const linkedLabel =
|
|
2353
|
-
const unlinkedLabel =
|
|
2502
|
+
const linkedLabel = __17("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2503
|
+
const unlinkedLabel = __17("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
2354
2504
|
const disabled = sizeDisabled || dimensionsDisabled;
|
|
2355
|
-
return /* @__PURE__ */
|
|
2505
|
+
return /* @__PURE__ */ React53.createElement(
|
|
2356
2506
|
PropProvider,
|
|
2357
2507
|
{
|
|
2358
2508
|
propType,
|
|
@@ -2361,7 +2511,7 @@ var LinkedDimensionsControl = ({
|
|
|
2361
2511
|
placeholder: dimensionsPlaceholder,
|
|
2362
2512
|
isDisabled: () => disabled
|
|
2363
2513
|
},
|
|
2364
|
-
/* @__PURE__ */
|
|
2514
|
+
/* @__PURE__ */ React53.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React53.createElement(ControlFormLabel, null, label), /* @__PURE__ */ React53.createElement(Tooltip6, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React53.createElement(
|
|
2365
2515
|
StyledToggleButton,
|
|
2366
2516
|
{
|
|
2367
2517
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -2373,9 +2523,9 @@ var LinkedDimensionsControl = ({
|
|
|
2373
2523
|
disabled,
|
|
2374
2524
|
isPlaceholder: hasPlaceholders
|
|
2375
2525
|
},
|
|
2376
|
-
/* @__PURE__ */
|
|
2526
|
+
/* @__PURE__ */ React53.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2377
2527
|
))),
|
|
2378
|
-
getCssDimensionProps(isSiteRtl).map((row, index) => /* @__PURE__ */
|
|
2528
|
+
getCssDimensionProps(isSiteRtl).map((row, index) => /* @__PURE__ */ React53.createElement(Stack8, { direction: "row", gap: 2, flexWrap: "nowrap", key: index, ref: gridRowRefs[index] }, row.map(({ icon, ...props }) => /* @__PURE__ */ React53.createElement(Grid9, { container: true, gap: 0.75, alignItems: "center", key: props.bind }, /* @__PURE__ */ React53.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(Label, { ...props })), /* @__PURE__ */ React53.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(
|
|
2379
2529
|
Control3,
|
|
2380
2530
|
{
|
|
2381
2531
|
bind: props.bind,
|
|
@@ -2397,7 +2547,7 @@ var Control3 = ({
|
|
|
2397
2547
|
min
|
|
2398
2548
|
}) => {
|
|
2399
2549
|
if (isLinked) {
|
|
2400
|
-
return /* @__PURE__ */
|
|
2550
|
+
return /* @__PURE__ */ React53.createElement(
|
|
2401
2551
|
SizeControl,
|
|
2402
2552
|
{
|
|
2403
2553
|
startIcon,
|
|
@@ -2407,7 +2557,7 @@ var Control3 = ({
|
|
|
2407
2557
|
}
|
|
2408
2558
|
);
|
|
2409
2559
|
}
|
|
2410
|
-
return /* @__PURE__ */
|
|
2560
|
+
return /* @__PURE__ */ React53.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React53.createElement(
|
|
2411
2561
|
SizeControl,
|
|
2412
2562
|
{
|
|
2413
2563
|
startIcon,
|
|
@@ -2418,51 +2568,51 @@ var Control3 = ({
|
|
|
2418
2568
|
));
|
|
2419
2569
|
};
|
|
2420
2570
|
var Label = ({ label, bind }) => {
|
|
2421
|
-
return /* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ React53.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React53.createElement(ControlLabel, null, label));
|
|
2422
2572
|
};
|
|
2423
2573
|
function getCssDimensionProps(isSiteRtl) {
|
|
2424
2574
|
return [
|
|
2425
2575
|
[
|
|
2426
2576
|
{
|
|
2427
2577
|
bind: "block-start",
|
|
2428
|
-
label:
|
|
2429
|
-
icon: /* @__PURE__ */
|
|
2578
|
+
label: __17("Top", "elementor"),
|
|
2579
|
+
icon: /* @__PURE__ */ React53.createElement(SideTopIcon, { fontSize: "tiny" })
|
|
2430
2580
|
},
|
|
2431
2581
|
{
|
|
2432
2582
|
bind: "inline-end",
|
|
2433
|
-
label: isSiteRtl ?
|
|
2434
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2583
|
+
label: isSiteRtl ? __17("Left", "elementor") : __17("Right", "elementor"),
|
|
2584
|
+
icon: isSiteRtl ? /* @__PURE__ */ React53.createElement(SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React53.createElement(SideRightIcon, { fontSize: "tiny" })
|
|
2435
2585
|
}
|
|
2436
2586
|
],
|
|
2437
2587
|
[
|
|
2438
2588
|
{
|
|
2439
2589
|
bind: "block-end",
|
|
2440
|
-
label:
|
|
2441
|
-
icon: /* @__PURE__ */
|
|
2590
|
+
label: __17("Bottom", "elementor"),
|
|
2591
|
+
icon: /* @__PURE__ */ React53.createElement(SideBottomIcon, { fontSize: "tiny" })
|
|
2442
2592
|
},
|
|
2443
2593
|
{
|
|
2444
2594
|
bind: "inline-start",
|
|
2445
|
-
label: isSiteRtl ?
|
|
2446
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2595
|
+
label: isSiteRtl ? __17("Right", "elementor") : __17("Left", "elementor"),
|
|
2596
|
+
icon: isSiteRtl ? /* @__PURE__ */ React53.createElement(SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React53.createElement(SideLeftIcon, { fontSize: "tiny" })
|
|
2447
2597
|
}
|
|
2448
2598
|
]
|
|
2449
2599
|
];
|
|
2450
2600
|
}
|
|
2451
2601
|
|
|
2452
2602
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2453
|
-
import * as
|
|
2603
|
+
import * as React55 from "react";
|
|
2454
2604
|
import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
|
|
2455
2605
|
import { ChevronDownIcon as ChevronDownIcon2, TextIcon } from "@elementor/icons";
|
|
2456
2606
|
import { bindPopover as bindPopover4, bindTrigger as bindTrigger3, Popover as Popover4, UnstableTag as UnstableTag2, usePopupState as usePopupState5 } from "@elementor/ui";
|
|
2457
|
-
import { __ as
|
|
2607
|
+
import { __ as __19 } from "@wordpress/i18n";
|
|
2458
2608
|
|
|
2459
2609
|
// src/components/item-selector.tsx
|
|
2460
|
-
import * as
|
|
2610
|
+
import * as React54 from "react";
|
|
2461
2611
|
import { useCallback, useEffect as useEffect6, useState as useState8 } from "react";
|
|
2462
2612
|
import { PopoverBody, PopoverHeader as PopoverHeader2, PopoverMenuList, PopoverSearch } from "@elementor/editor-ui";
|
|
2463
|
-
import { Box as
|
|
2613
|
+
import { Box as Box7, Divider as Divider2, Link, Stack as Stack9, Typography as Typography4 } from "@elementor/ui";
|
|
2464
2614
|
import { debounce } from "@elementor/utils";
|
|
2465
|
-
import { __ as
|
|
2615
|
+
import { __ as __18 } from "@wordpress/i18n";
|
|
2466
2616
|
|
|
2467
2617
|
// src/hooks/use-filtered-items-list.ts
|
|
2468
2618
|
var useFilteredItemsList = (itemsList, searchValue) => {
|
|
@@ -2503,14 +2653,14 @@ var ItemSelector = ({
|
|
|
2503
2653
|
setSearchValue("");
|
|
2504
2654
|
onClose();
|
|
2505
2655
|
};
|
|
2506
|
-
return /* @__PURE__ */
|
|
2656
|
+
return /* @__PURE__ */ React54.createElement(PopoverBody, { width: sectionWidth }, /* @__PURE__ */ React54.createElement(PopoverHeader2, { title, onClose: handleClose, icon: /* @__PURE__ */ React54.createElement(IconComponent, { fontSize: "tiny" }) }), /* @__PURE__ */ React54.createElement(
|
|
2507
2657
|
PopoverSearch,
|
|
2508
2658
|
{
|
|
2509
2659
|
value: searchValue,
|
|
2510
2660
|
onSearch: handleSearch,
|
|
2511
|
-
placeholder:
|
|
2661
|
+
placeholder: __18("Search", "elementor")
|
|
2512
2662
|
}
|
|
2513
|
-
), /* @__PURE__ */
|
|
2663
|
+
), /* @__PURE__ */ React54.createElement(Divider2, null), filteredItemsList.length > 0 ? /* @__PURE__ */ React54.createElement(
|
|
2514
2664
|
ItemList,
|
|
2515
2665
|
{
|
|
2516
2666
|
itemListItems: filteredItemsList,
|
|
@@ -2520,7 +2670,7 @@ var ItemSelector = ({
|
|
|
2520
2670
|
itemStyle,
|
|
2521
2671
|
onDebounce
|
|
2522
2672
|
}
|
|
2523
|
-
) : /* @__PURE__ */
|
|
2673
|
+
) : /* @__PURE__ */ React54.createElement(
|
|
2524
2674
|
Stack9,
|
|
2525
2675
|
{
|
|
2526
2676
|
alignItems: "center",
|
|
@@ -2530,26 +2680,26 @@ var ItemSelector = ({
|
|
|
2530
2680
|
gap: 1.5,
|
|
2531
2681
|
overflow: "hidden"
|
|
2532
2682
|
},
|
|
2533
|
-
/* @__PURE__ */
|
|
2534
|
-
/* @__PURE__ */
|
|
2683
|
+
/* @__PURE__ */ React54.createElement(IconComponent, { fontSize: "large" }),
|
|
2684
|
+
/* @__PURE__ */ React54.createElement(Box7, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React54.createElement(Typography4, { align: "center", variant: "subtitle2", color: "text.secondary" }, __18("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React54.createElement(
|
|
2535
2685
|
Typography4,
|
|
2536
2686
|
{
|
|
2537
2687
|
variant: "subtitle2",
|
|
2538
2688
|
color: "text.secondary",
|
|
2539
2689
|
sx: { display: "flex", width: "100%", justifyContent: "center" }
|
|
2540
2690
|
},
|
|
2541
|
-
/* @__PURE__ */
|
|
2542
|
-
/* @__PURE__ */
|
|
2543
|
-
|
|
2691
|
+
/* @__PURE__ */ React54.createElement("span", null, "\u201C"),
|
|
2692
|
+
/* @__PURE__ */ React54.createElement(
|
|
2693
|
+
Box7,
|
|
2544
2694
|
{
|
|
2545
2695
|
component: "span",
|
|
2546
2696
|
sx: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" }
|
|
2547
2697
|
},
|
|
2548
2698
|
searchValue
|
|
2549
2699
|
),
|
|
2550
|
-
/* @__PURE__ */
|
|
2700
|
+
/* @__PURE__ */ React54.createElement("span", null, "\u201D.")
|
|
2551
2701
|
)),
|
|
2552
|
-
/* @__PURE__ */
|
|
2702
|
+
/* @__PURE__ */ React54.createElement(
|
|
2553
2703
|
Typography4,
|
|
2554
2704
|
{
|
|
2555
2705
|
align: "center",
|
|
@@ -2557,8 +2707,8 @@ var ItemSelector = ({
|
|
|
2557
2707
|
color: "text.secondary",
|
|
2558
2708
|
sx: { display: "flex", flexDirection: "column" }
|
|
2559
2709
|
},
|
|
2560
|
-
|
|
2561
|
-
/* @__PURE__ */
|
|
2710
|
+
__18("Try something else.", "elementor"),
|
|
2711
|
+
/* @__PURE__ */ React54.createElement(
|
|
2562
2712
|
Link,
|
|
2563
2713
|
{
|
|
2564
2714
|
color: "secondary",
|
|
@@ -2566,7 +2716,7 @@ var ItemSelector = ({
|
|
|
2566
2716
|
component: "button",
|
|
2567
2717
|
onClick: () => setSearchValue("")
|
|
2568
2718
|
},
|
|
2569
|
-
|
|
2719
|
+
__18("Clear & try again", "elementor")
|
|
2570
2720
|
)
|
|
2571
2721
|
)
|
|
2572
2722
|
));
|
|
@@ -2590,7 +2740,7 @@ var ItemList = ({
|
|
|
2590
2740
|
});
|
|
2591
2741
|
}, 100);
|
|
2592
2742
|
const memoizedItemStyle = useCallback((item) => itemStyle(item), [itemStyle]);
|
|
2593
|
-
return /* @__PURE__ */
|
|
2743
|
+
return /* @__PURE__ */ React54.createElement(
|
|
2594
2744
|
PopoverMenuList,
|
|
2595
2745
|
{
|
|
2596
2746
|
items: itemListItems,
|
|
@@ -2620,18 +2770,18 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2620
2770
|
const { value: fontFamily, setValue: setFontFamily, disabled, placeholder } = useBoundProp(stringPropTypeUtil5);
|
|
2621
2771
|
const popoverState = usePopupState5({ variant: "popover" });
|
|
2622
2772
|
const isShowingPlaceholder = !fontFamily && placeholder;
|
|
2623
|
-
const mapFontSubs =
|
|
2773
|
+
const mapFontSubs = React55.useMemo(() => {
|
|
2624
2774
|
return fontFamilies.map(({ label, fonts }) => ({
|
|
2625
2775
|
label,
|
|
2626
2776
|
items: fonts
|
|
2627
2777
|
}));
|
|
2628
2778
|
}, [fontFamilies]);
|
|
2629
|
-
return /* @__PURE__ */
|
|
2779
|
+
return /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(ControlActions, null, /* @__PURE__ */ React55.createElement(
|
|
2630
2780
|
UnstableTag2,
|
|
2631
2781
|
{
|
|
2632
2782
|
variant: "outlined",
|
|
2633
2783
|
label: fontFamily || placeholder,
|
|
2634
|
-
endIcon: /* @__PURE__ */
|
|
2784
|
+
endIcon: /* @__PURE__ */ React55.createElement(ChevronDownIcon2, { fontSize: "tiny" }),
|
|
2635
2785
|
...bindTrigger3(popoverState),
|
|
2636
2786
|
fullWidth: true,
|
|
2637
2787
|
disabled,
|
|
@@ -2642,7 +2792,7 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2642
2792
|
textTransform: "capitalize"
|
|
2643
2793
|
} : void 0
|
|
2644
2794
|
}
|
|
2645
|
-
)), /* @__PURE__ */
|
|
2795
|
+
)), /* @__PURE__ */ React55.createElement(
|
|
2646
2796
|
Popover4,
|
|
2647
2797
|
{
|
|
2648
2798
|
disablePortal: true,
|
|
@@ -2652,7 +2802,7 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2652
2802
|
sx: { my: 1.5 },
|
|
2653
2803
|
...bindPopover4(popoverState)
|
|
2654
2804
|
},
|
|
2655
|
-
/* @__PURE__ */
|
|
2805
|
+
/* @__PURE__ */ React55.createElement(
|
|
2656
2806
|
ItemSelector,
|
|
2657
2807
|
{
|
|
2658
2808
|
itemsList: mapFontSubs,
|
|
@@ -2660,7 +2810,7 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2660
2810
|
onItemChange: setFontFamily,
|
|
2661
2811
|
onClose: popoverState.close,
|
|
2662
2812
|
sectionWidth,
|
|
2663
|
-
title:
|
|
2813
|
+
title: __19("Font Family", "elementor"),
|
|
2664
2814
|
itemStyle: (item) => ({ fontFamily: item.value }),
|
|
2665
2815
|
onDebounce: enqueueFont,
|
|
2666
2816
|
icon: TextIcon
|
|
@@ -2670,13 +2820,13 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2670
2820
|
});
|
|
2671
2821
|
|
|
2672
2822
|
// src/controls/url-control.tsx
|
|
2673
|
-
import * as
|
|
2823
|
+
import * as React56 from "react";
|
|
2674
2824
|
import { urlPropTypeUtil } from "@elementor/editor-props";
|
|
2675
2825
|
import { TextField as TextField5 } from "@elementor/ui";
|
|
2676
2826
|
var UrlControl = createControl(({ placeholder }) => {
|
|
2677
2827
|
const { value, setValue, disabled } = useBoundProp(urlPropTypeUtil);
|
|
2678
2828
|
const handleChange = (event) => setValue(event.target.value);
|
|
2679
|
-
return /* @__PURE__ */
|
|
2829
|
+
return /* @__PURE__ */ React56.createElement(ControlActions, null, /* @__PURE__ */ React56.createElement(
|
|
2680
2830
|
TextField5,
|
|
2681
2831
|
{
|
|
2682
2832
|
size: "tiny",
|
|
@@ -2690,8 +2840,8 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
2690
2840
|
});
|
|
2691
2841
|
|
|
2692
2842
|
// src/controls/link-control.tsx
|
|
2693
|
-
import * as
|
|
2694
|
-
import { useMemo as
|
|
2843
|
+
import * as React60 from "react";
|
|
2844
|
+
import { useMemo as useMemo5, useState as useState9 } from "react";
|
|
2695
2845
|
import { getLinkInLinkRestriction } from "@elementor/editor-elements";
|
|
2696
2846
|
import {
|
|
2697
2847
|
linkPropTypeUtil,
|
|
@@ -2702,22 +2852,22 @@ import {
|
|
|
2702
2852
|
import { httpService as httpService2 } from "@elementor/http-client";
|
|
2703
2853
|
import { MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
2704
2854
|
import { useSessionStorage } from "@elementor/session";
|
|
2705
|
-
import { Collapse, Grid as
|
|
2855
|
+
import { Collapse, Grid as Grid10, IconButton as IconButton6, Stack as Stack10 } from "@elementor/ui";
|
|
2706
2856
|
import { debounce as debounce2 } from "@elementor/utils";
|
|
2707
|
-
import { __ as
|
|
2857
|
+
import { __ as __21 } from "@wordpress/i18n";
|
|
2708
2858
|
|
|
2709
2859
|
// src/components/autocomplete.tsx
|
|
2710
|
-
import * as
|
|
2711
|
-
import { forwardRef as
|
|
2860
|
+
import * as React57 from "react";
|
|
2861
|
+
import { forwardRef as forwardRef6 } from "react";
|
|
2712
2862
|
import { XIcon as XIcon2 } from "@elementor/icons";
|
|
2713
2863
|
import {
|
|
2714
2864
|
Autocomplete as AutocompleteBase,
|
|
2715
|
-
Box as
|
|
2716
|
-
IconButton as
|
|
2865
|
+
Box as Box8,
|
|
2866
|
+
IconButton as IconButton5,
|
|
2717
2867
|
InputAdornment as InputAdornment4,
|
|
2718
2868
|
TextField as TextField6
|
|
2719
2869
|
} from "@elementor/ui";
|
|
2720
|
-
var Autocomplete =
|
|
2870
|
+
var Autocomplete = forwardRef6((props, ref) => {
|
|
2721
2871
|
const {
|
|
2722
2872
|
options,
|
|
2723
2873
|
onOptionChange,
|
|
@@ -2733,7 +2883,7 @@ var Autocomplete = forwardRef5((props, ref) => {
|
|
|
2733
2883
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
2734
2884
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
2735
2885
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
2736
|
-
return /* @__PURE__ */
|
|
2886
|
+
return /* @__PURE__ */ React57.createElement(
|
|
2737
2887
|
AutocompleteBase,
|
|
2738
2888
|
{
|
|
2739
2889
|
...restProps,
|
|
@@ -2751,8 +2901,8 @@ var Autocomplete = forwardRef5((props, ref) => {
|
|
|
2751
2901
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
2752
2902
|
isOptionEqualToValue,
|
|
2753
2903
|
filterOptions: () => optionKeys,
|
|
2754
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
2755
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2904
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React57.createElement(Box8, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
2905
|
+
renderInput: (params) => /* @__PURE__ */ React57.createElement(
|
|
2756
2906
|
TextInput,
|
|
2757
2907
|
{
|
|
2758
2908
|
params,
|
|
@@ -2775,7 +2925,7 @@ var TextInput = ({
|
|
|
2775
2925
|
const onChange = (event) => {
|
|
2776
2926
|
handleChange(event.target.value);
|
|
2777
2927
|
};
|
|
2778
|
-
return /* @__PURE__ */
|
|
2928
|
+
return /* @__PURE__ */ React57.createElement(
|
|
2779
2929
|
TextField6,
|
|
2780
2930
|
{
|
|
2781
2931
|
...params,
|
|
@@ -2788,7 +2938,7 @@ var TextInput = ({
|
|
|
2788
2938
|
},
|
|
2789
2939
|
InputProps: {
|
|
2790
2940
|
...params.InputProps,
|
|
2791
|
-
endAdornment: /* @__PURE__ */
|
|
2941
|
+
endAdornment: /* @__PURE__ */ React57.createElement(ClearButton, { params, allowClear, handleChange })
|
|
2792
2942
|
}
|
|
2793
2943
|
}
|
|
2794
2944
|
);
|
|
@@ -2797,7 +2947,7 @@ var ClearButton = ({
|
|
|
2797
2947
|
allowClear,
|
|
2798
2948
|
handleChange,
|
|
2799
2949
|
params
|
|
2800
|
-
}) => /* @__PURE__ */
|
|
2950
|
+
}) => /* @__PURE__ */ React57.createElement(InputAdornment4, { position: "end" }, allowClear && /* @__PURE__ */ React57.createElement(IconButton5, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React57.createElement(XIcon2, { fontSize: params.size })));
|
|
2801
2951
|
function findMatchingOption(options, optionId = null) {
|
|
2802
2952
|
const formattedOption = (optionId || "").toString();
|
|
2803
2953
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -2819,21 +2969,21 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
2819
2969
|
}
|
|
2820
2970
|
|
|
2821
2971
|
// src/components/restricted-link-infotip.tsx
|
|
2822
|
-
import * as
|
|
2972
|
+
import * as React58 from "react";
|
|
2823
2973
|
import { selectElement } from "@elementor/editor-elements";
|
|
2824
2974
|
import { InfoCircleFilledIcon } from "@elementor/icons";
|
|
2825
|
-
import { Alert, AlertAction, AlertTitle, Box as
|
|
2826
|
-
import { __ as
|
|
2975
|
+
import { Alert, AlertAction, AlertTitle, Box as Box9, Infotip as Infotip2, Link as Link2 } from "@elementor/ui";
|
|
2976
|
+
import { __ as __20 } from "@wordpress/i18n";
|
|
2827
2977
|
var learnMoreButton = {
|
|
2828
|
-
label:
|
|
2978
|
+
label: __20("Learn More", "elementor"),
|
|
2829
2979
|
href: "https://go.elementor.com/element-link-inside-link-infotip"
|
|
2830
2980
|
};
|
|
2831
2981
|
var INFOTIP_CONTENT = {
|
|
2832
|
-
descendant:
|
|
2982
|
+
descendant: __20(
|
|
2833
2983
|
"To add a link to this element, first remove the link from the elements inside of it.",
|
|
2834
2984
|
"elementor"
|
|
2835
2985
|
),
|
|
2836
|
-
ancestor:
|
|
2986
|
+
ancestor: __20("To add a link to this element, first remove the link from its parent container.", "elementor")
|
|
2837
2987
|
};
|
|
2838
2988
|
var RestrictedLinkInfotip = ({
|
|
2839
2989
|
linkInLinkRestriction,
|
|
@@ -2846,12 +2996,12 @@ var RestrictedLinkInfotip = ({
|
|
|
2846
2996
|
selectElement(elementId);
|
|
2847
2997
|
}
|
|
2848
2998
|
};
|
|
2849
|
-
const content = /* @__PURE__ */
|
|
2999
|
+
const content = /* @__PURE__ */ React58.createElement(
|
|
2850
3000
|
Alert,
|
|
2851
3001
|
{
|
|
2852
3002
|
color: "secondary",
|
|
2853
|
-
icon: /* @__PURE__ */
|
|
2854
|
-
action: /* @__PURE__ */
|
|
3003
|
+
icon: /* @__PURE__ */ React58.createElement(InfoCircleFilledIcon, null),
|
|
3004
|
+
action: /* @__PURE__ */ React58.createElement(
|
|
2855
3005
|
AlertAction,
|
|
2856
3006
|
{
|
|
2857
3007
|
sx: { width: "fit-content" },
|
|
@@ -2859,34 +3009,34 @@ var RestrictedLinkInfotip = ({
|
|
|
2859
3009
|
color: "secondary",
|
|
2860
3010
|
onClick: handleTakeMeClick
|
|
2861
3011
|
},
|
|
2862
|
-
|
|
3012
|
+
__20("Take me there", "elementor")
|
|
2863
3013
|
)
|
|
2864
3014
|
},
|
|
2865
|
-
/* @__PURE__ */
|
|
2866
|
-
/* @__PURE__ */
|
|
3015
|
+
/* @__PURE__ */ React58.createElement(AlertTitle, null, __20("Nested links", "elementor")),
|
|
3016
|
+
/* @__PURE__ */ React58.createElement(Box9, { component: "span" }, INFOTIP_CONTENT[reason ?? "descendant"], " ", /* @__PURE__ */ React58.createElement(Link2, { href: learnMoreButton.href, target: "_blank", color: "info.main" }, learnMoreButton.label))
|
|
2867
3017
|
);
|
|
2868
|
-
return shouldRestrict && isVisible ? /* @__PURE__ */
|
|
2869
|
-
|
|
3018
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React58.createElement(
|
|
3019
|
+
Infotip2,
|
|
2870
3020
|
{
|
|
2871
3021
|
placement: "right",
|
|
2872
3022
|
content,
|
|
2873
3023
|
color: "secondary",
|
|
2874
3024
|
slotProps: { popper: { sx: { width: 300 } } }
|
|
2875
3025
|
},
|
|
2876
|
-
/* @__PURE__ */
|
|
2877
|
-
) : /* @__PURE__ */
|
|
3026
|
+
/* @__PURE__ */ React58.createElement(Box9, null, children)
|
|
3027
|
+
) : /* @__PURE__ */ React58.createElement(React58.Fragment, null, children);
|
|
2878
3028
|
};
|
|
2879
3029
|
|
|
2880
3030
|
// src/controls/switch-control.tsx
|
|
2881
|
-
import * as
|
|
3031
|
+
import * as React59 from "react";
|
|
2882
3032
|
import { booleanPropTypeUtil } from "@elementor/editor-props";
|
|
2883
|
-
import { Box as
|
|
3033
|
+
import { Box as Box10, Switch } from "@elementor/ui";
|
|
2884
3034
|
var SwitchControl = createControl(() => {
|
|
2885
3035
|
const { value, setValue, disabled } = useBoundProp(booleanPropTypeUtil);
|
|
2886
3036
|
const handleChange = (event) => {
|
|
2887
3037
|
setValue(event.target.checked);
|
|
2888
3038
|
};
|
|
2889
|
-
return /* @__PURE__ */
|
|
3039
|
+
return /* @__PURE__ */ React59.createElement(Box10, { sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React59.createElement(
|
|
2890
3040
|
Switch,
|
|
2891
3041
|
{
|
|
2892
3042
|
checked: !!value,
|
|
@@ -2901,7 +3051,7 @@ var SwitchControl = createControl(() => {
|
|
|
2901
3051
|
});
|
|
2902
3052
|
|
|
2903
3053
|
// src/controls/link-control.tsx
|
|
2904
|
-
var
|
|
3054
|
+
var SIZE6 = "tiny";
|
|
2905
3055
|
var LinkControl = createControl((props) => {
|
|
2906
3056
|
const { value, path, setValue, ...propContext } = useBoundProp(linkPropTypeUtil);
|
|
2907
3057
|
const [linkSessionValue, setLinkSessionValue] = useSessionStorage(path.join("/"));
|
|
@@ -2912,7 +3062,7 @@ var LinkControl = createControl((props) => {
|
|
|
2912
3062
|
placeholder,
|
|
2913
3063
|
minInputLength = 2,
|
|
2914
3064
|
context: { elementId },
|
|
2915
|
-
label =
|
|
3065
|
+
label = __21("Link", "elementor")
|
|
2916
3066
|
} = props || {};
|
|
2917
3067
|
const [linkInLinkRestriction, setLinkInLinkRestriction] = useState9(getLinkInLinkRestriction(elementId));
|
|
2918
3068
|
const [options, setOptions] = useState9(
|
|
@@ -2966,7 +3116,7 @@ var LinkControl = createControl((props) => {
|
|
|
2966
3116
|
}
|
|
2967
3117
|
debounceFetch({ ...requestParams, term: newValue });
|
|
2968
3118
|
};
|
|
2969
|
-
const debounceFetch =
|
|
3119
|
+
const debounceFetch = useMemo5(
|
|
2970
3120
|
() => debounce2(
|
|
2971
3121
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
2972
3122
|
setOptions(formatOptions(newOptions));
|
|
@@ -2975,7 +3125,7 @@ var LinkControl = createControl((props) => {
|
|
|
2975
3125
|
),
|
|
2976
3126
|
[endpoint]
|
|
2977
3127
|
);
|
|
2978
|
-
return /* @__PURE__ */
|
|
3128
|
+
return /* @__PURE__ */ React60.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React60.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React60.createElement(
|
|
2979
3129
|
Stack10,
|
|
2980
3130
|
{
|
|
2981
3131
|
direction: "row",
|
|
@@ -2985,17 +3135,17 @@ var LinkControl = createControl((props) => {
|
|
|
2985
3135
|
marginInlineEnd: -0.75
|
|
2986
3136
|
}
|
|
2987
3137
|
},
|
|
2988
|
-
/* @__PURE__ */
|
|
2989
|
-
/* @__PURE__ */
|
|
3138
|
+
/* @__PURE__ */ React60.createElement(ControlFormLabel, null, label),
|
|
3139
|
+
/* @__PURE__ */ React60.createElement(RestrictedLinkInfotip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React60.createElement(
|
|
2990
3140
|
ToggleIconControl,
|
|
2991
3141
|
{
|
|
2992
3142
|
disabled: shouldDisableAddingLink,
|
|
2993
3143
|
active: isActive,
|
|
2994
3144
|
onIconClick: onEnabledChange,
|
|
2995
|
-
label:
|
|
3145
|
+
label: __21("Toggle link", "elementor")
|
|
2996
3146
|
}
|
|
2997
3147
|
))
|
|
2998
|
-
), /* @__PURE__ */
|
|
3148
|
+
), /* @__PURE__ */ React60.createElement(Collapse, { in: isActive, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React60.createElement(Stack10, { gap: 1.5 }, /* @__PURE__ */ React60.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React60.createElement(ControlActions, null, /* @__PURE__ */ React60.createElement(
|
|
2999
3149
|
Autocomplete,
|
|
3000
3150
|
{
|
|
3001
3151
|
options,
|
|
@@ -3006,10 +3156,10 @@ var LinkControl = createControl((props) => {
|
|
|
3006
3156
|
onTextChange,
|
|
3007
3157
|
minInputLength
|
|
3008
3158
|
}
|
|
3009
|
-
))), /* @__PURE__ */
|
|
3159
|
+
))), /* @__PURE__ */ React60.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React60.createElement(Grid10, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React60.createElement(Grid10, { item: true }, /* @__PURE__ */ React60.createElement(ControlFormLabel, null, __21("Open in a new tab", "elementor"))), /* @__PURE__ */ React60.createElement(Grid10, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React60.createElement(SwitchControl, null))))))));
|
|
3010
3160
|
});
|
|
3011
3161
|
var ToggleIconControl = ({ disabled, active, onIconClick, label }) => {
|
|
3012
|
-
return /* @__PURE__ */
|
|
3162
|
+
return /* @__PURE__ */ React60.createElement(IconButton6, { size: SIZE6, onClick: onIconClick, "aria-label": label, disabled }, active ? /* @__PURE__ */ React60.createElement(MinusIcon, { fontSize: SIZE6 }) : /* @__PURE__ */ React60.createElement(PlusIcon2, { fontSize: SIZE6 }));
|
|
3013
3163
|
};
|
|
3014
3164
|
async function fetchOptions(ajaxUrl, params) {
|
|
3015
3165
|
if (!params || !ajaxUrl) {
|
|
@@ -3041,12 +3191,12 @@ function generateFirstLoadedOption(unionValue) {
|
|
|
3041
3191
|
}
|
|
3042
3192
|
|
|
3043
3193
|
// src/controls/gap-control.tsx
|
|
3044
|
-
import * as
|
|
3194
|
+
import * as React61 from "react";
|
|
3045
3195
|
import { useRef as useRef10 } from "react";
|
|
3046
3196
|
import { layoutDirectionPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil5 } from "@elementor/editor-props";
|
|
3047
3197
|
import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/icons";
|
|
3048
|
-
import { Grid as
|
|
3049
|
-
import { __ as
|
|
3198
|
+
import { Grid as Grid11, Stack as Stack11, ToggleButton as ToggleButton3, Tooltip as Tooltip7 } from "@elementor/ui";
|
|
3199
|
+
import { __ as __22 } from "@wordpress/i18n";
|
|
3050
3200
|
var GapControl = ({ label }) => {
|
|
3051
3201
|
const {
|
|
3052
3202
|
value: directionValue,
|
|
@@ -3070,10 +3220,10 @@ var GapControl = ({ label }) => {
|
|
|
3070
3220
|
};
|
|
3071
3221
|
const tooltipLabel = label.toLowerCase();
|
|
3072
3222
|
const LinkedIcon = isLinked ? LinkIcon2 : DetachIcon2;
|
|
3073
|
-
const linkedLabel =
|
|
3074
|
-
const unlinkedLabel =
|
|
3223
|
+
const linkedLabel = __22("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
3224
|
+
const unlinkedLabel = __22("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
3075
3225
|
const disabled = sizeDisabled || directionDisabled;
|
|
3076
|
-
return /* @__PURE__ */
|
|
3226
|
+
return /* @__PURE__ */ React61.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React61.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React61.createElement(ControlLabel, null, label), /* @__PURE__ */ React61.createElement(Tooltip7, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React61.createElement(
|
|
3077
3227
|
ToggleButton3,
|
|
3078
3228
|
{
|
|
3079
3229
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -3084,8 +3234,8 @@ var GapControl = ({ label }) => {
|
|
|
3084
3234
|
onChange: onLinkToggle,
|
|
3085
3235
|
disabled
|
|
3086
3236
|
},
|
|
3087
|
-
/* @__PURE__ */
|
|
3088
|
-
))), /* @__PURE__ */
|
|
3237
|
+
/* @__PURE__ */ React61.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
3238
|
+
))), /* @__PURE__ */ React61.createElement(Stack11, { direction: "row", gap: 2, flexWrap: "nowrap", ref: stackRef }, /* @__PURE__ */ React61.createElement(Grid11, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React61.createElement(Grid11, { item: true, xs: 12 }, /* @__PURE__ */ React61.createElement(ControlFormLabel, null, __22("Column", "elementor"))), /* @__PURE__ */ React61.createElement(Grid11, { item: true, xs: 12 }, /* @__PURE__ */ React61.createElement(Control4, { bind: "column", isLinked, anchorRef: stackRef }))), /* @__PURE__ */ React61.createElement(Grid11, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React61.createElement(Grid11, { item: true, xs: 12 }, /* @__PURE__ */ React61.createElement(ControlFormLabel, null, __22("Row", "elementor"))), /* @__PURE__ */ React61.createElement(Grid11, { item: true, xs: 12 }, /* @__PURE__ */ React61.createElement(Control4, { bind: "row", isLinked, anchorRef: stackRef })))));
|
|
3089
3239
|
};
|
|
3090
3240
|
var Control4 = ({
|
|
3091
3241
|
bind,
|
|
@@ -3093,21 +3243,21 @@ var Control4 = ({
|
|
|
3093
3243
|
anchorRef
|
|
3094
3244
|
}) => {
|
|
3095
3245
|
if (isLinked) {
|
|
3096
|
-
return /* @__PURE__ */
|
|
3246
|
+
return /* @__PURE__ */ React61.createElement(SizeControl, { anchorRef });
|
|
3097
3247
|
}
|
|
3098
|
-
return /* @__PURE__ */
|
|
3248
|
+
return /* @__PURE__ */ React61.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React61.createElement(SizeControl, { anchorRef }));
|
|
3099
3249
|
};
|
|
3100
3250
|
|
|
3101
3251
|
// src/controls/aspect-ratio-control.tsx
|
|
3102
|
-
import * as
|
|
3252
|
+
import * as React62 from "react";
|
|
3103
3253
|
import { useEffect as useEffect7, useState as useState10 } from "react";
|
|
3104
3254
|
import { stringPropTypeUtil as stringPropTypeUtil7 } from "@elementor/editor-props";
|
|
3105
3255
|
import { MenuListItem as MenuListItem3 } from "@elementor/editor-ui";
|
|
3106
3256
|
import { ArrowsMoveHorizontalIcon, ArrowsMoveVerticalIcon } from "@elementor/icons";
|
|
3107
|
-
import { Grid as
|
|
3108
|
-
import { __ as
|
|
3257
|
+
import { Grid as Grid12, Select as Select2, Stack as Stack12, TextField as TextField7 } from "@elementor/ui";
|
|
3258
|
+
import { __ as __23 } from "@wordpress/i18n";
|
|
3109
3259
|
var RATIO_OPTIONS = [
|
|
3110
|
-
{ label:
|
|
3260
|
+
{ label: __23("Auto", "elementor"), value: "auto" },
|
|
3111
3261
|
{ label: "1/1", value: "1/1" },
|
|
3112
3262
|
{ label: "4/3", value: "4/3" },
|
|
3113
3263
|
{ label: "3/4", value: "3/4" },
|
|
@@ -3166,7 +3316,7 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
3166
3316
|
setAspectRatioValue(`${customWidth}/${newHeight}`);
|
|
3167
3317
|
}
|
|
3168
3318
|
};
|
|
3169
|
-
return /* @__PURE__ */
|
|
3319
|
+
return /* @__PURE__ */ React62.createElement(ControlActions, null, /* @__PURE__ */ React62.createElement(Stack12, { direction: "column", gap: 2 }, /* @__PURE__ */ React62.createElement(Grid12, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React62.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React62.createElement(ControlLabel, null, label)), /* @__PURE__ */ React62.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React62.createElement(
|
|
3170
3320
|
Select2,
|
|
3171
3321
|
{
|
|
3172
3322
|
size: "tiny",
|
|
@@ -3177,10 +3327,10 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
3177
3327
|
onChange: handleSelectChange,
|
|
3178
3328
|
fullWidth: true
|
|
3179
3329
|
},
|
|
3180
|
-
[...RATIO_OPTIONS, { label:
|
|
3181
|
-
({ label: optionLabel, ...props }) => /* @__PURE__ */
|
|
3330
|
+
[...RATIO_OPTIONS, { label: __23("Custom", "elementor"), value: CUSTOM_RATIO }].map(
|
|
3331
|
+
({ label: optionLabel, ...props }) => /* @__PURE__ */ React62.createElement(MenuListItem3, { key: props.value, ...props, value: props.value ?? "" }, optionLabel)
|
|
3182
3332
|
)
|
|
3183
|
-
))), isCustom && /* @__PURE__ */
|
|
3333
|
+
))), isCustom && /* @__PURE__ */ React62.createElement(Grid12, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React62.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React62.createElement(
|
|
3184
3334
|
TextField7,
|
|
3185
3335
|
{
|
|
3186
3336
|
size: "tiny",
|
|
@@ -3190,10 +3340,10 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
3190
3340
|
value: customWidth,
|
|
3191
3341
|
onChange: handleCustomWidthChange,
|
|
3192
3342
|
InputProps: {
|
|
3193
|
-
startAdornment: /* @__PURE__ */
|
|
3343
|
+
startAdornment: /* @__PURE__ */ React62.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
3194
3344
|
}
|
|
3195
3345
|
}
|
|
3196
|
-
)), /* @__PURE__ */
|
|
3346
|
+
)), /* @__PURE__ */ React62.createElement(Grid12, { item: true, xs: 6 }, /* @__PURE__ */ React62.createElement(
|
|
3197
3347
|
TextField7,
|
|
3198
3348
|
{
|
|
3199
3349
|
size: "tiny",
|
|
@@ -3203,23 +3353,23 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
3203
3353
|
value: customHeight,
|
|
3204
3354
|
onChange: handleCustomHeightChange,
|
|
3205
3355
|
InputProps: {
|
|
3206
|
-
startAdornment: /* @__PURE__ */
|
|
3356
|
+
startAdornment: /* @__PURE__ */ React62.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
3207
3357
|
}
|
|
3208
3358
|
}
|
|
3209
3359
|
)))));
|
|
3210
3360
|
});
|
|
3211
3361
|
|
|
3212
3362
|
// src/controls/svg-media-control.tsx
|
|
3213
|
-
import * as
|
|
3363
|
+
import * as React64 from "react";
|
|
3214
3364
|
import { useState as useState12 } from "react";
|
|
3215
3365
|
import { imageSrcPropTypeUtil as imageSrcPropTypeUtil2 } from "@elementor/editor-props";
|
|
3216
3366
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
3217
|
-
import { Button as Button4, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress3, Stack as Stack13, styled as
|
|
3367
|
+
import { Button as Button4, Card as Card2, CardMedia as CardMedia2, CardOverlay as CardOverlay2, CircularProgress as CircularProgress3, Stack as Stack13, styled as styled7 } from "@elementor/ui";
|
|
3218
3368
|
import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
|
|
3219
|
-
import { __ as
|
|
3369
|
+
import { __ as __25 } from "@wordpress/i18n";
|
|
3220
3370
|
|
|
3221
3371
|
// src/components/enable-unfiltered-modal.tsx
|
|
3222
|
-
import * as
|
|
3372
|
+
import * as React63 from "react";
|
|
3223
3373
|
import { useState as useState11 } from "react";
|
|
3224
3374
|
import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
|
|
3225
3375
|
import {
|
|
@@ -3233,19 +3383,19 @@ import {
|
|
|
3233
3383
|
DialogTitle,
|
|
3234
3384
|
Divider as Divider3
|
|
3235
3385
|
} from "@elementor/ui";
|
|
3236
|
-
import { __ as
|
|
3237
|
-
var ADMIN_TITLE_TEXT =
|
|
3238
|
-
var ADMIN_CONTENT_TEXT =
|
|
3386
|
+
import { __ as __24 } from "@wordpress/i18n";
|
|
3387
|
+
var ADMIN_TITLE_TEXT = __24("Enable Unfiltered Uploads", "elementor");
|
|
3388
|
+
var ADMIN_CONTENT_TEXT = __24(
|
|
3239
3389
|
"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.",
|
|
3240
3390
|
"elementor"
|
|
3241
3391
|
);
|
|
3242
|
-
var NON_ADMIN_TITLE_TEXT =
|
|
3243
|
-
var NON_ADMIN_CONTENT_TEXT =
|
|
3392
|
+
var NON_ADMIN_TITLE_TEXT = __24("Sorry, you can't upload that file yet", "elementor");
|
|
3393
|
+
var NON_ADMIN_CONTENT_TEXT = __24(
|
|
3244
3394
|
"This is because this file type may pose a security risk. To upload them anyway, ask the site administrator to enable unfiltered file uploads.",
|
|
3245
3395
|
"elementor"
|
|
3246
3396
|
);
|
|
3247
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT1 =
|
|
3248
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT2 =
|
|
3397
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT1 = __24("Failed to enable unfiltered files upload.", "elementor");
|
|
3398
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT2 = __24(
|
|
3249
3399
|
"You can try again, if the problem persists, please contact support.",
|
|
3250
3400
|
"elementor"
|
|
3251
3401
|
);
|
|
@@ -3272,9 +3422,9 @@ var EnableUnfilteredModal = (props) => {
|
|
|
3272
3422
|
}
|
|
3273
3423
|
};
|
|
3274
3424
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
3275
|
-
return canManageOptions ? /* @__PURE__ */
|
|
3425
|
+
return canManageOptions ? /* @__PURE__ */ React63.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React63.createElement(NonAdminDialog, { ...dialogProps });
|
|
3276
3426
|
};
|
|
3277
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
3427
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React63.createElement(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React63.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React63.createElement(DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React63.createElement(Divider3, null), /* @__PURE__ */ React63.createElement(DialogContent, null, /* @__PURE__ */ React63.createElement(DialogContentText, null, isError ? /* @__PURE__ */ React63.createElement(React63.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ React63.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React63.createElement(DialogActions, null, /* @__PURE__ */ React63.createElement(Button3, { size: "medium", color: "secondary", onClick: () => onClose(false) }, __24("Cancel", "elementor")), /* @__PURE__ */ React63.createElement(
|
|
3278
3428
|
Button3,
|
|
3279
3429
|
{
|
|
3280
3430
|
size: "medium",
|
|
@@ -3283,16 +3433,16 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
3283
3433
|
color: "primary",
|
|
3284
3434
|
disabled: isPending
|
|
3285
3435
|
},
|
|
3286
|
-
isPending ? /* @__PURE__ */
|
|
3436
|
+
isPending ? /* @__PURE__ */ React63.createElement(CircularProgress2, { size: 24 }) : __24("Enable", "elementor")
|
|
3287
3437
|
)));
|
|
3288
|
-
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */
|
|
3438
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React63.createElement(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React63.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React63.createElement(DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React63.createElement(Divider3, null), /* @__PURE__ */ React63.createElement(DialogContent, null, /* @__PURE__ */ React63.createElement(DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React63.createElement(DialogActions, null, /* @__PURE__ */ React63.createElement(Button3, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, __24("Got it", "elementor"))));
|
|
3289
3439
|
|
|
3290
3440
|
// src/controls/svg-media-control.tsx
|
|
3291
3441
|
var TILE_SIZE = 8;
|
|
3292
3442
|
var TILE_WHITE = "transparent";
|
|
3293
3443
|
var TILE_BLACK = "#c1c1c1";
|
|
3294
3444
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
3295
|
-
var StyledCard =
|
|
3445
|
+
var StyledCard = styled7(Card2)`
|
|
3296
3446
|
background-color: white;
|
|
3297
3447
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
3298
3448
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -3301,7 +3451,7 @@ var StyledCard = styled6(Card2)`
|
|
|
3301
3451
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
3302
3452
|
border: none;
|
|
3303
3453
|
`;
|
|
3304
|
-
var StyledCardMediaContainer =
|
|
3454
|
+
var StyledCardMediaContainer = styled7(Stack13)`
|
|
3305
3455
|
position: relative;
|
|
3306
3456
|
height: 140px;
|
|
3307
3457
|
object-fit: contain;
|
|
@@ -3333,392 +3483,83 @@ var SvgMediaControl = createControl(() => {
|
|
|
3333
3483
|
});
|
|
3334
3484
|
}
|
|
3335
3485
|
});
|
|
3336
|
-
const onCloseUnfilteredModal = (enabled) => {
|
|
3337
|
-
setUnfilteredModalOpenState(false);
|
|
3338
|
-
if (enabled) {
|
|
3339
|
-
open(MODE_UPLOAD);
|
|
3340
|
-
}
|
|
3341
|
-
};
|
|
3342
|
-
const handleClick = (openOptions) => {
|
|
3343
|
-
if (!allowSvgUpload && openOptions === MODE_UPLOAD) {
|
|
3344
|
-
setUnfilteredModalOpenState(true);
|
|
3345
|
-
} else {
|
|
3346
|
-
open(openOptions);
|
|
3347
|
-
}
|
|
3348
|
-
};
|
|
3349
|
-
return /* @__PURE__ */ React49.createElement(Stack13, { gap: 1 }, /* @__PURE__ */ React49.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React49.createElement(ControlActions, null, /* @__PURE__ */ React49.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React49.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React49.createElement(CircularProgress3, { role: "progressbar" }) : /* @__PURE__ */ React49.createElement(
|
|
3350
|
-
CardMedia2,
|
|
3351
|
-
{
|
|
3352
|
-
component: "img",
|
|
3353
|
-
image: src,
|
|
3354
|
-
alt: __18("Preview SVG", "elementor"),
|
|
3355
|
-
sx: { maxHeight: "140px", width: "50px" }
|
|
3356
|
-
}
|
|
3357
|
-
)), /* @__PURE__ */ React49.createElement(
|
|
3358
|
-
CardOverlay2,
|
|
3359
|
-
{
|
|
3360
|
-
sx: {
|
|
3361
|
-
"&:hover": {
|
|
3362
|
-
backgroundColor: "rgba( 0, 0, 0, 0.75 )"
|
|
3363
|
-
}
|
|
3364
|
-
}
|
|
3365
|
-
},
|
|
3366
|
-
/* @__PURE__ */ React49.createElement(Stack13, { gap: 1 }, /* @__PURE__ */ React49.createElement(
|
|
3367
|
-
Button4,
|
|
3368
|
-
{
|
|
3369
|
-
size: "tiny",
|
|
3370
|
-
color: "inherit",
|
|
3371
|
-
variant: "outlined",
|
|
3372
|
-
onClick: () => handleClick(MODE_BROWSE)
|
|
3373
|
-
},
|
|
3374
|
-
__18("Select SVG", "elementor")
|
|
3375
|
-
), /* @__PURE__ */ React49.createElement(
|
|
3376
|
-
Button4,
|
|
3377
|
-
{
|
|
3378
|
-
size: "tiny",
|
|
3379
|
-
variant: "text",
|
|
3380
|
-
color: "inherit",
|
|
3381
|
-
startIcon: /* @__PURE__ */ React49.createElement(UploadIcon2, null),
|
|
3382
|
-
onClick: () => handleClick(MODE_UPLOAD)
|
|
3383
|
-
},
|
|
3384
|
-
__18("Upload", "elementor")
|
|
3385
|
-
))
|
|
3386
|
-
))));
|
|
3387
|
-
});
|
|
3388
|
-
|
|
3389
|
-
// src/controls/background-control/background-control.tsx
|
|
3390
|
-
import * as React66 from "react";
|
|
3391
|
-
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
3392
|
-
import { Grid as Grid16 } from "@elementor/ui";
|
|
3393
|
-
import { __ as __29 } from "@wordpress/i18n";
|
|
3394
|
-
|
|
3395
|
-
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
3396
|
-
import * as React65 from "react";
|
|
3397
|
-
import {
|
|
3398
|
-
backgroundColorOverlayPropTypeUtil as backgroundColorOverlayPropTypeUtil2,
|
|
3399
|
-
backgroundImageOverlayPropTypeUtil as backgroundImageOverlayPropTypeUtil2,
|
|
3400
|
-
backgroundOverlayPropTypeUtil,
|
|
3401
|
-
colorPropTypeUtil as colorPropTypeUtil3
|
|
3402
|
-
} from "@elementor/editor-props";
|
|
3403
|
-
import { Box as Box12, CardMedia as CardMedia3, styled as styled7, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator3 } from "@elementor/ui";
|
|
3404
|
-
import { useWpMediaAttachment as useWpMediaAttachment3 } from "@elementor/wp-media";
|
|
3405
|
-
import { __ as __28 } from "@wordpress/i18n";
|
|
3406
|
-
|
|
3407
|
-
// src/components/unstable-repeater/actions/tooltip-add-item-action.tsx
|
|
3408
|
-
import * as React51 from "react";
|
|
3409
|
-
import { PlusIcon as PlusIcon3 } from "@elementor/icons";
|
|
3410
|
-
import { Box as Box9, IconButton as IconButton4, Infotip as Infotip2 } from "@elementor/ui";
|
|
3411
|
-
import { __ as __19 } from "@wordpress/i18n";
|
|
3412
|
-
|
|
3413
|
-
// src/components/unstable-repeater/context/repeater-context.tsx
|
|
3414
|
-
import * as React50 from "react";
|
|
3415
|
-
import { createContext as createContext7, useState as useState13 } from "react";
|
|
3416
|
-
import { usePopupState as usePopupState6 } from "@elementor/ui";
|
|
3417
|
-
var RepeaterContext = createContext7(null);
|
|
3418
|
-
var EMPTY_OPEN_ITEM2 = -1;
|
|
3419
|
-
var useRepeaterContext = () => {
|
|
3420
|
-
const context = React50.useContext(RepeaterContext);
|
|
3421
|
-
if (!context) {
|
|
3422
|
-
throw new Error("useRepeaterContext must be used within a RepeaterContextProvider");
|
|
3423
|
-
}
|
|
3424
|
-
return context;
|
|
3425
|
-
};
|
|
3426
|
-
var RepeaterContextProvider = ({
|
|
3427
|
-
children,
|
|
3428
|
-
initial,
|
|
3429
|
-
propTypeUtil
|
|
3430
|
-
}) => {
|
|
3431
|
-
const { value: repeaterValues, setValue: setRepeaterValues } = useBoundProp(propTypeUtil);
|
|
3432
|
-
const [items2, setItems] = useSyncExternalState({
|
|
3433
|
-
external: repeaterValues,
|
|
3434
|
-
fallback: () => [],
|
|
3435
|
-
setExternal: setRepeaterValues,
|
|
3436
|
-
persistWhen: () => true
|
|
3437
|
-
});
|
|
3438
|
-
const [itemsWithKeys, setItemsWithKeys] = useState13(() => {
|
|
3439
|
-
return items2?.map((item) => ({ key: generateUniqueKey(), item })) ?? [];
|
|
3440
|
-
});
|
|
3441
|
-
React50.useEffect(() => {
|
|
3442
|
-
setItemsWithKeys((prevItemsWithKeys) => {
|
|
3443
|
-
const newItemsWithKeys = items2?.map((item) => {
|
|
3444
|
-
const existingItem = prevItemsWithKeys.find((i) => i.item === item);
|
|
3445
|
-
return existingItem || { key: generateUniqueKey(), item };
|
|
3446
|
-
}) ?? [];
|
|
3447
|
-
return newItemsWithKeys;
|
|
3448
|
-
});
|
|
3449
|
-
}, [items2]);
|
|
3450
|
-
const handleSetItems = (newItemsWithKeys) => {
|
|
3451
|
-
setItems(newItemsWithKeys.map(({ item }) => item));
|
|
3452
|
-
};
|
|
3453
|
-
const [openItemIndex, setOpenItemIndex] = useState13(EMPTY_OPEN_ITEM2);
|
|
3454
|
-
const [rowRef, setRowRef] = useState13(null);
|
|
3455
|
-
const isOpen = openItemIndex !== EMPTY_OPEN_ITEM2;
|
|
3456
|
-
const popoverState = usePopupState6({ variant: "popover" });
|
|
3457
|
-
const addItem = (ev, config) => {
|
|
3458
|
-
const item = config?.item ?? initial;
|
|
3459
|
-
const newIndex = config?.index ?? items2.length;
|
|
3460
|
-
const newItems = [...items2];
|
|
3461
|
-
newItems.splice(newIndex, 0, item);
|
|
3462
|
-
setItems(newItems);
|
|
3463
|
-
setOpenItemIndex(newIndex);
|
|
3464
|
-
popoverState.open(rowRef ?? ev);
|
|
3465
|
-
};
|
|
3466
|
-
const removeItem = (index) => {
|
|
3467
|
-
setItems(items2.filter((_, pos) => pos !== index));
|
|
3468
|
-
};
|
|
3469
|
-
const updateItem = (updatedItem, index) => {
|
|
3470
|
-
const newItems = [...items2.slice(0, index), updatedItem, ...items2.slice(index + 1)];
|
|
3471
|
-
setItems(newItems);
|
|
3472
|
-
};
|
|
3473
|
-
return /* @__PURE__ */ React50.createElement(
|
|
3474
|
-
RepeaterContext.Provider,
|
|
3475
|
-
{
|
|
3476
|
-
value: {
|
|
3477
|
-
isOpen,
|
|
3478
|
-
openItemIndex,
|
|
3479
|
-
setOpenItemIndex,
|
|
3480
|
-
items: itemsWithKeys ?? [],
|
|
3481
|
-
setItems: handleSetItems,
|
|
3482
|
-
popoverState,
|
|
3483
|
-
initial,
|
|
3484
|
-
updateItem,
|
|
3485
|
-
addItem,
|
|
3486
|
-
removeItem,
|
|
3487
|
-
rowRef,
|
|
3488
|
-
setRowRef
|
|
3489
|
-
}
|
|
3490
|
-
},
|
|
3491
|
-
children
|
|
3492
|
-
);
|
|
3493
|
-
};
|
|
3494
|
-
var generateUniqueKey = () => {
|
|
3495
|
-
return Date.now() + Math.floor(Math.random() * 1e6);
|
|
3496
|
-
};
|
|
3497
|
-
|
|
3498
|
-
// src/components/unstable-repeater/actions/tooltip-add-item-action.tsx
|
|
3499
|
-
var SIZE4 = "tiny";
|
|
3500
|
-
var TooltipAddItemAction = ({
|
|
3501
|
-
disabled = false,
|
|
3502
|
-
enableTooltip = false,
|
|
3503
|
-
tooltipContent = null,
|
|
3504
|
-
newItemIndex
|
|
3505
|
-
}) => {
|
|
3506
|
-
const { addItem } = useRepeaterContext();
|
|
3507
|
-
const onClick = (ev) => addItem(ev, { index: newItemIndex });
|
|
3508
|
-
return /* @__PURE__ */ React51.createElement(ConditionalToolTip, { content: tooltipContent, enable: enableTooltip }, /* @__PURE__ */ React51.createElement(Box9, { component: "span", sx: { cursor: disabled ? "not-allowed" : "pointer" } }, /* @__PURE__ */ React51.createElement(
|
|
3509
|
-
IconButton4,
|
|
3510
|
-
{
|
|
3511
|
-
size: SIZE4,
|
|
3512
|
-
disabled,
|
|
3513
|
-
onClick,
|
|
3514
|
-
"aria-label": __19("Add item", "elementor")
|
|
3515
|
-
},
|
|
3516
|
-
/* @__PURE__ */ React51.createElement(PlusIcon3, { fontSize: SIZE4 })
|
|
3517
|
-
)));
|
|
3518
|
-
};
|
|
3519
|
-
var ConditionalToolTip = ({
|
|
3520
|
-
children,
|
|
3521
|
-
enable,
|
|
3522
|
-
content
|
|
3523
|
-
}) => enable && content ? /* @__PURE__ */ React51.createElement(Infotip2, { placement: "right", color: "secondary", content }, children) : children;
|
|
3524
|
-
|
|
3525
|
-
// src/components/unstable-repeater/header/header.tsx
|
|
3526
|
-
import * as React52 from "react";
|
|
3527
|
-
import { Box as Box10, Stack as Stack14, Typography as Typography5 } from "@elementor/ui";
|
|
3528
|
-
var Header = React52.forwardRef(({ label, children }, ref) => {
|
|
3529
|
-
const { value } = useBoundProp();
|
|
3530
|
-
return /* @__PURE__ */ React52.createElement(Stack14, { direction: "row", alignItems: "center", gap: 1, sx: { marginInlineEnd: -0.75, py: 0.25 }, ref }, /* @__PURE__ */ React52.createElement(Box10, { display: "flex", alignItems: "center", gap: 1, sx: { flexGrow: 1 } }, /* @__PURE__ */ React52.createElement(Typography5, { component: "label", variant: "caption", color: "text.secondary", sx: { lineHeight: 1 } }, label), /* @__PURE__ */ React52.createElement(ControlAdornments, null)), /* @__PURE__ */ React52.createElement(RepeaterHeaderActionsSlot, { value }), /* @__PURE__ */ React52.createElement(SlotChildren, { whitelist: [TooltipAddItemAction], sorted: true }, children));
|
|
3531
|
-
});
|
|
3532
|
-
|
|
3533
|
-
// src/components/unstable-repeater/items/items-container.tsx
|
|
3534
|
-
import * as React53 from "react";
|
|
3535
|
-
var ItemsContainer = ({
|
|
3536
|
-
itemTemplate,
|
|
3537
|
-
isSortable = true,
|
|
3538
|
-
children
|
|
3539
|
-
}) => {
|
|
3540
|
-
const { items: items2, setItems } = useRepeaterContext();
|
|
3541
|
-
const keys = items2.map(({ key }) => key);
|
|
3542
|
-
if (!itemTemplate) {
|
|
3543
|
-
return null;
|
|
3544
|
-
}
|
|
3545
|
-
const onChangeOrder = (newKeys) => {
|
|
3546
|
-
setItems(
|
|
3547
|
-
newKeys.map((key) => {
|
|
3548
|
-
const index = items2.findIndex((item) => item.key === key);
|
|
3549
|
-
return items2[index];
|
|
3550
|
-
})
|
|
3551
|
-
);
|
|
3552
|
-
};
|
|
3553
|
-
return /* @__PURE__ */ React53.createElement(React53.Fragment, null, /* @__PURE__ */ React53.createElement(SortableProvider, { value: keys, onChange: onChangeOrder }, keys.map((key, index) => {
|
|
3554
|
-
const value = items2[index].item;
|
|
3555
|
-
return /* @__PURE__ */ React53.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, React53.isValidElement(itemTemplate) ? React53.cloneElement(itemTemplate, {
|
|
3556
|
-
key,
|
|
3557
|
-
value,
|
|
3558
|
-
index,
|
|
3559
|
-
children
|
|
3560
|
-
}) : null);
|
|
3561
|
-
})));
|
|
3562
|
-
};
|
|
3563
|
-
|
|
3564
|
-
// src/components/unstable-repeater/items/item.tsx
|
|
3565
|
-
import * as React57 from "react";
|
|
3566
|
-
import { bindTrigger as bindTrigger4, UnstableTag as UnstableTag3 } from "@elementor/ui";
|
|
3567
|
-
import { __ as __23 } from "@wordpress/i18n";
|
|
3568
|
-
|
|
3569
|
-
// src/components/unstable-repeater/actions/disable-item-action.tsx
|
|
3570
|
-
import * as React54 from "react";
|
|
3571
|
-
import { EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2 } from "@elementor/icons";
|
|
3572
|
-
import { IconButton as IconButton5, Tooltip as Tooltip6 } from "@elementor/ui";
|
|
3573
|
-
import { __ as __20 } from "@wordpress/i18n";
|
|
3574
|
-
var SIZE5 = "tiny";
|
|
3575
|
-
var DisableItemAction = ({ index = -1 }) => {
|
|
3576
|
-
const { items: items2, updateItem } = useRepeaterContext();
|
|
3577
|
-
if (index === -1) {
|
|
3578
|
-
return null;
|
|
3579
|
-
}
|
|
3580
|
-
const propDisabled = items2[index].item.disabled ?? false;
|
|
3581
|
-
const toggleLabel = propDisabled ? __20("Show", "elementor") : __20("Hide", "elementor");
|
|
3582
|
-
const onClick = () => {
|
|
3583
|
-
const self = structuredClone(items2[index].item);
|
|
3584
|
-
self.disabled = !self.disabled;
|
|
3585
|
-
if (!self.disabled) {
|
|
3586
|
-
delete self.disabled;
|
|
3486
|
+
const onCloseUnfilteredModal = (enabled) => {
|
|
3487
|
+
setUnfilteredModalOpenState(false);
|
|
3488
|
+
if (enabled) {
|
|
3489
|
+
open(MODE_UPLOAD);
|
|
3587
3490
|
}
|
|
3588
|
-
updateItem(self, index);
|
|
3589
|
-
};
|
|
3590
|
-
return /* @__PURE__ */ React54.createElement(Tooltip6, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React54.createElement(IconButton5, { size: SIZE5, onClick, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React54.createElement(EyeOffIcon2, { fontSize: SIZE5 }) : /* @__PURE__ */ React54.createElement(EyeIcon2, { fontSize: SIZE5 })));
|
|
3591
|
-
};
|
|
3592
|
-
|
|
3593
|
-
// src/components/unstable-repeater/actions/duplicate-item-action.tsx
|
|
3594
|
-
import * as React55 from "react";
|
|
3595
|
-
import { CopyIcon as CopyIcon2 } from "@elementor/icons";
|
|
3596
|
-
import { IconButton as IconButton6, Tooltip as Tooltip7 } from "@elementor/ui";
|
|
3597
|
-
import { __ as __21 } from "@wordpress/i18n";
|
|
3598
|
-
var SIZE6 = "tiny";
|
|
3599
|
-
var DuplicateItemAction = ({ index = -1 }) => {
|
|
3600
|
-
const { items: items2, addItem } = useRepeaterContext();
|
|
3601
|
-
if (index === -1) {
|
|
3602
|
-
return null;
|
|
3603
|
-
}
|
|
3604
|
-
const duplicateLabel = __21("Duplicate", "elementor");
|
|
3605
|
-
const onClick = (ev) => {
|
|
3606
|
-
const newItem = structuredClone(items2[index]?.item);
|
|
3607
|
-
addItem(ev, { item: newItem, index: index + 1 });
|
|
3608
3491
|
};
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
import { IconButton as IconButton7, Tooltip as Tooltip8 } from "@elementor/ui";
|
|
3616
|
-
import { __ as __22 } from "@wordpress/i18n";
|
|
3617
|
-
var SIZE7 = "tiny";
|
|
3618
|
-
var RemoveItemAction = ({ index = -1 }) => {
|
|
3619
|
-
const { removeItem } = useRepeaterContext();
|
|
3620
|
-
if (index === -1) {
|
|
3621
|
-
return null;
|
|
3622
|
-
}
|
|
3623
|
-
const removeLabel = __22("Remove", "elementor");
|
|
3624
|
-
const onClick = () => removeItem(index);
|
|
3625
|
-
return /* @__PURE__ */ React56.createElement(Tooltip8, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React56.createElement(IconButton7, { size: SIZE7, onClick, "aria-label": removeLabel }, /* @__PURE__ */ React56.createElement(XIcon3, { fontSize: SIZE7 })));
|
|
3626
|
-
};
|
|
3627
|
-
|
|
3628
|
-
// src/components/unstable-repeater/items/item.tsx
|
|
3629
|
-
var Item = ({
|
|
3630
|
-
Label: Label3,
|
|
3631
|
-
Icon,
|
|
3632
|
-
value,
|
|
3633
|
-
index = -1,
|
|
3634
|
-
children
|
|
3635
|
-
}) => {
|
|
3636
|
-
const { items: items2, popoverState, setRowRef, openItemIndex, setOpenItemIndex } = useRepeaterContext();
|
|
3637
|
-
const triggerProps = bindTrigger4(popoverState);
|
|
3638
|
-
const key = items2[index].key ?? -1;
|
|
3639
|
-
const onClick = (ev) => {
|
|
3640
|
-
triggerProps.onClick(ev);
|
|
3641
|
-
setOpenItemIndex(index);
|
|
3492
|
+
const handleClick = (openOptions) => {
|
|
3493
|
+
if (!allowSvgUpload && openOptions === MODE_UPLOAD) {
|
|
3494
|
+
setUnfilteredModalOpenState(true);
|
|
3495
|
+
} else {
|
|
3496
|
+
open(openOptions);
|
|
3497
|
+
}
|
|
3642
3498
|
};
|
|
3643
|
-
return /* @__PURE__ */
|
|
3644
|
-
|
|
3499
|
+
return /* @__PURE__ */ React64.createElement(Stack13, { gap: 1 }, /* @__PURE__ */ React64.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React64.createElement(ControlActions, null, /* @__PURE__ */ React64.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React64.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React64.createElement(CircularProgress3, { role: "progressbar" }) : /* @__PURE__ */ React64.createElement(
|
|
3500
|
+
CardMedia2,
|
|
3645
3501
|
{
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
fullWidth: true,
|
|
3651
|
-
ref: (ref) => ref && openItemIndex === index && setRowRef(ref),
|
|
3652
|
-
variant: "outlined",
|
|
3653
|
-
"aria-label": __23("Open item", "elementor"),
|
|
3654
|
-
sx: { minHeight: (theme) => theme.spacing(4) },
|
|
3655
|
-
...triggerProps,
|
|
3656
|
-
onClick,
|
|
3657
|
-
startIcon: /* @__PURE__ */ React57.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React57.createElement(Icon, { value })),
|
|
3658
|
-
actions: /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(RepeaterItemActionsSlot, { index: index ?? -1 }), /* @__PURE__ */ React57.createElement(
|
|
3659
|
-
SlotChildren,
|
|
3660
|
-
{
|
|
3661
|
-
whitelist: [DuplicateItemAction, DisableItemAction, RemoveItemAction],
|
|
3662
|
-
props: { index },
|
|
3663
|
-
sorted: true
|
|
3664
|
-
},
|
|
3665
|
-
children
|
|
3666
|
-
))
|
|
3502
|
+
component: "img",
|
|
3503
|
+
image: src,
|
|
3504
|
+
alt: __25("Preview SVG", "elementor"),
|
|
3505
|
+
sx: { maxHeight: "140px", width: "50px" }
|
|
3667
3506
|
}
|
|
3668
|
-
))
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
// src/components/unstable-repeater/unstable-repeater.tsx
|
|
3672
|
-
import * as React59 from "react";
|
|
3673
|
-
|
|
3674
|
-
// src/components/unstable-repeater/items/edit-item-popover.tsx
|
|
3675
|
-
import * as React58 from "react";
|
|
3676
|
-
import { bindPopover as bindPopover5, Box as Box11, Popover as Popover5 } from "@elementor/ui";
|
|
3677
|
-
var EditItemPopover = ({ children }) => {
|
|
3678
|
-
const { popoverState, openItemIndex, isOpen, rowRef, setOpenItemIndex, setRowRef, items: items2 } = useRepeaterContext();
|
|
3679
|
-
const popoverProps = bindPopover5(popoverState);
|
|
3680
|
-
if (!isOpen || !rowRef) {
|
|
3681
|
-
return null;
|
|
3682
|
-
}
|
|
3683
|
-
const bind = items2[openItemIndex].item.$$type;
|
|
3684
|
-
const onClose = () => {
|
|
3685
|
-
popoverProps.onClose?.();
|
|
3686
|
-
setRowRef(null);
|
|
3687
|
-
setOpenItemIndex(EMPTY_OPEN_ITEM2);
|
|
3688
|
-
};
|
|
3689
|
-
return /* @__PURE__ */ React58.createElement(
|
|
3690
|
-
Popover5,
|
|
3507
|
+
)), /* @__PURE__ */ React64.createElement(
|
|
3508
|
+
CardOverlay2,
|
|
3691
3509
|
{
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
sx: { mt: 0.5, width: rowRef.offsetWidth }
|
|
3510
|
+
sx: {
|
|
3511
|
+
"&:hover": {
|
|
3512
|
+
backgroundColor: "rgba( 0, 0, 0, 0.75 )"
|
|
3696
3513
|
}
|
|
3697
|
-
}
|
|
3698
|
-
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
3699
|
-
...popoverProps,
|
|
3700
|
-
anchorEl: rowRef,
|
|
3701
|
-
onClose
|
|
3514
|
+
}
|
|
3702
3515
|
},
|
|
3703
|
-
/* @__PURE__ */
|
|
3704
|
-
|
|
3705
|
-
|
|
3516
|
+
/* @__PURE__ */ React64.createElement(Stack13, { gap: 1 }, /* @__PURE__ */ React64.createElement(
|
|
3517
|
+
Button4,
|
|
3518
|
+
{
|
|
3519
|
+
size: "tiny",
|
|
3520
|
+
color: "inherit",
|
|
3521
|
+
variant: "outlined",
|
|
3522
|
+
onClick: () => handleClick(MODE_BROWSE)
|
|
3523
|
+
},
|
|
3524
|
+
__25("Select SVG", "elementor")
|
|
3525
|
+
), /* @__PURE__ */ React64.createElement(
|
|
3526
|
+
Button4,
|
|
3527
|
+
{
|
|
3528
|
+
size: "tiny",
|
|
3529
|
+
variant: "text",
|
|
3530
|
+
color: "inherit",
|
|
3531
|
+
startIcon: /* @__PURE__ */ React64.createElement(UploadIcon2, null),
|
|
3532
|
+
onClick: () => handleClick(MODE_UPLOAD)
|
|
3533
|
+
},
|
|
3534
|
+
__25("Upload", "elementor")
|
|
3535
|
+
))
|
|
3536
|
+
))));
|
|
3537
|
+
});
|
|
3706
3538
|
|
|
3707
|
-
// src/
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3539
|
+
// src/controls/background-control/background-control.tsx
|
|
3540
|
+
import * as React71 from "react";
|
|
3541
|
+
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
3542
|
+
import { Grid as Grid17 } from "@elementor/ui";
|
|
3543
|
+
import { __ as __31 } from "@wordpress/i18n";
|
|
3544
|
+
|
|
3545
|
+
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
3546
|
+
import * as React70 from "react";
|
|
3547
|
+
import {
|
|
3548
|
+
backgroundColorOverlayPropTypeUtil as backgroundColorOverlayPropTypeUtil2,
|
|
3549
|
+
backgroundImageOverlayPropTypeUtil as backgroundImageOverlayPropTypeUtil2,
|
|
3550
|
+
backgroundOverlayPropTypeUtil,
|
|
3551
|
+
colorPropTypeUtil as colorPropTypeUtil3
|
|
3552
|
+
} from "@elementor/editor-props";
|
|
3553
|
+
import { Box as Box11, CardMedia as CardMedia3, styled as styled8, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator3 } from "@elementor/ui";
|
|
3554
|
+
import { useWpMediaAttachment as useWpMediaAttachment3 } from "@elementor/wp-media";
|
|
3555
|
+
import { __ as __30 } from "@wordpress/i18n";
|
|
3715
3556
|
|
|
3716
3557
|
// src/env.ts
|
|
3717
3558
|
import { parseEnv } from "@elementor/env";
|
|
3718
3559
|
var { env } = parseEnv("@elementor/editor-controls");
|
|
3719
3560
|
|
|
3720
3561
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
3721
|
-
import * as
|
|
3562
|
+
import * as React65 from "react";
|
|
3722
3563
|
import {
|
|
3723
3564
|
backgroundGradientOverlayPropTypeUtil,
|
|
3724
3565
|
colorPropTypeUtil as colorPropTypeUtil2,
|
|
@@ -3765,7 +3606,7 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
3765
3606
|
positions: positions?.value.split(" ")
|
|
3766
3607
|
};
|
|
3767
3608
|
};
|
|
3768
|
-
return /* @__PURE__ */
|
|
3609
|
+
return /* @__PURE__ */ React65.createElement(ControlActions, null, /* @__PURE__ */ React65.createElement(
|
|
3769
3610
|
UnstableGradientBox,
|
|
3770
3611
|
{
|
|
3771
3612
|
sx: { width: "auto", padding: 1.5 },
|
|
@@ -3790,47 +3631,47 @@ var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.cre
|
|
|
3790
3631
|
});
|
|
3791
3632
|
|
|
3792
3633
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
3793
|
-
import * as
|
|
3634
|
+
import * as React66 from "react";
|
|
3794
3635
|
import { PinIcon, PinnedOffIcon } from "@elementor/icons";
|
|
3795
|
-
import { Grid as
|
|
3796
|
-
import { __ as
|
|
3636
|
+
import { Grid as Grid13 } from "@elementor/ui";
|
|
3637
|
+
import { __ as __26 } from "@wordpress/i18n";
|
|
3797
3638
|
var attachmentControlOptions = [
|
|
3798
3639
|
{
|
|
3799
3640
|
value: "fixed",
|
|
3800
|
-
label:
|
|
3801
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3641
|
+
label: __26("Fixed", "elementor"),
|
|
3642
|
+
renderContent: ({ size }) => /* @__PURE__ */ React66.createElement(PinIcon, { fontSize: size }),
|
|
3802
3643
|
showTooltip: true
|
|
3803
3644
|
},
|
|
3804
3645
|
{
|
|
3805
3646
|
value: "scroll",
|
|
3806
|
-
label:
|
|
3807
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3647
|
+
label: __26("Scroll", "elementor"),
|
|
3648
|
+
renderContent: ({ size }) => /* @__PURE__ */ React66.createElement(PinnedOffIcon, { fontSize: size }),
|
|
3808
3649
|
showTooltip: true
|
|
3809
3650
|
}
|
|
3810
3651
|
];
|
|
3811
3652
|
var BackgroundImageOverlayAttachment = () => {
|
|
3812
|
-
return /* @__PURE__ */
|
|
3653
|
+
return /* @__PURE__ */ React66.createElement(PopoverGridContainer, null, /* @__PURE__ */ React66.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React66.createElement(ControlFormLabel, null, __26("Attachment", "elementor"))), /* @__PURE__ */ React66.createElement(Grid13, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React66.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
3813
3654
|
};
|
|
3814
3655
|
|
|
3815
3656
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
3816
|
-
import * as
|
|
3657
|
+
import * as React67 from "react";
|
|
3817
3658
|
import { useRef as useRef11 } from "react";
|
|
3818
3659
|
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil9 } from "@elementor/editor-props";
|
|
3819
3660
|
import { MenuListItem as MenuListItem4 } from "@elementor/editor-ui";
|
|
3820
3661
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
3821
|
-
import { Grid as
|
|
3822
|
-
import { __ as
|
|
3662
|
+
import { Grid as Grid14, Select as Select3 } from "@elementor/ui";
|
|
3663
|
+
import { __ as __27 } from "@wordpress/i18n";
|
|
3823
3664
|
var backgroundPositionOptions = [
|
|
3824
|
-
{ label:
|
|
3825
|
-
{ label:
|
|
3826
|
-
{ label:
|
|
3827
|
-
{ label:
|
|
3828
|
-
{ label:
|
|
3829
|
-
{ label:
|
|
3830
|
-
{ label:
|
|
3831
|
-
{ label:
|
|
3832
|
-
{ label:
|
|
3833
|
-
{ label:
|
|
3665
|
+
{ label: __27("Center center", "elementor"), value: "center center" },
|
|
3666
|
+
{ label: __27("Center left", "elementor"), value: "center left" },
|
|
3667
|
+
{ label: __27("Center right", "elementor"), value: "center right" },
|
|
3668
|
+
{ label: __27("Top center", "elementor"), value: "top center" },
|
|
3669
|
+
{ label: __27("Top left", "elementor"), value: "top left" },
|
|
3670
|
+
{ label: __27("Top right", "elementor"), value: "top right" },
|
|
3671
|
+
{ label: __27("Bottom center", "elementor"), value: "bottom center" },
|
|
3672
|
+
{ label: __27("Bottom left", "elementor"), value: "bottom left" },
|
|
3673
|
+
{ label: __27("Bottom right", "elementor"), value: "bottom right" },
|
|
3674
|
+
{ label: __27("Custom", "elementor"), value: "custom" }
|
|
3834
3675
|
];
|
|
3835
3676
|
var BackgroundImageOverlayPosition = () => {
|
|
3836
3677
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
@@ -3845,7 +3686,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3845
3686
|
stringPropContext.setValue(value);
|
|
3846
3687
|
}
|
|
3847
3688
|
};
|
|
3848
|
-
return /* @__PURE__ */
|
|
3689
|
+
return /* @__PURE__ */ React67.createElement(Grid14, { container: true, spacing: 1.5 }, /* @__PURE__ */ React67.createElement(Grid14, { item: true, xs: 12 }, /* @__PURE__ */ React67.createElement(PopoverGridContainer, null, /* @__PURE__ */ React67.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React67.createElement(ControlFormLabel, null, __27("Position", "elementor"))), /* @__PURE__ */ React67.createElement(Grid14, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React67.createElement(
|
|
3849
3690
|
Select3,
|
|
3850
3691
|
{
|
|
3851
3692
|
fullWidth: true,
|
|
@@ -3854,18 +3695,18 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3854
3695
|
disabled: stringPropContext.disabled,
|
|
3855
3696
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
|
|
3856
3697
|
},
|
|
3857
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
3858
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3698
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React67.createElement(MenuListItem4, { key: value, value: value ?? "" }, label))
|
|
3699
|
+
)))), isCustom ? /* @__PURE__ */ React67.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React67.createElement(Grid14, { item: true, xs: 12 }, /* @__PURE__ */ React67.createElement(Grid14, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React67.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React67.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React67.createElement(
|
|
3859
3700
|
SizeControl,
|
|
3860
3701
|
{
|
|
3861
|
-
startIcon: /* @__PURE__ */
|
|
3702
|
+
startIcon: /* @__PURE__ */ React67.createElement(LetterXIcon, { fontSize: "tiny" }),
|
|
3862
3703
|
anchorRef: rowRef,
|
|
3863
3704
|
min: -Number.MAX_SAFE_INTEGER
|
|
3864
3705
|
}
|
|
3865
|
-
))), /* @__PURE__ */
|
|
3706
|
+
))), /* @__PURE__ */ React67.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React67.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React67.createElement(
|
|
3866
3707
|
SizeControl,
|
|
3867
3708
|
{
|
|
3868
|
-
startIcon: /* @__PURE__ */
|
|
3709
|
+
startIcon: /* @__PURE__ */ React67.createElement(LetterYIcon, { fontSize: "tiny" }),
|
|
3869
3710
|
anchorRef: rowRef,
|
|
3870
3711
|
min: -Number.MAX_SAFE_INTEGER
|
|
3871
3712
|
}
|
|
@@ -3873,42 +3714,42 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3873
3714
|
};
|
|
3874
3715
|
|
|
3875
3716
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
3876
|
-
import * as
|
|
3877
|
-
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as
|
|
3878
|
-
import { Grid as
|
|
3879
|
-
import { __ as
|
|
3717
|
+
import * as React68 from "react";
|
|
3718
|
+
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon3 } from "@elementor/icons";
|
|
3719
|
+
import { Grid as Grid15 } from "@elementor/ui";
|
|
3720
|
+
import { __ as __28 } from "@wordpress/i18n";
|
|
3880
3721
|
var repeatControlOptions = [
|
|
3881
3722
|
{
|
|
3882
3723
|
value: "repeat",
|
|
3883
|
-
label:
|
|
3884
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3724
|
+
label: __28("Repeat", "elementor"),
|
|
3725
|
+
renderContent: ({ size }) => /* @__PURE__ */ React68.createElement(GridDotsIcon, { fontSize: size }),
|
|
3885
3726
|
showTooltip: true
|
|
3886
3727
|
},
|
|
3887
3728
|
{
|
|
3888
3729
|
value: "repeat-x",
|
|
3889
|
-
label:
|
|
3890
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3730
|
+
label: __28("Repeat-x", "elementor"),
|
|
3731
|
+
renderContent: ({ size }) => /* @__PURE__ */ React68.createElement(DotsHorizontalIcon, { fontSize: size }),
|
|
3891
3732
|
showTooltip: true
|
|
3892
3733
|
},
|
|
3893
3734
|
{
|
|
3894
3735
|
value: "repeat-y",
|
|
3895
|
-
label:
|
|
3896
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3736
|
+
label: __28("Repeat-y", "elementor"),
|
|
3737
|
+
renderContent: ({ size }) => /* @__PURE__ */ React68.createElement(DotsVerticalIcon, { fontSize: size }),
|
|
3897
3738
|
showTooltip: true
|
|
3898
3739
|
},
|
|
3899
3740
|
{
|
|
3900
3741
|
value: "no-repeat",
|
|
3901
|
-
label:
|
|
3902
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3742
|
+
label: __28("No-repeat", "elementor"),
|
|
3743
|
+
renderContent: ({ size }) => /* @__PURE__ */ React68.createElement(XIcon3, { fontSize: size }),
|
|
3903
3744
|
showTooltip: true
|
|
3904
3745
|
}
|
|
3905
3746
|
];
|
|
3906
3747
|
var BackgroundImageOverlayRepeat = () => {
|
|
3907
|
-
return /* @__PURE__ */
|
|
3748
|
+
return /* @__PURE__ */ React68.createElement(PopoverGridContainer, null, /* @__PURE__ */ React68.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React68.createElement(ControlFormLabel, null, __28("Repeat", "elementor"))), /* @__PURE__ */ React68.createElement(Grid15, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React68.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
3908
3749
|
};
|
|
3909
3750
|
|
|
3910
3751
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
3911
|
-
import * as
|
|
3752
|
+
import * as React69 from "react";
|
|
3912
3753
|
import { useRef as useRef12 } from "react";
|
|
3913
3754
|
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil10 } from "@elementor/editor-props";
|
|
3914
3755
|
import {
|
|
@@ -3919,31 +3760,31 @@ import {
|
|
|
3919
3760
|
LetterAIcon,
|
|
3920
3761
|
PencilIcon
|
|
3921
3762
|
} from "@elementor/icons";
|
|
3922
|
-
import { Grid as
|
|
3923
|
-
import { __ as
|
|
3763
|
+
import { Grid as Grid16 } from "@elementor/ui";
|
|
3764
|
+
import { __ as __29 } from "@wordpress/i18n";
|
|
3924
3765
|
var sizeControlOptions = [
|
|
3925
3766
|
{
|
|
3926
3767
|
value: "auto",
|
|
3927
|
-
label:
|
|
3928
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3768
|
+
label: __29("Auto", "elementor"),
|
|
3769
|
+
renderContent: ({ size }) => /* @__PURE__ */ React69.createElement(LetterAIcon, { fontSize: size }),
|
|
3929
3770
|
showTooltip: true
|
|
3930
3771
|
},
|
|
3931
3772
|
{
|
|
3932
3773
|
value: "cover",
|
|
3933
|
-
label:
|
|
3934
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3774
|
+
label: __29("Cover", "elementor"),
|
|
3775
|
+
renderContent: ({ size }) => /* @__PURE__ */ React69.createElement(ArrowsMaximizeIcon, { fontSize: size }),
|
|
3935
3776
|
showTooltip: true
|
|
3936
3777
|
},
|
|
3937
3778
|
{
|
|
3938
3779
|
value: "contain",
|
|
3939
|
-
label:
|
|
3940
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3780
|
+
label: __29("Contain", "elementor"),
|
|
3781
|
+
renderContent: ({ size }) => /* @__PURE__ */ React69.createElement(ArrowBarBothIcon, { fontSize: size }),
|
|
3941
3782
|
showTooltip: true
|
|
3942
3783
|
},
|
|
3943
3784
|
{
|
|
3944
3785
|
value: "custom",
|
|
3945
|
-
label:
|
|
3946
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3786
|
+
label: __29("Custom", "elementor"),
|
|
3787
|
+
renderContent: ({ size }) => /* @__PURE__ */ React69.createElement(PencilIcon, { fontSize: size }),
|
|
3947
3788
|
showTooltip: true
|
|
3948
3789
|
}
|
|
3949
3790
|
];
|
|
@@ -3959,7 +3800,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3959
3800
|
stringPropContext.setValue(size);
|
|
3960
3801
|
}
|
|
3961
3802
|
};
|
|
3962
|
-
return /* @__PURE__ */
|
|
3803
|
+
return /* @__PURE__ */ React69.createElement(Grid16, { container: true, spacing: 1.5 }, /* @__PURE__ */ React69.createElement(Grid16, { item: true, xs: 12 }, /* @__PURE__ */ React69.createElement(PopoverGridContainer, null, /* @__PURE__ */ React69.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React69.createElement(ControlFormLabel, null, __29("Size", "elementor"))), /* @__PURE__ */ React69.createElement(Grid16, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React69.createElement(
|
|
3963
3804
|
ControlToggleButtonGroup,
|
|
3964
3805
|
{
|
|
3965
3806
|
exclusive: true,
|
|
@@ -3968,17 +3809,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3968
3809
|
disabled: stringPropContext.disabled,
|
|
3969
3810
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
|
|
3970
3811
|
}
|
|
3971
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3812
|
+
)))), isCustom ? /* @__PURE__ */ React69.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React69.createElement(Grid16, { item: true, xs: 12, ref: rowRef }, /* @__PURE__ */ React69.createElement(PopoverGridContainer, null, /* @__PURE__ */ React69.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React69.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React69.createElement(
|
|
3972
3813
|
SizeControl,
|
|
3973
3814
|
{
|
|
3974
|
-
startIcon: /* @__PURE__ */
|
|
3815
|
+
startIcon: /* @__PURE__ */ React69.createElement(ArrowsMoveHorizontalIcon2, { fontSize: "tiny" }),
|
|
3975
3816
|
extendedOptions: ["auto"],
|
|
3976
3817
|
anchorRef: rowRef
|
|
3977
3818
|
}
|
|
3978
|
-
))), /* @__PURE__ */
|
|
3819
|
+
))), /* @__PURE__ */ React69.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React69.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React69.createElement(
|
|
3979
3820
|
SizeControl,
|
|
3980
3821
|
{
|
|
3981
|
-
startIcon: /* @__PURE__ */
|
|
3822
|
+
startIcon: /* @__PURE__ */ React69.createElement(ArrowsMoveVerticalIcon2, { fontSize: "tiny" }),
|
|
3982
3823
|
extendedOptions: ["auto"],
|
|
3983
3824
|
anchorRef: rowRef
|
|
3984
3825
|
}
|
|
@@ -4079,52 +3920,52 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
4079
3920
|
}
|
|
4080
3921
|
});
|
|
4081
3922
|
var backgroundResolutionOptions = [
|
|
4082
|
-
{ label:
|
|
4083
|
-
{ label:
|
|
4084
|
-
{ label:
|
|
4085
|
-
{ label:
|
|
3923
|
+
{ label: __30("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
3924
|
+
{ label: __30("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
3925
|
+
{ label: __30("Large 1024 x 1024", "elementor"), value: "large" },
|
|
3926
|
+
{ label: __30("Full", "elementor"), value: "full" }
|
|
4086
3927
|
];
|
|
4087
3928
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
4088
3929
|
const { propType, value: overlayValues, setValue } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
4089
|
-
return /* @__PURE__ */
|
|
3930
|
+
return /* @__PURE__ */ React70.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React70.createElement(
|
|
4090
3931
|
UnstableRepeater,
|
|
4091
3932
|
{
|
|
4092
3933
|
initial: getInitialBackgroundOverlay(),
|
|
4093
3934
|
propTypeUtil: backgroundOverlayPropTypeUtil
|
|
4094
3935
|
},
|
|
4095
|
-
/* @__PURE__ */
|
|
4096
|
-
/* @__PURE__ */
|
|
4097
|
-
/* @__PURE__ */
|
|
3936
|
+
/* @__PURE__ */ React70.createElement(Header, { label: __30("Overlay", "elementor") }, /* @__PURE__ */ React70.createElement(TooltipAddItemAction, { newItemIndex: 0 })),
|
|
3937
|
+
/* @__PURE__ */ React70.createElement(ItemsContainer, { itemTemplate: /* @__PURE__ */ React70.createElement(Item, { Icon: ItemIcon2, Label: ItemLabel2 }) }, /* @__PURE__ */ React70.createElement(DuplicateItemAction, null), /* @__PURE__ */ React70.createElement(DisableItemAction, null), /* @__PURE__ */ React70.createElement(RemoveItemAction, null)),
|
|
3938
|
+
/* @__PURE__ */ React70.createElement(EditItemPopover, null, /* @__PURE__ */ React70.createElement(ItemContent, null))
|
|
4098
3939
|
));
|
|
4099
3940
|
});
|
|
4100
|
-
var
|
|
3941
|
+
var ItemContent = () => {
|
|
4101
3942
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
4102
3943
|
image: getInitialBackgroundOverlay().value,
|
|
4103
3944
|
color: initialBackgroundColorOverlay.value,
|
|
4104
3945
|
gradient: initialBackgroundGradientOverlay.value
|
|
4105
3946
|
});
|
|
4106
3947
|
const { rowRef } = useRepeaterContext();
|
|
4107
|
-
return /* @__PURE__ */
|
|
3948
|
+
return /* @__PURE__ */ React70.createElement(Box11, { sx: { width: "100%" } }, /* @__PURE__ */ React70.createElement(Box11, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React70.createElement(
|
|
4108
3949
|
Tabs,
|
|
4109
3950
|
{
|
|
4110
3951
|
size: "small",
|
|
4111
3952
|
variant: "fullWidth",
|
|
4112
3953
|
...getTabsProps(),
|
|
4113
|
-
"aria-label":
|
|
3954
|
+
"aria-label": __30("Background Overlay", "elementor")
|
|
4114
3955
|
},
|
|
4115
|
-
/* @__PURE__ */
|
|
4116
|
-
/* @__PURE__ */
|
|
4117
|
-
/* @__PURE__ */
|
|
4118
|
-
)), /* @__PURE__ */
|
|
3956
|
+
/* @__PURE__ */ React70.createElement(Tab, { label: __30("Image", "elementor"), ...getTabProps("image") }),
|
|
3957
|
+
/* @__PURE__ */ React70.createElement(Tab, { label: __30("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
3958
|
+
/* @__PURE__ */ React70.createElement(Tab, { label: __30("Color", "elementor"), ...getTabProps("color") })
|
|
3959
|
+
)), /* @__PURE__ */ React70.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React70.createElement(PopoverContent, null, /* @__PURE__ */ React70.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React70.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React70.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React70.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React70.createElement(PopoverContent, null, /* @__PURE__ */ React70.createElement(ColorOverlayContent, { anchorEl: rowRef }))));
|
|
4119
3960
|
};
|
|
4120
|
-
var
|
|
3961
|
+
var ItemIcon2 = ({ value }) => {
|
|
4121
3962
|
switch (value.$$type) {
|
|
4122
3963
|
case "background-image-overlay":
|
|
4123
|
-
return /* @__PURE__ */
|
|
3964
|
+
return /* @__PURE__ */ React70.createElement(ItemIconImage, { value });
|
|
4124
3965
|
case "background-color-overlay":
|
|
4125
|
-
return /* @__PURE__ */
|
|
3966
|
+
return /* @__PURE__ */ React70.createElement(ItemIconColor, { value });
|
|
4126
3967
|
case "background-gradient-overlay":
|
|
4127
|
-
return /* @__PURE__ */
|
|
3968
|
+
return /* @__PURE__ */ React70.createElement(ItemIconGradient, { value });
|
|
4128
3969
|
default:
|
|
4129
3970
|
return null;
|
|
4130
3971
|
}
|
|
@@ -4137,11 +3978,11 @@ var extractColorFrom = (prop) => {
|
|
|
4137
3978
|
};
|
|
4138
3979
|
var ItemIconColor = ({ value: prop }) => {
|
|
4139
3980
|
const color = extractColorFrom(prop);
|
|
4140
|
-
return /* @__PURE__ */
|
|
3981
|
+
return /* @__PURE__ */ React70.createElement(StyledUnstableColorIndicator3, { size: "inherit", component: "span", value: color });
|
|
4141
3982
|
};
|
|
4142
3983
|
var ItemIconImage = ({ value }) => {
|
|
4143
3984
|
const { imageUrl } = useImage(value);
|
|
4144
|
-
return /* @__PURE__ */
|
|
3985
|
+
return /* @__PURE__ */ React70.createElement(
|
|
4145
3986
|
CardMedia3,
|
|
4146
3987
|
{
|
|
4147
3988
|
image: imageUrl,
|
|
@@ -4156,43 +3997,43 @@ var ItemIconImage = ({ value }) => {
|
|
|
4156
3997
|
};
|
|
4157
3998
|
var ItemIconGradient = ({ value }) => {
|
|
4158
3999
|
const gradient = getGradientValue(value);
|
|
4159
|
-
return /* @__PURE__ */
|
|
4000
|
+
return /* @__PURE__ */ React70.createElement(StyledUnstableColorIndicator3, { size: "inherit", component: "span", value: gradient });
|
|
4160
4001
|
};
|
|
4161
|
-
var
|
|
4002
|
+
var ItemLabel2 = ({ value }) => {
|
|
4162
4003
|
switch (value.$$type) {
|
|
4163
4004
|
case "background-image-overlay":
|
|
4164
|
-
return /* @__PURE__ */
|
|
4005
|
+
return /* @__PURE__ */ React70.createElement(ItemLabelImage, { value });
|
|
4165
4006
|
case "background-color-overlay":
|
|
4166
|
-
return /* @__PURE__ */
|
|
4007
|
+
return /* @__PURE__ */ React70.createElement(ItemLabelColor, { value });
|
|
4167
4008
|
case "background-gradient-overlay":
|
|
4168
|
-
return /* @__PURE__ */
|
|
4009
|
+
return /* @__PURE__ */ React70.createElement(ItemLabelGradient, { value });
|
|
4169
4010
|
default:
|
|
4170
4011
|
return null;
|
|
4171
4012
|
}
|
|
4172
4013
|
};
|
|
4173
4014
|
var ItemLabelColor = ({ value: prop }) => {
|
|
4174
4015
|
const color = extractColorFrom(prop);
|
|
4175
|
-
return /* @__PURE__ */
|
|
4016
|
+
return /* @__PURE__ */ React70.createElement("span", null, color);
|
|
4176
4017
|
};
|
|
4177
4018
|
var ItemLabelImage = ({ value }) => {
|
|
4178
4019
|
const { imageTitle } = useImage(value);
|
|
4179
|
-
return /* @__PURE__ */
|
|
4020
|
+
return /* @__PURE__ */ React70.createElement("span", null, imageTitle);
|
|
4180
4021
|
};
|
|
4181
4022
|
var ItemLabelGradient = ({ value }) => {
|
|
4182
4023
|
if (value.value.type.value === "linear") {
|
|
4183
|
-
return /* @__PURE__ */
|
|
4024
|
+
return /* @__PURE__ */ React70.createElement("span", null, __30("Linear Gradient", "elementor"));
|
|
4184
4025
|
}
|
|
4185
|
-
return /* @__PURE__ */
|
|
4026
|
+
return /* @__PURE__ */ React70.createElement("span", null, __30("Radial Gradient", "elementor"));
|
|
4186
4027
|
};
|
|
4187
4028
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
4188
4029
|
const propContext = useBoundProp(backgroundColorOverlayPropTypeUtil2);
|
|
4189
|
-
return /* @__PURE__ */
|
|
4030
|
+
return /* @__PURE__ */ React70.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React70.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React70.createElement(ColorControl, { anchorEl })));
|
|
4190
4031
|
};
|
|
4191
4032
|
var ImageOverlayContent = () => {
|
|
4192
4033
|
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil2);
|
|
4193
|
-
return /* @__PURE__ */
|
|
4034
|
+
return /* @__PURE__ */ React70.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React70.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React70.createElement(ImageControl, { sizes: backgroundResolutionOptions })), /* @__PURE__ */ React70.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React70.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React70.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React70.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React70.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React70.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React70.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React70.createElement(BackgroundImageOverlayAttachment, null)));
|
|
4194
4035
|
};
|
|
4195
|
-
var
|
|
4036
|
+
var StyledUnstableColorIndicator3 = styled8(UnstableColorIndicator3)(({ theme }) => ({
|
|
4196
4037
|
height: "1rem",
|
|
4197
4038
|
width: "1rem",
|
|
4198
4039
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
@@ -4230,21 +4071,21 @@ var getGradientValue = (value) => {
|
|
|
4230
4071
|
// src/controls/background-control/background-control.tsx
|
|
4231
4072
|
var BackgroundControl = createControl(() => {
|
|
4232
4073
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
4233
|
-
const colorLabel =
|
|
4234
|
-
return /* @__PURE__ */
|
|
4074
|
+
const colorLabel = __31("Color", "elementor");
|
|
4075
|
+
return /* @__PURE__ */ React71.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React71.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React71.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React71.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React71.createElement(Grid17, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React71.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React71.createElement(ControlLabel, null, colorLabel)), /* @__PURE__ */ React71.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React71.createElement(ColorControl, null)))));
|
|
4235
4076
|
});
|
|
4236
4077
|
|
|
4237
4078
|
// src/controls/repeatable-control.tsx
|
|
4238
|
-
import * as
|
|
4239
|
-
import { useMemo as
|
|
4079
|
+
import * as React72 from "react";
|
|
4080
|
+
import { useMemo as useMemo6 } from "react";
|
|
4240
4081
|
import { createArrayPropUtils } from "@elementor/editor-props";
|
|
4241
|
-
import { Box as
|
|
4082
|
+
import { Box as Box12 } from "@elementor/ui";
|
|
4242
4083
|
|
|
4243
4084
|
// src/hooks/use-repeatable-control-context.ts
|
|
4244
|
-
import { createContext as
|
|
4245
|
-
var RepeatableControlContext =
|
|
4085
|
+
import { createContext as createContext9, useContext as useContext9 } from "react";
|
|
4086
|
+
var RepeatableControlContext = createContext9(void 0);
|
|
4246
4087
|
var useRepeatableControlContext = () => {
|
|
4247
|
-
const context =
|
|
4088
|
+
const context = useContext9(RepeatableControlContext);
|
|
4248
4089
|
if (!context) {
|
|
4249
4090
|
throw new Error("useRepeatableControlContext must be used within RepeatableControl");
|
|
4250
4091
|
}
|
|
@@ -4269,11 +4110,11 @@ var RepeatableControl = createControl(
|
|
|
4269
4110
|
if (!childPropTypeUtil) {
|
|
4270
4111
|
return null;
|
|
4271
4112
|
}
|
|
4272
|
-
const childArrayPropTypeUtil =
|
|
4113
|
+
const childArrayPropTypeUtil = useMemo6(
|
|
4273
4114
|
() => createArrayPropUtils(childPropTypeUtil.key, childPropTypeUtil.schema, propKey),
|
|
4274
4115
|
[childPropTypeUtil.key, childPropTypeUtil.schema, propKey]
|
|
4275
4116
|
);
|
|
4276
|
-
const contextValue =
|
|
4117
|
+
const contextValue = useMemo6(
|
|
4277
4118
|
() => ({
|
|
4278
4119
|
...childControlConfig,
|
|
4279
4120
|
placeholder: placeholder || "",
|
|
@@ -4282,31 +4123,31 @@ var RepeatableControl = createControl(
|
|
|
4282
4123
|
[childControlConfig, placeholder, patternLabel]
|
|
4283
4124
|
);
|
|
4284
4125
|
const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
4285
|
-
return /* @__PURE__ */
|
|
4126
|
+
return /* @__PURE__ */ React72.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React72.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React72.createElement(
|
|
4286
4127
|
UnstableRepeater,
|
|
4287
4128
|
{
|
|
4288
4129
|
initial: childPropTypeUtil.create(initialValues || null),
|
|
4289
4130
|
propTypeUtil: childArrayPropTypeUtil
|
|
4290
4131
|
},
|
|
4291
|
-
/* @__PURE__ */
|
|
4292
|
-
/* @__PURE__ */
|
|
4132
|
+
/* @__PURE__ */ React72.createElement(Header, { label: repeaterLabel }, /* @__PURE__ */ React72.createElement(TooltipAddItemAction, { ...addItemTooltipProps, newItemIndex: 0 })),
|
|
4133
|
+
/* @__PURE__ */ React72.createElement(
|
|
4293
4134
|
ItemsContainer,
|
|
4294
4135
|
{
|
|
4295
4136
|
isSortable: false,
|
|
4296
|
-
itemTemplate: /* @__PURE__ */
|
|
4137
|
+
itemTemplate: /* @__PURE__ */ React72.createElement(Item, { Icon: ItemIcon3, Label: ItemLabel3 })
|
|
4297
4138
|
},
|
|
4298
|
-
showDuplicate && /* @__PURE__ */
|
|
4299
|
-
showToggle && /* @__PURE__ */
|
|
4300
|
-
/* @__PURE__ */
|
|
4139
|
+
showDuplicate && /* @__PURE__ */ React72.createElement(DuplicateItemAction, null),
|
|
4140
|
+
showToggle && /* @__PURE__ */ React72.createElement(DisableItemAction, null),
|
|
4141
|
+
/* @__PURE__ */ React72.createElement(RemoveItemAction, null)
|
|
4301
4142
|
),
|
|
4302
|
-
/* @__PURE__ */
|
|
4143
|
+
/* @__PURE__ */ React72.createElement(EditItemPopover, null, /* @__PURE__ */ React72.createElement(Content2, null))
|
|
4303
4144
|
)));
|
|
4304
4145
|
}
|
|
4305
4146
|
);
|
|
4306
|
-
var
|
|
4307
|
-
var
|
|
4147
|
+
var ItemIcon3 = () => /* @__PURE__ */ React72.createElement(React72.Fragment, null);
|
|
4148
|
+
var Content2 = () => {
|
|
4308
4149
|
const { component: ChildControl, props = {} } = useRepeatableControlContext();
|
|
4309
|
-
return /* @__PURE__ */
|
|
4150
|
+
return /* @__PURE__ */ React72.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React72.createElement(PopoverGridContainer, null, /* @__PURE__ */ React72.createElement(ChildControl, { ...props })));
|
|
4310
4151
|
};
|
|
4311
4152
|
var interpolate = (template, data) => {
|
|
4312
4153
|
if (!data) {
|
|
@@ -4363,12 +4204,12 @@ var shouldShowPlaceholder = (pattern, data) => {
|
|
|
4363
4204
|
}
|
|
4364
4205
|
return false;
|
|
4365
4206
|
};
|
|
4366
|
-
var
|
|
4207
|
+
var ItemLabel3 = ({ value }) => {
|
|
4367
4208
|
const { placeholder, patternLabel } = useRepeatableControlContext();
|
|
4368
4209
|
const showPlaceholder = shouldShowPlaceholder(patternLabel, value);
|
|
4369
4210
|
const label = showPlaceholder ? placeholder : interpolate(patternLabel, value);
|
|
4370
4211
|
const color = showPlaceholder ? "text.tertiary" : "text.primary";
|
|
4371
|
-
return /* @__PURE__ */
|
|
4212
|
+
return /* @__PURE__ */ React72.createElement(Box12, { component: "span", color }, label);
|
|
4372
4213
|
};
|
|
4373
4214
|
var getAllProperties = (pattern) => {
|
|
4374
4215
|
const properties = pattern.match(PLACEHOLDER_REGEX)?.map((match) => match.slice(2, -1)) || [];
|
|
@@ -4376,34 +4217,34 @@ var getAllProperties = (pattern) => {
|
|
|
4376
4217
|
};
|
|
4377
4218
|
|
|
4378
4219
|
// src/controls/key-value-control.tsx
|
|
4379
|
-
import * as
|
|
4380
|
-
import { useMemo as
|
|
4220
|
+
import * as React73 from "react";
|
|
4221
|
+
import { useMemo as useMemo7, useState as useState13 } from "react";
|
|
4381
4222
|
import {
|
|
4382
4223
|
isTransformable,
|
|
4383
4224
|
keyValuePropTypeUtil,
|
|
4384
4225
|
stringPropTypeUtil as stringPropTypeUtil11
|
|
4385
4226
|
} from "@elementor/editor-props";
|
|
4386
|
-
import { FormHelperText, FormLabel as FormLabel3, Grid as
|
|
4387
|
-
import { __ as
|
|
4227
|
+
import { FormHelperText, FormLabel as FormLabel3, Grid as Grid18 } from "@elementor/ui";
|
|
4228
|
+
import { __ as __32 } from "@wordpress/i18n";
|
|
4388
4229
|
var KeyValueControl = createControl((props = {}) => {
|
|
4389
4230
|
const { value, setValue, ...propContext } = useBoundProp(keyValuePropTypeUtil);
|
|
4390
|
-
const [keyError, setKeyError] =
|
|
4391
|
-
const [valueError, setValueError] =
|
|
4392
|
-
const [sessionState, setSessionState] =
|
|
4231
|
+
const [keyError, setKeyError] = useState13("");
|
|
4232
|
+
const [valueError, setValueError] = useState13("");
|
|
4233
|
+
const [sessionState, setSessionState] = useState13({
|
|
4393
4234
|
key: value?.key?.value || "",
|
|
4394
4235
|
value: value?.value?.value || ""
|
|
4395
4236
|
});
|
|
4396
|
-
const keyLabel = props.keyName ||
|
|
4397
|
-
const valueLabel = props.valueName ||
|
|
4237
|
+
const keyLabel = props.keyName || __32("Key", "elementor");
|
|
4238
|
+
const valueLabel = props.valueName || __32("Value", "elementor");
|
|
4398
4239
|
const { keyHelper, valueHelper } = props.getHelperText?.(sessionState.key, sessionState.value) || {
|
|
4399
4240
|
keyHelper: void 0,
|
|
4400
4241
|
valueHelper: void 0
|
|
4401
4242
|
};
|
|
4402
|
-
const [keyRegex, valueRegex, errMsg] =
|
|
4243
|
+
const [keyRegex, valueRegex, errMsg] = useMemo7(
|
|
4403
4244
|
() => [
|
|
4404
4245
|
props.regexKey ? new RegExp(props.regexKey) : void 0,
|
|
4405
4246
|
props.regexValue ? new RegExp(props.regexValue) : void 0,
|
|
4406
|
-
props.validationErrorMessage ||
|
|
4247
|
+
props.validationErrorMessage || __32("Invalid Format", "elementor")
|
|
4407
4248
|
],
|
|
4408
4249
|
[props.regexKey, props.regexValue, props.validationErrorMessage]
|
|
4409
4250
|
);
|
|
@@ -4452,7 +4293,7 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
4452
4293
|
});
|
|
4453
4294
|
}
|
|
4454
4295
|
};
|
|
4455
|
-
return /* @__PURE__ */
|
|
4296
|
+
return /* @__PURE__ */ React73.createElement(PropProvider, { ...propContext, value, setValue: handleChange }, /* @__PURE__ */ React73.createElement(Grid18, { container: true, gap: 1.5 }, /* @__PURE__ */ React73.createElement(Grid18, { item: true, xs: 12, display: "flex", flexDirection: "column" }, /* @__PURE__ */ React73.createElement(FormLabel3, { size: "tiny", sx: { pb: 1 } }, keyLabel), /* @__PURE__ */ React73.createElement(PropKeyProvider, { bind: "key" }, /* @__PURE__ */ React73.createElement(TextControl, { inputValue: sessionState.key, error: !!keyError, helperText: keyHelper })), !!keyError && /* @__PURE__ */ React73.createElement(FormHelperText, { error: true }, keyError)), /* @__PURE__ */ React73.createElement(Grid18, { item: true, xs: 12, display: "flex", flexDirection: "column" }, /* @__PURE__ */ React73.createElement(FormLabel3, { size: "tiny", sx: { pb: 1 } }, valueLabel), /* @__PURE__ */ React73.createElement(PropKeyProvider, { bind: "value" }, /* @__PURE__ */ React73.createElement(
|
|
4456
4297
|
TextControl,
|
|
4457
4298
|
{
|
|
4458
4299
|
inputValue: sessionState.value,
|
|
@@ -4460,27 +4301,27 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
4460
4301
|
inputDisabled: !!keyError,
|
|
4461
4302
|
helperText: valueHelper
|
|
4462
4303
|
}
|
|
4463
|
-
)), !!valueError && /* @__PURE__ */
|
|
4304
|
+
)), !!valueError && /* @__PURE__ */ React73.createElement(FormHelperText, { error: true }, valueError))));
|
|
4464
4305
|
});
|
|
4465
4306
|
|
|
4466
4307
|
// src/controls/position-control.tsx
|
|
4467
|
-
import * as
|
|
4308
|
+
import * as React74 from "react";
|
|
4468
4309
|
import { positionPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil12 } from "@elementor/editor-props";
|
|
4469
4310
|
import { MenuListItem as MenuListItem5 } from "@elementor/editor-ui";
|
|
4470
4311
|
import { LetterXIcon as LetterXIcon2, LetterYIcon as LetterYIcon2 } from "@elementor/icons";
|
|
4471
|
-
import { Grid as
|
|
4472
|
-
import { __ as
|
|
4312
|
+
import { Grid as Grid19, Select as Select4 } from "@elementor/ui";
|
|
4313
|
+
import { __ as __33 } from "@wordpress/i18n";
|
|
4473
4314
|
var positionOptions = [
|
|
4474
|
-
{ label:
|
|
4475
|
-
{ label:
|
|
4476
|
-
{ label:
|
|
4477
|
-
{ label:
|
|
4478
|
-
{ label:
|
|
4479
|
-
{ label:
|
|
4480
|
-
{ label:
|
|
4481
|
-
{ label:
|
|
4482
|
-
{ label:
|
|
4483
|
-
{ label:
|
|
4315
|
+
{ label: __33("Center center", "elementor"), value: "center center" },
|
|
4316
|
+
{ label: __33("Center left", "elementor"), value: "center left" },
|
|
4317
|
+
{ label: __33("Center right", "elementor"), value: "center right" },
|
|
4318
|
+
{ label: __33("Top center", "elementor"), value: "top center" },
|
|
4319
|
+
{ label: __33("Top left", "elementor"), value: "top left" },
|
|
4320
|
+
{ label: __33("Top right", "elementor"), value: "top right" },
|
|
4321
|
+
{ label: __33("Bottom center", "elementor"), value: "bottom center" },
|
|
4322
|
+
{ label: __33("Bottom left", "elementor"), value: "bottom left" },
|
|
4323
|
+
{ label: __33("Bottom right", "elementor"), value: "bottom right" },
|
|
4324
|
+
{ label: __33("Custom", "elementor"), value: "custom" }
|
|
4484
4325
|
];
|
|
4485
4326
|
var PositionControl = () => {
|
|
4486
4327
|
const positionContext = useBoundProp(positionPropTypeUtil);
|
|
@@ -4494,7 +4335,7 @@ var PositionControl = () => {
|
|
|
4494
4335
|
stringPropContext.setValue(value);
|
|
4495
4336
|
}
|
|
4496
4337
|
};
|
|
4497
|
-
return /* @__PURE__ */
|
|
4338
|
+
return /* @__PURE__ */ React74.createElement(Grid19, { container: true, spacing: 1.5 }, /* @__PURE__ */ React74.createElement(Grid19, { item: true, xs: 12 }, /* @__PURE__ */ React74.createElement(Grid19, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React74.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React74.createElement(ControlFormLabel, null, __33("Object position", "elementor"))), /* @__PURE__ */ React74.createElement(Grid19, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React74.createElement(
|
|
4498
4339
|
Select4,
|
|
4499
4340
|
{
|
|
4500
4341
|
size: "tiny",
|
|
@@ -4503,29 +4344,29 @@ var PositionControl = () => {
|
|
|
4503
4344
|
onChange: handlePositionChange,
|
|
4504
4345
|
fullWidth: true
|
|
4505
4346
|
},
|
|
4506
|
-
positionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
4507
|
-
)))), isCustom && /* @__PURE__ */
|
|
4347
|
+
positionOptions.map(({ label, value }) => /* @__PURE__ */ React74.createElement(MenuListItem5, { key: value, value: value ?? "" }, label))
|
|
4348
|
+
)))), isCustom && /* @__PURE__ */ React74.createElement(PropProvider, { ...positionContext }, /* @__PURE__ */ React74.createElement(Grid19, { item: true, xs: 12 }, /* @__PURE__ */ React74.createElement(Grid19, { container: true, spacing: 1.5 }, /* @__PURE__ */ React74.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React74.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React74.createElement(
|
|
4508
4349
|
SizeControl,
|
|
4509
4350
|
{
|
|
4510
|
-
startIcon: /* @__PURE__ */
|
|
4351
|
+
startIcon: /* @__PURE__ */ React74.createElement(LetterXIcon2, { fontSize: "tiny" }),
|
|
4511
4352
|
min: -Number.MAX_SAFE_INTEGER
|
|
4512
4353
|
}
|
|
4513
|
-
))), /* @__PURE__ */
|
|
4354
|
+
))), /* @__PURE__ */ React74.createElement(Grid19, { item: true, xs: 6 }, /* @__PURE__ */ React74.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React74.createElement(
|
|
4514
4355
|
SizeControl,
|
|
4515
4356
|
{
|
|
4516
|
-
startIcon: /* @__PURE__ */
|
|
4357
|
+
startIcon: /* @__PURE__ */ React74.createElement(LetterYIcon2, { fontSize: "tiny" }),
|
|
4517
4358
|
min: -Number.MAX_SAFE_INTEGER
|
|
4518
4359
|
}
|
|
4519
4360
|
)))))));
|
|
4520
4361
|
};
|
|
4521
4362
|
|
|
4522
4363
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
4523
|
-
import * as
|
|
4364
|
+
import * as React87 from "react";
|
|
4524
4365
|
import { useRef as useRef21 } from "react";
|
|
4525
4366
|
import { transformFunctionsPropTypeUtil, transformPropTypeUtil } from "@elementor/editor-props";
|
|
4526
4367
|
import { AdjustmentsIcon as AdjustmentsIcon2, InfoCircleFilledIcon as InfoCircleFilledIcon2 } from "@elementor/icons";
|
|
4527
|
-
import { bindTrigger as
|
|
4528
|
-
import { __ as
|
|
4368
|
+
import { bindTrigger as bindTrigger4, Box as Box16, IconButton as IconButton7, Typography as Typography5, usePopupState as usePopupState6 } from "@elementor/ui";
|
|
4369
|
+
import { __ as __43 } from "@wordpress/i18n";
|
|
4529
4370
|
|
|
4530
4371
|
// src/controls/transform-control/initial-values.ts
|
|
4531
4372
|
import {
|
|
@@ -4579,94 +4420,94 @@ var initialSkewValue = skewTransformPropTypeUtil.create({
|
|
|
4579
4420
|
});
|
|
4580
4421
|
|
|
4581
4422
|
// src/controls/transform-control/transform-base-control.tsx
|
|
4582
|
-
import * as
|
|
4423
|
+
import * as React77 from "react";
|
|
4583
4424
|
import { PopoverHeader as PopoverHeader3 } from "@elementor/editor-ui";
|
|
4584
4425
|
import { AdjustmentsIcon } from "@elementor/icons";
|
|
4585
|
-
import { bindPopover as
|
|
4586
|
-
import { __ as
|
|
4426
|
+
import { bindPopover as bindPopover5, Box as Box13, Divider as Divider4, Popover as Popover5 } from "@elementor/ui";
|
|
4427
|
+
import { __ as __36 } from "@wordpress/i18n";
|
|
4587
4428
|
|
|
4588
4429
|
// src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
|
|
4589
|
-
import * as
|
|
4430
|
+
import * as React75 from "react";
|
|
4590
4431
|
import { perspectiveOriginPropTypeUtil } from "@elementor/editor-props";
|
|
4591
|
-
import { Grid as
|
|
4592
|
-
import { __ as
|
|
4432
|
+
import { Grid as Grid20, Stack as Stack14 } from "@elementor/ui";
|
|
4433
|
+
import { __ as __34 } from "@wordpress/i18n";
|
|
4593
4434
|
var ORIGIN_UNITS = ["px", "%", "em", "rem"];
|
|
4594
4435
|
var PERSPECTIVE_CONTROL_FIELD = {
|
|
4595
|
-
label:
|
|
4436
|
+
label: __34("Perspective", "elementor"),
|
|
4596
4437
|
bind: "perspective",
|
|
4597
4438
|
units: ["px", "em", "rem", "vw", "vh"]
|
|
4598
4439
|
};
|
|
4599
4440
|
var CHILDREN_PERSPECTIVE_FIELDS = [
|
|
4600
4441
|
{
|
|
4601
|
-
label:
|
|
4442
|
+
label: __34("Origin X", "elementor"),
|
|
4602
4443
|
bind: "x",
|
|
4603
4444
|
units: ORIGIN_UNITS
|
|
4604
4445
|
},
|
|
4605
4446
|
{
|
|
4606
|
-
label:
|
|
4447
|
+
label: __34("Origin Y", "elementor"),
|
|
4607
4448
|
bind: "y",
|
|
4608
4449
|
units: ORIGIN_UNITS
|
|
4609
4450
|
}
|
|
4610
4451
|
];
|
|
4611
4452
|
var ChildrenPerspectiveControl = () => {
|
|
4612
|
-
return /* @__PURE__ */
|
|
4453
|
+
return /* @__PURE__ */ React75.createElement(Stack14, { direction: "column", spacing: 1.5 }, /* @__PURE__ */ React75.createElement(ControlFormLabel, null, __34("Children perspective", "elementor")), /* @__PURE__ */ React75.createElement(PerspectiveControl, null), /* @__PURE__ */ React75.createElement(PerspectiveOriginControl, null));
|
|
4613
4454
|
};
|
|
4614
|
-
var PerspectiveControl = () => /* @__PURE__ */
|
|
4615
|
-
var PerspectiveOriginControl = () => /* @__PURE__ */
|
|
4455
|
+
var PerspectiveControl = () => /* @__PURE__ */ React75.createElement(PropKeyProvider, { bind: "perspective" }, /* @__PURE__ */ React75.createElement(ControlFields, { control: PERSPECTIVE_CONTROL_FIELD, key: PERSPECTIVE_CONTROL_FIELD.bind }));
|
|
4456
|
+
var PerspectiveOriginControl = () => /* @__PURE__ */ React75.createElement(PropKeyProvider, { bind: "perspective-origin" }, /* @__PURE__ */ React75.createElement(PerspectiveOriginControlProvider, null));
|
|
4616
4457
|
var PerspectiveOriginControlProvider = () => {
|
|
4617
4458
|
const context = useBoundProp(perspectiveOriginPropTypeUtil);
|
|
4618
|
-
return /* @__PURE__ */
|
|
4459
|
+
return /* @__PURE__ */ React75.createElement(PropProvider, { ...context }, CHILDREN_PERSPECTIVE_FIELDS.map((control) => /* @__PURE__ */ React75.createElement(PropKeyProvider, { bind: control.bind, key: control.bind }, /* @__PURE__ */ React75.createElement(ControlFields, { control }))));
|
|
4619
4460
|
};
|
|
4620
4461
|
var ControlFields = ({ control }) => {
|
|
4621
|
-
const rowRef =
|
|
4622
|
-
return /* @__PURE__ */
|
|
4462
|
+
const rowRef = React75.useRef(null);
|
|
4463
|
+
return /* @__PURE__ */ React75.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React75.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React75.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React75.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React75.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef, disableCustom: true })));
|
|
4623
4464
|
};
|
|
4624
4465
|
|
|
4625
4466
|
// src/controls/transform-control/transform-base-controls/transform-origin-control.tsx
|
|
4626
|
-
import * as
|
|
4467
|
+
import * as React76 from "react";
|
|
4627
4468
|
import { transformOriginPropTypeUtil } from "@elementor/editor-props";
|
|
4628
|
-
import { Grid as
|
|
4629
|
-
import { __ as
|
|
4469
|
+
import { Grid as Grid21, Stack as Stack15 } from "@elementor/ui";
|
|
4470
|
+
import { __ as __35 } from "@wordpress/i18n";
|
|
4630
4471
|
var TRANSFORM_ORIGIN_UNITS = ["px", "%", "em", "rem"];
|
|
4631
4472
|
var TRANSFORM_ORIGIN_UNITS_Z_AXIS = TRANSFORM_ORIGIN_UNITS.filter((unit) => unit !== "%");
|
|
4632
4473
|
var TRANSFORM_ORIGIN_FIELDS = [
|
|
4633
4474
|
{
|
|
4634
|
-
label:
|
|
4475
|
+
label: __35("Origin X", "elementor"),
|
|
4635
4476
|
bind: "x",
|
|
4636
4477
|
units: TRANSFORM_ORIGIN_UNITS
|
|
4637
4478
|
},
|
|
4638
4479
|
{
|
|
4639
|
-
label:
|
|
4480
|
+
label: __35("Origin Y", "elementor"),
|
|
4640
4481
|
bind: "y",
|
|
4641
4482
|
units: TRANSFORM_ORIGIN_UNITS
|
|
4642
4483
|
},
|
|
4643
4484
|
{
|
|
4644
|
-
label:
|
|
4485
|
+
label: __35("Origin Z", "elementor"),
|
|
4645
4486
|
bind: "z",
|
|
4646
4487
|
units: TRANSFORM_ORIGIN_UNITS_Z_AXIS
|
|
4647
4488
|
}
|
|
4648
4489
|
];
|
|
4649
4490
|
var TransformOriginControl = () => {
|
|
4650
|
-
return /* @__PURE__ */
|
|
4491
|
+
return /* @__PURE__ */ React76.createElement(Stack15, { direction: "column", spacing: 1.5 }, /* @__PURE__ */ React76.createElement(ControlFormLabel, null, __35("Transform", "elementor")), TRANSFORM_ORIGIN_FIELDS.map((control) => /* @__PURE__ */ React76.createElement(ControlFields2, { control, key: control.bind })));
|
|
4651
4492
|
};
|
|
4652
4493
|
var ControlFields2 = ({ control }) => {
|
|
4653
4494
|
const context = useBoundProp(transformOriginPropTypeUtil);
|
|
4654
|
-
const rowRef =
|
|
4655
|
-
return /* @__PURE__ */
|
|
4495
|
+
const rowRef = React76.useRef(null);
|
|
4496
|
+
return /* @__PURE__ */ React76.createElement(PropProvider, { ...context }, /* @__PURE__ */ React76.createElement(PropKeyProvider, { bind: control.bind }, /* @__PURE__ */ React76.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React76.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React76.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React76.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React76.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef, disableCustom: true })))));
|
|
4656
4497
|
};
|
|
4657
4498
|
|
|
4658
4499
|
// src/controls/transform-control/transform-base-control.tsx
|
|
4659
|
-
var
|
|
4500
|
+
var SIZE7 = "tiny";
|
|
4660
4501
|
var TransformBaseControl = ({
|
|
4661
4502
|
popupState,
|
|
4662
4503
|
anchorRef
|
|
4663
4504
|
}) => {
|
|
4664
|
-
const popupProps =
|
|
4505
|
+
const popupProps = bindPopover5({
|
|
4665
4506
|
...popupState,
|
|
4666
4507
|
anchorEl: anchorRef.current ?? void 0
|
|
4667
4508
|
});
|
|
4668
|
-
return /* @__PURE__ */
|
|
4669
|
-
|
|
4509
|
+
return /* @__PURE__ */ React77.createElement(
|
|
4510
|
+
Popover5,
|
|
4670
4511
|
{
|
|
4671
4512
|
disablePortal: true,
|
|
4672
4513
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
@@ -4680,37 +4521,37 @@ var TransformBaseControl = ({
|
|
|
4680
4521
|
},
|
|
4681
4522
|
...popupProps
|
|
4682
4523
|
},
|
|
4683
|
-
/* @__PURE__ */
|
|
4524
|
+
/* @__PURE__ */ React77.createElement(
|
|
4684
4525
|
PopoverHeader3,
|
|
4685
4526
|
{
|
|
4686
|
-
title:
|
|
4527
|
+
title: __36("Base Transform", "elementor"),
|
|
4687
4528
|
onClose: popupState.close,
|
|
4688
|
-
icon: /* @__PURE__ */
|
|
4529
|
+
icon: /* @__PURE__ */ React77.createElement(AdjustmentsIcon, { fontSize: SIZE7 })
|
|
4689
4530
|
}
|
|
4690
4531
|
),
|
|
4691
|
-
/* @__PURE__ */
|
|
4692
|
-
/* @__PURE__ */
|
|
4532
|
+
/* @__PURE__ */ React77.createElement(Divider4, null),
|
|
4533
|
+
/* @__PURE__ */ React77.createElement(PopoverContent, { sx: { px: 2, py: 1.5 } }, /* @__PURE__ */ React77.createElement(PropKeyProvider, { bind: "transform-origin" }, /* @__PURE__ */ React77.createElement(TransformOriginControl, null)), /* @__PURE__ */ React77.createElement(Box13, { sx: { my: 0.5 } }, /* @__PURE__ */ React77.createElement(Divider4, null)), /* @__PURE__ */ React77.createElement(ChildrenPerspectiveControl, null))
|
|
4693
4534
|
);
|
|
4694
4535
|
};
|
|
4695
4536
|
|
|
4696
4537
|
// src/controls/transform-control/transform-content.tsx
|
|
4697
|
-
import * as
|
|
4698
|
-
import { Box as
|
|
4699
|
-
import { __ as
|
|
4538
|
+
import * as React84 from "react";
|
|
4539
|
+
import { Box as Box14, Tab as Tab2, TabPanel as TabPanel2, Tabs as Tabs2 } from "@elementor/ui";
|
|
4540
|
+
import { __ as __41 } from "@wordpress/i18n";
|
|
4700
4541
|
|
|
4701
4542
|
// src/controls/transform-control/functions/move.tsx
|
|
4702
|
-
import * as
|
|
4543
|
+
import * as React79 from "react";
|
|
4703
4544
|
import { useRef as useRef16 } from "react";
|
|
4704
4545
|
import { moveTransformPropTypeUtil } from "@elementor/editor-props";
|
|
4705
4546
|
import { ArrowDownLeftIcon, ArrowDownSmallIcon, ArrowRightIcon } from "@elementor/icons";
|
|
4706
|
-
import { Grid as
|
|
4707
|
-
import { __ as
|
|
4547
|
+
import { Grid as Grid23 } from "@elementor/ui";
|
|
4548
|
+
import { __ as __37 } from "@wordpress/i18n";
|
|
4708
4549
|
|
|
4709
4550
|
// src/controls/transform-control/functions/axis-row.tsx
|
|
4710
|
-
import * as
|
|
4711
|
-
import { Grid as
|
|
4551
|
+
import * as React78 from "react";
|
|
4552
|
+
import { Grid as Grid22 } from "@elementor/ui";
|
|
4712
4553
|
var AxisRow = ({ label, bind, startIcon, anchorRef, units: units2, variant = "angle" }) => {
|
|
4713
|
-
return /* @__PURE__ */
|
|
4554
|
+
return /* @__PURE__ */ React78.createElement(Grid22, { item: true, xs: 12 }, /* @__PURE__ */ React78.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React78.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React78.createElement(ControlLabel, null, label)), /* @__PURE__ */ React78.createElement(Grid22, { item: true, xs: 6 }, /* @__PURE__ */ React78.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React78.createElement(
|
|
4714
4555
|
SizeControl,
|
|
4715
4556
|
{
|
|
4716
4557
|
anchorRef,
|
|
@@ -4725,28 +4566,28 @@ var AxisRow = ({ label, bind, startIcon, anchorRef, units: units2, variant = "an
|
|
|
4725
4566
|
// src/controls/transform-control/functions/move.tsx
|
|
4726
4567
|
var moveAxisControls = [
|
|
4727
4568
|
{
|
|
4728
|
-
label:
|
|
4569
|
+
label: __37("Move X", "elementor"),
|
|
4729
4570
|
bind: "x",
|
|
4730
|
-
startIcon: /* @__PURE__ */
|
|
4571
|
+
startIcon: /* @__PURE__ */ React79.createElement(ArrowRightIcon, { fontSize: "tiny" }),
|
|
4731
4572
|
units: ["px", "%", "em", "rem", "vw"]
|
|
4732
4573
|
},
|
|
4733
4574
|
{
|
|
4734
|
-
label:
|
|
4575
|
+
label: __37("Move Y", "elementor"),
|
|
4735
4576
|
bind: "y",
|
|
4736
|
-
startIcon: /* @__PURE__ */
|
|
4577
|
+
startIcon: /* @__PURE__ */ React79.createElement(ArrowDownSmallIcon, { fontSize: "tiny" }),
|
|
4737
4578
|
units: ["px", "%", "em", "rem", "vh"]
|
|
4738
4579
|
},
|
|
4739
4580
|
{
|
|
4740
|
-
label:
|
|
4581
|
+
label: __37("Move Z", "elementor"),
|
|
4741
4582
|
bind: "z",
|
|
4742
|
-
startIcon: /* @__PURE__ */
|
|
4583
|
+
startIcon: /* @__PURE__ */ React79.createElement(ArrowDownLeftIcon, { fontSize: "tiny" }),
|
|
4743
4584
|
units: ["px", "%", "em", "rem", "vw", "vh"]
|
|
4744
4585
|
}
|
|
4745
4586
|
];
|
|
4746
4587
|
var Move = () => {
|
|
4747
4588
|
const context = useBoundProp(moveTransformPropTypeUtil);
|
|
4748
4589
|
const rowRefs = [useRef16(null), useRef16(null), useRef16(null)];
|
|
4749
|
-
return /* @__PURE__ */
|
|
4590
|
+
return /* @__PURE__ */ React79.createElement(Grid23, { container: true, spacing: 1.5 }, /* @__PURE__ */ React79.createElement(PropProvider, { ...context }, /* @__PURE__ */ React79.createElement(PropKeyProvider, { bind: TransformFunctionKeys.move }, moveAxisControls.map((control, index) => /* @__PURE__ */ React79.createElement(
|
|
4750
4591
|
AxisRow,
|
|
4751
4592
|
{
|
|
4752
4593
|
key: control.bind,
|
|
@@ -4759,34 +4600,34 @@ var Move = () => {
|
|
|
4759
4600
|
};
|
|
4760
4601
|
|
|
4761
4602
|
// src/controls/transform-control/functions/rotate.tsx
|
|
4762
|
-
import * as
|
|
4603
|
+
import * as React80 from "react";
|
|
4763
4604
|
import { useRef as useRef17 } from "react";
|
|
4764
4605
|
import { rotateTransformPropTypeUtil as rotateTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
4765
4606
|
import { Arrow360Icon, RotateClockwiseIcon } from "@elementor/icons";
|
|
4766
|
-
import { Grid as
|
|
4767
|
-
import { __ as
|
|
4607
|
+
import { Grid as Grid24 } from "@elementor/ui";
|
|
4608
|
+
import { __ as __38 } from "@wordpress/i18n";
|
|
4768
4609
|
var rotateAxisControls = [
|
|
4769
4610
|
{
|
|
4770
|
-
label:
|
|
4611
|
+
label: __38("Rotate X", "elementor"),
|
|
4771
4612
|
bind: "x",
|
|
4772
|
-
startIcon: /* @__PURE__ */
|
|
4613
|
+
startIcon: /* @__PURE__ */ React80.createElement(Arrow360Icon, { fontSize: "tiny" })
|
|
4773
4614
|
},
|
|
4774
4615
|
{
|
|
4775
|
-
label:
|
|
4616
|
+
label: __38("Rotate Y", "elementor"),
|
|
4776
4617
|
bind: "y",
|
|
4777
|
-
startIcon: /* @__PURE__ */
|
|
4618
|
+
startIcon: /* @__PURE__ */ React80.createElement(Arrow360Icon, { fontSize: "tiny", style: { transform: "scaleX(-1) rotate(-90deg)" } })
|
|
4778
4619
|
},
|
|
4779
4620
|
{
|
|
4780
|
-
label:
|
|
4621
|
+
label: __38("Rotate Z", "elementor"),
|
|
4781
4622
|
bind: "z",
|
|
4782
|
-
startIcon: /* @__PURE__ */
|
|
4623
|
+
startIcon: /* @__PURE__ */ React80.createElement(RotateClockwiseIcon, { fontSize: "tiny" })
|
|
4783
4624
|
}
|
|
4784
4625
|
];
|
|
4785
4626
|
var rotateUnits = ["deg", "rad", "grad", "turn"];
|
|
4786
4627
|
var Rotate = () => {
|
|
4787
4628
|
const context = useBoundProp(rotateTransformPropTypeUtil2);
|
|
4788
4629
|
const rowRefs = [useRef17(null), useRef17(null), useRef17(null)];
|
|
4789
|
-
return /* @__PURE__ */
|
|
4630
|
+
return /* @__PURE__ */ React80.createElement(Grid24, { container: true, spacing: 1.5 }, /* @__PURE__ */ React80.createElement(PropProvider, { ...context }, /* @__PURE__ */ React80.createElement(PropKeyProvider, { bind: TransformFunctionKeys.rotate }, rotateAxisControls.map((control, index) => /* @__PURE__ */ React80.createElement(
|
|
4790
4631
|
AxisRow,
|
|
4791
4632
|
{
|
|
4792
4633
|
key: control.bind,
|
|
@@ -4798,68 +4639,68 @@ var Rotate = () => {
|
|
|
4798
4639
|
};
|
|
4799
4640
|
|
|
4800
4641
|
// src/controls/transform-control/functions/scale.tsx
|
|
4801
|
-
import * as
|
|
4642
|
+
import * as React82 from "react";
|
|
4802
4643
|
import { useRef as useRef18 } from "react";
|
|
4803
4644
|
import { scaleTransformPropTypeUtil as scaleTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
4804
4645
|
import { ArrowDownLeftIcon as ArrowDownLeftIcon2, ArrowDownSmallIcon as ArrowDownSmallIcon2, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
|
|
4805
|
-
import { Grid as
|
|
4806
|
-
import { __ as
|
|
4646
|
+
import { Grid as Grid26 } from "@elementor/ui";
|
|
4647
|
+
import { __ as __39 } from "@wordpress/i18n";
|
|
4807
4648
|
|
|
4808
4649
|
// src/controls/transform-control/functions/scale-axis-row.tsx
|
|
4809
|
-
import * as
|
|
4810
|
-
import { Grid as
|
|
4650
|
+
import * as React81 from "react";
|
|
4651
|
+
import { Grid as Grid25 } from "@elementor/ui";
|
|
4811
4652
|
var ScaleAxisRow = ({ label, bind, startIcon, anchorRef }) => {
|
|
4812
|
-
return /* @__PURE__ */
|
|
4653
|
+
return /* @__PURE__ */ React81.createElement(Grid25, { item: true, xs: 12 }, /* @__PURE__ */ React81.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React81.createElement(Grid25, { item: true, xs: 6 }, /* @__PURE__ */ React81.createElement(ControlLabel, null, label)), /* @__PURE__ */ React81.createElement(Grid25, { item: true, xs: 6 }, /* @__PURE__ */ React81.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React81.createElement(NumberControl, { step: 0.1, placeholder: "1", startIcon })))));
|
|
4813
4654
|
};
|
|
4814
4655
|
|
|
4815
4656
|
// src/controls/transform-control/functions/scale.tsx
|
|
4816
4657
|
var scaleAxisControls = [
|
|
4817
4658
|
{
|
|
4818
|
-
label:
|
|
4659
|
+
label: __39("Scale X", "elementor"),
|
|
4819
4660
|
bind: "x",
|
|
4820
|
-
startIcon: /* @__PURE__ */
|
|
4661
|
+
startIcon: /* @__PURE__ */ React82.createElement(ArrowRightIcon2, { fontSize: "tiny" })
|
|
4821
4662
|
},
|
|
4822
4663
|
{
|
|
4823
|
-
label:
|
|
4664
|
+
label: __39("Scale Y", "elementor"),
|
|
4824
4665
|
bind: "y",
|
|
4825
|
-
startIcon: /* @__PURE__ */
|
|
4666
|
+
startIcon: /* @__PURE__ */ React82.createElement(ArrowDownSmallIcon2, { fontSize: "tiny" })
|
|
4826
4667
|
},
|
|
4827
4668
|
{
|
|
4828
|
-
label:
|
|
4669
|
+
label: __39("Scale Z", "elementor"),
|
|
4829
4670
|
bind: "z",
|
|
4830
|
-
startIcon: /* @__PURE__ */
|
|
4671
|
+
startIcon: /* @__PURE__ */ React82.createElement(ArrowDownLeftIcon2, { fontSize: "tiny" })
|
|
4831
4672
|
}
|
|
4832
4673
|
];
|
|
4833
4674
|
var Scale = () => {
|
|
4834
4675
|
const context = useBoundProp(scaleTransformPropTypeUtil2);
|
|
4835
4676
|
const rowRefs = [useRef18(null), useRef18(null), useRef18(null)];
|
|
4836
|
-
return /* @__PURE__ */
|
|
4677
|
+
return /* @__PURE__ */ React82.createElement(Grid26, { container: true, spacing: 1.5 }, /* @__PURE__ */ React82.createElement(PropProvider, { ...context }, /* @__PURE__ */ React82.createElement(PropKeyProvider, { bind: TransformFunctionKeys.scale }, scaleAxisControls.map((control, index) => /* @__PURE__ */ React82.createElement(ScaleAxisRow, { key: control.bind, ...control, anchorRef: rowRefs[index] })))));
|
|
4837
4678
|
};
|
|
4838
4679
|
|
|
4839
4680
|
// src/controls/transform-control/functions/skew.tsx
|
|
4840
|
-
import * as
|
|
4681
|
+
import * as React83 from "react";
|
|
4841
4682
|
import { useRef as useRef19 } from "react";
|
|
4842
4683
|
import { skewTransformPropTypeUtil as skewTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
4843
4684
|
import { ArrowLeftIcon, ArrowRightIcon as ArrowRightIcon3 } from "@elementor/icons";
|
|
4844
|
-
import { Grid as
|
|
4845
|
-
import { __ as
|
|
4685
|
+
import { Grid as Grid27 } from "@elementor/ui";
|
|
4686
|
+
import { __ as __40 } from "@wordpress/i18n";
|
|
4846
4687
|
var skewAxisControls = [
|
|
4847
4688
|
{
|
|
4848
|
-
label:
|
|
4689
|
+
label: __40("Skew X", "elementor"),
|
|
4849
4690
|
bind: "x",
|
|
4850
|
-
startIcon: /* @__PURE__ */
|
|
4691
|
+
startIcon: /* @__PURE__ */ React83.createElement(ArrowRightIcon3, { fontSize: "tiny" })
|
|
4851
4692
|
},
|
|
4852
4693
|
{
|
|
4853
|
-
label:
|
|
4694
|
+
label: __40("Skew Y", "elementor"),
|
|
4854
4695
|
bind: "y",
|
|
4855
|
-
startIcon: /* @__PURE__ */
|
|
4696
|
+
startIcon: /* @__PURE__ */ React83.createElement(ArrowLeftIcon, { fontSize: "tiny", style: { transform: "scaleX(-1) rotate(-90deg)" } })
|
|
4856
4697
|
}
|
|
4857
4698
|
];
|
|
4858
4699
|
var skewUnits = ["deg", "rad", "grad", "turn"];
|
|
4859
4700
|
var Skew = () => {
|
|
4860
4701
|
const context = useBoundProp(skewTransformPropTypeUtil2);
|
|
4861
4702
|
const rowRefs = [useRef19(null), useRef19(null), useRef19(null)];
|
|
4862
|
-
return /* @__PURE__ */
|
|
4703
|
+
return /* @__PURE__ */ React83.createElement(Grid27, { container: true, spacing: 1.5 }, /* @__PURE__ */ React83.createElement(PropProvider, { ...context }, /* @__PURE__ */ React83.createElement(PropKeyProvider, { bind: TransformFunctionKeys.skew }, skewAxisControls.map((control, index) => /* @__PURE__ */ React83.createElement(
|
|
4863
4704
|
AxisRow,
|
|
4864
4705
|
{
|
|
4865
4706
|
key: control.bind,
|
|
@@ -4964,7 +4805,7 @@ var TransformContent = () => {
|
|
|
4964
4805
|
rotate: initialRotateValue.value,
|
|
4965
4806
|
skew: initialSkewValue.value
|
|
4966
4807
|
});
|
|
4967
|
-
return /* @__PURE__ */
|
|
4808
|
+
return /* @__PURE__ */ React84.createElement(PopoverContent, null, /* @__PURE__ */ React84.createElement(Box14, { sx: { width: "100%" } }, /* @__PURE__ */ React84.createElement(Box14, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React84.createElement(
|
|
4968
4809
|
Tabs2,
|
|
4969
4810
|
{
|
|
4970
4811
|
size: "small",
|
|
@@ -4975,37 +4816,37 @@ var TransformContent = () => {
|
|
|
4975
4816
|
}
|
|
4976
4817
|
},
|
|
4977
4818
|
...getTabsProps(),
|
|
4978
|
-
"aria-label":
|
|
4819
|
+
"aria-label": __41("Transform", "elementor")
|
|
4979
4820
|
},
|
|
4980
|
-
/* @__PURE__ */
|
|
4981
|
-
/* @__PURE__ */
|
|
4982
|
-
/* @__PURE__ */
|
|
4983
|
-
/* @__PURE__ */
|
|
4984
|
-
)), /* @__PURE__ */
|
|
4821
|
+
/* @__PURE__ */ React84.createElement(Tab2, { label: __41("Move", "elementor"), ...getTabProps(TransformFunctionKeys.move) }),
|
|
4822
|
+
/* @__PURE__ */ React84.createElement(Tab2, { label: __41("Scale", "elementor"), ...getTabProps(TransformFunctionKeys.scale) }),
|
|
4823
|
+
/* @__PURE__ */ React84.createElement(Tab2, { label: __41("Rotate", "elementor"), ...getTabProps(TransformFunctionKeys.rotate) }),
|
|
4824
|
+
/* @__PURE__ */ React84.createElement(Tab2, { label: __41("Skew", "elementor"), ...getTabProps(TransformFunctionKeys.skew) })
|
|
4825
|
+
)), /* @__PURE__ */ React84.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.move) }, /* @__PURE__ */ React84.createElement(Move, null)), /* @__PURE__ */ React84.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.scale) }, /* @__PURE__ */ React84.createElement(Scale, null)), /* @__PURE__ */ React84.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.rotate) }, /* @__PURE__ */ React84.createElement(Rotate, null)), /* @__PURE__ */ React84.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.skew) }, /* @__PURE__ */ React84.createElement(Skew, null))));
|
|
4985
4826
|
};
|
|
4986
4827
|
|
|
4987
4828
|
// src/controls/transform-control/transform-icon.tsx
|
|
4988
|
-
import * as
|
|
4829
|
+
import * as React85 from "react";
|
|
4989
4830
|
import { ArrowsMaximizeIcon as ArrowsMaximizeIcon2, ExpandIcon, RotateClockwise2Icon, SkewXIcon } from "@elementor/icons";
|
|
4990
4831
|
var TransformIcon = ({ value }) => {
|
|
4991
4832
|
switch (value.$$type) {
|
|
4992
4833
|
case TransformFunctionKeys.move:
|
|
4993
|
-
return /* @__PURE__ */
|
|
4834
|
+
return /* @__PURE__ */ React85.createElement(ArrowsMaximizeIcon2, { fontSize: "tiny" });
|
|
4994
4835
|
case TransformFunctionKeys.scale:
|
|
4995
|
-
return /* @__PURE__ */
|
|
4836
|
+
return /* @__PURE__ */ React85.createElement(ExpandIcon, { fontSize: "tiny" });
|
|
4996
4837
|
case TransformFunctionKeys.rotate:
|
|
4997
|
-
return /* @__PURE__ */
|
|
4838
|
+
return /* @__PURE__ */ React85.createElement(RotateClockwise2Icon, { fontSize: "tiny" });
|
|
4998
4839
|
case TransformFunctionKeys.skew:
|
|
4999
|
-
return /* @__PURE__ */
|
|
4840
|
+
return /* @__PURE__ */ React85.createElement(SkewXIcon, { fontSize: "tiny" });
|
|
5000
4841
|
default:
|
|
5001
4842
|
return null;
|
|
5002
4843
|
}
|
|
5003
4844
|
};
|
|
5004
4845
|
|
|
5005
4846
|
// src/controls/transform-control/transform-label.tsx
|
|
5006
|
-
import * as
|
|
5007
|
-
import { Box as
|
|
5008
|
-
import { __ as
|
|
4847
|
+
import * as React86 from "react";
|
|
4848
|
+
import { Box as Box15 } from "@elementor/ui";
|
|
4849
|
+
import { __ as __42 } from "@wordpress/i18n";
|
|
5009
4850
|
var transformMoveValue = (value) => Object.values(value).map((axis) => {
|
|
5010
4851
|
const size = axis?.value?.size ?? defaultValues.move.size;
|
|
5011
4852
|
const unit = axis?.value?.unit ?? defaultValues.move.unit;
|
|
@@ -5026,44 +4867,44 @@ var TransformLabel = (props) => {
|
|
|
5026
4867
|
const { $$type, value } = props.value;
|
|
5027
4868
|
switch ($$type) {
|
|
5028
4869
|
case TransformFunctionKeys.move:
|
|
5029
|
-
return /* @__PURE__ */
|
|
4870
|
+
return /* @__PURE__ */ React86.createElement(Label2, { label: __42("Move", "elementor"), value: transformMoveValue(value) });
|
|
5030
4871
|
case TransformFunctionKeys.scale:
|
|
5031
|
-
return /* @__PURE__ */
|
|
4872
|
+
return /* @__PURE__ */ React86.createElement(Label2, { label: __42("Scale", "elementor"), value: transformScaleValue(value) });
|
|
5032
4873
|
case TransformFunctionKeys.rotate:
|
|
5033
|
-
return /* @__PURE__ */
|
|
4874
|
+
return /* @__PURE__ */ React86.createElement(Label2, { label: __42("Rotate", "elementor"), value: transformRotateValue(value) });
|
|
5034
4875
|
case TransformFunctionKeys.skew:
|
|
5035
|
-
return /* @__PURE__ */
|
|
4876
|
+
return /* @__PURE__ */ React86.createElement(Label2, { label: __42("Skew", "elementor"), value: transformSkewValue(value) });
|
|
5036
4877
|
default:
|
|
5037
4878
|
return "";
|
|
5038
4879
|
}
|
|
5039
4880
|
};
|
|
5040
4881
|
var Label2 = ({ label, value }) => {
|
|
5041
|
-
return /* @__PURE__ */
|
|
4882
|
+
return /* @__PURE__ */ React86.createElement(Box15, { component: "span" }, label, ": ", value);
|
|
5042
4883
|
};
|
|
5043
4884
|
|
|
5044
4885
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
5045
|
-
var
|
|
4886
|
+
var SIZE8 = "tiny";
|
|
5046
4887
|
var TransformRepeaterControl = createControl(() => {
|
|
5047
4888
|
const context = useBoundProp(transformPropTypeUtil);
|
|
5048
4889
|
const headerRef = useRef21(null);
|
|
5049
|
-
const popupState =
|
|
4890
|
+
const popupState = usePopupState6({ variant: "popover" });
|
|
5050
4891
|
const repeaterBindKey = "transform-functions";
|
|
5051
4892
|
injectIntoRepeaterHeaderActions({
|
|
5052
4893
|
id: "transform-base-control",
|
|
5053
|
-
component: () => /* @__PURE__ */
|
|
4894
|
+
component: () => /* @__PURE__ */ React87.createElement(TransformBasePopoverTrigger, { popupState, repeaterBindKey }),
|
|
5054
4895
|
options: { overwrite: true }
|
|
5055
4896
|
});
|
|
5056
|
-
return /* @__PURE__ */
|
|
4897
|
+
return /* @__PURE__ */ React87.createElement(PropProvider, { ...context }, /* @__PURE__ */ React87.createElement(TransformBaseControl, { popupState, anchorRef: headerRef }), /* @__PURE__ */ React87.createElement(PropKeyProvider, { bind: repeaterBindKey }, /* @__PURE__ */ React87.createElement(Repeater2, { headerRef })));
|
|
5057
4898
|
});
|
|
5058
|
-
var ToolTip = /* @__PURE__ */
|
|
5059
|
-
|
|
4899
|
+
var ToolTip = /* @__PURE__ */ React87.createElement(
|
|
4900
|
+
Box16,
|
|
5060
4901
|
{
|
|
5061
4902
|
component: "span",
|
|
5062
4903
|
"aria-label": void 0,
|
|
5063
4904
|
sx: { display: "flex", gap: 0.5, p: 2, width: 320, borderRadius: 1 }
|
|
5064
4905
|
},
|
|
5065
|
-
/* @__PURE__ */
|
|
5066
|
-
/* @__PURE__ */
|
|
4906
|
+
/* @__PURE__ */ React87.createElement(InfoCircleFilledIcon2, { sx: { color: "secondary.main" } }),
|
|
4907
|
+
/* @__PURE__ */ React87.createElement(Typography5, { variant: "body2", color: "text.secondary", fontSize: "14px" }, __43("You can use each kind of transform only once per element.", "elementor"))
|
|
5067
4908
|
);
|
|
5068
4909
|
var Repeater2 = ({ headerRef }) => {
|
|
5069
4910
|
const transformFunctionsContext = useBoundProp(transformFunctionsPropTypeUtil);
|
|
@@ -5073,13 +4914,13 @@ var Repeater2 = ({ headerRef }) => {
|
|
|
5073
4914
|
return availableValues.find((value) => !transformValues?.some((item) => item.$$type === value.$$type));
|
|
5074
4915
|
};
|
|
5075
4916
|
const shouldDisableAddItem = !getInitialValue();
|
|
5076
|
-
return /* @__PURE__ */
|
|
4917
|
+
return /* @__PURE__ */ React87.createElement(PropProvider, { ...transformFunctionsContext }, /* @__PURE__ */ React87.createElement(
|
|
5077
4918
|
UnstableRepeater,
|
|
5078
4919
|
{
|
|
5079
4920
|
initial: getInitialValue() ?? initialTransformValue,
|
|
5080
4921
|
propTypeUtil: transformFunctionsPropTypeUtil
|
|
5081
4922
|
},
|
|
5082
|
-
/* @__PURE__ */
|
|
4923
|
+
/* @__PURE__ */ React87.createElement(Header, { label: __43("Transform", "elementor"), ref: headerRef }, /* @__PURE__ */ React87.createElement(
|
|
5083
4924
|
TooltipAddItemAction,
|
|
5084
4925
|
{
|
|
5085
4926
|
disabled: shouldDisableAddItem,
|
|
@@ -5087,8 +4928,8 @@ var Repeater2 = ({ headerRef }) => {
|
|
|
5087
4928
|
enableTooltip: shouldDisableAddItem
|
|
5088
4929
|
}
|
|
5089
4930
|
)),
|
|
5090
|
-
/* @__PURE__ */
|
|
5091
|
-
/* @__PURE__ */
|
|
4931
|
+
/* @__PURE__ */ React87.createElement(ItemsContainer, { itemTemplate: /* @__PURE__ */ React87.createElement(Item, { Icon: TransformIcon, Label: TransformLabel }) }, /* @__PURE__ */ React87.createElement(DisableItemAction, null), /* @__PURE__ */ React87.createElement(RemoveItemAction, null)),
|
|
4932
|
+
/* @__PURE__ */ React87.createElement(EditItemPopover, null, /* @__PURE__ */ React87.createElement(TransformContent, null))
|
|
5092
4933
|
));
|
|
5093
4934
|
};
|
|
5094
4935
|
var TransformBasePopoverTrigger = ({
|
|
@@ -5096,27 +4937,27 @@ var TransformBasePopoverTrigger = ({
|
|
|
5096
4937
|
repeaterBindKey
|
|
5097
4938
|
}) => {
|
|
5098
4939
|
const { bind } = useBoundProp();
|
|
5099
|
-
return bind !== repeaterBindKey ? null : /* @__PURE__ */
|
|
4940
|
+
return bind !== repeaterBindKey ? null : /* @__PURE__ */ React87.createElement(IconButton7, { size: SIZE8, "aria-label": __43("Base Transform", "elementor"), ...bindTrigger4(popupState) }, /* @__PURE__ */ React87.createElement(AdjustmentsIcon2, { fontSize: SIZE8 }));
|
|
5100
4941
|
};
|
|
5101
4942
|
|
|
5102
4943
|
// src/controls/transition-control/transition-repeater-control.tsx
|
|
5103
|
-
import * as
|
|
5104
|
-
import { useEffect as
|
|
4944
|
+
import * as React90 from "react";
|
|
4945
|
+
import { useEffect as useEffect8, useState as useState14 } from "react";
|
|
5105
4946
|
import { selectionSizePropTypeUtil as selectionSizePropTypeUtil2 } from "@elementor/editor-props";
|
|
5106
4947
|
import { InfoCircleFilledIcon as InfoCircleFilledIcon3 } from "@elementor/icons";
|
|
5107
|
-
import { Alert as Alert2, AlertTitle as AlertTitle2, Box as
|
|
5108
|
-
import { __ as
|
|
4948
|
+
import { Alert as Alert2, AlertTitle as AlertTitle2, Box as Box18, Typography as Typography6 } from "@elementor/ui";
|
|
4949
|
+
import { __ as __46 } from "@wordpress/i18n";
|
|
5109
4950
|
|
|
5110
4951
|
// src/controls/selection-size-control.tsx
|
|
5111
|
-
import * as
|
|
5112
|
-
import { useMemo as
|
|
4952
|
+
import * as React88 from "react";
|
|
4953
|
+
import { useMemo as useMemo8, useRef as useRef22 } from "react";
|
|
5113
4954
|
import { selectionSizePropTypeUtil } from "@elementor/editor-props";
|
|
5114
|
-
import { Grid as
|
|
4955
|
+
import { Grid as Grid28 } from "@elementor/ui";
|
|
5115
4956
|
var SelectionSizeControl = createControl(
|
|
5116
4957
|
({ selectionLabel, sizeLabel, selectionConfig, sizeConfigMap }) => {
|
|
5117
4958
|
const { value, setValue, propType } = useBoundProp(selectionSizePropTypeUtil);
|
|
5118
4959
|
const rowRef = useRef22(null);
|
|
5119
|
-
const currentSizeConfig =
|
|
4960
|
+
const currentSizeConfig = useMemo8(() => {
|
|
5120
4961
|
switch (value.selection.$$type) {
|
|
5121
4962
|
case "key-value":
|
|
5122
4963
|
return sizeConfigMap[value?.selection?.value.value.value || ""];
|
|
@@ -5127,7 +4968,7 @@ var SelectionSizeControl = createControl(
|
|
|
5127
4968
|
}
|
|
5128
4969
|
}, [value, sizeConfigMap]);
|
|
5129
4970
|
const SelectionComponent = selectionConfig.component;
|
|
5130
|
-
return /* @__PURE__ */
|
|
4971
|
+
return /* @__PURE__ */ React88.createElement(PropProvider, { value, setValue, propType }, /* @__PURE__ */ React88.createElement(Grid28, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React88.createElement(Grid28, { item: true, xs: 6, sx: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React88.createElement(ControlFormLabel, null, selectionLabel)), /* @__PURE__ */ React88.createElement(Grid28, { item: true, xs: 6 }, /* @__PURE__ */ React88.createElement(PropKeyProvider, { bind: "selection" }, /* @__PURE__ */ React88.createElement(SelectionComponent, { ...selectionConfig.props }))), currentSizeConfig && /* @__PURE__ */ React88.createElement(React88.Fragment, null, /* @__PURE__ */ React88.createElement(Grid28, { item: true, xs: 6, sx: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React88.createElement(ControlFormLabel, null, sizeLabel)), /* @__PURE__ */ React88.createElement(Grid28, { item: true, xs: 6 }, /* @__PURE__ */ React88.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React88.createElement(
|
|
5131
4972
|
SizeControl,
|
|
5132
4973
|
{
|
|
5133
4974
|
anchorRef: rowRef,
|
|
@@ -5140,12 +4981,12 @@ var SelectionSizeControl = createControl(
|
|
|
5140
4981
|
);
|
|
5141
4982
|
|
|
5142
4983
|
// src/controls/transition-control/data.ts
|
|
5143
|
-
import { __ as
|
|
4984
|
+
import { __ as __44 } from "@wordpress/i18n";
|
|
5144
4985
|
var initialTransitionValue = {
|
|
5145
4986
|
selection: {
|
|
5146
4987
|
$$type: "key-value",
|
|
5147
4988
|
value: {
|
|
5148
|
-
key: { value:
|
|
4989
|
+
key: { value: __44("All properties", "elementor"), $$type: "string" },
|
|
5149
4990
|
value: { value: "all", $$type: "string" }
|
|
5150
4991
|
}
|
|
5151
4992
|
},
|
|
@@ -5153,9 +4994,9 @@ var initialTransitionValue = {
|
|
|
5153
4994
|
};
|
|
5154
4995
|
var transitionProperties = [
|
|
5155
4996
|
{
|
|
5156
|
-
label:
|
|
4997
|
+
label: __44("Default", "elementor"),
|
|
5157
4998
|
type: "category",
|
|
5158
|
-
properties: [{ label:
|
|
4999
|
+
properties: [{ label: __44("All properties", "elementor"), value: "all" }]
|
|
5159
5000
|
}
|
|
5160
5001
|
];
|
|
5161
5002
|
var transitionsItemsList = transitionProperties.map((category) => ({
|
|
@@ -5164,12 +5005,12 @@ var transitionsItemsList = transitionProperties.map((category) => ({
|
|
|
5164
5005
|
}));
|
|
5165
5006
|
|
|
5166
5007
|
// src/controls/transition-control/transition-selector.tsx
|
|
5167
|
-
import * as
|
|
5008
|
+
import * as React89 from "react";
|
|
5168
5009
|
import { useRef as useRef23 } from "react";
|
|
5169
5010
|
import { keyValuePropTypeUtil as keyValuePropTypeUtil2 } from "@elementor/editor-props";
|
|
5170
5011
|
import { ChevronDownIcon as ChevronDownIcon3, VariationsIcon } from "@elementor/icons";
|
|
5171
|
-
import { bindPopover as
|
|
5172
|
-
import { __ as
|
|
5012
|
+
import { bindPopover as bindPopover6, bindTrigger as bindTrigger5, Box as Box17, Popover as Popover6, UnstableTag as UnstableTag3, usePopupState as usePopupState7 } from "@elementor/ui";
|
|
5013
|
+
import { __ as __45 } from "@wordpress/i18n";
|
|
5173
5014
|
var toTransitionSelectorValue = (label) => {
|
|
5174
5015
|
for (const category of transitionProperties) {
|
|
5175
5016
|
const property = category.properties.find((prop) => prop.label === label);
|
|
@@ -5196,7 +5037,7 @@ var TransitionSelector = ({ recentlyUsedList = [] }) => {
|
|
|
5196
5037
|
key: { value: transitionLabel }
|
|
5197
5038
|
} = value;
|
|
5198
5039
|
const defaultRef = useRef23(null);
|
|
5199
|
-
const popoverState =
|
|
5040
|
+
const popoverState = usePopupState7({ variant: "popover" });
|
|
5200
5041
|
const getItemList = () => {
|
|
5201
5042
|
const recentItems = recentlyUsedList.map((item) => findByValue(item)).filter((item) => !!item);
|
|
5202
5043
|
const filteredItems = transitionsItemsList.map((category) => {
|
|
@@ -5212,7 +5053,7 @@ var TransitionSelector = ({ recentlyUsedList = [] }) => {
|
|
|
5212
5053
|
return [
|
|
5213
5054
|
first,
|
|
5214
5055
|
{
|
|
5215
|
-
label:
|
|
5056
|
+
label: __45("Recently Used", "elementor"),
|
|
5216
5057
|
items: recentItems
|
|
5217
5058
|
},
|
|
5218
5059
|
...rest
|
|
@@ -5236,27 +5077,27 @@ var TransitionSelector = ({ recentlyUsedList = [] }) => {
|
|
|
5236
5077
|
left: rect.right + 36
|
|
5237
5078
|
};
|
|
5238
5079
|
};
|
|
5239
|
-
return /* @__PURE__ */
|
|
5240
|
-
|
|
5080
|
+
return /* @__PURE__ */ React89.createElement(Box17, { ref: defaultRef }, /* @__PURE__ */ React89.createElement(
|
|
5081
|
+
UnstableTag3,
|
|
5241
5082
|
{
|
|
5242
5083
|
variant: "outlined",
|
|
5243
5084
|
label: transitionLabel,
|
|
5244
|
-
endIcon: /* @__PURE__ */
|
|
5245
|
-
...
|
|
5085
|
+
endIcon: /* @__PURE__ */ React89.createElement(ChevronDownIcon3, { fontSize: "tiny" }),
|
|
5086
|
+
...bindTrigger5(popoverState),
|
|
5246
5087
|
fullWidth: true
|
|
5247
5088
|
}
|
|
5248
|
-
), /* @__PURE__ */
|
|
5249
|
-
|
|
5089
|
+
), /* @__PURE__ */ React89.createElement(
|
|
5090
|
+
Popover6,
|
|
5250
5091
|
{
|
|
5251
5092
|
disablePortal: true,
|
|
5252
5093
|
disableScrollLock: true,
|
|
5253
|
-
...
|
|
5094
|
+
...bindPopover6(popoverState),
|
|
5254
5095
|
anchorReference: "anchorPosition",
|
|
5255
5096
|
anchorPosition: getAnchorPosition(),
|
|
5256
5097
|
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
5257
5098
|
transformOrigin: { vertical: "top", horizontal: "left" }
|
|
5258
5099
|
},
|
|
5259
|
-
/* @__PURE__ */
|
|
5100
|
+
/* @__PURE__ */ React89.createElement(
|
|
5260
5101
|
ItemSelector,
|
|
5261
5102
|
{
|
|
5262
5103
|
itemsList: getItemList(),
|
|
@@ -5264,7 +5105,7 @@ var TransitionSelector = ({ recentlyUsedList = [] }) => {
|
|
|
5264
5105
|
onItemChange: handleTransitionPropertyChange,
|
|
5265
5106
|
onClose: popoverState.close,
|
|
5266
5107
|
sectionWidth: 268,
|
|
5267
|
-
title:
|
|
5108
|
+
title: __45("Transition Property", "elementor"),
|
|
5268
5109
|
icon: VariationsIcon
|
|
5269
5110
|
}
|
|
5270
5111
|
)
|
|
@@ -5279,8 +5120,8 @@ var DURATION_CONFIG = {
|
|
|
5279
5120
|
};
|
|
5280
5121
|
var getSelectionSizeProps = (recentlyUsedList) => {
|
|
5281
5122
|
return {
|
|
5282
|
-
selectionLabel:
|
|
5283
|
-
sizeLabel:
|
|
5123
|
+
selectionLabel: __46("Type", "elementor"),
|
|
5124
|
+
sizeLabel: __46("Duration", "elementor"),
|
|
5284
5125
|
selectionConfig: {
|
|
5285
5126
|
component: TransitionSelector,
|
|
5286
5127
|
props: {
|
|
@@ -5307,7 +5148,7 @@ function getChildControlConfig(recentlyUsedList) {
|
|
|
5307
5148
|
props: getSelectionSizeProps(recentlyUsedList)
|
|
5308
5149
|
};
|
|
5309
5150
|
}
|
|
5310
|
-
var disableAddItemTooltipContent = /* @__PURE__ */
|
|
5151
|
+
var disableAddItemTooltipContent = /* @__PURE__ */ React90.createElement(
|
|
5311
5152
|
Alert2,
|
|
5312
5153
|
{
|
|
5313
5154
|
sx: {
|
|
@@ -5315,10 +5156,10 @@ var disableAddItemTooltipContent = /* @__PURE__ */ React85.createElement(
|
|
|
5315
5156
|
gap: 0.5
|
|
5316
5157
|
},
|
|
5317
5158
|
color: "secondary",
|
|
5318
|
-
icon: /* @__PURE__ */
|
|
5159
|
+
icon: /* @__PURE__ */ React90.createElement(InfoCircleFilledIcon3, null)
|
|
5319
5160
|
},
|
|
5320
|
-
/* @__PURE__ */
|
|
5321
|
-
/* @__PURE__ */
|
|
5161
|
+
/* @__PURE__ */ React90.createElement(AlertTitle2, null, __46("Transitions", "elementor")),
|
|
5162
|
+
/* @__PURE__ */ React90.createElement(Box18, { component: "span" }, /* @__PURE__ */ React90.createElement(Typography6, { variant: "body2" }, __46("Switch to 'Normal' state to add a transition.", "elementor")))
|
|
5322
5163
|
);
|
|
5323
5164
|
var TransitionRepeaterControl = createControl(
|
|
5324
5165
|
({
|
|
@@ -5326,17 +5167,17 @@ var TransitionRepeaterControl = createControl(
|
|
|
5326
5167
|
currentStyleState
|
|
5327
5168
|
}) => {
|
|
5328
5169
|
const currentStyleIsNormal = currentStyleState === null;
|
|
5329
|
-
const [recentlyUsedList, setRecentlyUsedList] =
|
|
5330
|
-
|
|
5170
|
+
const [recentlyUsedList, setRecentlyUsedList] = useState14([]);
|
|
5171
|
+
useEffect8(() => {
|
|
5331
5172
|
recentlyUsedListGetter().then(setRecentlyUsedList);
|
|
5332
5173
|
}, [recentlyUsedListGetter]);
|
|
5333
|
-
return /* @__PURE__ */
|
|
5174
|
+
return /* @__PURE__ */ React90.createElement(
|
|
5334
5175
|
RepeatableControl,
|
|
5335
5176
|
{
|
|
5336
|
-
label:
|
|
5337
|
-
repeaterLabel:
|
|
5177
|
+
label: __46("Transitions", "elementor"),
|
|
5178
|
+
repeaterLabel: __46("Transitions", "elementor"),
|
|
5338
5179
|
patternLabel: "${value.selection.value.key.value}: ${value.size.value.size}${value.size.value.unit}",
|
|
5339
|
-
placeholder:
|
|
5180
|
+
placeholder: __46("Empty Transition", "elementor"),
|
|
5340
5181
|
showDuplicate: false,
|
|
5341
5182
|
showToggle: true,
|
|
5342
5183
|
initialValues: initialTransitionValue,
|
|
@@ -5353,14 +5194,14 @@ var TransitionRepeaterControl = createControl(
|
|
|
5353
5194
|
);
|
|
5354
5195
|
|
|
5355
5196
|
// src/components/css-code-editor/css-editor.tsx
|
|
5356
|
-
import * as
|
|
5197
|
+
import * as React92 from "react";
|
|
5357
5198
|
import { useActiveBreakpoint as useActiveBreakpoint2 } from "@elementor/editor-responsive";
|
|
5358
5199
|
import { useTheme as useTheme2 } from "@elementor/ui";
|
|
5359
5200
|
import { Editor } from "@monaco-editor/react";
|
|
5360
5201
|
|
|
5361
5202
|
// src/components/css-code-editor/css-editor.styles.ts
|
|
5362
|
-
import { Box as
|
|
5363
|
-
var EditorWrapper =
|
|
5203
|
+
import { Box as Box19, Button as Button5, styled as styled9 } from "@elementor/ui";
|
|
5204
|
+
var EditorWrapper = styled9(Box19)`
|
|
5364
5205
|
border: 1px solid var( --e-a-border-color );
|
|
5365
5206
|
border-radius: 8px;
|
|
5366
5207
|
padding: 10px 12px;
|
|
@@ -5371,7 +5212,7 @@ var EditorWrapper = styled8(Box20)`
|
|
|
5371
5212
|
z-index: 99999999 !important;
|
|
5372
5213
|
}
|
|
5373
5214
|
`;
|
|
5374
|
-
var ResizeHandle =
|
|
5215
|
+
var ResizeHandle = styled9(Button5)`
|
|
5375
5216
|
position: absolute;
|
|
5376
5217
|
bottom: 0;
|
|
5377
5218
|
left: 0;
|
|
@@ -5404,25 +5245,25 @@ var ResizeHandle = styled8(Button5)`
|
|
|
5404
5245
|
`;
|
|
5405
5246
|
|
|
5406
5247
|
// src/components/css-code-editor/css-validation.ts
|
|
5407
|
-
import { __ as
|
|
5248
|
+
import { __ as __47 } from "@wordpress/i18n";
|
|
5408
5249
|
var forbiddenPatterns = [
|
|
5409
5250
|
{
|
|
5410
5251
|
pattern: ":hover",
|
|
5411
|
-
message:
|
|
5252
|
+
message: __47(
|
|
5412
5253
|
"The use of pseudo-states is not permitted. Instead, switch to the desired pseudo state and add your custom code there.",
|
|
5413
5254
|
"elementor"
|
|
5414
5255
|
)
|
|
5415
5256
|
},
|
|
5416
5257
|
{
|
|
5417
5258
|
pattern: ":active",
|
|
5418
|
-
message:
|
|
5259
|
+
message: __47(
|
|
5419
5260
|
"The use of pseudo-states is not permitted. Instead, switch to the desired pseudo state and add your custom code there.",
|
|
5420
5261
|
"elementor"
|
|
5421
5262
|
)
|
|
5422
5263
|
},
|
|
5423
5264
|
{
|
|
5424
5265
|
pattern: "@media",
|
|
5425
|
-
message:
|
|
5266
|
+
message: __47(
|
|
5426
5267
|
"The use of @media is not permitted. Instead, switch to the desired breakpoint and add your custom code there.",
|
|
5427
5268
|
"elementor"
|
|
5428
5269
|
)
|
|
@@ -5461,9 +5302,9 @@ function validate(editor, monaco) {
|
|
|
5461
5302
|
}
|
|
5462
5303
|
|
|
5463
5304
|
// src/components/css-code-editor/resize-handle.tsx
|
|
5464
|
-
import * as
|
|
5305
|
+
import * as React91 from "react";
|
|
5465
5306
|
var ResizeHandleComponent = ({ onResize, containerRef, onHeightChange }) => {
|
|
5466
|
-
const handleResizeMove =
|
|
5307
|
+
const handleResizeMove = React91.useCallback(
|
|
5467
5308
|
(e) => {
|
|
5468
5309
|
const container = containerRef.current;
|
|
5469
5310
|
if (!container) {
|
|
@@ -5476,11 +5317,11 @@ var ResizeHandleComponent = ({ onResize, containerRef, onHeightChange }) => {
|
|
|
5476
5317
|
},
|
|
5477
5318
|
[containerRef, onResize, onHeightChange]
|
|
5478
5319
|
);
|
|
5479
|
-
const handleResizeEnd =
|
|
5320
|
+
const handleResizeEnd = React91.useCallback(() => {
|
|
5480
5321
|
document.removeEventListener("mousemove", handleResizeMove);
|
|
5481
5322
|
document.removeEventListener("mouseup", handleResizeEnd);
|
|
5482
5323
|
}, [handleResizeMove]);
|
|
5483
|
-
const handleResizeStart =
|
|
5324
|
+
const handleResizeStart = React91.useCallback(
|
|
5484
5325
|
(e) => {
|
|
5485
5326
|
e.preventDefault();
|
|
5486
5327
|
e.stopPropagation();
|
|
@@ -5489,13 +5330,13 @@ var ResizeHandleComponent = ({ onResize, containerRef, onHeightChange }) => {
|
|
|
5489
5330
|
},
|
|
5490
5331
|
[handleResizeMove, handleResizeEnd]
|
|
5491
5332
|
);
|
|
5492
|
-
|
|
5333
|
+
React91.useEffect(() => {
|
|
5493
5334
|
return () => {
|
|
5494
5335
|
document.removeEventListener("mousemove", handleResizeMove);
|
|
5495
5336
|
document.removeEventListener("mouseup", handleResizeEnd);
|
|
5496
5337
|
};
|
|
5497
5338
|
}, [handleResizeMove, handleResizeEnd]);
|
|
5498
|
-
return /* @__PURE__ */
|
|
5339
|
+
return /* @__PURE__ */ React91.createElement(
|
|
5499
5340
|
ResizeHandle,
|
|
5500
5341
|
{
|
|
5501
5342
|
onMouseDown: handleResizeStart,
|
|
@@ -5579,21 +5420,21 @@ var createEditorDidMountHandler = (editorRef, monacoRef, debounceTimer, onChange
|
|
|
5579
5420
|
};
|
|
5580
5421
|
var CssEditor = ({ value, onChange }) => {
|
|
5581
5422
|
const theme = useTheme2();
|
|
5582
|
-
const containerRef =
|
|
5583
|
-
const editorRef =
|
|
5584
|
-
const monacoRef =
|
|
5585
|
-
const debounceTimer =
|
|
5423
|
+
const containerRef = React92.useRef(null);
|
|
5424
|
+
const editorRef = React92.useRef(null);
|
|
5425
|
+
const monacoRef = React92.useRef(null);
|
|
5426
|
+
const debounceTimer = React92.useRef(null);
|
|
5586
5427
|
const activeBreakpoint = useActiveBreakpoint2();
|
|
5587
|
-
const handleResize =
|
|
5428
|
+
const handleResize = React92.useCallback(() => {
|
|
5588
5429
|
editorRef.current?.layout();
|
|
5589
5430
|
}, []);
|
|
5590
|
-
const handleHeightChange =
|
|
5431
|
+
const handleHeightChange = React92.useCallback((height) => {
|
|
5591
5432
|
if (containerRef.current) {
|
|
5592
5433
|
containerRef.current.style.height = `${height}px`;
|
|
5593
5434
|
}
|
|
5594
5435
|
}, []);
|
|
5595
5436
|
const handleEditorDidMount = createEditorDidMountHandler(editorRef, monacoRef, debounceTimer, onChange);
|
|
5596
|
-
|
|
5437
|
+
React92.useEffect(() => {
|
|
5597
5438
|
const timerRef = debounceTimer;
|
|
5598
5439
|
return () => {
|
|
5599
5440
|
const timer = timerRef.current;
|
|
@@ -5602,7 +5443,7 @@ var CssEditor = ({ value, onChange }) => {
|
|
|
5602
5443
|
}
|
|
5603
5444
|
};
|
|
5604
5445
|
}, []);
|
|
5605
|
-
return /* @__PURE__ */
|
|
5446
|
+
return /* @__PURE__ */ React92.createElement(EditorWrapper, { ref: containerRef }, /* @__PURE__ */ React92.createElement(
|
|
5606
5447
|
Editor,
|
|
5607
5448
|
{
|
|
5608
5449
|
key: activeBreakpoint,
|
|
@@ -5623,7 +5464,7 @@ var CssEditor = ({ value, onChange }) => {
|
|
|
5623
5464
|
fixedOverflowWidgets: true
|
|
5624
5465
|
}
|
|
5625
5466
|
}
|
|
5626
|
-
), /* @__PURE__ */
|
|
5467
|
+
), /* @__PURE__ */ React92.createElement(
|
|
5627
5468
|
ResizeHandleComponent,
|
|
5628
5469
|
{
|
|
5629
5470
|
onResize: handleResize,
|