@elementor/editor-controls 0.28.2 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +376 -242
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +311 -174
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/conditional-tooltip.tsx +16 -0
- package/src/components/control-toggle-button-group.tsx +173 -28
- package/src/controls/font-family-control/font-family-control.tsx +10 -8
- package/src/controls/toggle-control.tsx +3 -0
package/dist/index.js
CHANGED
|
@@ -372,7 +372,7 @@ function ControlActions({ children }) {
|
|
|
372
372
|
if (items.length === 0) {
|
|
373
373
|
return children;
|
|
374
374
|
}
|
|
375
|
-
const menuItems = items.map(({ MenuItem, id }) => /* @__PURE__ */ React7.createElement(
|
|
375
|
+
const menuItems = items.map(({ MenuItem: MenuItem2, id }) => /* @__PURE__ */ React7.createElement(MenuItem2, { key: id }));
|
|
376
376
|
return /* @__PURE__ */ React7.createElement(FloatingBarContainer, null, /* @__PURE__ */ React7.createElement(import_ui3.UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
377
377
|
}
|
|
378
378
|
|
|
@@ -1131,14 +1131,41 @@ var initialShadow = {
|
|
|
1131
1131
|
};
|
|
1132
1132
|
|
|
1133
1133
|
// src/controls/toggle-control.tsx
|
|
1134
|
-
var
|
|
1134
|
+
var React27 = __toESM(require("react"));
|
|
1135
1135
|
var import_editor_props10 = require("@elementor/editor-props");
|
|
1136
1136
|
|
|
1137
1137
|
// src/components/control-toggle-button-group.tsx
|
|
1138
|
+
var React26 = __toESM(require("react"));
|
|
1139
|
+
var import_react10 = require("react");
|
|
1140
|
+
var import_icons4 = require("@elementor/icons");
|
|
1141
|
+
var import_ui20 = require("@elementor/ui");
|
|
1142
|
+
|
|
1143
|
+
// src/components/conditional-tooltip.tsx
|
|
1138
1144
|
var React25 = __toESM(require("react"));
|
|
1139
1145
|
var import_ui19 = require("@elementor/ui");
|
|
1140
|
-
var
|
|
1146
|
+
var ConditionalTooltip = ({
|
|
1147
|
+
showTooltip,
|
|
1148
|
+
children,
|
|
1149
|
+
label
|
|
1150
|
+
}) => {
|
|
1151
|
+
return showTooltip && label ? /* @__PURE__ */ React25.createElement(import_ui19.Tooltip, { title: label, disableFocusListener: true, placement: "top" }, children) : children;
|
|
1152
|
+
};
|
|
1153
|
+
|
|
1154
|
+
// src/components/control-toggle-button-group.tsx
|
|
1155
|
+
var StyledToggleButtonGroup = (0, import_ui20.styled)(import_ui20.ToggleButtonGroup)`
|
|
1141
1156
|
${({ justify }) => `justify-content: ${justify};`}
|
|
1157
|
+
button:not( :last-of-type ) {
|
|
1158
|
+
border-start-end-radius: 0;
|
|
1159
|
+
border-end-end-radius: 0;
|
|
1160
|
+
}
|
|
1161
|
+
button:not( :first-of-type ) {
|
|
1162
|
+
border-start-start-radius: 0;
|
|
1163
|
+
border-end-start-radius: 0;
|
|
1164
|
+
}
|
|
1165
|
+
button:last-of-type {
|
|
1166
|
+
border-start-end-radius: 8px;
|
|
1167
|
+
border-end-end-radius: 8px;
|
|
1168
|
+
}
|
|
1142
1169
|
`;
|
|
1143
1170
|
var ControlToggleButtonGroup = ({
|
|
1144
1171
|
justify = "end",
|
|
@@ -1146,14 +1173,24 @@ var ControlToggleButtonGroup = ({
|
|
|
1146
1173
|
value,
|
|
1147
1174
|
onChange,
|
|
1148
1175
|
items,
|
|
1176
|
+
maxItems,
|
|
1149
1177
|
exclusive = false,
|
|
1150
1178
|
fullWidth = false
|
|
1151
1179
|
}) => {
|
|
1152
|
-
const
|
|
1180
|
+
const shouldSliceItems = exclusive && maxItems !== void 0 && items.length > maxItems;
|
|
1181
|
+
const menuItems = shouldSliceItems ? items.slice(maxItems - 1) : [];
|
|
1182
|
+
const fixedItems = shouldSliceItems ? items.slice(0, maxItems - 1) : items;
|
|
1183
|
+
const isRtl = "rtl" === (0, import_ui20.useTheme)().direction;
|
|
1153
1184
|
const handleChange = (_, newValue) => {
|
|
1154
1185
|
onChange(newValue);
|
|
1155
1186
|
};
|
|
1156
|
-
|
|
1187
|
+
const getGridTemplateColumns = (0, import_react10.useMemo)(() => {
|
|
1188
|
+
const isOffLimits = menuItems?.length;
|
|
1189
|
+
const itemsCount = isOffLimits ? fixedItems.length + 1 : fixedItems.length;
|
|
1190
|
+
const templateColumnsSuffix = isOffLimits ? "auto" : "";
|
|
1191
|
+
return `repeat(${itemsCount}, minmax(0, 25%)) ${templateColumnsSuffix}`;
|
|
1192
|
+
}, [menuItems?.length, fixedItems.length]);
|
|
1193
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(
|
|
1157
1194
|
StyledToggleButtonGroup,
|
|
1158
1195
|
{
|
|
1159
1196
|
justify,
|
|
@@ -1163,24 +1200,119 @@ var ControlToggleButtonGroup = ({
|
|
|
1163
1200
|
sx: {
|
|
1164
1201
|
direction: isRtl ? "rtl /* @noflip */" : "ltr /* @noflip */",
|
|
1165
1202
|
display: "grid",
|
|
1166
|
-
gridTemplateColumns:
|
|
1203
|
+
gridTemplateColumns: getGridTemplateColumns,
|
|
1167
1204
|
width: `100%`
|
|
1168
1205
|
}
|
|
1169
1206
|
},
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1207
|
+
fixedItems.map(({ label, value: buttonValue, renderContent: Content3, showTooltip }) => /* @__PURE__ */ React26.createElement(
|
|
1208
|
+
ConditionalTooltip,
|
|
1209
|
+
{
|
|
1210
|
+
key: buttonValue,
|
|
1211
|
+
label,
|
|
1212
|
+
showTooltip: showTooltip || false
|
|
1213
|
+
},
|
|
1214
|
+
/* @__PURE__ */ React26.createElement(import_ui20.ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React26.createElement(Content3, { size }))
|
|
1215
|
+
)),
|
|
1216
|
+
menuItems.length && exclusive && /* @__PURE__ */ React26.createElement(
|
|
1217
|
+
SplitButtonGroup,
|
|
1218
|
+
{
|
|
1219
|
+
size,
|
|
1220
|
+
value: value || null,
|
|
1221
|
+
onChange,
|
|
1222
|
+
items: menuItems,
|
|
1223
|
+
fullWidth
|
|
1224
|
+
}
|
|
1182
1225
|
)
|
|
1226
|
+
));
|
|
1227
|
+
};
|
|
1228
|
+
var SplitButtonGroup = ({
|
|
1229
|
+
size = "tiny",
|
|
1230
|
+
onChange,
|
|
1231
|
+
items,
|
|
1232
|
+
fullWidth,
|
|
1233
|
+
value
|
|
1234
|
+
}) => {
|
|
1235
|
+
const previewButton = usePreviewButton(items, value);
|
|
1236
|
+
const [isMenuOpen, setIsMenuOpen] = (0, import_react10.useState)(false);
|
|
1237
|
+
const menuButtonRef = (0, import_react10.useRef)(null);
|
|
1238
|
+
const onMenuToggle = (ev) => {
|
|
1239
|
+
setIsMenuOpen((prev) => !prev);
|
|
1240
|
+
ev.preventDefault();
|
|
1241
|
+
};
|
|
1242
|
+
const onMenuItemClick = (newValue) => {
|
|
1243
|
+
setIsMenuOpen(false);
|
|
1244
|
+
onToggleItem(newValue);
|
|
1245
|
+
};
|
|
1246
|
+
const onToggleItem = (newValue) => {
|
|
1247
|
+
const shouldRemove = newValue === value;
|
|
1248
|
+
onChange(shouldRemove ? null : newValue);
|
|
1249
|
+
};
|
|
1250
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(
|
|
1251
|
+
import_ui20.ToggleButton,
|
|
1252
|
+
{
|
|
1253
|
+
value: previewButton.value,
|
|
1254
|
+
"aria-label": previewButton.label,
|
|
1255
|
+
size,
|
|
1256
|
+
fullWidth,
|
|
1257
|
+
onClick: (ev) => {
|
|
1258
|
+
ev.preventDefault();
|
|
1259
|
+
onMenuItemClick(previewButton.value);
|
|
1260
|
+
},
|
|
1261
|
+
ref: menuButtonRef
|
|
1262
|
+
},
|
|
1263
|
+
previewButton.renderContent({ size })
|
|
1264
|
+
), /* @__PURE__ */ React26.createElement(
|
|
1265
|
+
import_ui20.ToggleButton,
|
|
1266
|
+
{
|
|
1267
|
+
size,
|
|
1268
|
+
"aria-expanded": isMenuOpen ? "true" : void 0,
|
|
1269
|
+
"aria-haspopup": "menu",
|
|
1270
|
+
"aria-pressed": void 0,
|
|
1271
|
+
onClick: onMenuToggle,
|
|
1272
|
+
ref: menuButtonRef,
|
|
1273
|
+
value: "__chevron-icon-button__"
|
|
1274
|
+
},
|
|
1275
|
+
/* @__PURE__ */ React26.createElement(import_icons4.ChevronDownIcon, { fontSize: size })
|
|
1276
|
+
), /* @__PURE__ */ React26.createElement(
|
|
1277
|
+
import_ui20.Menu,
|
|
1278
|
+
{
|
|
1279
|
+
open: isMenuOpen,
|
|
1280
|
+
onClose: () => setIsMenuOpen(false),
|
|
1281
|
+
anchorEl: menuButtonRef.current,
|
|
1282
|
+
anchorOrigin: {
|
|
1283
|
+
vertical: "bottom",
|
|
1284
|
+
horizontal: "right"
|
|
1285
|
+
},
|
|
1286
|
+
transformOrigin: {
|
|
1287
|
+
vertical: "top",
|
|
1288
|
+
horizontal: "right"
|
|
1289
|
+
},
|
|
1290
|
+
sx: {
|
|
1291
|
+
mt: 0.5
|
|
1292
|
+
}
|
|
1293
|
+
},
|
|
1294
|
+
items.map(({ label, value: buttonValue }) => /* @__PURE__ */ React26.createElement(
|
|
1295
|
+
import_ui20.MenuItem,
|
|
1296
|
+
{
|
|
1297
|
+
key: buttonValue,
|
|
1298
|
+
selected: buttonValue === value,
|
|
1299
|
+
onClick: () => onMenuItemClick(buttonValue)
|
|
1300
|
+
},
|
|
1301
|
+
/* @__PURE__ */ React26.createElement(import_ui20.ListItemText, null, /* @__PURE__ */ React26.createElement(import_ui20.Typography, { sx: { fontSize: "14px" } }, label))
|
|
1302
|
+
))
|
|
1303
|
+
));
|
|
1304
|
+
};
|
|
1305
|
+
var usePreviewButton = (items, value) => {
|
|
1306
|
+
const [previewButton, setPreviewButton] = (0, import_react10.useState)(
|
|
1307
|
+
items.find((item) => item.value === value) ?? items[0]
|
|
1183
1308
|
);
|
|
1309
|
+
(0, import_react10.useEffect)(() => {
|
|
1310
|
+
const selectedButton = items.find((item) => item.value === value);
|
|
1311
|
+
if (selectedButton) {
|
|
1312
|
+
setPreviewButton(selectedButton);
|
|
1313
|
+
}
|
|
1314
|
+
}, [items, value]);
|
|
1315
|
+
return previewButton;
|
|
1184
1316
|
};
|
|
1185
1317
|
|
|
1186
1318
|
// src/controls/toggle-control.tsx
|
|
@@ -1189,7 +1321,8 @@ var ToggleControl = createControl(
|
|
|
1189
1321
|
options,
|
|
1190
1322
|
fullWidth = false,
|
|
1191
1323
|
size = "tiny",
|
|
1192
|
-
exclusive = true
|
|
1324
|
+
exclusive = true,
|
|
1325
|
+
maxItems
|
|
1193
1326
|
}) => {
|
|
1194
1327
|
const { value, setValue, placeholder } = useBoundProp(import_editor_props10.stringPropTypeUtil);
|
|
1195
1328
|
const exclusiveValues = options.filter((option) => option.exclusive).map((option) => option.value);
|
|
@@ -1201,10 +1334,11 @@ var ToggleControl = createControl(
|
|
|
1201
1334
|
};
|
|
1202
1335
|
const toggleButtonGroupProps = {
|
|
1203
1336
|
items: options,
|
|
1337
|
+
maxItems,
|
|
1204
1338
|
fullWidth,
|
|
1205
1339
|
size
|
|
1206
1340
|
};
|
|
1207
|
-
return exclusive ? /* @__PURE__ */
|
|
1341
|
+
return exclusive ? /* @__PURE__ */ React27.createElement(
|
|
1208
1342
|
ControlToggleButtonGroup,
|
|
1209
1343
|
{
|
|
1210
1344
|
...toggleButtonGroupProps,
|
|
@@ -1212,7 +1346,7 @@ var ToggleControl = createControl(
|
|
|
1212
1346
|
onChange: setValue,
|
|
1213
1347
|
exclusive: true
|
|
1214
1348
|
}
|
|
1215
|
-
) : /* @__PURE__ */
|
|
1349
|
+
) : /* @__PURE__ */ React27.createElement(
|
|
1216
1350
|
ControlToggleButtonGroup,
|
|
1217
1351
|
{
|
|
1218
1352
|
...toggleButtonGroupProps,
|
|
@@ -1225,9 +1359,9 @@ var ToggleControl = createControl(
|
|
|
1225
1359
|
);
|
|
1226
1360
|
|
|
1227
1361
|
// src/controls/number-control.tsx
|
|
1228
|
-
var
|
|
1362
|
+
var React28 = __toESM(require("react"));
|
|
1229
1363
|
var import_editor_props11 = require("@elementor/editor-props");
|
|
1230
|
-
var
|
|
1364
|
+
var import_ui21 = require("@elementor/ui");
|
|
1231
1365
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
1232
1366
|
var RESTRICTED_INPUT_KEYS2 = ["e", "E", "+", "-"];
|
|
1233
1367
|
var NumberControl = createControl(
|
|
@@ -1248,8 +1382,8 @@ var NumberControl = createControl(
|
|
|
1248
1382
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
1249
1383
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
1250
1384
|
};
|
|
1251
|
-
return /* @__PURE__ */
|
|
1252
|
-
|
|
1385
|
+
return /* @__PURE__ */ React28.createElement(ControlActions, null, /* @__PURE__ */ React28.createElement(
|
|
1386
|
+
import_ui21.TextField,
|
|
1253
1387
|
{
|
|
1254
1388
|
size: "tiny",
|
|
1255
1389
|
type: "number",
|
|
@@ -1269,17 +1403,17 @@ var NumberControl = createControl(
|
|
|
1269
1403
|
);
|
|
1270
1404
|
|
|
1271
1405
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1272
|
-
var
|
|
1273
|
-
var
|
|
1406
|
+
var React30 = __toESM(require("react"));
|
|
1407
|
+
var import_react11 = require("react");
|
|
1274
1408
|
var import_editor_props12 = require("@elementor/editor-props");
|
|
1275
|
-
var
|
|
1409
|
+
var import_ui23 = require("@elementor/ui");
|
|
1276
1410
|
var import_i18n6 = require("@wordpress/i18n");
|
|
1277
1411
|
|
|
1278
1412
|
// src/components/control-label.tsx
|
|
1279
|
-
var
|
|
1280
|
-
var
|
|
1413
|
+
var React29 = __toESM(require("react"));
|
|
1414
|
+
var import_ui22 = require("@elementor/ui");
|
|
1281
1415
|
var ControlLabel = ({ children }) => {
|
|
1282
|
-
return /* @__PURE__ */
|
|
1416
|
+
return /* @__PURE__ */ React29.createElement(import_ui22.Stack, { direction: "row", alignItems: "center", justifyItems: "start", gap: 1 }, /* @__PURE__ */ React29.createElement(ControlFormLabel, null, children), /* @__PURE__ */ React29.createElement(ControlAdornments, null));
|
|
1283
1417
|
};
|
|
1284
1418
|
|
|
1285
1419
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
@@ -1300,9 +1434,9 @@ function EqualUnequalSizesControl({
|
|
|
1300
1434
|
items,
|
|
1301
1435
|
multiSizePropTypeUtil
|
|
1302
1436
|
}) {
|
|
1303
|
-
const popupId = (0,
|
|
1304
|
-
const controlRef = (0,
|
|
1305
|
-
const popupState = (0,
|
|
1437
|
+
const popupId = (0, import_react11.useId)();
|
|
1438
|
+
const controlRef = (0, import_react11.useRef)(null);
|
|
1439
|
+
const popupState = (0, import_ui23.usePopupState)({ variant: "popover", popupId });
|
|
1306
1440
|
const {
|
|
1307
1441
|
propType: multiSizePropType,
|
|
1308
1442
|
value: multiSizeValue,
|
|
@@ -1336,19 +1470,19 @@ function EqualUnequalSizesControl({
|
|
|
1336
1470
|
return splitEqualValue() ?? null;
|
|
1337
1471
|
};
|
|
1338
1472
|
const isMixed = !!multiSizeValue;
|
|
1339
|
-
return /* @__PURE__ */
|
|
1340
|
-
|
|
1473
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, label)), /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(import_ui23.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React30.createElement(SizeControl, { placeholder: isMixed ? (0, import_i18n6.__)("Mixed", "elementor") : void 0 }), /* @__PURE__ */ React30.createElement(import_ui23.Tooltip, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React30.createElement(
|
|
1474
|
+
import_ui23.ToggleButton,
|
|
1341
1475
|
{
|
|
1342
1476
|
size: "tiny",
|
|
1343
1477
|
value: "check",
|
|
1344
1478
|
sx: { marginLeft: "auto" },
|
|
1345
|
-
...(0,
|
|
1479
|
+
...(0, import_ui23.bindToggle)(popupState),
|
|
1346
1480
|
selected: popupState.isOpen,
|
|
1347
1481
|
"aria-label": tooltipLabel
|
|
1348
1482
|
},
|
|
1349
1483
|
icon
|
|
1350
|
-
))))), /* @__PURE__ */
|
|
1351
|
-
|
|
1484
|
+
))))), /* @__PURE__ */ React30.createElement(
|
|
1485
|
+
import_ui23.Popover,
|
|
1352
1486
|
{
|
|
1353
1487
|
disablePortal: true,
|
|
1354
1488
|
disableScrollLock: true,
|
|
@@ -1360,21 +1494,21 @@ function EqualUnequalSizesControl({
|
|
|
1360
1494
|
vertical: "top",
|
|
1361
1495
|
horizontal: "right"
|
|
1362
1496
|
},
|
|
1363
|
-
...(0,
|
|
1497
|
+
...(0, import_ui23.bindPopover)(popupState),
|
|
1364
1498
|
slotProps: {
|
|
1365
1499
|
paper: { sx: { mt: 0.5, width: controlRef.current?.getBoundingClientRect().width } }
|
|
1366
1500
|
}
|
|
1367
1501
|
},
|
|
1368
|
-
/* @__PURE__ */
|
|
1502
|
+
/* @__PURE__ */ React30.createElement(PropProvider, { propType: multiSizePropType, value: getMultiSizeValues(), setValue: setNestedProp }, /* @__PURE__ */ React30.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React30.createElement(PopoverGridContainer, null, /* @__PURE__ */ React30.createElement(MultiSizeValueControl, { item: items[0] }), /* @__PURE__ */ React30.createElement(MultiSizeValueControl, { item: items[1] })), /* @__PURE__ */ React30.createElement(PopoverGridContainer, null, /* @__PURE__ */ React30.createElement(MultiSizeValueControl, { item: items[2] }), /* @__PURE__ */ React30.createElement(MultiSizeValueControl, { item: items[3] }))))
|
|
1369
1503
|
));
|
|
1370
1504
|
}
|
|
1371
|
-
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */
|
|
1505
|
+
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React30.createElement(ControlFormLabel, null, item.label)), /* @__PURE__ */ React30.createElement(import_ui23.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React30.createElement(SizeControl, { startIcon: item.icon })))));
|
|
1372
1506
|
|
|
1373
1507
|
// src/controls/linked-dimensions-control.tsx
|
|
1374
|
-
var
|
|
1508
|
+
var React31 = __toESM(require("react"));
|
|
1375
1509
|
var import_editor_props13 = require("@elementor/editor-props");
|
|
1376
|
-
var
|
|
1377
|
-
var
|
|
1510
|
+
var import_icons5 = require("@elementor/icons");
|
|
1511
|
+
var import_ui24 = require("@elementor/ui");
|
|
1378
1512
|
var import_i18n7 = require("@wordpress/i18n");
|
|
1379
1513
|
var LinkedDimensionsControl = createControl(
|
|
1380
1514
|
({
|
|
@@ -1403,11 +1537,11 @@ var LinkedDimensionsControl = createControl(
|
|
|
1403
1537
|
});
|
|
1404
1538
|
};
|
|
1405
1539
|
const tooltipLabel = label.toLowerCase();
|
|
1406
|
-
const LinkedIcon = isLinked ?
|
|
1540
|
+
const LinkedIcon = isLinked ? import_icons5.LinkIcon : import_icons5.DetachIcon;
|
|
1407
1541
|
const linkedLabel = (0, import_i18n7.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1408
1542
|
const unlinkedLabel = (0, import_i18n7.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1409
|
-
return /* @__PURE__ */
|
|
1410
|
-
|
|
1543
|
+
return /* @__PURE__ */ React31.createElement(PropProvider, { propType, value: dimensionsValue, setValue: setDimensionsValue }, /* @__PURE__ */ React31.createElement(import_ui24.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(ControlLabel, null, label), /* @__PURE__ */ React31.createElement(import_ui24.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React31.createElement(
|
|
1544
|
+
import_ui24.ToggleButton,
|
|
1411
1545
|
{
|
|
1412
1546
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1413
1547
|
size: "tiny",
|
|
@@ -1416,36 +1550,36 @@ var LinkedDimensionsControl = createControl(
|
|
|
1416
1550
|
sx: { marginLeft: "auto" },
|
|
1417
1551
|
onChange: onLinkToggle
|
|
1418
1552
|
},
|
|
1419
|
-
/* @__PURE__ */
|
|
1420
|
-
))), /* @__PURE__ */
|
|
1553
|
+
/* @__PURE__ */ React31.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1554
|
+
))), /* @__PURE__ */ React31.createElement(import_ui24.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(ControlFormLabel, null, (0, import_i18n7.__)("Top", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1421
1555
|
Control3,
|
|
1422
1556
|
{
|
|
1423
1557
|
bind: "block-start",
|
|
1424
|
-
startIcon: /* @__PURE__ */
|
|
1558
|
+
startIcon: /* @__PURE__ */ React31.createElement(import_icons5.SideTopIcon, { fontSize: "tiny" }),
|
|
1425
1559
|
isLinked,
|
|
1426
1560
|
extendedValues
|
|
1427
1561
|
}
|
|
1428
|
-
))), /* @__PURE__ */
|
|
1562
|
+
))), /* @__PURE__ */ React31.createElement(import_ui24.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(ControlFormLabel, null, isSiteRtl ? (0, import_i18n7.__)("Left", "elementor") : (0, import_i18n7.__)("Right", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1429
1563
|
Control3,
|
|
1430
1564
|
{
|
|
1431
1565
|
bind: "inline-end",
|
|
1432
|
-
startIcon: isSiteRtl ? /* @__PURE__ */
|
|
1566
|
+
startIcon: isSiteRtl ? /* @__PURE__ */ React31.createElement(import_icons5.SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React31.createElement(import_icons5.SideRightIcon, { fontSize: "tiny" }),
|
|
1433
1567
|
isLinked,
|
|
1434
1568
|
extendedValues
|
|
1435
1569
|
}
|
|
1436
|
-
)))), /* @__PURE__ */
|
|
1570
|
+
)))), /* @__PURE__ */ React31.createElement(import_ui24.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(ControlFormLabel, null, (0, import_i18n7.__)("Bottom", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1437
1571
|
Control3,
|
|
1438
1572
|
{
|
|
1439
1573
|
bind: "block-end",
|
|
1440
|
-
startIcon: /* @__PURE__ */
|
|
1574
|
+
startIcon: /* @__PURE__ */ React31.createElement(import_icons5.SideBottomIcon, { fontSize: "tiny" }),
|
|
1441
1575
|
isLinked,
|
|
1442
1576
|
extendedValues
|
|
1443
1577
|
}
|
|
1444
|
-
))), /* @__PURE__ */
|
|
1578
|
+
))), /* @__PURE__ */ React31.createElement(import_ui24.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(ControlFormLabel, null, isSiteRtl ? (0, import_i18n7.__)("Right", "elementor") : (0, import_i18n7.__)("Left", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui24.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(
|
|
1445
1579
|
Control3,
|
|
1446
1580
|
{
|
|
1447
1581
|
bind: "inline-start",
|
|
1448
|
-
startIcon: isSiteRtl ? /* @__PURE__ */
|
|
1582
|
+
startIcon: isSiteRtl ? /* @__PURE__ */ React31.createElement(import_icons5.SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React31.createElement(import_icons5.SideLeftIcon, { fontSize: "tiny" }),
|
|
1449
1583
|
isLinked,
|
|
1450
1584
|
extendedValues
|
|
1451
1585
|
}
|
|
@@ -1459,17 +1593,17 @@ var Control3 = ({
|
|
|
1459
1593
|
extendedValues
|
|
1460
1594
|
}) => {
|
|
1461
1595
|
if (isLinked) {
|
|
1462
|
-
return /* @__PURE__ */
|
|
1596
|
+
return /* @__PURE__ */ React31.createElement(SizeControl, { startIcon, extendedValues });
|
|
1463
1597
|
}
|
|
1464
|
-
return /* @__PURE__ */
|
|
1598
|
+
return /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React31.createElement(SizeControl, { startIcon, extendedValues }));
|
|
1465
1599
|
};
|
|
1466
1600
|
|
|
1467
1601
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1468
|
-
var
|
|
1469
|
-
var
|
|
1602
|
+
var React32 = __toESM(require("react"));
|
|
1603
|
+
var import_react12 = require("react");
|
|
1470
1604
|
var import_editor_props14 = require("@elementor/editor-props");
|
|
1471
|
-
var
|
|
1472
|
-
var
|
|
1605
|
+
var import_icons6 = require("@elementor/icons");
|
|
1606
|
+
var import_ui25 = require("@elementor/ui");
|
|
1473
1607
|
var import_utils2 = require("@elementor/utils");
|
|
1474
1608
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
1475
1609
|
var import_i18n8 = require("@wordpress/i18n");
|
|
@@ -1499,9 +1633,9 @@ var enqueueFont = (fontFamily, context = "editor") => {
|
|
|
1499
1633
|
// src/controls/font-family-control/font-family-control.tsx
|
|
1500
1634
|
var SIZE2 = "tiny";
|
|
1501
1635
|
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
1502
|
-
const [searchValue, setSearchValue] = (0,
|
|
1636
|
+
const [searchValue, setSearchValue] = (0, import_react12.useState)("");
|
|
1503
1637
|
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(import_editor_props14.stringPropTypeUtil);
|
|
1504
|
-
const popoverState = (0,
|
|
1638
|
+
const popoverState = (0, import_ui25.usePopupState)({ variant: "popover" });
|
|
1505
1639
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1506
1640
|
const handleSearch = (event) => {
|
|
1507
1641
|
setSearchValue(event.target.value);
|
|
@@ -1510,26 +1644,26 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1510
1644
|
setSearchValue("");
|
|
1511
1645
|
popoverState.close();
|
|
1512
1646
|
};
|
|
1513
|
-
return /* @__PURE__ */
|
|
1514
|
-
|
|
1647
|
+
return /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement(ControlActions, null, /* @__PURE__ */ React32.createElement(
|
|
1648
|
+
import_ui25.UnstableTag,
|
|
1515
1649
|
{
|
|
1516
1650
|
variant: "outlined",
|
|
1517
1651
|
label: fontFamily,
|
|
1518
|
-
endIcon: /* @__PURE__ */
|
|
1519
|
-
...(0,
|
|
1652
|
+
endIcon: /* @__PURE__ */ React32.createElement(import_icons6.ChevronDownIcon, { fontSize: "tiny" }),
|
|
1653
|
+
...(0, import_ui25.bindTrigger)(popoverState),
|
|
1520
1654
|
fullWidth: true
|
|
1521
1655
|
}
|
|
1522
|
-
), /* @__PURE__ */
|
|
1523
|
-
|
|
1656
|
+
)), /* @__PURE__ */ React32.createElement(
|
|
1657
|
+
import_ui25.Popover,
|
|
1524
1658
|
{
|
|
1525
1659
|
disablePortal: true,
|
|
1526
1660
|
disableScrollLock: true,
|
|
1527
1661
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1528
|
-
...(0,
|
|
1662
|
+
...(0, import_ui25.bindPopover)(popoverState),
|
|
1529
1663
|
onClose: handleClose
|
|
1530
1664
|
},
|
|
1531
|
-
/* @__PURE__ */
|
|
1532
|
-
|
|
1665
|
+
/* @__PURE__ */ React32.createElement(import_ui25.Stack, null, /* @__PURE__ */ React32.createElement(import_ui25.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React32.createElement(import_icons6.TextIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React32.createElement(import_ui25.Typography, { variant: "subtitle2" }, (0, import_i18n8.__)("Font Family", "elementor")), /* @__PURE__ */ React32.createElement(import_ui25.IconButton, { size: SIZE2, sx: { ml: "auto" }, onClick: handleClose }, /* @__PURE__ */ React32.createElement(import_icons6.XIcon, { fontSize: SIZE2 }))), /* @__PURE__ */ React32.createElement(import_ui25.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React32.createElement(
|
|
1666
|
+
import_ui25.TextField,
|
|
1533
1667
|
{
|
|
1534
1668
|
autoFocus: true,
|
|
1535
1669
|
fullWidth: true,
|
|
@@ -1538,10 +1672,10 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1538
1672
|
placeholder: (0, import_i18n8.__)("Search", "elementor"),
|
|
1539
1673
|
onChange: handleSearch,
|
|
1540
1674
|
InputProps: {
|
|
1541
|
-
startAdornment: /* @__PURE__ */
|
|
1675
|
+
startAdornment: /* @__PURE__ */ React32.createElement(import_ui25.InputAdornment, { position: "start" }, /* @__PURE__ */ React32.createElement(import_icons6.SearchIcon, { fontSize: SIZE2 }))
|
|
1542
1676
|
}
|
|
1543
1677
|
}
|
|
1544
|
-
)), /* @__PURE__ */
|
|
1678
|
+
)), /* @__PURE__ */ React32.createElement(import_ui25.Divider, null), filteredFontFamilies.length > 0 ? /* @__PURE__ */ React32.createElement(
|
|
1545
1679
|
FontList,
|
|
1546
1680
|
{
|
|
1547
1681
|
fontListItems: filteredFontFamilies,
|
|
@@ -1549,8 +1683,8 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1549
1683
|
handleClose,
|
|
1550
1684
|
fontFamily
|
|
1551
1685
|
}
|
|
1552
|
-
) : /* @__PURE__ */
|
|
1553
|
-
|
|
1686
|
+
) : /* @__PURE__ */ React32.createElement(import_ui25.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, /* @__PURE__ */ React32.createElement(import_ui25.Stack, { alignItems: "center", p: 2.5, gap: 1.5, overflow: "hidden" }, /* @__PURE__ */ React32.createElement(import_icons6.TextIcon, { fontSize: "large" }), /* @__PURE__ */ React32.createElement(import_ui25.Box, { sx: { maxWidth: 160, overflow: "hidden" } }, /* @__PURE__ */ React32.createElement(import_ui25.Typography, { align: "center", variant: "subtitle2", color: "text.secondary" }, (0, import_i18n8.__)("Sorry, nothing matched", "elementor")), /* @__PURE__ */ React32.createElement(
|
|
1687
|
+
import_ui25.Typography,
|
|
1554
1688
|
{
|
|
1555
1689
|
variant: "subtitle2",
|
|
1556
1690
|
color: "text.secondary",
|
|
@@ -1560,17 +1694,17 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1560
1694
|
justifyContent: "center"
|
|
1561
1695
|
}
|
|
1562
1696
|
},
|
|
1563
|
-
/* @__PURE__ */
|
|
1564
|
-
/* @__PURE__ */
|
|
1697
|
+
/* @__PURE__ */ React32.createElement("span", null, "\u201C"),
|
|
1698
|
+
/* @__PURE__ */ React32.createElement(
|
|
1565
1699
|
"span",
|
|
1566
1700
|
{
|
|
1567
1701
|
style: { maxWidth: "80%", overflow: "hidden", textOverflow: "ellipsis" }
|
|
1568
1702
|
},
|
|
1569
1703
|
searchValue
|
|
1570
1704
|
),
|
|
1571
|
-
/* @__PURE__ */
|
|
1572
|
-
)), /* @__PURE__ */
|
|
1573
|
-
|
|
1705
|
+
/* @__PURE__ */ React32.createElement("span", null, "\u201D.")
|
|
1706
|
+
)), /* @__PURE__ */ React32.createElement(import_ui25.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n8.__)("Try something else.", "elementor"), /* @__PURE__ */ React32.createElement(
|
|
1707
|
+
import_ui25.Link,
|
|
1574
1708
|
{
|
|
1575
1709
|
color: "secondary",
|
|
1576
1710
|
variant: "caption",
|
|
@@ -1584,7 +1718,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1584
1718
|
var LIST_ITEM_HEIGHT = 36;
|
|
1585
1719
|
var LIST_ITEMS_BUFFER = 6;
|
|
1586
1720
|
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
1587
|
-
const containerRef = (0,
|
|
1721
|
+
const containerRef = (0, import_react12.useRef)(null);
|
|
1588
1722
|
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
1589
1723
|
const debouncedVirtualizeChange = useDebounce(({ getVirtualIndexes }) => {
|
|
1590
1724
|
getVirtualIndexes().forEach((index) => {
|
|
@@ -1601,7 +1735,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1601
1735
|
overscan: LIST_ITEMS_BUFFER,
|
|
1602
1736
|
onChange: debouncedVirtualizeChange
|
|
1603
1737
|
});
|
|
1604
|
-
(0,
|
|
1738
|
+
(0, import_react12.useEffect)(
|
|
1605
1739
|
() => {
|
|
1606
1740
|
virtualizer.scrollToIndex(fontListItems.findIndex((item) => item.value === fontFamily));
|
|
1607
1741
|
},
|
|
@@ -1609,8 +1743,8 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1609
1743
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1610
1744
|
[fontFamily]
|
|
1611
1745
|
);
|
|
1612
|
-
return /* @__PURE__ */
|
|
1613
|
-
|
|
1746
|
+
return /* @__PURE__ */ React32.createElement(
|
|
1747
|
+
import_ui25.Box,
|
|
1614
1748
|
{
|
|
1615
1749
|
ref: containerRef,
|
|
1616
1750
|
sx: {
|
|
@@ -1619,7 +1753,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1619
1753
|
width: 220
|
|
1620
1754
|
}
|
|
1621
1755
|
},
|
|
1622
|
-
/* @__PURE__ */
|
|
1756
|
+
/* @__PURE__ */ React32.createElement(
|
|
1623
1757
|
StyledMenuList,
|
|
1624
1758
|
{
|
|
1625
1759
|
role: "listbox",
|
|
@@ -1635,8 +1769,8 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1635
1769
|
const isSelected = selectedItem?.value === item.value;
|
|
1636
1770
|
const tabIndexFallback = !selectedItem ? 0 : -1;
|
|
1637
1771
|
if (item.type === "category") {
|
|
1638
|
-
return /* @__PURE__ */
|
|
1639
|
-
|
|
1772
|
+
return /* @__PURE__ */ React32.createElement(
|
|
1773
|
+
import_ui25.MenuSubheader,
|
|
1640
1774
|
{
|
|
1641
1775
|
key: virtualRow.key,
|
|
1642
1776
|
style: {
|
|
@@ -1646,7 +1780,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1646
1780
|
item.value
|
|
1647
1781
|
);
|
|
1648
1782
|
}
|
|
1649
|
-
return /* @__PURE__ */
|
|
1783
|
+
return /* @__PURE__ */ React32.createElement(
|
|
1650
1784
|
"li",
|
|
1651
1785
|
{
|
|
1652
1786
|
key: virtualRow.key,
|
|
@@ -1682,7 +1816,7 @@ var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
|
1682
1816
|
)
|
|
1683
1817
|
);
|
|
1684
1818
|
};
|
|
1685
|
-
var StyledMenuList = (0,
|
|
1819
|
+
var StyledMenuList = (0, import_ui25.styled)(import_ui25.MenuList)(({ theme }) => ({
|
|
1686
1820
|
"& > li": {
|
|
1687
1821
|
height: LIST_ITEM_HEIGHT,
|
|
1688
1822
|
position: "absolute",
|
|
@@ -1709,20 +1843,20 @@ var StyledMenuList = (0, import_ui24.styled)(import_ui24.MenuList)(({ theme }) =
|
|
|
1709
1843
|
position: "relative"
|
|
1710
1844
|
}));
|
|
1711
1845
|
var useDebounce = (fn, delay) => {
|
|
1712
|
-
const [debouncedFn] = (0,
|
|
1713
|
-
(0,
|
|
1846
|
+
const [debouncedFn] = (0, import_react12.useState)(() => (0, import_utils2.debounce)(fn, delay));
|
|
1847
|
+
(0, import_react12.useEffect)(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
1714
1848
|
return debouncedFn;
|
|
1715
1849
|
};
|
|
1716
1850
|
|
|
1717
1851
|
// src/controls/url-control.tsx
|
|
1718
|
-
var
|
|
1852
|
+
var React33 = __toESM(require("react"));
|
|
1719
1853
|
var import_editor_props15 = require("@elementor/editor-props");
|
|
1720
|
-
var
|
|
1854
|
+
var import_ui26 = require("@elementor/ui");
|
|
1721
1855
|
var UrlControl = createControl(({ placeholder }) => {
|
|
1722
1856
|
const { value, setValue } = useBoundProp(import_editor_props15.urlPropTypeUtil);
|
|
1723
1857
|
const handleChange = (event) => setValue(event.target.value);
|
|
1724
|
-
return /* @__PURE__ */
|
|
1725
|
-
|
|
1858
|
+
return /* @__PURE__ */ React33.createElement(ControlActions, null, /* @__PURE__ */ React33.createElement(
|
|
1859
|
+
import_ui26.TextField,
|
|
1726
1860
|
{
|
|
1727
1861
|
size: "tiny",
|
|
1728
1862
|
fullWidth: true,
|
|
@@ -1734,24 +1868,24 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1734
1868
|
});
|
|
1735
1869
|
|
|
1736
1870
|
// src/controls/link-control.tsx
|
|
1737
|
-
var
|
|
1738
|
-
var
|
|
1871
|
+
var React35 = __toESM(require("react"));
|
|
1872
|
+
var import_react14 = require("react");
|
|
1739
1873
|
var import_editor_elements = require("@elementor/editor-elements");
|
|
1740
1874
|
var import_editor_props16 = require("@elementor/editor-props");
|
|
1741
1875
|
var import_editor_ui3 = require("@elementor/editor-ui");
|
|
1742
1876
|
var import_http_client2 = require("@elementor/http-client");
|
|
1743
|
-
var
|
|
1877
|
+
var import_icons8 = require("@elementor/icons");
|
|
1744
1878
|
var import_session = require("@elementor/session");
|
|
1745
|
-
var
|
|
1879
|
+
var import_ui28 = require("@elementor/ui");
|
|
1746
1880
|
var import_utils3 = require("@elementor/utils");
|
|
1747
1881
|
var import_i18n9 = require("@wordpress/i18n");
|
|
1748
1882
|
|
|
1749
1883
|
// src/components/autocomplete.tsx
|
|
1750
|
-
var
|
|
1751
|
-
var
|
|
1752
|
-
var
|
|
1753
|
-
var
|
|
1754
|
-
var Autocomplete = (0,
|
|
1884
|
+
var React34 = __toESM(require("react"));
|
|
1885
|
+
var import_react13 = require("react");
|
|
1886
|
+
var import_icons7 = require("@elementor/icons");
|
|
1887
|
+
var import_ui27 = require("@elementor/ui");
|
|
1888
|
+
var Autocomplete = (0, import_react13.forwardRef)((props, ref) => {
|
|
1755
1889
|
const {
|
|
1756
1890
|
options,
|
|
1757
1891
|
onOptionChange,
|
|
@@ -1767,8 +1901,8 @@ var Autocomplete = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
1767
1901
|
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
1768
1902
|
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
1769
1903
|
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
1770
|
-
return /* @__PURE__ */
|
|
1771
|
-
|
|
1904
|
+
return /* @__PURE__ */ React34.createElement(
|
|
1905
|
+
import_ui27.Autocomplete,
|
|
1772
1906
|
{
|
|
1773
1907
|
...restProps,
|
|
1774
1908
|
ref,
|
|
@@ -1785,8 +1919,8 @@ var Autocomplete = (0, import_react12.forwardRef)((props, ref) => {
|
|
|
1785
1919
|
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
1786
1920
|
isOptionEqualToValue,
|
|
1787
1921
|
filterOptions: () => optionKeys,
|
|
1788
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */
|
|
1789
|
-
renderInput: (params) => /* @__PURE__ */
|
|
1922
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React34.createElement(import_ui27.Box, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
1923
|
+
renderInput: (params) => /* @__PURE__ */ React34.createElement(
|
|
1790
1924
|
TextInput,
|
|
1791
1925
|
{
|
|
1792
1926
|
params,
|
|
@@ -1809,8 +1943,8 @@ var TextInput = ({
|
|
|
1809
1943
|
const onChange = (event) => {
|
|
1810
1944
|
handleChange(event.target.value);
|
|
1811
1945
|
};
|
|
1812
|
-
return /* @__PURE__ */
|
|
1813
|
-
|
|
1946
|
+
return /* @__PURE__ */ React34.createElement(
|
|
1947
|
+
import_ui27.TextField,
|
|
1814
1948
|
{
|
|
1815
1949
|
...params,
|
|
1816
1950
|
placeholder,
|
|
@@ -1822,7 +1956,7 @@ var TextInput = ({
|
|
|
1822
1956
|
},
|
|
1823
1957
|
InputProps: {
|
|
1824
1958
|
...params.InputProps,
|
|
1825
|
-
endAdornment: /* @__PURE__ */
|
|
1959
|
+
endAdornment: /* @__PURE__ */ React34.createElement(ClearButton, { params, allowClear, handleChange })
|
|
1826
1960
|
}
|
|
1827
1961
|
}
|
|
1828
1962
|
);
|
|
@@ -1831,7 +1965,7 @@ var ClearButton = ({
|
|
|
1831
1965
|
allowClear,
|
|
1832
1966
|
handleChange,
|
|
1833
1967
|
params
|
|
1834
|
-
}) => /* @__PURE__ */
|
|
1968
|
+
}) => /* @__PURE__ */ React34.createElement(import_ui27.InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React34.createElement(import_ui27.IconButton, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React34.createElement(import_icons7.XIcon, { fontSize: params.size })));
|
|
1835
1969
|
function findMatchingOption(options, optionId = null) {
|
|
1836
1970
|
const formattedOption = (optionId || "").toString();
|
|
1837
1971
|
return options.find(({ id }) => formattedOption === id.toString());
|
|
@@ -1861,7 +1995,7 @@ var learnMoreButton = {
|
|
|
1861
1995
|
var LinkControl = createControl((props) => {
|
|
1862
1996
|
const { value, path, setValue, ...propContext } = useBoundProp(import_editor_props16.linkPropTypeUtil);
|
|
1863
1997
|
const [linkSessionValue, setLinkSessionValue] = (0, import_session.useSessionStorage)(path.join("/"));
|
|
1864
|
-
const [isActive, setIsActive] = (0,
|
|
1998
|
+
const [isActive, setIsActive] = (0, import_react14.useState)(!!value);
|
|
1865
1999
|
const {
|
|
1866
2000
|
allowCustomValues,
|
|
1867
2001
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
@@ -1869,8 +2003,8 @@ var LinkControl = createControl((props) => {
|
|
|
1869
2003
|
minInputLength = 2,
|
|
1870
2004
|
context: { elementId }
|
|
1871
2005
|
} = props || {};
|
|
1872
|
-
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0,
|
|
1873
|
-
const [options, setOptions] = (0,
|
|
2006
|
+
const [linkInLinkRestriction, setLinkInLinkRestriction] = (0, import_react14.useState)((0, import_editor_elements.getLinkInLinkRestriction)(elementId));
|
|
2007
|
+
const [options, setOptions] = (0, import_react14.useState)(
|
|
1874
2008
|
generateFirstLoadedOption(value)
|
|
1875
2009
|
);
|
|
1876
2010
|
const shouldDisableAddingLink = !isActive && linkInLinkRestriction.shouldRestrict;
|
|
@@ -1921,7 +2055,7 @@ var LinkControl = createControl((props) => {
|
|
|
1921
2055
|
}
|
|
1922
2056
|
debounceFetch({ ...requestParams, term: newValue });
|
|
1923
2057
|
};
|
|
1924
|
-
const debounceFetch = (0,
|
|
2058
|
+
const debounceFetch = (0, import_react14.useMemo)(
|
|
1925
2059
|
() => (0, import_utils3.debounce)(
|
|
1926
2060
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
1927
2061
|
setOptions(formatOptions(newOptions));
|
|
@@ -1930,8 +2064,8 @@ var LinkControl = createControl((props) => {
|
|
|
1930
2064
|
),
|
|
1931
2065
|
[endpoint]
|
|
1932
2066
|
);
|
|
1933
|
-
return /* @__PURE__ */
|
|
1934
|
-
|
|
2067
|
+
return /* @__PURE__ */ React35.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React35.createElement(import_ui28.Stack, { gap: 1.5 }, /* @__PURE__ */ React35.createElement(
|
|
2068
|
+
import_ui28.Stack,
|
|
1935
2069
|
{
|
|
1936
2070
|
direction: "row",
|
|
1937
2071
|
sx: {
|
|
@@ -1940,8 +2074,8 @@ var LinkControl = createControl((props) => {
|
|
|
1940
2074
|
marginInlineEnd: -0.75
|
|
1941
2075
|
}
|
|
1942
2076
|
},
|
|
1943
|
-
/* @__PURE__ */
|
|
1944
|
-
/* @__PURE__ */
|
|
2077
|
+
/* @__PURE__ */ React35.createElement(ControlFormLabel, null, (0, import_i18n9.__)("Link", "elementor")),
|
|
2078
|
+
/* @__PURE__ */ React35.createElement(ConditionalInfoTip, { isVisible: !isActive, linkInLinkRestriction }, /* @__PURE__ */ React35.createElement(
|
|
1945
2079
|
ToggleIconControl,
|
|
1946
2080
|
{
|
|
1947
2081
|
disabled: shouldDisableAddingLink,
|
|
@@ -1950,7 +2084,7 @@ var LinkControl = createControl((props) => {
|
|
|
1950
2084
|
label: (0, import_i18n9.__)("Toggle link", "elementor")
|
|
1951
2085
|
}
|
|
1952
2086
|
))
|
|
1953
|
-
), /* @__PURE__ */
|
|
2087
|
+
), /* @__PURE__ */ React35.createElement(import_ui28.Collapse, { in: isActive, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React35.createElement(import_ui28.Stack, { gap: 1.5 }, /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React35.createElement(ControlActions, null, /* @__PURE__ */ React35.createElement(
|
|
1954
2088
|
Autocomplete,
|
|
1955
2089
|
{
|
|
1956
2090
|
options,
|
|
@@ -1961,10 +2095,10 @@ var LinkControl = createControl((props) => {
|
|
|
1961
2095
|
onTextChange,
|
|
1962
2096
|
minInputLength
|
|
1963
2097
|
}
|
|
1964
|
-
))), /* @__PURE__ */
|
|
2098
|
+
))), /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React35.createElement(SwitchControl, { disabled: !value }))))));
|
|
1965
2099
|
});
|
|
1966
2100
|
var ToggleIconControl = ({ disabled, active, onIconClick, label }) => {
|
|
1967
|
-
return /* @__PURE__ */
|
|
2101
|
+
return /* @__PURE__ */ React35.createElement(import_ui28.IconButton, { size: SIZE3, onClick: onIconClick, "aria-label": label, disabled }, active ? /* @__PURE__ */ React35.createElement(import_icons8.MinusIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React35.createElement(import_icons8.PlusIcon, { fontSize: SIZE3 }));
|
|
1968
2102
|
};
|
|
1969
2103
|
var SwitchControl = ({ disabled }) => {
|
|
1970
2104
|
const { value = false, setValue } = useBoundProp(import_editor_props16.booleanPropTypeUtil);
|
|
@@ -1976,7 +2110,7 @@ var SwitchControl = ({ disabled }) => {
|
|
|
1976
2110
|
opacity: 0
|
|
1977
2111
|
}
|
|
1978
2112
|
} : {};
|
|
1979
|
-
return /* @__PURE__ */
|
|
2113
|
+
return /* @__PURE__ */ React35.createElement(import_ui28.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true }, /* @__PURE__ */ React35.createElement(ControlFormLabel, null, (0, import_i18n9.__)("Open in a new tab", "elementor"))), /* @__PURE__ */ React35.createElement(import_ui28.Grid, { item: true, sx: { marginInlineEnd: -1 } }, /* @__PURE__ */ React35.createElement(import_ui28.Switch, { checked: value, onClick, disabled, inputProps })));
|
|
1980
2114
|
};
|
|
1981
2115
|
async function fetchOptions(ajaxUrl, params) {
|
|
1982
2116
|
if (!params || !ajaxUrl) {
|
|
@@ -2013,15 +2147,15 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2013
2147
|
(0, import_editor_elements.selectElement)(elementId);
|
|
2014
2148
|
}
|
|
2015
2149
|
};
|
|
2016
|
-
return shouldRestrict && isVisible ? /* @__PURE__ */
|
|
2017
|
-
|
|
2150
|
+
return shouldRestrict && isVisible ? /* @__PURE__ */ React35.createElement(
|
|
2151
|
+
import_ui28.Infotip,
|
|
2018
2152
|
{
|
|
2019
2153
|
placement: "right",
|
|
2020
|
-
content: /* @__PURE__ */
|
|
2154
|
+
content: /* @__PURE__ */ React35.createElement(
|
|
2021
2155
|
import_editor_ui3.InfoTipCard,
|
|
2022
2156
|
{
|
|
2023
2157
|
content: INFOTIP_CONTENT[reason],
|
|
2024
|
-
svgIcon: /* @__PURE__ */
|
|
2158
|
+
svgIcon: /* @__PURE__ */ React35.createElement(import_icons8.AlertTriangleIcon, null),
|
|
2025
2159
|
learnMoreButton,
|
|
2026
2160
|
ctaButton: {
|
|
2027
2161
|
label: (0, import_i18n9.__)("Take me there", "elementor"),
|
|
@@ -2030,19 +2164,19 @@ var ConditionalInfoTip = ({ linkInLinkRestriction, isVisible, children }) => {
|
|
|
2030
2164
|
}
|
|
2031
2165
|
)
|
|
2032
2166
|
},
|
|
2033
|
-
/* @__PURE__ */
|
|
2034
|
-
) : /* @__PURE__ */
|
|
2167
|
+
/* @__PURE__ */ React35.createElement(import_ui28.Box, null, children)
|
|
2168
|
+
) : /* @__PURE__ */ React35.createElement(React35.Fragment, null, children);
|
|
2035
2169
|
};
|
|
2036
2170
|
var INFOTIP_CONTENT = {
|
|
2037
|
-
descendant: /* @__PURE__ */
|
|
2038
|
-
ancestor: /* @__PURE__ */
|
|
2171
|
+
descendant: /* @__PURE__ */ React35.createElement(React35.Fragment, null, (0, import_i18n9.__)("To add a link to this container,", "elementor"), /* @__PURE__ */ React35.createElement("br", null), (0, import_i18n9.__)("first remove the link from the elements inside of it.", "elementor")),
|
|
2172
|
+
ancestor: /* @__PURE__ */ React35.createElement(React35.Fragment, null, (0, import_i18n9.__)("To add a link to this element,", "elementor"), /* @__PURE__ */ React35.createElement("br", null), (0, import_i18n9.__)("first remove the link from its parent container.", "elementor"))
|
|
2039
2173
|
};
|
|
2040
2174
|
|
|
2041
2175
|
// src/controls/gap-control.tsx
|
|
2042
|
-
var
|
|
2176
|
+
var React36 = __toESM(require("react"));
|
|
2043
2177
|
var import_editor_props17 = require("@elementor/editor-props");
|
|
2044
|
-
var
|
|
2045
|
-
var
|
|
2178
|
+
var import_icons9 = require("@elementor/icons");
|
|
2179
|
+
var import_ui29 = require("@elementor/ui");
|
|
2046
2180
|
var import_i18n10 = require("@wordpress/i18n");
|
|
2047
2181
|
var GapControl = createControl(({ label }) => {
|
|
2048
2182
|
const {
|
|
@@ -2064,11 +2198,11 @@ var GapControl = createControl(({ label }) => {
|
|
|
2064
2198
|
});
|
|
2065
2199
|
};
|
|
2066
2200
|
const tooltipLabel = label.toLowerCase();
|
|
2067
|
-
const LinkedIcon = isLinked ?
|
|
2201
|
+
const LinkedIcon = isLinked ? import_icons9.LinkIcon : import_icons9.DetachIcon;
|
|
2068
2202
|
const linkedLabel = (0, import_i18n10.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
2069
2203
|
const unlinkedLabel = (0, import_i18n10.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
2070
|
-
return /* @__PURE__ */
|
|
2071
|
-
|
|
2204
|
+
return /* @__PURE__ */ React36.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React36.createElement(import_ui29.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(ControlLabel, null, label), /* @__PURE__ */ React36.createElement(import_ui29.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React36.createElement(
|
|
2205
|
+
import_ui29.ToggleButton,
|
|
2072
2206
|
{
|
|
2073
2207
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
2074
2208
|
size: "tiny",
|
|
@@ -2077,30 +2211,30 @@ var GapControl = createControl(({ label }) => {
|
|
|
2077
2211
|
sx: { marginLeft: "auto" },
|
|
2078
2212
|
onChange: onLinkToggle
|
|
2079
2213
|
},
|
|
2080
|
-
/* @__PURE__ */
|
|
2081
|
-
))), /* @__PURE__ */
|
|
2214
|
+
/* @__PURE__ */ React36.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
2215
|
+
))), /* @__PURE__ */ React36.createElement(import_ui29.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React36.createElement(import_ui29.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React36.createElement(import_ui29.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(ControlFormLabel, null, (0, import_i18n10.__)("Column", "elementor"))), /* @__PURE__ */ React36.createElement(import_ui29.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(Control4, { bind: "column", isLinked }))), /* @__PURE__ */ React36.createElement(import_ui29.Grid, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React36.createElement(import_ui29.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(ControlFormLabel, null, (0, import_i18n10.__)("Row", "elementor"))), /* @__PURE__ */ React36.createElement(import_ui29.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(Control4, { bind: "row", isLinked })))));
|
|
2082
2216
|
});
|
|
2083
2217
|
var Control4 = ({ bind, isLinked }) => {
|
|
2084
2218
|
if (isLinked) {
|
|
2085
|
-
return /* @__PURE__ */
|
|
2219
|
+
return /* @__PURE__ */ React36.createElement(SizeControl, null);
|
|
2086
2220
|
}
|
|
2087
|
-
return /* @__PURE__ */
|
|
2221
|
+
return /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React36.createElement(SizeControl, null));
|
|
2088
2222
|
};
|
|
2089
2223
|
|
|
2090
2224
|
// src/controls/svg-media-control.tsx
|
|
2091
|
-
var
|
|
2092
|
-
var
|
|
2225
|
+
var React38 = __toESM(require("react"));
|
|
2226
|
+
var import_react16 = require("react");
|
|
2093
2227
|
var import_editor_props18 = require("@elementor/editor-props");
|
|
2094
|
-
var
|
|
2095
|
-
var
|
|
2228
|
+
var import_icons10 = require("@elementor/icons");
|
|
2229
|
+
var import_ui31 = require("@elementor/ui");
|
|
2096
2230
|
var import_wp_media2 = require("@elementor/wp-media");
|
|
2097
2231
|
var import_i18n12 = require("@wordpress/i18n");
|
|
2098
2232
|
|
|
2099
2233
|
// src/components/enable-unfiltered-modal.tsx
|
|
2100
|
-
var
|
|
2101
|
-
var
|
|
2234
|
+
var React37 = __toESM(require("react"));
|
|
2235
|
+
var import_react15 = require("react");
|
|
2102
2236
|
var import_editor_current_user = require("@elementor/editor-current-user");
|
|
2103
|
-
var
|
|
2237
|
+
var import_ui30 = require("@elementor/ui");
|
|
2104
2238
|
var import_i18n11 = require("@wordpress/i18n");
|
|
2105
2239
|
var ADMIN_TITLE_TEXT = (0, import_i18n11.__)("Enable Unfiltered Uploads", "elementor");
|
|
2106
2240
|
var ADMIN_CONTENT_TEXT = (0, import_i18n11.__)(
|
|
@@ -2121,7 +2255,7 @@ var WAIT_FOR_CLOSE_TIMEOUT_MS = 300;
|
|
|
2121
2255
|
var EnableUnfilteredModal = (props) => {
|
|
2122
2256
|
const { mutateAsync, isPending } = useUpdateUnfilteredFilesUpload();
|
|
2123
2257
|
const { canUser } = (0, import_editor_current_user.useCurrentUserCapabilities)();
|
|
2124
|
-
const [isError, setIsError] = (0,
|
|
2258
|
+
const [isError, setIsError] = (0, import_react15.useState)(false);
|
|
2125
2259
|
const canManageOptions = canUser("manage_options");
|
|
2126
2260
|
const onClose = (enabled) => {
|
|
2127
2261
|
props.onClose(enabled);
|
|
@@ -2140,10 +2274,10 @@ var EnableUnfilteredModal = (props) => {
|
|
|
2140
2274
|
}
|
|
2141
2275
|
};
|
|
2142
2276
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
2143
|
-
return canManageOptions ? /* @__PURE__ */
|
|
2277
|
+
return canManageOptions ? /* @__PURE__ */ React37.createElement(AdminDialog, { ...dialogProps }) : /* @__PURE__ */ React37.createElement(NonAdminDialog, { ...dialogProps });
|
|
2144
2278
|
};
|
|
2145
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
2146
|
-
|
|
2279
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React37.createElement(import_ui30.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React37.createElement(import_ui30.DialogHeader, { logo: false }, /* @__PURE__ */ React37.createElement(import_ui30.DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React37.createElement(import_ui30.Divider, null), /* @__PURE__ */ React37.createElement(import_ui30.DialogContent, null, /* @__PURE__ */ React37.createElement(import_ui30.DialogContentText, null, isError ? /* @__PURE__ */ React37.createElement(React37.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ React37.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React37.createElement(import_ui30.DialogActions, null, /* @__PURE__ */ React37.createElement(import_ui30.Button, { size: "medium", color: "secondary", onClick: () => onClose(false) }, (0, import_i18n11.__)("Cancel", "elementor")), /* @__PURE__ */ React37.createElement(
|
|
2280
|
+
import_ui30.Button,
|
|
2147
2281
|
{
|
|
2148
2282
|
size: "medium",
|
|
2149
2283
|
onClick: () => handleEnable(),
|
|
@@ -2151,16 +2285,16 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
2151
2285
|
color: "primary",
|
|
2152
2286
|
disabled: isPending
|
|
2153
2287
|
},
|
|
2154
|
-
isPending ? /* @__PURE__ */
|
|
2288
|
+
isPending ? /* @__PURE__ */ React37.createElement(import_ui30.CircularProgress, { size: 24 }) : (0, import_i18n11.__)("Enable", "elementor")
|
|
2155
2289
|
)));
|
|
2156
|
-
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */
|
|
2290
|
+
var NonAdminDialog = ({ open, onClose }) => /* @__PURE__ */ React37.createElement(import_ui30.Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React37.createElement(import_ui30.DialogHeader, { logo: false }, /* @__PURE__ */ React37.createElement(import_ui30.DialogTitle, null, NON_ADMIN_TITLE_TEXT)), /* @__PURE__ */ React37.createElement(import_ui30.Divider, null), /* @__PURE__ */ React37.createElement(import_ui30.DialogContent, null, /* @__PURE__ */ React37.createElement(import_ui30.DialogContentText, null, NON_ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React37.createElement(import_ui30.DialogActions, null, /* @__PURE__ */ React37.createElement(import_ui30.Button, { size: "medium", onClick: () => onClose(false), variant: "contained", color: "primary" }, (0, import_i18n11.__)("Got it", "elementor"))));
|
|
2157
2291
|
|
|
2158
2292
|
// src/controls/svg-media-control.tsx
|
|
2159
2293
|
var TILE_SIZE = 8;
|
|
2160
2294
|
var TILE_WHITE = "transparent";
|
|
2161
2295
|
var TILE_BLACK = "#c1c1c1";
|
|
2162
2296
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
2163
|
-
var StyledCard = (0,
|
|
2297
|
+
var StyledCard = (0, import_ui31.styled)(import_ui31.Card)`
|
|
2164
2298
|
background-color: white;
|
|
2165
2299
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
2166
2300
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -2169,7 +2303,7 @@ var StyledCard = (0, import_ui30.styled)(import_ui30.Card)`
|
|
|
2169
2303
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
2170
2304
|
border: none;
|
|
2171
2305
|
`;
|
|
2172
|
-
var StyledCardMediaContainer = (0,
|
|
2306
|
+
var StyledCardMediaContainer = (0, import_ui31.styled)(import_ui31.Stack)`
|
|
2173
2307
|
position: relative;
|
|
2174
2308
|
height: 140px;
|
|
2175
2309
|
object-fit: contain;
|
|
@@ -2186,7 +2320,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
2186
2320
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(id?.value || null);
|
|
2187
2321
|
const src = attachment?.url ?? url?.value ?? null;
|
|
2188
2322
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
2189
|
-
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0,
|
|
2323
|
+
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = (0, import_react16.useState)(false);
|
|
2190
2324
|
const { open } = (0, import_wp_media2.useWpMediaFrame)({
|
|
2191
2325
|
mediaTypes: ["svg"],
|
|
2192
2326
|
multiple: false,
|
|
@@ -2214,16 +2348,16 @@ var SvgMediaControl = createControl(() => {
|
|
|
2214
2348
|
open(openOptions);
|
|
2215
2349
|
}
|
|
2216
2350
|
};
|
|
2217
|
-
return /* @__PURE__ */
|
|
2218
|
-
|
|
2351
|
+
return /* @__PURE__ */ React38.createElement(import_ui31.Stack, { gap: 1 }, /* @__PURE__ */ React38.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: onCloseUnfilteredModal }), /* @__PURE__ */ React38.createElement(ControlFormLabel, null, " ", (0, import_i18n12.__)("SVG", "elementor"), " "), /* @__PURE__ */ React38.createElement(ControlActions, null, /* @__PURE__ */ React38.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React38.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React38.createElement(import_ui31.CircularProgress, { role: "progressbar" }) : /* @__PURE__ */ React38.createElement(
|
|
2352
|
+
import_ui31.CardMedia,
|
|
2219
2353
|
{
|
|
2220
2354
|
component: "img",
|
|
2221
2355
|
image: src,
|
|
2222
2356
|
alt: (0, import_i18n12.__)("Preview SVG", "elementor"),
|
|
2223
2357
|
sx: { maxHeight: "140px", width: "50px" }
|
|
2224
2358
|
}
|
|
2225
|
-
)), /* @__PURE__ */
|
|
2226
|
-
|
|
2359
|
+
)), /* @__PURE__ */ React38.createElement(
|
|
2360
|
+
import_ui31.CardOverlay,
|
|
2227
2361
|
{
|
|
2228
2362
|
sx: {
|
|
2229
2363
|
"&:hover": {
|
|
@@ -2231,8 +2365,8 @@ var SvgMediaControl = createControl(() => {
|
|
|
2231
2365
|
}
|
|
2232
2366
|
}
|
|
2233
2367
|
},
|
|
2234
|
-
/* @__PURE__ */
|
|
2235
|
-
|
|
2368
|
+
/* @__PURE__ */ React38.createElement(import_ui31.Stack, { gap: 1 }, /* @__PURE__ */ React38.createElement(
|
|
2369
|
+
import_ui31.Button,
|
|
2236
2370
|
{
|
|
2237
2371
|
size: "tiny",
|
|
2238
2372
|
color: "inherit",
|
|
@@ -2240,13 +2374,13 @@ var SvgMediaControl = createControl(() => {
|
|
|
2240
2374
|
onClick: () => handleClick(MODE_BROWSE)
|
|
2241
2375
|
},
|
|
2242
2376
|
(0, import_i18n12.__)("Select SVG", "elementor")
|
|
2243
|
-
), /* @__PURE__ */
|
|
2244
|
-
|
|
2377
|
+
), /* @__PURE__ */ React38.createElement(
|
|
2378
|
+
import_ui31.Button,
|
|
2245
2379
|
{
|
|
2246
2380
|
size: "tiny",
|
|
2247
2381
|
variant: "text",
|
|
2248
2382
|
color: "inherit",
|
|
2249
|
-
startIcon: /* @__PURE__ */
|
|
2383
|
+
startIcon: /* @__PURE__ */ React38.createElement(import_icons10.UploadIcon, null),
|
|
2250
2384
|
onClick: () => handleClick(MODE_UPLOAD)
|
|
2251
2385
|
},
|
|
2252
2386
|
(0, import_i18n12.__)("Upload", "elementor")
|
|
@@ -2255,15 +2389,15 @@ var SvgMediaControl = createControl(() => {
|
|
|
2255
2389
|
});
|
|
2256
2390
|
|
|
2257
2391
|
// src/controls/background-control/background-control.tsx
|
|
2258
|
-
var
|
|
2392
|
+
var React45 = __toESM(require("react"));
|
|
2259
2393
|
var import_editor_props24 = require("@elementor/editor-props");
|
|
2260
|
-
var
|
|
2394
|
+
var import_ui39 = require("@elementor/ui");
|
|
2261
2395
|
var import_i18n18 = require("@wordpress/i18n");
|
|
2262
2396
|
|
|
2263
2397
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
2264
|
-
var
|
|
2398
|
+
var React44 = __toESM(require("react"));
|
|
2265
2399
|
var import_editor_props23 = require("@elementor/editor-props");
|
|
2266
|
-
var
|
|
2400
|
+
var import_ui38 = require("@elementor/ui");
|
|
2267
2401
|
var import_wp_media3 = require("@elementor/wp-media");
|
|
2268
2402
|
var import_i18n17 = require("@wordpress/i18n");
|
|
2269
2403
|
|
|
@@ -2272,9 +2406,9 @@ var import_env = require("@elementor/env");
|
|
|
2272
2406
|
var { env } = (0, import_env.parseEnv)("@elementor/editor-controls");
|
|
2273
2407
|
|
|
2274
2408
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
2275
|
-
var
|
|
2409
|
+
var React39 = __toESM(require("react"));
|
|
2276
2410
|
var import_editor_props19 = require("@elementor/editor-props");
|
|
2277
|
-
var
|
|
2411
|
+
var import_ui32 = require("@elementor/ui");
|
|
2278
2412
|
var BackgroundGradientColorControl = createControl(() => {
|
|
2279
2413
|
const { value, setValue } = useBoundProp(import_editor_props19.backgroundGradientOverlayPropTypeUtil);
|
|
2280
2414
|
const handleChange = (newValue) => {
|
|
@@ -2312,8 +2446,8 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
2312
2446
|
positions: positions?.value.split(" ")
|
|
2313
2447
|
};
|
|
2314
2448
|
};
|
|
2315
|
-
return /* @__PURE__ */
|
|
2316
|
-
|
|
2449
|
+
return /* @__PURE__ */ React39.createElement(ControlActions, null, /* @__PURE__ */ React39.createElement(
|
|
2450
|
+
import_ui32.UnstableGradientBox,
|
|
2317
2451
|
{
|
|
2318
2452
|
sx: { width: "auto", padding: 1.5 },
|
|
2319
2453
|
value: normalizeValue(),
|
|
@@ -2337,34 +2471,34 @@ var initialBackgroundGradientOverlay = import_editor_props19.backgroundGradientO
|
|
|
2337
2471
|
});
|
|
2338
2472
|
|
|
2339
2473
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
2340
|
-
var
|
|
2341
|
-
var
|
|
2342
|
-
var
|
|
2474
|
+
var React40 = __toESM(require("react"));
|
|
2475
|
+
var import_icons11 = require("@elementor/icons");
|
|
2476
|
+
var import_ui33 = require("@elementor/ui");
|
|
2343
2477
|
var import_i18n13 = require("@wordpress/i18n");
|
|
2344
2478
|
var attachmentControlOptions = [
|
|
2345
2479
|
{
|
|
2346
2480
|
value: "fixed",
|
|
2347
2481
|
label: (0, import_i18n13.__)("Fixed", "elementor"),
|
|
2348
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2482
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(import_icons11.PinIcon, { fontSize: size }),
|
|
2349
2483
|
showTooltip: true
|
|
2350
2484
|
},
|
|
2351
2485
|
{
|
|
2352
2486
|
value: "scroll",
|
|
2353
2487
|
label: (0, import_i18n13.__)("Scroll", "elementor"),
|
|
2354
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2488
|
+
renderContent: ({ size }) => /* @__PURE__ */ React40.createElement(import_icons11.PinnedOffIcon, { fontSize: size }),
|
|
2355
2489
|
showTooltip: true
|
|
2356
2490
|
}
|
|
2357
2491
|
];
|
|
2358
2492
|
var BackgroundImageOverlayAttachment = () => {
|
|
2359
|
-
return /* @__PURE__ */
|
|
2493
|
+
return /* @__PURE__ */ React40.createElement(PopoverGridContainer, null, /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React40.createElement(ControlFormLabel, null, (0, import_i18n13.__)("Attachment", "elementor"))), /* @__PURE__ */ React40.createElement(import_ui33.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React40.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
2360
2494
|
};
|
|
2361
2495
|
|
|
2362
2496
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
2363
|
-
var
|
|
2497
|
+
var React41 = __toESM(require("react"));
|
|
2364
2498
|
var import_editor_props20 = require("@elementor/editor-props");
|
|
2365
2499
|
var import_editor_ui4 = require("@elementor/editor-ui");
|
|
2366
|
-
var
|
|
2367
|
-
var
|
|
2500
|
+
var import_icons12 = require("@elementor/icons");
|
|
2501
|
+
var import_ui34 = require("@elementor/ui");
|
|
2368
2502
|
var import_i18n14 = require("@wordpress/i18n");
|
|
2369
2503
|
var backgroundPositionOptions = [
|
|
2370
2504
|
{ label: (0, import_i18n14.__)("Center center", "elementor"), value: "center center" },
|
|
@@ -2390,82 +2524,82 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
2390
2524
|
stringPropContext.setValue(value);
|
|
2391
2525
|
}
|
|
2392
2526
|
};
|
|
2393
|
-
return /* @__PURE__ */
|
|
2394
|
-
|
|
2527
|
+
return /* @__PURE__ */ React41.createElement(import_ui34.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(PopoverGridContainer, null, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(ControlFormLabel, null, (0, import_i18n14.__)("Position", "elementor"))), /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React41.createElement(
|
|
2528
|
+
import_ui34.Select,
|
|
2395
2529
|
{
|
|
2396
2530
|
size: "tiny",
|
|
2397
2531
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? "",
|
|
2398
2532
|
onChange: handlePositionChange,
|
|
2399
2533
|
fullWidth: true
|
|
2400
2534
|
},
|
|
2401
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
2402
|
-
)))), isCustom ? /* @__PURE__ */
|
|
2535
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React41.createElement(import_editor_ui4.MenuListItem, { key: value, value: value ?? "" }, label))
|
|
2536
|
+
)))), isCustom ? /* @__PURE__ */ React41.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React41.createElement(SizeControl, { startIcon: /* @__PURE__ */ React41.createElement(import_icons12.LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React41.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React41.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React41.createElement(SizeControl, { startIcon: /* @__PURE__ */ React41.createElement(import_icons12.LetterYIcon, { fontSize: "tiny" }) })))))) : null);
|
|
2403
2537
|
};
|
|
2404
2538
|
|
|
2405
2539
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
2406
|
-
var
|
|
2407
|
-
var
|
|
2408
|
-
var
|
|
2540
|
+
var React42 = __toESM(require("react"));
|
|
2541
|
+
var import_icons13 = require("@elementor/icons");
|
|
2542
|
+
var import_ui35 = require("@elementor/ui");
|
|
2409
2543
|
var import_i18n15 = require("@wordpress/i18n");
|
|
2410
2544
|
var repeatControlOptions = [
|
|
2411
2545
|
{
|
|
2412
2546
|
value: "repeat",
|
|
2413
2547
|
label: (0, import_i18n15.__)("Repeat", "elementor"),
|
|
2414
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2548
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons13.GridDotsIcon, { fontSize: size }),
|
|
2415
2549
|
showTooltip: true
|
|
2416
2550
|
},
|
|
2417
2551
|
{
|
|
2418
2552
|
value: "repeat-x",
|
|
2419
2553
|
label: (0, import_i18n15.__)("Repeat-x", "elementor"),
|
|
2420
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2554
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons13.DotsHorizontalIcon, { fontSize: size }),
|
|
2421
2555
|
showTooltip: true
|
|
2422
2556
|
},
|
|
2423
2557
|
{
|
|
2424
2558
|
value: "repeat-y",
|
|
2425
2559
|
label: (0, import_i18n15.__)("Repeat-y", "elementor"),
|
|
2426
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2560
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons13.DotsVerticalIcon, { fontSize: size }),
|
|
2427
2561
|
showTooltip: true
|
|
2428
2562
|
},
|
|
2429
2563
|
{
|
|
2430
2564
|
value: "no-repeat",
|
|
2431
2565
|
label: (0, import_i18n15.__)("No-repeat", "elementor"),
|
|
2432
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2566
|
+
renderContent: ({ size }) => /* @__PURE__ */ React42.createElement(import_icons13.XIcon, { fontSize: size }),
|
|
2433
2567
|
showTooltip: true
|
|
2434
2568
|
}
|
|
2435
2569
|
];
|
|
2436
2570
|
var BackgroundImageOverlayRepeat = () => {
|
|
2437
|
-
return /* @__PURE__ */
|
|
2571
|
+
return /* @__PURE__ */ React42.createElement(PopoverGridContainer, null, /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React42.createElement(ControlFormLabel, null, (0, import_i18n15.__)("Repeat", "elementor"))), /* @__PURE__ */ React42.createElement(import_ui35.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React42.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
2438
2572
|
};
|
|
2439
2573
|
|
|
2440
2574
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
2441
|
-
var
|
|
2575
|
+
var React43 = __toESM(require("react"));
|
|
2442
2576
|
var import_editor_props21 = require("@elementor/editor-props");
|
|
2443
|
-
var
|
|
2444
|
-
var
|
|
2577
|
+
var import_icons14 = require("@elementor/icons");
|
|
2578
|
+
var import_ui36 = require("@elementor/ui");
|
|
2445
2579
|
var import_i18n16 = require("@wordpress/i18n");
|
|
2446
2580
|
var sizeControlOptions = [
|
|
2447
2581
|
{
|
|
2448
2582
|
value: "auto",
|
|
2449
2583
|
label: (0, import_i18n16.__)("Auto", "elementor"),
|
|
2450
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2584
|
+
renderContent: ({ size }) => /* @__PURE__ */ React43.createElement(import_icons14.LetterAIcon, { fontSize: size }),
|
|
2451
2585
|
showTooltip: true
|
|
2452
2586
|
},
|
|
2453
2587
|
{
|
|
2454
2588
|
value: "cover",
|
|
2455
2589
|
label: (0, import_i18n16.__)("Cover", "elementor"),
|
|
2456
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2590
|
+
renderContent: ({ size }) => /* @__PURE__ */ React43.createElement(import_icons14.ArrowsMaximizeIcon, { fontSize: size }),
|
|
2457
2591
|
showTooltip: true
|
|
2458
2592
|
},
|
|
2459
2593
|
{
|
|
2460
2594
|
value: "contain",
|
|
2461
2595
|
label: (0, import_i18n16.__)("Contain", "elementor"),
|
|
2462
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2596
|
+
renderContent: ({ size }) => /* @__PURE__ */ React43.createElement(import_icons14.ArrowBarBothIcon, { fontSize: size }),
|
|
2463
2597
|
showTooltip: true
|
|
2464
2598
|
},
|
|
2465
2599
|
{
|
|
2466
2600
|
value: "custom",
|
|
2467
2601
|
label: (0, import_i18n16.__)("Custom", "elementor"),
|
|
2468
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
2602
|
+
renderContent: ({ size }) => /* @__PURE__ */ React43.createElement(import_icons14.PencilIcon, { fontSize: size }),
|
|
2469
2603
|
showTooltip: true
|
|
2470
2604
|
}
|
|
2471
2605
|
];
|
|
@@ -2480,7 +2614,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2480
2614
|
stringPropContext.setValue(size);
|
|
2481
2615
|
}
|
|
2482
2616
|
};
|
|
2483
|
-
return /* @__PURE__ */
|
|
2617
|
+
return /* @__PURE__ */ React43.createElement(import_ui36.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(PopoverGridContainer, null, /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(ControlFormLabel, null, (0, import_i18n16.__)("Size", "elementor"))), /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React43.createElement(
|
|
2484
2618
|
ControlToggleButtonGroup,
|
|
2485
2619
|
{
|
|
2486
2620
|
exclusive: true,
|
|
@@ -2488,25 +2622,25 @@ var BackgroundImageOverlaySize = () => {
|
|
|
2488
2622
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value,
|
|
2489
2623
|
onChange: handleSizeChange
|
|
2490
2624
|
}
|
|
2491
|
-
)))), isCustom ? /* @__PURE__ */
|
|
2625
|
+
)))), isCustom ? /* @__PURE__ */ React43.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React43.createElement(PopoverGridContainer, null, /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React43.createElement(
|
|
2492
2626
|
SizeControl,
|
|
2493
2627
|
{
|
|
2494
|
-
startIcon: /* @__PURE__ */
|
|
2628
|
+
startIcon: /* @__PURE__ */ React43.createElement(import_icons14.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
2495
2629
|
extendedValues: ["auto"]
|
|
2496
2630
|
}
|
|
2497
|
-
))), /* @__PURE__ */
|
|
2631
|
+
))), /* @__PURE__ */ React43.createElement(import_ui36.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React43.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React43.createElement(
|
|
2498
2632
|
SizeControl,
|
|
2499
2633
|
{
|
|
2500
|
-
startIcon: /* @__PURE__ */
|
|
2634
|
+
startIcon: /* @__PURE__ */ React43.createElement(import_icons14.ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
2501
2635
|
extendedValues: ["auto"]
|
|
2502
2636
|
}
|
|
2503
2637
|
)))))) : null);
|
|
2504
2638
|
};
|
|
2505
2639
|
|
|
2506
2640
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
2507
|
-
var
|
|
2641
|
+
var import_react17 = require("react");
|
|
2508
2642
|
var import_editor_props22 = require("@elementor/editor-props");
|
|
2509
|
-
var
|
|
2643
|
+
var import_ui37 = require("@elementor/ui");
|
|
2510
2644
|
var useBackgroundTabsHistory = ({
|
|
2511
2645
|
color: initialBackgroundColorOverlay2,
|
|
2512
2646
|
image: initialBackgroundImageOverlay,
|
|
@@ -2524,8 +2658,8 @@ var useBackgroundTabsHistory = ({
|
|
|
2524
2658
|
}
|
|
2525
2659
|
return "image";
|
|
2526
2660
|
};
|
|
2527
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
2528
|
-
const valuesHistory = (0,
|
|
2661
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui37.useTabs)(getCurrentOverlayType());
|
|
2662
|
+
const valuesHistory = (0, import_react17.useRef)({
|
|
2529
2663
|
image: initialBackgroundImageOverlay,
|
|
2530
2664
|
color: initialBackgroundColorOverlay2,
|
|
2531
2665
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -2600,7 +2734,7 @@ var backgroundResolutionOptions = [
|
|
|
2600
2734
|
];
|
|
2601
2735
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
2602
2736
|
const { propType, value: overlayValues, setValue } = useBoundProp(import_editor_props23.backgroundOverlayPropTypeUtil);
|
|
2603
|
-
return /* @__PURE__ */
|
|
2737
|
+
return /* @__PURE__ */ React44.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React44.createElement(
|
|
2604
2738
|
Repeater,
|
|
2605
2739
|
{
|
|
2606
2740
|
openOnAdd: true,
|
|
@@ -2617,7 +2751,7 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
2617
2751
|
));
|
|
2618
2752
|
});
|
|
2619
2753
|
var ItemContent2 = ({ bind }) => {
|
|
2620
|
-
return /* @__PURE__ */
|
|
2754
|
+
return /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React44.createElement(Content2, null));
|
|
2621
2755
|
};
|
|
2622
2756
|
var Content2 = () => {
|
|
2623
2757
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
@@ -2625,27 +2759,27 @@ var Content2 = () => {
|
|
|
2625
2759
|
color: initialBackgroundColorOverlay.value,
|
|
2626
2760
|
gradient: initialBackgroundGradientOverlay.value
|
|
2627
2761
|
});
|
|
2628
|
-
return /* @__PURE__ */
|
|
2629
|
-
|
|
2762
|
+
return /* @__PURE__ */ React44.createElement(import_ui38.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React44.createElement(import_ui38.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React44.createElement(
|
|
2763
|
+
import_ui38.Tabs,
|
|
2630
2764
|
{
|
|
2631
2765
|
size: "small",
|
|
2632
2766
|
variant: "fullWidth",
|
|
2633
2767
|
...getTabsProps(),
|
|
2634
2768
|
"aria-label": (0, import_i18n17.__)("Background Overlay", "elementor")
|
|
2635
2769
|
},
|
|
2636
|
-
/* @__PURE__ */
|
|
2637
|
-
/* @__PURE__ */
|
|
2638
|
-
/* @__PURE__ */
|
|
2639
|
-
)), /* @__PURE__ */
|
|
2770
|
+
/* @__PURE__ */ React44.createElement(import_ui38.Tab, { label: (0, import_i18n17.__)("Image", "elementor"), ...getTabProps("image") }),
|
|
2771
|
+
/* @__PURE__ */ React44.createElement(import_ui38.Tab, { label: (0, import_i18n17.__)("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
2772
|
+
/* @__PURE__ */ React44.createElement(import_ui38.Tab, { label: (0, import_i18n17.__)("Color", "elementor"), ...getTabProps("color") })
|
|
2773
|
+
)), /* @__PURE__ */ React44.createElement(import_ui38.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React44.createElement(PopoverContent, null, /* @__PURE__ */ React44.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React44.createElement(import_ui38.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React44.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React44.createElement(import_ui38.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React44.createElement(PopoverContent, null, /* @__PURE__ */ React44.createElement(ColorOverlayContent, null))));
|
|
2640
2774
|
};
|
|
2641
2775
|
var ItemIcon2 = ({ value }) => {
|
|
2642
2776
|
switch (value.$$type) {
|
|
2643
2777
|
case "background-image-overlay":
|
|
2644
|
-
return /* @__PURE__ */
|
|
2778
|
+
return /* @__PURE__ */ React44.createElement(ItemIconImage, { value });
|
|
2645
2779
|
case "background-color-overlay":
|
|
2646
|
-
return /* @__PURE__ */
|
|
2780
|
+
return /* @__PURE__ */ React44.createElement(ItemIconColor, { value });
|
|
2647
2781
|
case "background-gradient-overlay":
|
|
2648
|
-
return /* @__PURE__ */
|
|
2782
|
+
return /* @__PURE__ */ React44.createElement(ItemIconGradient, { value });
|
|
2649
2783
|
default:
|
|
2650
2784
|
return null;
|
|
2651
2785
|
}
|
|
@@ -2658,12 +2792,12 @@ var extractColorFrom = (prop) => {
|
|
|
2658
2792
|
};
|
|
2659
2793
|
var ItemIconColor = ({ value: prop }) => {
|
|
2660
2794
|
const color = extractColorFrom(prop);
|
|
2661
|
-
return /* @__PURE__ */
|
|
2795
|
+
return /* @__PURE__ */ React44.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: color });
|
|
2662
2796
|
};
|
|
2663
2797
|
var ItemIconImage = ({ value }) => {
|
|
2664
2798
|
const { imageUrl } = useImage(value);
|
|
2665
|
-
return /* @__PURE__ */
|
|
2666
|
-
|
|
2799
|
+
return /* @__PURE__ */ React44.createElement(
|
|
2800
|
+
import_ui38.CardMedia,
|
|
2667
2801
|
{
|
|
2668
2802
|
image: imageUrl,
|
|
2669
2803
|
sx: (theme) => ({
|
|
@@ -2677,49 +2811,49 @@ var ItemIconImage = ({ value }) => {
|
|
|
2677
2811
|
};
|
|
2678
2812
|
var ItemIconGradient = ({ value }) => {
|
|
2679
2813
|
const gradient = getGradientValue(value);
|
|
2680
|
-
return /* @__PURE__ */
|
|
2814
|
+
return /* @__PURE__ */ React44.createElement(StyledUnstableColorIndicator, { size: "inherit", component: "span", value: gradient });
|
|
2681
2815
|
};
|
|
2682
2816
|
var ItemLabel2 = ({ value }) => {
|
|
2683
2817
|
switch (value.$$type) {
|
|
2684
2818
|
case "background-image-overlay":
|
|
2685
|
-
return /* @__PURE__ */
|
|
2819
|
+
return /* @__PURE__ */ React44.createElement(ItemLabelImage, { value });
|
|
2686
2820
|
case "background-color-overlay":
|
|
2687
|
-
return /* @__PURE__ */
|
|
2821
|
+
return /* @__PURE__ */ React44.createElement(ItemLabelColor, { value });
|
|
2688
2822
|
case "background-gradient-overlay":
|
|
2689
|
-
return /* @__PURE__ */
|
|
2823
|
+
return /* @__PURE__ */ React44.createElement(ItemLabelGradient, { value });
|
|
2690
2824
|
default:
|
|
2691
2825
|
return null;
|
|
2692
2826
|
}
|
|
2693
2827
|
};
|
|
2694
2828
|
var ItemLabelColor = ({ value: prop }) => {
|
|
2695
2829
|
const color = extractColorFrom(prop);
|
|
2696
|
-
return /* @__PURE__ */
|
|
2830
|
+
return /* @__PURE__ */ React44.createElement("span", null, color);
|
|
2697
2831
|
};
|
|
2698
2832
|
var ItemLabelImage = ({ value }) => {
|
|
2699
2833
|
const { imageTitle } = useImage(value);
|
|
2700
|
-
return /* @__PURE__ */
|
|
2834
|
+
return /* @__PURE__ */ React44.createElement("span", null, imageTitle);
|
|
2701
2835
|
};
|
|
2702
2836
|
var ItemLabelGradient = ({ value }) => {
|
|
2703
2837
|
if (value.value.type.value === "linear") {
|
|
2704
|
-
return /* @__PURE__ */
|
|
2838
|
+
return /* @__PURE__ */ React44.createElement("span", null, (0, import_i18n17.__)("Linear Gradient", "elementor"));
|
|
2705
2839
|
}
|
|
2706
|
-
return /* @__PURE__ */
|
|
2840
|
+
return /* @__PURE__ */ React44.createElement("span", null, (0, import_i18n17.__)("Radial Gradient", "elementor"));
|
|
2707
2841
|
};
|
|
2708
2842
|
var ColorOverlayContent = () => {
|
|
2709
2843
|
const propContext = useBoundProp(import_editor_props23.backgroundColorOverlayPropTypeUtil);
|
|
2710
|
-
return /* @__PURE__ */
|
|
2844
|
+
return /* @__PURE__ */ React44.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React44.createElement(ColorControl, null)));
|
|
2711
2845
|
};
|
|
2712
2846
|
var ImageOverlayContent = () => {
|
|
2713
2847
|
const propContext = useBoundProp(import_editor_props23.backgroundImageOverlayPropTypeUtil);
|
|
2714
|
-
return /* @__PURE__ */
|
|
2848
|
+
return /* @__PURE__ */ React44.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React44.createElement(import_ui38.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React44.createElement(import_ui38.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React44.createElement(
|
|
2715
2849
|
ImageControl,
|
|
2716
2850
|
{
|
|
2717
2851
|
resolutionLabel: (0, import_i18n17.__)("Resolution", "elementor"),
|
|
2718
2852
|
sizes: backgroundResolutionOptions
|
|
2719
2853
|
}
|
|
2720
|
-
)))), /* @__PURE__ */
|
|
2854
|
+
)))), /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React44.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React44.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React44.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React44.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React44.createElement(BackgroundImageOverlayAttachment, null)));
|
|
2721
2855
|
};
|
|
2722
|
-
var StyledUnstableColorIndicator = (0,
|
|
2856
|
+
var StyledUnstableColorIndicator = (0, import_ui38.styled)(import_ui38.UnstableColorIndicator)(({ theme }) => ({
|
|
2723
2857
|
borderRadius: `${theme.shape.borderRadius / 2}px`
|
|
2724
2858
|
}));
|
|
2725
2859
|
var useImage = (image) => {
|
|
@@ -2755,7 +2889,7 @@ var getGradientValue = (value) => {
|
|
|
2755
2889
|
// src/controls/background-control/background-control.tsx
|
|
2756
2890
|
var BackgroundControl = createControl(() => {
|
|
2757
2891
|
const propContext = useBoundProp(import_editor_props24.backgroundPropTypeUtil);
|
|
2758
|
-
return /* @__PURE__ */
|
|
2892
|
+
return /* @__PURE__ */ React45.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React45.createElement(SectionContent, null, /* @__PURE__ */ React45.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React45.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React45.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React45.createElement(import_ui39.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React45.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ControlFormLabel, null, (0, import_i18n18.__)("Color", "elementor"))), /* @__PURE__ */ React45.createElement(import_ui39.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React45.createElement(ColorControl, null))))));
|
|
2759
2893
|
});
|
|
2760
2894
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2761
2895
|
0 && (module.exports = {
|