@elementor/editor-variables 4.0.0-499 → 4.0.0-501
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 +21 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/fields/font-field.tsx +2 -1
- package/src/components/variable-creation.tsx +3 -4
- package/src/components/variable-edit.tsx +3 -4
- package/src/components/variable-restore.tsx +3 -4
- package/src/components/variables-selection.tsx +3 -3
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_panel4 = 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
|
|
|
@@ -2080,7 +2080,6 @@ var usePopoverContentRef = () => {
|
|
|
2080
2080
|
var React15 = __toESM(require("react"));
|
|
2081
2081
|
var import_react13 = require("react");
|
|
2082
2082
|
var import_editor_controls4 = require("@elementor/editor-controls");
|
|
2083
|
-
var import_editor_editing_panel2 = require("@elementor/editor-editing-panel");
|
|
2084
2083
|
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
2085
2084
|
var import_icons6 = require("@elementor/icons");
|
|
2086
2085
|
var import_ui15 = require("@elementor/ui");
|
|
@@ -2201,7 +2200,7 @@ var VariableCreation = ({ onGoBack, onClose }) => {
|
|
|
2201
2200
|
handleCreateAndTrack();
|
|
2202
2201
|
}
|
|
2203
2202
|
};
|
|
2204
|
-
return /* @__PURE__ */ React15.createElement(
|
|
2203
|
+
return /* @__PURE__ */ React15.createElement(import_editor_ui6.SectionPopoverBody, { height: "auto" }, /* @__PURE__ */ React15.createElement(
|
|
2205
2204
|
import_editor_ui6.PopoverHeader,
|
|
2206
2205
|
{
|
|
2207
2206
|
icon: /* @__PURE__ */ React15.createElement(React15.Fragment, null, onGoBack && /* @__PURE__ */ React15.createElement(import_ui15.IconButton, { size: SIZE2, "aria-label": (0, import_i18n10.__)("Go Back", "elementor"), onClick: onGoBack }, /* @__PURE__ */ React15.createElement(import_icons6.ArrowLeftIcon, { fontSize: SIZE2 })), /* @__PURE__ */ React15.createElement(VariableIcon, { fontSize: SIZE2 })),
|
|
@@ -2267,7 +2266,6 @@ var React17 = __toESM(require("react"));
|
|
|
2267
2266
|
var import_react15 = require("react");
|
|
2268
2267
|
var import_editor_controls5 = require("@elementor/editor-controls");
|
|
2269
2268
|
var import_editor_current_user2 = require("@elementor/editor-current-user");
|
|
2270
|
-
var import_editor_editing_panel3 = require("@elementor/editor-editing-panel");
|
|
2271
2269
|
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
2272
2270
|
var import_icons8 = require("@elementor/icons");
|
|
2273
2271
|
var import_ui17 = require("@elementor/ui");
|
|
@@ -2419,7 +2417,7 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2419
2417
|
handleUpdate();
|
|
2420
2418
|
}
|
|
2421
2419
|
};
|
|
2422
|
-
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(
|
|
2420
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(import_editor_ui7.SectionPopoverBody, { height: "auto" }, /* @__PURE__ */ React17.createElement(
|
|
2423
2421
|
import_editor_ui7.PopoverHeader,
|
|
2424
2422
|
{
|
|
2425
2423
|
title: (0, import_i18n12.__)("Edit variable", "elementor"),
|
|
@@ -2498,8 +2496,8 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2498
2496
|
// src/components/variables-selection.tsx
|
|
2499
2497
|
var React19 = __toESM(require("react"));
|
|
2500
2498
|
var import_react16 = require("react");
|
|
2501
|
-
var import_editor_editing_panel4 = require("@elementor/editor-editing-panel");
|
|
2502
2499
|
var import_editor_ui9 = require("@elementor/editor-ui");
|
|
2500
|
+
var import_editor_ui10 = require("@elementor/editor-ui");
|
|
2503
2501
|
var import_icons10 = require("@elementor/icons");
|
|
2504
2502
|
var import_ui20 = require("@elementor/ui");
|
|
2505
2503
|
var import_i18n14 = require("@wordpress/i18n");
|
|
@@ -2677,8 +2675,8 @@ var VariablesSelection = ({ closePopover, onAdd, onEdit, onSettings, disabled =
|
|
|
2677
2675
|
const handleClearSearch = () => {
|
|
2678
2676
|
setSearchValue("");
|
|
2679
2677
|
};
|
|
2680
|
-
return /* @__PURE__ */ React19.createElement(
|
|
2681
|
-
|
|
2678
|
+
return /* @__PURE__ */ React19.createElement(import_editor_ui9.SectionPopoverBody, null, /* @__PURE__ */ React19.createElement(
|
|
2679
|
+
import_editor_ui10.PopoverHeader,
|
|
2682
2680
|
{
|
|
2683
2681
|
title: (0, import_i18n14.__)("Variables", "elementor"),
|
|
2684
2682
|
icon: /* @__PURE__ */ React19.createElement(import_icons10.ColorFilterIcon, { fontSize: SIZE5 }),
|
|
@@ -2686,14 +2684,14 @@ var VariablesSelection = ({ closePopover, onAdd, onEdit, onSettings, disabled =
|
|
|
2686
2684
|
actions
|
|
2687
2685
|
}
|
|
2688
2686
|
), hasVariables && /* @__PURE__ */ React19.createElement(
|
|
2689
|
-
|
|
2687
|
+
import_editor_ui10.SearchField,
|
|
2690
2688
|
{
|
|
2691
2689
|
value: searchValue,
|
|
2692
2690
|
onSearch: handleSearch,
|
|
2693
2691
|
placeholder: (0, import_i18n14.__)("Search", "elementor")
|
|
2694
2692
|
}
|
|
2695
2693
|
), /* @__PURE__ */ React19.createElement(import_ui20.Divider, null), hasVariables && hasSearchResults && /* @__PURE__ */ React19.createElement(
|
|
2696
|
-
|
|
2694
|
+
import_editor_ui10.PopoverMenuList,
|
|
2697
2695
|
{
|
|
2698
2696
|
items,
|
|
2699
2697
|
onSelect: handleSetVariable,
|
|
@@ -2923,8 +2921,7 @@ var import_i18n18 = require("@wordpress/i18n");
|
|
|
2923
2921
|
var React23 = __toESM(require("react"));
|
|
2924
2922
|
var import_react19 = require("react");
|
|
2925
2923
|
var import_editor_controls7 = require("@elementor/editor-controls");
|
|
2926
|
-
var
|
|
2927
|
-
var import_editor_ui10 = require("@elementor/editor-ui");
|
|
2924
|
+
var import_editor_ui11 = require("@elementor/editor-ui");
|
|
2928
2925
|
var import_ui23 = require("@elementor/ui");
|
|
2929
2926
|
var import_i18n16 = require("@wordpress/i18n");
|
|
2930
2927
|
var SIZE7 = "tiny";
|
|
@@ -2986,8 +2983,8 @@ var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
|
2986
2983
|
handleRestore();
|
|
2987
2984
|
}
|
|
2988
2985
|
};
|
|
2989
|
-
return /* @__PURE__ */ React23.createElement(PopoverContentRefContextProvider, null, /* @__PURE__ */ React23.createElement(
|
|
2990
|
-
|
|
2986
|
+
return /* @__PURE__ */ React23.createElement(PopoverContentRefContextProvider, null, /* @__PURE__ */ React23.createElement(import_editor_ui11.SectionPopoverBody, { height: "auto" }, /* @__PURE__ */ React23.createElement(
|
|
2987
|
+
import_editor_ui11.PopoverHeader,
|
|
2991
2988
|
{
|
|
2992
2989
|
icon: /* @__PURE__ */ React23.createElement(VariableIcon, { fontSize: SIZE7 }),
|
|
2993
2990
|
title: (0, import_i18n16.__)("Restore variable", "elementor"),
|
|
@@ -3383,11 +3380,11 @@ var VariableControl = () => {
|
|
|
3383
3380
|
|
|
3384
3381
|
// src/hooks/use-prop-variable-action.tsx
|
|
3385
3382
|
var React32 = __toESM(require("react"));
|
|
3386
|
-
var
|
|
3383
|
+
var import_editor_editing_panel2 = require("@elementor/editor-editing-panel");
|
|
3387
3384
|
var import_icons14 = require("@elementor/icons");
|
|
3388
3385
|
var import_i18n23 = require("@wordpress/i18n");
|
|
3389
3386
|
var usePropVariableAction = () => {
|
|
3390
|
-
const { propType, path } = (0,
|
|
3387
|
+
const { propType, path } = (0, import_editor_editing_panel2.useBoundProp)();
|
|
3391
3388
|
const variable = resolveVariableFromPropType(propType);
|
|
3392
3389
|
return {
|
|
3393
3390
|
visible: Boolean(variable),
|
|
@@ -3541,7 +3538,7 @@ function initMcp() {
|
|
|
3541
3538
|
// src/register-variable-types.tsx
|
|
3542
3539
|
var React35 = __toESM(require("react"));
|
|
3543
3540
|
var import_editor_props5 = require("@elementor/editor-props");
|
|
3544
|
-
var
|
|
3541
|
+
var import_editor_ui13 = require("@elementor/editor-ui");
|
|
3545
3542
|
var import_icons16 = require("@elementor/icons");
|
|
3546
3543
|
|
|
3547
3544
|
// src/components/fields/color-field.tsx
|
|
@@ -3592,7 +3589,8 @@ var ColorField = ({ value, onChange, onValidationChange }) => {
|
|
|
3592
3589
|
var React34 = __toESM(require("react"));
|
|
3593
3590
|
var import_react24 = require("react");
|
|
3594
3591
|
var import_editor_controls12 = require("@elementor/editor-controls");
|
|
3595
|
-
var
|
|
3592
|
+
var import_editor_editing_panel3 = require("@elementor/editor-editing-panel");
|
|
3593
|
+
var import_editor_ui12 = require("@elementor/editor-ui");
|
|
3596
3594
|
var import_icons15 = require("@elementor/icons");
|
|
3597
3595
|
var import_ui32 = require("@elementor/ui");
|
|
3598
3596
|
var import_i18n24 = require("@wordpress/i18n");
|
|
@@ -3601,8 +3599,8 @@ var FontField = ({ value, onChange, onValidationChange }) => {
|
|
|
3601
3599
|
const defaultRef = (0, import_react24.useRef)(null);
|
|
3602
3600
|
const anchorRef = usePopoverContentRef() ?? defaultRef.current;
|
|
3603
3601
|
const fontPopoverState = (0, import_ui32.usePopupState)({ variant: "popover" });
|
|
3604
|
-
const fontFamilies = (0,
|
|
3605
|
-
const sectionWidth = (0,
|
|
3602
|
+
const fontFamilies = (0, import_editor_editing_panel3.useFontFamilies)();
|
|
3603
|
+
const sectionWidth = (0, import_editor_ui12.useSectionWidth)();
|
|
3606
3604
|
const mapFontSubs = React34.useMemo(() => {
|
|
3607
3605
|
return fontFamilies.map(({ label, fonts }) => ({
|
|
3608
3606
|
label,
|
|
@@ -3698,7 +3696,7 @@ function registerVariableTypes() {
|
|
|
3698
3696
|
styleTransformer: EmptyTransformer,
|
|
3699
3697
|
variableType: "size",
|
|
3700
3698
|
selectionFilter: () => [],
|
|
3701
|
-
emptyState: /* @__PURE__ */ React35.createElement(
|
|
3699
|
+
emptyState: /* @__PURE__ */ React35.createElement(import_editor_ui13.CtaButton, { size: "small", href: "https://go.elementor.com/go-pro-panel-size-variable/" })
|
|
3702
3700
|
};
|
|
3703
3701
|
registerVariableType({
|
|
3704
3702
|
...sizePromotions,
|
|
@@ -3803,11 +3801,11 @@ var hasAssignedColorVariable = (propValue) => {
|
|
|
3803
3801
|
};
|
|
3804
3802
|
|
|
3805
3803
|
// src/init.ts
|
|
3806
|
-
var { registerPopoverAction } =
|
|
3804
|
+
var { registerPopoverAction } = import_editor_editing_panel4.controlActionsMenu;
|
|
3807
3805
|
function init() {
|
|
3808
3806
|
registerVariableTypes();
|
|
3809
3807
|
registerRepeaterInjections();
|
|
3810
|
-
(0,
|
|
3808
|
+
(0, import_editor_editing_panel4.registerControlReplacement)({
|
|
3811
3809
|
component: VariableControl,
|
|
3812
3810
|
condition: ({ value, placeholder }) => {
|
|
3813
3811
|
if (hasVariableAssigned(value)) {
|