@elementor/editor-controls 4.4.0-beta1 → 4.4.0-beta3
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/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +1202 -1098
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +887 -784
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -16
- package/src/controls/icon-library/icon-library-grid.tsx +18 -25
- package/src/controls/icon-library/icon-library-popover.tsx +27 -9
- package/src/controls/query-select-control.tsx +104 -0
- package/src/controls/size-control/hooks/use-size-value.ts +2 -2
- package/src/controls/size-control/unstable-size-control.tsx +19 -1
- package/src/controls/size-control/utils/resolve-size-value.ts +14 -0
- package/src/controls/size-control.tsx +5 -5
- package/src/hooks/use-query-autocomplete.ts +7 -3
- package/src/index.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -1531,17 +1531,17 @@ var SizeControl = createControl(
|
|
|
1531
1531
|
const actualUnits = resolveUnits(propType, enablePropTypeUnits, variant, units2, actualExtendedOptions);
|
|
1532
1532
|
const popupState = usePopupState2({ variant: "popover" });
|
|
1533
1533
|
const memorizedExternalState = useMemo2(
|
|
1534
|
-
() => createStateFromSizeProp(sizeValue, actualDefaultUnit),
|
|
1534
|
+
() => sizeValue ? createStateFromSizeProp(sizeValue, actualDefaultUnit) : null,
|
|
1535
1535
|
[sizeValue, actualDefaultUnit]
|
|
1536
1536
|
);
|
|
1537
1537
|
const [state, setState] = useSyncExternalState({
|
|
1538
1538
|
external: memorizedExternalState,
|
|
1539
1539
|
setExternal: (newState, options, meta) => setSizeValue(extractValueFromState(newState), options, meta),
|
|
1540
1540
|
persistWhen: (newState) => !!extractValueFromState(newState),
|
|
1541
|
-
fallback: (
|
|
1542
|
-
unit:
|
|
1543
|
-
numeric:
|
|
1544
|
-
custom:
|
|
1541
|
+
fallback: (prevState) => ({
|
|
1542
|
+
unit: prevState?.unit && !isUnitExtendedOption(prevState.unit) ? prevState.unit : actualDefaultUnit,
|
|
1543
|
+
numeric: DEFAULT_SIZE,
|
|
1544
|
+
custom: ""
|
|
1545
1545
|
})
|
|
1546
1546
|
});
|
|
1547
1547
|
const { size: controlSize = DEFAULT_SIZE, unit: controlUnit = actualDefaultUnit } = extractValueFromState(state, true) || {};
|
|
@@ -3566,6 +3566,13 @@ var createDefaultSizeValue = (units2, defaultUnit) => {
|
|
|
3566
3566
|
}
|
|
3567
3567
|
return { size: DEFAULT_SIZE2, unit };
|
|
3568
3568
|
};
|
|
3569
|
+
var createEmptySizeValue = (previousValue, units2, defaultUnit) => {
|
|
3570
|
+
const previousUnit = previousValue?.unit;
|
|
3571
|
+
if (!previousUnit || isExtendedUnit(previousUnit) || !units2.includes(previousUnit)) {
|
|
3572
|
+
return createDefaultSizeValue(units2, defaultUnit);
|
|
3573
|
+
}
|
|
3574
|
+
return { size: DEFAULT_SIZE2, unit: previousUnit };
|
|
3575
|
+
};
|
|
3569
3576
|
var resolveFallbackUnit = (unit, units2, defaultUnit) => {
|
|
3570
3577
|
if (units2.includes(unit)) {
|
|
3571
3578
|
return unit;
|
|
@@ -3620,7 +3627,7 @@ var useSizeValue = ({
|
|
|
3620
3627
|
}
|
|
3621
3628
|
},
|
|
3622
3629
|
persistWhen: (next) => hasChanged(next, resolvedValue),
|
|
3623
|
-
fallback: () =>
|
|
3630
|
+
fallback: (previousValue) => createEmptySizeValue(previousValue, units2, defaultUnit)
|
|
3624
3631
|
});
|
|
3625
3632
|
const [unit, setUnit] = useUnitSync({
|
|
3626
3633
|
sizeValue,
|
|
@@ -4056,16 +4063,19 @@ var UnstableSizeControl = createControl(
|
|
|
4056
4063
|
restoreValue
|
|
4057
4064
|
} = useBoundProp(sizePropTypeUtil4);
|
|
4058
4065
|
const lastNonAutoValue = useRef13(null);
|
|
4059
|
-
const
|
|
4066
|
+
const clearedUnit = useRef13(null);
|
|
4067
|
+
const { sizeValue: resolvedSizeValue, placeholder } = resolveBoundPropValue(
|
|
4060
4068
|
value ?? lastNonAutoValue.current,
|
|
4061
4069
|
boundPropPlaceholder,
|
|
4062
4070
|
propPlaceholder
|
|
4063
4071
|
);
|
|
4072
|
+
const sizeValue = applyClearedUnit(resolvedSizeValue, value, clearedUnit.current);
|
|
4064
4073
|
const units2 = getSizeUnits(propType, variant);
|
|
4065
4074
|
const defaultUnit = getDefaultUnit(propType);
|
|
4066
4075
|
const handleBlur = () => {
|
|
4067
4076
|
const isRequired = propType.settings.required;
|
|
4068
4077
|
if (shouldNullifyValue(value) && !isRequired) {
|
|
4078
|
+
clearedUnit.current = value?.unit ?? null;
|
|
4069
4079
|
setValue(null);
|
|
4070
4080
|
}
|
|
4071
4081
|
if (isRequired) {
|
|
@@ -4073,6 +4083,7 @@ var UnstableSizeControl = createControl(
|
|
|
4073
4083
|
}
|
|
4074
4084
|
};
|
|
4075
4085
|
const handleChange = (newValue, options, meta) => {
|
|
4086
|
+
clearedUnit.current = null;
|
|
4076
4087
|
if (isTransitioningFromExtendedUnit(newValue, value)) {
|
|
4077
4088
|
lastNonAutoValue.current = newValue;
|
|
4078
4089
|
setValue(null);
|
|
@@ -4106,6 +4117,12 @@ var UnstableSizeControl = createControl(
|
|
|
4106
4117
|
);
|
|
4107
4118
|
}
|
|
4108
4119
|
);
|
|
4120
|
+
var applyClearedUnit = (resolvedValue, boundValue, clearedUnit) => {
|
|
4121
|
+
if (boundValue || !resolvedValue || !clearedUnit) {
|
|
4122
|
+
return resolvedValue;
|
|
4123
|
+
}
|
|
4124
|
+
return { ...resolvedValue, unit: clearedUnit };
|
|
4125
|
+
};
|
|
4109
4126
|
var isTransitioningFromExtendedUnit = (nextValue, previousValue) => {
|
|
4110
4127
|
return !isExtendedUnit(nextValue.unit) && isExtendedUnit(previousValue?.unit) && nextValue.size === "";
|
|
4111
4128
|
};
|
|
@@ -4797,7 +4814,7 @@ function factoryFilter(newValue, options, minInputLength) {
|
|
|
4797
4814
|
}
|
|
4798
4815
|
|
|
4799
4816
|
// src/hooks/use-query-autocomplete.ts
|
|
4800
|
-
import { useEffect as useEffect14, useMemo as useMemo9, useState as useState14 } from "react";
|
|
4817
|
+
import { useEffect as useEffect14, useMemo as useMemo9, useRef as useRef15, useState as useState14 } from "react";
|
|
4801
4818
|
import { numberPropTypeUtil as numberPropTypeUtil2, stringPropTypeUtil as stringPropTypeUtil8 } from "@elementor/editor-props";
|
|
4802
4819
|
import { httpService as httpService2 } from "@elementor/http-client";
|
|
4803
4820
|
import { debounce as debounce2 } from "@elementor/utils";
|
|
@@ -4821,13 +4838,16 @@ function useQueryAutocomplete({
|
|
|
4821
4838
|
),
|
|
4822
4839
|
[url, excludeIdSet]
|
|
4823
4840
|
);
|
|
4841
|
+
const paramsKey = useMemo9(() => JSON.stringify(params), [params]);
|
|
4842
|
+
const paramsRef = useRef15(params);
|
|
4843
|
+
paramsRef.current = params;
|
|
4824
4844
|
useEffect14(() => {
|
|
4825
4845
|
if (minInputLength === 0 && url) {
|
|
4826
|
-
fetchOptions(url, { ...
|
|
4846
|
+
fetchOptions(url, { ...paramsRef.current, term: "" }).then((newOptions) => {
|
|
4827
4847
|
setOptions(formatOptions(filterExcludedOptions(newOptions, excludeIdSet)));
|
|
4828
4848
|
});
|
|
4829
4849
|
}
|
|
4830
|
-
}, [url, minInputLength, excludeIdSet,
|
|
4850
|
+
}, [url, minInputLength, excludeIdSet, paramsKey]);
|
|
4831
4851
|
const updateOptions = (term) => {
|
|
4832
4852
|
const termStr = term ?? "";
|
|
4833
4853
|
if (!url || termStr.length < minInputLength) {
|
|
@@ -5258,7 +5278,7 @@ function extractChips(value) {
|
|
|
5258
5278
|
|
|
5259
5279
|
// src/controls/query-filter-repeater-control.tsx
|
|
5260
5280
|
import * as React80 from "react";
|
|
5261
|
-
import { useMemo as useMemo11, useRef as
|
|
5281
|
+
import { useMemo as useMemo11, useRef as useRef16 } from "react";
|
|
5262
5282
|
import { useSelectedElementSettings } from "@elementor/editor-elements";
|
|
5263
5283
|
import {
|
|
5264
5284
|
extractValue,
|
|
@@ -5360,7 +5380,7 @@ var ItemContent = ({
|
|
|
5360
5380
|
chipsPlaceholder
|
|
5361
5381
|
}) => {
|
|
5362
5382
|
const propContext = useBoundProp(queryFilterPropTypeUtil);
|
|
5363
|
-
const snapshotsByKeyRef =
|
|
5383
|
+
const snapshotsByKeyRef = useRef16({});
|
|
5364
5384
|
const handleValueChange = (nextValue, options, meta) => {
|
|
5365
5385
|
if (meta?.bind !== "key") {
|
|
5366
5386
|
propContext.setValue(nextValue, options, meta);
|
|
@@ -5430,9 +5450,85 @@ function getUsedKeys(items2) {
|
|
|
5430
5450
|
return new Set(keys);
|
|
5431
5451
|
}
|
|
5432
5452
|
|
|
5433
|
-
// src/controls/
|
|
5453
|
+
// src/controls/query-select-control.tsx
|
|
5434
5454
|
import * as React81 from "react";
|
|
5435
|
-
import {
|
|
5455
|
+
import { useMemo as useMemo12 } from "react";
|
|
5456
|
+
import { numberPropTypeUtil as numberPropTypeUtil5, queryPropTypeUtil as queryPropTypeUtil3, stringPropTypeUtil as stringPropTypeUtil13 } from "@elementor/editor-props";
|
|
5457
|
+
import { Autocomplete as Autocomplete4, TextField as TextField10 } from "@elementor/ui";
|
|
5458
|
+
import { __ as __31 } from "@wordpress/i18n";
|
|
5459
|
+
var SIZE10 = "tiny";
|
|
5460
|
+
var QuerySelectControl = createControl((props) => {
|
|
5461
|
+
const { queryOptions, placeholder, minInputLength = 0, ariaLabel } = props;
|
|
5462
|
+
const { value, setValue, disabled } = useBoundProp(queryPropTypeUtil3);
|
|
5463
|
+
const selectedOption = useMemo12(() => extractFlatOptionFromQueryValue(value), [value]);
|
|
5464
|
+
const { options, updateOptions } = useQueryAutocomplete({
|
|
5465
|
+
url: queryOptions.url,
|
|
5466
|
+
params: queryOptions.params,
|
|
5467
|
+
minInputLength,
|
|
5468
|
+
initialQueryValue: value
|
|
5469
|
+
});
|
|
5470
|
+
const optionsWithSelected = useMemo12(
|
|
5471
|
+
() => withSelectedOption(options, selectedOption),
|
|
5472
|
+
[options, selectedOption]
|
|
5473
|
+
);
|
|
5474
|
+
const handleChange = (_, newValue) => {
|
|
5475
|
+
if (!newValue) {
|
|
5476
|
+
setValue(null);
|
|
5477
|
+
return;
|
|
5478
|
+
}
|
|
5479
|
+
setValue({
|
|
5480
|
+
id: numberPropTypeUtil5.create(Number(newValue.id)),
|
|
5481
|
+
label: stringPropTypeUtil13.create(newValue.label)
|
|
5482
|
+
});
|
|
5483
|
+
};
|
|
5484
|
+
const handleInputChange = (_, term, reason) => {
|
|
5485
|
+
if ("reset" === reason || "clear" === reason) {
|
|
5486
|
+
updateOptions(null);
|
|
5487
|
+
return;
|
|
5488
|
+
}
|
|
5489
|
+
if ("input" !== reason) {
|
|
5490
|
+
return;
|
|
5491
|
+
}
|
|
5492
|
+
updateOptions(term || null);
|
|
5493
|
+
};
|
|
5494
|
+
return /* @__PURE__ */ React81.createElement(ControlActions, null, /* @__PURE__ */ React81.createElement(
|
|
5495
|
+
Autocomplete4,
|
|
5496
|
+
{
|
|
5497
|
+
fullWidth: true,
|
|
5498
|
+
openOnFocus: true,
|
|
5499
|
+
disabled,
|
|
5500
|
+
size: SIZE10,
|
|
5501
|
+
value: selectedOption,
|
|
5502
|
+
options: optionsWithSelected,
|
|
5503
|
+
onChange: handleChange,
|
|
5504
|
+
onInputChange: handleInputChange,
|
|
5505
|
+
getOptionLabel: (option) => option.label,
|
|
5506
|
+
isOptionEqualToValue: (option, val) => option.id === val.id,
|
|
5507
|
+
filterOptions: (opts) => opts,
|
|
5508
|
+
renderInput: (params) => /* @__PURE__ */ React81.createElement(
|
|
5509
|
+
TextField10,
|
|
5510
|
+
{
|
|
5511
|
+
...params,
|
|
5512
|
+
placeholder: placeholder ?? __31("Search", "elementor"),
|
|
5513
|
+
inputProps: {
|
|
5514
|
+
...params.inputProps,
|
|
5515
|
+
...ariaLabel ? { "aria-label": ariaLabel } : {}
|
|
5516
|
+
}
|
|
5517
|
+
}
|
|
5518
|
+
)
|
|
5519
|
+
}
|
|
5520
|
+
));
|
|
5521
|
+
});
|
|
5522
|
+
function withSelectedOption(options, selectedOption) {
|
|
5523
|
+
if (!selectedOption || options.some((option) => option.id === selectedOption.id)) {
|
|
5524
|
+
return options;
|
|
5525
|
+
}
|
|
5526
|
+
return [selectedOption, ...options];
|
|
5527
|
+
}
|
|
5528
|
+
|
|
5529
|
+
// src/controls/gap-control.tsx
|
|
5530
|
+
import * as React82 from "react";
|
|
5531
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef17, useState as useState16 } from "react";
|
|
5436
5532
|
import {
|
|
5437
5533
|
layoutDirectionPropTypeUtil,
|
|
5438
5534
|
sizePropTypeUtil as sizePropTypeUtil6
|
|
@@ -5440,9 +5536,9 @@ import {
|
|
|
5440
5536
|
import { useActiveBreakpoint as useActiveBreakpoint5 } from "@elementor/editor-responsive";
|
|
5441
5537
|
import { DetachIcon as DetachIcon2, LinkIcon as LinkIcon2 } from "@elementor/icons";
|
|
5442
5538
|
import { Grid as Grid12, Stack as Stack13, Tooltip as Tooltip7 } from "@elementor/ui";
|
|
5443
|
-
import { __ as
|
|
5539
|
+
import { __ as __32 } from "@wordpress/i18n";
|
|
5444
5540
|
var GapControl = ({ label }) => {
|
|
5445
|
-
const stackRef =
|
|
5541
|
+
const stackRef = useRef17(null);
|
|
5446
5542
|
const { disabled: sizeDisabled } = useBoundProp(sizePropTypeUtil6);
|
|
5447
5543
|
const {
|
|
5448
5544
|
value: directionValue,
|
|
@@ -5488,8 +5584,8 @@ var GapControl = ({ label }) => {
|
|
|
5488
5584
|
};
|
|
5489
5585
|
const tooltipLabel = label.toLowerCase();
|
|
5490
5586
|
const LinkedIcon = isLinked ? LinkIcon2 : DetachIcon2;
|
|
5491
|
-
const linkedLabel =
|
|
5492
|
-
const unlinkedLabel =
|
|
5587
|
+
const linkedLabel = __32("Link %s", "elementor").replace("%s", tooltipLabel);
|
|
5588
|
+
const unlinkedLabel = __32("Unlink %s", "elementor").replace("%s", tooltipLabel);
|
|
5493
5589
|
const disabled = sizeDisabled || directionDisabled;
|
|
5494
5590
|
const propProviderProps = {
|
|
5495
5591
|
propType,
|
|
@@ -5509,7 +5605,7 @@ var GapControl = ({ label }) => {
|
|
|
5509
5605
|
}
|
|
5510
5606
|
return sizePropTypeUtil6.extract(directionPlaceholder?.[bind]);
|
|
5511
5607
|
};
|
|
5512
|
-
return /* @__PURE__ */
|
|
5608
|
+
return /* @__PURE__ */ React82.createElement(PropProvider, { ...propProviderProps }, /* @__PURE__ */ React82.createElement(Stack13, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React82.createElement(ControlLabel, null, label), /* @__PURE__ */ React82.createElement(Tooltip7, { title: isLinked ? unlinkedLabel : linkedLabel, placement: "top" }, /* @__PURE__ */ React82.createElement(
|
|
5513
5609
|
StyledToggleButton,
|
|
5514
5610
|
{
|
|
5515
5611
|
"aria-label": isLinked ? unlinkedLabel : linkedLabel,
|
|
@@ -5521,21 +5617,21 @@ var GapControl = ({ label }) => {
|
|
|
5521
5617
|
disabled,
|
|
5522
5618
|
isPlaceholder: hasPlaceholders
|
|
5523
5619
|
},
|
|
5524
|
-
/* @__PURE__ */
|
|
5525
|
-
))), /* @__PURE__ */
|
|
5620
|
+
/* @__PURE__ */ React82.createElement(LinkedIcon, { fontSize: "tiny" })
|
|
5621
|
+
))), /* @__PURE__ */ React82.createElement(Stack13, { direction: "row", gap: 2, flexWrap: "nowrap", ref: stackRef }, /* @__PURE__ */ React82.createElement(Grid12, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React82.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React82.createElement(ControlFormLabel, null, __32("Column", "elementor"))), /* @__PURE__ */ React82.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React82.createElement(
|
|
5526
5622
|
Control4,
|
|
5527
5623
|
{
|
|
5528
5624
|
bind: "column",
|
|
5529
|
-
ariaLabel:
|
|
5625
|
+
ariaLabel: __32("Column gap", "elementor"),
|
|
5530
5626
|
isLinked,
|
|
5531
5627
|
anchorRef: stackRef,
|
|
5532
5628
|
placeholder: getEffectivePlaceholder("column") ?? void 0
|
|
5533
5629
|
}
|
|
5534
|
-
))), /* @__PURE__ */
|
|
5630
|
+
))), /* @__PURE__ */ React82.createElement(Grid12, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React82.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React82.createElement(ControlFormLabel, null, __32("Row", "elementor"))), /* @__PURE__ */ React82.createElement(Grid12, { item: true, xs: 12 }, /* @__PURE__ */ React82.createElement(
|
|
5535
5631
|
Control4,
|
|
5536
5632
|
{
|
|
5537
5633
|
bind: "row",
|
|
5538
|
-
ariaLabel:
|
|
5634
|
+
ariaLabel: __32("Row gap", "elementor"),
|
|
5539
5635
|
isLinked,
|
|
5540
5636
|
anchorRef: stackRef,
|
|
5541
5637
|
placeholder: getEffectivePlaceholder("row") ?? void 0
|
|
@@ -5550,21 +5646,21 @@ var Control4 = ({
|
|
|
5550
5646
|
placeholder
|
|
5551
5647
|
}) => {
|
|
5552
5648
|
if (isLinked) {
|
|
5553
|
-
return /* @__PURE__ */
|
|
5649
|
+
return /* @__PURE__ */ React82.createElement(UnstableSizeControl, { anchorRef, placeholder, ariaLabel });
|
|
5554
5650
|
}
|
|
5555
|
-
return /* @__PURE__ */
|
|
5651
|
+
return /* @__PURE__ */ React82.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React82.createElement(UnstableSizeControl, { anchorRef, placeholder, ariaLabel }));
|
|
5556
5652
|
};
|
|
5557
5653
|
|
|
5558
5654
|
// src/controls/aspect-ratio-control.tsx
|
|
5559
|
-
import * as
|
|
5655
|
+
import * as React83 from "react";
|
|
5560
5656
|
import { useEffect as useEffect16, useState as useState17 } from "react";
|
|
5561
|
-
import { stringPropTypeUtil as
|
|
5657
|
+
import { stringPropTypeUtil as stringPropTypeUtil14 } from "@elementor/editor-props";
|
|
5562
5658
|
import { MenuListItem as MenuListItem5 } from "@elementor/editor-ui";
|
|
5563
5659
|
import { ArrowsMoveHorizontalIcon, ArrowsMoveVerticalIcon } from "@elementor/icons";
|
|
5564
|
-
import { Grid as Grid13, Select as Select3, Stack as Stack14, TextField as
|
|
5565
|
-
import { __ as
|
|
5660
|
+
import { Grid as Grid13, Select as Select3, Stack as Stack14, TextField as TextField11 } from "@elementor/ui";
|
|
5661
|
+
import { __ as __33 } from "@wordpress/i18n";
|
|
5566
5662
|
var RATIO_OPTIONS = [
|
|
5567
|
-
{ label:
|
|
5663
|
+
{ label: __33("Auto", "elementor"), value: "auto" },
|
|
5568
5664
|
{ label: "1/1", value: "1/1" },
|
|
5569
5665
|
{ label: "4/3", value: "4/3" },
|
|
5570
5666
|
{ label: "3/4", value: "3/4" },
|
|
@@ -5580,7 +5676,7 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
5580
5676
|
setValue: setAspectRatioValue,
|
|
5581
5677
|
disabled,
|
|
5582
5678
|
placeholder: externalPlaceholder
|
|
5583
|
-
} = useBoundProp(
|
|
5679
|
+
} = useBoundProp(stringPropTypeUtil14);
|
|
5584
5680
|
const aspectRatioValue = currentPropValue ?? externalPlaceholder;
|
|
5585
5681
|
const isCustomSelected = aspectRatioValue && !RATIO_OPTIONS.some((option) => option.value === aspectRatioValue);
|
|
5586
5682
|
const [initialWidth, initialHeight] = isCustomSelected ? aspectRatioValue.split("/") : ["", ""];
|
|
@@ -5631,7 +5727,7 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
5631
5727
|
};
|
|
5632
5728
|
const lookup = currentPropValue ?? externalPlaceholder;
|
|
5633
5729
|
const selectedOption = RATIO_OPTIONS.find((option) => option.value === lookup);
|
|
5634
|
-
return /* @__PURE__ */
|
|
5730
|
+
return /* @__PURE__ */ React83.createElement(ControlActions, null, /* @__PURE__ */ React83.createElement(Stack14, { direction: "column", gap: 2 }, /* @__PURE__ */ React83.createElement(Grid13, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React83.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React83.createElement(ControlLabel, null, label)), /* @__PURE__ */ React83.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React83.createElement(
|
|
5635
5731
|
Select3,
|
|
5636
5732
|
{
|
|
5637
5733
|
size: "tiny",
|
|
@@ -5643,11 +5739,11 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
5643
5739
|
renderValue: isCustomSelected ? void 0 : () => selectedOption?.label,
|
|
5644
5740
|
fullWidth: true
|
|
5645
5741
|
},
|
|
5646
|
-
[...RATIO_OPTIONS, { label:
|
|
5647
|
-
({ label: optionLabel, ...props }) => /* @__PURE__ */
|
|
5742
|
+
[...RATIO_OPTIONS, { label: __33("Custom", "elementor"), value: CUSTOM_RATIO }].map(
|
|
5743
|
+
({ label: optionLabel, ...props }) => /* @__PURE__ */ React83.createElement(MenuListItem5, { key: props.value, ...props, value: props.value ?? "" }, optionLabel)
|
|
5648
5744
|
)
|
|
5649
|
-
))), isCustom && /* @__PURE__ */
|
|
5650
|
-
|
|
5745
|
+
))), isCustom && /* @__PURE__ */ React83.createElement(Grid13, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React83.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React83.createElement(
|
|
5746
|
+
TextField11,
|
|
5651
5747
|
{
|
|
5652
5748
|
size: "tiny",
|
|
5653
5749
|
type: "number",
|
|
@@ -5656,11 +5752,11 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
5656
5752
|
value: customWidth,
|
|
5657
5753
|
onChange: handleCustomWidthChange,
|
|
5658
5754
|
InputProps: {
|
|
5659
|
-
startAdornment: /* @__PURE__ */
|
|
5755
|
+
startAdornment: /* @__PURE__ */ React83.createElement(ArrowsMoveHorizontalIcon, { fontSize: "tiny" })
|
|
5660
5756
|
}
|
|
5661
5757
|
}
|
|
5662
|
-
)), /* @__PURE__ */
|
|
5663
|
-
|
|
5758
|
+
)), /* @__PURE__ */ React83.createElement(Grid13, { item: true, xs: 6 }, /* @__PURE__ */ React83.createElement(
|
|
5759
|
+
TextField11,
|
|
5664
5760
|
{
|
|
5665
5761
|
size: "tiny",
|
|
5666
5762
|
type: "number",
|
|
@@ -5669,23 +5765,23 @@ var AspectRatioControl = createControl(({ label }) => {
|
|
|
5669
5765
|
value: customHeight,
|
|
5670
5766
|
onChange: handleCustomHeightChange,
|
|
5671
5767
|
InputProps: {
|
|
5672
|
-
startAdornment: /* @__PURE__ */
|
|
5768
|
+
startAdornment: /* @__PURE__ */ React83.createElement(ArrowsMoveVerticalIcon, { fontSize: "tiny" })
|
|
5673
5769
|
}
|
|
5674
5770
|
}
|
|
5675
5771
|
)))));
|
|
5676
5772
|
});
|
|
5677
5773
|
|
|
5678
5774
|
// src/controls/svg-media-control.tsx
|
|
5679
|
-
import * as
|
|
5680
|
-
import { useEffect as useEffect18, useRef as
|
|
5775
|
+
import * as React94 from "react";
|
|
5776
|
+
import { useEffect as useEffect18, useRef as useRef23, useState as useState24 } from "react";
|
|
5681
5777
|
import { useCurrentUserCapabilities } from "@elementor/editor-current-user";
|
|
5682
5778
|
import { iconPropTypeUtil, svgSrcPropTypeUtil, urlPropTypeUtil as urlPropTypeUtil4 } from "@elementor/editor-props";
|
|
5683
5779
|
import { Box as Box24, Card as Card2, CardOverlay as CardOverlay2, Popover as Popover6, Stack as Stack18, styled as styled12, usePopupState as usePopupState9 } from "@elementor/ui";
|
|
5684
5780
|
import { useWpMediaAttachment as useWpMediaAttachment2, useWpMediaFrame as useWpMediaFrame2 } from "@elementor/wp-media";
|
|
5685
|
-
import { __ as
|
|
5781
|
+
import { __ as __42 } from "@wordpress/i18n";
|
|
5686
5782
|
|
|
5687
5783
|
// src/components/enable-unfiltered-modal.tsx
|
|
5688
|
-
import * as
|
|
5784
|
+
import * as React84 from "react";
|
|
5689
5785
|
import { useState as useState18 } from "react";
|
|
5690
5786
|
import {
|
|
5691
5787
|
Button as Button5,
|
|
@@ -5698,14 +5794,14 @@ import {
|
|
|
5698
5794
|
DialogTitle,
|
|
5699
5795
|
Divider as Divider3
|
|
5700
5796
|
} from "@elementor/ui";
|
|
5701
|
-
import { __ as
|
|
5702
|
-
var ADMIN_TITLE_TEXT =
|
|
5703
|
-
var ADMIN_CONTENT_TEXT =
|
|
5797
|
+
import { __ as __34 } from "@wordpress/i18n";
|
|
5798
|
+
var ADMIN_TITLE_TEXT = __34("Enable Unfiltered Uploads", "elementor");
|
|
5799
|
+
var ADMIN_CONTENT_TEXT = __34(
|
|
5704
5800
|
"Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.",
|
|
5705
5801
|
"elementor"
|
|
5706
5802
|
);
|
|
5707
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT1 =
|
|
5708
|
-
var ADMIN_FAILED_CONTENT_TEXT_PT2 =
|
|
5803
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT1 = __34("Failed to enable unfiltered files upload.", "elementor");
|
|
5804
|
+
var ADMIN_FAILED_CONTENT_TEXT_PT2 = __34(
|
|
5709
5805
|
"You can try again, if the problem persists, please contact support.",
|
|
5710
5806
|
"elementor"
|
|
5711
5807
|
);
|
|
@@ -5730,9 +5826,9 @@ var EnableUnfilteredModal = (props) => {
|
|
|
5730
5826
|
}
|
|
5731
5827
|
};
|
|
5732
5828
|
const dialogProps = { ...props, isPending, handleEnable, isError, onClose };
|
|
5733
|
-
return /* @__PURE__ */
|
|
5829
|
+
return /* @__PURE__ */ React84.createElement(AdminDialog, { ...dialogProps });
|
|
5734
5830
|
};
|
|
5735
|
-
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */
|
|
5831
|
+
var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @__PURE__ */ React84.createElement(Dialog, { open, maxWidth: "sm", onClose: () => onClose(false) }, /* @__PURE__ */ React84.createElement(DialogHeader, { logo: false }, /* @__PURE__ */ React84.createElement(DialogTitle, null, ADMIN_TITLE_TEXT)), /* @__PURE__ */ React84.createElement(Divider3, null), /* @__PURE__ */ React84.createElement(DialogContent, null, /* @__PURE__ */ React84.createElement(DialogContentText, null, isError ? /* @__PURE__ */ React84.createElement(React84.Fragment, null, ADMIN_FAILED_CONTENT_TEXT_PT1, " ", /* @__PURE__ */ React84.createElement("br", null), " ", ADMIN_FAILED_CONTENT_TEXT_PT2) : ADMIN_CONTENT_TEXT)), /* @__PURE__ */ React84.createElement(DialogActions, null, /* @__PURE__ */ React84.createElement(Button5, { size: "medium", color: "secondary", onClick: () => onClose(false) }, __34("Cancel", "elementor")), /* @__PURE__ */ React84.createElement(
|
|
5736
5832
|
Button5,
|
|
5737
5833
|
{
|
|
5738
5834
|
size: "medium",
|
|
@@ -5741,7 +5837,7 @@ var AdminDialog = ({ open, onClose, handleEnable, isPending, isError }) => /* @_
|
|
|
5741
5837
|
color: "primary",
|
|
5742
5838
|
disabled: isPending
|
|
5743
5839
|
},
|
|
5744
|
-
isPending ? /* @__PURE__ */
|
|
5840
|
+
isPending ? /* @__PURE__ */ React84.createElement(CircularProgress2, { size: 24 }) : __34("Enable", "elementor")
|
|
5745
5841
|
)));
|
|
5746
5842
|
|
|
5747
5843
|
// src/controls/icon-library/get-icon-library-anchor.ts
|
|
@@ -5760,8 +5856,8 @@ function measureIconLibraryAnchor(container, buttonGroup) {
|
|
|
5760
5856
|
}
|
|
5761
5857
|
|
|
5762
5858
|
// src/controls/icon-library/icon-library-popover.tsx
|
|
5763
|
-
import * as
|
|
5764
|
-
import { useMemo as
|
|
5859
|
+
import * as React91 from "react";
|
|
5860
|
+
import { useMemo as useMemo13, useRef as useRef22, useState as useState23 } from "react";
|
|
5765
5861
|
import {
|
|
5766
5862
|
PopoverBody as PopoverBody2,
|
|
5767
5863
|
PopoverHeader as PopoverHeader4,
|
|
@@ -5773,7 +5869,7 @@ import { LibraryIcon as LibraryIcon2 } from "@elementor/icons";
|
|
|
5773
5869
|
import { useSessionStorage as useSessionStorage2 } from "@elementor/session";
|
|
5774
5870
|
import { Box as Box21, CircularProgress as CircularProgress3, Divider as Divider5, Link as Link3, Stack as Stack16, styled as styled11, Typography as Typography10 } from "@elementor/ui";
|
|
5775
5871
|
import { useDebounceState } from "@elementor/utils";
|
|
5776
|
-
import { __ as
|
|
5872
|
+
import { __ as __39 } from "@wordpress/i18n";
|
|
5777
5873
|
|
|
5778
5874
|
// src/controls/icon-library/font-awesome-7-data.ts
|
|
5779
5875
|
var FONT_AWESOME_7_LIBRARIES = [
|
|
@@ -6021,12 +6117,12 @@ function toCatalogIcon(icon, library) {
|
|
|
6021
6117
|
}
|
|
6022
6118
|
|
|
6023
6119
|
// src/controls/icon-library/font-awesome-glyph.tsx
|
|
6024
|
-
import * as
|
|
6025
|
-
import { useEffect as useEffect17, useRef as
|
|
6120
|
+
import * as React85 from "react";
|
|
6121
|
+
import { useEffect as useEffect17, useRef as useRef19, useState as useState20 } from "react";
|
|
6026
6122
|
import { Box as Box17 } from "@elementor/ui";
|
|
6027
6123
|
|
|
6028
6124
|
// src/controls/icon-library/icon-library-providers.ts
|
|
6029
|
-
import { useRef as
|
|
6125
|
+
import { useRef as useRef18, useState as useState19 } from "react";
|
|
6030
6126
|
import { useQuery as useQuery2 } from "@elementor/query";
|
|
6031
6127
|
var PROVIDER_ICON_SVG_QUERY_KEY = "icon-library-provider-svg";
|
|
6032
6128
|
var providers = /* @__PURE__ */ new Map();
|
|
@@ -6072,7 +6168,7 @@ async function resolveFromProviders(pickResolver, library, iconValue, signal) {
|
|
|
6072
6168
|
return null;
|
|
6073
6169
|
}
|
|
6074
6170
|
function useStableConcat(lists) {
|
|
6075
|
-
const previous =
|
|
6171
|
+
const previous = useRef18(null);
|
|
6076
6172
|
if (!previous.current || !areSameLists(previous.current.lists, lists)) {
|
|
6077
6173
|
previous.current = { lists, merged: lists.flatMap((list) => list ?? []) };
|
|
6078
6174
|
}
|
|
@@ -6139,15 +6235,15 @@ function pruneNode(node) {
|
|
|
6139
6235
|
var FontAwesomeGlyph = (props) => {
|
|
6140
6236
|
const { icon } = props;
|
|
6141
6237
|
if (icon.lazySvg && !icon.svgMarkup) {
|
|
6142
|
-
return /* @__PURE__ */
|
|
6238
|
+
return /* @__PURE__ */ React85.createElement(LazyProviderGlyph, { ...props });
|
|
6143
6239
|
}
|
|
6144
|
-
return /* @__PURE__ */
|
|
6240
|
+
return /* @__PURE__ */ React85.createElement(ResolvedGlyph, { ...props });
|
|
6145
6241
|
};
|
|
6146
6242
|
var LazyProviderGlyph = (props) => {
|
|
6147
6243
|
const { icon, size } = props;
|
|
6148
6244
|
const [resolved, setResolved] = useState20(null);
|
|
6149
6245
|
const [isVisible, setIsVisible] = useState20(typeof IntersectionObserver === "undefined");
|
|
6150
|
-
const placeholderRef =
|
|
6246
|
+
const placeholderRef = useRef19(null);
|
|
6151
6247
|
const svgMarkup = resolved?.id === icon.id ? resolved.markup : null;
|
|
6152
6248
|
useEffect17(() => {
|
|
6153
6249
|
const element = placeholderRef.current;
|
|
@@ -6173,7 +6269,7 @@ var LazyProviderGlyph = (props) => {
|
|
|
6173
6269
|
return () => controller.abort();
|
|
6174
6270
|
}, [isVisible, icon.id, icon.library, icon.value]);
|
|
6175
6271
|
if (!svgMarkup) {
|
|
6176
|
-
return /* @__PURE__ */
|
|
6272
|
+
return /* @__PURE__ */ React85.createElement(
|
|
6177
6273
|
Box17,
|
|
6178
6274
|
{
|
|
6179
6275
|
component: "span",
|
|
@@ -6183,12 +6279,12 @@ var LazyProviderGlyph = (props) => {
|
|
|
6183
6279
|
}
|
|
6184
6280
|
);
|
|
6185
6281
|
}
|
|
6186
|
-
return /* @__PURE__ */
|
|
6282
|
+
return /* @__PURE__ */ React85.createElement(ResolvedGlyph, { ...props, icon: { ...icon, svgMarkup } });
|
|
6187
6283
|
};
|
|
6188
6284
|
var ResolvedGlyph = ({ icon, size, color, label }) => {
|
|
6189
6285
|
const svgMarkup = sanitizeIconSvgMarkup(icon.svgMarkup);
|
|
6190
6286
|
if (svgMarkup) {
|
|
6191
|
-
return /* @__PURE__ */
|
|
6287
|
+
return /* @__PURE__ */ React85.createElement(
|
|
6192
6288
|
Box17,
|
|
6193
6289
|
{
|
|
6194
6290
|
component: "span",
|
|
@@ -6214,7 +6310,7 @@ var ResolvedGlyph = ({ icon, size, color, label }) => {
|
|
|
6214
6310
|
);
|
|
6215
6311
|
}
|
|
6216
6312
|
if (icon.paths.length > 0) {
|
|
6217
|
-
return /* @__PURE__ */
|
|
6313
|
+
return /* @__PURE__ */ React85.createElement(
|
|
6218
6314
|
"svg",
|
|
6219
6315
|
{
|
|
6220
6316
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -6227,11 +6323,11 @@ var ResolvedGlyph = ({ icon, size, color, label }) => {
|
|
|
6227
6323
|
"aria-label": label,
|
|
6228
6324
|
role: label ? "img" : void 0
|
|
6229
6325
|
},
|
|
6230
|
-
icon.paths.map((path, index) => /* @__PURE__ */
|
|
6326
|
+
icon.paths.map((path, index) => /* @__PURE__ */ React85.createElement("path", { key: `${index}-${path}`, d: path }))
|
|
6231
6327
|
);
|
|
6232
6328
|
}
|
|
6233
6329
|
if (icon.glyphClass) {
|
|
6234
|
-
return /* @__PURE__ */
|
|
6330
|
+
return /* @__PURE__ */ React85.createElement(
|
|
6235
6331
|
"i",
|
|
6236
6332
|
{
|
|
6237
6333
|
className: icon.glyphClass,
|
|
@@ -6245,7 +6341,7 @@ var ResolvedGlyph = ({ icon, size, color, label }) => {
|
|
|
6245
6341
|
};
|
|
6246
6342
|
|
|
6247
6343
|
// src/controls/icon-library/icon-library-filter.tsx
|
|
6248
|
-
import * as
|
|
6344
|
+
import * as React86 from "react";
|
|
6249
6345
|
import { useId as useId4 } from "react";
|
|
6250
6346
|
import {
|
|
6251
6347
|
CheckIcon,
|
|
@@ -6270,7 +6366,7 @@ import {
|
|
|
6270
6366
|
Typography as Typography9,
|
|
6271
6367
|
usePopupState as usePopupState8
|
|
6272
6368
|
} from "@elementor/ui";
|
|
6273
|
-
import { __ as
|
|
6369
|
+
import { __ as __35 } from "@wordpress/i18n";
|
|
6274
6370
|
|
|
6275
6371
|
// src/controls/icon-library/icon-library-tooltip.ts
|
|
6276
6372
|
var ICON_LIBRARY_ACTION_TOOLTIP_ENTER_DELAY = 0;
|
|
@@ -6304,21 +6400,21 @@ var IconLibraryFilter = ({ value, onChange }) => {
|
|
|
6304
6400
|
const entries = getFilterEntries();
|
|
6305
6401
|
const selectableValues = entries.flatMap((entry) => entry.type === FILTER_TYPE_ITEM ? [entry.value] : []);
|
|
6306
6402
|
const isFiltered = value.length > 0;
|
|
6307
|
-
const filterButtonLabel = isFiltered ?
|
|
6403
|
+
const filterButtonLabel = isFiltered ? __35("Filter by library, active", "elementor") : __35("Filter by library", "elementor");
|
|
6308
6404
|
const handleLibraryClick = (library) => {
|
|
6309
6405
|
const nextValue = value.includes(library) ? value.filter((selectedLibrary) => selectedLibrary !== library) : [...value, library];
|
|
6310
6406
|
onChange(nextValue.length === selectableValues.length ? [] : nextValue);
|
|
6311
6407
|
};
|
|
6312
|
-
return /* @__PURE__ */
|
|
6408
|
+
return /* @__PURE__ */ React86.createElement(React86.Fragment, null, /* @__PURE__ */ React86.createElement(
|
|
6313
6409
|
Tooltip8,
|
|
6314
6410
|
{
|
|
6315
|
-
title:
|
|
6411
|
+
title: __35("Filter by library", "elementor"),
|
|
6316
6412
|
placement: "top",
|
|
6317
6413
|
enterDelay: ICON_LIBRARY_ACTION_TOOLTIP_ENTER_DELAY,
|
|
6318
6414
|
enterNextDelay: ICON_LIBRARY_ACTION_TOOLTIP_ENTER_DELAY,
|
|
6319
6415
|
disableInteractive: true
|
|
6320
6416
|
},
|
|
6321
|
-
/* @__PURE__ */
|
|
6417
|
+
/* @__PURE__ */ React86.createElement(
|
|
6322
6418
|
ToggleButton2,
|
|
6323
6419
|
{
|
|
6324
6420
|
"aria-label": filterButtonLabel,
|
|
@@ -6329,8 +6425,8 @@ var IconLibraryFilter = ({ value, onChange }) => {
|
|
|
6329
6425
|
...bindToggle2(popupState),
|
|
6330
6426
|
"aria-expanded": popupState.isOpen
|
|
6331
6427
|
},
|
|
6332
|
-
/* @__PURE__ */
|
|
6333
|
-
isFiltered ? /* @__PURE__ */
|
|
6428
|
+
/* @__PURE__ */ React86.createElement(FilterIcon2, { fontSize: "tiny" }),
|
|
6429
|
+
isFiltered ? /* @__PURE__ */ React86.createElement(
|
|
6334
6430
|
Box18,
|
|
6335
6431
|
{
|
|
6336
6432
|
component: "span",
|
|
@@ -6347,14 +6443,14 @@ var IconLibraryFilter = ({ value, onChange }) => {
|
|
|
6347
6443
|
}
|
|
6348
6444
|
) : null
|
|
6349
6445
|
)
|
|
6350
|
-
), /* @__PURE__ */
|
|
6446
|
+
), /* @__PURE__ */ React86.createElement(
|
|
6351
6447
|
Menu4,
|
|
6352
6448
|
{
|
|
6353
6449
|
...bindMenu3(popupState),
|
|
6354
6450
|
MenuListProps: {
|
|
6355
6451
|
dense: true,
|
|
6356
6452
|
autoFocusItem: true,
|
|
6357
|
-
"aria-label":
|
|
6453
|
+
"aria-label": __35("Filter by library", "elementor")
|
|
6358
6454
|
},
|
|
6359
6455
|
sx: { "& .MuiPaper-root": { minWidth: FILTER_MENU_WIDTH } }
|
|
6360
6456
|
},
|
|
@@ -6366,13 +6462,13 @@ var IconLibraryFilter = ({ value, onChange }) => {
|
|
|
6366
6462
|
var renderFilterEntry = (entry, index, selectedLibraries, isFiltered, onAllIconsClick, onLibraryClick) => {
|
|
6367
6463
|
if (entry.type === FILTER_TYPE_GROUP) {
|
|
6368
6464
|
return [
|
|
6369
|
-
/* @__PURE__ */
|
|
6370
|
-
/* @__PURE__ */
|
|
6465
|
+
/* @__PURE__ */ React86.createElement(Divider4, { key: `divider-${index}` }),
|
|
6466
|
+
/* @__PURE__ */ React86.createElement(ListSubheader, { key: `group-${index}`, disableSticky: true }, entry.label)
|
|
6371
6467
|
];
|
|
6372
6468
|
}
|
|
6373
6469
|
if (entry.type === FILTER_TYPE_ALL) {
|
|
6374
6470
|
return [
|
|
6375
|
-
/* @__PURE__ */
|
|
6471
|
+
/* @__PURE__ */ React86.createElement(
|
|
6376
6472
|
MenuItem2,
|
|
6377
6473
|
{
|
|
6378
6474
|
key: `all-${index}`,
|
|
@@ -6387,7 +6483,7 @@ var renderFilterEntry = (entry, index, selectedLibraries, isFiltered, onAllIcons
|
|
|
6387
6483
|
}
|
|
6388
6484
|
const isSelected = selectedLibraries.includes(entry.value);
|
|
6389
6485
|
return [
|
|
6390
|
-
/* @__PURE__ */
|
|
6486
|
+
/* @__PURE__ */ React86.createElement(
|
|
6391
6487
|
MenuItem2,
|
|
6392
6488
|
{
|
|
6393
6489
|
key: entry.value,
|
|
@@ -6401,7 +6497,7 @@ var renderFilterEntry = (entry, index, selectedLibraries, isFiltered, onAllIcons
|
|
|
6401
6497
|
];
|
|
6402
6498
|
};
|
|
6403
6499
|
var getFilterIcon = (icon) => FILTER_ICONS[icon ?? ""] ?? LibraryIcon;
|
|
6404
|
-
var renderFilterMenuItemContent = (label, Icon, selected) => /* @__PURE__ */
|
|
6500
|
+
var renderFilterMenuItemContent = (label, Icon, selected) => /* @__PURE__ */ React86.createElement(Stack15, { direction: "row", alignItems: "center", gap: 1, width: "100%" }, /* @__PURE__ */ React86.createElement(Icon, { fontSize: "tiny" }), /* @__PURE__ */ React86.createElement(Typography9, { variant: "caption", sx: { flex: 1 } }, label), selected ? /* @__PURE__ */ React86.createElement(CheckIcon, { fontSize: "tiny", "aria-hidden": "true" }) : null);
|
|
6405
6501
|
function getFilterEntries() {
|
|
6406
6502
|
const filter = window.elementorCommon?.config?.fontAwesome?.v7?.filter;
|
|
6407
6503
|
if (!Array.isArray(filter)) {
|
|
@@ -6440,11 +6536,12 @@ function parseFilterEntry(value) {
|
|
|
6440
6536
|
}
|
|
6441
6537
|
|
|
6442
6538
|
// src/controls/icon-library/icon-library-grid.tsx
|
|
6443
|
-
import * as
|
|
6444
|
-
import { useLayoutEffect as useLayoutEffect3, useRef as
|
|
6539
|
+
import * as React87 from "react";
|
|
6540
|
+
import { useLayoutEffect as useLayoutEffect3, useRef as useRef20, useState as useState21 } from "react";
|
|
6541
|
+
import { useRovingFocus } from "@elementor/editor-ui";
|
|
6445
6542
|
import { Box as Box19, Tooltip as Tooltip9, useTheme as useTheme4 } from "@elementor/ui";
|
|
6446
|
-
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
6447
|
-
import { __ as
|
|
6543
|
+
import { defaultRangeExtractor, useVirtualizer } from "@tanstack/react-virtual";
|
|
6544
|
+
import { __ as __36 } from "@wordpress/i18n";
|
|
6448
6545
|
var ICON_LIBRARY_GRID_FALLBACK_COLUMN_COUNT = 4;
|
|
6449
6546
|
var ICON_LIBRARY_GRID_MIN_CELL_SIZE = 52;
|
|
6450
6547
|
var ICON_LIBRARY_GRID_TOOLTIP_ENTER_DELAY = 1e3;
|
|
@@ -6480,9 +6577,7 @@ var IconLibraryGrid = ({
|
|
|
6480
6577
|
noResultsComponent
|
|
6481
6578
|
}) => {
|
|
6482
6579
|
const theme = useTheme4();
|
|
6483
|
-
const containerRef =
|
|
6484
|
-
const cellRefs = useRef19(/* @__PURE__ */ new Map());
|
|
6485
|
-
const shouldRestoreFocusRef = useRef19(false);
|
|
6580
|
+
const containerRef = useRef20(null);
|
|
6486
6581
|
const selectedIndex = items2.findIndex((item) => item.id === selectedValue);
|
|
6487
6582
|
const [focusedIndex, setFocusedIndex] = useState21(selectedIndex >= 0 ? selectedIndex : 0);
|
|
6488
6583
|
const [{ columnCount, cellSize }, setGridMetrics] = useState21(() => getGridMetrics(0, 0, 0));
|
|
@@ -6496,7 +6591,15 @@ var IconLibraryGrid = ({
|
|
|
6496
6591
|
gap: cellGap,
|
|
6497
6592
|
paddingStart: verticalPadding,
|
|
6498
6593
|
paddingEnd: verticalPadding,
|
|
6499
|
-
overscan: GRID_OVERSCAN
|
|
6594
|
+
overscan: GRID_OVERSCAN,
|
|
6595
|
+
rangeExtractor: (range) => {
|
|
6596
|
+
const rowIndexes = defaultRangeExtractor(range);
|
|
6597
|
+
const focusedRow = Math.floor(focusedIndex / columnCount);
|
|
6598
|
+
if (items2.length === 0 || rowIndexes.includes(focusedRow)) {
|
|
6599
|
+
return rowIndexes;
|
|
6600
|
+
}
|
|
6601
|
+
return [...rowIndexes, focusedRow].sort((a, b) => a - b);
|
|
6602
|
+
}
|
|
6500
6603
|
});
|
|
6501
6604
|
const focusedItem = items2[focusedIndex];
|
|
6502
6605
|
const visibleRowIndexes = virtualizer.getVirtualIndexes().join(",");
|
|
@@ -6515,17 +6618,10 @@ var IconLibraryGrid = ({
|
|
|
6515
6618
|
virtualizer.scrollToIndex(Math.floor(selectedIndex / columnCount), { align: "center" });
|
|
6516
6619
|
}
|
|
6517
6620
|
}, [cellSize, columnCount, items2, selectedIndex, selectedValue]);
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
const cell = cellRefs.current.get(focusedItem.id);
|
|
6523
|
-
if (!cell) {
|
|
6524
|
-
return;
|
|
6525
|
-
}
|
|
6526
|
-
cell.focus();
|
|
6527
|
-
shouldRestoreFocusRef.current = false;
|
|
6528
|
-
}, [focusedItem, visibleRowIndexes]);
|
|
6621
|
+
const { registerRef, requestFocus } = useRovingFocus({
|
|
6622
|
+
tabbableKey: focusedItem?.id,
|
|
6623
|
+
mountedSignature: visibleRowIndexes
|
|
6624
|
+
});
|
|
6529
6625
|
useLayoutEffect3(() => {
|
|
6530
6626
|
const container = containerRef.current;
|
|
6531
6627
|
if (!container) {
|
|
@@ -6551,7 +6647,7 @@ var IconLibraryGrid = ({
|
|
|
6551
6647
|
if (nextIndex < 0 || nextIndex >= items2.length) {
|
|
6552
6648
|
return;
|
|
6553
6649
|
}
|
|
6554
|
-
|
|
6650
|
+
requestFocus();
|
|
6555
6651
|
setFocusedIndex(nextIndex);
|
|
6556
6652
|
virtualizer.scrollToIndex(Math.floor(nextIndex / columnCount));
|
|
6557
6653
|
};
|
|
@@ -6593,7 +6689,7 @@ var IconLibraryGrid = ({
|
|
|
6593
6689
|
moveFocus(event.key === "Home" ? rowStart : rowEnd);
|
|
6594
6690
|
}
|
|
6595
6691
|
};
|
|
6596
|
-
return /* @__PURE__ */
|
|
6692
|
+
return /* @__PURE__ */ React87.createElement(
|
|
6597
6693
|
Box19,
|
|
6598
6694
|
{
|
|
6599
6695
|
ref: containerRef,
|
|
@@ -6605,11 +6701,11 @@ var IconLibraryGrid = ({
|
|
|
6605
6701
|
overflowY: "auto"
|
|
6606
6702
|
}
|
|
6607
6703
|
},
|
|
6608
|
-
items2.length === 0 && noResultsComponent ? noResultsComponent : /* @__PURE__ */
|
|
6704
|
+
items2.length === 0 && noResultsComponent ? noResultsComponent : /* @__PURE__ */ React87.createElement(
|
|
6609
6705
|
Box19,
|
|
6610
6706
|
{
|
|
6611
6707
|
role: "grid",
|
|
6612
|
-
"aria-label":
|
|
6708
|
+
"aria-label": __36("Icons", "elementor"),
|
|
6613
6709
|
"aria-rowcount": rowCount,
|
|
6614
6710
|
"aria-colcount": columnCount,
|
|
6615
6711
|
"data-testid": "icon-library-grid",
|
|
@@ -6623,7 +6719,7 @@ var IconLibraryGrid = ({
|
|
|
6623
6719
|
virtualizer.getVirtualItems().map((virtualRow) => {
|
|
6624
6720
|
const startIndex = virtualRow.index * columnCount;
|
|
6625
6721
|
const rowItems = items2.slice(startIndex, startIndex + columnCount);
|
|
6626
|
-
return /* @__PURE__ */
|
|
6722
|
+
return /* @__PURE__ */ React87.createElement(
|
|
6627
6723
|
Box19,
|
|
6628
6724
|
{
|
|
6629
6725
|
key: virtualRow.key,
|
|
@@ -6647,14 +6743,14 @@ var IconLibraryGrid = ({
|
|
|
6647
6743
|
const index = startIndex + columnIndex;
|
|
6648
6744
|
const isSelected = selectedValue === item.id;
|
|
6649
6745
|
const tabIndex = focusedIndex === index ? 0 : -1;
|
|
6650
|
-
return /* @__PURE__ */
|
|
6746
|
+
return /* @__PURE__ */ React87.createElement(
|
|
6651
6747
|
Box19,
|
|
6652
6748
|
{
|
|
6653
6749
|
key: item.id,
|
|
6654
6750
|
role: "presentation",
|
|
6655
6751
|
sx: { minWidth: 0, minHeight: 0, width: "100%", height: "100%" }
|
|
6656
6752
|
},
|
|
6657
|
-
/* @__PURE__ */
|
|
6753
|
+
/* @__PURE__ */ React87.createElement(
|
|
6658
6754
|
Tooltip9,
|
|
6659
6755
|
{
|
|
6660
6756
|
title: item.label,
|
|
@@ -6664,7 +6760,7 @@ var IconLibraryGrid = ({
|
|
|
6664
6760
|
disableInteractive: true,
|
|
6665
6761
|
disableFocusListener: true
|
|
6666
6762
|
},
|
|
6667
|
-
/* @__PURE__ */
|
|
6763
|
+
/* @__PURE__ */ React87.createElement(
|
|
6668
6764
|
Box19,
|
|
6669
6765
|
{
|
|
6670
6766
|
component: "button",
|
|
@@ -6674,13 +6770,7 @@ var IconLibraryGrid = ({
|
|
|
6674
6770
|
"aria-label": item.label,
|
|
6675
6771
|
"aria-selected": isSelected,
|
|
6676
6772
|
tabIndex,
|
|
6677
|
-
ref: (
|
|
6678
|
-
if (node) {
|
|
6679
|
-
cellRefs.current.set(item.id, node);
|
|
6680
|
-
} else {
|
|
6681
|
-
cellRefs.current.delete(item.id);
|
|
6682
|
-
}
|
|
6683
|
-
},
|
|
6773
|
+
ref: registerRef(item.id),
|
|
6684
6774
|
onClick: () => {
|
|
6685
6775
|
onSelect(item.id);
|
|
6686
6776
|
onClose();
|
|
@@ -6719,7 +6809,7 @@ var IconLibraryGrid = ({
|
|
|
6719
6809
|
}
|
|
6720
6810
|
}
|
|
6721
6811
|
},
|
|
6722
|
-
/* @__PURE__ */
|
|
6812
|
+
/* @__PURE__ */ React87.createElement(
|
|
6723
6813
|
FontAwesomeGlyph,
|
|
6724
6814
|
{
|
|
6725
6815
|
icon: { ...item, value: item.iconValue ?? item.value },
|
|
@@ -6738,13 +6828,13 @@ var IconLibraryGrid = ({
|
|
|
6738
6828
|
};
|
|
6739
6829
|
|
|
6740
6830
|
// src/controls/icon-library/icon-library-upload-action.tsx
|
|
6741
|
-
import * as
|
|
6742
|
-
import { forwardRef as forwardRef11, useRef as
|
|
6831
|
+
import * as React88 from "react";
|
|
6832
|
+
import { forwardRef as forwardRef11, useRef as useRef21, useState as useState22 } from "react";
|
|
6743
6833
|
import { PromotionPopover, useCanvasClickHandler } from "@elementor/editor-ui";
|
|
6744
6834
|
import { UploadIcon as UploadIcon2 } from "@elementor/icons";
|
|
6745
6835
|
import { createReplaceableLocation as createReplaceableLocation2 } from "@elementor/locations";
|
|
6746
6836
|
import { Box as Box20, IconButton as IconButton8, Tooltip as Tooltip10 } from "@elementor/ui";
|
|
6747
|
-
import { __ as
|
|
6837
|
+
import { __ as __37 } from "@wordpress/i18n";
|
|
6748
6838
|
|
|
6749
6839
|
// src/utils/tracking.ts
|
|
6750
6840
|
import { getSelectedElements } from "@elementor/editor-elements";
|
|
@@ -6790,18 +6880,18 @@ var TRACKING_DATA = { target_name: "icon_library_upload", location_l2: "general"
|
|
|
6790
6880
|
var { Slot: IconLibraryUploadActionSlot, inject: injectIntoIconLibraryUploadAction } = createReplaceableLocation2();
|
|
6791
6881
|
var IconLibraryUploadButton = forwardRef11(
|
|
6792
6882
|
(props, ref) => {
|
|
6793
|
-
const label =
|
|
6794
|
-
return /* @__PURE__ */
|
|
6883
|
+
const label = __37("Upload library", "elementor");
|
|
6884
|
+
return /* @__PURE__ */ React88.createElement(Tooltip10, { title: label, placement: "top" }, /* @__PURE__ */ React88.createElement(IconButton8, { ref, size: "tiny", "aria-label": label, ...props }, /* @__PURE__ */ React88.createElement(UploadIcon2, { fontSize: "tiny" })));
|
|
6795
6885
|
}
|
|
6796
6886
|
);
|
|
6797
6887
|
var IconLibraryUploadPromotion = ({
|
|
6798
6888
|
ctaUrl = ICON_LIBRARY_UPLOAD_UPGRADE_URL,
|
|
6799
|
-
ctaText =
|
|
6800
|
-
title =
|
|
6801
|
-
content =
|
|
6889
|
+
ctaText = __37("Upgrade now", "elementor"),
|
|
6890
|
+
title = __37("Upload custom icons", "elementor"),
|
|
6891
|
+
content = __37("Add your own icon font library to use across your site.", "elementor")
|
|
6802
6892
|
}) => {
|
|
6803
6893
|
const [isOpen, setIsOpen] = useState22(false);
|
|
6804
|
-
const triggerRef =
|
|
6894
|
+
const triggerRef = useRef21(null);
|
|
6805
6895
|
const canSeePromotions = !!window.elementor?.config?.v4Promotions;
|
|
6806
6896
|
const close = () => {
|
|
6807
6897
|
setIsOpen(false);
|
|
@@ -6817,7 +6907,7 @@ var IconLibraryUploadPromotion = ({
|
|
|
6817
6907
|
if (!canSeePromotions) {
|
|
6818
6908
|
return null;
|
|
6819
6909
|
}
|
|
6820
|
-
return /* @__PURE__ */
|
|
6910
|
+
return /* @__PURE__ */ React88.createElement(
|
|
6821
6911
|
PromotionPopover,
|
|
6822
6912
|
{
|
|
6823
6913
|
open: isOpen,
|
|
@@ -6833,7 +6923,7 @@ var IconLibraryUploadPromotion = ({
|
|
|
6833
6923
|
},
|
|
6834
6924
|
onCtaClick: () => trackUpgradePromotionClick(TRACKING_DATA)
|
|
6835
6925
|
},
|
|
6836
|
-
/* @__PURE__ */
|
|
6926
|
+
/* @__PURE__ */ React88.createElement(Box20, { component: "span", sx: { display: "inline-flex" } }, /* @__PURE__ */ React88.createElement(
|
|
6837
6927
|
IconLibraryUploadButton,
|
|
6838
6928
|
{
|
|
6839
6929
|
ref: triggerRef,
|
|
@@ -6848,22 +6938,22 @@ var IconLibraryUploadAction = () => {
|
|
|
6848
6938
|
if (window.elementorPro) {
|
|
6849
6939
|
return null;
|
|
6850
6940
|
}
|
|
6851
|
-
return /* @__PURE__ */
|
|
6941
|
+
return /* @__PURE__ */ React88.createElement(IconLibraryUploadPromotion, null);
|
|
6852
6942
|
};
|
|
6853
6943
|
|
|
6854
6944
|
// src/controls/icon-library/icon-library-view-toggle.tsx
|
|
6855
|
-
import * as
|
|
6945
|
+
import * as React89 from "react";
|
|
6856
6946
|
import { ListIcon, WidgetsIcon } from "@elementor/icons";
|
|
6857
6947
|
import { IconButton as IconButton9, Tooltip as Tooltip11 } from "@elementor/ui";
|
|
6858
|
-
import { __ as
|
|
6948
|
+
import { __ as __38 } from "@wordpress/i18n";
|
|
6859
6949
|
var HEADER_ACTION_GAP = 0.5;
|
|
6860
6950
|
var IconLibraryViewToggle = ({ value, onChange }) => {
|
|
6861
6951
|
const isGrid = value === "grid";
|
|
6862
6952
|
const nextView = isGrid ? "list" : "grid";
|
|
6863
6953
|
const ViewIcon = isGrid ? WidgetsIcon : ListIcon;
|
|
6864
|
-
const viewButtonLabel = isGrid ?
|
|
6865
|
-
const viewButtonAction = isGrid ?
|
|
6866
|
-
return /* @__PURE__ */
|
|
6954
|
+
const viewButtonLabel = isGrid ? __38("Grid view", "elementor") : __38("List view", "elementor");
|
|
6955
|
+
const viewButtonAction = isGrid ? __38("Switch to list view", "elementor") : __38("Switch to grid view", "elementor");
|
|
6956
|
+
return /* @__PURE__ */ React89.createElement(
|
|
6867
6957
|
Tooltip11,
|
|
6868
6958
|
{
|
|
6869
6959
|
title: viewButtonLabel,
|
|
@@ -6872,7 +6962,7 @@ var IconLibraryViewToggle = ({ value, onChange }) => {
|
|
|
6872
6962
|
enterNextDelay: ICON_LIBRARY_ACTION_TOOLTIP_ENTER_DELAY,
|
|
6873
6963
|
disableInteractive: true
|
|
6874
6964
|
},
|
|
6875
|
-
/* @__PURE__ */
|
|
6965
|
+
/* @__PURE__ */ React89.createElement(
|
|
6876
6966
|
IconButton9,
|
|
6877
6967
|
{
|
|
6878
6968
|
"aria-label": viewButtonAction,
|
|
@@ -6880,7 +6970,7 @@ var IconLibraryViewToggle = ({ value, onChange }) => {
|
|
|
6880
6970
|
onClick: () => onChange(nextView),
|
|
6881
6971
|
sx: { flexShrink: 0, mr: HEADER_ACTION_GAP }
|
|
6882
6972
|
},
|
|
6883
|
-
/* @__PURE__ */
|
|
6973
|
+
/* @__PURE__ */ React89.createElement(ViewIcon, { fontSize: "tiny" })
|
|
6884
6974
|
)
|
|
6885
6975
|
);
|
|
6886
6976
|
};
|
|
@@ -6901,11 +6991,11 @@ function mergeIconsById(primary, secondary) {
|
|
|
6901
6991
|
}
|
|
6902
6992
|
|
|
6903
6993
|
// src/controls/icon-library/svg-element-icon.tsx
|
|
6904
|
-
import * as
|
|
6994
|
+
import * as React90 from "react";
|
|
6905
6995
|
import { SvgIcon } from "@elementor/ui";
|
|
6906
6996
|
var SVG_ELEMENT_ICON_PATH = "M502 772c10 0 19-6 24-14l201-351c4-9 4-19 0-27-5-9-14-14-24-14h-401c-10 0-19 5-24 14-4 8-5 18 0 27l201 351c5 8 14 14 23 14z m0-82l-154-270h309l-154 270z m-323-471c-6 0-12-2-16-7-4-4-7-10-7-16v-201c0-6 3-12 7-16 4-5 10-7 16-7h201c6 0 12 2 16 7 5 4 7 10 7 16v201c0 6-2 12-7 16-4 5-10 7-16 7h-201z m-54 32c14 14 34 22 54 22h201c20 0 40-8 55-22 14-15 22-35 22-55v-201c0-20-8-40-22-54-15-15-35-23-55-23h-201c-20 0-40 8-54 23-15 14-23 34-23 54v201c0 20 8 40 23 55z m480-30c34 33 79 52 126 52s92-19 125-52c34-33 52-78 52-125s-18-93-52-126c-33-33-78-52-125-52s-92 19-126 52c-33 33-52 78-52 126s19 92 52 125z m126-2c-33 0-64-13-87-36-24-23-37-55-37-87s13-65 37-88c23-23 54-36 87-36s64 13 87 36c23 23 36 55 36 88s-13 64-36 87c-23 23-54 36-87 36z";
|
|
6907
|
-
var SvgElementIcon =
|
|
6908
|
-
(props, ref) => /* @__PURE__ */
|
|
6997
|
+
var SvgElementIcon = React90.forwardRef(
|
|
6998
|
+
(props, ref) => /* @__PURE__ */ React90.createElement(SvgIcon, { viewBox: "0 0 1000 1000", ...props, ref }, /* @__PURE__ */ React90.createElement("g", { transform: "translate(0, 850) scale(1, -1)" }, /* @__PURE__ */ React90.createElement("path", { d: SVG_ELEMENT_ICON_PATH })))
|
|
6909
6999
|
);
|
|
6910
7000
|
|
|
6911
7001
|
// src/controls/icon-library/use-font-awesome-7-catalog.ts
|
|
@@ -6964,19 +7054,20 @@ var IconLibraryPopover = ({
|
|
|
6964
7054
|
const view = isIconLibraryView(storedView) ? storedView : DEFAULT_ICON_LIBRARY_VIEW;
|
|
6965
7055
|
const { data: fontAwesomeIcons = [], isLoading: isFontAwesomeLoading } = useFontAwesome7Catalog(open);
|
|
6966
7056
|
const { data: providerIcons = [], isLoading: isProviderLoading } = useIconLibraryProviderIcons(open);
|
|
6967
|
-
const icons =
|
|
7057
|
+
const icons = useMemo13(
|
|
6968
7058
|
() => mergeIconsById(fontAwesomeIcons, providerIcons),
|
|
6969
7059
|
[providerIcons, fontAwesomeIcons]
|
|
6970
7060
|
);
|
|
6971
|
-
const items2 =
|
|
7061
|
+
const items2 = useMemo13(
|
|
6972
7062
|
() => createIconLibraryItems(icons, searchValue, activeLibraries),
|
|
6973
7063
|
[activeLibraries, icons, searchValue]
|
|
6974
7064
|
);
|
|
6975
7065
|
const isLoading = isFontAwesomeLoading || isProviderLoading && items2.length === 0;
|
|
6976
|
-
const selectedValue =
|
|
7066
|
+
const selectedValue = useMemo13(
|
|
6977
7067
|
() => findFontAwesome7Icon(icons, selectedIconClass, selectedIconLibrary)?.id,
|
|
6978
7068
|
[icons, selectedIconClass, selectedIconLibrary]
|
|
6979
7069
|
);
|
|
7070
|
+
const contentRef = useRef22(null);
|
|
6980
7071
|
const handleClose = () => {
|
|
6981
7072
|
setSearchValue("");
|
|
6982
7073
|
setActiveLibraries([]);
|
|
@@ -6992,18 +7083,28 @@ var IconLibraryPopover = ({
|
|
|
6992
7083
|
library: icon.library
|
|
6993
7084
|
});
|
|
6994
7085
|
};
|
|
7086
|
+
const handleSearchKeyDown = (event) => {
|
|
7087
|
+
if (event.key !== "ArrowDown" || view !== "list") {
|
|
7088
|
+
return;
|
|
7089
|
+
}
|
|
7090
|
+
const option = contentRef.current?.querySelector('[role="option"][tabindex="0"]');
|
|
7091
|
+
if (option) {
|
|
7092
|
+
event.preventDefault();
|
|
7093
|
+
option.focus();
|
|
7094
|
+
}
|
|
7095
|
+
};
|
|
6995
7096
|
const handleClearSearch = () => {
|
|
6996
7097
|
setSearchValue("");
|
|
6997
7098
|
};
|
|
6998
|
-
return /* @__PURE__ */
|
|
7099
|
+
return /* @__PURE__ */ React91.createElement(PopoverBody2, { width, fillWidth: true, id: "icon-library" }, /* @__PURE__ */ React91.createElement(
|
|
6999
7100
|
PopoverHeader4,
|
|
7000
7101
|
{
|
|
7001
|
-
title:
|
|
7102
|
+
title: __39("Icon library", "elementor"),
|
|
7002
7103
|
onClose: handleClose,
|
|
7003
|
-
icon: /* @__PURE__ */
|
|
7104
|
+
icon: /* @__PURE__ */ React91.createElement(LibraryIcon2, { fontSize: "tiny" }),
|
|
7004
7105
|
actions: [
|
|
7005
|
-
/* @__PURE__ */
|
|
7006
|
-
/* @__PURE__ */
|
|
7106
|
+
/* @__PURE__ */ React91.createElement(IconLibraryViewToggle, { key: "view", value: view, onChange: setStoredView }),
|
|
7107
|
+
/* @__PURE__ */ React91.createElement(IconLibraryUploadActionSlot, { key: "upload" }, /* @__PURE__ */ React91.createElement(IconLibraryUploadAction, null))
|
|
7007
7108
|
],
|
|
7008
7109
|
sx: {
|
|
7009
7110
|
pl: ICON_LIBRARY_INLINE_SPACING,
|
|
@@ -7011,7 +7112,7 @@ var IconLibraryPopover = ({
|
|
|
7011
7112
|
"& .MuiTypography-subtitle2": { fontSize: ICON_LIBRARY_TITLE_SIZE }
|
|
7012
7113
|
}
|
|
7013
7114
|
}
|
|
7014
|
-
), /* @__PURE__ */
|
|
7115
|
+
), /* @__PURE__ */ React91.createElement(
|
|
7015
7116
|
Stack16,
|
|
7016
7117
|
{
|
|
7017
7118
|
direction: "row",
|
|
@@ -7019,18 +7120,18 @@ var IconLibraryPopover = ({
|
|
|
7019
7120
|
gap: 1,
|
|
7020
7121
|
sx: { px: ICON_LIBRARY_INLINE_SPACING, pb: ICON_LIBRARY_SEARCH_PADDING_BOTTOM }
|
|
7021
7122
|
},
|
|
7022
|
-
/* @__PURE__ */
|
|
7123
|
+
/* @__PURE__ */ React91.createElement(Box21, { onKeyDown: handleSearchKeyDown, sx: { flex: 1, minWidth: 0 } }, /* @__PURE__ */ React91.createElement(
|
|
7023
7124
|
SearchField2,
|
|
7024
7125
|
{
|
|
7025
7126
|
value: searchInputValue,
|
|
7026
7127
|
onSearch: handleSearchChange,
|
|
7027
|
-
placeholder:
|
|
7128
|
+
placeholder: __39("Search", "elementor"),
|
|
7028
7129
|
id: "icon-library-search",
|
|
7029
|
-
sx: {
|
|
7130
|
+
sx: { width: "100%", px: 0, pb: 0 }
|
|
7030
7131
|
}
|
|
7031
|
-
),
|
|
7032
|
-
/* @__PURE__ */
|
|
7033
|
-
), /* @__PURE__ */
|
|
7132
|
+
)),
|
|
7133
|
+
/* @__PURE__ */ React91.createElement(IconLibraryFilter, { value: activeLibraries, onChange: setActiveLibraries })
|
|
7134
|
+
), /* @__PURE__ */ React91.createElement(Divider5, null), /* @__PURE__ */ React91.createElement(Box21, { ref: contentRef, sx: { flex: 1, overflow: "hidden", minHeight: 0, minWidth: 0 } }, /* @__PURE__ */ React91.createElement(
|
|
7034
7135
|
IconLibraryContent,
|
|
7035
7136
|
{
|
|
7036
7137
|
isLoading,
|
|
@@ -7057,9 +7158,9 @@ var IconLibraryContent = ({
|
|
|
7057
7158
|
onClearSearch
|
|
7058
7159
|
}) => {
|
|
7059
7160
|
if (isLoading) {
|
|
7060
|
-
return /* @__PURE__ */
|
|
7161
|
+
return /* @__PURE__ */ React91.createElement(IconLibraryLoadingState, null);
|
|
7061
7162
|
}
|
|
7062
|
-
const emptyState = /* @__PURE__ */
|
|
7163
|
+
const emptyState = /* @__PURE__ */ React91.createElement(
|
|
7063
7164
|
IconLibraryEmptyState,
|
|
7064
7165
|
{
|
|
7065
7166
|
searchValue,
|
|
@@ -7068,7 +7169,7 @@ var IconLibraryContent = ({
|
|
|
7068
7169
|
}
|
|
7069
7170
|
);
|
|
7070
7171
|
if (view === "grid") {
|
|
7071
|
-
return /* @__PURE__ */
|
|
7172
|
+
return /* @__PURE__ */ React91.createElement(Box21, { sx: { width: "100%", height: "100%", minWidth: 0, minHeight: 0 } }, /* @__PURE__ */ React91.createElement(
|
|
7072
7173
|
IconLibraryGrid,
|
|
7073
7174
|
{
|
|
7074
7175
|
items: items2,
|
|
@@ -7079,7 +7180,7 @@ var IconLibraryContent = ({
|
|
|
7079
7180
|
}
|
|
7080
7181
|
));
|
|
7081
7182
|
}
|
|
7082
|
-
return /* @__PURE__ */
|
|
7183
|
+
return /* @__PURE__ */ React91.createElement(
|
|
7083
7184
|
PopoverMenuList2,
|
|
7084
7185
|
{
|
|
7085
7186
|
items: items2,
|
|
@@ -7089,25 +7190,26 @@ var IconLibraryContent = ({
|
|
|
7089
7190
|
onClose,
|
|
7090
7191
|
itemHeight: ICON_LIBRARY_ROW_HEIGHT,
|
|
7091
7192
|
menuItemContentTemplate: IconLibraryRow,
|
|
7193
|
+
rovingFocus: true,
|
|
7092
7194
|
noResultsComponent: emptyState,
|
|
7093
7195
|
"data-testid": "icon-library-list"
|
|
7094
7196
|
}
|
|
7095
7197
|
);
|
|
7096
7198
|
};
|
|
7097
|
-
var IconLibraryLoadingState = () => /* @__PURE__ */
|
|
7199
|
+
var IconLibraryLoadingState = () => /* @__PURE__ */ React91.createElement(Stack16, { alignItems: "center", justifyContent: "center", height: "100%" }, /* @__PURE__ */ React91.createElement(CircularProgress3, { role: "progressbar", size: 24, "aria-label": __39("Loading icons", "elementor") }));
|
|
7098
7200
|
var IconLibraryEmptyState = ({
|
|
7099
7201
|
searchValue,
|
|
7100
7202
|
isCatalogAvailable,
|
|
7101
7203
|
onClear
|
|
7102
7204
|
}) => {
|
|
7103
7205
|
if (!isCatalogAvailable) {
|
|
7104
|
-
return /* @__PURE__ */
|
|
7206
|
+
return /* @__PURE__ */ React91.createElement(CatalogUnavailable, null);
|
|
7105
7207
|
}
|
|
7106
|
-
return /* @__PURE__ */
|
|
7208
|
+
return /* @__PURE__ */ React91.createElement(NoResults, { searchValue, onClear });
|
|
7107
7209
|
};
|
|
7108
7210
|
var IconLibraryRow = (item) => {
|
|
7109
7211
|
const icon = item;
|
|
7110
|
-
return /* @__PURE__ */
|
|
7212
|
+
return /* @__PURE__ */ React91.createElement(Stack16, { direction: "row", alignItems: "center", gap: 1, sx: { width: "100%" } }, /* @__PURE__ */ React91.createElement(
|
|
7111
7213
|
Box21,
|
|
7112
7214
|
{
|
|
7113
7215
|
sx: {
|
|
@@ -7123,7 +7225,7 @@ var IconLibraryRow = (item) => {
|
|
|
7123
7225
|
flexShrink: 0
|
|
7124
7226
|
}
|
|
7125
7227
|
},
|
|
7126
|
-
/* @__PURE__ */
|
|
7228
|
+
/* @__PURE__ */ React91.createElement(
|
|
7127
7229
|
FontAwesomeGlyph,
|
|
7128
7230
|
{
|
|
7129
7231
|
icon: { ...icon, value: icon.iconValue },
|
|
@@ -7131,10 +7233,10 @@ var IconLibraryRow = (item) => {
|
|
|
7131
7233
|
color: "currentColor"
|
|
7132
7234
|
}
|
|
7133
7235
|
)
|
|
7134
|
-
), /* @__PURE__ */
|
|
7236
|
+
), /* @__PURE__ */ React91.createElement(Typography10, { variant: "caption", color: "text.primary", noWrap: true }, icon.label));
|
|
7135
7237
|
};
|
|
7136
|
-
var CatalogUnavailable = () => /* @__PURE__ */
|
|
7137
|
-
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */
|
|
7238
|
+
var CatalogUnavailable = () => /* @__PURE__ */ React91.createElement(Stack16, { alignItems: "center", justifyContent: "center", height: "100%", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React91.createElement(SvgElementIcon, { fontSize: "large" }), /* @__PURE__ */ React91.createElement(Typography10, { align: "center", variant: "subtitle2", color: "text.secondary" }, __39("Icons couldn't be loaded.", "elementor")));
|
|
7239
|
+
var NoResults = ({ searchValue, onClear }) => /* @__PURE__ */ React91.createElement(Stack16, { alignItems: "center", justifyContent: "center", height: "100%", p: 2.5, gap: 1.5 }, /* @__PURE__ */ React91.createElement(SvgElementIcon, { fontSize: "large" }), /* @__PURE__ */ React91.createElement(Typography10, { align: "center", variant: "subtitle2", color: "text.secondary" }, __39("Sorry, nothing matched", "elementor")), searchValue ? /* @__PURE__ */ React91.createElement(React91.Fragment, null, /* @__PURE__ */ React91.createElement(Typography10, { align: "center", variant: "subtitle2", color: "text.secondary", noWrap: true, sx: { maxWidth: "80%" } }, "\u201C", searchValue, "\u201D."), /* @__PURE__ */ React91.createElement(Link3, { color: "secondary", variant: "caption", component: "button", type: "button", onClick: onClear }, __39("Clear & try again", "elementor"))) : null);
|
|
7138
7240
|
var createIconLibraryItems = (icons, searchValue, libraries) => filterFontAwesome7Icons(icons, searchValue, libraries).map((icon) => ({
|
|
7139
7241
|
...icon,
|
|
7140
7242
|
type: "item",
|
|
@@ -7143,23 +7245,23 @@ var createIconLibraryItems = (icons, searchValue, libraries) => filterFontAwesom
|
|
|
7143
7245
|
}));
|
|
7144
7246
|
|
|
7145
7247
|
// src/controls/open-icon-library.ts
|
|
7146
|
-
import { stringPropTypeUtil as
|
|
7248
|
+
import { stringPropTypeUtil as stringPropTypeUtil15 } from "@elementor/editor-props";
|
|
7147
7249
|
function enqueueIconFonts(library) {
|
|
7148
7250
|
window.elementor?.helpers?.enqueueIconFonts?.(library);
|
|
7149
7251
|
}
|
|
7150
7252
|
function createIconPropValue(icon, library) {
|
|
7151
7253
|
return {
|
|
7152
|
-
value:
|
|
7153
|
-
library:
|
|
7254
|
+
value: stringPropTypeUtil15.create(icon),
|
|
7255
|
+
library: stringPropTypeUtil15.create(library)
|
|
7154
7256
|
};
|
|
7155
7257
|
}
|
|
7156
7258
|
|
|
7157
7259
|
// src/controls/svg-media-overlay.tsx
|
|
7158
|
-
import * as
|
|
7260
|
+
import * as React92 from "react";
|
|
7159
7261
|
import { ThemeProvider } from "@elementor/editor-ui";
|
|
7160
7262
|
import { LibraryIcon as LibraryIcon3 } from "@elementor/icons";
|
|
7161
7263
|
import { Box as Box22, Button as Button6, Stack as Stack17, Typography as Typography11 } from "@elementor/ui";
|
|
7162
|
-
import { __ as
|
|
7264
|
+
import { __ as __40 } from "@wordpress/i18n";
|
|
7163
7265
|
var SVG_MEDIA_CONTROL_CONTAINER_TEST_ID = "svg-media-control-container";
|
|
7164
7266
|
var SVG_MEDIA_ACTION_GROUP_TEST_ID = "svg-media-action-group";
|
|
7165
7267
|
var ICON_LIBRARY_PADDING = 0.625;
|
|
@@ -7172,31 +7274,31 @@ var SvgMediaOverlay = ({
|
|
|
7172
7274
|
onOpenIconLibrary,
|
|
7173
7275
|
infotipTitle,
|
|
7174
7276
|
infotipDescription
|
|
7175
|
-
}) => /* @__PURE__ */
|
|
7277
|
+
}) => /* @__PURE__ */ React92.createElement(Stack17, { alignItems: "center", gap: 1 }, /* @__PURE__ */ React92.createElement(
|
|
7176
7278
|
MediaActionGroup,
|
|
7177
7279
|
{
|
|
7178
7280
|
label,
|
|
7179
7281
|
onSelect: onSelectSvg,
|
|
7180
7282
|
groupRef: buttonGroupRef,
|
|
7181
7283
|
testId: SVG_MEDIA_ACTION_GROUP_TEST_ID,
|
|
7182
|
-
uploadSlot: /* @__PURE__ */
|
|
7284
|
+
uploadSlot: /* @__PURE__ */ React92.createElement(
|
|
7183
7285
|
ConditionalControlInfotip,
|
|
7184
7286
|
{
|
|
7185
7287
|
title: infotipTitle,
|
|
7186
7288
|
description: infotipDescription,
|
|
7187
7289
|
isEnabled: !isAdmin
|
|
7188
7290
|
},
|
|
7189
|
-
/* @__PURE__ */
|
|
7291
|
+
/* @__PURE__ */ React92.createElement(Box22, { component: "span", sx: { display: "flex", width: "100%" } }, /* @__PURE__ */ React92.createElement(UploadControl, { isAdmin, onUpload }))
|
|
7190
7292
|
)
|
|
7191
7293
|
}
|
|
7192
|
-
), /* @__PURE__ */
|
|
7294
|
+
), /* @__PURE__ */ React92.createElement(
|
|
7193
7295
|
Button6,
|
|
7194
7296
|
{
|
|
7195
7297
|
size: "tiny",
|
|
7196
7298
|
color: "inherit",
|
|
7197
7299
|
variant: "text",
|
|
7198
|
-
startIcon: /* @__PURE__ */
|
|
7199
|
-
"aria-label":
|
|
7300
|
+
startIcon: /* @__PURE__ */ React92.createElement(LibraryIcon3, { sx: { height: "18px", width: "16px" } }),
|
|
7301
|
+
"aria-label": __40("Icon library", "elementor"),
|
|
7200
7302
|
onClick: onOpenIconLibrary,
|
|
7201
7303
|
sx: {
|
|
7202
7304
|
height: "28px",
|
|
@@ -7204,20 +7306,20 @@ var SvgMediaOverlay = ({
|
|
|
7204
7306
|
".MuiButton-icon": { ml: 0 }
|
|
7205
7307
|
}
|
|
7206
7308
|
},
|
|
7207
|
-
/* @__PURE__ */
|
|
7309
|
+
/* @__PURE__ */ React92.createElement(Typography11, null, __40("Icon library", "elementor"))
|
|
7208
7310
|
));
|
|
7209
7311
|
var UploadControl = ({ isAdmin, onUpload }) => {
|
|
7210
7312
|
if (isAdmin) {
|
|
7211
|
-
return /* @__PURE__ */
|
|
7313
|
+
return /* @__PURE__ */ React92.createElement(MediaUploadButton, { onClick: onUpload });
|
|
7212
7314
|
}
|
|
7213
|
-
return /* @__PURE__ */
|
|
7315
|
+
return /* @__PURE__ */ React92.createElement(ThemeProvider, { colorScheme: "dark" }, /* @__PURE__ */ React92.createElement(MediaUploadButton, { disabled: true }));
|
|
7214
7316
|
};
|
|
7215
7317
|
|
|
7216
7318
|
// src/controls/svg-media-preview.tsx
|
|
7217
|
-
import * as
|
|
7218
|
-
import { useMemo as
|
|
7319
|
+
import * as React93 from "react";
|
|
7320
|
+
import { useMemo as useMemo14 } from "react";
|
|
7219
7321
|
import { Box as Box23, CardMedia as CardMedia2, CircularProgress as CircularProgress4 } from "@elementor/ui";
|
|
7220
|
-
import { __ as
|
|
7322
|
+
import { __ as __41 } from "@wordpress/i18n";
|
|
7221
7323
|
var ICON_PREVIEW_SIZE = 50;
|
|
7222
7324
|
var ICON_PREVIEW_COLOR = "#000000";
|
|
7223
7325
|
var SvgMediaPreview = ({ isFetching, src, iconClassName, iconLibrary }) => {
|
|
@@ -7227,7 +7329,7 @@ var SvgMediaPreview = ({ isFetching, src, iconClassName, iconLibrary }) => {
|
|
|
7227
7329
|
const { data: providerIcons = [], isLoading: isProviderLoading } = useIconLibraryProviderIcons(
|
|
7228
7330
|
shouldLoadIconCatalog && !isFontAwesomeLibrary
|
|
7229
7331
|
);
|
|
7230
|
-
const icons =
|
|
7332
|
+
const icons = useMemo14(
|
|
7231
7333
|
() => mergeIconsById(fontAwesomeIcons, providerIcons),
|
|
7232
7334
|
[fontAwesomeIcons, providerIcons]
|
|
7233
7335
|
);
|
|
@@ -7239,21 +7341,21 @@ var SvgMediaPreview = ({ isFetching, src, iconClassName, iconLibrary }) => {
|
|
|
7239
7341
|
shouldLoadIconCatalog && !isLoadingCatalog && !selectedIcon && !isFontAwesomeLibrary
|
|
7240
7342
|
);
|
|
7241
7343
|
if (isFetching || isLoadingCatalog || isSavedIconLoading) {
|
|
7242
|
-
return /* @__PURE__ */
|
|
7344
|
+
return /* @__PURE__ */ React93.createElement(CircularProgress4, { role: "progressbar", "aria-label": __41("Loading icon", "elementor") });
|
|
7243
7345
|
}
|
|
7244
7346
|
if (selectedIcon) {
|
|
7245
|
-
return /* @__PURE__ */
|
|
7347
|
+
return /* @__PURE__ */ React93.createElement(IconPreview, { icon: selectedIcon });
|
|
7246
7348
|
}
|
|
7247
7349
|
if (shouldLoadIconCatalog && iconClassName && iconLibrary && isFontAwesomeLibrary) {
|
|
7248
|
-
return /* @__PURE__ */
|
|
7350
|
+
return /* @__PURE__ */ React93.createElement(IconPreview, { icon: createLazyIcon(iconLibrary, iconClassName) });
|
|
7249
7351
|
}
|
|
7250
7352
|
if (savedIconSvg) {
|
|
7251
|
-
return /* @__PURE__ */
|
|
7353
|
+
return /* @__PURE__ */ React93.createElement(IconPreview, { icon: toSvgMarkupIcon(savedIconSvg, iconLibrary, iconClassName) });
|
|
7252
7354
|
}
|
|
7253
7355
|
if (shouldLoadIconCatalog) {
|
|
7254
|
-
return /* @__PURE__ */
|
|
7356
|
+
return /* @__PURE__ */ React93.createElement(IconPreviewPlaceholder, null);
|
|
7255
7357
|
}
|
|
7256
|
-
return /* @__PURE__ */
|
|
7358
|
+
return /* @__PURE__ */ React93.createElement(SvgPreview, { src });
|
|
7257
7359
|
};
|
|
7258
7360
|
var createLazyIcon = (library, value) => ({
|
|
7259
7361
|
id: `${library}:${value}`,
|
|
@@ -7279,16 +7381,16 @@ var toSvgMarkupIcon = (svgMarkup, library, value) => ({
|
|
|
7279
7381
|
paths: [],
|
|
7280
7382
|
svgMarkup
|
|
7281
7383
|
});
|
|
7282
|
-
var IconPreview = ({ icon }) => /* @__PURE__ */
|
|
7384
|
+
var IconPreview = ({ icon }) => /* @__PURE__ */ React93.createElement(Box23, { sx: { color: ICON_PREVIEW_COLOR, minWidth: ICON_PREVIEW_SIZE, minHeight: ICON_PREVIEW_SIZE } }, /* @__PURE__ */ React93.createElement(
|
|
7283
7385
|
FontAwesomeGlyph,
|
|
7284
7386
|
{
|
|
7285
7387
|
icon,
|
|
7286
7388
|
size: ICON_PREVIEW_SIZE,
|
|
7287
7389
|
color: ICON_PREVIEW_COLOR,
|
|
7288
|
-
label:
|
|
7390
|
+
label: __41("Preview icon", "elementor")
|
|
7289
7391
|
}
|
|
7290
7392
|
));
|
|
7291
|
-
var IconPreviewPlaceholder = () => /* @__PURE__ */
|
|
7393
|
+
var IconPreviewPlaceholder = () => /* @__PURE__ */ React93.createElement(
|
|
7292
7394
|
Box23,
|
|
7293
7395
|
{
|
|
7294
7396
|
"aria-hidden": true,
|
|
@@ -7299,12 +7401,12 @@ var IconPreviewPlaceholder = () => /* @__PURE__ */ React92.createElement(
|
|
|
7299
7401
|
}
|
|
7300
7402
|
}
|
|
7301
7403
|
);
|
|
7302
|
-
var SvgPreview = ({ src }) => /* @__PURE__ */
|
|
7404
|
+
var SvgPreview = ({ src }) => /* @__PURE__ */ React93.createElement(
|
|
7303
7405
|
CardMedia2,
|
|
7304
7406
|
{
|
|
7305
7407
|
component: "img",
|
|
7306
7408
|
image: src,
|
|
7307
|
-
alt:
|
|
7409
|
+
alt: __41("Preview SVG", "elementor"),
|
|
7308
7410
|
sx: { maxHeight: "140px", width: `${ICON_PREVIEW_SIZE}px`, color: ICON_PREVIEW_COLOR }
|
|
7309
7411
|
}
|
|
7310
7412
|
);
|
|
@@ -7338,7 +7440,7 @@ var StyledCardMediaContainer = styled12(Stack18)`
|
|
|
7338
7440
|
var MODE_BROWSE = { mode: "browse" };
|
|
7339
7441
|
var MODE_UPLOAD = { mode: "upload" };
|
|
7340
7442
|
var SvgMediaControl = createControl(({ label }) => {
|
|
7341
|
-
const groupLabel = label ??
|
|
7443
|
+
const groupLabel = label ?? __42("SVG", "elementor");
|
|
7342
7444
|
const { value: svgValue, setValue: setSvgValue, placeholder: svgPlaceholder } = useBoundProp(svgSrcPropTypeUtil);
|
|
7343
7445
|
const { value: iconValue, setValue: setIconValue, placeholder: iconPlaceholder } = useBoundProp(iconPropTypeUtil);
|
|
7344
7446
|
const id = svgValue?.id;
|
|
@@ -7350,8 +7452,8 @@ var SvgMediaControl = createControl(({ label }) => {
|
|
|
7350
7452
|
const { data: allowSvgUpload } = useUnfilteredFilesUpload();
|
|
7351
7453
|
const [unfilteredModalOpenState, setUnfilteredModalOpenState] = useState24(false);
|
|
7352
7454
|
const iconLibraryPopoverState = usePopupState9({ variant: "popover" });
|
|
7353
|
-
const controlContainerRef =
|
|
7354
|
-
const buttonGroupRef =
|
|
7455
|
+
const controlContainerRef = useRef23(null);
|
|
7456
|
+
const buttonGroupRef = useRef23(null);
|
|
7355
7457
|
const [iconLibraryAnchor, setIconLibraryAnchor] = useState24(null);
|
|
7356
7458
|
const { isAdmin } = useCurrentUserCapabilities();
|
|
7357
7459
|
const selectedIconClass = typeof previewIconValue?.value?.value === "string" ? previewIconValue.value.value : null;
|
|
@@ -7420,7 +7522,7 @@ var SvgMediaControl = createControl(({ label }) => {
|
|
|
7420
7522
|
};
|
|
7421
7523
|
}, [iconLibraryPopoverState.isOpen]);
|
|
7422
7524
|
const iconLibraryWidth = iconLibraryAnchor?.width ?? ICON_LIBRARY_POPOVER_WIDTH;
|
|
7423
|
-
return /* @__PURE__ */
|
|
7525
|
+
return /* @__PURE__ */ React94.createElement(Stack18, { gap: 1, "aria-label": __42("SVG control", "elementor") }, /* @__PURE__ */ React94.createElement(EnableUnfilteredModal, { open: unfilteredModalOpenState, onClose: handleCloseUnfilteredModal }), iconLibraryAnchor ? /* @__PURE__ */ React94.createElement(
|
|
7424
7526
|
Popover6,
|
|
7425
7527
|
{
|
|
7426
7528
|
disableScrollLock: true,
|
|
@@ -7440,7 +7542,7 @@ var SvgMediaControl = createControl(({ label }) => {
|
|
|
7440
7542
|
}
|
|
7441
7543
|
}
|
|
7442
7544
|
},
|
|
7443
|
-
/* @__PURE__ */
|
|
7545
|
+
/* @__PURE__ */ React94.createElement(
|
|
7444
7546
|
IconLibraryPopover,
|
|
7445
7547
|
{
|
|
7446
7548
|
open: iconLibraryPopoverState.isOpen,
|
|
@@ -7451,14 +7553,14 @@ var SvgMediaControl = createControl(({ label }) => {
|
|
|
7451
7553
|
width: iconLibraryWidth
|
|
7452
7554
|
}
|
|
7453
7555
|
)
|
|
7454
|
-
) : null, /* @__PURE__ */
|
|
7556
|
+
) : null, /* @__PURE__ */ React94.createElement(
|
|
7455
7557
|
Box24,
|
|
7456
7558
|
{
|
|
7457
7559
|
ref: controlContainerRef,
|
|
7458
7560
|
"data-testid": SVG_MEDIA_CONTROL_CONTAINER_TEST_ID,
|
|
7459
7561
|
sx: { width: "100%" }
|
|
7460
7562
|
},
|
|
7461
|
-
/* @__PURE__ */
|
|
7563
|
+
/* @__PURE__ */ React94.createElement(ControlActions, null, /* @__PURE__ */ React94.createElement(StyledCard, { variant: "outlined" }, /* @__PURE__ */ React94.createElement(StyledCardMediaContainer, null, /* @__PURE__ */ React94.createElement(
|
|
7462
7564
|
SvgMediaPreview,
|
|
7463
7565
|
{
|
|
7464
7566
|
isFetching,
|
|
@@ -7466,7 +7568,7 @@ var SvgMediaControl = createControl(({ label }) => {
|
|
|
7466
7568
|
iconClassName: selectedIconClass,
|
|
7467
7569
|
iconLibrary: selectedIconLibrary
|
|
7468
7570
|
}
|
|
7469
|
-
)), /* @__PURE__ */
|
|
7571
|
+
)), /* @__PURE__ */ React94.createElement(
|
|
7470
7572
|
CardOverlay2,
|
|
7471
7573
|
{
|
|
7472
7574
|
sx: {
|
|
@@ -7475,7 +7577,7 @@ var SvgMediaControl = createControl(({ label }) => {
|
|
|
7475
7577
|
}
|
|
7476
7578
|
}
|
|
7477
7579
|
},
|
|
7478
|
-
/* @__PURE__ */
|
|
7580
|
+
/* @__PURE__ */ React94.createElement(
|
|
7479
7581
|
SvgMediaOverlay,
|
|
7480
7582
|
{
|
|
7481
7583
|
label: groupLabel,
|
|
@@ -7484,23 +7586,23 @@ var SvgMediaControl = createControl(({ label }) => {
|
|
|
7484
7586
|
onSelectSvg: handleSelectSvg,
|
|
7485
7587
|
onUpload: handleUpload,
|
|
7486
7588
|
onOpenIconLibrary: handleOpenIconLibrary,
|
|
7487
|
-
infotipTitle:
|
|
7488
|
-
infotipDescription: /* @__PURE__ */
|
|
7589
|
+
infotipTitle: __42("Sorry, you can't upload that file yet.", "elementor"),
|
|
7590
|
+
infotipDescription: /* @__PURE__ */ React94.createElement(UnfilteredUploadInfotipDescription, null)
|
|
7489
7591
|
}
|
|
7490
7592
|
)
|
|
7491
7593
|
)))
|
|
7492
7594
|
));
|
|
7493
7595
|
});
|
|
7494
|
-
var UnfilteredUploadInfotipDescription = () => /* @__PURE__ */
|
|
7596
|
+
var UnfilteredUploadInfotipDescription = () => /* @__PURE__ */ React94.createElement(React94.Fragment, null, __42("To upload them anyway, ask the site administrator to enable unfiltered", "elementor"), /* @__PURE__ */ React94.createElement("br", null), __42("file uploads.", "elementor"));
|
|
7495
7597
|
|
|
7496
7598
|
// src/controls/video-media-control.tsx
|
|
7497
|
-
import * as
|
|
7599
|
+
import * as React95 from "react";
|
|
7498
7600
|
import { urlPropTypeUtil as urlPropTypeUtil5, videoSrcPropTypeUtil } from "@elementor/editor-props";
|
|
7499
7601
|
import { Card as Card3, CardMedia as CardMedia3, CardOverlay as CardOverlay3, CircularProgress as CircularProgress5 } from "@elementor/ui";
|
|
7500
7602
|
import { useWpMediaAttachment as useWpMediaAttachment3, useWpMediaFrame as useWpMediaFrame3 } from "@elementor/wp-media";
|
|
7501
|
-
import { __ as
|
|
7603
|
+
import { __ as __43 } from "@wordpress/i18n";
|
|
7502
7604
|
var PLACEHOLDER_IMAGE = window.elementorCommon?.config?.urls?.assets + "/shapes/play-triangle.svg";
|
|
7503
|
-
var VideoMediaControl = createControl(({ label =
|
|
7605
|
+
var VideoMediaControl = createControl(({ label = __43("Video", "elementor") }) => {
|
|
7504
7606
|
const { value, setValue, propType } = useBoundProp(videoSrcPropTypeUtil);
|
|
7505
7607
|
const { id, url } = value ?? {};
|
|
7506
7608
|
const { data: attachment, isFetching } = useWpMediaAttachment3(id?.value || null);
|
|
@@ -7528,7 +7630,7 @@ var VideoMediaControl = createControl(({ label = __42("Video", "elementor") }) =
|
|
|
7528
7630
|
});
|
|
7529
7631
|
}
|
|
7530
7632
|
});
|
|
7531
|
-
return /* @__PURE__ */
|
|
7633
|
+
return /* @__PURE__ */ React95.createElement(ControlActions, null, /* @__PURE__ */ React95.createElement(Card3, { variant: "outlined" }, /* @__PURE__ */ React95.createElement(
|
|
7532
7634
|
CardMedia3,
|
|
7533
7635
|
{
|
|
7534
7636
|
sx: {
|
|
@@ -7543,8 +7645,8 @@ var VideoMediaControl = createControl(({ label = __42("Video", "elementor") }) =
|
|
|
7543
7645
|
alignItems: "center"
|
|
7544
7646
|
}
|
|
7545
7647
|
},
|
|
7546
|
-
/* @__PURE__ */
|
|
7547
|
-
), /* @__PURE__ */
|
|
7648
|
+
/* @__PURE__ */ React95.createElement(VideoPreview, { isFetching, videoUrl })
|
|
7649
|
+
), /* @__PURE__ */ React95.createElement(CardOverlay3, null, /* @__PURE__ */ React95.createElement(
|
|
7548
7650
|
MediaSelectActions,
|
|
7549
7651
|
{
|
|
7550
7652
|
label,
|
|
@@ -7556,13 +7658,13 @@ var VideoMediaControl = createControl(({ label = __42("Video", "elementor") }) =
|
|
|
7556
7658
|
});
|
|
7557
7659
|
var VideoPreview = ({ isFetching = false, videoUrl }) => {
|
|
7558
7660
|
if (isFetching) {
|
|
7559
|
-
return /* @__PURE__ */
|
|
7661
|
+
return /* @__PURE__ */ React95.createElement(CircularProgress5, null);
|
|
7560
7662
|
}
|
|
7561
7663
|
if (videoUrl) {
|
|
7562
|
-
return /* @__PURE__ */
|
|
7664
|
+
return /* @__PURE__ */ React95.createElement(
|
|
7563
7665
|
"video",
|
|
7564
7666
|
{
|
|
7565
|
-
"aria-label":
|
|
7667
|
+
"aria-label": __43("Video preview", "elementor"),
|
|
7566
7668
|
src: videoUrl,
|
|
7567
7669
|
muted: true,
|
|
7568
7670
|
preload: "metadata",
|
|
@@ -7575,17 +7677,17 @@ var VideoPreview = ({ isFetching = false, videoUrl }) => {
|
|
|
7575
7677
|
}
|
|
7576
7678
|
);
|
|
7577
7679
|
}
|
|
7578
|
-
return /* @__PURE__ */
|
|
7680
|
+
return /* @__PURE__ */ React95.createElement("img", { src: PLACEHOLDER_IMAGE, alt: "No video selected" });
|
|
7579
7681
|
};
|
|
7580
7682
|
|
|
7581
7683
|
// src/controls/background-control/background-control.tsx
|
|
7582
|
-
import * as
|
|
7684
|
+
import * as React102 from "react";
|
|
7583
7685
|
import { backgroundPropTypeUtil } from "@elementor/editor-props";
|
|
7584
7686
|
import { Grid as Grid18 } from "@elementor/ui";
|
|
7585
|
-
import { __ as
|
|
7687
|
+
import { __ as __49 } from "@wordpress/i18n";
|
|
7586
7688
|
|
|
7587
7689
|
// src/controls/background-control/background-overlay/background-overlay-repeater-control.tsx
|
|
7588
|
-
import * as
|
|
7690
|
+
import * as React101 from "react";
|
|
7589
7691
|
import {
|
|
7590
7692
|
backgroundColorOverlayPropTypeUtil as backgroundColorOverlayPropTypeUtil2,
|
|
7591
7693
|
backgroundImageOverlayPropTypeUtil as backgroundImageOverlayPropTypeUtil2,
|
|
@@ -7594,21 +7696,21 @@ import {
|
|
|
7594
7696
|
} from "@elementor/editor-props";
|
|
7595
7697
|
import { Box as Box25, CardMedia as CardMedia4, styled as styled13, Tab, TabPanel, Tabs, UnstableColorIndicator as UnstableColorIndicator3 } from "@elementor/ui";
|
|
7596
7698
|
import { useWpMediaAttachment as useWpMediaAttachment4 } from "@elementor/wp-media";
|
|
7597
|
-
import { __ as
|
|
7699
|
+
import { __ as __48 } from "@wordpress/i18n";
|
|
7598
7700
|
|
|
7599
7701
|
// src/env.ts
|
|
7600
7702
|
import { parseEnv } from "@elementor/env";
|
|
7601
7703
|
var { env } = parseEnv("@elementor/editor-controls");
|
|
7602
7704
|
|
|
7603
7705
|
// src/controls/background-control/background-gradient-color-control.tsx
|
|
7604
|
-
import * as
|
|
7706
|
+
import * as React96 from "react";
|
|
7605
7707
|
import {
|
|
7606
7708
|
backgroundGradientOverlayPropTypeUtil,
|
|
7607
7709
|
colorPropTypeUtil as colorPropTypeUtil2,
|
|
7608
7710
|
colorStopPropTypeUtil,
|
|
7609
7711
|
gradientColorStopPropTypeUtil,
|
|
7610
|
-
numberPropTypeUtil as
|
|
7611
|
-
stringPropTypeUtil as
|
|
7712
|
+
numberPropTypeUtil as numberPropTypeUtil6,
|
|
7713
|
+
stringPropTypeUtil as stringPropTypeUtil16
|
|
7612
7714
|
} from "@elementor/editor-props";
|
|
7613
7715
|
import { UnstableGradientBox } from "@elementor/ui";
|
|
7614
7716
|
var BackgroundGradientColorControl = createControl(() => {
|
|
@@ -7616,19 +7718,19 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
7616
7718
|
const handleChange = (newValue) => {
|
|
7617
7719
|
const transformedValue = createTransformableValue(newValue);
|
|
7618
7720
|
if (transformedValue.positions) {
|
|
7619
|
-
transformedValue.positions =
|
|
7721
|
+
transformedValue.positions = stringPropTypeUtil16.create(newValue.positions.join(" "));
|
|
7620
7722
|
}
|
|
7621
7723
|
setValue(transformedValue);
|
|
7622
7724
|
};
|
|
7623
7725
|
const createTransformableValue = (newValue) => ({
|
|
7624
7726
|
...newValue,
|
|
7625
|
-
type:
|
|
7626
|
-
angle:
|
|
7727
|
+
type: stringPropTypeUtil16.create(newValue.type),
|
|
7728
|
+
angle: numberPropTypeUtil6.create(newValue.angle),
|
|
7627
7729
|
stops: gradientColorStopPropTypeUtil.create(
|
|
7628
7730
|
newValue.stops.map(
|
|
7629
7731
|
({ color, offset }) => colorStopPropTypeUtil.create({
|
|
7630
7732
|
color: colorPropTypeUtil2.create(color),
|
|
7631
|
-
offset:
|
|
7733
|
+
offset: numberPropTypeUtil6.create(offset)
|
|
7632
7734
|
})
|
|
7633
7735
|
)
|
|
7634
7736
|
)
|
|
@@ -7648,7 +7750,7 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
7648
7750
|
positions: positions?.value.split(" ")
|
|
7649
7751
|
};
|
|
7650
7752
|
};
|
|
7651
|
-
return /* @__PURE__ */
|
|
7753
|
+
return /* @__PURE__ */ React96.createElement(
|
|
7652
7754
|
UnstableGradientBox,
|
|
7653
7755
|
{
|
|
7654
7756
|
sx: { width: "auto", padding: 1.5 },
|
|
@@ -7658,68 +7760,68 @@ var BackgroundGradientColorControl = createControl(() => {
|
|
|
7658
7760
|
);
|
|
7659
7761
|
});
|
|
7660
7762
|
var initialBackgroundGradientOverlay = backgroundGradientOverlayPropTypeUtil.create({
|
|
7661
|
-
type:
|
|
7662
|
-
angle:
|
|
7763
|
+
type: stringPropTypeUtil16.create("linear"),
|
|
7764
|
+
angle: numberPropTypeUtil6.create(180),
|
|
7663
7765
|
stops: gradientColorStopPropTypeUtil.create([
|
|
7664
7766
|
colorStopPropTypeUtil.create({
|
|
7665
7767
|
color: colorPropTypeUtil2.create("rgb(0,0,0)"),
|
|
7666
|
-
offset:
|
|
7768
|
+
offset: numberPropTypeUtil6.create(0)
|
|
7667
7769
|
}),
|
|
7668
7770
|
colorStopPropTypeUtil.create({
|
|
7669
7771
|
color: colorPropTypeUtil2.create("rgb(255,255,255)"),
|
|
7670
|
-
offset:
|
|
7772
|
+
offset: numberPropTypeUtil6.create(100)
|
|
7671
7773
|
})
|
|
7672
7774
|
])
|
|
7673
7775
|
});
|
|
7674
7776
|
|
|
7675
7777
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-attachment.tsx
|
|
7676
|
-
import * as
|
|
7778
|
+
import * as React97 from "react";
|
|
7677
7779
|
import { PinIcon, PinnedOffIcon } from "@elementor/icons";
|
|
7678
7780
|
import { Grid as Grid14 } from "@elementor/ui";
|
|
7679
|
-
import { __ as
|
|
7781
|
+
import { __ as __44 } from "@wordpress/i18n";
|
|
7680
7782
|
var attachmentControlOptions = [
|
|
7681
7783
|
{
|
|
7682
7784
|
value: "fixed",
|
|
7683
|
-
label:
|
|
7684
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
7785
|
+
label: __44("Fixed", "elementor"),
|
|
7786
|
+
renderContent: ({ size }) => /* @__PURE__ */ React97.createElement(PinIcon, { fontSize: size }),
|
|
7685
7787
|
showTooltip: true
|
|
7686
7788
|
},
|
|
7687
7789
|
{
|
|
7688
7790
|
value: "scroll",
|
|
7689
|
-
label:
|
|
7690
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
7791
|
+
label: __44("Scroll", "elementor"),
|
|
7792
|
+
renderContent: ({ size }) => /* @__PURE__ */ React97.createElement(PinnedOffIcon, { fontSize: size }),
|
|
7691
7793
|
showTooltip: true
|
|
7692
7794
|
}
|
|
7693
7795
|
];
|
|
7694
7796
|
var BackgroundImageOverlayAttachment = () => {
|
|
7695
|
-
return /* @__PURE__ */
|
|
7797
|
+
return /* @__PURE__ */ React97.createElement(PopoverGridContainer, null, /* @__PURE__ */ React97.createElement(Grid14, { item: true, xs: 6 }, /* @__PURE__ */ React97.createElement(ControlFormLabel, null, __44("Attachment", "elementor"))), /* @__PURE__ */ React97.createElement(Grid14, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React97.createElement(ToggleControl, { options: attachmentControlOptions })));
|
|
7696
7798
|
};
|
|
7697
7799
|
|
|
7698
7800
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-position.tsx
|
|
7699
|
-
import * as
|
|
7700
|
-
import { useRef as
|
|
7701
|
-
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as
|
|
7801
|
+
import * as React98 from "react";
|
|
7802
|
+
import { useRef as useRef24 } from "react";
|
|
7803
|
+
import { backgroundImagePositionOffsetPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil17 } from "@elementor/editor-props";
|
|
7702
7804
|
import { MenuListItem as MenuListItem6 } from "@elementor/editor-ui";
|
|
7703
7805
|
import { LetterXIcon, LetterYIcon } from "@elementor/icons";
|
|
7704
7806
|
import { Grid as Grid15, Select as Select4 } from "@elementor/ui";
|
|
7705
|
-
import { __ as
|
|
7807
|
+
import { __ as __45 } from "@wordpress/i18n";
|
|
7706
7808
|
var backgroundPositionOptions = [
|
|
7707
|
-
{ label:
|
|
7708
|
-
{ label:
|
|
7709
|
-
{ label:
|
|
7710
|
-
{ label:
|
|
7711
|
-
{ label:
|
|
7712
|
-
{ label:
|
|
7713
|
-
{ label:
|
|
7714
|
-
{ label:
|
|
7715
|
-
{ label:
|
|
7716
|
-
{ label:
|
|
7809
|
+
{ label: __45("Center center", "elementor"), value: "center center" },
|
|
7810
|
+
{ label: __45("Center left", "elementor"), value: "center left" },
|
|
7811
|
+
{ label: __45("Center right", "elementor"), value: "center right" },
|
|
7812
|
+
{ label: __45("Top center", "elementor"), value: "top center" },
|
|
7813
|
+
{ label: __45("Top left", "elementor"), value: "top left" },
|
|
7814
|
+
{ label: __45("Top right", "elementor"), value: "top right" },
|
|
7815
|
+
{ label: __45("Bottom center", "elementor"), value: "bottom center" },
|
|
7816
|
+
{ label: __45("Bottom left", "elementor"), value: "bottom left" },
|
|
7817
|
+
{ label: __45("Bottom right", "elementor"), value: "bottom right" },
|
|
7818
|
+
{ label: __45("Custom", "elementor"), value: "custom" }
|
|
7717
7819
|
];
|
|
7718
7820
|
var BackgroundImageOverlayPosition = () => {
|
|
7719
7821
|
const backgroundImageOffsetContext = useBoundProp(backgroundImagePositionOffsetPropTypeUtil);
|
|
7720
|
-
const stringPropContext = useBoundProp(
|
|
7822
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil17);
|
|
7721
7823
|
const isCustom = !!backgroundImageOffsetContext.value;
|
|
7722
|
-
const rowRef =
|
|
7824
|
+
const rowRef = useRef24(null);
|
|
7723
7825
|
const handlePositionChange = (event) => {
|
|
7724
7826
|
const value = event.target.value || null;
|
|
7725
7827
|
if (value === "custom") {
|
|
@@ -7728,7 +7830,7 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
7728
7830
|
stringPropContext.setValue(value);
|
|
7729
7831
|
}
|
|
7730
7832
|
};
|
|
7731
|
-
return /* @__PURE__ */
|
|
7833
|
+
return /* @__PURE__ */ React98.createElement(Grid15, { container: true, spacing: 1.5 }, /* @__PURE__ */ React98.createElement(Grid15, { item: true, xs: 12 }, /* @__PURE__ */ React98.createElement(PopoverGridContainer, null, /* @__PURE__ */ React98.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React98.createElement(ControlFormLabel, null, __45("Position", "elementor"))), /* @__PURE__ */ React98.createElement(Grid15, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end", overflow: "hidden" } }, /* @__PURE__ */ React98.createElement(ControlActions, null, /* @__PURE__ */ React98.createElement(
|
|
7732
7834
|
Select4,
|
|
7733
7835
|
{
|
|
7734
7836
|
fullWidth: true,
|
|
@@ -7737,18 +7839,18 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
7737
7839
|
disabled: stringPropContext.disabled,
|
|
7738
7840
|
value: (backgroundImageOffsetContext.value ? "custom" : stringPropContext.value) ?? ""
|
|
7739
7841
|
},
|
|
7740
|
-
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
7741
|
-
))))), isCustom ? /* @__PURE__ */
|
|
7842
|
+
backgroundPositionOptions.map(({ label, value }) => /* @__PURE__ */ React98.createElement(MenuListItem6, { key: value, value: value ?? "" }, label))
|
|
7843
|
+
))))), isCustom ? /* @__PURE__ */ React98.createElement(PropProvider, { ...backgroundImageOffsetContext }, /* @__PURE__ */ React98.createElement(Grid15, { item: true, xs: 12 }, /* @__PURE__ */ React98.createElement(Grid15, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React98.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React98.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React98.createElement(
|
|
7742
7844
|
SizeControl,
|
|
7743
7845
|
{
|
|
7744
|
-
startIcon: /* @__PURE__ */
|
|
7846
|
+
startIcon: /* @__PURE__ */ React98.createElement(LetterXIcon, { fontSize: "tiny" }),
|
|
7745
7847
|
anchorRef: rowRef,
|
|
7746
7848
|
min: -Number.MAX_SAFE_INTEGER
|
|
7747
7849
|
}
|
|
7748
|
-
))), /* @__PURE__ */
|
|
7850
|
+
))), /* @__PURE__ */ React98.createElement(Grid15, { item: true, xs: 6 }, /* @__PURE__ */ React98.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React98.createElement(
|
|
7749
7851
|
SizeControl,
|
|
7750
7852
|
{
|
|
7751
|
-
startIcon: /* @__PURE__ */
|
|
7853
|
+
startIcon: /* @__PURE__ */ React98.createElement(LetterYIcon, { fontSize: "tiny" }),
|
|
7752
7854
|
anchorRef: rowRef,
|
|
7753
7855
|
min: -Number.MAX_SAFE_INTEGER
|
|
7754
7856
|
}
|
|
@@ -7756,44 +7858,44 @@ var BackgroundImageOverlayPosition = () => {
|
|
|
7756
7858
|
};
|
|
7757
7859
|
|
|
7758
7860
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-repeat.tsx
|
|
7759
|
-
import * as
|
|
7861
|
+
import * as React99 from "react";
|
|
7760
7862
|
import { DotsHorizontalIcon, DotsVerticalIcon, GridDotsIcon, XIcon as XIcon3 } from "@elementor/icons";
|
|
7761
7863
|
import { Grid as Grid16 } from "@elementor/ui";
|
|
7762
|
-
import { __ as
|
|
7864
|
+
import { __ as __46 } from "@wordpress/i18n";
|
|
7763
7865
|
var repeatControlOptions = [
|
|
7764
7866
|
{
|
|
7765
7867
|
value: "repeat",
|
|
7766
|
-
label:
|
|
7767
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
7868
|
+
label: __46("Repeat", "elementor"),
|
|
7869
|
+
renderContent: ({ size }) => /* @__PURE__ */ React99.createElement(GridDotsIcon, { fontSize: size }),
|
|
7768
7870
|
showTooltip: true
|
|
7769
7871
|
},
|
|
7770
7872
|
{
|
|
7771
7873
|
value: "repeat-x",
|
|
7772
|
-
label:
|
|
7773
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
7874
|
+
label: __46("Repeat-x", "elementor"),
|
|
7875
|
+
renderContent: ({ size }) => /* @__PURE__ */ React99.createElement(DotsHorizontalIcon, { fontSize: size }),
|
|
7774
7876
|
showTooltip: true
|
|
7775
7877
|
},
|
|
7776
7878
|
{
|
|
7777
7879
|
value: "repeat-y",
|
|
7778
|
-
label:
|
|
7779
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
7880
|
+
label: __46("Repeat-y", "elementor"),
|
|
7881
|
+
renderContent: ({ size }) => /* @__PURE__ */ React99.createElement(DotsVerticalIcon, { fontSize: size }),
|
|
7780
7882
|
showTooltip: true
|
|
7781
7883
|
},
|
|
7782
7884
|
{
|
|
7783
7885
|
value: "no-repeat",
|
|
7784
|
-
label:
|
|
7785
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
7886
|
+
label: __46("No-repeat", "elementor"),
|
|
7887
|
+
renderContent: ({ size }) => /* @__PURE__ */ React99.createElement(XIcon3, { fontSize: size }),
|
|
7786
7888
|
showTooltip: true
|
|
7787
7889
|
}
|
|
7788
7890
|
];
|
|
7789
7891
|
var BackgroundImageOverlayRepeat = () => {
|
|
7790
|
-
return /* @__PURE__ */
|
|
7892
|
+
return /* @__PURE__ */ React99.createElement(PopoverGridContainer, null, /* @__PURE__ */ React99.createElement(Grid16, { item: true, xs: 6 }, /* @__PURE__ */ React99.createElement(ControlFormLabel, null, __46("Repeat", "elementor"))), /* @__PURE__ */ React99.createElement(Grid16, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React99.createElement(ToggleControl, { options: repeatControlOptions })));
|
|
7791
7893
|
};
|
|
7792
7894
|
|
|
7793
7895
|
// src/controls/background-control/background-overlay/background-image-overlay/background-image-overlay-size.tsx
|
|
7794
|
-
import * as
|
|
7795
|
-
import { useRef as
|
|
7796
|
-
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as
|
|
7896
|
+
import * as React100 from "react";
|
|
7897
|
+
import { useRef as useRef25 } from "react";
|
|
7898
|
+
import { backgroundImageSizeScalePropTypeUtil, stringPropTypeUtil as stringPropTypeUtil18 } from "@elementor/editor-props";
|
|
7797
7899
|
import {
|
|
7798
7900
|
ArrowBarBothIcon,
|
|
7799
7901
|
ArrowsMaximizeIcon,
|
|
@@ -7803,38 +7905,38 @@ import {
|
|
|
7803
7905
|
PencilIcon
|
|
7804
7906
|
} from "@elementor/icons";
|
|
7805
7907
|
import { Grid as Grid17 } from "@elementor/ui";
|
|
7806
|
-
import { __ as
|
|
7908
|
+
import { __ as __47 } from "@wordpress/i18n";
|
|
7807
7909
|
var sizeControlOptions = [
|
|
7808
7910
|
{
|
|
7809
7911
|
value: "auto",
|
|
7810
|
-
label:
|
|
7811
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
7912
|
+
label: __47("Auto", "elementor"),
|
|
7913
|
+
renderContent: ({ size }) => /* @__PURE__ */ React100.createElement(LetterAIcon, { fontSize: size }),
|
|
7812
7914
|
showTooltip: true
|
|
7813
7915
|
},
|
|
7814
7916
|
{
|
|
7815
7917
|
value: "cover",
|
|
7816
|
-
label:
|
|
7817
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
7918
|
+
label: __47("Cover", "elementor"),
|
|
7919
|
+
renderContent: ({ size }) => /* @__PURE__ */ React100.createElement(ArrowsMaximizeIcon, { fontSize: size }),
|
|
7818
7920
|
showTooltip: true
|
|
7819
7921
|
},
|
|
7820
7922
|
{
|
|
7821
7923
|
value: "contain",
|
|
7822
|
-
label:
|
|
7823
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
7924
|
+
label: __47("Contain", "elementor"),
|
|
7925
|
+
renderContent: ({ size }) => /* @__PURE__ */ React100.createElement(ArrowBarBothIcon, { fontSize: size }),
|
|
7824
7926
|
showTooltip: true
|
|
7825
7927
|
},
|
|
7826
7928
|
{
|
|
7827
7929
|
value: "custom",
|
|
7828
|
-
label:
|
|
7829
|
-
renderContent: ({ size }) => /* @__PURE__ */
|
|
7930
|
+
label: __47("Custom", "elementor"),
|
|
7931
|
+
renderContent: ({ size }) => /* @__PURE__ */ React100.createElement(PencilIcon, { fontSize: size }),
|
|
7830
7932
|
showTooltip: true
|
|
7831
7933
|
}
|
|
7832
7934
|
];
|
|
7833
7935
|
var BackgroundImageOverlaySize = () => {
|
|
7834
7936
|
const backgroundImageScaleContext = useBoundProp(backgroundImageSizeScalePropTypeUtil);
|
|
7835
|
-
const stringPropContext = useBoundProp(
|
|
7937
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil18);
|
|
7836
7938
|
const isCustom = !!backgroundImageScaleContext.value;
|
|
7837
|
-
const rowRef =
|
|
7939
|
+
const rowRef = useRef25(null);
|
|
7838
7940
|
const handleSizeChange = (size) => {
|
|
7839
7941
|
if (size === "custom") {
|
|
7840
7942
|
backgroundImageScaleContext.setValue({ width: null, height: null });
|
|
@@ -7842,7 +7944,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
7842
7944
|
stringPropContext.setValue(size);
|
|
7843
7945
|
}
|
|
7844
7946
|
};
|
|
7845
|
-
return /* @__PURE__ */
|
|
7947
|
+
return /* @__PURE__ */ React100.createElement(Grid17, { container: true, spacing: 1.5 }, /* @__PURE__ */ React100.createElement(Grid17, { item: true, xs: 12 }, /* @__PURE__ */ React100.createElement(PopoverGridContainer, null, /* @__PURE__ */ React100.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React100.createElement(ControlFormLabel, null, __47("Size", "elementor"))), /* @__PURE__ */ React100.createElement(Grid17, { item: true, xs: 6, sx: { display: "flex", justifyContent: "flex-end" } }, /* @__PURE__ */ React100.createElement(
|
|
7846
7948
|
ControlToggleButtonGroup,
|
|
7847
7949
|
{
|
|
7848
7950
|
exclusive: true,
|
|
@@ -7851,17 +7953,17 @@ var BackgroundImageOverlaySize = () => {
|
|
|
7851
7953
|
disabled: stringPropContext.disabled,
|
|
7852
7954
|
value: backgroundImageScaleContext.value ? "custom" : stringPropContext.value
|
|
7853
7955
|
}
|
|
7854
|
-
)))), isCustom ? /* @__PURE__ */
|
|
7956
|
+
)))), isCustom ? /* @__PURE__ */ React100.createElement(PropProvider, { ...backgroundImageScaleContext }, /* @__PURE__ */ React100.createElement(Grid17, { item: true, xs: 12, ref: rowRef }, /* @__PURE__ */ React100.createElement(PopoverGridContainer, null, /* @__PURE__ */ React100.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React100.createElement(PropKeyProvider, { bind: "width" }, /* @__PURE__ */ React100.createElement(
|
|
7855
7957
|
SizeControl,
|
|
7856
7958
|
{
|
|
7857
|
-
startIcon: /* @__PURE__ */
|
|
7959
|
+
startIcon: /* @__PURE__ */ React100.createElement(ArrowsMoveHorizontalIcon2, { fontSize: "tiny" }),
|
|
7858
7960
|
extendedOptions: ["auto"],
|
|
7859
7961
|
anchorRef: rowRef
|
|
7860
7962
|
}
|
|
7861
|
-
))), /* @__PURE__ */
|
|
7963
|
+
))), /* @__PURE__ */ React100.createElement(Grid17, { item: true, xs: 6 }, /* @__PURE__ */ React100.createElement(PropKeyProvider, { bind: "height" }, /* @__PURE__ */ React100.createElement(
|
|
7862
7964
|
SizeControl,
|
|
7863
7965
|
{
|
|
7864
|
-
startIcon: /* @__PURE__ */
|
|
7966
|
+
startIcon: /* @__PURE__ */ React100.createElement(ArrowsMoveVerticalIcon2, { fontSize: "tiny" }),
|
|
7865
7967
|
extendedOptions: ["auto"],
|
|
7866
7968
|
anchorRef: rowRef
|
|
7867
7969
|
}
|
|
@@ -7869,7 +7971,7 @@ var BackgroundImageOverlaySize = () => {
|
|
|
7869
7971
|
};
|
|
7870
7972
|
|
|
7871
7973
|
// src/controls/background-control/background-overlay/use-background-tabs-history.ts
|
|
7872
|
-
import { useRef as
|
|
7974
|
+
import { useRef as useRef26 } from "react";
|
|
7873
7975
|
import {
|
|
7874
7976
|
backgroundColorOverlayPropTypeUtil,
|
|
7875
7977
|
backgroundGradientOverlayPropTypeUtil as backgroundGradientOverlayPropTypeUtil2,
|
|
@@ -7894,7 +7996,7 @@ var useBackgroundTabsHistory = ({
|
|
|
7894
7996
|
return "image";
|
|
7895
7997
|
};
|
|
7896
7998
|
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs(getCurrentOverlayType());
|
|
7897
|
-
const valuesHistory =
|
|
7999
|
+
const valuesHistory = useRef26({
|
|
7898
8000
|
image: initialBackgroundImageOverlay,
|
|
7899
8001
|
color: initialBackgroundColorOverlay2,
|
|
7900
8002
|
gradient: initialBackgroundGradientOverlay2
|
|
@@ -7962,29 +8064,29 @@ var getInitialBackgroundOverlay = () => ({
|
|
|
7962
8064
|
}
|
|
7963
8065
|
});
|
|
7964
8066
|
var backgroundResolutionOptions = [
|
|
7965
|
-
{ label:
|
|
7966
|
-
{ label:
|
|
7967
|
-
{ label:
|
|
7968
|
-
{ label:
|
|
8067
|
+
{ label: __48("Thumbnail - 150 x 150", "elementor"), value: "thumbnail" },
|
|
8068
|
+
{ label: __48("Medium - 300 x 300", "elementor"), value: "medium" },
|
|
8069
|
+
{ label: __48("Large 1024 x 1024", "elementor"), value: "large" },
|
|
8070
|
+
{ label: __48("Full", "elementor"), value: "full" }
|
|
7969
8071
|
];
|
|
7970
8072
|
var BackgroundOverlayRepeaterControl = createControl(() => {
|
|
7971
8073
|
const { propType, value: overlayValues, setValue } = useBoundProp(backgroundOverlayPropTypeUtil);
|
|
7972
|
-
return /* @__PURE__ */
|
|
8074
|
+
return /* @__PURE__ */ React101.createElement(PropProvider, { propType, value: overlayValues, setValue }, /* @__PURE__ */ React101.createElement(
|
|
7973
8075
|
ControlRepeater,
|
|
7974
8076
|
{
|
|
7975
8077
|
initial: getInitialBackgroundOverlay(),
|
|
7976
8078
|
propTypeUtil: backgroundOverlayPropTypeUtil
|
|
7977
8079
|
},
|
|
7978
|
-
/* @__PURE__ */
|
|
7979
|
-
/* @__PURE__ */
|
|
8080
|
+
/* @__PURE__ */ React101.createElement(RepeaterHeader, { label: __48("Overlay", "elementor") }, /* @__PURE__ */ React101.createElement(TooltipAddItemAction, { newItemIndex: 0 })),
|
|
8081
|
+
/* @__PURE__ */ React101.createElement(ItemsContainer, null, /* @__PURE__ */ React101.createElement(
|
|
7980
8082
|
Item,
|
|
7981
8083
|
{
|
|
7982
8084
|
Icon: ItemIcon2,
|
|
7983
8085
|
Label: ItemLabel3,
|
|
7984
|
-
actions: /* @__PURE__ */
|
|
8086
|
+
actions: /* @__PURE__ */ React101.createElement(React101.Fragment, null, /* @__PURE__ */ React101.createElement(DuplicateItemAction, null), /* @__PURE__ */ React101.createElement(DisableItemAction, null), /* @__PURE__ */ React101.createElement(RemoveItemAction, null))
|
|
7985
8087
|
}
|
|
7986
8088
|
)),
|
|
7987
|
-
/* @__PURE__ */
|
|
8089
|
+
/* @__PURE__ */ React101.createElement(EditItemPopover, null, /* @__PURE__ */ React101.createElement(ItemContent2, null))
|
|
7988
8090
|
));
|
|
7989
8091
|
});
|
|
7990
8092
|
var ItemContent2 = () => {
|
|
@@ -7994,27 +8096,27 @@ var ItemContent2 = () => {
|
|
|
7994
8096
|
gradient: initialBackgroundGradientOverlay.value
|
|
7995
8097
|
});
|
|
7996
8098
|
const { rowRef } = useRepeaterContext();
|
|
7997
|
-
return /* @__PURE__ */
|
|
8099
|
+
return /* @__PURE__ */ React101.createElement(Box25, { sx: { width: "100%" } }, /* @__PURE__ */ React101.createElement(Box25, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React101.createElement(
|
|
7998
8100
|
Tabs,
|
|
7999
8101
|
{
|
|
8000
8102
|
size: "small",
|
|
8001
8103
|
variant: "fullWidth",
|
|
8002
8104
|
...getTabsProps(),
|
|
8003
|
-
"aria-label":
|
|
8105
|
+
"aria-label": __48("Background Overlay", "elementor")
|
|
8004
8106
|
},
|
|
8005
|
-
/* @__PURE__ */
|
|
8006
|
-
/* @__PURE__ */
|
|
8007
|
-
/* @__PURE__ */
|
|
8008
|
-
)), /* @__PURE__ */
|
|
8107
|
+
/* @__PURE__ */ React101.createElement(Tab, { label: __48("Image", "elementor"), ...getTabProps("image") }),
|
|
8108
|
+
/* @__PURE__ */ React101.createElement(Tab, { label: __48("Gradient", "elementor"), ...getTabProps("gradient") }),
|
|
8109
|
+
/* @__PURE__ */ React101.createElement(Tab, { label: __48("Color", "elementor"), ...getTabProps("color") })
|
|
8110
|
+
)), /* @__PURE__ */ React101.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("image") }, /* @__PURE__ */ React101.createElement(PopoverContent, null, /* @__PURE__ */ React101.createElement(ImageOverlayContent, null))), /* @__PURE__ */ React101.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("gradient") }, /* @__PURE__ */ React101.createElement(BackgroundGradientColorControl, null)), /* @__PURE__ */ React101.createElement(TabPanel, { sx: { p: 1.5 }, ...getTabPanelProps("color") }, /* @__PURE__ */ React101.createElement(PopoverContent, null, /* @__PURE__ */ React101.createElement(ColorOverlayContent, { anchorEl: rowRef }))));
|
|
8009
8111
|
};
|
|
8010
8112
|
var ItemIcon2 = ({ value }) => {
|
|
8011
8113
|
switch (value.$$type) {
|
|
8012
8114
|
case "background-image-overlay":
|
|
8013
|
-
return /* @__PURE__ */
|
|
8115
|
+
return /* @__PURE__ */ React101.createElement(ItemIconImage, { value });
|
|
8014
8116
|
case "background-color-overlay":
|
|
8015
|
-
return /* @__PURE__ */
|
|
8117
|
+
return /* @__PURE__ */ React101.createElement(ItemIconColor, { value });
|
|
8016
8118
|
case "background-gradient-overlay":
|
|
8017
|
-
return /* @__PURE__ */
|
|
8119
|
+
return /* @__PURE__ */ React101.createElement(ItemIconGradient, { value });
|
|
8018
8120
|
default:
|
|
8019
8121
|
return null;
|
|
8020
8122
|
}
|
|
@@ -8027,11 +8129,11 @@ var extractColorFrom = (prop) => {
|
|
|
8027
8129
|
};
|
|
8028
8130
|
var ItemIconColor = ({ value: prop }) => {
|
|
8029
8131
|
const color = extractColorFrom(prop);
|
|
8030
|
-
return /* @__PURE__ */
|
|
8132
|
+
return /* @__PURE__ */ React101.createElement(StyledUnstableColorIndicator3, { size: "inherit", component: "span", value: color });
|
|
8031
8133
|
};
|
|
8032
8134
|
var ItemIconImage = ({ value }) => {
|
|
8033
8135
|
const { imageUrl } = useImage(value);
|
|
8034
|
-
return /* @__PURE__ */
|
|
8136
|
+
return /* @__PURE__ */ React101.createElement(
|
|
8035
8137
|
CardMedia4,
|
|
8036
8138
|
{
|
|
8037
8139
|
image: imageUrl,
|
|
@@ -8046,41 +8148,41 @@ var ItemIconImage = ({ value }) => {
|
|
|
8046
8148
|
};
|
|
8047
8149
|
var ItemIconGradient = ({ value }) => {
|
|
8048
8150
|
const gradient = getGradientValue(value);
|
|
8049
|
-
return /* @__PURE__ */
|
|
8151
|
+
return /* @__PURE__ */ React101.createElement(StyledUnstableColorIndicator3, { size: "inherit", component: "span", value: gradient });
|
|
8050
8152
|
};
|
|
8051
8153
|
var ItemLabel3 = ({ value }) => {
|
|
8052
8154
|
switch (value.$$type) {
|
|
8053
8155
|
case "background-image-overlay":
|
|
8054
|
-
return /* @__PURE__ */
|
|
8156
|
+
return /* @__PURE__ */ React101.createElement(ItemLabelImage, { value });
|
|
8055
8157
|
case "background-color-overlay":
|
|
8056
|
-
return /* @__PURE__ */
|
|
8158
|
+
return /* @__PURE__ */ React101.createElement(ItemLabelColor, { value });
|
|
8057
8159
|
case "background-gradient-overlay":
|
|
8058
|
-
return /* @__PURE__ */
|
|
8160
|
+
return /* @__PURE__ */ React101.createElement(ItemLabelGradient, { value });
|
|
8059
8161
|
default:
|
|
8060
8162
|
return null;
|
|
8061
8163
|
}
|
|
8062
8164
|
};
|
|
8063
8165
|
var ItemLabelColor = ({ value: prop }) => {
|
|
8064
8166
|
const color = extractColorFrom(prop);
|
|
8065
|
-
return /* @__PURE__ */
|
|
8167
|
+
return /* @__PURE__ */ React101.createElement("span", null, color);
|
|
8066
8168
|
};
|
|
8067
8169
|
var ItemLabelImage = ({ value }) => {
|
|
8068
8170
|
const { imageTitle } = useImage(value);
|
|
8069
|
-
return /* @__PURE__ */
|
|
8171
|
+
return /* @__PURE__ */ React101.createElement("span", null, imageTitle);
|
|
8070
8172
|
};
|
|
8071
8173
|
var ItemLabelGradient = ({ value }) => {
|
|
8072
8174
|
if (value.value.type.value === "linear") {
|
|
8073
|
-
return /* @__PURE__ */
|
|
8175
|
+
return /* @__PURE__ */ React101.createElement("span", null, __48("Linear Gradient", "elementor"));
|
|
8074
8176
|
}
|
|
8075
|
-
return /* @__PURE__ */
|
|
8177
|
+
return /* @__PURE__ */ React101.createElement("span", null, __48("Radial Gradient", "elementor"));
|
|
8076
8178
|
};
|
|
8077
8179
|
var ColorOverlayContent = ({ anchorEl }) => {
|
|
8078
8180
|
const propContext = useBoundProp(backgroundColorOverlayPropTypeUtil2);
|
|
8079
|
-
return /* @__PURE__ */
|
|
8181
|
+
return /* @__PURE__ */ React101.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React101.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React101.createElement(ColorControl, { anchorEl })));
|
|
8080
8182
|
};
|
|
8081
8183
|
var ImageOverlayContent = () => {
|
|
8082
8184
|
const propContext = useBoundProp(backgroundImageOverlayPropTypeUtil2);
|
|
8083
|
-
return /* @__PURE__ */
|
|
8185
|
+
return /* @__PURE__ */ React101.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React101.createElement(PropKeyProvider, { bind: "image" }, /* @__PURE__ */ React101.createElement(ImageControl, { sizes: backgroundResolutionOptions })), /* @__PURE__ */ React101.createElement(PropKeyProvider, { bind: "position" }, /* @__PURE__ */ React101.createElement(BackgroundImageOverlayPosition, null)), /* @__PURE__ */ React101.createElement(PropKeyProvider, { bind: "repeat" }, /* @__PURE__ */ React101.createElement(BackgroundImageOverlayRepeat, null)), /* @__PURE__ */ React101.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React101.createElement(BackgroundImageOverlaySize, null)), /* @__PURE__ */ React101.createElement(PropKeyProvider, { bind: "attachment" }, /* @__PURE__ */ React101.createElement(BackgroundImageOverlayAttachment, null)));
|
|
8084
8186
|
};
|
|
8085
8187
|
var StyledUnstableColorIndicator3 = styled13(UnstableColorIndicator3)(({ theme }) => ({
|
|
8086
8188
|
height: "1rem",
|
|
@@ -8125,27 +8227,27 @@ var getGradientValue = (value) => {
|
|
|
8125
8227
|
|
|
8126
8228
|
// src/controls/background-control/background-control.tsx
|
|
8127
8229
|
var clipOptions = [
|
|
8128
|
-
{ label:
|
|
8129
|
-
{ label:
|
|
8130
|
-
{ label:
|
|
8131
|
-
{ label:
|
|
8230
|
+
{ label: __49("Full element", "elementor"), value: "border-box" },
|
|
8231
|
+
{ label: __49("Padding edges", "elementor"), value: "padding-box" },
|
|
8232
|
+
{ label: __49("Content edges", "elementor"), value: "content-box" },
|
|
8233
|
+
{ label: __49("Text", "elementor"), value: "text" }
|
|
8132
8234
|
];
|
|
8133
|
-
var colorLabel =
|
|
8134
|
-
var clipLabel =
|
|
8235
|
+
var colorLabel = __49("Color", "elementor");
|
|
8236
|
+
var clipLabel = __49("Clipping", "elementor");
|
|
8135
8237
|
var BackgroundControl = createControl(() => {
|
|
8136
8238
|
const propContext = useBoundProp(backgroundPropTypeUtil);
|
|
8137
|
-
return /* @__PURE__ */
|
|
8239
|
+
return /* @__PURE__ */ React102.createElement(PropProvider, { ...propContext }, /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "background-overlay" }, /* @__PURE__ */ React102.createElement(BackgroundOverlayRepeaterControl, null)), /* @__PURE__ */ React102.createElement(BackgroundColorField, null), /* @__PURE__ */ React102.createElement(BackgroundClipField, null));
|
|
8138
8240
|
});
|
|
8139
8241
|
var BackgroundColorField = () => {
|
|
8140
|
-
return /* @__PURE__ */
|
|
8242
|
+
return /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "color" }, /* @__PURE__ */ React102.createElement(Grid18, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React102.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, colorLabel)), /* @__PURE__ */ React102.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React102.createElement(ColorControl, null))));
|
|
8141
8243
|
};
|
|
8142
8244
|
var BackgroundClipField = () => {
|
|
8143
|
-
return /* @__PURE__ */
|
|
8245
|
+
return /* @__PURE__ */ React102.createElement(PropKeyProvider, { bind: "clip" }, /* @__PURE__ */ React102.createElement(Grid18, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React102.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React102.createElement(ControlLabel, null, clipLabel)), /* @__PURE__ */ React102.createElement(Grid18, { item: true, xs: 6 }, /* @__PURE__ */ React102.createElement(SelectControl, { options: clipOptions }))));
|
|
8144
8246
|
};
|
|
8145
8247
|
|
|
8146
8248
|
// src/controls/repeatable-control.tsx
|
|
8147
|
-
import * as
|
|
8148
|
-
import { useMemo as
|
|
8249
|
+
import * as React103 from "react";
|
|
8250
|
+
import { useMemo as useMemo15 } from "react";
|
|
8149
8251
|
import { createArrayPropUtils as createArrayPropUtils2 } from "@elementor/editor-props";
|
|
8150
8252
|
import { Box as Box26 } from "@elementor/ui";
|
|
8151
8253
|
var PLACEHOLDER_REGEX = /\$\{([^}]+)\}/g;
|
|
@@ -8166,11 +8268,11 @@ var RepeatableControl = createControl(
|
|
|
8166
8268
|
if (!childPropTypeUtil) {
|
|
8167
8269
|
return null;
|
|
8168
8270
|
}
|
|
8169
|
-
const childArrayPropTypeUtil2 =
|
|
8271
|
+
const childArrayPropTypeUtil2 = useMemo15(
|
|
8170
8272
|
() => createArrayPropUtils2(childPropTypeUtil.key, childPropTypeUtil.schema, propKey),
|
|
8171
8273
|
[childPropTypeUtil.key, childPropTypeUtil.schema, propKey]
|
|
8172
8274
|
);
|
|
8173
|
-
const contextValue =
|
|
8275
|
+
const contextValue = useMemo15(
|
|
8174
8276
|
() => ({
|
|
8175
8277
|
...childControlConfig,
|
|
8176
8278
|
placeholder: placeholder || "",
|
|
@@ -8180,14 +8282,14 @@ var RepeatableControl = createControl(
|
|
|
8180
8282
|
);
|
|
8181
8283
|
const { propType, value, setValue } = useBoundProp(childArrayPropTypeUtil2);
|
|
8182
8284
|
const newItemIndex = addItemTooltipProps?.newItemIndex === null ? void 0 : 0;
|
|
8183
|
-
return /* @__PURE__ */
|
|
8285
|
+
return /* @__PURE__ */ React103.createElement(PropProvider, { propType, value, setValue }, /* @__PURE__ */ React103.createElement(RepeatableControlContext.Provider, { value: contextValue }, /* @__PURE__ */ React103.createElement(
|
|
8184
8286
|
ControlRepeater,
|
|
8185
8287
|
{
|
|
8186
8288
|
initial: childPropTypeUtil.create(initialValues || null),
|
|
8187
8289
|
propTypeUtil: childArrayPropTypeUtil2,
|
|
8188
8290
|
isItemDisabled: isItemDisabled2
|
|
8189
8291
|
},
|
|
8190
|
-
/* @__PURE__ */
|
|
8292
|
+
/* @__PURE__ */ React103.createElement(RepeaterHeader, { label: repeaterLabel }, /* @__PURE__ */ React103.createElement(
|
|
8191
8293
|
TooltipAddItemAction,
|
|
8192
8294
|
{
|
|
8193
8295
|
...addItemTooltipProps,
|
|
@@ -8195,22 +8297,22 @@ var RepeatableControl = createControl(
|
|
|
8195
8297
|
ariaLabel: repeaterLabel
|
|
8196
8298
|
}
|
|
8197
8299
|
)),
|
|
8198
|
-
/* @__PURE__ */
|
|
8300
|
+
/* @__PURE__ */ React103.createElement(ItemsContainer, { isSortable }, /* @__PURE__ */ React103.createElement(
|
|
8199
8301
|
Item,
|
|
8200
8302
|
{
|
|
8201
8303
|
Icon: ItemIcon3,
|
|
8202
8304
|
Label: ItemLabel4,
|
|
8203
|
-
actions: /* @__PURE__ */
|
|
8305
|
+
actions: /* @__PURE__ */ React103.createElement(React103.Fragment, null, showDuplicate && /* @__PURE__ */ React103.createElement(DuplicateItemAction, null), showToggle && /* @__PURE__ */ React103.createElement(DisableItemAction, null), /* @__PURE__ */ React103.createElement(RemoveItemAction, null))
|
|
8204
8306
|
}
|
|
8205
8307
|
)),
|
|
8206
|
-
/* @__PURE__ */
|
|
8308
|
+
/* @__PURE__ */ React103.createElement(EditItemPopover, null, /* @__PURE__ */ React103.createElement(Content2, null))
|
|
8207
8309
|
)));
|
|
8208
8310
|
}
|
|
8209
8311
|
);
|
|
8210
|
-
var ItemIcon3 = () => /* @__PURE__ */
|
|
8312
|
+
var ItemIcon3 = () => /* @__PURE__ */ React103.createElement(React103.Fragment, null);
|
|
8211
8313
|
var Content2 = () => {
|
|
8212
8314
|
const { component: ChildControl, props = {} } = useRepeatableControlContext();
|
|
8213
|
-
return /* @__PURE__ */
|
|
8315
|
+
return /* @__PURE__ */ React103.createElement(PopoverContent, { p: 1.5 }, /* @__PURE__ */ React103.createElement(PopoverGridContainer, null, /* @__PURE__ */ React103.createElement(ChildControl, { ...props })));
|
|
8214
8316
|
};
|
|
8215
8317
|
var interpolate = (template, data) => {
|
|
8216
8318
|
if (!data) {
|
|
@@ -8293,7 +8395,7 @@ var ItemLabel4 = ({ value }) => {
|
|
|
8293
8395
|
const label = showPlaceholder ? placeholder : interpolate(patternLabel, value);
|
|
8294
8396
|
const isReadOnly = !!childProps?.readOnly;
|
|
8295
8397
|
const color = getTextColor(isReadOnly, showPlaceholder);
|
|
8296
|
-
return /* @__PURE__ */
|
|
8398
|
+
return /* @__PURE__ */ React103.createElement(Box26, { component: "span", color }, label);
|
|
8297
8399
|
};
|
|
8298
8400
|
var getAllProperties = (pattern) => {
|
|
8299
8401
|
const properties = pattern.match(PLACEHOLDER_REGEX)?.map((match) => match.slice(2, -1)) || [];
|
|
@@ -8301,15 +8403,15 @@ var getAllProperties = (pattern) => {
|
|
|
8301
8403
|
};
|
|
8302
8404
|
|
|
8303
8405
|
// src/controls/key-value-control.tsx
|
|
8304
|
-
import * as
|
|
8305
|
-
import { useMemo as
|
|
8406
|
+
import * as React104 from "react";
|
|
8407
|
+
import { useMemo as useMemo16, useState as useState25 } from "react";
|
|
8306
8408
|
import {
|
|
8307
8409
|
isTransformable,
|
|
8308
8410
|
keyValuePropTypeUtil,
|
|
8309
|
-
stringPropTypeUtil as
|
|
8411
|
+
stringPropTypeUtil as stringPropTypeUtil19
|
|
8310
8412
|
} from "@elementor/editor-props";
|
|
8311
8413
|
import { FormHelperText, FormLabel as FormLabel3, Grid as Grid19 } from "@elementor/ui";
|
|
8312
|
-
import { __ as
|
|
8414
|
+
import { __ as __50 } from "@wordpress/i18n";
|
|
8313
8415
|
|
|
8314
8416
|
// src/utils/escape-html-attr.ts
|
|
8315
8417
|
var escapeHtmlAttr = (value) => {
|
|
@@ -8339,17 +8441,17 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
8339
8441
|
key: getInitialFieldValue(value?.key),
|
|
8340
8442
|
value: getInitialFieldValue(value?.value)
|
|
8341
8443
|
});
|
|
8342
|
-
const keyLabel = props.keyName ||
|
|
8343
|
-
const valueLabel = props.valueName ||
|
|
8444
|
+
const keyLabel = props.keyName || __50("Key", "elementor");
|
|
8445
|
+
const valueLabel = props.valueName || __50("Value", "elementor");
|
|
8344
8446
|
const { keyHelper, valueHelper } = props.getHelperText?.(sessionState.key, sessionState.value) || {
|
|
8345
8447
|
keyHelper: void 0,
|
|
8346
8448
|
valueHelper: void 0
|
|
8347
8449
|
};
|
|
8348
|
-
const [keyRegex, valueRegex, errMsg] =
|
|
8450
|
+
const [keyRegex, valueRegex, errMsg] = useMemo16(
|
|
8349
8451
|
() => [
|
|
8350
8452
|
props.regexKey ? new RegExp(props.regexKey) : void 0,
|
|
8351
8453
|
props.regexValue ? new RegExp(props.regexValue) : void 0,
|
|
8352
|
-
props.validationErrorMessage ||
|
|
8454
|
+
props.validationErrorMessage || __50("Invalid Format", "elementor")
|
|
8353
8455
|
],
|
|
8354
8456
|
[props.regexKey, props.regexValue, props.validationErrorMessage]
|
|
8355
8457
|
);
|
|
@@ -8378,7 +8480,7 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
8378
8480
|
});
|
|
8379
8481
|
return;
|
|
8380
8482
|
}
|
|
8381
|
-
const extractedValue =
|
|
8483
|
+
const extractedValue = stringPropTypeUtil19.extract(newChangedValue);
|
|
8382
8484
|
setSessionState((prev) => ({
|
|
8383
8485
|
...prev,
|
|
8384
8486
|
[fieldType]: extractedValue
|
|
@@ -8398,14 +8500,14 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
8398
8500
|
});
|
|
8399
8501
|
}
|
|
8400
8502
|
};
|
|
8401
|
-
return /* @__PURE__ */
|
|
8503
|
+
return /* @__PURE__ */ React104.createElement(PropProvider, { ...propContext, value, setValue: handleChange }, /* @__PURE__ */ React104.createElement(Grid19, { container: true, gap: 1.5 }, /* @__PURE__ */ React104.createElement(Grid19, { item: true, xs: 12, display: "flex", flexDirection: "column" }, /* @__PURE__ */ React104.createElement(FormLabel3, { size: "tiny", sx: { pb: 1 } }, keyLabel), /* @__PURE__ */ React104.createElement(PropKeyProvider, { bind: "key" }, /* @__PURE__ */ React104.createElement(
|
|
8402
8504
|
TextControl,
|
|
8403
8505
|
{
|
|
8404
8506
|
inputValue: props.escapeHtml ? escapeHtmlAttr(sessionState.key) : sessionState.key,
|
|
8405
8507
|
error: !!keyError,
|
|
8406
8508
|
helperText: keyHelper
|
|
8407
8509
|
}
|
|
8408
|
-
)), !!keyError && /* @__PURE__ */
|
|
8510
|
+
)), !!keyError && /* @__PURE__ */ React104.createElement(FormHelperText, { error: true }, keyError)), /* @__PURE__ */ React104.createElement(Grid19, { item: true, xs: 12, display: "flex", flexDirection: "column" }, /* @__PURE__ */ React104.createElement(FormLabel3, { size: "tiny", sx: { pb: 1 } }, valueLabel), /* @__PURE__ */ React104.createElement(PropKeyProvider, { bind: "value" }, /* @__PURE__ */ React104.createElement(
|
|
8409
8511
|
TextControl,
|
|
8410
8512
|
{
|
|
8411
8513
|
inputValue: props.escapeHtml ? escapeHtmlAttr(sessionState.value) : sessionState.value,
|
|
@@ -8413,31 +8515,31 @@ var KeyValueControl = createControl((props = {}) => {
|
|
|
8413
8515
|
inputDisabled: !!keyError,
|
|
8414
8516
|
helperText: valueHelper
|
|
8415
8517
|
}
|
|
8416
|
-
)), !!valueError && /* @__PURE__ */
|
|
8518
|
+
)), !!valueError && /* @__PURE__ */ React104.createElement(FormHelperText, { error: true }, valueError))));
|
|
8417
8519
|
});
|
|
8418
8520
|
|
|
8419
8521
|
// src/controls/position-control.tsx
|
|
8420
|
-
import * as
|
|
8421
|
-
import { positionPropTypeUtil, stringPropTypeUtil as
|
|
8522
|
+
import * as React105 from "react";
|
|
8523
|
+
import { positionPropTypeUtil, stringPropTypeUtil as stringPropTypeUtil20 } from "@elementor/editor-props";
|
|
8422
8524
|
import { MenuListItem as MenuListItem7 } from "@elementor/editor-ui";
|
|
8423
8525
|
import { LetterXIcon as LetterXIcon2, LetterYIcon as LetterYIcon2 } from "@elementor/icons";
|
|
8424
8526
|
import { Grid as Grid20, Select as Select5 } from "@elementor/ui";
|
|
8425
|
-
import { __ as
|
|
8527
|
+
import { __ as __51 } from "@wordpress/i18n";
|
|
8426
8528
|
var positionOptions = [
|
|
8427
|
-
{ label:
|
|
8428
|
-
{ label:
|
|
8429
|
-
{ label:
|
|
8430
|
-
{ label:
|
|
8431
|
-
{ label:
|
|
8432
|
-
{ label:
|
|
8433
|
-
{ label:
|
|
8434
|
-
{ label:
|
|
8435
|
-
{ label:
|
|
8436
|
-
{ label:
|
|
8529
|
+
{ label: __51("Center center", "elementor"), value: "center center" },
|
|
8530
|
+
{ label: __51("Center left", "elementor"), value: "center left" },
|
|
8531
|
+
{ label: __51("Center right", "elementor"), value: "center right" },
|
|
8532
|
+
{ label: __51("Top center", "elementor"), value: "top center" },
|
|
8533
|
+
{ label: __51("Top left", "elementor"), value: "top left" },
|
|
8534
|
+
{ label: __51("Top right", "elementor"), value: "top right" },
|
|
8535
|
+
{ label: __51("Bottom center", "elementor"), value: "bottom center" },
|
|
8536
|
+
{ label: __51("Bottom left", "elementor"), value: "bottom left" },
|
|
8537
|
+
{ label: __51("Bottom right", "elementor"), value: "bottom right" },
|
|
8538
|
+
{ label: __51("Custom", "elementor"), value: "custom" }
|
|
8437
8539
|
];
|
|
8438
8540
|
var PositionControl = () => {
|
|
8439
8541
|
const positionContext = useBoundProp(positionPropTypeUtil);
|
|
8440
|
-
const stringPropContext = useBoundProp(
|
|
8542
|
+
const stringPropContext = useBoundProp(stringPropTypeUtil20);
|
|
8441
8543
|
const isCustom = !!positionContext.value;
|
|
8442
8544
|
const placeholder = positionContext.placeholder ? "custom" : stringPropContext.placeholder ?? null;
|
|
8443
8545
|
const handlePositionChange = (event) => {
|
|
@@ -8448,7 +8550,7 @@ var PositionControl = () => {
|
|
|
8448
8550
|
stringPropContext.setValue(value);
|
|
8449
8551
|
}
|
|
8450
8552
|
};
|
|
8451
|
-
return /* @__PURE__ */
|
|
8553
|
+
return /* @__PURE__ */ React105.createElement(Grid20, { container: true, spacing: 1.5 }, /* @__PURE__ */ React105.createElement(Grid20, { item: true, xs: 12 }, /* @__PURE__ */ React105.createElement(Grid20, { container: true, gap: 2, alignItems: "center", flexWrap: "nowrap" }, /* @__PURE__ */ React105.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React105.createElement(ControlFormLabel, null, __51("Object position", "elementor"))), /* @__PURE__ */ React105.createElement(Grid20, { item: true, xs: 6, sx: { overflow: "hidden" } }, /* @__PURE__ */ React105.createElement(
|
|
8452
8554
|
Select5,
|
|
8453
8555
|
{
|
|
8454
8556
|
size: "tiny",
|
|
@@ -8459,33 +8561,33 @@ var PositionControl = () => {
|
|
|
8459
8561
|
renderValue: (selectedValue) => getSelectRenderValue(positionOptions, placeholder, selectedValue),
|
|
8460
8562
|
fullWidth: true
|
|
8461
8563
|
},
|
|
8462
|
-
positionOptions.map(({ label, value }) => /* @__PURE__ */
|
|
8463
|
-
)))), isCustom && /* @__PURE__ */
|
|
8564
|
+
positionOptions.map(({ label, value }) => /* @__PURE__ */ React105.createElement(MenuListItem7, { key: value, value: value ?? "" }, label))
|
|
8565
|
+
)))), isCustom && /* @__PURE__ */ React105.createElement(PropProvider, { ...positionContext }, /* @__PURE__ */ React105.createElement(Grid20, { item: true, xs: 12 }, /* @__PURE__ */ React105.createElement(Grid20, { container: true, spacing: 1.5 }, /* @__PURE__ */ React105.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React105.createElement(PropKeyProvider, { bind: "x" }, /* @__PURE__ */ React105.createElement(
|
|
8464
8566
|
SizeControl,
|
|
8465
8567
|
{
|
|
8466
|
-
startIcon: /* @__PURE__ */
|
|
8568
|
+
startIcon: /* @__PURE__ */ React105.createElement(LetterXIcon2, { fontSize: "tiny" }),
|
|
8467
8569
|
min: -Number.MAX_SAFE_INTEGER
|
|
8468
8570
|
}
|
|
8469
|
-
))), /* @__PURE__ */
|
|
8571
|
+
))), /* @__PURE__ */ React105.createElement(Grid20, { item: true, xs: 6 }, /* @__PURE__ */ React105.createElement(PropKeyProvider, { bind: "y" }, /* @__PURE__ */ React105.createElement(
|
|
8470
8572
|
SizeControl,
|
|
8471
8573
|
{
|
|
8472
|
-
startIcon: /* @__PURE__ */
|
|
8574
|
+
startIcon: /* @__PURE__ */ React105.createElement(LetterYIcon2, { fontSize: "tiny" }),
|
|
8473
8575
|
min: -Number.MAX_SAFE_INTEGER
|
|
8474
8576
|
}
|
|
8475
8577
|
)))))));
|
|
8476
8578
|
};
|
|
8477
8579
|
|
|
8478
8580
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
8479
|
-
import * as
|
|
8480
|
-
import { useRef as
|
|
8581
|
+
import * as React118 from "react";
|
|
8582
|
+
import { useRef as useRef34 } from "react";
|
|
8481
8583
|
import { transformFunctionsPropTypeUtil, transformPropTypeUtil } from "@elementor/editor-props";
|
|
8482
8584
|
import { AdjustmentsIcon as AdjustmentsIcon2, InfoCircleFilledIcon as InfoCircleFilledIcon2 } from "@elementor/icons";
|
|
8483
8585
|
import { bindTrigger as bindTrigger5, Box as Box30, IconButton as IconButton10, Tooltip as Tooltip12, Typography as Typography12, usePopupState as usePopupState10 } from "@elementor/ui";
|
|
8484
|
-
import { __ as
|
|
8586
|
+
import { __ as __61 } from "@wordpress/i18n";
|
|
8485
8587
|
|
|
8486
8588
|
// src/controls/transform-control/initial-values.ts
|
|
8487
8589
|
import {
|
|
8488
|
-
numberPropTypeUtil as
|
|
8590
|
+
numberPropTypeUtil as numberPropTypeUtil7,
|
|
8489
8591
|
rotateTransformPropTypeUtil,
|
|
8490
8592
|
scaleTransformPropTypeUtil,
|
|
8491
8593
|
skewTransformPropTypeUtil
|
|
@@ -8520,9 +8622,9 @@ var initialTransformValue = {
|
|
|
8520
8622
|
}
|
|
8521
8623
|
};
|
|
8522
8624
|
var initialScaleValue = scaleTransformPropTypeUtil.create({
|
|
8523
|
-
x:
|
|
8524
|
-
y:
|
|
8525
|
-
z:
|
|
8625
|
+
x: numberPropTypeUtil7.create(defaultValues.scale),
|
|
8626
|
+
y: numberPropTypeUtil7.create(defaultValues.scale),
|
|
8627
|
+
z: numberPropTypeUtil7.create(defaultValues.scale)
|
|
8526
8628
|
});
|
|
8527
8629
|
var initialRotateValue = rotateTransformPropTypeUtil.create({
|
|
8528
8630
|
x: { $$type: "size", value: { size: defaultValues.rotate.size, unit: defaultValues.rotate.unit } },
|
|
@@ -8535,24 +8637,24 @@ var initialSkewValue = skewTransformPropTypeUtil.create({
|
|
|
8535
8637
|
});
|
|
8536
8638
|
|
|
8537
8639
|
// src/controls/transform-control/transform-content.tsx
|
|
8538
|
-
import * as
|
|
8640
|
+
import * as React112 from "react";
|
|
8539
8641
|
import { Box as Box27, Tab as Tab2, TabPanel as TabPanel2, Tabs as Tabs2 } from "@elementor/ui";
|
|
8540
|
-
import { __ as
|
|
8642
|
+
import { __ as __56 } from "@wordpress/i18n";
|
|
8541
8643
|
|
|
8542
8644
|
// src/controls/transform-control/functions/move.tsx
|
|
8543
|
-
import * as
|
|
8544
|
-
import { useRef as
|
|
8645
|
+
import * as React107 from "react";
|
|
8646
|
+
import { useRef as useRef27 } from "react";
|
|
8545
8647
|
import { moveTransformPropTypeUtil } from "@elementor/editor-props";
|
|
8546
8648
|
import { ArrowDownLeftIcon, ArrowDownSmallIcon, ArrowRightIcon } from "@elementor/icons";
|
|
8547
8649
|
import { Grid as Grid22 } from "@elementor/ui";
|
|
8548
|
-
import { __ as
|
|
8650
|
+
import { __ as __52 } from "@wordpress/i18n";
|
|
8549
8651
|
|
|
8550
8652
|
// src/controls/transform-control/functions/axis-row.tsx
|
|
8551
|
-
import * as
|
|
8653
|
+
import * as React106 from "react";
|
|
8552
8654
|
import { Grid as Grid21 } from "@elementor/ui";
|
|
8553
8655
|
var AxisRow = ({ label, bind, startIcon, anchorRef, units: units2, variant = "angle" }) => {
|
|
8554
8656
|
const safeId = label.replace(/\s+/g, "-").toLowerCase();
|
|
8555
|
-
return /* @__PURE__ */
|
|
8657
|
+
return /* @__PURE__ */ React106.createElement(Grid21, { item: true, xs: 12 }, /* @__PURE__ */ React106.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React106.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React106.createElement(ControlLabel, { htmlFor: safeId }, label)), /* @__PURE__ */ React106.createElement(Grid21, { item: true, xs: 6 }, /* @__PURE__ */ React106.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React106.createElement(
|
|
8556
8658
|
SizeControl,
|
|
8557
8659
|
{
|
|
8558
8660
|
anchorRef,
|
|
@@ -8568,28 +8670,28 @@ var AxisRow = ({ label, bind, startIcon, anchorRef, units: units2, variant = "an
|
|
|
8568
8670
|
// src/controls/transform-control/functions/move.tsx
|
|
8569
8671
|
var moveAxisControls = [
|
|
8570
8672
|
{
|
|
8571
|
-
label:
|
|
8673
|
+
label: __52("Move X", "elementor"),
|
|
8572
8674
|
bind: "x",
|
|
8573
|
-
startIcon: /* @__PURE__ */
|
|
8675
|
+
startIcon: /* @__PURE__ */ React107.createElement(ArrowRightIcon, { fontSize: "tiny" }),
|
|
8574
8676
|
units: ["px", "%", "em", "rem", "vw"]
|
|
8575
8677
|
},
|
|
8576
8678
|
{
|
|
8577
|
-
label:
|
|
8679
|
+
label: __52("Move Y", "elementor"),
|
|
8578
8680
|
bind: "y",
|
|
8579
|
-
startIcon: /* @__PURE__ */
|
|
8681
|
+
startIcon: /* @__PURE__ */ React107.createElement(ArrowDownSmallIcon, { fontSize: "tiny" }),
|
|
8580
8682
|
units: ["px", "%", "em", "rem", "vh"]
|
|
8581
8683
|
},
|
|
8582
8684
|
{
|
|
8583
|
-
label:
|
|
8685
|
+
label: __52("Move Z", "elementor"),
|
|
8584
8686
|
bind: "z",
|
|
8585
|
-
startIcon: /* @__PURE__ */
|
|
8687
|
+
startIcon: /* @__PURE__ */ React107.createElement(ArrowDownLeftIcon, { fontSize: "tiny" }),
|
|
8586
8688
|
units: ["px", "%", "em", "rem", "vw", "vh"]
|
|
8587
8689
|
}
|
|
8588
8690
|
];
|
|
8589
8691
|
var Move = () => {
|
|
8590
8692
|
const context = useBoundProp(moveTransformPropTypeUtil);
|
|
8591
|
-
const rowRefs = [
|
|
8592
|
-
return /* @__PURE__ */
|
|
8693
|
+
const rowRefs = [useRef27(null), useRef27(null), useRef27(null)];
|
|
8694
|
+
return /* @__PURE__ */ React107.createElement(Grid22, { container: true, spacing: 1.5 }, /* @__PURE__ */ React107.createElement(PropProvider, { ...context }, /* @__PURE__ */ React107.createElement(PropKeyProvider, { bind: TransformFunctionKeys.move }, moveAxisControls.map((control, index) => /* @__PURE__ */ React107.createElement(
|
|
8593
8695
|
AxisRow,
|
|
8594
8696
|
{
|
|
8595
8697
|
key: control.bind,
|
|
@@ -8602,34 +8704,34 @@ var Move = () => {
|
|
|
8602
8704
|
};
|
|
8603
8705
|
|
|
8604
8706
|
// src/controls/transform-control/functions/rotate.tsx
|
|
8605
|
-
import * as
|
|
8606
|
-
import { useRef as
|
|
8707
|
+
import * as React108 from "react";
|
|
8708
|
+
import { useRef as useRef28 } from "react";
|
|
8607
8709
|
import { rotateTransformPropTypeUtil as rotateTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
8608
8710
|
import { Arrow360Icon, RotateClockwiseIcon } from "@elementor/icons";
|
|
8609
8711
|
import { Grid as Grid23 } from "@elementor/ui";
|
|
8610
|
-
import { __ as
|
|
8712
|
+
import { __ as __53 } from "@wordpress/i18n";
|
|
8611
8713
|
var rotateAxisControls = [
|
|
8612
8714
|
{
|
|
8613
|
-
label:
|
|
8715
|
+
label: __53("Rotate X", "elementor"),
|
|
8614
8716
|
bind: "x",
|
|
8615
|
-
startIcon: /* @__PURE__ */
|
|
8717
|
+
startIcon: /* @__PURE__ */ React108.createElement(Arrow360Icon, { fontSize: "tiny" })
|
|
8616
8718
|
},
|
|
8617
8719
|
{
|
|
8618
|
-
label:
|
|
8720
|
+
label: __53("Rotate Y", "elementor"),
|
|
8619
8721
|
bind: "y",
|
|
8620
|
-
startIcon: /* @__PURE__ */
|
|
8722
|
+
startIcon: /* @__PURE__ */ React108.createElement(Arrow360Icon, { fontSize: "tiny", style: { transform: "scaleX(-1) rotate(-90deg)" } })
|
|
8621
8723
|
},
|
|
8622
8724
|
{
|
|
8623
|
-
label:
|
|
8725
|
+
label: __53("Rotate Z", "elementor"),
|
|
8624
8726
|
bind: "z",
|
|
8625
|
-
startIcon: /* @__PURE__ */
|
|
8727
|
+
startIcon: /* @__PURE__ */ React108.createElement(RotateClockwiseIcon, { fontSize: "tiny" })
|
|
8626
8728
|
}
|
|
8627
8729
|
];
|
|
8628
8730
|
var rotateUnits = ["deg", "rad", "grad", "turn"];
|
|
8629
8731
|
var Rotate = () => {
|
|
8630
8732
|
const context = useBoundProp(rotateTransformPropTypeUtil2);
|
|
8631
|
-
const rowRefs = [
|
|
8632
|
-
return /* @__PURE__ */
|
|
8733
|
+
const rowRefs = [useRef28(null), useRef28(null), useRef28(null)];
|
|
8734
|
+
return /* @__PURE__ */ React108.createElement(Grid23, { container: true, spacing: 1.5 }, /* @__PURE__ */ React108.createElement(PropProvider, { ...context }, /* @__PURE__ */ React108.createElement(PropKeyProvider, { bind: TransformFunctionKeys.rotate }, rotateAxisControls.map((control, index) => /* @__PURE__ */ React108.createElement(
|
|
8633
8735
|
AxisRow,
|
|
8634
8736
|
{
|
|
8635
8737
|
key: control.bind,
|
|
@@ -8641,68 +8743,68 @@ var Rotate = () => {
|
|
|
8641
8743
|
};
|
|
8642
8744
|
|
|
8643
8745
|
// src/controls/transform-control/functions/scale.tsx
|
|
8644
|
-
import * as
|
|
8645
|
-
import { useRef as
|
|
8746
|
+
import * as React110 from "react";
|
|
8747
|
+
import { useRef as useRef29 } from "react";
|
|
8646
8748
|
import { scaleTransformPropTypeUtil as scaleTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
8647
8749
|
import { ArrowDownLeftIcon as ArrowDownLeftIcon2, ArrowDownSmallIcon as ArrowDownSmallIcon2, ArrowRightIcon as ArrowRightIcon2 } from "@elementor/icons";
|
|
8648
8750
|
import { Grid as Grid25 } from "@elementor/ui";
|
|
8649
|
-
import { __ as
|
|
8751
|
+
import { __ as __54 } from "@wordpress/i18n";
|
|
8650
8752
|
|
|
8651
8753
|
// src/controls/transform-control/functions/scale-axis-row.tsx
|
|
8652
|
-
import * as
|
|
8754
|
+
import * as React109 from "react";
|
|
8653
8755
|
import { Grid as Grid24 } from "@elementor/ui";
|
|
8654
8756
|
var ScaleAxisRow = ({ label, bind, startIcon, anchorRef }) => {
|
|
8655
|
-
return /* @__PURE__ */
|
|
8757
|
+
return /* @__PURE__ */ React109.createElement(Grid24, { item: true, xs: 12 }, /* @__PURE__ */ React109.createElement(PopoverGridContainer, { ref: anchorRef }, /* @__PURE__ */ React109.createElement(Grid24, { item: true, xs: 6 }, /* @__PURE__ */ React109.createElement(ControlLabel, null, label)), /* @__PURE__ */ React109.createElement(Grid24, { item: true, xs: 6 }, /* @__PURE__ */ React109.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React109.createElement(NumberControl, { step: 0.1, placeholder: "1", startIcon })))));
|
|
8656
8758
|
};
|
|
8657
8759
|
|
|
8658
8760
|
// src/controls/transform-control/functions/scale.tsx
|
|
8659
8761
|
var scaleAxisControls = [
|
|
8660
8762
|
{
|
|
8661
|
-
label:
|
|
8763
|
+
label: __54("Scale X", "elementor"),
|
|
8662
8764
|
bind: "x",
|
|
8663
|
-
startIcon: /* @__PURE__ */
|
|
8765
|
+
startIcon: /* @__PURE__ */ React110.createElement(ArrowRightIcon2, { fontSize: "tiny" })
|
|
8664
8766
|
},
|
|
8665
8767
|
{
|
|
8666
|
-
label:
|
|
8768
|
+
label: __54("Scale Y", "elementor"),
|
|
8667
8769
|
bind: "y",
|
|
8668
|
-
startIcon: /* @__PURE__ */
|
|
8770
|
+
startIcon: /* @__PURE__ */ React110.createElement(ArrowDownSmallIcon2, { fontSize: "tiny" })
|
|
8669
8771
|
},
|
|
8670
8772
|
{
|
|
8671
|
-
label:
|
|
8773
|
+
label: __54("Scale Z", "elementor"),
|
|
8672
8774
|
bind: "z",
|
|
8673
|
-
startIcon: /* @__PURE__ */
|
|
8775
|
+
startIcon: /* @__PURE__ */ React110.createElement(ArrowDownLeftIcon2, { fontSize: "tiny" })
|
|
8674
8776
|
}
|
|
8675
8777
|
];
|
|
8676
8778
|
var Scale = () => {
|
|
8677
8779
|
const context = useBoundProp(scaleTransformPropTypeUtil2);
|
|
8678
|
-
const rowRefs = [
|
|
8679
|
-
return /* @__PURE__ */
|
|
8780
|
+
const rowRefs = [useRef29(null), useRef29(null), useRef29(null)];
|
|
8781
|
+
return /* @__PURE__ */ React110.createElement(Grid25, { container: true, spacing: 1.5 }, /* @__PURE__ */ React110.createElement(PropProvider, { ...context }, /* @__PURE__ */ React110.createElement(PropKeyProvider, { bind: TransformFunctionKeys.scale }, scaleAxisControls.map((control, index) => /* @__PURE__ */ React110.createElement(ScaleAxisRow, { key: control.bind, ...control, anchorRef: rowRefs[index] })))));
|
|
8680
8782
|
};
|
|
8681
8783
|
|
|
8682
8784
|
// src/controls/transform-control/functions/skew.tsx
|
|
8683
|
-
import * as
|
|
8684
|
-
import { useRef as
|
|
8785
|
+
import * as React111 from "react";
|
|
8786
|
+
import { useRef as useRef30 } from "react";
|
|
8685
8787
|
import { skewTransformPropTypeUtil as skewTransformPropTypeUtil2 } from "@elementor/editor-props";
|
|
8686
8788
|
import { ArrowLeftIcon, ArrowRightIcon as ArrowRightIcon3 } from "@elementor/icons";
|
|
8687
8789
|
import { Grid as Grid26 } from "@elementor/ui";
|
|
8688
|
-
import { __ as
|
|
8790
|
+
import { __ as __55 } from "@wordpress/i18n";
|
|
8689
8791
|
var skewAxisControls = [
|
|
8690
8792
|
{
|
|
8691
|
-
label:
|
|
8793
|
+
label: __55("Skew X", "elementor"),
|
|
8692
8794
|
bind: "x",
|
|
8693
|
-
startIcon: /* @__PURE__ */
|
|
8795
|
+
startIcon: /* @__PURE__ */ React111.createElement(ArrowRightIcon3, { fontSize: "tiny" })
|
|
8694
8796
|
},
|
|
8695
8797
|
{
|
|
8696
|
-
label:
|
|
8798
|
+
label: __55("Skew Y", "elementor"),
|
|
8697
8799
|
bind: "y",
|
|
8698
|
-
startIcon: /* @__PURE__ */
|
|
8800
|
+
startIcon: /* @__PURE__ */ React111.createElement(ArrowLeftIcon, { fontSize: "tiny", style: { transform: "scaleX(-1) rotate(-90deg)" } })
|
|
8699
8801
|
}
|
|
8700
8802
|
];
|
|
8701
8803
|
var skewUnits = ["deg", "rad", "grad", "turn"];
|
|
8702
8804
|
var Skew = () => {
|
|
8703
8805
|
const context = useBoundProp(skewTransformPropTypeUtil2);
|
|
8704
|
-
const rowRefs = [
|
|
8705
|
-
return /* @__PURE__ */
|
|
8806
|
+
const rowRefs = [useRef30(null), useRef30(null), useRef30(null)];
|
|
8807
|
+
return /* @__PURE__ */ React111.createElement(Grid26, { container: true, spacing: 1.5 }, /* @__PURE__ */ React111.createElement(PropProvider, { ...context }, /* @__PURE__ */ React111.createElement(PropKeyProvider, { bind: TransformFunctionKeys.skew }, skewAxisControls.map((control, index) => /* @__PURE__ */ React111.createElement(
|
|
8706
8808
|
AxisRow,
|
|
8707
8809
|
{
|
|
8708
8810
|
key: control.bind,
|
|
@@ -8714,7 +8816,7 @@ var Skew = () => {
|
|
|
8714
8816
|
};
|
|
8715
8817
|
|
|
8716
8818
|
// src/controls/transform-control/use-transform-tabs-history.tsx
|
|
8717
|
-
import { useRef as
|
|
8819
|
+
import { useRef as useRef31 } from "react";
|
|
8718
8820
|
import {
|
|
8719
8821
|
moveTransformPropTypeUtil as moveTransformPropTypeUtil2,
|
|
8720
8822
|
rotateTransformPropTypeUtil as rotateTransformPropTypeUtil3,
|
|
@@ -8746,7 +8848,7 @@ var useTransformTabsHistory = ({
|
|
|
8746
8848
|
}
|
|
8747
8849
|
};
|
|
8748
8850
|
const { getTabsProps, getTabProps, getTabPanelProps } = useTabs2(getCurrentTransformType());
|
|
8749
|
-
const valuesHistory =
|
|
8851
|
+
const valuesHistory = useRef31({
|
|
8750
8852
|
move: initialMove,
|
|
8751
8853
|
scale: initialScale,
|
|
8752
8854
|
rotate: initialRotate,
|
|
@@ -8807,7 +8909,7 @@ var TransformContent = () => {
|
|
|
8807
8909
|
rotate: initialRotateValue.value,
|
|
8808
8910
|
skew: initialSkewValue.value
|
|
8809
8911
|
});
|
|
8810
|
-
return /* @__PURE__ */
|
|
8912
|
+
return /* @__PURE__ */ React112.createElement(PopoverContent, null, /* @__PURE__ */ React112.createElement(Box27, { sx: { width: "100%" } }, /* @__PURE__ */ React112.createElement(Box27, { sx: { borderBottom: 1, borderColor: "divider" } }, /* @__PURE__ */ React112.createElement(
|
|
8811
8913
|
Tabs2,
|
|
8812
8914
|
{
|
|
8813
8915
|
size: "small",
|
|
@@ -8818,37 +8920,37 @@ var TransformContent = () => {
|
|
|
8818
8920
|
}
|
|
8819
8921
|
},
|
|
8820
8922
|
...getTabsProps(),
|
|
8821
|
-
"aria-label":
|
|
8923
|
+
"aria-label": __56("Transform", "elementor")
|
|
8822
8924
|
},
|
|
8823
|
-
/* @__PURE__ */
|
|
8824
|
-
/* @__PURE__ */
|
|
8825
|
-
/* @__PURE__ */
|
|
8826
|
-
/* @__PURE__ */
|
|
8827
|
-
)), /* @__PURE__ */
|
|
8925
|
+
/* @__PURE__ */ React112.createElement(Tab2, { label: __56("Move", "elementor"), ...getTabProps(TransformFunctionKeys.move) }),
|
|
8926
|
+
/* @__PURE__ */ React112.createElement(Tab2, { label: __56("Scale", "elementor"), ...getTabProps(TransformFunctionKeys.scale) }),
|
|
8927
|
+
/* @__PURE__ */ React112.createElement(Tab2, { label: __56("Rotate", "elementor"), ...getTabProps(TransformFunctionKeys.rotate) }),
|
|
8928
|
+
/* @__PURE__ */ React112.createElement(Tab2, { label: __56("Skew", "elementor"), ...getTabProps(TransformFunctionKeys.skew) })
|
|
8929
|
+
)), /* @__PURE__ */ React112.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.move) }, /* @__PURE__ */ React112.createElement(Move, null)), /* @__PURE__ */ React112.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.scale) }, /* @__PURE__ */ React112.createElement(Scale, null)), /* @__PURE__ */ React112.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.rotate) }, /* @__PURE__ */ React112.createElement(Rotate, null)), /* @__PURE__ */ React112.createElement(TabPanel2, { sx: { p: 1.5 }, ...getTabPanelProps(TransformFunctionKeys.skew) }, /* @__PURE__ */ React112.createElement(Skew, null))));
|
|
8828
8930
|
};
|
|
8829
8931
|
|
|
8830
8932
|
// src/controls/transform-control/transform-icon.tsx
|
|
8831
|
-
import * as
|
|
8933
|
+
import * as React113 from "react";
|
|
8832
8934
|
import { ArrowAutofitHeightIcon, ArrowsMaximizeIcon as ArrowsMaximizeIcon2, RotateClockwise2Icon, SkewXIcon } from "@elementor/icons";
|
|
8833
8935
|
var TransformIcon = ({ value }) => {
|
|
8834
8936
|
switch (value.$$type) {
|
|
8835
8937
|
case TransformFunctionKeys.move:
|
|
8836
|
-
return /* @__PURE__ */
|
|
8938
|
+
return /* @__PURE__ */ React113.createElement(ArrowsMaximizeIcon2, { fontSize: "tiny" });
|
|
8837
8939
|
case TransformFunctionKeys.scale:
|
|
8838
|
-
return /* @__PURE__ */
|
|
8940
|
+
return /* @__PURE__ */ React113.createElement(ArrowAutofitHeightIcon, { fontSize: "tiny" });
|
|
8839
8941
|
case TransformFunctionKeys.rotate:
|
|
8840
|
-
return /* @__PURE__ */
|
|
8942
|
+
return /* @__PURE__ */ React113.createElement(RotateClockwise2Icon, { fontSize: "tiny" });
|
|
8841
8943
|
case TransformFunctionKeys.skew:
|
|
8842
|
-
return /* @__PURE__ */
|
|
8944
|
+
return /* @__PURE__ */ React113.createElement(SkewXIcon, { fontSize: "tiny" });
|
|
8843
8945
|
default:
|
|
8844
8946
|
return null;
|
|
8845
8947
|
}
|
|
8846
8948
|
};
|
|
8847
8949
|
|
|
8848
8950
|
// src/controls/transform-control/transform-label.tsx
|
|
8849
|
-
import * as
|
|
8951
|
+
import * as React114 from "react";
|
|
8850
8952
|
import { Box as Box28 } from "@elementor/ui";
|
|
8851
|
-
import { __ as
|
|
8953
|
+
import { __ as __57 } from "@wordpress/i18n";
|
|
8852
8954
|
var orderedAxis = ["x", "y", "z"];
|
|
8853
8955
|
var formatLabel = (value, functionType) => {
|
|
8854
8956
|
return orderedAxis.map((axisKey) => {
|
|
@@ -8866,102 +8968,102 @@ var TransformLabel = (props) => {
|
|
|
8866
8968
|
const { $$type, value } = props.value;
|
|
8867
8969
|
switch ($$type) {
|
|
8868
8970
|
case TransformFunctionKeys.move:
|
|
8869
|
-
return /* @__PURE__ */
|
|
8971
|
+
return /* @__PURE__ */ React114.createElement(Label2, { label: __57("Move", "elementor"), value: formatLabel(value, "move") });
|
|
8870
8972
|
case TransformFunctionKeys.scale:
|
|
8871
|
-
return /* @__PURE__ */
|
|
8973
|
+
return /* @__PURE__ */ React114.createElement(Label2, { label: __57("Scale", "elementor"), value: formatLabel(value, "scale") });
|
|
8872
8974
|
case TransformFunctionKeys.rotate:
|
|
8873
|
-
return /* @__PURE__ */
|
|
8975
|
+
return /* @__PURE__ */ React114.createElement(Label2, { label: __57("Rotate", "elementor"), value: formatLabel(value, "rotate") });
|
|
8874
8976
|
case TransformFunctionKeys.skew:
|
|
8875
|
-
return /* @__PURE__ */
|
|
8977
|
+
return /* @__PURE__ */ React114.createElement(Label2, { label: __57("Skew", "elementor"), value: formatLabel(value, "skew") });
|
|
8876
8978
|
default:
|
|
8877
8979
|
return "";
|
|
8878
8980
|
}
|
|
8879
8981
|
};
|
|
8880
8982
|
var Label2 = ({ label, value }) => {
|
|
8881
|
-
return /* @__PURE__ */
|
|
8983
|
+
return /* @__PURE__ */ React114.createElement(Box28, { component: "span" }, label, ": ", value);
|
|
8882
8984
|
};
|
|
8883
8985
|
|
|
8884
8986
|
// src/controls/transform-control/transform-settings-control.tsx
|
|
8885
|
-
import * as
|
|
8987
|
+
import * as React117 from "react";
|
|
8886
8988
|
import { PopoverHeader as PopoverHeader5 } from "@elementor/editor-ui";
|
|
8887
8989
|
import { AdjustmentsIcon } from "@elementor/icons";
|
|
8888
8990
|
import { bindPopover as bindPopover6, Box as Box29, Divider as Divider6, Popover as Popover7 } from "@elementor/ui";
|
|
8889
|
-
import { __ as
|
|
8991
|
+
import { __ as __60 } from "@wordpress/i18n";
|
|
8890
8992
|
|
|
8891
8993
|
// src/controls/transform-control/transform-base-controls/children-perspective-control.tsx
|
|
8892
|
-
import * as
|
|
8893
|
-
import { useRef as
|
|
8994
|
+
import * as React115 from "react";
|
|
8995
|
+
import { useRef as useRef32 } from "react";
|
|
8894
8996
|
import { perspectiveOriginPropTypeUtil } from "@elementor/editor-props";
|
|
8895
8997
|
import { Grid as Grid27, Stack as Stack19 } from "@elementor/ui";
|
|
8896
|
-
import { __ as
|
|
8998
|
+
import { __ as __58 } from "@wordpress/i18n";
|
|
8897
8999
|
var ORIGIN_UNITS = ["px", "%", "em", "rem"];
|
|
8898
9000
|
var PERSPECTIVE_CONTROL_FIELD = {
|
|
8899
|
-
label:
|
|
9001
|
+
label: __58("Perspective", "elementor"),
|
|
8900
9002
|
bind: "perspective",
|
|
8901
9003
|
units: ["px", "em", "rem", "vw", "vh"]
|
|
8902
9004
|
};
|
|
8903
9005
|
var CHILDREN_PERSPECTIVE_FIELDS = [
|
|
8904
9006
|
{
|
|
8905
|
-
label:
|
|
9007
|
+
label: __58("Origin X", "elementor"),
|
|
8906
9008
|
bind: "x",
|
|
8907
9009
|
units: ORIGIN_UNITS
|
|
8908
9010
|
},
|
|
8909
9011
|
{
|
|
8910
|
-
label:
|
|
9012
|
+
label: __58("Origin Y", "elementor"),
|
|
8911
9013
|
bind: "y",
|
|
8912
9014
|
units: ORIGIN_UNITS
|
|
8913
9015
|
}
|
|
8914
9016
|
];
|
|
8915
9017
|
var ChildrenPerspectiveControl = () => {
|
|
8916
|
-
return /* @__PURE__ */
|
|
9018
|
+
return /* @__PURE__ */ React115.createElement(Stack19, { direction: "column", spacing: 1.5 }, /* @__PURE__ */ React115.createElement(ControlFormLabel, null, __58("Children perspective", "elementor")), /* @__PURE__ */ React115.createElement(PerspectiveControl, null), /* @__PURE__ */ React115.createElement(PerspectiveOriginControl, null));
|
|
8917
9019
|
};
|
|
8918
|
-
var PerspectiveControl = () => /* @__PURE__ */
|
|
8919
|
-
var PerspectiveOriginControl = () => /* @__PURE__ */
|
|
9020
|
+
var PerspectiveControl = () => /* @__PURE__ */ React115.createElement(PropKeyProvider, { bind: "perspective" }, /* @__PURE__ */ React115.createElement(ControlFields, { control: PERSPECTIVE_CONTROL_FIELD, key: PERSPECTIVE_CONTROL_FIELD.bind }));
|
|
9021
|
+
var PerspectiveOriginControl = () => /* @__PURE__ */ React115.createElement(PropKeyProvider, { bind: "perspective-origin" }, /* @__PURE__ */ React115.createElement(PerspectiveOriginControlProvider, null));
|
|
8920
9022
|
var PerspectiveOriginControlProvider = () => {
|
|
8921
9023
|
const context = useBoundProp(perspectiveOriginPropTypeUtil);
|
|
8922
|
-
return /* @__PURE__ */
|
|
9024
|
+
return /* @__PURE__ */ React115.createElement(PropProvider, { ...context }, CHILDREN_PERSPECTIVE_FIELDS.map((control) => /* @__PURE__ */ React115.createElement(PropKeyProvider, { bind: control.bind, key: control.bind }, /* @__PURE__ */ React115.createElement(ControlFields, { control }))));
|
|
8923
9025
|
};
|
|
8924
9026
|
var ControlFields = ({ control }) => {
|
|
8925
|
-
const rowRef =
|
|
8926
|
-
return /* @__PURE__ */
|
|
9027
|
+
const rowRef = useRef32(null);
|
|
9028
|
+
return /* @__PURE__ */ React115.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React115.createElement(Grid27, { item: true, xs: 6 }, /* @__PURE__ */ React115.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React115.createElement(Grid27, { item: true, xs: 6 }, /* @__PURE__ */ React115.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef, disableCustom: true })));
|
|
8927
9029
|
};
|
|
8928
9030
|
|
|
8929
9031
|
// src/controls/transform-control/transform-base-controls/transform-origin-control.tsx
|
|
8930
|
-
import * as
|
|
8931
|
-
import { useRef as
|
|
9032
|
+
import * as React116 from "react";
|
|
9033
|
+
import { useRef as useRef33 } from "react";
|
|
8932
9034
|
import { transformOriginPropTypeUtil } from "@elementor/editor-props";
|
|
8933
9035
|
import { Grid as Grid28, Stack as Stack20 } from "@elementor/ui";
|
|
8934
|
-
import { __ as
|
|
9036
|
+
import { __ as __59 } from "@wordpress/i18n";
|
|
8935
9037
|
var TRANSFORM_ORIGIN_UNITS = ["px", "%", "em", "rem"];
|
|
8936
9038
|
var TRANSFORM_ORIGIN_UNITS_Z_AXIS = TRANSFORM_ORIGIN_UNITS.filter((unit) => unit !== "%");
|
|
8937
9039
|
var TRANSFORM_ORIGIN_FIELDS = [
|
|
8938
9040
|
{
|
|
8939
|
-
label:
|
|
9041
|
+
label: __59("Origin X", "elementor"),
|
|
8940
9042
|
bind: "x",
|
|
8941
9043
|
units: TRANSFORM_ORIGIN_UNITS
|
|
8942
9044
|
},
|
|
8943
9045
|
{
|
|
8944
|
-
label:
|
|
9046
|
+
label: __59("Origin Y", "elementor"),
|
|
8945
9047
|
bind: "y",
|
|
8946
9048
|
units: TRANSFORM_ORIGIN_UNITS
|
|
8947
9049
|
},
|
|
8948
9050
|
{
|
|
8949
|
-
label:
|
|
9051
|
+
label: __59("Origin Z", "elementor"),
|
|
8950
9052
|
bind: "z",
|
|
8951
9053
|
units: TRANSFORM_ORIGIN_UNITS_Z_AXIS
|
|
8952
9054
|
}
|
|
8953
9055
|
];
|
|
8954
9056
|
var TransformOriginControl = () => {
|
|
8955
|
-
return /* @__PURE__ */
|
|
9057
|
+
return /* @__PURE__ */ React116.createElement(Stack20, { direction: "column", spacing: 1.5 }, /* @__PURE__ */ React116.createElement(ControlFormLabel, null, __59("Transform", "elementor")), TRANSFORM_ORIGIN_FIELDS.map((control) => /* @__PURE__ */ React116.createElement(ControlFields2, { control, key: control.bind })));
|
|
8956
9058
|
};
|
|
8957
9059
|
var ControlFields2 = ({ control }) => {
|
|
8958
9060
|
const context = useBoundProp(transformOriginPropTypeUtil);
|
|
8959
|
-
const rowRef =
|
|
8960
|
-
return /* @__PURE__ */
|
|
9061
|
+
const rowRef = useRef33(null);
|
|
9062
|
+
return /* @__PURE__ */ React116.createElement(PropProvider, { ...context }, /* @__PURE__ */ React116.createElement(PropKeyProvider, { bind: control.bind }, /* @__PURE__ */ React116.createElement(PopoverGridContainer, { ref: rowRef }, /* @__PURE__ */ React116.createElement(Grid28, { item: true, xs: 6 }, /* @__PURE__ */ React116.createElement(ControlFormLabel, null, control.label)), /* @__PURE__ */ React116.createElement(Grid28, { item: true, xs: 6 }, /* @__PURE__ */ React116.createElement(SizeControl, { variant: "length", units: control.units, anchorRef: rowRef })))));
|
|
8961
9063
|
};
|
|
8962
9064
|
|
|
8963
9065
|
// src/controls/transform-control/transform-settings-control.tsx
|
|
8964
|
-
var
|
|
9066
|
+
var SIZE11 = "tiny";
|
|
8965
9067
|
var TransformSettingsControl = ({
|
|
8966
9068
|
popupState,
|
|
8967
9069
|
anchorRef,
|
|
@@ -8971,7 +9073,7 @@ var TransformSettingsControl = ({
|
|
|
8971
9073
|
...popupState,
|
|
8972
9074
|
anchorEl: anchorRef.current ?? void 0
|
|
8973
9075
|
});
|
|
8974
|
-
return /* @__PURE__ */
|
|
9076
|
+
return /* @__PURE__ */ React117.createElement(
|
|
8975
9077
|
Popover7,
|
|
8976
9078
|
{
|
|
8977
9079
|
disablePortal: true,
|
|
@@ -8986,45 +9088,45 @@ var TransformSettingsControl = ({
|
|
|
8986
9088
|
},
|
|
8987
9089
|
...popupProps
|
|
8988
9090
|
},
|
|
8989
|
-
/* @__PURE__ */
|
|
9091
|
+
/* @__PURE__ */ React117.createElement(
|
|
8990
9092
|
PopoverHeader5,
|
|
8991
9093
|
{
|
|
8992
|
-
title:
|
|
9094
|
+
title: __60("Transform settings", "elementor"),
|
|
8993
9095
|
onClose: popupState.close,
|
|
8994
|
-
icon: /* @__PURE__ */
|
|
9096
|
+
icon: /* @__PURE__ */ React117.createElement(AdjustmentsIcon, { fontSize: SIZE11 })
|
|
8995
9097
|
}
|
|
8996
9098
|
),
|
|
8997
|
-
/* @__PURE__ */
|
|
8998
|
-
/* @__PURE__ */
|
|
9099
|
+
/* @__PURE__ */ React117.createElement(Divider6, null),
|
|
9100
|
+
/* @__PURE__ */ React117.createElement(PopoverContent, { sx: { px: 2, py: 1.5 } }, /* @__PURE__ */ React117.createElement(PropKeyProvider, { bind: "transform-origin" }, /* @__PURE__ */ React117.createElement(TransformOriginControl, null)), showChildrenPerspective && /* @__PURE__ */ React117.createElement(React117.Fragment, null, /* @__PURE__ */ React117.createElement(Box29, { sx: { my: 0.5 } }, /* @__PURE__ */ React117.createElement(Divider6, null)), /* @__PURE__ */ React117.createElement(ChildrenPerspectiveControl, null)))
|
|
8999
9101
|
);
|
|
9000
9102
|
};
|
|
9001
9103
|
|
|
9002
9104
|
// src/controls/transform-control/transform-repeater-control.tsx
|
|
9003
|
-
var
|
|
9105
|
+
var SIZE12 = "tiny";
|
|
9004
9106
|
var TransformRepeaterControl = createControl(
|
|
9005
9107
|
({ showChildrenPerspective }) => {
|
|
9006
9108
|
const context = useBoundProp(transformPropTypeUtil);
|
|
9007
|
-
const headerRef =
|
|
9109
|
+
const headerRef = useRef34(null);
|
|
9008
9110
|
const popupState = usePopupState10({ variant: "popover" });
|
|
9009
|
-
return /* @__PURE__ */
|
|
9111
|
+
return /* @__PURE__ */ React118.createElement(PropProvider, { ...context }, /* @__PURE__ */ React118.createElement(
|
|
9010
9112
|
TransformSettingsControl,
|
|
9011
9113
|
{
|
|
9012
9114
|
popupState,
|
|
9013
9115
|
anchorRef: headerRef,
|
|
9014
9116
|
showChildrenPerspective
|
|
9015
9117
|
}
|
|
9016
|
-
), /* @__PURE__ */
|
|
9118
|
+
), /* @__PURE__ */ React118.createElement(PropKeyProvider, { bind: "transform-functions" }, /* @__PURE__ */ React118.createElement(Repeater2, { headerRef, propType: context.propType, popupState })));
|
|
9017
9119
|
}
|
|
9018
9120
|
);
|
|
9019
|
-
var ToolTip = /* @__PURE__ */
|
|
9121
|
+
var ToolTip = /* @__PURE__ */ React118.createElement(
|
|
9020
9122
|
Box30,
|
|
9021
9123
|
{
|
|
9022
9124
|
component: "span",
|
|
9023
9125
|
"aria-label": void 0,
|
|
9024
9126
|
sx: { display: "flex", gap: 0.5, p: 2, width: 320, borderRadius: 1 }
|
|
9025
9127
|
},
|
|
9026
|
-
/* @__PURE__ */
|
|
9027
|
-
/* @__PURE__ */
|
|
9128
|
+
/* @__PURE__ */ React118.createElement(InfoCircleFilledIcon2, { sx: { color: "secondary.main" } }),
|
|
9129
|
+
/* @__PURE__ */ React118.createElement(Typography12, { variant: "body2", color: "text.secondary", fontSize: "14px" }, __61("You can use each kind of transform only once per element.", "elementor"))
|
|
9028
9130
|
);
|
|
9029
9131
|
var Repeater2 = ({
|
|
9030
9132
|
headerRef,
|
|
@@ -9038,21 +9140,21 @@ var Repeater2 = ({
|
|
|
9038
9140
|
return availableValues.find((value) => !transformValues?.some((item) => item.$$type === value.$$type));
|
|
9039
9141
|
};
|
|
9040
9142
|
const shouldDisableAddItem = !getInitialValue2();
|
|
9041
|
-
return /* @__PURE__ */
|
|
9143
|
+
return /* @__PURE__ */ React118.createElement(PropProvider, { ...transformFunctionsContext }, /* @__PURE__ */ React118.createElement(
|
|
9042
9144
|
ControlRepeater,
|
|
9043
9145
|
{
|
|
9044
9146
|
initial: getInitialValue2() ?? initialTransformValue,
|
|
9045
9147
|
propTypeUtil: transformFunctionsPropTypeUtil
|
|
9046
9148
|
},
|
|
9047
|
-
/* @__PURE__ */
|
|
9149
|
+
/* @__PURE__ */ React118.createElement(
|
|
9048
9150
|
RepeaterHeader,
|
|
9049
9151
|
{
|
|
9050
|
-
label:
|
|
9051
|
-
adornment: () => /* @__PURE__ */
|
|
9152
|
+
label: __61("Transform", "elementor"),
|
|
9153
|
+
adornment: () => /* @__PURE__ */ React118.createElement(ControlAdornments, { customContext: { path: ["transform"], propType } }),
|
|
9052
9154
|
ref: headerRef
|
|
9053
9155
|
},
|
|
9054
|
-
/* @__PURE__ */
|
|
9055
|
-
/* @__PURE__ */
|
|
9156
|
+
/* @__PURE__ */ React118.createElement(TransformBasePopoverTrigger, { popupState, repeaterBindKey: bind }),
|
|
9157
|
+
/* @__PURE__ */ React118.createElement(
|
|
9056
9158
|
TooltipAddItemAction,
|
|
9057
9159
|
{
|
|
9058
9160
|
disabled: shouldDisableAddItem,
|
|
@@ -9062,15 +9164,15 @@ var Repeater2 = ({
|
|
|
9062
9164
|
}
|
|
9063
9165
|
)
|
|
9064
9166
|
),
|
|
9065
|
-
/* @__PURE__ */
|
|
9167
|
+
/* @__PURE__ */ React118.createElement(ItemsContainer, null, /* @__PURE__ */ React118.createElement(
|
|
9066
9168
|
Item,
|
|
9067
9169
|
{
|
|
9068
9170
|
Icon: TransformIcon,
|
|
9069
9171
|
Label: TransformLabel,
|
|
9070
|
-
actions: /* @__PURE__ */
|
|
9172
|
+
actions: /* @__PURE__ */ React118.createElement(React118.Fragment, null, /* @__PURE__ */ React118.createElement(DisableItemAction, null), /* @__PURE__ */ React118.createElement(RemoveItemAction, null))
|
|
9071
9173
|
}
|
|
9072
9174
|
)),
|
|
9073
|
-
/* @__PURE__ */
|
|
9175
|
+
/* @__PURE__ */ React118.createElement(EditItemPopover, null, /* @__PURE__ */ React118.createElement(TransformContent, null))
|
|
9074
9176
|
));
|
|
9075
9177
|
};
|
|
9076
9178
|
var TransformBasePopoverTrigger = ({
|
|
@@ -9078,13 +9180,13 @@ var TransformBasePopoverTrigger = ({
|
|
|
9078
9180
|
repeaterBindKey
|
|
9079
9181
|
}) => {
|
|
9080
9182
|
const { bind } = useBoundProp();
|
|
9081
|
-
const titleLabel =
|
|
9082
|
-
return bind !== repeaterBindKey ? null : /* @__PURE__ */
|
|
9183
|
+
const titleLabel = __61("Transform settings", "elementor");
|
|
9184
|
+
return bind !== repeaterBindKey ? null : /* @__PURE__ */ React118.createElement(Tooltip12, { title: titleLabel, placement: "top" }, /* @__PURE__ */ React118.createElement(IconButton10, { size: SIZE12, "aria-label": titleLabel, ...bindTrigger5(popupState) }, /* @__PURE__ */ React118.createElement(AdjustmentsIcon2, { fontSize: SIZE12 })));
|
|
9083
9185
|
};
|
|
9084
9186
|
|
|
9085
9187
|
// src/controls/transition-control/transition-repeater-control.tsx
|
|
9086
|
-
import * as
|
|
9087
|
-
import { useEffect as useEffect19, useMemo as
|
|
9188
|
+
import * as React121 from "react";
|
|
9189
|
+
import { useEffect as useEffect19, useMemo as useMemo19, useState as useState26 } from "react";
|
|
9088
9190
|
import {
|
|
9089
9191
|
createArrayPropUtils as createArrayPropUtils3,
|
|
9090
9192
|
selectionSizePropTypeUtil as selectionSizePropTypeUtil2
|
|
@@ -9092,19 +9194,19 @@ import {
|
|
|
9092
9194
|
import { InfoCircleFilledIcon as InfoCircleFilledIcon3 } from "@elementor/icons";
|
|
9093
9195
|
import { Alert as Alert3, AlertTitle as AlertTitle4, Box as Box32, Typography as Typography13 } from "@elementor/ui";
|
|
9094
9196
|
import { hasProInstalled as hasProInstalled2 } from "@elementor/utils";
|
|
9095
|
-
import { __ as
|
|
9197
|
+
import { __ as __64 } from "@wordpress/i18n";
|
|
9096
9198
|
|
|
9097
9199
|
// src/controls/selection-size-control.tsx
|
|
9098
|
-
import * as
|
|
9099
|
-
import { useMemo as
|
|
9200
|
+
import * as React119 from "react";
|
|
9201
|
+
import { useMemo as useMemo17, useRef as useRef35 } from "react";
|
|
9100
9202
|
import { selectionSizePropTypeUtil } from "@elementor/editor-props";
|
|
9101
9203
|
import { Grid as Grid29 } from "@elementor/ui";
|
|
9102
9204
|
var SelectionSizeControl = createControl(
|
|
9103
9205
|
({ selectionLabel, sizeLabel, selectionConfig, sizeConfigMap }) => {
|
|
9104
9206
|
const { value, setValue, propType } = useBoundProp(selectionSizePropTypeUtil);
|
|
9105
|
-
const rowRef =
|
|
9207
|
+
const rowRef = useRef35(null);
|
|
9106
9208
|
const sizeFieldId = sizeLabel.replace(/\s+/g, "-").toLowerCase();
|
|
9107
|
-
const currentSizeConfig =
|
|
9209
|
+
const currentSizeConfig = useMemo17(() => {
|
|
9108
9210
|
switch (value.selection.$$type) {
|
|
9109
9211
|
case "key-value":
|
|
9110
9212
|
return sizeConfigMap[value?.selection?.value.value.value || ""];
|
|
@@ -9115,7 +9217,7 @@ var SelectionSizeControl = createControl(
|
|
|
9115
9217
|
}
|
|
9116
9218
|
}, [value, sizeConfigMap]);
|
|
9117
9219
|
const SelectionComponent = selectionConfig.component;
|
|
9118
|
-
return /* @__PURE__ */
|
|
9220
|
+
return /* @__PURE__ */ React119.createElement(PropProvider, { value, setValue, propType }, /* @__PURE__ */ React119.createElement(Grid29, { container: true, spacing: 1.5, ref: rowRef }, /* @__PURE__ */ React119.createElement(Grid29, { item: true, xs: 6, sx: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React119.createElement(ControlFormLabel, null, selectionLabel)), /* @__PURE__ */ React119.createElement(Grid29, { item: true, xs: 6 }, /* @__PURE__ */ React119.createElement(PropKeyProvider, { bind: "selection" }, /* @__PURE__ */ React119.createElement(SelectionComponent, { ...selectionConfig.props }))), currentSizeConfig && /* @__PURE__ */ React119.createElement(React119.Fragment, null, /* @__PURE__ */ React119.createElement(Grid29, { item: true, xs: 6, sx: { display: "flex", alignItems: "center" } }, /* @__PURE__ */ React119.createElement(ControlFormLabel, { htmlFor: sizeFieldId }, sizeLabel)), /* @__PURE__ */ React119.createElement(Grid29, { item: true, xs: 6 }, /* @__PURE__ */ React119.createElement(PropKeyProvider, { bind: "size" }, /* @__PURE__ */ React119.createElement(
|
|
9119
9221
|
SizeControl,
|
|
9120
9222
|
{
|
|
9121
9223
|
anchorRef: rowRef,
|
|
@@ -9130,12 +9232,12 @@ var SelectionSizeControl = createControl(
|
|
|
9130
9232
|
|
|
9131
9233
|
// src/controls/transition-control/data.ts
|
|
9132
9234
|
import { hasProInstalled, isVersionGreaterOrEqual } from "@elementor/utils";
|
|
9133
|
-
import { __ as
|
|
9235
|
+
import { __ as __62 } from "@wordpress/i18n";
|
|
9134
9236
|
var initialTransitionValue = {
|
|
9135
9237
|
selection: {
|
|
9136
9238
|
$$type: "key-value",
|
|
9137
9239
|
value: {
|
|
9138
|
-
key: { value:
|
|
9240
|
+
key: { value: __62("All properties", "elementor"), $$type: "string" },
|
|
9139
9241
|
value: { value: "all", $$type: "string" }
|
|
9140
9242
|
}
|
|
9141
9243
|
},
|
|
@@ -9159,128 +9261,128 @@ var createTransitionPropertiesList = () => {
|
|
|
9159
9261
|
const isSiteRtl = getIsSiteRtl();
|
|
9160
9262
|
const baseProperties = [
|
|
9161
9263
|
{
|
|
9162
|
-
label:
|
|
9264
|
+
label: __62("Default", "elementor"),
|
|
9163
9265
|
type: "category",
|
|
9164
|
-
properties: [{ label:
|
|
9266
|
+
properties: [{ label: __62("All properties", "elementor"), value: "all" }]
|
|
9165
9267
|
},
|
|
9166
9268
|
{
|
|
9167
|
-
label:
|
|
9269
|
+
label: __62("Margin", "elementor"),
|
|
9168
9270
|
type: "category",
|
|
9169
9271
|
properties: [
|
|
9170
|
-
{ label:
|
|
9171
|
-
{ label:
|
|
9272
|
+
{ label: __62("Margin (all)", "elementor"), value: "margin", isDisabled: true },
|
|
9273
|
+
{ label: __62("Margin bottom", "elementor"), value: "margin-block-end", isDisabled: true },
|
|
9172
9274
|
{
|
|
9173
|
-
label: isSiteRtl ?
|
|
9275
|
+
label: isSiteRtl ? __62("Margin right", "elementor") : __62("Margin left", "elementor"),
|
|
9174
9276
|
value: "margin-inline-start",
|
|
9175
9277
|
isDisabled: true
|
|
9176
9278
|
},
|
|
9177
9279
|
{
|
|
9178
|
-
label: isSiteRtl ?
|
|
9280
|
+
label: isSiteRtl ? __62("Margin left", "elementor") : __62("Margin right", "elementor"),
|
|
9179
9281
|
value: "margin-inline-end",
|
|
9180
9282
|
isDisabled: true
|
|
9181
9283
|
},
|
|
9182
|
-
{ label:
|
|
9284
|
+
{ label: __62("Margin top", "elementor"), value: "margin-block-start", isDisabled: true }
|
|
9183
9285
|
]
|
|
9184
9286
|
},
|
|
9185
9287
|
{
|
|
9186
|
-
label:
|
|
9288
|
+
label: __62("Padding", "elementor"),
|
|
9187
9289
|
type: "category",
|
|
9188
9290
|
properties: [
|
|
9189
|
-
{ label:
|
|
9190
|
-
{ label:
|
|
9291
|
+
{ label: __62("Padding (all)", "elementor"), value: "padding", isDisabled: true },
|
|
9292
|
+
{ label: __62("Padding bottom", "elementor"), value: "padding-block-end", isDisabled: true },
|
|
9191
9293
|
{
|
|
9192
|
-
label: isSiteRtl ?
|
|
9294
|
+
label: isSiteRtl ? __62("Padding right", "elementor") : __62("Padding left", "elementor"),
|
|
9193
9295
|
value: "padding-inline-start",
|
|
9194
9296
|
isDisabled: true
|
|
9195
9297
|
},
|
|
9196
9298
|
{
|
|
9197
|
-
label: isSiteRtl ?
|
|
9299
|
+
label: isSiteRtl ? __62("Padding left", "elementor") : __62("Padding right", "elementor"),
|
|
9198
9300
|
value: "padding-inline-end",
|
|
9199
9301
|
isDisabled: true
|
|
9200
9302
|
},
|
|
9201
|
-
{ label:
|
|
9303
|
+
{ label: __62("Padding top", "elementor"), value: "padding-block-start", isDisabled: true }
|
|
9202
9304
|
]
|
|
9203
9305
|
},
|
|
9204
9306
|
{
|
|
9205
|
-
label:
|
|
9307
|
+
label: __62("Flex", "elementor"),
|
|
9206
9308
|
type: "category",
|
|
9207
9309
|
properties: [
|
|
9208
|
-
{ label:
|
|
9209
|
-
{ label:
|
|
9210
|
-
{ label:
|
|
9211
|
-
{ label:
|
|
9310
|
+
{ label: __62("Flex (all)", "elementor"), value: "flex", isDisabled: true },
|
|
9311
|
+
{ label: __62("Flex grow", "elementor"), value: "flex-grow", isDisabled: true },
|
|
9312
|
+
{ label: __62("Flex shrink", "elementor"), value: "flex-shrink", isDisabled: true },
|
|
9313
|
+
{ label: __62("Flex basis", "elementor"), value: "flex-basis", isDisabled: true }
|
|
9212
9314
|
]
|
|
9213
9315
|
},
|
|
9214
9316
|
{
|
|
9215
|
-
label:
|
|
9317
|
+
label: __62("Size", "elementor"),
|
|
9216
9318
|
type: "category",
|
|
9217
9319
|
properties: [
|
|
9218
|
-
{ label:
|
|
9219
|
-
{ label:
|
|
9220
|
-
{ label:
|
|
9221
|
-
{ label:
|
|
9222
|
-
{ label:
|
|
9223
|
-
{ label:
|
|
9320
|
+
{ label: __62("Width", "elementor"), value: "width", isDisabled: true },
|
|
9321
|
+
{ label: __62("Height", "elementor"), value: "height", isDisabled: true },
|
|
9322
|
+
{ label: __62("Max height", "elementor"), value: "max-height", isDisabled: true },
|
|
9323
|
+
{ label: __62("Max width", "elementor"), value: "max-width", isDisabled: true },
|
|
9324
|
+
{ label: __62("Min height", "elementor"), value: "min-height", isDisabled: true },
|
|
9325
|
+
{ label: __62("Min width", "elementor"), value: "min-width", isDisabled: true }
|
|
9224
9326
|
]
|
|
9225
9327
|
},
|
|
9226
9328
|
{
|
|
9227
|
-
label:
|
|
9329
|
+
label: __62("Position", "elementor"),
|
|
9228
9330
|
type: "category",
|
|
9229
9331
|
properties: [
|
|
9230
|
-
{ label:
|
|
9332
|
+
{ label: __62("Top", "elementor"), value: "inset-block-start", isDisabled: true },
|
|
9231
9333
|
{
|
|
9232
|
-
label: isSiteRtl ?
|
|
9334
|
+
label: isSiteRtl ? __62("Right", "elementor") : __62("Left", "elementor"),
|
|
9233
9335
|
value: "inset-inline-start",
|
|
9234
9336
|
isDisabled: true
|
|
9235
9337
|
},
|
|
9236
9338
|
{
|
|
9237
|
-
label: isSiteRtl ?
|
|
9339
|
+
label: isSiteRtl ? __62("Left", "elementor") : __62("Right", "elementor"),
|
|
9238
9340
|
value: "inset-inline-end",
|
|
9239
9341
|
isDisabled: true
|
|
9240
9342
|
},
|
|
9241
|
-
{ label:
|
|
9242
|
-
{ label:
|
|
9343
|
+
{ label: __62("Bottom", "elementor"), value: "inset-block-end", isDisabled: true },
|
|
9344
|
+
{ label: __62("Z-index", "elementor"), value: "z-index", isDisabled: true }
|
|
9243
9345
|
]
|
|
9244
9346
|
},
|
|
9245
9347
|
{
|
|
9246
|
-
label:
|
|
9348
|
+
label: __62("Typography", "elementor"),
|
|
9247
9349
|
type: "category",
|
|
9248
9350
|
properties: [
|
|
9249
|
-
{ label:
|
|
9250
|
-
{ label:
|
|
9251
|
-
{ label:
|
|
9252
|
-
{ label:
|
|
9253
|
-
{ label:
|
|
9254
|
-
{ label:
|
|
9255
|
-
{ label:
|
|
9351
|
+
{ label: __62("Font color", "elementor"), value: "color", isDisabled: true },
|
|
9352
|
+
{ label: __62("Font size", "elementor"), value: "font-size", isDisabled: true },
|
|
9353
|
+
{ label: __62("Line height", "elementor"), value: "line-height", isDisabled: true },
|
|
9354
|
+
{ label: __62("Letter spacing", "elementor"), value: "letter-spacing", isDisabled: true },
|
|
9355
|
+
{ label: __62("Word spacing", "elementor"), value: "word-spacing", isDisabled: true },
|
|
9356
|
+
{ label: __62("Font variations", "elementor"), value: "font-variation-settings", isDisabled: true },
|
|
9357
|
+
{ label: __62("Text stroke color", "elementor"), value: "-webkit-text-stroke-color", isDisabled: true }
|
|
9256
9358
|
]
|
|
9257
9359
|
},
|
|
9258
9360
|
{
|
|
9259
|
-
label:
|
|
9361
|
+
label: __62("Background", "elementor"),
|
|
9260
9362
|
type: "category",
|
|
9261
9363
|
properties: [
|
|
9262
|
-
{ label:
|
|
9263
|
-
{ label:
|
|
9264
|
-
{ label:
|
|
9364
|
+
{ label: __62("Background color", "elementor"), value: "background-color", isDisabled: true },
|
|
9365
|
+
{ label: __62("Background position", "elementor"), value: "background-position", isDisabled: true },
|
|
9366
|
+
{ label: __62("Box shadow", "elementor"), value: "box-shadow", isDisabled: true }
|
|
9265
9367
|
]
|
|
9266
9368
|
},
|
|
9267
9369
|
{
|
|
9268
|
-
label:
|
|
9370
|
+
label: __62("Border", "elementor"),
|
|
9269
9371
|
type: "category",
|
|
9270
9372
|
properties: [
|
|
9271
|
-
{ label:
|
|
9272
|
-
{ label:
|
|
9273
|
-
{ label:
|
|
9274
|
-
{ label:
|
|
9373
|
+
{ label: __62("Border (all)", "elementor"), value: "border", isDisabled: true },
|
|
9374
|
+
{ label: __62("Border radius", "elementor"), value: "border-radius", isDisabled: true },
|
|
9375
|
+
{ label: __62("Border color", "elementor"), value: "border-color", isDisabled: true },
|
|
9376
|
+
{ label: __62("Border width", "elementor"), value: "border-width", isDisabled: true }
|
|
9275
9377
|
]
|
|
9276
9378
|
},
|
|
9277
9379
|
{
|
|
9278
|
-
label:
|
|
9380
|
+
label: __62("Effects", "elementor"),
|
|
9279
9381
|
type: "category",
|
|
9280
9382
|
properties: [
|
|
9281
|
-
{ label:
|
|
9282
|
-
{ label:
|
|
9283
|
-
{ label:
|
|
9383
|
+
{ label: __62("Opacity", "elementor"), value: "opacity", isDisabled: true },
|
|
9384
|
+
{ label: __62("Transform (all)", "elementor"), value: "transform", isDisabled: true },
|
|
9385
|
+
{ label: __62("Filter (all)", "elementor"), value: "filter", isDisabled: true }
|
|
9284
9386
|
]
|
|
9285
9387
|
}
|
|
9286
9388
|
];
|
|
@@ -9316,13 +9418,13 @@ function subscribeToTransitionEvent() {
|
|
|
9316
9418
|
}
|
|
9317
9419
|
|
|
9318
9420
|
// src/controls/transition-control/transition-selector.tsx
|
|
9319
|
-
import * as
|
|
9320
|
-
import { useMemo as
|
|
9421
|
+
import * as React120 from "react";
|
|
9422
|
+
import { useMemo as useMemo18, useRef as useRef36 } from "react";
|
|
9321
9423
|
import { keyValuePropTypeUtil as keyValuePropTypeUtil2 } from "@elementor/editor-props";
|
|
9322
9424
|
import { PromotionAlert, PromotionChip } from "@elementor/editor-ui";
|
|
9323
9425
|
import { ChevronDownIcon as ChevronDownIcon3, VariationsIcon } from "@elementor/icons";
|
|
9324
9426
|
import { bindPopover as bindPopover7, bindTrigger as bindTrigger6, Box as Box31, Popover as Popover8, UnstableTag as UnstableTag3, usePopupState as usePopupState11 } from "@elementor/ui";
|
|
9325
|
-
import { __ as
|
|
9427
|
+
import { __ as __63 } from "@wordpress/i18n";
|
|
9326
9428
|
var toTransitionSelectorValue = (label) => {
|
|
9327
9429
|
for (const category of transitionProperties) {
|
|
9328
9430
|
const property = category.properties.find((prop) => prop.label === label);
|
|
@@ -9363,9 +9465,9 @@ var TransitionSelector = ({
|
|
|
9363
9465
|
const {
|
|
9364
9466
|
key: { value: transitionLabel }
|
|
9365
9467
|
} = value;
|
|
9366
|
-
const defaultRef =
|
|
9468
|
+
const defaultRef = useRef36(null);
|
|
9367
9469
|
const popoverState = usePopupState11({ variant: "popover" });
|
|
9368
|
-
const disabledCategories =
|
|
9470
|
+
const disabledCategories = useMemo18(() => {
|
|
9369
9471
|
return new Set(
|
|
9370
9472
|
transitionProperties.filter((cat) => cat.properties.some((prop) => prop.isDisabled)).map((cat) => cat.label)
|
|
9371
9473
|
);
|
|
@@ -9385,7 +9487,7 @@ var TransitionSelector = ({
|
|
|
9385
9487
|
return [
|
|
9386
9488
|
first,
|
|
9387
9489
|
{
|
|
9388
|
-
label:
|
|
9490
|
+
label: __63("Recently Used", "elementor"),
|
|
9389
9491
|
items: recentItems
|
|
9390
9492
|
},
|
|
9391
9493
|
...rest
|
|
@@ -9409,16 +9511,16 @@ var TransitionSelector = ({
|
|
|
9409
9511
|
left: rect.right + 36
|
|
9410
9512
|
};
|
|
9411
9513
|
};
|
|
9412
|
-
return /* @__PURE__ */
|
|
9514
|
+
return /* @__PURE__ */ React120.createElement(Box31, { ref: defaultRef }, /* @__PURE__ */ React120.createElement(ControlActions, null, /* @__PURE__ */ React120.createElement(
|
|
9413
9515
|
UnstableTag3,
|
|
9414
9516
|
{
|
|
9415
9517
|
variant: "outlined",
|
|
9416
9518
|
label: transitionLabel,
|
|
9417
|
-
endIcon: /* @__PURE__ */
|
|
9519
|
+
endIcon: /* @__PURE__ */ React120.createElement(ChevronDownIcon3, { fontSize: "tiny" }),
|
|
9418
9520
|
...bindTrigger6(popoverState),
|
|
9419
9521
|
fullWidth: true
|
|
9420
9522
|
}
|
|
9421
|
-
)), /* @__PURE__ */
|
|
9523
|
+
)), /* @__PURE__ */ React120.createElement(
|
|
9422
9524
|
Popover8,
|
|
9423
9525
|
{
|
|
9424
9526
|
disablePortal: true,
|
|
@@ -9429,7 +9531,7 @@ var TransitionSelector = ({
|
|
|
9429
9531
|
anchorOrigin: { vertical: "top", horizontal: "right" },
|
|
9430
9532
|
transformOrigin: { vertical: "top", horizontal: "left" }
|
|
9431
9533
|
},
|
|
9432
|
-
/* @__PURE__ */
|
|
9534
|
+
/* @__PURE__ */ React120.createElement(
|
|
9433
9535
|
ItemSelector,
|
|
9434
9536
|
{
|
|
9435
9537
|
itemsList: getItemList(),
|
|
@@ -9437,10 +9539,10 @@ var TransitionSelector = ({
|
|
|
9437
9539
|
onItemChange: handleTransitionPropertyChange,
|
|
9438
9540
|
onClose: popoverState.close,
|
|
9439
9541
|
sectionWidth: 268,
|
|
9440
|
-
title:
|
|
9542
|
+
title: __63("Transition Property", "elementor"),
|
|
9441
9543
|
icon: VariationsIcon,
|
|
9442
9544
|
disabledItems: includeCurrentValueInOptions(value, disabledItems),
|
|
9443
|
-
categoryItemContentTemplate: (item) => /* @__PURE__ */
|
|
9545
|
+
categoryItemContentTemplate: (item) => /* @__PURE__ */ React120.createElement(
|
|
9444
9546
|
Box31,
|
|
9445
9547
|
{
|
|
9446
9548
|
sx: {
|
|
@@ -9450,13 +9552,13 @@ var TransitionSelector = ({
|
|
|
9450
9552
|
width: "100%"
|
|
9451
9553
|
}
|
|
9452
9554
|
},
|
|
9453
|
-
/* @__PURE__ */
|
|
9454
|
-
showPromotion && disabledCategories.has(item.value) && /* @__PURE__ */
|
|
9555
|
+
/* @__PURE__ */ React120.createElement("span", null, item.value),
|
|
9556
|
+
showPromotion && disabledCategories.has(item.value) && /* @__PURE__ */ React120.createElement(PromotionChip, null)
|
|
9455
9557
|
),
|
|
9456
|
-
footer: showPromotion ? /* @__PURE__ */
|
|
9558
|
+
footer: showPromotion ? /* @__PURE__ */ React120.createElement(
|
|
9457
9559
|
PromotionAlert,
|
|
9458
9560
|
{
|
|
9459
|
-
message:
|
|
9561
|
+
message: __63(
|
|
9460
9562
|
"Upgrade to customize transition properties and control effects.",
|
|
9461
9563
|
"elementor"
|
|
9462
9564
|
),
|
|
@@ -9495,8 +9597,8 @@ var areAllPropertiesUsed = (value = []) => {
|
|
|
9495
9597
|
};
|
|
9496
9598
|
var getSelectionSizeProps = (recentlyUsedList, disabledItems, showPromotion) => {
|
|
9497
9599
|
return {
|
|
9498
|
-
selectionLabel:
|
|
9499
|
-
sizeLabel:
|
|
9600
|
+
selectionLabel: __64("Type", "elementor"),
|
|
9601
|
+
sizeLabel: __64("Duration", "elementor"),
|
|
9500
9602
|
selectionConfig: {
|
|
9501
9603
|
component: TransitionSelector,
|
|
9502
9604
|
props: {
|
|
@@ -9572,7 +9674,7 @@ var getInitialValue = (values = []) => {
|
|
|
9572
9674
|
}
|
|
9573
9675
|
return initialTransitionValue;
|
|
9574
9676
|
};
|
|
9575
|
-
var disableAddItemTooltipContent = /* @__PURE__ */
|
|
9677
|
+
var disableAddItemTooltipContent = /* @__PURE__ */ React121.createElement(
|
|
9576
9678
|
Alert3,
|
|
9577
9679
|
{
|
|
9578
9680
|
sx: {
|
|
@@ -9580,10 +9682,10 @@ var disableAddItemTooltipContent = /* @__PURE__ */ React120.createElement(
|
|
|
9580
9682
|
gap: 0.5
|
|
9581
9683
|
},
|
|
9582
9684
|
color: "secondary",
|
|
9583
|
-
icon: /* @__PURE__ */
|
|
9685
|
+
icon: /* @__PURE__ */ React121.createElement(InfoCircleFilledIcon3, null)
|
|
9584
9686
|
},
|
|
9585
|
-
/* @__PURE__ */
|
|
9586
|
-
/* @__PURE__ */
|
|
9687
|
+
/* @__PURE__ */ React121.createElement(AlertTitle4, null, __64("Transitions", "elementor")),
|
|
9688
|
+
/* @__PURE__ */ React121.createElement(Box32, { component: "span" }, /* @__PURE__ */ React121.createElement(Typography13, { variant: "body2" }, __64("Switch to 'Normal' state to add a transition.", "elementor")))
|
|
9587
9689
|
);
|
|
9588
9690
|
var TransitionRepeaterControl = createControl(
|
|
9589
9691
|
({
|
|
@@ -9594,11 +9696,11 @@ var TransitionRepeaterControl = createControl(
|
|
|
9594
9696
|
const [recentlyUsedList, setRecentlyUsedList] = useState26([]);
|
|
9595
9697
|
const proInstalled = hasProInstalled2();
|
|
9596
9698
|
const { value, setValue } = useBoundProp(childArrayPropTypeUtil);
|
|
9597
|
-
const { allDisabled: disabledItems, proDisabled: proDisabledItems } =
|
|
9699
|
+
const { allDisabled: disabledItems, proDisabled: proDisabledItems } = useMemo19(
|
|
9598
9700
|
() => getDisabledItemLabels(value),
|
|
9599
9701
|
[value]
|
|
9600
9702
|
);
|
|
9601
|
-
const allowedTransitionSet =
|
|
9703
|
+
const allowedTransitionSet = useMemo19(() => {
|
|
9602
9704
|
const set = /* @__PURE__ */ new Set();
|
|
9603
9705
|
transitionProperties.forEach((category) => {
|
|
9604
9706
|
category.properties.forEach((prop) => {
|
|
@@ -9624,15 +9726,15 @@ var TransitionRepeaterControl = createControl(
|
|
|
9624
9726
|
useEffect19(() => {
|
|
9625
9727
|
recentlyUsedListGetter().then(setRecentlyUsedList);
|
|
9626
9728
|
}, [recentlyUsedListGetter]);
|
|
9627
|
-
const allPropertiesUsed =
|
|
9729
|
+
const allPropertiesUsed = useMemo19(() => areAllPropertiesUsed(value), [value]);
|
|
9628
9730
|
const isAddItemDisabled = !currentStyleIsNormal || allPropertiesUsed;
|
|
9629
|
-
return /* @__PURE__ */
|
|
9731
|
+
return /* @__PURE__ */ React121.createElement(
|
|
9630
9732
|
RepeatableControl,
|
|
9631
9733
|
{
|
|
9632
|
-
label:
|
|
9633
|
-
repeaterLabel:
|
|
9734
|
+
label: __64("Transitions", "elementor"),
|
|
9735
|
+
repeaterLabel: __64("Transitions", "elementor"),
|
|
9634
9736
|
patternLabel: "${value.selection.value.key.value}: ${value.size.value.size}${value.size.value.unit}",
|
|
9635
|
-
placeholder:
|
|
9737
|
+
placeholder: __64("Empty Transition", "elementor"),
|
|
9636
9738
|
showDuplicate: false,
|
|
9637
9739
|
showToggle: true,
|
|
9638
9740
|
initialValues: getInitialValue(value),
|
|
@@ -9653,9 +9755,9 @@ var TransitionRepeaterControl = createControl(
|
|
|
9653
9755
|
);
|
|
9654
9756
|
|
|
9655
9757
|
// src/controls/date-time-control.tsx
|
|
9656
|
-
import * as
|
|
9758
|
+
import * as React122 from "react";
|
|
9657
9759
|
import * as dayjs from "dayjs";
|
|
9658
|
-
import { isTransformable as isTransformable2, stringPropTypeUtil as
|
|
9760
|
+
import { isTransformable as isTransformable2, stringPropTypeUtil as stringPropTypeUtil21 } from "@elementor/editor-props";
|
|
9659
9761
|
import { DateTimePropTypeUtil } from "@elementor/editor-props";
|
|
9660
9762
|
import { Box as Box33, DatePicker, LocalizationProvider, TimePicker } from "@elementor/ui";
|
|
9661
9763
|
var DATE_FORMAT = "YYYY-MM-DD";
|
|
@@ -9701,10 +9803,10 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
9701
9803
|
const base = dayjs.default();
|
|
9702
9804
|
return base.hour(h).minute(m).second(0).millisecond(0);
|
|
9703
9805
|
};
|
|
9704
|
-
return /* @__PURE__ */
|
|
9806
|
+
return /* @__PURE__ */ React122.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React122.createElement(ControlActions, null, /* @__PURE__ */ React122.createElement(LocalizationProvider, null, /* @__PURE__ */ React122.createElement(Box33, { display: "flex", gap: 1, alignItems: "center" }, /* @__PURE__ */ React122.createElement(PropKeyProvider, { bind: "date" }, /* @__PURE__ */ React122.createElement(
|
|
9705
9807
|
DatePicker,
|
|
9706
9808
|
{
|
|
9707
|
-
value: parseDateValue(
|
|
9809
|
+
value: parseDateValue(stringPropTypeUtil21.extract(value?.date)),
|
|
9708
9810
|
onChange: (v) => handleChange({ date: v }, { bind: "date" }),
|
|
9709
9811
|
disabled: inputDisabled,
|
|
9710
9812
|
slotProps: {
|
|
@@ -9713,10 +9815,10 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
9713
9815
|
openPickerIcon: { fontSize: "tiny" }
|
|
9714
9816
|
}
|
|
9715
9817
|
}
|
|
9716
|
-
)), /* @__PURE__ */
|
|
9818
|
+
)), /* @__PURE__ */ React122.createElement(PropKeyProvider, { bind: "time" }, /* @__PURE__ */ React122.createElement(
|
|
9717
9819
|
TimePicker,
|
|
9718
9820
|
{
|
|
9719
|
-
value: parseTimeValue(
|
|
9821
|
+
value: parseTimeValue(stringPropTypeUtil21.extract(value?.time)),
|
|
9720
9822
|
onChange: (v) => handleChange({ time: v }, { bind: "time" }),
|
|
9721
9823
|
disabled: inputDisabled,
|
|
9722
9824
|
slotProps: {
|
|
@@ -9729,13 +9831,13 @@ var DateTimeControl = createControl(({ inputDisabled }) => {
|
|
|
9729
9831
|
});
|
|
9730
9832
|
|
|
9731
9833
|
// src/controls/date-range-control.tsx
|
|
9732
|
-
import * as
|
|
9834
|
+
import * as React124 from "react";
|
|
9733
9835
|
import { dateRangePropTypeUtil, dateStringPropTypeUtil as dateStringPropTypeUtil2 } from "@elementor/editor-props";
|
|
9734
9836
|
import { FormHelperText as FormHelperText2, Grid as Grid30, Stack as Stack21 } from "@elementor/ui";
|
|
9735
|
-
import { __ as
|
|
9837
|
+
import { __ as __65 } from "@wordpress/i18n";
|
|
9736
9838
|
|
|
9737
9839
|
// src/controls/date-string-control.tsx
|
|
9738
|
-
import * as
|
|
9840
|
+
import * as React123 from "react";
|
|
9739
9841
|
import { dateStringPropTypeUtil } from "@elementor/editor-props";
|
|
9740
9842
|
import { DatePicker as DatePicker2, LocalizationProvider as LocalizationProvider2 } from "@elementor/ui";
|
|
9741
9843
|
|
|
@@ -9794,7 +9896,7 @@ var DateStringControl = createControl(
|
|
|
9794
9896
|
}
|
|
9795
9897
|
setValue(newValue.format(format));
|
|
9796
9898
|
};
|
|
9797
|
-
return /* @__PURE__ */
|
|
9899
|
+
return /* @__PURE__ */ React123.createElement(LocalizationProvider2, null, /* @__PURE__ */ React123.createElement(ControlActions, null, /* @__PURE__ */ React123.createElement(
|
|
9798
9900
|
DatePicker2,
|
|
9799
9901
|
{
|
|
9800
9902
|
value: parseDateString(value ?? ""),
|
|
@@ -9808,8 +9910,8 @@ var DateStringControl = createControl(
|
|
|
9808
9910
|
|
|
9809
9911
|
// src/controls/date-range-control.tsx
|
|
9810
9912
|
var RANGE_LABELS = {
|
|
9811
|
-
min:
|
|
9812
|
-
max:
|
|
9913
|
+
min: __65("Min date", "elementor"),
|
|
9914
|
+
max: __65("Max date", "elementor")
|
|
9813
9915
|
};
|
|
9814
9916
|
var isMaxBeforeMin = (minIso, maxIso) => {
|
|
9815
9917
|
if (!minIso || !maxIso) {
|
|
@@ -9817,38 +9919,38 @@ var isMaxBeforeMin = (minIso, maxIso) => {
|
|
|
9817
9919
|
}
|
|
9818
9920
|
return maxIso < minIso;
|
|
9819
9921
|
};
|
|
9820
|
-
var RANGE_ERROR_MESSAGE =
|
|
9922
|
+
var RANGE_ERROR_MESSAGE = __65("Max date must be on or after Min date", "elementor");
|
|
9821
9923
|
var DateRangeControl = createControl(() => {
|
|
9822
9924
|
const { value, setValue, ...propContext } = useBoundProp(dateRangePropTypeUtil);
|
|
9823
9925
|
const minString = dateStringPropTypeUtil2.extract(value?.min);
|
|
9824
9926
|
const maxString = dateStringPropTypeUtil2.extract(value?.max);
|
|
9825
9927
|
const hasInvalidRange = isMaxBeforeMin(minString, maxString);
|
|
9826
|
-
return /* @__PURE__ */
|
|
9928
|
+
return /* @__PURE__ */ React124.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React124.createElement(Stack21, { gap: 0.75 }, /* @__PURE__ */ React124.createElement(Stack21, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React124.createElement(Grid30, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React124.createElement(Grid30, { item: true, xs: 12 }, /* @__PURE__ */ React124.createElement(ControlFormLabel, null, RANGE_LABELS.min)), /* @__PURE__ */ React124.createElement(Grid30, { item: true, xs: 12 }, /* @__PURE__ */ React124.createElement(
|
|
9827
9929
|
BoundDateStringControl,
|
|
9828
9930
|
{
|
|
9829
9931
|
bind: "min",
|
|
9830
9932
|
ariaLabel: RANGE_LABELS.min,
|
|
9831
9933
|
error: hasInvalidRange
|
|
9832
9934
|
}
|
|
9833
|
-
))), /* @__PURE__ */
|
|
9935
|
+
))), /* @__PURE__ */ React124.createElement(Grid30, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React124.createElement(Grid30, { item: true, xs: 12 }, /* @__PURE__ */ React124.createElement(ControlFormLabel, null, RANGE_LABELS.max)), /* @__PURE__ */ React124.createElement(Grid30, { item: true, xs: 12 }, /* @__PURE__ */ React124.createElement(
|
|
9834
9936
|
BoundDateStringControl,
|
|
9835
9937
|
{
|
|
9836
9938
|
bind: "max",
|
|
9837
9939
|
ariaLabel: RANGE_LABELS.max,
|
|
9838
9940
|
error: hasInvalidRange
|
|
9839
9941
|
}
|
|
9840
|
-
)))), hasInvalidRange && /* @__PURE__ */
|
|
9942
|
+
)))), hasInvalidRange && /* @__PURE__ */ React124.createElement(FormHelperText2, { error: true }, RANGE_ERROR_MESSAGE)));
|
|
9841
9943
|
});
|
|
9842
9944
|
var BoundDateStringControl = ({
|
|
9843
9945
|
bind,
|
|
9844
9946
|
ariaLabel,
|
|
9845
9947
|
error
|
|
9846
9948
|
}) => {
|
|
9847
|
-
return /* @__PURE__ */
|
|
9949
|
+
return /* @__PURE__ */ React124.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React124.createElement(DateStringControl, { ariaLabel, error, coerceInvalidToNull: true }));
|
|
9848
9950
|
};
|
|
9849
9951
|
|
|
9850
9952
|
// src/controls/time-string-control.tsx
|
|
9851
|
-
import * as
|
|
9953
|
+
import * as React125 from "react";
|
|
9852
9954
|
import { timeStringPropTypeUtil } from "@elementor/editor-props";
|
|
9853
9955
|
import { LocalizationProvider as LocalizationProvider3, TimePicker as TimePicker2 } from "@elementor/ui";
|
|
9854
9956
|
var TimeStringControl = createControl(
|
|
@@ -9876,7 +9978,7 @@ var TimeStringControl = createControl(
|
|
|
9876
9978
|
}
|
|
9877
9979
|
setValue(newValue.format(format));
|
|
9878
9980
|
};
|
|
9879
|
-
return /* @__PURE__ */
|
|
9981
|
+
return /* @__PURE__ */ React125.createElement(LocalizationProvider3, null, /* @__PURE__ */ React125.createElement(ControlActions, null, /* @__PURE__ */ React125.createElement(
|
|
9880
9982
|
TimePicker2,
|
|
9881
9983
|
{
|
|
9882
9984
|
value: parseTimeString(value ?? ""),
|
|
@@ -9889,31 +9991,31 @@ var TimeStringControl = createControl(
|
|
|
9889
9991
|
);
|
|
9890
9992
|
|
|
9891
9993
|
// src/controls/time-range-control.tsx
|
|
9892
|
-
import * as
|
|
9994
|
+
import * as React126 from "react";
|
|
9893
9995
|
import { timeRangePropTypeUtil } from "@elementor/editor-props";
|
|
9894
9996
|
import { Grid as Grid31, Stack as Stack22 } from "@elementor/ui";
|
|
9895
|
-
import { __ as
|
|
9997
|
+
import { __ as __66 } from "@wordpress/i18n";
|
|
9896
9998
|
var RANGE_LABELS2 = {
|
|
9897
|
-
min:
|
|
9898
|
-
max:
|
|
9999
|
+
min: __66("Start time", "elementor"),
|
|
10000
|
+
max: __66("End time", "elementor")
|
|
9899
10001
|
};
|
|
9900
10002
|
var TimeRangeControl = createControl(() => {
|
|
9901
10003
|
const { value, setValue, ...propContext } = useBoundProp(timeRangePropTypeUtil);
|
|
9902
|
-
return /* @__PURE__ */
|
|
10004
|
+
return /* @__PURE__ */ React126.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React126.createElement(Stack22, { direction: "row", gap: 2, flexWrap: "nowrap" }, /* @__PURE__ */ React126.createElement(Grid31, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React126.createElement(Grid31, { item: true, xs: 12 }, /* @__PURE__ */ React126.createElement(ControlFormLabel, null, RANGE_LABELS2.min)), /* @__PURE__ */ React126.createElement(Grid31, { item: true, xs: 12 }, /* @__PURE__ */ React126.createElement(BoundTimeStringControl, { bind: "min", ariaLabel: RANGE_LABELS2.min }))), /* @__PURE__ */ React126.createElement(Grid31, { container: true, gap: 0.75, alignItems: "center" }, /* @__PURE__ */ React126.createElement(Grid31, { item: true, xs: 12 }, /* @__PURE__ */ React126.createElement(ControlFormLabel, null, RANGE_LABELS2.max)), /* @__PURE__ */ React126.createElement(Grid31, { item: true, xs: 12 }, /* @__PURE__ */ React126.createElement(BoundTimeStringControl, { bind: "max", ariaLabel: RANGE_LABELS2.max })))));
|
|
9903
10005
|
});
|
|
9904
10006
|
var BoundTimeStringControl = ({ bind, ariaLabel }) => {
|
|
9905
|
-
return /* @__PURE__ */
|
|
10007
|
+
return /* @__PURE__ */ React126.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React126.createElement(TimeStringControl, { ariaLabel, coerceInvalidToNull: true }));
|
|
9906
10008
|
};
|
|
9907
10009
|
|
|
9908
10010
|
// src/controls/inline-editing-control.tsx
|
|
9909
|
-
import * as
|
|
10011
|
+
import * as React130 from "react";
|
|
9910
10012
|
import { useCallback as useCallback4, useState as useState28 } from "react";
|
|
9911
10013
|
import { escapedHtmlPropTypeUtil as escapedHtmlPropTypeUtil2 } from "@elementor/editor-props";
|
|
9912
10014
|
import { Box as Box36, Stack as Stack24 } from "@elementor/ui";
|
|
9913
10015
|
|
|
9914
10016
|
// src/components/inline-editor.tsx
|
|
9915
|
-
import * as
|
|
9916
|
-
import { useEffect as useEffect20, useRef as
|
|
10017
|
+
import * as React127 from "react";
|
|
10018
|
+
import { useEffect as useEffect20, useRef as useRef37 } from "react";
|
|
9917
10019
|
import { Box as Box34 } from "@elementor/ui";
|
|
9918
10020
|
import Bold from "@tiptap/extension-bold";
|
|
9919
10021
|
import Document from "@tiptap/extension-document";
|
|
@@ -9930,7 +10032,7 @@ import Underline from "@tiptap/extension-underline";
|
|
|
9930
10032
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
9931
10033
|
|
|
9932
10034
|
// src/utils/inline-editing.ts
|
|
9933
|
-
import { escapedHtmlPropTypeUtil, htmlV3PropTypeUtil, stringPropTypeUtil as
|
|
10035
|
+
import { escapedHtmlPropTypeUtil, htmlV3PropTypeUtil, stringPropTypeUtil as stringPropTypeUtil22 } from "@elementor/editor-props";
|
|
9934
10036
|
function isEmpty(value = "") {
|
|
9935
10037
|
if (!value) {
|
|
9936
10038
|
return true;
|
|
@@ -9952,14 +10054,14 @@ function extractInlineHtmlContent(propValue) {
|
|
|
9952
10054
|
return escapedHtmlPropTypeUtil.extract(propValue) ?? "";
|
|
9953
10055
|
}
|
|
9954
10056
|
const htmlV3 = htmlV3PropTypeUtil.extract(propValue);
|
|
9955
|
-
return
|
|
10057
|
+
return stringPropTypeUtil22.extract(htmlV3?.content ?? null) ?? "";
|
|
9956
10058
|
}
|
|
9957
10059
|
|
|
9958
10060
|
// src/components/inline-editor.tsx
|
|
9959
10061
|
var ITALIC_KEYBOARD_SHORTCUT = "i";
|
|
9960
10062
|
var BOLD_KEYBOARD_SHORTCUT = "b";
|
|
9961
10063
|
var UNDERLINE_KEYBOARD_SHORTCUT = "u";
|
|
9962
|
-
var InlineEditor =
|
|
10064
|
+
var InlineEditor = React127.forwardRef((props, ref) => {
|
|
9963
10065
|
const {
|
|
9964
10066
|
value,
|
|
9965
10067
|
setValue,
|
|
@@ -9976,8 +10078,8 @@ var InlineEditor = React126.forwardRef((props, ref) => {
|
|
|
9976
10078
|
onSelectionEnd,
|
|
9977
10079
|
mountElement = null
|
|
9978
10080
|
} = props;
|
|
9979
|
-
const containerRef =
|
|
9980
|
-
const onBlurRef =
|
|
10081
|
+
const containerRef = useRef37(null);
|
|
10082
|
+
const onBlurRef = useRef37(onBlur);
|
|
9981
10083
|
onBlurRef.current = onBlur;
|
|
9982
10084
|
const documentContentSettings = !!expectedTag ? "block+" : "inline*";
|
|
9983
10085
|
const onUpdate = ({ editor: updatedEditor }) => {
|
|
@@ -10072,10 +10174,10 @@ var InlineEditor = React126.forwardRef((props, ref) => {
|
|
|
10072
10174
|
if (mountElement) {
|
|
10073
10175
|
return null;
|
|
10074
10176
|
}
|
|
10075
|
-
return /* @__PURE__ */
|
|
10177
|
+
return /* @__PURE__ */ React127.createElement(Box34, { ref: containerRef, sx, className: wrapperClassName }, /* @__PURE__ */ React127.createElement(EditorContent, { ref, editor }));
|
|
10076
10178
|
});
|
|
10077
10179
|
var useOnUpdate = (callback, dependencies) => {
|
|
10078
|
-
const hasMounted =
|
|
10180
|
+
const hasMounted = useRef37(false);
|
|
10079
10181
|
useEffect20(() => {
|
|
10080
10182
|
if (hasMounted.current) {
|
|
10081
10183
|
callback();
|
|
@@ -10086,8 +10188,8 @@ var useOnUpdate = (callback, dependencies) => {
|
|
|
10086
10188
|
};
|
|
10087
10189
|
|
|
10088
10190
|
// src/components/inline-editor-toolbar.tsx
|
|
10089
|
-
import * as
|
|
10090
|
-
import { useEffect as useEffect22, useMemo as
|
|
10191
|
+
import * as React129 from "react";
|
|
10192
|
+
import { useEffect as useEffect22, useMemo as useMemo20, useRef as useRef39, useState as useState27 } from "react";
|
|
10091
10193
|
import { getContainer as getContainer2, getElementSetting } from "@elementor/editor-elements";
|
|
10092
10194
|
import {
|
|
10093
10195
|
BoldIcon,
|
|
@@ -10109,14 +10211,14 @@ import {
|
|
|
10109
10211
|
usePopupState as usePopupState12
|
|
10110
10212
|
} from "@elementor/ui";
|
|
10111
10213
|
import { useEditorState } from "@tiptap/react";
|
|
10112
|
-
import { __ as
|
|
10214
|
+
import { __ as __68 } from "@wordpress/i18n";
|
|
10113
10215
|
|
|
10114
10216
|
// src/components/url-popover.tsx
|
|
10115
|
-
import * as
|
|
10116
|
-
import { useEffect as useEffect21, useRef as
|
|
10217
|
+
import * as React128 from "react";
|
|
10218
|
+
import { useEffect as useEffect21, useRef as useRef38 } from "react";
|
|
10117
10219
|
import { ExternalLinkIcon } from "@elementor/icons";
|
|
10118
|
-
import { bindPopover as bindPopover8, Popover as Popover9, Stack as Stack23, TextField as
|
|
10119
|
-
import { __ as
|
|
10220
|
+
import { bindPopover as bindPopover8, Popover as Popover9, Stack as Stack23, TextField as TextField12, ToggleButton as ToggleButton3, Tooltip as Tooltip13 } from "@elementor/ui";
|
|
10221
|
+
import { __ as __67 } from "@wordpress/i18n";
|
|
10120
10222
|
var UrlPopover = ({
|
|
10121
10223
|
popupState,
|
|
10122
10224
|
restoreValue,
|
|
@@ -10126,7 +10228,7 @@ var UrlPopover = ({
|
|
|
10126
10228
|
openInNewTab,
|
|
10127
10229
|
onToggleNewTab
|
|
10128
10230
|
}) => {
|
|
10129
|
-
const inputRef =
|
|
10231
|
+
const inputRef = useRef38(null);
|
|
10130
10232
|
useEffect21(() => {
|
|
10131
10233
|
if (popupState.isOpen) {
|
|
10132
10234
|
requestAnimationFrame(() => inputRef.current?.focus());
|
|
@@ -10136,7 +10238,7 @@ var UrlPopover = ({
|
|
|
10136
10238
|
restoreValue();
|
|
10137
10239
|
popupState.close();
|
|
10138
10240
|
};
|
|
10139
|
-
return /* @__PURE__ */
|
|
10241
|
+
return /* @__PURE__ */ React128.createElement(
|
|
10140
10242
|
Popover9,
|
|
10141
10243
|
{
|
|
10142
10244
|
slotProps: {
|
|
@@ -10147,30 +10249,30 @@ var UrlPopover = ({
|
|
|
10147
10249
|
transformOrigin: { vertical: "top", horizontal: "left" },
|
|
10148
10250
|
onClose: handleClose
|
|
10149
10251
|
},
|
|
10150
|
-
/* @__PURE__ */
|
|
10151
|
-
|
|
10252
|
+
/* @__PURE__ */ React128.createElement(Stack23, { direction: "row", alignItems: "center", gap: 1, sx: { p: 1.5 } }, /* @__PURE__ */ React128.createElement(
|
|
10253
|
+
TextField12,
|
|
10152
10254
|
{
|
|
10153
10255
|
value,
|
|
10154
10256
|
onChange,
|
|
10155
10257
|
size: "tiny",
|
|
10156
10258
|
fullWidth: true,
|
|
10157
|
-
placeholder:
|
|
10259
|
+
placeholder: __67("Type a URL", "elementor"),
|
|
10158
10260
|
inputProps: { ref: inputRef },
|
|
10159
10261
|
color: "secondary",
|
|
10160
10262
|
InputProps: { sx: { borderRadius: "8px" } },
|
|
10161
10263
|
onKeyUp: (event) => event.key === "Enter" && handleClose()
|
|
10162
10264
|
}
|
|
10163
|
-
), /* @__PURE__ */
|
|
10265
|
+
), /* @__PURE__ */ React128.createElement(Tooltip13, { title: __67("Open in a new tab", "elementor") }, /* @__PURE__ */ React128.createElement(
|
|
10164
10266
|
ToggleButton3,
|
|
10165
10267
|
{
|
|
10166
10268
|
size: "tiny",
|
|
10167
10269
|
value: "newTab",
|
|
10168
10270
|
selected: openInNewTab,
|
|
10169
10271
|
onClick: onToggleNewTab,
|
|
10170
|
-
"aria-label":
|
|
10272
|
+
"aria-label": __67("Open in a new tab", "elementor"),
|
|
10171
10273
|
sx: { borderRadius: "8px" }
|
|
10172
10274
|
},
|
|
10173
|
-
/* @__PURE__ */
|
|
10275
|
+
/* @__PURE__ */ React128.createElement(ExternalLinkIcon, { fontSize: "tiny" })
|
|
10174
10276
|
)))
|
|
10175
10277
|
);
|
|
10176
10278
|
};
|
|
@@ -10184,14 +10286,14 @@ var InlineEditorToolbar = ({
|
|
|
10184
10286
|
}) => {
|
|
10185
10287
|
const [urlValue, setUrlValue] = useState27("");
|
|
10186
10288
|
const [openInNewTab, setOpenInNewTab] = useState27(false);
|
|
10187
|
-
const toolbarRef =
|
|
10289
|
+
const toolbarRef = useRef39(null);
|
|
10188
10290
|
const linkPopupState = usePopupState12({ variant: "popover" });
|
|
10189
10291
|
const isElementClickable = elementId ? checkIfElementIsClickable(elementId) : false;
|
|
10190
10292
|
const editorState = useEditorState({
|
|
10191
10293
|
editor,
|
|
10192
10294
|
selector: (ctx) => possibleFormats.filter((format) => ctx.editor.isActive(format))
|
|
10193
10295
|
});
|
|
10194
|
-
const formatButtonsList =
|
|
10296
|
+
const formatButtonsList = useMemo20(() => {
|
|
10195
10297
|
const buttons = Object.values(formatButtons);
|
|
10196
10298
|
if (isElementClickable) {
|
|
10197
10299
|
return buttons.filter((button) => button.action !== "link");
|
|
@@ -10233,7 +10335,7 @@ var InlineEditorToolbar = ({
|
|
|
10233
10335
|
editor?.commands?.focus();
|
|
10234
10336
|
}
|
|
10235
10337
|
}, [editor, inControlPanel]);
|
|
10236
|
-
return /* @__PURE__ */
|
|
10338
|
+
return /* @__PURE__ */ React129.createElement(
|
|
10237
10339
|
Box35,
|
|
10238
10340
|
{
|
|
10239
10341
|
ref: toolbarRef,
|
|
@@ -10267,8 +10369,8 @@ var InlineEditorToolbar = ({
|
|
|
10267
10369
|
}
|
|
10268
10370
|
}
|
|
10269
10371
|
},
|
|
10270
|
-
/* @__PURE__ */
|
|
10271
|
-
/* @__PURE__ */
|
|
10372
|
+
/* @__PURE__ */ React129.createElement(Tooltip14, { title: clearButton.label, placement: "top", sx: { borderRadius: "8px" } }, /* @__PURE__ */ React129.createElement(IconButton11, { "aria-label": clearButton.label, onClick: () => clearButton.method(editor), size: "tiny" }, clearButton.icon)),
|
|
10373
|
+
/* @__PURE__ */ React129.createElement(
|
|
10272
10374
|
ToggleButtonGroup2,
|
|
10273
10375
|
{
|
|
10274
10376
|
value: editorState,
|
|
@@ -10298,7 +10400,7 @@ var InlineEditorToolbar = ({
|
|
|
10298
10400
|
}
|
|
10299
10401
|
}
|
|
10300
10402
|
},
|
|
10301
|
-
formatButtonsList.map((button) => /* @__PURE__ */
|
|
10403
|
+
formatButtonsList.map((button) => /* @__PURE__ */ React129.createElement(Tooltip14, { title: button.label, key: button.action, placement: "top" }, /* @__PURE__ */ React129.createElement(
|
|
10302
10404
|
ToggleButton4,
|
|
10303
10405
|
{
|
|
10304
10406
|
value: button.action,
|
|
@@ -10316,7 +10418,7 @@ var InlineEditorToolbar = ({
|
|
|
10316
10418
|
button.icon
|
|
10317
10419
|
)))
|
|
10318
10420
|
),
|
|
10319
|
-
/* @__PURE__ */
|
|
10421
|
+
/* @__PURE__ */ React129.createElement(
|
|
10320
10422
|
UrlPopover,
|
|
10321
10423
|
{
|
|
10322
10424
|
popupState: linkPopupState,
|
|
@@ -10339,64 +10441,64 @@ var checkIfElementIsClickable = (elementId) => {
|
|
|
10339
10441
|
};
|
|
10340
10442
|
var toolbarButtons = {
|
|
10341
10443
|
clear: {
|
|
10342
|
-
label:
|
|
10343
|
-
icon: /* @__PURE__ */
|
|
10444
|
+
label: __68("Clear", "elementor"),
|
|
10445
|
+
icon: /* @__PURE__ */ React129.createElement(MinusIcon2, { fontSize: "tiny" }),
|
|
10344
10446
|
action: "clear",
|
|
10345
10447
|
method: (editor) => {
|
|
10346
10448
|
editor.chain().focus().clearNodes().unsetAllMarks().run();
|
|
10347
10449
|
}
|
|
10348
10450
|
},
|
|
10349
10451
|
bold: {
|
|
10350
|
-
label:
|
|
10351
|
-
icon: /* @__PURE__ */
|
|
10452
|
+
label: __68("Bold", "elementor"),
|
|
10453
|
+
icon: /* @__PURE__ */ React129.createElement(BoldIcon, { fontSize: "tiny" }),
|
|
10352
10454
|
action: "bold",
|
|
10353
10455
|
method: (editor) => {
|
|
10354
10456
|
editor.chain().focus().toggleBold().run();
|
|
10355
10457
|
}
|
|
10356
10458
|
},
|
|
10357
10459
|
italic: {
|
|
10358
|
-
label:
|
|
10359
|
-
icon: /* @__PURE__ */
|
|
10460
|
+
label: __68("Italic", "elementor"),
|
|
10461
|
+
icon: /* @__PURE__ */ React129.createElement(ItalicIcon, { fontSize: "tiny" }),
|
|
10360
10462
|
action: "italic",
|
|
10361
10463
|
method: (editor) => {
|
|
10362
10464
|
editor.chain().focus().toggleItalic().run();
|
|
10363
10465
|
}
|
|
10364
10466
|
},
|
|
10365
10467
|
underline: {
|
|
10366
|
-
label:
|
|
10367
|
-
icon: /* @__PURE__ */
|
|
10468
|
+
label: __68("Underline", "elementor"),
|
|
10469
|
+
icon: /* @__PURE__ */ React129.createElement(UnderlineIcon, { fontSize: "tiny" }),
|
|
10368
10470
|
action: "underline",
|
|
10369
10471
|
method: (editor) => {
|
|
10370
10472
|
editor.chain().focus().toggleUnderline().run();
|
|
10371
10473
|
}
|
|
10372
10474
|
},
|
|
10373
10475
|
strike: {
|
|
10374
|
-
label:
|
|
10375
|
-
icon: /* @__PURE__ */
|
|
10476
|
+
label: __68("Strikethrough", "elementor"),
|
|
10477
|
+
icon: /* @__PURE__ */ React129.createElement(StrikethroughIcon, { fontSize: "tiny" }),
|
|
10376
10478
|
action: "strike",
|
|
10377
10479
|
method: (editor) => {
|
|
10378
10480
|
editor.chain().focus().toggleStrike().run();
|
|
10379
10481
|
}
|
|
10380
10482
|
},
|
|
10381
10483
|
superscript: {
|
|
10382
|
-
label:
|
|
10383
|
-
icon: /* @__PURE__ */
|
|
10484
|
+
label: __68("Superscript", "elementor"),
|
|
10485
|
+
icon: /* @__PURE__ */ React129.createElement(SuperscriptIcon, { fontSize: "tiny" }),
|
|
10384
10486
|
action: "superscript",
|
|
10385
10487
|
method: (editor) => {
|
|
10386
10488
|
editor.chain().focus().toggleSuperscript().run();
|
|
10387
10489
|
}
|
|
10388
10490
|
},
|
|
10389
10491
|
subscript: {
|
|
10390
|
-
label:
|
|
10391
|
-
icon: /* @__PURE__ */
|
|
10492
|
+
label: __68("Subscript", "elementor"),
|
|
10493
|
+
icon: /* @__PURE__ */ React129.createElement(SubscriptIcon, { fontSize: "tiny" }),
|
|
10392
10494
|
action: "subscript",
|
|
10393
10495
|
method: (editor) => {
|
|
10394
10496
|
editor.chain().focus().toggleSubscript().run();
|
|
10395
10497
|
}
|
|
10396
10498
|
},
|
|
10397
10499
|
link: {
|
|
10398
|
-
label:
|
|
10399
|
-
icon: /* @__PURE__ */
|
|
10500
|
+
label: __68("Link", "elementor"),
|
|
10501
|
+
icon: /* @__PURE__ */ React129.createElement(LinkIcon3, { fontSize: "tiny" }),
|
|
10400
10502
|
action: "link",
|
|
10401
10503
|
method: null
|
|
10402
10504
|
}
|
|
@@ -10418,7 +10520,7 @@ var InlineEditingControl = createControl(
|
|
|
10418
10520
|
},
|
|
10419
10521
|
[setValue]
|
|
10420
10522
|
);
|
|
10421
|
-
const editorField = /* @__PURE__ */
|
|
10523
|
+
const editorField = /* @__PURE__ */ React130.createElement(ControlActions, null, /* @__PURE__ */ React130.createElement(Box36, { sx: { position: "relative" } }, editor && editor.isEditable && /* @__PURE__ */ React130.createElement(
|
|
10422
10524
|
InlineEditorToolbar,
|
|
10423
10525
|
{
|
|
10424
10526
|
editor,
|
|
@@ -10431,7 +10533,7 @@ var InlineEditingControl = createControl(
|
|
|
10431
10533
|
}),
|
|
10432
10534
|
inControlPanel: true
|
|
10433
10535
|
}
|
|
10434
|
-
), /* @__PURE__ */
|
|
10536
|
+
), /* @__PURE__ */ React130.createElement(
|
|
10435
10537
|
Box36,
|
|
10436
10538
|
{
|
|
10437
10539
|
sx: (theme) => ({
|
|
@@ -10476,7 +10578,7 @@ var InlineEditingControl = createControl(
|
|
|
10476
10578
|
...attributes,
|
|
10477
10579
|
...props
|
|
10478
10580
|
},
|
|
10479
|
-
/* @__PURE__ */
|
|
10581
|
+
/* @__PURE__ */ React130.createElement(
|
|
10480
10582
|
InlineEditor,
|
|
10481
10583
|
{
|
|
10482
10584
|
value: content,
|
|
@@ -10493,22 +10595,22 @@ var InlineEditingControl = createControl(
|
|
|
10493
10595
|
if (!promotion) {
|
|
10494
10596
|
return editorField;
|
|
10495
10597
|
}
|
|
10496
|
-
return /* @__PURE__ */
|
|
10598
|
+
return /* @__PURE__ */ React130.createElement(Stack24, { gap: 1 }, /* @__PURE__ */ React130.createElement(Stack24, { direction: "row", alignItems: "center", justifyContent: "space-between" }, /* @__PURE__ */ React130.createElement(ControlLabel, null, label), /* @__PURE__ */ React130.createElement(ImageOptimizeTrigger, { promotion })), editorField);
|
|
10497
10599
|
}
|
|
10498
10600
|
);
|
|
10499
10601
|
|
|
10500
10602
|
// src/controls/email-form-action-control/index.tsx
|
|
10501
|
-
import * as
|
|
10603
|
+
import * as React134 from "react";
|
|
10502
10604
|
import { emailsPropTypeUtil } from "@elementor/editor-props";
|
|
10503
10605
|
import { CollapsibleContent } from "@elementor/editor-ui";
|
|
10504
10606
|
import { Box as Box37, Divider as Divider7, Stack as Stack26 } from "@elementor/ui";
|
|
10505
|
-
import { __ as
|
|
10607
|
+
import { __ as __70 } from "@wordpress/i18n";
|
|
10506
10608
|
|
|
10507
10609
|
// src/controls/email-form-action-control/fields.tsx
|
|
10508
|
-
import * as
|
|
10610
|
+
import * as React133 from "react";
|
|
10509
10611
|
import { InfoAlert as InfoAlert2 } from "@elementor/editor-ui";
|
|
10510
10612
|
import { Grid as Grid34, Stack as Stack25 } from "@elementor/ui";
|
|
10511
|
-
import { __ as
|
|
10613
|
+
import { __ as __69 } from "@wordpress/i18n";
|
|
10512
10614
|
|
|
10513
10615
|
// src/hooks/use-form-field-suggestions.ts
|
|
10514
10616
|
import {
|
|
@@ -10517,7 +10619,7 @@ import {
|
|
|
10517
10619
|
getSelectedElements as getSelectedElements3,
|
|
10518
10620
|
getWidgetsCache
|
|
10519
10621
|
} from "@elementor/editor-elements";
|
|
10520
|
-
import { stringPropTypeUtil as
|
|
10622
|
+
import { stringPropTypeUtil as stringPropTypeUtil23 } from "@elementor/editor-props";
|
|
10521
10623
|
import { __privateUseListenTo as useListenTo2, commandEndEvent as commandEndEvent2, v1ReadyEvent } from "@elementor/editor-v1-adapters";
|
|
10522
10624
|
var FORM_FIELD_WIDGET_TYPES = [
|
|
10523
10625
|
"e-form-input",
|
|
@@ -10534,7 +10636,7 @@ function isFormFieldWidgetType(widgetType) {
|
|
|
10534
10636
|
return FORM_FIELD_WIDGET_TYPES.includes(widgetType);
|
|
10535
10637
|
}
|
|
10536
10638
|
function extractStringPropValue(value) {
|
|
10537
|
-
return
|
|
10639
|
+
return stringPropTypeUtil23.extract(value);
|
|
10538
10640
|
}
|
|
10539
10641
|
function getSettingWithDefault(child, widgetType, key) {
|
|
10540
10642
|
const fromGet = child.settings.get(key);
|
|
@@ -10598,10 +10700,10 @@ function useFormFieldSuggestions(options) {
|
|
|
10598
10700
|
}
|
|
10599
10701
|
|
|
10600
10702
|
// src/controls/email-form-action-control/email-chips-field.tsx
|
|
10601
|
-
import * as
|
|
10602
|
-
import { useMemo as
|
|
10603
|
-
import { stringArrayPropTypeUtil as stringArrayPropTypeUtil3, stringPropTypeUtil as
|
|
10604
|
-
import { Autocomplete as
|
|
10703
|
+
import * as React131 from "react";
|
|
10704
|
+
import { useMemo as useMemo21, useState as useState29 } from "react";
|
|
10705
|
+
import { stringArrayPropTypeUtil as stringArrayPropTypeUtil3, stringPropTypeUtil as stringPropTypeUtil24 } from "@elementor/editor-props";
|
|
10706
|
+
import { Autocomplete as Autocomplete5, Grid as Grid32, TextField as TextField13 } from "@elementor/ui";
|
|
10605
10707
|
|
|
10606
10708
|
// src/controls/email-form-action-control/utils.ts
|
|
10607
10709
|
import { z } from "@elementor/schema";
|
|
@@ -10639,8 +10741,8 @@ var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
|
|
|
10639
10741
|
const { value, setValue, disabled } = useBoundProp(stringArrayPropTypeUtil3);
|
|
10640
10742
|
const [inputValue, setInputValue] = useState29("");
|
|
10641
10743
|
const items2 = value || [];
|
|
10642
|
-
const selectedValues = items2.map((item) =>
|
|
10643
|
-
const suggestionOptions =
|
|
10744
|
+
const selectedValues = items2.map((item) => stringPropTypeUtil24.extract(item)).filter((val) => val !== null);
|
|
10745
|
+
const suggestionOptions = useMemo21(
|
|
10644
10746
|
() => suggestions.map((suggestion) => `[${suggestion.value}]`),
|
|
10645
10747
|
[suggestions]
|
|
10646
10748
|
);
|
|
@@ -10649,7 +10751,7 @@ var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
|
|
|
10649
10751
|
if (!address || selectedValues.includes(address) || !isValidRecipient(address)) {
|
|
10650
10752
|
return;
|
|
10651
10753
|
}
|
|
10652
|
-
setValue([...items2,
|
|
10754
|
+
setValue([...items2, stringPropTypeUtil24.create(address)]);
|
|
10653
10755
|
setInputValue("");
|
|
10654
10756
|
};
|
|
10655
10757
|
const handleChange = (_, newValue) => {
|
|
@@ -10659,7 +10761,7 @@ var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
|
|
|
10659
10761
|
if (!address || !isValidRecipient(address)) {
|
|
10660
10762
|
continue;
|
|
10661
10763
|
}
|
|
10662
|
-
updated.push(
|
|
10764
|
+
updated.push(stringPropTypeUtil24.create(address));
|
|
10663
10765
|
}
|
|
10664
10766
|
setValue(updated);
|
|
10665
10767
|
setInputValue("");
|
|
@@ -10675,8 +10777,8 @@ var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
|
|
|
10675
10777
|
tryAddChip(inputValue);
|
|
10676
10778
|
}
|
|
10677
10779
|
};
|
|
10678
|
-
return /* @__PURE__ */
|
|
10679
|
-
|
|
10780
|
+
return /* @__PURE__ */ React131.createElement(ControlActions, null, /* @__PURE__ */ React131.createElement(
|
|
10781
|
+
Autocomplete5,
|
|
10680
10782
|
{
|
|
10681
10783
|
fullWidth: true,
|
|
10682
10784
|
multiple: true,
|
|
@@ -10700,17 +10802,17 @@ var EmailChipsControl = createControl(({ placeholder, suggestions = [] }) => {
|
|
|
10700
10802
|
onBlur: handleBlur,
|
|
10701
10803
|
getOptionLabel: (option) => option,
|
|
10702
10804
|
isOptionEqualToValue: (option, val) => option === val,
|
|
10703
|
-
renderInput: (params) => /* @__PURE__ */
|
|
10704
|
-
renderTags: (tagValues, getTagProps) => /* @__PURE__ */
|
|
10805
|
+
renderInput: (params) => /* @__PURE__ */ React131.createElement(TextField13, { ...params, placeholder, onKeyDown: handleKeyDown }),
|
|
10806
|
+
renderTags: (tagValues, getTagProps) => /* @__PURE__ */ React131.createElement(ChipsList, { getLabel: (option) => option, getTagProps, values: tagValues })
|
|
10705
10807
|
}
|
|
10706
10808
|
));
|
|
10707
10809
|
});
|
|
10708
|
-
var EmailChipsField = ({ fieldLabel, placeholder, suggestions }) => /* @__PURE__ */
|
|
10810
|
+
var EmailChipsField = ({ fieldLabel, placeholder, suggestions }) => /* @__PURE__ */ React131.createElement(Grid32, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React131.createElement(Grid32, { item: true }, /* @__PURE__ */ React131.createElement(ControlFormLabel, null, fieldLabel)), /* @__PURE__ */ React131.createElement(Grid32, { item: true }, /* @__PURE__ */ React131.createElement(EmailChipsControl, { placeholder, suggestions })));
|
|
10709
10811
|
|
|
10710
10812
|
// src/controls/email-form-action-control/email-field.tsx
|
|
10711
|
-
import * as
|
|
10813
|
+
import * as React132 from "react";
|
|
10712
10814
|
import { Grid as Grid33 } from "@elementor/ui";
|
|
10713
|
-
var EmailField = ({ bind, label, placeholder }) => /* @__PURE__ */
|
|
10815
|
+
var EmailField = ({ bind, label, placeholder }) => /* @__PURE__ */ React132.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React132.createElement(Grid33, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React132.createElement(Grid33, { item: true }, /* @__PURE__ */ React132.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React132.createElement(Grid33, { item: true }, /* @__PURE__ */ React132.createElement(TextControl, { placeholder }))));
|
|
10714
10816
|
|
|
10715
10817
|
// src/controls/email-form-action-control/fields.tsx
|
|
10716
10818
|
var FieldValueMentionField = ({
|
|
@@ -10719,88 +10821,88 @@ var FieldValueMentionField = ({
|
|
|
10719
10821
|
placeholder
|
|
10720
10822
|
}) => {
|
|
10721
10823
|
const suggestions = useFormFieldSuggestions();
|
|
10722
|
-
return /* @__PURE__ */
|
|
10824
|
+
return /* @__PURE__ */ React133.createElement(PropKeyProvider, { bind }, /* @__PURE__ */ React133.createElement(Grid34, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React133.createElement(Grid34, { item: true }, /* @__PURE__ */ React133.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React133.createElement(Grid34, { item: true }, /* @__PURE__ */ React133.createElement(MentionTextAreaControl, { suggestions, rows: 1, placeholder }))));
|
|
10723
10825
|
};
|
|
10724
10826
|
var SendToField = ({ placeholder }) => {
|
|
10725
10827
|
const suggestions = useFormFieldSuggestions({ inputType: "email" });
|
|
10726
|
-
return /* @__PURE__ */
|
|
10828
|
+
return /* @__PURE__ */ React133.createElement(PropKeyProvider, { bind: "to" }, /* @__PURE__ */ React133.createElement(Stack25, { gap: 0.5 }, /* @__PURE__ */ React133.createElement(
|
|
10727
10829
|
EmailChipsField,
|
|
10728
10830
|
{
|
|
10729
|
-
fieldLabel:
|
|
10831
|
+
fieldLabel: __69("Send to", "elementor"),
|
|
10730
10832
|
placeholder,
|
|
10731
10833
|
suggestions
|
|
10732
10834
|
}
|
|
10733
|
-
), shouldShowMentionsInfo() && /* @__PURE__ */
|
|
10835
|
+
), shouldShowMentionsInfo() && /* @__PURE__ */ React133.createElement(InfoAlert2, null, __69("Type @ or an email field name to insert its submitted value.", "elementor"))));
|
|
10734
10836
|
};
|
|
10735
|
-
var SubjectField = () => /* @__PURE__ */
|
|
10837
|
+
var SubjectField = () => /* @__PURE__ */ React133.createElement(
|
|
10736
10838
|
FieldValueMentionField,
|
|
10737
10839
|
{
|
|
10738
10840
|
bind: "subject",
|
|
10739
|
-
label:
|
|
10740
|
-
placeholder:
|
|
10841
|
+
label: __69("Email subject", "elementor"),
|
|
10842
|
+
placeholder: __69("New form submission", "elementor")
|
|
10741
10843
|
}
|
|
10742
10844
|
);
|
|
10743
10845
|
var MessageField = () => {
|
|
10744
10846
|
const suggestions = useFormFieldSuggestions();
|
|
10745
|
-
return /* @__PURE__ */
|
|
10847
|
+
return /* @__PURE__ */ React133.createElement(PropKeyProvider, { bind: "message" }, /* @__PURE__ */ React133.createElement(Grid34, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React133.createElement(Grid34, { item: true }, /* @__PURE__ */ React133.createElement(ControlFormLabel, null, __69("Message", "elementor"))), /* @__PURE__ */ React133.createElement(Grid34, { item: true }, /* @__PURE__ */ React133.createElement(MentionTextAreaControl, { suggestions })), /* @__PURE__ */ React133.createElement(Grid34, { item: true }, /* @__PURE__ */ React133.createElement(InfoAlert2, null, shouldShowMentionsInfo() ? __69(
|
|
10746
10848
|
"[all-fields] shortcode sends all fields. Type @ to insert specific fields and customize your message.",
|
|
10747
10849
|
"elementor"
|
|
10748
|
-
) :
|
|
10850
|
+
) : __69("[all-fields] shortcode sends all fields.", "elementor")))));
|
|
10749
10851
|
};
|
|
10750
|
-
var FromEmailField = () => /* @__PURE__ */
|
|
10852
|
+
var FromEmailField = () => /* @__PURE__ */ React133.createElement(
|
|
10751
10853
|
EmailField,
|
|
10752
10854
|
{
|
|
10753
10855
|
bind: "from",
|
|
10754
|
-
label:
|
|
10755
|
-
placeholder:
|
|
10856
|
+
label: __69("From email", "elementor"),
|
|
10857
|
+
placeholder: __69("What email should appear as the sender?", "elementor")
|
|
10756
10858
|
}
|
|
10757
10859
|
);
|
|
10758
|
-
var FromNameField = () => /* @__PURE__ */
|
|
10860
|
+
var FromNameField = () => /* @__PURE__ */ React133.createElement(
|
|
10759
10861
|
FieldValueMentionField,
|
|
10760
10862
|
{
|
|
10761
10863
|
bind: "from-name",
|
|
10762
|
-
label:
|
|
10763
|
-
placeholder:
|
|
10864
|
+
label: __69("From name", "elementor"),
|
|
10865
|
+
placeholder: __69("What name should appear as the sender?", "elementor")
|
|
10764
10866
|
}
|
|
10765
10867
|
);
|
|
10766
10868
|
var ReplyToField = () => {
|
|
10767
10869
|
const emailSuggestions = useFormFieldSuggestions({ inputType: "email" });
|
|
10768
|
-
return /* @__PURE__ */
|
|
10870
|
+
return /* @__PURE__ */ React133.createElement(PropKeyProvider, { bind: "reply-to" }, /* @__PURE__ */ React133.createElement(Grid34, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React133.createElement(Grid34, { item: true }, /* @__PURE__ */ React133.createElement(ControlFormLabel, null, __69("Reply-to", "elementor"))), /* @__PURE__ */ React133.createElement(Grid34, { item: true }, /* @__PURE__ */ React133.createElement(
|
|
10769
10871
|
MentionTextAreaControl,
|
|
10770
10872
|
{
|
|
10771
10873
|
suggestions: emailSuggestions,
|
|
10772
10874
|
rows: 1,
|
|
10773
10875
|
triggerPosition: "start",
|
|
10774
|
-
placeholder:
|
|
10876
|
+
placeholder: __69("You can type @ to insert an email field", "elementor")
|
|
10775
10877
|
}
|
|
10776
10878
|
))));
|
|
10777
10879
|
};
|
|
10778
10880
|
var CcField = () => {
|
|
10779
10881
|
const suggestions = useFormFieldSuggestions({ inputType: "email" });
|
|
10780
|
-
return /* @__PURE__ */
|
|
10882
|
+
return /* @__PURE__ */ React133.createElement(PropKeyProvider, { bind: "cc" }, /* @__PURE__ */ React133.createElement(EmailChipsField, { fieldLabel: __69("Cc", "elementor"), suggestions }));
|
|
10781
10883
|
};
|
|
10782
10884
|
var BccField = () => {
|
|
10783
10885
|
const suggestions = useFormFieldSuggestions({ inputType: "email" });
|
|
10784
|
-
return /* @__PURE__ */
|
|
10886
|
+
return /* @__PURE__ */ React133.createElement(PropKeyProvider, { bind: "bcc" }, /* @__PURE__ */ React133.createElement(EmailChipsField, { fieldLabel: __69("Bcc", "elementor"), suggestions }));
|
|
10785
10887
|
};
|
|
10786
|
-
var MetaDataField = () => /* @__PURE__ */
|
|
10888
|
+
var MetaDataField = () => /* @__PURE__ */ React133.createElement(PropKeyProvider, { bind: "meta-data" }, /* @__PURE__ */ React133.createElement(Stack25, { gap: 0.5 }, /* @__PURE__ */ React133.createElement(ControlFormLabel, null, __69("Metadata", "elementor")), /* @__PURE__ */ React133.createElement(
|
|
10787
10889
|
ChipsControl,
|
|
10788
10890
|
{
|
|
10789
10891
|
options: [
|
|
10790
|
-
{ label:
|
|
10791
|
-
{ label:
|
|
10792
|
-
{ label:
|
|
10793
|
-
{ label:
|
|
10794
|
-
{ label:
|
|
10892
|
+
{ label: __69("Date", "elementor"), value: "date" },
|
|
10893
|
+
{ label: __69("Time", "elementor"), value: "time" },
|
|
10894
|
+
{ label: __69("Page URL", "elementor"), value: "page-url" },
|
|
10895
|
+
{ label: __69("User agent", "elementor"), value: "user-agent" },
|
|
10896
|
+
{ label: __69("Credit", "elementor"), value: "credit" }
|
|
10795
10897
|
]
|
|
10796
10898
|
}
|
|
10797
10899
|
)));
|
|
10798
|
-
var SendAsField = () => /* @__PURE__ */
|
|
10900
|
+
var SendAsField = () => /* @__PURE__ */ React133.createElement(PropKeyProvider, { bind: "send-as" }, /* @__PURE__ */ React133.createElement(Grid34, { container: true, direction: "column", gap: 0.5 }, /* @__PURE__ */ React133.createElement(Grid34, { item: true }, /* @__PURE__ */ React133.createElement(ControlFormLabel, null, __69("Send as", "elementor"))), /* @__PURE__ */ React133.createElement(Grid34, { item: true }, /* @__PURE__ */ React133.createElement(
|
|
10799
10901
|
SelectControl,
|
|
10800
10902
|
{
|
|
10801
10903
|
options: [
|
|
10802
|
-
{ label:
|
|
10803
|
-
{ label:
|
|
10904
|
+
{ label: __69("HTML", "elementor"), value: "html" },
|
|
10905
|
+
{ label: __69("Plain Text", "elementor"), value: "plain" }
|
|
10804
10906
|
]
|
|
10805
10907
|
}
|
|
10806
10908
|
))));
|
|
@@ -10809,27 +10911,27 @@ var SendAsField = () => /* @__PURE__ */ React132.createElement(PropKeyProvider,
|
|
|
10809
10911
|
var EmailFormActionControl = createControl(
|
|
10810
10912
|
({ toPlaceholder, label }) => {
|
|
10811
10913
|
const { value, setValue, ...propContext } = useBoundProp(emailsPropTypeUtil);
|
|
10812
|
-
return /* @__PURE__ */
|
|
10914
|
+
return /* @__PURE__ */ React134.createElement(PropProvider, { ...propContext, value, setValue }, /* @__PURE__ */ React134.createElement(Stack26, { gap: 2 }, /* @__PURE__ */ React134.createElement(ControlLabel, null, label ? label + " " + __70("settings", "elementor") : __70("Email settings", "elementor")), /* @__PURE__ */ React134.createElement(SendToField, { placeholder: toPlaceholder }), /* @__PURE__ */ React134.createElement(SubjectField, null), /* @__PURE__ */ React134.createElement(MessageField, null), /* @__PURE__ */ React134.createElement(FromEmailField, null), /* @__PURE__ */ React134.createElement(AdvancedSettings, null)));
|
|
10813
10915
|
}
|
|
10814
10916
|
);
|
|
10815
|
-
var AdvancedSettings = () => /* @__PURE__ */
|
|
10917
|
+
var AdvancedSettings = () => /* @__PURE__ */ React134.createElement(CollapsibleContent, { defaultOpen: false }, /* @__PURE__ */ React134.createElement(Box37, { sx: { pt: 2 } }, /* @__PURE__ */ React134.createElement(Stack26, { gap: 2 }, /* @__PURE__ */ React134.createElement(FromNameField, null), /* @__PURE__ */ React134.createElement(ReplyToField, null), /* @__PURE__ */ React134.createElement(CcField, null), /* @__PURE__ */ React134.createElement(BccField, null), /* @__PURE__ */ React134.createElement(Divider7, null), /* @__PURE__ */ React134.createElement(MetaDataField, null), /* @__PURE__ */ React134.createElement(SendAsField, null))));
|
|
10816
10918
|
|
|
10817
10919
|
// src/controls/attachment-type-control.tsx
|
|
10818
|
-
import * as
|
|
10920
|
+
import * as React135 from "react";
|
|
10819
10921
|
import { InfoAlert as InfoAlert3 } from "@elementor/editor-ui";
|
|
10820
10922
|
import { Grid as Grid35 } from "@elementor/ui";
|
|
10821
|
-
import { __ as
|
|
10923
|
+
import { __ as __71 } from "@wordpress/i18n";
|
|
10822
10924
|
var AttachmentTypeControl = createControl(({ label, options }) => {
|
|
10823
|
-
return /* @__PURE__ */
|
|
10925
|
+
return /* @__PURE__ */ React135.createElement(Grid35, { container: true, direction: "column", gap: 1 }, label && /* @__PURE__ */ React135.createElement(Grid35, { item: true }, /* @__PURE__ */ React135.createElement(ControlFormLabel, null, label)), /* @__PURE__ */ React135.createElement(Grid35, { item: true }, /* @__PURE__ */ React135.createElement(SelectControl, { options })), /* @__PURE__ */ React135.createElement(Grid35, { item: true }, /* @__PURE__ */ React135.createElement(InfoAlert3, null, __71(
|
|
10824
10926
|
"Linked uploads are saved to the server. Direct attachments will not appear under Submissions.",
|
|
10825
10927
|
"elementor"
|
|
10826
10928
|
))));
|
|
10827
10929
|
});
|
|
10828
10930
|
|
|
10829
10931
|
// src/controls/grid-span-control.tsx
|
|
10830
|
-
import * as
|
|
10932
|
+
import * as React136 from "react";
|
|
10831
10933
|
import { spanPropTypeUtil } from "@elementor/editor-props";
|
|
10832
|
-
import { TextField as
|
|
10934
|
+
import { TextField as TextField14 } from "@elementor/ui";
|
|
10833
10935
|
var GridSpanControl = createControl(
|
|
10834
10936
|
({
|
|
10835
10937
|
placeholder: propPlaceholder,
|
|
@@ -10846,8 +10948,8 @@ var GridSpanControl = createControl(
|
|
|
10846
10948
|
setValue(next === "" ? null : next);
|
|
10847
10949
|
};
|
|
10848
10950
|
const placeholder = propPlaceholder ?? boundPlaceholder ?? `e.g: 'span 2' or '1 / 3'`;
|
|
10849
|
-
return /* @__PURE__ */
|
|
10850
|
-
|
|
10951
|
+
return /* @__PURE__ */ React136.createElement(ControlActions, null, /* @__PURE__ */ React136.createElement(
|
|
10952
|
+
TextField14,
|
|
10851
10953
|
{
|
|
10852
10954
|
size: "tiny",
|
|
10853
10955
|
fullWidth: true,
|
|
@@ -10867,14 +10969,14 @@ var GridSpanControl = createControl(
|
|
|
10867
10969
|
);
|
|
10868
10970
|
|
|
10869
10971
|
// src/components/promotions/display-conditions-control.tsx
|
|
10870
|
-
import * as
|
|
10871
|
-
import { useRef as
|
|
10972
|
+
import * as React138 from "react";
|
|
10973
|
+
import { useRef as useRef40 } from "react";
|
|
10872
10974
|
import { SitemapIcon } from "@elementor/icons";
|
|
10873
10975
|
import { IconButton as IconButton12, Stack as Stack27, Tooltip as Tooltip15 } from "@elementor/ui";
|
|
10874
|
-
import { __ as
|
|
10976
|
+
import { __ as __72 } from "@wordpress/i18n";
|
|
10875
10977
|
|
|
10876
10978
|
// src/components/promotions/promotion-trigger.tsx
|
|
10877
|
-
import * as
|
|
10979
|
+
import * as React137 from "react";
|
|
10878
10980
|
import { forwardRef as forwardRef14, useCallback as useCallback5, useImperativeHandle, useState as useState30 } from "react";
|
|
10879
10981
|
import { PromotionChip as PromotionChip2, PromotionInfotip } from "@elementor/editor-ui";
|
|
10880
10982
|
import { Box as Box38 } from "@elementor/ui";
|
|
@@ -10894,7 +10996,7 @@ var PromotionTrigger = forwardRef14(
|
|
|
10894
10996
|
});
|
|
10895
10997
|
}, [trackingData]);
|
|
10896
10998
|
useImperativeHandle(ref, () => ({ toggle }), [toggle]);
|
|
10897
|
-
return /* @__PURE__ */
|
|
10999
|
+
return /* @__PURE__ */ React137.createElement(React137.Fragment, null, promotion && /* @__PURE__ */ React137.createElement(
|
|
10898
11000
|
PromotionInfotip,
|
|
10899
11001
|
{
|
|
10900
11002
|
title: promotion.title,
|
|
@@ -10908,7 +11010,7 @@ var PromotionTrigger = forwardRef14(
|
|
|
10908
11010
|
},
|
|
10909
11011
|
onCtaClick: () => trackUpgradePromotionClick(trackingData)
|
|
10910
11012
|
},
|
|
10911
|
-
/* @__PURE__ */
|
|
11013
|
+
/* @__PURE__ */ React137.createElement(
|
|
10912
11014
|
Box38,
|
|
10913
11015
|
{
|
|
10914
11016
|
onClick: (e) => {
|
|
@@ -10917,18 +11019,18 @@ var PromotionTrigger = forwardRef14(
|
|
|
10917
11019
|
},
|
|
10918
11020
|
sx: { cursor: "pointer", display: "inline-flex" }
|
|
10919
11021
|
},
|
|
10920
|
-
children ?? /* @__PURE__ */
|
|
11022
|
+
children ?? /* @__PURE__ */ React137.createElement(PromotionChip2, null)
|
|
10921
11023
|
)
|
|
10922
11024
|
));
|
|
10923
11025
|
}
|
|
10924
11026
|
);
|
|
10925
11027
|
|
|
10926
11028
|
// src/components/promotions/display-conditions-control.tsx
|
|
10927
|
-
var ARIA_LABEL =
|
|
11029
|
+
var ARIA_LABEL = __72("Display Conditions", "elementor");
|
|
10928
11030
|
var TRACKING_DATA2 = { target_name: "display_conditions", location_l2: "general" };
|
|
10929
11031
|
var DisplayConditionsControl = createControl(() => {
|
|
10930
|
-
const triggerRef =
|
|
10931
|
-
return /* @__PURE__ */
|
|
11032
|
+
const triggerRef = useRef40(null);
|
|
11033
|
+
return /* @__PURE__ */ React138.createElement(
|
|
10932
11034
|
Stack27,
|
|
10933
11035
|
{
|
|
10934
11036
|
direction: "row",
|
|
@@ -10938,8 +11040,8 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
10938
11040
|
alignItems: "center"
|
|
10939
11041
|
}
|
|
10940
11042
|
},
|
|
10941
|
-
/* @__PURE__ */
|
|
10942
|
-
/* @__PURE__ */
|
|
11043
|
+
/* @__PURE__ */ React138.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "displayConditions", trackingData: TRACKING_DATA2 }),
|
|
11044
|
+
/* @__PURE__ */ React138.createElement(Tooltip15, { title: ARIA_LABEL, placement: "top" }, /* @__PURE__ */ React138.createElement(
|
|
10943
11045
|
IconButton12,
|
|
10944
11046
|
{
|
|
10945
11047
|
size: "tiny",
|
|
@@ -10952,22 +11054,22 @@ var DisplayConditionsControl = createControl(() => {
|
|
|
10952
11054
|
borderRadius: 1
|
|
10953
11055
|
}
|
|
10954
11056
|
},
|
|
10955
|
-
/* @__PURE__ */
|
|
11057
|
+
/* @__PURE__ */ React138.createElement(SitemapIcon, { fontSize: "tiny", color: "disabled" })
|
|
10956
11058
|
))
|
|
10957
11059
|
);
|
|
10958
11060
|
});
|
|
10959
11061
|
|
|
10960
11062
|
// src/components/promotions/attributes-control.tsx
|
|
10961
|
-
import * as
|
|
10962
|
-
import { useRef as
|
|
11063
|
+
import * as React139 from "react";
|
|
11064
|
+
import { useRef as useRef41 } from "react";
|
|
10963
11065
|
import { PlusIcon as PlusIcon4 } from "@elementor/icons";
|
|
10964
11066
|
import { Stack as Stack28, Tooltip as Tooltip16 } from "@elementor/ui";
|
|
10965
|
-
import { __ as
|
|
10966
|
-
var ARIA_LABEL2 =
|
|
11067
|
+
import { __ as __73 } from "@wordpress/i18n";
|
|
11068
|
+
var ARIA_LABEL2 = __73("Attributes", "elementor");
|
|
10967
11069
|
var TRACKING_DATA3 = { target_name: "attributes", location_l2: "general" };
|
|
10968
11070
|
var AttributesControl = createControl(() => {
|
|
10969
|
-
const triggerRef =
|
|
10970
|
-
return /* @__PURE__ */
|
|
11071
|
+
const triggerRef = useRef41(null);
|
|
11072
|
+
return /* @__PURE__ */ React139.createElement(
|
|
10971
11073
|
Stack28,
|
|
10972
11074
|
{
|
|
10973
11075
|
direction: "row",
|
|
@@ -10977,8 +11079,8 @@ var AttributesControl = createControl(() => {
|
|
|
10977
11079
|
alignItems: "center"
|
|
10978
11080
|
}
|
|
10979
11081
|
},
|
|
10980
|
-
/* @__PURE__ */
|
|
10981
|
-
/* @__PURE__ */
|
|
11082
|
+
/* @__PURE__ */ React139.createElement(PromotionTrigger, { ref: triggerRef, promotionKey: "attributes", trackingData: TRACKING_DATA3 }),
|
|
11083
|
+
/* @__PURE__ */ React139.createElement(Tooltip16, { title: ARIA_LABEL2, placement: "top" }, /* @__PURE__ */ React139.createElement(
|
|
10982
11084
|
PlusIcon4,
|
|
10983
11085
|
{
|
|
10984
11086
|
"aria-label": ARIA_LABEL2,
|
|
@@ -10992,17 +11094,17 @@ var AttributesControl = createControl(() => {
|
|
|
10992
11094
|
});
|
|
10993
11095
|
|
|
10994
11096
|
// src/components/icon-buttons/clear-icon-button.tsx
|
|
10995
|
-
import * as
|
|
11097
|
+
import * as React140 from "react";
|
|
10996
11098
|
import { BrushBigIcon } from "@elementor/icons";
|
|
10997
11099
|
import { IconButton as IconButton13, styled as styled14, Tooltip as Tooltip17 } from "@elementor/ui";
|
|
10998
11100
|
var CustomIconButton = styled14(IconButton13)(({ theme }) => ({
|
|
10999
11101
|
width: theme.spacing(2.5),
|
|
11000
11102
|
height: theme.spacing(2.5)
|
|
11001
11103
|
}));
|
|
11002
|
-
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */
|
|
11104
|
+
var ClearIconButton = ({ tooltipText, onClick, disabled, size = "tiny" }) => /* @__PURE__ */ React140.createElement(Tooltip17, { title: tooltipText, placement: "top", disableInteractive: true }, /* @__PURE__ */ React140.createElement(CustomIconButton, { "aria-label": tooltipText, size, onClick, disabled }, /* @__PURE__ */ React140.createElement(BrushBigIcon, { fontSize: size })));
|
|
11003
11105
|
|
|
11004
11106
|
// src/components/repeater/repeater.tsx
|
|
11005
|
-
import * as
|
|
11107
|
+
import * as React141 from "react";
|
|
11006
11108
|
import { useEffect as useEffect23, useState as useState31 } from "react";
|
|
11007
11109
|
import { CopyIcon as CopyIcon2, EyeIcon as EyeIcon2, EyeOffIcon as EyeOffIcon2, PlusIcon as PlusIcon5, XIcon as XIcon4 } from "@elementor/icons";
|
|
11008
11110
|
import {
|
|
@@ -11014,8 +11116,8 @@ import {
|
|
|
11014
11116
|
Tooltip as Tooltip18,
|
|
11015
11117
|
usePopupState as usePopupState13
|
|
11016
11118
|
} from "@elementor/ui";
|
|
11017
|
-
import { __ as
|
|
11018
|
-
var
|
|
11119
|
+
import { __ as __74 } from "@wordpress/i18n";
|
|
11120
|
+
var SIZE13 = "tiny";
|
|
11019
11121
|
var EMPTY_OPEN_ITEM2 = -1;
|
|
11020
11122
|
var Repeater3 = ({
|
|
11021
11123
|
label,
|
|
@@ -11096,20 +11198,20 @@ var Repeater3 = ({
|
|
|
11096
11198
|
};
|
|
11097
11199
|
const isButtonDisabled = disabled || disableAddItemButton;
|
|
11098
11200
|
const shouldShowInfotip = isButtonDisabled && addButtonInfotipContent;
|
|
11099
|
-
const addButton = /* @__PURE__ */
|
|
11201
|
+
const addButton = /* @__PURE__ */ React141.createElement(
|
|
11100
11202
|
IconButton14,
|
|
11101
11203
|
{
|
|
11102
|
-
size:
|
|
11204
|
+
size: SIZE13,
|
|
11103
11205
|
sx: {
|
|
11104
11206
|
ml: "auto"
|
|
11105
11207
|
},
|
|
11106
11208
|
disabled: isButtonDisabled,
|
|
11107
11209
|
onClick: addRepeaterItem,
|
|
11108
|
-
"aria-label":
|
|
11210
|
+
"aria-label": __74("Add item", "elementor")
|
|
11109
11211
|
},
|
|
11110
|
-
/* @__PURE__ */
|
|
11212
|
+
/* @__PURE__ */ React141.createElement(PlusIcon5, { fontSize: SIZE13 })
|
|
11111
11213
|
);
|
|
11112
|
-
return /* @__PURE__ */
|
|
11214
|
+
return /* @__PURE__ */ React141.createElement(SectionContent, { gap: 2 }, /* @__PURE__ */ React141.createElement(RepeaterHeader, { label, adornment }, shouldShowInfotip ? /* @__PURE__ */ React141.createElement(
|
|
11113
11215
|
Infotip5,
|
|
11114
11216
|
{
|
|
11115
11217
|
placement: "right",
|
|
@@ -11117,20 +11219,20 @@ var Repeater3 = ({
|
|
|
11117
11219
|
color: "secondary",
|
|
11118
11220
|
slotProps: { popper: { sx: { width: 300 } } }
|
|
11119
11221
|
},
|
|
11120
|
-
/* @__PURE__ */
|
|
11121
|
-
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */
|
|
11222
|
+
/* @__PURE__ */ React141.createElement(Box39, { sx: { ...isButtonDisabled ? { cursor: "not-allowed" } : {} } }, addButton)
|
|
11223
|
+
) : addButton), 0 < uniqueKeys.length && /* @__PURE__ */ React141.createElement(SortableProvider, { value: uniqueKeys, onChange: onChangeOrder }, uniqueKeys.map((key) => {
|
|
11122
11224
|
const index = uniqueKeys.indexOf(key);
|
|
11123
11225
|
const value = items2[index];
|
|
11124
11226
|
if (!value) {
|
|
11125
11227
|
return null;
|
|
11126
11228
|
}
|
|
11127
|
-
return /* @__PURE__ */
|
|
11229
|
+
return /* @__PURE__ */ React141.createElement(SortableItem, { id: key, key: `sortable-${key}`, disabled: !isSortable }, /* @__PURE__ */ React141.createElement(
|
|
11128
11230
|
RepeaterItem,
|
|
11129
11231
|
{
|
|
11130
11232
|
disabled,
|
|
11131
11233
|
propDisabled: value?.disabled,
|
|
11132
|
-
label: /* @__PURE__ */
|
|
11133
|
-
startIcon: /* @__PURE__ */
|
|
11234
|
+
label: /* @__PURE__ */ React141.createElement(RepeaterItemLabelSlot, { value }, /* @__PURE__ */ React141.createElement(itemSettings.Label, { value, index })),
|
|
11235
|
+
startIcon: /* @__PURE__ */ React141.createElement(RepeaterItemIconSlot, { value }, /* @__PURE__ */ React141.createElement(itemSettings.Icon, { value })),
|
|
11134
11236
|
removeItem: () => removeRepeaterItem(index),
|
|
11135
11237
|
duplicateItem: () => duplicateRepeaterItem(index),
|
|
11136
11238
|
toggleDisableItem: () => toggleDisableRepeaterItem(index),
|
|
@@ -11144,7 +11246,7 @@ var Repeater3 = ({
|
|
|
11144
11246
|
actions: itemSettings.actions,
|
|
11145
11247
|
value
|
|
11146
11248
|
},
|
|
11147
|
-
(props) => /* @__PURE__ */
|
|
11249
|
+
(props) => /* @__PURE__ */ React141.createElement(
|
|
11148
11250
|
itemSettings.Content,
|
|
11149
11251
|
{
|
|
11150
11252
|
...props,
|
|
@@ -11186,16 +11288,16 @@ var RepeaterItem = ({
|
|
|
11186
11288
|
);
|
|
11187
11289
|
const triggerProps = bindTrigger7(popoverState);
|
|
11188
11290
|
usePopoverDismiss({ isOpen: popoverState.isOpen, onClose: popoverProps.onClose });
|
|
11189
|
-
const duplicateLabel =
|
|
11190
|
-
const toggleLabel = propDisabled ?
|
|
11191
|
-
const removeLabel =
|
|
11192
|
-
return /* @__PURE__ */
|
|
11291
|
+
const duplicateLabel = __74("Duplicate", "elementor");
|
|
11292
|
+
const toggleLabel = propDisabled ? __74("Show", "elementor") : __74("Hide", "elementor");
|
|
11293
|
+
const removeLabel = __74("Remove", "elementor");
|
|
11294
|
+
return /* @__PURE__ */ React141.createElement(Box39, { sx: { display: "contents" } }, /* @__PURE__ */ React141.createElement(
|
|
11193
11295
|
RepeaterTag,
|
|
11194
11296
|
{
|
|
11195
11297
|
disabled,
|
|
11196
11298
|
label,
|
|
11197
11299
|
ref: setRef,
|
|
11198
|
-
"aria-label":
|
|
11300
|
+
"aria-label": __74("Open item", "elementor"),
|
|
11199
11301
|
...triggerProps,
|
|
11200
11302
|
onClick: (e) => {
|
|
11201
11303
|
triggerProps.onClick(e);
|
|
@@ -11204,9 +11306,9 @@ var RepeaterItem = ({
|
|
|
11204
11306
|
}
|
|
11205
11307
|
},
|
|
11206
11308
|
startIcon,
|
|
11207
|
-
actions: /* @__PURE__ */
|
|
11309
|
+
actions: /* @__PURE__ */ React141.createElement(React141.Fragment, null, showDuplicate && /* @__PURE__ */ React141.createElement(Tooltip18, { title: duplicateLabel, placement: "top" }, /* @__PURE__ */ React141.createElement(IconButton14, { size: SIZE13, onClick: duplicateItem, "aria-label": duplicateLabel }, /* @__PURE__ */ React141.createElement(CopyIcon2, { fontSize: SIZE13 }))), showToggle && /* @__PURE__ */ React141.createElement(Tooltip18, { title: toggleLabel, placement: "top" }, /* @__PURE__ */ React141.createElement(IconButton14, { size: SIZE13, onClick: toggleDisableItem, "aria-label": toggleLabel }, propDisabled ? /* @__PURE__ */ React141.createElement(EyeOffIcon2, { fontSize: SIZE13 }) : /* @__PURE__ */ React141.createElement(EyeIcon2, { fontSize: SIZE13 }))), actions?.(value), showRemove && /* @__PURE__ */ React141.createElement(Tooltip18, { title: removeLabel, placement: "top" }, /* @__PURE__ */ React141.createElement(IconButton14, { size: SIZE13, onClick: removeItem, "aria-label": removeLabel }, /* @__PURE__ */ React141.createElement(XIcon4, { fontSize: SIZE13 }))))
|
|
11208
11310
|
}
|
|
11209
|
-
), /* @__PURE__ */
|
|
11311
|
+
), /* @__PURE__ */ React141.createElement(RepeaterPopover, { width: ref?.getBoundingClientRect().width, ...popoverProps, anchorEl: ref }, /* @__PURE__ */ React141.createElement(Box39, null, children({ anchorEl: ref }))));
|
|
11210
11312
|
};
|
|
11211
11313
|
var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
11212
11314
|
const [ref, setRef] = useState31(null);
|
|
@@ -11231,7 +11333,7 @@ var usePopover = (openOnMount, onOpen, onPopoverClose) => {
|
|
|
11231
11333
|
};
|
|
11232
11334
|
|
|
11233
11335
|
// src/components/size/unstable-size-field.tsx
|
|
11234
|
-
import * as
|
|
11336
|
+
import * as React144 from "react";
|
|
11235
11337
|
import { InputAdornment as InputAdornment6 } from "@elementor/ui";
|
|
11236
11338
|
|
|
11237
11339
|
// src/hooks/use-size-value.ts
|
|
@@ -11274,7 +11376,7 @@ var differsFromExternal = (newState, externalState) => {
|
|
|
11274
11376
|
};
|
|
11275
11377
|
|
|
11276
11378
|
// src/components/size/unit-select.tsx
|
|
11277
|
-
import * as
|
|
11379
|
+
import * as React142 from "react";
|
|
11278
11380
|
import { useId as useId5 } from "react";
|
|
11279
11381
|
import { MenuListItem as MenuListItem8 } from "@elementor/editor-ui";
|
|
11280
11382
|
import { bindMenu as bindMenu4, bindTrigger as bindTrigger8, Button as Button7, Menu as Menu5, styled as styled15, usePopupState as usePopupState14 } from "@elementor/ui";
|
|
@@ -11292,7 +11394,7 @@ var UnitSelect = ({ value, showPrimaryColor, onClick, options }) => {
|
|
|
11292
11394
|
onClick(options[index]);
|
|
11293
11395
|
popupState.close();
|
|
11294
11396
|
};
|
|
11295
|
-
return /* @__PURE__ */
|
|
11397
|
+
return /* @__PURE__ */ React142.createElement(React142.Fragment, null, /* @__PURE__ */ React142.createElement(StyledButton3, { isPrimaryColor: showPrimaryColor, size: "small", ...bindTrigger8(popupState) }, value), /* @__PURE__ */ React142.createElement(Menu5, { MenuListProps: { dense: true }, ...bindMenu4(popupState) }, options.map((option, index) => /* @__PURE__ */ React142.createElement(
|
|
11296
11398
|
MenuListItem8,
|
|
11297
11399
|
{
|
|
11298
11400
|
key: option,
|
|
@@ -11321,11 +11423,11 @@ var StyledButton3 = styled15(Button7, {
|
|
|
11321
11423
|
}));
|
|
11322
11424
|
|
|
11323
11425
|
// src/components/size/unstable-size-input.tsx
|
|
11324
|
-
import * as
|
|
11426
|
+
import * as React143 from "react";
|
|
11325
11427
|
import { forwardRef as forwardRef15 } from "react";
|
|
11326
11428
|
var UnstableSizeInput = forwardRef15(
|
|
11327
11429
|
({ type, value, onChange, onKeyDown, onKeyUp, InputProps, onBlur, focused, disabled }, ref) => {
|
|
11328
|
-
return /* @__PURE__ */
|
|
11430
|
+
return /* @__PURE__ */ React143.createElement(
|
|
11329
11431
|
NumberInput,
|
|
11330
11432
|
{
|
|
11331
11433
|
ref,
|
|
@@ -11363,7 +11465,7 @@ var UnstableSizeField = ({
|
|
|
11363
11465
|
const shouldHighlightUnit2 = () => {
|
|
11364
11466
|
return hasValue(size);
|
|
11365
11467
|
};
|
|
11366
|
-
return /* @__PURE__ */
|
|
11468
|
+
return /* @__PURE__ */ React144.createElement(
|
|
11367
11469
|
UnstableSizeInput,
|
|
11368
11470
|
{
|
|
11369
11471
|
type: "number",
|
|
@@ -11372,8 +11474,8 @@ var UnstableSizeField = ({
|
|
|
11372
11474
|
onChange: (event) => setSize(event.target.value),
|
|
11373
11475
|
InputProps: {
|
|
11374
11476
|
...InputProps,
|
|
11375
|
-
startAdornment: startIcon && /* @__PURE__ */
|
|
11376
|
-
endAdornment: /* @__PURE__ */
|
|
11477
|
+
startAdornment: startIcon && /* @__PURE__ */ React144.createElement(InputAdornment6, { position: "start" }, startIcon),
|
|
11478
|
+
endAdornment: /* @__PURE__ */ React144.createElement(InputAdornment6, { position: "end" }, /* @__PURE__ */ React144.createElement(
|
|
11377
11479
|
UnitSelect,
|
|
11378
11480
|
{
|
|
11379
11481
|
options: units2,
|
|
@@ -11391,7 +11493,7 @@ var hasValue = (value) => {
|
|
|
11391
11493
|
};
|
|
11392
11494
|
|
|
11393
11495
|
// src/hooks/use-font-families.ts
|
|
11394
|
-
import { useMemo as
|
|
11496
|
+
import { useMemo as useMemo22 } from "react";
|
|
11395
11497
|
import { getElementorConfig } from "@elementor/editor-v1-adapters";
|
|
11396
11498
|
var getFontControlConfig = () => {
|
|
11397
11499
|
const { controls } = getElementorConfig();
|
|
@@ -11399,7 +11501,7 @@ var getFontControlConfig = () => {
|
|
|
11399
11501
|
};
|
|
11400
11502
|
var useFontFamilies = () => {
|
|
11401
11503
|
const { groups, options } = getFontControlConfig();
|
|
11402
|
-
return
|
|
11504
|
+
return useMemo22(() => {
|
|
11403
11505
|
if (!groups || !options) {
|
|
11404
11506
|
return [];
|
|
11405
11507
|
}
|
|
@@ -11470,6 +11572,7 @@ export {
|
|
|
11470
11572
|
QueryChipsControl,
|
|
11471
11573
|
QueryControl,
|
|
11472
11574
|
QueryFilterRepeaterControl,
|
|
11575
|
+
QuerySelectControl,
|
|
11473
11576
|
RepeatableControl,
|
|
11474
11577
|
Repeater3 as Repeater,
|
|
11475
11578
|
SelectControl,
|