@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.js
CHANGED
|
@@ -30,7 +30,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
-
AutocompleteControl: () => AutocompleteControl,
|
|
34
33
|
BackgroundControl: () => BackgroundControl,
|
|
35
34
|
BoxShadowRepeaterControl: () => BoxShadowRepeaterControl,
|
|
36
35
|
ColorControl: () => ColorControl,
|
|
@@ -62,10 +61,11 @@ __export(index_exports, {
|
|
|
62
61
|
});
|
|
63
62
|
module.exports = __toCommonJS(index_exports);
|
|
64
63
|
|
|
65
|
-
// src/controls/
|
|
66
|
-
var
|
|
67
|
-
var
|
|
68
|
-
var
|
|
64
|
+
// src/controls/image-control.tsx
|
|
65
|
+
var React10 = __toESM(require("react"));
|
|
66
|
+
var import_editor_props3 = require("@elementor/editor-props");
|
|
67
|
+
var import_ui6 = require("@elementor/ui");
|
|
68
|
+
var import_i18n2 = require("@wordpress/i18n");
|
|
69
69
|
|
|
70
70
|
// src/bound-prop-context/prop-context.tsx
|
|
71
71
|
var React = __toESM(require("react"));
|
|
@@ -216,12 +216,19 @@ var resolveUnionPropType = (propType, key) => {
|
|
|
216
216
|
return resolvedPropType;
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
-
// src/
|
|
220
|
-
var
|
|
219
|
+
// src/components/control-label.tsx
|
|
220
|
+
var React3 = __toESM(require("react"));
|
|
221
221
|
var import_ui = require("@elementor/ui");
|
|
222
|
+
var ControlLabel = ({ children }) => {
|
|
223
|
+
return /* @__PURE__ */ React3.createElement(import_ui.Typography, { component: "label", variant: "caption", color: "text.secondary" }, children);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
// src/create-control.tsx
|
|
227
|
+
var React5 = __toESM(require("react"));
|
|
228
|
+
var import_ui2 = require("@elementor/ui");
|
|
222
229
|
|
|
223
230
|
// src/create-control-replacement.tsx
|
|
224
|
-
var
|
|
231
|
+
var React4 = __toESM(require("react"));
|
|
225
232
|
var import_react3 = require("react");
|
|
226
233
|
var ControlReplacementContext = (0, import_react3.createContext)(void 0);
|
|
227
234
|
var ControlReplacementProvider = ({
|
|
@@ -229,7 +236,7 @@ var ControlReplacementProvider = ({
|
|
|
229
236
|
condition,
|
|
230
237
|
children
|
|
231
238
|
}) => {
|
|
232
|
-
return /* @__PURE__ */
|
|
239
|
+
return /* @__PURE__ */ React4.createElement(ControlReplacementContext.Provider, { value: { component, condition } }, children);
|
|
233
240
|
};
|
|
234
241
|
var useControlReplacement = () => {
|
|
235
242
|
const { value } = useBoundProp();
|
|
@@ -258,156 +265,29 @@ function createControl(Component, { supportsReplacements = true } = {}) {
|
|
|
258
265
|
return (props) => {
|
|
259
266
|
const ControlReplacement = useControlReplacement();
|
|
260
267
|
if (ControlReplacement && supportsReplacements) {
|
|
261
|
-
return /* @__PURE__ */
|
|
268
|
+
return /* @__PURE__ */ React5.createElement(import_ui2.ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(ControlReplacement, { ...props }));
|
|
262
269
|
}
|
|
263
|
-
return /* @__PURE__ */
|
|
270
|
+
return /* @__PURE__ */ React5.createElement(import_ui2.ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(Component, { ...props }));
|
|
264
271
|
};
|
|
265
272
|
}
|
|
266
273
|
|
|
267
|
-
// src/controls/autocomplete-control.tsx
|
|
268
|
-
var AutocompleteControl = createControl(
|
|
269
|
-
(props) => {
|
|
270
|
-
const {
|
|
271
|
-
options,
|
|
272
|
-
optionRestrictedPropTypeUtil,
|
|
273
|
-
onOptionChangeCallback,
|
|
274
|
-
onTextChangeCallback,
|
|
275
|
-
allowCustomValues = false,
|
|
276
|
-
placeholder = "",
|
|
277
|
-
minInputLength = 2,
|
|
278
|
-
customValue
|
|
279
|
-
} = props;
|
|
280
|
-
const { value: selectableValue, setValue: setSelectableValue } = useBoundProp(optionRestrictedPropTypeUtil);
|
|
281
|
-
const value = selectableValue || customValue || "";
|
|
282
|
-
const optionKeys = _factoryFilter(selectableValue || customValue || null, options, minInputLength).map(
|
|
283
|
-
({ id }) => id
|
|
284
|
-
);
|
|
285
|
-
const allowClear = !!value;
|
|
286
|
-
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
287
|
-
const isOptionEqualToValue = () => {
|
|
288
|
-
return muiWarningPreventer ? void 0 : () => true;
|
|
289
|
-
};
|
|
290
|
-
const hasSelectedValue = !!findMatchingOption(options, selectableValue?.toString());
|
|
291
|
-
const onOptionChange = (newValue) => {
|
|
292
|
-
setSelectableValue(newValue);
|
|
293
|
-
onOptionChangeCallback?.(newValue);
|
|
294
|
-
};
|
|
295
|
-
const onTextChange = (newValue) => {
|
|
296
|
-
onTextChangeCallback?.(newValue);
|
|
297
|
-
};
|
|
298
|
-
return /* @__PURE__ */ React5.createElement(
|
|
299
|
-
import_ui2.Autocomplete,
|
|
300
|
-
{
|
|
301
|
-
forcePopupIcon: false,
|
|
302
|
-
disableClearable: true,
|
|
303
|
-
freeSolo: allowCustomValues,
|
|
304
|
-
value: value?.toString() || "",
|
|
305
|
-
size: "tiny",
|
|
306
|
-
onChange: (_, newValue) => onOptionChange(Number(newValue)),
|
|
307
|
-
readOnly: hasSelectedValue,
|
|
308
|
-
options: optionKeys,
|
|
309
|
-
getOptionKey: (optionId) => findMatchingOption(options, optionId)?.id || optionId,
|
|
310
|
-
getOptionLabel: (optionId) => findMatchingOption(options, optionId)?.label || optionId.toString(),
|
|
311
|
-
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
312
|
-
isOptionEqualToValue: isOptionEqualToValue(),
|
|
313
|
-
filterOptions: () => optionKeys,
|
|
314
|
-
renderOption: (optionProps, optionId) => /* @__PURE__ */ React5.createElement(import_ui2.Box, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
315
|
-
renderInput: (params) => /* @__PURE__ */ React5.createElement(
|
|
316
|
-
TextInput,
|
|
317
|
-
{
|
|
318
|
-
params,
|
|
319
|
-
handleChange: onTextChange,
|
|
320
|
-
allowClear,
|
|
321
|
-
placeholder,
|
|
322
|
-
hasSelectedValue
|
|
323
|
-
}
|
|
324
|
-
)
|
|
325
|
-
}
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
);
|
|
329
|
-
var TextInput = ({
|
|
330
|
-
params,
|
|
331
|
-
allowClear,
|
|
332
|
-
placeholder,
|
|
333
|
-
handleChange,
|
|
334
|
-
hasSelectedValue
|
|
335
|
-
}) => {
|
|
336
|
-
const onChange = (event) => {
|
|
337
|
-
handleChange(event.target.value);
|
|
338
|
-
};
|
|
339
|
-
return /* @__PURE__ */ React5.createElement(
|
|
340
|
-
import_ui2.TextField,
|
|
341
|
-
{
|
|
342
|
-
...params,
|
|
343
|
-
placeholder,
|
|
344
|
-
onChange,
|
|
345
|
-
sx: {
|
|
346
|
-
"& .MuiInputBase-input": {
|
|
347
|
-
cursor: hasSelectedValue ? "default" : void 0
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
InputProps: {
|
|
351
|
-
...params.InputProps,
|
|
352
|
-
endAdornment: /* @__PURE__ */ React5.createElement(ClearButton, { params, allowClear, handleChange })
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
);
|
|
356
|
-
};
|
|
357
|
-
var ClearButton = ({
|
|
358
|
-
allowClear,
|
|
359
|
-
handleChange,
|
|
360
|
-
params
|
|
361
|
-
}) => /* @__PURE__ */ React5.createElement(import_ui2.InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React5.createElement(import_ui2.IconButton, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React5.createElement(import_icons.XIcon, { fontSize: params.size })));
|
|
362
|
-
function findMatchingOption(options, optionId = null) {
|
|
363
|
-
return options.find(({ id }) => optionId?.toString() === id.toString());
|
|
364
|
-
}
|
|
365
|
-
function isCategorizedOptionPool(options) {
|
|
366
|
-
return options.every((option) => "groupLabel" in option);
|
|
367
|
-
}
|
|
368
|
-
function _factoryFilter(newValue, options, minInputLength) {
|
|
369
|
-
if (null === newValue) {
|
|
370
|
-
return options;
|
|
371
|
-
}
|
|
372
|
-
const formattedValue = String(newValue || "")?.toLowerCase();
|
|
373
|
-
if (formattedValue.length < minInputLength) {
|
|
374
|
-
return new Array(0);
|
|
375
|
-
}
|
|
376
|
-
return options.filter(
|
|
377
|
-
(option) => String(option.id).toLowerCase().includes(formattedValue) || option.label.toLowerCase().includes(formattedValue)
|
|
378
|
-
);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
// src/controls/image-control.tsx
|
|
382
|
-
var React11 = __toESM(require("react"));
|
|
383
|
-
var import_editor_props3 = require("@elementor/editor-props");
|
|
384
|
-
var import_ui7 = require("@elementor/ui");
|
|
385
|
-
var import_i18n2 = require("@wordpress/i18n");
|
|
386
|
-
|
|
387
|
-
// src/components/control-label.tsx
|
|
388
|
-
var React6 = __toESM(require("react"));
|
|
389
|
-
var import_ui3 = require("@elementor/ui");
|
|
390
|
-
var ControlLabel = ({ children }) => {
|
|
391
|
-
return /* @__PURE__ */ React6.createElement(import_ui3.Typography, { component: "label", variant: "caption", color: "text.secondary" }, children);
|
|
392
|
-
};
|
|
393
|
-
|
|
394
274
|
// src/controls/image-media-control.tsx
|
|
395
|
-
var
|
|
275
|
+
var React8 = __toESM(require("react"));
|
|
396
276
|
var import_editor_props = require("@elementor/editor-props");
|
|
397
|
-
var
|
|
398
|
-
var
|
|
277
|
+
var import_icons = require("@elementor/icons");
|
|
278
|
+
var import_ui4 = require("@elementor/ui");
|
|
399
279
|
var import_wp_media = require("@elementor/wp-media");
|
|
400
280
|
var import_i18n = require("@wordpress/i18n");
|
|
401
281
|
|
|
402
282
|
// src/control-actions/control-actions.tsx
|
|
403
|
-
var
|
|
404
|
-
var
|
|
283
|
+
var React7 = __toESM(require("react"));
|
|
284
|
+
var import_ui3 = require("@elementor/ui");
|
|
405
285
|
|
|
406
286
|
// src/control-actions/control-actions-context.tsx
|
|
407
|
-
var
|
|
287
|
+
var React6 = __toESM(require("react"));
|
|
408
288
|
var import_react4 = require("react");
|
|
409
289
|
var Context = (0, import_react4.createContext)(null);
|
|
410
|
-
var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */
|
|
290
|
+
var ControlActionsProvider = ({ children, items }) => /* @__PURE__ */ React6.createElement(Context.Provider, { value: { items } }, children);
|
|
411
291
|
var useControlActions = () => {
|
|
412
292
|
const context = (0, import_react4.useContext)(Context);
|
|
413
293
|
if (!context) {
|
|
@@ -417,7 +297,7 @@ var useControlActions = () => {
|
|
|
417
297
|
};
|
|
418
298
|
|
|
419
299
|
// src/control-actions/control-actions.tsx
|
|
420
|
-
var FloatingBarContainer = (0,
|
|
300
|
+
var FloatingBarContainer = (0, import_ui3.styled)("span")`
|
|
421
301
|
display: contents;
|
|
422
302
|
|
|
423
303
|
.MuiFloatingActionBar-popper:has( .MuiFloatingActionBar-actions:empty ) {
|
|
@@ -429,8 +309,8 @@ function ControlActions({ children }) {
|
|
|
429
309
|
if (items.length === 0) {
|
|
430
310
|
return children;
|
|
431
311
|
}
|
|
432
|
-
const menuItems = items.map(({ MenuItem: MenuItem5, id }) => /* @__PURE__ */
|
|
433
|
-
return /* @__PURE__ */
|
|
312
|
+
const menuItems = items.map(({ MenuItem: MenuItem5, id }) => /* @__PURE__ */ React7.createElement(MenuItem5, { key: id }));
|
|
313
|
+
return /* @__PURE__ */ React7.createElement(FloatingBarContainer, null, /* @__PURE__ */ React7.createElement(import_ui3.UnstableFloatingActionBar, { actions: menuItems }, children));
|
|
434
314
|
}
|
|
435
315
|
|
|
436
316
|
// src/controls/image-media-control.tsx
|
|
@@ -454,32 +334,32 @@ var ImageMediaControl = createControl((props) => {
|
|
|
454
334
|
});
|
|
455
335
|
}
|
|
456
336
|
});
|
|
457
|
-
return /* @__PURE__ */
|
|
458
|
-
|
|
337
|
+
return /* @__PURE__ */ React8.createElement(ControlActions, null, /* @__PURE__ */ React8.createElement(import_ui4.Card, { variant: "outlined" }, /* @__PURE__ */ React8.createElement(import_ui4.CardMedia, { image: src, sx: { height: 150 } }, isFetching ? /* @__PURE__ */ React8.createElement(import_ui4.Stack, { justifyContent: "center", alignItems: "center", width: "100%", height: "100%" }, /* @__PURE__ */ React8.createElement(import_ui4.CircularProgress, null)) : /* @__PURE__ */ React8.createElement(React8.Fragment, null)), /* @__PURE__ */ React8.createElement(import_ui4.CardOverlay, null, /* @__PURE__ */ React8.createElement(import_ui4.Stack, { gap: 1 }, /* @__PURE__ */ React8.createElement(
|
|
338
|
+
import_ui4.Button,
|
|
459
339
|
{
|
|
460
340
|
size: "tiny",
|
|
461
341
|
color: "inherit",
|
|
462
342
|
variant: "outlined",
|
|
463
343
|
onClick: () => open({ mode: "browse" })
|
|
464
344
|
},
|
|
465
|
-
(0, import_i18n.__)("Select
|
|
466
|
-
), /* @__PURE__ */
|
|
467
|
-
|
|
345
|
+
(0, import_i18n.__)("Select image", "elementor")
|
|
346
|
+
), /* @__PURE__ */ React8.createElement(
|
|
347
|
+
import_ui4.Button,
|
|
468
348
|
{
|
|
469
349
|
size: "tiny",
|
|
470
350
|
variant: "text",
|
|
471
351
|
color: "inherit",
|
|
472
|
-
startIcon: /* @__PURE__ */
|
|
352
|
+
startIcon: /* @__PURE__ */ React8.createElement(import_icons.UploadIcon, null),
|
|
473
353
|
onClick: () => open({ mode: "upload" })
|
|
474
354
|
},
|
|
475
|
-
(0, import_i18n.__)("Upload
|
|
355
|
+
(0, import_i18n.__)("Upload image", "elementor")
|
|
476
356
|
)))));
|
|
477
357
|
});
|
|
478
358
|
|
|
479
359
|
// src/controls/select-control.tsx
|
|
480
|
-
var
|
|
360
|
+
var React9 = __toESM(require("react"));
|
|
481
361
|
var import_editor_props2 = require("@elementor/editor-props");
|
|
482
|
-
var
|
|
362
|
+
var import_ui5 = require("@elementor/ui");
|
|
483
363
|
var SelectControl = createControl(({ options, onChange }) => {
|
|
484
364
|
const { value, setValue } = useBoundProp(import_editor_props2.stringPropTypeUtil);
|
|
485
365
|
const handleChange = (event) => {
|
|
@@ -487,26 +367,37 @@ var SelectControl = createControl(({ options, onChange }) => {
|
|
|
487
367
|
onChange?.(newValue, value);
|
|
488
368
|
setValue(newValue);
|
|
489
369
|
};
|
|
490
|
-
return /* @__PURE__ */
|
|
370
|
+
return /* @__PURE__ */ React9.createElement(ControlActions, null, /* @__PURE__ */ React9.createElement(
|
|
371
|
+
import_ui5.Select,
|
|
372
|
+
{
|
|
373
|
+
sx: { overflow: "hidden" },
|
|
374
|
+
displayEmpty: true,
|
|
375
|
+
size: "tiny",
|
|
376
|
+
value: value ?? "",
|
|
377
|
+
onChange: handleChange,
|
|
378
|
+
fullWidth: true
|
|
379
|
+
},
|
|
380
|
+
options.map(({ label, ...props }) => /* @__PURE__ */ React9.createElement(import_ui5.MenuItem, { key: props.value, ...props, value: props.value ?? "" }, label))
|
|
381
|
+
));
|
|
491
382
|
});
|
|
492
383
|
|
|
493
384
|
// src/controls/image-control.tsx
|
|
494
385
|
var ImageControl = createControl(
|
|
495
386
|
({ sizes, resolutionLabel = (0, import_i18n2.__)("Image resolution", "elementor") }) => {
|
|
496
387
|
const propContext = useBoundProp(import_editor_props3.imagePropTypeUtil);
|
|
497
|
-
return /* @__PURE__ */
|
|
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.__)("Choose image", "elementor"), " "), /* @__PURE__ */ React10.createElement(ImageMediaControl, null)), /* @__PURE__ */ React10.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React10.createElement(import_ui6.Grid, { container: true, gap: 2, 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 }))))));
|
|
498
389
|
}
|
|
499
390
|
);
|
|
500
391
|
|
|
501
392
|
// src/controls/text-control.tsx
|
|
502
|
-
var
|
|
393
|
+
var React11 = __toESM(require("react"));
|
|
503
394
|
var import_editor_props4 = require("@elementor/editor-props");
|
|
504
|
-
var
|
|
395
|
+
var import_ui7 = require("@elementor/ui");
|
|
505
396
|
var TextControl = createControl(({ placeholder }) => {
|
|
506
397
|
const { value, setValue } = useBoundProp(import_editor_props4.stringPropTypeUtil);
|
|
507
398
|
const handleChange = (event) => setValue(event.target.value);
|
|
508
|
-
return /* @__PURE__ */
|
|
509
|
-
|
|
399
|
+
return /* @__PURE__ */ React11.createElement(ControlActions, null, /* @__PURE__ */ React11.createElement(
|
|
400
|
+
import_ui7.TextField,
|
|
510
401
|
{
|
|
511
402
|
size: "tiny",
|
|
512
403
|
fullWidth: true,
|
|
@@ -518,16 +409,16 @@ var TextControl = createControl(({ placeholder }) => {
|
|
|
518
409
|
});
|
|
519
410
|
|
|
520
411
|
// src/controls/text-area-control.tsx
|
|
521
|
-
var
|
|
412
|
+
var React12 = __toESM(require("react"));
|
|
522
413
|
var import_editor_props5 = require("@elementor/editor-props");
|
|
523
|
-
var
|
|
414
|
+
var import_ui8 = require("@elementor/ui");
|
|
524
415
|
var TextAreaControl = createControl(({ placeholder }) => {
|
|
525
416
|
const { value, setValue } = useBoundProp(import_editor_props5.stringPropTypeUtil);
|
|
526
417
|
const handleChange = (event) => {
|
|
527
418
|
setValue(event.target.value);
|
|
528
419
|
};
|
|
529
|
-
return /* @__PURE__ */
|
|
530
|
-
|
|
420
|
+
return /* @__PURE__ */ React12.createElement(ControlActions, null, /* @__PURE__ */ React12.createElement(
|
|
421
|
+
import_ui8.TextField,
|
|
531
422
|
{
|
|
532
423
|
size: "tiny",
|
|
533
424
|
multiline: true,
|
|
@@ -541,18 +432,18 @@ var TextAreaControl = createControl(({ placeholder }) => {
|
|
|
541
432
|
});
|
|
542
433
|
|
|
543
434
|
// src/controls/size-control.tsx
|
|
544
|
-
var
|
|
435
|
+
var React14 = __toESM(require("react"));
|
|
545
436
|
var import_editor_props6 = require("@elementor/editor-props");
|
|
546
|
-
var
|
|
437
|
+
var import_ui10 = require("@elementor/ui");
|
|
547
438
|
|
|
548
439
|
// src/components/text-field-inner-selection.tsx
|
|
549
|
-
var
|
|
440
|
+
var React13 = __toESM(require("react"));
|
|
550
441
|
var import_react5 = require("react");
|
|
551
|
-
var
|
|
442
|
+
var import_ui9 = require("@elementor/ui");
|
|
552
443
|
var TextFieldInnerSelection = (0, import_react5.forwardRef)(
|
|
553
444
|
({ placeholder, type, value, onChange, endAdornment, startAdornment }, ref) => {
|
|
554
|
-
return /* @__PURE__ */
|
|
555
|
-
|
|
445
|
+
return /* @__PURE__ */ React13.createElement(
|
|
446
|
+
import_ui9.TextField,
|
|
556
447
|
{
|
|
557
448
|
size: "tiny",
|
|
558
449
|
fullWidth: true,
|
|
@@ -574,7 +465,7 @@ var SelectionEndAdornment = ({
|
|
|
574
465
|
onClick,
|
|
575
466
|
value
|
|
576
467
|
}) => {
|
|
577
|
-
const popupState = (0,
|
|
468
|
+
const popupState = (0, import_ui9.usePopupState)({
|
|
578
469
|
variant: "popover",
|
|
579
470
|
popupId: (0, import_react5.useId)()
|
|
580
471
|
});
|
|
@@ -582,16 +473,16 @@ var SelectionEndAdornment = ({
|
|
|
582
473
|
onClick(options[index]);
|
|
583
474
|
popupState.close();
|
|
584
475
|
};
|
|
585
|
-
return /* @__PURE__ */
|
|
586
|
-
|
|
476
|
+
return /* @__PURE__ */ React13.createElement(import_ui9.InputAdornment, { position: "end" }, /* @__PURE__ */ React13.createElement(
|
|
477
|
+
import_ui9.Button,
|
|
587
478
|
{
|
|
588
479
|
size: "small",
|
|
589
480
|
color: "inherit",
|
|
590
481
|
sx: { font: "inherit", minWidth: "initial" },
|
|
591
|
-
...(0,
|
|
482
|
+
...(0, import_ui9.bindTrigger)(popupState)
|
|
592
483
|
},
|
|
593
484
|
value.toUpperCase()
|
|
594
|
-
), /* @__PURE__ */
|
|
485
|
+
), /* @__PURE__ */ React13.createElement(import_ui9.Menu, { MenuListProps: { dense: true }, ...(0, import_ui9.bindMenu)(popupState) }, options.map((option, index) => /* @__PURE__ */ React13.createElement(import_ui9.MenuItem, { key: option, onClick: () => handleMenuItemClick(index) }, option.toUpperCase()))));
|
|
595
486
|
};
|
|
596
487
|
|
|
597
488
|
// src/hooks/use-sync-external-state.tsx
|
|
@@ -652,10 +543,10 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
652
543
|
size: size || size === "0" ? parseFloat(size) : defaultSize
|
|
653
544
|
}));
|
|
654
545
|
};
|
|
655
|
-
return /* @__PURE__ */
|
|
546
|
+
return /* @__PURE__ */ React14.createElement(ControlActions, null, /* @__PURE__ */ React14.createElement(
|
|
656
547
|
TextFieldInnerSelection,
|
|
657
548
|
{
|
|
658
|
-
endAdornment: /* @__PURE__ */
|
|
549
|
+
endAdornment: /* @__PURE__ */ React14.createElement(
|
|
659
550
|
SelectionEndAdornment,
|
|
660
551
|
{
|
|
661
552
|
options: units2,
|
|
@@ -664,7 +555,7 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
664
555
|
}
|
|
665
556
|
),
|
|
666
557
|
placeholder,
|
|
667
|
-
startAdornment: startIcon ?? /* @__PURE__ */
|
|
558
|
+
startAdornment: startIcon ?? /* @__PURE__ */ React14.createElement(import_ui10.InputAdornment, { position: "start" }, startIcon),
|
|
668
559
|
type: "number",
|
|
669
560
|
value: Number.isNaN(state?.size) ? "" : state?.size,
|
|
670
561
|
onChange: handleSizeChange
|
|
@@ -673,42 +564,42 @@ var SizeControl = createControl(({ units: units2 = defaultUnits, placeholder, st
|
|
|
673
564
|
});
|
|
674
565
|
|
|
675
566
|
// src/controls/stroke-control.tsx
|
|
676
|
-
var
|
|
567
|
+
var React16 = __toESM(require("react"));
|
|
677
568
|
var import_editor_props8 = require("@elementor/editor-props");
|
|
678
|
-
var
|
|
569
|
+
var import_ui12 = require("@elementor/ui");
|
|
679
570
|
var import_i18n3 = require("@wordpress/i18n");
|
|
680
571
|
|
|
681
572
|
// src/controls/color-control.tsx
|
|
682
|
-
var
|
|
573
|
+
var React15 = __toESM(require("react"));
|
|
683
574
|
var import_editor_props7 = require("@elementor/editor-props");
|
|
684
|
-
var
|
|
575
|
+
var import_ui11 = require("@elementor/ui");
|
|
685
576
|
var ColorControl = createControl(({ propTypeUtil = import_editor_props7.colorPropTypeUtil, ...props }) => {
|
|
686
577
|
const { value, setValue } = useBoundProp(propTypeUtil);
|
|
687
578
|
const handleChange = (selectedColor) => {
|
|
688
579
|
setValue(selectedColor);
|
|
689
580
|
};
|
|
690
|
-
return /* @__PURE__ */
|
|
581
|
+
return /* @__PURE__ */ React15.createElement(ControlActions, null, /* @__PURE__ */ React15.createElement(import_ui11.UnstableColorField, { size: "tiny", ...props, value: value ?? "", onChange: handleChange, fullWidth: true }));
|
|
691
582
|
});
|
|
692
583
|
|
|
693
584
|
// src/controls/stroke-control.tsx
|
|
694
585
|
var units = ["px", "em", "rem"];
|
|
695
586
|
var StrokeControl = createControl(() => {
|
|
696
587
|
const propContext = useBoundProp(import_editor_props8.strokePropTypeUtil);
|
|
697
|
-
return /* @__PURE__ */
|
|
588
|
+
return /* @__PURE__ */ React16.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React16.createElement(import_ui12.Stack, { gap: 1.5 }, /* @__PURE__ */ React16.createElement(Control, { bind: "width", label: (0, import_i18n3.__)("Stroke width", "elementor") }, /* @__PURE__ */ React16.createElement(SizeControl, { units })), /* @__PURE__ */ React16.createElement(Control, { bind: "color", label: (0, import_i18n3.__)("Stroke color", "elementor") }, /* @__PURE__ */ React16.createElement(ColorControl, null))));
|
|
698
589
|
});
|
|
699
|
-
var Control = ({ bind, label, children }) => /* @__PURE__ */
|
|
590
|
+
var Control = ({ bind, label, children }) => /* @__PURE__ */ React16.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React16.createElement(import_ui12.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React16.createElement(import_ui12.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React16.createElement(ControlLabel, null, label)), /* @__PURE__ */ React16.createElement(import_ui12.Grid, { item: true, xs: 6 }, children)));
|
|
700
591
|
|
|
701
592
|
// src/controls/box-shadow-repeater-control.tsx
|
|
702
|
-
var
|
|
593
|
+
var React18 = __toESM(require("react"));
|
|
703
594
|
var import_editor_props9 = require("@elementor/editor-props");
|
|
704
|
-
var
|
|
595
|
+
var import_ui14 = require("@elementor/ui");
|
|
705
596
|
var import_i18n5 = require("@wordpress/i18n");
|
|
706
597
|
|
|
707
598
|
// src/components/repeater.tsx
|
|
708
|
-
var
|
|
599
|
+
var React17 = __toESM(require("react"));
|
|
709
600
|
var import_react7 = require("react");
|
|
710
|
-
var
|
|
711
|
-
var
|
|
601
|
+
var import_icons2 = require("@elementor/icons");
|
|
602
|
+
var import_ui13 = require("@elementor/ui");
|
|
712
603
|
var import_i18n4 = require("@wordpress/i18n");
|
|
713
604
|
var SIZE = "tiny";
|
|
714
605
|
var Repeater = ({
|
|
@@ -746,19 +637,19 @@ var Repeater = ({
|
|
|
746
637
|
})
|
|
747
638
|
);
|
|
748
639
|
};
|
|
749
|
-
return /* @__PURE__ */
|
|
640
|
+
return /* @__PURE__ */ React17.createElement(import_ui13.Stack, null, /* @__PURE__ */ React17.createElement(import_ui13.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { pb: 1 } }, /* @__PURE__ */ React17.createElement(import_ui13.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label), /* @__PURE__ */ React17.createElement(import_ui13.IconButton, { size: SIZE, onClick: addRepeaterItem, "aria-label": (0, import_i18n4.__)("Add item", "elementor") }, /* @__PURE__ */ React17.createElement(import_icons2.PlusIcon, { fontSize: SIZE }))), /* @__PURE__ */ React17.createElement(import_ui13.Stack, { gap: 1 }, repeaterValues.map((value, index) => /* @__PURE__ */ React17.createElement(
|
|
750
641
|
RepeaterItem,
|
|
751
642
|
{
|
|
752
643
|
key: index,
|
|
753
644
|
bind: String(index),
|
|
754
645
|
disabled: value.disabled,
|
|
755
|
-
label: /* @__PURE__ */
|
|
756
|
-
startIcon: /* @__PURE__ */
|
|
646
|
+
label: /* @__PURE__ */ React17.createElement(itemSettings.Label, { value }),
|
|
647
|
+
startIcon: /* @__PURE__ */ React17.createElement(itemSettings.Icon, { value }),
|
|
757
648
|
removeItem: () => removeRepeaterItem(index),
|
|
758
649
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
759
650
|
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
760
651
|
},
|
|
761
|
-
(props) => /* @__PURE__ */
|
|
652
|
+
(props) => /* @__PURE__ */ React17.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
762
653
|
))));
|
|
763
654
|
};
|
|
764
655
|
var RepeaterItem = ({
|
|
@@ -774,46 +665,46 @@ var RepeaterItem = ({
|
|
|
774
665
|
const popupId = `repeater-popup-${bind}`;
|
|
775
666
|
const controlRef = (0, import_react7.useRef)(null);
|
|
776
667
|
const [anchorEl, setAnchorEl] = (0, import_react7.useState)(null);
|
|
777
|
-
const popoverState = (0,
|
|
778
|
-
const popoverProps = (0,
|
|
779
|
-
return /* @__PURE__ */
|
|
780
|
-
|
|
668
|
+
const popoverState = (0, import_ui13.usePopupState)({ popupId, variant: "popover" });
|
|
669
|
+
const popoverProps = (0, import_ui13.bindPopover)(popoverState);
|
|
670
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
671
|
+
import_ui13.UnstableTag,
|
|
781
672
|
{
|
|
782
673
|
label,
|
|
783
674
|
showActionsOnHover: true,
|
|
784
675
|
ref: controlRef,
|
|
785
676
|
variant: "outlined",
|
|
786
677
|
"aria-label": (0, import_i18n4.__)("Open item", "elementor"),
|
|
787
|
-
...(0,
|
|
678
|
+
...(0, import_ui13.bindTrigger)(popoverState),
|
|
788
679
|
startIcon,
|
|
789
|
-
actions: /* @__PURE__ */
|
|
790
|
-
|
|
680
|
+
actions: /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
681
|
+
import_ui13.IconButton,
|
|
791
682
|
{
|
|
792
683
|
size: SIZE,
|
|
793
684
|
onClick: duplicateItem,
|
|
794
685
|
"aria-label": (0, import_i18n4.__)("Duplicate item", "elementor")
|
|
795
686
|
},
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
), /* @__PURE__ */
|
|
798
|
-
|
|
687
|
+
/* @__PURE__ */ React17.createElement(import_icons2.CopyIcon, { fontSize: SIZE })
|
|
688
|
+
), /* @__PURE__ */ React17.createElement(
|
|
689
|
+
import_ui13.IconButton,
|
|
799
690
|
{
|
|
800
691
|
size: SIZE,
|
|
801
692
|
onClick: toggleDisableItem,
|
|
802
693
|
"aria-label": disabled ? (0, import_i18n4.__)("Enable item", "elementor") : (0, import_i18n4.__)("Disable item", "elementor")
|
|
803
694
|
},
|
|
804
|
-
disabled ? /* @__PURE__ */
|
|
805
|
-
), /* @__PURE__ */
|
|
806
|
-
|
|
695
|
+
disabled ? /* @__PURE__ */ React17.createElement(import_icons2.EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React17.createElement(import_icons2.EyeIcon, { fontSize: SIZE })
|
|
696
|
+
), /* @__PURE__ */ React17.createElement(
|
|
697
|
+
import_ui13.IconButton,
|
|
807
698
|
{
|
|
808
699
|
size: SIZE,
|
|
809
700
|
onClick: removeItem,
|
|
810
701
|
"aria-label": (0, import_i18n4.__)("Remove item", "elementor")
|
|
811
702
|
},
|
|
812
|
-
/* @__PURE__ */
|
|
703
|
+
/* @__PURE__ */ React17.createElement(import_icons2.XIcon, { fontSize: SIZE })
|
|
813
704
|
))
|
|
814
705
|
}
|
|
815
|
-
), /* @__PURE__ */
|
|
816
|
-
|
|
706
|
+
), /* @__PURE__ */ React17.createElement(
|
|
707
|
+
import_ui13.Popover,
|
|
817
708
|
{
|
|
818
709
|
disablePortal: true,
|
|
819
710
|
slotProps: {
|
|
@@ -825,14 +716,14 @@ var RepeaterItem = ({
|
|
|
825
716
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
826
717
|
...popoverProps
|
|
827
718
|
},
|
|
828
|
-
/* @__PURE__ */
|
|
719
|
+
/* @__PURE__ */ React17.createElement(import_ui13.Box, null, children({ anchorEl }))
|
|
829
720
|
));
|
|
830
721
|
};
|
|
831
722
|
|
|
832
723
|
// src/controls/box-shadow-repeater-control.tsx
|
|
833
724
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
834
725
|
const { propType, value, setValue } = useBoundProp(import_editor_props9.boxShadowPropTypeUtil);
|
|
835
|
-
return /* @__PURE__ */
|
|
726
|
+
return /* @__PURE__ */ React18.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React18.createElement(
|
|
836
727
|
Repeater,
|
|
837
728
|
{
|
|
838
729
|
values: value ?? [],
|
|
@@ -847,13 +738,13 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
847
738
|
}
|
|
848
739
|
));
|
|
849
740
|
});
|
|
850
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */
|
|
741
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React18.createElement(import_ui14.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
|
|
851
742
|
var ItemContent = ({ anchorEl, bind }) => {
|
|
852
|
-
return /* @__PURE__ */
|
|
743
|
+
return /* @__PURE__ */ React18.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React18.createElement(Content, { anchorEl }));
|
|
853
744
|
};
|
|
854
745
|
var Content = ({ anchorEl }) => {
|
|
855
746
|
const { propType, value, setValue } = useBoundProp(import_editor_props9.shadowPropTypeUtil);
|
|
856
|
-
return /* @__PURE__ */
|
|
747
|
+
return /* @__PURE__ */ React18.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React18.createElement(import_ui14.Stack, { gap: 1.5, sx: { p: 1.5 } }, /* @__PURE__ */ React18.createElement(import_ui14.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(Control2, { bind: "color", label: (0, import_i18n5.__)("Color", "elementor") }, /* @__PURE__ */ React18.createElement(
|
|
857
748
|
ColorControl,
|
|
858
749
|
{
|
|
859
750
|
slotProps: {
|
|
@@ -870,7 +761,7 @@ var Content = ({ anchorEl }) => {
|
|
|
870
761
|
}
|
|
871
762
|
}
|
|
872
763
|
}
|
|
873
|
-
)), /* @__PURE__ */
|
|
764
|
+
)), /* @__PURE__ */ React18.createElement(Control2, { bind: "position", label: (0, import_i18n5.__)("Position", "elementor") }, /* @__PURE__ */ React18.createElement(
|
|
874
765
|
SelectControl,
|
|
875
766
|
{
|
|
876
767
|
options: [
|
|
@@ -878,9 +769,9 @@ var Content = ({ anchorEl }) => {
|
|
|
878
769
|
{ label: (0, import_i18n5.__)("Outset", "elementor"), value: null }
|
|
879
770
|
]
|
|
880
771
|
}
|
|
881
|
-
))), /* @__PURE__ */
|
|
772
|
+
))), /* @__PURE__ */ React18.createElement(import_ui14.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(Control2, { bind: "hOffset", label: (0, import_i18n5.__)("Horizontal", "elementor") }, /* @__PURE__ */ React18.createElement(SizeControl, null)), /* @__PURE__ */ React18.createElement(Control2, { bind: "vOffset", label: (0, import_i18n5.__)("Vertical", "elementor") }, /* @__PURE__ */ React18.createElement(SizeControl, null))), /* @__PURE__ */ React18.createElement(import_ui14.Grid, { container: true, gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React18.createElement(Control2, { bind: "blur", label: (0, import_i18n5.__)("Blur", "elementor") }, /* @__PURE__ */ React18.createElement(SizeControl, null)), /* @__PURE__ */ React18.createElement(Control2, { bind: "spread", label: (0, import_i18n5.__)("Spread", "elementor") }, /* @__PURE__ */ React18.createElement(SizeControl, null)))));
|
|
882
773
|
};
|
|
883
|
-
var Control2 = ({ label, bind, children }) => /* @__PURE__ */
|
|
774
|
+
var Control2 = ({ label, bind, children }) => /* @__PURE__ */ React18.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React18.createElement(import_ui14.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React18.createElement(import_ui14.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React18.createElement(import_ui14.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React18.createElement(import_ui14.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React18.createElement(import_ui14.Grid, { item: true, xs: 12 }, children))));
|
|
884
775
|
var ItemLabel = ({ value }) => {
|
|
885
776
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
886
777
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -894,7 +785,7 @@ var ItemLabel = ({ value }) => {
|
|
|
894
785
|
blurSize + blurUnit,
|
|
895
786
|
spreadSize + spreadUnit
|
|
896
787
|
].join(" ");
|
|
897
|
-
return /* @__PURE__ */
|
|
788
|
+
return /* @__PURE__ */ React18.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
898
789
|
};
|
|
899
790
|
var initialShadow = {
|
|
900
791
|
$$type: "shadow",
|
|
@@ -924,13 +815,13 @@ var initialShadow = {
|
|
|
924
815
|
};
|
|
925
816
|
|
|
926
817
|
// src/controls/toggle-control.tsx
|
|
927
|
-
var
|
|
818
|
+
var React20 = __toESM(require("react"));
|
|
928
819
|
var import_editor_props10 = require("@elementor/editor-props");
|
|
929
820
|
|
|
930
821
|
// src/components/control-toggle-button-group.tsx
|
|
931
|
-
var
|
|
932
|
-
var
|
|
933
|
-
var StyledToggleButtonGroup = (0,
|
|
822
|
+
var React19 = __toESM(require("react"));
|
|
823
|
+
var import_ui15 = require("@elementor/ui");
|
|
824
|
+
var StyledToggleButtonGroup = (0, import_ui15.styled)(import_ui15.ToggleButtonGroup)`
|
|
934
825
|
${({ justify }) => `justify-content: ${justify};`}
|
|
935
826
|
`;
|
|
936
827
|
var ControlToggleButtonGroup = ({
|
|
@@ -942,11 +833,11 @@ var ControlToggleButtonGroup = ({
|
|
|
942
833
|
exclusive = false,
|
|
943
834
|
fullWidth = false
|
|
944
835
|
}) => {
|
|
945
|
-
const isRtl = "rtl" === (0,
|
|
836
|
+
const isRtl = "rtl" === (0, import_ui15.useTheme)().direction;
|
|
946
837
|
const handleChange = (_, newValue) => {
|
|
947
838
|
onChange(newValue);
|
|
948
839
|
};
|
|
949
|
-
return /* @__PURE__ */
|
|
840
|
+
return /* @__PURE__ */ React19.createElement(
|
|
950
841
|
StyledToggleButtonGroup,
|
|
951
842
|
{
|
|
952
843
|
justify,
|
|
@@ -958,8 +849,8 @@ var ControlToggleButtonGroup = ({
|
|
|
958
849
|
}
|
|
959
850
|
},
|
|
960
851
|
items.map(
|
|
961
|
-
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */
|
|
962
|
-
|
|
852
|
+
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */ React19.createElement(import_ui15.Tooltip, { key: buttonValue, title: label, disableFocusListener: true, placement: "top" }, /* @__PURE__ */ React19.createElement(import_ui15.ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React19.createElement(Content3, { size }))) : /* @__PURE__ */ React19.createElement(
|
|
853
|
+
import_ui15.ToggleButton,
|
|
963
854
|
{
|
|
964
855
|
key: buttonValue,
|
|
965
856
|
value: buttonValue,
|
|
@@ -967,7 +858,7 @@ var ControlToggleButtonGroup = ({
|
|
|
967
858
|
size,
|
|
968
859
|
fullWidth
|
|
969
860
|
},
|
|
970
|
-
/* @__PURE__ */
|
|
861
|
+
/* @__PURE__ */ React19.createElement(Content3, { size })
|
|
971
862
|
)
|
|
972
863
|
)
|
|
973
864
|
);
|
|
@@ -980,7 +871,7 @@ var ToggleControl = createControl(
|
|
|
980
871
|
const handleToggle = (option) => {
|
|
981
872
|
setValue(option);
|
|
982
873
|
};
|
|
983
|
-
return /* @__PURE__ */
|
|
874
|
+
return /* @__PURE__ */ React20.createElement(
|
|
984
875
|
ControlToggleButtonGroup,
|
|
985
876
|
{
|
|
986
877
|
items: options,
|
|
@@ -995,9 +886,9 @@ var ToggleControl = createControl(
|
|
|
995
886
|
);
|
|
996
887
|
|
|
997
888
|
// src/controls/number-control.tsx
|
|
998
|
-
var
|
|
889
|
+
var React21 = __toESM(require("react"));
|
|
999
890
|
var import_editor_props11 = require("@elementor/editor-props");
|
|
1000
|
-
var
|
|
891
|
+
var import_ui16 = require("@elementor/ui");
|
|
1001
892
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
1002
893
|
var NumberControl = createControl(
|
|
1003
894
|
({
|
|
@@ -1017,8 +908,8 @@ var NumberControl = createControl(
|
|
|
1017
908
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
1018
909
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
1019
910
|
};
|
|
1020
|
-
return /* @__PURE__ */
|
|
1021
|
-
|
|
911
|
+
return /* @__PURE__ */ React21.createElement(ControlActions, null, /* @__PURE__ */ React21.createElement(
|
|
912
|
+
import_ui16.TextField,
|
|
1022
913
|
{
|
|
1023
914
|
size: "tiny",
|
|
1024
915
|
type: "number",
|
|
@@ -1033,10 +924,10 @@ var NumberControl = createControl(
|
|
|
1033
924
|
);
|
|
1034
925
|
|
|
1035
926
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1036
|
-
var
|
|
927
|
+
var React22 = __toESM(require("react"));
|
|
1037
928
|
var import_react8 = require("react");
|
|
1038
929
|
var import_editor_props12 = require("@elementor/editor-props");
|
|
1039
|
-
var
|
|
930
|
+
var import_ui17 = require("@elementor/ui");
|
|
1040
931
|
var import_i18n6 = require("@wordpress/i18n");
|
|
1041
932
|
var isEqualSizes = (propValue, items) => {
|
|
1042
933
|
const values = Object.values(propValue);
|
|
@@ -1056,7 +947,7 @@ function EqualUnequalSizesControl({
|
|
|
1056
947
|
}) {
|
|
1057
948
|
const popupId = (0, import_react8.useId)();
|
|
1058
949
|
const controlRef = (0, import_react8.useRef)(null);
|
|
1059
|
-
const popupState = (0,
|
|
950
|
+
const popupState = (0, import_ui17.usePopupState)({ variant: "popover", popupId });
|
|
1060
951
|
const {
|
|
1061
952
|
propType: multiSizePropType,
|
|
1062
953
|
value: multiSizeValue,
|
|
@@ -1090,18 +981,18 @@ function EqualUnequalSizesControl({
|
|
|
1090
981
|
return splitEqualValue() ?? null;
|
|
1091
982
|
};
|
|
1092
983
|
const isMixed = !!multiSizeValue;
|
|
1093
|
-
return /* @__PURE__ */
|
|
1094
|
-
|
|
984
|
+
return /* @__PURE__ */ React22.createElement(React22.Fragment, null, /* @__PURE__ */ React22.createElement(import_ui17.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React22.createElement(import_ui17.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(ControlLabel, null, label)), /* @__PURE__ */ React22.createElement(import_ui17.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(import_ui17.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React22.createElement(SizeControl, { placeholder: isMixed ? (0, import_i18n6.__)("Mixed", "elementor") : void 0 }), /* @__PURE__ */ React22.createElement(
|
|
985
|
+
import_ui17.ToggleButton,
|
|
1095
986
|
{
|
|
1096
987
|
size: "tiny",
|
|
1097
988
|
value: "check",
|
|
1098
989
|
sx: { marginLeft: "auto" },
|
|
1099
|
-
...(0,
|
|
990
|
+
...(0, import_ui17.bindToggle)(popupState),
|
|
1100
991
|
selected: popupState.isOpen
|
|
1101
992
|
},
|
|
1102
993
|
icon
|
|
1103
|
-
)))), /* @__PURE__ */
|
|
1104
|
-
|
|
994
|
+
)))), /* @__PURE__ */ React22.createElement(
|
|
995
|
+
import_ui17.Popover,
|
|
1105
996
|
{
|
|
1106
997
|
disablePortal: true,
|
|
1107
998
|
disableScrollLock: true,
|
|
@@ -1113,21 +1004,21 @@ function EqualUnequalSizesControl({
|
|
|
1113
1004
|
vertical: "top",
|
|
1114
1005
|
horizontal: "right"
|
|
1115
1006
|
},
|
|
1116
|
-
...(0,
|
|
1007
|
+
...(0, import_ui17.bindPopover)(popupState),
|
|
1117
1008
|
slotProps: {
|
|
1118
1009
|
paper: { sx: { mt: 0.5, p: 2, pt: 1, width: controlRef.current?.getBoundingClientRect().width } }
|
|
1119
1010
|
}
|
|
1120
1011
|
},
|
|
1121
|
-
/* @__PURE__ */
|
|
1012
|
+
/* @__PURE__ */ React22.createElement(PropProvider, { propType: multiSizePropType, value: getMultiSizeValues(), setValue: setNestedProp }, /* @__PURE__ */ React22.createElement(import_ui17.Stack, { gap: 1.5 }, /* @__PURE__ */ React22.createElement(import_ui17.Grid, { 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(import_ui17.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React22.createElement(MultiSizeValueControl, { item: items[3] }), /* @__PURE__ */ React22.createElement(MultiSizeValueControl, { item: items[2] }))))
|
|
1122
1013
|
));
|
|
1123
1014
|
}
|
|
1124
|
-
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */
|
|
1015
|
+
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React22.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React22.createElement(import_ui17.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React22.createElement(import_ui17.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React22.createElement(import_ui17.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React22.createElement(import_ui17.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React22.createElement(SizeControl, { startIcon: item.icon })))));
|
|
1125
1016
|
|
|
1126
1017
|
// src/controls/linked-dimensions-control.tsx
|
|
1127
|
-
var
|
|
1018
|
+
var React23 = __toESM(require("react"));
|
|
1128
1019
|
var import_editor_props13 = require("@elementor/editor-props");
|
|
1129
|
-
var
|
|
1130
|
-
var
|
|
1020
|
+
var import_icons3 = require("@elementor/icons");
|
|
1021
|
+
var import_ui18 = require("@elementor/ui");
|
|
1131
1022
|
var import_i18n7 = require("@wordpress/i18n");
|
|
1132
1023
|
var LinkedDimensionsControl = createControl(({ label }) => {
|
|
1133
1024
|
const { value: dimensionsValue, setValue: setDimensionsValue, propType } = useBoundProp(import_editor_props13.dimensionsPropTypeUtil);
|
|
@@ -1146,61 +1037,61 @@ var LinkedDimensionsControl = createControl(({ label }) => {
|
|
|
1146
1037
|
left: value
|
|
1147
1038
|
});
|
|
1148
1039
|
};
|
|
1149
|
-
const LinkedIcon = isLinked ?
|
|
1150
|
-
return /* @__PURE__ */
|
|
1151
|
-
|
|
1040
|
+
const LinkedIcon = isLinked ? import_icons3.LinkIcon : import_icons3.DetachIcon;
|
|
1041
|
+
return /* @__PURE__ */ React23.createElement(PropProvider, { propType, value: dimensionsValue, setValue: setDimensionsValue }, /* @__PURE__ */ React23.createElement(import_ui18.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React23.createElement(ControlLabel, null, label), /* @__PURE__ */ React23.createElement(
|
|
1042
|
+
import_ui18.ToggleButton,
|
|
1152
1043
|
{
|
|
1153
|
-
"aria-label": (0, import_i18n7.__)("Link
|
|
1044
|
+
"aria-label": (0, import_i18n7.__)("Link inputs", "elementor"),
|
|
1154
1045
|
size: "tiny",
|
|
1155
1046
|
value: "check",
|
|
1156
1047
|
selected: isLinked,
|
|
1157
1048
|
sx: { marginLeft: "auto" },
|
|
1158
1049
|
onChange: onLinkToggle
|
|
1159
1050
|
},
|
|
1160
|
-
/* @__PURE__ */
|
|
1161
|
-
)), /* @__PURE__ */
|
|
1051
|
+
/* @__PURE__ */ React23.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1052
|
+
)), /* @__PURE__ */ React23.createElement(import_ui18.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React23.createElement(import_ui18.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, (0, import_i18n7.__)("Top", "elementor"))), /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(
|
|
1162
1053
|
Control3,
|
|
1163
1054
|
{
|
|
1164
1055
|
bind: "top",
|
|
1165
|
-
startIcon: /* @__PURE__ */
|
|
1056
|
+
startIcon: /* @__PURE__ */ React23.createElement(import_icons3.SideTopIcon, { fontSize: "tiny" }),
|
|
1166
1057
|
isLinked
|
|
1167
1058
|
}
|
|
1168
|
-
))), /* @__PURE__ */
|
|
1059
|
+
))), /* @__PURE__ */ React23.createElement(import_ui18.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, (0, import_i18n7.__)("Right", "elementor"))), /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(
|
|
1169
1060
|
Control3,
|
|
1170
1061
|
{
|
|
1171
1062
|
bind: "right",
|
|
1172
|
-
startIcon: /* @__PURE__ */
|
|
1063
|
+
startIcon: /* @__PURE__ */ React23.createElement(import_icons3.SideRightIcon, { fontSize: "tiny" }),
|
|
1173
1064
|
isLinked
|
|
1174
1065
|
}
|
|
1175
|
-
)))), /* @__PURE__ */
|
|
1066
|
+
)))), /* @__PURE__ */ React23.createElement(import_ui18.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React23.createElement(import_ui18.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, (0, import_i18n7.__)("Bottom", "elementor"))), /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(
|
|
1176
1067
|
Control3,
|
|
1177
1068
|
{
|
|
1178
1069
|
bind: "bottom",
|
|
1179
|
-
startIcon: /* @__PURE__ */
|
|
1070
|
+
startIcon: /* @__PURE__ */ React23.createElement(import_icons3.SideBottomIcon, { fontSize: "tiny" }),
|
|
1180
1071
|
isLinked
|
|
1181
1072
|
}
|
|
1182
|
-
))), /* @__PURE__ */
|
|
1073
|
+
))), /* @__PURE__ */ React23.createElement(import_ui18.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(ControlLabel, null, (0, import_i18n7.__)("Left", "elementor"))), /* @__PURE__ */ React23.createElement(import_ui18.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React23.createElement(
|
|
1183
1074
|
Control3,
|
|
1184
1075
|
{
|
|
1185
1076
|
bind: "left",
|
|
1186
|
-
startIcon: /* @__PURE__ */
|
|
1077
|
+
startIcon: /* @__PURE__ */ React23.createElement(import_icons3.SideLeftIcon, { fontSize: "tiny" }),
|
|
1187
1078
|
isLinked
|
|
1188
1079
|
}
|
|
1189
1080
|
)))));
|
|
1190
1081
|
});
|
|
1191
1082
|
var Control3 = ({ bind, startIcon, isLinked }) => {
|
|
1192
1083
|
if (isLinked) {
|
|
1193
|
-
return /* @__PURE__ */
|
|
1084
|
+
return /* @__PURE__ */ React23.createElement(SizeControl, { startIcon });
|
|
1194
1085
|
}
|
|
1195
|
-
return /* @__PURE__ */
|
|
1086
|
+
return /* @__PURE__ */ React23.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React23.createElement(SizeControl, { startIcon }));
|
|
1196
1087
|
};
|
|
1197
1088
|
|
|
1198
1089
|
// src/controls/font-family-control.tsx
|
|
1199
1090
|
var import_react9 = require("react");
|
|
1200
|
-
var
|
|
1091
|
+
var React24 = __toESM(require("react"));
|
|
1201
1092
|
var import_editor_props14 = require("@elementor/editor-props");
|
|
1202
|
-
var
|
|
1203
|
-
var
|
|
1093
|
+
var import_icons4 = require("@elementor/icons");
|
|
1094
|
+
var import_ui19 = require("@elementor/ui");
|
|
1204
1095
|
var import_i18n9 = require("@wordpress/i18n");
|
|
1205
1096
|
|
|
1206
1097
|
// src/hooks/use-filtered-font-families.ts
|
|
@@ -1239,7 +1130,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1239
1130
|
const [searchValue, setSearchValue] = (0, import_react9.useState)("");
|
|
1240
1131
|
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(import_editor_props14.stringPropTypeUtil);
|
|
1241
1132
|
const popupId = (0, import_react9.useId)();
|
|
1242
|
-
const popoverState = (0,
|
|
1133
|
+
const popoverState = (0, import_ui19.usePopupState)({ variant: "popover", popupId });
|
|
1243
1134
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1244
1135
|
if (!filteredFontFamilies) {
|
|
1245
1136
|
return null;
|
|
@@ -1251,26 +1142,26 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1251
1142
|
setSearchValue("");
|
|
1252
1143
|
popoverState.close();
|
|
1253
1144
|
};
|
|
1254
|
-
return /* @__PURE__ */
|
|
1255
|
-
|
|
1145
|
+
return /* @__PURE__ */ React24.createElement(React24.Fragment, null, /* @__PURE__ */ React24.createElement(
|
|
1146
|
+
import_ui19.UnstableTag,
|
|
1256
1147
|
{
|
|
1257
1148
|
variant: "outlined",
|
|
1258
1149
|
label: fontFamily,
|
|
1259
|
-
endIcon: /* @__PURE__ */
|
|
1260
|
-
...(0,
|
|
1150
|
+
endIcon: /* @__PURE__ */ React24.createElement(import_icons4.ChevronDownIcon, { fontSize: "tiny" }),
|
|
1151
|
+
...(0, import_ui19.bindTrigger)(popoverState),
|
|
1261
1152
|
fullWidth: true
|
|
1262
1153
|
}
|
|
1263
|
-
), /* @__PURE__ */
|
|
1264
|
-
|
|
1154
|
+
), /* @__PURE__ */ React24.createElement(
|
|
1155
|
+
import_ui19.Popover,
|
|
1265
1156
|
{
|
|
1266
1157
|
disablePortal: true,
|
|
1267
1158
|
disableScrollLock: true,
|
|
1268
1159
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1269
|
-
...(0,
|
|
1160
|
+
...(0, import_ui19.bindPopover)(popoverState),
|
|
1270
1161
|
onClose: handleClose
|
|
1271
1162
|
},
|
|
1272
|
-
/* @__PURE__ */
|
|
1273
|
-
|
|
1163
|
+
/* @__PURE__ */ React24.createElement(import_ui19.Stack, null, /* @__PURE__ */ React24.createElement(import_ui19.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React24.createElement(import_icons4.EditIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React24.createElement(import_ui19.Typography, { variant: "subtitle2" }, (0, import_i18n9.__)("Font Family", "elementor")), /* @__PURE__ */ React24.createElement(import_ui19.IconButton, { size: SIZE2, sx: { ml: "auto" }, onClick: handleClose }, /* @__PURE__ */ React24.createElement(import_icons4.XIcon, { fontSize: SIZE2 }))), /* @__PURE__ */ React24.createElement(import_ui19.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React24.createElement(
|
|
1164
|
+
import_ui19.TextField,
|
|
1274
1165
|
{
|
|
1275
1166
|
fullWidth: true,
|
|
1276
1167
|
size: SIZE2,
|
|
@@ -1278,13 +1169,13 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1278
1169
|
placeholder: (0, import_i18n9.__)("Search", "elementor"),
|
|
1279
1170
|
onChange: handleSearch,
|
|
1280
1171
|
InputProps: {
|
|
1281
|
-
startAdornment: /* @__PURE__ */
|
|
1172
|
+
startAdornment: /* @__PURE__ */ React24.createElement(import_ui19.InputAdornment, { position: "start" }, /* @__PURE__ */ React24.createElement(import_icons4.SearchIcon, { fontSize: SIZE2 }))
|
|
1282
1173
|
}
|
|
1283
1174
|
}
|
|
1284
|
-
)), /* @__PURE__ */
|
|
1175
|
+
)), /* @__PURE__ */ React24.createElement(import_ui19.Divider, null), /* @__PURE__ */ React24.createElement(import_ui19.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, filteredFontFamilies.length > 0 ? /* @__PURE__ */ React24.createElement(import_ui19.MenuList, { role: "listbox", tabIndex: 0 }, filteredFontFamilies.map(([category, items], index) => /* @__PURE__ */ React24.createElement(import_react9.Fragment, { key: index }, /* @__PURE__ */ React24.createElement(import_ui19.ListSubheader, { sx: { typography: "caption", color: "text.tertiary" } }, category), items.map((item) => {
|
|
1285
1176
|
const isSelected = item === fontFamily;
|
|
1286
|
-
return /* @__PURE__ */
|
|
1287
|
-
|
|
1177
|
+
return /* @__PURE__ */ React24.createElement(
|
|
1178
|
+
import_ui19.MenuItem,
|
|
1288
1179
|
{
|
|
1289
1180
|
key: item,
|
|
1290
1181
|
selected: isSelected,
|
|
@@ -1298,8 +1189,8 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1298
1189
|
},
|
|
1299
1190
|
item
|
|
1300
1191
|
);
|
|
1301
|
-
})))) : /* @__PURE__ */
|
|
1302
|
-
|
|
1192
|
+
})))) : /* @__PURE__ */ React24.createElement(import_ui19.Stack, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React24.createElement(import_icons4.PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React24.createElement(import_ui19.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n9.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React24.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React24.createElement(import_ui19.Typography, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React24.createElement(
|
|
1193
|
+
import_ui19.Link,
|
|
1303
1194
|
{
|
|
1304
1195
|
color: "secondary",
|
|
1305
1196
|
variant: "caption",
|
|
@@ -1312,14 +1203,14 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1312
1203
|
});
|
|
1313
1204
|
|
|
1314
1205
|
// src/controls/url-control.tsx
|
|
1315
|
-
var
|
|
1206
|
+
var React25 = __toESM(require("react"));
|
|
1316
1207
|
var import_editor_props15 = require("@elementor/editor-props");
|
|
1317
|
-
var
|
|
1208
|
+
var import_ui20 = require("@elementor/ui");
|
|
1318
1209
|
var UrlControl = createControl(({ placeholder }) => {
|
|
1319
1210
|
const { value, setValue } = useBoundProp(import_editor_props15.urlPropTypeUtil);
|
|
1320
1211
|
const handleChange = (event) => setValue(event.target.value);
|
|
1321
|
-
return /* @__PURE__ */
|
|
1322
|
-
|
|
1212
|
+
return /* @__PURE__ */ React25.createElement(ControlActions, null, /* @__PURE__ */ React25.createElement(
|
|
1213
|
+
import_ui20.TextField,
|
|
1323
1214
|
{
|
|
1324
1215
|
size: "tiny",
|
|
1325
1216
|
fullWidth: true,
|
|
@@ -1332,49 +1223,155 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1332
1223
|
|
|
1333
1224
|
// src/controls/link-control.tsx
|
|
1334
1225
|
var React27 = __toESM(require("react"));
|
|
1335
|
-
var
|
|
1226
|
+
var import_react11 = require("react");
|
|
1336
1227
|
var import_editor_props16 = require("@elementor/editor-props");
|
|
1337
1228
|
var import_http = require("@elementor/http");
|
|
1338
1229
|
var import_icons6 = require("@elementor/icons");
|
|
1339
1230
|
var import_session = require("@elementor/session");
|
|
1340
1231
|
var import_ui22 = require("@elementor/ui");
|
|
1341
1232
|
var import_i18n10 = require("@wordpress/i18n");
|
|
1233
|
+
|
|
1234
|
+
// src/components/autocomplete.tsx
|
|
1235
|
+
var React26 = __toESM(require("react"));
|
|
1236
|
+
var import_react10 = require("react");
|
|
1237
|
+
var import_icons5 = require("@elementor/icons");
|
|
1238
|
+
var import_ui21 = require("@elementor/ui");
|
|
1239
|
+
var Autocomplete = (0, import_react10.forwardRef)((props, ref) => {
|
|
1240
|
+
const {
|
|
1241
|
+
options,
|
|
1242
|
+
onOptionChange,
|
|
1243
|
+
onTextChange,
|
|
1244
|
+
allowCustomValues = false,
|
|
1245
|
+
placeholder = "",
|
|
1246
|
+
minInputLength = 2,
|
|
1247
|
+
value = "",
|
|
1248
|
+
...restProps
|
|
1249
|
+
} = props;
|
|
1250
|
+
const optionKeys = _factoryFilter(value, options, minInputLength).map(({ id }) => id);
|
|
1251
|
+
const allowClear = !!value;
|
|
1252
|
+
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
1253
|
+
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
1254
|
+
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
1255
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1256
|
+
import_ui21.Autocomplete,
|
|
1257
|
+
{
|
|
1258
|
+
...restProps,
|
|
1259
|
+
ref,
|
|
1260
|
+
forcePopupIcon: false,
|
|
1261
|
+
disableClearable: true,
|
|
1262
|
+
freeSolo: allowCustomValues,
|
|
1263
|
+
value: value?.toString() || "",
|
|
1264
|
+
size: "tiny",
|
|
1265
|
+
onChange: (_, newValue) => onOptionChange(Number(newValue)),
|
|
1266
|
+
readOnly: isValueFromOptions,
|
|
1267
|
+
options: optionKeys,
|
|
1268
|
+
getOptionKey: (optionId) => findMatchingOption(options, optionId)?.id || optionId,
|
|
1269
|
+
getOptionLabel: (optionId) => findMatchingOption(options, optionId)?.label || optionId.toString(),
|
|
1270
|
+
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
1271
|
+
isOptionEqualToValue,
|
|
1272
|
+
filterOptions: () => optionKeys,
|
|
1273
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React26.createElement(import_ui21.Box, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
1274
|
+
renderInput: (params) => /* @__PURE__ */ React26.createElement(
|
|
1275
|
+
TextInput,
|
|
1276
|
+
{
|
|
1277
|
+
params,
|
|
1278
|
+
handleChange: (newValue) => onTextChange?.(newValue),
|
|
1279
|
+
allowClear,
|
|
1280
|
+
placeholder,
|
|
1281
|
+
hasSelectedValue: isValueFromOptions
|
|
1282
|
+
}
|
|
1283
|
+
)
|
|
1284
|
+
}
|
|
1285
|
+
);
|
|
1286
|
+
});
|
|
1287
|
+
var TextInput = ({
|
|
1288
|
+
params,
|
|
1289
|
+
allowClear,
|
|
1290
|
+
placeholder,
|
|
1291
|
+
handleChange,
|
|
1292
|
+
hasSelectedValue
|
|
1293
|
+
}) => {
|
|
1294
|
+
const onChange = (event) => {
|
|
1295
|
+
handleChange(event.target.value);
|
|
1296
|
+
};
|
|
1297
|
+
return /* @__PURE__ */ React26.createElement(
|
|
1298
|
+
import_ui21.TextField,
|
|
1299
|
+
{
|
|
1300
|
+
...params,
|
|
1301
|
+
placeholder,
|
|
1302
|
+
onChange,
|
|
1303
|
+
sx: {
|
|
1304
|
+
"& .MuiInputBase-input": {
|
|
1305
|
+
cursor: hasSelectedValue ? "default" : void 0
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
InputProps: {
|
|
1309
|
+
...params.InputProps,
|
|
1310
|
+
endAdornment: /* @__PURE__ */ React26.createElement(ClearButton, { params, allowClear, handleChange })
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
);
|
|
1314
|
+
};
|
|
1315
|
+
var ClearButton = ({
|
|
1316
|
+
allowClear,
|
|
1317
|
+
handleChange,
|
|
1318
|
+
params
|
|
1319
|
+
}) => /* @__PURE__ */ React26.createElement(import_ui21.InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React26.createElement(import_ui21.IconButton, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React26.createElement(import_icons5.XIcon, { fontSize: params.size })));
|
|
1320
|
+
function findMatchingOption(options, optionId = null) {
|
|
1321
|
+
const formattedOption = (optionId || "").toString();
|
|
1322
|
+
return options.find(({ id }) => formattedOption === id.toString());
|
|
1323
|
+
}
|
|
1324
|
+
function isCategorizedOptionPool(options) {
|
|
1325
|
+
return options.every((option) => "groupLabel" in option);
|
|
1326
|
+
}
|
|
1327
|
+
function _factoryFilter(newValue, options, minInputLength) {
|
|
1328
|
+
if (null === newValue) {
|
|
1329
|
+
return options;
|
|
1330
|
+
}
|
|
1331
|
+
const formattedValue = String(newValue || "")?.toLowerCase();
|
|
1332
|
+
if (formattedValue.length < minInputLength) {
|
|
1333
|
+
return new Array(0);
|
|
1334
|
+
}
|
|
1335
|
+
return options.filter(
|
|
1336
|
+
(option) => String(option.id).toLowerCase().includes(formattedValue) || option.label.toLowerCase().includes(formattedValue)
|
|
1337
|
+
);
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
// src/controls/link-control.tsx
|
|
1342
1341
|
var SIZE3 = "tiny";
|
|
1343
1342
|
var LinkControl = createControl((props) => {
|
|
1344
1343
|
const { value, path, setValue, ...propContext } = useBoundProp(import_editor_props16.linkPropTypeUtil);
|
|
1345
1344
|
const [linkSessionValue, setLinkSessionValue] = (0, import_session.useSessionStorage)(path.join("/"));
|
|
1345
|
+
const [isEnabled, setIsEnabled] = (0, import_react11.useState)(!!value);
|
|
1346
1346
|
const {
|
|
1347
1347
|
allowCustomValues,
|
|
1348
1348
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
1349
1349
|
placeholder,
|
|
1350
1350
|
minInputLength = 2
|
|
1351
1351
|
} = props || {};
|
|
1352
|
-
const [options, setOptions] = (0,
|
|
1352
|
+
const [options, setOptions] = (0, import_react11.useState)(
|
|
1353
1353
|
generateFirstLoadedOption(value)
|
|
1354
1354
|
);
|
|
1355
1355
|
const onEnabledChange = () => {
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
setValue(isEnabled ? null : linkSessionValue?.value ?? { destination: null });
|
|
1356
|
+
setIsEnabled((prevState) => !prevState);
|
|
1357
|
+
setValue(isEnabled ? null : linkSessionValue?.value ?? null);
|
|
1359
1358
|
setLinkSessionValue({ value, meta: { isEnabled: !isEnabled } });
|
|
1360
1359
|
};
|
|
1361
1360
|
const onOptionChange = (newValue) => {
|
|
1362
|
-
const valueToSave = {
|
|
1361
|
+
const valueToSave = newValue ? {
|
|
1363
1362
|
...value,
|
|
1364
|
-
destination:
|
|
1365
|
-
label:
|
|
1366
|
-
|
|
1367
|
-
value: findMatchingOption(options, newValue?.toString())?.label || ""
|
|
1368
|
-
}
|
|
1369
|
-
};
|
|
1363
|
+
destination: import_editor_props16.numberPropTypeUtil.create(newValue),
|
|
1364
|
+
label: import_editor_props16.stringPropTypeUtil.create(findMatchingOption(options, newValue)?.label || null)
|
|
1365
|
+
} : null;
|
|
1370
1366
|
onSaveNewValue(valueToSave);
|
|
1371
1367
|
};
|
|
1372
1368
|
const onTextChange = (newValue) => {
|
|
1373
|
-
|
|
1369
|
+
newValue = newValue?.trim() || "";
|
|
1370
|
+
const valueToSave = newValue ? {
|
|
1374
1371
|
...value,
|
|
1375
|
-
destination:
|
|
1372
|
+
destination: import_editor_props16.urlPropTypeUtil.create(newValue),
|
|
1376
1373
|
label: null
|
|
1377
|
-
};
|
|
1374
|
+
} : null;
|
|
1378
1375
|
onSaveNewValue(valueToSave);
|
|
1379
1376
|
updateOptions(newValue);
|
|
1380
1377
|
};
|
|
@@ -1387,13 +1384,16 @@ var LinkControl = createControl((props) => {
|
|
|
1387
1384
|
if (!newValue || !endpoint || newValue.length < minInputLength) {
|
|
1388
1385
|
return;
|
|
1389
1386
|
}
|
|
1390
|
-
debounceFetch(newValue)
|
|
1387
|
+
debounceFetch({ ...requestParams, term: newValue });
|
|
1391
1388
|
};
|
|
1392
|
-
const debounceFetch = (
|
|
1393
|
-
() =>
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1389
|
+
const debounceFetch = (0, import_react11.useMemo)(
|
|
1390
|
+
() => debounce(
|
|
1391
|
+
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
1392
|
+
setOptions(formatOptions(newOptions));
|
|
1393
|
+
}),
|
|
1394
|
+
400
|
|
1395
|
+
),
|
|
1396
|
+
[endpoint]
|
|
1397
1397
|
);
|
|
1398
1398
|
return /* @__PURE__ */ React27.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React27.createElement(import_ui22.Stack, { gap: 1.5 }, /* @__PURE__ */ React27.createElement(import_ui22.Divider, null), /* @__PURE__ */ React27.createElement(
|
|
1399
1399
|
import_ui22.Stack,
|
|
@@ -1408,24 +1408,23 @@ var LinkControl = createControl((props) => {
|
|
|
1408
1408
|
/* @__PURE__ */ React27.createElement(
|
|
1409
1409
|
ToggleIconControl,
|
|
1410
1410
|
{
|
|
1411
|
-
enabled:
|
|
1411
|
+
enabled: isEnabled,
|
|
1412
1412
|
onIconClick: onEnabledChange,
|
|
1413
|
-
label: (0, import_i18n10.__)("Toggle
|
|
1413
|
+
label: (0, import_i18n10.__)("Toggle link", "elementor")
|
|
1414
1414
|
}
|
|
1415
1415
|
)
|
|
1416
|
-
), /* @__PURE__ */ React27.createElement(import_ui22.Collapse, { in:
|
|
1417
|
-
|
|
1416
|
+
), /* @__PURE__ */ React27.createElement(import_ui22.Collapse, { in: isEnabled, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React27.createElement(import_ui22.Stack, { gap: 1.5 }, /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React27.createElement(ControlActions, null, /* @__PURE__ */ React27.createElement(
|
|
1417
|
+
Autocomplete,
|
|
1418
1418
|
{
|
|
1419
1419
|
options,
|
|
1420
1420
|
allowCustomValues,
|
|
1421
1421
|
placeholder,
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
minInputLength
|
|
1426
|
-
customValue: value?.destination?.value?.toString()
|
|
1422
|
+
value: value?.destination?.value,
|
|
1423
|
+
onOptionChange,
|
|
1424
|
+
onTextChange,
|
|
1425
|
+
minInputLength
|
|
1427
1426
|
}
|
|
1428
|
-
)), /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React27.createElement(SwitchControl, null))))));
|
|
1427
|
+
))), /* @__PURE__ */ React27.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React27.createElement(SwitchControl, null))))));
|
|
1429
1428
|
});
|
|
1430
1429
|
var ToggleIconControl = ({ enabled, onIconClick, label }) => {
|
|
1431
1430
|
return /* @__PURE__ */ React27.createElement(import_ui22.IconButton, { size: SIZE3, onClick: onIconClick, "aria-label": label }, enabled ? /* @__PURE__ */ React27.createElement(import_icons6.MinusIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React27.createElement(import_icons6.PlusIcon, { fontSize: SIZE3 }));
|
|
@@ -1504,7 +1503,7 @@ var GapControl = createControl(({ label }) => {
|
|
|
1504
1503
|
return /* @__PURE__ */ React28.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React28.createElement(import_ui23.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React28.createElement(ControlLabel, null, label), /* @__PURE__ */ React28.createElement(
|
|
1505
1504
|
import_ui23.ToggleButton,
|
|
1506
1505
|
{
|
|
1507
|
-
"aria-label": (0, import_i18n11.__)("Link
|
|
1506
|
+
"aria-label": (0, import_i18n11.__)("Link inputs", "elementor"),
|
|
1508
1507
|
size: "tiny",
|
|
1509
1508
|
value: "check",
|
|
1510
1509
|
selected: isLinked,
|
|
@@ -1612,14 +1611,14 @@ var SvgMediaControl = createControl(() => {
|
|
|
1612
1611
|
|
|
1613
1612
|
// src/controls/background-control/background-control.tsx
|
|
1614
1613
|
var React35 = __toESM(require("react"));
|
|
1615
|
-
var
|
|
1616
|
-
var
|
|
1614
|
+
var import_editor_props23 = require("@elementor/editor-props");
|
|
1615
|
+
var import_ui31 = require("@elementor/ui");
|
|
1617
1616
|
var import_i18n18 = require("@wordpress/i18n");
|
|
1618
1617
|
|
|
1619
1618
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1620
1619
|
var React34 = __toESM(require("react"));
|
|
1621
|
-
var
|
|
1622
|
-
var
|
|
1620
|
+
var import_editor_props22 = require("@elementor/editor-props");
|
|
1621
|
+
var import_ui30 = require("@elementor/ui");
|
|
1623
1622
|
var import_wp_media3 = require("@elementor/wp-media");
|
|
1624
1623
|
var import_i18n17 = require("@wordpress/i18n");
|
|
1625
1624
|
|
|
@@ -1647,7 +1646,7 @@ var attachmentControlOptions = [
|
|
|
1647
1646
|
}
|
|
1648
1647
|
];
|
|
1649
1648
|
var BackgroundImageOverlayAttachment = () => {
|
|
1650
|
-
return /* @__PURE__ */ React30.createElement(import_ui25.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(import_ui25.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, (0, import_i18n13.__)("Attachment", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui25.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React30.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
1649
|
+
return /* @__PURE__ */ React30.createElement(import_ui25.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React30.createElement(import_ui25.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React30.createElement(ControlLabel, null, (0, import_i18n13.__)("Attachment", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui25.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React30.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
1651
1650
|
};
|
|
1652
1651
|
|
|
1653
1652
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
@@ -1657,15 +1656,15 @@ var import_icons10 = require("@elementor/icons");
|
|
|
1657
1656
|
var import_ui26 = require("@elementor/ui");
|
|
1658
1657
|
var import_i18n14 = require("@wordpress/i18n");
|
|
1659
1658
|
var backgroundPositionOptions = [
|
|
1660
|
-
{ label: (0, import_i18n14.__)("Center
|
|
1661
|
-
{ label: (0, import_i18n14.__)("Center
|
|
1662
|
-
{ label: (0, import_i18n14.__)("Center
|
|
1663
|
-
{ label: (0, import_i18n14.__)("Top
|
|
1664
|
-
{ label: (0, import_i18n14.__)("Top
|
|
1665
|
-
{ label: (0, import_i18n14.__)("Top
|
|
1666
|
-
{ label: (0, import_i18n14.__)("Bottom
|
|
1667
|
-
{ label: (0, import_i18n14.__)("Bottom
|
|
1668
|
-
{ label: (0, import_i18n14.__)("Bottom
|
|
1659
|
+
{ label: (0, import_i18n14.__)("Center center", "elementor"), value: "center center" },
|
|
1660
|
+
{ label: (0, import_i18n14.__)("Center left", "elementor"), value: "center left" },
|
|
1661
|
+
{ label: (0, import_i18n14.__)("Center right", "elementor"), value: "center right" },
|
|
1662
|
+
{ label: (0, import_i18n14.__)("Top center", "elementor"), value: "top center" },
|
|
1663
|
+
{ label: (0, import_i18n14.__)("Top left", "elementor"), value: "top left" },
|
|
1664
|
+
{ label: (0, import_i18n14.__)("Top right", "elementor"), value: "top right" },
|
|
1665
|
+
{ label: (0, import_i18n14.__)("Bottom center", "elementor"), value: "bottom center" },
|
|
1666
|
+
{ label: (0, import_i18n14.__)("Bottom left", "elementor"), value: "bottom left" },
|
|
1667
|
+
{ label: (0, import_i18n14.__)("Bottom right", "elementor"), value: "bottom right" },
|
|
1669
1668
|
{ label: (0, import_i18n14.__)("Custom", "elementor"), value: "custom" }
|
|
1670
1669
|
];
|
|
1671
1670
|
var BackgroundImageOverlayPosition = () => {
|
|
@@ -1680,7 +1679,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
1680
1679
|
stringPropContext.setValue(value);
|
|
1681
1680
|
}
|
|
1682
1681
|
};
|
|
1683
|
-
return /* @__PURE__ */ React31.createElement(import_ui26.Grid, { container: true, spacing: 2 }, /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(import_ui26.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel, null, (0, import_i18n14.__)("Position", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React31.createElement(
|
|
1682
|
+
return /* @__PURE__ */ React31.createElement(import_ui26.Grid, { container: true, spacing: 2 }, /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(import_ui26.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React31.createElement(ControlLabel, null, (0, import_i18n14.__)("Position", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React31.createElement(
|
|
1684
1683
|
import_ui26.Select,
|
|
1685
1684
|
{
|
|
1686
1685
|
size: "tiny",
|
|
@@ -1781,8 +1780,51 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1781
1780
|
)))), isCustom ? /* @__PURE__ */ React33.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React33.createElement(import_ui28.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React33.createElement(import_ui28.Grid, { container: true, spacing: 2 }, /* @__PURE__ */ React33.createElement(import_ui28.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React33.createElement(SizeControl, { startIcon: /* @__PURE__ */ React33.createElement(import_icons12.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React33.createElement(import_ui28.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React33.createElement(SizeControl, { startIcon: /* @__PURE__ */ React33.createElement(import_icons12.ArrowsMoveVerticalIcon, { fontSize: "tiny" }) })))))) : null);
|
|
1782
1781
|
};
|
|
1783
1782
|
|
|
1783
|
+
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
1784
|
+
var import_react12 = require("react");
|
|
1785
|
+
var import_editor_props21 = require("@elementor/editor-props");
|
|
1786
|
+
var import_ui29 = require("@elementor/ui");
|
|
1787
|
+
var useBackgroundTabsHistory = ({
|
|
1788
|
+
color: initialBackgroundColorOverlay2,
|
|
1789
|
+
image: initialBackgroundImageOverlay
|
|
1790
|
+
}) => {
|
|
1791
|
+
const { value: imageValue, setValue: setImageValue } = useBoundProp(import_editor_props21.backgroundImageOverlayPropTypeUtil);
|
|
1792
|
+
const { value: colorValue, setValue: setColorValue } = useBoundProp(import_editor_props21.backgroundColorOverlayPropTypeUtil);
|
|
1793
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui29.useTabs)(colorValue ? "color" : "image");
|
|
1794
|
+
const valuesHistory = (0, import_react12.useRef)({
|
|
1795
|
+
image: initialBackgroundImageOverlay,
|
|
1796
|
+
color: initialBackgroundColorOverlay2
|
|
1797
|
+
});
|
|
1798
|
+
const saveToHistory = (key, value) => {
|
|
1799
|
+
if (value) {
|
|
1800
|
+
valuesHistory.current[key] = value;
|
|
1801
|
+
}
|
|
1802
|
+
};
|
|
1803
|
+
const onTabChange = (e, tabName) => {
|
|
1804
|
+
switch (tabName) {
|
|
1805
|
+
case "image":
|
|
1806
|
+
setImageValue(valuesHistory.current.image);
|
|
1807
|
+
saveToHistory("color", colorValue);
|
|
1808
|
+
break;
|
|
1809
|
+
case "color":
|
|
1810
|
+
setColorValue(valuesHistory.current.color);
|
|
1811
|
+
saveToHistory("image", imageValue);
|
|
1812
|
+
}
|
|
1813
|
+
return getTabsProps().onChange(e, tabName);
|
|
1814
|
+
};
|
|
1815
|
+
return {
|
|
1816
|
+
getTabProps,
|
|
1817
|
+
getTabPanelProps,
|
|
1818
|
+
getTabsProps: () => ({ ...getTabsProps(), onChange: onTabChange })
|
|
1819
|
+
};
|
|
1820
|
+
};
|
|
1821
|
+
|
|
1784
1822
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1785
|
-
var
|
|
1823
|
+
var initialBackgroundColorOverlay = {
|
|
1824
|
+
$$type: "background-color-overlay",
|
|
1825
|
+
value: "#00000033"
|
|
1826
|
+
};
|
|
1827
|
+
var getInitialBackgroundOverlay = () => ({
|
|
1786
1828
|
$$type: "background-image-overlay",
|
|
1787
1829
|
value: {
|
|
1788
1830
|
image: {
|
|
@@ -1793,7 +1835,7 @@ var initialBackgroundOverlay = (backgroundPlaceholderImage) => ({
|
|
|
1793
1835
|
value: {
|
|
1794
1836
|
url: {
|
|
1795
1837
|
$$type: "url",
|
|
1796
|
-
value:
|
|
1838
|
+
value: env.background_placeholder_image
|
|
1797
1839
|
},
|
|
1798
1840
|
id: null
|
|
1799
1841
|
}
|
|
@@ -1813,7 +1855,7 @@ var backgroundResolutionOptions = [
|
|
|
1813
1855
|
{ label: (0, import_i18n17.__)("Full", "elementor"), value: "full" }
|
|
1814
1856
|
];
|
|
1815
1857
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
1816
|
-
const { propType, value: overlayValues, setValue } = useBoundProp(
|
|
1858
|
+
const { propType, value: overlayValues, setValue } = useBoundProp(import_editor_props22.backgroundOverlayPropTypeUtil);
|
|
1817
1859
|
return /* @__PURE__ */ React34.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React34.createElement(
|
|
1818
1860
|
Repeater,
|
|
1819
1861
|
{
|
|
@@ -1824,18 +1866,20 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
1824
1866
|
Icon: ItemIcon2,
|
|
1825
1867
|
Label: ItemLabel2,
|
|
1826
1868
|
Content: ItemContent2,
|
|
1827
|
-
initialValues:
|
|
1869
|
+
initialValues: getInitialBackgroundOverlay()
|
|
1828
1870
|
}
|
|
1829
1871
|
}
|
|
1830
1872
|
));
|
|
1831
1873
|
});
|
|
1832
|
-
var ItemContent2 = ({ bind
|
|
1833
|
-
return /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React34.createElement(Content2,
|
|
1874
|
+
var ItemContent2 = ({ bind }) => {
|
|
1875
|
+
return /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React34.createElement(Content2, null));
|
|
1834
1876
|
};
|
|
1835
|
-
var Content2 = (
|
|
1836
|
-
const
|
|
1837
|
-
|
|
1838
|
-
|
|
1877
|
+
var Content2 = () => {
|
|
1878
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
1879
|
+
image: getInitialBackgroundOverlay().value,
|
|
1880
|
+
color: initialBackgroundColorOverlay.value
|
|
1881
|
+
});
|
|
1882
|
+
return /* @__PURE__ */ React34.createElement(import_ui30.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React34.createElement(import_ui30.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React34.createElement(import_ui30.Tabs, { ...getTabsProps(), "aria-label": (0, import_i18n17.__)("Background Overlay", "elementor") }, /* @__PURE__ */ React34.createElement(import_ui30.Tab, { label: (0, import_i18n17.__)("Image", "elementor"), ...getTabProps("image") }), /* @__PURE__ */ React34.createElement(import_ui30.Tab, { label: (0, import_i18n17.__)("Color", "elementor"), ...getTabProps("color") }))), /* @__PURE__ */ React34.createElement(import_ui30.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React34.createElement(import_ui30.Stack, { gap: 1.5 }, /* @__PURE__ */ React34.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React34.createElement(import_ui30.TabPanel, { ...getTabPanelProps("color"), sx: { p: 1.5 } }, /* @__PURE__ */ React34.createElement(import_ui30.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React34.createElement(import_ui30.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(ColorControl, { propTypeUtil: import_editor_props22.backgroundColorOverlayPropTypeUtil })))));
|
|
1839
1883
|
};
|
|
1840
1884
|
var ItemIcon2 = ({ value }) => {
|
|
1841
1885
|
switch (value.$$type) {
|
|
@@ -1848,11 +1892,11 @@ var ItemIcon2 = ({ value }) => {
|
|
|
1848
1892
|
}
|
|
1849
1893
|
};
|
|
1850
1894
|
var ItemIconColor = ({ value }) => {
|
|
1851
|
-
return /* @__PURE__ */ React34.createElement(
|
|
1895
|
+
return /* @__PURE__ */ React34.createElement(import_ui30.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value });
|
|
1852
1896
|
};
|
|
1853
1897
|
var ItemIconImage = ({ value }) => {
|
|
1854
1898
|
const { imageUrl } = useImage(value);
|
|
1855
|
-
return /* @__PURE__ */ React34.createElement(
|
|
1899
|
+
return /* @__PURE__ */ React34.createElement(import_ui30.CardMedia, { image: imageUrl, sx: { height: 13, width: 13, borderRadius: "4px" } });
|
|
1856
1900
|
};
|
|
1857
1901
|
var ItemLabel2 = ({ value }) => {
|
|
1858
1902
|
switch (value.$$type) {
|
|
@@ -1872,8 +1916,8 @@ var ItemLabelImage = ({ value }) => {
|
|
|
1872
1916
|
return /* @__PURE__ */ React34.createElement("span", null, imageTitle);
|
|
1873
1917
|
};
|
|
1874
1918
|
var ImageOverlayContent = () => {
|
|
1875
|
-
const propContext = useBoundProp(
|
|
1876
|
-
return /* @__PURE__ */ React34.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React34.createElement(
|
|
1919
|
+
const propContext = useBoundProp(import_editor_props22.backgroundImageOverlayPropTypeUtil);
|
|
1920
|
+
return /* @__PURE__ */ React34.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React34.createElement(import_ui30.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React34.createElement(import_ui30.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(
|
|
1877
1921
|
ImageControl,
|
|
1878
1922
|
{
|
|
1879
1923
|
resolutionLabel: (0, import_i18n17.__)("Resolution", "elementor"),
|
|
@@ -1881,15 +1925,6 @@ var ImageOverlayContent = () => {
|
|
|
1881
1925
|
}
|
|
1882
1926
|
)))), /* @__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)));
|
|
1883
1927
|
};
|
|
1884
|
-
var deriveOverlayType = (type) => {
|
|
1885
|
-
if (type === "background-color-overlay") {
|
|
1886
|
-
return "color";
|
|
1887
|
-
}
|
|
1888
|
-
if (type === "background-image-overlay") {
|
|
1889
|
-
return "image";
|
|
1890
|
-
}
|
|
1891
|
-
throw new Error(`Invalid overlay type: ${type}`);
|
|
1892
|
-
};
|
|
1893
1928
|
var useImage = (image) => {
|
|
1894
1929
|
let imageTitle, imageUrl = null;
|
|
1895
1930
|
const imageSrc = image?.value.image.value?.src.value;
|
|
@@ -1907,12 +1942,11 @@ var useImage = (image) => {
|
|
|
1907
1942
|
|
|
1908
1943
|
// src/controls/background-control/background-control.tsx
|
|
1909
1944
|
var BackgroundControl = createControl(() => {
|
|
1910
|
-
const propContext = useBoundProp(
|
|
1911
|
-
return /* @__PURE__ */ React35.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React35.createElement(
|
|
1945
|
+
const propContext = useBoundProp(import_editor_props23.backgroundPropTypeUtil);
|
|
1946
|
+
return /* @__PURE__ */ React35.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React35.createElement(import_ui31.Stack, { gap: 1.5 }, /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React35.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React35.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React35.createElement(import_ui31.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React35.createElement(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, (0, import_i18n18.__)("Color", "elementor"))), /* @__PURE__ */ React35.createElement(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ColorControl, null))))));
|
|
1912
1947
|
});
|
|
1913
1948
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1914
1949
|
0 && (module.exports = {
|
|
1915
|
-
AutocompleteControl,
|
|
1916
1950
|
BackgroundControl,
|
|
1917
1951
|
BoxShadowRepeaterControl,
|
|
1918
1952
|
ColorControl,
|