@elementor/editor-controls 0.13.0 → 0.15.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 +36 -0
- package/dist/index.d.mts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +443 -244
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +468 -268
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -7
- package/src/api.ts +16 -0
- package/src/components/repeater.tsx +21 -23
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx +1 -1
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx +8 -2
- package/src/controls/equal-unequal-sizes-control.tsx +15 -10
- package/src/controls/font-family-control/enqueue-font.tsx +15 -0
- package/src/controls/font-family-control/font-family-control.tsx +286 -0
- package/src/controls/gap-control.tsx +20 -12
- package/src/controls/image-control.tsx +7 -2
- package/src/controls/image-media-control.tsx +5 -7
- package/src/controls/link-control.tsx +2 -13
- package/src/controls/linked-dimensions-control.tsx +141 -89
- package/src/controls/size-control.tsx +91 -26
- package/src/controls/svg-media-control.tsx +17 -7
- package/src/hooks/use-filtered-font-families.ts +13 -26
- package/src/hooks/use-unfiltered-files-upload.ts +40 -0
- package/src/index.ts +2 -1
- package/src/controls/font-family-control.tsx +0 -157
package/dist/index.js
CHANGED
|
@@ -271,6 +271,34 @@ function createControl(Component, { supportsReplacements = true } = {}) {
|
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
// src/hooks/use-unfiltered-files-upload.ts
|
|
275
|
+
var import_query = require("@elementor/query");
|
|
276
|
+
|
|
277
|
+
// src/api.ts
|
|
278
|
+
var import_http = require("@elementor/http");
|
|
279
|
+
var ELEMENTOR_SETTING_URL = "elementor/v1/settings";
|
|
280
|
+
var apiClient = {
|
|
281
|
+
getElementorSetting: (key) => (0, import_http.httpService)().get(`${ELEMENTOR_SETTING_URL}/${key}`).then((res) => formatSettingResponse(res.data)),
|
|
282
|
+
updateElementorSetting: (key, value) => (0, import_http.httpService)().put(`${ELEMENTOR_SETTING_URL}/${key}`, { value })
|
|
283
|
+
};
|
|
284
|
+
var formatSettingResponse = (response) => response.data.value;
|
|
285
|
+
|
|
286
|
+
// src/hooks/use-unfiltered-files-upload.ts
|
|
287
|
+
var UNFILTERED_FILES_UPLOAD_KEY = "elementor_unfiltered_files_upload";
|
|
288
|
+
var unfilteredFilesQueryKey = {
|
|
289
|
+
queryKey: [UNFILTERED_FILES_UPLOAD_KEY]
|
|
290
|
+
};
|
|
291
|
+
var useUnfilteredFilesUpload = () => (0, import_query.useQuery)({
|
|
292
|
+
...unfilteredFilesQueryKey,
|
|
293
|
+
queryFn: () => apiClient.getElementorSetting(UNFILTERED_FILES_UPLOAD_KEY).then((res) => {
|
|
294
|
+
return formatResponse(res);
|
|
295
|
+
}),
|
|
296
|
+
staleTime: Infinity
|
|
297
|
+
});
|
|
298
|
+
var formatResponse = (response) => {
|
|
299
|
+
return Boolean(response === "1");
|
|
300
|
+
};
|
|
301
|
+
|
|
274
302
|
// src/controls/image-media-control.tsx
|
|
275
303
|
var React8 = __toESM(require("react"));
|
|
276
304
|
var import_editor_props = require("@elementor/editor-props");
|
|
@@ -309,19 +337,18 @@ function ControlActions({ children }) {
|
|
|
309
337
|
if (items.length === 0) {
|
|
310
338
|
return children;
|
|
311
339
|
}
|
|
312
|
-
const menuItems = items.map(({ MenuItem:
|
|
340
|
+
const menuItems = items.map(({ MenuItem: MenuItem4, id }) => /* @__PURE__ */ React7.createElement(MenuItem4, { key: id }));
|
|
313
341
|
return /* @__PURE__ */ React7.createElement(FloatingBarContainer, null, /* @__PURE__ */ React7.createElement(import_ui3.UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
314
342
|
}
|
|
315
343
|
|
|
316
344
|
// src/controls/image-media-control.tsx
|
|
317
|
-
var ImageMediaControl = createControl((
|
|
345
|
+
var ImageMediaControl = createControl(({ mediaTypes = ["image"] }) => {
|
|
318
346
|
const { value, setValue } = useBoundProp(import_editor_props.imageSrcPropTypeUtil);
|
|
319
347
|
const { id, url } = value ?? {};
|
|
320
348
|
const { data: attachment, isFetching } = (0, import_wp_media.useWpMediaAttachment)(id?.value || null);
|
|
321
349
|
const src = attachment?.url ?? url?.value ?? null;
|
|
322
350
|
const { open } = (0, import_wp_media.useWpMediaFrame)({
|
|
323
|
-
|
|
324
|
-
allowedExtensions: props.allowedExtensions,
|
|
351
|
+
mediaTypes,
|
|
325
352
|
multiple: false,
|
|
326
353
|
selected: id?.value || null,
|
|
327
354
|
onSelect: (selectedAttachment) => {
|
|
@@ -352,7 +379,7 @@ var ImageMediaControl = createControl((props) => {
|
|
|
352
379
|
startIcon: /* @__PURE__ */ React8.createElement(import_icons.UploadIcon, null),
|
|
353
380
|
onClick: () => open({ mode: "upload" })
|
|
354
381
|
},
|
|
355
|
-
(0, import_i18n.__)("Upload
|
|
382
|
+
(0, import_i18n.__)("Upload", "elementor")
|
|
356
383
|
)))));
|
|
357
384
|
});
|
|
358
385
|
|
|
@@ -385,7 +412,9 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
385
412
|
var ImageControl = createControl(
|
|
386
413
|
({ sizes, resolutionLabel = (0, import_i18n2.__)("Image resolution", "elementor") }) => {
|
|
387
414
|
const propContext = useBoundProp(import_editor_props3.imagePropTypeUtil);
|
|
388
|
-
|
|
415
|
+
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
416
|
+
const mediaTypes = allowSvgUpload ? ["image", "svg"] : ["image"];
|
|
417
|
+
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React10.createElement(import_ui6.Stack, { gap: 1.5 }, /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(ControlLabel, null, " ", (0, import_i18n2.__)("Image", "elementor"), " "), /* @__PURE__ */ React10.createElement(ImageMediaControl, { mediaTypes })), /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React10.createElement(import_ui6.Grid, { container: true, gap: 1.5, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React10.createElement(import_ui6.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(ControlLabel, null, " ", resolutionLabel, " ")), /* @__PURE__ */ React10.createElement(import_ui6.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React10.createElement(SelectControl, { options: sizes }))))));
|
|
389
418
|
}
|
|
390
419
|
);
|
|
391
420
|
|
|
@@ -522,27 +551,74 @@ var useSyncExternalState = ({
|
|
|
522
551
|
var defaultUnits = ["px", "%", "em", "rem", "vw", "vh"];
|
|
523
552
|
var defaultUnit = "px";
|
|
524
553
|
var defaultSize = NaN;
|
|
525
|
-
var SizeControl = createControl(
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
554
|
+
var SizeControl = createControl(
|
|
555
|
+
({ units: units2 = defaultUnits, extendedValues = [], placeholder, startIcon }) => {
|
|
556
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(import_editor_props6.sizePropTypeUtil);
|
|
557
|
+
const [state, setState] = useSyncExternalState({
|
|
558
|
+
external: sizeValue,
|
|
559
|
+
setExternal: setSizeValue,
|
|
560
|
+
persistWhen: (controlValue) => !!controlValue?.size || controlValue?.size === 0,
|
|
561
|
+
fallback: (controlValue) => ({ unit: controlValue?.unit || defaultUnit, size: defaultSize })
|
|
562
|
+
});
|
|
563
|
+
const handleUnitChange = (unit) => {
|
|
564
|
+
setState((prev) => ({
|
|
565
|
+
size: prev?.size ?? defaultSize,
|
|
566
|
+
unit
|
|
567
|
+
}));
|
|
568
|
+
};
|
|
569
|
+
const handleSizeChange = (event) => {
|
|
570
|
+
const { value: size } = event.target;
|
|
571
|
+
setState((prev) => ({
|
|
572
|
+
...prev,
|
|
573
|
+
size: size || size === "0" ? parseFloat(size) : defaultSize
|
|
574
|
+
}));
|
|
575
|
+
};
|
|
576
|
+
const inputProps = {
|
|
577
|
+
size: state.size,
|
|
578
|
+
unit: state.unit,
|
|
579
|
+
placeholder,
|
|
580
|
+
startIcon,
|
|
581
|
+
units: units2,
|
|
582
|
+
extendedValues,
|
|
583
|
+
handleSizeChange,
|
|
584
|
+
handleUnitChange
|
|
585
|
+
};
|
|
586
|
+
if (extendedValues?.length) {
|
|
587
|
+
return /* @__PURE__ */ React14.createElement(ExtendedSizeInput, { ...inputProps });
|
|
588
|
+
}
|
|
589
|
+
return /* @__PURE__ */ React14.createElement(SizeInput, { ...inputProps });
|
|
590
|
+
}
|
|
591
|
+
);
|
|
592
|
+
var ExtendedSizeInput = (props) => {
|
|
593
|
+
const { value: stringValue, setValue: setStringValue } = useBoundProp(import_editor_props6.stringPropTypeUtil);
|
|
594
|
+
const { extendedValues = [] } = props;
|
|
595
|
+
const unit = stringValue ?? props.unit;
|
|
596
|
+
const handleUnitChange = (newUnit) => {
|
|
597
|
+
if (extendedValues.includes(newUnit)) {
|
|
598
|
+
setStringValue(newUnit);
|
|
599
|
+
} else {
|
|
600
|
+
props.handleUnitChange(newUnit);
|
|
601
|
+
}
|
|
545
602
|
};
|
|
603
|
+
return /* @__PURE__ */ React14.createElement(
|
|
604
|
+
SizeInput,
|
|
605
|
+
{
|
|
606
|
+
...props,
|
|
607
|
+
units: [...props.units, ...extendedValues],
|
|
608
|
+
handleUnitChange,
|
|
609
|
+
unit
|
|
610
|
+
}
|
|
611
|
+
);
|
|
612
|
+
};
|
|
613
|
+
var SizeInput = ({
|
|
614
|
+
units: units2,
|
|
615
|
+
handleUnitChange,
|
|
616
|
+
handleSizeChange,
|
|
617
|
+
placeholder,
|
|
618
|
+
startIcon,
|
|
619
|
+
size,
|
|
620
|
+
unit
|
|
621
|
+
}) => {
|
|
546
622
|
return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(
|
|
547
623
|
TextFieldInnerSelection,
|
|
548
624
|
{
|
|
@@ -551,17 +627,17 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
551
627
|
{
|
|
552
628
|
options: units2,
|
|
553
629
|
onClick: handleUnitChange,
|
|
554
|
-
value:
|
|
630
|
+
value: unit ?? defaultUnit
|
|
555
631
|
}
|
|
556
632
|
),
|
|
557
633
|
placeholder,
|
|
558
634
|
startAdornment: startIcon ? /* @__PURE__ */ React14.createElement(import_ui10.InputAdornment, { position: "start" }, startIcon) : void 0,
|
|
559
635
|
type: "number",
|
|
560
|
-
value: Number.isNaN(
|
|
636
|
+
value: Number.isNaN(size) ? "" : size,
|
|
561
637
|
onChange: handleSizeChange
|
|
562
638
|
}
|
|
563
639
|
));
|
|
564
|
-
}
|
|
640
|
+
};
|
|
565
641
|
|
|
566
642
|
// src/controls/stroke-control.tsx
|
|
567
643
|
var React17 = __toESM(require("react"));
|
|
@@ -812,6 +888,9 @@ var RepeaterItem = ({
|
|
|
812
888
|
const [anchorEl, setAnchorEl] = (0, import_react7.useState)(null);
|
|
813
889
|
const popoverState = (0, import_ui17.usePopupState)({ popupId, variant: "popover" });
|
|
814
890
|
const popoverProps = (0, import_ui17.bindPopover)(popoverState);
|
|
891
|
+
const duplicateLabel = (0, import_i18n4.__)("Duplicate", "elementor");
|
|
892
|
+
const toggleLabel = disabled ? (0, import_i18n4.__)("Show", "elementor") : (0, import_i18n4.__)("Hide", "elementor");
|
|
893
|
+
const removeLabel = (0, import_i18n4.__)("Remove", "elementor");
|
|
815
894
|
return /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
816
895
|
import_ui17.UnstableTag,
|
|
817
896
|
{
|
|
@@ -823,31 +902,8 @@ var RepeaterItem = ({
|
|
|
823
902
|
"aria-label": (0, import_i18n4.__)("Open item", "elementor"),
|
|
824
903
|
...(0, import_ui17.bindTrigger)(popoverState),
|
|
825
904
|
startIcon,
|
|
826
|
-
actions: /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(
|
|
827
|
-
|
|
828
|
-
{
|
|
829
|
-
size: SIZE,
|
|
830
|
-
onClick: duplicateItem,
|
|
831
|
-
"aria-label": (0, import_i18n4.__)("Duplicate item", "elementor")
|
|
832
|
-
},
|
|
833
|
-
/* @__PURE__ */ React21.createElement(import_icons3.CopyIcon, { fontSize: SIZE })
|
|
834
|
-
), /* @__PURE__ */ React21.createElement(
|
|
835
|
-
import_ui17.IconButton,
|
|
836
|
-
{
|
|
837
|
-
size: SIZE,
|
|
838
|
-
onClick: toggleDisableItem,
|
|
839
|
-
"aria-label": disabled ? (0, import_i18n4.__)("Enable item", "elementor") : (0, import_i18n4.__)("Disable item", "elementor")
|
|
840
|
-
},
|
|
841
|
-
disabled ? /* @__PURE__ */ React21.createElement(import_icons3.EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React21.createElement(import_icons3.EyeIcon, { fontSize: SIZE })
|
|
842
|
-
), /* @__PURE__ */ React21.createElement(
|
|
843
|
-
import_ui17.IconButton,
|
|
844
|
-
{
|
|
845
|
-
size: SIZE,
|
|
846
|
-
onClick: removeItem,
|
|
847
|
-
"aria-label": (0, import_i18n4.__)("Remove item", "elementor")
|
|
848
|
-
},
|
|
849
|
-
/* @__PURE__ */ React21.createElement(import_icons3.XIcon, { fontSize: SIZE })
|
|
850
|
-
))
|
|
905
|
+
actions: /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement(import_ui17.Tooltip, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React21.createElement(import_ui17.IconButton, { size: SIZE, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React21.createElement(import_icons3.CopyIcon, { fontSize: SIZE }))), /* @__PURE__ */ React21.createElement(import_ui17.Tooltip, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React21.createElement(import_ui17.IconButton, { size: SIZE, onClick: toggleDisableItem, "aria-label": toggleLabel }, disabled ? /* @__PURE__ */ React21.createElement(import_icons3.EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React21.createElement(import_icons3.EyeIcon, { fontSize: SIZE }))), /* @__PURE__ */ React21.createElement(import_ui17.Tooltip, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React21.createElement(import_ui17.IconButton, { size: SIZE, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React21.createElement(import_icons3.XIcon, { fontSize: SIZE })))),
|
|
906
|
+
sx: { backgroundColor: "background.paper" }
|
|
851
907
|
}
|
|
852
908
|
), /* @__PURE__ */ React21.createElement(
|
|
853
909
|
import_ui17.Popover,
|
|
@@ -1088,6 +1144,7 @@ var isEqualSizes = (propValue, items) => {
|
|
|
1088
1144
|
function EqualUnequalSizesControl({
|
|
1089
1145
|
label,
|
|
1090
1146
|
icon,
|
|
1147
|
+
tooltipLabel,
|
|
1091
1148
|
items,
|
|
1092
1149
|
multiSizePropTypeUtil
|
|
1093
1150
|
}) {
|
|
@@ -1127,17 +1184,18 @@ function EqualUnequalSizesControl({
|
|
|
1127
1184
|
return splitEqualValue() ?? null;
|
|
1128
1185
|
};
|
|
1129
1186
|
const isMixed = !!multiSizeValue;
|
|
1130
|
-
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, label)), /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(import_ui21.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React26.createElement(SizeControl, { placeholder: isMixed ? (0, import_i18n6.__)("Mixed", "elementor") : void 0 }), /* @__PURE__ */ React26.createElement(
|
|
1187
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, label)), /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React26.createElement(import_ui21.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React26.createElement(SizeControl, { placeholder: isMixed ? (0, import_i18n6.__)("Mixed", "elementor") : void 0 }), /* @__PURE__ */ React26.createElement(import_ui21.Tooltip, { title: tooltipLabel, placement: "top" }, /* @__PURE__ */ React26.createElement(
|
|
1131
1188
|
import_ui21.ToggleButton,
|
|
1132
1189
|
{
|
|
1133
1190
|
size: "tiny",
|
|
1134
1191
|
value: "check",
|
|
1135
1192
|
sx: { marginLeft: "auto" },
|
|
1136
1193
|
...(0, import_ui21.bindToggle)(popupState),
|
|
1137
|
-
selected: popupState.isOpen
|
|
1194
|
+
selected: popupState.isOpen,
|
|
1195
|
+
"aria-label": tooltipLabel
|
|
1138
1196
|
},
|
|
1139
1197
|
icon
|
|
1140
|
-
)))), /* @__PURE__ */ React26.createElement(
|
|
1198
|
+
))))), /* @__PURE__ */ React26.createElement(
|
|
1141
1199
|
import_ui21.Popover,
|
|
1142
1200
|
{
|
|
1143
1201
|
disablePortal: true,
|
|
@@ -1166,121 +1224,135 @@ var import_editor_props13 = require("@elementor/editor-props");
|
|
|
1166
1224
|
var import_icons4 = require("@elementor/icons");
|
|
1167
1225
|
var import_ui22 = require("@elementor/ui");
|
|
1168
1226
|
var import_i18n7 = require("@wordpress/i18n");
|
|
1169
|
-
var LinkedDimensionsControl = createControl(
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1227
|
+
var LinkedDimensionsControl = createControl(
|
|
1228
|
+
({
|
|
1229
|
+
label,
|
|
1230
|
+
isSiteRtl = false,
|
|
1231
|
+
extendedValues
|
|
1232
|
+
}) => {
|
|
1233
|
+
const {
|
|
1234
|
+
value: dimensionsValue,
|
|
1235
|
+
setValue: setDimensionsValue,
|
|
1236
|
+
propType
|
|
1237
|
+
} = useBoundProp(import_editor_props13.dimensionsPropTypeUtil);
|
|
1238
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(import_editor_props13.sizePropTypeUtil);
|
|
1239
|
+
const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
|
|
1240
|
+
const onLinkToggle = () => {
|
|
1241
|
+
if (!isLinked) {
|
|
1242
|
+
setSizeValue(dimensionsValue["block-start"]?.value);
|
|
1243
|
+
return;
|
|
1244
|
+
}
|
|
1245
|
+
const value = sizeValue ? import_editor_props13.sizePropTypeUtil.create(sizeValue) : null;
|
|
1246
|
+
setDimensionsValue({
|
|
1247
|
+
"block-start": value,
|
|
1248
|
+
"block-end": value,
|
|
1249
|
+
"inline-start": value,
|
|
1250
|
+
"inline-end": value
|
|
1251
|
+
});
|
|
1252
|
+
};
|
|
1253
|
+
const tooltipLabel = label.toLowerCase();
|
|
1254
|
+
const LinkedIcon = isLinked ? import_icons4.LinkIcon : import_icons4.DetachIcon;
|
|
1255
|
+
const linkedLabel = (0, import_i18n7.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1256
|
+
const unlinkedLabel = (0, import_i18n7.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1257
|
+
return /* @__PURE__ */ React27.createElement(PropProvider, { propType, value: dimensionsValue, setValue: setDimensionsValue }, /* @__PURE__ */ React27.createElement(import_ui22.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(ControlLabel, null, label), /* @__PURE__ */ React27.createElement(import_ui22.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React27.createElement(
|
|
1258
|
+
import_ui22.ToggleButton,
|
|
1259
|
+
{
|
|
1260
|
+
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1261
|
+
size: "tiny",
|
|
1262
|
+
value: "check",
|
|
1263
|
+
selected: isLinked,
|
|
1264
|
+
sx: { marginLeft: "auto" },
|
|
1265
|
+
onChange: onLinkToggle
|
|
1266
|
+
},
|
|
1267
|
+
/* @__PURE__ */ React27.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1268
|
+
))), /* @__PURE__ */ React27.createElement(import_ui22.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, (0, import_i18n7.__)("Top", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1269
|
+
Control3,
|
|
1270
|
+
{
|
|
1271
|
+
bind: "block-start",
|
|
1272
|
+
startIcon: /* @__PURE__ */ React27.createElement(import_icons4.SideTopIcon, { fontSize: "tiny" }),
|
|
1273
|
+
isLinked,
|
|
1274
|
+
extendedValues
|
|
1275
|
+
}
|
|
1276
|
+
))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, isSiteRtl ? (0, import_i18n7.__)("Left", "elementor") : (0, import_i18n7.__)("Right", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1277
|
+
Control3,
|
|
1278
|
+
{
|
|
1279
|
+
bind: "inline-end",
|
|
1280
|
+
startIcon: isSiteRtl ? /* @__PURE__ */ React27.createElement(import_icons4.SideLeftIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React27.createElement(import_icons4.SideRightIcon, { fontSize: "tiny" }),
|
|
1281
|
+
isLinked,
|
|
1282
|
+
extendedValues
|
|
1283
|
+
}
|
|
1284
|
+
)))), /* @__PURE__ */ React27.createElement(import_ui22.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, (0, import_i18n7.__)("Bottom", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1285
|
+
Control3,
|
|
1286
|
+
{
|
|
1287
|
+
bind: "block-end",
|
|
1288
|
+
startIcon: /* @__PURE__ */ React27.createElement(import_icons4.SideBottomIcon, { fontSize: "tiny" }),
|
|
1289
|
+
isLinked,
|
|
1290
|
+
extendedValues
|
|
1291
|
+
}
|
|
1292
|
+
))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(ControlLabel, null, isSiteRtl ? (0, import_i18n7.__)("Right", "elementor") : (0, import_i18n7.__)("Left", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1293
|
+
Control3,
|
|
1294
|
+
{
|
|
1295
|
+
bind: "inline-start",
|
|
1296
|
+
startIcon: isSiteRtl ? /* @__PURE__ */ React27.createElement(import_icons4.SideRightIcon, { fontSize: "tiny" }) : /* @__PURE__ */ React27.createElement(import_icons4.SideLeftIcon, { fontSize: "tiny" }),
|
|
1297
|
+
isLinked,
|
|
1298
|
+
extendedValues
|
|
1299
|
+
}
|
|
1300
|
+
)))));
|
|
1301
|
+
}
|
|
1302
|
+
);
|
|
1303
|
+
var Control3 = ({
|
|
1304
|
+
bind,
|
|
1305
|
+
startIcon,
|
|
1306
|
+
isLinked,
|
|
1307
|
+
extendedValues
|
|
1308
|
+
}) => {
|
|
1229
1309
|
if (isLinked) {
|
|
1230
|
-
return /* @__PURE__ */ React27.createElement(SizeControl, { startIcon });
|
|
1310
|
+
return /* @__PURE__ */ React27.createElement(SizeControl, { startIcon, extendedValues });
|
|
1231
1311
|
}
|
|
1232
|
-
return /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React27.createElement(SizeControl, { startIcon }));
|
|
1312
|
+
return /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React27.createElement(SizeControl, { startIcon, extendedValues }));
|
|
1233
1313
|
};
|
|
1234
1314
|
|
|
1235
|
-
// src/controls/font-family-control.tsx
|
|
1236
|
-
var import_react9 = require("react");
|
|
1315
|
+
// src/controls/font-family-control/font-family-control.tsx
|
|
1237
1316
|
var React28 = __toESM(require("react"));
|
|
1317
|
+
var import_react9 = require("react");
|
|
1238
1318
|
var import_editor_props14 = require("@elementor/editor-props");
|
|
1239
1319
|
var import_icons5 = require("@elementor/icons");
|
|
1240
1320
|
var import_ui23 = require("@elementor/ui");
|
|
1241
|
-
var
|
|
1321
|
+
var import_utils2 = require("@elementor/utils");
|
|
1322
|
+
var import_react_virtual = require("@tanstack/react-virtual");
|
|
1323
|
+
var import_i18n8 = require("@wordpress/i18n");
|
|
1242
1324
|
|
|
1243
1325
|
// src/hooks/use-filtered-font-families.ts
|
|
1244
|
-
var import_i18n8 = require("@wordpress/i18n");
|
|
1245
|
-
var supportedCategories = {
|
|
1246
|
-
system: (0, import_i18n8.__)("System", "elementor"),
|
|
1247
|
-
googlefonts: (0, import_i18n8.__)("Google Fonts", "elementor"),
|
|
1248
|
-
customfonts: (0, import_i18n8.__)("Custom Fonts", "elementor")
|
|
1249
|
-
};
|
|
1250
1326
|
var useFilteredFontFamilies = (fontFamilies, searchValue) => {
|
|
1251
1327
|
const filteredFontFamilies = Object.entries(fontFamilies).reduce(
|
|
1252
|
-
(acc, [
|
|
1253
|
-
const
|
|
1254
|
-
if (
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
const existingCategory = acc.get(categoryLabel);
|
|
1260
|
-
if (existingCategory) {
|
|
1261
|
-
existingCategory.push(font);
|
|
1262
|
-
} else {
|
|
1263
|
-
acc.set(categoryLabel, [font]);
|
|
1264
|
-
}
|
|
1328
|
+
(acc, [category, fonts]) => {
|
|
1329
|
+
const filteredFonts = fonts.filter((font) => font.toLowerCase().includes(searchValue.toLowerCase()));
|
|
1330
|
+
if (filteredFonts.length) {
|
|
1331
|
+
acc.push({ type: "category", value: category });
|
|
1332
|
+
filteredFonts.forEach((font) => {
|
|
1333
|
+
acc.push({ type: "font", value: font });
|
|
1334
|
+
});
|
|
1265
1335
|
}
|
|
1266
1336
|
return acc;
|
|
1267
1337
|
},
|
|
1268
|
-
|
|
1338
|
+
[]
|
|
1269
1339
|
);
|
|
1270
1340
|
return [...filteredFontFamilies];
|
|
1271
1341
|
};
|
|
1272
1342
|
|
|
1273
|
-
// src/controls/font-family-control.tsx
|
|
1343
|
+
// src/controls/font-family-control/enqueue-font.tsx
|
|
1344
|
+
var enqueueFont = (fontFamily, context = "editor") => {
|
|
1345
|
+
const extendedWindow = window;
|
|
1346
|
+
return extendedWindow.elementor?.helpers?.enqueueFont?.(fontFamily, context) ?? null;
|
|
1347
|
+
};
|
|
1348
|
+
|
|
1349
|
+
// src/controls/font-family-control/font-family-control.tsx
|
|
1274
1350
|
var SIZE2 = "tiny";
|
|
1275
1351
|
var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
1276
1352
|
const [searchValue, setSearchValue] = (0, import_react9.useState)("");
|
|
1277
1353
|
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(import_editor_props14.stringPropTypeUtil);
|
|
1278
|
-
const
|
|
1279
|
-
const popoverState = (0, import_ui23.usePopupState)({ variant: "popover", popupId });
|
|
1354
|
+
const popoverState = (0, import_ui23.usePopupState)({ variant: "popover" });
|
|
1280
1355
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1281
|
-
if (!filteredFontFamilies) {
|
|
1282
|
-
return null;
|
|
1283
|
-
}
|
|
1284
1356
|
const handleSearch = (event) => {
|
|
1285
1357
|
setSearchValue(event.target.value);
|
|
1286
1358
|
};
|
|
@@ -1306,42 +1378,27 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1306
1378
|
...(0, import_ui23.bindPopover)(popoverState),
|
|
1307
1379
|
onClose: handleClose
|
|
1308
1380
|
},
|
|
1309
|
-
/* @__PURE__ */ React28.createElement(import_ui23.Stack, null, /* @__PURE__ */ React28.createElement(import_ui23.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React28.createElement(import_icons5.EditIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React28.createElement(import_ui23.Typography, { variant: "subtitle2" }, (0,
|
|
1381
|
+
/* @__PURE__ */ React28.createElement(import_ui23.Stack, null, /* @__PURE__ */ React28.createElement(import_ui23.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React28.createElement(import_icons5.EditIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React28.createElement(import_ui23.Typography, { variant: "subtitle2" }, (0, import_i18n8.__)("Font Family", "elementor")), /* @__PURE__ */ React28.createElement(import_ui23.IconButton, { size: SIZE2, sx: { ml: "auto" }, onClick: handleClose }, /* @__PURE__ */ React28.createElement(import_icons5.XIcon, { fontSize: SIZE2 }))), /* @__PURE__ */ React28.createElement(import_ui23.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React28.createElement(
|
|
1310
1382
|
import_ui23.TextField,
|
|
1311
1383
|
{
|
|
1312
1384
|
fullWidth: true,
|
|
1313
1385
|
size: SIZE2,
|
|
1314
1386
|
value: searchValue,
|
|
1315
|
-
placeholder: (0,
|
|
1387
|
+
placeholder: (0, import_i18n8.__)("Search", "elementor"),
|
|
1316
1388
|
onChange: handleSearch,
|
|
1317
1389
|
InputProps: {
|
|
1318
1390
|
startAdornment: /* @__PURE__ */ React28.createElement(import_ui23.InputAdornment, { position: "start" }, /* @__PURE__ */ React28.createElement(import_icons5.SearchIcon, { fontSize: SIZE2 }))
|
|
1319
1391
|
}
|
|
1320
1392
|
}
|
|
1321
|
-
)), /* @__PURE__ */ React28.createElement(import_ui23.Divider, null),
|
|
1322
|
-
|
|
1393
|
+
)), /* @__PURE__ */ React28.createElement(import_ui23.Divider, null), filteredFontFamilies.length > 0 ? /* @__PURE__ */ React28.createElement(
|
|
1394
|
+
FontList,
|
|
1323
1395
|
{
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
import_ui23.MenuItem,
|
|
1331
|
-
{
|
|
1332
|
-
key: item,
|
|
1333
|
-
selected: isSelected,
|
|
1334
|
-
autoFocus: isSelected,
|
|
1335
|
-
onClick: () => {
|
|
1336
|
-
setFontFamily(item);
|
|
1337
|
-
handleClose();
|
|
1338
|
-
},
|
|
1339
|
-
sx: { px: 1.5, typography: "caption" },
|
|
1340
|
-
style: { fontFamily: item }
|
|
1341
|
-
},
|
|
1342
|
-
item
|
|
1343
|
-
);
|
|
1344
|
-
})))) : /* @__PURE__ */ React28.createElement(import_ui23.Stack, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React28.createElement(import_icons5.PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React28.createElement(import_ui23.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n9.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React28.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React28.createElement(import_ui23.Typography, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React28.createElement(
|
|
1396
|
+
fontListItems: filteredFontFamilies,
|
|
1397
|
+
setFontFamily,
|
|
1398
|
+
handleClose,
|
|
1399
|
+
fontFamily
|
|
1400
|
+
}
|
|
1401
|
+
) : /* @__PURE__ */ React28.createElement(import_ui23.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, /* @__PURE__ */ React28.createElement(import_ui23.Stack, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React28.createElement(import_icons5.PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React28.createElement(import_ui23.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n8.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React28.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React28.createElement(import_ui23.Typography, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React28.createElement(
|
|
1345
1402
|
import_ui23.Link,
|
|
1346
1403
|
{
|
|
1347
1404
|
color: "secondary",
|
|
@@ -1349,10 +1406,139 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1349
1406
|
component: "button",
|
|
1350
1407
|
onClick: () => setSearchValue("")
|
|
1351
1408
|
},
|
|
1352
|
-
(0,
|
|
1353
|
-
), "\xA0", (0,
|
|
1409
|
+
(0, import_i18n8.__)("Clear the filters", "elementor")
|
|
1410
|
+
), "\xA0", (0, import_i18n8.__)("and try again.", "elementor")))))
|
|
1354
1411
|
));
|
|
1355
1412
|
});
|
|
1413
|
+
var LIST_ITEM_HEIGHT = 36;
|
|
1414
|
+
var LIST_ITEMS_BUFFER = 6;
|
|
1415
|
+
var FontList = ({ fontListItems, setFontFamily, handleClose, fontFamily }) => {
|
|
1416
|
+
const containerRef = (0, import_react9.useRef)(null);
|
|
1417
|
+
const selectedItem = fontListItems.find((item) => item.value === fontFamily);
|
|
1418
|
+
const debouncedVirtualizeChange = useDebounce(({ getVirtualIndexes }) => {
|
|
1419
|
+
getVirtualIndexes().forEach((index) => {
|
|
1420
|
+
const item = fontListItems[index];
|
|
1421
|
+
if (item && item.type === "font") {
|
|
1422
|
+
enqueueFont(item.value);
|
|
1423
|
+
}
|
|
1424
|
+
});
|
|
1425
|
+
}, 100);
|
|
1426
|
+
const virtualizer = (0, import_react_virtual.useVirtualizer)({
|
|
1427
|
+
count: fontListItems.length,
|
|
1428
|
+
getScrollElement: () => containerRef.current,
|
|
1429
|
+
estimateSize: () => LIST_ITEM_HEIGHT,
|
|
1430
|
+
overscan: LIST_ITEMS_BUFFER,
|
|
1431
|
+
onChange: debouncedVirtualizeChange
|
|
1432
|
+
});
|
|
1433
|
+
(0, import_react9.useEffect)(
|
|
1434
|
+
() => {
|
|
1435
|
+
virtualizer.scrollToIndex(fontListItems.findIndex((item) => item.value === fontFamily));
|
|
1436
|
+
},
|
|
1437
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1438
|
+
[fontFamily]
|
|
1439
|
+
);
|
|
1440
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1441
|
+
import_ui23.Box,
|
|
1442
|
+
{
|
|
1443
|
+
ref: containerRef,
|
|
1444
|
+
sx: {
|
|
1445
|
+
overflowY: "auto",
|
|
1446
|
+
height: 260,
|
|
1447
|
+
width: 220
|
|
1448
|
+
}
|
|
1449
|
+
},
|
|
1450
|
+
/* @__PURE__ */ React28.createElement(
|
|
1451
|
+
StyledMenuList,
|
|
1452
|
+
{
|
|
1453
|
+
role: "listbox",
|
|
1454
|
+
style: {
|
|
1455
|
+
height: `${virtualizer.getTotalSize()}px`
|
|
1456
|
+
},
|
|
1457
|
+
"data-testid": "font-list"
|
|
1458
|
+
},
|
|
1459
|
+
virtualizer.getVirtualItems().map((virtualRow) => {
|
|
1460
|
+
const item = fontListItems[virtualRow.index];
|
|
1461
|
+
const isLast = virtualRow.index === fontListItems.length - 1;
|
|
1462
|
+
const isFirst = virtualRow.index === 1;
|
|
1463
|
+
const isSelected = selectedItem?.value === item.value;
|
|
1464
|
+
const tabIndexFallback = !selectedItem ? 0 : -1;
|
|
1465
|
+
if (item.type === "category") {
|
|
1466
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1467
|
+
import_ui23.ListSubheader,
|
|
1468
|
+
{
|
|
1469
|
+
key: virtualRow.key,
|
|
1470
|
+
style: {
|
|
1471
|
+
transform: `translateY(${virtualRow.start}px)`
|
|
1472
|
+
}
|
|
1473
|
+
},
|
|
1474
|
+
item.value
|
|
1475
|
+
);
|
|
1476
|
+
}
|
|
1477
|
+
return /* @__PURE__ */ React28.createElement(
|
|
1478
|
+
"li",
|
|
1479
|
+
{
|
|
1480
|
+
key: virtualRow.key,
|
|
1481
|
+
role: "option",
|
|
1482
|
+
"aria-selected": isSelected,
|
|
1483
|
+
onClick: () => {
|
|
1484
|
+
setFontFamily(item.value);
|
|
1485
|
+
handleClose();
|
|
1486
|
+
},
|
|
1487
|
+
onKeyDown: (event) => {
|
|
1488
|
+
if (event.key === "Enter") {
|
|
1489
|
+
setFontFamily(item.value);
|
|
1490
|
+
handleClose();
|
|
1491
|
+
}
|
|
1492
|
+
if (event.key === "ArrowDown" && isLast) {
|
|
1493
|
+
event.preventDefault();
|
|
1494
|
+
event.stopPropagation();
|
|
1495
|
+
}
|
|
1496
|
+
if (event.key === "ArrowUp" && isFirst) {
|
|
1497
|
+
event.preventDefault();
|
|
1498
|
+
event.stopPropagation();
|
|
1499
|
+
}
|
|
1500
|
+
},
|
|
1501
|
+
tabIndex: isSelected ? 0 : tabIndexFallback,
|
|
1502
|
+
style: {
|
|
1503
|
+
transform: `translateY(${virtualRow.start}px)`,
|
|
1504
|
+
fontFamily: item.value
|
|
1505
|
+
}
|
|
1506
|
+
},
|
|
1507
|
+
item.value
|
|
1508
|
+
);
|
|
1509
|
+
})
|
|
1510
|
+
)
|
|
1511
|
+
);
|
|
1512
|
+
};
|
|
1513
|
+
var StyledMenuList = (0, import_ui23.styled)(import_ui23.MenuList)(({ theme }) => ({
|
|
1514
|
+
"& > li": {
|
|
1515
|
+
height: LIST_ITEM_HEIGHT,
|
|
1516
|
+
position: "absolute",
|
|
1517
|
+
top: 0,
|
|
1518
|
+
left: 0,
|
|
1519
|
+
width: "100%"
|
|
1520
|
+
},
|
|
1521
|
+
'& > [role="option"]': {
|
|
1522
|
+
...theme.typography.caption,
|
|
1523
|
+
lineHeight: "inherit",
|
|
1524
|
+
padding: theme.spacing(0.75, 2),
|
|
1525
|
+
"&:hover, &:focus": {
|
|
1526
|
+
backgroundColor: theme.palette.action.hover
|
|
1527
|
+
},
|
|
1528
|
+
'&[aria-selected="true"]': {
|
|
1529
|
+
backgroundColor: theme.palette.action.selected
|
|
1530
|
+
},
|
|
1531
|
+
cursor: "pointer",
|
|
1532
|
+
textOverflow: "ellipsis"
|
|
1533
|
+
},
|
|
1534
|
+
width: "100%",
|
|
1535
|
+
position: "relative"
|
|
1536
|
+
}));
|
|
1537
|
+
var useDebounce = (fn, delay) => {
|
|
1538
|
+
const [debouncedFn] = (0, import_react9.useState)(() => (0, import_utils2.debounce)(fn, delay));
|
|
1539
|
+
(0, import_react9.useEffect)(() => () => debouncedFn.cancel(), [debouncedFn]);
|
|
1540
|
+
return debouncedFn;
|
|
1541
|
+
};
|
|
1356
1542
|
|
|
1357
1543
|
// src/controls/url-control.tsx
|
|
1358
1544
|
var React29 = __toESM(require("react"));
|
|
@@ -1377,11 +1563,12 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1377
1563
|
var React31 = __toESM(require("react"));
|
|
1378
1564
|
var import_react11 = require("react");
|
|
1379
1565
|
var import_editor_props16 = require("@elementor/editor-props");
|
|
1380
|
-
var
|
|
1566
|
+
var import_http2 = require("@elementor/http");
|
|
1381
1567
|
var import_icons7 = require("@elementor/icons");
|
|
1382
1568
|
var import_session = require("@elementor/session");
|
|
1383
1569
|
var import_ui26 = require("@elementor/ui");
|
|
1384
|
-
var
|
|
1570
|
+
var import_utils3 = require("@elementor/utils");
|
|
1571
|
+
var import_i18n9 = require("@wordpress/i18n");
|
|
1385
1572
|
|
|
1386
1573
|
// src/components/autocomplete.tsx
|
|
1387
1574
|
var React30 = __toESM(require("react"));
|
|
@@ -1539,7 +1726,7 @@ var LinkControl = createControl((props) => {
|
|
|
1539
1726
|
debounceFetch({ ...requestParams, term: newValue });
|
|
1540
1727
|
};
|
|
1541
1728
|
const debounceFetch = (0, import_react11.useMemo)(
|
|
1542
|
-
() => debounce(
|
|
1729
|
+
() => (0, import_utils3.debounce)(
|
|
1543
1730
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
1544
1731
|
setOptions(formatOptions(newOptions));
|
|
1545
1732
|
}),
|
|
@@ -1556,13 +1743,13 @@ var LinkControl = createControl((props) => {
|
|
|
1556
1743
|
alignItems: "center"
|
|
1557
1744
|
}
|
|
1558
1745
|
},
|
|
1559
|
-
/* @__PURE__ */ React31.createElement(ControlLabel, null, (0,
|
|
1746
|
+
/* @__PURE__ */ React31.createElement(ControlLabel, null, (0, import_i18n9.__)("Link", "elementor")),
|
|
1560
1747
|
/* @__PURE__ */ React31.createElement(
|
|
1561
1748
|
ToggleIconControl,
|
|
1562
1749
|
{
|
|
1563
1750
|
enabled: isEnabled,
|
|
1564
1751
|
onIconClick: onEnabledChange,
|
|
1565
|
-
label: (0,
|
|
1752
|
+
label: (0, import_i18n9.__)("Toggle link", "elementor")
|
|
1566
1753
|
}
|
|
1567
1754
|
)
|
|
1568
1755
|
), /* @__PURE__ */ React31.createElement(import_ui26.Collapse, { in: isEnabled, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React31.createElement(import_ui26.Stack, { gap: 1.5 }, /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React31.createElement(ControlActions, null, /* @__PURE__ */ React31.createElement(
|
|
@@ -1586,14 +1773,14 @@ var SwitchControl = () => {
|
|
|
1586
1773
|
const onClick = () => {
|
|
1587
1774
|
setValue(!value);
|
|
1588
1775
|
};
|
|
1589
|
-
return /* @__PURE__ */ React31.createElement(import_ui26.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true }, /* @__PURE__ */ React31.createElement(ControlLabel, null, (0,
|
|
1776
|
+
return /* @__PURE__ */ React31.createElement(import_ui26.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true }, /* @__PURE__ */ React31.createElement(ControlLabel, null, (0, import_i18n9.__)("Open in a new tab", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true }, /* @__PURE__ */ React31.createElement(import_ui26.Switch, { checked: value, onClick })));
|
|
1590
1777
|
};
|
|
1591
1778
|
async function fetchOptions(ajaxUrl, params) {
|
|
1592
1779
|
if (!params || !ajaxUrl) {
|
|
1593
1780
|
return [];
|
|
1594
1781
|
}
|
|
1595
1782
|
try {
|
|
1596
|
-
const { data: response } = await (0,
|
|
1783
|
+
const { data: response } = await (0, import_http2.httpService)().get(ajaxUrl, { params });
|
|
1597
1784
|
return response.data.value;
|
|
1598
1785
|
} catch {
|
|
1599
1786
|
return [];
|
|
@@ -1616,22 +1803,13 @@ function generateFirstLoadedOption(unionValue) {
|
|
|
1616
1803
|
}
|
|
1617
1804
|
] : [];
|
|
1618
1805
|
}
|
|
1619
|
-
function debounce(fn, timeout) {
|
|
1620
|
-
let timer;
|
|
1621
|
-
return (...args) => {
|
|
1622
|
-
clearTimeout(timer);
|
|
1623
|
-
timer = setTimeout(() => {
|
|
1624
|
-
fn(...args);
|
|
1625
|
-
}, timeout);
|
|
1626
|
-
};
|
|
1627
|
-
}
|
|
1628
1806
|
|
|
1629
1807
|
// src/controls/gap-control.tsx
|
|
1630
1808
|
var React32 = __toESM(require("react"));
|
|
1631
1809
|
var import_editor_props17 = require("@elementor/editor-props");
|
|
1632
1810
|
var import_icons8 = require("@elementor/icons");
|
|
1633
1811
|
var import_ui27 = require("@elementor/ui");
|
|
1634
|
-
var
|
|
1812
|
+
var import_i18n10 = require("@wordpress/i18n");
|
|
1635
1813
|
var GapControl = createControl(({ label }) => {
|
|
1636
1814
|
const {
|
|
1637
1815
|
value: directionValue,
|
|
@@ -1642,7 +1820,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
1642
1820
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
1643
1821
|
const onLinkToggle = () => {
|
|
1644
1822
|
if (!isLinked) {
|
|
1645
|
-
setSizeValue(directionValue?.column
|
|
1823
|
+
setSizeValue(directionValue?.column?.value);
|
|
1646
1824
|
return;
|
|
1647
1825
|
}
|
|
1648
1826
|
const value = sizeValue ? import_editor_props17.sizePropTypeUtil.create(sizeValue) : null;
|
|
@@ -1651,11 +1829,14 @@ var GapControl = createControl(({ label }) => {
|
|
|
1651
1829
|
column: value
|
|
1652
1830
|
});
|
|
1653
1831
|
};
|
|
1832
|
+
const tooltipLabel = label.toLowerCase();
|
|
1654
1833
|
const LinkedIcon = isLinked ? import_icons8.LinkIcon : import_icons8.DetachIcon;
|
|
1655
|
-
|
|
1834
|
+
const linkedLabel = (0, import_i18n10.__)("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
1835
|
+
const unlinkedLabel = (0, import_i18n10.__)("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
1836
|
+
return /* @__PURE__ */ React32.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React32.createElement(import_ui27.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(ControlLabel, null, label), /* @__PURE__ */ React32.createElement(import_ui27.Tooltip, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React32.createElement(
|
|
1656
1837
|
import_ui27.ToggleButton,
|
|
1657
1838
|
{
|
|
1658
|
-
"aria-label":
|
|
1839
|
+
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
1659
1840
|
size: "tiny",
|
|
1660
1841
|
value: "check",
|
|
1661
1842
|
selected: isLinked,
|
|
@@ -1663,7 +1844,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
1663
1844
|
onChange: onLinkToggle
|
|
1664
1845
|
},
|
|
1665
1846
|
/* @__PURE__ */ React32.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1666
|
-
)), /* @__PURE__ */ React32.createElement(import_ui27.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(import_ui27.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(import_ui27.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, (0,
|
|
1847
|
+
))), /* @__PURE__ */ React32.createElement(import_ui27.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React32.createElement(import_ui27.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(import_ui27.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, (0, import_i18n10.__)("Column", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui27.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(Control4, { bind: "column", isLinked }))), /* @__PURE__ */ React32.createElement(import_ui27.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React32.createElement(import_ui27.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, (0, import_i18n10.__)("Row", "elementor"))), /* @__PURE__ */ React32.createElement(import_ui27.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React32.createElement(Control4, { bind: "row", isLinked })))));
|
|
1667
1848
|
});
|
|
1668
1849
|
var Control4 = ({ bind, isLinked }) => {
|
|
1669
1850
|
if (isLinked) {
|
|
@@ -1678,7 +1859,7 @@ var import_editor_props18 = require("@elementor/editor-props");
|
|
|
1678
1859
|
var import_icons9 = require("@elementor/icons");
|
|
1679
1860
|
var import_ui28 = require("@elementor/ui");
|
|
1680
1861
|
var import_wp_media2 = require("@elementor/wp-media");
|
|
1681
|
-
var
|
|
1862
|
+
var import_i18n11 = require("@wordpress/i18n");
|
|
1682
1863
|
var TILE_SIZE = 8;
|
|
1683
1864
|
var TILE_WHITE = "transparent";
|
|
1684
1865
|
var TILE_BLACK = "#c1c1c1";
|
|
@@ -1706,9 +1887,9 @@ var SvgMediaControl = createControl(() => {
|
|
|
1706
1887
|
const { id, url } = value ?? {};
|
|
1707
1888
|
const { data: attachment, isFetching } = (0, import_wp_media2.useWpMediaAttachment)(id?.value || null);
|
|
1708
1889
|
const src = attachment?.url ?? url?.value ?? null;
|
|
1890
|
+
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
1709
1891
|
const { open } = (0, import_wp_media2.useWpMediaFrame)({
|
|
1710
|
-
|
|
1711
|
-
allowedExtensions: ["svg"],
|
|
1892
|
+
mediaTypes: ["svg"],
|
|
1712
1893
|
multiple: false,
|
|
1713
1894
|
selected: id?.value || null,
|
|
1714
1895
|
onSelect: (selectedAttachment) => {
|
|
@@ -1721,12 +1902,18 @@ var SvgMediaControl = createControl(() => {
|
|
|
1721
1902
|
});
|
|
1722
1903
|
}
|
|
1723
1904
|
});
|
|
1724
|
-
|
|
1905
|
+
const handleClick = (openOptions) => {
|
|
1906
|
+
if (allowSvgUpload) {
|
|
1907
|
+
open(openOptions);
|
|
1908
|
+
} else {
|
|
1909
|
+
}
|
|
1910
|
+
};
|
|
1911
|
+
return /* @__PURE__ */ React33.createElement(import_ui28.Stack, { gap: 1 }, /* @__PURE__ */ React33.createElement(ControlLabel, null, " ", (0, import_i18n11.__)("SVG", "elementor"), " "), /* @__PURE__ */ React33.createElement(ControlActions, null, /* @__PURE__ */ React33.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React33.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React33.createElement(import_ui28.CircularProgress, { role: "progressbar" }) : /* @__PURE__ */ React33.createElement(
|
|
1725
1912
|
import_ui28.CardMedia,
|
|
1726
1913
|
{
|
|
1727
1914
|
component: "img",
|
|
1728
1915
|
image: src,
|
|
1729
|
-
alt: (0,
|
|
1916
|
+
alt: (0, import_i18n11.__)("Preview SVG", "elementor"),
|
|
1730
1917
|
sx: { maxHeight: "140px", width: "50px" }
|
|
1731
1918
|
}
|
|
1732
1919
|
)), /* @__PURE__ */ React33.createElement(
|
|
@@ -1744,9 +1931,9 @@ var SvgMediaControl = createControl(() => {
|
|
|
1744
1931
|
size: "tiny",
|
|
1745
1932
|
color: "inherit",
|
|
1746
1933
|
variant: "outlined",
|
|
1747
|
-
onClick: () =>
|
|
1934
|
+
onClick: () => handleClick({ mode: "browse" })
|
|
1748
1935
|
},
|
|
1749
|
-
(0,
|
|
1936
|
+
(0, import_i18n11.__)("Select SVG", "elementor")
|
|
1750
1937
|
), /* @__PURE__ */ React33.createElement(
|
|
1751
1938
|
import_ui28.Button,
|
|
1752
1939
|
{
|
|
@@ -1754,9 +1941,9 @@ var SvgMediaControl = createControl(() => {
|
|
|
1754
1941
|
variant: "text",
|
|
1755
1942
|
color: "inherit",
|
|
1756
1943
|
startIcon: /* @__PURE__ */ React33.createElement(import_icons9.UploadIcon, null),
|
|
1757
|
-
onClick: () =>
|
|
1944
|
+
onClick: () => handleClick({ mode: "upload" })
|
|
1758
1945
|
},
|
|
1759
|
-
(0,
|
|
1946
|
+
(0, import_i18n11.__)("Upload", "elementor")
|
|
1760
1947
|
))
|
|
1761
1948
|
))));
|
|
1762
1949
|
});
|
|
@@ -1765,14 +1952,14 @@ var SvgMediaControl = createControl(() => {
|
|
|
1765
1952
|
var React39 = __toESM(require("react"));
|
|
1766
1953
|
var import_editor_props23 = require("@elementor/editor-props");
|
|
1767
1954
|
var import_ui35 = require("@elementor/ui");
|
|
1768
|
-
var
|
|
1955
|
+
var import_i18n17 = require("@wordpress/i18n");
|
|
1769
1956
|
|
|
1770
1957
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1771
1958
|
var React38 = __toESM(require("react"));
|
|
1772
1959
|
var import_editor_props22 = require("@elementor/editor-props");
|
|
1773
1960
|
var import_ui34 = require("@elementor/ui");
|
|
1774
1961
|
var import_wp_media3 = require("@elementor/wp-media");
|
|
1775
|
-
var
|
|
1962
|
+
var import_i18n16 = require("@wordpress/i18n");
|
|
1776
1963
|
|
|
1777
1964
|
// src/env.ts
|
|
1778
1965
|
var import_env = require("@elementor/env");
|
|
@@ -1782,23 +1969,23 @@ var { env } = (0, import_env.parseEnv)("@elementor/editor-controls");
|
|
|
1782
1969
|
var React34 = __toESM(require("react"));
|
|
1783
1970
|
var import_icons10 = require("@elementor/icons");
|
|
1784
1971
|
var import_ui29 = require("@elementor/ui");
|
|
1785
|
-
var
|
|
1972
|
+
var import_i18n12 = require("@wordpress/i18n");
|
|
1786
1973
|
var attachmentControlOptions = [
|
|
1787
1974
|
{
|
|
1788
1975
|
value: "fixed",
|
|
1789
|
-
label: (0,
|
|
1976
|
+
label: (0, import_i18n12.__)("Fixed", "elementor"),
|
|
1790
1977
|
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(import_icons10.PinIcon, { fontSize: size }),
|
|
1791
1978
|
showTooltip: true
|
|
1792
1979
|
},
|
|
1793
1980
|
{
|
|
1794
1981
|
value: "scroll",
|
|
1795
|
-
label: (0,
|
|
1982
|
+
label: (0, import_i18n12.__)("Scroll", "elementor"),
|
|
1796
1983
|
renderContent: ({ size }) => /* @__PURE__ */ React34.createElement(import_icons10.PinnedOffIcon, { fontSize: size }),
|
|
1797
1984
|
showTooltip: true
|
|
1798
1985
|
}
|
|
1799
1986
|
];
|
|
1800
1987
|
var BackgroundImageOverlayAttachment = () => {
|
|
1801
|
-
return /* @__PURE__ */ React34.createElement(PopoverGridContainer, null, /* @__PURE__ */ React34.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel, null, (0,
|
|
1988
|
+
return /* @__PURE__ */ React34.createElement(PopoverGridContainer, null, /* @__PURE__ */ React34.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel, null, (0, import_i18n12.__)("Attachment", "elementor"))), /* @__PURE__ */ React34.createElement(import_ui29.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React34.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
1802
1989
|
};
|
|
1803
1990
|
|
|
1804
1991
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
@@ -1806,18 +1993,18 @@ var React35 = __toESM(require("react"));
|
|
|
1806
1993
|
var import_editor_props19 = require("@elementor/editor-props");
|
|
1807
1994
|
var import_icons11 = require("@elementor/icons");
|
|
1808
1995
|
var import_ui30 = require("@elementor/ui");
|
|
1809
|
-
var
|
|
1996
|
+
var import_i18n13 = require("@wordpress/i18n");
|
|
1810
1997
|
var backgroundPositionOptions = [
|
|
1811
|
-
{ label: (0,
|
|
1812
|
-
{ label: (0,
|
|
1813
|
-
{ label: (0,
|
|
1814
|
-
{ label: (0,
|
|
1815
|
-
{ label: (0,
|
|
1816
|
-
{ label: (0,
|
|
1817
|
-
{ label: (0,
|
|
1818
|
-
{ label: (0,
|
|
1819
|
-
{ label: (0,
|
|
1820
|
-
{ label: (0,
|
|
1998
|
+
{ label: (0, import_i18n13.__)("Center center", "elementor"), value: "center center" },
|
|
1999
|
+
{ label: (0, import_i18n13.__)("Center left", "elementor"), value: "center left" },
|
|
2000
|
+
{ label: (0, import_i18n13.__)("Center right", "elementor"), value: "center right" },
|
|
2001
|
+
{ label: (0, import_i18n13.__)("Top center", "elementor"), value: "top center" },
|
|
2002
|
+
{ label: (0, import_i18n13.__)("Top left", "elementor"), value: "top left" },
|
|
2003
|
+
{ label: (0, import_i18n13.__)("Top right", "elementor"), value: "top right" },
|
|
2004
|
+
{ label: (0, import_i18n13.__)("Bottom center", "elementor"), value: "bottom center" },
|
|
2005
|
+
{ label: (0, import_i18n13.__)("Bottom left", "elementor"), value: "bottom left" },
|
|
2006
|
+
{ label: (0, import_i18n13.__)("Bottom right", "elementor"), value: "bottom right" },
|
|
2007
|
+
{ label: (0, import_i18n13.__)("Custom", "elementor"), value: "custom" }
|
|
1821
2008
|
];
|
|
1822
2009
|
var BackgroundImageOverlayPosition = () => {
|
|
1823
2010
|
const backgroundImageOffsetContext = useBoundProp(import_editor_props19.backgroundImagePositionOffsetPropTypeUtil);
|
|
@@ -1831,7 +2018,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
1831
2018
|
stringPropContext.setValue(value);
|
|
1832
2019
|
}
|
|
1833
2020
|
};
|
|
1834
|
-
return /* @__PURE__ */ React35.createElement(import_ui30.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React35.createElement(import_ui30.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(PopoverGridContainer, null, /* @__PURE__ */ React35.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, (0,
|
|
2021
|
+
return /* @__PURE__ */ React35.createElement(import_ui30.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React35.createElement(import_ui30.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React35.createElement(PopoverGridContainer, null, /* @__PURE__ */ React35.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, (0, import_i18n13.__)("Position", "elementor"))), /* @__PURE__ */ React35.createElement(import_ui30.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React35.createElement(
|
|
1835
2022
|
import_ui30.Select,
|
|
1836
2023
|
{
|
|
1837
2024
|
size: "tiny",
|
|
@@ -1847,35 +2034,35 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
1847
2034
|
var React36 = __toESM(require("react"));
|
|
1848
2035
|
var import_icons12 = require("@elementor/icons");
|
|
1849
2036
|
var import_ui31 = require("@elementor/ui");
|
|
1850
|
-
var
|
|
2037
|
+
var import_i18n14 = require("@wordpress/i18n");
|
|
1851
2038
|
var repeatControlOptions = [
|
|
1852
2039
|
{
|
|
1853
2040
|
value: "repeat",
|
|
1854
|
-
label: (0,
|
|
2041
|
+
label: (0, import_i18n14.__)("Repeat", "elementor"),
|
|
1855
2042
|
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.GridDotsIcon, { fontSize: size }),
|
|
1856
2043
|
showTooltip: true
|
|
1857
2044
|
},
|
|
1858
2045
|
{
|
|
1859
2046
|
value: "repeat-x",
|
|
1860
|
-
label: (0,
|
|
2047
|
+
label: (0, import_i18n14.__)("Repeat-x", "elementor"),
|
|
1861
2048
|
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.DotsHorizontalIcon, { fontSize: size }),
|
|
1862
2049
|
showTooltip: true
|
|
1863
2050
|
},
|
|
1864
2051
|
{
|
|
1865
2052
|
value: "repeat-y",
|
|
1866
|
-
label: (0,
|
|
2053
|
+
label: (0, import_i18n14.__)("Repeat-y", "elementor"),
|
|
1867
2054
|
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.DotsVerticalIcon, { fontSize: size }),
|
|
1868
2055
|
showTooltip: true
|
|
1869
2056
|
},
|
|
1870
2057
|
{
|
|
1871
2058
|
value: "no-repeat",
|
|
1872
|
-
label: (0,
|
|
2059
|
+
label: (0, import_i18n14.__)("No-repeat", "elementor"),
|
|
1873
2060
|
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.XIcon, { fontSize: size }),
|
|
1874
2061
|
showTooltip: true
|
|
1875
2062
|
}
|
|
1876
2063
|
];
|
|
1877
2064
|
var BackgroundImageOverlayRepeat = () => {
|
|
1878
|
-
return /* @__PURE__ */ React36.createElement(PopoverGridContainer, null, /* @__PURE__ */ React36.createElement(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, (0,
|
|
2065
|
+
return /* @__PURE__ */ React36.createElement(PopoverGridContainer, null, /* @__PURE__ */ React36.createElement(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, (0, import_i18n14.__)("Repeat", "elementor"))), /* @__PURE__ */ React36.createElement(import_ui31.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React36.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
1879
2066
|
};
|
|
1880
2067
|
|
|
1881
2068
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
@@ -1883,29 +2070,29 @@ var React37 = __toESM(require("react"));
|
|
|
1883
2070
|
var import_editor_props20 = require("@elementor/editor-props");
|
|
1884
2071
|
var import_icons13 = require("@elementor/icons");
|
|
1885
2072
|
var import_ui32 = require("@elementor/ui");
|
|
1886
|
-
var
|
|
2073
|
+
var import_i18n15 = require("@wordpress/i18n");
|
|
1887
2074
|
var sizeControlOptions = [
|
|
1888
2075
|
{
|
|
1889
2076
|
value: "auto",
|
|
1890
|
-
label: (0,
|
|
2077
|
+
label: (0, import_i18n15.__)("Auto", "elementor"),
|
|
1891
2078
|
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(import_icons13.LetterAIcon, { fontSize: size }),
|
|
1892
2079
|
showTooltip: true
|
|
1893
2080
|
},
|
|
1894
2081
|
{
|
|
1895
2082
|
value: "cover",
|
|
1896
|
-
label: (0,
|
|
2083
|
+
label: (0, import_i18n15.__)("Cover", "elementor"),
|
|
1897
2084
|
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(import_icons13.ArrowsMaximizeIcon, { fontSize: size }),
|
|
1898
2085
|
showTooltip: true
|
|
1899
2086
|
},
|
|
1900
2087
|
{
|
|
1901
2088
|
value: "contain",
|
|
1902
|
-
label: (0,
|
|
2089
|
+
label: (0, import_i18n15.__)("Contain", "elementor"),
|
|
1903
2090
|
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(import_icons13.ArrowBarBothIcon, { fontSize: size }),
|
|
1904
2091
|
showTooltip: true
|
|
1905
2092
|
},
|
|
1906
2093
|
{
|
|
1907
2094
|
value: "custom",
|
|
1908
|
-
label: (0,
|
|
2095
|
+
label: (0, import_i18n15.__)("Custom", "elementor"),
|
|
1909
2096
|
renderContent: ({ size }) => /* @__PURE__ */ React37.createElement(import_icons13.PencilIcon, { fontSize: size }),
|
|
1910
2097
|
showTooltip: true
|
|
1911
2098
|
}
|
|
@@ -1921,7 +2108,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1921
2108
|
stringPropContext.setValue(size);
|
|
1922
2109
|
}
|
|
1923
2110
|
};
|
|
1924
|
-
return /* @__PURE__ */ React37.createElement(import_ui32.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, (0,
|
|
2111
|
+
return /* @__PURE__ */ React37.createElement(import_ui32.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(ControlLabel, null, (0, import_i18n15.__)("Size", "elementor"))), /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React37.createElement(
|
|
1925
2112
|
ControlToggleButtonGroup,
|
|
1926
2113
|
{
|
|
1927
2114
|
exclusive: true,
|
|
@@ -1929,7 +2116,19 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1929
2116
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value,
|
|
1930
2117
|
onChange: handleSizeChange
|
|
1931
2118
|
}
|
|
1932
|
-
)))), isCustom ? /* @__PURE__ */ React37.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React37.createElement(
|
|
2119
|
+
)))), isCustom ? /* @__PURE__ */ React37.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(PopoverGridContainer, null, /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React37.createElement(
|
|
2120
|
+
SizeControl,
|
|
2121
|
+
{
|
|
2122
|
+
startIcon: /* @__PURE__ */ React37.createElement(import_icons13.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
2123
|
+
extendedValues: ["auto"]
|
|
2124
|
+
}
|
|
2125
|
+
))), /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React37.createElement(
|
|
2126
|
+
SizeControl,
|
|
2127
|
+
{
|
|
2128
|
+
startIcon: /* @__PURE__ */ React37.createElement(import_icons13.ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
2129
|
+
extendedValues: ["auto"]
|
|
2130
|
+
}
|
|
2131
|
+
)))))) : null);
|
|
1933
2132
|
};
|
|
1934
2133
|
|
|
1935
2134
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
@@ -2001,10 +2200,10 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
2001
2200
|
}
|
|
2002
2201
|
});
|
|
2003
2202
|
var backgroundResolutionOptions = [
|
|
2004
|
-
{ label: (0,
|
|
2005
|
-
{ label: (0,
|
|
2006
|
-
{ label: (0,
|
|
2007
|
-
{ label: (0,
|
|
2203
|
+
{ label: (0, import_i18n16.__)("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
2204
|
+
{ label: (0, import_i18n16.__)("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
2205
|
+
{ label: (0, import_i18n16.__)("Large 1024 x 1024", "elementor"), value: "large" },
|
|
2206
|
+
{ label: (0, import_i18n16.__)("Full", "elementor"), value: "full" }
|
|
2008
2207
|
];
|
|
2009
2208
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
2010
2209
|
const { propType, value: overlayValues, setValue } = useBoundProp(import_editor_props22.backgroundOverlayPropTypeUtil);
|
|
@@ -2013,7 +2212,7 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
2013
2212
|
{
|
|
2014
2213
|
values: overlayValues ?? [],
|
|
2015
2214
|
setValues: setValue,
|
|
2016
|
-
label: (0,
|
|
2215
|
+
label: (0, import_i18n16.__)("Overlay", "elementor"),
|
|
2017
2216
|
itemSettings: {
|
|
2018
2217
|
Icon: ItemIcon2,
|
|
2019
2218
|
Label: ItemLabel2,
|
|
@@ -2031,7 +2230,7 @@ var Content2 = () => {
|
|
|
2031
2230
|
image: getInitialBackgroundOverlay().value,
|
|
2032
2231
|
color: initialBackgroundColorOverlay.value
|
|
2033
2232
|
});
|
|
2034
|
-
return /* @__PURE__ */ React38.createElement(import_ui34.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React38.createElement(import_ui34.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React38.createElement(import_ui34.Tabs, { ...getTabsProps(), "aria-label": (0,
|
|
2233
|
+
return /* @__PURE__ */ React38.createElement(import_ui34.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React38.createElement(import_ui34.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React38.createElement(import_ui34.Tabs, { ...getTabsProps(), "aria-label": (0, import_i18n16.__)("Background Overlay", "elementor") }, /* @__PURE__ */ React38.createElement(import_ui34.Tab, { label: (0, import_i18n16.__)("Image", "elementor"), ...getTabProps("image") }), /* @__PURE__ */ React38.createElement(import_ui34.Tab, { label: (0, import_i18n16.__)("Color", "elementor"), ...getTabProps("color") }))), /* @__PURE__ */ React38.createElement(import_ui34.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React38.createElement(PopoverContent, null, /* @__PURE__ */ React38.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React38.createElement(import_ui34.TabPanel, { ...getTabPanelProps("color"), sx: { p: 1.5 } }, /* @__PURE__ */ React38.createElement(import_ui34.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React38.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(ColorControl, { propTypeUtil: import_editor_props22.backgroundColorOverlayPropTypeUtil })))));
|
|
2035
2234
|
};
|
|
2036
2235
|
var ItemIcon2 = ({ value }) => {
|
|
2037
2236
|
switch (value.$$type) {
|
|
@@ -2072,7 +2271,7 @@ var ImageOverlayContent = () => {
|
|
|
2072
2271
|
return /* @__PURE__ */ React38.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React38.createElement(import_ui34.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React38.createElement(import_ui34.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React38.createElement(
|
|
2073
2272
|
ImageControl,
|
|
2074
2273
|
{
|
|
2075
|
-
resolutionLabel: (0,
|
|
2274
|
+
resolutionLabel: (0, import_i18n16.__)("Resolution", "elementor"),
|
|
2076
2275
|
sizes: backgroundResolutionOptions
|
|
2077
2276
|
}
|
|
2078
2277
|
)))), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React38.createElement(BackgroundImageOverlayAttachment, null)));
|
|
@@ -2095,7 +2294,7 @@ var useImage = (image) => {
|
|
|
2095
2294
|
// src/controls/background-control/background-control.tsx
|
|
2096
2295
|
var BackgroundControl = createControl(() => {
|
|
2097
2296
|
const propContext = useBoundProp(import_editor_props23.backgroundPropTypeUtil);
|
|
2098
|
-
return /* @__PURE__ */ React39.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React39.createElement(SectionContent, null, /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React39.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React39.createElement(import_ui35.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, (0,
|
|
2297
|
+
return /* @__PURE__ */ React39.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React39.createElement(SectionContent, null, /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React39.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React39.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React39.createElement(import_ui35.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React39.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ControlLabel, null, (0, import_i18n17.__)("Color", "elementor"))), /* @__PURE__ */ React39.createElement(import_ui35.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React39.createElement(ColorControl, null))))));
|
|
2099
2298
|
});
|
|
2100
2299
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2101
2300
|
0 && (module.exports = {
|