@elementor/editor-variables 4.0.0-676 → 4.0.0-678
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 +77 -42
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +56 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/ui/variable-promotion-chip.tsx +14 -4
- package/src/components/variables-manager/ui/variable-table-row.tsx +3 -0
- package/src/components/variables-manager/variables-manager-create-menu.tsx +7 -0
- package/src/components/variables-selection.tsx +12 -1
- package/src/register-variable-types.tsx +10 -1
package/dist/index.js
CHANGED
|
@@ -44,7 +44,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
44
44
|
|
|
45
45
|
// src/init.ts
|
|
46
46
|
var import_editor = require("@elementor/editor");
|
|
47
|
-
var
|
|
47
|
+
var import_editor_controls18 = require("@elementor/editor-controls");
|
|
48
48
|
var import_editor_panels2 = require("@elementor/editor-panels");
|
|
49
49
|
var import_editor_props7 = require("@elementor/editor-props");
|
|
50
50
|
var import_menus = require("@elementor/menus");
|
|
@@ -1127,16 +1127,24 @@ var useQuotaPermissions = (variableType) => {
|
|
|
1127
1127
|
// src/components/ui/variable-promotion-chip.tsx
|
|
1128
1128
|
var React6 = __toESM(require("react"));
|
|
1129
1129
|
var import_react6 = require("react");
|
|
1130
|
+
var import_editor_controls2 = require("@elementor/editor-controls");
|
|
1130
1131
|
var import_editor_ui2 = require("@elementor/editor-ui");
|
|
1131
1132
|
var import_ui6 = require("@elementor/ui");
|
|
1132
1133
|
var import_utils = require("@elementor/utils");
|
|
1133
1134
|
var import_i18n7 = require("@wordpress/i18n");
|
|
1134
1135
|
var VariablePromotionChip = (0, import_react6.forwardRef)(
|
|
1135
|
-
({ variableType, upgradeUrl }, ref) => {
|
|
1136
|
+
({ variableType, upgradeUrl, trackingData }, ref) => {
|
|
1136
1137
|
const [isOpen, setIsOpen] = (0, import_react6.useState)(false);
|
|
1137
1138
|
(0, import_editor_ui2.useCanvasClickHandler)(isOpen, () => setIsOpen(false));
|
|
1138
|
-
const toggle = ()
|
|
1139
|
-
|
|
1139
|
+
const toggle = (0, import_react6.useCallback)(() => {
|
|
1140
|
+
setIsOpen((prev) => {
|
|
1141
|
+
if (!prev) {
|
|
1142
|
+
(0, import_editor_controls2.trackViewPromotion)(trackingData);
|
|
1143
|
+
}
|
|
1144
|
+
return !prev;
|
|
1145
|
+
});
|
|
1146
|
+
}, [trackingData]);
|
|
1147
|
+
(0, import_react6.useImperativeHandle)(ref, () => ({ toggle }), [toggle]);
|
|
1140
1148
|
const title = (0, import_i18n7.sprintf)(
|
|
1141
1149
|
/* translators: %s: Variable Type. */
|
|
1142
1150
|
(0, import_i18n7.__)("%s variables", "elementor"),
|
|
@@ -1158,7 +1166,8 @@ var VariablePromotionChip = (0, import_react6.forwardRef)(
|
|
|
1158
1166
|
onClose: (e) => {
|
|
1159
1167
|
e.stopPropagation();
|
|
1160
1168
|
setIsOpen(false);
|
|
1161
|
-
}
|
|
1169
|
+
},
|
|
1170
|
+
onCtaClick: () => (0, import_editor_controls2.trackUpgradePromotionClick)(trackingData)
|
|
1162
1171
|
},
|
|
1163
1172
|
/* @__PURE__ */ React6.createElement(
|
|
1164
1173
|
import_ui6.Box,
|
|
@@ -1176,6 +1185,11 @@ var VariablePromotionChip = (0, import_react6.forwardRef)(
|
|
|
1176
1185
|
);
|
|
1177
1186
|
|
|
1178
1187
|
// src/components/variables-manager/variables-manager-create-menu.tsx
|
|
1188
|
+
var TRACKING_DATA = {
|
|
1189
|
+
target_name: "variables_manager",
|
|
1190
|
+
target_location: "variables_manager",
|
|
1191
|
+
location_l1: "create variable menu"
|
|
1192
|
+
};
|
|
1179
1193
|
var SIZE = "tiny";
|
|
1180
1194
|
var VariableManagerCreateMenu = ({ variables, onCreate, menuState }) => {
|
|
1181
1195
|
const buttonRef = (0, import_react7.useRef)(null);
|
|
@@ -1258,7 +1272,8 @@ var MenuOption = ({
|
|
|
1258
1272
|
{
|
|
1259
1273
|
variableType: config.variableType,
|
|
1260
1274
|
upgradeUrl: `https://go.elementor.com/go-pro-manager-${config.variableType}-variable/`,
|
|
1261
|
-
ref: promotionRef
|
|
1275
|
+
ref: promotionRef,
|
|
1276
|
+
trackingData: TRACKING_DATA
|
|
1262
1277
|
}
|
|
1263
1278
|
));
|
|
1264
1279
|
};
|
|
@@ -1588,6 +1603,7 @@ var VariableEditMenu = ({ menuActions, disabled, itemId }) => {
|
|
|
1588
1603
|
};
|
|
1589
1604
|
|
|
1590
1605
|
// src/components/variables-manager/ui/variable-table-row.tsx
|
|
1606
|
+
var TRACKING_DATA2 = { target_name: "variables_manager", target_location: "variables_manager" };
|
|
1591
1607
|
var VariableRow = (props) => {
|
|
1592
1608
|
const {
|
|
1593
1609
|
row,
|
|
@@ -1750,7 +1766,8 @@ var VariableRow = (props) => {
|
|
|
1750
1766
|
{
|
|
1751
1767
|
variableType: row.variableType,
|
|
1752
1768
|
upgradeUrl: `https://go.elementor.com/renew-license-manager-${row.variableType}-variable`,
|
|
1753
|
-
ref: promotionRef
|
|
1769
|
+
ref: promotionRef,
|
|
1770
|
+
trackingData: TRACKING_DATA2
|
|
1754
1771
|
}
|
|
1755
1772
|
), /* @__PURE__ */ React12.createElement(VariableEditMenu, { menuActions: menuActions(row.id), disabled: isSorting, itemId: row.id })))
|
|
1756
1773
|
);
|
|
@@ -2253,12 +2270,12 @@ function OpenPanelFromUrl() {
|
|
|
2253
2270
|
|
|
2254
2271
|
// src/controls/variable-control.tsx
|
|
2255
2272
|
var React33 = __toESM(require("react"));
|
|
2256
|
-
var
|
|
2273
|
+
var import_editor_controls13 = require("@elementor/editor-controls");
|
|
2257
2274
|
|
|
2258
2275
|
// src/components/ui/variable/assigned-variable.tsx
|
|
2259
2276
|
var import_react22 = require("react");
|
|
2260
2277
|
var React24 = __toESM(require("react"));
|
|
2261
|
-
var
|
|
2278
|
+
var import_editor_controls8 = require("@elementor/editor-controls");
|
|
2262
2279
|
var import_icons12 = require("@elementor/icons");
|
|
2263
2280
|
var import_ui24 = require("@elementor/ui");
|
|
2264
2281
|
|
|
@@ -2299,16 +2316,16 @@ var usePopoverContentRef = () => {
|
|
|
2299
2316
|
// src/components/variable-creation.tsx
|
|
2300
2317
|
var React17 = __toESM(require("react"));
|
|
2301
2318
|
var import_react17 = require("react");
|
|
2302
|
-
var
|
|
2319
|
+
var import_editor_controls5 = require("@elementor/editor-controls");
|
|
2303
2320
|
var import_editor_ui6 = require("@elementor/editor-ui");
|
|
2304
2321
|
var import_icons6 = require("@elementor/icons");
|
|
2305
2322
|
var import_ui17 = require("@elementor/ui");
|
|
2306
2323
|
var import_i18n11 = require("@wordpress/i18n");
|
|
2307
2324
|
|
|
2308
2325
|
// src/hooks/use-initial-value.ts
|
|
2309
|
-
var
|
|
2326
|
+
var import_editor_controls3 = require("@elementor/editor-controls");
|
|
2310
2327
|
var useInitialValue = () => {
|
|
2311
|
-
const { value: initial } = (0,
|
|
2328
|
+
const { value: initial } = (0, import_editor_controls3.useBoundProp)();
|
|
2312
2329
|
const hasAssignedVariable = hasVariableType(initial?.$$type) && Boolean(initial?.value);
|
|
2313
2330
|
const variable = useVariable(hasAssignedVariable ? initial.value : "");
|
|
2314
2331
|
if (hasAssignedVariable) {
|
|
@@ -2318,11 +2335,11 @@ var useInitialValue = () => {
|
|
|
2318
2335
|
};
|
|
2319
2336
|
|
|
2320
2337
|
// src/hooks/use-variable-bound-prop.ts
|
|
2321
|
-
var
|
|
2338
|
+
var import_editor_controls4 = require("@elementor/editor-controls");
|
|
2322
2339
|
var import_editor_props3 = require("@elementor/editor-props");
|
|
2323
2340
|
var useVariableBoundProp = () => {
|
|
2324
2341
|
const { propTypeUtil } = useVariableType();
|
|
2325
|
-
const boundProp = (0,
|
|
2342
|
+
const boundProp = (0, import_editor_controls4.useBoundProp)(propTypeUtil);
|
|
2326
2343
|
return {
|
|
2327
2344
|
...boundProp,
|
|
2328
2345
|
setVariableValue: (value) => resolveBoundPropAndSetValue(value, boundProp),
|
|
@@ -2357,7 +2374,7 @@ var SIZE2 = "tiny";
|
|
|
2357
2374
|
var VariableCreation = ({ onGoBack, onClose }) => {
|
|
2358
2375
|
const { icon: VariableIcon, valueField: ValueField, variableType, propTypeUtil } = useVariableType();
|
|
2359
2376
|
const { setVariableValue: setVariable, path } = useVariableBoundProp();
|
|
2360
|
-
const { propType } = (0,
|
|
2377
|
+
const { propType } = (0, import_editor_controls5.useBoundProp)();
|
|
2361
2378
|
const initialValue = useInitialValue();
|
|
2362
2379
|
const [value, setValue] = (0, import_react17.useState)(initialValue);
|
|
2363
2380
|
const [label, setLabel] = (0, import_react17.useState)("");
|
|
@@ -2427,7 +2444,7 @@ var VariableCreation = ({ onGoBack, onClose }) => {
|
|
|
2427
2444
|
title: (0, import_i18n11.__)("Create variable", "elementor"),
|
|
2428
2445
|
onClose: closePopover
|
|
2429
2446
|
}
|
|
2430
|
-
), /* @__PURE__ */ React17.createElement(import_ui17.Divider, null), /* @__PURE__ */ React17.createElement(
|
|
2447
|
+
), /* @__PURE__ */ React17.createElement(import_ui17.Divider, null), /* @__PURE__ */ React17.createElement(import_editor_controls5.PopoverContent, { p: 2 }, /* @__PURE__ */ React17.createElement(
|
|
2431
2448
|
FormField,
|
|
2432
2449
|
{
|
|
2433
2450
|
id: "variable-label",
|
|
@@ -2484,7 +2501,7 @@ var VariableCreation = ({ onGoBack, onClose }) => {
|
|
|
2484
2501
|
// src/components/variable-edit.tsx
|
|
2485
2502
|
var React19 = __toESM(require("react"));
|
|
2486
2503
|
var import_react19 = require("react");
|
|
2487
|
-
var
|
|
2504
|
+
var import_editor_controls6 = require("@elementor/editor-controls");
|
|
2488
2505
|
var import_editor_current_user3 = require("@elementor/editor-current-user");
|
|
2489
2506
|
var import_editor_ui7 = require("@elementor/editor-ui");
|
|
2490
2507
|
var import_icons8 = require("@elementor/icons");
|
|
@@ -2535,7 +2552,7 @@ var DELETE_LABEL = (0, import_i18n13.__)("Delete variable", "elementor");
|
|
|
2535
2552
|
var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
2536
2553
|
const { icon: VariableIcon, valueField: ValueField, variableType, propTypeUtil } = useVariableType();
|
|
2537
2554
|
const { setVariableValue: notifyBoundPropChange, variableId } = useVariableBoundProp();
|
|
2538
|
-
const { propType } = (0,
|
|
2555
|
+
const { propType } = (0, import_editor_controls6.useBoundProp)();
|
|
2539
2556
|
const [isMessageSuppressed, suppressMessage] = (0, import_editor_current_user3.useSuppressedMessage)(EDIT_CONFIRMATION_DIALOG_ID);
|
|
2540
2557
|
const [deleteConfirmation, setDeleteConfirmation] = (0, import_react19.useState)(false);
|
|
2541
2558
|
const [editConfirmation, setEditConfirmation] = (0, import_react19.useState)(false);
|
|
@@ -2653,7 +2670,7 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2653
2670
|
), /* @__PURE__ */ React19.createElement(VariableIcon, { fontSize: SIZE3 })),
|
|
2654
2671
|
actions
|
|
2655
2672
|
}
|
|
2656
|
-
), /* @__PURE__ */ React19.createElement(import_ui19.Divider, null), /* @__PURE__ */ React19.createElement(
|
|
2673
|
+
), /* @__PURE__ */ React19.createElement(import_ui19.Divider, null), /* @__PURE__ */ React19.createElement(import_editor_controls6.PopoverContent, { p: 2 }, /* @__PURE__ */ React19.createElement(
|
|
2657
2674
|
FormField,
|
|
2658
2675
|
{
|
|
2659
2676
|
id: "variable-label",
|
|
@@ -2716,6 +2733,7 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2716
2733
|
// src/components/variables-selection.tsx
|
|
2717
2734
|
var import_react20 = require("react");
|
|
2718
2735
|
var React21 = __toESM(require("react"));
|
|
2736
|
+
var import_editor_controls7 = require("@elementor/editor-controls");
|
|
2719
2737
|
var import_editor_ui9 = require("@elementor/editor-ui");
|
|
2720
2738
|
var import_editor_ui10 = require("@elementor/editor-ui");
|
|
2721
2739
|
var import_icons10 = require("@elementor/icons");
|
|
@@ -2898,6 +2916,15 @@ var VariablesSelection = ({ closePopover, onAdd, onEdit, onSettings, disabled =
|
|
|
2898
2916
|
const handleClearSearch = () => {
|
|
2899
2917
|
setSearchValue("");
|
|
2900
2918
|
};
|
|
2919
|
+
(0, import_react20.useEffect)(() => {
|
|
2920
|
+
if (disabled) {
|
|
2921
|
+
(0, import_editor_controls7.trackViewPromotion)({
|
|
2922
|
+
target_name: "variables_popover",
|
|
2923
|
+
target_location: "widget_panel",
|
|
2924
|
+
location_l1: "variables_list"
|
|
2925
|
+
});
|
|
2926
|
+
}
|
|
2927
|
+
}, [disabled]);
|
|
2901
2928
|
return /* @__PURE__ */ React21.createElement(import_editor_ui9.SectionPopoverBody, null, /* @__PURE__ */ React21.createElement(
|
|
2902
2929
|
import_editor_ui9.PopoverHeader,
|
|
2903
2930
|
{
|
|
@@ -3104,7 +3131,7 @@ var AssignedTag = ({ startIcon, label, onUnlink, ...props }) => {
|
|
|
3104
3131
|
// src/components/ui/variable/assigned-variable.tsx
|
|
3105
3132
|
var AssignedVariable = ({ variable, propTypeKey }) => {
|
|
3106
3133
|
const { startIcon, propTypeUtil } = getVariableType(propTypeKey);
|
|
3107
|
-
const { setValue } = (0,
|
|
3134
|
+
const { setValue } = (0, import_editor_controls8.useBoundProp)();
|
|
3108
3135
|
const anchorRef = (0, import_react22.useRef)(null);
|
|
3109
3136
|
const popupId = (0, import_react22.useId)();
|
|
3110
3137
|
const popupState = (0, import_ui24.usePopupState)({
|
|
@@ -3147,14 +3174,14 @@ var AssignedVariable = ({ variable, propTypeKey }) => {
|
|
|
3147
3174
|
// src/components/ui/variable/deleted-variable.tsx
|
|
3148
3175
|
var React28 = __toESM(require("react"));
|
|
3149
3176
|
var import_react24 = require("react");
|
|
3150
|
-
var
|
|
3177
|
+
var import_editor_controls10 = require("@elementor/editor-controls");
|
|
3151
3178
|
var import_ui28 = require("@elementor/ui");
|
|
3152
3179
|
var import_i18n19 = require("@wordpress/i18n");
|
|
3153
3180
|
|
|
3154
3181
|
// src/components/variable-restore.tsx
|
|
3155
3182
|
var React25 = __toESM(require("react"));
|
|
3156
3183
|
var import_react23 = require("react");
|
|
3157
|
-
var
|
|
3184
|
+
var import_editor_controls9 = require("@elementor/editor-controls");
|
|
3158
3185
|
var import_editor_ui11 = require("@elementor/editor-ui");
|
|
3159
3186
|
var import_ui25 = require("@elementor/ui");
|
|
3160
3187
|
var import_i18n17 = require("@wordpress/i18n");
|
|
@@ -3162,7 +3189,7 @@ var SIZE7 = "tiny";
|
|
|
3162
3189
|
var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
3163
3190
|
const { icon: VariableIcon, valueField: ValueField, variableType, propTypeUtil } = useVariableType();
|
|
3164
3191
|
const { setVariableValue: notifyBoundPropChange } = useVariableBoundProp();
|
|
3165
|
-
const { propType } = (0,
|
|
3192
|
+
const { propType } = (0, import_editor_controls9.useBoundProp)();
|
|
3166
3193
|
const variable = useVariable(variableId);
|
|
3167
3194
|
if (!variable) {
|
|
3168
3195
|
throw new Error(`Global ${variableType} variable not found`);
|
|
@@ -3224,7 +3251,7 @@ var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
|
3224
3251
|
title: (0, import_i18n17.__)("Restore variable", "elementor"),
|
|
3225
3252
|
onClose
|
|
3226
3253
|
}
|
|
3227
|
-
), /* @__PURE__ */ React25.createElement(import_ui25.Divider, null), /* @__PURE__ */ React25.createElement(
|
|
3254
|
+
), /* @__PURE__ */ React25.createElement(import_ui25.Divider, null), /* @__PURE__ */ React25.createElement(import_editor_controls9.PopoverContent, { p: 2 }, /* @__PURE__ */ React25.createElement(
|
|
3228
3255
|
FormField,
|
|
3229
3256
|
{
|
|
3230
3257
|
id: "variable-label",
|
|
@@ -3325,7 +3352,7 @@ WarningVariableTag.displayName = "WarningVariableTag";
|
|
|
3325
3352
|
// src/components/ui/variable/deleted-variable.tsx
|
|
3326
3353
|
var DeletedVariable = ({ variable, propTypeKey }) => {
|
|
3327
3354
|
const { propTypeUtil } = getVariableType(propTypeKey);
|
|
3328
|
-
const boundProp = (0,
|
|
3355
|
+
const boundProp = (0, import_editor_controls10.useBoundProp)();
|
|
3329
3356
|
const userPermissions = usePermissions();
|
|
3330
3357
|
const [showInfotip, setShowInfotip] = (0, import_react24.useState)(false);
|
|
3331
3358
|
const toggleInfotip = () => setShowInfotip((prev) => !prev);
|
|
@@ -3419,7 +3446,7 @@ var DeletedVariable = ({ variable, propTypeKey }) => {
|
|
|
3419
3446
|
// src/components/ui/variable/mismatch-variable.tsx
|
|
3420
3447
|
var React30 = __toESM(require("react"));
|
|
3421
3448
|
var import_react25 = require("react");
|
|
3422
|
-
var
|
|
3449
|
+
var import_editor_controls11 = require("@elementor/editor-controls");
|
|
3423
3450
|
var import_ui30 = require("@elementor/ui");
|
|
3424
3451
|
var import_i18n21 = require("@wordpress/i18n");
|
|
3425
3452
|
|
|
@@ -3455,7 +3482,7 @@ var MismatchVariableAlert = ({ onClose, onClear, triggerSelect }) => {
|
|
|
3455
3482
|
|
|
3456
3483
|
// src/components/ui/variable/mismatch-variable.tsx
|
|
3457
3484
|
var MismatchVariable = ({ variable }) => {
|
|
3458
|
-
const { setValue, value } = (0,
|
|
3485
|
+
const { setValue, value } = (0, import_editor_controls11.useBoundProp)();
|
|
3459
3486
|
const anchorRef = (0, import_react25.useRef)(null);
|
|
3460
3487
|
const popupId = (0, import_react25.useId)();
|
|
3461
3488
|
const popupState = (0, import_ui30.usePopupState)({
|
|
@@ -3536,7 +3563,7 @@ var MismatchVariable = ({ variable }) => {
|
|
|
3536
3563
|
// src/components/ui/variable/missing-variable.tsx
|
|
3537
3564
|
var React32 = __toESM(require("react"));
|
|
3538
3565
|
var import_react26 = require("react");
|
|
3539
|
-
var
|
|
3566
|
+
var import_editor_controls12 = require("@elementor/editor-controls");
|
|
3540
3567
|
var import_ui32 = require("@elementor/ui");
|
|
3541
3568
|
var import_i18n23 = require("@wordpress/i18n");
|
|
3542
3569
|
|
|
@@ -3564,7 +3591,7 @@ var MissingVariableAlert = ({ onClose, onClear }) => {
|
|
|
3564
3591
|
|
|
3565
3592
|
// src/components/ui/variable/missing-variable.tsx
|
|
3566
3593
|
var MissingVariable = () => {
|
|
3567
|
-
const { setValue } = (0,
|
|
3594
|
+
const { setValue } = (0, import_editor_controls12.useBoundProp)();
|
|
3568
3595
|
const [infotipVisible, setInfotipVisible] = (0, import_react26.useState)(false);
|
|
3569
3596
|
const toggleInfotip = () => setInfotipVisible((prev) => !prev);
|
|
3570
3597
|
const closeInfotip = () => setInfotipVisible(false);
|
|
@@ -3595,7 +3622,7 @@ var MissingVariable = () => {
|
|
|
3595
3622
|
|
|
3596
3623
|
// src/controls/variable-control.tsx
|
|
3597
3624
|
var VariableControl = () => {
|
|
3598
|
-
const boundProp = (0,
|
|
3625
|
+
const boundProp = (0, import_editor_controls13.useBoundProp)();
|
|
3599
3626
|
const boundPropValue = boundProp.value ?? boundProp.placeholder;
|
|
3600
3627
|
const assignedVariable = useVariable(boundPropValue?.value);
|
|
3601
3628
|
if (!assignedVariable) {
|
|
@@ -3614,11 +3641,11 @@ var VariableControl = () => {
|
|
|
3614
3641
|
|
|
3615
3642
|
// src/hooks/use-prop-variable-action.tsx
|
|
3616
3643
|
var React34 = __toESM(require("react"));
|
|
3617
|
-
var
|
|
3644
|
+
var import_editor_controls14 = require("@elementor/editor-controls");
|
|
3618
3645
|
var import_icons14 = require("@elementor/icons");
|
|
3619
3646
|
var import_i18n24 = require("@wordpress/i18n");
|
|
3620
3647
|
var usePropVariableAction = () => {
|
|
3621
|
-
const { propType, path } = (0,
|
|
3648
|
+
const { propType, path } = (0, import_editor_controls14.useBoundProp)();
|
|
3622
3649
|
const variable = resolveVariableFromPropType(propType);
|
|
3623
3650
|
return {
|
|
3624
3651
|
visible: Boolean(variable),
|
|
@@ -3776,6 +3803,7 @@ function initMcp() {
|
|
|
3776
3803
|
|
|
3777
3804
|
// src/register-variable-types.tsx
|
|
3778
3805
|
var React37 = __toESM(require("react"));
|
|
3806
|
+
var import_editor_controls16 = require("@elementor/editor-controls");
|
|
3779
3807
|
var import_editor_props5 = require("@elementor/editor-props");
|
|
3780
3808
|
var import_editor_ui13 = require("@elementor/editor-ui");
|
|
3781
3809
|
var import_editor_v1_adapters6 = require("@elementor/editor-v1-adapters");
|
|
@@ -3829,7 +3857,7 @@ var ColorField = ({ value, onChange, onValidationChange }) => {
|
|
|
3829
3857
|
// src/components/fields/font-field.tsx
|
|
3830
3858
|
var React36 = __toESM(require("react"));
|
|
3831
3859
|
var import_react28 = require("react");
|
|
3832
|
-
var
|
|
3860
|
+
var import_editor_controls15 = require("@elementor/editor-controls");
|
|
3833
3861
|
var import_editor_ui12 = require("@elementor/editor-ui");
|
|
3834
3862
|
var import_icons15 = require("@elementor/icons");
|
|
3835
3863
|
var import_ui34 = require("@elementor/ui");
|
|
@@ -3839,7 +3867,7 @@ var FontField = ({ value, onChange, onValidationChange }) => {
|
|
|
3839
3867
|
const defaultRef = (0, import_react28.useRef)(null);
|
|
3840
3868
|
const anchorRef = usePopoverContentRef() ?? defaultRef.current;
|
|
3841
3869
|
const fontPopoverState = (0, import_ui34.usePopupState)({ variant: "popover" });
|
|
3842
|
-
const fontFamilies = (0,
|
|
3870
|
+
const fontFamilies = (0, import_editor_controls15.useFontFamilies)();
|
|
3843
3871
|
const sectionWidth = (0, import_editor_ui12.useSectionWidth)();
|
|
3844
3872
|
const mapFontSubs = React36.useMemo(() => {
|
|
3845
3873
|
return fontFamilies.map(({ label, fonts }) => ({
|
|
@@ -3879,7 +3907,7 @@ var FontField = ({ value, onChange, onValidationChange }) => {
|
|
|
3879
3907
|
...(0, import_ui34.bindPopover)(fontPopoverState)
|
|
3880
3908
|
},
|
|
3881
3909
|
/* @__PURE__ */ React36.createElement(
|
|
3882
|
-
|
|
3910
|
+
import_editor_controls15.ItemSelector,
|
|
3883
3911
|
{
|
|
3884
3912
|
id: "font-family-variables-selector",
|
|
3885
3913
|
itemsList: mapFontSubs,
|
|
@@ -3889,7 +3917,7 @@ var FontField = ({ value, onChange, onValidationChange }) => {
|
|
|
3889
3917
|
sectionWidth,
|
|
3890
3918
|
title: (0, import_i18n25.__)("Font family", "elementor"),
|
|
3891
3919
|
itemStyle: (item) => ({ fontFamily: item.value }),
|
|
3892
|
-
onDebounce:
|
|
3920
|
+
onDebounce: import_editor_controls15.enqueueFont,
|
|
3893
3921
|
icon: import_icons15.TextIcon
|
|
3894
3922
|
}
|
|
3895
3923
|
)
|
|
@@ -3958,7 +3986,14 @@ function registerVariableTypes() {
|
|
|
3958
3986
|
styleTransformer: EmptyTransformer,
|
|
3959
3987
|
variableType: "size",
|
|
3960
3988
|
selectionFilter: () => [],
|
|
3961
|
-
emptyState: /* @__PURE__ */ React37.createElement(
|
|
3989
|
+
emptyState: /* @__PURE__ */ React37.createElement(
|
|
3990
|
+
import_editor_ui13.CtaButton,
|
|
3991
|
+
{
|
|
3992
|
+
size: "small",
|
|
3993
|
+
href: "https://go.elementor.com/go-pro-panel-size-variable/",
|
|
3994
|
+
onClick: () => (0, import_editor_controls16.trackUpgradePromotionClick)({ target_name: "variables_popover", location_l1: "variables_list" })
|
|
3995
|
+
}
|
|
3996
|
+
)
|
|
3962
3997
|
};
|
|
3963
3998
|
registerVariableType({
|
|
3964
3999
|
...sizePromotions,
|
|
@@ -4012,7 +4047,7 @@ function convertToCssVariables(variables) {
|
|
|
4012
4047
|
}
|
|
4013
4048
|
|
|
4014
4049
|
// src/repeater-injections.ts
|
|
4015
|
-
var
|
|
4050
|
+
var import_editor_controls17 = require("@elementor/editor-controls");
|
|
4016
4051
|
var import_editor_props6 = require("@elementor/editor-props");
|
|
4017
4052
|
|
|
4018
4053
|
// src/components/variables-repeater-item-slot.tsx
|
|
@@ -4036,21 +4071,21 @@ var BoxShadowRepeaterColorIndicator = ({ value }) => {
|
|
|
4036
4071
|
|
|
4037
4072
|
// src/repeater-injections.ts
|
|
4038
4073
|
function registerRepeaterInjections() {
|
|
4039
|
-
(0,
|
|
4074
|
+
(0, import_editor_controls17.injectIntoRepeaterItemIcon)({
|
|
4040
4075
|
id: "color-variables-background-icon",
|
|
4041
4076
|
component: BackgroundRepeaterColorIndicator,
|
|
4042
4077
|
condition: ({ value: prop }) => {
|
|
4043
4078
|
return hasAssignedColorVariable(import_editor_props6.backgroundColorOverlayPropTypeUtil.extract(prop)?.color);
|
|
4044
4079
|
}
|
|
4045
4080
|
});
|
|
4046
|
-
(0,
|
|
4081
|
+
(0, import_editor_controls17.injectIntoRepeaterItemIcon)({
|
|
4047
4082
|
id: "color-variables-icon",
|
|
4048
4083
|
component: BoxShadowRepeaterColorIndicator,
|
|
4049
4084
|
condition: ({ value: prop }) => {
|
|
4050
4085
|
return hasAssignedColorVariable(import_editor_props6.shadowPropTypeUtil.extract(prop)?.color);
|
|
4051
4086
|
}
|
|
4052
4087
|
});
|
|
4053
|
-
(0,
|
|
4088
|
+
(0, import_editor_controls17.injectIntoRepeaterItemLabel)({
|
|
4054
4089
|
id: "color-variables-label",
|
|
4055
4090
|
component: BackgroundRepeaterLabel,
|
|
4056
4091
|
condition: ({ value: prop }) => {
|
|
@@ -4067,7 +4102,7 @@ var { registerPopoverAction } = import_menus.controlActionsMenu;
|
|
|
4067
4102
|
function init() {
|
|
4068
4103
|
registerVariableTypes();
|
|
4069
4104
|
registerRepeaterInjections();
|
|
4070
|
-
(0,
|
|
4105
|
+
(0, import_editor_controls18.registerControlReplacement)({
|
|
4071
4106
|
component: VariableControl,
|
|
4072
4107
|
condition: ({ value, placeholder }) => {
|
|
4073
4108
|
if (hasVariableAssigned(value)) {
|