@elementor/editor-controls 0.9.0 → 0.11.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 +24 -0
- package/dist/index.d.mts +3 -25
- package/dist/index.d.ts +3 -25
- package/dist/index.js +395 -361
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +371 -327
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/autocomplete.tsx +181 -0
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx +1 -1
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx +10 -10
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +18 -46
- package/src/controls/background-control/background-overlay/types.ts +22 -0
- package/src/controls/background-control/background-overlay/use-background-tabs-history.ts +62 -0
- package/src/controls/box-shadow-repeater-control.tsx +1 -1
- package/src/controls/gap-control.tsx +1 -1
- package/src/controls/image-control.tsx +1 -1
- package/src/controls/image-media-control.tsx +2 -2
- package/src/controls/link-control.tsx +65 -49
- package/src/controls/linked-dimensions-control.tsx +1 -1
- package/src/controls/select-control.tsx +8 -1
- package/src/controls/stroke-control.tsx +2 -2
- package/src/index.ts +0 -1
- package/src/controls/autocomplete-control.tsx +0 -195
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
// src/controls/
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
Box,
|
|
7
|
-
IconButton,
|
|
8
|
-
InputAdornment,
|
|
9
|
-
TextField
|
|
10
|
-
} from "@elementor/ui";
|
|
1
|
+
// src/controls/image-control.tsx
|
|
2
|
+
import * as React10 from "react";
|
|
3
|
+
import { imagePropTypeUtil } from "@elementor/editor-props";
|
|
4
|
+
import { Grid, Stack as Stack2 } from "@elementor/ui";
|
|
5
|
+
import { __ as __2 } from "@wordpress/i18n";
|
|
11
6
|
|
|
12
7
|
// src/bound-prop-context/prop-context.tsx
|
|
13
8
|
import * as React from "react";
|
|
@@ -158,12 +153,19 @@ var resolveUnionPropType = (propType, key) => {
|
|
|
158
153
|
return resolvedPropType;
|
|
159
154
|
};
|
|
160
155
|
|
|
156
|
+
// src/components/control-label.tsx
|
|
157
|
+
import * as React3 from "react";
|
|
158
|
+
import { Typography } from "@elementor/ui";
|
|
159
|
+
var ControlLabel = ({ children }) => {
|
|
160
|
+
return /* @__PURE__ */ React3.createElement(Typography, { component: "label", variant: "caption", color: "text.secondary" }, children);
|
|
161
|
+
};
|
|
162
|
+
|
|
161
163
|
// src/create-control.tsx
|
|
162
|
-
import * as
|
|
164
|
+
import * as React5 from "react";
|
|
163
165
|
import { ErrorBoundary } from "@elementor/ui";
|
|
164
166
|
|
|
165
167
|
// src/create-control-replacement.tsx
|
|
166
|
-
import * as
|
|
168
|
+
import * as React4 from "react";
|
|
167
169
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
168
170
|
var ControlReplacementContext = createContext3(void 0);
|
|
169
171
|
var ControlReplacementProvider = ({
|
|
@@ -171,7 +173,7 @@ var ControlReplacementProvider = ({
|
|
|
171
173
|
condition,
|
|
172
174
|
children
|
|
173
175
|
}) => {
|
|
174
|
-
return /* @__PURE__ */
|
|
176
|
+
return /* @__PURE__ */ React4.createElement(ControlReplacementContext.Provider, { value: { component, condition } }, children);
|
|
175
177
|
};
|
|
176
178
|
var useControlReplacement = () => {
|
|
177
179
|
const { value } = useBoundProp();
|
|
@@ -200,141 +202,14 @@ function createControl(Component, { supportsReplacements = true } = {}) {
|
|
|
200
202
|
return (props) => {
|
|
201
203
|
const ControlReplacement = useControlReplacement();
|
|
202
204
|
if (ControlReplacement && supportsReplacements) {
|
|
203
|
-
return /* @__PURE__ */
|
|
205
|
+
return /* @__PURE__ */ React5.createElement(ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(ControlReplacement, { ...props }));
|
|
204
206
|
}
|
|
205
|
-
return /* @__PURE__ */
|
|
207
|
+
return /* @__PURE__ */ React5.createElement(ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(Component, { ...props }));
|
|
206
208
|
};
|
|
207
209
|
}
|
|
208
210
|
|
|
209
|
-
// src/controls/autocomplete-control.tsx
|
|
210
|
-
var AutocompleteControl = createControl(
|
|
211
|
-
(props) => {
|
|
212
|
-
const {
|
|
213
|
-
options,
|
|
214
|
-
optionRestrictedPropTypeUtil,
|
|
215
|
-
onOptionChangeCallback,
|
|
216
|
-
onTextChangeCallback,
|
|
217
|
-
allowCustomValues = false,
|
|
218
|
-
placeholder = "",
|
|
219
|
-
minInputLength = 2,
|
|
220
|
-
customValue
|
|
221
|
-
} = props;
|
|
222
|
-
const { value: selectableValue, setValue: setSelectableValue } = useBoundProp(optionRestrictedPropTypeUtil);
|
|
223
|
-
const value = selectableValue || customValue || "";
|
|
224
|
-
const optionKeys = _factoryFilter(selectableValue || customValue || null, options, minInputLength).map(
|
|
225
|
-
({ id }) => id
|
|
226
|
-
);
|
|
227
|
-
const allowClear = !!value;
|
|
228
|
-
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
229
|
-
const isOptionEqualToValue = () => {
|
|
230
|
-
return muiWarningPreventer ? void 0 : () => true;
|
|
231
|
-
};
|
|
232
|
-
const hasSelectedValue = !!findMatchingOption(options, selectableValue?.toString());
|
|
233
|
-
const onOptionChange = (newValue) => {
|
|
234
|
-
setSelectableValue(newValue);
|
|
235
|
-
onOptionChangeCallback?.(newValue);
|
|
236
|
-
};
|
|
237
|
-
const onTextChange = (newValue) => {
|
|
238
|
-
onTextChangeCallback?.(newValue);
|
|
239
|
-
};
|
|
240
|
-
return /* @__PURE__ */ React5.createElement(
|
|
241
|
-
Autocomplete,
|
|
242
|
-
{
|
|
243
|
-
forcePopupIcon: false,
|
|
244
|
-
disableClearable: true,
|
|
245
|
-
freeSolo: allowCustomValues,
|
|
246
|
-
value: value?.toString() || "",
|
|
247
|
-
size: "tiny",
|
|
248
|
-
onChange: (_, newValue) => onOptionChange(Number(newValue)),
|
|
249
|
-
readOnly: hasSelectedValue,
|
|
250
|
-
options: optionKeys,
|
|
251
|
-
getOptionKey: (optionId) => findMatchingOption(options, optionId)?.id || optionId,
|
|
252
|
-
getOptionLabel: (optionId) => findMatchingOption(options, optionId)?.label || optionId.toString(),
|
|
253
|
-
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
254
|
-
isOptionEqualToValue: isOptionEqualToValue(),
|
|
255
|
-
filterOptions: () => optionKeys,
|
|
256
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */ React5.createElement(Box, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
257
|
-
renderInput: (params) => /* @__PURE__ */ React5.createElement(
|
|
258
|
-
TextInput,
|
|
259
|
-
{
|
|
260
|
-
params,
|
|
261
|
-
handleChange: onTextChange,
|
|
262
|
-
allowClear,
|
|
263
|
-
placeholder,
|
|
264
|
-
hasSelectedValue
|
|
265
|
-
}
|
|
266
|
-
)
|
|
267
|
-
}
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
);
|
|
271
|
-
var TextInput = ({
|
|
272
|
-
params,
|
|
273
|
-
allowClear,
|
|
274
|
-
placeholder,
|
|
275
|
-
handleChange,
|
|
276
|
-
hasSelectedValue
|
|
277
|
-
}) => {
|
|
278
|
-
const onChange = (event) => {
|
|
279
|
-
handleChange(event.target.value);
|
|
280
|
-
};
|
|
281
|
-
return /* @__PURE__ */ React5.createElement(
|
|
282
|
-
TextField,
|
|
283
|
-
{
|
|
284
|
-
...params,
|
|
285
|
-
placeholder,
|
|
286
|
-
onChange,
|
|
287
|
-
sx: {
|
|
288
|
-
"& .MuiInputBase-input": {
|
|
289
|
-
cursor: hasSelectedValue ? "default" : void 0
|
|
290
|
-
}
|
|
291
|
-
},
|
|
292
|
-
InputProps: {
|
|
293
|
-
...params.InputProps,
|
|
294
|
-
endAdornment: /* @__PURE__ */ React5.createElement(ClearButton, { params, allowClear, handleChange })
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
);
|
|
298
|
-
};
|
|
299
|
-
var ClearButton = ({
|
|
300
|
-
allowClear,
|
|
301
|
-
handleChange,
|
|
302
|
-
params
|
|
303
|
-
}) => /* @__PURE__ */ React5.createElement(InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React5.createElement(IconButton, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React5.createElement(XIcon, { fontSize: params.size })));
|
|
304
|
-
function findMatchingOption(options, optionId = null) {
|
|
305
|
-
return options.find(({ id }) => optionId?.toString() === id.toString());
|
|
306
|
-
}
|
|
307
|
-
function isCategorizedOptionPool(options) {
|
|
308
|
-
return options.every((option) => "groupLabel" in option);
|
|
309
|
-
}
|
|
310
|
-
function _factoryFilter(newValue, options, minInputLength) {
|
|
311
|
-
if (null === newValue) {
|
|
312
|
-
return options;
|
|
313
|
-
}
|
|
314
|
-
const formattedValue = String(newValue || "")?.toLowerCase();
|
|
315
|
-
if (formattedValue.length < minInputLength) {
|
|
316
|
-
return new Array(0);
|
|
317
|
-
}
|
|
318
|
-
return options.filter(
|
|
319
|
-
(option) => String(option.id).toLowerCase().includes(formattedValue) || option.label.toLowerCase().includes(formattedValue)
|
|
320
|
-
);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
// src/controls/image-control.tsx
|
|
324
|
-
import * as React11 from "react";
|
|
325
|
-
import { imagePropTypeUtil } from "@elementor/editor-props";
|
|
326
|
-
import { Grid, Stack as Stack2 } from "@elementor/ui";
|
|
327
|
-
import { __ as __2 } from "@wordpress/i18n";
|
|
328
|
-
|
|
329
|
-
// src/components/control-label.tsx
|
|
330
|
-
import * as React6 from "react";
|
|
331
|
-
import { Typography } from "@elementor/ui";
|
|
332
|
-
var ControlLabel = ({ children }) => {
|
|
333
|
-
return /* @__PURE__ */ React6.createElement(Typography, { component: "label", variant: "caption", color: "text.secondary" }, children);
|
|
334
|
-
};
|
|
335
|
-
|
|
336
211
|
// src/controls/image-media-control.tsx
|
|
337
|
-
import * as
|
|
212
|
+
import * as React8 from "react";
|
|
338
213
|
import { imageSrcPropTypeUtil } from "@elementor/editor-props";
|
|
339
214
|
import { UploadIcon } from "@elementor/icons";
|
|
340
215
|
import { Button, Card, CardMedia, CardOverlay, CircularProgress, Stack } from "@elementor/ui";
|
|
@@ -342,14 +217,14 @@ import { useWpMediaAttachment, useWpMediaFrame } from "@elementor/wp-media";
|
|
|
342
217
|
import { __ } from "@wordpress/i18n";
|
|
343
218
|
|
|
344
219
|
// src/control-actions/control-actions.tsx
|
|
345
|
-
import * as
|
|
220
|
+
import * as React7 from "react";
|
|
346
221
|
import { styled, UnstableFloatingActionBar } from "@elementor/ui";
|
|
347
222
|
|
|
348
223
|
// src/control-actions/control-actions-context.tsx
|
|
349
|
-
import * as
|
|
224
|
+
import * as React6 from "react";
|
|
350
225
|
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
351
226
|
var Context = createContext4(null);
|
|
352
|
-
var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */
|
|
227
|
+
var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */ React6.createElement(Context.Provider, { value: { items } }, children);
|
|
353
228
|
var useControlActions = () => {
|
|
354
229
|
const context = useContext4(Context);
|
|
355
230
|
if (!context) {
|
|
@@ -371,8 +246,8 @@ function ControlActions({ children }) {
|
|
|
371
246
|
if (items.length === 0) {
|
|
372
247
|
return children;
|
|
373
248
|
}
|
|
374
|
-
const menuItems = items.map(({ MenuItem: MenuItem5, id }) => /* @__PURE__ */
|
|
375
|
-
return /* @__PURE__ */
|
|
249
|
+
const menuItems = items.map(({ MenuItem: MenuItem5, id }) => /* @__PURE__ */ React7.createElement(MenuItem5, { key: id }));
|
|
250
|
+
return /* @__PURE__ */ React7.createElement(FloatingBarContainer, null, /* @__PURE__ */ React7.createElement(UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
376
251
|
}
|
|
377
252
|
|
|
378
253
|
// src/controls/image-media-control.tsx
|
|
@@ -396,7 +271,7 @@ var ImageMediaControl = createControl((props) => {
|
|
|
396
271
|
});
|
|
397
272
|
}
|
|
398
273
|
});
|
|
399
|
-
return /* @__PURE__ */
|
|
274
|
+
return /* @__PURE__ */ React8.createElement(ControlActions, null, /* @__PURE__ */ React8.createElement(Card, { variant: "outlined" }, /* @__PURE__ */ React8.createElement(CardMedia, { image: src, sx: { height: 150 } }, isFetching ? /* @__PURE__ */ React8.createElement(Stack, { justifyContent: "center", alignItems: "center", width: "100%", height: "100%" }, /* @__PURE__ */ React8.createElement(CircularProgress, null)) : /* @__PURE__ */ React8.createElement(React8.Fragment, null)), /* @__PURE__ */ React8.createElement(CardOverlay, null, /* @__PURE__ */ React8.createElement(Stack, { gap: 1 }, /* @__PURE__ */ React8.createElement(
|
|
400
275
|
Button,
|
|
401
276
|
{
|
|
402
277
|
size: "tiny",
|
|
@@ -404,22 +279,22 @@ var ImageMediaControl = createControl((props) => {
|
|
|
404
279
|
variant: "outlined",
|
|
405
280
|
onClick: () => open({ mode: "browse" })
|
|
406
281
|
},
|
|
407
|
-
__("Select
|
|
408
|
-
), /* @__PURE__ */
|
|
282
|
+
__("Select image", "elementor")
|
|
283
|
+
), /* @__PURE__ */ React8.createElement(
|
|
409
284
|
Button,
|
|
410
285
|
{
|
|
411
286
|
size: "tiny",
|
|
412
287
|
variant: "text",
|
|
413
288
|
color: "inherit",
|
|
414
|
-
startIcon: /* @__PURE__ */
|
|
289
|
+
startIcon: /* @__PURE__ */ React8.createElement(UploadIcon, null),
|
|
415
290
|
onClick: () => open({ mode: "upload" })
|
|
416
291
|
},
|
|
417
|
-
__("Upload
|
|
292
|
+
__("Upload image", "elementor")
|
|
418
293
|
)))));
|
|
419
294
|
});
|
|
420
295
|
|
|
421
296
|
// src/controls/select-control.tsx
|
|
422
|
-
import * as
|
|
297
|
+
import * as React9 from "react";
|
|
423
298
|
import { stringPropTypeUtil } from "@elementor/editor-props";
|
|
424
299
|
import { MenuItem, Select } from "@elementor/ui";
|
|
425
300
|
var SelectControl = createControl(({ options, onChange }) => {
|
|
@@ -429,26 +304,37 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
429
304
|
onChange?.(newValue, value);
|
|
430
305
|
setValue(newValue);
|
|
431
306
|
};
|
|
432
|
-
return /* @__PURE__ */
|
|
307
|
+
return /* @__PURE__ */ React9.createElement(ControlActions, null, /* @__PURE__ */ React9.createElement(
|
|
308
|
+
Select,
|
|
309
|
+
{
|
|
310
|
+
sx: { overflow: "hidden" },
|
|
311
|
+
displayEmpty: true,
|
|
312
|
+
size: "tiny",
|
|
313
|
+
value: value ?? "",
|
|
314
|
+
onChange: handleChange,
|
|
315
|
+
fullWidth: true
|
|
316
|
+
},
|
|
317
|
+
options.map(({ label, ...props }) => /* @__PURE__ */ React9.createElement(MenuItem, { key: props.value, ...props, value: props.value ?? "" }, label))
|
|
318
|
+
));
|
|
433
319
|
});
|
|
434
320
|
|
|
435
321
|
// src/controls/image-control.tsx
|
|
436
322
|
var ImageControl = createControl(
|
|
437
323
|
({ sizes, resolutionLabel = __2("Image resolution", "elementor") }) => {
|
|
438
324
|
const propContext = useBoundProp(imagePropTypeUtil);
|
|
439
|
-
return /* @__PURE__ */
|
|
325
|
+
return /* @__PURE__ */ React10.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React10.createElement(Stack2, { gap: 1.5 }, /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "src" }, /* @__PURE__ */ React10.createElement(ControlLabel, null, " ", __2("Choose image", "elementor"), " "), /* @__PURE__ */ React10.createElement(ImageMediaControl, null)), /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React10.createElement(Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(ControlLabel, null, " ", resolutionLabel, " ")), /* @__PURE__ */ React10.createElement(Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React10.createElement(SelectControl, { options: sizes }))))));
|
|
440
326
|
}
|
|
441
327
|
);
|
|
442
328
|
|
|
443
329
|
// src/controls/text-control.tsx
|
|
444
|
-
import * as
|
|
330
|
+
import * as React11 from "react";
|
|
445
331
|
import { stringPropTypeUtil as stringPropTypeUtil2 } from "@elementor/editor-props";
|
|
446
|
-
import { TextField
|
|
332
|
+
import { TextField } from "@elementor/ui";
|
|
447
333
|
var TextControl = createControl(({ placeholder }) => {
|
|
448
334
|
const { value, setValue } = useBoundProp(stringPropTypeUtil2);
|
|
449
335
|
const handleChange = (event) => setValue(event.target.value);
|
|
450
|
-
return /* @__PURE__ */
|
|
451
|
-
|
|
336
|
+
return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
|
|
337
|
+
TextField,
|
|
452
338
|
{
|
|
453
339
|
size: "tiny",
|
|
454
340
|
fullWidth: true,
|
|
@@ -460,16 +346,16 @@ var TextControl = createControl(({ placeholder }) => {
|
|
|
460
346
|
});
|
|
461
347
|
|
|
462
348
|
// src/controls/text-area-control.tsx
|
|
463
|
-
import * as
|
|
349
|
+
import * as React12 from "react";
|
|
464
350
|
import { stringPropTypeUtil as stringPropTypeUtil3 } from "@elementor/editor-props";
|
|
465
|
-
import { TextField as
|
|
351
|
+
import { TextField as TextField2 } from "@elementor/ui";
|
|
466
352
|
var TextAreaControl = createControl(({ placeholder }) => {
|
|
467
353
|
const { value, setValue } = useBoundProp(stringPropTypeUtil3);
|
|
468
354
|
const handleChange = (event) => {
|
|
469
355
|
setValue(event.target.value);
|
|
470
356
|
};
|
|
471
|
-
return /* @__PURE__ */
|
|
472
|
-
|
|
357
|
+
return /* @__PURE__ */ React12.createElement(ControlActions, null, /* @__PURE__ */ React12.createElement(
|
|
358
|
+
TextField2,
|
|
473
359
|
{
|
|
474
360
|
size: "tiny",
|
|
475
361
|
multiline: true,
|
|
@@ -483,18 +369,18 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
483
369
|
});
|
|
484
370
|
|
|
485
371
|
// src/controls/size-control.tsx
|
|
486
|
-
import * as
|
|
372
|
+
import * as React14 from "react";
|
|
487
373
|
import { sizePropTypeUtil } from "@elementor/editor-props";
|
|
488
|
-
import { InputAdornment as
|
|
374
|
+
import { InputAdornment as InputAdornment2 } from "@elementor/ui";
|
|
489
375
|
|
|
490
376
|
// src/components/text-field-inner-selection.tsx
|
|
491
|
-
import * as
|
|
377
|
+
import * as React13 from "react";
|
|
492
378
|
import { forwardRef, useId } from "react";
|
|
493
|
-
import { bindMenu, bindTrigger, Button as Button2, InputAdornment
|
|
379
|
+
import { bindMenu, bindTrigger, Button as Button2, InputAdornment, Menu, MenuItem as MenuItem2, TextField as TextField3, usePopupState } from "@elementor/ui";
|
|
494
380
|
var TextFieldInnerSelection = forwardRef(
|
|
495
381
|
({ placeholder, type, value, onChange, endAdornment, startAdornment }, ref) => {
|
|
496
|
-
return /* @__PURE__ */
|
|
497
|
-
|
|
382
|
+
return /* @__PURE__ */ React13.createElement(
|
|
383
|
+
TextField3,
|
|
498
384
|
{
|
|
499
385
|
size: "tiny",
|
|
500
386
|
fullWidth: true,
|
|
@@ -524,7 +410,7 @@ var SelectionEndAdornment = ({
|
|
|
524
410
|
onClick(options[index]);
|
|
525
411
|
popupState.close();
|
|
526
412
|
};
|
|
527
|
-
return /* @__PURE__ */
|
|
413
|
+
return /* @__PURE__ */ React13.createElement(InputAdornment, { position: "end" }, /* @__PURE__ */ React13.createElement(
|
|
528
414
|
Button2,
|
|
529
415
|
{
|
|
530
416
|
size: "small",
|
|
@@ -533,7 +419,7 @@ var SelectionEndAdornment = ({
|
|
|
533
419
|
...bindTrigger(popupState)
|
|
534
420
|
},
|
|
535
421
|
value.toUpperCase()
|
|
536
|
-
), /* @__PURE__ */
|
|
422
|
+
), /* @__PURE__ */ React13.createElement(Menu, { MenuListProps: { dense: true }, ...bindMenu(popupState) }, options.map((option, index) => /* @__PURE__ */ React13.createElement(MenuItem2, { key: option, onClick: () => handleMenuItemClick(index) }, option.toUpperCase()))));
|
|
537
423
|
};
|
|
538
424
|
|
|
539
425
|
// src/hooks/use-sync-external-state.tsx
|
|
@@ -594,10 +480,10 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
594
480
|
size: size || size === "0" ? parseFloat(size) : defaultSize
|
|
595
481
|
}));
|
|
596
482
|
};
|
|
597
|
-
return /* @__PURE__ */
|
|
483
|
+
return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(
|
|
598
484
|
TextFieldInnerSelection,
|
|
599
485
|
{
|
|
600
|
-
endAdornment: /* @__PURE__ */
|
|
486
|
+
endAdornment: /* @__PURE__ */ React14.createElement(
|
|
601
487
|
SelectionEndAdornment,
|
|
602
488
|
{
|
|
603
489
|
options: units2,
|
|
@@ -606,7 +492,7 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
606
492
|
}
|
|
607
493
|
),
|
|
608
494
|
placeholder,
|
|
609
|
-
startAdornment: startIcon ?? /* @__PURE__ */
|
|
495
|
+
startAdornment: startIcon ?? /* @__PURE__ */ React14.createElement(InputAdornment2, { position: "start" }, startIcon),
|
|
610
496
|
type: "number",
|
|
611
497
|
value: Number.isNaN(state?.size) ? "" : state?.size,
|
|
612
498
|
onChange: handleSizeChange
|
|
@@ -615,13 +501,13 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
615
501
|
});
|
|
616
502
|
|
|
617
503
|
// src/controls/stroke-control.tsx
|
|
618
|
-
import * as
|
|
504
|
+
import * as React16 from "react";
|
|
619
505
|
import { strokePropTypeUtil } from "@elementor/editor-props";
|
|
620
506
|
import { Grid as Grid2, Stack as Stack3 } from "@elementor/ui";
|
|
621
507
|
import { __ as __3 } from "@wordpress/i18n";
|
|
622
508
|
|
|
623
509
|
// src/controls/color-control.tsx
|
|
624
|
-
import * as
|
|
510
|
+
import * as React15 from "react";
|
|
625
511
|
import { colorPropTypeUtil } from "@elementor/editor-props";
|
|
626
512
|
import { UnstableColorField } from "@elementor/ui";
|
|
627
513
|
var ColorControl = createControl(({ propTypeUtil = colorPropTypeUtil, ...props }) => {
|
|
@@ -629,32 +515,32 @@ var ColorControl = createControl(({ propTypeUtil = colorPropTypeUtil, ...props }
|
|
|
629
515
|
const handleChange = (selectedColor) => {
|
|
630
516
|
setValue(selectedColor);
|
|
631
517
|
};
|
|
632
|
-
return /* @__PURE__ */
|
|
518
|
+
return /* @__PURE__ */ React15.createElement(ControlActions, null, /* @__PURE__ */ React15.createElement(UnstableColorField, { size: "tiny", ...props, value: value ?? "", onChange: handleChange, fullWidth: true }));
|
|
633
519
|
});
|
|
634
520
|
|
|
635
521
|
// src/controls/stroke-control.tsx
|
|
636
522
|
var units = ["px", "em", "rem"];
|
|
637
523
|
var StrokeControl = createControl(() => {
|
|
638
524
|
const propContext = useBoundProp(strokePropTypeUtil);
|
|
639
|
-
return /* @__PURE__ */
|
|
525
|
+
return /* @__PURE__ */ React16.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React16.createElement(Stack3, { gap: 1.5 }, /* @__PURE__ */ React16.createElement(Control, { bind: "width", label: __3("Stroke width", "elementor") }, /* @__PURE__ */ React16.createElement(SizeControl, { units })), /* @__PURE__ */ React16.createElement(Control, { bind: "color", label: __3("Stroke color", "elementor") }, /* @__PURE__ */ React16.createElement(ColorControl, null))));
|
|
640
526
|
});
|
|
641
|
-
var Control = ({ bind, label, children }) => /* @__PURE__ */
|
|
527
|
+
var Control = ({ bind, label, children }) => /* @__PURE__ */ React16.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React16.createElement(Grid2, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React16.createElement(Grid2, { item: true, xs: 6 }, /* @__PURE__ */ React16.createElement(ControlLabel, null, label)), /* @__PURE__ */ React16.createElement(Grid2, { item: true, xs: 6 }, children)));
|
|
642
528
|
|
|
643
529
|
// src/controls/box-shadow-repeater-control.tsx
|
|
644
|
-
import * as
|
|
530
|
+
import * as React18 from "react";
|
|
645
531
|
import { boxShadowPropTypeUtil, shadowPropTypeUtil } from "@elementor/editor-props";
|
|
646
532
|
import { Grid as Grid3, Stack as Stack5, Typography as Typography3, UnstableColorIndicator } from "@elementor/ui";
|
|
647
533
|
import { __ as __5 } from "@wordpress/i18n";
|
|
648
534
|
|
|
649
535
|
// src/components/repeater.tsx
|
|
650
|
-
import * as
|
|
536
|
+
import * as React17 from "react";
|
|
651
537
|
import { useRef, useState as useState2 } from "react";
|
|
652
|
-
import { CopyIcon, EyeIcon, EyeOffIcon, PlusIcon, XIcon
|
|
538
|
+
import { CopyIcon, EyeIcon, EyeOffIcon, PlusIcon, XIcon } from "@elementor/icons";
|
|
653
539
|
import {
|
|
654
540
|
bindPopover,
|
|
655
541
|
bindTrigger as bindTrigger2,
|
|
656
|
-
Box
|
|
657
|
-
IconButton
|
|
542
|
+
Box,
|
|
543
|
+
IconButton,
|
|
658
544
|
Popover,
|
|
659
545
|
Stack as Stack4,
|
|
660
546
|
Typography as Typography2,
|
|
@@ -698,19 +584,19 @@ var Repeater = ({
|
|
|
698
584
|
})
|
|
699
585
|
);
|
|
700
586
|
};
|
|
701
|
-
return /* @__PURE__ */
|
|
587
|
+
return /* @__PURE__ */ React17.createElement(Stack4, null, /* @__PURE__ */ React17.createElement(Stack4, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pb: 1 } }, /* @__PURE__ */ React17.createElement(Typography2, { component: "label", variant: "caption", color: "text.secondary" }, label), /* @__PURE__ */ React17.createElement(IconButton, { size: SIZE, onClick: addRepeaterItem, "aria-label": __4("Add item", "elementor") }, /* @__PURE__ */ React17.createElement(PlusIcon, { fontSize: SIZE }))), /* @__PURE__ */ React17.createElement(Stack4, { gap: 1 }, repeaterValues.map((value, index) => /* @__PURE__ */ React17.createElement(
|
|
702
588
|
RepeaterItem,
|
|
703
589
|
{
|
|
704
590
|
key: index,
|
|
705
591
|
bind: String(index),
|
|
706
592
|
disabled: value.disabled,
|
|
707
|
-
label: /* @__PURE__ */
|
|
708
|
-
startIcon: /* @__PURE__ */
|
|
593
|
+
label: /* @__PURE__ */ React17.createElement(itemSettings.Label, { value }),
|
|
594
|
+
startIcon: /* @__PURE__ */ React17.createElement(itemSettings.Icon, { value }),
|
|
709
595
|
removeItem: () => removeRepeaterItem(index),
|
|
710
596
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
711
597
|
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
712
598
|
},
|
|
713
|
-
(props) => /* @__PURE__ */
|
|
599
|
+
(props) => /* @__PURE__ */ React17.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
714
600
|
))));
|
|
715
601
|
};
|
|
716
602
|
var RepeaterItem = ({
|
|
@@ -728,7 +614,7 @@ var RepeaterItem = ({
|
|
|
728
614
|
const [anchorEl, setAnchorEl] = useState2(null);
|
|
729
615
|
const popoverState = usePopupState2({ popupId, variant: "popover" });
|
|
730
616
|
const popoverProps = bindPopover(popoverState);
|
|
731
|
-
return /* @__PURE__ */
|
|
617
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
732
618
|
UnstableTag,
|
|
733
619
|
{
|
|
734
620
|
label,
|
|
@@ -738,33 +624,33 @@ var RepeaterItem = ({
|
|
|
738
624
|
"aria-label": __4("Open item", "elementor"),
|
|
739
625
|
...bindTrigger2(popoverState),
|
|
740
626
|
startIcon,
|
|
741
|
-
actions: /* @__PURE__ */
|
|
742
|
-
|
|
627
|
+
actions: /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
628
|
+
IconButton,
|
|
743
629
|
{
|
|
744
630
|
size: SIZE,
|
|
745
631
|
onClick: duplicateItem,
|
|
746
632
|
"aria-label": __4("Duplicate item", "elementor")
|
|
747
633
|
},
|
|
748
|
-
/* @__PURE__ */
|
|
749
|
-
), /* @__PURE__ */
|
|
750
|
-
|
|
634
|
+
/* @__PURE__ */ React17.createElement(CopyIcon, { fontSize: SIZE })
|
|
635
|
+
), /* @__PURE__ */ React17.createElement(
|
|
636
|
+
IconButton,
|
|
751
637
|
{
|
|
752
638
|
size: SIZE,
|
|
753
639
|
onClick: toggleDisableItem,
|
|
754
640
|
"aria-label": disabled ? __4("Enable item", "elementor") : __4("Disable item", "elementor")
|
|
755
641
|
},
|
|
756
|
-
disabled ? /* @__PURE__ */
|
|
757
|
-
), /* @__PURE__ */
|
|
758
|
-
|
|
642
|
+
disabled ? /* @__PURE__ */ React17.createElement(EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React17.createElement(EyeIcon, { fontSize: SIZE })
|
|
643
|
+
), /* @__PURE__ */ React17.createElement(
|
|
644
|
+
IconButton,
|
|
759
645
|
{
|
|
760
646
|
size: SIZE,
|
|
761
647
|
onClick: removeItem,
|
|
762
648
|
"aria-label": __4("Remove item", "elementor")
|
|
763
649
|
},
|
|
764
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ React17.createElement(XIcon, { fontSize: SIZE })
|
|
765
651
|
))
|
|
766
652
|
}
|
|
767
|
-
), /* @__PURE__ */
|
|
653
|
+
), /* @__PURE__ */ React17.createElement(
|
|
768
654
|
Popover,
|
|
769
655
|
{
|
|
770
656
|
disablePortal: true,
|
|
@@ -777,14 +663,14 @@ var RepeaterItem = ({
|
|
|
777
663
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
778
664
|
...popoverProps
|
|
779
665
|
},
|
|
780
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ React17.createElement(Box, null, children({ anchorEl }))
|
|
781
667
|
));
|
|
782
668
|
};
|
|
783
669
|
|
|
784
670
|
// src/controls/box-shadow-repeater-control.tsx
|
|
785
671
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
786
672
|
const { propType, value, setValue } = useBoundProp(boxShadowPropTypeUtil);
|
|
787
|
-
return /* @__PURE__ */
|
|
673
|
+
return /* @__PURE__ */ React18.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React18.createElement(
|
|
788
674
|
Repeater,
|
|
789
675
|
{
|
|
790
676
|
values: value ?? [],
|
|
@@ -799,13 +685,13 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
799
685
|
}
|
|
800
686
|
));
|
|
801
687
|
});
|
|
802
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */
|
|
688
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React18.createElement(UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
|
|
803
689
|
var ItemContent = ({ anchorEl, bind }) => {
|
|
804
|
-
return /* @__PURE__ */
|
|
690
|
+
return /* @__PURE__ */ React18.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React18.createElement(Content, { anchorEl }));
|
|
805
691
|
};
|
|
806
692
|
var Content = ({ anchorEl }) => {
|
|
807
693
|
const { propType, value, setValue } = useBoundProp(shadowPropTypeUtil);
|
|
808
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ React18.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React18.createElement(Stack5, { gap: 1.5, sx: { p: 1.5 } }, /* @__PURE__ */ React18.createElement(Grid3, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(Control2, { bind: "color", label: __5("Color", "elementor") }, /* @__PURE__ */ React18.createElement(
|
|
809
695
|
ColorControl,
|
|
810
696
|
{
|
|
811
697
|
slotProps: {
|
|
@@ -822,7 +708,7 @@ var Content = ({ anchorEl }) => {
|
|
|
822
708
|
}
|
|
823
709
|
}
|
|
824
710
|
}
|
|
825
|
-
)), /* @__PURE__ */
|
|
711
|
+
)), /* @__PURE__ */ React18.createElement(Control2, { bind: "position", label: __5("Position", "elementor") }, /* @__PURE__ */ React18.createElement(
|
|
826
712
|
SelectControl,
|
|
827
713
|
{
|
|
828
714
|
options: [
|
|
@@ -830,9 +716,9 @@ var Content = ({ anchorEl }) => {
|
|
|
830
716
|
{ label: __5("Outset", "elementor"), value: null }
|
|
831
717
|
]
|
|
832
718
|
}
|
|
833
|
-
))), /* @__PURE__ */
|
|
719
|
+
))), /* @__PURE__ */ React18.createElement(Grid3, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(Control2, { bind: "hOffset", label: __5("Horizontal", "elementor") }, /* @__PURE__ */ React18.createElement(SizeControl, null)), /* @__PURE__ */ React18.createElement(Control2, { bind: "vOffset", label: __5("Vertical", "elementor") }, /* @__PURE__ */ React18.createElement(SizeControl, null))), /* @__PURE__ */ React18.createElement(Grid3, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(Control2, { bind: "blur", label: __5("Blur", "elementor") }, /* @__PURE__ */ React18.createElement(SizeControl, null)), /* @__PURE__ */ React18.createElement(Control2, { bind: "spread", label: __5("Spread", "elementor") }, /* @__PURE__ */ React18.createElement(SizeControl, null)))));
|
|
834
720
|
};
|
|
835
|
-
var Control2 = ({ label, bind, children }) => /* @__PURE__ */
|
|
721
|
+
var Control2 = ({ label, bind, children }) => /* @__PURE__ */ React18.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React18.createElement(Grid3, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React18.createElement(Grid3, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React18.createElement(Grid3, { item: true, xs: 12 }, /* @__PURE__ */ React18.createElement(Typography3, { component: "label", variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React18.createElement(Grid3, { item: true, xs: 12 }, children))));
|
|
836
722
|
var ItemLabel = ({ value }) => {
|
|
837
723
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
838
724
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -846,7 +732,7 @@ var ItemLabel = ({ value }) => {
|
|
|
846
732
|
blurSize + blurUnit,
|
|
847
733
|
spreadSize + spreadUnit
|
|
848
734
|
].join(" ");
|
|
849
|
-
return /* @__PURE__ */
|
|
735
|
+
return /* @__PURE__ */ React18.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
850
736
|
};
|
|
851
737
|
var initialShadow = {
|
|
852
738
|
$$type: "shadow",
|
|
@@ -876,11 +762,11 @@ var initialShadow = {
|
|
|
876
762
|
};
|
|
877
763
|
|
|
878
764
|
// src/controls/toggle-control.tsx
|
|
879
|
-
import * as
|
|
765
|
+
import * as React20 from "react";
|
|
880
766
|
import { stringPropTypeUtil as stringPropTypeUtil4 } from "@elementor/editor-props";
|
|
881
767
|
|
|
882
768
|
// src/components/control-toggle-button-group.tsx
|
|
883
|
-
import * as
|
|
769
|
+
import * as React19 from "react";
|
|
884
770
|
import {
|
|
885
771
|
styled as styled2,
|
|
886
772
|
ToggleButton,
|
|
@@ -904,7 +790,7 @@ var ControlToggleButtonGroup = ({
|
|
|
904
790
|
const handleChange = (_, newValue) => {
|
|
905
791
|
onChange(newValue);
|
|
906
792
|
};
|
|
907
|
-
return /* @__PURE__ */
|
|
793
|
+
return /* @__PURE__ */ React19.createElement(
|
|
908
794
|
StyledToggleButtonGroup,
|
|
909
795
|
{
|
|
910
796
|
justify,
|
|
@@ -916,7 +802,7 @@ var ControlToggleButtonGroup = ({
|
|
|
916
802
|
}
|
|
917
803
|
},
|
|
918
804
|
items.map(
|
|
919
|
-
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */
|
|
805
|
+
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */ React19.createElement(Tooltip, { key: buttonValue, title: label, disableFocusListener: true, placement: "top" }, /* @__PURE__ */ React19.createElement(ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React19.createElement(Content3, { size }))) : /* @__PURE__ */ React19.createElement(
|
|
920
806
|
ToggleButton,
|
|
921
807
|
{
|
|
922
808
|
key: buttonValue,
|
|
@@ -925,7 +811,7 @@ var ControlToggleButtonGroup = ({
|
|
|
925
811
|
size,
|
|
926
812
|
fullWidth
|
|
927
813
|
},
|
|
928
|
-
/* @__PURE__ */
|
|
814
|
+
/* @__PURE__ */ React19.createElement(Content3, { size })
|
|
929
815
|
)
|
|
930
816
|
)
|
|
931
817
|
);
|
|
@@ -938,7 +824,7 @@ var ToggleControl = createControl(
|
|
|
938
824
|
const handleToggle = (option) => {
|
|
939
825
|
setValue(option);
|
|
940
826
|
};
|
|
941
|
-
return /* @__PURE__ */
|
|
827
|
+
return /* @__PURE__ */ React20.createElement(
|
|
942
828
|
ControlToggleButtonGroup,
|
|
943
829
|
{
|
|
944
830
|
items: options,
|
|
@@ -953,9 +839,9 @@ var ToggleControl = createControl(
|
|
|
953
839
|
);
|
|
954
840
|
|
|
955
841
|
// src/controls/number-control.tsx
|
|
956
|
-
import * as
|
|
842
|
+
import * as React21 from "react";
|
|
957
843
|
import { numberPropTypeUtil } from "@elementor/editor-props";
|
|
958
|
-
import { TextField as
|
|
844
|
+
import { TextField as TextField4 } from "@elementor/ui";
|
|
959
845
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
960
846
|
var NumberControl = createControl(
|
|
961
847
|
({
|
|
@@ -975,8 +861,8 @@ var NumberControl = createControl(
|
|
|
975
861
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
976
862
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
977
863
|
};
|
|
978
|
-
return /* @__PURE__ */
|
|
979
|
-
|
|
864
|
+
return /* @__PURE__ */ React21.createElement(ControlActions, null, /* @__PURE__ */ React21.createElement(
|
|
865
|
+
TextField4,
|
|
980
866
|
{
|
|
981
867
|
size: "tiny",
|
|
982
868
|
type: "number",
|
|
@@ -991,7 +877,7 @@ var NumberControl = createControl(
|
|
|
991
877
|
);
|
|
992
878
|
|
|
993
879
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
994
|
-
import * as
|
|
880
|
+
import * as React22 from "react";
|
|
995
881
|
import { useId as useId2, useRef as useRef2 } from "react";
|
|
996
882
|
import { sizePropTypeUtil as sizePropTypeUtil2 } from "@elementor/editor-props";
|
|
997
883
|
import { bindPopover as bindPopover2, bindToggle, Grid as Grid4, Popover as Popover2, Stack as Stack6, ToggleButton as ToggleButton2, usePopupState as usePopupState3 } from "@elementor/ui";
|
|
@@ -1048,7 +934,7 @@ function EqualUnequalSizesControl({
|
|
|
1048
934
|
return splitEqualValue() ?? null;
|
|
1049
935
|
};
|
|
1050
936
|
const isMixed = !!multiSizeValue;
|
|
1051
|
-
return /* @__PURE__ */
|
|
937
|
+
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React22.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(ControlLabel, null, label)), /* @__PURE__ */ React22.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(Stack6, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React22.createElement(SizeControl, { placeholder: isMixed ? __6("Mixed", "elementor") : void 0 }), /* @__PURE__ */ React22.createElement(
|
|
1052
938
|
ToggleButton2,
|
|
1053
939
|
{
|
|
1054
940
|
size: "tiny",
|
|
@@ -1058,7 +944,7 @@ function EqualUnequalSizesControl({
|
|
|
1058
944
|
selected: popupState.isOpen
|
|
1059
945
|
},
|
|
1060
946
|
icon
|
|
1061
|
-
)))), /* @__PURE__ */
|
|
947
|
+
)))), /* @__PURE__ */ React22.createElement(
|
|
1062
948
|
Popover2,
|
|
1063
949
|
{
|
|
1064
950
|
disablePortal: true,
|
|
@@ -1076,13 +962,13 @@ function EqualUnequalSizesControl({
|
|
|
1076
962
|
paper: { sx: { mt: 0.5, p: 2, pt: 1, width: controlRef.current?.getBoundingClientRect().width } }
|
|
1077
963
|
}
|
|
1078
964
|
},
|
|
1079
|
-
/* @__PURE__ */
|
|
965
|
+
/* @__PURE__ */ React22.createElement(PropProvider, { propType: multiSizePropType, value: getMultiSizeValues(), setValue: setNestedProp }, /* @__PURE__ */ React22.createElement(Stack6, { gap: 1.5 }, /* @__PURE__ */ React22.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React22.createElement(MultiSizeValueControl, { item: items[0] }), /* @__PURE__ */ React22.createElement(MultiSizeValueControl, { item: items[1] })), /* @__PURE__ */ React22.createElement(Grid4, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React22.createElement(MultiSizeValueControl, { item: items[3] }), /* @__PURE__ */ React22.createElement(MultiSizeValueControl, { item: items[2] }))))
|
|
1080
966
|
));
|
|
1081
967
|
}
|
|
1082
|
-
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */
|
|
968
|
+
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React22.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React22.createElement(Grid4, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(Grid4, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React22.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React22.createElement(Grid4, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(SizeControl, { startIcon: item.icon })))));
|
|
1083
969
|
|
|
1084
970
|
// src/controls/linked-dimensions-control.tsx
|
|
1085
|
-
import * as
|
|
971
|
+
import * as React23 from "react";
|
|
1086
972
|
import { dimensionsPropTypeUtil, sizePropTypeUtil as sizePropTypeUtil3 } from "@elementor/editor-props";
|
|
1087
973
|
import { DetachIcon, LinkIcon, SideBottomIcon, SideLeftIcon, SideRightIcon, SideTopIcon } from "@elementor/icons";
|
|
1088
974
|
import { Grid as Grid5, Stack as Stack7, ToggleButton as ToggleButton3 } from "@elementor/ui";
|
|
@@ -1105,73 +991,73 @@ var LinkedDimensionsControl = createControl(({ label }) => {
|
|
|
1105
991
|
});
|
|
1106
992
|
};
|
|
1107
993
|
const LinkedIcon = isLinked ? LinkIcon : DetachIcon;
|
|
1108
|
-
return /* @__PURE__ */
|
|
994
|
+
return /* @__PURE__ */ React23.createElement(PropProvider, { propType, value: dimensionsValue, setValue: setDimensionsValue }, /* @__PURE__ */ React23.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React23.createElement(ControlLabel, null, label), /* @__PURE__ */ React23.createElement(
|
|
1109
995
|
ToggleButton3,
|
|
1110
996
|
{
|
|
1111
|
-
"aria-label": __7("Link
|
|
997
|
+
"aria-label": __7("Link inputs", "elementor"),
|
|
1112
998
|
size: "tiny",
|
|
1113
999
|
value: "check",
|
|
1114
1000
|
selected: isLinked,
|
|
1115
1001
|
sx: { marginLeft: "auto" },
|
|
1116
1002
|
onChange: onLinkToggle
|
|
1117
1003
|
},
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
)), /* @__PURE__ */
|
|
1004
|
+
/* @__PURE__ */ React23.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1005
|
+
)), /* @__PURE__ */ React23.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React23.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, __7("Top", "elementor"))), /* @__PURE__ */ React23.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(
|
|
1120
1006
|
Control3,
|
|
1121
1007
|
{
|
|
1122
1008
|
bind: "top",
|
|
1123
|
-
startIcon: /* @__PURE__ */
|
|
1009
|
+
startIcon: /* @__PURE__ */ React23.createElement(SideTopIcon, { fontSize: "tiny" }),
|
|
1124
1010
|
isLinked
|
|
1125
1011
|
}
|
|
1126
|
-
))), /* @__PURE__ */
|
|
1012
|
+
))), /* @__PURE__ */ React23.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, __7("Right", "elementor"))), /* @__PURE__ */ React23.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(
|
|
1127
1013
|
Control3,
|
|
1128
1014
|
{
|
|
1129
1015
|
bind: "right",
|
|
1130
|
-
startIcon: /* @__PURE__ */
|
|
1016
|
+
startIcon: /* @__PURE__ */ React23.createElement(SideRightIcon, { fontSize: "tiny" }),
|
|
1131
1017
|
isLinked
|
|
1132
1018
|
}
|
|
1133
|
-
)))), /* @__PURE__ */
|
|
1019
|
+
)))), /* @__PURE__ */ React23.createElement(Stack7, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React23.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, __7("Bottom", "elementor"))), /* @__PURE__ */ React23.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(
|
|
1134
1020
|
Control3,
|
|
1135
1021
|
{
|
|
1136
1022
|
bind: "bottom",
|
|
1137
|
-
startIcon: /* @__PURE__ */
|
|
1023
|
+
startIcon: /* @__PURE__ */ React23.createElement(SideBottomIcon, { fontSize: "tiny" }),
|
|
1138
1024
|
isLinked
|
|
1139
1025
|
}
|
|
1140
|
-
))), /* @__PURE__ */
|
|
1026
|
+
))), /* @__PURE__ */ React23.createElement(Grid5, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, __7("Left", "elementor"))), /* @__PURE__ */ React23.createElement(Grid5, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(
|
|
1141
1027
|
Control3,
|
|
1142
1028
|
{
|
|
1143
1029
|
bind: "left",
|
|
1144
|
-
startIcon: /* @__PURE__ */
|
|
1030
|
+
startIcon: /* @__PURE__ */ React23.createElement(SideLeftIcon, { fontSize: "tiny" }),
|
|
1145
1031
|
isLinked
|
|
1146
1032
|
}
|
|
1147
1033
|
)))));
|
|
1148
1034
|
});
|
|
1149
1035
|
var Control3 = ({ bind, startIcon, isLinked }) => {
|
|
1150
1036
|
if (isLinked) {
|
|
1151
|
-
return /* @__PURE__ */
|
|
1037
|
+
return /* @__PURE__ */ React23.createElement(SizeControl, { startIcon });
|
|
1152
1038
|
}
|
|
1153
|
-
return /* @__PURE__ */
|
|
1039
|
+
return /* @__PURE__ */ React23.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React23.createElement(SizeControl, { startIcon }));
|
|
1154
1040
|
};
|
|
1155
1041
|
|
|
1156
1042
|
// src/controls/font-family-control.tsx
|
|
1157
1043
|
import { Fragment as Fragment4, useId as useId3, useState as useState3 } from "react";
|
|
1158
|
-
import * as
|
|
1044
|
+
import * as React24 from "react";
|
|
1159
1045
|
import { stringPropTypeUtil as stringPropTypeUtil5 } from "@elementor/editor-props";
|
|
1160
|
-
import { ChevronDownIcon, EditIcon, PhotoIcon, SearchIcon, XIcon as
|
|
1046
|
+
import { ChevronDownIcon, EditIcon, PhotoIcon, SearchIcon, XIcon as XIcon2 } from "@elementor/icons";
|
|
1161
1047
|
import {
|
|
1162
1048
|
bindPopover as bindPopover3,
|
|
1163
1049
|
bindTrigger as bindTrigger3,
|
|
1164
|
-
Box as
|
|
1050
|
+
Box as Box2,
|
|
1165
1051
|
Divider,
|
|
1166
|
-
IconButton as
|
|
1167
|
-
InputAdornment as
|
|
1052
|
+
IconButton as IconButton2,
|
|
1053
|
+
InputAdornment as InputAdornment3,
|
|
1168
1054
|
Link,
|
|
1169
1055
|
ListSubheader,
|
|
1170
1056
|
MenuItem as MenuItem3,
|
|
1171
1057
|
MenuList,
|
|
1172
1058
|
Popover as Popover3,
|
|
1173
1059
|
Stack as Stack8,
|
|
1174
|
-
TextField as
|
|
1060
|
+
TextField as TextField5,
|
|
1175
1061
|
Typography as Typography4,
|
|
1176
1062
|
UnstableTag as UnstableTag2,
|
|
1177
1063
|
usePopupState as usePopupState4
|
|
@@ -1226,16 +1112,16 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1226
1112
|
setSearchValue("");
|
|
1227
1113
|
popoverState.close();
|
|
1228
1114
|
};
|
|
1229
|
-
return /* @__PURE__ */
|
|
1115
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(
|
|
1230
1116
|
UnstableTag2,
|
|
1231
1117
|
{
|
|
1232
1118
|
variant: "outlined",
|
|
1233
1119
|
label: fontFamily,
|
|
1234
|
-
endIcon: /* @__PURE__ */
|
|
1120
|
+
endIcon: /* @__PURE__ */ React24.createElement(ChevronDownIcon, { fontSize: "tiny" }),
|
|
1235
1121
|
...bindTrigger3(popoverState),
|
|
1236
1122
|
fullWidth: true
|
|
1237
1123
|
}
|
|
1238
|
-
), /* @__PURE__ */
|
|
1124
|
+
), /* @__PURE__ */ React24.createElement(
|
|
1239
1125
|
Popover3,
|
|
1240
1126
|
{
|
|
1241
1127
|
disablePortal: true,
|
|
@@ -1244,8 +1130,8 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1244
1130
|
...bindPopover3(popoverState),
|
|
1245
1131
|
onClose: handleClose
|
|
1246
1132
|
},
|
|
1247
|
-
/* @__PURE__ */
|
|
1248
|
-
|
|
1133
|
+
/* @__PURE__ */ React24.createElement(Stack8, null, /* @__PURE__ */ React24.createElement(Stack8, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React24.createElement(EditIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React24.createElement(Typography4, { variant: "subtitle2" }, __9("Font Family", "elementor")), /* @__PURE__ */ React24.createElement(IconButton2, { size: SIZE2, sx: { ml: "auto" }, onClick: handleClose }, /* @__PURE__ */ React24.createElement(XIcon2, { fontSize: SIZE2 }))), /* @__PURE__ */ React24.createElement(Box2, { px: 1.5, pb: 1 }, /* @__PURE__ */ React24.createElement(
|
|
1134
|
+
TextField5,
|
|
1249
1135
|
{
|
|
1250
1136
|
fullWidth: true,
|
|
1251
1137
|
size: SIZE2,
|
|
@@ -1253,12 +1139,12 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1253
1139
|
placeholder: __9("Search", "elementor"),
|
|
1254
1140
|
onChange: handleSearch,
|
|
1255
1141
|
InputProps: {
|
|
1256
|
-
startAdornment: /* @__PURE__ */
|
|
1142
|
+
startAdornment: /* @__PURE__ */ React24.createElement(InputAdornment3, { position: "start" }, /* @__PURE__ */ React24.createElement(SearchIcon, { fontSize: SIZE2 }))
|
|
1257
1143
|
}
|
|
1258
1144
|
}
|
|
1259
|
-
)), /* @__PURE__ */
|
|
1145
|
+
)), /* @__PURE__ */ React24.createElement(Divider, null), /* @__PURE__ */ React24.createElement(Box2, { sx: { overflowY: "auto", height: 260, width: 220 } }, filteredFontFamilies.length > 0 ? /* @__PURE__ */ React24.createElement(MenuList, { role: "listbox", tabIndex: 0 }, filteredFontFamilies.map(([category, items], index) => /* @__PURE__ */ React24.createElement(Fragment4, { key: index }, /* @__PURE__ */ React24.createElement(ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, category), items.map((item) => {
|
|
1260
1146
|
const isSelected = item === fontFamily;
|
|
1261
|
-
return /* @__PURE__ */
|
|
1147
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1262
1148
|
MenuItem3,
|
|
1263
1149
|
{
|
|
1264
1150
|
key: item,
|
|
@@ -1273,7 +1159,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1273
1159
|
},
|
|
1274
1160
|
item
|
|
1275
1161
|
);
|
|
1276
|
-
})))) : /* @__PURE__ */
|
|
1162
|
+
})))) : /* @__PURE__ */ React24.createElement(Stack8, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React24.createElement(PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React24.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, __9("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React24.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React24.createElement(Typography4, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React24.createElement(
|
|
1277
1163
|
Link,
|
|
1278
1164
|
{
|
|
1279
1165
|
color: "secondary",
|
|
@@ -1287,14 +1173,14 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1287
1173
|
});
|
|
1288
1174
|
|
|
1289
1175
|
// src/controls/url-control.tsx
|
|
1290
|
-
import * as
|
|
1176
|
+
import * as React25 from "react";
|
|
1291
1177
|
import { urlPropTypeUtil } from "@elementor/editor-props";
|
|
1292
|
-
import { TextField as
|
|
1178
|
+
import { TextField as TextField6 } from "@elementor/ui";
|
|
1293
1179
|
var UrlControl = createControl(({ placeholder }) => {
|
|
1294
1180
|
const { value, setValue } = useBoundProp(urlPropTypeUtil);
|
|
1295
1181
|
const handleChange = (event) => setValue(event.target.value);
|
|
1296
|
-
return /* @__PURE__ */
|
|
1297
|
-
|
|
1182
|
+
return /* @__PURE__ */ React25.createElement(ControlActions, null, /* @__PURE__ */ React25.createElement(
|
|
1183
|
+
TextField6,
|
|
1298
1184
|
{
|
|
1299
1185
|
size: "tiny",
|
|
1300
1186
|
fullWidth: true,
|
|
@@ -1307,17 +1193,138 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1307
1193
|
|
|
1308
1194
|
// src/controls/link-control.tsx
|
|
1309
1195
|
import * as React27 from "react";
|
|
1310
|
-
import { useState as useState4 } from "react";
|
|
1311
|
-
import {
|
|
1196
|
+
import { useMemo, useState as useState4 } from "react";
|
|
1197
|
+
import {
|
|
1198
|
+
booleanPropTypeUtil,
|
|
1199
|
+
linkPropTypeUtil,
|
|
1200
|
+
numberPropTypeUtil as numberPropTypeUtil2,
|
|
1201
|
+
stringPropTypeUtil as stringPropTypeUtil6,
|
|
1202
|
+
urlPropTypeUtil as urlPropTypeUtil2
|
|
1203
|
+
} from "@elementor/editor-props";
|
|
1312
1204
|
import { httpService } from "@elementor/http";
|
|
1313
1205
|
import { MinusIcon, PlusIcon as PlusIcon2 } from "@elementor/icons";
|
|
1314
1206
|
import { useSessionStorage } from "@elementor/session";
|
|
1315
1207
|
import { Collapse, Divider as Divider2, Grid as Grid6, IconButton as IconButton4, Stack as Stack9, Switch } from "@elementor/ui";
|
|
1316
1208
|
import { __ as __10 } from "@wordpress/i18n";
|
|
1209
|
+
|
|
1210
|
+
// src/components/autocomplete.tsx
|
|
1211
|
+
import * as React26 from "react";
|
|
1212
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
1213
|
+
import { XIcon as XIcon3 } from "@elementor/icons";
|
|
1214
|
+
import {
|
|
1215
|
+
Autocomplete as AutocompleteBase,
|
|
1216
|
+
Box as Box3,
|
|
1217
|
+
IconButton as IconButton3,
|
|
1218
|
+
InputAdornment as InputAdornment4,
|
|
1219
|
+
TextField as TextField7
|
|
1220
|
+
} from "@elementor/ui";
|
|
1221
|
+
var Autocomplete = forwardRef2((props, ref) => {
|
|
1222
|
+
const {
|
|
1223
|
+
options,
|
|
1224
|
+
onOptionChange,
|
|
1225
|
+
onTextChange,
|
|
1226
|
+
allowCustomValues = false,
|
|
1227
|
+
placeholder = "",
|
|
1228
|
+
minInputLength = 2,
|
|
1229
|
+
value = "",
|
|
1230
|
+
...restProps
|
|
1231
|
+
} = props;
|
|
1232
|
+
const optionKeys = _factoryFilter(value, options, minInputLength).map(({ id }) => id);
|
|
1233
|
+
const allowClear = !!value;
|
|
1234
|
+
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
1235
|
+
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
1236
|
+
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
1237
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1238
|
+
AutocompleteBase,
|
|
1239
|
+
{
|
|
1240
|
+
...restProps,
|
|
1241
|
+
ref,
|
|
1242
|
+
forcePopupIcon: false,
|
|
1243
|
+
disableClearable: true,
|
|
1244
|
+
freeSolo: allowCustomValues,
|
|
1245
|
+
value: value?.toString() || "",
|
|
1246
|
+
size: "tiny",
|
|
1247
|
+
onChange: (_, newValue) => onOptionChange(Number(newValue)),
|
|
1248
|
+
readOnly: isValueFromOptions,
|
|
1249
|
+
options: optionKeys,
|
|
1250
|
+
getOptionKey: (optionId) => findMatchingOption(options, optionId)?.id || optionId,
|
|
1251
|
+
getOptionLabel: (optionId) => findMatchingOption(options, optionId)?.label || optionId.toString(),
|
|
1252
|
+
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
1253
|
+
isOptionEqualToValue,
|
|
1254
|
+
filterOptions: () => optionKeys,
|
|
1255
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React26.createElement(Box3, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
1256
|
+
renderInput: (params) => /* @__PURE__ */ React26.createElement(
|
|
1257
|
+
TextInput,
|
|
1258
|
+
{
|
|
1259
|
+
params,
|
|
1260
|
+
handleChange: (newValue) => onTextChange?.(newValue),
|
|
1261
|
+
allowClear,
|
|
1262
|
+
placeholder,
|
|
1263
|
+
hasSelectedValue: isValueFromOptions
|
|
1264
|
+
}
|
|
1265
|
+
)
|
|
1266
|
+
}
|
|
1267
|
+
);
|
|
1268
|
+
});
|
|
1269
|
+
var TextInput = ({
|
|
1270
|
+
params,
|
|
1271
|
+
allowClear,
|
|
1272
|
+
placeholder,
|
|
1273
|
+
handleChange,
|
|
1274
|
+
hasSelectedValue
|
|
1275
|
+
}) => {
|
|
1276
|
+
const onChange = (event) => {
|
|
1277
|
+
handleChange(event.target.value);
|
|
1278
|
+
};
|
|
1279
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1280
|
+
TextField7,
|
|
1281
|
+
{
|
|
1282
|
+
...params,
|
|
1283
|
+
placeholder,
|
|
1284
|
+
onChange,
|
|
1285
|
+
sx: {
|
|
1286
|
+
"& .MuiInputBase-input": {
|
|
1287
|
+
cursor: hasSelectedValue ? "default" : void 0
|
|
1288
|
+
}
|
|
1289
|
+
},
|
|
1290
|
+
InputProps: {
|
|
1291
|
+
...params.InputProps,
|
|
1292
|
+
endAdornment: /* @__PURE__ */ React26.createElement(ClearButton, { params, allowClear, handleChange })
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
);
|
|
1296
|
+
};
|
|
1297
|
+
var ClearButton = ({
|
|
1298
|
+
allowClear,
|
|
1299
|
+
handleChange,
|
|
1300
|
+
params
|
|
1301
|
+
}) => /* @__PURE__ */ React26.createElement(InputAdornment4, { position: "end" }, allowClear && /* @__PURE__ */ React26.createElement(IconButton3, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React26.createElement(XIcon3, { fontSize: params.size })));
|
|
1302
|
+
function findMatchingOption(options, optionId = null) {
|
|
1303
|
+
const formattedOption = (optionId || "").toString();
|
|
1304
|
+
return options.find(({ id }) => formattedOption === id.toString());
|
|
1305
|
+
}
|
|
1306
|
+
function isCategorizedOptionPool(options) {
|
|
1307
|
+
return options.every((option) => "groupLabel" in option);
|
|
1308
|
+
}
|
|
1309
|
+
function _factoryFilter(newValue, options, minInputLength) {
|
|
1310
|
+
if (null === newValue) {
|
|
1311
|
+
return options;
|
|
1312
|
+
}
|
|
1313
|
+
const formattedValue = String(newValue || "")?.toLowerCase();
|
|
1314
|
+
if (formattedValue.length < minInputLength) {
|
|
1315
|
+
return new Array(0);
|
|
1316
|
+
}
|
|
1317
|
+
return options.filter(
|
|
1318
|
+
(option) => String(option.id).toLowerCase().includes(formattedValue) || option.label.toLowerCase().includes(formattedValue)
|
|
1319
|
+
);
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
// src/controls/link-control.tsx
|
|
1317
1323
|
var SIZE3 = "tiny";
|
|
1318
1324
|
var LinkControl = createControl((props) => {
|
|
1319
1325
|
const { value, path, setValue, ...propContext } = useBoundProp(linkPropTypeUtil);
|
|
1320
1326
|
const [linkSessionValue, setLinkSessionValue] = useSessionStorage(path.join("/"));
|
|
1327
|
+
const [isEnabled, setIsEnabled] = useState4(!!value);
|
|
1321
1328
|
const {
|
|
1322
1329
|
allowCustomValues,
|
|
1323
1330
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
@@ -1328,28 +1335,25 @@ var LinkControl = createControl((props) => {
|
|
|
1328
1335
|
generateFirstLoadedOption(value)
|
|
1329
1336
|
);
|
|
1330
1337
|
const onEnabledChange = () => {
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
setValue(isEnabled ? null : linkSessionValue?.value ?? { destination: null });
|
|
1338
|
+
setIsEnabled((prevState) => !prevState);
|
|
1339
|
+
setValue(isEnabled ? null : linkSessionValue?.value ?? null);
|
|
1334
1340
|
setLinkSessionValue({ value, meta: { isEnabled: !isEnabled } });
|
|
1335
1341
|
};
|
|
1336
1342
|
const onOptionChange = (newValue) => {
|
|
1337
|
-
const valueToSave = {
|
|
1343
|
+
const valueToSave = newValue ? {
|
|
1338
1344
|
...value,
|
|
1339
|
-
destination:
|
|
1340
|
-
label:
|
|
1341
|
-
|
|
1342
|
-
value: findMatchingOption(options, newValue?.toString())?.label || ""
|
|
1343
|
-
}
|
|
1344
|
-
};
|
|
1345
|
+
destination: numberPropTypeUtil2.create(newValue),
|
|
1346
|
+
label: stringPropTypeUtil6.create(findMatchingOption(options, newValue)?.label || null)
|
|
1347
|
+
} : null;
|
|
1345
1348
|
onSaveNewValue(valueToSave);
|
|
1346
1349
|
};
|
|
1347
1350
|
const onTextChange = (newValue) => {
|
|
1348
|
-
|
|
1351
|
+
newValue = newValue?.trim() || "";
|
|
1352
|
+
const valueToSave = newValue ? {
|
|
1349
1353
|
...value,
|
|
1350
|
-
destination:
|
|
1354
|
+
destination: urlPropTypeUtil2.create(newValue),
|
|
1351
1355
|
label: null
|
|
1352
|
-
};
|
|
1356
|
+
} : null;
|
|
1353
1357
|
onSaveNewValue(valueToSave);
|
|
1354
1358
|
updateOptions(newValue);
|
|
1355
1359
|
};
|
|
@@ -1362,13 +1366,16 @@ var LinkControl = createControl((props) => {
|
|
|
1362
1366
|
if (!newValue || !endpoint || newValue.length < minInputLength) {
|
|
1363
1367
|
return;
|
|
1364
1368
|
}
|
|
1365
|
-
debounceFetch(newValue)
|
|
1369
|
+
debounceFetch({ ...requestParams, term: newValue });
|
|
1366
1370
|
};
|
|
1367
|
-
const debounceFetch = (
|
|
1368
|
-
() =>
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1371
|
+
const debounceFetch = useMemo(
|
|
1372
|
+
() => debounce(
|
|
1373
|
+
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
1374
|
+
setOptions(formatOptions(newOptions));
|
|
1375
|
+
}),
|
|
1376
|
+
400
|
|
1377
|
+
),
|
|
1378
|
+
[endpoint]
|
|
1372
1379
|
);
|
|
1373
1380
|
return /* @__PURE__ */ React27.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React27.createElement(Stack9, { gap: 1.5 }, /* @__PURE__ */ React27.createElement(Divider2, null), /* @__PURE__ */ React27.createElement(
|
|
1374
1381
|
Stack9,
|
|
@@ -1383,24 +1390,23 @@ var LinkControl = createControl((props) => {
|
|
|
1383
1390
|
/* @__PURE__ */ React27.createElement(
|
|
1384
1391
|
ToggleIconControl,
|
|
1385
1392
|
{
|
|
1386
|
-
enabled:
|
|
1393
|
+
enabled: isEnabled,
|
|
1387
1394
|
onIconClick: onEnabledChange,
|
|
1388
|
-
label: __10("Toggle
|
|
1395
|
+
label: __10("Toggle link", "elementor")
|
|
1389
1396
|
}
|
|
1390
1397
|
)
|
|
1391
|
-
), /* @__PURE__ */ React27.createElement(Collapse, { in:
|
|
1392
|
-
|
|
1398
|
+
), /* @__PURE__ */ React27.createElement(Collapse, { in: isEnabled, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React27.createElement(Stack9, { gap: 1.5 }, /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React27.createElement(ControlActions, null, /* @__PURE__ */ React27.createElement(
|
|
1399
|
+
Autocomplete,
|
|
1393
1400
|
{
|
|
1394
1401
|
options,
|
|
1395
1402
|
allowCustomValues,
|
|
1396
1403
|
placeholder,
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
minInputLength
|
|
1401
|
-
customValue: value?.destination?.value?.toString()
|
|
1404
|
+
value: value?.destination?.value,
|
|
1405
|
+
onOptionChange,
|
|
1406
|
+
onTextChange,
|
|
1407
|
+
minInputLength
|
|
1402
1408
|
}
|
|
1403
|
-
)), /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React27.createElement(SwitchControl, null))))));
|
|
1409
|
+
))), /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React27.createElement(SwitchControl, null))))));
|
|
1404
1410
|
});
|
|
1405
1411
|
var ToggleIconControl = ({ enabled, onIconClick, label }) => {
|
|
1406
1412
|
return /* @__PURE__ */ React27.createElement(IconButton4, { size: SIZE3, onClick: onIconClick, "aria-label": label }, enabled ? /* @__PURE__ */ React27.createElement(MinusIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React27.createElement(PlusIcon2, { fontSize: SIZE3 }));
|
|
@@ -1479,7 +1485,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
1479
1485
|
return /* @__PURE__ */ React28.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React28.createElement(Stack10, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(ControlLabel, null, label), /* @__PURE__ */ React28.createElement(
|
|
1480
1486
|
ToggleButton4,
|
|
1481
1487
|
{
|
|
1482
|
-
"aria-label": __11("Link
|
|
1488
|
+
"aria-label": __11("Link inputs", "elementor"),
|
|
1483
1489
|
size: "tiny",
|
|
1484
1490
|
value: "check",
|
|
1485
1491
|
selected: isLinked,
|
|
@@ -1594,11 +1600,11 @@ import { __ as __18 } from "@wordpress/i18n";
|
|
|
1594
1600
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1595
1601
|
import * as React34 from "react";
|
|
1596
1602
|
import {
|
|
1597
|
-
backgroundColorOverlayPropTypeUtil,
|
|
1598
|
-
backgroundImageOverlayPropTypeUtil,
|
|
1603
|
+
backgroundColorOverlayPropTypeUtil as backgroundColorOverlayPropTypeUtil2,
|
|
1604
|
+
backgroundImageOverlayPropTypeUtil as backgroundImageOverlayPropTypeUtil2,
|
|
1599
1605
|
backgroundOverlayPropTypeUtil
|
|
1600
1606
|
} from "@elementor/editor-props";
|
|
1601
|
-
import { Box as Box4, CardMedia as CardMedia3, Grid as Grid12, Stack as Stack12, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator2
|
|
1607
|
+
import { Box as Box4, CardMedia as CardMedia3, Grid as Grid12, Stack as Stack12, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator2 } from "@elementor/ui";
|
|
1602
1608
|
import { useWpMediaAttachment as useWpMediaAttachment3 } from "@elementor/wp-media";
|
|
1603
1609
|
import { __ as __17 } from "@wordpress/i18n";
|
|
1604
1610
|
|
|
@@ -1626,30 +1632,30 @@ var attachmentControlOptions = [
|
|
|
1626
1632
|
}
|
|
1627
1633
|
];
|
|
1628
1634
|
var BackgroundImageOverlayAttachment = () => {
|
|
1629
|
-
return /* @__PURE__ */ React30.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, __13("Attachment", "elementor"))), /* @__PURE__ */ React30.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React30.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
1635
|
+
return /* @__PURE__ */ React30.createElement(Grid8, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(Grid8, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, __13("Attachment", "elementor"))), /* @__PURE__ */ React30.createElement(Grid8, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React30.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
1630
1636
|
};
|
|
1631
1637
|
|
|
1632
1638
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
1633
1639
|
import * as React31 from "react";
|
|
1634
|
-
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as
|
|
1640
|
+
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil7 } from "@elementor/editor-props";
|
|
1635
1641
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
1636
1642
|
import { Grid as Grid9, MenuItem as MenuItem4, Select as Select2 } from "@elementor/ui";
|
|
1637
1643
|
import { __ as __14 } from "@wordpress/i18n";
|
|
1638
1644
|
var backgroundPositionOptions = [
|
|
1639
|
-
{ label: __14("Center
|
|
1640
|
-
{ label: __14("Center
|
|
1641
|
-
{ label: __14("Center
|
|
1642
|
-
{ label: __14("Top
|
|
1643
|
-
{ label: __14("Top
|
|
1644
|
-
{ label: __14("Top
|
|
1645
|
-
{ label: __14("Bottom
|
|
1646
|
-
{ label: __14("Bottom
|
|
1647
|
-
{ label: __14("Bottom
|
|
1645
|
+
{ label: __14("Center center", "elementor"), value: "center center" },
|
|
1646
|
+
{ label: __14("Center left", "elementor"), value: "center left" },
|
|
1647
|
+
{ label: __14("Center right", "elementor"), value: "center right" },
|
|
1648
|
+
{ label: __14("Top center", "elementor"), value: "top center" },
|
|
1649
|
+
{ label: __14("Top left", "elementor"), value: "top left" },
|
|
1650
|
+
{ label: __14("Top right", "elementor"), value: "top right" },
|
|
1651
|
+
{ label: __14("Bottom center", "elementor"), value: "bottom center" },
|
|
1652
|
+
{ label: __14("Bottom left", "elementor"), value: "bottom left" },
|
|
1653
|
+
{ label: __14("Bottom right", "elementor"), value: "bottom right" },
|
|
1648
1654
|
{ label: __14("Custom", "elementor"), value: "custom" }
|
|
1649
1655
|
];
|
|
1650
1656
|
var BackgroundImageOverlayPosition = () => {
|
|
1651
1657
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
1652
|
-
const stringPropContext = useBoundProp(
|
|
1658
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil7);
|
|
1653
1659
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
1654
1660
|
const handlePositionChange = (event) => {
|
|
1655
1661
|
const value = event.target.value || null;
|
|
@@ -1659,7 +1665,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
1659
1665
|
stringPropContext.setValue(value);
|
|
1660
1666
|
}
|
|
1661
1667
|
};
|
|
1662
|
-
return /* @__PURE__ */ React31.createElement(Grid9, { container: true, spacing: 2 }, /* @__PURE__ */ React31.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(Grid9, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel, null, __14("Position", "elementor"))), /* @__PURE__ */ React31.createElement(Grid9, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React31.createElement(
|
|
1668
|
+
return /* @__PURE__ */ React31.createElement(Grid9, { container: true, spacing: 2 }, /* @__PURE__ */ React31.createElement(Grid9, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(Grid9, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(Grid9, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel, null, __14("Position", "elementor"))), /* @__PURE__ */ React31.createElement(Grid9, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React31.createElement(
|
|
1663
1669
|
Select2,
|
|
1664
1670
|
{
|
|
1665
1671
|
size: "tiny",
|
|
@@ -1708,7 +1714,7 @@ var BackgroundImageOverlayRepeat = () => {
|
|
|
1708
1714
|
|
|
1709
1715
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
1710
1716
|
import * as React33 from "react";
|
|
1711
|
-
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as
|
|
1717
|
+
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil8 } from "@elementor/editor-props";
|
|
1712
1718
|
import {
|
|
1713
1719
|
ArrowBarBothIcon,
|
|
1714
1720
|
ArrowsMaximizeIcon,
|
|
@@ -1747,7 +1753,7 @@ var sizeControlOptions = [
|
|
|
1747
1753
|
];
|
|
1748
1754
|
var BackgroundImageOverlaySize = () => {
|
|
1749
1755
|
const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
|
|
1750
|
-
const stringPropContext = useBoundProp(
|
|
1756
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil8);
|
|
1751
1757
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
1752
1758
|
const handleSizeChange = (size) => {
|
|
1753
1759
|
if (size === "custom") {
|
|
@@ -1767,8 +1773,54 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1767
1773
|
)))), isCustom ? /* @__PURE__ */ React33.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React33.createElement(Grid11, { item: true, xs: 12 }, /* @__PURE__ */ React33.createElement(Grid11, { container: true, spacing: 2 }, /* @__PURE__ */ React33.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React33.createElement(SizeControl, { startIcon: /* @__PURE__ */ React33.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React33.createElement(Grid11, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React33.createElement(SizeControl, { startIcon: /* @__PURE__ */ React33.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" }) })))))) : null);
|
|
1768
1774
|
};
|
|
1769
1775
|
|
|
1776
|
+
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
1777
|
+
import { useRef as useRef3 } from "react";
|
|
1778
|
+
import {
|
|
1779
|
+
backgroundColorOverlayPropTypeUtil,
|
|
1780
|
+
backgroundImageOverlayPropTypeUtil
|
|
1781
|
+
} from "@elementor/editor-props";
|
|
1782
|
+
import { useTabs } from "@elementor/ui";
|
|
1783
|
+
var useBackgroundTabsHistory = ({
|
|
1784
|
+
color: initialBackgroundColorOverlay2,
|
|
1785
|
+
image: initialBackgroundImageOverlay
|
|
1786
|
+
}) => {
|
|
1787
|
+
const { value: imageValue, setValue: setImageValue } = useBoundProp(backgroundImageOverlayPropTypeUtil);
|
|
1788
|
+
const { value: colorValue, setValue: setColorValue } = useBoundProp(backgroundColorOverlayPropTypeUtil);
|
|
1789
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(colorValue ? "color" : "image");
|
|
1790
|
+
const valuesHistory = useRef3({
|
|
1791
|
+
image: initialBackgroundImageOverlay,
|
|
1792
|
+
color: initialBackgroundColorOverlay2
|
|
1793
|
+
});
|
|
1794
|
+
const saveToHistory = (key, value) => {
|
|
1795
|
+
if (value) {
|
|
1796
|
+
valuesHistory.current[key] = value;
|
|
1797
|
+
}
|
|
1798
|
+
};
|
|
1799
|
+
const onTabChange = (e, tabName) => {
|
|
1800
|
+
switch (tabName) {
|
|
1801
|
+
case "image":
|
|
1802
|
+
setImageValue(valuesHistory.current.image);
|
|
1803
|
+
saveToHistory("color", colorValue);
|
|
1804
|
+
break;
|
|
1805
|
+
case "color":
|
|
1806
|
+
setColorValue(valuesHistory.current.color);
|
|
1807
|
+
saveToHistory("image", imageValue);
|
|
1808
|
+
}
|
|
1809
|
+
return getTabsProps().onChange(e, tabName);
|
|
1810
|
+
};
|
|
1811
|
+
return {
|
|
1812
|
+
getTabProps,
|
|
1813
|
+
getTabPanelProps,
|
|
1814
|
+
getTabsProps: () => ({ ...getTabsProps(), onChange: onTabChange })
|
|
1815
|
+
};
|
|
1816
|
+
};
|
|
1817
|
+
|
|
1770
1818
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1771
|
-
var
|
|
1819
|
+
var initialBackgroundColorOverlay = {
|
|
1820
|
+
$$type: "background-color-overlay",
|
|
1821
|
+
value: "#00000033"
|
|
1822
|
+
};
|
|
1823
|
+
var getInitialBackgroundOverlay = () => ({
|
|
1772
1824
|
$$type: "background-image-overlay",
|
|
1773
1825
|
value: {
|
|
1774
1826
|
image: {
|
|
@@ -1779,7 +1831,7 @@ var initialBackgroundOverlay = (backgroundPlaceholderImage) => ({
|
|
|
1779
1831
|
value: {
|
|
1780
1832
|
url: {
|
|
1781
1833
|
$$type: "url",
|
|
1782
|
-
value:
|
|
1834
|
+
value: env.background_placeholder_image
|
|
1783
1835
|
},
|
|
1784
1836
|
id: null
|
|
1785
1837
|
}
|
|
@@ -1810,18 +1862,20 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
1810
1862
|
Icon: ItemIcon2,
|
|
1811
1863
|
Label: ItemLabel2,
|
|
1812
1864
|
Content: ItemContent2,
|
|
1813
|
-
initialValues:
|
|
1865
|
+
initialValues: getInitialBackgroundOverlay()
|
|
1814
1866
|
}
|
|
1815
1867
|
}
|
|
1816
1868
|
));
|
|
1817
1869
|
});
|
|
1818
|
-
var ItemContent2 = ({ bind
|
|
1819
|
-
return /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React34.createElement(Content2,
|
|
1870
|
+
var ItemContent2 = ({ bind }) => {
|
|
1871
|
+
return /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React34.createElement(Content2, null));
|
|
1820
1872
|
};
|
|
1821
|
-
var Content2 = (
|
|
1822
|
-
const
|
|
1823
|
-
|
|
1824
|
-
|
|
1873
|
+
var Content2 = () => {
|
|
1874
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
1875
|
+
image: getInitialBackgroundOverlay().value,
|
|
1876
|
+
color: initialBackgroundColorOverlay.value
|
|
1877
|
+
});
|
|
1878
|
+
return /* @__PURE__ */ React34.createElement(Box4, { sx: { width: "100%" } }, /* @__PURE__ */ React34.createElement(Box4, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React34.createElement(Tabs, { ...getTabsProps(), "aria-label": __17("Background Overlay", "elementor") }, /* @__PURE__ */ React34.createElement(Tab, { label: __17("Image", "elementor"), ...getTabProps("image") }), /* @__PURE__ */ React34.createElement(Tab, { label: __17("Color", "elementor"), ...getTabProps("color") }))), /* @__PURE__ */ React34.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React34.createElement(Stack12, { gap: 1.5 }, /* @__PURE__ */ React34.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React34.createElement(TabPanel, { ...getTabPanelProps("color"), sx: { p: 1.5 } }, /* @__PURE__ */ React34.createElement(Grid12, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React34.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(ColorControl, { propTypeUtil: backgroundColorOverlayPropTypeUtil2 })))));
|
|
1825
1879
|
};
|
|
1826
1880
|
var ItemIcon2 = ({ value }) => {
|
|
1827
1881
|
switch (value.$$type) {
|
|
@@ -1858,7 +1912,7 @@ var ItemLabelImage = ({ value }) => {
|
|
|
1858
1912
|
return /* @__PURE__ */ React34.createElement("span", null, imageTitle);
|
|
1859
1913
|
};
|
|
1860
1914
|
var ImageOverlayContent = () => {
|
|
1861
|
-
const propContext = useBoundProp(
|
|
1915
|
+
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil2);
|
|
1862
1916
|
return /* @__PURE__ */ React34.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React34.createElement(Grid12, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React34.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(
|
|
1863
1917
|
ImageControl,
|
|
1864
1918
|
{
|
|
@@ -1867,15 +1921,6 @@ var ImageOverlayContent = () => {
|
|
|
1867
1921
|
}
|
|
1868
1922
|
)))), /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React34.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React34.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React34.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React34.createElement(BackgroundImageOverlayAttachment, null)));
|
|
1869
1923
|
};
|
|
1870
|
-
var deriveOverlayType = (type) => {
|
|
1871
|
-
if (type === "background-color-overlay") {
|
|
1872
|
-
return "color";
|
|
1873
|
-
}
|
|
1874
|
-
if (type === "background-image-overlay") {
|
|
1875
|
-
return "image";
|
|
1876
|
-
}
|
|
1877
|
-
throw new Error(`Invalid overlay type: ${type}`);
|
|
1878
|
-
};
|
|
1879
1924
|
var useImage = (image) => {
|
|
1880
1925
|
let imageTitle, imageUrl = null;
|
|
1881
1926
|
const imageSrc = image?.value.image.value?.src.value;
|
|
@@ -1897,7 +1942,6 @@ var BackgroundControl = createControl(() => {
|
|
|
1897
1942
|
return /* @__PURE__ */ React35.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React35.createElement(Stack13, { gap: 1.5 }, /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React35.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React35.createElement(Grid13, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, __18("Color", "elementor"))), /* @__PURE__ */ React35.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ColorControl, null))))));
|
|
1898
1943
|
});
|
|
1899
1944
|
export {
|
|
1900
|
-
AutocompleteControl,
|
|
1901
1945
|
BackgroundControl,
|
|
1902
1946
|
BoxShadowRepeaterControl,
|
|
1903
1947
|
ColorControl,
|