@elementor/editor-controls 0.13.0 → 0.14.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 +18 -0
- package/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +173 -106
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +183 -116
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/repeater.tsx +1 -0
- 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/font-family-control.tsx +2 -2
- package/src/controls/gap-control.tsx +1 -1
- package/src/controls/image-control.tsx +1 -1
- package/src/controls/image-media-control.tsx +1 -1
- package/src/controls/link-control.tsx +2 -13
- package/src/controls/linked-dimensions-control.tsx +108 -88
- package/src/controls/size-control.tsx +91 -26
- package/src/controls/svg-media-control.tsx +2 -2
- package/src/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @elementor/editor-controls
|
|
2
2
|
|
|
3
|
+
## 0.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1a1e998: Add auto size unit to size controls
|
|
8
|
+
- bcf4254: VQA text fixes
|
|
9
|
+
- ed5962d: removed transparency during, to prevent ui glitches while using drag-n-drop to re-order repeater nodes
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- f4b76ac: cannot link values once you unlinked them when input is empty
|
|
14
|
+
- 571ff75: Add `debounce` util
|
|
15
|
+
- Updated dependencies [c654f89]
|
|
16
|
+
- Updated dependencies [571ff75]
|
|
17
|
+
- @elementor/editor-props@0.9.3
|
|
18
|
+
- @elementor/utils@0.4.0
|
|
19
|
+
- @elementor/wp-media@0.4.2
|
|
20
|
+
|
|
3
21
|
## 0.13.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -21,13 +21,15 @@ type Props$5 = {
|
|
|
21
21
|
};
|
|
22
22
|
declare const TextAreaControl: ControlComponent<({ placeholder }: Props$5) => React.JSX.Element>;
|
|
23
23
|
|
|
24
|
+
type ExtendedValue = 'auto';
|
|
24
25
|
type Unit = 'px' | '%' | 'em' | 'rem' | 'vw' | 'vh';
|
|
25
26
|
type SizeControlProps = {
|
|
26
27
|
placeholder?: string;
|
|
27
28
|
startIcon?: React.ReactNode;
|
|
28
29
|
units?: Unit[];
|
|
30
|
+
extendedValues?: ExtendedValue[];
|
|
29
31
|
};
|
|
30
|
-
declare const SizeControl: ControlComponent<({ units, placeholder, startIcon }: SizeControlProps) => React.JSX.Element>;
|
|
32
|
+
declare const SizeControl: ControlComponent<({ units, extendedValues, placeholder, startIcon }: SizeControlProps) => React.JSX.Element>;
|
|
31
33
|
|
|
32
34
|
declare const StrokeControl: ControlComponent<() => React.JSX.Element>;
|
|
33
35
|
|
|
@@ -105,8 +107,9 @@ type Props$1<TMultiPropType extends string, TPropValue extends MultiSizePropValu
|
|
|
105
107
|
};
|
|
106
108
|
declare function EqualUnequalSizesControl<TMultiPropType extends string, TPropValue extends MultiSizePropValue>({ label, icon, items, multiSizePropTypeUtil, }: Props$1<TMultiPropType, TPropValue>): React.JSX.Element;
|
|
107
109
|
|
|
108
|
-
declare const LinkedDimensionsControl: ControlComponent<({ label }: {
|
|
110
|
+
declare const LinkedDimensionsControl: ControlComponent<({ label, extendedValues }: {
|
|
109
111
|
label: string;
|
|
112
|
+
extendedValues?: ExtendedValue[];
|
|
110
113
|
}) => React.JSX.Element>;
|
|
111
114
|
|
|
112
115
|
declare const FontFamilyControl: ControlComponent<({ fontFamilies }: any) => React.JSX.Element | null>;
|
|
@@ -211,4 +214,4 @@ type UseInternalStateOptions<TValue> = {
|
|
|
211
214
|
};
|
|
212
215
|
declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
|
|
213
216
|
|
|
214
|
-
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, PropKeyProvider, PropProvider, type PropProviderProps, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, UrlControl, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
|
|
217
|
+
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedValue, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, PropKeyProvider, PropProvider, type PropProviderProps, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, UrlControl, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
|
package/dist/index.d.ts
CHANGED
|
@@ -21,13 +21,15 @@ type Props$5 = {
|
|
|
21
21
|
};
|
|
22
22
|
declare const TextAreaControl: ControlComponent<({ placeholder }: Props$5) => React.JSX.Element>;
|
|
23
23
|
|
|
24
|
+
type ExtendedValue = 'auto';
|
|
24
25
|
type Unit = 'px' | '%' | 'em' | 'rem' | 'vw' | 'vh';
|
|
25
26
|
type SizeControlProps = {
|
|
26
27
|
placeholder?: string;
|
|
27
28
|
startIcon?: React.ReactNode;
|
|
28
29
|
units?: Unit[];
|
|
30
|
+
extendedValues?: ExtendedValue[];
|
|
29
31
|
};
|
|
30
|
-
declare const SizeControl: ControlComponent<({ units, placeholder, startIcon }: SizeControlProps) => React.JSX.Element>;
|
|
32
|
+
declare const SizeControl: ControlComponent<({ units, extendedValues, placeholder, startIcon }: SizeControlProps) => React.JSX.Element>;
|
|
31
33
|
|
|
32
34
|
declare const StrokeControl: ControlComponent<() => React.JSX.Element>;
|
|
33
35
|
|
|
@@ -105,8 +107,9 @@ type Props$1<TMultiPropType extends string, TPropValue extends MultiSizePropValu
|
|
|
105
107
|
};
|
|
106
108
|
declare function EqualUnequalSizesControl<TMultiPropType extends string, TPropValue extends MultiSizePropValue>({ label, icon, items, multiSizePropTypeUtil, }: Props$1<TMultiPropType, TPropValue>): React.JSX.Element;
|
|
107
109
|
|
|
108
|
-
declare const LinkedDimensionsControl: ControlComponent<({ label }: {
|
|
110
|
+
declare const LinkedDimensionsControl: ControlComponent<({ label, extendedValues }: {
|
|
109
111
|
label: string;
|
|
112
|
+
extendedValues?: ExtendedValue[];
|
|
110
113
|
}) => React.JSX.Element>;
|
|
111
114
|
|
|
112
115
|
declare const FontFamilyControl: ControlComponent<({ fontFamilies }: any) => React.JSX.Element | null>;
|
|
@@ -211,4 +214,4 @@ type UseInternalStateOptions<TValue> = {
|
|
|
211
214
|
};
|
|
212
215
|
declare const useSyncExternalState: <TValue>({ external, setExternal, persistWhen, fallback, }: UseInternalStateOptions<TValue>) => readonly [TValue, (setter: ((value: TValue) => TValue) | TValue) => void];
|
|
213
216
|
|
|
214
|
-
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, PropKeyProvider, PropProvider, type PropProviderProps, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, UrlControl, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
|
|
217
|
+
export { BackgroundControl, BoxShadowRepeaterControl, ColorControl, type ControlActionsItems, ControlActionsProvider, type ControlComponent, ControlLabel, ControlReplacementProvider, ControlToggleButtonGroup, type EqualUnequalItems, EqualUnequalSizesControl, type ExtendedValue, FontFamilyControl, GapControl, ImageControl, LinkControl, LinkedDimensionsControl, NumberControl, PropKeyProvider, PropProvider, type PropProviderProps, SelectControl, type SetValue, SizeControl, StrokeControl, SvgMediaControl, TextAreaControl, TextControl, type ToggleButtonGroupItem, ToggleControl, UrlControl, createControlReplacement, useBoundProp, useControlActions, useSyncExternalState };
|
package/dist/index.js
CHANGED
|
@@ -352,7 +352,7 @@ var ImageMediaControl = createControl((props) => {
|
|
|
352
352
|
startIcon: /* @__PURE__ */ React8.createElement(import_icons.UploadIcon, null),
|
|
353
353
|
onClick: () => open({ mode: "upload" })
|
|
354
354
|
},
|
|
355
|
-
(0, import_i18n.__)("Upload
|
|
355
|
+
(0, import_i18n.__)("Upload", "elementor")
|
|
356
356
|
)))));
|
|
357
357
|
});
|
|
358
358
|
|
|
@@ -385,7 +385,7 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
385
385
|
var ImageControl = createControl(
|
|
386
386
|
({ sizes, resolutionLabel = (0, import_i18n2.__)("Image resolution", "elementor") }) => {
|
|
387
387
|
const propContext = useBoundProp(import_editor_props3.imagePropTypeUtil);
|
|
388
|
-
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.__)("
|
|
388
|
+
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, null)), /* @__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
389
|
}
|
|
390
390
|
);
|
|
391
391
|
|
|
@@ -522,27 +522,74 @@ var useSyncExternalState = ({
|
|
|
522
522
|
var defaultUnits = ["px", "%", "em", "rem", "vw", "vh"];
|
|
523
523
|
var defaultUnit = "px";
|
|
524
524
|
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
|
-
|
|
525
|
+
var SizeControl = createControl(
|
|
526
|
+
({ units: units2 = defaultUnits, extendedValues = [], placeholder, startIcon }) => {
|
|
527
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(import_editor_props6.sizePropTypeUtil);
|
|
528
|
+
const [state, setState] = useSyncExternalState({
|
|
529
|
+
external: sizeValue,
|
|
530
|
+
setExternal: setSizeValue,
|
|
531
|
+
persistWhen: (controlValue) => !!controlValue?.size || controlValue?.size === 0,
|
|
532
|
+
fallback: (controlValue) => ({ unit: controlValue?.unit || defaultUnit, size: defaultSize })
|
|
533
|
+
});
|
|
534
|
+
const handleUnitChange = (unit) => {
|
|
535
|
+
setState((prev) => ({
|
|
536
|
+
size: prev?.size ?? defaultSize,
|
|
537
|
+
unit
|
|
538
|
+
}));
|
|
539
|
+
};
|
|
540
|
+
const handleSizeChange = (event) => {
|
|
541
|
+
const { value: size } = event.target;
|
|
542
|
+
setState((prev) => ({
|
|
543
|
+
...prev,
|
|
544
|
+
size: size || size === "0" ? parseFloat(size) : defaultSize
|
|
545
|
+
}));
|
|
546
|
+
};
|
|
547
|
+
const inputProps = {
|
|
548
|
+
size: state.size,
|
|
549
|
+
unit: state.unit,
|
|
550
|
+
placeholder,
|
|
551
|
+
startIcon,
|
|
552
|
+
units: units2,
|
|
553
|
+
extendedValues,
|
|
554
|
+
handleSizeChange,
|
|
555
|
+
handleUnitChange
|
|
556
|
+
};
|
|
557
|
+
if (extendedValues?.length) {
|
|
558
|
+
return /* @__PURE__ */ React14.createElement(ExtendedSizeInput, { ...inputProps });
|
|
559
|
+
}
|
|
560
|
+
return /* @__PURE__ */ React14.createElement(SizeInput, { ...inputProps });
|
|
561
|
+
}
|
|
562
|
+
);
|
|
563
|
+
var ExtendedSizeInput = (props) => {
|
|
564
|
+
const { value: stringValue, setValue: setStringValue } = useBoundProp(import_editor_props6.stringPropTypeUtil);
|
|
565
|
+
const { extendedValues = [] } = props;
|
|
566
|
+
const unit = stringValue ?? props.unit;
|
|
567
|
+
const handleUnitChange = (newUnit) => {
|
|
568
|
+
if (extendedValues.includes(newUnit)) {
|
|
569
|
+
setStringValue(newUnit);
|
|
570
|
+
} else {
|
|
571
|
+
props.handleUnitChange(newUnit);
|
|
572
|
+
}
|
|
545
573
|
};
|
|
574
|
+
return /* @__PURE__ */ React14.createElement(
|
|
575
|
+
SizeInput,
|
|
576
|
+
{
|
|
577
|
+
...props,
|
|
578
|
+
units: [...props.units, ...extendedValues],
|
|
579
|
+
handleUnitChange,
|
|
580
|
+
unit
|
|
581
|
+
}
|
|
582
|
+
);
|
|
583
|
+
};
|
|
584
|
+
var SizeInput = ({
|
|
585
|
+
units: units2,
|
|
586
|
+
handleUnitChange,
|
|
587
|
+
handleSizeChange,
|
|
588
|
+
placeholder,
|
|
589
|
+
startIcon,
|
|
590
|
+
size,
|
|
591
|
+
unit
|
|
592
|
+
}) => {
|
|
546
593
|
return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(
|
|
547
594
|
TextFieldInnerSelection,
|
|
548
595
|
{
|
|
@@ -551,17 +598,17 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
551
598
|
{
|
|
552
599
|
options: units2,
|
|
553
600
|
onClick: handleUnitChange,
|
|
554
|
-
value:
|
|
601
|
+
value: unit ?? defaultUnit
|
|
555
602
|
}
|
|
556
603
|
),
|
|
557
604
|
placeholder,
|
|
558
605
|
startAdornment: startIcon ? /* @__PURE__ */ React14.createElement(import_ui10.InputAdornment, { position: "start" }, startIcon) : void 0,
|
|
559
606
|
type: "number",
|
|
560
|
-
value: Number.isNaN(
|
|
607
|
+
value: Number.isNaN(size) ? "" : size,
|
|
561
608
|
onChange: handleSizeChange
|
|
562
609
|
}
|
|
563
610
|
));
|
|
564
|
-
}
|
|
611
|
+
};
|
|
565
612
|
|
|
566
613
|
// src/controls/stroke-control.tsx
|
|
567
614
|
var React17 = __toESM(require("react"));
|
|
@@ -847,7 +894,8 @@ var RepeaterItem = ({
|
|
|
847
894
|
"aria-label": (0, import_i18n4.__)("Remove item", "elementor")
|
|
848
895
|
},
|
|
849
896
|
/* @__PURE__ */ React21.createElement(import_icons3.XIcon, { fontSize: SIZE })
|
|
850
|
-
))
|
|
897
|
+
)),
|
|
898
|
+
sx: { backgroundColor: "background.paper" }
|
|
851
899
|
}
|
|
852
900
|
), /* @__PURE__ */ React21.createElement(
|
|
853
901
|
import_ui17.Popover,
|
|
@@ -1166,70 +1214,85 @@ var import_editor_props13 = require("@elementor/editor-props");
|
|
|
1166
1214
|
var import_icons4 = require("@elementor/icons");
|
|
1167
1215
|
var import_ui22 = require("@elementor/ui");
|
|
1168
1216
|
var import_i18n7 = require("@wordpress/i18n");
|
|
1169
|
-
var LinkedDimensionsControl = createControl(
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
const
|
|
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
|
-
|
|
1217
|
+
var LinkedDimensionsControl = createControl(
|
|
1218
|
+
({ label, extendedValues }) => {
|
|
1219
|
+
const {
|
|
1220
|
+
value: dimensionsValue,
|
|
1221
|
+
setValue: setDimensionsValue,
|
|
1222
|
+
propType
|
|
1223
|
+
} = useBoundProp(import_editor_props13.dimensionsPropTypeUtil);
|
|
1224
|
+
const { value: sizeValue, setValue: setSizeValue } = useBoundProp(import_editor_props13.sizePropTypeUtil);
|
|
1225
|
+
const isLinked = !dimensionsValue && !sizeValue ? true : !!sizeValue;
|
|
1226
|
+
const onLinkToggle = () => {
|
|
1227
|
+
if (!isLinked) {
|
|
1228
|
+
setSizeValue(dimensionsValue?.top?.value);
|
|
1229
|
+
return;
|
|
1230
|
+
}
|
|
1231
|
+
const value = sizeValue ? import_editor_props13.sizePropTypeUtil.create(sizeValue) : null;
|
|
1232
|
+
setDimensionsValue({
|
|
1233
|
+
top: value,
|
|
1234
|
+
right: value,
|
|
1235
|
+
bottom: value,
|
|
1236
|
+
left: value
|
|
1237
|
+
});
|
|
1238
|
+
};
|
|
1239
|
+
const LinkedIcon = isLinked ? import_icons4.LinkIcon : import_icons4.DetachIcon;
|
|
1240
|
+
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(
|
|
1241
|
+
import_ui22.ToggleButton,
|
|
1242
|
+
{
|
|
1243
|
+
"aria-label": (0, import_i18n7.__)("Link Inputs", "elementor"),
|
|
1244
|
+
size: "tiny",
|
|
1245
|
+
value: "check",
|
|
1246
|
+
selected: isLinked,
|
|
1247
|
+
sx: { marginLeft: "auto" },
|
|
1248
|
+
onChange: onLinkToggle
|
|
1249
|
+
},
|
|
1250
|
+
/* @__PURE__ */ React27.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1251
|
+
)), /* @__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(
|
|
1252
|
+
Control3,
|
|
1253
|
+
{
|
|
1254
|
+
bind: "top",
|
|
1255
|
+
startIcon: /* @__PURE__ */ React27.createElement(import_icons4.SideTopIcon, { fontSize: "tiny" }),
|
|
1256
|
+
isLinked,
|
|
1257
|
+
extendedValues
|
|
1258
|
+
}
|
|
1259
|
+
))), /* @__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.__)("Right", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1260
|
+
Control3,
|
|
1261
|
+
{
|
|
1262
|
+
bind: "right",
|
|
1263
|
+
startIcon: /* @__PURE__ */ React27.createElement(import_icons4.SideRightIcon, { fontSize: "tiny" }),
|
|
1264
|
+
isLinked,
|
|
1265
|
+
extendedValues
|
|
1266
|
+
}
|
|
1267
|
+
)))), /* @__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(
|
|
1268
|
+
Control3,
|
|
1269
|
+
{
|
|
1270
|
+
bind: "bottom",
|
|
1271
|
+
startIcon: /* @__PURE__ */ React27.createElement(import_icons4.SideBottomIcon, { fontSize: "tiny" }),
|
|
1272
|
+
isLinked,
|
|
1273
|
+
extendedValues
|
|
1274
|
+
}
|
|
1275
|
+
))), /* @__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.__)("Left", "elementor"))), /* @__PURE__ */ React27.createElement(import_ui22.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React27.createElement(
|
|
1276
|
+
Control3,
|
|
1277
|
+
{
|
|
1278
|
+
bind: "left",
|
|
1279
|
+
startIcon: /* @__PURE__ */ React27.createElement(import_icons4.SideLeftIcon, { fontSize: "tiny" }),
|
|
1280
|
+
isLinked,
|
|
1281
|
+
extendedValues
|
|
1282
|
+
}
|
|
1283
|
+
)))));
|
|
1284
|
+
}
|
|
1285
|
+
);
|
|
1286
|
+
var Control3 = ({
|
|
1287
|
+
bind,
|
|
1288
|
+
startIcon,
|
|
1289
|
+
isLinked,
|
|
1290
|
+
extendedValues
|
|
1291
|
+
}) => {
|
|
1229
1292
|
if (isLinked) {
|
|
1230
|
-
return /* @__PURE__ */ React27.createElement(SizeControl, { startIcon });
|
|
1293
|
+
return /* @__PURE__ */ React27.createElement(SizeControl, { startIcon, extendedValues });
|
|
1231
1294
|
}
|
|
1232
|
-
return /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React27.createElement(SizeControl, { startIcon }));
|
|
1295
|
+
return /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React27.createElement(SizeControl, { startIcon, extendedValues }));
|
|
1233
1296
|
};
|
|
1234
1297
|
|
|
1235
1298
|
// src/controls/font-family-control.tsx
|
|
@@ -1306,13 +1369,13 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1306
1369
|
...(0, import_ui23.bindPopover)(popoverState),
|
|
1307
1370
|
onClose: handleClose
|
|
1308
1371
|
},
|
|
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, import_i18n9.__)("Font
|
|
1372
|
+
/* @__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_i18n9.__)("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
1373
|
import_ui23.TextField,
|
|
1311
1374
|
{
|
|
1312
1375
|
fullWidth: true,
|
|
1313
1376
|
size: SIZE2,
|
|
1314
1377
|
value: searchValue,
|
|
1315
|
-
placeholder: (0, import_i18n9.__)("Search", "elementor"),
|
|
1378
|
+
placeholder: (0, import_i18n9.__)("Search fonts\u2026", "elementor"),
|
|
1316
1379
|
onChange: handleSearch,
|
|
1317
1380
|
InputProps: {
|
|
1318
1381
|
startAdornment: /* @__PURE__ */ React28.createElement(import_ui23.InputAdornment, { position: "start" }, /* @__PURE__ */ React28.createElement(import_icons5.SearchIcon, { fontSize: SIZE2 }))
|
|
@@ -1381,6 +1444,7 @@ var import_http = require("@elementor/http");
|
|
|
1381
1444
|
var import_icons7 = require("@elementor/icons");
|
|
1382
1445
|
var import_session = require("@elementor/session");
|
|
1383
1446
|
var import_ui26 = require("@elementor/ui");
|
|
1447
|
+
var import_utils2 = require("@elementor/utils");
|
|
1384
1448
|
var import_i18n10 = require("@wordpress/i18n");
|
|
1385
1449
|
|
|
1386
1450
|
// src/components/autocomplete.tsx
|
|
@@ -1539,7 +1603,7 @@ var LinkControl = createControl((props) => {
|
|
|
1539
1603
|
debounceFetch({ ...requestParams, term: newValue });
|
|
1540
1604
|
};
|
|
1541
1605
|
const debounceFetch = (0, import_react11.useMemo)(
|
|
1542
|
-
() => debounce(
|
|
1606
|
+
() => (0, import_utils2.debounce)(
|
|
1543
1607
|
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
1544
1608
|
setOptions(formatOptions(newOptions));
|
|
1545
1609
|
}),
|
|
@@ -1586,7 +1650,7 @@ var SwitchControl = () => {
|
|
|
1586
1650
|
const onClick = () => {
|
|
1587
1651
|
setValue(!value);
|
|
1588
1652
|
};
|
|
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, import_i18n10.__)("Open in new tab", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true }, /* @__PURE__ */ React31.createElement(import_ui26.Switch, { checked: value, onClick })));
|
|
1653
|
+
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_i18n10.__)("Open in a new tab", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true }, /* @__PURE__ */ React31.createElement(import_ui26.Switch, { checked: value, onClick })));
|
|
1590
1654
|
};
|
|
1591
1655
|
async function fetchOptions(ajaxUrl, params) {
|
|
1592
1656
|
if (!params || !ajaxUrl) {
|
|
@@ -1616,15 +1680,6 @@ function generateFirstLoadedOption(unionValue) {
|
|
|
1616
1680
|
}
|
|
1617
1681
|
] : [];
|
|
1618
1682
|
}
|
|
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
1683
|
|
|
1629
1684
|
// src/controls/gap-control.tsx
|
|
1630
1685
|
var React32 = __toESM(require("react"));
|
|
@@ -1642,7 +1697,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
1642
1697
|
const isLinked = !directionValue && !sizeValue ? true : !!sizeValue;
|
|
1643
1698
|
const onLinkToggle = () => {
|
|
1644
1699
|
if (!isLinked) {
|
|
1645
|
-
setSizeValue(directionValue?.column
|
|
1700
|
+
setSizeValue(directionValue?.column?.value);
|
|
1646
1701
|
return;
|
|
1647
1702
|
}
|
|
1648
1703
|
const value = sizeValue ? import_editor_props17.sizePropTypeUtil.create(sizeValue) : null;
|
|
@@ -1721,7 +1776,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
1721
1776
|
});
|
|
1722
1777
|
}
|
|
1723
1778
|
});
|
|
1724
|
-
return /* @__PURE__ */ React33.createElement(import_ui28.Stack, { gap: 1 }, /* @__PURE__ */ React33.createElement(ControlLabel, null, " ", (0, import_i18n12.__)("
|
|
1779
|
+
return /* @__PURE__ */ React33.createElement(import_ui28.Stack, { gap: 1 }, /* @__PURE__ */ React33.createElement(ControlLabel, null, " ", (0, import_i18n12.__)("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
1780
|
import_ui28.CardMedia,
|
|
1726
1781
|
{
|
|
1727
1782
|
component: "img",
|
|
@@ -1756,7 +1811,7 @@ var SvgMediaControl = createControl(() => {
|
|
|
1756
1811
|
startIcon: /* @__PURE__ */ React33.createElement(import_icons9.UploadIcon, null),
|
|
1757
1812
|
onClick: () => open({ mode: "upload" })
|
|
1758
1813
|
},
|
|
1759
|
-
(0, import_i18n12.__)("Upload
|
|
1814
|
+
(0, import_i18n12.__)("Upload", "elementor")
|
|
1760
1815
|
))
|
|
1761
1816
|
))));
|
|
1762
1817
|
});
|
|
@@ -1869,7 +1924,7 @@ var repeatControlOptions = [
|
|
|
1869
1924
|
},
|
|
1870
1925
|
{
|
|
1871
1926
|
value: "no-repeat",
|
|
1872
|
-
label: (0, import_i18n15.__)("No-
|
|
1927
|
+
label: (0, import_i18n15.__)("No-repeat", "elementor"),
|
|
1873
1928
|
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.XIcon, { fontSize: size }),
|
|
1874
1929
|
showTooltip: true
|
|
1875
1930
|
}
|
|
@@ -1929,7 +1984,19 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1929
1984
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value,
|
|
1930
1985
|
onChange: handleSizeChange
|
|
1931
1986
|
}
|
|
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(
|
|
1987
|
+
)))), 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(
|
|
1988
|
+
SizeControl,
|
|
1989
|
+
{
|
|
1990
|
+
startIcon: /* @__PURE__ */ React37.createElement(import_icons13.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }),
|
|
1991
|
+
extendedValues: ["auto"]
|
|
1992
|
+
}
|
|
1993
|
+
))), /* @__PURE__ */ React37.createElement(import_ui32.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React37.createElement(
|
|
1994
|
+
SizeControl,
|
|
1995
|
+
{
|
|
1996
|
+
startIcon: /* @__PURE__ */ React37.createElement(import_icons13.ArrowsMoveVerticalIcon, { fontSize: "tiny" }),
|
|
1997
|
+
extendedValues: ["auto"]
|
|
1998
|
+
}
|
|
1999
|
+
)))))) : null);
|
|
1933
2000
|
};
|
|
1934
2001
|
|
|
1935
2002
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|