@elementor/editor-variables 4.1.0-manual → 4.2.0-839

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
@@ -1,12 +1,30 @@
1
+ import * as react from 'react';
2
+ import { KeyboardEvent } from 'react';
1
3
  import * as _elementor_editor_props from '@elementor/editor-props';
2
4
  import { PropType } from '@elementor/editor-props';
3
5
  import { z } from '@elementor/schema';
6
+ import * as _elementor_editor_styles from '@elementor/editor-styles';
7
+ import { Variable } from '@elementor/editor-styles';
4
8
  import * as _elementor_editor_canvas from '@elementor/editor-canvas';
5
- import * as react from 'react';
6
- import { KeyboardEvent } from 'react';
7
9
  import { SvgIconProps } from '@elementor/ui';
8
10
  import * as _mui_material from '@mui/material';
9
11
 
12
+ type VariablesManagerPanelEmbeddedProps = {
13
+ onRequestClose: () => void | Promise<void>;
14
+ /**
15
+ * Registers the variables manager close handler (dirty check + save dialog) so parent panel chrome
16
+ * can invoke the same flow as the standalone panel close control.
17
+ */
18
+ onExposeCloseAttempt?: (attemptClose: (() => void) | null) => void;
19
+ };
20
+ /**
21
+ * Variables UI without standalone panel chrome — use inside Design System panel when experiment is active.
22
+ * @param root0
23
+ * @param root0.onRequestClose
24
+ * @param root0.onExposeCloseAttempt
25
+ */
26
+ declare function VariablesManagerPanelEmbedded({ onRequestClose, onExposeCloseAttempt, }: VariablesManagerPanelEmbeddedProps): react.JSX.Element;
27
+
10
28
  declare function init(): void;
11
29
 
12
30
  declare const GLOBAL_VARIABLES_URI = "elementor://global-variables";
@@ -48,15 +66,6 @@ type TVariable = {
48
66
  };
49
67
  type TVariablesList = Record<string, TVariable>;
50
68
 
51
- type Variable = {
52
- key?: string;
53
- label: string;
54
- value: string;
55
- type: string;
56
- deleted?: boolean;
57
- deleted_at?: string;
58
- sync_to_v3?: boolean;
59
- };
60
69
  type NormalizedVariable = {
61
70
  key: string;
62
71
  label: string;
@@ -141,7 +150,7 @@ declare const registerVariableType: ({ key, icon, startIcon, valueField, propTyp
141
150
  propTypeUtil: _elementor_editor_props.PropTypeUtil<string, string>;
142
151
  selectionFilter?: (variables: NormalizedVariable[], propType?: _elementor_editor_props.PropType) => NormalizedVariable[];
143
152
  valueTransformer?: (value: string, type?: string) => _elementor_editor_props.PropValue;
144
- isCompatible?: (propType: _elementor_editor_props.PropType, variable: Variable) => boolean;
153
+ isCompatible?: (propType: _elementor_editor_props.PropType, variable: _elementor_editor_styles.Variable) => boolean;
145
154
  emptyState?: react.JSX.Element;
146
155
  isActive?: boolean;
147
156
  menuActionsFactory?: MenuActionsFactory;
@@ -167,4 +176,4 @@ declare const Utils: {
167
176
  };
168
177
  };
169
178
 
170
- export { GLOBAL_VARIABLES_URI, type MenuActionContext, type MenuActionsFactory, Utils, type VariableManagerMenuAction, getMenuActionsForVariable, hasVariable, init, registerVariableType, registerVariableTypes, service, sizeVariablePropTypeUtil };
179
+ export { GLOBAL_VARIABLES_URI, type MenuActionContext, type MenuActionsFactory, Utils, type VariableManagerMenuAction, VariablesManagerPanelEmbedded, type VariablesManagerPanelEmbeddedProps, getMenuActionsForVariable, hasVariable, init, registerVariableType, registerVariableTypes, service, sizeVariablePropTypeUtil };
package/dist/index.d.ts CHANGED
@@ -1,12 +1,30 @@
1
+ import * as react from 'react';
2
+ import { KeyboardEvent } from 'react';
1
3
  import * as _elementor_editor_props from '@elementor/editor-props';
2
4
  import { PropType } from '@elementor/editor-props';
3
5
  import { z } from '@elementor/schema';
6
+ import * as _elementor_editor_styles from '@elementor/editor-styles';
7
+ import { Variable } from '@elementor/editor-styles';
4
8
  import * as _elementor_editor_canvas from '@elementor/editor-canvas';
5
- import * as react from 'react';
6
- import { KeyboardEvent } from 'react';
7
9
  import { SvgIconProps } from '@elementor/ui';
8
10
  import * as _mui_material from '@mui/material';
9
11
 
12
+ type VariablesManagerPanelEmbeddedProps = {
13
+ onRequestClose: () => void | Promise<void>;
14
+ /**
15
+ * Registers the variables manager close handler (dirty check + save dialog) so parent panel chrome
16
+ * can invoke the same flow as the standalone panel close control.
17
+ */
18
+ onExposeCloseAttempt?: (attemptClose: (() => void) | null) => void;
19
+ };
20
+ /**
21
+ * Variables UI without standalone panel chrome — use inside Design System panel when experiment is active.
22
+ * @param root0
23
+ * @param root0.onRequestClose
24
+ * @param root0.onExposeCloseAttempt
25
+ */
26
+ declare function VariablesManagerPanelEmbedded({ onRequestClose, onExposeCloseAttempt, }: VariablesManagerPanelEmbeddedProps): react.JSX.Element;
27
+
10
28
  declare function init(): void;
11
29
 
12
30
  declare const GLOBAL_VARIABLES_URI = "elementor://global-variables";
@@ -48,15 +66,6 @@ type TVariable = {
48
66
  };
49
67
  type TVariablesList = Record<string, TVariable>;
50
68
 
51
- type Variable = {
52
- key?: string;
53
- label: string;
54
- value: string;
55
- type: string;
56
- deleted?: boolean;
57
- deleted_at?: string;
58
- sync_to_v3?: boolean;
59
- };
60
69
  type NormalizedVariable = {
61
70
  key: string;
62
71
  label: string;
@@ -141,7 +150,7 @@ declare const registerVariableType: ({ key, icon, startIcon, valueField, propTyp
141
150
  propTypeUtil: _elementor_editor_props.PropTypeUtil<string, string>;
142
151
  selectionFilter?: (variables: NormalizedVariable[], propType?: _elementor_editor_props.PropType) => NormalizedVariable[];
143
152
  valueTransformer?: (value: string, type?: string) => _elementor_editor_props.PropValue;
144
- isCompatible?: (propType: _elementor_editor_props.PropType, variable: Variable) => boolean;
153
+ isCompatible?: (propType: _elementor_editor_props.PropType, variable: _elementor_editor_styles.Variable) => boolean;
145
154
  emptyState?: react.JSX.Element;
146
155
  isActive?: boolean;
147
156
  menuActionsFactory?: MenuActionsFactory;
@@ -167,4 +176,4 @@ declare const Utils: {
167
176
  };
168
177
  };
169
178
 
170
- export { GLOBAL_VARIABLES_URI, type MenuActionContext, type MenuActionsFactory, Utils, type VariableManagerMenuAction, getMenuActionsForVariable, hasVariable, init, registerVariableType, registerVariableTypes, service, sizeVariablePropTypeUtil };
179
+ export { GLOBAL_VARIABLES_URI, type MenuActionContext, type MenuActionsFactory, Utils, type VariableManagerMenuAction, VariablesManagerPanelEmbedded, type VariablesManagerPanelEmbeddedProps, getMenuActionsForVariable, hasVariable, init, registerVariableType, registerVariableTypes, service, sizeVariablePropTypeUtil };