@elementor/editor-variables 3.35.0-441 → 3.35.0-442
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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +33 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +15 -15
- package/src/components/fields/label-field.tsx +4 -1
- package/src/components/variable-creation.tsx +10 -1
- package/src/components/variable-edit.tsx +10 -1
- package/src/components/variable-restore.tsx +10 -1
- package/src/variables-registry/create-variable-type-registry.ts +8 -1
package/dist/index.mjs
CHANGED
|
@@ -1215,7 +1215,8 @@ var LabelField = ({
|
|
|
1215
1215
|
focusOnShow = false,
|
|
1216
1216
|
selectOnShow = false,
|
|
1217
1217
|
showWarningInfotip = false,
|
|
1218
|
-
variables
|
|
1218
|
+
variables,
|
|
1219
|
+
onKeyDown
|
|
1219
1220
|
}) => {
|
|
1220
1221
|
const [label, setLabel] = useState4(value);
|
|
1221
1222
|
const [errorMessage, setErrorMessage] = useState4("");
|
|
@@ -1245,7 +1246,8 @@ var LabelField = ({
|
|
|
1245
1246
|
inputProps: {
|
|
1246
1247
|
maxLength: VARIABLE_LABEL_MAX_LENGTH,
|
|
1247
1248
|
...selectOnShow && { onFocus: (e) => e.target.select() },
|
|
1248
|
-
"aria-label": "Name"
|
|
1249
|
+
"aria-label": "Name",
|
|
1250
|
+
onKeyDown
|
|
1249
1251
|
},
|
|
1250
1252
|
autoFocus: focusOnShow
|
|
1251
1253
|
}
|
|
@@ -2165,6 +2167,12 @@ var VariableCreation = ({ onGoBack, onClose }) => {
|
|
|
2165
2167
|
return !!errorMessage;
|
|
2166
2168
|
};
|
|
2167
2169
|
const isSubmitDisabled = hasEmptyFields() || hasErrors();
|
|
2170
|
+
const handleKeyDown = (event) => {
|
|
2171
|
+
if (event.key === "Enter" && !isSubmitDisabled) {
|
|
2172
|
+
event.preventDefault();
|
|
2173
|
+
handleCreateAndTrack();
|
|
2174
|
+
}
|
|
2175
|
+
};
|
|
2168
2176
|
return /* @__PURE__ */ React15.createElement(PopoverBody, { height: "auto" }, /* @__PURE__ */ React15.createElement(
|
|
2169
2177
|
PopoverHeader,
|
|
2170
2178
|
{
|
|
@@ -2195,7 +2203,8 @@ var VariableCreation = ({ onGoBack, onClose }) => {
|
|
|
2195
2203
|
value: label,
|
|
2196
2204
|
message: errorMsg
|
|
2197
2205
|
});
|
|
2198
|
-
}
|
|
2206
|
+
},
|
|
2207
|
+
onKeyDown: handleKeyDown
|
|
2199
2208
|
}
|
|
2200
2209
|
)
|
|
2201
2210
|
), ValueField && /* @__PURE__ */ React15.createElement(FormField, { errorMsg: valueFieldError, label: __10("Value", "elementor") }, /* @__PURE__ */ React15.createElement(Typography6, { variant: "h5", id: "variable-value-wrapper" }, /* @__PURE__ */ React15.createElement(
|
|
@@ -2209,7 +2218,8 @@ var VariableCreation = ({ onGoBack, onClose }) => {
|
|
|
2209
2218
|
setValueFieldError("");
|
|
2210
2219
|
},
|
|
2211
2220
|
onValidationChange: setValueFieldError,
|
|
2212
|
-
propType
|
|
2221
|
+
propType,
|
|
2222
|
+
onKeyDown: handleKeyDown
|
|
2213
2223
|
}
|
|
2214
2224
|
))), errorMessage && /* @__PURE__ */ React15.createElement(FormHelperText2, { error: true }, errorMessage)), /* @__PURE__ */ React15.createElement(CardActions, { sx: { pt: 0.5, pb: 1 } }, /* @__PURE__ */ React15.createElement(
|
|
2215
2225
|
Button3,
|
|
@@ -2385,6 +2395,12 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2385
2395
|
return !!errorMessage;
|
|
2386
2396
|
};
|
|
2387
2397
|
const isSubmitDisabled = noValueChanged() || hasEmptyFields() || hasErrors();
|
|
2398
|
+
const handleKeyDown = (event) => {
|
|
2399
|
+
if (event.key === "Enter" && !isSubmitDisabled) {
|
|
2400
|
+
event.preventDefault();
|
|
2401
|
+
handleUpdate();
|
|
2402
|
+
}
|
|
2403
|
+
};
|
|
2388
2404
|
return /* @__PURE__ */ React17.createElement(React17.Fragment, null, /* @__PURE__ */ React17.createElement(PopoverBody2, { height: "auto" }, /* @__PURE__ */ React17.createElement(
|
|
2389
2405
|
PopoverHeader2,
|
|
2390
2406
|
{
|
|
@@ -2424,7 +2440,8 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2424
2440
|
value: label,
|
|
2425
2441
|
message: errorMsg
|
|
2426
2442
|
});
|
|
2427
|
-
}
|
|
2443
|
+
},
|
|
2444
|
+
onKeyDown: handleKeyDown
|
|
2428
2445
|
}
|
|
2429
2446
|
)
|
|
2430
2447
|
), ValueField && /* @__PURE__ */ React17.createElement(FormField, { errorMsg: valueFieldError, label: __12("Value", "elementor") }, /* @__PURE__ */ React17.createElement(Typography8, { variant: "h5" }, /* @__PURE__ */ React17.createElement(
|
|
@@ -2438,6 +2455,7 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
|
|
|
2438
2455
|
setErrorMessage("");
|
|
2439
2456
|
setValueFieldError("");
|
|
2440
2457
|
},
|
|
2458
|
+
onKeyDown: handleKeyDown,
|
|
2441
2459
|
onValidationChange: setValueFieldError,
|
|
2442
2460
|
propType
|
|
2443
2461
|
}
|
|
@@ -2944,6 +2962,12 @@ var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
|
2944
2962
|
return !!errorMessage;
|
|
2945
2963
|
};
|
|
2946
2964
|
const isSubmitDisabled = noValueChanged() || hasEmptyFields() || hasErrors();
|
|
2965
|
+
const handleKeyDown = (event) => {
|
|
2966
|
+
if (event.key === "Enter" && !isSubmitDisabled) {
|
|
2967
|
+
event.preventDefault();
|
|
2968
|
+
handleRestore();
|
|
2969
|
+
}
|
|
2970
|
+
};
|
|
2947
2971
|
return /* @__PURE__ */ React23.createElement(PopoverContentRefContextProvider, null, /* @__PURE__ */ React23.createElement(PopoverBody4, { height: "auto" }, /* @__PURE__ */ React23.createElement(
|
|
2948
2972
|
PopoverHeader4,
|
|
2949
2973
|
{
|
|
@@ -2974,7 +2998,8 @@ var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
|
2974
2998
|
value: label,
|
|
2975
2999
|
message: errorMsg
|
|
2976
3000
|
});
|
|
2977
|
-
}
|
|
3001
|
+
},
|
|
3002
|
+
onKeyDown: handleKeyDown
|
|
2978
3003
|
}
|
|
2979
3004
|
)
|
|
2980
3005
|
), ValueField && /* @__PURE__ */ React23.createElement(FormField, { errorMsg: valueFieldError, label: __16("Value", "elementor") }, /* @__PURE__ */ React23.createElement(Typography11, { variant: "h5" }, /* @__PURE__ */ React23.createElement(
|
|
@@ -2989,7 +3014,8 @@ var VariableRestore = ({ variableId, onClose, onSubmit }) => {
|
|
|
2989
3014
|
setValueFieldError("");
|
|
2990
3015
|
},
|
|
2991
3016
|
onValidationChange: setValueFieldError,
|
|
2992
|
-
propType
|
|
3017
|
+
propType,
|
|
3018
|
+
onKeyDown: handleKeyDown
|
|
2993
3019
|
}
|
|
2994
3020
|
))), errorMessage && /* @__PURE__ */ React23.createElement(FormHelperText4, { error: true }, errorMessage)), /* @__PURE__ */ React23.createElement(CardActions3, { sx: { pt: 0.5, pb: 1 } }, /* @__PURE__ */ React23.createElement(Button6, { size: "small", variant: "contained", disabled: isSubmitDisabled, onClick: handleRestore }, __16("Restore", "elementor")))));
|
|
2995
3021
|
};
|