@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.js
CHANGED
|
@@ -1099,7 +1099,7 @@ var SizeControl = createControl(
|
|
|
1099
1099
|
popupState,
|
|
1100
1100
|
min
|
|
1101
1101
|
}
|
|
1102
|
-
), anchorRef?.current && /* @__PURE__ */ React18.createElement(
|
|
1102
|
+
), anchorRef?.current && popupState.isOpen && /* @__PURE__ */ React18.createElement(
|
|
1103
1103
|
TextFieldPopover,
|
|
1104
1104
|
{
|
|
1105
1105
|
popupState,
|
|
@@ -1229,11 +1229,11 @@ var StrokeControl = createControl(() => {
|
|
|
1229
1229
|
var Control = (0, import_react14.forwardRef)(({ bind, label, children }, ref) => /* @__PURE__ */ React21.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React21.createElement(import_ui16.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref }, /* @__PURE__ */ React21.createElement(import_ui16.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React21.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React21.createElement(import_ui16.Grid, { item: true, xs: 6 }, children))));
|
|
1230
1230
|
|
|
1231
1231
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1232
|
-
var
|
|
1232
|
+
var React37 = __toESM(require("react"));
|
|
1233
1233
|
var import_react18 = require("react");
|
|
1234
1234
|
var import_editor_props10 = require("@elementor/editor-props");
|
|
1235
|
-
var
|
|
1236
|
-
var
|
|
1235
|
+
var import_ui28 = require("@elementor/ui");
|
|
1236
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
1237
1237
|
|
|
1238
1238
|
// src/components/popover-content.tsx
|
|
1239
1239
|
var React22 = __toESM(require("react"));
|
|
@@ -1248,23 +1248,138 @@ var PopoverGridContainer = (0, import_react15.forwardRef)(
|
|
|
1248
1248
|
({ gap = 1.5, alignItems = "center", flexWrap = "nowrap", children }, ref) => /* @__PURE__ */ React23.createElement(import_ui18.Grid, { container: true, gap, alignItems, flexWrap, ref }, children)
|
|
1249
1249
|
);
|
|
1250
1250
|
|
|
1251
|
-
// src/components/repeater.tsx
|
|
1252
|
-
var
|
|
1253
|
-
var
|
|
1254
|
-
var import_icons5 = require("@elementor/icons");
|
|
1251
|
+
// src/components/unstable-repeater/actions/tooltip-add-item-action.tsx
|
|
1252
|
+
var React25 = __toESM(require("react"));
|
|
1253
|
+
var import_icons4 = require("@elementor/icons");
|
|
1255
1254
|
var import_ui20 = require("@elementor/ui");
|
|
1256
1255
|
var import_i18n5 = require("@wordpress/i18n");
|
|
1257
1256
|
|
|
1257
|
+
// src/components/unstable-repeater/context/repeater-context.tsx
|
|
1258
|
+
var React24 = __toESM(require("react"));
|
|
1259
|
+
var import_react16 = require("react");
|
|
1260
|
+
var import_ui19 = require("@elementor/ui");
|
|
1261
|
+
var RepeaterContext = (0, import_react16.createContext)(null);
|
|
1262
|
+
var EMPTY_OPEN_ITEM = -1;
|
|
1263
|
+
var useRepeaterContext = () => {
|
|
1264
|
+
const context = React24.useContext(RepeaterContext);
|
|
1265
|
+
if (!context) {
|
|
1266
|
+
throw new Error("useRepeaterContext must be used within a RepeaterContextProvider");
|
|
1267
|
+
}
|
|
1268
|
+
return context;
|
|
1269
|
+
};
|
|
1270
|
+
var RepeaterContextProvider = ({
|
|
1271
|
+
children,
|
|
1272
|
+
initial,
|
|
1273
|
+
propTypeUtil
|
|
1274
|
+
}) => {
|
|
1275
|
+
const { value: repeaterValues, setValue: setRepeaterValues } = useBoundProp(propTypeUtil);
|
|
1276
|
+
const [items2, setItems] = useSyncExternalState({
|
|
1277
|
+
external: repeaterValues,
|
|
1278
|
+
fallback: () => [],
|
|
1279
|
+
setExternal: setRepeaterValues,
|
|
1280
|
+
persistWhen: () => true
|
|
1281
|
+
});
|
|
1282
|
+
const [itemsWithKeys, setItemsWithKeys] = (0, import_react16.useState)(() => {
|
|
1283
|
+
return items2?.map((item) => ({ key: generateUniqueKey(), item })) ?? [];
|
|
1284
|
+
});
|
|
1285
|
+
React24.useEffect(() => {
|
|
1286
|
+
setItemsWithKeys((prevItemsWithKeys) => {
|
|
1287
|
+
const newItemsWithKeys = items2?.map((item) => {
|
|
1288
|
+
const existingItem = prevItemsWithKeys.find((i) => i.item === item);
|
|
1289
|
+
return existingItem || { key: generateUniqueKey(), item };
|
|
1290
|
+
}) ?? [];
|
|
1291
|
+
return newItemsWithKeys;
|
|
1292
|
+
});
|
|
1293
|
+
}, [items2]);
|
|
1294
|
+
const handleSetItems = (newItemsWithKeys) => {
|
|
1295
|
+
setItems(newItemsWithKeys.map(({ item }) => item));
|
|
1296
|
+
};
|
|
1297
|
+
const [openItemIndex, setOpenItemIndex] = (0, import_react16.useState)(EMPTY_OPEN_ITEM);
|
|
1298
|
+
const [rowRef, setRowRef] = (0, import_react16.useState)(null);
|
|
1299
|
+
const isOpen = openItemIndex !== EMPTY_OPEN_ITEM;
|
|
1300
|
+
const popoverState = (0, import_ui19.usePopupState)({ variant: "popover" });
|
|
1301
|
+
const addItem = (ev, config) => {
|
|
1302
|
+
const item = config?.item ?? { ...initial };
|
|
1303
|
+
const newIndex = config?.index ?? items2.length;
|
|
1304
|
+
const newItems = [...items2];
|
|
1305
|
+
newItems.splice(newIndex, 0, item);
|
|
1306
|
+
setItems(newItems);
|
|
1307
|
+
setOpenItemIndex(newIndex);
|
|
1308
|
+
popoverState.open(rowRef ?? ev);
|
|
1309
|
+
};
|
|
1310
|
+
const removeItem = (index) => {
|
|
1311
|
+
setItems(items2.filter((_, pos) => pos !== index));
|
|
1312
|
+
};
|
|
1313
|
+
const updateItem = (updatedItem, index) => {
|
|
1314
|
+
const newItems = [...items2.slice(0, index), updatedItem, ...items2.slice(index + 1)];
|
|
1315
|
+
setItems(newItems);
|
|
1316
|
+
};
|
|
1317
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1318
|
+
RepeaterContext.Provider,
|
|
1319
|
+
{
|
|
1320
|
+
value: {
|
|
1321
|
+
isOpen,
|
|
1322
|
+
openItemIndex,
|
|
1323
|
+
setOpenItemIndex,
|
|
1324
|
+
items: itemsWithKeys ?? [],
|
|
1325
|
+
setItems: handleSetItems,
|
|
1326
|
+
popoverState,
|
|
1327
|
+
initial,
|
|
1328
|
+
updateItem,
|
|
1329
|
+
addItem,
|
|
1330
|
+
removeItem,
|
|
1331
|
+
rowRef,
|
|
1332
|
+
setRowRef
|
|
1333
|
+
}
|
|
1334
|
+
},
|
|
1335
|
+
children
|
|
1336
|
+
);
|
|
1337
|
+
};
|
|
1338
|
+
var generateUniqueKey = () => {
|
|
1339
|
+
return Date.now() + Math.floor(Math.random() * 1e6);
|
|
1340
|
+
};
|
|
1341
|
+
|
|
1342
|
+
// src/components/unstable-repeater/actions/tooltip-add-item-action.tsx
|
|
1343
|
+
var SIZE2 = "tiny";
|
|
1344
|
+
var TooltipAddItemAction = ({
|
|
1345
|
+
disabled = false,
|
|
1346
|
+
enableTooltip = false,
|
|
1347
|
+
tooltipContent = null,
|
|
1348
|
+
newItemIndex
|
|
1349
|
+
}) => {
|
|
1350
|
+
const { addItem } = useRepeaterContext();
|
|
1351
|
+
const onClick = (ev) => addItem(ev, { index: newItemIndex });
|
|
1352
|
+
return /* @__PURE__ */ React25.createElement(ConditionalToolTip, { content: tooltipContent, enable: enableTooltip }, /* @__PURE__ */ React25.createElement(import_ui20.Box, { component: "span", sx: { cursor: disabled ? "not-allowed" : "pointer" } }, /* @__PURE__ */ React25.createElement(
|
|
1353
|
+
import_ui20.IconButton,
|
|
1354
|
+
{
|
|
1355
|
+
size: SIZE2,
|
|
1356
|
+
disabled,
|
|
1357
|
+
onClick,
|
|
1358
|
+
"aria-label": (0, import_i18n5.__)("Add item", "elementor")
|
|
1359
|
+
},
|
|
1360
|
+
/* @__PURE__ */ React25.createElement(import_icons4.PlusIcon, { fontSize: SIZE2 })
|
|
1361
|
+
)));
|
|
1362
|
+
};
|
|
1363
|
+
var ConditionalToolTip = ({
|
|
1364
|
+
children,
|
|
1365
|
+
enable,
|
|
1366
|
+
content
|
|
1367
|
+
}) => enable && content ? /* @__PURE__ */ React25.createElement(import_ui20.Infotip, { placement: "right", color: "secondary", content }, children) : children;
|
|
1368
|
+
|
|
1369
|
+
// src/components/unstable-repeater/header/header.tsx
|
|
1370
|
+
var React28 = __toESM(require("react"));
|
|
1371
|
+
var import_ui21 = require("@elementor/ui");
|
|
1372
|
+
|
|
1258
1373
|
// src/control-adornments/control-adornments.tsx
|
|
1259
|
-
var
|
|
1374
|
+
var React27 = __toESM(require("react"));
|
|
1260
1375
|
|
|
1261
1376
|
// src/control-adornments/control-adornments-context.tsx
|
|
1262
|
-
var
|
|
1263
|
-
var
|
|
1264
|
-
var Context2 = (0,
|
|
1265
|
-
var ControlAdornmentsProvider = ({ children, items: items2 }) => /* @__PURE__ */
|
|
1377
|
+
var React26 = __toESM(require("react"));
|
|
1378
|
+
var import_react17 = require("react");
|
|
1379
|
+
var Context2 = (0, import_react17.createContext)(null);
|
|
1380
|
+
var ControlAdornmentsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React26.createElement(Context2.Provider, { value: { items: items2 } }, children);
|
|
1266
1381
|
var useControlAdornments = () => {
|
|
1267
|
-
const context = (0,
|
|
1382
|
+
const context = (0, import_react17.useContext)(Context2);
|
|
1268
1383
|
return context?.items ?? [];
|
|
1269
1384
|
};
|
|
1270
1385
|
|
|
@@ -1274,19 +1389,35 @@ function ControlAdornments() {
|
|
|
1274
1389
|
if (items2?.length === 0) {
|
|
1275
1390
|
return null;
|
|
1276
1391
|
}
|
|
1277
|
-
return /* @__PURE__ */
|
|
1392
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, items2.map(({ Adornment, id }) => /* @__PURE__ */ React27.createElement(Adornment, { key: id })));
|
|
1278
1393
|
}
|
|
1279
1394
|
|
|
1395
|
+
// src/components/unstable-repeater/locations.ts
|
|
1396
|
+
var import_locations = require("@elementor/locations");
|
|
1397
|
+
var { Slot: RepeaterItemIconSlot, inject: injectIntoRepeaterItemIcon } = (0, import_locations.createReplaceableLocation)();
|
|
1398
|
+
var { Slot: RepeaterItemLabelSlot, inject: injectIntoRepeaterItemLabel } = (0, import_locations.createReplaceableLocation)();
|
|
1399
|
+
var { Slot: RepeaterHeaderActionsSlot, inject: injectIntoRepeaterHeaderActions } = (0, import_locations.createLocation)();
|
|
1400
|
+
var { Slot: RepeaterItemActionsSlot, inject: injectIntoRepeaterItemActions } = (0, import_locations.createLocation)();
|
|
1401
|
+
|
|
1402
|
+
// src/components/unstable-repeater/header/header.tsx
|
|
1403
|
+
var Header = React28.forwardRef(({ label, children }, ref) => {
|
|
1404
|
+
const { value } = useBoundProp();
|
|
1405
|
+
return /* @__PURE__ */ React28.createElement(import_ui21.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { marginInlineEnd: -0.75, py: 0.25 }, ref }, /* @__PURE__ */ React28.createElement(import_ui21.Box, { display: "flex", alignItems: "center", gap: 1, sx: { flexGrow: 1 } }, /* @__PURE__ */ React28.createElement(import_ui21.Typography, { 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));
|
|
1406
|
+
});
|
|
1407
|
+
|
|
1408
|
+
// src/components/unstable-repeater/items/items-container.tsx
|
|
1409
|
+
var React30 = __toESM(require("react"));
|
|
1410
|
+
|
|
1280
1411
|
// src/components/sortable.tsx
|
|
1281
|
-
var
|
|
1282
|
-
var
|
|
1283
|
-
var
|
|
1412
|
+
var React29 = __toESM(require("react"));
|
|
1413
|
+
var import_icons5 = require("@elementor/icons");
|
|
1414
|
+
var import_ui22 = require("@elementor/ui");
|
|
1284
1415
|
var SortableProvider = (props) => {
|
|
1285
|
-
return /* @__PURE__ */
|
|
1416
|
+
return /* @__PURE__ */ React29.createElement(import_ui22.List, { sx: { p: 0, my: -0.5, mx: 0 } }, /* @__PURE__ */ React29.createElement(import_ui22.UnstableSortableProvider, { restrictAxis: true, disableDragOverlay: false, variant: "static", ...props }));
|
|
1286
1417
|
};
|
|
1287
1418
|
var SortableItem = ({ id, children, disabled }) => {
|
|
1288
|
-
return /* @__PURE__ */
|
|
1289
|
-
|
|
1419
|
+
return /* @__PURE__ */ React29.createElement(
|
|
1420
|
+
import_ui22.UnstableSortableItem,
|
|
1290
1421
|
{
|
|
1291
1422
|
id,
|
|
1292
1423
|
disabled,
|
|
@@ -1298,12 +1429,12 @@ var SortableItem = ({ id, children, disabled }) => {
|
|
|
1298
1429
|
showDropIndication,
|
|
1299
1430
|
dropIndicationStyle
|
|
1300
1431
|
}) => {
|
|
1301
|
-
return /* @__PURE__ */
|
|
1432
|
+
return /* @__PURE__ */ React29.createElement(StyledListItem, { ...itemProps, style: itemStyle }, !disabled && /* @__PURE__ */ React29.createElement(SortableTrigger, { ...triggerProps, style: triggerStyle }), children, showDropIndication && /* @__PURE__ */ React29.createElement(StyledDivider, { style: dropIndicationStyle }));
|
|
1302
1433
|
}
|
|
1303
1434
|
}
|
|
1304
1435
|
);
|
|
1305
1436
|
};
|
|
1306
|
-
var StyledListItem = (0,
|
|
1437
|
+
var StyledListItem = (0, import_ui22.styled)(import_ui22.ListItem)`
|
|
1307
1438
|
position: relative;
|
|
1308
1439
|
margin-inline: 0px;
|
|
1309
1440
|
padding-inline: 0px;
|
|
@@ -1332,8 +1463,8 @@ var StyledListItem = (0, import_ui19.styled)(import_ui19.ListItem)`
|
|
|
1332
1463
|
}
|
|
1333
1464
|
}
|
|
1334
1465
|
`;
|
|
1335
|
-
var SortableTrigger = (props) => /* @__PURE__ */
|
|
1336
|
-
var StyledDivider = (0,
|
|
1466
|
+
var SortableTrigger = (props) => /* @__PURE__ */ React29.createElement("div", { ...props, role: "button", className: "class-item-sortable-trigger" }, /* @__PURE__ */ React29.createElement(import_icons5.GripVerticalIcon, { fontSize: "tiny" }));
|
|
1467
|
+
var StyledDivider = (0, import_ui22.styled)(import_ui22.Divider)`
|
|
1337
1468
|
height: 0px;
|
|
1338
1469
|
border: none;
|
|
1339
1470
|
overflow: visible;
|
|
@@ -1350,252 +1481,224 @@ var StyledDivider = (0, import_ui19.styled)(import_ui19.Divider)`
|
|
|
1350
1481
|
}
|
|
1351
1482
|
`;
|
|
1352
1483
|
|
|
1353
|
-
// src/components/unstable-repeater/
|
|
1354
|
-
var
|
|
1355
|
-
|
|
1356
|
-
var { Slot: RepeaterItemLabelSlot, inject: injectIntoRepeaterItemLabel } = (0, import_locations.createReplaceableLocation)();
|
|
1357
|
-
var { Slot: RepeaterHeaderActionsSlot, inject: injectIntoRepeaterHeaderActions } = (0, import_locations.createLocation)();
|
|
1358
|
-
var { Slot: RepeaterItemActionsSlot, inject: injectIntoRepeaterItemActions } = (0, import_locations.createLocation)();
|
|
1359
|
-
|
|
1360
|
-
// src/components/repeater.tsx
|
|
1361
|
-
var SIZE2 = "tiny";
|
|
1362
|
-
var EMPTY_OPEN_ITEM = -1;
|
|
1363
|
-
var Repeater = ({
|
|
1364
|
-
label,
|
|
1365
|
-
itemSettings,
|
|
1366
|
-
disabled = false,
|
|
1367
|
-
openOnAdd = false,
|
|
1368
|
-
addToBottom = false,
|
|
1369
|
-
values: repeaterValues = [],
|
|
1370
|
-
setValues: setRepeaterValues,
|
|
1371
|
-
showDuplicate = true,
|
|
1372
|
-
showToggle = true,
|
|
1484
|
+
// src/components/unstable-repeater/items/items-container.tsx
|
|
1485
|
+
var ItemsContainer = ({
|
|
1486
|
+
itemTemplate,
|
|
1373
1487
|
isSortable = true,
|
|
1374
|
-
|
|
1488
|
+
children
|
|
1375
1489
|
}) => {
|
|
1376
|
-
const
|
|
1377
|
-
const
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
});
|
|
1383
|
-
const [uniqueKeys, setUniqueKeys] = (0, import_react17.useState)(items2.map((_, index) => index));
|
|
1384
|
-
const generateNextKey = (source) => {
|
|
1385
|
-
return 1 + Math.max(0, ...source);
|
|
1386
|
-
};
|
|
1387
|
-
const addRepeaterItem = () => {
|
|
1388
|
-
const newItem = structuredClone(itemSettings.initialValues);
|
|
1389
|
-
const newKey = generateNextKey(uniqueKeys);
|
|
1390
|
-
if (addToBottom) {
|
|
1391
|
-
setItems([...items2, newItem]);
|
|
1392
|
-
setUniqueKeys([...uniqueKeys, newKey]);
|
|
1393
|
-
} else {
|
|
1394
|
-
setItems([newItem, ...items2]);
|
|
1395
|
-
setUniqueKeys([newKey, ...uniqueKeys]);
|
|
1396
|
-
}
|
|
1397
|
-
if (openOnAdd) {
|
|
1398
|
-
setOpenItem(newKey);
|
|
1399
|
-
}
|
|
1400
|
-
};
|
|
1401
|
-
const duplicateRepeaterItem = (index) => {
|
|
1402
|
-
const newItem = structuredClone(items2[index]);
|
|
1403
|
-
const newKey = generateNextKey(uniqueKeys);
|
|
1404
|
-
const atPosition = 1 + index;
|
|
1405
|
-
setItems([...items2.slice(0, atPosition), newItem, ...items2.slice(atPosition)]);
|
|
1406
|
-
setUniqueKeys([...uniqueKeys.slice(0, atPosition), newKey, ...uniqueKeys.slice(atPosition)]);
|
|
1407
|
-
};
|
|
1408
|
-
const removeRepeaterItem = (index) => {
|
|
1409
|
-
setUniqueKeys(
|
|
1410
|
-
uniqueKeys.filter((_, pos) => {
|
|
1411
|
-
return pos !== index;
|
|
1412
|
-
})
|
|
1413
|
-
);
|
|
1414
|
-
setItems(
|
|
1415
|
-
items2.filter((_, pos) => {
|
|
1416
|
-
return pos !== index;
|
|
1417
|
-
})
|
|
1418
|
-
);
|
|
1419
|
-
};
|
|
1420
|
-
const toggleDisableRepeaterItem = (index) => {
|
|
1490
|
+
const { items: items2, setItems } = useRepeaterContext();
|
|
1491
|
+
const keys = items2.map(({ key }) => key);
|
|
1492
|
+
if (!itemTemplate) {
|
|
1493
|
+
return null;
|
|
1494
|
+
}
|
|
1495
|
+
const onChangeOrder = (newKeys) => {
|
|
1421
1496
|
setItems(
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
return { ...rest, ...propDisabled ? {} : { disabled: true } };
|
|
1426
|
-
}
|
|
1427
|
-
return value;
|
|
1497
|
+
newKeys.map((key) => {
|
|
1498
|
+
const index = items2.findIndex((item) => item.key === key);
|
|
1499
|
+
return items2[index];
|
|
1428
1500
|
})
|
|
1429
1501
|
);
|
|
1430
1502
|
};
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
});
|
|
1439
|
-
};
|
|
1440
|
-
return /* @__PURE__ */ React27.createElement(SectionContent, null, /* @__PURE__ */ React27.createElement(
|
|
1441
|
-
import_ui20.Stack,
|
|
1442
|
-
{
|
|
1443
|
-
direction: "row",
|
|
1444
|
-
justifyContent: "start",
|
|
1445
|
-
alignItems: "center",
|
|
1446
|
-
gap: 1,
|
|
1447
|
-
sx: { marginInlineEnd: -0.75 }
|
|
1448
|
-
},
|
|
1449
|
-
/* @__PURE__ */ React27.createElement(import_ui20.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label),
|
|
1450
|
-
/* @__PURE__ */ React27.createElement(ControlAdornments, null),
|
|
1451
|
-
/* @__PURE__ */ React27.createElement(
|
|
1452
|
-
import_ui20.IconButton,
|
|
1453
|
-
{
|
|
1454
|
-
size: SIZE2,
|
|
1455
|
-
sx: { ml: "auto" },
|
|
1456
|
-
disabled,
|
|
1457
|
-
onClick: addRepeaterItem,
|
|
1458
|
-
"aria-label": (0, import_i18n5.__)("Add item", "elementor")
|
|
1459
|
-
},
|
|
1460
|
-
/* @__PURE__ */ React27.createElement(import_icons5.PlusIcon, { fontSize: SIZE2 })
|
|
1461
|
-
)
|
|
1462
|
-
), 0 < uniqueKeys.length && /* @__PURE__ */ React27.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key, index) => {
|
|
1463
|
-
const value = items2[index];
|
|
1464
|
-
if (!value) {
|
|
1465
|
-
return null;
|
|
1466
|
-
}
|
|
1467
|
-
return /* @__PURE__ */ React27.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React27.createElement(
|
|
1468
|
-
RepeaterItem,
|
|
1469
|
-
{
|
|
1470
|
-
disabled,
|
|
1471
|
-
propDisabled: value?.disabled,
|
|
1472
|
-
label: /* @__PURE__ */ React27.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React27.createElement(itemSettings.Label, { value })),
|
|
1473
|
-
startIcon: /* @__PURE__ */ React27.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React27.createElement(itemSettings.Icon, { value })),
|
|
1474
|
-
removeItem: () => removeRepeaterItem(index),
|
|
1475
|
-
duplicateItem: () => duplicateRepeaterItem(index),
|
|
1476
|
-
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
1477
|
-
openOnMount: openOnAdd && openItem === key,
|
|
1478
|
-
onOpen: () => setOpenItem(EMPTY_OPEN_ITEM),
|
|
1479
|
-
showDuplicate,
|
|
1480
|
-
showToggle,
|
|
1481
|
-
collectionPropUtil
|
|
1482
|
-
},
|
|
1483
|
-
(props) => /* @__PURE__ */ React27.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
1484
|
-
));
|
|
1503
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(SortableProvider, { value: keys, onChange: onChangeOrder }, keys.map((key, index) => {
|
|
1504
|
+
const value = items2[index].item;
|
|
1505
|
+
return /* @__PURE__ */ React30.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, React30.isValidElement(itemTemplate) ? React30.cloneElement(itemTemplate, {
|
|
1506
|
+
key,
|
|
1507
|
+
value,
|
|
1508
|
+
index,
|
|
1509
|
+
children
|
|
1510
|
+
}) : null);
|
|
1485
1511
|
})));
|
|
1486
1512
|
};
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
const
|
|
1505
|
-
const toggleLabel = propDisabled ? (0,
|
|
1506
|
-
const
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
{
|
|
1510
|
-
disabled
|
|
1511
|
-
label,
|
|
1512
|
-
showActionsOnHover: true,
|
|
1513
|
-
fullWidth: true,
|
|
1514
|
-
ref: setRef,
|
|
1515
|
-
variant: "outlined",
|
|
1516
|
-
"aria-label": (0, import_i18n5.__)("Open item", "elementor"),
|
|
1517
|
-
...(0, import_ui20.bindTrigger)(popoverState),
|
|
1518
|
-
startIcon,
|
|
1519
|
-
actions: /* @__PURE__ */ React27.createElement(React27.Fragment, null, showDuplicate && /* @__PURE__ */ React27.createElement(import_ui20.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React27.createElement(import_ui20.IconButton, { size: SIZE2, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React27.createElement(import_icons5.CopyIcon, { fontSize: SIZE2 }))), showToggle && /* @__PURE__ */ React27.createElement(import_ui20.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React27.createElement(import_ui20.IconButton, { size: SIZE2, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React27.createElement(import_icons5.EyeOffIcon, { fontSize: SIZE2 }) : /* @__PURE__ */ React27.createElement(import_icons5.EyeIcon, { fontSize: SIZE2 }))), /* @__PURE__ */ React27.createElement(import_ui20.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React27.createElement(import_ui20.IconButton, { size: SIZE2, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React27.createElement(import_icons5.XIcon, { fontSize: SIZE2 }))))
|
|
1520
|
-
}
|
|
1521
|
-
), /* @__PURE__ */ React27.createElement(
|
|
1522
|
-
import_ui20.Popover,
|
|
1523
|
-
{
|
|
1524
|
-
disablePortal: true,
|
|
1525
|
-
slotProps: {
|
|
1526
|
-
paper: {
|
|
1527
|
-
ref: setAnchorEl,
|
|
1528
|
-
sx: { mt: 0.5, width: ref?.getBoundingClientRect().width }
|
|
1529
|
-
}
|
|
1530
|
-
},
|
|
1531
|
-
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1532
|
-
...popoverProps,
|
|
1533
|
-
anchorEl: ref
|
|
1534
|
-
},
|
|
1535
|
-
/* @__PURE__ */ React27.createElement(import_ui20.Box, null, children({ anchorEl, collectionPropUtil }))
|
|
1536
|
-
));
|
|
1537
|
-
};
|
|
1538
|
-
var usePopover = (openOnMount, onOpen) => {
|
|
1539
|
-
const [ref, setRef] = (0, import_react17.useState)(null);
|
|
1540
|
-
const popoverState = (0, import_ui20.usePopupState)({ variant: "popover" });
|
|
1541
|
-
const popoverProps = (0, import_ui20.bindPopover)(popoverState);
|
|
1542
|
-
(0, import_react17.useEffect)(() => {
|
|
1543
|
-
if (openOnMount && ref) {
|
|
1544
|
-
popoverState.open(ref);
|
|
1545
|
-
onOpen?.();
|
|
1513
|
+
|
|
1514
|
+
// src/components/unstable-repeater/items/item.tsx
|
|
1515
|
+
var React34 = __toESM(require("react"));
|
|
1516
|
+
var import_ui26 = require("@elementor/ui");
|
|
1517
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
1518
|
+
|
|
1519
|
+
// src/components/unstable-repeater/actions/disable-item-action.tsx
|
|
1520
|
+
var React31 = __toESM(require("react"));
|
|
1521
|
+
var import_icons6 = require("@elementor/icons");
|
|
1522
|
+
var import_ui23 = require("@elementor/ui");
|
|
1523
|
+
var import_i18n6 = require("@wordpress/i18n");
|
|
1524
|
+
var SIZE3 = "tiny";
|
|
1525
|
+
var DisableItemAction = ({ index = -1 }) => {
|
|
1526
|
+
const { items: items2, updateItem } = useRepeaterContext();
|
|
1527
|
+
if (index === -1) {
|
|
1528
|
+
return null;
|
|
1529
|
+
}
|
|
1530
|
+
const propDisabled = items2[index].item.disabled ?? false;
|
|
1531
|
+
const toggleLabel = propDisabled ? (0, import_i18n6.__)("Show", "elementor") : (0, import_i18n6.__)("Hide", "elementor");
|
|
1532
|
+
const onClick = () => {
|
|
1533
|
+
const self = structuredClone(items2[index].item);
|
|
1534
|
+
self.disabled = !self.disabled;
|
|
1535
|
+
if (!self.disabled) {
|
|
1536
|
+
delete self.disabled;
|
|
1546
1537
|
}
|
|
1547
|
-
|
|
1548
|
-
return {
|
|
1549
|
-
popoverState,
|
|
1550
|
-
ref,
|
|
1551
|
-
setRef,
|
|
1552
|
-
popoverProps
|
|
1538
|
+
updateItem(self, index);
|
|
1553
1539
|
};
|
|
1540
|
+
return /* @__PURE__ */ React31.createElement(import_ui23.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React31.createElement(import_ui23.IconButton, { size: SIZE3, onClick, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React31.createElement(import_icons6.EyeOffIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React31.createElement(import_icons6.EyeIcon, { fontSize: SIZE3 })));
|
|
1554
1541
|
};
|
|
1555
1542
|
|
|
1556
|
-
// src/
|
|
1557
|
-
var
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1543
|
+
// src/components/unstable-repeater/actions/duplicate-item-action.tsx
|
|
1544
|
+
var React32 = __toESM(require("react"));
|
|
1545
|
+
var import_icons7 = require("@elementor/icons");
|
|
1546
|
+
var import_ui24 = require("@elementor/ui");
|
|
1547
|
+
var import_i18n7 = require("@wordpress/i18n");
|
|
1548
|
+
var SIZE4 = "tiny";
|
|
1549
|
+
var DuplicateItemAction = ({ index = -1 }) => {
|
|
1550
|
+
const { items: items2, addItem } = useRepeaterContext();
|
|
1551
|
+
if (index === -1) {
|
|
1552
|
+
return null;
|
|
1553
|
+
}
|
|
1554
|
+
const duplicateLabel = (0, import_i18n7.__)("Duplicate", "elementor");
|
|
1555
|
+
const onClick = (ev) => {
|
|
1556
|
+
const newItem = structuredClone(items2[index]?.item);
|
|
1557
|
+
addItem(ev, { item: newItem, index: index + 1 });
|
|
1558
|
+
};
|
|
1559
|
+
return /* @__PURE__ */ React32.createElement(import_ui24.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React32.createElement(import_ui24.IconButton, { size: SIZE4, onClick, "aria-label": duplicateLabel }, /* @__PURE__ */ React32.createElement(import_icons7.CopyIcon, { fontSize: SIZE4 })));
|
|
1560
|
+
};
|
|
1561
|
+
|
|
1562
|
+
// src/components/unstable-repeater/actions/remove-item-action.tsx
|
|
1563
|
+
var React33 = __toESM(require("react"));
|
|
1564
|
+
var import_icons8 = require("@elementor/icons");
|
|
1565
|
+
var import_ui25 = require("@elementor/ui");
|
|
1566
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
1567
|
+
var SIZE5 = "tiny";
|
|
1568
|
+
var RemoveItemAction = ({ index = -1 }) => {
|
|
1569
|
+
const { removeItem } = useRepeaterContext();
|
|
1570
|
+
if (index === -1) {
|
|
1571
|
+
return null;
|
|
1572
|
+
}
|
|
1573
|
+
const removeLabel = (0, import_i18n8.__)("Remove", "elementor");
|
|
1574
|
+
const onClick = () => removeItem(index);
|
|
1575
|
+
return /* @__PURE__ */ React33.createElement(import_ui25.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React33.createElement(import_ui25.IconButton, { size: SIZE5, onClick, "aria-label": removeLabel }, /* @__PURE__ */ React33.createElement(import_icons8.XIcon, { fontSize: SIZE5 })));
|
|
1576
|
+
};
|
|
1577
|
+
|
|
1578
|
+
// src/components/unstable-repeater/items/item.tsx
|
|
1579
|
+
var Item = ({
|
|
1580
|
+
Label: Label3,
|
|
1581
|
+
Icon,
|
|
1582
|
+
value,
|
|
1583
|
+
index = -1,
|
|
1584
|
+
children
|
|
1585
|
+
}) => {
|
|
1586
|
+
const { items: items2, popoverState, setRowRef, openItemIndex, setOpenItemIndex } = useRepeaterContext();
|
|
1587
|
+
const triggerProps = (0, import_ui26.bindTrigger)(popoverState);
|
|
1588
|
+
const key = items2[index].key ?? -1;
|
|
1589
|
+
const onClick = (ev) => {
|
|
1590
|
+
triggerProps.onClick(ev);
|
|
1591
|
+
setOpenItemIndex(index);
|
|
1592
|
+
};
|
|
1593
|
+
const setRef = (ref) => {
|
|
1594
|
+
if (!ref || openItemIndex !== index || ref === popoverState.anchorEl) {
|
|
1595
|
+
return;
|
|
1596
|
+
}
|
|
1597
|
+
setRowRef(ref);
|
|
1598
|
+
popoverState.setAnchorEl(ref);
|
|
1599
|
+
};
|
|
1600
|
+
return /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(
|
|
1601
|
+
import_ui26.UnstableTag,
|
|
1561
1602
|
{
|
|
1562
|
-
|
|
1563
|
-
disabled,
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1603
|
+
key,
|
|
1604
|
+
disabled: false,
|
|
1605
|
+
label: /* @__PURE__ */ React34.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React34.createElement(Label3, { value })),
|
|
1606
|
+
showActionsOnHover: true,
|
|
1607
|
+
fullWidth: true,
|
|
1608
|
+
ref: setRef,
|
|
1609
|
+
variant: "outlined",
|
|
1610
|
+
"aria-label": (0, import_i18n9.__)("Open item", "elementor"),
|
|
1611
|
+
sx: { minHeight: (theme) => theme.spacing(4) },
|
|
1612
|
+
...triggerProps,
|
|
1613
|
+
onClick,
|
|
1614
|
+
startIcon: /* @__PURE__ */ React34.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React34.createElement(Icon, { value })),
|
|
1615
|
+
actions: /* @__PURE__ */ React34.createElement(React34.Fragment, null, /* @__PURE__ */ React34.createElement(RepeaterItemActionsSlot, { index: index ?? -1 }), /* @__PURE__ */ React34.createElement(
|
|
1616
|
+
SlotChildren,
|
|
1617
|
+
{
|
|
1618
|
+
whitelist: [DuplicateItemAction, DisableItemAction, RemoveItemAction],
|
|
1619
|
+
props: { index },
|
|
1620
|
+
sorted: true
|
|
1621
|
+
},
|
|
1622
|
+
children
|
|
1623
|
+
))
|
|
1573
1624
|
}
|
|
1574
1625
|
));
|
|
1575
|
-
});
|
|
1576
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */ React28.createElement(import_ui21.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color?.value });
|
|
1577
|
-
var ItemContent = ({ anchorEl, bind }) => {
|
|
1578
|
-
return /* @__PURE__ */ React28.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React28.createElement(Content, { anchorEl }));
|
|
1579
1626
|
};
|
|
1580
|
-
|
|
1627
|
+
|
|
1628
|
+
// src/components/unstable-repeater/unstable-repeater.tsx
|
|
1629
|
+
var React36 = __toESM(require("react"));
|
|
1630
|
+
|
|
1631
|
+
// src/components/unstable-repeater/items/edit-item-popover.tsx
|
|
1632
|
+
var React35 = __toESM(require("react"));
|
|
1633
|
+
var import_ui27 = require("@elementor/ui");
|
|
1634
|
+
var EditItemPopover = ({ children }) => {
|
|
1635
|
+
const { popoverState, openItemIndex, isOpen, rowRef, setOpenItemIndex, setRowRef, items: items2 } = useRepeaterContext();
|
|
1636
|
+
if (!isOpen || !rowRef) {
|
|
1637
|
+
return null;
|
|
1638
|
+
}
|
|
1639
|
+
const bind = items2[openItemIndex].item.$$type;
|
|
1640
|
+
const onClose = () => {
|
|
1641
|
+
setRowRef(null);
|
|
1642
|
+
popoverState.setAnchorEl(null);
|
|
1643
|
+
setOpenItemIndex(EMPTY_OPEN_ITEM);
|
|
1644
|
+
};
|
|
1645
|
+
return /* @__PURE__ */ React35.createElement(
|
|
1646
|
+
import_ui27.Popover,
|
|
1647
|
+
{
|
|
1648
|
+
disablePortal: true,
|
|
1649
|
+
slotProps: {
|
|
1650
|
+
paper: {
|
|
1651
|
+
sx: { mt: 0.5, width: rowRef.offsetWidth }
|
|
1652
|
+
}
|
|
1653
|
+
},
|
|
1654
|
+
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1655
|
+
...(0, import_ui27.bindPopover)(popoverState),
|
|
1656
|
+
onClose
|
|
1657
|
+
},
|
|
1658
|
+
/* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: String(openItemIndex) }, /* @__PURE__ */ React35.createElement(import_ui27.Box, null, React35.isValidElement(children) && React35.cloneElement(children, { bind, index: openItemIndex })))
|
|
1659
|
+
);
|
|
1660
|
+
};
|
|
1661
|
+
|
|
1662
|
+
// src/components/unstable-repeater/unstable-repeater.tsx
|
|
1663
|
+
var UnstableRepeater = ({
|
|
1664
|
+
children,
|
|
1665
|
+
initial,
|
|
1666
|
+
propTypeUtil
|
|
1667
|
+
}) => {
|
|
1668
|
+
return /* @__PURE__ */ React36.createElement(SectionContent, null, /* @__PURE__ */ React36.createElement(RepeaterContextProvider, { initial, propTypeUtil }, /* @__PURE__ */ React36.createElement(SlotChildren, { whitelist: [Header, ItemsContainer, EditItemPopover], sorted: true }, children)));
|
|
1669
|
+
};
|
|
1670
|
+
|
|
1671
|
+
// src/controls/box-shadow-repeater-control.tsx
|
|
1672
|
+
var BoxShadowRepeaterControl = createControl(() => {
|
|
1673
|
+
const { propType, value, setValue, disabled } = useBoundProp(import_editor_props10.boxShadowPropTypeUtil);
|
|
1674
|
+
return /* @__PURE__ */ React37.createElement(PropProvider, { propType, value, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React37.createElement(UnstableRepeater, { initial: initialShadow, propTypeUtil: import_editor_props10.boxShadowPropTypeUtil }, /* @__PURE__ */ React37.createElement(Header, { label: (0, import_i18n10.__)("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))));
|
|
1675
|
+
});
|
|
1676
|
+
var StyledUnstableColorIndicator = (0, import_ui28.styled)(import_ui28.UnstableColorIndicator)(({ theme }) => ({
|
|
1677
|
+
height: "1rem",
|
|
1678
|
+
width: "1rem",
|
|
1679
|
+
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
1680
|
+
}));
|
|
1681
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React37.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color?.value });
|
|
1682
|
+
var Content = () => {
|
|
1581
1683
|
const context = useBoundProp(import_editor_props10.shadowPropTypeUtil);
|
|
1582
1684
|
const rowRef = [(0, import_react18.useRef)(null), (0, import_react18.useRef)(null)];
|
|
1583
|
-
|
|
1685
|
+
const { rowRef: anchorEl } = useRepeaterContext();
|
|
1686
|
+
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: (0, import_i18n10.__)("Color", "elementor") }, /* @__PURE__ */ React37.createElement(ColorControl, { anchorEl })), /* @__PURE__ */ React37.createElement(Control2, { bind: "position", label: (0, import_i18n10.__)("Position", "elementor"), sx: { overflow: "hidden" } }, /* @__PURE__ */ React37.createElement(
|
|
1584
1687
|
SelectControl,
|
|
1585
1688
|
{
|
|
1586
1689
|
options: [
|
|
1587
|
-
{ label: (0,
|
|
1588
|
-
{ label: (0,
|
|
1690
|
+
{ label: (0, import_i18n10.__)("Inset", "elementor"), value: "inset" },
|
|
1691
|
+
{ label: (0, import_i18n10.__)("Outset", "elementor"), value: null }
|
|
1589
1692
|
]
|
|
1590
1693
|
}
|
|
1591
|
-
))), /* @__PURE__ */
|
|
1694
|
+
))), /* @__PURE__ */ React37.createElement(PopoverGridContainer, { ref: rowRef[0] }, /* @__PURE__ */ React37.createElement(Control2, { bind: "hOffset", label: (0, import_i18n10.__)("Horizontal", "elementor") }, /* @__PURE__ */ React37.createElement(SizeControl, { anchorRef: rowRef[0] })), /* @__PURE__ */ React37.createElement(Control2, { bind: "vOffset", label: (0, import_i18n10.__)("Vertical", "elementor") }, /* @__PURE__ */ React37.createElement(SizeControl, { anchorRef: rowRef[0] }))), /* @__PURE__ */ React37.createElement(PopoverGridContainer, { ref: rowRef[1] }, /* @__PURE__ */ React37.createElement(Control2, { bind: "blur", label: (0, import_i18n10.__)("Blur", "elementor") }, /* @__PURE__ */ React37.createElement(SizeControl, { anchorRef: rowRef[1] })), /* @__PURE__ */ React37.createElement(Control2, { bind: "spread", label: (0, import_i18n10.__)("Spread", "elementor") }, /* @__PURE__ */ React37.createElement(SizeControl, { anchorRef: rowRef[1] })))));
|
|
1592
1695
|
};
|
|
1593
1696
|
var Control2 = ({
|
|
1594
1697
|
label,
|
|
1595
1698
|
bind,
|
|
1596
1699
|
children,
|
|
1597
1700
|
sx
|
|
1598
|
-
}) => /* @__PURE__ */
|
|
1701
|
+
}) => /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React37.createElement(import_ui28.Grid, { item: true, xs: 6, sx }, /* @__PURE__ */ React37.createElement(import_ui28.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React37.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(import_ui28.FormLabel, { size: "tiny" }, label)), /* @__PURE__ */ React37.createElement(import_ui28.Grid, { item: true, xs: 12 }, children))));
|
|
1599
1702
|
var ItemLabel = ({ value }) => {
|
|
1600
1703
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
1601
1704
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -1609,7 +1712,7 @@ var ItemLabel = ({ value }) => {
|
|
|
1609
1712
|
blurSize + blurUnit,
|
|
1610
1713
|
spreadSize + spreadUnit
|
|
1611
1714
|
].join(" ");
|
|
1612
|
-
return /* @__PURE__ */
|
|
1715
|
+
return /* @__PURE__ */ React37.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
1613
1716
|
};
|
|
1614
1717
|
var initialShadow = {
|
|
1615
1718
|
$$type: "shadow",
|
|
@@ -1638,292 +1741,343 @@ var initialShadow = {
|
|
|
1638
1741
|
}
|
|
1639
1742
|
};
|
|
1640
1743
|
|
|
1641
|
-
// src/controls/filter-repeater-control.tsx
|
|
1642
|
-
var
|
|
1643
|
-
var
|
|
1644
|
-
var
|
|
1645
|
-
var import_editor_props13 = require("@elementor/editor-props");
|
|
1646
|
-
var import_ui24 = require("@elementor/ui");
|
|
1647
|
-
var import_i18n8 = require("@wordpress/i18n");
|
|
1744
|
+
// src/controls/filter-control/filter-repeater-control.tsx
|
|
1745
|
+
var React46 = __toESM(require("react"));
|
|
1746
|
+
var import_editor_props15 = require("@elementor/editor-props");
|
|
1747
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
1648
1748
|
|
|
1649
|
-
// src/controls/filter-control/
|
|
1650
|
-
var
|
|
1749
|
+
// src/controls/filter-control/context/filter-config-context.tsx
|
|
1750
|
+
var React38 = __toESM(require("react"));
|
|
1651
1751
|
var import_react19 = require("react");
|
|
1652
1752
|
var import_editor_props11 = require("@elementor/editor-props");
|
|
1653
|
-
|
|
1654
|
-
|
|
1753
|
+
|
|
1754
|
+
// src/controls/filter-control/utils.ts
|
|
1755
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
1756
|
+
|
|
1757
|
+
// src/controls/filter-control/configs.ts
|
|
1758
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
1759
|
+
var FILTERS_BY_GROUP = {
|
|
1760
|
+
blur: {
|
|
1761
|
+
blur: {
|
|
1762
|
+
name: (0, import_i18n11.__)("Blur", "elementor"),
|
|
1763
|
+
valueName: (0, import_i18n11.__)("Radius", "elementor")
|
|
1764
|
+
}
|
|
1765
|
+
},
|
|
1766
|
+
intensity: {
|
|
1767
|
+
brightness: { name: (0, import_i18n11.__)("Brightness", "elementor") },
|
|
1768
|
+
contrast: { name: (0, import_i18n11.__)("Contrast", "elementor") },
|
|
1769
|
+
saturate: { name: (0, import_i18n11.__)("Saturate", "elementor") }
|
|
1770
|
+
},
|
|
1771
|
+
"hue-rotate": {
|
|
1772
|
+
"hue-rotate": {
|
|
1773
|
+
name: (0, import_i18n11.__)("Hue Rotate", "elementor"),
|
|
1774
|
+
valueName: (0, import_i18n11.__)("Angle", "elementor")
|
|
1775
|
+
}
|
|
1776
|
+
},
|
|
1777
|
+
"color-tone": {
|
|
1778
|
+
grayscale: { name: (0, import_i18n11.__)("Grayscale", "elementor") },
|
|
1779
|
+
invert: { name: (0, import_i18n11.__)("Invert", "elementor") },
|
|
1780
|
+
sepia: { name: (0, import_i18n11.__)("Sepia", "elementor") }
|
|
1781
|
+
},
|
|
1782
|
+
"drop-shadow": {
|
|
1783
|
+
"drop-shadow": { name: (0, import_i18n11.__)("Drop shadow", "elementor"), valueName: (0, import_i18n11.__)("Drop-shadow", "elementor") }
|
|
1784
|
+
}
|
|
1785
|
+
};
|
|
1786
|
+
|
|
1787
|
+
// src/controls/filter-control/utils.ts
|
|
1788
|
+
var AMOUNT_VALUE_NAME = (0, import_i18n12.__)("Amount", "elementor");
|
|
1789
|
+
var DEFAULT_FACTORIES = {
|
|
1790
|
+
"drop-shadow": (propType) => buildDropShadowDefault(propType)
|
|
1791
|
+
};
|
|
1792
|
+
function buildFilterConfig(cssFilterPropType) {
|
|
1793
|
+
function createEntry(filterFunctionGroup, filterFunction, { name, valueName }) {
|
|
1794
|
+
const propType = extractPropType(cssFilterPropType, filterFunctionGroup);
|
|
1795
|
+
const value = DEFAULT_FACTORIES[filterFunction]?.(propType) ?? buildSizeDefault(propType);
|
|
1796
|
+
const defaultValue = createDefaultValue({
|
|
1797
|
+
filterFunction,
|
|
1798
|
+
filterFunctionGroup,
|
|
1799
|
+
value
|
|
1800
|
+
});
|
|
1801
|
+
return [
|
|
1802
|
+
filterFunction,
|
|
1803
|
+
{
|
|
1804
|
+
name,
|
|
1805
|
+
valueName: valueName ?? AMOUNT_VALUE_NAME,
|
|
1806
|
+
defaultValue,
|
|
1807
|
+
filterFunctionGroup
|
|
1808
|
+
}
|
|
1809
|
+
];
|
|
1810
|
+
}
|
|
1811
|
+
const entries = Object.entries(FILTERS_BY_GROUP).flatMap(
|
|
1812
|
+
([filterFunctionGroup, group]) => Object.entries(group).map(
|
|
1813
|
+
([filterFunction, meta]) => createEntry(filterFunctionGroup, filterFunction, meta)
|
|
1814
|
+
)
|
|
1815
|
+
);
|
|
1816
|
+
return Object.fromEntries(entries);
|
|
1817
|
+
}
|
|
1818
|
+
function createDefaultValue({ filterFunction, filterFunctionGroup, value }) {
|
|
1819
|
+
return {
|
|
1820
|
+
$$type: "css-filter-func",
|
|
1821
|
+
value: {
|
|
1822
|
+
func: { $$type: "string", value: filterFunction },
|
|
1823
|
+
args: {
|
|
1824
|
+
$$type: filterFunctionGroup,
|
|
1825
|
+
value
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
};
|
|
1829
|
+
}
|
|
1830
|
+
function buildSizeDefault(propType) {
|
|
1831
|
+
const sizePropType = propType?.shape?.size;
|
|
1832
|
+
return {
|
|
1833
|
+
size: sizePropType?.default
|
|
1834
|
+
};
|
|
1835
|
+
}
|
|
1836
|
+
function buildDropShadowDefault(propType) {
|
|
1837
|
+
const dropShadowPropType = propType.shape;
|
|
1838
|
+
return {
|
|
1839
|
+
blur: dropShadowPropType?.blur?.default,
|
|
1840
|
+
xAxis: dropShadowPropType?.xAxis?.default,
|
|
1841
|
+
yAxis: dropShadowPropType?.yAxis?.default,
|
|
1842
|
+
color: dropShadowPropType?.color?.default ?? (dropShadowPropType?.color).prop_types.color.default
|
|
1843
|
+
};
|
|
1844
|
+
}
|
|
1845
|
+
function extractPropType(propType, filterFunctionGroup) {
|
|
1846
|
+
return propType.shape?.args?.prop_types[filterFunctionGroup];
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
// src/controls/filter-control/context/filter-config-context.tsx
|
|
1850
|
+
var FilterConfigContext = (0, import_react19.createContext)(null);
|
|
1851
|
+
function FilterConfigProvider({ children }) {
|
|
1852
|
+
const propContext = useBoundProp(import_editor_props11.cssFilterFunctionPropUtil);
|
|
1853
|
+
const contextValue = (0, import_react19.useMemo)(() => {
|
|
1854
|
+
const config = buildFilterConfig(propContext.propType.item_prop_type);
|
|
1855
|
+
const filterOptions = Object.entries(config).map(([key, conf]) => ({
|
|
1856
|
+
value: key,
|
|
1857
|
+
label: conf.name
|
|
1858
|
+
}));
|
|
1859
|
+
return {
|
|
1860
|
+
config,
|
|
1861
|
+
filterOptions,
|
|
1862
|
+
getFilterFunctionConfig: (filterFunction) => config[filterFunction],
|
|
1863
|
+
getInitialValue: () => config.blur.defaultValue
|
|
1864
|
+
};
|
|
1865
|
+
}, [propContext.propType]);
|
|
1866
|
+
return /* @__PURE__ */ React38.createElement(FilterConfigContext.Provider, { value: contextValue }, children);
|
|
1867
|
+
}
|
|
1868
|
+
function useFilterConfig() {
|
|
1869
|
+
const context = (0, import_react19.useContext)(FilterConfigContext);
|
|
1870
|
+
if (!context) {
|
|
1871
|
+
throw new Error("useFilterConfig must be used within FilterConfigProvider");
|
|
1872
|
+
}
|
|
1873
|
+
return context;
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1876
|
+
// src/controls/filter-control/filter-content.tsx
|
|
1877
|
+
var React41 = __toESM(require("react"));
|
|
1878
|
+
var import_editor_props14 = require("@elementor/editor-props");
|
|
1879
|
+
var import_ui31 = require("@elementor/ui");
|
|
1880
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
1881
|
+
|
|
1882
|
+
// src/controls/filter-control/drop-shadow/drop-shadow-item-content.tsx
|
|
1883
|
+
var React39 = __toESM(require("react"));
|
|
1884
|
+
var import_react20 = require("react");
|
|
1885
|
+
var import_editor_props12 = require("@elementor/editor-props");
|
|
1886
|
+
var import_ui29 = require("@elementor/ui");
|
|
1887
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
1655
1888
|
var items = [
|
|
1656
1889
|
{
|
|
1657
1890
|
bind: "xAxis",
|
|
1658
|
-
label: (0,
|
|
1891
|
+
label: (0, import_i18n13.__)("X-axis", "elementor"),
|
|
1659
1892
|
rowIndex: 0
|
|
1660
1893
|
},
|
|
1661
1894
|
{
|
|
1662
1895
|
bind: "yAxis",
|
|
1663
|
-
label: (0,
|
|
1896
|
+
label: (0, import_i18n13.__)("Y-axis", "elementor"),
|
|
1664
1897
|
rowIndex: 0
|
|
1665
1898
|
},
|
|
1666
1899
|
{
|
|
1667
1900
|
bind: "blur",
|
|
1668
|
-
label: (0,
|
|
1901
|
+
label: (0, import_i18n13.__)("Blur", "elementor"),
|
|
1669
1902
|
rowIndex: 1
|
|
1670
1903
|
},
|
|
1671
1904
|
{
|
|
1672
1905
|
bind: "color",
|
|
1673
|
-
label: (0,
|
|
1906
|
+
label: (0, import_i18n13.__)("Color", "elementor"),
|
|
1674
1907
|
rowIndex: 1
|
|
1675
1908
|
}
|
|
1676
1909
|
];
|
|
1677
|
-
var DropShadowItemContent = ({
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
}) => {
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1910
|
+
var DropShadowItemContent = ({ anchorEl }) => {
|
|
1911
|
+
const context = useBoundProp(import_editor_props12.dropShadowFilterPropTypeUtil);
|
|
1912
|
+
const rowRefs = [(0, import_react20.useRef)(null), (0, import_react20.useRef)(null)];
|
|
1913
|
+
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(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React39.createElement(import_ui29.Grid, { item: true, xs: 6 }, item.bind === "color" ? /* @__PURE__ */ React39.createElement(ColorControl, { anchorEl }) : /* @__PURE__ */ React39.createElement(
|
|
1914
|
+
SizeControl,
|
|
1915
|
+
{
|
|
1916
|
+
anchorRef: rowRefs[item.rowIndex],
|
|
1917
|
+
enablePropTypeUnits: true,
|
|
1918
|
+
defaultUnit: "px"
|
|
1919
|
+
}
|
|
1920
|
+
))))));
|
|
1684
1921
|
};
|
|
1685
1922
|
|
|
1686
|
-
// src/controls/filter-control/
|
|
1687
|
-
var
|
|
1688
|
-
var
|
|
1923
|
+
// src/controls/filter-control/single-size/single-size-item-content.tsx
|
|
1924
|
+
var import_react21 = require("react");
|
|
1925
|
+
var React40 = __toESM(require("react"));
|
|
1926
|
+
var import_editor_props13 = require("@elementor/editor-props");
|
|
1927
|
+
var import_ui30 = require("@elementor/ui");
|
|
1928
|
+
var propTypeMap = {
|
|
1929
|
+
blur: import_editor_props13.blurFilterPropTypeUtil,
|
|
1930
|
+
intensity: import_editor_props13.intensityFilterPropTypeUtil,
|
|
1931
|
+
"hue-rotate": import_editor_props13.hueRotateFilterPropTypeUtil,
|
|
1932
|
+
"color-tone": import_editor_props13.colorToneFilterPropTypeUtil
|
|
1933
|
+
};
|
|
1934
|
+
var SingleSizeItemContent = ({ filterFunc }) => {
|
|
1935
|
+
const rowRef = (0, import_react21.useRef)(null);
|
|
1936
|
+
const { getFilterFunctionConfig } = useFilterConfig();
|
|
1937
|
+
const { valueName, filterFunctionGroup } = getFilterFunctionConfig(filterFunc);
|
|
1938
|
+
const context = useBoundProp(propTypeMap[filterFunctionGroup]);
|
|
1939
|
+
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(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlFormLabel, null, valueName)), /* @__PURE__ */ React40.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(SizeControl, { anchorRef: rowRef, enablePropTypeUnits: true }))))));
|
|
1940
|
+
};
|
|
1941
|
+
|
|
1942
|
+
// src/controls/filter-control/filter-content.tsx
|
|
1943
|
+
var FilterContent = () => {
|
|
1944
|
+
const propContext = useBoundProp(import_editor_props14.cssFilterFunctionPropUtil);
|
|
1945
|
+
const { filterOptions, getFilterFunctionConfig } = useFilterConfig();
|
|
1946
|
+
const handleValueChange = (value, _, meta) => {
|
|
1947
|
+
let newValue = structuredClone(value);
|
|
1948
|
+
const funcConfig = getFilterFunctionConfig(newValue?.func.value);
|
|
1949
|
+
if (meta?.bind === "func") {
|
|
1950
|
+
newValue = funcConfig.defaultValue.value;
|
|
1951
|
+
}
|
|
1952
|
+
if (!newValue.args) {
|
|
1953
|
+
return;
|
|
1954
|
+
}
|
|
1955
|
+
propContext.setValue(newValue);
|
|
1956
|
+
};
|
|
1957
|
+
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(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlFormLabel, null, (0, import_i18n14.__)("Filter", "elementor"))), /* @__PURE__ */ React41.createElement(import_ui31.Grid, { 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)))));
|
|
1958
|
+
};
|
|
1959
|
+
var FilterValueContent = () => {
|
|
1960
|
+
const { openItemIndex, items: items2 } = useRepeaterContext();
|
|
1961
|
+
const currentItem = items2[openItemIndex];
|
|
1962
|
+
const filterFunc = currentItem.item.value.func.value;
|
|
1963
|
+
const isDropShadow = filterFunc === "drop-shadow";
|
|
1964
|
+
if (isDropShadow) {
|
|
1965
|
+
return /* @__PURE__ */ React41.createElement(DropShadowItemContent, null);
|
|
1966
|
+
}
|
|
1967
|
+
return /* @__PURE__ */ React41.createElement(SingleSizeItemContent, { filterFunc });
|
|
1968
|
+
};
|
|
1969
|
+
|
|
1970
|
+
// src/controls/filter-control/filter-icon.tsx
|
|
1971
|
+
var React42 = __toESM(require("react"));
|
|
1972
|
+
var import_ui32 = require("@elementor/ui");
|
|
1973
|
+
var FilterIcon = ({ value }) => {
|
|
1974
|
+
if (value.value.func.value !== "drop-shadow") {
|
|
1975
|
+
return null;
|
|
1976
|
+
}
|
|
1977
|
+
return /* @__PURE__ */ React42.createElement(
|
|
1978
|
+
StyledUnstableColorIndicator2,
|
|
1979
|
+
{
|
|
1980
|
+
size: "inherit",
|
|
1981
|
+
component: "span",
|
|
1982
|
+
value: value.value.args.value?.color.value
|
|
1983
|
+
}
|
|
1984
|
+
);
|
|
1985
|
+
};
|
|
1986
|
+
var StyledUnstableColorIndicator2 = (0, import_ui32.styled)(import_ui32.UnstableColorIndicator)(({ theme }) => ({
|
|
1987
|
+
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
1988
|
+
}));
|
|
1989
|
+
|
|
1990
|
+
// src/controls/filter-control/filter-label.tsx
|
|
1991
|
+
var React45 = __toESM(require("react"));
|
|
1992
|
+
|
|
1993
|
+
// src/controls/filter-control/drop-shadow/drop-shadow-item-label.tsx
|
|
1994
|
+
var React43 = __toESM(require("react"));
|
|
1995
|
+
var import_ui33 = require("@elementor/ui");
|
|
1689
1996
|
var DropShadowItemLabel = ({ value }) => {
|
|
1690
1997
|
const { xAxis, yAxis, blur } = value.value.args.value;
|
|
1691
1998
|
const xValue = `${xAxis?.value?.size ?? 0}${xAxis?.value?.unit ?? "px"}`;
|
|
1692
1999
|
const yValue = `${yAxis?.value?.size ?? 0}${yAxis?.value?.unit ?? "px"}`;
|
|
1693
2000
|
const blurValue = `${blur?.value?.size ?? 10}${blur?.value?.unit ?? "px"}`;
|
|
1694
|
-
return /* @__PURE__ */
|
|
2001
|
+
return /* @__PURE__ */ React43.createElement(import_ui33.Box, { component: "span" }, /* @__PURE__ */ React43.createElement(import_ui33.Box, { component: "span", style: { textTransform: "capitalize" } }, "Drop shadow:"), `${xValue} ${yValue} ${blurValue}`);
|
|
1695
2002
|
};
|
|
1696
2003
|
|
|
1697
|
-
// src/controls/filter-
|
|
1698
|
-
var
|
|
1699
|
-
var
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
},
|
|
1724
|
-
contrast: {
|
|
1725
|
-
defaultValue: {
|
|
1726
|
-
$$type: "css-filter-func",
|
|
1727
|
-
value: {
|
|
1728
|
-
func: { $$type: "string", value: "contrast" },
|
|
1729
|
-
args: { $$type: "size", value: { size: 100, unit: "%" } }
|
|
1730
|
-
}
|
|
1731
|
-
},
|
|
1732
|
-
name: (0, import_i18n8.__)("Contrast", "elementor"),
|
|
1733
|
-
valueName: (0, import_i18n8.__)("Amount", "elementor"),
|
|
1734
|
-
units: ["%"]
|
|
1735
|
-
},
|
|
1736
|
-
"hue-rotate": {
|
|
1737
|
-
defaultValue: {
|
|
1738
|
-
$$type: "css-filter-func",
|
|
1739
|
-
value: {
|
|
1740
|
-
func: { $$type: "string", value: "hue-rotate" },
|
|
1741
|
-
args: { $$type: "size", value: { size: 0, unit: "deg" } }
|
|
1742
|
-
}
|
|
1743
|
-
},
|
|
1744
|
-
name: (0, import_i18n8.__)("Hue Rotate", "elementor"),
|
|
1745
|
-
valueName: (0, import_i18n8.__)("Angle", "elementor"),
|
|
1746
|
-
units: ["deg", "rad", "grad", "turn"]
|
|
1747
|
-
},
|
|
1748
|
-
saturate: {
|
|
1749
|
-
defaultValue: {
|
|
1750
|
-
$$type: "css-filter-func",
|
|
1751
|
-
value: {
|
|
1752
|
-
func: { $$type: "string", value: "saturate" },
|
|
1753
|
-
args: { $$type: "size", value: { size: 100, unit: "%" } }
|
|
1754
|
-
}
|
|
1755
|
-
},
|
|
1756
|
-
name: (0, import_i18n8.__)("Saturate", "elementor"),
|
|
1757
|
-
valueName: (0, import_i18n8.__)("Amount", "elementor"),
|
|
1758
|
-
units: ["%"]
|
|
2004
|
+
// src/controls/filter-control/single-size/single-size-item-label.tsx
|
|
2005
|
+
var React44 = __toESM(require("react"));
|
|
2006
|
+
var import_ui34 = require("@elementor/ui");
|
|
2007
|
+
var SingleSizeItemLabel = ({ value }) => {
|
|
2008
|
+
const { func, args } = value.value;
|
|
2009
|
+
const { getFilterFunctionConfig } = useFilterConfig();
|
|
2010
|
+
const { defaultValue } = getFilterFunctionConfig(func.value ?? "");
|
|
2011
|
+
const defaultUnit = defaultValue.value.args.value?.size?.value?.unit ?? lengthUnits[0];
|
|
2012
|
+
const { unit, size } = args.value.size?.value ?? { unit: defaultUnit, size: 0 };
|
|
2013
|
+
const label = /* @__PURE__ */ React44.createElement(import_ui34.Box, { component: "span", style: { textTransform: "capitalize" } }, func.value ?? "", ":");
|
|
2014
|
+
return /* @__PURE__ */ React44.createElement(import_ui34.Box, { component: "span" }, label, unit !== "custom" ? ` ${size ?? 0}${unit ?? defaultUnit}` : size);
|
|
2015
|
+
};
|
|
2016
|
+
|
|
2017
|
+
// src/controls/filter-control/filter-label.tsx
|
|
2018
|
+
var FilterLabel = ({ value }) => {
|
|
2019
|
+
if (value.value.func.value === "drop-shadow") {
|
|
2020
|
+
return /* @__PURE__ */ React45.createElement(DropShadowItemLabel, { value });
|
|
2021
|
+
}
|
|
2022
|
+
return /* @__PURE__ */ React45.createElement(SingleSizeItemLabel, { value });
|
|
2023
|
+
};
|
|
2024
|
+
|
|
2025
|
+
// src/controls/filter-control/filter-repeater-control.tsx
|
|
2026
|
+
var FILTER_CONFIG = {
|
|
2027
|
+
filter: {
|
|
2028
|
+
propTypeUtil: import_editor_props15.filterPropTypeUtil,
|
|
2029
|
+
label: (0, import_i18n15.__)("Filters", "elementor")
|
|
1759
2030
|
},
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
value: {
|
|
1764
|
-
func: { $$type: "string", value: "grayscale" },
|
|
1765
|
-
args: { $$type: "size", value: { size: 0, unit: "%" } }
|
|
1766
|
-
}
|
|
1767
|
-
},
|
|
1768
|
-
name: (0, import_i18n8.__)("Grayscale", "elementor"),
|
|
1769
|
-
valueName: (0, import_i18n8.__)("Amount", "elementor"),
|
|
1770
|
-
units: ["%"]
|
|
1771
|
-
},
|
|
1772
|
-
invert: {
|
|
1773
|
-
defaultValue: {
|
|
1774
|
-
$$type: "css-filter-func",
|
|
1775
|
-
value: {
|
|
1776
|
-
func: { $$type: "string", value: "invert" },
|
|
1777
|
-
args: { $$type: "size", value: { size: 0, unit: "%" } }
|
|
1778
|
-
}
|
|
1779
|
-
},
|
|
1780
|
-
name: (0, import_i18n8.__)("Invert", "elementor"),
|
|
1781
|
-
valueName: (0, import_i18n8.__)("Amount", "elementor"),
|
|
1782
|
-
units: ["%"]
|
|
1783
|
-
},
|
|
1784
|
-
sepia: {
|
|
1785
|
-
defaultValue: {
|
|
1786
|
-
$$type: "css-filter-func",
|
|
1787
|
-
value: {
|
|
1788
|
-
func: { $$type: "string", value: "sepia" },
|
|
1789
|
-
args: { $$type: "size", value: { size: 0, unit: "%" } }
|
|
1790
|
-
}
|
|
1791
|
-
},
|
|
1792
|
-
name: (0, import_i18n8.__)("Sepia", "elementor"),
|
|
1793
|
-
valueName: (0, import_i18n8.__)("Amount", "elementor"),
|
|
1794
|
-
units: ["%"]
|
|
1795
|
-
},
|
|
1796
|
-
"drop-shadow": {
|
|
1797
|
-
defaultValue: {
|
|
1798
|
-
$$type: "css-filter-func",
|
|
1799
|
-
value: {
|
|
1800
|
-
func: { $$type: "string", value: "drop-shadow" },
|
|
1801
|
-
args: {
|
|
1802
|
-
$$type: "drop-shadow",
|
|
1803
|
-
value: {
|
|
1804
|
-
xAxis: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
1805
|
-
yAxis: { $$type: "size", value: { size: 0, unit: "px" } },
|
|
1806
|
-
blur: { $$type: "size", value: { size: 10, unit: "px" } },
|
|
1807
|
-
color: { $$type: "color", value: "rgba(0, 0, 0, 1)" }
|
|
1808
|
-
}
|
|
1809
|
-
}
|
|
1810
|
-
}
|
|
1811
|
-
},
|
|
1812
|
-
name: (0, import_i18n8.__)("Drop shadow", "elementor"),
|
|
1813
|
-
valueName: (0, import_i18n8.__)("Drop-shadow", "elementor"),
|
|
1814
|
-
units: lengthUnits.filter((unit) => unit !== "%")
|
|
2031
|
+
"backdrop-filter": {
|
|
2032
|
+
propTypeUtil: import_editor_props15.backdropFilterPropTypeUtil,
|
|
2033
|
+
label: (0, import_i18n15.__)("Backdrop Filters", "elementor")
|
|
1815
2034
|
}
|
|
1816
2035
|
};
|
|
1817
|
-
var filterKeys = Object.keys(filterConfig);
|
|
1818
|
-
var isSingleSize = (key) => {
|
|
1819
|
-
return !["drop-shadow"].includes(key);
|
|
1820
|
-
};
|
|
1821
2036
|
var FilterRepeaterControl = createControl(({ filterPropName = "filter" }) => {
|
|
1822
|
-
const
|
|
1823
|
-
const { propType, value: filterValues, setValue
|
|
1824
|
-
return /* @__PURE__ */
|
|
2037
|
+
const { propTypeUtil, label } = ensureFilterConfig(filterPropName);
|
|
2038
|
+
const { propType, value: filterValues, setValue } = useBoundProp(propTypeUtil);
|
|
2039
|
+
return /* @__PURE__ */ React46.createElement(FilterConfigProvider, null, /* @__PURE__ */ React46.createElement(PropProvider, { propType, value: filterValues, setValue }, /* @__PURE__ */ React46.createElement(
|
|
1825
2040
|
Repeater,
|
|
1826
2041
|
{
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
values: filterValues ?? [],
|
|
1830
|
-
setValues: setValue,
|
|
1831
|
-
label,
|
|
1832
|
-
collectionPropUtil: propUtil,
|
|
1833
|
-
itemSettings: {
|
|
1834
|
-
Icon: ItemIcon2,
|
|
1835
|
-
Label: ItemLabel2,
|
|
1836
|
-
Content: ItemContent2,
|
|
1837
|
-
initialValues: filterConfig[DEFAULT_FILTER].defaultValue
|
|
1838
|
-
}
|
|
2042
|
+
propTypeUtil,
|
|
2043
|
+
label
|
|
1839
2044
|
}
|
|
1840
|
-
));
|
|
2045
|
+
)));
|
|
1841
2046
|
});
|
|
1842
|
-
var
|
|
1843
|
-
|
|
1844
|
-
}));
|
|
1845
|
-
var ItemIcon2 = ({ value }) => {
|
|
1846
|
-
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 });
|
|
1847
|
-
};
|
|
1848
|
-
var ItemLabel2 = ({ value }) => {
|
|
1849
|
-
return isSingleSize(value.value.func.value ?? "") ? /* @__PURE__ */ React31.createElement(SingleSizeItemLabel, { value }) : /* @__PURE__ */ React31.createElement(DropShadowItemLabel, { value });
|
|
1850
|
-
};
|
|
1851
|
-
var SingleSizeItemLabel = ({ value }) => {
|
|
1852
|
-
const { func, args } = value.value;
|
|
1853
|
-
const defaultUnit = filterConfig[func.value ?? ""].defaultValue.value.args.value.unit ?? lengthUnits[0];
|
|
1854
|
-
const { unit, size } = args.value ?? { unit: defaultUnit, size: 0 };
|
|
1855
|
-
const label = /* @__PURE__ */ React31.createElement(import_ui24.Box, { component: "span", style: { textTransform: "capitalize" } }, func.value ?? "", ":");
|
|
1856
|
-
return /* @__PURE__ */ React31.createElement(import_ui24.Box, { component: "span" }, label, unit !== "custom" ? ` ${size ?? 0}${unit ?? defaultUnit}` : size);
|
|
1857
|
-
};
|
|
1858
|
-
var ItemContent2 = ({
|
|
1859
|
-
bind,
|
|
1860
|
-
collectionPropUtil,
|
|
1861
|
-
anchorEl
|
|
1862
|
-
}) => {
|
|
1863
|
-
const { value: filterValues = [] } = useBoundProp(collectionPropUtil ?? import_editor_props12.filterPropTypeUtil);
|
|
1864
|
-
const itemIndex = parseInt(bind, 10);
|
|
1865
|
-
const item = filterValues?.[itemIndex];
|
|
1866
|
-
return item ? /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React31.createElement(PropContent, { item, anchorEl })) : null;
|
|
1867
|
-
};
|
|
1868
|
-
var PropContent = ({ item, anchorEl }) => {
|
|
1869
|
-
const propContext = useBoundProp(import_editor_props12.cssFilterFunctionPropUtil);
|
|
1870
|
-
const handleValueChange = (changedValue, options, meta) => {
|
|
1871
|
-
let newValue = structuredClone(changedValue);
|
|
1872
|
-
const newFuncName = newValue?.func.value ?? "";
|
|
1873
|
-
if (meta?.bind === "func") {
|
|
1874
|
-
newValue = structuredClone(filterConfig[newFuncName].defaultValue.value);
|
|
1875
|
-
}
|
|
1876
|
-
if (!newValue.args) {
|
|
1877
|
-
return;
|
|
1878
|
-
}
|
|
1879
|
-
propContext.setValue(newValue);
|
|
1880
|
-
};
|
|
1881
|
-
return /* @__PURE__ */ React31.createElement(PropProvider, { ...propContext, setValue: handleValueChange }, /* @__PURE__ */ React31.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React31.createElement(PopoverGridContainer, null, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlFormLabel, null, (0, import_i18n8.__)("Filter", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind: "func" }, /* @__PURE__ */ React31.createElement(
|
|
1882
|
-
SelectControl,
|
|
1883
|
-
{
|
|
1884
|
-
options: filterKeys.map((filterKey) => ({
|
|
1885
|
-
label: filterConfig[filterKey].name,
|
|
1886
|
-
value: filterKey
|
|
1887
|
-
}))
|
|
1888
|
-
}
|
|
1889
|
-
)))), /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind: "args" }, /* @__PURE__ */ React31.createElement(Content2, { filterType: item?.value.func, anchorEl }))));
|
|
1890
|
-
};
|
|
1891
|
-
var Content2 = ({ filterType, anchorEl }) => {
|
|
1892
|
-
const filterName = filterType?.value || DEFAULT_FILTER;
|
|
1893
|
-
const filterItemConfig = filterConfig[filterName];
|
|
1894
|
-
const { units: units2 = [] } = filterItemConfig;
|
|
1895
|
-
return isSingleSize(filterName) ? /* @__PURE__ */ React31.createElement(SingleSizeItemContent, { filterType: filterName }) : /* @__PURE__ */ React31.createElement(DropShadowItemContent, { units: units2, anchorEl });
|
|
1896
|
-
};
|
|
1897
|
-
var SingleSizeItemContent = ({ filterType }) => {
|
|
1898
|
-
const { valueName, defaultValue, units: units2 } = filterConfig[filterType];
|
|
1899
|
-
const rowRef = (0, import_react20.useRef)(null);
|
|
1900
|
-
const defaultUnit = defaultValue.value.args.value.unit;
|
|
1901
|
-
return /* @__PURE__ */ React31.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlFormLabel, null, valueName)), /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(SizeControl, { anchorRef: rowRef, units: units2, defaultUnit })));
|
|
2047
|
+
var Repeater = ({ propTypeUtil, label }) => {
|
|
2048
|
+
const { getInitialValue } = useFilterConfig();
|
|
2049
|
+
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)));
|
|
1902
2050
|
};
|
|
2051
|
+
function ensureFilterConfig(name) {
|
|
2052
|
+
if (name && name in FILTER_CONFIG) {
|
|
2053
|
+
return FILTER_CONFIG[name];
|
|
2054
|
+
}
|
|
2055
|
+
return FILTER_CONFIG.filter;
|
|
2056
|
+
}
|
|
1903
2057
|
|
|
1904
2058
|
// src/controls/toggle-control.tsx
|
|
1905
|
-
var
|
|
1906
|
-
var
|
|
2059
|
+
var React49 = __toESM(require("react"));
|
|
2060
|
+
var import_editor_props16 = require("@elementor/editor-props");
|
|
1907
2061
|
|
|
1908
2062
|
// src/components/control-toggle-button-group.tsx
|
|
1909
|
-
var
|
|
1910
|
-
var
|
|
1911
|
-
var
|
|
1912
|
-
var
|
|
2063
|
+
var React48 = __toESM(require("react"));
|
|
2064
|
+
var import_react22 = require("react");
|
|
2065
|
+
var import_icons9 = require("@elementor/icons");
|
|
2066
|
+
var import_ui36 = require("@elementor/ui");
|
|
1913
2067
|
|
|
1914
2068
|
// src/components/conditional-tooltip.tsx
|
|
1915
|
-
var
|
|
1916
|
-
var
|
|
2069
|
+
var React47 = __toESM(require("react"));
|
|
2070
|
+
var import_ui35 = require("@elementor/ui");
|
|
1917
2071
|
var ConditionalTooltip = ({
|
|
1918
2072
|
showTooltip,
|
|
1919
2073
|
children,
|
|
1920
2074
|
label
|
|
1921
2075
|
}) => {
|
|
1922
|
-
return showTooltip && label ? /* @__PURE__ */
|
|
2076
|
+
return showTooltip && label ? /* @__PURE__ */ React47.createElement(import_ui35.Tooltip, { title: label, disableFocusListener: true, placement: "top" }, children) : children;
|
|
1923
2077
|
};
|
|
1924
2078
|
|
|
1925
2079
|
// src/components/control-toggle-button-group.tsx
|
|
1926
|
-
var StyledToggleButtonGroup = (0,
|
|
2080
|
+
var StyledToggleButtonGroup = (0, import_ui36.styled)(import_ui36.ToggleButtonGroup)`
|
|
1927
2081
|
${({ justify }) => `justify-content: ${justify};`}
|
|
1928
2082
|
button:not( :last-of-type ) {
|
|
1929
2083
|
border-start-end-radius: 0;
|
|
@@ -1938,7 +2092,7 @@ var StyledToggleButtonGroup = (0, import_ui26.styled)(import_ui26.ToggleButtonGr
|
|
|
1938
2092
|
border-end-end-radius: 8px;
|
|
1939
2093
|
}
|
|
1940
2094
|
`;
|
|
1941
|
-
var StyledToggleButton = (0,
|
|
2095
|
+
var StyledToggleButton = (0, import_ui36.styled)(import_ui36.ToggleButton, {
|
|
1942
2096
|
shouldForwardProp: (prop) => prop !== "isPlaceholder"
|
|
1943
2097
|
})`
|
|
1944
2098
|
${({ theme, isPlaceholder }) => isPlaceholder && `
|
|
@@ -1965,12 +2119,12 @@ var ControlToggleButtonGroup = ({
|
|
|
1965
2119
|
const shouldSliceItems = exclusive && maxItems !== void 0 && items2.length > maxItems;
|
|
1966
2120
|
const menuItems = shouldSliceItems ? items2.slice(maxItems - 1) : [];
|
|
1967
2121
|
const fixedItems = shouldSliceItems ? items2.slice(0, maxItems - 1) : items2;
|
|
1968
|
-
const theme = (0,
|
|
2122
|
+
const theme = (0, import_ui36.useTheme)();
|
|
1969
2123
|
const isRtl = "rtl" === theme.direction;
|
|
1970
2124
|
const handleChange = (_, newValue) => {
|
|
1971
2125
|
onChange(newValue);
|
|
1972
2126
|
};
|
|
1973
|
-
const getGridTemplateColumns = (0,
|
|
2127
|
+
const getGridTemplateColumns = (0, import_react22.useMemo)(() => {
|
|
1974
2128
|
const isOffLimits = menuItems?.length;
|
|
1975
2129
|
const itemsCount = isOffLimits ? fixedItems.length + 1 : fixedItems.length;
|
|
1976
2130
|
const templateColumnsSuffix = isOffLimits ? "auto" : "";
|
|
@@ -1994,7 +2148,7 @@ var ControlToggleButtonGroup = ({
|
|
|
1994
2148
|
return [];
|
|
1995
2149
|
};
|
|
1996
2150
|
const placeholderArray = getPlaceholderArray(placeholder);
|
|
1997
|
-
return /* @__PURE__ */
|
|
2151
|
+
return /* @__PURE__ */ React48.createElement(ControlActions, null, /* @__PURE__ */ React48.createElement(
|
|
1998
2152
|
StyledToggleButtonGroup,
|
|
1999
2153
|
{
|
|
2000
2154
|
justify,
|
|
@@ -2009,16 +2163,16 @@ var ControlToggleButtonGroup = ({
|
|
|
2009
2163
|
width: `100%`
|
|
2010
2164
|
}
|
|
2011
2165
|
},
|
|
2012
|
-
fixedItems.map(({ label, value: buttonValue, renderContent:
|
|
2166
|
+
fixedItems.map(({ label, value: buttonValue, renderContent: Content3, showTooltip }) => {
|
|
2013
2167
|
const isPlaceholder = placeholderArray.length > 0 && placeholderArray.includes(buttonValue) && (shouldShowExclusivePlaceholder || shouldShowNonExclusivePlaceholder);
|
|
2014
|
-
return /* @__PURE__ */
|
|
2168
|
+
return /* @__PURE__ */ React48.createElement(
|
|
2015
2169
|
ConditionalTooltip,
|
|
2016
2170
|
{
|
|
2017
2171
|
key: buttonValue,
|
|
2018
2172
|
label,
|
|
2019
2173
|
showTooltip: showTooltip || false
|
|
2020
2174
|
},
|
|
2021
|
-
/* @__PURE__ */
|
|
2175
|
+
/* @__PURE__ */ React48.createElement(
|
|
2022
2176
|
StyledToggleButton,
|
|
2023
2177
|
{
|
|
2024
2178
|
value: buttonValue,
|
|
@@ -2027,11 +2181,11 @@ var ControlToggleButtonGroup = ({
|
|
|
2027
2181
|
fullWidth,
|
|
2028
2182
|
isPlaceholder
|
|
2029
2183
|
},
|
|
2030
|
-
/* @__PURE__ */
|
|
2184
|
+
/* @__PURE__ */ React48.createElement(Content3, { size })
|
|
2031
2185
|
)
|
|
2032
2186
|
);
|
|
2033
2187
|
}),
|
|
2034
|
-
menuItems.length && exclusive && /* @__PURE__ */
|
|
2188
|
+
menuItems.length && exclusive && /* @__PURE__ */ React48.createElement(
|
|
2035
2189
|
SplitButtonGroup,
|
|
2036
2190
|
{
|
|
2037
2191
|
size,
|
|
@@ -2051,8 +2205,8 @@ var SplitButtonGroup = ({
|
|
|
2051
2205
|
value
|
|
2052
2206
|
}) => {
|
|
2053
2207
|
const previewButton = usePreviewButton(items2, value);
|
|
2054
|
-
const [isMenuOpen, setIsMenuOpen] = (0,
|
|
2055
|
-
const menuButtonRef = (0,
|
|
2208
|
+
const [isMenuOpen, setIsMenuOpen] = (0, import_react22.useState)(false);
|
|
2209
|
+
const menuButtonRef = (0, import_react22.useRef)(null);
|
|
2056
2210
|
const onMenuToggle = (ev) => {
|
|
2057
2211
|
setIsMenuOpen((prev) => !prev);
|
|
2058
2212
|
ev.preventDefault();
|
|
@@ -2065,8 +2219,8 @@ var SplitButtonGroup = ({
|
|
|
2065
2219
|
const shouldRemove = newValue === value;
|
|
2066
2220
|
onChange(shouldRemove ? null : newValue);
|
|
2067
2221
|
};
|
|
2068
|
-
return /* @__PURE__ */
|
|
2069
|
-
|
|
2222
|
+
return /* @__PURE__ */ React48.createElement(React48.Fragment, null, /* @__PURE__ */ React48.createElement(
|
|
2223
|
+
import_ui36.ToggleButton,
|
|
2070
2224
|
{
|
|
2071
2225
|
value: previewButton.value,
|
|
2072
2226
|
"aria-label": previewButton.label,
|
|
@@ -2079,8 +2233,8 @@ var SplitButtonGroup = ({
|
|
|
2079
2233
|
ref: menuButtonRef
|
|
2080
2234
|
},
|
|
2081
2235
|
previewButton.renderContent({ size })
|
|
2082
|
-
), /* @__PURE__ */
|
|
2083
|
-
|
|
2236
|
+
), /* @__PURE__ */ React48.createElement(
|
|
2237
|
+
import_ui36.ToggleButton,
|
|
2084
2238
|
{
|
|
2085
2239
|
size,
|
|
2086
2240
|
"aria-expanded": isMenuOpen ? "true" : void 0,
|
|
@@ -2090,9 +2244,9 @@ var SplitButtonGroup = ({
|
|
|
2090
2244
|
ref: menuButtonRef,
|
|
2091
2245
|
value: "__chevron-icon-button__"
|
|
2092
2246
|
},
|
|
2093
|
-
/* @__PURE__ */
|
|
2094
|
-
), /* @__PURE__ */
|
|
2095
|
-
|
|
2247
|
+
/* @__PURE__ */ React48.createElement(import_icons9.ChevronDownIcon, { fontSize: size })
|
|
2248
|
+
), /* @__PURE__ */ React48.createElement(
|
|
2249
|
+
import_ui36.Menu,
|
|
2096
2250
|
{
|
|
2097
2251
|
open: isMenuOpen,
|
|
2098
2252
|
onClose: () => setIsMenuOpen(false),
|
|
@@ -2109,22 +2263,22 @@ var SplitButtonGroup = ({
|
|
|
2109
2263
|
mt: 0.5
|
|
2110
2264
|
}
|
|
2111
2265
|
},
|
|
2112
|
-
items2.map(({ label, value: buttonValue }) => /* @__PURE__ */
|
|
2113
|
-
|
|
2266
|
+
items2.map(({ label, value: buttonValue }) => /* @__PURE__ */ React48.createElement(
|
|
2267
|
+
import_ui36.MenuItem,
|
|
2114
2268
|
{
|
|
2115
2269
|
key: buttonValue,
|
|
2116
2270
|
selected: buttonValue === value,
|
|
2117
2271
|
onClick: () => onMenuItemClick(buttonValue)
|
|
2118
2272
|
},
|
|
2119
|
-
/* @__PURE__ */
|
|
2273
|
+
/* @__PURE__ */ React48.createElement(import_ui36.ListItemText, null, /* @__PURE__ */ React48.createElement(import_ui36.Typography, { sx: { fontSize: "14px" } }, label))
|
|
2120
2274
|
))
|
|
2121
2275
|
));
|
|
2122
2276
|
};
|
|
2123
2277
|
var usePreviewButton = (items2, value) => {
|
|
2124
|
-
const [previewButton, setPreviewButton] = (0,
|
|
2278
|
+
const [previewButton, setPreviewButton] = (0, import_react22.useState)(
|
|
2125
2279
|
items2.find((item) => item.value === value) ?? items2[0]
|
|
2126
2280
|
);
|
|
2127
|
-
(0,
|
|
2281
|
+
(0, import_react22.useEffect)(() => {
|
|
2128
2282
|
const selectedButton = items2.find((item) => item.value === value);
|
|
2129
2283
|
if (selectedButton) {
|
|
2130
2284
|
setPreviewButton(selectedButton);
|
|
@@ -2142,7 +2296,7 @@ var ToggleControl = createControl(
|
|
|
2142
2296
|
exclusive = true,
|
|
2143
2297
|
maxItems
|
|
2144
2298
|
}) => {
|
|
2145
|
-
const { value, setValue, placeholder, disabled } = useBoundProp(
|
|
2299
|
+
const { value, setValue, placeholder, disabled } = useBoundProp(import_editor_props16.stringPropTypeUtil);
|
|
2146
2300
|
const exclusiveValues = options.filter((option) => option.exclusive).map((option) => option.value);
|
|
2147
2301
|
const handleNonExclusiveToggle = (selectedValues) => {
|
|
2148
2302
|
const newSelectedValue = selectedValues[selectedValues.length - 1];
|
|
@@ -2157,7 +2311,7 @@ var ToggleControl = createControl(
|
|
|
2157
2311
|
size,
|
|
2158
2312
|
placeholder
|
|
2159
2313
|
};
|
|
2160
|
-
return exclusive ? /* @__PURE__ */
|
|
2314
|
+
return exclusive ? /* @__PURE__ */ React49.createElement(
|
|
2161
2315
|
ControlToggleButtonGroup,
|
|
2162
2316
|
{
|
|
2163
2317
|
...toggleButtonGroupProps,
|
|
@@ -2166,7 +2320,7 @@ var ToggleControl = createControl(
|
|
|
2166
2320
|
disabled,
|
|
2167
2321
|
exclusive: true
|
|
2168
2322
|
}
|
|
2169
|
-
) : /* @__PURE__ */
|
|
2323
|
+
) : /* @__PURE__ */ React49.createElement(
|
|
2170
2324
|
ControlToggleButtonGroup,
|
|
2171
2325
|
{
|
|
2172
2326
|
...toggleButtonGroupProps,
|
|
@@ -2180,9 +2334,9 @@ var ToggleControl = createControl(
|
|
|
2180
2334
|
);
|
|
2181
2335
|
|
|
2182
2336
|
// src/controls/number-control.tsx
|
|
2183
|
-
var
|
|
2184
|
-
var
|
|
2185
|
-
var
|
|
2337
|
+
var React50 = __toESM(require("react"));
|
|
2338
|
+
var import_editor_props17 = require("@elementor/editor-props");
|
|
2339
|
+
var import_ui37 = require("@elementor/ui");
|
|
2186
2340
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
2187
2341
|
var NumberControl = createControl(
|
|
2188
2342
|
({
|
|
@@ -2193,7 +2347,7 @@ var NumberControl = createControl(
|
|
|
2193
2347
|
shouldForceInt = false,
|
|
2194
2348
|
startIcon
|
|
2195
2349
|
}) => {
|
|
2196
|
-
const { value, setValue, placeholder, disabled, restoreValue } = useBoundProp(
|
|
2350
|
+
const { value, setValue, placeholder, disabled, restoreValue } = useBoundProp(import_editor_props17.numberPropTypeUtil);
|
|
2197
2351
|
const handleChange = (event) => {
|
|
2198
2352
|
const {
|
|
2199
2353
|
value: eventValue,
|
|
@@ -2211,7 +2365,7 @@ var NumberControl = createControl(
|
|
|
2211
2365
|
}
|
|
2212
2366
|
setValue(updatedValue, void 0, { validation: () => isInputValid });
|
|
2213
2367
|
};
|
|
2214
|
-
return /* @__PURE__ */
|
|
2368
|
+
return /* @__PURE__ */ React50.createElement(ControlActions, null, /* @__PURE__ */ React50.createElement(
|
|
2215
2369
|
NumberInput,
|
|
2216
2370
|
{
|
|
2217
2371
|
size: "tiny",
|
|
@@ -2224,7 +2378,7 @@ var NumberControl = createControl(
|
|
|
2224
2378
|
placeholder: labelPlaceholder ?? (isEmptyOrNaN(placeholder) ? "" : String(placeholder)),
|
|
2225
2379
|
inputProps: { step, min },
|
|
2226
2380
|
InputProps: {
|
|
2227
|
-
startAdornment: startIcon ? /* @__PURE__ */
|
|
2381
|
+
startAdornment: startIcon ? /* @__PURE__ */ React50.createElement(import_ui37.InputAdornment, { position: "start", disabled }, startIcon) : void 0
|
|
2228
2382
|
}
|
|
2229
2383
|
}
|
|
2230
2384
|
));
|
|
@@ -2232,17 +2386,17 @@ var NumberControl = createControl(
|
|
|
2232
2386
|
);
|
|
2233
2387
|
|
|
2234
2388
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
2235
|
-
var
|
|
2236
|
-
var
|
|
2237
|
-
var
|
|
2238
|
-
var
|
|
2239
|
-
var
|
|
2389
|
+
var React52 = __toESM(require("react"));
|
|
2390
|
+
var import_react23 = require("react");
|
|
2391
|
+
var import_editor_props18 = require("@elementor/editor-props");
|
|
2392
|
+
var import_ui39 = require("@elementor/ui");
|
|
2393
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
2240
2394
|
|
|
2241
2395
|
// src/components/control-label.tsx
|
|
2242
|
-
var
|
|
2243
|
-
var
|
|
2396
|
+
var React51 = __toESM(require("react"));
|
|
2397
|
+
var import_ui38 = require("@elementor/ui");
|
|
2244
2398
|
var ControlLabel = ({ children }) => {
|
|
2245
|
-
return /* @__PURE__ */
|
|
2399
|
+
return /* @__PURE__ */ React51.createElement(import_ui38.Stack, { direction: "row", alignItems: "center", justifyItems: "start", gap: 0.25 }, /* @__PURE__ */ React51.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React51.createElement(ControlAdornments, null));
|
|
2246
2400
|
};
|
|
2247
2401
|
|
|
2248
2402
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
@@ -2263,22 +2417,22 @@ function EqualUnequalSizesControl({
|
|
|
2263
2417
|
items: items2,
|
|
2264
2418
|
multiSizePropTypeUtil
|
|
2265
2419
|
}) {
|
|
2266
|
-
const popupId = (0,
|
|
2267
|
-
const popupState = (0,
|
|
2420
|
+
const popupId = (0, import_react23.useId)();
|
|
2421
|
+
const popupState = (0, import_ui39.usePopupState)({ variant: "popover", popupId });
|
|
2268
2422
|
const {
|
|
2269
2423
|
propType: multiSizePropType,
|
|
2270
2424
|
value: multiSizeValue,
|
|
2271
2425
|
setValue: setMultiSizeValue,
|
|
2272
2426
|
disabled: multiSizeDisabled
|
|
2273
2427
|
} = useBoundProp(multiSizePropTypeUtil);
|
|
2274
|
-
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(
|
|
2275
|
-
const rowRefs = [(0,
|
|
2428
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(import_editor_props18.sizePropTypeUtil);
|
|
2429
|
+
const rowRefs = [(0, import_react23.useRef)(null), (0, import_react23.useRef)(null)];
|
|
2276
2430
|
const splitEqualValue = () => {
|
|
2277
2431
|
if (!sizeValue) {
|
|
2278
2432
|
return null;
|
|
2279
2433
|
}
|
|
2280
2434
|
return items2.reduce(
|
|
2281
|
-
(acc, { bind }) => ({ ...acc, [bind]:
|
|
2435
|
+
(acc, { bind }) => ({ ...acc, [bind]: import_editor_props18.sizePropTypeUtil.create(sizeValue) }),
|
|
2282
2436
|
{}
|
|
2283
2437
|
);
|
|
2284
2438
|
};
|
|
@@ -2301,25 +2455,25 @@ function EqualUnequalSizesControl({
|
|
|
2301
2455
|
};
|
|
2302
2456
|
const isShowingGeneralIndicator = !popupState.isOpen;
|
|
2303
2457
|
const isMixed = !!multiSizeValue;
|
|
2304
|
-
return /* @__PURE__ */
|
|
2458
|
+
return /* @__PURE__ */ React52.createElement(React52.Fragment, null, /* @__PURE__ */ React52.createElement(import_ui39.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: rowRefs[0] }, /* @__PURE__ */ React52.createElement(import_ui39.Grid, { item: true, xs: 6 }, !isShowingGeneralIndicator ? /* @__PURE__ */ React52.createElement(ControlFormLabel, null, label) : /* @__PURE__ */ React52.createElement(ControlLabel, null, label)), /* @__PURE__ */ React52.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(import_ui39.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React52.createElement(
|
|
2305
2459
|
SizeControl,
|
|
2306
2460
|
{
|
|
2307
|
-
placeholder: isMixed ? (0,
|
|
2461
|
+
placeholder: isMixed ? (0, import_i18n16.__)("Mixed", "elementor") : void 0,
|
|
2308
2462
|
anchorRef: rowRefs[0]
|
|
2309
2463
|
}
|
|
2310
|
-
), /* @__PURE__ */
|
|
2311
|
-
|
|
2464
|
+
), /* @__PURE__ */ React52.createElement(import_ui39.Tooltip, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React52.createElement(
|
|
2465
|
+
import_ui39.ToggleButton,
|
|
2312
2466
|
{
|
|
2313
2467
|
size: "tiny",
|
|
2314
2468
|
value: "check",
|
|
2315
2469
|
sx: { marginLeft: "auto" },
|
|
2316
|
-
...(0,
|
|
2470
|
+
...(0, import_ui39.bindToggle)(popupState),
|
|
2317
2471
|
selected: popupState.isOpen,
|
|
2318
2472
|
"aria-label": tooltipLabel
|
|
2319
2473
|
},
|
|
2320
2474
|
icon
|
|
2321
|
-
))))), /* @__PURE__ */
|
|
2322
|
-
|
|
2475
|
+
))))), /* @__PURE__ */ React52.createElement(
|
|
2476
|
+
import_ui39.Popover,
|
|
2323
2477
|
{
|
|
2324
2478
|
disablePortal: true,
|
|
2325
2479
|
disableScrollLock: true,
|
|
@@ -2331,12 +2485,12 @@ function EqualUnequalSizesControl({
|
|
|
2331
2485
|
vertical: "top",
|
|
2332
2486
|
horizontal: "right"
|
|
2333
2487
|
},
|
|
2334
|
-
...(0,
|
|
2488
|
+
...(0, import_ui39.bindPopover)(popupState),
|
|
2335
2489
|
slotProps: {
|
|
2336
2490
|
paper: { sx: { mt: 0.5, width: rowRefs[0].current?.getBoundingClientRect().width } }
|
|
2337
2491
|
}
|
|
2338
2492
|
},
|
|
2339
|
-
/* @__PURE__ */
|
|
2493
|
+
/* @__PURE__ */ React52.createElement(
|
|
2340
2494
|
PropProvider,
|
|
2341
2495
|
{
|
|
2342
2496
|
propType: multiSizePropType,
|
|
@@ -2344,21 +2498,21 @@ function EqualUnequalSizesControl({
|
|
|
2344
2498
|
setValue: setNestedProp,
|
|
2345
2499
|
isDisabled: () => multiSizeDisabled
|
|
2346
2500
|
},
|
|
2347
|
-
/* @__PURE__ */
|
|
2501
|
+
/* @__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] })))
|
|
2348
2502
|
)
|
|
2349
2503
|
));
|
|
2350
2504
|
}
|
|
2351
2505
|
var MultiSizeValueControl = ({ item, rowRef }) => {
|
|
2352
|
-
return /* @__PURE__ */
|
|
2506
|
+
return /* @__PURE__ */ React52.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React52.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React52.createElement(import_ui39.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React52.createElement(import_ui39.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React52.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React52.createElement(import_ui39.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React52.createElement(SizeControl, { startIcon: item.icon, anchorRef: rowRef })))));
|
|
2353
2507
|
};
|
|
2354
2508
|
|
|
2355
2509
|
// src/controls/linked-dimensions-control.tsx
|
|
2356
|
-
var
|
|
2357
|
-
var
|
|
2358
|
-
var
|
|
2359
|
-
var
|
|
2360
|
-
var
|
|
2361
|
-
var
|
|
2510
|
+
var React53 = __toESM(require("react"));
|
|
2511
|
+
var import_react24 = require("react");
|
|
2512
|
+
var import_editor_props19 = require("@elementor/editor-props");
|
|
2513
|
+
var import_icons10 = require("@elementor/icons");
|
|
2514
|
+
var import_ui40 = require("@elementor/ui");
|
|
2515
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
2362
2516
|
var LinkedDimensionsControl = ({
|
|
2363
2517
|
label,
|
|
2364
2518
|
isSiteRtl = false,
|
|
@@ -2370,15 +2524,15 @@ var LinkedDimensionsControl = ({
|
|
|
2370
2524
|
setValue: setSizeValue,
|
|
2371
2525
|
disabled: sizeDisabled,
|
|
2372
2526
|
placeholder: sizePlaceholder
|
|
2373
|
-
} = useBoundProp(
|
|
2374
|
-
const gridRowRefs = [(0,
|
|
2527
|
+
} = useBoundProp(import_editor_props19.sizePropTypeUtil);
|
|
2528
|
+
const gridRowRefs = [(0, import_react24.useRef)(null), (0, import_react24.useRef)(null)];
|
|
2375
2529
|
const {
|
|
2376
2530
|
value: dimensionsValue,
|
|
2377
2531
|
setValue: setDimensionsValue,
|
|
2378
2532
|
propType,
|
|
2379
2533
|
placeholder: dimensionsPlaceholder,
|
|
2380
2534
|
disabled: dimensionsDisabled
|
|
2381
|
-
} = useBoundProp(
|
|
2535
|
+
} = useBoundProp(import_editor_props19.dimensionsPropTypeUtil);
|
|
2382
2536
|
const hasUserValues = !!(dimensionsValue || sizeValue);
|
|
2383
2537
|
const hasPlaceholders = !!(sizePlaceholder || dimensionsPlaceholder);
|
|
2384
2538
|
const isLinked = !hasUserValues && !hasPlaceholders || (hasPlaceholders ? !!sizePlaceholder : !!sizeValue);
|
|
@@ -2387,7 +2541,7 @@ var LinkedDimensionsControl = ({
|
|
|
2387
2541
|
setSizeValue(dimensionsValue["block-start"]?.value ?? null);
|
|
2388
2542
|
return;
|
|
2389
2543
|
}
|
|
2390
|
-
const value = sizeValue ?
|
|
2544
|
+
const value = sizeValue ? import_editor_props19.sizePropTypeUtil.create(sizeValue) : null;
|
|
2391
2545
|
setDimensionsValue({
|
|
2392
2546
|
"block-start": value,
|
|
2393
2547
|
"block-end": value,
|
|
@@ -2396,11 +2550,11 @@ var LinkedDimensionsControl = ({
|
|
|
2396
2550
|
});
|
|
2397
2551
|
};
|
|
2398
2552
|
const tooltipLabel = label.toLowerCase();
|
|
2399
|
-
const LinkedIcon = isLinked ?
|
|
2400
|
-
const linkedLabel = (0,
|
|
2401
|
-
const unlinkedLabel = (0,
|
|
2553
|
+
const LinkedIcon = isLinked ? import_icons10.LinkIcon : import_icons10.DetachIcon;
|
|
2554
|
+
const linkedLabel = (0, import_i18n17.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2555
|
+
const unlinkedLabel = (0, import_i18n17.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
2402
2556
|
const disabled = sizeDisabled || dimensionsDisabled;
|
|
2403
|
-
return /* @__PURE__ */
|
|
2557
|
+
return /* @__PURE__ */ React53.createElement(
|
|
2404
2558
|
PropProvider,
|
|
2405
2559
|
{
|
|
2406
2560
|
propType,
|
|
@@ -2409,7 +2563,7 @@ var LinkedDimensionsControl = ({
|
|
|
2409
2563
|
placeholder: dimensionsPlaceholder,
|
|
2410
2564
|
isDisabled: () => disabled
|
|
2411
2565
|
},
|
|
2412
|
-
/* @__PURE__ */
|
|
2566
|
+
/* @__PURE__ */ React53.createElement(import_ui40.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React53.createElement(ControlFormLabel, null, label), /* @__PURE__ */ React53.createElement(import_ui40.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React53.createElement(
|
|
2413
2567
|
StyledToggleButton,
|
|
2414
2568
|
{
|
|
2415
2569
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -2421,9 +2575,9 @@ var LinkedDimensionsControl = ({
|
|
|
2421
2575
|
disabled,
|
|
2422
2576
|
isPlaceholder: hasPlaceholders
|
|
2423
2577
|
},
|
|
2424
|
-
/* @__PURE__ */
|
|
2578
|
+
/* @__PURE__ */ React53.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2425
2579
|
))),
|
|
2426
|
-
getCssDimensionProps(isSiteRtl).map((row, index) => /* @__PURE__ */
|
|
2580
|
+
getCssDimensionProps(isSiteRtl).map((row, index) => /* @__PURE__ */ React53.createElement(import_ui40.Stack, { direction: "row", gap: 2, flexWrap: "nowrap", key: index, ref: gridRowRefs[index] }, row.map(({ icon, ...props }) => /* @__PURE__ */ React53.createElement(import_ui40.Grid, { container: true, gap: 0.75, alignItems: "center", key: props.bind }, /* @__PURE__ */ React53.createElement(import_ui40.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(Label, { ...props })), /* @__PURE__ */ React53.createElement(import_ui40.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React53.createElement(
|
|
2427
2581
|
Control3,
|
|
2428
2582
|
{
|
|
2429
2583
|
bind: props.bind,
|
|
@@ -2445,7 +2599,7 @@ var Control3 = ({
|
|
|
2445
2599
|
min
|
|
2446
2600
|
}) => {
|
|
2447
2601
|
if (isLinked) {
|
|
2448
|
-
return /* @__PURE__ */
|
|
2602
|
+
return /* @__PURE__ */ React53.createElement(
|
|
2449
2603
|
SizeControl,
|
|
2450
2604
|
{
|
|
2451
2605
|
startIcon,
|
|
@@ -2455,7 +2609,7 @@ var Control3 = ({
|
|
|
2455
2609
|
}
|
|
2456
2610
|
);
|
|
2457
2611
|
}
|
|
2458
|
-
return /* @__PURE__ */
|
|
2612
|
+
return /* @__PURE__ */ React53.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React53.createElement(
|
|
2459
2613
|
SizeControl,
|
|
2460
2614
|
{
|
|
2461
2615
|
startIcon,
|
|
@@ -2466,51 +2620,51 @@ var Control3 = ({
|
|
|
2466
2620
|
));
|
|
2467
2621
|
};
|
|
2468
2622
|
var Label = ({ label, bind }) => {
|
|
2469
|
-
return /* @__PURE__ */
|
|
2623
|
+
return /* @__PURE__ */ React53.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React53.createElement(ControlLabel, null, label));
|
|
2470
2624
|
};
|
|
2471
2625
|
function getCssDimensionProps(isSiteRtl) {
|
|
2472
2626
|
return [
|
|
2473
2627
|
[
|
|
2474
2628
|
{
|
|
2475
2629
|
bind: "block-start",
|
|
2476
|
-
label: (0,
|
|
2477
|
-
icon: /* @__PURE__ */
|
|
2630
|
+
label: (0, import_i18n17.__)("Top", "elementor"),
|
|
2631
|
+
icon: /* @__PURE__ */ React53.createElement(import_icons10.SideTopIcon, { fontSize: "tiny" })
|
|
2478
2632
|
},
|
|
2479
2633
|
{
|
|
2480
2634
|
bind: "inline-end",
|
|
2481
|
-
label: isSiteRtl ? (0,
|
|
2482
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2635
|
+
label: isSiteRtl ? (0, import_i18n17.__)("Left", "elementor") : (0, import_i18n17.__)("Right", "elementor"),
|
|
2636
|
+
icon: isSiteRtl ? /* @__PURE__ */ React53.createElement(import_icons10.SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React53.createElement(import_icons10.SideRightIcon, { fontSize: "tiny" })
|
|
2483
2637
|
}
|
|
2484
2638
|
],
|
|
2485
2639
|
[
|
|
2486
2640
|
{
|
|
2487
2641
|
bind: "block-end",
|
|
2488
|
-
label: (0,
|
|
2489
|
-
icon: /* @__PURE__ */
|
|
2642
|
+
label: (0, import_i18n17.__)("Bottom", "elementor"),
|
|
2643
|
+
icon: /* @__PURE__ */ React53.createElement(import_icons10.SideBottomIcon, { fontSize: "tiny" })
|
|
2490
2644
|
},
|
|
2491
2645
|
{
|
|
2492
2646
|
bind: "inline-start",
|
|
2493
|
-
label: isSiteRtl ? (0,
|
|
2494
|
-
icon: isSiteRtl ? /* @__PURE__ */
|
|
2647
|
+
label: isSiteRtl ? (0, import_i18n17.__)("Right", "elementor") : (0, import_i18n17.__)("Left", "elementor"),
|
|
2648
|
+
icon: isSiteRtl ? /* @__PURE__ */ React53.createElement(import_icons10.SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React53.createElement(import_icons10.SideLeftIcon, { fontSize: "tiny" })
|
|
2495
2649
|
}
|
|
2496
2650
|
]
|
|
2497
2651
|
];
|
|
2498
2652
|
}
|
|
2499
2653
|
|
|
2500
2654
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2501
|
-
var
|
|
2502
|
-
var
|
|
2503
|
-
var
|
|
2504
|
-
var
|
|
2505
|
-
var
|
|
2655
|
+
var React55 = __toESM(require("react"));
|
|
2656
|
+
var import_editor_props20 = require("@elementor/editor-props");
|
|
2657
|
+
var import_icons11 = require("@elementor/icons");
|
|
2658
|
+
var import_ui42 = require("@elementor/ui");
|
|
2659
|
+
var import_i18n19 = require("@wordpress/i18n");
|
|
2506
2660
|
|
|
2507
2661
|
// src/components/item-selector.tsx
|
|
2508
|
-
var
|
|
2509
|
-
var
|
|
2662
|
+
var React54 = __toESM(require("react"));
|
|
2663
|
+
var import_react25 = require("react");
|
|
2510
2664
|
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
2511
|
-
var
|
|
2512
|
-
var
|
|
2513
|
-
var
|
|
2665
|
+
var import_ui41 = require("@elementor/ui");
|
|
2666
|
+
var import_utils3 = require("@elementor/utils");
|
|
2667
|
+
var import_i18n18 = require("@wordpress/i18n");
|
|
2514
2668
|
|
|
2515
2669
|
// src/hooks/use-filtered-items-list.ts
|
|
2516
2670
|
var useFilteredItemsList = (itemsList, searchValue) => {
|
|
@@ -2541,7 +2695,7 @@ var ItemSelector = ({
|
|
|
2541
2695
|
},
|
|
2542
2696
|
icon
|
|
2543
2697
|
}) => {
|
|
2544
|
-
const [searchValue, setSearchValue] = (0,
|
|
2698
|
+
const [searchValue, setSearchValue] = (0, import_react25.useState)("");
|
|
2545
2699
|
const filteredItemsList = useFilteredItemsList(itemsList, searchValue);
|
|
2546
2700
|
const IconComponent = icon;
|
|
2547
2701
|
const handleSearch = (value) => {
|
|
@@ -2551,14 +2705,14 @@ var ItemSelector = ({
|
|
|
2551
2705
|
setSearchValue("");
|
|
2552
2706
|
onClose();
|
|
2553
2707
|
};
|
|
2554
|
-
return /* @__PURE__ */
|
|
2708
|
+
return /* @__PURE__ */ React54.createElement(import_editor_ui4.PopoverBody, { width: sectionWidth }, /* @__PURE__ */ React54.createElement(import_editor_ui4.PopoverHeader, { title, onClose: handleClose, icon: /* @__PURE__ */ React54.createElement(IconComponent, { fontSize: "tiny" }) }), /* @__PURE__ */ React54.createElement(
|
|
2555
2709
|
import_editor_ui4.PopoverSearch,
|
|
2556
2710
|
{
|
|
2557
2711
|
value: searchValue,
|
|
2558
2712
|
onSearch: handleSearch,
|
|
2559
|
-
placeholder: (0,
|
|
2713
|
+
placeholder: (0, import_i18n18.__)("Search", "elementor")
|
|
2560
2714
|
}
|
|
2561
|
-
), /* @__PURE__ */
|
|
2715
|
+
), /* @__PURE__ */ React54.createElement(import_ui41.Divider, null), filteredItemsList.length > 0 ? /* @__PURE__ */ React54.createElement(
|
|
2562
2716
|
ItemList,
|
|
2563
2717
|
{
|
|
2564
2718
|
itemListItems: filteredItemsList,
|
|
@@ -2568,8 +2722,8 @@ var ItemSelector = ({
|
|
|
2568
2722
|
itemStyle,
|
|
2569
2723
|
onDebounce
|
|
2570
2724
|
}
|
|
2571
|
-
) : /* @__PURE__ */
|
|
2572
|
-
|
|
2725
|
+
) : /* @__PURE__ */ React54.createElement(
|
|
2726
|
+
import_ui41.Stack,
|
|
2573
2727
|
{
|
|
2574
2728
|
alignItems: "center",
|
|
2575
2729
|
justifyContent: "center",
|
|
@@ -2578,43 +2732,43 @@ var ItemSelector = ({
|
|
|
2578
2732
|
gap: 1.5,
|
|
2579
2733
|
overflow: "hidden"
|
|
2580
2734
|
},
|
|
2581
|
-
/* @__PURE__ */
|
|
2582
|
-
/* @__PURE__ */
|
|
2583
|
-
|
|
2735
|
+
/* @__PURE__ */ React54.createElement(IconComponent, { fontSize: "large" }),
|
|
2736
|
+
/* @__PURE__ */ React54.createElement(import_ui41.Box, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React54.createElement(import_ui41.Typography, { align: "center", variant: "subtitle2", color: "text.secondary" }, (0, import_i18n18.__)("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React54.createElement(
|
|
2737
|
+
import_ui41.Typography,
|
|
2584
2738
|
{
|
|
2585
2739
|
variant: "subtitle2",
|
|
2586
2740
|
color: "text.secondary",
|
|
2587
2741
|
sx: { display: "flex", width: "100%", justifyContent: "center" }
|
|
2588
2742
|
},
|
|
2589
|
-
/* @__PURE__ */
|
|
2590
|
-
/* @__PURE__ */
|
|
2591
|
-
|
|
2743
|
+
/* @__PURE__ */ React54.createElement("span", null, "\u201C"),
|
|
2744
|
+
/* @__PURE__ */ React54.createElement(
|
|
2745
|
+
import_ui41.Box,
|
|
2592
2746
|
{
|
|
2593
2747
|
component: "span",
|
|
2594
2748
|
sx: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" }
|
|
2595
2749
|
},
|
|
2596
2750
|
searchValue
|
|
2597
2751
|
),
|
|
2598
|
-
/* @__PURE__ */
|
|
2752
|
+
/* @__PURE__ */ React54.createElement("span", null, "\u201D.")
|
|
2599
2753
|
)),
|
|
2600
|
-
/* @__PURE__ */
|
|
2601
|
-
|
|
2754
|
+
/* @__PURE__ */ React54.createElement(
|
|
2755
|
+
import_ui41.Typography,
|
|
2602
2756
|
{
|
|
2603
2757
|
align: "center",
|
|
2604
2758
|
variant: "caption",
|
|
2605
2759
|
color: "text.secondary",
|
|
2606
2760
|
sx: { display: "flex", flexDirection: "column" }
|
|
2607
2761
|
},
|
|
2608
|
-
(0,
|
|
2609
|
-
/* @__PURE__ */
|
|
2610
|
-
|
|
2762
|
+
(0, import_i18n18.__)("Try something else.", "elementor"),
|
|
2763
|
+
/* @__PURE__ */ React54.createElement(
|
|
2764
|
+
import_ui41.Link,
|
|
2611
2765
|
{
|
|
2612
2766
|
color: "secondary",
|
|
2613
2767
|
variant: "caption",
|
|
2614
2768
|
component: "button",
|
|
2615
2769
|
onClick: () => setSearchValue("")
|
|
2616
2770
|
},
|
|
2617
|
-
(0,
|
|
2771
|
+
(0, import_i18n18.__)("Clear & try again", "elementor")
|
|
2618
2772
|
)
|
|
2619
2773
|
)
|
|
2620
2774
|
));
|
|
@@ -2637,8 +2791,8 @@ var ItemList = ({
|
|
|
2637
2791
|
}
|
|
2638
2792
|
});
|
|
2639
2793
|
}, 100);
|
|
2640
|
-
const memoizedItemStyle = (0,
|
|
2641
|
-
return /* @__PURE__ */
|
|
2794
|
+
const memoizedItemStyle = (0, import_react25.useCallback)((item) => itemStyle(item), [itemStyle]);
|
|
2795
|
+
return /* @__PURE__ */ React54.createElement(
|
|
2642
2796
|
import_editor_ui4.PopoverMenuList,
|
|
2643
2797
|
{
|
|
2644
2798
|
items: itemListItems,
|
|
@@ -2652,8 +2806,8 @@ var ItemList = ({
|
|
|
2652
2806
|
);
|
|
2653
2807
|
};
|
|
2654
2808
|
var useDebounce = (fn, delay) => {
|
|
2655
|
-
const [debouncedFn] = (0,
|
|
2656
|
-
(0,
|
|
2809
|
+
const [debouncedFn] = (0, import_react25.useState)(() => (0, import_utils3.debounce)(fn, delay));
|
|
2810
|
+
(0, import_react25.useEffect)(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
2657
2811
|
return debouncedFn;
|
|
2658
2812
|
};
|
|
2659
2813
|
|
|
@@ -2665,22 +2819,22 @@ var enqueueFont = (fontFamily, context = "editor") => {
|
|
|
2665
2819
|
|
|
2666
2820
|
// src/controls/font-family-control/font-family-control.tsx
|
|
2667
2821
|
var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
2668
|
-
const { value: fontFamily, setValue: setFontFamily, disabled, placeholder } = useBoundProp(
|
|
2669
|
-
const popoverState = (0,
|
|
2822
|
+
const { value: fontFamily, setValue: setFontFamily, disabled, placeholder } = useBoundProp(import_editor_props20.stringPropTypeUtil);
|
|
2823
|
+
const popoverState = (0, import_ui42.usePopupState)({ variant: "popover" });
|
|
2670
2824
|
const isShowingPlaceholder = !fontFamily && placeholder;
|
|
2671
|
-
const mapFontSubs =
|
|
2825
|
+
const mapFontSubs = React55.useMemo(() => {
|
|
2672
2826
|
return fontFamilies.map(({ label, fonts }) => ({
|
|
2673
2827
|
label,
|
|
2674
2828
|
items: fonts
|
|
2675
2829
|
}));
|
|
2676
2830
|
}, [fontFamilies]);
|
|
2677
|
-
return /* @__PURE__ */
|
|
2678
|
-
|
|
2831
|
+
return /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(ControlActions, null, /* @__PURE__ */ React55.createElement(
|
|
2832
|
+
import_ui42.UnstableTag,
|
|
2679
2833
|
{
|
|
2680
2834
|
variant: "outlined",
|
|
2681
2835
|
label: fontFamily || placeholder,
|
|
2682
|
-
endIcon: /* @__PURE__ */
|
|
2683
|
-
...(0,
|
|
2836
|
+
endIcon: /* @__PURE__ */ React55.createElement(import_icons11.ChevronDownIcon, { fontSize: "tiny" }),
|
|
2837
|
+
...(0, import_ui42.bindTrigger)(popoverState),
|
|
2684
2838
|
fullWidth: true,
|
|
2685
2839
|
disabled,
|
|
2686
2840
|
sx: isShowingPlaceholder ? {
|
|
@@ -2690,17 +2844,17 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2690
2844
|
textTransform: "capitalize"
|
|
2691
2845
|
} : void 0
|
|
2692
2846
|
}
|
|
2693
|
-
)), /* @__PURE__ */
|
|
2694
|
-
|
|
2847
|
+
)), /* @__PURE__ */ React55.createElement(
|
|
2848
|
+
import_ui42.Popover,
|
|
2695
2849
|
{
|
|
2696
2850
|
disablePortal: true,
|
|
2697
2851
|
disableScrollLock: true,
|
|
2698
2852
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
2699
2853
|
transformOrigin: { vertical: "top", horizontal: "right" },
|
|
2700
2854
|
sx: { my: 1.5 },
|
|
2701
|
-
...(0,
|
|
2855
|
+
...(0, import_ui42.bindPopover)(popoverState)
|
|
2702
2856
|
},
|
|
2703
|
-
/* @__PURE__ */
|
|
2857
|
+
/* @__PURE__ */ React55.createElement(
|
|
2704
2858
|
ItemSelector,
|
|
2705
2859
|
{
|
|
2706
2860
|
itemsList: mapFontSubs,
|
|
@@ -2708,24 +2862,24 @@ var FontFamilyControl = createControl(({ fontFamilies, sectionWidth }) => {
|
|
|
2708
2862
|
onItemChange: setFontFamily,
|
|
2709
2863
|
onClose: popoverState.close,
|
|
2710
2864
|
sectionWidth,
|
|
2711
|
-
title: (0,
|
|
2865
|
+
title: (0, import_i18n19.__)("Font Family", "elementor"),
|
|
2712
2866
|
itemStyle: (item) => ({ fontFamily: item.value }),
|
|
2713
2867
|
onDebounce: enqueueFont,
|
|
2714
|
-
icon:
|
|
2868
|
+
icon: import_icons11.TextIcon
|
|
2715
2869
|
}
|
|
2716
2870
|
)
|
|
2717
2871
|
));
|
|
2718
2872
|
});
|
|
2719
2873
|
|
|
2720
2874
|
// src/controls/url-control.tsx
|
|
2721
|
-
var
|
|
2722
|
-
var
|
|
2723
|
-
var
|
|
2875
|
+
var React56 = __toESM(require("react"));
|
|
2876
|
+
var import_editor_props21 = require("@elementor/editor-props");
|
|
2877
|
+
var import_ui43 = require("@elementor/ui");
|
|
2724
2878
|
var UrlControl = createControl(({ placeholder }) => {
|
|
2725
|
-
const { value, setValue, disabled } = useBoundProp(
|
|
2879
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props21.urlPropTypeUtil);
|
|
2726
2880
|
const handleChange = (event) => setValue(event.target.value);
|
|
2727
|
-
return /* @__PURE__ */
|
|
2728
|
-
|
|
2881
|
+
return /* @__PURE__ */ React56.createElement(ControlActions, null, /* @__PURE__ */ React56.createElement(
|
|
2882
|
+
import_ui43.TextField,
|
|
2729
2883
|
{
|
|
2730
2884
|
size: "tiny",
|
|
2731
2885
|
fullWidth: true,
|
|
@@ -2738,23 +2892,23 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
2738
2892
|
});
|
|
2739
2893
|
|
|
2740
2894
|
// src/controls/link-control.tsx
|
|
2741
|
-
var
|
|
2742
|
-
var
|
|
2895
|
+
var React60 = __toESM(require("react"));
|
|
2896
|
+
var import_react27 = require("react");
|
|
2743
2897
|
var import_editor_elements2 = require("@elementor/editor-elements");
|
|
2744
|
-
var
|
|
2898
|
+
var import_editor_props23 = require("@elementor/editor-props");
|
|
2745
2899
|
var import_http_client2 = require("@elementor/http-client");
|
|
2746
|
-
var
|
|
2900
|
+
var import_icons14 = require("@elementor/icons");
|
|
2747
2901
|
var import_session = require("@elementor/session");
|
|
2748
|
-
var
|
|
2749
|
-
var
|
|
2750
|
-
var
|
|
2902
|
+
var import_ui47 = require("@elementor/ui");
|
|
2903
|
+
var import_utils4 = require("@elementor/utils");
|
|
2904
|
+
var import_i18n21 = require("@wordpress/i18n");
|
|
2751
2905
|
|
|
2752
2906
|
// src/components/autocomplete.tsx
|
|
2753
|
-
var
|
|
2754
|
-
var
|
|
2755
|
-
var
|
|
2756
|
-
var
|
|
2757
|
-
var Autocomplete = (0,
|
|
2907
|
+
var React57 = __toESM(require("react"));
|
|
2908
|
+
var import_react26 = require("react");
|
|
2909
|
+
var import_icons12 = require("@elementor/icons");
|
|
2910
|
+
var import_ui44 = require("@elementor/ui");
|
|
2911
|
+
var Autocomplete = (0, import_react26.forwardRef)((props, ref) => {
|
|
2758
2912
|
const {
|
|
2759
2913
|
options,
|
|
2760
2914
|
onOptionChange,
|
|
@@ -2770,8 +2924,8 @@ var Autocomplete = (0, import_react25.forwardRef)((props, ref) => {
|
|
|
2770
2924
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
2771
2925
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
2772
2926
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
2773
|
-
return /* @__PURE__ */
|
|
2774
|
-
|
|
2927
|
+
return /* @__PURE__ */ React57.createElement(
|
|
2928
|
+
import_ui44.Autocomplete,
|
|
2775
2929
|
{
|
|
2776
2930
|
...restProps,
|
|
2777
2931
|
ref,
|
|
@@ -2788,8 +2942,8 @@ var Autocomplete = (0, import_react25.forwardRef)((props, ref) => {
|
|
|
2788
2942
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
2789
2943
|
isOptionEqualToValue,
|
|
2790
2944
|
filterOptions: () => optionKeys,
|
|
2791
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
2792
|
-
renderInput: (params) => /* @__PURE__ */
|
|
2945
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React57.createElement(import_ui44.Box, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
2946
|
+
renderInput: (params) => /* @__PURE__ */ React57.createElement(
|
|
2793
2947
|
TextInput,
|
|
2794
2948
|
{
|
|
2795
2949
|
params,
|
|
@@ -2812,8 +2966,8 @@ var TextInput = ({
|
|
|
2812
2966
|
const onChange = (event) => {
|
|
2813
2967
|
handleChange(event.target.value);
|
|
2814
2968
|
};
|
|
2815
|
-
return /* @__PURE__ */
|
|
2816
|
-
|
|
2969
|
+
return /* @__PURE__ */ React57.createElement(
|
|
2970
|
+
import_ui44.TextField,
|
|
2817
2971
|
{
|
|
2818
2972
|
...params,
|
|
2819
2973
|
placeholder,
|
|
@@ -2825,7 +2979,7 @@ var TextInput = ({
|
|
|
2825
2979
|
},
|
|
2826
2980
|
InputProps: {
|
|
2827
2981
|
...params.InputProps,
|
|
2828
|
-
endAdornment: /* @__PURE__ */
|
|
2982
|
+
endAdornment: /* @__PURE__ */ React57.createElement(ClearButton, { params, allowClear, handleChange })
|
|
2829
2983
|
}
|
|
2830
2984
|
}
|
|
2831
2985
|
);
|
|
@@ -2834,7 +2988,7 @@ var ClearButton = ({
|
|
|
2834
2988
|
allowClear,
|
|
2835
2989
|
handleChange,
|
|
2836
2990
|
params
|
|
2837
|
-
}) => /* @__PURE__ */
|
|
2991
|
+
}) => /* @__PURE__ */ React57.createElement(import_ui44.InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React57.createElement(import_ui44.IconButton, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React57.createElement(import_icons12.XIcon, { fontSize: params.size })));
|
|
2838
2992
|
function findMatchingOption(options, optionId = null) {
|
|
2839
2993
|
const formattedOption = (optionId || "").toString();
|
|
2840
2994
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -2856,21 +3010,21 @@ function _factoryFilter(newValue, options, minInputLength) {
|
|
|
2856
3010
|
}
|
|
2857
3011
|
|
|
2858
3012
|
// src/components/restricted-link-infotip.tsx
|
|
2859
|
-
var
|
|
3013
|
+
var React58 = __toESM(require("react"));
|
|
2860
3014
|
var import_editor_elements = require("@elementor/editor-elements");
|
|
2861
|
-
var
|
|
2862
|
-
var
|
|
2863
|
-
var
|
|
3015
|
+
var import_icons13 = require("@elementor/icons");
|
|
3016
|
+
var import_ui45 = require("@elementor/ui");
|
|
3017
|
+
var import_i18n20 = require("@wordpress/i18n");
|
|
2864
3018
|
var learnMoreButton = {
|
|
2865
|
-
label: (0,
|
|
3019
|
+
label: (0, import_i18n20.__)("Learn More", "elementor"),
|
|
2866
3020
|
href: "https://go.elementor.com/element-link-inside-link-infotip"
|
|
2867
3021
|
};
|
|
2868
3022
|
var INFOTIP_CONTENT = {
|
|
2869
|
-
descendant: (0,
|
|
3023
|
+
descendant: (0, import_i18n20.__)(
|
|
2870
3024
|
"To add a link to this element, first remove the link from the elements inside of it.",
|
|
2871
3025
|
"elementor"
|
|
2872
3026
|
),
|
|
2873
|
-
ancestor: (0,
|
|
3027
|
+
ancestor: (0, import_i18n20.__)("To add a link to this element, first remove the link from its parent container.", "elementor")
|
|
2874
3028
|
};
|
|
2875
3029
|
var RestrictedLinkInfotip = ({
|
|
2876
3030
|
linkInLinkRestriction,
|
|
@@ -2883,48 +3037,48 @@ var RestrictedLinkInfotip = ({
|
|
|
2883
3037
|
(0, import_editor_elements.selectElement)(elementId);
|
|
2884
3038
|
}
|
|
2885
3039
|
};
|
|
2886
|
-
const content = /* @__PURE__ */
|
|
2887
|
-
|
|
3040
|
+
const content = /* @__PURE__ */ React58.createElement(
|
|
3041
|
+
import_ui45.Alert,
|
|
2888
3042
|
{
|
|
2889
3043
|
color: "secondary",
|
|
2890
|
-
icon: /* @__PURE__ */
|
|
2891
|
-
action: /* @__PURE__ */
|
|
2892
|
-
|
|
3044
|
+
icon: /* @__PURE__ */ React58.createElement(import_icons13.InfoCircleFilledIcon, null),
|
|
3045
|
+
action: /* @__PURE__ */ React58.createElement(
|
|
3046
|
+
import_ui45.AlertAction,
|
|
2893
3047
|
{
|
|
2894
3048
|
sx: { width: "fit-content" },
|
|
2895
3049
|
variant: "contained",
|
|
2896
3050
|
color: "secondary",
|
|
2897
3051
|
onClick: handleTakeMeClick
|
|
2898
3052
|
},
|
|
2899
|
-
(0,
|
|
3053
|
+
(0, import_i18n20.__)("Take me there", "elementor")
|
|
2900
3054
|
)
|
|
2901
3055
|
},
|
|
2902
|
-
/* @__PURE__ */
|
|
2903
|
-
/* @__PURE__ */
|
|
3056
|
+
/* @__PURE__ */ React58.createElement(import_ui45.AlertTitle, null, (0, import_i18n20.__)("Nested links", "elementor")),
|
|
3057
|
+
/* @__PURE__ */ React58.createElement(import_ui45.Box, { component: "span" }, INFOTIP_CONTENT[reason ?? "descendant"], " ", /* @__PURE__ */ React58.createElement(import_ui45.Link, { href: learnMoreButton.href, target: "_blank", color: "info.main" }, learnMoreButton.label))
|
|
2904
3058
|
);
|
|
2905
|
-
return shouldRestrict && isVisible ? /* @__PURE__ */
|
|
2906
|
-
|
|
3059
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React58.createElement(
|
|
3060
|
+
import_ui45.Infotip,
|
|
2907
3061
|
{
|
|
2908
3062
|
placement: "right",
|
|
2909
3063
|
content,
|
|
2910
3064
|
color: "secondary",
|
|
2911
3065
|
slotProps: { popper: { sx: { width: 300 } } }
|
|
2912
3066
|
},
|
|
2913
|
-
/* @__PURE__ */
|
|
2914
|
-
) : /* @__PURE__ */
|
|
3067
|
+
/* @__PURE__ */ React58.createElement(import_ui45.Box, null, children)
|
|
3068
|
+
) : /* @__PURE__ */ React58.createElement(React58.Fragment, null, children);
|
|
2915
3069
|
};
|
|
2916
3070
|
|
|
2917
3071
|
// src/controls/switch-control.tsx
|
|
2918
|
-
var
|
|
2919
|
-
var
|
|
2920
|
-
var
|
|
3072
|
+
var React59 = __toESM(require("react"));
|
|
3073
|
+
var import_editor_props22 = require("@elementor/editor-props");
|
|
3074
|
+
var import_ui46 = require("@elementor/ui");
|
|
2921
3075
|
var SwitchControl = createControl(() => {
|
|
2922
|
-
const { value, setValue, disabled } = useBoundProp(
|
|
3076
|
+
const { value, setValue, disabled } = useBoundProp(import_editor_props22.booleanPropTypeUtil);
|
|
2923
3077
|
const handleChange = (event) => {
|
|
2924
3078
|
setValue(event.target.checked);
|
|
2925
3079
|
};
|
|
2926
|
-
return /* @__PURE__ */
|
|
2927
|
-
|
|
3080
|
+
return /* @__PURE__ */ React59.createElement(import_ui46.Box, { sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React59.createElement(
|
|
3081
|
+
import_ui46.Switch,
|
|
2928
3082
|
{
|
|
2929
3083
|
checked: !!value,
|
|
2930
3084
|
onChange: handleChange,
|
|
@@ -2938,21 +3092,21 @@ var SwitchControl = createControl(() => {
|
|
|
2938
3092
|
});
|
|
2939
3093
|
|
|
2940
3094
|
// src/controls/link-control.tsx
|
|
2941
|
-
var
|
|
3095
|
+
var SIZE6 = "tiny";
|
|
2942
3096
|
var LinkControl = createControl((props) => {
|
|
2943
|
-
const { value, path, setValue, ...propContext } = useBoundProp(
|
|
3097
|
+
const { value, path, setValue, ...propContext } = useBoundProp(import_editor_props23.linkPropTypeUtil);
|
|
2944
3098
|
const [linkSessionValue, setLinkSessionValue] = (0, import_session.useSessionStorage)(path.join("/"));
|
|
2945
|
-
const [isActive, setIsActive] = (0,
|
|
3099
|
+
const [isActive, setIsActive] = (0, import_react27.useState)(!!value);
|
|
2946
3100
|
const {
|
|
2947
3101
|
allowCustomValues,
|
|
2948
3102
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
2949
3103
|
placeholder,
|
|
2950
3104
|
minInputLength = 2,
|
|
2951
3105
|
context: { elementId },
|
|
2952
|
-
label = (0,
|
|
3106
|
+
label = (0, import_i18n21.__)("Link", "elementor")
|
|
2953
3107
|
} = props || {};
|
|
2954
|
-
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0,
|
|
2955
|
-
const [options, setOptions] = (0,
|
|
3108
|
+
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0, import_react27.useState)((0, import_editor_elements2.getLinkInLinkRestriction)(elementId));
|
|
3109
|
+
const [options, setOptions] = (0, import_react27.useState)(
|
|
2956
3110
|
generateFirstLoadedOption(value)
|
|
2957
3111
|
);
|
|
2958
3112
|
const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
|
|
@@ -2977,8 +3131,8 @@ var LinkControl = createControl((props) => {
|
|
|
2977
3131
|
const onOptionChange = (newValue) => {
|
|
2978
3132
|
const valueToSave = newValue ? {
|
|
2979
3133
|
...value,
|
|
2980
|
-
destination:
|
|
2981
|
-
label:
|
|
3134
|
+
destination: import_editor_props23.numberPropTypeUtil.create(newValue),
|
|
3135
|
+
label: import_editor_props23.stringPropTypeUtil.create(findMatchingOption(options, newValue)?.label || null)
|
|
2982
3136
|
} : null;
|
|
2983
3137
|
onSaveNewValue(valueToSave);
|
|
2984
3138
|
};
|
|
@@ -2986,8 +3140,8 @@ var LinkControl = createControl((props) => {
|
|
|
2986
3140
|
newValue = newValue?.trim() || "";
|
|
2987
3141
|
const valueToSave = newValue ? {
|
|
2988
3142
|
...value,
|
|
2989
|
-
destination:
|
|
2990
|
-
label:
|
|
3143
|
+
destination: import_editor_props23.urlPropTypeUtil.create(newValue),
|
|
3144
|
+
label: import_editor_props23.stringPropTypeUtil.create("")
|
|
2991
3145
|
} : null;
|
|
2992
3146
|
onSaveNewValue(valueToSave);
|
|
2993
3147
|
updateOptions(newValue);
|
|
@@ -3003,8 +3157,8 @@ var LinkControl = createControl((props) => {
|
|
|
3003
3157
|
}
|
|
3004
3158
|
debounceFetch({ ...requestParams, term: newValue });
|
|
3005
3159
|
};
|
|
3006
|
-
const debounceFetch = (0,
|
|
3007
|
-
() => (0,
|
|
3160
|
+
const debounceFetch = (0, import_react27.useMemo)(
|
|
3161
|
+
() => (0, import_utils4.debounce)(
|
|
3008
3162
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
3009
3163
|
setOptions(formatOptions(newOptions));
|
|
3010
3164
|
}),
|
|
@@ -3012,8 +3166,8 @@ var LinkControl = createControl((props) => {
|
|
|
3012
3166
|
),
|
|
3013
3167
|
[endpoint]
|
|
3014
3168
|
);
|
|
3015
|
-
return /* @__PURE__ */
|
|
3016
|
-
|
|
3169
|
+
return /* @__PURE__ */ React60.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React60.createElement(import_ui47.Stack, { gap: 1.5 }, /* @__PURE__ */ React60.createElement(
|
|
3170
|
+
import_ui47.Stack,
|
|
3017
3171
|
{
|
|
3018
3172
|
direction: "row",
|
|
3019
3173
|
sx: {
|
|
@@ -3022,17 +3176,17 @@ var LinkControl = createControl((props) => {
|
|
|
3022
3176
|
marginInlineEnd: -0.75
|
|
3023
3177
|
}
|
|
3024
3178
|
},
|
|
3025
|
-
/* @__PURE__ */
|
|
3026
|
-
/* @__PURE__ */
|
|
3179
|
+
/* @__PURE__ */ React60.createElement(ControlFormLabel, null, label),
|
|
3180
|
+
/* @__PURE__ */ React60.createElement(RestrictedLinkInfotip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React60.createElement(
|
|
3027
3181
|
ToggleIconControl,
|
|
3028
3182
|
{
|
|
3029
3183
|
disabled: shouldDisableAddingLink,
|
|
3030
3184
|
active: isActive,
|
|
3031
3185
|
onIconClick: onEnabledChange,
|
|
3032
|
-
label: (0,
|
|
3186
|
+
label: (0, import_i18n21.__)("Toggle link", "elementor")
|
|
3033
3187
|
}
|
|
3034
3188
|
))
|
|
3035
|
-
), /* @__PURE__ */
|
|
3189
|
+
), /* @__PURE__ */ React60.createElement(import_ui47.Collapse, { in: isActive, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React60.createElement(import_ui47.Stack, { gap: 1.5 }, /* @__PURE__ */ React60.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React60.createElement(ControlActions, null, /* @__PURE__ */ React60.createElement(
|
|
3036
3190
|
Autocomplete,
|
|
3037
3191
|
{
|
|
3038
3192
|
options,
|
|
@@ -3043,10 +3197,10 @@ var LinkControl = createControl((props) => {
|
|
|
3043
3197
|
onTextChange,
|
|
3044
3198
|
minInputLength
|
|
3045
3199
|
}
|
|
3046
|
-
))), /* @__PURE__ */
|
|
3200
|
+
))), /* @__PURE__ */ React60.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React60.createElement(import_ui47.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React60.createElement(import_ui47.Grid, { item: true }, /* @__PURE__ */ React60.createElement(ControlFormLabel, null, (0, import_i18n21.__)("Open in a new tab", "elementor"))), /* @__PURE__ */ React60.createElement(import_ui47.Grid, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React60.createElement(SwitchControl, null))))))));
|
|
3047
3201
|
});
|
|
3048
3202
|
var ToggleIconControl = ({ disabled, active, onIconClick, label }) => {
|
|
3049
|
-
return /* @__PURE__ */
|
|
3203
|
+
return /* @__PURE__ */ React60.createElement(import_ui47.IconButton, { size: SIZE6, onClick: onIconClick, "aria-label": label, disabled }, active ? /* @__PURE__ */ React60.createElement(import_icons14.MinusIcon, { fontSize: SIZE6 }) : /* @__PURE__ */ React60.createElement(import_icons14.PlusIcon, { fontSize: SIZE6 }));
|
|
3050
3204
|
};
|
|
3051
3205
|
async function fetchOptions(ajaxUrl, params) {
|
|
3052
3206
|
if (!params || !ajaxUrl) {
|
|
@@ -3078,40 +3232,40 @@ function generateFirstLoadedOption(unionValue) {
|
|
|
3078
3232
|
}
|
|
3079
3233
|
|
|
3080
3234
|
// src/controls/gap-control.tsx
|
|
3081
|
-
var
|
|
3082
|
-
var
|
|
3083
|
-
var
|
|
3084
|
-
var
|
|
3085
|
-
var
|
|
3086
|
-
var
|
|
3235
|
+
var React61 = __toESM(require("react"));
|
|
3236
|
+
var import_react28 = require("react");
|
|
3237
|
+
var import_editor_props24 = require("@elementor/editor-props");
|
|
3238
|
+
var import_icons15 = require("@elementor/icons");
|
|
3239
|
+
var import_ui48 = require("@elementor/ui");
|
|
3240
|
+
var import_i18n22 = require("@wordpress/i18n");
|
|
3087
3241
|
var GapControl = ({ label }) => {
|
|
3088
3242
|
const {
|
|
3089
3243
|
value: directionValue,
|
|
3090
3244
|
setValue: setDirectionValue,
|
|
3091
3245
|
propType,
|
|
3092
3246
|
disabled: directionDisabled
|
|
3093
|
-
} = useBoundProp(
|
|
3094
|
-
const stackRef = (0,
|
|
3095
|
-
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(
|
|
3247
|
+
} = useBoundProp(import_editor_props24.layoutDirectionPropTypeUtil);
|
|
3248
|
+
const stackRef = (0, import_react28.useRef)(null);
|
|
3249
|
+
const { value: sizeValue, setValue: setSizeValue, disabled: sizeDisabled } = useBoundProp(import_editor_props24.sizePropTypeUtil);
|
|
3096
3250
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
3097
3251
|
const onLinkToggle = () => {
|
|
3098
3252
|
if (!isLinked) {
|
|
3099
3253
|
setSizeValue(directionValue?.column?.value ?? null);
|
|
3100
3254
|
return;
|
|
3101
3255
|
}
|
|
3102
|
-
const value = sizeValue ?
|
|
3256
|
+
const value = sizeValue ? import_editor_props24.sizePropTypeUtil.create(sizeValue) : null;
|
|
3103
3257
|
setDirectionValue({
|
|
3104
3258
|
row: value,
|
|
3105
3259
|
column: value
|
|
3106
3260
|
});
|
|
3107
3261
|
};
|
|
3108
3262
|
const tooltipLabel = label.toLowerCase();
|
|
3109
|
-
const LinkedIcon = isLinked ?
|
|
3110
|
-
const linkedLabel = (0,
|
|
3111
|
-
const unlinkedLabel = (0,
|
|
3263
|
+
const LinkedIcon = isLinked ? import_icons15.LinkIcon : import_icons15.DetachIcon;
|
|
3264
|
+
const linkedLabel = (0, import_i18n22.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
3265
|
+
const unlinkedLabel = (0, import_i18n22.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
3112
3266
|
const disabled = sizeDisabled || directionDisabled;
|
|
3113
|
-
return /* @__PURE__ */
|
|
3114
|
-
|
|
3267
|
+
return /* @__PURE__ */ React61.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React61.createElement(import_ui48.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React61.createElement(ControlLabel, null, label), /* @__PURE__ */ React61.createElement(import_ui48.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React61.createElement(
|
|
3268
|
+
import_ui48.ToggleButton,
|
|
3115
3269
|
{
|
|
3116
3270
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
3117
3271
|
size: "tiny",
|
|
@@ -3121,8 +3275,8 @@ var GapControl = ({ label }) => {
|
|
|
3121
3275
|
onChange: onLinkToggle,
|
|
3122
3276
|
disabled
|
|
3123
3277
|
},
|
|
3124
|
-
/* @__PURE__ */
|
|
3125
|
-
))), /* @__PURE__ */
|
|
3278
|
+
/* @__PURE__ */ React61.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
3279
|
+
))), /* @__PURE__ */ React61.createElement(import_ui48.Stack, { direction: "row", gap: 2, flexWrap: "nowrap", ref: stackRef }, /* @__PURE__ */ React61.createElement(import_ui48.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React61.createElement(import_ui48.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React61.createElement(ControlFormLabel, null, (0, import_i18n22.__)("Column", "elementor"))), /* @__PURE__ */ React61.createElement(import_ui48.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React61.createElement(Control4, { bind: "column", isLinked, anchorRef: stackRef }))), /* @__PURE__ */ React61.createElement(import_ui48.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React61.createElement(import_ui48.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React61.createElement(ControlFormLabel, null, (0, import_i18n22.__)("Row", "elementor"))), /* @__PURE__ */ React61.createElement(import_ui48.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React61.createElement(Control4, { bind: "row", isLinked, anchorRef: stackRef })))));
|
|
3126
3280
|
};
|
|
3127
3281
|
var Control4 = ({
|
|
3128
3282
|
bind,
|
|
@@ -3130,21 +3284,21 @@ var Control4 = ({
|
|
|
3130
3284
|
anchorRef
|
|
3131
3285
|
}) => {
|
|
3132
3286
|
if (isLinked) {
|
|
3133
|
-
return /* @__PURE__ */
|
|
3287
|
+
return /* @__PURE__ */ React61.createElement(SizeControl, { anchorRef });
|
|
3134
3288
|
}
|
|
3135
|
-
return /* @__PURE__ */
|
|
3289
|
+
return /* @__PURE__ */ React61.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React61.createElement(SizeControl, { anchorRef }));
|
|
3136
3290
|
};
|
|
3137
3291
|
|
|
3138
3292
|
// src/controls/aspect-ratio-control.tsx
|
|
3139
|
-
var
|
|
3140
|
-
var
|
|
3141
|
-
var
|
|
3293
|
+
var React62 = __toESM(require("react"));
|
|
3294
|
+
var import_react29 = require("react");
|
|
3295
|
+
var import_editor_props25 = require("@elementor/editor-props");
|
|
3142
3296
|
var import_editor_ui5 = require("@elementor/editor-ui");
|
|
3143
|
-
var
|
|
3144
|
-
var
|
|
3145
|
-
var
|
|
3297
|
+
var import_icons16 = require("@elementor/icons");
|
|
3298
|
+
var import_ui49 = require("@elementor/ui");
|
|
3299
|
+
var import_i18n23 = require("@wordpress/i18n");
|
|
3146
3300
|
var RATIO_OPTIONS = [
|
|
3147
|
-
{ label: (0,
|
|
3301
|
+
{ label: (0, import_i18n23.__)("Auto", "elementor"), value: "auto" },
|
|
3148
3302
|
{ label: "1/1", value: "1/1" },
|
|
3149
3303
|
{ label: "4/3", value: "4/3" },
|
|
3150
3304
|
{ label: "3/4", value: "3/4" },
|
|
@@ -3155,16 +3309,16 @@ var RATIO_OPTIONS = [
|
|
|
3155
3309
|
];
|
|
3156
3310
|
var CUSTOM_RATIO = "custom";
|
|
3157
3311
|
var AspectRatioControl = createControl(({ label }) => {
|
|
3158
|
-
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(
|
|
3312
|
+
const { value: aspectRatioValue, setValue: setAspectRatioValue, disabled } = useBoundProp(import_editor_props25.stringPropTypeUtil);
|
|
3159
3313
|
const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
3160
3314
|
const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
|
|
3161
|
-
const [isCustom, setIsCustom] = (0,
|
|
3162
|
-
const [customWidth, setCustomWidth] = (0,
|
|
3163
|
-
const [customHeight, setCustomHeight] = (0,
|
|
3164
|
-
const [selectedValue, setSelectedValue] = (0,
|
|
3315
|
+
const [isCustom, setIsCustom] = (0, import_react29.useState)(isCustomSelected);
|
|
3316
|
+
const [customWidth, setCustomWidth] = (0, import_react29.useState)(initialWidth);
|
|
3317
|
+
const [customHeight, setCustomHeight] = (0, import_react29.useState)(initialHeight);
|
|
3318
|
+
const [selectedValue, setSelectedValue] = (0, import_react29.useState)(
|
|
3165
3319
|
isCustomSelected ? CUSTOM_RATIO : aspectRatioValue || ""
|
|
3166
3320
|
);
|
|
3167
|
-
(0,
|
|
3321
|
+
(0, import_react29.useEffect)(() => {
|
|
3168
3322
|
const isCustomValue = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
3169
3323
|
if (isCustomValue) {
|
|
3170
3324
|
const [width, height] = aspectRatioValue.split("/");
|
|
@@ -3203,8 +3357,8 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
3203
3357
|
setAspectRatioValue(`${customWidth}/${newHeight}`);
|
|
3204
3358
|
}
|
|
3205
3359
|
};
|
|
3206
|
-
return /* @__PURE__ */
|
|
3207
|
-
|
|
3360
|
+
return /* @__PURE__ */ React62.createElement(ControlActions, null, /* @__PURE__ */ React62.createElement(import_ui49.Stack, { direction: "column", gap: 2 }, /* @__PURE__ */ React62.createElement(import_ui49.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React62.createElement(import_ui49.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React62.createElement(ControlLabel, null, label)), /* @__PURE__ */ React62.createElement(import_ui49.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React62.createElement(
|
|
3361
|
+
import_ui49.Select,
|
|
3208
3362
|
{
|
|
3209
3363
|
size: "tiny",
|
|
3210
3364
|
displayEmpty: true,
|
|
@@ -3214,11 +3368,11 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
3214
3368
|
onChange: handleSelectChange,
|
|
3215
3369
|
fullWidth: true
|
|
3216
3370
|
},
|
|
3217
|
-
[...RATIO_OPTIONS, { label: (0,
|
|
3218
|
-
({ label: optionLabel, ...props }) => /* @__PURE__ */
|
|
3371
|
+
[...RATIO_OPTIONS, { label: (0, import_i18n23.__)("Custom", "elementor"), value: CUSTOM_RATIO }].map(
|
|
3372
|
+
({ label: optionLabel, ...props }) => /* @__PURE__ */ React62.createElement(import_editor_ui5.MenuListItem, { key: props.value, ...props, value: props.value ?? "" }, optionLabel)
|
|
3219
3373
|
)
|
|
3220
|
-
))), isCustom && /* @__PURE__ */
|
|
3221
|
-
|
|
3374
|
+
))), isCustom && /* @__PURE__ */ React62.createElement(import_ui49.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React62.createElement(import_ui49.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React62.createElement(
|
|
3375
|
+
import_ui49.TextField,
|
|
3222
3376
|
{
|
|
3223
3377
|
size: "tiny",
|
|
3224
3378
|
type: "number",
|
|
@@ -3227,11 +3381,11 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
3227
3381
|
value: customWidth,
|
|
3228
3382
|
onChange: handleCustomWidthChange,
|
|
3229
3383
|
InputProps: {
|
|
3230
|
-
startAdornment: /* @__PURE__ */
|
|
3384
|
+
startAdornment: /* @__PURE__ */ React62.createElement(import_icons16.ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
3231
3385
|
}
|
|
3232
3386
|
}
|
|
3233
|
-
)), /* @__PURE__ */
|
|
3234
|
-
|
|
3387
|
+
)), /* @__PURE__ */ React62.createElement(import_ui49.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React62.createElement(
|
|
3388
|
+
import_ui49.TextField,
|
|
3235
3389
|
{
|
|
3236
3390
|
size: "tiny",
|
|
3237
3391
|
type: "number",
|
|
@@ -3240,39 +3394,39 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
3240
3394
|
value: customHeight,
|
|
3241
3395
|
onChange: handleCustomHeightChange,
|
|
3242
3396
|
InputProps: {
|
|
3243
|
-
startAdornment: /* @__PURE__ */
|
|
3397
|
+
startAdornment: /* @__PURE__ */ React62.createElement(import_icons16.ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
3244
3398
|
}
|
|
3245
3399
|
}
|
|
3246
3400
|
)))));
|
|
3247
3401
|
});
|
|
3248
3402
|
|
|
3249
3403
|
// src/controls/svg-media-control.tsx
|
|
3250
|
-
var
|
|
3251
|
-
var
|
|
3252
|
-
var
|
|
3253
|
-
var
|
|
3254
|
-
var
|
|
3404
|
+
var React64 = __toESM(require("react"));
|
|
3405
|
+
var import_react31 = require("react");
|
|
3406
|
+
var import_editor_props26 = require("@elementor/editor-props");
|
|
3407
|
+
var import_icons17 = require("@elementor/icons");
|
|
3408
|
+
var import_ui51 = require("@elementor/ui");
|
|
3255
3409
|
var import_wp_media2 = require("@elementor/wp-media");
|
|
3256
|
-
var
|
|
3410
|
+
var import_i18n25 = require("@wordpress/i18n");
|
|
3257
3411
|
|
|
3258
3412
|
// src/components/enable-unfiltered-modal.tsx
|
|
3259
|
-
var
|
|
3260
|
-
var
|
|
3413
|
+
var React63 = __toESM(require("react"));
|
|
3414
|
+
var import_react30 = require("react");
|
|
3261
3415
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
3262
|
-
var
|
|
3263
|
-
var
|
|
3264
|
-
var ADMIN_TITLE_TEXT = (0,
|
|
3265
|
-
var ADMIN_CONTENT_TEXT = (0,
|
|
3416
|
+
var import_ui50 = require("@elementor/ui");
|
|
3417
|
+
var import_i18n24 = require("@wordpress/i18n");
|
|
3418
|
+
var ADMIN_TITLE_TEXT = (0, import_i18n24.__)("Enable Unfiltered Uploads", "elementor");
|
|
3419
|
+
var ADMIN_CONTENT_TEXT = (0, import_i18n24.__)(
|
|
3266
3420
|
"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.",
|
|
3267
3421
|
"elementor"
|
|
3268
3422
|
);
|
|
3269
|
-
var NON_ADMIN_TITLE_TEXT = (0,
|
|
3270
|
-
var NON_ADMIN_CONTENT_TEXT = (0,
|
|
3423
|
+
var NON_ADMIN_TITLE_TEXT = (0, import_i18n24.__)("Sorry, you can't upload that file yet", "elementor");
|
|
3424
|
+
var NON_ADMIN_CONTENT_TEXT = (0, import_i18n24.__)(
|
|
3271
3425
|
"This is because this file type may pose a security risk. To upload them anyway, ask the site administrator to enable unfiltered file uploads.",
|
|
3272
3426
|
"elementor"
|
|
3273
3427
|
);
|
|
3274
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT1 = (0,
|
|
3275
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT2 = (0,
|
|
3428
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT1 = (0, import_i18n24.__)("Failed to enable unfiltered files upload.", "elementor");
|
|
3429
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT2 = (0, import_i18n24.__)(
|
|
3276
3430
|
"You can try again, if the problem persists, please contact support.",
|
|
3277
3431
|
"elementor"
|
|
3278
3432
|
);
|
|
@@ -3280,7 +3434,7 @@ var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
|
|
|
3280
3434
|
var EnableUnfilteredModal = (props) => {
|
|
3281
3435
|
const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
|
|
3282
3436
|
const { canUser } = (0, import_editor_current_user.useCurrentUserCapabilities)();
|
|
3283
|
-
const [isError, setIsError] = (0,
|
|
3437
|
+
const [isError, setIsError] = (0, import_react30.useState)(false);
|
|
3284
3438
|
const canManageOptions = canUser("manage_options");
|
|
3285
3439
|
const onClose = (enabled) => {
|
|
3286
3440
|
props.onClose(enabled);
|
|
@@ -3299,10 +3453,10 @@ var EnableUnfilteredModal = (props) => {
|
|
|
3299
3453
|
}
|
|
3300
3454
|
};
|
|
3301
3455
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
3302
|
-
return canManageOptions ? /* @__PURE__ */
|
|
3456
|
+
return canManageOptions ? /* @__PURE__ */ React63.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React63.createElement(NonAdminDialog, { ...dialogProps });
|
|
3303
3457
|
};
|
|
3304
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
3305
|
-
|
|
3458
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React63.createElement(import_ui50.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React63.createElement(import_ui50.DialogHeader, { logo: false }, /* @__PURE__ */ React63.createElement(import_ui50.DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React63.createElement(import_ui50.Divider, null), /* @__PURE__ */ React63.createElement(import_ui50.DialogContent, null, /* @__PURE__ */ React63.createElement(import_ui50.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(import_ui50.DialogActions, null, /* @__PURE__ */ React63.createElement(import_ui50.Button, { size: "medium", color: "secondary", onClick: () => onClose(false) }, (0, import_i18n24.__)("Cancel", "elementor")), /* @__PURE__ */ React63.createElement(
|
|
3459
|
+
import_ui50.Button,
|
|
3306
3460
|
{
|
|
3307
3461
|
size: "medium",
|
|
3308
3462
|
onClick: () => handleEnable(),
|
|
@@ -3310,16 +3464,16 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
3310
3464
|
color: "primary",
|
|
3311
3465
|
disabled: isPending
|
|
3312
3466
|
},
|
|
3313
|
-
isPending ? /* @__PURE__ */
|
|
3467
|
+
isPending ? /* @__PURE__ */ React63.createElement(import_ui50.CircularProgress, { size: 24 }) : (0, import_i18n24.__)("Enable", "elementor")
|
|
3314
3468
|
)));
|
|
3315
|
-
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */
|
|
3469
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React63.createElement(import_ui50.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React63.createElement(import_ui50.DialogHeader, { logo: false }, /* @__PURE__ */ React63.createElement(import_ui50.DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React63.createElement(import_ui50.Divider, null), /* @__PURE__ */ React63.createElement(import_ui50.DialogContent, null, /* @__PURE__ */ React63.createElement(import_ui50.DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React63.createElement(import_ui50.DialogActions, null, /* @__PURE__ */ React63.createElement(import_ui50.Button, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, (0, import_i18n24.__)("Got it", "elementor"))));
|
|
3316
3470
|
|
|
3317
3471
|
// src/controls/svg-media-control.tsx
|
|
3318
3472
|
var TILE_SIZE = 8;
|
|
3319
3473
|
var TILE_WHITE = "transparent";
|
|
3320
3474
|
var TILE_BLACK = "#c1c1c1";
|
|
3321
3475
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
3322
|
-
var StyledCard = (0,
|
|
3476
|
+
var StyledCard = (0, import_ui51.styled)(import_ui51.Card)`
|
|
3323
3477
|
background-color: white;
|
|
3324
3478
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
3325
3479
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -3328,7 +3482,7 @@ var StyledCard = (0, import_ui41.styled)(import_ui41.Card)`
|
|
|
3328
3482
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
3329
3483
|
border: none;
|
|
3330
3484
|
`;
|
|
3331
|
-
var StyledCardMediaContainer = (0,
|
|
3485
|
+
var StyledCardMediaContainer = (0, import_ui51.styled)(import_ui51.Stack)`
|
|
3332
3486
|
position: relative;
|
|
3333
3487
|
height: 140px;
|
|
3334
3488
|
object-fit: contain;
|
|
@@ -3340,12 +3494,12 @@ var StyledCardMediaContainer = (0, import_ui41.styled)(import_ui41.Stack)`
|
|
|
3340
3494
|
var MODE_BROWSE = { mode: "browse" };
|
|
3341
3495
|
var MODE_UPLOAD = { mode: "upload" };
|
|
3342
3496
|
var SvgMediaControl = createControl(() => {
|
|
3343
|
-
const { value, setValue } = useBoundProp(
|
|
3497
|
+
const { value, setValue } = useBoundProp(import_editor_props26.imageSrcPropTypeUtil);
|
|
3344
3498
|
const { id, url } = value ?? {};
|
|
3345
3499
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(id?.value || null);
|
|
3346
3500
|
const src = attachment?.url ?? url?.value ?? null;
|
|
3347
3501
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
3348
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0,
|
|
3502
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, import_react31.useState)(false);
|
|
3349
3503
|
const { open } = (0, import_wp_media2.useWpMediaFrame)({
|
|
3350
3504
|
mediaTypes: ["svg"],
|
|
3351
3505
|
multiple: false,
|
|
@@ -3373,394 +3527,85 @@ var SvgMediaControl = createControl(() => {
|
|
|
3373
3527
|
open(openOptions);
|
|
3374
3528
|
}
|
|
3375
3529
|
};
|
|
3376
|
-
return /* @__PURE__ */
|
|
3377
|
-
|
|
3530
|
+
return /* @__PURE__ */ React64.createElement(import_ui51.Stack, { 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(import_ui51.CircularProgress, { role: "progressbar" }) : /* @__PURE__ */ React64.createElement(
|
|
3531
|
+
import_ui51.CardMedia,
|
|
3378
3532
|
{
|
|
3379
3533
|
component: "img",
|
|
3380
3534
|
image: src,
|
|
3381
|
-
alt: (0,
|
|
3382
|
-
sx: { maxHeight: "140px", width: "50px" }
|
|
3383
|
-
}
|
|
3384
|
-
)), /* @__PURE__ */
|
|
3385
|
-
|
|
3386
|
-
{
|
|
3387
|
-
sx: {
|
|
3388
|
-
"&:hover": {
|
|
3389
|
-
backgroundColor: "rgba( 0, 0, 0, 0.75 )"
|
|
3390
|
-
}
|
|
3391
|
-
}
|
|
3392
|
-
},
|
|
3393
|
-
/* @__PURE__ */ React49.createElement(import_ui41.Stack, { gap: 1 }, /* @__PURE__ */ React49.createElement(
|
|
3394
|
-
import_ui41.Button,
|
|
3395
|
-
{
|
|
3396
|
-
size: "tiny",
|
|
3397
|
-
color: "inherit",
|
|
3398
|
-
variant: "outlined",
|
|
3399
|
-
onClick: () => handleClick(MODE_BROWSE)
|
|
3400
|
-
},
|
|
3401
|
-
(0, import_i18n18.__)("Select SVG", "elementor")
|
|
3402
|
-
), /* @__PURE__ */ React49.createElement(
|
|
3403
|
-
import_ui41.Button,
|
|
3404
|
-
{
|
|
3405
|
-
size: "tiny",
|
|
3406
|
-
variant: "text",
|
|
3407
|
-
color: "inherit",
|
|
3408
|
-
startIcon: /* @__PURE__ */ React49.createElement(import_icons14.UploadIcon, null),
|
|
3409
|
-
onClick: () => handleClick(MODE_UPLOAD)
|
|
3410
|
-
},
|
|
3411
|
-
(0, import_i18n18.__)("Upload", "elementor")
|
|
3412
|
-
))
|
|
3413
|
-
))));
|
|
3414
|
-
});
|
|
3415
|
-
|
|
3416
|
-
// src/controls/background-control/background-control.tsx
|
|
3417
|
-
var React66 = __toESM(require("react"));
|
|
3418
|
-
var import_editor_props30 = require("@elementor/editor-props");
|
|
3419
|
-
var import_ui57 = require("@elementor/ui");
|
|
3420
|
-
var import_i18n29 = require("@wordpress/i18n");
|
|
3421
|
-
|
|
3422
|
-
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
3423
|
-
var React65 = __toESM(require("react"));
|
|
3424
|
-
var import_editor_props29 = require("@elementor/editor-props");
|
|
3425
|
-
var import_ui56 = require("@elementor/ui");
|
|
3426
|
-
var import_wp_media3 = require("@elementor/wp-media");
|
|
3427
|
-
var import_i18n28 = require("@wordpress/i18n");
|
|
3428
|
-
|
|
3429
|
-
// src/components/unstable-repeater/actions/tooltip-add-item-action.tsx
|
|
3430
|
-
var React51 = __toESM(require("react"));
|
|
3431
|
-
var import_icons15 = require("@elementor/icons");
|
|
3432
|
-
var import_ui43 = require("@elementor/ui");
|
|
3433
|
-
var import_i18n19 = require("@wordpress/i18n");
|
|
3434
|
-
|
|
3435
|
-
// src/components/unstable-repeater/context/repeater-context.tsx
|
|
3436
|
-
var React50 = __toESM(require("react"));
|
|
3437
|
-
var import_react31 = require("react");
|
|
3438
|
-
var import_ui42 = require("@elementor/ui");
|
|
3439
|
-
var RepeaterContext = (0, import_react31.createContext)(null);
|
|
3440
|
-
var EMPTY_OPEN_ITEM2 = -1;
|
|
3441
|
-
var useRepeaterContext = () => {
|
|
3442
|
-
const context = React50.useContext(RepeaterContext);
|
|
3443
|
-
if (!context) {
|
|
3444
|
-
throw new Error("useRepeaterContext must be used within a RepeaterContextProvider");
|
|
3445
|
-
}
|
|
3446
|
-
return context;
|
|
3447
|
-
};
|
|
3448
|
-
var RepeaterContextProvider = ({
|
|
3449
|
-
children,
|
|
3450
|
-
initial,
|
|
3451
|
-
propTypeUtil
|
|
3452
|
-
}) => {
|
|
3453
|
-
const { value: repeaterValues, setValue: setRepeaterValues } = useBoundProp(propTypeUtil);
|
|
3454
|
-
const [items2, setItems] = useSyncExternalState({
|
|
3455
|
-
external: repeaterValues,
|
|
3456
|
-
fallback: () => [],
|
|
3457
|
-
setExternal: setRepeaterValues,
|
|
3458
|
-
persistWhen: () => true
|
|
3459
|
-
});
|
|
3460
|
-
const [itemsWithKeys, setItemsWithKeys] = (0, import_react31.useState)(() => {
|
|
3461
|
-
return items2?.map((item) => ({ key: generateUniqueKey(), item })) ?? [];
|
|
3462
|
-
});
|
|
3463
|
-
React50.useEffect(() => {
|
|
3464
|
-
setItemsWithKeys((prevItemsWithKeys) => {
|
|
3465
|
-
const newItemsWithKeys = items2?.map((item) => {
|
|
3466
|
-
const existingItem = prevItemsWithKeys.find((i) => i.item === item);
|
|
3467
|
-
return existingItem || { key: generateUniqueKey(), item };
|
|
3468
|
-
}) ?? [];
|
|
3469
|
-
return newItemsWithKeys;
|
|
3470
|
-
});
|
|
3471
|
-
}, [items2]);
|
|
3472
|
-
const handleSetItems = (newItemsWithKeys) => {
|
|
3473
|
-
setItems(newItemsWithKeys.map(({ item }) => item));
|
|
3474
|
-
};
|
|
3475
|
-
const [openItemIndex, setOpenItemIndex] = (0, import_react31.useState)(EMPTY_OPEN_ITEM2);
|
|
3476
|
-
const [rowRef, setRowRef] = (0, import_react31.useState)(null);
|
|
3477
|
-
const isOpen = openItemIndex !== EMPTY_OPEN_ITEM2;
|
|
3478
|
-
const popoverState = (0, import_ui42.usePopupState)({ variant: "popover" });
|
|
3479
|
-
const addItem = (ev, config) => {
|
|
3480
|
-
const item = config?.item ?? initial;
|
|
3481
|
-
const newIndex = config?.index ?? items2.length;
|
|
3482
|
-
const newItems = [...items2];
|
|
3483
|
-
newItems.splice(newIndex, 0, item);
|
|
3484
|
-
setItems(newItems);
|
|
3485
|
-
setOpenItemIndex(newIndex);
|
|
3486
|
-
popoverState.open(rowRef ?? ev);
|
|
3487
|
-
};
|
|
3488
|
-
const removeItem = (index) => {
|
|
3489
|
-
setItems(items2.filter((_, pos) => pos !== index));
|
|
3490
|
-
};
|
|
3491
|
-
const updateItem = (updatedItem, index) => {
|
|
3492
|
-
const newItems = [...items2.slice(0, index), updatedItem, ...items2.slice(index + 1)];
|
|
3493
|
-
setItems(newItems);
|
|
3494
|
-
};
|
|
3495
|
-
return /* @__PURE__ */ React50.createElement(
|
|
3496
|
-
RepeaterContext.Provider,
|
|
3497
|
-
{
|
|
3498
|
-
value: {
|
|
3499
|
-
isOpen,
|
|
3500
|
-
openItemIndex,
|
|
3501
|
-
setOpenItemIndex,
|
|
3502
|
-
items: itemsWithKeys ?? [],
|
|
3503
|
-
setItems: handleSetItems,
|
|
3504
|
-
popoverState,
|
|
3505
|
-
initial,
|
|
3506
|
-
updateItem,
|
|
3507
|
-
addItem,
|
|
3508
|
-
removeItem,
|
|
3509
|
-
rowRef,
|
|
3510
|
-
setRowRef
|
|
3511
|
-
}
|
|
3512
|
-
},
|
|
3513
|
-
children
|
|
3514
|
-
);
|
|
3515
|
-
};
|
|
3516
|
-
var generateUniqueKey = () => {
|
|
3517
|
-
return Date.now() + Math.floor(Math.random() * 1e6);
|
|
3518
|
-
};
|
|
3519
|
-
|
|
3520
|
-
// src/components/unstable-repeater/actions/tooltip-add-item-action.tsx
|
|
3521
|
-
var SIZE4 = "tiny";
|
|
3522
|
-
var TooltipAddItemAction = ({
|
|
3523
|
-
disabled = false,
|
|
3524
|
-
enableTooltip = false,
|
|
3525
|
-
tooltipContent = null,
|
|
3526
|
-
newItemIndex
|
|
3527
|
-
}) => {
|
|
3528
|
-
const { addItem } = useRepeaterContext();
|
|
3529
|
-
const onClick = (ev) => addItem(ev, { index: newItemIndex });
|
|
3530
|
-
return /* @__PURE__ */ React51.createElement(ConditionalToolTip, { content: tooltipContent, enable: enableTooltip }, /* @__PURE__ */ React51.createElement(import_ui43.Box, { component: "span", sx: { cursor: disabled ? "not-allowed" : "pointer" } }, /* @__PURE__ */ React51.createElement(
|
|
3531
|
-
import_ui43.IconButton,
|
|
3532
|
-
{
|
|
3533
|
-
size: SIZE4,
|
|
3534
|
-
disabled,
|
|
3535
|
-
onClick,
|
|
3536
|
-
"aria-label": (0, import_i18n19.__)("Add item", "elementor")
|
|
3537
|
-
},
|
|
3538
|
-
/* @__PURE__ */ React51.createElement(import_icons15.PlusIcon, { fontSize: SIZE4 })
|
|
3539
|
-
)));
|
|
3540
|
-
};
|
|
3541
|
-
var ConditionalToolTip = ({
|
|
3542
|
-
children,
|
|
3543
|
-
enable,
|
|
3544
|
-
content
|
|
3545
|
-
}) => enable && content ? /* @__PURE__ */ React51.createElement(import_ui43.Infotip, { placement: "right", color: "secondary", content }, children) : children;
|
|
3546
|
-
|
|
3547
|
-
// src/components/unstable-repeater/header/header.tsx
|
|
3548
|
-
var React52 = __toESM(require("react"));
|
|
3549
|
-
var import_ui44 = require("@elementor/ui");
|
|
3550
|
-
var Header = React52.forwardRef(({ label, children }, ref) => {
|
|
3551
|
-
const { value } = useBoundProp();
|
|
3552
|
-
return /* @__PURE__ */ React52.createElement(import_ui44.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { marginInlineEnd: -0.75, py: 0.25 }, ref }, /* @__PURE__ */ React52.createElement(import_ui44.Box, { display: "flex", alignItems: "center", gap: 1, sx: { flexGrow: 1 } }, /* @__PURE__ */ React52.createElement(import_ui44.Typography, { 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));
|
|
3553
|
-
});
|
|
3554
|
-
|
|
3555
|
-
// src/components/unstable-repeater/items/items-container.tsx
|
|
3556
|
-
var React53 = __toESM(require("react"));
|
|
3557
|
-
var ItemsContainer = ({
|
|
3558
|
-
itemTemplate,
|
|
3559
|
-
isSortable = true,
|
|
3560
|
-
children
|
|
3561
|
-
}) => {
|
|
3562
|
-
const { items: items2, setItems } = useRepeaterContext();
|
|
3563
|
-
const keys = items2.map(({ key }) => key);
|
|
3564
|
-
if (!itemTemplate) {
|
|
3565
|
-
return null;
|
|
3566
|
-
}
|
|
3567
|
-
const onChangeOrder = (newKeys) => {
|
|
3568
|
-
setItems(
|
|
3569
|
-
newKeys.map((key) => {
|
|
3570
|
-
const index = items2.findIndex((item) => item.key === key);
|
|
3571
|
-
return items2[index];
|
|
3572
|
-
})
|
|
3573
|
-
);
|
|
3574
|
-
};
|
|
3575
|
-
return /* @__PURE__ */ React53.createElement(React53.Fragment, null, /* @__PURE__ */ React53.createElement(SortableProvider, { value: keys, onChange: onChangeOrder }, keys.map((key, index) => {
|
|
3576
|
-
const value = items2[index].item;
|
|
3577
|
-
return /* @__PURE__ */ React53.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, React53.isValidElement(itemTemplate) ? React53.cloneElement(itemTemplate, {
|
|
3578
|
-
key,
|
|
3579
|
-
value,
|
|
3580
|
-
index,
|
|
3581
|
-
children
|
|
3582
|
-
}) : null);
|
|
3583
|
-
})));
|
|
3584
|
-
};
|
|
3585
|
-
|
|
3586
|
-
// src/components/unstable-repeater/items/item.tsx
|
|
3587
|
-
var React57 = __toESM(require("react"));
|
|
3588
|
-
var import_ui48 = require("@elementor/ui");
|
|
3589
|
-
var import_i18n23 = require("@wordpress/i18n");
|
|
3590
|
-
|
|
3591
|
-
// src/components/unstable-repeater/actions/disable-item-action.tsx
|
|
3592
|
-
var React54 = __toESM(require("react"));
|
|
3593
|
-
var import_icons16 = require("@elementor/icons");
|
|
3594
|
-
var import_ui45 = require("@elementor/ui");
|
|
3595
|
-
var import_i18n20 = require("@wordpress/i18n");
|
|
3596
|
-
var SIZE5 = "tiny";
|
|
3597
|
-
var DisableItemAction = ({ index = -1 }) => {
|
|
3598
|
-
const { items: items2, updateItem } = useRepeaterContext();
|
|
3599
|
-
if (index === -1) {
|
|
3600
|
-
return null;
|
|
3601
|
-
}
|
|
3602
|
-
const propDisabled = items2[index].item.disabled ?? false;
|
|
3603
|
-
const toggleLabel = propDisabled ? (0, import_i18n20.__)("Show", "elementor") : (0, import_i18n20.__)("Hide", "elementor");
|
|
3604
|
-
const onClick = () => {
|
|
3605
|
-
const self = structuredClone(items2[index].item);
|
|
3606
|
-
self.disabled = !self.disabled;
|
|
3607
|
-
if (!self.disabled) {
|
|
3608
|
-
delete self.disabled;
|
|
3609
|
-
}
|
|
3610
|
-
updateItem(self, index);
|
|
3611
|
-
};
|
|
3612
|
-
return /* @__PURE__ */ React54.createElement(import_ui45.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React54.createElement(import_ui45.IconButton, { size: SIZE5, onClick, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React54.createElement(import_icons16.EyeOffIcon, { fontSize: SIZE5 }) : /* @__PURE__ */ React54.createElement(import_icons16.EyeIcon, { fontSize: SIZE5 })));
|
|
3613
|
-
};
|
|
3614
|
-
|
|
3615
|
-
// src/components/unstable-repeater/actions/duplicate-item-action.tsx
|
|
3616
|
-
var React55 = __toESM(require("react"));
|
|
3617
|
-
var import_icons17 = require("@elementor/icons");
|
|
3618
|
-
var import_ui46 = require("@elementor/ui");
|
|
3619
|
-
var import_i18n21 = require("@wordpress/i18n");
|
|
3620
|
-
var SIZE6 = "tiny";
|
|
3621
|
-
var DuplicateItemAction = ({ index = -1 }) => {
|
|
3622
|
-
const { items: items2, addItem } = useRepeaterContext();
|
|
3623
|
-
if (index === -1) {
|
|
3624
|
-
return null;
|
|
3625
|
-
}
|
|
3626
|
-
const duplicateLabel = (0, import_i18n21.__)("Duplicate", "elementor");
|
|
3627
|
-
const onClick = (ev) => {
|
|
3628
|
-
const newItem = structuredClone(items2[index]?.item);
|
|
3629
|
-
addItem(ev, { item: newItem, index: index + 1 });
|
|
3630
|
-
};
|
|
3631
|
-
return /* @__PURE__ */ React55.createElement(import_ui46.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React55.createElement(import_ui46.IconButton, { size: SIZE6, onClick, "aria-label": duplicateLabel }, /* @__PURE__ */ React55.createElement(import_icons17.CopyIcon, { fontSize: SIZE6 })));
|
|
3632
|
-
};
|
|
3633
|
-
|
|
3634
|
-
// src/components/unstable-repeater/actions/remove-item-action.tsx
|
|
3635
|
-
var React56 = __toESM(require("react"));
|
|
3636
|
-
var import_icons18 = require("@elementor/icons");
|
|
3637
|
-
var import_ui47 = require("@elementor/ui");
|
|
3638
|
-
var import_i18n22 = require("@wordpress/i18n");
|
|
3639
|
-
var SIZE7 = "tiny";
|
|
3640
|
-
var RemoveItemAction = ({ index = -1 }) => {
|
|
3641
|
-
const { removeItem } = useRepeaterContext();
|
|
3642
|
-
if (index === -1) {
|
|
3643
|
-
return null;
|
|
3644
|
-
}
|
|
3645
|
-
const removeLabel = (0, import_i18n22.__)("Remove", "elementor");
|
|
3646
|
-
const onClick = () => removeItem(index);
|
|
3647
|
-
return /* @__PURE__ */ React56.createElement(import_ui47.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React56.createElement(import_ui47.IconButton, { size: SIZE7, onClick, "aria-label": removeLabel }, /* @__PURE__ */ React56.createElement(import_icons18.XIcon, { fontSize: SIZE7 })));
|
|
3648
|
-
};
|
|
3649
|
-
|
|
3650
|
-
// src/components/unstable-repeater/items/item.tsx
|
|
3651
|
-
var Item = ({
|
|
3652
|
-
Label: Label3,
|
|
3653
|
-
Icon,
|
|
3654
|
-
value,
|
|
3655
|
-
index = -1,
|
|
3656
|
-
children
|
|
3657
|
-
}) => {
|
|
3658
|
-
const { items: items2, popoverState, setRowRef, openItemIndex, setOpenItemIndex } = useRepeaterContext();
|
|
3659
|
-
const triggerProps = (0, import_ui48.bindTrigger)(popoverState);
|
|
3660
|
-
const key = items2[index].key ?? -1;
|
|
3661
|
-
const onClick = (ev) => {
|
|
3662
|
-
triggerProps.onClick(ev);
|
|
3663
|
-
setOpenItemIndex(index);
|
|
3664
|
-
};
|
|
3665
|
-
return /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(
|
|
3666
|
-
import_ui48.UnstableTag,
|
|
3667
|
-
{
|
|
3668
|
-
key,
|
|
3669
|
-
disabled: false,
|
|
3670
|
-
label: /* @__PURE__ */ React57.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React57.createElement(Label3, { value })),
|
|
3671
|
-
showActionsOnHover: true,
|
|
3672
|
-
fullWidth: true,
|
|
3673
|
-
ref: (ref) => ref && openItemIndex === index && setRowRef(ref),
|
|
3674
|
-
variant: "outlined",
|
|
3675
|
-
"aria-label": (0, import_i18n23.__)("Open item", "elementor"),
|
|
3676
|
-
sx: { minHeight: (theme) => theme.spacing(4) },
|
|
3677
|
-
...triggerProps,
|
|
3678
|
-
onClick,
|
|
3679
|
-
startIcon: /* @__PURE__ */ React57.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React57.createElement(Icon, { value })),
|
|
3680
|
-
actions: /* @__PURE__ */ React57.createElement(React57.Fragment, null, /* @__PURE__ */ React57.createElement(RepeaterItemActionsSlot, { index: index ?? -1 }), /* @__PURE__ */ React57.createElement(
|
|
3681
|
-
SlotChildren,
|
|
3682
|
-
{
|
|
3683
|
-
whitelist: [DuplicateItemAction, DisableItemAction, RemoveItemAction],
|
|
3684
|
-
props: { index },
|
|
3685
|
-
sorted: true
|
|
3686
|
-
},
|
|
3687
|
-
children
|
|
3688
|
-
))
|
|
3689
|
-
}
|
|
3690
|
-
));
|
|
3691
|
-
};
|
|
3692
|
-
|
|
3693
|
-
// src/components/unstable-repeater/unstable-repeater.tsx
|
|
3694
|
-
var React59 = __toESM(require("react"));
|
|
3695
|
-
|
|
3696
|
-
// src/components/unstable-repeater/items/edit-item-popover.tsx
|
|
3697
|
-
var React58 = __toESM(require("react"));
|
|
3698
|
-
var import_ui49 = require("@elementor/ui");
|
|
3699
|
-
var EditItemPopover = ({ children }) => {
|
|
3700
|
-
const { popoverState, openItemIndex, isOpen, rowRef, setOpenItemIndex, setRowRef, items: items2 } = useRepeaterContext();
|
|
3701
|
-
const popoverProps = (0, import_ui49.bindPopover)(popoverState);
|
|
3702
|
-
if (!isOpen || !rowRef) {
|
|
3703
|
-
return null;
|
|
3704
|
-
}
|
|
3705
|
-
const bind = items2[openItemIndex].item.$$type;
|
|
3706
|
-
const onClose = () => {
|
|
3707
|
-
popoverProps.onClose?.();
|
|
3708
|
-
setRowRef(null);
|
|
3709
|
-
setOpenItemIndex(EMPTY_OPEN_ITEM2);
|
|
3710
|
-
};
|
|
3711
|
-
return /* @__PURE__ */ React58.createElement(
|
|
3712
|
-
import_ui49.Popover,
|
|
3535
|
+
alt: (0, import_i18n25.__)("Preview SVG", "elementor"),
|
|
3536
|
+
sx: { maxHeight: "140px", width: "50px" }
|
|
3537
|
+
}
|
|
3538
|
+
)), /* @__PURE__ */ React64.createElement(
|
|
3539
|
+
import_ui51.CardOverlay,
|
|
3713
3540
|
{
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
sx: { mt: 0.5, width: rowRef.offsetWidth }
|
|
3541
|
+
sx: {
|
|
3542
|
+
"&:hover": {
|
|
3543
|
+
backgroundColor: "rgba( 0, 0, 0, 0.75 )"
|
|
3718
3544
|
}
|
|
3719
|
-
}
|
|
3720
|
-
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
3721
|
-
...popoverProps,
|
|
3722
|
-
anchorEl: rowRef,
|
|
3723
|
-
onClose
|
|
3545
|
+
}
|
|
3724
3546
|
},
|
|
3725
|
-
/* @__PURE__ */
|
|
3726
|
-
|
|
3727
|
-
|
|
3547
|
+
/* @__PURE__ */ React64.createElement(import_ui51.Stack, { gap: 1 }, /* @__PURE__ */ React64.createElement(
|
|
3548
|
+
import_ui51.Button,
|
|
3549
|
+
{
|
|
3550
|
+
size: "tiny",
|
|
3551
|
+
color: "inherit",
|
|
3552
|
+
variant: "outlined",
|
|
3553
|
+
onClick: () => handleClick(MODE_BROWSE)
|
|
3554
|
+
},
|
|
3555
|
+
(0, import_i18n25.__)("Select SVG", "elementor")
|
|
3556
|
+
), /* @__PURE__ */ React64.createElement(
|
|
3557
|
+
import_ui51.Button,
|
|
3558
|
+
{
|
|
3559
|
+
size: "tiny",
|
|
3560
|
+
variant: "text",
|
|
3561
|
+
color: "inherit",
|
|
3562
|
+
startIcon: /* @__PURE__ */ React64.createElement(import_icons17.UploadIcon, null),
|
|
3563
|
+
onClick: () => handleClick(MODE_UPLOAD)
|
|
3564
|
+
},
|
|
3565
|
+
(0, import_i18n25.__)("Upload", "elementor")
|
|
3566
|
+
))
|
|
3567
|
+
))));
|
|
3568
|
+
});
|
|
3728
3569
|
|
|
3729
|
-
// src/
|
|
3730
|
-
var
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3570
|
+
// src/controls/background-control/background-control.tsx
|
|
3571
|
+
var React71 = __toESM(require("react"));
|
|
3572
|
+
var import_editor_props32 = require("@elementor/editor-props");
|
|
3573
|
+
var import_ui59 = require("@elementor/ui");
|
|
3574
|
+
var import_i18n31 = require("@wordpress/i18n");
|
|
3575
|
+
|
|
3576
|
+
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
3577
|
+
var React70 = __toESM(require("react"));
|
|
3578
|
+
var import_editor_props31 = require("@elementor/editor-props");
|
|
3579
|
+
var import_ui58 = require("@elementor/ui");
|
|
3580
|
+
var import_wp_media3 = require("@elementor/wp-media");
|
|
3581
|
+
var import_i18n30 = require("@wordpress/i18n");
|
|
3737
3582
|
|
|
3738
3583
|
// src/env.ts
|
|
3739
3584
|
var import_env = require("@elementor/env");
|
|
3740
3585
|
var { env } = (0, import_env.parseEnv)("@elementor/editor-controls");
|
|
3741
3586
|
|
|
3742
3587
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
3743
|
-
var
|
|
3744
|
-
var
|
|
3745
|
-
var
|
|
3588
|
+
var React65 = __toESM(require("react"));
|
|
3589
|
+
var import_editor_props27 = require("@elementor/editor-props");
|
|
3590
|
+
var import_ui52 = require("@elementor/ui");
|
|
3746
3591
|
var BackgroundGradientColorControl = createControl(() => {
|
|
3747
|
-
const { value, setValue } = useBoundProp(
|
|
3592
|
+
const { value, setValue } = useBoundProp(import_editor_props27.backgroundGradientOverlayPropTypeUtil);
|
|
3748
3593
|
const handleChange = (newValue) => {
|
|
3749
3594
|
const transformedValue = createTransformableValue(newValue);
|
|
3750
3595
|
if (transformedValue.positions) {
|
|
3751
|
-
transformedValue.positions =
|
|
3596
|
+
transformedValue.positions = import_editor_props27.stringPropTypeUtil.create(newValue.positions.join(" "));
|
|
3752
3597
|
}
|
|
3753
3598
|
setValue(transformedValue);
|
|
3754
3599
|
};
|
|
3755
3600
|
const createTransformableValue = (newValue) => ({
|
|
3756
3601
|
...newValue,
|
|
3757
|
-
type:
|
|
3758
|
-
angle:
|
|
3759
|
-
stops:
|
|
3602
|
+
type: import_editor_props27.stringPropTypeUtil.create(newValue.type),
|
|
3603
|
+
angle: import_editor_props27.numberPropTypeUtil.create(newValue.angle),
|
|
3604
|
+
stops: import_editor_props27.gradientColorStopPropTypeUtil.create(
|
|
3760
3605
|
newValue.stops.map(
|
|
3761
|
-
({ color, offset }) =>
|
|
3762
|
-
color:
|
|
3763
|
-
offset:
|
|
3606
|
+
({ color, offset }) => import_editor_props27.colorStopPropTypeUtil.create({
|
|
3607
|
+
color: import_editor_props27.colorPropTypeUtil.create(color),
|
|
3608
|
+
offset: import_editor_props27.numberPropTypeUtil.create(offset)
|
|
3764
3609
|
})
|
|
3765
3610
|
)
|
|
3766
3611
|
)
|
|
@@ -3780,8 +3625,8 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
3780
3625
|
positions: positions?.value.split(" ")
|
|
3781
3626
|
};
|
|
3782
3627
|
};
|
|
3783
|
-
return /* @__PURE__ */
|
|
3784
|
-
|
|
3628
|
+
return /* @__PURE__ */ React65.createElement(ControlActions, null, /* @__PURE__ */ React65.createElement(
|
|
3629
|
+
import_ui52.UnstableGradientBox,
|
|
3785
3630
|
{
|
|
3786
3631
|
sx: { width: "auto", padding: 1.5 },
|
|
3787
3632
|
value: normalizeValue(),
|
|
@@ -3789,67 +3634,67 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
3789
3634
|
}
|
|
3790
3635
|
));
|
|
3791
3636
|
});
|
|
3792
|
-
var initialBackgroundGradientOverlay =
|
|
3793
|
-
type:
|
|
3794
|
-
angle:
|
|
3795
|
-
stops:
|
|
3796
|
-
|
|
3797
|
-
color:
|
|
3798
|
-
offset:
|
|
3637
|
+
var initialBackgroundGradientOverlay = import_editor_props27.backgroundGradientOverlayPropTypeUtil.create({
|
|
3638
|
+
type: import_editor_props27.stringPropTypeUtil.create("linear"),
|
|
3639
|
+
angle: import_editor_props27.numberPropTypeUtil.create(180),
|
|
3640
|
+
stops: import_editor_props27.gradientColorStopPropTypeUtil.create([
|
|
3641
|
+
import_editor_props27.colorStopPropTypeUtil.create({
|
|
3642
|
+
color: import_editor_props27.colorPropTypeUtil.create("rgb(0,0,0)"),
|
|
3643
|
+
offset: import_editor_props27.numberPropTypeUtil.create(0)
|
|
3799
3644
|
}),
|
|
3800
|
-
|
|
3801
|
-
color:
|
|
3802
|
-
offset:
|
|
3645
|
+
import_editor_props27.colorStopPropTypeUtil.create({
|
|
3646
|
+
color: import_editor_props27.colorPropTypeUtil.create("rgb(255,255,255)"),
|
|
3647
|
+
offset: import_editor_props27.numberPropTypeUtil.create(100)
|
|
3803
3648
|
})
|
|
3804
3649
|
])
|
|
3805
3650
|
});
|
|
3806
3651
|
|
|
3807
3652
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
3808
|
-
var
|
|
3809
|
-
var
|
|
3810
|
-
var
|
|
3811
|
-
var
|
|
3653
|
+
var React66 = __toESM(require("react"));
|
|
3654
|
+
var import_icons18 = require("@elementor/icons");
|
|
3655
|
+
var import_ui53 = require("@elementor/ui");
|
|
3656
|
+
var import_i18n26 = require("@wordpress/i18n");
|
|
3812
3657
|
var attachmentControlOptions = [
|
|
3813
3658
|
{
|
|
3814
3659
|
value: "fixed",
|
|
3815
|
-
label: (0,
|
|
3816
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3660
|
+
label: (0, import_i18n26.__)("Fixed", "elementor"),
|
|
3661
|
+
renderContent: ({ size }) => /* @__PURE__ */ React66.createElement(import_icons18.PinIcon, { fontSize: size }),
|
|
3817
3662
|
showTooltip: true
|
|
3818
3663
|
},
|
|
3819
3664
|
{
|
|
3820
3665
|
value: "scroll",
|
|
3821
|
-
label: (0,
|
|
3822
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3666
|
+
label: (0, import_i18n26.__)("Scroll", "elementor"),
|
|
3667
|
+
renderContent: ({ size }) => /* @__PURE__ */ React66.createElement(import_icons18.PinnedOffIcon, { fontSize: size }),
|
|
3823
3668
|
showTooltip: true
|
|
3824
3669
|
}
|
|
3825
3670
|
];
|
|
3826
3671
|
var BackgroundImageOverlayAttachment = () => {
|
|
3827
|
-
return /* @__PURE__ */
|
|
3672
|
+
return /* @__PURE__ */ React66.createElement(PopoverGridContainer, null, /* @__PURE__ */ React66.createElement(import_ui53.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React66.createElement(ControlFormLabel, null, (0, import_i18n26.__)("Attachment", "elementor"))), /* @__PURE__ */ React66.createElement(import_ui53.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React66.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
3828
3673
|
};
|
|
3829
3674
|
|
|
3830
3675
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
3831
|
-
var
|
|
3676
|
+
var React67 = __toESM(require("react"));
|
|
3832
3677
|
var import_react32 = require("react");
|
|
3833
|
-
var
|
|
3678
|
+
var import_editor_props28 = require("@elementor/editor-props");
|
|
3834
3679
|
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
3835
|
-
var
|
|
3836
|
-
var
|
|
3837
|
-
var
|
|
3680
|
+
var import_icons19 = require("@elementor/icons");
|
|
3681
|
+
var import_ui54 = require("@elementor/ui");
|
|
3682
|
+
var import_i18n27 = require("@wordpress/i18n");
|
|
3838
3683
|
var backgroundPositionOptions = [
|
|
3839
|
-
{ label: (0,
|
|
3840
|
-
{ label: (0,
|
|
3841
|
-
{ label: (0,
|
|
3842
|
-
{ label: (0,
|
|
3843
|
-
{ label: (0,
|
|
3844
|
-
{ label: (0,
|
|
3845
|
-
{ label: (0,
|
|
3846
|
-
{ label: (0,
|
|
3847
|
-
{ label: (0,
|
|
3848
|
-
{ label: (0,
|
|
3684
|
+
{ label: (0, import_i18n27.__)("Center center", "elementor"), value: "center center" },
|
|
3685
|
+
{ label: (0, import_i18n27.__)("Center left", "elementor"), value: "center left" },
|
|
3686
|
+
{ label: (0, import_i18n27.__)("Center right", "elementor"), value: "center right" },
|
|
3687
|
+
{ label: (0, import_i18n27.__)("Top center", "elementor"), value: "top center" },
|
|
3688
|
+
{ label: (0, import_i18n27.__)("Top left", "elementor"), value: "top left" },
|
|
3689
|
+
{ label: (0, import_i18n27.__)("Top right", "elementor"), value: "top right" },
|
|
3690
|
+
{ label: (0, import_i18n27.__)("Bottom center", "elementor"), value: "bottom center" },
|
|
3691
|
+
{ label: (0, import_i18n27.__)("Bottom left", "elementor"), value: "bottom left" },
|
|
3692
|
+
{ label: (0, import_i18n27.__)("Bottom right", "elementor"), value: "bottom right" },
|
|
3693
|
+
{ label: (0, import_i18n27.__)("Custom", "elementor"), value: "custom" }
|
|
3849
3694
|
];
|
|
3850
3695
|
var BackgroundImageOverlayPosition = () => {
|
|
3851
|
-
const backgroundImageOffsetContext = useBoundProp(
|
|
3852
|
-
const stringPropContext = useBoundProp(
|
|
3696
|
+
const backgroundImageOffsetContext = useBoundProp(import_editor_props28.backgroundImagePositionOffsetPropTypeUtil);
|
|
3697
|
+
const stringPropContext = useBoundProp(import_editor_props28.stringPropTypeUtil);
|
|
3853
3698
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
3854
3699
|
const rowRef = (0, import_react32.useRef)(null);
|
|
3855
3700
|
const handlePositionChange = (event) => {
|
|
@@ -3860,8 +3705,8 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3860
3705
|
stringPropContext.setValue(value);
|
|
3861
3706
|
}
|
|
3862
3707
|
};
|
|
3863
|
-
return /* @__PURE__ */
|
|
3864
|
-
|
|
3708
|
+
return /* @__PURE__ */ React67.createElement(import_ui54.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React67.createElement(import_ui54.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React67.createElement(PopoverGridContainer, null, /* @__PURE__ */ React67.createElement(import_ui54.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React67.createElement(ControlFormLabel, null, (0, import_i18n27.__)("Position", "elementor"))), /* @__PURE__ */ React67.createElement(import_ui54.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React67.createElement(
|
|
3709
|
+
import_ui54.Select,
|
|
3865
3710
|
{
|
|
3866
3711
|
fullWidth: true,
|
|
3867
3712
|
size: "tiny",
|
|
@@ -3869,18 +3714,18 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3869
3714
|
disabled: stringPropContext.disabled,
|
|
3870
3715
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
|
|
3871
3716
|
},
|
|
3872
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
3873
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3717
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React67.createElement(import_editor_ui6.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
3718
|
+
)))), isCustom ? /* @__PURE__ */ React67.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React67.createElement(import_ui54.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React67.createElement(import_ui54.Grid, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React67.createElement(import_ui54.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React67.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React67.createElement(
|
|
3874
3719
|
SizeControl,
|
|
3875
3720
|
{
|
|
3876
|
-
startIcon: /* @__PURE__ */
|
|
3721
|
+
startIcon: /* @__PURE__ */ React67.createElement(import_icons19.LetterXIcon, { fontSize: "tiny" }),
|
|
3877
3722
|
anchorRef: rowRef,
|
|
3878
3723
|
min: -Number.MAX_SAFE_INTEGER
|
|
3879
3724
|
}
|
|
3880
|
-
))), /* @__PURE__ */
|
|
3725
|
+
))), /* @__PURE__ */ React67.createElement(import_ui54.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React67.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React67.createElement(
|
|
3881
3726
|
SizeControl,
|
|
3882
3727
|
{
|
|
3883
|
-
startIcon: /* @__PURE__ */
|
|
3728
|
+
startIcon: /* @__PURE__ */ React67.createElement(import_icons19.LetterYIcon, { fontSize: "tiny" }),
|
|
3884
3729
|
anchorRef: rowRef,
|
|
3885
3730
|
min: -Number.MAX_SAFE_INTEGER
|
|
3886
3731
|
}
|
|
@@ -3888,76 +3733,76 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
3888
3733
|
};
|
|
3889
3734
|
|
|
3890
3735
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
3891
|
-
var
|
|
3892
|
-
var
|
|
3893
|
-
var
|
|
3894
|
-
var
|
|
3736
|
+
var React68 = __toESM(require("react"));
|
|
3737
|
+
var import_icons20 = require("@elementor/icons");
|
|
3738
|
+
var import_ui55 = require("@elementor/ui");
|
|
3739
|
+
var import_i18n28 = require("@wordpress/i18n");
|
|
3895
3740
|
var repeatControlOptions = [
|
|
3896
3741
|
{
|
|
3897
3742
|
value: "repeat",
|
|
3898
|
-
label: (0,
|
|
3899
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3743
|
+
label: (0, import_i18n28.__)("Repeat", "elementor"),
|
|
3744
|
+
renderContent: ({ size }) => /* @__PURE__ */ React68.createElement(import_icons20.GridDotsIcon, { fontSize: size }),
|
|
3900
3745
|
showTooltip: true
|
|
3901
3746
|
},
|
|
3902
3747
|
{
|
|
3903
3748
|
value: "repeat-x",
|
|
3904
|
-
label: (0,
|
|
3905
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3749
|
+
label: (0, import_i18n28.__)("Repeat-x", "elementor"),
|
|
3750
|
+
renderContent: ({ size }) => /* @__PURE__ */ React68.createElement(import_icons20.DotsHorizontalIcon, { fontSize: size }),
|
|
3906
3751
|
showTooltip: true
|
|
3907
3752
|
},
|
|
3908
3753
|
{
|
|
3909
3754
|
value: "repeat-y",
|
|
3910
|
-
label: (0,
|
|
3911
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3755
|
+
label: (0, import_i18n28.__)("Repeat-y", "elementor"),
|
|
3756
|
+
renderContent: ({ size }) => /* @__PURE__ */ React68.createElement(import_icons20.DotsVerticalIcon, { fontSize: size }),
|
|
3912
3757
|
showTooltip: true
|
|
3913
3758
|
},
|
|
3914
3759
|
{
|
|
3915
3760
|
value: "no-repeat",
|
|
3916
|
-
label: (0,
|
|
3917
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3761
|
+
label: (0, import_i18n28.__)("No-repeat", "elementor"),
|
|
3762
|
+
renderContent: ({ size }) => /* @__PURE__ */ React68.createElement(import_icons20.XIcon, { fontSize: size }),
|
|
3918
3763
|
showTooltip: true
|
|
3919
3764
|
}
|
|
3920
3765
|
];
|
|
3921
3766
|
var BackgroundImageOverlayRepeat = () => {
|
|
3922
|
-
return /* @__PURE__ */
|
|
3767
|
+
return /* @__PURE__ */ React68.createElement(PopoverGridContainer, null, /* @__PURE__ */ React68.createElement(import_ui55.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React68.createElement(ControlFormLabel, null, (0, import_i18n28.__)("Repeat", "elementor"))), /* @__PURE__ */ React68.createElement(import_ui55.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React68.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
3923
3768
|
};
|
|
3924
3769
|
|
|
3925
3770
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
3926
|
-
var
|
|
3771
|
+
var React69 = __toESM(require("react"));
|
|
3927
3772
|
var import_react33 = require("react");
|
|
3928
|
-
var
|
|
3929
|
-
var
|
|
3930
|
-
var
|
|
3931
|
-
var
|
|
3773
|
+
var import_editor_props29 = require("@elementor/editor-props");
|
|
3774
|
+
var import_icons21 = require("@elementor/icons");
|
|
3775
|
+
var import_ui56 = require("@elementor/ui");
|
|
3776
|
+
var import_i18n29 = require("@wordpress/i18n");
|
|
3932
3777
|
var sizeControlOptions = [
|
|
3933
3778
|
{
|
|
3934
3779
|
value: "auto",
|
|
3935
|
-
label: (0,
|
|
3936
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3780
|
+
label: (0, import_i18n29.__)("Auto", "elementor"),
|
|
3781
|
+
renderContent: ({ size }) => /* @__PURE__ */ React69.createElement(import_icons21.LetterAIcon, { fontSize: size }),
|
|
3937
3782
|
showTooltip: true
|
|
3938
3783
|
},
|
|
3939
3784
|
{
|
|
3940
3785
|
value: "cover",
|
|
3941
|
-
label: (0,
|
|
3942
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3786
|
+
label: (0, import_i18n29.__)("Cover", "elementor"),
|
|
3787
|
+
renderContent: ({ size }) => /* @__PURE__ */ React69.createElement(import_icons21.ArrowsMaximizeIcon, { fontSize: size }),
|
|
3943
3788
|
showTooltip: true
|
|
3944
3789
|
},
|
|
3945
3790
|
{
|
|
3946
3791
|
value: "contain",
|
|
3947
|
-
label: (0,
|
|
3948
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3792
|
+
label: (0, import_i18n29.__)("Contain", "elementor"),
|
|
3793
|
+
renderContent: ({ size }) => /* @__PURE__ */ React69.createElement(import_icons21.ArrowBarBothIcon, { fontSize: size }),
|
|
3949
3794
|
showTooltip: true
|
|
3950
3795
|
},
|
|
3951
3796
|
{
|
|
3952
3797
|
value: "custom",
|
|
3953
|
-
label: (0,
|
|
3954
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
3798
|
+
label: (0, import_i18n29.__)("Custom", "elementor"),
|
|
3799
|
+
renderContent: ({ size }) => /* @__PURE__ */ React69.createElement(import_icons21.PencilIcon, { fontSize: size }),
|
|
3955
3800
|
showTooltip: true
|
|
3956
3801
|
}
|
|
3957
3802
|
];
|
|
3958
3803
|
var BackgroundImageOverlaySize = () => {
|
|
3959
|
-
const backgroundImageScaleContext = useBoundProp(
|
|
3960
|
-
const stringPropContext = useBoundProp(
|
|
3804
|
+
const backgroundImageScaleContext = useBoundProp(import_editor_props29.backgroundImageSizeScalePropTypeUtil);
|
|
3805
|
+
const stringPropContext = useBoundProp(import_editor_props29.stringPropTypeUtil);
|
|
3961
3806
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
3962
3807
|
const rowRef = (0, import_react33.useRef)(null);
|
|
3963
3808
|
const handleSizeChange = (size) => {
|
|
@@ -3967,7 +3812,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3967
3812
|
stringPropContext.setValue(size);
|
|
3968
3813
|
}
|
|
3969
3814
|
};
|
|
3970
|
-
return /* @__PURE__ */
|
|
3815
|
+
return /* @__PURE__ */ React69.createElement(import_ui56.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React69.createElement(import_ui56.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React69.createElement(PopoverGridContainer, null, /* @__PURE__ */ React69.createElement(import_ui56.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React69.createElement(ControlFormLabel, null, (0, import_i18n29.__)("Size", "elementor"))), /* @__PURE__ */ React69.createElement(import_ui56.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React69.createElement(
|
|
3971
3816
|
ControlToggleButtonGroup,
|
|
3972
3817
|
{
|
|
3973
3818
|
exclusive: true,
|
|
@@ -3976,17 +3821,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3976
3821
|
disabled: stringPropContext.disabled,
|
|
3977
3822
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
|
|
3978
3823
|
}
|
|
3979
|
-
)))), isCustom ? /* @__PURE__ */
|
|
3824
|
+
)))), isCustom ? /* @__PURE__ */ React69.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React69.createElement(import_ui56.Grid, { item: true, xs: 12, ref: rowRef }, /* @__PURE__ */ React69.createElement(PopoverGridContainer, null, /* @__PURE__ */ React69.createElement(import_ui56.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React69.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React69.createElement(
|
|
3980
3825
|
SizeControl,
|
|
3981
3826
|
{
|
|
3982
|
-
startIcon: /* @__PURE__ */
|
|
3827
|
+
startIcon: /* @__PURE__ */ React69.createElement(import_icons21.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
3983
3828
|
extendedOptions: ["auto"],
|
|
3984
3829
|
anchorRef: rowRef
|
|
3985
3830
|
}
|
|
3986
|
-
))), /* @__PURE__ */
|
|
3831
|
+
))), /* @__PURE__ */ React69.createElement(import_ui56.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React69.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React69.createElement(
|
|
3987
3832
|
SizeControl,
|
|
3988
3833
|
{
|
|
3989
|
-
startIcon: /* @__PURE__ */
|
|
3834
|
+
startIcon: /* @__PURE__ */ React69.createElement(import_icons21.ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
3990
3835
|
extendedOptions: ["auto"],
|
|
3991
3836
|
anchorRef: rowRef
|
|
3992
3837
|
}
|
|
@@ -3995,16 +3840,16 @@ var BackgroundImageOverlaySize = () => {
|
|
|
3995
3840
|
|
|
3996
3841
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
3997
3842
|
var import_react34 = require("react");
|
|
3998
|
-
var
|
|
3999
|
-
var
|
|
3843
|
+
var import_editor_props30 = require("@elementor/editor-props");
|
|
3844
|
+
var import_ui57 = require("@elementor/ui");
|
|
4000
3845
|
var useBackgroundTabsHistory = ({
|
|
4001
3846
|
color: initialBackgroundColorOverlay2,
|
|
4002
3847
|
image: initialBackgroundImageOverlay,
|
|
4003
3848
|
gradient: initialBackgroundGradientOverlay2
|
|
4004
3849
|
}) => {
|
|
4005
|
-
const { value: imageValue, setValue: setImageValue } = useBoundProp(
|
|
4006
|
-
const { value: colorValue, setValue: setColorValue } = useBoundProp(
|
|
4007
|
-
const { value: gradientValue, setValue: setGradientValue } = useBoundProp(
|
|
3850
|
+
const { value: imageValue, setValue: setImageValue } = useBoundProp(import_editor_props30.backgroundImageOverlayPropTypeUtil);
|
|
3851
|
+
const { value: colorValue, setValue: setColorValue } = useBoundProp(import_editor_props30.backgroundColorOverlayPropTypeUtil);
|
|
3852
|
+
const { value: gradientValue, setValue: setGradientValue } = useBoundProp(import_editor_props30.backgroundGradientOverlayPropTypeUtil);
|
|
4008
3853
|
const getCurrentOverlayType = () => {
|
|
4009
3854
|
if (colorValue) {
|
|
4010
3855
|
return "color";
|
|
@@ -4014,7 +3859,7 @@ var useBackgroundTabsHistory = ({
|
|
|
4014
3859
|
}
|
|
4015
3860
|
return "image";
|
|
4016
3861
|
};
|
|
4017
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
3862
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui57.useTabs)(getCurrentOverlayType());
|
|
4018
3863
|
const valuesHistory = (0, import_react34.useRef)({
|
|
4019
3864
|
image: initialBackgroundImageOverlay,
|
|
4020
3865
|
color: initialBackgroundColorOverlay2,
|
|
@@ -4053,9 +3898,9 @@ var useBackgroundTabsHistory = ({
|
|
|
4053
3898
|
|
|
4054
3899
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
4055
3900
|
var DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR = "#00000033";
|
|
4056
|
-
var initialBackgroundColorOverlay =
|
|
3901
|
+
var initialBackgroundColorOverlay = import_editor_props31.backgroundColorOverlayPropTypeUtil.create(
|
|
4057
3902
|
{
|
|
4058
|
-
color:
|
|
3903
|
+
color: import_editor_props31.colorPropTypeUtil.create(DEFAULT_BACKGROUND_COLOR_OVERLAY_COLOR)
|
|
4059
3904
|
}
|
|
4060
3905
|
);
|
|
4061
3906
|
var getInitialBackgroundOverlay = () => ({
|
|
@@ -4083,52 +3928,52 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
4083
3928
|
}
|
|
4084
3929
|
});
|
|
4085
3930
|
var backgroundResolutionOptions = [
|
|
4086
|
-
{ label: (0,
|
|
4087
|
-
{ label: (0,
|
|
4088
|
-
{ label: (0,
|
|
4089
|
-
{ label: (0,
|
|
3931
|
+
{ label: (0, import_i18n30.__)("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
3932
|
+
{ label: (0, import_i18n30.__)("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
3933
|
+
{ label: (0, import_i18n30.__)("Large 1024 x 1024", "elementor"), value: "large" },
|
|
3934
|
+
{ label: (0, import_i18n30.__)("Full", "elementor"), value: "full" }
|
|
4090
3935
|
];
|
|
4091
3936
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
4092
|
-
const { propType, value: overlayValues, setValue } = useBoundProp(
|
|
4093
|
-
return /* @__PURE__ */
|
|
3937
|
+
const { propType, value: overlayValues, setValue } = useBoundProp(import_editor_props31.backgroundOverlayPropTypeUtil);
|
|
3938
|
+
return /* @__PURE__ */ React70.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React70.createElement(
|
|
4094
3939
|
UnstableRepeater,
|
|
4095
3940
|
{
|
|
4096
3941
|
initial: getInitialBackgroundOverlay(),
|
|
4097
|
-
propTypeUtil:
|
|
3942
|
+
propTypeUtil: import_editor_props31.backgroundOverlayPropTypeUtil
|
|
4098
3943
|
},
|
|
4099
|
-
/* @__PURE__ */
|
|
4100
|
-
/* @__PURE__ */
|
|
4101
|
-
/* @__PURE__ */
|
|
3944
|
+
/* @__PURE__ */ React70.createElement(Header, { label: (0, import_i18n30.__)("Overlay", "elementor") }, /* @__PURE__ */ React70.createElement(TooltipAddItemAction, { newItemIndex: 0 })),
|
|
3945
|
+
/* @__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)),
|
|
3946
|
+
/* @__PURE__ */ React70.createElement(EditItemPopover, null, /* @__PURE__ */ React70.createElement(ItemContent, null))
|
|
4102
3947
|
));
|
|
4103
3948
|
});
|
|
4104
|
-
var
|
|
3949
|
+
var ItemContent = () => {
|
|
4105
3950
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
4106
3951
|
image: getInitialBackgroundOverlay().value,
|
|
4107
3952
|
color: initialBackgroundColorOverlay.value,
|
|
4108
3953
|
gradient: initialBackgroundGradientOverlay.value
|
|
4109
3954
|
});
|
|
4110
3955
|
const { rowRef } = useRepeaterContext();
|
|
4111
|
-
return /* @__PURE__ */
|
|
4112
|
-
|
|
3956
|
+
return /* @__PURE__ */ React70.createElement(import_ui58.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React70.createElement(import_ui58.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React70.createElement(
|
|
3957
|
+
import_ui58.Tabs,
|
|
4113
3958
|
{
|
|
4114
3959
|
size: "small",
|
|
4115
3960
|
variant: "fullWidth",
|
|
4116
3961
|
...getTabsProps(),
|
|
4117
|
-
"aria-label": (0,
|
|
3962
|
+
"aria-label": (0, import_i18n30.__)("Background Overlay", "elementor")
|
|
4118
3963
|
},
|
|
4119
|
-
/* @__PURE__ */
|
|
4120
|
-
/* @__PURE__ */
|
|
4121
|
-
/* @__PURE__ */
|
|
4122
|
-
)), /* @__PURE__ */
|
|
3964
|
+
/* @__PURE__ */ React70.createElement(import_ui58.Tab, { label: (0, import_i18n30.__)("Image", "elementor"), ...getTabProps("image") }),
|
|
3965
|
+
/* @__PURE__ */ React70.createElement(import_ui58.Tab, { label: (0, import_i18n30.__)("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
3966
|
+
/* @__PURE__ */ React70.createElement(import_ui58.Tab, { label: (0, import_i18n30.__)("Color", "elementor"), ...getTabProps("color") })
|
|
3967
|
+
)), /* @__PURE__ */ React70.createElement(import_ui58.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React70.createElement(PopoverContent, null, /* @__PURE__ */ React70.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React70.createElement(import_ui58.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React70.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React70.createElement(import_ui58.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React70.createElement(PopoverContent, null, /* @__PURE__ */ React70.createElement(ColorOverlayContent, { anchorEl: rowRef }))));
|
|
4123
3968
|
};
|
|
4124
|
-
var
|
|
3969
|
+
var ItemIcon2 = ({ value }) => {
|
|
4125
3970
|
switch (value.$$type) {
|
|
4126
3971
|
case "background-image-overlay":
|
|
4127
|
-
return /* @__PURE__ */
|
|
3972
|
+
return /* @__PURE__ */ React70.createElement(ItemIconImage, { value });
|
|
4128
3973
|
case "background-color-overlay":
|
|
4129
|
-
return /* @__PURE__ */
|
|
3974
|
+
return /* @__PURE__ */ React70.createElement(ItemIconColor, { value });
|
|
4130
3975
|
case "background-gradient-overlay":
|
|
4131
|
-
return /* @__PURE__ */
|
|
3976
|
+
return /* @__PURE__ */ React70.createElement(ItemIconGradient, { value });
|
|
4132
3977
|
default:
|
|
4133
3978
|
return null;
|
|
4134
3979
|
}
|
|
@@ -4141,12 +3986,12 @@ var extractColorFrom = (prop) => {
|
|
|
4141
3986
|
};
|
|
4142
3987
|
var ItemIconColor = ({ value: prop }) => {
|
|
4143
3988
|
const color = extractColorFrom(prop);
|
|
4144
|
-
return /* @__PURE__ */
|
|
3989
|
+
return /* @__PURE__ */ React70.createElement(StyledUnstableColorIndicator3, { size: "inherit", component: "span", value: color });
|
|
4145
3990
|
};
|
|
4146
3991
|
var ItemIconImage = ({ value }) => {
|
|
4147
3992
|
const { imageUrl } = useImage(value);
|
|
4148
|
-
return /* @__PURE__ */
|
|
4149
|
-
|
|
3993
|
+
return /* @__PURE__ */ React70.createElement(
|
|
3994
|
+
import_ui58.CardMedia,
|
|
4150
3995
|
{
|
|
4151
3996
|
image: imageUrl,
|
|
4152
3997
|
sx: (theme) => ({
|
|
@@ -4160,43 +4005,43 @@ var ItemIconImage = ({ value }) => {
|
|
|
4160
4005
|
};
|
|
4161
4006
|
var ItemIconGradient = ({ value }) => {
|
|
4162
4007
|
const gradient = getGradientValue(value);
|
|
4163
|
-
return /* @__PURE__ */
|
|
4008
|
+
return /* @__PURE__ */ React70.createElement(StyledUnstableColorIndicator3, { size: "inherit", component: "span", value: gradient });
|
|
4164
4009
|
};
|
|
4165
|
-
var
|
|
4010
|
+
var ItemLabel2 = ({ value }) => {
|
|
4166
4011
|
switch (value.$$type) {
|
|
4167
4012
|
case "background-image-overlay":
|
|
4168
|
-
return /* @__PURE__ */
|
|
4013
|
+
return /* @__PURE__ */ React70.createElement(ItemLabelImage, { value });
|
|
4169
4014
|
case "background-color-overlay":
|
|
4170
|
-
return /* @__PURE__ */
|
|
4015
|
+
return /* @__PURE__ */ React70.createElement(ItemLabelColor, { value });
|
|
4171
4016
|
case "background-gradient-overlay":
|
|
4172
|
-
return /* @__PURE__ */
|
|
4017
|
+
return /* @__PURE__ */ React70.createElement(ItemLabelGradient, { value });
|
|
4173
4018
|
default:
|
|
4174
4019
|
return null;
|
|
4175
4020
|
}
|
|
4176
4021
|
};
|
|
4177
4022
|
var ItemLabelColor = ({ value: prop }) => {
|
|
4178
4023
|
const color = extractColorFrom(prop);
|
|
4179
|
-
return /* @__PURE__ */
|
|
4024
|
+
return /* @__PURE__ */ React70.createElement("span", null, color);
|
|
4180
4025
|
};
|
|
4181
4026
|
var ItemLabelImage = ({ value }) => {
|
|
4182
4027
|
const { imageTitle } = useImage(value);
|
|
4183
|
-
return /* @__PURE__ */
|
|
4028
|
+
return /* @__PURE__ */ React70.createElement("span", null, imageTitle);
|
|
4184
4029
|
};
|
|
4185
4030
|
var ItemLabelGradient = ({ value }) => {
|
|
4186
4031
|
if (value.value.type.value === "linear") {
|
|
4187
|
-
return /* @__PURE__ */
|
|
4032
|
+
return /* @__PURE__ */ React70.createElement("span", null, (0, import_i18n30.__)("Linear Gradient", "elementor"));
|
|
4188
4033
|
}
|
|
4189
|
-
return /* @__PURE__ */
|
|
4034
|
+
return /* @__PURE__ */ React70.createElement("span", null, (0, import_i18n30.__)("Radial Gradient", "elementor"));
|
|
4190
4035
|
};
|
|
4191
4036
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
4192
|
-
const propContext = useBoundProp(
|
|
4193
|
-
return /* @__PURE__ */
|
|
4037
|
+
const propContext = useBoundProp(import_editor_props31.backgroundColorOverlayPropTypeUtil);
|
|
4038
|
+
return /* @__PURE__ */ React70.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React70.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React70.createElement(ColorControl, { anchorEl })));
|
|
4194
4039
|
};
|
|
4195
4040
|
var ImageOverlayContent = () => {
|
|
4196
|
-
const propContext = useBoundProp(
|
|
4197
|
-
return /* @__PURE__ */
|
|
4041
|
+
const propContext = useBoundProp(import_editor_props31.backgroundImageOverlayPropTypeUtil);
|
|
4042
|
+
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)));
|
|
4198
4043
|
};
|
|
4199
|
-
var
|
|
4044
|
+
var StyledUnstableColorIndicator3 = (0, import_ui58.styled)(import_ui58.UnstableColorIndicator)(({ theme }) => ({
|
|
4200
4045
|
height: "1rem",
|
|
4201
4046
|
width: "1rem",
|
|
4202
4047
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
@@ -4233,16 +4078,16 @@ var getGradientValue = (value) => {
|
|
|
4233
4078
|
|
|
4234
4079
|
// src/controls/background-control/background-control.tsx
|
|
4235
4080
|
var BackgroundControl = createControl(() => {
|
|
4236
|
-
const propContext = useBoundProp(
|
|
4237
|
-
const colorLabel = (0,
|
|
4238
|
-
return /* @__PURE__ */
|
|
4081
|
+
const propContext = useBoundProp(import_editor_props32.backgroundPropTypeUtil);
|
|
4082
|
+
const colorLabel = (0, import_i18n31.__)("Color", "elementor");
|
|
4083
|
+
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(import_ui59.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React71.createElement(import_ui59.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React71.createElement(ControlLabel, null, colorLabel)), /* @__PURE__ */ React71.createElement(import_ui59.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React71.createElement(ColorControl, null)))));
|
|
4239
4084
|
});
|
|
4240
4085
|
|
|
4241
4086
|
// src/controls/repeatable-control.tsx
|
|
4242
|
-
var
|
|
4087
|
+
var React72 = __toESM(require("react"));
|
|
4243
4088
|
var import_react36 = require("react");
|
|
4244
|
-
var
|
|
4245
|
-
var
|
|
4089
|
+
var import_editor_props33 = require("@elementor/editor-props");
|
|
4090
|
+
var import_ui60 = require("@elementor/ui");
|
|
4246
4091
|
|
|
4247
4092
|
// src/hooks/use-repeatable-control-context.ts
|
|
4248
4093
|
var import_react35 = require("react");
|
|
@@ -4274,7 +4119,7 @@ var RepeatableControl = createControl(
|
|
|
4274
4119
|
return null;
|
|
4275
4120
|
}
|
|
4276
4121
|
const childArrayPropTypeUtil = (0, import_react36.useMemo)(
|
|
4277
|
-
() => (0,
|
|
4122
|
+
() => (0, import_editor_props33.createArrayPropUtils)(childPropTypeUtil.key, childPropTypeUtil.schema, propKey),
|
|
4278
4123
|
[childPropTypeUtil.key, childPropTypeUtil.schema, propKey]
|
|
4279
4124
|
);
|
|
4280
4125
|
const contextValue = (0, import_react36.useMemo)(
|
|
@@ -4286,31 +4131,31 @@ var RepeatableControl = createControl(
|
|
|
4286
4131
|
[childControlConfig, placeholder, patternLabel]
|
|
4287
4132
|
);
|
|
4288
4133
|
const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
4289
|
-
return /* @__PURE__ */
|
|
4134
|
+
return /* @__PURE__ */ React72.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React72.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React72.createElement(
|
|
4290
4135
|
UnstableRepeater,
|
|
4291
4136
|
{
|
|
4292
4137
|
initial: childPropTypeUtil.create(initialValues || null),
|
|
4293
4138
|
propTypeUtil: childArrayPropTypeUtil
|
|
4294
4139
|
},
|
|
4295
|
-
/* @__PURE__ */
|
|
4296
|
-
/* @__PURE__ */
|
|
4140
|
+
/* @__PURE__ */ React72.createElement(Header, { label: repeaterLabel }, /* @__PURE__ */ React72.createElement(TooltipAddItemAction, { ...addItemTooltipProps, newItemIndex: 0 })),
|
|
4141
|
+
/* @__PURE__ */ React72.createElement(
|
|
4297
4142
|
ItemsContainer,
|
|
4298
4143
|
{
|
|
4299
4144
|
isSortable: false,
|
|
4300
|
-
itemTemplate: /* @__PURE__ */
|
|
4145
|
+
itemTemplate: /* @__PURE__ */ React72.createElement(Item, { Icon: ItemIcon3, Label: ItemLabel3 })
|
|
4301
4146
|
},
|
|
4302
|
-
showDuplicate && /* @__PURE__ */
|
|
4303
|
-
showToggle && /* @__PURE__ */
|
|
4304
|
-
/* @__PURE__ */
|
|
4147
|
+
showDuplicate && /* @__PURE__ */ React72.createElement(DuplicateItemAction, null),
|
|
4148
|
+
showToggle && /* @__PURE__ */ React72.createElement(DisableItemAction, null),
|
|
4149
|
+
/* @__PURE__ */ React72.createElement(RemoveItemAction, null)
|
|
4305
4150
|
),
|
|
4306
|
-
/* @__PURE__ */
|
|
4151
|
+
/* @__PURE__ */ React72.createElement(EditItemPopover, null, /* @__PURE__ */ React72.createElement(Content2, null))
|
|
4307
4152
|
)));
|
|
4308
4153
|
}
|
|
4309
4154
|
);
|
|
4310
|
-
var
|
|
4311
|
-
var
|
|
4155
|
+
var ItemIcon3 = () => /* @__PURE__ */ React72.createElement(React72.Fragment, null);
|
|
4156
|
+
var Content2 = () => {
|
|
4312
4157
|
const { component: ChildControl, props = {} } = useRepeatableControlContext();
|
|
4313
|
-
return /* @__PURE__ */
|
|
4158
|
+
return /* @__PURE__ */ React72.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React72.createElement(PopoverGridContainer, null, /* @__PURE__ */ React72.createElement(ChildControl, { ...props })));
|
|
4314
4159
|
};
|
|
4315
4160
|
var interpolate = (template, data) => {
|
|
4316
4161
|
if (!data) {
|
|
@@ -4367,12 +4212,12 @@ var shouldShowPlaceholder = (pattern, data) => {
|
|
|
4367
4212
|
}
|
|
4368
4213
|
return false;
|
|
4369
4214
|
};
|
|
4370
|
-
var
|
|
4215
|
+
var ItemLabel3 = ({ value }) => {
|
|
4371
4216
|
const { placeholder, patternLabel } = useRepeatableControlContext();
|
|
4372
4217
|
const showPlaceholder = shouldShowPlaceholder(patternLabel, value);
|
|
4373
4218
|
const label = showPlaceholder ? placeholder : interpolate(patternLabel, value);
|
|
4374
4219
|
const color = showPlaceholder ? "text.tertiary" : "text.primary";
|
|
4375
|
-
return /* @__PURE__ */
|
|
4220
|
+
return /* @__PURE__ */ React72.createElement(import_ui60.Box, { component: "span", color }, label);
|
|
4376
4221
|
};
|
|
4377
4222
|
var getAllProperties = (pattern) => {
|
|
4378
4223
|
const properties = pattern.match(PLACEHOLDER_REGEX)?.map((match) => match.slice(2, -1)) || [];
|
|
@@ -4380,21 +4225,21 @@ var getAllProperties = (pattern) => {
|
|
|
4380
4225
|
};
|
|
4381
4226
|
|
|
4382
4227
|
// src/controls/key-value-control.tsx
|
|
4383
|
-
var
|
|
4228
|
+
var React73 = __toESM(require("react"));
|
|
4384
4229
|
var import_react37 = require("react");
|
|
4385
|
-
var
|
|
4386
|
-
var
|
|
4387
|
-
var
|
|
4230
|
+
var import_editor_props34 = require("@elementor/editor-props");
|
|
4231
|
+
var import_ui61 = require("@elementor/ui");
|
|
4232
|
+
var import_i18n32 = require("@wordpress/i18n");
|
|
4388
4233
|
var KeyValueControl = createControl((props = {}) => {
|
|
4389
|
-
const { value, setValue, ...propContext } = useBoundProp(
|
|
4234
|
+
const { value, setValue, ...propContext } = useBoundProp(import_editor_props34.keyValuePropTypeUtil);
|
|
4390
4235
|
const [keyError, setKeyError] = (0, import_react37.useState)("");
|
|
4391
4236
|
const [valueError, setValueError] = (0, import_react37.useState)("");
|
|
4392
4237
|
const [sessionState, setSessionState] = (0, import_react37.useState)({
|
|
4393
4238
|
key: value?.key?.value || "",
|
|
4394
4239
|
value: value?.value?.value || ""
|
|
4395
4240
|
});
|
|
4396
|
-
const keyLabel = props.keyName || (0,
|
|
4397
|
-
const valueLabel = props.valueName || (0,
|
|
4241
|
+
const keyLabel = props.keyName || (0, import_i18n32.__)("Key", "elementor");
|
|
4242
|
+
const valueLabel = props.valueName || (0, import_i18n32.__)("Value", "elementor");
|
|
4398
4243
|
const { keyHelper, valueHelper } = props.getHelperText?.(sessionState.key, sessionState.value) || {
|
|
4399
4244
|
keyHelper: void 0,
|
|
4400
4245
|
valueHelper: void 0
|
|
@@ -4403,7 +4248,7 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
4403
4248
|
() => [
|
|
4404
4249
|
props.regexKey ? new RegExp(props.regexKey) : void 0,
|
|
4405
4250
|
props.regexValue ? new RegExp(props.regexValue) : void 0,
|
|
4406
|
-
props.validationErrorMessage || (0,
|
|
4251
|
+
props.validationErrorMessage || (0, import_i18n32.__)("Invalid Format", "elementor")
|
|
4407
4252
|
],
|
|
4408
4253
|
[props.regexKey, props.regexValue, props.validationErrorMessage]
|
|
4409
4254
|
);
|
|
@@ -4425,14 +4270,14 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
4425
4270
|
return;
|
|
4426
4271
|
}
|
|
4427
4272
|
const newChangedValue = newValue[fieldType];
|
|
4428
|
-
if ((0,
|
|
4273
|
+
if ((0, import_editor_props34.isTransformable)(newChangedValue) && newChangedValue.$$type === "dynamic") {
|
|
4429
4274
|
setValue({
|
|
4430
4275
|
...value,
|
|
4431
4276
|
[fieldType]: newChangedValue
|
|
4432
4277
|
});
|
|
4433
4278
|
return;
|
|
4434
4279
|
}
|
|
4435
|
-
const extractedValue =
|
|
4280
|
+
const extractedValue = import_editor_props34.stringPropTypeUtil.extract(newChangedValue);
|
|
4436
4281
|
setSessionState((prev) => ({
|
|
4437
4282
|
...prev,
|
|
4438
4283
|
[fieldType]: extractedValue
|
|
@@ -4452,7 +4297,7 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
4452
4297
|
});
|
|
4453
4298
|
}
|
|
4454
4299
|
};
|
|
4455
|
-
return /* @__PURE__ */
|
|
4300
|
+
return /* @__PURE__ */ React73.createElement(PropProvider, { ...propContext, value, setValue: handleChange }, /* @__PURE__ */ React73.createElement(import_ui61.Grid, { container: true, gap: 1.5 }, /* @__PURE__ */ React73.createElement(import_ui61.Grid, { item: true, xs: 12, display: "flex", flexDirection: "column" }, /* @__PURE__ */ React73.createElement(import_ui61.FormLabel, { 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(import_ui61.FormHelperText, { error: true }, keyError)), /* @__PURE__ */ React73.createElement(import_ui61.Grid, { item: true, xs: 12, display: "flex", flexDirection: "column" }, /* @__PURE__ */ React73.createElement(import_ui61.FormLabel, { size: "tiny", sx: { pb: 1 } }, valueLabel), /* @__PURE__ */ React73.createElement(PropKeyProvider, { bind: "value" }, /* @__PURE__ */ React73.createElement(
|
|
4456
4301
|
TextControl,
|
|
4457
4302
|
{
|
|
4458
4303
|
inputValue: sessionState.value,
|
|
@@ -4460,31 +4305,31 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
4460
4305
|
inputDisabled: !!keyError,
|
|
4461
4306
|
helperText: valueHelper
|
|
4462
4307
|
}
|
|
4463
|
-
)), !!valueError && /* @__PURE__ */
|
|
4308
|
+
)), !!valueError && /* @__PURE__ */ React73.createElement(import_ui61.FormHelperText, { error: true }, valueError))));
|
|
4464
4309
|
});
|
|
4465
4310
|
|
|
4466
4311
|
// src/controls/position-control.tsx
|
|
4467
|
-
var
|
|
4468
|
-
var
|
|
4312
|
+
var React74 = __toESM(require("react"));
|
|
4313
|
+
var import_editor_props35 = require("@elementor/editor-props");
|
|
4469
4314
|
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
4470
|
-
var
|
|
4471
|
-
var
|
|
4472
|
-
var
|
|
4315
|
+
var import_icons22 = require("@elementor/icons");
|
|
4316
|
+
var import_ui62 = require("@elementor/ui");
|
|
4317
|
+
var import_i18n33 = require("@wordpress/i18n");
|
|
4473
4318
|
var positionOptions = [
|
|
4474
|
-
{ label: (0,
|
|
4475
|
-
{ label: (0,
|
|
4476
|
-
{ label: (0,
|
|
4477
|
-
{ label: (0,
|
|
4478
|
-
{ label: (0,
|
|
4479
|
-
{ label: (0,
|
|
4480
|
-
{ label: (0,
|
|
4481
|
-
{ label: (0,
|
|
4482
|
-
{ label: (0,
|
|
4483
|
-
{ label: (0,
|
|
4319
|
+
{ label: (0, import_i18n33.__)("Center center", "elementor"), value: "center center" },
|
|
4320
|
+
{ label: (0, import_i18n33.__)("Center left", "elementor"), value: "center left" },
|
|
4321
|
+
{ label: (0, import_i18n33.__)("Center right", "elementor"), value: "center right" },
|
|
4322
|
+
{ label: (0, import_i18n33.__)("Top center", "elementor"), value: "top center" },
|
|
4323
|
+
{ label: (0, import_i18n33.__)("Top left", "elementor"), value: "top left" },
|
|
4324
|
+
{ label: (0, import_i18n33.__)("Top right", "elementor"), value: "top right" },
|
|
4325
|
+
{ label: (0, import_i18n33.__)("Bottom center", "elementor"), value: "bottom center" },
|
|
4326
|
+
{ label: (0, import_i18n33.__)("Bottom left", "elementor"), value: "bottom left" },
|
|
4327
|
+
{ label: (0, import_i18n33.__)("Bottom right", "elementor"), value: "bottom right" },
|
|
4328
|
+
{ label: (0, import_i18n33.__)("Custom", "elementor"), value: "custom" }
|
|
4484
4329
|
];
|
|
4485
4330
|
var PositionControl = () => {
|
|
4486
|
-
const positionContext = useBoundProp(
|
|
4487
|
-
const stringPropContext = useBoundProp(
|
|
4331
|
+
const positionContext = useBoundProp(import_editor_props35.positionPropTypeUtil);
|
|
4332
|
+
const stringPropContext = useBoundProp(import_editor_props35.stringPropTypeUtil);
|
|
4488
4333
|
const isCustom = !!positionContext.value;
|
|
4489
4334
|
const handlePositionChange = (event) => {
|
|
4490
4335
|
const value = event.target.value || null;
|
|
@@ -4494,8 +4339,8 @@ var PositionControl = () => {
|
|
|
4494
4339
|
stringPropContext.setValue(value);
|
|
4495
4340
|
}
|
|
4496
4341
|
};
|
|
4497
|
-
return /* @__PURE__ */
|
|
4498
|
-
|
|
4342
|
+
return /* @__PURE__ */ React74.createElement(import_ui62.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React74.createElement(import_ui62.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React74.createElement(import_ui62.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React74.createElement(import_ui62.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React74.createElement(ControlFormLabel, null, (0, import_i18n33.__)("Object position", "elementor"))), /* @__PURE__ */ React74.createElement(import_ui62.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React74.createElement(
|
|
4343
|
+
import_ui62.Select,
|
|
4499
4344
|
{
|
|
4500
4345
|
size: "tiny",
|
|
4501
4346
|
disabled: stringPropContext.disabled,
|
|
@@ -4503,32 +4348,32 @@ var PositionControl = () => {
|
|
|
4503
4348
|
onChange: handlePositionChange,
|
|
4504
4349
|
fullWidth: true
|
|
4505
4350
|
},
|
|
4506
|
-
positionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
4507
|
-
)))), isCustom && /* @__PURE__ */
|
|
4351
|
+
positionOptions.map(({ label, value }) => /* @__PURE__ */ React74.createElement(import_editor_ui7.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
4352
|
+
)))), isCustom && /* @__PURE__ */ React74.createElement(PropProvider, { ...positionContext }, /* @__PURE__ */ React74.createElement(import_ui62.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React74.createElement(import_ui62.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React74.createElement(import_ui62.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React74.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React74.createElement(
|
|
4508
4353
|
SizeControl,
|
|
4509
4354
|
{
|
|
4510
|
-
startIcon: /* @__PURE__ */
|
|
4355
|
+
startIcon: /* @__PURE__ */ React74.createElement(import_icons22.LetterXIcon, { fontSize: "tiny" }),
|
|
4511
4356
|
min: -Number.MAX_SAFE_INTEGER
|
|
4512
4357
|
}
|
|
4513
|
-
))), /* @__PURE__ */
|
|
4358
|
+
))), /* @__PURE__ */ React74.createElement(import_ui62.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React74.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React74.createElement(
|
|
4514
4359
|
SizeControl,
|
|
4515
4360
|
{
|
|
4516
|
-
startIcon: /* @__PURE__ */
|
|
4361
|
+
startIcon: /* @__PURE__ */ React74.createElement(import_icons22.LetterYIcon, { fontSize: "tiny" }),
|
|
4517
4362
|
min: -Number.MAX_SAFE_INTEGER
|
|
4518
4363
|
}
|
|
4519
4364
|
)))))));
|
|
4520
4365
|
};
|
|
4521
4366
|
|
|
4522
4367
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
4523
|
-
var
|
|
4368
|
+
var React87 = __toESM(require("react"));
|
|
4524
4369
|
var import_react43 = require("react");
|
|
4525
|
-
var
|
|
4526
|
-
var
|
|
4527
|
-
var
|
|
4528
|
-
var
|
|
4370
|
+
var import_editor_props44 = require("@elementor/editor-props");
|
|
4371
|
+
var import_icons29 = require("@elementor/icons");
|
|
4372
|
+
var import_ui75 = require("@elementor/ui");
|
|
4373
|
+
var import_i18n43 = require("@wordpress/i18n");
|
|
4529
4374
|
|
|
4530
4375
|
// src/controls/transform-control/initial-values.ts
|
|
4531
|
-
var
|
|
4376
|
+
var import_editor_props36 = require("@elementor/editor-props");
|
|
4532
4377
|
var TransformFunctionKeys = {
|
|
4533
4378
|
move: "transform-move",
|
|
4534
4379
|
scale: "transform-scale",
|
|
@@ -4558,110 +4403,110 @@ var initialTransformValue = {
|
|
|
4558
4403
|
z: { $$type: "size", value: { size: defaultValues.move.size, unit: defaultValues.move.unit } }
|
|
4559
4404
|
}
|
|
4560
4405
|
};
|
|
4561
|
-
var initialScaleValue =
|
|
4562
|
-
x:
|
|
4563
|
-
y:
|
|
4564
|
-
z:
|
|
4406
|
+
var initialScaleValue = import_editor_props36.scaleTransformPropTypeUtil.create({
|
|
4407
|
+
x: import_editor_props36.numberPropTypeUtil.create(defaultValues.scale),
|
|
4408
|
+
y: import_editor_props36.numberPropTypeUtil.create(defaultValues.scale),
|
|
4409
|
+
z: import_editor_props36.numberPropTypeUtil.create(defaultValues.scale)
|
|
4565
4410
|
});
|
|
4566
|
-
var initialRotateValue =
|
|
4411
|
+
var initialRotateValue = import_editor_props36.rotateTransformPropTypeUtil.create({
|
|
4567
4412
|
x: { $$type: "size", value: { size: defaultValues.rotate.size, unit: defaultValues.rotate.unit } },
|
|
4568
4413
|
y: { $$type: "size", value: { size: defaultValues.rotate.size, unit: defaultValues.rotate.unit } },
|
|
4569
4414
|
z: { $$type: "size", value: { size: defaultValues.rotate.size, unit: defaultValues.rotate.unit } }
|
|
4570
4415
|
});
|
|
4571
|
-
var initialSkewValue =
|
|
4416
|
+
var initialSkewValue = import_editor_props36.skewTransformPropTypeUtil.create({
|
|
4572
4417
|
x: { $$type: "size", value: { size: defaultValues.skew.size, unit: defaultValues.skew.unit } },
|
|
4573
4418
|
y: { $$type: "size", value: { size: defaultValues.skew.size, unit: defaultValues.skew.unit } }
|
|
4574
4419
|
});
|
|
4575
4420
|
|
|
4576
4421
|
// src/controls/transform-control/transform-base-control.tsx
|
|
4577
|
-
var
|
|
4422
|
+
var React77 = __toESM(require("react"));
|
|
4578
4423
|
var import_editor_ui8 = require("@elementor/editor-ui");
|
|
4579
|
-
var
|
|
4580
|
-
var
|
|
4581
|
-
var
|
|
4424
|
+
var import_icons23 = require("@elementor/icons");
|
|
4425
|
+
var import_ui65 = require("@elementor/ui");
|
|
4426
|
+
var import_i18n36 = require("@wordpress/i18n");
|
|
4582
4427
|
|
|
4583
4428
|
// src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
|
|
4584
|
-
var
|
|
4585
|
-
var
|
|
4586
|
-
var
|
|
4587
|
-
var
|
|
4429
|
+
var React75 = __toESM(require("react"));
|
|
4430
|
+
var import_editor_props37 = require("@elementor/editor-props");
|
|
4431
|
+
var import_ui63 = require("@elementor/ui");
|
|
4432
|
+
var import_i18n34 = require("@wordpress/i18n");
|
|
4588
4433
|
var ORIGIN_UNITS = ["px", "%", "em", "rem"];
|
|
4589
4434
|
var PERSPECTIVE_CONTROL_FIELD = {
|
|
4590
|
-
label: (0,
|
|
4435
|
+
label: (0, import_i18n34.__)("Perspective", "elementor"),
|
|
4591
4436
|
bind: "perspective",
|
|
4592
4437
|
units: ["px", "em", "rem", "vw", "vh"]
|
|
4593
4438
|
};
|
|
4594
4439
|
var CHILDREN_PERSPECTIVE_FIELDS = [
|
|
4595
4440
|
{
|
|
4596
|
-
label: (0,
|
|
4441
|
+
label: (0, import_i18n34.__)("Origin X", "elementor"),
|
|
4597
4442
|
bind: "x",
|
|
4598
4443
|
units: ORIGIN_UNITS
|
|
4599
4444
|
},
|
|
4600
4445
|
{
|
|
4601
|
-
label: (0,
|
|
4446
|
+
label: (0, import_i18n34.__)("Origin Y", "elementor"),
|
|
4602
4447
|
bind: "y",
|
|
4603
4448
|
units: ORIGIN_UNITS
|
|
4604
4449
|
}
|
|
4605
4450
|
];
|
|
4606
4451
|
var ChildrenPerspectiveControl = () => {
|
|
4607
|
-
return /* @__PURE__ */
|
|
4452
|
+
return /* @__PURE__ */ React75.createElement(import_ui63.Stack, { direction: "column", spacing: 1.5 }, /* @__PURE__ */ React75.createElement(ControlFormLabel, null, (0, import_i18n34.__)("Children perspective", "elementor")), /* @__PURE__ */ React75.createElement(PerspectiveControl, null), /* @__PURE__ */ React75.createElement(PerspectiveOriginControl, null));
|
|
4608
4453
|
};
|
|
4609
|
-
var PerspectiveControl = () => /* @__PURE__ */
|
|
4610
|
-
var PerspectiveOriginControl = () => /* @__PURE__ */
|
|
4454
|
+
var PerspectiveControl = () => /* @__PURE__ */ React75.createElement(PropKeyProvider, { bind: "perspective" }, /* @__PURE__ */ React75.createElement(ControlFields, { control: PERSPECTIVE_CONTROL_FIELD, key: PERSPECTIVE_CONTROL_FIELD.bind }));
|
|
4455
|
+
var PerspectiveOriginControl = () => /* @__PURE__ */ React75.createElement(PropKeyProvider, { bind: "perspective-origin" }, /* @__PURE__ */ React75.createElement(PerspectiveOriginControlProvider, null));
|
|
4611
4456
|
var PerspectiveOriginControlProvider = () => {
|
|
4612
|
-
const context = useBoundProp(
|
|
4613
|
-
return /* @__PURE__ */
|
|
4457
|
+
const context = useBoundProp(import_editor_props37.perspectiveOriginPropTypeUtil);
|
|
4458
|
+
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 }))));
|
|
4614
4459
|
};
|
|
4615
4460
|
var ControlFields = ({ control }) => {
|
|
4616
|
-
const rowRef =
|
|
4617
|
-
return /* @__PURE__ */
|
|
4461
|
+
const rowRef = React75.useRef(null);
|
|
4462
|
+
return /* @__PURE__ */ React75.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React75.createElement(import_ui63.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React75.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React75.createElement(import_ui63.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React75.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef, disableCustom: true })));
|
|
4618
4463
|
};
|
|
4619
4464
|
|
|
4620
4465
|
// src/controls/transform-control/transform-base-controls/transform-origin-control.tsx
|
|
4621
|
-
var
|
|
4622
|
-
var
|
|
4623
|
-
var
|
|
4624
|
-
var
|
|
4466
|
+
var React76 = __toESM(require("react"));
|
|
4467
|
+
var import_editor_props38 = require("@elementor/editor-props");
|
|
4468
|
+
var import_ui64 = require("@elementor/ui");
|
|
4469
|
+
var import_i18n35 = require("@wordpress/i18n");
|
|
4625
4470
|
var TRANSFORM_ORIGIN_UNITS = ["px", "%", "em", "rem"];
|
|
4626
4471
|
var TRANSFORM_ORIGIN_UNITS_Z_AXIS = TRANSFORM_ORIGIN_UNITS.filter((unit) => unit !== "%");
|
|
4627
4472
|
var TRANSFORM_ORIGIN_FIELDS = [
|
|
4628
4473
|
{
|
|
4629
|
-
label: (0,
|
|
4474
|
+
label: (0, import_i18n35.__)("Origin X", "elementor"),
|
|
4630
4475
|
bind: "x",
|
|
4631
4476
|
units: TRANSFORM_ORIGIN_UNITS
|
|
4632
4477
|
},
|
|
4633
4478
|
{
|
|
4634
|
-
label: (0,
|
|
4479
|
+
label: (0, import_i18n35.__)("Origin Y", "elementor"),
|
|
4635
4480
|
bind: "y",
|
|
4636
4481
|
units: TRANSFORM_ORIGIN_UNITS
|
|
4637
4482
|
},
|
|
4638
4483
|
{
|
|
4639
|
-
label: (0,
|
|
4484
|
+
label: (0, import_i18n35.__)("Origin Z", "elementor"),
|
|
4640
4485
|
bind: "z",
|
|
4641
4486
|
units: TRANSFORM_ORIGIN_UNITS_Z_AXIS
|
|
4642
4487
|
}
|
|
4643
4488
|
];
|
|
4644
4489
|
var TransformOriginControl = () => {
|
|
4645
|
-
return /* @__PURE__ */
|
|
4490
|
+
return /* @__PURE__ */ React76.createElement(import_ui64.Stack, { direction: "column", spacing: 1.5 }, /* @__PURE__ */ React76.createElement(ControlFormLabel, null, (0, import_i18n35.__)("Transform", "elementor")), TRANSFORM_ORIGIN_FIELDS.map((control) => /* @__PURE__ */ React76.createElement(ControlFields2, { control, key: control.bind })));
|
|
4646
4491
|
};
|
|
4647
4492
|
var ControlFields2 = ({ control }) => {
|
|
4648
|
-
const context = useBoundProp(
|
|
4649
|
-
const rowRef =
|
|
4650
|
-
return /* @__PURE__ */
|
|
4493
|
+
const context = useBoundProp(import_editor_props38.transformOriginPropTypeUtil);
|
|
4494
|
+
const rowRef = React76.useRef(null);
|
|
4495
|
+
return /* @__PURE__ */ React76.createElement(PropProvider, { ...context }, /* @__PURE__ */ React76.createElement(PropKeyProvider, { bind: control.bind }, /* @__PURE__ */ React76.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React76.createElement(import_ui64.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React76.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React76.createElement(import_ui64.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React76.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef, disableCustom: true })))));
|
|
4651
4496
|
};
|
|
4652
4497
|
|
|
4653
4498
|
// src/controls/transform-control/transform-base-control.tsx
|
|
4654
|
-
var
|
|
4499
|
+
var SIZE7 = "tiny";
|
|
4655
4500
|
var TransformBaseControl = ({
|
|
4656
4501
|
popupState,
|
|
4657
4502
|
anchorRef
|
|
4658
4503
|
}) => {
|
|
4659
|
-
const popupProps = (0,
|
|
4504
|
+
const popupProps = (0, import_ui65.bindPopover)({
|
|
4660
4505
|
...popupState,
|
|
4661
4506
|
anchorEl: anchorRef.current ?? void 0
|
|
4662
4507
|
});
|
|
4663
|
-
return /* @__PURE__ */
|
|
4664
|
-
|
|
4508
|
+
return /* @__PURE__ */ React77.createElement(
|
|
4509
|
+
import_ui65.Popover,
|
|
4665
4510
|
{
|
|
4666
4511
|
disablePortal: true,
|
|
4667
4512
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
@@ -4675,37 +4520,37 @@ var TransformBaseControl = ({
|
|
|
4675
4520
|
},
|
|
4676
4521
|
...popupProps
|
|
4677
4522
|
},
|
|
4678
|
-
/* @__PURE__ */
|
|
4523
|
+
/* @__PURE__ */ React77.createElement(
|
|
4679
4524
|
import_editor_ui8.PopoverHeader,
|
|
4680
4525
|
{
|
|
4681
|
-
title: (0,
|
|
4526
|
+
title: (0, import_i18n36.__)("Base Transform", "elementor"),
|
|
4682
4527
|
onClose: popupState.close,
|
|
4683
|
-
icon: /* @__PURE__ */
|
|
4528
|
+
icon: /* @__PURE__ */ React77.createElement(import_icons23.AdjustmentsIcon, { fontSize: SIZE7 })
|
|
4684
4529
|
}
|
|
4685
4530
|
),
|
|
4686
|
-
/* @__PURE__ */
|
|
4687
|
-
/* @__PURE__ */
|
|
4531
|
+
/* @__PURE__ */ React77.createElement(import_ui65.Divider, null),
|
|
4532
|
+
/* @__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(import_ui65.Box, { sx: { my: 0.5 } }, /* @__PURE__ */ React77.createElement(import_ui65.Divider, null)), /* @__PURE__ */ React77.createElement(ChildrenPerspectiveControl, null))
|
|
4688
4533
|
);
|
|
4689
4534
|
};
|
|
4690
4535
|
|
|
4691
4536
|
// src/controls/transform-control/transform-content.tsx
|
|
4692
|
-
var
|
|
4693
|
-
var
|
|
4694
|
-
var
|
|
4537
|
+
var React84 = __toESM(require("react"));
|
|
4538
|
+
var import_ui73 = require("@elementor/ui");
|
|
4539
|
+
var import_i18n41 = require("@wordpress/i18n");
|
|
4695
4540
|
|
|
4696
4541
|
// src/controls/transform-control/functions/move.tsx
|
|
4697
|
-
var
|
|
4542
|
+
var React79 = __toESM(require("react"));
|
|
4698
4543
|
var import_react38 = require("react");
|
|
4699
|
-
var
|
|
4700
|
-
var
|
|
4701
|
-
var
|
|
4702
|
-
var
|
|
4544
|
+
var import_editor_props39 = require("@elementor/editor-props");
|
|
4545
|
+
var import_icons24 = require("@elementor/icons");
|
|
4546
|
+
var import_ui67 = require("@elementor/ui");
|
|
4547
|
+
var import_i18n37 = require("@wordpress/i18n");
|
|
4703
4548
|
|
|
4704
4549
|
// src/controls/transform-control/functions/axis-row.tsx
|
|
4705
|
-
var
|
|
4706
|
-
var
|
|
4550
|
+
var React78 = __toESM(require("react"));
|
|
4551
|
+
var import_ui66 = require("@elementor/ui");
|
|
4707
4552
|
var AxisRow = ({ label, bind, startIcon, anchorRef, units: units2, variant = "angle" }) => {
|
|
4708
|
-
return /* @__PURE__ */
|
|
4553
|
+
return /* @__PURE__ */ React78.createElement(import_ui66.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React78.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React78.createElement(import_ui66.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React78.createElement(ControlLabel, null, label)), /* @__PURE__ */ React78.createElement(import_ui66.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React78.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React78.createElement(
|
|
4709
4554
|
SizeControl,
|
|
4710
4555
|
{
|
|
4711
4556
|
anchorRef,
|
|
@@ -4720,28 +4565,28 @@ var AxisRow = ({ label, bind, startIcon, anchorRef, units: units2, variant = "an
|
|
|
4720
4565
|
// src/controls/transform-control/functions/move.tsx
|
|
4721
4566
|
var moveAxisControls = [
|
|
4722
4567
|
{
|
|
4723
|
-
label: (0,
|
|
4568
|
+
label: (0, import_i18n37.__)("Move X", "elementor"),
|
|
4724
4569
|
bind: "x",
|
|
4725
|
-
startIcon: /* @__PURE__ */
|
|
4570
|
+
startIcon: /* @__PURE__ */ React79.createElement(import_icons24.ArrowRightIcon, { fontSize: "tiny" }),
|
|
4726
4571
|
units: ["px", "%", "em", "rem", "vw"]
|
|
4727
4572
|
},
|
|
4728
4573
|
{
|
|
4729
|
-
label: (0,
|
|
4574
|
+
label: (0, import_i18n37.__)("Move Y", "elementor"),
|
|
4730
4575
|
bind: "y",
|
|
4731
|
-
startIcon: /* @__PURE__ */
|
|
4576
|
+
startIcon: /* @__PURE__ */ React79.createElement(import_icons24.ArrowDownSmallIcon, { fontSize: "tiny" }),
|
|
4732
4577
|
units: ["px", "%", "em", "rem", "vh"]
|
|
4733
4578
|
},
|
|
4734
4579
|
{
|
|
4735
|
-
label: (0,
|
|
4580
|
+
label: (0, import_i18n37.__)("Move Z", "elementor"),
|
|
4736
4581
|
bind: "z",
|
|
4737
|
-
startIcon: /* @__PURE__ */
|
|
4582
|
+
startIcon: /* @__PURE__ */ React79.createElement(import_icons24.ArrowDownLeftIcon, { fontSize: "tiny" }),
|
|
4738
4583
|
units: ["px", "%", "em", "rem", "vw", "vh"]
|
|
4739
4584
|
}
|
|
4740
4585
|
];
|
|
4741
4586
|
var Move = () => {
|
|
4742
|
-
const context = useBoundProp(
|
|
4587
|
+
const context = useBoundProp(import_editor_props39.moveTransformPropTypeUtil);
|
|
4743
4588
|
const rowRefs = [(0, import_react38.useRef)(null), (0, import_react38.useRef)(null), (0, import_react38.useRef)(null)];
|
|
4744
|
-
return /* @__PURE__ */
|
|
4589
|
+
return /* @__PURE__ */ React79.createElement(import_ui67.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React79.createElement(PropProvider, { ...context }, /* @__PURE__ */ React79.createElement(PropKeyProvider, { bind: TransformFunctionKeys.move }, moveAxisControls.map((control, index) => /* @__PURE__ */ React79.createElement(
|
|
4745
4590
|
AxisRow,
|
|
4746
4591
|
{
|
|
4747
4592
|
key: control.bind,
|
|
@@ -4754,34 +4599,34 @@ var Move = () => {
|
|
|
4754
4599
|
};
|
|
4755
4600
|
|
|
4756
4601
|
// src/controls/transform-control/functions/rotate.tsx
|
|
4757
|
-
var
|
|
4602
|
+
var React80 = __toESM(require("react"));
|
|
4758
4603
|
var import_react39 = require("react");
|
|
4759
|
-
var
|
|
4760
|
-
var
|
|
4761
|
-
var
|
|
4762
|
-
var
|
|
4604
|
+
var import_editor_props40 = require("@elementor/editor-props");
|
|
4605
|
+
var import_icons25 = require("@elementor/icons");
|
|
4606
|
+
var import_ui68 = require("@elementor/ui");
|
|
4607
|
+
var import_i18n38 = require("@wordpress/i18n");
|
|
4763
4608
|
var rotateAxisControls = [
|
|
4764
4609
|
{
|
|
4765
|
-
label: (0,
|
|
4610
|
+
label: (0, import_i18n38.__)("Rotate X", "elementor"),
|
|
4766
4611
|
bind: "x",
|
|
4767
|
-
startIcon: /* @__PURE__ */
|
|
4612
|
+
startIcon: /* @__PURE__ */ React80.createElement(import_icons25.Arrow360Icon, { fontSize: "tiny" })
|
|
4768
4613
|
},
|
|
4769
4614
|
{
|
|
4770
|
-
label: (0,
|
|
4615
|
+
label: (0, import_i18n38.__)("Rotate Y", "elementor"),
|
|
4771
4616
|
bind: "y",
|
|
4772
|
-
startIcon: /* @__PURE__ */
|
|
4617
|
+
startIcon: /* @__PURE__ */ React80.createElement(import_icons25.Arrow360Icon, { fontSize: "tiny", style: { transform: "scaleX(-1) rotate(-90deg)" } })
|
|
4773
4618
|
},
|
|
4774
4619
|
{
|
|
4775
|
-
label: (0,
|
|
4620
|
+
label: (0, import_i18n38.__)("Rotate Z", "elementor"),
|
|
4776
4621
|
bind: "z",
|
|
4777
|
-
startIcon: /* @__PURE__ */
|
|
4622
|
+
startIcon: /* @__PURE__ */ React80.createElement(import_icons25.RotateClockwiseIcon, { fontSize: "tiny" })
|
|
4778
4623
|
}
|
|
4779
4624
|
];
|
|
4780
4625
|
var rotateUnits = ["deg", "rad", "grad", "turn"];
|
|
4781
4626
|
var Rotate = () => {
|
|
4782
|
-
const context = useBoundProp(
|
|
4627
|
+
const context = useBoundProp(import_editor_props40.rotateTransformPropTypeUtil);
|
|
4783
4628
|
const rowRefs = [(0, import_react39.useRef)(null), (0, import_react39.useRef)(null), (0, import_react39.useRef)(null)];
|
|
4784
|
-
return /* @__PURE__ */
|
|
4629
|
+
return /* @__PURE__ */ React80.createElement(import_ui68.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React80.createElement(PropProvider, { ...context }, /* @__PURE__ */ React80.createElement(PropKeyProvider, { bind: TransformFunctionKeys.rotate }, rotateAxisControls.map((control, index) => /* @__PURE__ */ React80.createElement(
|
|
4785
4630
|
AxisRow,
|
|
4786
4631
|
{
|
|
4787
4632
|
key: control.bind,
|
|
@@ -4793,68 +4638,68 @@ var Rotate = () => {
|
|
|
4793
4638
|
};
|
|
4794
4639
|
|
|
4795
4640
|
// src/controls/transform-control/functions/scale.tsx
|
|
4796
|
-
var
|
|
4641
|
+
var React82 = __toESM(require("react"));
|
|
4797
4642
|
var import_react40 = require("react");
|
|
4798
|
-
var
|
|
4799
|
-
var
|
|
4800
|
-
var
|
|
4801
|
-
var
|
|
4643
|
+
var import_editor_props41 = require("@elementor/editor-props");
|
|
4644
|
+
var import_icons26 = require("@elementor/icons");
|
|
4645
|
+
var import_ui70 = require("@elementor/ui");
|
|
4646
|
+
var import_i18n39 = require("@wordpress/i18n");
|
|
4802
4647
|
|
|
4803
4648
|
// src/controls/transform-control/functions/scale-axis-row.tsx
|
|
4804
|
-
var
|
|
4805
|
-
var
|
|
4649
|
+
var React81 = __toESM(require("react"));
|
|
4650
|
+
var import_ui69 = require("@elementor/ui");
|
|
4806
4651
|
var ScaleAxisRow = ({ label, bind, startIcon, anchorRef }) => {
|
|
4807
|
-
return /* @__PURE__ */
|
|
4652
|
+
return /* @__PURE__ */ React81.createElement(import_ui69.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React81.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React81.createElement(import_ui69.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React81.createElement(ControlLabel, null, label)), /* @__PURE__ */ React81.createElement(import_ui69.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React81.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React81.createElement(NumberControl, { step: 0.1, placeholder: "1", startIcon })))));
|
|
4808
4653
|
};
|
|
4809
4654
|
|
|
4810
4655
|
// src/controls/transform-control/functions/scale.tsx
|
|
4811
4656
|
var scaleAxisControls = [
|
|
4812
4657
|
{
|
|
4813
|
-
label: (0,
|
|
4658
|
+
label: (0, import_i18n39.__)("Scale X", "elementor"),
|
|
4814
4659
|
bind: "x",
|
|
4815
|
-
startIcon: /* @__PURE__ */
|
|
4660
|
+
startIcon: /* @__PURE__ */ React82.createElement(import_icons26.ArrowRightIcon, { fontSize: "tiny" })
|
|
4816
4661
|
},
|
|
4817
4662
|
{
|
|
4818
|
-
label: (0,
|
|
4663
|
+
label: (0, import_i18n39.__)("Scale Y", "elementor"),
|
|
4819
4664
|
bind: "y",
|
|
4820
|
-
startIcon: /* @__PURE__ */
|
|
4665
|
+
startIcon: /* @__PURE__ */ React82.createElement(import_icons26.ArrowDownSmallIcon, { fontSize: "tiny" })
|
|
4821
4666
|
},
|
|
4822
4667
|
{
|
|
4823
|
-
label: (0,
|
|
4668
|
+
label: (0, import_i18n39.__)("Scale Z", "elementor"),
|
|
4824
4669
|
bind: "z",
|
|
4825
|
-
startIcon: /* @__PURE__ */
|
|
4670
|
+
startIcon: /* @__PURE__ */ React82.createElement(import_icons26.ArrowDownLeftIcon, { fontSize: "tiny" })
|
|
4826
4671
|
}
|
|
4827
4672
|
];
|
|
4828
4673
|
var Scale = () => {
|
|
4829
|
-
const context = useBoundProp(
|
|
4674
|
+
const context = useBoundProp(import_editor_props41.scaleTransformPropTypeUtil);
|
|
4830
4675
|
const rowRefs = [(0, import_react40.useRef)(null), (0, import_react40.useRef)(null), (0, import_react40.useRef)(null)];
|
|
4831
|
-
return /* @__PURE__ */
|
|
4676
|
+
return /* @__PURE__ */ React82.createElement(import_ui70.Grid, { 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] })))));
|
|
4832
4677
|
};
|
|
4833
4678
|
|
|
4834
4679
|
// src/controls/transform-control/functions/skew.tsx
|
|
4835
|
-
var
|
|
4680
|
+
var React83 = __toESM(require("react"));
|
|
4836
4681
|
var import_react41 = require("react");
|
|
4837
|
-
var
|
|
4838
|
-
var
|
|
4839
|
-
var
|
|
4840
|
-
var
|
|
4682
|
+
var import_editor_props42 = require("@elementor/editor-props");
|
|
4683
|
+
var import_icons27 = require("@elementor/icons");
|
|
4684
|
+
var import_ui71 = require("@elementor/ui");
|
|
4685
|
+
var import_i18n40 = require("@wordpress/i18n");
|
|
4841
4686
|
var skewAxisControls = [
|
|
4842
4687
|
{
|
|
4843
|
-
label: (0,
|
|
4688
|
+
label: (0, import_i18n40.__)("Skew X", "elementor"),
|
|
4844
4689
|
bind: "x",
|
|
4845
|
-
startIcon: /* @__PURE__ */
|
|
4690
|
+
startIcon: /* @__PURE__ */ React83.createElement(import_icons27.ArrowRightIcon, { fontSize: "tiny" })
|
|
4846
4691
|
},
|
|
4847
4692
|
{
|
|
4848
|
-
label: (0,
|
|
4693
|
+
label: (0, import_i18n40.__)("Skew Y", "elementor"),
|
|
4849
4694
|
bind: "y",
|
|
4850
|
-
startIcon: /* @__PURE__ */
|
|
4695
|
+
startIcon: /* @__PURE__ */ React83.createElement(import_icons27.ArrowLeftIcon, { fontSize: "tiny", style: { transform: "scaleX(-1) rotate(-90deg)" } })
|
|
4851
4696
|
}
|
|
4852
4697
|
];
|
|
4853
4698
|
var skewUnits = ["deg", "rad", "grad", "turn"];
|
|
4854
4699
|
var Skew = () => {
|
|
4855
|
-
const context = useBoundProp(
|
|
4700
|
+
const context = useBoundProp(import_editor_props42.skewTransformPropTypeUtil);
|
|
4856
4701
|
const rowRefs = [(0, import_react41.useRef)(null), (0, import_react41.useRef)(null), (0, import_react41.useRef)(null)];
|
|
4857
|
-
return /* @__PURE__ */
|
|
4702
|
+
return /* @__PURE__ */ React83.createElement(import_ui71.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React83.createElement(PropProvider, { ...context }, /* @__PURE__ */ React83.createElement(PropKeyProvider, { bind: TransformFunctionKeys.skew }, skewAxisControls.map((control, index) => /* @__PURE__ */ React83.createElement(
|
|
4858
4703
|
AxisRow,
|
|
4859
4704
|
{
|
|
4860
4705
|
key: control.bind,
|
|
@@ -4867,18 +4712,18 @@ var Skew = () => {
|
|
|
4867
4712
|
|
|
4868
4713
|
// src/controls/transform-control/use-transform-tabs-history.tsx
|
|
4869
4714
|
var import_react42 = require("react");
|
|
4870
|
-
var
|
|
4871
|
-
var
|
|
4715
|
+
var import_editor_props43 = require("@elementor/editor-props");
|
|
4716
|
+
var import_ui72 = require("@elementor/ui");
|
|
4872
4717
|
var useTransformTabsHistory = ({
|
|
4873
4718
|
move: initialMove,
|
|
4874
4719
|
scale: initialScale,
|
|
4875
4720
|
rotate: initialRotate,
|
|
4876
4721
|
skew: initialSkew
|
|
4877
4722
|
}) => {
|
|
4878
|
-
const { value: moveValue, setValue: setMoveValue } = useBoundProp(
|
|
4879
|
-
const { value: scaleValue, setValue: setScaleValue } = useBoundProp(
|
|
4880
|
-
const { value: rotateValue, setValue: setRotateValue } = useBoundProp(
|
|
4881
|
-
const { value: skewValue, setValue: setSkewValue } = useBoundProp(
|
|
4723
|
+
const { value: moveValue, setValue: setMoveValue } = useBoundProp(import_editor_props43.moveTransformPropTypeUtil);
|
|
4724
|
+
const { value: scaleValue, setValue: setScaleValue } = useBoundProp(import_editor_props43.scaleTransformPropTypeUtil);
|
|
4725
|
+
const { value: rotateValue, setValue: setRotateValue } = useBoundProp(import_editor_props43.rotateTransformPropTypeUtil);
|
|
4726
|
+
const { value: skewValue, setValue: setSkewValue } = useBoundProp(import_editor_props43.skewTransformPropTypeUtil);
|
|
4882
4727
|
const { openItemIndex, items: items2 } = useRepeaterContext();
|
|
4883
4728
|
const getCurrentTransformType = () => {
|
|
4884
4729
|
switch (true) {
|
|
@@ -4892,7 +4737,7 @@ var useTransformTabsHistory = ({
|
|
|
4892
4737
|
return TransformFunctionKeys.move;
|
|
4893
4738
|
}
|
|
4894
4739
|
};
|
|
4895
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
4740
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui72.useTabs)(getCurrentTransformType());
|
|
4896
4741
|
const valuesHistory = (0, import_react42.useRef)({
|
|
4897
4742
|
move: initialMove,
|
|
4898
4743
|
scale: initialScale,
|
|
@@ -4954,8 +4799,8 @@ var TransformContent = () => {
|
|
|
4954
4799
|
rotate: initialRotateValue.value,
|
|
4955
4800
|
skew: initialSkewValue.value
|
|
4956
4801
|
});
|
|
4957
|
-
return /* @__PURE__ */
|
|
4958
|
-
|
|
4802
|
+
return /* @__PURE__ */ React84.createElement(PopoverContent, null, /* @__PURE__ */ React84.createElement(import_ui73.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React84.createElement(import_ui73.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React84.createElement(
|
|
4803
|
+
import_ui73.Tabs,
|
|
4959
4804
|
{
|
|
4960
4805
|
size: "small",
|
|
4961
4806
|
variant: "fullWidth",
|
|
@@ -4965,37 +4810,37 @@ var TransformContent = () => {
|
|
|
4965
4810
|
}
|
|
4966
4811
|
},
|
|
4967
4812
|
...getTabsProps(),
|
|
4968
|
-
"aria-label": (0,
|
|
4813
|
+
"aria-label": (0, import_i18n41.__)("Transform", "elementor")
|
|
4969
4814
|
},
|
|
4970
|
-
/* @__PURE__ */
|
|
4971
|
-
/* @__PURE__ */
|
|
4972
|
-
/* @__PURE__ */
|
|
4973
|
-
/* @__PURE__ */
|
|
4974
|
-
)), /* @__PURE__ */
|
|
4815
|
+
/* @__PURE__ */ React84.createElement(import_ui73.Tab, { label: (0, import_i18n41.__)("Move", "elementor"), ...getTabProps(TransformFunctionKeys.move) }),
|
|
4816
|
+
/* @__PURE__ */ React84.createElement(import_ui73.Tab, { label: (0, import_i18n41.__)("Scale", "elementor"), ...getTabProps(TransformFunctionKeys.scale) }),
|
|
4817
|
+
/* @__PURE__ */ React84.createElement(import_ui73.Tab, { label: (0, import_i18n41.__)("Rotate", "elementor"), ...getTabProps(TransformFunctionKeys.rotate) }),
|
|
4818
|
+
/* @__PURE__ */ React84.createElement(import_ui73.Tab, { label: (0, import_i18n41.__)("Skew", "elementor"), ...getTabProps(TransformFunctionKeys.skew) })
|
|
4819
|
+
)), /* @__PURE__ */ React84.createElement(import_ui73.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.move) }, /* @__PURE__ */ React84.createElement(Move, null)), /* @__PURE__ */ React84.createElement(import_ui73.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.scale) }, /* @__PURE__ */ React84.createElement(Scale, null)), /* @__PURE__ */ React84.createElement(import_ui73.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.rotate) }, /* @__PURE__ */ React84.createElement(Rotate, null)), /* @__PURE__ */ React84.createElement(import_ui73.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.skew) }, /* @__PURE__ */ React84.createElement(Skew, null))));
|
|
4975
4820
|
};
|
|
4976
4821
|
|
|
4977
4822
|
// src/controls/transform-control/transform-icon.tsx
|
|
4978
|
-
var
|
|
4979
|
-
var
|
|
4823
|
+
var React85 = __toESM(require("react"));
|
|
4824
|
+
var import_icons28 = require("@elementor/icons");
|
|
4980
4825
|
var TransformIcon = ({ value }) => {
|
|
4981
4826
|
switch (value.$$type) {
|
|
4982
4827
|
case TransformFunctionKeys.move:
|
|
4983
|
-
return /* @__PURE__ */
|
|
4828
|
+
return /* @__PURE__ */ React85.createElement(import_icons28.ArrowsMaximizeIcon, { fontSize: "tiny" });
|
|
4984
4829
|
case TransformFunctionKeys.scale:
|
|
4985
|
-
return /* @__PURE__ */
|
|
4830
|
+
return /* @__PURE__ */ React85.createElement(import_icons28.ExpandIcon, { fontSize: "tiny" });
|
|
4986
4831
|
case TransformFunctionKeys.rotate:
|
|
4987
|
-
return /* @__PURE__ */
|
|
4832
|
+
return /* @__PURE__ */ React85.createElement(import_icons28.RotateClockwise2Icon, { fontSize: "tiny" });
|
|
4988
4833
|
case TransformFunctionKeys.skew:
|
|
4989
|
-
return /* @__PURE__ */
|
|
4834
|
+
return /* @__PURE__ */ React85.createElement(import_icons28.SkewXIcon, { fontSize: "tiny" });
|
|
4990
4835
|
default:
|
|
4991
4836
|
return null;
|
|
4992
4837
|
}
|
|
4993
4838
|
};
|
|
4994
4839
|
|
|
4995
4840
|
// src/controls/transform-control/transform-label.tsx
|
|
4996
|
-
var
|
|
4997
|
-
var
|
|
4998
|
-
var
|
|
4841
|
+
var React86 = __toESM(require("react"));
|
|
4842
|
+
var import_ui74 = require("@elementor/ui");
|
|
4843
|
+
var import_i18n42 = require("@wordpress/i18n");
|
|
4999
4844
|
var transformMoveValue = (value) => Object.values(value).map((axis) => {
|
|
5000
4845
|
const size = axis?.value?.size ?? defaultValues.move.size;
|
|
5001
4846
|
const unit = axis?.value?.unit ?? defaultValues.move.unit;
|
|
@@ -5016,60 +4861,60 @@ var TransformLabel = (props) => {
|
|
|
5016
4861
|
const { $$type, value } = props.value;
|
|
5017
4862
|
switch ($$type) {
|
|
5018
4863
|
case TransformFunctionKeys.move:
|
|
5019
|
-
return /* @__PURE__ */
|
|
4864
|
+
return /* @__PURE__ */ React86.createElement(Label2, { label: (0, import_i18n42.__)("Move", "elementor"), value: transformMoveValue(value) });
|
|
5020
4865
|
case TransformFunctionKeys.scale:
|
|
5021
|
-
return /* @__PURE__ */
|
|
4866
|
+
return /* @__PURE__ */ React86.createElement(Label2, { label: (0, import_i18n42.__)("Scale", "elementor"), value: transformScaleValue(value) });
|
|
5022
4867
|
case TransformFunctionKeys.rotate:
|
|
5023
|
-
return /* @__PURE__ */
|
|
4868
|
+
return /* @__PURE__ */ React86.createElement(Label2, { label: (0, import_i18n42.__)("Rotate", "elementor"), value: transformRotateValue(value) });
|
|
5024
4869
|
case TransformFunctionKeys.skew:
|
|
5025
|
-
return /* @__PURE__ */
|
|
4870
|
+
return /* @__PURE__ */ React86.createElement(Label2, { label: (0, import_i18n42.__)("Skew", "elementor"), value: transformSkewValue(value) });
|
|
5026
4871
|
default:
|
|
5027
4872
|
return "";
|
|
5028
4873
|
}
|
|
5029
4874
|
};
|
|
5030
4875
|
var Label2 = ({ label, value }) => {
|
|
5031
|
-
return /* @__PURE__ */
|
|
4876
|
+
return /* @__PURE__ */ React86.createElement(import_ui74.Box, { component: "span" }, label, ": ", value);
|
|
5032
4877
|
};
|
|
5033
4878
|
|
|
5034
4879
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
5035
|
-
var
|
|
4880
|
+
var SIZE8 = "tiny";
|
|
5036
4881
|
var TransformRepeaterControl = createControl(() => {
|
|
5037
|
-
const context = useBoundProp(
|
|
4882
|
+
const context = useBoundProp(import_editor_props44.transformPropTypeUtil);
|
|
5038
4883
|
const headerRef = (0, import_react43.useRef)(null);
|
|
5039
|
-
const popupState = (0,
|
|
4884
|
+
const popupState = (0, import_ui75.usePopupState)({ variant: "popover" });
|
|
5040
4885
|
const repeaterBindKey = "transform-functions";
|
|
5041
4886
|
injectIntoRepeaterHeaderActions({
|
|
5042
4887
|
id: "transform-base-control",
|
|
5043
|
-
component: () => /* @__PURE__ */
|
|
4888
|
+
component: () => /* @__PURE__ */ React87.createElement(TransformBasePopoverTrigger, { popupState, repeaterBindKey }),
|
|
5044
4889
|
options: { overwrite: true }
|
|
5045
4890
|
});
|
|
5046
|
-
return /* @__PURE__ */
|
|
4891
|
+
return /* @__PURE__ */ React87.createElement(PropProvider, { ...context }, /* @__PURE__ */ React87.createElement(TransformBaseControl, { popupState, anchorRef: headerRef }), /* @__PURE__ */ React87.createElement(PropKeyProvider, { bind: repeaterBindKey }, /* @__PURE__ */ React87.createElement(Repeater2, { headerRef })));
|
|
5047
4892
|
});
|
|
5048
|
-
var ToolTip = /* @__PURE__ */
|
|
5049
|
-
|
|
4893
|
+
var ToolTip = /* @__PURE__ */ React87.createElement(
|
|
4894
|
+
import_ui75.Box,
|
|
5050
4895
|
{
|
|
5051
4896
|
component: "span",
|
|
5052
4897
|
"aria-label": void 0,
|
|
5053
4898
|
sx: { display: "flex", gap: 0.5, p: 2, width: 320, borderRadius: 1 }
|
|
5054
4899
|
},
|
|
5055
|
-
/* @__PURE__ */
|
|
5056
|
-
/* @__PURE__ */
|
|
4900
|
+
/* @__PURE__ */ React87.createElement(import_icons29.InfoCircleFilledIcon, { sx: { color: "secondary.main" } }),
|
|
4901
|
+
/* @__PURE__ */ React87.createElement(import_ui75.Typography, { variant: "body2", color: "text.secondary", fontSize: "14px" }, (0, import_i18n43.__)("You can use each kind of transform only once per element.", "elementor"))
|
|
5057
4902
|
);
|
|
5058
4903
|
var Repeater2 = ({ headerRef }) => {
|
|
5059
|
-
const transformFunctionsContext = useBoundProp(
|
|
4904
|
+
const transformFunctionsContext = useBoundProp(import_editor_props44.transformFunctionsPropTypeUtil);
|
|
5060
4905
|
const availableValues = [initialTransformValue, initialScaleValue, initialRotateValue, initialSkewValue];
|
|
5061
4906
|
const { value: transformValues } = transformFunctionsContext;
|
|
5062
4907
|
const getInitialValue = () => {
|
|
5063
4908
|
return availableValues.find((value) => !transformValues?.some((item) => item.$$type === value.$$type));
|
|
5064
4909
|
};
|
|
5065
4910
|
const shouldDisableAddItem = !getInitialValue();
|
|
5066
|
-
return /* @__PURE__ */
|
|
4911
|
+
return /* @__PURE__ */ React87.createElement(PropProvider, { ...transformFunctionsContext }, /* @__PURE__ */ React87.createElement(
|
|
5067
4912
|
UnstableRepeater,
|
|
5068
4913
|
{
|
|
5069
4914
|
initial: getInitialValue() ?? initialTransformValue,
|
|
5070
|
-
propTypeUtil:
|
|
4915
|
+
propTypeUtil: import_editor_props44.transformFunctionsPropTypeUtil
|
|
5071
4916
|
},
|
|
5072
|
-
/* @__PURE__ */
|
|
4917
|
+
/* @__PURE__ */ React87.createElement(Header, { label: (0, import_i18n43.__)("Transform", "elementor"), ref: headerRef }, /* @__PURE__ */ React87.createElement(
|
|
5073
4918
|
TooltipAddItemAction,
|
|
5074
4919
|
{
|
|
5075
4920
|
disabled: shouldDisableAddItem,
|
|
@@ -5077,8 +4922,8 @@ var Repeater2 = ({ headerRef }) => {
|
|
|
5077
4922
|
enableTooltip: shouldDisableAddItem
|
|
5078
4923
|
}
|
|
5079
4924
|
)),
|
|
5080
|
-
/* @__PURE__ */
|
|
5081
|
-
/* @__PURE__ */
|
|
4925
|
+
/* @__PURE__ */ React87.createElement(ItemsContainer, { itemTemplate: /* @__PURE__ */ React87.createElement(Item, { Icon: TransformIcon, Label: TransformLabel }) }, /* @__PURE__ */ React87.createElement(DisableItemAction, null), /* @__PURE__ */ React87.createElement(RemoveItemAction, null)),
|
|
4926
|
+
/* @__PURE__ */ React87.createElement(EditItemPopover, null, /* @__PURE__ */ React87.createElement(TransformContent, null))
|
|
5082
4927
|
));
|
|
5083
4928
|
};
|
|
5084
4929
|
var TransformBasePopoverTrigger = ({
|
|
@@ -5086,25 +4931,25 @@ var TransformBasePopoverTrigger = ({
|
|
|
5086
4931
|
repeaterBindKey
|
|
5087
4932
|
}) => {
|
|
5088
4933
|
const { bind } = useBoundProp();
|
|
5089
|
-
return bind !== repeaterBindKey ? null : /* @__PURE__ */
|
|
4934
|
+
return bind !== repeaterBindKey ? null : /* @__PURE__ */ React87.createElement(import_ui75.IconButton, { size: SIZE8, "aria-label": (0, import_i18n43.__)("Base Transform", "elementor"), ...(0, import_ui75.bindTrigger)(popupState) }, /* @__PURE__ */ React87.createElement(import_icons29.AdjustmentsIcon, { fontSize: SIZE8 }));
|
|
5090
4935
|
};
|
|
5091
4936
|
|
|
5092
4937
|
// src/controls/transition-control/transition-repeater-control.tsx
|
|
5093
|
-
var
|
|
4938
|
+
var React90 = __toESM(require("react"));
|
|
5094
4939
|
var import_react46 = require("react");
|
|
5095
|
-
var
|
|
5096
|
-
var
|
|
5097
|
-
var
|
|
5098
|
-
var
|
|
4940
|
+
var import_editor_props47 = require("@elementor/editor-props");
|
|
4941
|
+
var import_icons31 = require("@elementor/icons");
|
|
4942
|
+
var import_ui78 = require("@elementor/ui");
|
|
4943
|
+
var import_i18n46 = require("@wordpress/i18n");
|
|
5099
4944
|
|
|
5100
4945
|
// src/controls/selection-size-control.tsx
|
|
5101
|
-
var
|
|
4946
|
+
var React88 = __toESM(require("react"));
|
|
5102
4947
|
var import_react44 = require("react");
|
|
5103
|
-
var
|
|
5104
|
-
var
|
|
4948
|
+
var import_editor_props45 = require("@elementor/editor-props");
|
|
4949
|
+
var import_ui76 = require("@elementor/ui");
|
|
5105
4950
|
var SelectionSizeControl = createControl(
|
|
5106
4951
|
({ selectionLabel, sizeLabel, selectionConfig, sizeConfigMap }) => {
|
|
5107
|
-
const { value, setValue, propType } = useBoundProp(
|
|
4952
|
+
const { value, setValue, propType } = useBoundProp(import_editor_props45.selectionSizePropTypeUtil);
|
|
5108
4953
|
const rowRef = (0, import_react44.useRef)(null);
|
|
5109
4954
|
const currentSizeConfig = (0, import_react44.useMemo)(() => {
|
|
5110
4955
|
switch (value.selection.$$type) {
|
|
@@ -5117,7 +4962,7 @@ var SelectionSizeControl = createControl(
|
|
|
5117
4962
|
}
|
|
5118
4963
|
}, [value, sizeConfigMap]);
|
|
5119
4964
|
const SelectionComponent = selectionConfig.component;
|
|
5120
|
-
return /* @__PURE__ */
|
|
4965
|
+
return /* @__PURE__ */ React88.createElement(PropProvider, { value, setValue, propType }, /* @__PURE__ */ React88.createElement(import_ui76.Grid, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React88.createElement(import_ui76.Grid, { item: true, xs: 6, sx: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React88.createElement(ControlFormLabel, null, selectionLabel)), /* @__PURE__ */ React88.createElement(import_ui76.Grid, { 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(import_ui76.Grid, { item: true, xs: 6, sx: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React88.createElement(ControlFormLabel, null, sizeLabel)), /* @__PURE__ */ React88.createElement(import_ui76.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React88.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React88.createElement(
|
|
5121
4966
|
SizeControl,
|
|
5122
4967
|
{
|
|
5123
4968
|
anchorRef: rowRef,
|
|
@@ -5130,12 +4975,12 @@ var SelectionSizeControl = createControl(
|
|
|
5130
4975
|
);
|
|
5131
4976
|
|
|
5132
4977
|
// src/controls/transition-control/data.ts
|
|
5133
|
-
var
|
|
4978
|
+
var import_i18n44 = require("@wordpress/i18n");
|
|
5134
4979
|
var initialTransitionValue = {
|
|
5135
4980
|
selection: {
|
|
5136
4981
|
$$type: "key-value",
|
|
5137
4982
|
value: {
|
|
5138
|
-
key: { value: (0,
|
|
4983
|
+
key: { value: (0, import_i18n44.__)("All properties", "elementor"), $$type: "string" },
|
|
5139
4984
|
value: { value: "all", $$type: "string" }
|
|
5140
4985
|
}
|
|
5141
4986
|
},
|
|
@@ -5143,9 +4988,9 @@ var initialTransitionValue = {
|
|
|
5143
4988
|
};
|
|
5144
4989
|
var transitionProperties = [
|
|
5145
4990
|
{
|
|
5146
|
-
label: (0,
|
|
4991
|
+
label: (0, import_i18n44.__)("Default", "elementor"),
|
|
5147
4992
|
type: "category",
|
|
5148
|
-
properties: [{ label: (0,
|
|
4993
|
+
properties: [{ label: (0, import_i18n44.__)("All properties", "elementor"), value: "all" }]
|
|
5149
4994
|
}
|
|
5150
4995
|
];
|
|
5151
4996
|
var transitionsItemsList = transitionProperties.map((category) => ({
|
|
@@ -5154,12 +4999,12 @@ var transitionsItemsList = transitionProperties.map((category) => ({
|
|
|
5154
4999
|
}));
|
|
5155
5000
|
|
|
5156
5001
|
// src/controls/transition-control/transition-selector.tsx
|
|
5157
|
-
var
|
|
5002
|
+
var React89 = __toESM(require("react"));
|
|
5158
5003
|
var import_react45 = require("react");
|
|
5159
|
-
var
|
|
5160
|
-
var
|
|
5161
|
-
var
|
|
5162
|
-
var
|
|
5004
|
+
var import_editor_props46 = require("@elementor/editor-props");
|
|
5005
|
+
var import_icons30 = require("@elementor/icons");
|
|
5006
|
+
var import_ui77 = require("@elementor/ui");
|
|
5007
|
+
var import_i18n45 = require("@wordpress/i18n");
|
|
5163
5008
|
var toTransitionSelectorValue = (label) => {
|
|
5164
5009
|
for (const category of transitionProperties) {
|
|
5165
5010
|
const property = category.properties.find((prop) => prop.label === label);
|
|
@@ -5181,12 +5026,12 @@ var findByValue = (value) => {
|
|
|
5181
5026
|
}
|
|
5182
5027
|
};
|
|
5183
5028
|
var TransitionSelector = ({ recentlyUsedList = [] }) => {
|
|
5184
|
-
const { value, setValue } = useBoundProp(
|
|
5029
|
+
const { value, setValue } = useBoundProp(import_editor_props46.keyValuePropTypeUtil);
|
|
5185
5030
|
const {
|
|
5186
5031
|
key: { value: transitionLabel }
|
|
5187
5032
|
} = value;
|
|
5188
5033
|
const defaultRef = (0, import_react45.useRef)(null);
|
|
5189
|
-
const popoverState = (0,
|
|
5034
|
+
const popoverState = (0, import_ui77.usePopupState)({ variant: "popover" });
|
|
5190
5035
|
const getItemList = () => {
|
|
5191
5036
|
const recentItems = recentlyUsedList.map((item) => findByValue(item)).filter((item) => !!item);
|
|
5192
5037
|
const filteredItems = transitionsItemsList.map((category) => {
|
|
@@ -5202,7 +5047,7 @@ var TransitionSelector = ({ recentlyUsedList = [] }) => {
|
|
|
5202
5047
|
return [
|
|
5203
5048
|
first,
|
|
5204
5049
|
{
|
|
5205
|
-
label: (0,
|
|
5050
|
+
label: (0, import_i18n45.__)("Recently Used", "elementor"),
|
|
5206
5051
|
items: recentItems
|
|
5207
5052
|
},
|
|
5208
5053
|
...rest
|
|
@@ -5226,27 +5071,27 @@ var TransitionSelector = ({ recentlyUsedList = [] }) => {
|
|
|
5226
5071
|
left: rect.right + 36
|
|
5227
5072
|
};
|
|
5228
5073
|
};
|
|
5229
|
-
return /* @__PURE__ */
|
|
5230
|
-
|
|
5074
|
+
return /* @__PURE__ */ React89.createElement(import_ui77.Box, { ref: defaultRef }, /* @__PURE__ */ React89.createElement(
|
|
5075
|
+
import_ui77.UnstableTag,
|
|
5231
5076
|
{
|
|
5232
5077
|
variant: "outlined",
|
|
5233
5078
|
label: transitionLabel,
|
|
5234
|
-
endIcon: /* @__PURE__ */
|
|
5235
|
-
...(0,
|
|
5079
|
+
endIcon: /* @__PURE__ */ React89.createElement(import_icons30.ChevronDownIcon, { fontSize: "tiny" }),
|
|
5080
|
+
...(0, import_ui77.bindTrigger)(popoverState),
|
|
5236
5081
|
fullWidth: true
|
|
5237
5082
|
}
|
|
5238
|
-
), /* @__PURE__ */
|
|
5239
|
-
|
|
5083
|
+
), /* @__PURE__ */ React89.createElement(
|
|
5084
|
+
import_ui77.Popover,
|
|
5240
5085
|
{
|
|
5241
5086
|
disablePortal: true,
|
|
5242
5087
|
disableScrollLock: true,
|
|
5243
|
-
...(0,
|
|
5088
|
+
...(0, import_ui77.bindPopover)(popoverState),
|
|
5244
5089
|
anchorReference: "anchorPosition",
|
|
5245
5090
|
anchorPosition: getAnchorPosition(),
|
|
5246
5091
|
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
5247
5092
|
transformOrigin: { vertical: "top", horizontal: "left" }
|
|
5248
5093
|
},
|
|
5249
|
-
/* @__PURE__ */
|
|
5094
|
+
/* @__PURE__ */ React89.createElement(
|
|
5250
5095
|
ItemSelector,
|
|
5251
5096
|
{
|
|
5252
5097
|
itemsList: getItemList(),
|
|
@@ -5254,8 +5099,8 @@ var TransitionSelector = ({ recentlyUsedList = [] }) => {
|
|
|
5254
5099
|
onItemChange: handleTransitionPropertyChange,
|
|
5255
5100
|
onClose: popoverState.close,
|
|
5256
5101
|
sectionWidth: 268,
|
|
5257
|
-
title: (0,
|
|
5258
|
-
icon:
|
|
5102
|
+
title: (0, import_i18n45.__)("Transition Property", "elementor"),
|
|
5103
|
+
icon: import_icons30.VariationsIcon
|
|
5259
5104
|
}
|
|
5260
5105
|
)
|
|
5261
5106
|
));
|
|
@@ -5269,8 +5114,8 @@ var DURATION_CONFIG = {
|
|
|
5269
5114
|
};
|
|
5270
5115
|
var getSelectionSizeProps = (recentlyUsedList) => {
|
|
5271
5116
|
return {
|
|
5272
|
-
selectionLabel: (0,
|
|
5273
|
-
sizeLabel: (0,
|
|
5117
|
+
selectionLabel: (0, import_i18n46.__)("Type", "elementor"),
|
|
5118
|
+
sizeLabel: (0, import_i18n46.__)("Duration", "elementor"),
|
|
5274
5119
|
selectionConfig: {
|
|
5275
5120
|
component: TransitionSelector,
|
|
5276
5121
|
props: {
|
|
@@ -5292,23 +5137,23 @@ var getSelectionSizeProps = (recentlyUsedList) => {
|
|
|
5292
5137
|
};
|
|
5293
5138
|
function getChildControlConfig(recentlyUsedList) {
|
|
5294
5139
|
return {
|
|
5295
|
-
propTypeUtil:
|
|
5140
|
+
propTypeUtil: import_editor_props47.selectionSizePropTypeUtil,
|
|
5296
5141
|
component: SelectionSizeControl,
|
|
5297
5142
|
props: getSelectionSizeProps(recentlyUsedList)
|
|
5298
5143
|
};
|
|
5299
5144
|
}
|
|
5300
|
-
var disableAddItemTooltipContent = /* @__PURE__ */
|
|
5301
|
-
|
|
5145
|
+
var disableAddItemTooltipContent = /* @__PURE__ */ React90.createElement(
|
|
5146
|
+
import_ui78.Alert,
|
|
5302
5147
|
{
|
|
5303
5148
|
sx: {
|
|
5304
5149
|
width: 280,
|
|
5305
5150
|
gap: 0.5
|
|
5306
5151
|
},
|
|
5307
5152
|
color: "secondary",
|
|
5308
|
-
icon: /* @__PURE__ */
|
|
5153
|
+
icon: /* @__PURE__ */ React90.createElement(import_icons31.InfoCircleFilledIcon, null)
|
|
5309
5154
|
},
|
|
5310
|
-
/* @__PURE__ */
|
|
5311
|
-
/* @__PURE__ */
|
|
5155
|
+
/* @__PURE__ */ React90.createElement(import_ui78.AlertTitle, null, (0, import_i18n46.__)("Transitions", "elementor")),
|
|
5156
|
+
/* @__PURE__ */ React90.createElement(import_ui78.Box, { component: "span" }, /* @__PURE__ */ React90.createElement(import_ui78.Typography, { variant: "body2" }, (0, import_i18n46.__)("Switch to 'Normal' state to add a transition.", "elementor")))
|
|
5312
5157
|
);
|
|
5313
5158
|
var TransitionRepeaterControl = createControl(
|
|
5314
5159
|
({
|
|
@@ -5320,13 +5165,13 @@ var TransitionRepeaterControl = createControl(
|
|
|
5320
5165
|
(0, import_react46.useEffect)(() => {
|
|
5321
5166
|
recentlyUsedListGetter().then(setRecentlyUsedList);
|
|
5322
5167
|
}, [recentlyUsedListGetter]);
|
|
5323
|
-
return /* @__PURE__ */
|
|
5168
|
+
return /* @__PURE__ */ React90.createElement(
|
|
5324
5169
|
RepeatableControl,
|
|
5325
5170
|
{
|
|
5326
|
-
label: (0,
|
|
5327
|
-
repeaterLabel: (0,
|
|
5171
|
+
label: (0, import_i18n46.__)("Transitions", "elementor"),
|
|
5172
|
+
repeaterLabel: (0, import_i18n46.__)("Transitions", "elementor"),
|
|
5328
5173
|
patternLabel: "${value.selection.value.key.value}: ${value.size.value.size}${value.size.value.unit}",
|
|
5329
|
-
placeholder: (0,
|
|
5174
|
+
placeholder: (0, import_i18n46.__)("Empty Transition", "elementor"),
|
|
5330
5175
|
showDuplicate: false,
|
|
5331
5176
|
showToggle: true,
|
|
5332
5177
|
initialValues: initialTransitionValue,
|
|
@@ -5343,14 +5188,14 @@ var TransitionRepeaterControl = createControl(
|
|
|
5343
5188
|
);
|
|
5344
5189
|
|
|
5345
5190
|
// src/components/css-code-editor/css-editor.tsx
|
|
5346
|
-
var
|
|
5191
|
+
var React92 = __toESM(require("react"));
|
|
5347
5192
|
var import_editor_responsive2 = require("@elementor/editor-responsive");
|
|
5348
|
-
var
|
|
5193
|
+
var import_ui80 = require("@elementor/ui");
|
|
5349
5194
|
var import_react47 = require("@monaco-editor/react");
|
|
5350
5195
|
|
|
5351
5196
|
// src/components/css-code-editor/css-editor.styles.ts
|
|
5352
|
-
var
|
|
5353
|
-
var EditorWrapper = (0,
|
|
5197
|
+
var import_ui79 = require("@elementor/ui");
|
|
5198
|
+
var EditorWrapper = (0, import_ui79.styled)(import_ui79.Box)`
|
|
5354
5199
|
border: 1px solid var( --e-a-border-color );
|
|
5355
5200
|
border-radius: 8px;
|
|
5356
5201
|
padding: 10px 12px;
|
|
@@ -5361,7 +5206,7 @@ var EditorWrapper = (0, import_ui77.styled)(import_ui77.Box)`
|
|
|
5361
5206
|
z-index: 99999999 !important;
|
|
5362
5207
|
}
|
|
5363
5208
|
`;
|
|
5364
|
-
var ResizeHandle = (0,
|
|
5209
|
+
var ResizeHandle = (0, import_ui79.styled)(import_ui79.Button)`
|
|
5365
5210
|
position: absolute;
|
|
5366
5211
|
bottom: 0;
|
|
5367
5212
|
left: 0;
|
|
@@ -5394,25 +5239,25 @@ var ResizeHandle = (0, import_ui77.styled)(import_ui77.Button)`
|
|
|
5394
5239
|
`;
|
|
5395
5240
|
|
|
5396
5241
|
// src/components/css-code-editor/css-validation.ts
|
|
5397
|
-
var
|
|
5242
|
+
var import_i18n47 = require("@wordpress/i18n");
|
|
5398
5243
|
var forbiddenPatterns = [
|
|
5399
5244
|
{
|
|
5400
5245
|
pattern: ":hover",
|
|
5401
|
-
message: (0,
|
|
5246
|
+
message: (0, import_i18n47.__)(
|
|
5402
5247
|
"The use of pseudo-states is not permitted. Instead, switch to the desired pseudo state and add your custom code there.",
|
|
5403
5248
|
"elementor"
|
|
5404
5249
|
)
|
|
5405
5250
|
},
|
|
5406
5251
|
{
|
|
5407
5252
|
pattern: ":active",
|
|
5408
|
-
message: (0,
|
|
5253
|
+
message: (0, import_i18n47.__)(
|
|
5409
5254
|
"The use of pseudo-states is not permitted. Instead, switch to the desired pseudo state and add your custom code there.",
|
|
5410
5255
|
"elementor"
|
|
5411
5256
|
)
|
|
5412
5257
|
},
|
|
5413
5258
|
{
|
|
5414
5259
|
pattern: "@media",
|
|
5415
|
-
message: (0,
|
|
5260
|
+
message: (0, import_i18n47.__)(
|
|
5416
5261
|
"The use of @media is not permitted. Instead, switch to the desired breakpoint and add your custom code there.",
|
|
5417
5262
|
"elementor"
|
|
5418
5263
|
)
|
|
@@ -5451,9 +5296,9 @@ function validate(editor, monaco) {
|
|
|
5451
5296
|
}
|
|
5452
5297
|
|
|
5453
5298
|
// src/components/css-code-editor/resize-handle.tsx
|
|
5454
|
-
var
|
|
5299
|
+
var React91 = __toESM(require("react"));
|
|
5455
5300
|
var ResizeHandleComponent = ({ onResize, containerRef, onHeightChange }) => {
|
|
5456
|
-
const handleResizeMove =
|
|
5301
|
+
const handleResizeMove = React91.useCallback(
|
|
5457
5302
|
(e) => {
|
|
5458
5303
|
const container = containerRef.current;
|
|
5459
5304
|
if (!container) {
|
|
@@ -5466,11 +5311,11 @@ var ResizeHandleComponent = ({ onResize, containerRef, onHeightChange }) => {
|
|
|
5466
5311
|
},
|
|
5467
5312
|
[containerRef, onResize, onHeightChange]
|
|
5468
5313
|
);
|
|
5469
|
-
const handleResizeEnd =
|
|
5314
|
+
const handleResizeEnd = React91.useCallback(() => {
|
|
5470
5315
|
document.removeEventListener("mousemove", handleResizeMove);
|
|
5471
5316
|
document.removeEventListener("mouseup", handleResizeEnd);
|
|
5472
5317
|
}, [handleResizeMove]);
|
|
5473
|
-
const handleResizeStart =
|
|
5318
|
+
const handleResizeStart = React91.useCallback(
|
|
5474
5319
|
(e) => {
|
|
5475
5320
|
e.preventDefault();
|
|
5476
5321
|
e.stopPropagation();
|
|
@@ -5479,13 +5324,13 @@ var ResizeHandleComponent = ({ onResize, containerRef, onHeightChange }) => {
|
|
|
5479
5324
|
},
|
|
5480
5325
|
[handleResizeMove, handleResizeEnd]
|
|
5481
5326
|
);
|
|
5482
|
-
|
|
5327
|
+
React91.useEffect(() => {
|
|
5483
5328
|
return () => {
|
|
5484
5329
|
document.removeEventListener("mousemove", handleResizeMove);
|
|
5485
5330
|
document.removeEventListener("mouseup", handleResizeEnd);
|
|
5486
5331
|
};
|
|
5487
5332
|
}, [handleResizeMove, handleResizeEnd]);
|
|
5488
|
-
return /* @__PURE__ */
|
|
5333
|
+
return /* @__PURE__ */ React91.createElement(
|
|
5489
5334
|
ResizeHandle,
|
|
5490
5335
|
{
|
|
5491
5336
|
onMouseDown: handleResizeStart,
|
|
@@ -5568,22 +5413,22 @@ var createEditorDidMountHandler = (editorRef, monacoRef, debounceTimer, onChange
|
|
|
5568
5413
|
};
|
|
5569
5414
|
};
|
|
5570
5415
|
var CssEditor = ({ value, onChange }) => {
|
|
5571
|
-
const theme = (0,
|
|
5572
|
-
const containerRef =
|
|
5573
|
-
const editorRef =
|
|
5574
|
-
const monacoRef =
|
|
5575
|
-
const debounceTimer =
|
|
5416
|
+
const theme = (0, import_ui80.useTheme)();
|
|
5417
|
+
const containerRef = React92.useRef(null);
|
|
5418
|
+
const editorRef = React92.useRef(null);
|
|
5419
|
+
const monacoRef = React92.useRef(null);
|
|
5420
|
+
const debounceTimer = React92.useRef(null);
|
|
5576
5421
|
const activeBreakpoint = (0, import_editor_responsive2.useActiveBreakpoint)();
|
|
5577
|
-
const handleResize =
|
|
5422
|
+
const handleResize = React92.useCallback(() => {
|
|
5578
5423
|
editorRef.current?.layout();
|
|
5579
5424
|
}, []);
|
|
5580
|
-
const handleHeightChange =
|
|
5425
|
+
const handleHeightChange = React92.useCallback((height) => {
|
|
5581
5426
|
if (containerRef.current) {
|
|
5582
5427
|
containerRef.current.style.height = `${height}px`;
|
|
5583
5428
|
}
|
|
5584
5429
|
}, []);
|
|
5585
5430
|
const handleEditorDidMount = createEditorDidMountHandler(editorRef, monacoRef, debounceTimer, onChange);
|
|
5586
|
-
|
|
5431
|
+
React92.useEffect(() => {
|
|
5587
5432
|
const timerRef = debounceTimer;
|
|
5588
5433
|
return () => {
|
|
5589
5434
|
const timer = timerRef.current;
|
|
@@ -5592,7 +5437,7 @@ var CssEditor = ({ value, onChange }) => {
|
|
|
5592
5437
|
}
|
|
5593
5438
|
};
|
|
5594
5439
|
}, []);
|
|
5595
|
-
return /* @__PURE__ */
|
|
5440
|
+
return /* @__PURE__ */ React92.createElement(EditorWrapper, { ref: containerRef }, /* @__PURE__ */ React92.createElement(
|
|
5596
5441
|
import_react47.Editor,
|
|
5597
5442
|
{
|
|
5598
5443
|
key: activeBreakpoint,
|
|
@@ -5613,7 +5458,7 @@ var CssEditor = ({ value, onChange }) => {
|
|
|
5613
5458
|
fixedOverflowWidgets: true
|
|
5614
5459
|
}
|
|
5615
5460
|
}
|
|
5616
|
-
), /* @__PURE__ */
|
|
5461
|
+
), /* @__PURE__ */ React92.createElement(
|
|
5617
5462
|
ResizeHandleComponent,
|
|
5618
5463
|
{
|
|
5619
5464
|
onResize: handleResize,
|