@elementor/editor-controls 0.10.0 → 0.12.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 +22 -0
- package/dist/index.d.mts +3 -25
- package/dist/index.d.ts +3 -25
- package/dist/index.js +427 -403
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +400 -369
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/autocomplete.tsx +181 -0
- package/src/components/popover-content.tsx +15 -0
- package/src/components/popover-grid-container.tsx +20 -0
- package/src/components/repeater.tsx +6 -4
- package/src/components/section-content.tsx +16 -0
- package/src/controls/background-control/background-control.tsx +4 -3
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx +4 -3
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx +15 -14
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx +3 -2
- package/src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx +5 -4
- package/src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx +4 -3
- package/src/controls/box-shadow-repeater-control.tsx +12 -10
- package/src/controls/equal-unequal-sizes-control.tsx +9 -7
- package/src/controls/font-family-control.tsx +4 -2
- package/src/controls/gap-control.tsx +1 -1
- package/src/controls/image-control.tsx +2 -2
- 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/size-control.tsx +3 -1
- package/src/controls/stroke-control.tsx +6 -5
- 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__ */
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
|
|
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);
|
|
270
|
+
return /* @__PURE__ */ React5.createElement(import_ui2.ErrorBoundary, { fallback: null }, /* @__PURE__ */ React5.createElement(Component, { ...props }));
|
|
338
271
|
};
|
|
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
272
|
}
|
|
380
273
|
|
|
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: 1.5, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React10.createElement(import_ui6.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React10.createElement(ControlLabel, null, " ", resolutionLabel, " ")), /* @__PURE__ */ React10.createElement(import_ui6.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React10.createElement(SelectControl, { options: sizes }))))));
|
|
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
|
|
558
|
+
startAdornment: startIcon ? /* @__PURE__ */ React14.createElement(import_ui10.InputAdornment, { position: "start" }, startIcon) : void 0,
|
|
668
559
|
type: "number",
|
|
669
560
|
value: Number.isNaN(state?.size) ? "" : state?.size,
|
|
670
561
|
onChange: handleSizeChange
|
|
@@ -678,6 +569,11 @@ var import_editor_props8 = require("@elementor/editor-props");
|
|
|
678
569
|
var import_ui13 = require("@elementor/ui");
|
|
679
570
|
var import_i18n3 = require("@wordpress/i18n");
|
|
680
571
|
|
|
572
|
+
// src/components/section-content.tsx
|
|
573
|
+
var React15 = __toESM(require("react"));
|
|
574
|
+
var import_ui11 = require("@elementor/ui");
|
|
575
|
+
var SectionContent = ({ gap = 2, sx, children }) => /* @__PURE__ */ React15.createElement(import_ui11.Stack, { gap, sx: { ...sx } }, children);
|
|
576
|
+
|
|
681
577
|
// src/controls/color-control.tsx
|
|
682
578
|
var React16 = __toESM(require("react"));
|
|
683
579
|
var import_editor_props7 = require("@elementor/editor-props");
|
|
@@ -694,21 +590,36 @@ var ColorControl = createControl(({ propTypeUtil = import_editor_props7.colorPro
|
|
|
694
590
|
var units = ["px", "em", "rem"];
|
|
695
591
|
var StrokeControl = createControl(() => {
|
|
696
592
|
const propContext = useBoundProp(import_editor_props8.strokePropTypeUtil);
|
|
697
|
-
return /* @__PURE__ */ React17.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React17.createElement(
|
|
593
|
+
return /* @__PURE__ */ React17.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React17.createElement(SectionContent, null, /* @__PURE__ */ React17.createElement(Control, { bind: "width", label: (0, import_i18n3.__)("Stroke width", "elementor") }, /* @__PURE__ */ React17.createElement(SizeControl, { units })), /* @__PURE__ */ React17.createElement(Control, { bind: "color", label: (0, import_i18n3.__)("Stroke color", "elementor") }, /* @__PURE__ */ React17.createElement(ColorControl, null))));
|
|
698
594
|
});
|
|
699
595
|
var Control = ({ bind, label, children }) => /* @__PURE__ */ React17.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React17.createElement(import_ui13.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React17.createElement(import_ui13.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React17.createElement(ControlLabel, null, label)), /* @__PURE__ */ React17.createElement(import_ui13.Grid, { item: true, xs: 6 }, children)));
|
|
700
596
|
|
|
701
597
|
// src/controls/box-shadow-repeater-control.tsx
|
|
702
|
-
var
|
|
598
|
+
var React21 = __toESM(require("react"));
|
|
703
599
|
var import_editor_props9 = require("@elementor/editor-props");
|
|
704
|
-
var
|
|
600
|
+
var import_ui17 = require("@elementor/ui");
|
|
705
601
|
var import_i18n5 = require("@wordpress/i18n");
|
|
706
602
|
|
|
707
|
-
// src/components/
|
|
603
|
+
// src/components/popover-content.tsx
|
|
708
604
|
var React18 = __toESM(require("react"));
|
|
709
|
-
var import_react7 = require("react");
|
|
710
|
-
var import_icons3 = require("@elementor/icons");
|
|
711
605
|
var import_ui14 = require("@elementor/ui");
|
|
606
|
+
var PopoverContent = ({ alignItems, gap = 1.5, p, children }) => /* @__PURE__ */ React18.createElement(import_ui14.Stack, { alignItems, gap, p }, children);
|
|
607
|
+
|
|
608
|
+
// src/components/popover-grid-container.tsx
|
|
609
|
+
var React19 = __toESM(require("react"));
|
|
610
|
+
var import_ui15 = require("@elementor/ui");
|
|
611
|
+
var PopoverGridContainer = ({
|
|
612
|
+
gap = 1.5,
|
|
613
|
+
alignItems = "center",
|
|
614
|
+
flexWrap = "nowrap",
|
|
615
|
+
children
|
|
616
|
+
}) => /* @__PURE__ */ React19.createElement(import_ui15.Grid, { container: true, gap, alignItems, flexWrap }, children);
|
|
617
|
+
|
|
618
|
+
// src/components/repeater.tsx
|
|
619
|
+
var React20 = __toESM(require("react"));
|
|
620
|
+
var import_react7 = require("react");
|
|
621
|
+
var import_icons2 = require("@elementor/icons");
|
|
622
|
+
var import_ui16 = require("@elementor/ui");
|
|
712
623
|
var import_i18n4 = require("@wordpress/i18n");
|
|
713
624
|
var SIZE = "tiny";
|
|
714
625
|
var Repeater = ({
|
|
@@ -746,19 +657,19 @@ var Repeater = ({
|
|
|
746
657
|
})
|
|
747
658
|
);
|
|
748
659
|
};
|
|
749
|
-
return /* @__PURE__ */
|
|
660
|
+
return /* @__PURE__ */ React20.createElement(SectionContent, null, /* @__PURE__ */ React20.createElement(import_ui16.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React20.createElement(import_ui16.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label), /* @__PURE__ */ React20.createElement(import_ui16.IconButton, { size: SIZE, onClick: addRepeaterItem, "aria-label": (0, import_i18n4.__)("Add item", "elementor") }, /* @__PURE__ */ React20.createElement(import_icons2.PlusIcon, { fontSize: SIZE }))), /* @__PURE__ */ React20.createElement(import_ui16.Stack, { gap: 1, sx: { "&:empty": { display: "none" } } }, repeaterValues.map((value, index) => /* @__PURE__ */ React20.createElement(
|
|
750
661
|
RepeaterItem,
|
|
751
662
|
{
|
|
752
663
|
key: index,
|
|
753
664
|
bind: String(index),
|
|
754
665
|
disabled: value.disabled,
|
|
755
|
-
label: /* @__PURE__ */
|
|
756
|
-
startIcon: /* @__PURE__ */
|
|
666
|
+
label: /* @__PURE__ */ React20.createElement(itemSettings.Label, { value }),
|
|
667
|
+
startIcon: /* @__PURE__ */ React20.createElement(itemSettings.Icon, { value }),
|
|
757
668
|
removeItem: () => removeRepeaterItem(index),
|
|
758
669
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
759
670
|
toggleDisableItem: () => toggleDisableRepeaterItem(index)
|
|
760
671
|
},
|
|
761
|
-
(props) => /* @__PURE__ */
|
|
672
|
+
(props) => /* @__PURE__ */ React20.createElement(itemSettings.Content, { ...props, value, bind: String(index) })
|
|
762
673
|
))));
|
|
763
674
|
};
|
|
764
675
|
var RepeaterItem = ({
|
|
@@ -774,46 +685,46 @@ var RepeaterItem = ({
|
|
|
774
685
|
const popupId = `repeater-popup-${bind}`;
|
|
775
686
|
const controlRef = (0, import_react7.useRef)(null);
|
|
776
687
|
const [anchorEl, setAnchorEl] = (0, import_react7.useState)(null);
|
|
777
|
-
const popoverState = (0,
|
|
778
|
-
const popoverProps = (0,
|
|
779
|
-
return /* @__PURE__ */
|
|
780
|
-
|
|
688
|
+
const popoverState = (0, import_ui16.usePopupState)({ popupId, variant: "popover" });
|
|
689
|
+
const popoverProps = (0, import_ui16.bindPopover)(popoverState);
|
|
690
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
691
|
+
import_ui16.UnstableTag,
|
|
781
692
|
{
|
|
782
693
|
label,
|
|
783
694
|
showActionsOnHover: true,
|
|
784
695
|
ref: controlRef,
|
|
785
696
|
variant: "outlined",
|
|
786
697
|
"aria-label": (0, import_i18n4.__)("Open item", "elementor"),
|
|
787
|
-
...(0,
|
|
698
|
+
...(0, import_ui16.bindTrigger)(popoverState),
|
|
788
699
|
startIcon,
|
|
789
|
-
actions: /* @__PURE__ */
|
|
790
|
-
|
|
700
|
+
actions: /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
701
|
+
import_ui16.IconButton,
|
|
791
702
|
{
|
|
792
703
|
size: SIZE,
|
|
793
704
|
onClick: duplicateItem,
|
|
794
705
|
"aria-label": (0, import_i18n4.__)("Duplicate item", "elementor")
|
|
795
706
|
},
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
), /* @__PURE__ */
|
|
798
|
-
|
|
707
|
+
/* @__PURE__ */ React20.createElement(import_icons2.CopyIcon, { fontSize: SIZE })
|
|
708
|
+
), /* @__PURE__ */ React20.createElement(
|
|
709
|
+
import_ui16.IconButton,
|
|
799
710
|
{
|
|
800
711
|
size: SIZE,
|
|
801
712
|
onClick: toggleDisableItem,
|
|
802
713
|
"aria-label": disabled ? (0, import_i18n4.__)("Enable item", "elementor") : (0, import_i18n4.__)("Disable item", "elementor")
|
|
803
714
|
},
|
|
804
|
-
disabled ? /* @__PURE__ */
|
|
805
|
-
), /* @__PURE__ */
|
|
806
|
-
|
|
715
|
+
disabled ? /* @__PURE__ */ React20.createElement(import_icons2.EyeOffIcon, { fontSize: SIZE }) : /* @__PURE__ */ React20.createElement(import_icons2.EyeIcon, { fontSize: SIZE })
|
|
716
|
+
), /* @__PURE__ */ React20.createElement(
|
|
717
|
+
import_ui16.IconButton,
|
|
807
718
|
{
|
|
808
719
|
size: SIZE,
|
|
809
720
|
onClick: removeItem,
|
|
810
721
|
"aria-label": (0, import_i18n4.__)("Remove item", "elementor")
|
|
811
722
|
},
|
|
812
|
-
/* @__PURE__ */
|
|
723
|
+
/* @__PURE__ */ React20.createElement(import_icons2.XIcon, { fontSize: SIZE })
|
|
813
724
|
))
|
|
814
725
|
}
|
|
815
|
-
), /* @__PURE__ */
|
|
816
|
-
|
|
726
|
+
), /* @__PURE__ */ React20.createElement(
|
|
727
|
+
import_ui16.Popover,
|
|
817
728
|
{
|
|
818
729
|
disablePortal: true,
|
|
819
730
|
slotProps: {
|
|
@@ -825,14 +736,14 @@ var RepeaterItem = ({
|
|
|
825
736
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
826
737
|
...popoverProps
|
|
827
738
|
},
|
|
828
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ React20.createElement(import_ui16.Box, null, children({ anchorEl }))
|
|
829
740
|
));
|
|
830
741
|
};
|
|
831
742
|
|
|
832
743
|
// src/controls/box-shadow-repeater-control.tsx
|
|
833
744
|
var BoxShadowRepeaterControl = createControl(() => {
|
|
834
745
|
const { propType, value, setValue } = useBoundProp(import_editor_props9.boxShadowPropTypeUtil);
|
|
835
|
-
return /* @__PURE__ */
|
|
746
|
+
return /* @__PURE__ */ React21.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React21.createElement(
|
|
836
747
|
Repeater,
|
|
837
748
|
{
|
|
838
749
|
values: value ?? [],
|
|
@@ -847,13 +758,13 @@ var BoxShadowRepeaterControl = createControl(() => {
|
|
|
847
758
|
}
|
|
848
759
|
));
|
|
849
760
|
});
|
|
850
|
-
var ItemIcon = ({ value }) => /* @__PURE__ */
|
|
761
|
+
var ItemIcon = ({ value }) => /* @__PURE__ */ React21.createElement(import_ui17.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value.color.value });
|
|
851
762
|
var ItemContent = ({ anchorEl, bind }) => {
|
|
852
|
-
return /* @__PURE__ */
|
|
763
|
+
return /* @__PURE__ */ React21.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React21.createElement(Content, { anchorEl }));
|
|
853
764
|
};
|
|
854
765
|
var Content = ({ anchorEl }) => {
|
|
855
766
|
const { propType, value, setValue } = useBoundProp(import_editor_props9.shadowPropTypeUtil);
|
|
856
|
-
return /* @__PURE__ */
|
|
767
|
+
return /* @__PURE__ */ React21.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React21.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React21.createElement(PopoverGridContainer, null, /* @__PURE__ */ React21.createElement(Control2, { bind: "color", label: (0, import_i18n5.__)("Color", "elementor") }, /* @__PURE__ */ React21.createElement(
|
|
857
768
|
ColorControl,
|
|
858
769
|
{
|
|
859
770
|
slotProps: {
|
|
@@ -870,7 +781,7 @@ var Content = ({ anchorEl }) => {
|
|
|
870
781
|
}
|
|
871
782
|
}
|
|
872
783
|
}
|
|
873
|
-
)), /* @__PURE__ */
|
|
784
|
+
)), /* @__PURE__ */ React21.createElement(Control2, { bind: "position", label: (0, import_i18n5.__)("Position", "elementor") }, /* @__PURE__ */ React21.createElement(
|
|
874
785
|
SelectControl,
|
|
875
786
|
{
|
|
876
787
|
options: [
|
|
@@ -878,9 +789,9 @@ var Content = ({ anchorEl }) => {
|
|
|
878
789
|
{ label: (0, import_i18n5.__)("Outset", "elementor"), value: null }
|
|
879
790
|
]
|
|
880
791
|
}
|
|
881
|
-
))), /* @__PURE__ */
|
|
792
|
+
))), /* @__PURE__ */ React21.createElement(PopoverGridContainer, null, /* @__PURE__ */ React21.createElement(Control2, { bind: "hOffset", label: (0, import_i18n5.__)("Horizontal", "elementor") }, /* @__PURE__ */ React21.createElement(SizeControl, null)), /* @__PURE__ */ React21.createElement(Control2, { bind: "vOffset", label: (0, import_i18n5.__)("Vertical", "elementor") }, /* @__PURE__ */ React21.createElement(SizeControl, null))), /* @__PURE__ */ React21.createElement(PopoverGridContainer, null, /* @__PURE__ */ React21.createElement(Control2, { bind: "blur", label: (0, import_i18n5.__)("Blur", "elementor") }, /* @__PURE__ */ React21.createElement(SizeControl, null)), /* @__PURE__ */ React21.createElement(Control2, { bind: "spread", label: (0, import_i18n5.__)("Spread", "elementor") }, /* @__PURE__ */ React21.createElement(SizeControl, null)))));
|
|
882
793
|
};
|
|
883
|
-
var Control2 = ({ label, bind, children }) => /* @__PURE__ */
|
|
794
|
+
var Control2 = ({ label, bind, children }) => /* @__PURE__ */ React21.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React21.createElement(import_ui17.Grid, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React21.createElement(import_ui17.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React21.createElement(import_ui17.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React21.createElement(import_ui17.Typography, { component: "label", variant: "caption", color: "text.secondary" }, label)), /* @__PURE__ */ React21.createElement(import_ui17.Grid, { item: true, xs: 12 }, children))));
|
|
884
795
|
var ItemLabel = ({ value }) => {
|
|
885
796
|
const { position, hOffset, vOffset, blur, spread } = value.value;
|
|
886
797
|
const { size: blurSize = "", unit: blurUnit = "" } = blur?.value || {};
|
|
@@ -894,7 +805,7 @@ var ItemLabel = ({ value }) => {
|
|
|
894
805
|
blurSize + blurUnit,
|
|
895
806
|
spreadSize + spreadUnit
|
|
896
807
|
].join(" ");
|
|
897
|
-
return /* @__PURE__ */
|
|
808
|
+
return /* @__PURE__ */ React21.createElement("span", { style: { textTransform: "capitalize" } }, positionLabel, ": ", sizes);
|
|
898
809
|
};
|
|
899
810
|
var initialShadow = {
|
|
900
811
|
$$type: "shadow",
|
|
@@ -924,13 +835,13 @@ var initialShadow = {
|
|
|
924
835
|
};
|
|
925
836
|
|
|
926
837
|
// src/controls/toggle-control.tsx
|
|
927
|
-
var
|
|
838
|
+
var React23 = __toESM(require("react"));
|
|
928
839
|
var import_editor_props10 = require("@elementor/editor-props");
|
|
929
840
|
|
|
930
841
|
// src/components/control-toggle-button-group.tsx
|
|
931
|
-
var
|
|
932
|
-
var
|
|
933
|
-
var StyledToggleButtonGroup = (0,
|
|
842
|
+
var React22 = __toESM(require("react"));
|
|
843
|
+
var import_ui18 = require("@elementor/ui");
|
|
844
|
+
var StyledToggleButtonGroup = (0, import_ui18.styled)(import_ui18.ToggleButtonGroup)`
|
|
934
845
|
${({ justify }) => `justify-content: ${justify};`}
|
|
935
846
|
`;
|
|
936
847
|
var ControlToggleButtonGroup = ({
|
|
@@ -942,11 +853,11 @@ var ControlToggleButtonGroup = ({
|
|
|
942
853
|
exclusive = false,
|
|
943
854
|
fullWidth = false
|
|
944
855
|
}) => {
|
|
945
|
-
const isRtl = "rtl" === (0,
|
|
856
|
+
const isRtl = "rtl" === (0, import_ui18.useTheme)().direction;
|
|
946
857
|
const handleChange = (_, newValue) => {
|
|
947
858
|
onChange(newValue);
|
|
948
859
|
};
|
|
949
|
-
return /* @__PURE__ */
|
|
860
|
+
return /* @__PURE__ */ React22.createElement(
|
|
950
861
|
StyledToggleButtonGroup,
|
|
951
862
|
{
|
|
952
863
|
justify,
|
|
@@ -958,8 +869,8 @@ var ControlToggleButtonGroup = ({
|
|
|
958
869
|
}
|
|
959
870
|
},
|
|
960
871
|
items.map(
|
|
961
|
-
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */
|
|
962
|
-
|
|
872
|
+
({ label, value: buttonValue, renderContent: Content3, showTooltip }) => showTooltip ? /* @__PURE__ */ React22.createElement(import_ui18.Tooltip, { key: buttonValue, title: label, disableFocusListener: true, placement: "top" }, /* @__PURE__ */ React22.createElement(import_ui18.ToggleButton, { value: buttonValue, "aria-label": label, size, fullWidth }, /* @__PURE__ */ React22.createElement(Content3, { size }))) : /* @__PURE__ */ React22.createElement(
|
|
873
|
+
import_ui18.ToggleButton,
|
|
963
874
|
{
|
|
964
875
|
key: buttonValue,
|
|
965
876
|
value: buttonValue,
|
|
@@ -967,7 +878,7 @@ var ControlToggleButtonGroup = ({
|
|
|
967
878
|
size,
|
|
968
879
|
fullWidth
|
|
969
880
|
},
|
|
970
|
-
/* @__PURE__ */
|
|
881
|
+
/* @__PURE__ */ React22.createElement(Content3, { size })
|
|
971
882
|
)
|
|
972
883
|
)
|
|
973
884
|
);
|
|
@@ -980,7 +891,7 @@ var ToggleControl = createControl(
|
|
|
980
891
|
const handleToggle = (option) => {
|
|
981
892
|
setValue(option);
|
|
982
893
|
};
|
|
983
|
-
return /* @__PURE__ */
|
|
894
|
+
return /* @__PURE__ */ React23.createElement(
|
|
984
895
|
ControlToggleButtonGroup,
|
|
985
896
|
{
|
|
986
897
|
items: options,
|
|
@@ -995,9 +906,9 @@ var ToggleControl = createControl(
|
|
|
995
906
|
);
|
|
996
907
|
|
|
997
908
|
// src/controls/number-control.tsx
|
|
998
|
-
var
|
|
909
|
+
var React24 = __toESM(require("react"));
|
|
999
910
|
var import_editor_props11 = require("@elementor/editor-props");
|
|
1000
|
-
var
|
|
911
|
+
var import_ui19 = require("@elementor/ui");
|
|
1001
912
|
var isEmptyOrNaN = (value) => value === null || value === void 0 || value === "" || Number.isNaN(Number(value));
|
|
1002
913
|
var NumberControl = createControl(
|
|
1003
914
|
({
|
|
@@ -1017,8 +928,8 @@ var NumberControl = createControl(
|
|
|
1017
928
|
const formattedValue = shouldForceInt ? +parseInt(eventValue) : Number(eventValue);
|
|
1018
929
|
setValue(Math.min(Math.max(formattedValue, min), max));
|
|
1019
930
|
};
|
|
1020
|
-
return /* @__PURE__ */
|
|
1021
|
-
|
|
931
|
+
return /* @__PURE__ */ React24.createElement(ControlActions, null, /* @__PURE__ */ React24.createElement(
|
|
932
|
+
import_ui19.TextField,
|
|
1022
933
|
{
|
|
1023
934
|
size: "tiny",
|
|
1024
935
|
type: "number",
|
|
@@ -1033,10 +944,10 @@ var NumberControl = createControl(
|
|
|
1033
944
|
);
|
|
1034
945
|
|
|
1035
946
|
// src/controls/equal-unequal-sizes-control.tsx
|
|
1036
|
-
var
|
|
947
|
+
var React25 = __toESM(require("react"));
|
|
1037
948
|
var import_react8 = require("react");
|
|
1038
949
|
var import_editor_props12 = require("@elementor/editor-props");
|
|
1039
|
-
var
|
|
950
|
+
var import_ui20 = require("@elementor/ui");
|
|
1040
951
|
var import_i18n6 = require("@wordpress/i18n");
|
|
1041
952
|
var isEqualSizes = (propValue, items) => {
|
|
1042
953
|
const values = Object.values(propValue);
|
|
@@ -1056,7 +967,7 @@ function EqualUnequalSizesControl({
|
|
|
1056
967
|
}) {
|
|
1057
968
|
const popupId = (0, import_react8.useId)();
|
|
1058
969
|
const controlRef = (0, import_react8.useRef)(null);
|
|
1059
|
-
const popupState = (0,
|
|
970
|
+
const popupState = (0, import_ui20.usePopupState)({ variant: "popover", popupId });
|
|
1060
971
|
const {
|
|
1061
972
|
propType: multiSizePropType,
|
|
1062
973
|
value: multiSizeValue,
|
|
@@ -1090,18 +1001,18 @@ function EqualUnequalSizesControl({
|
|
|
1090
1001
|
return splitEqualValue() ?? null;
|
|
1091
1002
|
};
|
|
1092
1003
|
const isMixed = !!multiSizeValue;
|
|
1093
|
-
return /* @__PURE__ */
|
|
1094
|
-
|
|
1004
|
+
return /* @__PURE__ */ React25.createElement(React25.Fragment, null, /* @__PURE__ */ React25.createElement(import_ui20.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap", ref: controlRef }, /* @__PURE__ */ React25.createElement(import_ui20.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React25.createElement(ControlLabel, null, label)), /* @__PURE__ */ React25.createElement(import_ui20.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React25.createElement(import_ui20.Stack, { direction: "row", alignItems: "center", gap: 1 }, /* @__PURE__ */ React25.createElement(SizeControl, { placeholder: isMixed ? (0, import_i18n6.__)("Mixed", "elementor") : void 0 }), /* @__PURE__ */ React25.createElement(
|
|
1005
|
+
import_ui20.ToggleButton,
|
|
1095
1006
|
{
|
|
1096
1007
|
size: "tiny",
|
|
1097
1008
|
value: "check",
|
|
1098
1009
|
sx: { marginLeft: "auto" },
|
|
1099
|
-
...(0,
|
|
1010
|
+
...(0, import_ui20.bindToggle)(popupState),
|
|
1100
1011
|
selected: popupState.isOpen
|
|
1101
1012
|
},
|
|
1102
1013
|
icon
|
|
1103
|
-
)))), /* @__PURE__ */
|
|
1104
|
-
|
|
1014
|
+
)))), /* @__PURE__ */ React25.createElement(
|
|
1015
|
+
import_ui20.Popover,
|
|
1105
1016
|
{
|
|
1106
1017
|
disablePortal: true,
|
|
1107
1018
|
disableScrollLock: true,
|
|
@@ -1113,21 +1024,21 @@ function EqualUnequalSizesControl({
|
|
|
1113
1024
|
vertical: "top",
|
|
1114
1025
|
horizontal: "right"
|
|
1115
1026
|
},
|
|
1116
|
-
...(0,
|
|
1027
|
+
...(0, import_ui20.bindPopover)(popupState),
|
|
1117
1028
|
slotProps: {
|
|
1118
|
-
paper: { sx: { mt: 0.5,
|
|
1029
|
+
paper: { sx: { mt: 0.5, width: controlRef.current?.getBoundingClientRect().width } }
|
|
1119
1030
|
}
|
|
1120
1031
|
},
|
|
1121
|
-
/* @__PURE__ */
|
|
1032
|
+
/* @__PURE__ */ React25.createElement(PropProvider, { propType: multiSizePropType, value: getMultiSizeValues(), setValue: setNestedProp }, /* @__PURE__ */ React25.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React25.createElement(PopoverGridContainer, null, /* @__PURE__ */ React25.createElement(MultiSizeValueControl, { item: items[0] }), /* @__PURE__ */ React25.createElement(MultiSizeValueControl, { item: items[1] })), /* @__PURE__ */ React25.createElement(PopoverGridContainer, null, /* @__PURE__ */ React25.createElement(MultiSizeValueControl, { item: items[3] }), /* @__PURE__ */ React25.createElement(MultiSizeValueControl, { item: items[2] }))))
|
|
1122
1033
|
));
|
|
1123
1034
|
}
|
|
1124
|
-
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */
|
|
1035
|
+
var MultiSizeValueControl = ({ item }) => /* @__PURE__ */ React25.createElement(PropKeyProvider, { bind: item.bind }, /* @__PURE__ */ React25.createElement(import_ui20.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React25.createElement(import_ui20.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React25.createElement(import_ui20.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React25.createElement(ControlLabel, null, item.label)), /* @__PURE__ */ React25.createElement(import_ui20.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React25.createElement(SizeControl, { startIcon: item.icon })))));
|
|
1125
1036
|
|
|
1126
1037
|
// src/controls/linked-dimensions-control.tsx
|
|
1127
|
-
var
|
|
1038
|
+
var React26 = __toESM(require("react"));
|
|
1128
1039
|
var import_editor_props13 = require("@elementor/editor-props");
|
|
1129
|
-
var
|
|
1130
|
-
var
|
|
1040
|
+
var import_icons3 = require("@elementor/icons");
|
|
1041
|
+
var import_ui21 = require("@elementor/ui");
|
|
1131
1042
|
var import_i18n7 = require("@wordpress/i18n");
|
|
1132
1043
|
var LinkedDimensionsControl = createControl(({ label }) => {
|
|
1133
1044
|
const { value: dimensionsValue, setValue: setDimensionsValue, propType } = useBoundProp(import_editor_props13.dimensionsPropTypeUtil);
|
|
@@ -1146,61 +1057,61 @@ var LinkedDimensionsControl = createControl(({ label }) => {
|
|
|
1146
1057
|
left: value
|
|
1147
1058
|
});
|
|
1148
1059
|
};
|
|
1149
|
-
const LinkedIcon = isLinked ?
|
|
1150
|
-
return /* @__PURE__ */
|
|
1151
|
-
|
|
1060
|
+
const LinkedIcon = isLinked ? import_icons3.LinkIcon : import_icons3.DetachIcon;
|
|
1061
|
+
return /* @__PURE__ */ React26.createElement(PropProvider, { propType, value: dimensionsValue, setValue: setDimensionsValue }, /* @__PURE__ */ React26.createElement(import_ui21.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React26.createElement(ControlLabel, null, label), /* @__PURE__ */ React26.createElement(
|
|
1062
|
+
import_ui21.ToggleButton,
|
|
1152
1063
|
{
|
|
1153
|
-
"aria-label": (0, import_i18n7.__)("Link
|
|
1064
|
+
"aria-label": (0, import_i18n7.__)("Link inputs", "elementor"),
|
|
1154
1065
|
size: "tiny",
|
|
1155
1066
|
value: "check",
|
|
1156
1067
|
selected: isLinked,
|
|
1157
1068
|
sx: { marginLeft: "auto" },
|
|
1158
1069
|
onChange: onLinkToggle
|
|
1159
1070
|
},
|
|
1160
|
-
/* @__PURE__ */
|
|
1161
|
-
)), /* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ React26.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1072
|
+
)), /* @__PURE__ */ React26.createElement(import_ui21.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, (0, import_i18n7.__)("Top", "elementor"))), /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(
|
|
1162
1073
|
Control3,
|
|
1163
1074
|
{
|
|
1164
1075
|
bind: "top",
|
|
1165
|
-
startIcon: /* @__PURE__ */
|
|
1076
|
+
startIcon: /* @__PURE__ */ React26.createElement(import_icons3.SideTopIcon, { fontSize: "tiny" }),
|
|
1166
1077
|
isLinked
|
|
1167
1078
|
}
|
|
1168
|
-
))), /* @__PURE__ */
|
|
1079
|
+
))), /* @__PURE__ */ React26.createElement(import_ui21.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, (0, import_i18n7.__)("Right", "elementor"))), /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(
|
|
1169
1080
|
Control3,
|
|
1170
1081
|
{
|
|
1171
1082
|
bind: "right",
|
|
1172
|
-
startIcon: /* @__PURE__ */
|
|
1083
|
+
startIcon: /* @__PURE__ */ React26.createElement(import_icons3.SideRightIcon, { fontSize: "tiny" }),
|
|
1173
1084
|
isLinked
|
|
1174
1085
|
}
|
|
1175
|
-
)))), /* @__PURE__ */
|
|
1086
|
+
)))), /* @__PURE__ */ React26.createElement(import_ui21.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, (0, import_i18n7.__)("Bottom", "elementor"))), /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(
|
|
1176
1087
|
Control3,
|
|
1177
1088
|
{
|
|
1178
1089
|
bind: "bottom",
|
|
1179
|
-
startIcon: /* @__PURE__ */
|
|
1090
|
+
startIcon: /* @__PURE__ */ React26.createElement(import_icons3.SideBottomIcon, { fontSize: "tiny" }),
|
|
1180
1091
|
isLinked
|
|
1181
1092
|
}
|
|
1182
|
-
))), /* @__PURE__ */
|
|
1093
|
+
))), /* @__PURE__ */ React26.createElement(import_ui21.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(ControlLabel, null, (0, import_i18n7.__)("Left", "elementor"))), /* @__PURE__ */ React26.createElement(import_ui21.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React26.createElement(
|
|
1183
1094
|
Control3,
|
|
1184
1095
|
{
|
|
1185
1096
|
bind: "left",
|
|
1186
|
-
startIcon: /* @__PURE__ */
|
|
1097
|
+
startIcon: /* @__PURE__ */ React26.createElement(import_icons3.SideLeftIcon, { fontSize: "tiny" }),
|
|
1187
1098
|
isLinked
|
|
1188
1099
|
}
|
|
1189
1100
|
)))));
|
|
1190
1101
|
});
|
|
1191
1102
|
var Control3 = ({ bind, startIcon, isLinked }) => {
|
|
1192
1103
|
if (isLinked) {
|
|
1193
|
-
return /* @__PURE__ */
|
|
1104
|
+
return /* @__PURE__ */ React26.createElement(SizeControl, { startIcon });
|
|
1194
1105
|
}
|
|
1195
|
-
return /* @__PURE__ */
|
|
1106
|
+
return /* @__PURE__ */ React26.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React26.createElement(SizeControl, { startIcon }));
|
|
1196
1107
|
};
|
|
1197
1108
|
|
|
1198
1109
|
// src/controls/font-family-control.tsx
|
|
1199
1110
|
var import_react9 = require("react");
|
|
1200
|
-
var
|
|
1111
|
+
var React27 = __toESM(require("react"));
|
|
1201
1112
|
var import_editor_props14 = require("@elementor/editor-props");
|
|
1202
|
-
var
|
|
1203
|
-
var
|
|
1113
|
+
var import_icons4 = require("@elementor/icons");
|
|
1114
|
+
var import_ui22 = require("@elementor/ui");
|
|
1204
1115
|
var import_i18n9 = require("@wordpress/i18n");
|
|
1205
1116
|
|
|
1206
1117
|
// src/hooks/use-filtered-font-families.ts
|
|
@@ -1239,7 +1150,7 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1239
1150
|
const [searchValue, setSearchValue] = (0, import_react9.useState)("");
|
|
1240
1151
|
const { value: fontFamily, setValue: setFontFamily } = useBoundProp(import_editor_props14.stringPropTypeUtil);
|
|
1241
1152
|
const popupId = (0, import_react9.useId)();
|
|
1242
|
-
const popoverState = (0,
|
|
1153
|
+
const popoverState = (0, import_ui22.usePopupState)({ variant: "popover", popupId });
|
|
1243
1154
|
const filteredFontFamilies = useFilteredFontFamilies(fontFamilies, searchValue);
|
|
1244
1155
|
if (!filteredFontFamilies) {
|
|
1245
1156
|
return null;
|
|
@@ -1251,26 +1162,26 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1251
1162
|
setSearchValue("");
|
|
1252
1163
|
popoverState.close();
|
|
1253
1164
|
};
|
|
1254
|
-
return /* @__PURE__ */
|
|
1255
|
-
|
|
1165
|
+
return /* @__PURE__ */ React27.createElement(React27.Fragment, null, /* @__PURE__ */ React27.createElement(
|
|
1166
|
+
import_ui22.UnstableTag,
|
|
1256
1167
|
{
|
|
1257
1168
|
variant: "outlined",
|
|
1258
1169
|
label: fontFamily,
|
|
1259
|
-
endIcon: /* @__PURE__ */
|
|
1260
|
-
...(0,
|
|
1170
|
+
endIcon: /* @__PURE__ */ React27.createElement(import_icons4.ChevronDownIcon, { fontSize: "tiny" }),
|
|
1171
|
+
...(0, import_ui22.bindTrigger)(popoverState),
|
|
1261
1172
|
fullWidth: true
|
|
1262
1173
|
}
|
|
1263
|
-
), /* @__PURE__ */
|
|
1264
|
-
|
|
1174
|
+
), /* @__PURE__ */ React27.createElement(
|
|
1175
|
+
import_ui22.Popover,
|
|
1265
1176
|
{
|
|
1266
1177
|
disablePortal: true,
|
|
1267
1178
|
disableScrollLock: true,
|
|
1268
1179
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
1269
|
-
...(0,
|
|
1180
|
+
...(0, import_ui22.bindPopover)(popoverState),
|
|
1270
1181
|
onClose: handleClose
|
|
1271
1182
|
},
|
|
1272
|
-
/* @__PURE__ */
|
|
1273
|
-
|
|
1183
|
+
/* @__PURE__ */ React27.createElement(import_ui22.Stack, null, /* @__PURE__ */ React27.createElement(import_ui22.Stack, { direction: "row", alignItems: "center", pl: 1.5, pr: 0.5, py: 1.5 }, /* @__PURE__ */ React27.createElement(import_icons4.EditIcon, { fontSize: SIZE2, sx: { mr: 0.5 } }), /* @__PURE__ */ React27.createElement(import_ui22.Typography, { variant: "subtitle2" }, (0, import_i18n9.__)("Font Family", "elementor")), /* @__PURE__ */ React27.createElement(import_ui22.IconButton, { size: SIZE2, sx: { ml: "auto" }, onClick: handleClose }, /* @__PURE__ */ React27.createElement(import_icons4.XIcon, { fontSize: SIZE2 }))), /* @__PURE__ */ React27.createElement(import_ui22.Box, { px: 1.5, pb: 1 }, /* @__PURE__ */ React27.createElement(
|
|
1184
|
+
import_ui22.TextField,
|
|
1274
1185
|
{
|
|
1275
1186
|
fullWidth: true,
|
|
1276
1187
|
size: SIZE2,
|
|
@@ -1278,13 +1189,19 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1278
1189
|
placeholder: (0, import_i18n9.__)("Search", "elementor"),
|
|
1279
1190
|
onChange: handleSearch,
|
|
1280
1191
|
InputProps: {
|
|
1281
|
-
startAdornment: /* @__PURE__ */
|
|
1192
|
+
startAdornment: /* @__PURE__ */ React27.createElement(import_ui22.InputAdornment, { position: "start" }, /* @__PURE__ */ React27.createElement(import_icons4.SearchIcon, { fontSize: SIZE2 }))
|
|
1282
1193
|
}
|
|
1283
1194
|
}
|
|
1284
|
-
)), /* @__PURE__ */
|
|
1195
|
+
)), /* @__PURE__ */ React27.createElement(import_ui22.Divider, null), /* @__PURE__ */ React27.createElement(import_ui22.Box, { sx: { overflowY: "auto", height: 260, width: 220 } }, filteredFontFamilies.length > 0 ? /* @__PURE__ */ React27.createElement(import_ui22.MenuList, { role: "listbox", tabIndex: 0 }, filteredFontFamilies.map(([category, items], index) => /* @__PURE__ */ React27.createElement(import_react9.Fragment, { key: index }, /* @__PURE__ */ React27.createElement(
|
|
1196
|
+
import_ui22.ListSubheader,
|
|
1197
|
+
{
|
|
1198
|
+
sx: { px: 1.5, typography: "caption", color: "text.tertiary" }
|
|
1199
|
+
},
|
|
1200
|
+
category
|
|
1201
|
+
), items.map((item) => {
|
|
1285
1202
|
const isSelected = item === fontFamily;
|
|
1286
|
-
return /* @__PURE__ */
|
|
1287
|
-
|
|
1203
|
+
return /* @__PURE__ */ React27.createElement(
|
|
1204
|
+
import_ui22.MenuItem,
|
|
1288
1205
|
{
|
|
1289
1206
|
key: item,
|
|
1290
1207
|
selected: isSelected,
|
|
@@ -1293,13 +1210,13 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1293
1210
|
setFontFamily(item);
|
|
1294
1211
|
handleClose();
|
|
1295
1212
|
},
|
|
1296
|
-
sx: { typography: "caption" },
|
|
1213
|
+
sx: { px: 1.5, typography: "caption" },
|
|
1297
1214
|
style: { fontFamily: item }
|
|
1298
1215
|
},
|
|
1299
1216
|
item
|
|
1300
1217
|
);
|
|
1301
|
-
})))) : /* @__PURE__ */
|
|
1302
|
-
|
|
1218
|
+
})))) : /* @__PURE__ */ React27.createElement(import_ui22.Stack, { alignItems: "center", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React27.createElement(import_icons4.PhotoIcon, { fontSize: "large" }), /* @__PURE__ */ React27.createElement(import_ui22.Typography, { align: "center", variant: "caption", color: "text.secondary" }, (0, import_i18n9.__)("Sorry, nothing matched", "elementor"), /* @__PURE__ */ React27.createElement("br", null), "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React27.createElement(import_ui22.Typography, { align: "center", variant: "caption", color: "text.secondary" }, /* @__PURE__ */ React27.createElement(
|
|
1219
|
+
import_ui22.Link,
|
|
1303
1220
|
{
|
|
1304
1221
|
color: "secondary",
|
|
1305
1222
|
variant: "caption",
|
|
@@ -1312,14 +1229,14 @@ var FontFamilyControl = createControl(({ fontFamilies }) => {
|
|
|
1312
1229
|
});
|
|
1313
1230
|
|
|
1314
1231
|
// src/controls/url-control.tsx
|
|
1315
|
-
var
|
|
1232
|
+
var React28 = __toESM(require("react"));
|
|
1316
1233
|
var import_editor_props15 = require("@elementor/editor-props");
|
|
1317
|
-
var
|
|
1234
|
+
var import_ui23 = require("@elementor/ui");
|
|
1318
1235
|
var UrlControl = createControl(({ placeholder }) => {
|
|
1319
1236
|
const { value, setValue } = useBoundProp(import_editor_props15.urlPropTypeUtil);
|
|
1320
1237
|
const handleChange = (event) => setValue(event.target.value);
|
|
1321
|
-
return /* @__PURE__ */
|
|
1322
|
-
|
|
1238
|
+
return /* @__PURE__ */ React28.createElement(ControlActions, null, /* @__PURE__ */ React28.createElement(
|
|
1239
|
+
import_ui23.TextField,
|
|
1323
1240
|
{
|
|
1324
1241
|
size: "tiny",
|
|
1325
1242
|
fullWidth: true,
|
|
@@ -1331,50 +1248,156 @@ var UrlControl = createControl(({ placeholder }) => {
|
|
|
1331
1248
|
});
|
|
1332
1249
|
|
|
1333
1250
|
// src/controls/link-control.tsx
|
|
1334
|
-
var
|
|
1335
|
-
var
|
|
1251
|
+
var React30 = __toESM(require("react"));
|
|
1252
|
+
var import_react11 = require("react");
|
|
1336
1253
|
var import_editor_props16 = require("@elementor/editor-props");
|
|
1337
1254
|
var import_http = require("@elementor/http");
|
|
1338
1255
|
var import_icons6 = require("@elementor/icons");
|
|
1339
1256
|
var import_session = require("@elementor/session");
|
|
1340
|
-
var
|
|
1257
|
+
var import_ui25 = require("@elementor/ui");
|
|
1341
1258
|
var import_i18n10 = require("@wordpress/i18n");
|
|
1259
|
+
|
|
1260
|
+
// src/components/autocomplete.tsx
|
|
1261
|
+
var React29 = __toESM(require("react"));
|
|
1262
|
+
var import_react10 = require("react");
|
|
1263
|
+
var import_icons5 = require("@elementor/icons");
|
|
1264
|
+
var import_ui24 = require("@elementor/ui");
|
|
1265
|
+
var Autocomplete = (0, import_react10.forwardRef)((props, ref) => {
|
|
1266
|
+
const {
|
|
1267
|
+
options,
|
|
1268
|
+
onOptionChange,
|
|
1269
|
+
onTextChange,
|
|
1270
|
+
allowCustomValues = false,
|
|
1271
|
+
placeholder = "",
|
|
1272
|
+
minInputLength = 2,
|
|
1273
|
+
value = "",
|
|
1274
|
+
...restProps
|
|
1275
|
+
} = props;
|
|
1276
|
+
const optionKeys = _factoryFilter(value, options, minInputLength).map(({ id }) => id);
|
|
1277
|
+
const allowClear = !!value;
|
|
1278
|
+
const muiWarningPreventer = allowCustomValues || !!value?.toString()?.length;
|
|
1279
|
+
const isOptionEqualToValue = muiWarningPreventer ? void 0 : () => true;
|
|
1280
|
+
const isValueFromOptions = typeof value === "number" && !!findMatchingOption(options, value);
|
|
1281
|
+
return /* @__PURE__ */ React29.createElement(
|
|
1282
|
+
import_ui24.Autocomplete,
|
|
1283
|
+
{
|
|
1284
|
+
...restProps,
|
|
1285
|
+
ref,
|
|
1286
|
+
forcePopupIcon: false,
|
|
1287
|
+
disableClearable: true,
|
|
1288
|
+
freeSolo: allowCustomValues,
|
|
1289
|
+
value: value?.toString() || "",
|
|
1290
|
+
size: "tiny",
|
|
1291
|
+
onChange: (_, newValue) => onOptionChange(Number(newValue)),
|
|
1292
|
+
readOnly: isValueFromOptions,
|
|
1293
|
+
options: optionKeys,
|
|
1294
|
+
getOptionKey: (optionId) => findMatchingOption(options, optionId)?.id || optionId,
|
|
1295
|
+
getOptionLabel: (optionId) => findMatchingOption(options, optionId)?.label || optionId.toString(),
|
|
1296
|
+
groupBy: isCategorizedOptionPool(options) ? (optionId) => findMatchingOption(options, optionId)?.groupLabel || optionId : void 0,
|
|
1297
|
+
isOptionEqualToValue,
|
|
1298
|
+
filterOptions: () => optionKeys,
|
|
1299
|
+
renderOption: (optionProps, optionId) => /* @__PURE__ */ React29.createElement(import_ui24.Box, { component: "li", ...optionProps, key: optionProps.id }, findMatchingOption(options, optionId)?.label ?? optionId),
|
|
1300
|
+
renderInput: (params) => /* @__PURE__ */ React29.createElement(
|
|
1301
|
+
TextInput,
|
|
1302
|
+
{
|
|
1303
|
+
params,
|
|
1304
|
+
handleChange: (newValue) => onTextChange?.(newValue),
|
|
1305
|
+
allowClear,
|
|
1306
|
+
placeholder,
|
|
1307
|
+
hasSelectedValue: isValueFromOptions
|
|
1308
|
+
}
|
|
1309
|
+
)
|
|
1310
|
+
}
|
|
1311
|
+
);
|
|
1312
|
+
});
|
|
1313
|
+
var TextInput = ({
|
|
1314
|
+
params,
|
|
1315
|
+
allowClear,
|
|
1316
|
+
placeholder,
|
|
1317
|
+
handleChange,
|
|
1318
|
+
hasSelectedValue
|
|
1319
|
+
}) => {
|
|
1320
|
+
const onChange = (event) => {
|
|
1321
|
+
handleChange(event.target.value);
|
|
1322
|
+
};
|
|
1323
|
+
return /* @__PURE__ */ React29.createElement(
|
|
1324
|
+
import_ui24.TextField,
|
|
1325
|
+
{
|
|
1326
|
+
...params,
|
|
1327
|
+
placeholder,
|
|
1328
|
+
onChange,
|
|
1329
|
+
sx: {
|
|
1330
|
+
"& .MuiInputBase-input": {
|
|
1331
|
+
cursor: hasSelectedValue ? "default" : void 0
|
|
1332
|
+
}
|
|
1333
|
+
},
|
|
1334
|
+
InputProps: {
|
|
1335
|
+
...params.InputProps,
|
|
1336
|
+
endAdornment: /* @__PURE__ */ React29.createElement(ClearButton, { params, allowClear, handleChange })
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
);
|
|
1340
|
+
};
|
|
1341
|
+
var ClearButton = ({
|
|
1342
|
+
allowClear,
|
|
1343
|
+
handleChange,
|
|
1344
|
+
params
|
|
1345
|
+
}) => /* @__PURE__ */ React29.createElement(import_ui24.InputAdornment, { position: "end" }, allowClear && /* @__PURE__ */ React29.createElement(import_ui24.IconButton, { size: params.size, onClick: () => handleChange(null), sx: { cursor: "pointer" } }, /* @__PURE__ */ React29.createElement(import_icons5.XIcon, { fontSize: params.size })));
|
|
1346
|
+
function findMatchingOption(options, optionId = null) {
|
|
1347
|
+
const formattedOption = (optionId || "").toString();
|
|
1348
|
+
return options.find(({ id }) => formattedOption === id.toString());
|
|
1349
|
+
}
|
|
1350
|
+
function isCategorizedOptionPool(options) {
|
|
1351
|
+
return options.every((option) => "groupLabel" in option);
|
|
1352
|
+
}
|
|
1353
|
+
function _factoryFilter(newValue, options, minInputLength) {
|
|
1354
|
+
if (null === newValue) {
|
|
1355
|
+
return options;
|
|
1356
|
+
}
|
|
1357
|
+
const formattedValue = String(newValue || "")?.toLowerCase();
|
|
1358
|
+
if (formattedValue.length < minInputLength) {
|
|
1359
|
+
return new Array(0);
|
|
1360
|
+
}
|
|
1361
|
+
return options.filter(
|
|
1362
|
+
(option) => String(option.id).toLowerCase().includes(formattedValue) || option.label.toLowerCase().includes(formattedValue)
|
|
1363
|
+
);
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
// src/controls/link-control.tsx
|
|
1342
1367
|
var SIZE3 = "tiny";
|
|
1343
1368
|
var LinkControl = createControl((props) => {
|
|
1344
1369
|
const { value, path, setValue, ...propContext } = useBoundProp(import_editor_props16.linkPropTypeUtil);
|
|
1345
1370
|
const [linkSessionValue, setLinkSessionValue] = (0, import_session.useSessionStorage)(path.join("/"));
|
|
1371
|
+
const [isEnabled, setIsEnabled] = (0, import_react11.useState)(!!value);
|
|
1346
1372
|
const {
|
|
1347
1373
|
allowCustomValues,
|
|
1348
1374
|
queryOptions: { endpoint = "", requestParams = {} },
|
|
1349
1375
|
placeholder,
|
|
1350
1376
|
minInputLength = 2
|
|
1351
1377
|
} = props || {};
|
|
1352
|
-
const [options, setOptions] = (0,
|
|
1378
|
+
const [options, setOptions] = (0, import_react11.useState)(
|
|
1353
1379
|
generateFirstLoadedOption(value)
|
|
1354
1380
|
);
|
|
1355
1381
|
const onEnabledChange = () => {
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
setValue(isEnabled ? null : linkSessionValue?.value ?? { destination: null });
|
|
1382
|
+
setIsEnabled((prevState) => !prevState);
|
|
1383
|
+
setValue(isEnabled ? null : linkSessionValue?.value ?? null);
|
|
1359
1384
|
setLinkSessionValue({ value, meta: { isEnabled: !isEnabled } });
|
|
1360
1385
|
};
|
|
1361
1386
|
const onOptionChange = (newValue) => {
|
|
1362
|
-
const valueToSave = {
|
|
1387
|
+
const valueToSave = newValue ? {
|
|
1363
1388
|
...value,
|
|
1364
|
-
destination:
|
|
1365
|
-
label:
|
|
1366
|
-
|
|
1367
|
-
value: findMatchingOption(options, newValue?.toString())?.label || ""
|
|
1368
|
-
}
|
|
1369
|
-
};
|
|
1389
|
+
destination: import_editor_props16.numberPropTypeUtil.create(newValue),
|
|
1390
|
+
label: import_editor_props16.stringPropTypeUtil.create(findMatchingOption(options, newValue)?.label || null)
|
|
1391
|
+
} : null;
|
|
1370
1392
|
onSaveNewValue(valueToSave);
|
|
1371
1393
|
};
|
|
1372
1394
|
const onTextChange = (newValue) => {
|
|
1373
|
-
|
|
1395
|
+
newValue = newValue?.trim() || "";
|
|
1396
|
+
const valueToSave = newValue ? {
|
|
1374
1397
|
...value,
|
|
1375
|
-
destination:
|
|
1398
|
+
destination: import_editor_props16.urlPropTypeUtil.create(newValue),
|
|
1376
1399
|
label: null
|
|
1377
|
-
};
|
|
1400
|
+
} : null;
|
|
1378
1401
|
onSaveNewValue(valueToSave);
|
|
1379
1402
|
updateOptions(newValue);
|
|
1380
1403
|
};
|
|
@@ -1387,16 +1410,19 @@ var LinkControl = createControl((props) => {
|
|
|
1387
1410
|
if (!newValue || !endpoint || newValue.length < minInputLength) {
|
|
1388
1411
|
return;
|
|
1389
1412
|
}
|
|
1390
|
-
debounceFetch(newValue)
|
|
1413
|
+
debounceFetch({ ...requestParams, term: newValue });
|
|
1391
1414
|
};
|
|
1392
|
-
const debounceFetch = (
|
|
1393
|
-
() =>
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1415
|
+
const debounceFetch = (0, import_react11.useMemo)(
|
|
1416
|
+
() => debounce(
|
|
1417
|
+
(params) => fetchOptions(endpoint, params).then((newOptions) => {
|
|
1418
|
+
setOptions(formatOptions(newOptions));
|
|
1419
|
+
}),
|
|
1420
|
+
400
|
|
1421
|
+
),
|
|
1422
|
+
[endpoint]
|
|
1397
1423
|
);
|
|
1398
|
-
return /* @__PURE__ */
|
|
1399
|
-
|
|
1424
|
+
return /* @__PURE__ */ React30.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React30.createElement(import_ui25.Stack, { gap: 1.5 }, /* @__PURE__ */ React30.createElement(import_ui25.Divider, null), /* @__PURE__ */ React30.createElement(
|
|
1425
|
+
import_ui25.Stack,
|
|
1400
1426
|
{
|
|
1401
1427
|
direction: "row",
|
|
1402
1428
|
sx: {
|
|
@@ -1404,38 +1430,37 @@ var LinkControl = createControl((props) => {
|
|
|
1404
1430
|
alignItems: "center"
|
|
1405
1431
|
}
|
|
1406
1432
|
},
|
|
1407
|
-
/* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1433
|
+
/* @__PURE__ */ React30.createElement(ControlLabel, null, (0, import_i18n10.__)("Link", "elementor")),
|
|
1434
|
+
/* @__PURE__ */ React30.createElement(
|
|
1409
1435
|
ToggleIconControl,
|
|
1410
1436
|
{
|
|
1411
|
-
enabled:
|
|
1437
|
+
enabled: isEnabled,
|
|
1412
1438
|
onIconClick: onEnabledChange,
|
|
1413
|
-
label: (0, import_i18n10.__)("Toggle
|
|
1439
|
+
label: (0, import_i18n10.__)("Toggle link", "elementor")
|
|
1414
1440
|
}
|
|
1415
1441
|
)
|
|
1416
|
-
), /* @__PURE__ */
|
|
1417
|
-
|
|
1442
|
+
), /* @__PURE__ */ React30.createElement(import_ui25.Collapse, { in: isEnabled, timeout: "auto", unmountOnExit: true }, /* @__PURE__ */ React30.createElement(import_ui25.Stack, { gap: 1.5 }, /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind: "destination" }, /* @__PURE__ */ React30.createElement(ControlActions, null, /* @__PURE__ */ React30.createElement(
|
|
1443
|
+
Autocomplete,
|
|
1418
1444
|
{
|
|
1419
1445
|
options,
|
|
1420
1446
|
allowCustomValues,
|
|
1421
1447
|
placeholder,
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
minInputLength
|
|
1426
|
-
customValue: value?.destination?.value?.toString()
|
|
1448
|
+
value: value?.destination?.value,
|
|
1449
|
+
onOptionChange,
|
|
1450
|
+
onTextChange,
|
|
1451
|
+
minInputLength
|
|
1427
1452
|
}
|
|
1428
|
-
)), /* @__PURE__ */
|
|
1453
|
+
))), /* @__PURE__ */ React30.createElement(PropKeyProvider, { bind: "isTargetBlank" }, /* @__PURE__ */ React30.createElement(SwitchControl, null))))));
|
|
1429
1454
|
});
|
|
1430
1455
|
var ToggleIconControl = ({ enabled, onIconClick, label }) => {
|
|
1431
|
-
return /* @__PURE__ */
|
|
1456
|
+
return /* @__PURE__ */ React30.createElement(import_ui25.IconButton, { size: SIZE3, onClick: onIconClick, "aria-label": label }, enabled ? /* @__PURE__ */ React30.createElement(import_icons6.MinusIcon, { fontSize: SIZE3 }) : /* @__PURE__ */ React30.createElement(import_icons6.PlusIcon, { fontSize: SIZE3 }));
|
|
1432
1457
|
};
|
|
1433
1458
|
var SwitchControl = () => {
|
|
1434
1459
|
const { value = false, setValue } = useBoundProp(import_editor_props16.booleanPropTypeUtil);
|
|
1435
1460
|
const onClick = () => {
|
|
1436
1461
|
setValue(!value);
|
|
1437
1462
|
};
|
|
1438
|
-
return /* @__PURE__ */
|
|
1463
|
+
return /* @__PURE__ */ React30.createElement(import_ui25.Grid, { container: true, alignItems: "center", flexWrap: "nowrap", justifyContent: "space-between" }, /* @__PURE__ */ React30.createElement(import_ui25.Grid, { item: true }, /* @__PURE__ */ React30.createElement(ControlLabel, null, (0, import_i18n10.__)("Open in new tab", "elementor"))), /* @__PURE__ */ React30.createElement(import_ui25.Grid, { item: true }, /* @__PURE__ */ React30.createElement(import_ui25.Switch, { checked: value, onClick })));
|
|
1439
1464
|
};
|
|
1440
1465
|
async function fetchOptions(ajaxUrl, params) {
|
|
1441
1466
|
if (!params || !ajaxUrl) {
|
|
@@ -1476,10 +1501,10 @@ function debounce(fn, timeout) {
|
|
|
1476
1501
|
}
|
|
1477
1502
|
|
|
1478
1503
|
// src/controls/gap-control.tsx
|
|
1479
|
-
var
|
|
1504
|
+
var React31 = __toESM(require("react"));
|
|
1480
1505
|
var import_editor_props17 = require("@elementor/editor-props");
|
|
1481
1506
|
var import_icons7 = require("@elementor/icons");
|
|
1482
|
-
var
|
|
1507
|
+
var import_ui26 = require("@elementor/ui");
|
|
1483
1508
|
var import_i18n11 = require("@wordpress/i18n");
|
|
1484
1509
|
var GapControl = createControl(({ label }) => {
|
|
1485
1510
|
const {
|
|
@@ -1501,38 +1526,38 @@ var GapControl = createControl(({ label }) => {
|
|
|
1501
1526
|
});
|
|
1502
1527
|
};
|
|
1503
1528
|
const LinkedIcon = isLinked ? import_icons7.LinkIcon : import_icons7.DetachIcon;
|
|
1504
|
-
return /* @__PURE__ */
|
|
1505
|
-
|
|
1529
|
+
return /* @__PURE__ */ React31.createElement(PropProvider, { propType, value: directionValue, setValue: setDirectionValue }, /* @__PURE__ */ React31.createElement(import_ui26.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(ControlLabel, null, label), /* @__PURE__ */ React31.createElement(
|
|
1530
|
+
import_ui26.ToggleButton,
|
|
1506
1531
|
{
|
|
1507
|
-
"aria-label": (0, import_i18n11.__)("Link
|
|
1532
|
+
"aria-label": (0, import_i18n11.__)("Link inputs", "elementor"),
|
|
1508
1533
|
size: "tiny",
|
|
1509
1534
|
value: "check",
|
|
1510
1535
|
selected: isLinked,
|
|
1511
1536
|
sx: { marginLeft: "auto" },
|
|
1512
1537
|
onChange: onLinkToggle
|
|
1513
1538
|
},
|
|
1514
|
-
/* @__PURE__ */
|
|
1515
|
-
)), /* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ React31.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
1540
|
+
)), /* @__PURE__ */ React31.createElement(import_ui26.Stack, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React31.createElement(import_ui26.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(ControlLabel, null, (0, import_i18n11.__)("Column", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(Control4, { bind: "column", isLinked }))), /* @__PURE__ */ React31.createElement(import_ui26.Grid, { container: true, gap: 1, alignItems: "center" }, /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(ControlLabel, null, (0, import_i18n11.__)("Row", "elementor"))), /* @__PURE__ */ React31.createElement(import_ui26.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React31.createElement(Control4, { bind: "row", isLinked })))));
|
|
1516
1541
|
});
|
|
1517
1542
|
var Control4 = ({ bind, isLinked }) => {
|
|
1518
1543
|
if (isLinked) {
|
|
1519
|
-
return /* @__PURE__ */
|
|
1544
|
+
return /* @__PURE__ */ React31.createElement(SizeControl, null);
|
|
1520
1545
|
}
|
|
1521
|
-
return /* @__PURE__ */
|
|
1546
|
+
return /* @__PURE__ */ React31.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React31.createElement(SizeControl, null));
|
|
1522
1547
|
};
|
|
1523
1548
|
|
|
1524
1549
|
// src/controls/svg-media-control.tsx
|
|
1525
|
-
var
|
|
1550
|
+
var React32 = __toESM(require("react"));
|
|
1526
1551
|
var import_editor_props18 = require("@elementor/editor-props");
|
|
1527
1552
|
var import_icons8 = require("@elementor/icons");
|
|
1528
|
-
var
|
|
1553
|
+
var import_ui27 = require("@elementor/ui");
|
|
1529
1554
|
var import_wp_media2 = require("@elementor/wp-media");
|
|
1530
1555
|
var import_i18n12 = require("@wordpress/i18n");
|
|
1531
1556
|
var TILE_SIZE = 8;
|
|
1532
1557
|
var TILE_WHITE = "transparent";
|
|
1533
1558
|
var TILE_BLACK = "#c1c1c1";
|
|
1534
1559
|
var TILES_GRADIENT_FORMULA = `linear-gradient(45deg, ${TILE_BLACK} 25%, ${TILE_WHITE} 0, ${TILE_WHITE} 75%, ${TILE_BLACK} 0, ${TILE_BLACK})`;
|
|
1535
|
-
var StyledCard = (0,
|
|
1560
|
+
var StyledCard = (0, import_ui27.styled)(import_ui27.Card)`
|
|
1536
1561
|
background-color: white;
|
|
1537
1562
|
background-image: ${TILES_GRADIENT_FORMULA}, ${TILES_GRADIENT_FORMULA};
|
|
1538
1563
|
background-size: ${TILE_SIZE}px ${TILE_SIZE}px;
|
|
@@ -1541,7 +1566,7 @@ var StyledCard = (0, import_ui24.styled)(import_ui24.Card)`
|
|
|
1541
1566
|
${TILE_SIZE / 2}px ${TILE_SIZE / 2}px;
|
|
1542
1567
|
border: none;
|
|
1543
1568
|
`;
|
|
1544
|
-
var StyledCardMediaContainer = (0,
|
|
1569
|
+
var StyledCardMediaContainer = (0, import_ui27.styled)(import_ui27.Stack)`
|
|
1545
1570
|
position: relative;
|
|
1546
1571
|
height: 140px;
|
|
1547
1572
|
object-fit: contain;
|
|
@@ -1570,16 +1595,16 @@ var SvgMediaControl = createControl(() => {
|
|
|
1570
1595
|
});
|
|
1571
1596
|
}
|
|
1572
1597
|
});
|
|
1573
|
-
return /* @__PURE__ */
|
|
1574
|
-
|
|
1598
|
+
return /* @__PURE__ */ React32.createElement(import_ui27.Stack, { gap: 1 }, /* @__PURE__ */ React32.createElement(ControlLabel, null, " ", (0, import_i18n12.__)("Choose SVG", "elementor"), " "), /* @__PURE__ */ React32.createElement(ControlActions, null, /* @__PURE__ */ React32.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React32.createElement(StyledCardMediaContainer, null, isFetching ? /* @__PURE__ */ React32.createElement(import_ui27.CircularProgress, { role: "progressbar" }) : /* @__PURE__ */ React32.createElement(
|
|
1599
|
+
import_ui27.CardMedia,
|
|
1575
1600
|
{
|
|
1576
1601
|
component: "img",
|
|
1577
1602
|
image: src,
|
|
1578
1603
|
alt: (0, import_i18n12.__)("Preview SVG", "elementor"),
|
|
1579
1604
|
sx: { maxHeight: "140px", width: "50px" }
|
|
1580
1605
|
}
|
|
1581
|
-
)), /* @__PURE__ */
|
|
1582
|
-
|
|
1606
|
+
)), /* @__PURE__ */ React32.createElement(
|
|
1607
|
+
import_ui27.CardOverlay,
|
|
1583
1608
|
{
|
|
1584
1609
|
sx: {
|
|
1585
1610
|
"&:hover": {
|
|
@@ -1587,8 +1612,8 @@ var SvgMediaControl = createControl(() => {
|
|
|
1587
1612
|
}
|
|
1588
1613
|
}
|
|
1589
1614
|
},
|
|
1590
|
-
/* @__PURE__ */
|
|
1591
|
-
|
|
1615
|
+
/* @__PURE__ */ React32.createElement(import_ui27.Stack, { gap: 1 }, /* @__PURE__ */ React32.createElement(
|
|
1616
|
+
import_ui27.Button,
|
|
1592
1617
|
{
|
|
1593
1618
|
size: "tiny",
|
|
1594
1619
|
color: "inherit",
|
|
@@ -1596,13 +1621,13 @@ var SvgMediaControl = createControl(() => {
|
|
|
1596
1621
|
onClick: () => open({ mode: "browse" })
|
|
1597
1622
|
},
|
|
1598
1623
|
(0, import_i18n12.__)("Select SVG", "elementor")
|
|
1599
|
-
), /* @__PURE__ */
|
|
1600
|
-
|
|
1624
|
+
), /* @__PURE__ */ React32.createElement(
|
|
1625
|
+
import_ui27.Button,
|
|
1601
1626
|
{
|
|
1602
1627
|
size: "tiny",
|
|
1603
1628
|
variant: "text",
|
|
1604
1629
|
color: "inherit",
|
|
1605
|
-
startIcon: /* @__PURE__ */
|
|
1630
|
+
startIcon: /* @__PURE__ */ React32.createElement(import_icons8.UploadIcon, null),
|
|
1606
1631
|
onClick: () => open({ mode: "upload" })
|
|
1607
1632
|
},
|
|
1608
1633
|
(0, import_i18n12.__)("Upload SVG", "elementor")
|
|
@@ -1611,15 +1636,15 @@ var SvgMediaControl = createControl(() => {
|
|
|
1611
1636
|
});
|
|
1612
1637
|
|
|
1613
1638
|
// src/controls/background-control/background-control.tsx
|
|
1614
|
-
var
|
|
1639
|
+
var React38 = __toESM(require("react"));
|
|
1615
1640
|
var import_editor_props23 = require("@elementor/editor-props");
|
|
1616
|
-
var
|
|
1641
|
+
var import_ui34 = require("@elementor/ui");
|
|
1617
1642
|
var import_i18n18 = require("@wordpress/i18n");
|
|
1618
1643
|
|
|
1619
1644
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
1620
|
-
var
|
|
1645
|
+
var React37 = __toESM(require("react"));
|
|
1621
1646
|
var import_editor_props22 = require("@elementor/editor-props");
|
|
1622
|
-
var
|
|
1647
|
+
var import_ui33 = require("@elementor/ui");
|
|
1623
1648
|
var import_wp_media3 = require("@elementor/wp-media");
|
|
1624
1649
|
var import_i18n17 = require("@wordpress/i18n");
|
|
1625
1650
|
|
|
@@ -1628,44 +1653,44 @@ var import_env = require("@elementor/env");
|
|
|
1628
1653
|
var { env } = (0, import_env.parseEnv)("@elementor/editor-controls");
|
|
1629
1654
|
|
|
1630
1655
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
1631
|
-
var
|
|
1656
|
+
var React33 = __toESM(require("react"));
|
|
1632
1657
|
var import_icons9 = require("@elementor/icons");
|
|
1633
|
-
var
|
|
1658
|
+
var import_ui28 = require("@elementor/ui");
|
|
1634
1659
|
var import_i18n13 = require("@wordpress/i18n");
|
|
1635
1660
|
var attachmentControlOptions = [
|
|
1636
1661
|
{
|
|
1637
1662
|
value: "fixed",
|
|
1638
1663
|
label: (0, import_i18n13.__)("Fixed", "elementor"),
|
|
1639
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1664
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(import_icons9.PinIcon, { fontSize: size }),
|
|
1640
1665
|
showTooltip: true
|
|
1641
1666
|
},
|
|
1642
1667
|
{
|
|
1643
1668
|
value: "scroll",
|
|
1644
1669
|
label: (0, import_i18n13.__)("Scroll", "elementor"),
|
|
1645
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1670
|
+
renderContent: ({ size }) => /* @__PURE__ */ React33.createElement(import_icons9.PinnedOffIcon, { fontSize: size }),
|
|
1646
1671
|
showTooltip: true
|
|
1647
1672
|
}
|
|
1648
1673
|
];
|
|
1649
1674
|
var BackgroundImageOverlayAttachment = () => {
|
|
1650
|
-
return /* @__PURE__ */
|
|
1675
|
+
return /* @__PURE__ */ React33.createElement(PopoverGridContainer, null, /* @__PURE__ */ React33.createElement(import_ui28.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React33.createElement(ControlLabel, null, (0, import_i18n13.__)("Attachment", "elementor"))), /* @__PURE__ */ React33.createElement(import_ui28.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React33.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
1651
1676
|
};
|
|
1652
1677
|
|
|
1653
1678
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
1654
|
-
var
|
|
1679
|
+
var React34 = __toESM(require("react"));
|
|
1655
1680
|
var import_editor_props19 = require("@elementor/editor-props");
|
|
1656
1681
|
var import_icons10 = require("@elementor/icons");
|
|
1657
|
-
var
|
|
1682
|
+
var import_ui29 = require("@elementor/ui");
|
|
1658
1683
|
var import_i18n14 = require("@wordpress/i18n");
|
|
1659
1684
|
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
|
|
1685
|
+
{ label: (0, import_i18n14.__)("Center center", "elementor"), value: "center center" },
|
|
1686
|
+
{ label: (0, import_i18n14.__)("Center left", "elementor"), value: "center left" },
|
|
1687
|
+
{ label: (0, import_i18n14.__)("Center right", "elementor"), value: "center right" },
|
|
1688
|
+
{ label: (0, import_i18n14.__)("Top center", "elementor"), value: "top center" },
|
|
1689
|
+
{ label: (0, import_i18n14.__)("Top left", "elementor"), value: "top left" },
|
|
1690
|
+
{ label: (0, import_i18n14.__)("Top right", "elementor"), value: "top right" },
|
|
1691
|
+
{ label: (0, import_i18n14.__)("Bottom center", "elementor"), value: "bottom center" },
|
|
1692
|
+
{ label: (0, import_i18n14.__)("Bottom left", "elementor"), value: "bottom left" },
|
|
1693
|
+
{ label: (0, import_i18n14.__)("Bottom right", "elementor"), value: "bottom right" },
|
|
1669
1694
|
{ label: (0, import_i18n14.__)("Custom", "elementor"), value: "custom" }
|
|
1670
1695
|
];
|
|
1671
1696
|
var BackgroundImageOverlayPosition = () => {
|
|
@@ -1680,82 +1705,82 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
1680
1705
|
stringPropContext.setValue(value);
|
|
1681
1706
|
}
|
|
1682
1707
|
};
|
|
1683
|
-
return /* @__PURE__ */
|
|
1684
|
-
|
|
1708
|
+
return /* @__PURE__ */ React34.createElement(import_ui29.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React34.createElement(import_ui29.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(PopoverGridContainer, null, /* @__PURE__ */ React34.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(ControlLabel, null, (0, import_i18n14.__)("Position", "elementor"))), /* @__PURE__ */ React34.createElement(import_ui29.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React34.createElement(
|
|
1709
|
+
import_ui29.Select,
|
|
1685
1710
|
{
|
|
1686
1711
|
size: "tiny",
|
|
1687
1712
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? "",
|
|
1688
1713
|
onChange: handlePositionChange,
|
|
1689
1714
|
fullWidth: true
|
|
1690
1715
|
},
|
|
1691
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
1692
|
-
)))), isCustom ? /* @__PURE__ */
|
|
1716
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React34.createElement(import_ui29.MenuItem, { key: value, value: value ?? "" }, label))
|
|
1717
|
+
)))), isCustom ? /* @__PURE__ */ React34.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React34.createElement(import_ui29.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React34.createElement(import_ui29.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React34.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React34.createElement(SizeControl, { startIcon: /* @__PURE__ */ React34.createElement(import_icons10.LetterXIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React34.createElement(import_ui29.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React34.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React34.createElement(SizeControl, { startIcon: /* @__PURE__ */ React34.createElement(import_icons10.LetterYIcon, { fontSize: "tiny" }) })))))) : null);
|
|
1693
1718
|
};
|
|
1694
1719
|
|
|
1695
1720
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
1696
|
-
var
|
|
1721
|
+
var React35 = __toESM(require("react"));
|
|
1697
1722
|
var import_icons11 = require("@elementor/icons");
|
|
1698
|
-
var
|
|
1723
|
+
var import_ui30 = require("@elementor/ui");
|
|
1699
1724
|
var import_i18n15 = require("@wordpress/i18n");
|
|
1700
1725
|
var repeatControlOptions = [
|
|
1701
1726
|
{
|
|
1702
1727
|
value: "repeat",
|
|
1703
1728
|
label: (0, import_i18n15.__)("Repeat", "elementor"),
|
|
1704
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1729
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(import_icons11.GridDotsIcon, { fontSize: size }),
|
|
1705
1730
|
showTooltip: true
|
|
1706
1731
|
},
|
|
1707
1732
|
{
|
|
1708
1733
|
value: "repeat-x",
|
|
1709
1734
|
label: (0, import_i18n15.__)("Repeat-x", "elementor"),
|
|
1710
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1735
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(import_icons11.DotsHorizontalIcon, { fontSize: size }),
|
|
1711
1736
|
showTooltip: true
|
|
1712
1737
|
},
|
|
1713
1738
|
{
|
|
1714
1739
|
value: "repeat-y",
|
|
1715
1740
|
label: (0, import_i18n15.__)("Repeat-y", "elementor"),
|
|
1716
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1741
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(import_icons11.DotsVerticalIcon, { fontSize: size }),
|
|
1717
1742
|
showTooltip: true
|
|
1718
1743
|
},
|
|
1719
1744
|
{
|
|
1720
1745
|
value: "no-repeat",
|
|
1721
1746
|
label: (0, import_i18n15.__)("No-Repeat", "elementor"),
|
|
1722
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1747
|
+
renderContent: ({ size }) => /* @__PURE__ */ React35.createElement(import_icons11.XIcon, { fontSize: size }),
|
|
1723
1748
|
showTooltip: true
|
|
1724
1749
|
}
|
|
1725
1750
|
];
|
|
1726
1751
|
var BackgroundImageOverlayRepeat = () => {
|
|
1727
|
-
return /* @__PURE__ */
|
|
1752
|
+
return /* @__PURE__ */ React35.createElement(PopoverGridContainer, null, /* @__PURE__ */ React35.createElement(import_ui30.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React35.createElement(ControlLabel, null, (0, import_i18n15.__)("Repeat", "elementor"))), /* @__PURE__ */ React35.createElement(import_ui30.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React35.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
1728
1753
|
};
|
|
1729
1754
|
|
|
1730
1755
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
1731
|
-
var
|
|
1756
|
+
var React36 = __toESM(require("react"));
|
|
1732
1757
|
var import_editor_props20 = require("@elementor/editor-props");
|
|
1733
1758
|
var import_icons12 = require("@elementor/icons");
|
|
1734
|
-
var
|
|
1759
|
+
var import_ui31 = require("@elementor/ui");
|
|
1735
1760
|
var import_i18n16 = require("@wordpress/i18n");
|
|
1736
1761
|
var sizeControlOptions = [
|
|
1737
1762
|
{
|
|
1738
1763
|
value: "auto",
|
|
1739
1764
|
label: (0, import_i18n16.__)("Auto", "elementor"),
|
|
1740
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1765
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.LetterAIcon, { fontSize: size }),
|
|
1741
1766
|
showTooltip: true
|
|
1742
1767
|
},
|
|
1743
1768
|
{
|
|
1744
1769
|
value: "cover",
|
|
1745
1770
|
label: (0, import_i18n16.__)("Cover", "elementor"),
|
|
1746
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1771
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.ArrowsMaximizeIcon, { fontSize: size }),
|
|
1747
1772
|
showTooltip: true
|
|
1748
1773
|
},
|
|
1749
1774
|
{
|
|
1750
1775
|
value: "contain",
|
|
1751
1776
|
label: (0, import_i18n16.__)("Contain", "elementor"),
|
|
1752
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1777
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.ArrowBarBothIcon, { fontSize: size }),
|
|
1753
1778
|
showTooltip: true
|
|
1754
1779
|
},
|
|
1755
1780
|
{
|
|
1756
1781
|
value: "custom",
|
|
1757
1782
|
label: (0, import_i18n16.__)("Custom", "elementor"),
|
|
1758
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
1783
|
+
renderContent: ({ size }) => /* @__PURE__ */ React36.createElement(import_icons12.PencilIcon, { fontSize: size }),
|
|
1759
1784
|
showTooltip: true
|
|
1760
1785
|
}
|
|
1761
1786
|
];
|
|
@@ -1770,7 +1795,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1770
1795
|
stringPropContext.setValue(size);
|
|
1771
1796
|
}
|
|
1772
1797
|
};
|
|
1773
|
-
return /* @__PURE__ */
|
|
1798
|
+
return /* @__PURE__ */ React36.createElement(import_ui31.Grid, { container: true, spacing: 1.5 }, /* @__PURE__ */ React36.createElement(import_ui31.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(PopoverGridContainer, null, /* @__PURE__ */ React36.createElement(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(ControlLabel, null, (0, import_i18n16.__)("Size", "elementor"))), /* @__PURE__ */ React36.createElement(import_ui31.Grid, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React36.createElement(
|
|
1774
1799
|
ControlToggleButtonGroup,
|
|
1775
1800
|
{
|
|
1776
1801
|
exclusive: true,
|
|
@@ -1778,21 +1803,21 @@ var BackgroundImageOverlaySize = () => {
|
|
|
1778
1803
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value,
|
|
1779
1804
|
onChange: handleSizeChange
|
|
1780
1805
|
}
|
|
1781
|
-
)))), isCustom ? /* @__PURE__ */
|
|
1806
|
+
)))), isCustom ? /* @__PURE__ */ React36.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React36.createElement(import_ui31.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React36.createElement(PopoverGridContainer, null, /* @__PURE__ */ React36.createElement(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React36.createElement(SizeControl, { startIcon: /* @__PURE__ */ React36.createElement(import_icons12.ArrowsMoveHorizontalIcon, { fontSize: "tiny" }) }))), /* @__PURE__ */ React36.createElement(import_ui31.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React36.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React36.createElement(SizeControl, { startIcon: /* @__PURE__ */ React36.createElement(import_icons12.ArrowsMoveVerticalIcon, { fontSize: "tiny" }) })))))) : null);
|
|
1782
1807
|
};
|
|
1783
1808
|
|
|
1784
1809
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
1785
|
-
var
|
|
1810
|
+
var import_react12 = require("react");
|
|
1786
1811
|
var import_editor_props21 = require("@elementor/editor-props");
|
|
1787
|
-
var
|
|
1812
|
+
var import_ui32 = require("@elementor/ui");
|
|
1788
1813
|
var useBackgroundTabsHistory = ({
|
|
1789
1814
|
color: initialBackgroundColorOverlay2,
|
|
1790
1815
|
image: initialBackgroundImageOverlay
|
|
1791
1816
|
}) => {
|
|
1792
1817
|
const { value: imageValue, setValue: setImageValue } = useBoundProp(import_editor_props21.backgroundImageOverlayPropTypeUtil);
|
|
1793
1818
|
const { value: colorValue, setValue: setColorValue } = useBoundProp(import_editor_props21.backgroundColorOverlayPropTypeUtil);
|
|
1794
|
-
const { getTabsProps, getTabProps, getTabPanelProps } = (0,
|
|
1795
|
-
const valuesHistory = (0,
|
|
1819
|
+
const { getTabsProps, getTabProps, getTabPanelProps } = (0, import_ui32.useTabs)(colorValue ? "color" : "image");
|
|
1820
|
+
const valuesHistory = (0, import_react12.useRef)({
|
|
1796
1821
|
image: initialBackgroundImageOverlay,
|
|
1797
1822
|
color: initialBackgroundColorOverlay2
|
|
1798
1823
|
});
|
|
@@ -1857,7 +1882,7 @@ var backgroundResolutionOptions = [
|
|
|
1857
1882
|
];
|
|
1858
1883
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
1859
1884
|
const { propType, value: overlayValues, setValue } = useBoundProp(import_editor_props22.backgroundOverlayPropTypeUtil);
|
|
1860
|
-
return /* @__PURE__ */
|
|
1885
|
+
return /* @__PURE__ */ React37.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React37.createElement(
|
|
1861
1886
|
Repeater,
|
|
1862
1887
|
{
|
|
1863
1888
|
values: overlayValues ?? [],
|
|
@@ -1873,58 +1898,58 @@ var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
|
1873
1898
|
));
|
|
1874
1899
|
});
|
|
1875
1900
|
var ItemContent2 = ({ bind }) => {
|
|
1876
|
-
return /* @__PURE__ */
|
|
1901
|
+
return /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React37.createElement(Content2, null));
|
|
1877
1902
|
};
|
|
1878
1903
|
var Content2 = () => {
|
|
1879
1904
|
const { getTabsProps, getTabProps, getTabPanelProps } = useBackgroundTabsHistory({
|
|
1880
1905
|
image: getInitialBackgroundOverlay().value,
|
|
1881
1906
|
color: initialBackgroundColorOverlay.value
|
|
1882
1907
|
});
|
|
1883
|
-
return /* @__PURE__ */
|
|
1908
|
+
return /* @__PURE__ */ React37.createElement(import_ui33.Box, { sx: { width: "100%" } }, /* @__PURE__ */ React37.createElement(import_ui33.Box, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React37.createElement(import_ui33.Tabs, { ...getTabsProps(), "aria-label": (0, import_i18n17.__)("Background Overlay", "elementor") }, /* @__PURE__ */ React37.createElement(import_ui33.Tab, { label: (0, import_i18n17.__)("Image", "elementor"), ...getTabProps("image") }), /* @__PURE__ */ React37.createElement(import_ui33.Tab, { label: (0, import_i18n17.__)("Color", "elementor"), ...getTabProps("color") }))), /* @__PURE__ */ React37.createElement(import_ui33.TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React37.createElement(PopoverContent, null, /* @__PURE__ */ React37.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React37.createElement(import_ui33.TabPanel, { ...getTabPanelProps("color"), sx: { p: 1.5 } }, /* @__PURE__ */ React37.createElement(import_ui33.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React37.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(ColorControl, { propTypeUtil: import_editor_props22.backgroundColorOverlayPropTypeUtil })))));
|
|
1884
1909
|
};
|
|
1885
1910
|
var ItemIcon2 = ({ value }) => {
|
|
1886
1911
|
switch (value.$$type) {
|
|
1887
1912
|
case "background-image-overlay":
|
|
1888
|
-
return /* @__PURE__ */
|
|
1913
|
+
return /* @__PURE__ */ React37.createElement(ItemIconImage, { value });
|
|
1889
1914
|
case "background-color-overlay":
|
|
1890
|
-
return /* @__PURE__ */
|
|
1915
|
+
return /* @__PURE__ */ React37.createElement(ItemIconColor, { value });
|
|
1891
1916
|
default:
|
|
1892
1917
|
return null;
|
|
1893
1918
|
}
|
|
1894
1919
|
};
|
|
1895
1920
|
var ItemIconColor = ({ value }) => {
|
|
1896
|
-
return /* @__PURE__ */
|
|
1921
|
+
return /* @__PURE__ */ React37.createElement(import_ui33.UnstableColorIndicator, { size: "inherit", component: "span", value: value.value });
|
|
1897
1922
|
};
|
|
1898
1923
|
var ItemIconImage = ({ value }) => {
|
|
1899
1924
|
const { imageUrl } = useImage(value);
|
|
1900
|
-
return /* @__PURE__ */
|
|
1925
|
+
return /* @__PURE__ */ React37.createElement(import_ui33.CardMedia, { image: imageUrl, sx: { height: 13, width: 13, borderRadius: "4px" } });
|
|
1901
1926
|
};
|
|
1902
1927
|
var ItemLabel2 = ({ value }) => {
|
|
1903
1928
|
switch (value.$$type) {
|
|
1904
1929
|
case "background-image-overlay":
|
|
1905
|
-
return /* @__PURE__ */
|
|
1930
|
+
return /* @__PURE__ */ React37.createElement(ItemLabelImage, { value });
|
|
1906
1931
|
case "background-color-overlay":
|
|
1907
|
-
return /* @__PURE__ */
|
|
1932
|
+
return /* @__PURE__ */ React37.createElement(ItemLabelColor, { value });
|
|
1908
1933
|
default:
|
|
1909
1934
|
return null;
|
|
1910
1935
|
}
|
|
1911
1936
|
};
|
|
1912
1937
|
var ItemLabelColor = ({ value }) => {
|
|
1913
|
-
return /* @__PURE__ */
|
|
1938
|
+
return /* @__PURE__ */ React37.createElement("span", null, value.value);
|
|
1914
1939
|
};
|
|
1915
1940
|
var ItemLabelImage = ({ value }) => {
|
|
1916
1941
|
const { imageTitle } = useImage(value);
|
|
1917
|
-
return /* @__PURE__ */
|
|
1942
|
+
return /* @__PURE__ */ React37.createElement("span", null, imageTitle);
|
|
1918
1943
|
};
|
|
1919
1944
|
var ImageOverlayContent = () => {
|
|
1920
1945
|
const propContext = useBoundProp(import_editor_props22.backgroundImageOverlayPropTypeUtil);
|
|
1921
|
-
return /* @__PURE__ */
|
|
1946
|
+
return /* @__PURE__ */ React37.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React37.createElement(import_ui33.Grid, { container: true, spacing: 1, alignItems: "center" }, /* @__PURE__ */ React37.createElement(import_ui33.Grid, { item: true, xs: 12 }, /* @__PURE__ */ React37.createElement(
|
|
1922
1947
|
ImageControl,
|
|
1923
1948
|
{
|
|
1924
1949
|
resolutionLabel: (0, import_i18n17.__)("Resolution", "elementor"),
|
|
1925
1950
|
sizes: backgroundResolutionOptions
|
|
1926
1951
|
}
|
|
1927
|
-
)))), /* @__PURE__ */
|
|
1952
|
+
)))), /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React37.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React37.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React37.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React37.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React37.createElement(BackgroundImageOverlayAttachment, null)));
|
|
1928
1953
|
};
|
|
1929
1954
|
var useImage = (image) => {
|
|
1930
1955
|
let imageTitle, imageUrl = null;
|
|
@@ -1944,11 +1969,10 @@ var useImage = (image) => {
|
|
|
1944
1969
|
// src/controls/background-control/background-control.tsx
|
|
1945
1970
|
var BackgroundControl = createControl(() => {
|
|
1946
1971
|
const propContext = useBoundProp(import_editor_props23.backgroundPropTypeUtil);
|
|
1947
|
-
return /* @__PURE__ */
|
|
1972
|
+
return /* @__PURE__ */ React38.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React38.createElement(SectionContent, null, /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React38.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React38.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React38.createElement(import_ui34.Grid, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React38.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(ControlLabel, null, (0, import_i18n18.__)("Color", "elementor"))), /* @__PURE__ */ React38.createElement(import_ui34.Grid, { item: true, xs: 6 }, /* @__PURE__ */ React38.createElement(ColorControl, null))))));
|
|
1948
1973
|
});
|
|
1949
1974
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1950
1975
|
0 && (module.exports = {
|
|
1951
|
-
AutocompleteControl,
|
|
1952
1976
|
BackgroundControl,
|
|
1953
1977
|
BoxShadowRepeaterControl,
|
|
1954
1978
|
ColorControl,
|