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