@elementor/editor-variables 4.0.0-520 → 4.0.0-522

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
@@ -126,6 +126,8 @@ declare const registerVariableType: ({ key, icon, startIcon, valueField, propTyp
126
126
  isActive?: boolean;
127
127
  }) => void;
128
128
 
129
+ declare const hasVariable: (key: string) => boolean;
130
+
129
131
  declare const Utils: {
130
132
  readonly globalVariablesLLMResolvers: {
131
133
  'global-color-variable': (value: unknown) => {
@@ -143,4 +145,4 @@ declare const Utils: {
143
145
  };
144
146
  };
145
147
 
146
- export { GLOBAL_VARIABLES_URI, Utils, init, registerVariableType, registerVariableTypes, service, sizeVariablePropTypeUtil };
148
+ export { GLOBAL_VARIABLES_URI, Utils, hasVariable, init, registerVariableType, registerVariableTypes, service, sizeVariablePropTypeUtil };
package/dist/index.d.ts CHANGED
@@ -126,6 +126,8 @@ declare const registerVariableType: ({ key, icon, startIcon, valueField, propTyp
126
126
  isActive?: boolean;
127
127
  }) => void;
128
128
 
129
+ declare const hasVariable: (key: string) => boolean;
130
+
129
131
  declare const Utils: {
130
132
  readonly globalVariablesLLMResolvers: {
131
133
  'global-color-variable': (value: unknown) => {
@@ -143,4 +145,4 @@ declare const Utils: {
143
145
  };
144
146
  };
145
147
 
146
- export { GLOBAL_VARIABLES_URI, Utils, init, registerVariableType, registerVariableTypes, service, sizeVariablePropTypeUtil };
148
+ export { GLOBAL_VARIABLES_URI, Utils, hasVariable, init, registerVariableType, registerVariableTypes, service, sizeVariablePropTypeUtil };
package/dist/index.js CHANGED
@@ -32,6 +32,7 @@ var index_exports = {};
32
32
  __export(index_exports, {
33
33
  GLOBAL_VARIABLES_URI: () => GLOBAL_VARIABLES_URI,
34
34
  Utils: () => Utils,
35
+ hasVariable: () => hasVariable,
35
36
  init: () => init,
36
37
  registerVariableType: () => registerVariableType,
37
38
  registerVariableTypes: () => registerVariableTypes,
@@ -927,6 +928,9 @@ var getVariables = (includeDeleted = true) => {
927
928
  }
928
929
  return Object.fromEntries(Object.entries(variables).filter(([, variable]) => !variable.deleted));
929
930
  };
931
+ var hasVariable = (key) => {
932
+ return getVariables()[key] !== void 0;
933
+ };
930
934
  var useVariable = (key) => {
931
935
  const variables = getVariables();
932
936
  if (!variables?.[key]) {
@@ -3854,6 +3858,7 @@ var Utils = {
3854
3858
  0 && (module.exports = {
3855
3859
  GLOBAL_VARIABLES_URI,
3856
3860
  Utils,
3861
+ hasVariable,
3857
3862
  init,
3858
3863
  registerVariableType,
3859
3864
  registerVariableTypes,