@elementor/editor-controls 3.33.0-147 → 3.33.0-149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +106 -106
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +79 -79
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/{unstable-repeater/unstable-repeater.tsx → control-repeater/control-repeater.tsx} +1 -1
- package/src/components/{unstable-repeater → control-repeater}/index.ts +1 -1
- package/src/components/repeater.tsx +1 -1
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +10 -10
- package/src/controls/box-shadow-repeater-control.tsx +8 -8
- package/src/controls/filter-control/filter-content.tsx +1 -1
- package/src/controls/filter-control/filter-repeater-control.tsx +8 -14
- package/src/controls/repeatable-control.tsx +10 -10
- package/src/controls/transform-control/transform-repeater-control.tsx +6 -12
- package/src/controls/transform-control/use-transform-tabs-history.tsx +1 -1
- package/src/index.ts +1 -1
- /package/src/components/{unstable-repeater → control-repeater}/actions/disable-item-action.tsx +0 -0
- /package/src/components/{unstable-repeater → control-repeater}/actions/duplicate-item-action.tsx +0 -0
- /package/src/components/{unstable-repeater → control-repeater}/actions/remove-item-action.tsx +0 -0
- /package/src/components/{unstable-repeater → control-repeater}/actions/tooltip-add-item-action.tsx +0 -0
- /package/src/components/{unstable-repeater → control-repeater}/context/item-context.tsx +0 -0
- /package/src/components/{unstable-repeater → control-repeater}/context/repeater-context.tsx +0 -0
- /package/src/components/{unstable-repeater → control-repeater}/header/header.tsx +0 -0
- /package/src/components/{unstable-repeater → control-repeater}/items/edit-item-popover.tsx +0 -0
- /package/src/components/{unstable-repeater → control-repeater}/items/item.tsx +0 -0
- /package/src/components/{unstable-repeater → control-repeater}/items/items-container.tsx +0 -0
- /package/src/components/{unstable-repeater → control-repeater}/locations.ts +0 -0
- /package/src/components/{unstable-repeater → control-repeater}/types.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1223,29 +1223,16 @@ var import_editor_props10 = require("@elementor/editor-props");
|
|
|
1223
1223
|
var import_ui28 = require("@elementor/ui");
|
|
1224
1224
|
var import_i18n11 = require("@wordpress/i18n");
|
|
1225
1225
|
|
|
1226
|
-
// src/components/
|
|
1227
|
-
var React22 = __toESM(require("react"));
|
|
1228
|
-
var import_ui17 = require("@elementor/ui");
|
|
1229
|
-
var PopoverContent = ({ gap = 1.5, children, ...props }) => /* @__PURE__ */ React22.createElement(import_ui17.Stack, { ...props, gap }, children);
|
|
1230
|
-
|
|
1231
|
-
// src/components/popover-grid-container.tsx
|
|
1232
|
-
var import_react15 = require("react");
|
|
1226
|
+
// src/components/control-repeater/actions/tooltip-add-item-action.tsx
|
|
1233
1227
|
var React23 = __toESM(require("react"));
|
|
1234
|
-
var import_ui18 = require("@elementor/ui");
|
|
1235
|
-
var PopoverGridContainer = (0, import_react15.forwardRef)(
|
|
1236
|
-
({ gap = 1.5, alignItems = "center", flexWrap = "nowrap", children }, ref) => /* @__PURE__ */ React23.createElement(import_ui18.Grid, { container: true, gap, alignItems, flexWrap, ref }, children)
|
|
1237
|
-
);
|
|
1238
|
-
|
|
1239
|
-
// src/components/unstable-repeater/actions/tooltip-add-item-action.tsx
|
|
1240
|
-
var React25 = __toESM(require("react"));
|
|
1241
1228
|
var import_icons4 = require("@elementor/icons");
|
|
1242
|
-
var
|
|
1229
|
+
var import_ui18 = require("@elementor/ui");
|
|
1243
1230
|
var import_i18n5 = require("@wordpress/i18n");
|
|
1244
1231
|
|
|
1245
|
-
// src/components/
|
|
1246
|
-
var
|
|
1247
|
-
var
|
|
1248
|
-
var
|
|
1232
|
+
// src/components/control-repeater/context/repeater-context.tsx
|
|
1233
|
+
var React22 = __toESM(require("react"));
|
|
1234
|
+
var import_react16 = require("react");
|
|
1235
|
+
var import_ui17 = require("@elementor/ui");
|
|
1249
1236
|
|
|
1250
1237
|
// src/services/event-bus.ts
|
|
1251
1238
|
var EventBus = class {
|
|
@@ -1281,19 +1268,19 @@ var EventBus = class {
|
|
|
1281
1268
|
};
|
|
1282
1269
|
var eventBus = new EventBus();
|
|
1283
1270
|
|
|
1284
|
-
// src/components/
|
|
1285
|
-
var
|
|
1286
|
-
var ItemContext = (0,
|
|
1271
|
+
// src/components/control-repeater/context/item-context.tsx
|
|
1272
|
+
var import_react15 = require("react");
|
|
1273
|
+
var ItemContext = (0, import_react15.createContext)({
|
|
1287
1274
|
index: -1,
|
|
1288
1275
|
value: {}
|
|
1289
1276
|
});
|
|
1290
1277
|
|
|
1291
|
-
// src/components/
|
|
1292
|
-
var RepeaterContext = (0,
|
|
1278
|
+
// src/components/control-repeater/context/repeater-context.tsx
|
|
1279
|
+
var RepeaterContext = (0, import_react16.createContext)(null);
|
|
1293
1280
|
var EMPTY_OPEN_ITEM = -1;
|
|
1294
1281
|
var useRepeaterContext = () => {
|
|
1295
|
-
const context =
|
|
1296
|
-
const itemContext =
|
|
1282
|
+
const context = React22.useContext(RepeaterContext);
|
|
1283
|
+
const itemContext = React22.useContext(ItemContext);
|
|
1297
1284
|
if (!context) {
|
|
1298
1285
|
throw new Error("useRepeaterContext must be used within a RepeaterContextProvider");
|
|
1299
1286
|
}
|
|
@@ -1311,10 +1298,10 @@ var RepeaterContextProvider = ({
|
|
|
1311
1298
|
setExternal: setRepeaterValues,
|
|
1312
1299
|
persistWhen: () => true
|
|
1313
1300
|
});
|
|
1314
|
-
const [itemsWithKeys, setItemsWithKeys] = (0,
|
|
1301
|
+
const [itemsWithKeys, setItemsWithKeys] = (0, import_react16.useState)(() => {
|
|
1315
1302
|
return items2?.map((item) => ({ key: generateUniqueKey(), item })) ?? [];
|
|
1316
1303
|
});
|
|
1317
|
-
|
|
1304
|
+
React22.useEffect(() => {
|
|
1318
1305
|
setItemsWithKeys((prevItemsWithKeys) => {
|
|
1319
1306
|
const newItemsWithKeys = items2?.map((item) => {
|
|
1320
1307
|
const existingItem = prevItemsWithKeys.find((i) => i.item === item);
|
|
@@ -1326,10 +1313,10 @@ var RepeaterContextProvider = ({
|
|
|
1326
1313
|
const handleSetItems = (newItemsWithKeys) => {
|
|
1327
1314
|
setItems(newItemsWithKeys.map(({ item }) => item));
|
|
1328
1315
|
};
|
|
1329
|
-
const [openItemIndex, setOpenItemIndex] = (0,
|
|
1330
|
-
const [rowRef, setRowRef] = (0,
|
|
1316
|
+
const [openItemIndex, setOpenItemIndex] = (0, import_react16.useState)(EMPTY_OPEN_ITEM);
|
|
1317
|
+
const [rowRef, setRowRef] = (0, import_react16.useState)(null);
|
|
1331
1318
|
const isOpen = openItemIndex !== EMPTY_OPEN_ITEM;
|
|
1332
|
-
const popoverState = (0,
|
|
1319
|
+
const popoverState = (0, import_ui17.usePopupState)({ variant: "popover" });
|
|
1333
1320
|
const addItem = (ev, config) => {
|
|
1334
1321
|
const item = config?.item ?? { ...initial };
|
|
1335
1322
|
const newIndex = config?.index ?? items2.length;
|
|
@@ -1353,7 +1340,7 @@ var RepeaterContextProvider = ({
|
|
|
1353
1340
|
const newItems = [...items2.slice(0, index), updatedItem, ...items2.slice(index + 1)];
|
|
1354
1341
|
setItems(newItems);
|
|
1355
1342
|
};
|
|
1356
|
-
return /* @__PURE__ */
|
|
1343
|
+
return /* @__PURE__ */ React22.createElement(
|
|
1357
1344
|
RepeaterContext.Provider,
|
|
1358
1345
|
{
|
|
1359
1346
|
value: {
|
|
@@ -1378,7 +1365,7 @@ var generateUniqueKey = () => {
|
|
|
1378
1365
|
return Date.now() + Math.floor(Math.random() * 1e6);
|
|
1379
1366
|
};
|
|
1380
1367
|
|
|
1381
|
-
// src/components/
|
|
1368
|
+
// src/components/control-repeater/actions/tooltip-add-item-action.tsx
|
|
1382
1369
|
var SIZE2 = "tiny";
|
|
1383
1370
|
var TooltipAddItemAction = ({
|
|
1384
1371
|
disabled = false,
|
|
@@ -1389,37 +1376,37 @@ var TooltipAddItemAction = ({
|
|
|
1389
1376
|
}) => {
|
|
1390
1377
|
const { addItem } = useRepeaterContext();
|
|
1391
1378
|
const onClick = (ev) => addItem(ev, { index: newItemIndex });
|
|
1392
|
-
return /* @__PURE__ */
|
|
1393
|
-
|
|
1379
|
+
return /* @__PURE__ */ React23.createElement(ConditionalToolTip, { content: tooltipContent, enable: enableTooltip }, /* @__PURE__ */ React23.createElement(import_ui18.Box, { component: "span", sx: { cursor: disabled ? "not-allowed" : "pointer" } }, /* @__PURE__ */ React23.createElement(
|
|
1380
|
+
import_ui18.IconButton,
|
|
1394
1381
|
{
|
|
1395
1382
|
size: SIZE2,
|
|
1396
1383
|
disabled,
|
|
1397
1384
|
onClick,
|
|
1398
1385
|
"aria-label": (0, import_i18n5.sprintf)((0, import_i18n5.__)("Add %s item", "elementor"), ariaLabel?.toLowerCase())
|
|
1399
1386
|
},
|
|
1400
|
-
/* @__PURE__ */
|
|
1387
|
+
/* @__PURE__ */ React23.createElement(import_icons4.PlusIcon, { fontSize: SIZE2 })
|
|
1401
1388
|
)));
|
|
1402
1389
|
};
|
|
1403
1390
|
var ConditionalToolTip = ({
|
|
1404
1391
|
children,
|
|
1405
1392
|
enable,
|
|
1406
1393
|
content
|
|
1407
|
-
}) => enable && content ? /* @__PURE__ */
|
|
1394
|
+
}) => enable && content ? /* @__PURE__ */ React23.createElement(import_ui18.Infotip, { placement: "right", color: "secondary", content }, children) : children;
|
|
1408
1395
|
|
|
1409
|
-
// src/components/
|
|
1410
|
-
var
|
|
1411
|
-
var
|
|
1396
|
+
// src/components/control-repeater/header/header.tsx
|
|
1397
|
+
var React26 = __toESM(require("react"));
|
|
1398
|
+
var import_ui19 = require("@elementor/ui");
|
|
1412
1399
|
|
|
1413
1400
|
// src/control-adornments/control-adornments.tsx
|
|
1414
|
-
var
|
|
1401
|
+
var React25 = __toESM(require("react"));
|
|
1415
1402
|
|
|
1416
1403
|
// src/control-adornments/control-adornments-context.tsx
|
|
1417
|
-
var
|
|
1418
|
-
var
|
|
1419
|
-
var Context2 = (0,
|
|
1420
|
-
var ControlAdornmentsProvider = ({ children, items: items2 }) => /* @__PURE__ */
|
|
1404
|
+
var React24 = __toESM(require("react"));
|
|
1405
|
+
var import_react17 = require("react");
|
|
1406
|
+
var Context2 = (0, import_react17.createContext)(null);
|
|
1407
|
+
var ControlAdornmentsProvider = ({ children, items: items2 }) => /* @__PURE__ */ React24.createElement(Context2.Provider, { value: { items: items2 } }, children);
|
|
1421
1408
|
var useControlAdornments = () => {
|
|
1422
|
-
const context = (0,
|
|
1409
|
+
const context = (0, import_react17.useContext)(Context2);
|
|
1423
1410
|
return context?.items ?? [];
|
|
1424
1411
|
};
|
|
1425
1412
|
|
|
@@ -1431,18 +1418,18 @@ function ControlAdornments({
|
|
|
1431
1418
|
if (items2?.length === 0) {
|
|
1432
1419
|
return null;
|
|
1433
1420
|
}
|
|
1434
|
-
return /* @__PURE__ */
|
|
1421
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, items2.map(({ Adornment, id }) => /* @__PURE__ */ React25.createElement(Adornment, { key: id, customContext })));
|
|
1435
1422
|
}
|
|
1436
1423
|
|
|
1437
|
-
// src/components/
|
|
1438
|
-
var Header =
|
|
1424
|
+
// src/components/control-repeater/header/header.tsx
|
|
1425
|
+
var Header = React26.forwardRef(
|
|
1439
1426
|
({
|
|
1440
1427
|
label,
|
|
1441
1428
|
children,
|
|
1442
1429
|
adornment: Adornment = ControlAdornments
|
|
1443
1430
|
}, ref) => {
|
|
1444
|
-
return /* @__PURE__ */
|
|
1445
|
-
|
|
1431
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1432
|
+
import_ui19.Stack,
|
|
1446
1433
|
{
|
|
1447
1434
|
direction: "row",
|
|
1448
1435
|
alignItems: "center",
|
|
@@ -1450,26 +1437,26 @@ var Header = React28.forwardRef(
|
|
|
1450
1437
|
sx: { marginInlineEnd: -0.75, py: 0.25 },
|
|
1451
1438
|
ref
|
|
1452
1439
|
},
|
|
1453
|
-
/* @__PURE__ */
|
|
1440
|
+
/* @__PURE__ */ React26.createElement(import_ui19.Box, { display: "flex", alignItems: "center", gap: 1, sx: { flexGrow: 1 } }, /* @__PURE__ */ React26.createElement(import_ui19.Typography, { component: "label", variant: "caption", color: "text.secondary", sx: { lineHeight: 1 } }, label), /* @__PURE__ */ React26.createElement(Adornment, null)),
|
|
1454
1441
|
children
|
|
1455
1442
|
);
|
|
1456
1443
|
}
|
|
1457
1444
|
);
|
|
1458
1445
|
|
|
1459
|
-
// src/components/
|
|
1460
|
-
var
|
|
1446
|
+
// src/components/control-repeater/items/items-container.tsx
|
|
1447
|
+
var React28 = __toESM(require("react"));
|
|
1461
1448
|
|
|
1462
1449
|
// src/components/sortable.tsx
|
|
1463
|
-
var
|
|
1450
|
+
var React27 = __toESM(require("react"));
|
|
1464
1451
|
var import_icons5 = require("@elementor/icons");
|
|
1465
|
-
var
|
|
1452
|
+
var import_ui20 = require("@elementor/ui");
|
|
1466
1453
|
var import_i18n6 = require("@wordpress/i18n");
|
|
1467
1454
|
var SortableProvider = (props) => {
|
|
1468
|
-
return /* @__PURE__ */
|
|
1455
|
+
return /* @__PURE__ */ React27.createElement(import_ui20.List, { sx: { p: 0, my: -0.5, mx: 0 } }, /* @__PURE__ */ React27.createElement(import_ui20.UnstableSortableProvider, { restrictAxis: true, disableDragOverlay: false, variant: "static", ...props }));
|
|
1469
1456
|
};
|
|
1470
1457
|
var SortableItem = ({ id, children, disabled }) => {
|
|
1471
|
-
return /* @__PURE__ */
|
|
1472
|
-
|
|
1458
|
+
return /* @__PURE__ */ React27.createElement(
|
|
1459
|
+
import_ui20.UnstableSortableItem,
|
|
1473
1460
|
{
|
|
1474
1461
|
id,
|
|
1475
1462
|
disabled,
|
|
@@ -1481,12 +1468,12 @@ var SortableItem = ({ id, children, disabled }) => {
|
|
|
1481
1468
|
showDropIndication,
|
|
1482
1469
|
dropIndicationStyle
|
|
1483
1470
|
}) => {
|
|
1484
|
-
return /* @__PURE__ */
|
|
1471
|
+
return /* @__PURE__ */ React27.createElement(StyledListItem, { ...itemProps, style: itemStyle, tabIndex: -1 }, !disabled && /* @__PURE__ */ React27.createElement(SortableTrigger, { ...triggerProps, style: triggerStyle }), children, showDropIndication && /* @__PURE__ */ React27.createElement(StyledDivider, { style: dropIndicationStyle }));
|
|
1485
1472
|
}
|
|
1486
1473
|
}
|
|
1487
1474
|
);
|
|
1488
1475
|
};
|
|
1489
|
-
var StyledListItem = (0,
|
|
1476
|
+
var StyledListItem = (0, import_ui20.styled)(import_ui20.ListItem)`
|
|
1490
1477
|
position: relative;
|
|
1491
1478
|
margin-inline: 0px;
|
|
1492
1479
|
padding-inline: 0px;
|
|
@@ -1516,7 +1503,7 @@ var StyledListItem = (0, import_ui22.styled)(import_ui22.ListItem)`
|
|
|
1516
1503
|
}
|
|
1517
1504
|
}
|
|
1518
1505
|
`;
|
|
1519
|
-
var SortableTrigger = (props) => /* @__PURE__ */
|
|
1506
|
+
var SortableTrigger = (props) => /* @__PURE__ */ React27.createElement(
|
|
1520
1507
|
"div",
|
|
1521
1508
|
{
|
|
1522
1509
|
...props,
|
|
@@ -1525,9 +1512,9 @@ var SortableTrigger = (props) => /* @__PURE__ */ React29.createElement(
|
|
|
1525
1512
|
tabIndex: 0,
|
|
1526
1513
|
"aria-label": (0, import_i18n6.__)("Drag item", "elementor")
|
|
1527
1514
|
},
|
|
1528
|
-
/* @__PURE__ */
|
|
1515
|
+
/* @__PURE__ */ React27.createElement(import_icons5.GripVerticalIcon, { fontSize: "tiny" })
|
|
1529
1516
|
);
|
|
1530
|
-
var StyledDivider = (0,
|
|
1517
|
+
var StyledDivider = (0, import_ui20.styled)(import_ui20.Divider)`
|
|
1531
1518
|
height: 0px;
|
|
1532
1519
|
border: none;
|
|
1533
1520
|
overflow: visible;
|
|
@@ -1544,7 +1531,7 @@ var StyledDivider = (0, import_ui22.styled)(import_ui22.Divider)`
|
|
|
1544
1531
|
}
|
|
1545
1532
|
`;
|
|
1546
1533
|
|
|
1547
|
-
// src/components/
|
|
1534
|
+
// src/components/control-repeater/items/items-container.tsx
|
|
1548
1535
|
var ItemsContainer = ({
|
|
1549
1536
|
isSortable = true,
|
|
1550
1537
|
children
|
|
@@ -1562,27 +1549,27 @@ var ItemsContainer = ({
|
|
|
1562
1549
|
})
|
|
1563
1550
|
);
|
|
1564
1551
|
};
|
|
1565
|
-
return /* @__PURE__ */
|
|
1552
|
+
return /* @__PURE__ */ React28.createElement(React28.Fragment, null, /* @__PURE__ */ React28.createElement(SortableProvider, { value: keys, onChange: onChangeOrder }, keys.map((key, index) => {
|
|
1566
1553
|
const value = items2[index].item;
|
|
1567
|
-
return /* @__PURE__ */
|
|
1554
|
+
return /* @__PURE__ */ React28.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React28.createElement(ItemContext.Provider, { value: { index, value } }, children));
|
|
1568
1555
|
})));
|
|
1569
1556
|
};
|
|
1570
1557
|
|
|
1571
|
-
// src/components/
|
|
1572
|
-
var
|
|
1573
|
-
var
|
|
1558
|
+
// src/components/control-repeater/items/item.tsx
|
|
1559
|
+
var React29 = __toESM(require("react"));
|
|
1560
|
+
var import_ui21 = require("@elementor/ui");
|
|
1574
1561
|
var import_i18n7 = require("@wordpress/i18n");
|
|
1575
1562
|
|
|
1576
|
-
// src/components/
|
|
1563
|
+
// src/components/control-repeater/locations.ts
|
|
1577
1564
|
var import_locations = require("@elementor/locations");
|
|
1578
1565
|
var { Slot: RepeaterItemIconSlot, inject: injectIntoRepeaterItemIcon } = (0, import_locations.createReplaceableLocation)();
|
|
1579
1566
|
var { Slot: RepeaterItemLabelSlot, inject: injectIntoRepeaterItemLabel } = (0, import_locations.createReplaceableLocation)();
|
|
1580
1567
|
var { Slot: RepeaterItemActionsSlot, inject: injectIntoRepeaterItemActions } = (0, import_locations.createLocation)();
|
|
1581
1568
|
|
|
1582
|
-
// src/components/
|
|
1569
|
+
// src/components/control-repeater/items/item.tsx
|
|
1583
1570
|
var Item = ({ Label: Label3, Icon, actions }) => {
|
|
1584
1571
|
const { items: items2, popoverState, setRowRef, openItemIndex, setOpenItemIndex, index = -1, value } = useRepeaterContext();
|
|
1585
|
-
const triggerProps = (0,
|
|
1572
|
+
const triggerProps = (0, import_ui21.bindTrigger)(popoverState);
|
|
1586
1573
|
const key = items2[index].key ?? -1;
|
|
1587
1574
|
const onClick = (ev) => {
|
|
1588
1575
|
triggerProps.onClick(ev);
|
|
@@ -1595,12 +1582,12 @@ var Item = ({ Label: Label3, Icon, actions }) => {
|
|
|
1595
1582
|
setRowRef(ref);
|
|
1596
1583
|
popoverState.setAnchorEl(ref);
|
|
1597
1584
|
};
|
|
1598
|
-
return /* @__PURE__ */
|
|
1599
|
-
|
|
1585
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(
|
|
1586
|
+
import_ui21.UnstableTag,
|
|
1600
1587
|
{
|
|
1601
1588
|
key,
|
|
1602
1589
|
disabled: false,
|
|
1603
|
-
label: /* @__PURE__ */
|
|
1590
|
+
label: /* @__PURE__ */ React29.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React29.createElement(Label3, { value })),
|
|
1604
1591
|
showActionsOnHover: true,
|
|
1605
1592
|
fullWidth: true,
|
|
1606
1593
|
ref: setRef,
|
|
@@ -1609,26 +1596,26 @@ var Item = ({ Label: Label3, Icon, actions }) => {
|
|
|
1609
1596
|
sx: { minHeight: (theme) => theme.spacing(3.5) },
|
|
1610
1597
|
...triggerProps,
|
|
1611
1598
|
onClick,
|
|
1612
|
-
startIcon: /* @__PURE__ */
|
|
1613
|
-
actions: /* @__PURE__ */
|
|
1599
|
+
startIcon: /* @__PURE__ */ React29.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React29.createElement(Icon, { value })),
|
|
1600
|
+
actions: /* @__PURE__ */ React29.createElement(React29.Fragment, null, /* @__PURE__ */ React29.createElement(RepeaterItemActionsSlot, { index: index ?? -1 }), actions)
|
|
1614
1601
|
}
|
|
1615
1602
|
));
|
|
1616
1603
|
};
|
|
1617
1604
|
|
|
1618
|
-
// src/components/
|
|
1619
|
-
var
|
|
1620
|
-
var
|
|
1605
|
+
// src/components/control-repeater/control-repeater.tsx
|
|
1606
|
+
var React30 = __toESM(require("react"));
|
|
1607
|
+
var ControlRepeater = ({
|
|
1621
1608
|
children,
|
|
1622
1609
|
initial,
|
|
1623
1610
|
propTypeUtil
|
|
1624
1611
|
}) => {
|
|
1625
|
-
return /* @__PURE__ */
|
|
1612
|
+
return /* @__PURE__ */ React30.createElement(SectionContent, null, /* @__PURE__ */ React30.createElement(RepeaterContextProvider, { initial, propTypeUtil }, children));
|
|
1626
1613
|
};
|
|
1627
1614
|
|
|
1628
|
-
// src/components/
|
|
1629
|
-
var
|
|
1615
|
+
// src/components/control-repeater/actions/disable-item-action.tsx
|
|
1616
|
+
var React31 = __toESM(require("react"));
|
|
1630
1617
|
var import_icons6 = require("@elementor/icons");
|
|
1631
|
-
var
|
|
1618
|
+
var import_ui22 = require("@elementor/ui");
|
|
1632
1619
|
var import_i18n8 = require("@wordpress/i18n");
|
|
1633
1620
|
var SIZE3 = "tiny";
|
|
1634
1621
|
var DisableItemAction = () => {
|
|
@@ -1646,13 +1633,13 @@ var DisableItemAction = () => {
|
|
|
1646
1633
|
}
|
|
1647
1634
|
updateItem(self, index);
|
|
1648
1635
|
};
|
|
1649
|
-
return /* @__PURE__ */
|
|
1636
|
+
return /* @__PURE__ */ React31.createElement(import_ui22.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React31.createElement(import_ui22.IconButton, { size: SIZE3, onClick, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React31.createElement(import_icons6.EyeOffIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React31.createElement(import_icons6.EyeIcon, { fontSize: SIZE3 })));
|
|
1650
1637
|
};
|
|
1651
1638
|
|
|
1652
|
-
// src/components/
|
|
1653
|
-
var
|
|
1639
|
+
// src/components/control-repeater/actions/duplicate-item-action.tsx
|
|
1640
|
+
var React32 = __toESM(require("react"));
|
|
1654
1641
|
var import_icons7 = require("@elementor/icons");
|
|
1655
|
-
var
|
|
1642
|
+
var import_ui23 = require("@elementor/ui");
|
|
1656
1643
|
var import_i18n9 = require("@wordpress/i18n");
|
|
1657
1644
|
var SIZE4 = "tiny";
|
|
1658
1645
|
var DuplicateItemAction = () => {
|
|
@@ -1665,13 +1652,13 @@ var DuplicateItemAction = () => {
|
|
|
1665
1652
|
const newItem = structuredClone(items2[index]?.item);
|
|
1666
1653
|
addItem(ev, { item: newItem, index: index + 1 });
|
|
1667
1654
|
};
|
|
1668
|
-
return /* @__PURE__ */
|
|
1655
|
+
return /* @__PURE__ */ React32.createElement(import_ui23.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React32.createElement(import_ui23.IconButton, { size: SIZE4, onClick, "aria-label": duplicateLabel }, /* @__PURE__ */ React32.createElement(import_icons7.CopyIcon, { fontSize: SIZE4 })));
|
|
1669
1656
|
};
|
|
1670
1657
|
|
|
1671
|
-
// src/components/
|
|
1672
|
-
var
|
|
1658
|
+
// src/components/control-repeater/actions/remove-item-action.tsx
|
|
1659
|
+
var React33 = __toESM(require("react"));
|
|
1673
1660
|
var import_icons8 = require("@elementor/icons");
|
|
1674
|
-
var
|
|
1661
|
+
var import_ui24 = require("@elementor/ui");
|
|
1675
1662
|
var import_i18n10 = require("@wordpress/i18n");
|
|
1676
1663
|
var SIZE5 = "tiny";
|
|
1677
1664
|
var RemoveItemAction = () => {
|
|
@@ -1681,12 +1668,12 @@ var RemoveItemAction = () => {
|
|
|
1681
1668
|
}
|
|
1682
1669
|
const removeLabel = (0, import_i18n10.__)("Remove", "elementor");
|
|
1683
1670
|
const onClick = () => removeItem(index);
|
|
1684
|
-
return /* @__PURE__ */
|
|
1671
|
+
return /* @__PURE__ */ React33.createElement(import_ui24.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React33.createElement(import_ui24.IconButton, { size: SIZE5, onClick, "aria-label": removeLabel }, /* @__PURE__ */ React33.createElement(import_icons8.XIcon, { fontSize: SIZE5 })));
|
|
1685
1672
|
};
|
|
1686
1673
|
|
|
1687
|
-
// src/components/
|
|
1688
|
-
var
|
|
1689
|
-
var
|
|
1674
|
+
// src/components/control-repeater/items/edit-item-popover.tsx
|
|
1675
|
+
var React34 = __toESM(require("react"));
|
|
1676
|
+
var import_ui25 = require("@elementor/ui");
|
|
1690
1677
|
var EditItemPopover = ({ children }) => {
|
|
1691
1678
|
const { popoverState, openItemIndex, isOpen, rowRef, setOpenItemIndex, setRowRef } = useRepeaterContext();
|
|
1692
1679
|
if (!isOpen || !rowRef) {
|
|
@@ -1697,8 +1684,8 @@ var EditItemPopover = ({ children }) => {
|
|
|
1697
1684
|
popoverState.setAnchorEl(null);
|
|
1698
1685
|
setOpenItemIndex(EMPTY_OPEN_ITEM);
|
|
1699
1686
|
};
|
|
1700
|
-
return /* @__PURE__ */
|
|
1701
|
-
|
|
1687
|
+
return /* @__PURE__ */ React34.createElement(
|
|
1688
|
+
import_ui25.Popover,
|
|
1702
1689
|
{
|
|
1703
1690
|
disablePortal: true,
|
|
1704
1691
|
slotProps: {
|
|
@@ -1707,17 +1694,30 @@ var EditItemPopover = ({ children }) => {
|
|
|
1707
1694
|
}
|
|
1708
1695
|
},
|
|
1709
1696
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1710
|
-
...(0,
|
|
1697
|
+
...(0, import_ui25.bindPopover)(popoverState),
|
|
1711
1698
|
onClose
|
|
1712
1699
|
},
|
|
1713
|
-
/* @__PURE__ */
|
|
1700
|
+
/* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: String(openItemIndex) }, /* @__PURE__ */ React34.createElement(import_ui25.Box, null, children))
|
|
1714
1701
|
);
|
|
1715
1702
|
};
|
|
1716
1703
|
|
|
1704
|
+
// src/components/popover-content.tsx
|
|
1705
|
+
var React35 = __toESM(require("react"));
|
|
1706
|
+
var import_ui26 = require("@elementor/ui");
|
|
1707
|
+
var PopoverContent = ({ gap = 1.5, children, ...props }) => /* @__PURE__ */ React35.createElement(import_ui26.Stack, { ...props, gap }, children);
|
|
1708
|
+
|
|
1709
|
+
// src/components/popover-grid-container.tsx
|
|
1710
|
+
var import_react18 = require("react");
|
|
1711
|
+
var React36 = __toESM(require("react"));
|
|
1712
|
+
var import_ui27 = require("@elementor/ui");
|
|
1713
|
+
var PopoverGridContainer = (0, import_react18.forwardRef)(
|
|
1714
|
+
({ gap = 1.5, alignItems = "center", flexWrap = "nowrap", children }, ref) => /* @__PURE__ */ React36.createElement(import_ui27.Grid, { container: true, gap, alignItems, flexWrap, ref }, children)
|
|
1715
|
+
);
|
|
1716
|
+
|
|
1717
1717
|
// src/controls/box-shadow-repeater-control.tsx
|
|
1718
1718
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
1719
1719
|
const { propType, value, setValue, disabled } = useBoundProp(import_editor_props10.boxShadowPropTypeUtil);
|
|
1720
|
-
return /* @__PURE__ */ React37.createElement(PropProvider, { propType, value, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React37.createElement(
|
|
1720
|
+
return /* @__PURE__ */ React37.createElement(PropProvider, { propType, value, setValue, isDisabled: () => disabled }, /* @__PURE__ */ React37.createElement(ControlRepeater, { initial: initialShadow, propTypeUtil: import_editor_props10.boxShadowPropTypeUtil }, /* @__PURE__ */ React37.createElement(Header, { label: (0, import_i18n11.__)("Box shadow", "elementor") }, /* @__PURE__ */ React37.createElement(TooltipAddItemAction, { newItemIndex: 0, disabled, ariaLabel: "Box shadow" })), /* @__PURE__ */ React37.createElement(ItemsContainer, null, /* @__PURE__ */ React37.createElement(
|
|
1721
1721
|
Item,
|
|
1722
1722
|
{
|
|
1723
1723
|
Icon: ItemIcon,
|
|
@@ -2100,7 +2100,7 @@ var FilterRepeaterControl = createControl(({ filterPropName = "filter" }) => {
|
|
|
2100
2100
|
});
|
|
2101
2101
|
var Repeater = ({ propTypeUtil, label, filterPropName }) => {
|
|
2102
2102
|
const { getInitialValue } = useFilterConfig();
|
|
2103
|
-
return /* @__PURE__ */ React46.createElement(
|
|
2103
|
+
return /* @__PURE__ */ React46.createElement(ControlRepeater, { initial: getInitialValue(), propTypeUtil }, /* @__PURE__ */ React46.createElement(Header, { label }, /* @__PURE__ */ React46.createElement(
|
|
2104
2104
|
TooltipAddItemAction,
|
|
2105
2105
|
{
|
|
2106
2106
|
newItemIndex: 0,
|
|
@@ -4081,7 +4081,7 @@ var backgroundResolutionOptions = [
|
|
|
4081
4081
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
4082
4082
|
const { propType, value: overlayValues, setValue } = useBoundProp(import_editor_props32.backgroundOverlayPropTypeUtil);
|
|
4083
4083
|
return /* @__PURE__ */ React72.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React72.createElement(
|
|
4084
|
-
|
|
4084
|
+
ControlRepeater,
|
|
4085
4085
|
{
|
|
4086
4086
|
initial: getInitialBackgroundOverlay(),
|
|
4087
4087
|
propTypeUtil: import_editor_props32.backgroundOverlayPropTypeUtil
|
|
@@ -4297,7 +4297,7 @@ var RepeatableControl = createControl(
|
|
|
4297
4297
|
);
|
|
4298
4298
|
const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
4299
4299
|
return /* @__PURE__ */ React74.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React74.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React74.createElement(
|
|
4300
|
-
|
|
4300
|
+
ControlRepeater,
|
|
4301
4301
|
{
|
|
4302
4302
|
initial: childPropTypeUtil.create(initialValues || null),
|
|
4303
4303
|
propTypeUtil: childArrayPropTypeUtil
|
|
@@ -5100,7 +5100,7 @@ var Repeater2 = ({
|
|
|
5100
5100
|
};
|
|
5101
5101
|
const shouldDisableAddItem = !getInitialValue();
|
|
5102
5102
|
return /* @__PURE__ */ React89.createElement(PropProvider, { ...transformFunctionsContext }, /* @__PURE__ */ React89.createElement(
|
|
5103
|
-
|
|
5103
|
+
ControlRepeater,
|
|
5104
5104
|
{
|
|
5105
5105
|
initial: getInitialValue() ?? initialTransformValue,
|
|
5106
5106
|
propTypeUtil: import_editor_props45.transformFunctionsPropTypeUtil
|