@elementor/editor-variables 3.32.0-54 → 3.32.0-56

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 CHANGED
@@ -15,10 +15,11 @@ declare const registerVariableType: ({ icon, startIcon, valueField, propTypeUtil
15
15
  startIcon?: ({ value }: {
16
16
  value: string;
17
17
  }) => react.JSX.Element;
18
- valueField: ({ value, onChange, onValidationChange }: {
18
+ valueField: ({ value, onChange, onValidationChange, propType }: {
19
19
  value: string;
20
20
  onChange: (value: string) => void;
21
21
  onValidationChange?: (value: string) => void;
22
+ propType?: _elementor_editor_props.PropType;
22
23
  }) => react.JSX.Element;
23
24
  variableType: string;
24
25
  fallbackPropTypeUtil: any;
package/dist/index.d.ts CHANGED
@@ -15,10 +15,11 @@ declare const registerVariableType: ({ icon, startIcon, valueField, propTypeUtil
15
15
  startIcon?: ({ value }: {
16
16
  value: string;
17
17
  }) => react.JSX.Element;
18
- valueField: ({ value, onChange, onValidationChange }: {
18
+ valueField: ({ value, onChange, onValidationChange, propType }: {
19
19
  value: string;
20
20
  onChange: (value: string) => void;
21
21
  onValidationChange?: (value: string) => void;
22
+ propType?: _elementor_editor_props.PropType;
22
23
  }) => react.JSX.Element;
23
24
  variableType: string;
24
25
  fallbackPropTypeUtil: any;
package/dist/index.js CHANGED
@@ -1011,6 +1011,7 @@ var SIZE = "tiny";
1011
1011
  var VariableCreation = ({ onGoBack, onClose }) => {
1012
1012
  const { icon: VariableIcon, valueField: ValueField, variableType, propTypeUtil } = useVariableType();
1013
1013
  const { setValue: setVariable, path } = (0, import_editor_controls3.useBoundProp)(propTypeUtil);
1014
+ const { propType } = (0, import_editor_controls3.useBoundProp)();
1014
1015
  const initialValue = useInitialValue();
1015
1016
  const [value, setValue] = (0, import_react8.useState)(initialValue);
1016
1017
  const [label, setLabel] = (0, import_react8.useState)("");
@@ -1092,7 +1093,8 @@ var VariableCreation = ({ onGoBack, onClose }) => {
1092
1093
  setErrorMessage("");
1093
1094
  setValueFieldError("");
1094
1095
  },
1095
- onValidationChange: setValueFieldError
1096
+ onValidationChange: setValueFieldError,
1097
+ propType
1096
1098
  }
1097
1099
  )), errorMessage && /* @__PURE__ */ React10.createElement(import_ui10.FormHelperText, { error: true }, errorMessage)), /* @__PURE__ */ React10.createElement(import_ui10.CardActions, { sx: { pt: 0.5, pb: 1 } }, /* @__PURE__ */ React10.createElement(import_ui10.Button, { size: "small", variant: "contained", disabled: isSubmitDisabled, onClick: handleCreateAndTrack }, (0, import_i18n7.__)("Create", "elementor"))));
1098
1100
  };
@@ -1166,6 +1168,7 @@ var SIZE2 = "tiny";
1166
1168
  var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
1167
1169
  const { icon: VariableIcon, valueField: ValueField, variableType, propTypeUtil } = useVariableType();
1168
1170
  const { setValue: notifyBoundPropChange, value: assignedValue } = (0, import_editor_controls4.useBoundProp)(propTypeUtil);
1171
+ const { propType } = (0, import_editor_controls4.useBoundProp)();
1169
1172
  const [isMessageSuppressed, suppressMessage] = (0, import_editor_current_user2.useSuppressedMessage)(EDIT_CONFIRMATION_DIALOG_ID);
1170
1173
  const [deleteConfirmation, setDeleteConfirmation] = (0, import_react10.useState)(false);
1171
1174
  const [editConfirmation, setEditConfirmation] = (0, import_react10.useState)(false);
@@ -1305,7 +1308,8 @@ var VariableEdit = ({ onClose, onGoBack, onSubmit, editId }) => {
1305
1308
  setErrorMessage("");
1306
1309
  setValueFieldError("");
1307
1310
  },
1308
- onValidationChange: setValueFieldError
1311
+ onValidationChange: setValueFieldError,
1312
+ propType
1309
1313
  }
1310
1314
  )), errorMessage && /* @__PURE__ */ React13.createElement(import_ui13.FormHelperText, { error: true }, errorMessage)), /* @__PURE__ */ React13.createElement(import_ui13.CardActions, { sx: { pt: 0.5, pb: 1 } }, /* @__PURE__ */ React13.createElement(import_ui13.Button, { size: "small", variant: "contained", disabled: isSubmitDisabled, onClick: handleUpdate }, (0, import_i18n10.__)("Save", "elementor")))), deleteConfirmation && /* @__PURE__ */ React13.createElement(
1311
1315
  DeleteConfirmationDialog,
@@ -1751,6 +1755,7 @@ var SIZE6 = "tiny";
1751
1755
  var VariableRestore = ({ variableId, onClose, onSubmit }) => {
1752
1756
  const { icon: VariableIcon, valueField: ValueField, variableType, propTypeUtil } = useVariableType();
1753
1757
  const { setValue: notifyBoundPropChange } = (0, import_editor_controls7.useBoundProp)(propTypeUtil);
1758
+ const { propType } = (0, import_editor_controls7.useBoundProp)();
1754
1759
  const variable = useVariable(variableId);
1755
1760
  if (!variable) {
1756
1761
  throw new Error(`Global ${variableType} variable not found`);
@@ -1822,7 +1827,8 @@ var VariableRestore = ({ variableId, onClose, onSubmit }) => {
1822
1827
  setErrorMessage("");
1823
1828
  setValueFieldError("");
1824
1829
  },
1825
- onValidationChange: setValueFieldError
1830
+ onValidationChange: setValueFieldError,
1831
+ propType
1826
1832
  }
1827
1833
  )), errorMessage && /* @__PURE__ */ React21.createElement(import_ui21.FormHelperText, { error: true }, errorMessage)), /* @__PURE__ */ React21.createElement(import_ui21.CardActions, { sx: { pt: 0.5, pb: 1 } }, /* @__PURE__ */ React21.createElement(import_ui21.Button, { size: "small", variant: "contained", disabled: isSubmitDisabled, onClick: handleRestore }, (0, import_i18n16.__)("Restore", "elementor")))));
1828
1834
  };