@elementor/editor-variables 4.0.0-501 → 4.0.0-503
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.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/hooks/use-prop-variable-action.tsx +2 -1
package/dist/index.js
CHANGED
|
@@ -42,7 +42,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
42
42
|
|
|
43
43
|
// src/init.ts
|
|
44
44
|
var import_editor = require("@elementor/editor");
|
|
45
|
-
var
|
|
45
|
+
var import_editor_editing_panel3 = require("@elementor/editor-editing-panel");
|
|
46
46
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
47
47
|
var import_editor_props7 = require("@elementor/editor-props");
|
|
48
48
|
|
|
@@ -3380,11 +3380,11 @@ var VariableControl = () => {
|
|
|
3380
3380
|
|
|
3381
3381
|
// src/hooks/use-prop-variable-action.tsx
|
|
3382
3382
|
var React32 = __toESM(require("react"));
|
|
3383
|
-
var
|
|
3383
|
+
var import_editor_controls12 = require("@elementor/editor-controls");
|
|
3384
3384
|
var import_icons14 = require("@elementor/icons");
|
|
3385
3385
|
var import_i18n23 = require("@wordpress/i18n");
|
|
3386
3386
|
var usePropVariableAction = () => {
|
|
3387
|
-
const { propType, path } = (0,
|
|
3387
|
+
const { propType, path } = (0, import_editor_controls12.useBoundProp)();
|
|
3388
3388
|
const variable = resolveVariableFromPropType(propType);
|
|
3389
3389
|
return {
|
|
3390
3390
|
visible: Boolean(variable),
|
|
@@ -3588,8 +3588,8 @@ var ColorField = ({ value, onChange, onValidationChange }) => {
|
|
|
3588
3588
|
// src/components/fields/font-field.tsx
|
|
3589
3589
|
var React34 = __toESM(require("react"));
|
|
3590
3590
|
var import_react24 = require("react");
|
|
3591
|
-
var
|
|
3592
|
-
var
|
|
3591
|
+
var import_editor_controls13 = require("@elementor/editor-controls");
|
|
3592
|
+
var import_editor_editing_panel2 = require("@elementor/editor-editing-panel");
|
|
3593
3593
|
var import_editor_ui12 = require("@elementor/editor-ui");
|
|
3594
3594
|
var import_icons15 = require("@elementor/icons");
|
|
3595
3595
|
var import_ui32 = require("@elementor/ui");
|
|
@@ -3599,7 +3599,7 @@ var FontField = ({ value, onChange, onValidationChange }) => {
|
|
|
3599
3599
|
const defaultRef = (0, import_react24.useRef)(null);
|
|
3600
3600
|
const anchorRef = usePopoverContentRef() ?? defaultRef.current;
|
|
3601
3601
|
const fontPopoverState = (0, import_ui32.usePopupState)({ variant: "popover" });
|
|
3602
|
-
const fontFamilies = (0,
|
|
3602
|
+
const fontFamilies = (0, import_editor_editing_panel2.useFontFamilies)();
|
|
3603
3603
|
const sectionWidth = (0, import_editor_ui12.useSectionWidth)();
|
|
3604
3604
|
const mapFontSubs = React34.useMemo(() => {
|
|
3605
3605
|
return fontFamilies.map(({ label, fonts }) => ({
|
|
@@ -3639,7 +3639,7 @@ var FontField = ({ value, onChange, onValidationChange }) => {
|
|
|
3639
3639
|
...(0, import_ui32.bindPopover)(fontPopoverState)
|
|
3640
3640
|
},
|
|
3641
3641
|
/* @__PURE__ */ React34.createElement(
|
|
3642
|
-
|
|
3642
|
+
import_editor_controls13.ItemSelector,
|
|
3643
3643
|
{
|
|
3644
3644
|
id: "font-family-variables-selector",
|
|
3645
3645
|
itemsList: mapFontSubs,
|
|
@@ -3649,7 +3649,7 @@ var FontField = ({ value, onChange, onValidationChange }) => {
|
|
|
3649
3649
|
sectionWidth,
|
|
3650
3650
|
title: (0, import_i18n24.__)("Font family", "elementor"),
|
|
3651
3651
|
itemStyle: (item) => ({ fontFamily: item.value }),
|
|
3652
|
-
onDebounce:
|
|
3652
|
+
onDebounce: import_editor_controls13.enqueueFont,
|
|
3653
3653
|
icon: import_icons15.TextIcon
|
|
3654
3654
|
}
|
|
3655
3655
|
)
|
|
@@ -3750,7 +3750,7 @@ function convertToCssVariables(variables) {
|
|
|
3750
3750
|
}
|
|
3751
3751
|
|
|
3752
3752
|
// src/repeater-injections.ts
|
|
3753
|
-
var
|
|
3753
|
+
var import_editor_controls14 = require("@elementor/editor-controls");
|
|
3754
3754
|
var import_editor_props6 = require("@elementor/editor-props");
|
|
3755
3755
|
|
|
3756
3756
|
// src/components/variables-repeater-item-slot.tsx
|
|
@@ -3774,21 +3774,21 @@ var BoxShadowRepeaterColorIndicator = ({ value }) => {
|
|
|
3774
3774
|
|
|
3775
3775
|
// src/repeater-injections.ts
|
|
3776
3776
|
function registerRepeaterInjections() {
|
|
3777
|
-
(0,
|
|
3777
|
+
(0, import_editor_controls14.injectIntoRepeaterItemIcon)({
|
|
3778
3778
|
id: "color-variables-background-icon",
|
|
3779
3779
|
component: BackgroundRepeaterColorIndicator,
|
|
3780
3780
|
condition: ({ value: prop }) => {
|
|
3781
3781
|
return hasAssignedColorVariable(import_editor_props6.backgroundColorOverlayPropTypeUtil.extract(prop)?.color);
|
|
3782
3782
|
}
|
|
3783
3783
|
});
|
|
3784
|
-
(0,
|
|
3784
|
+
(0, import_editor_controls14.injectIntoRepeaterItemIcon)({
|
|
3785
3785
|
id: "color-variables-icon",
|
|
3786
3786
|
component: BoxShadowRepeaterColorIndicator,
|
|
3787
3787
|
condition: ({ value: prop }) => {
|
|
3788
3788
|
return hasAssignedColorVariable(import_editor_props6.shadowPropTypeUtil.extract(prop)?.color);
|
|
3789
3789
|
}
|
|
3790
3790
|
});
|
|
3791
|
-
(0,
|
|
3791
|
+
(0, import_editor_controls14.injectIntoRepeaterItemLabel)({
|
|
3792
3792
|
id: "color-variables-label",
|
|
3793
3793
|
component: BackgroundRepeaterLabel,
|
|
3794
3794
|
condition: ({ value: prop }) => {
|
|
@@ -3801,11 +3801,11 @@ var hasAssignedColorVariable = (propValue) => {
|
|
|
3801
3801
|
};
|
|
3802
3802
|
|
|
3803
3803
|
// src/init.ts
|
|
3804
|
-
var { registerPopoverAction } =
|
|
3804
|
+
var { registerPopoverAction } = import_editor_editing_panel3.controlActionsMenu;
|
|
3805
3805
|
function init() {
|
|
3806
3806
|
registerVariableTypes();
|
|
3807
3807
|
registerRepeaterInjections();
|
|
3808
|
-
(0,
|
|
3808
|
+
(0, import_editor_editing_panel3.registerControlReplacement)({
|
|
3809
3809
|
component: VariableControl,
|
|
3810
3810
|
condition: ({ value, placeholder }) => {
|
|
3811
3811
|
if (hasVariableAssigned(value)) {
|