@elementor/editor-variables 4.3.0-948 → 4.3.0-950

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
@@ -64,6 +64,31 @@ type NormalizedVariable = {
64
64
  sync_to_v3?: boolean;
65
65
  };
66
66
 
67
+ type VariableEventData = {
68
+ varType: string;
69
+ controlPath?: string;
70
+ action: 'open' | 'add' | 'connect' | 'save' | 'update';
71
+ executedBy?: 'mcp_tool' | 'user';
72
+ };
73
+ type VariablesManagerOpenSource = 'vars-popover' | 'system-panel';
74
+ type VariablesManagerEventData = {
75
+ action: 'openManager' | 'add' | 'saveChanges' | 'delete' | 'duplicate';
76
+ source?: VariablesManagerOpenSource;
77
+ varType?: string;
78
+ controlPath?: string;
79
+ };
80
+ declare const trackVariablesManagerEvent: ({ action, source, varType, controlPath }: VariablesManagerEventData) => void;
81
+
82
+ type EventData = {
83
+ controlPath?: VariableEventData['controlPath'];
84
+ executedBy?: VariableEventData['executedBy'];
85
+ };
86
+ type CreateVariableOptions = {
87
+ eventData?: EventData;
88
+ };
89
+ type UpdateVariableOptions = {
90
+ eventData?: EventData;
91
+ };
67
92
  declare const service: {
68
93
  variables: () => TVariablesList;
69
94
  findIdByLabel(needle: string): string;
@@ -71,13 +96,13 @@ declare const service: {
71
96
  getWatermark: () => number;
72
97
  init: () => Promise<any>;
73
98
  load: () => Promise<any>;
74
- create: ({ type, label, value }: Variable) => Promise<{
99
+ create: ({ type, label, value }: Variable, options?: CreateVariableOptions) => Promise<{
75
100
  id: any;
76
101
  variable: any;
77
102
  }>;
78
103
  update: (id: string, { label, value, type }: Omit<Variable, "type"> & {
79
104
  type?: Variable["type"];
80
- }) => Promise<{
105
+ }, options?: UpdateVariableOptions) => Promise<{
81
106
  id: any;
82
107
  variable: any;
83
108
  }>;
@@ -149,15 +174,6 @@ declare function getMenuActionsForVariable(variableType: string, context: MenuAc
149
174
 
150
175
  declare const hasVariable: (key: string) => boolean;
151
176
 
152
- type VariablesManagerOpenSource = 'vars-popover' | 'system-panel';
153
- type VariablesManagerEventData = {
154
- action: 'openManager' | 'add' | 'saveChanges' | 'delete' | 'duplicate';
155
- source?: VariablesManagerOpenSource;
156
- varType?: string;
157
- controlPath?: string;
158
- };
159
- declare const trackVariablesManagerEvent: ({ action, source, varType, controlPath }: VariablesManagerEventData) => void;
160
-
161
177
  declare const Utils: {
162
178
  readonly globalVariablesLLMResolvers: {
163
179
  'global-color-variable': (value: unknown) => {
package/dist/index.d.ts CHANGED
@@ -64,6 +64,31 @@ type NormalizedVariable = {
64
64
  sync_to_v3?: boolean;
65
65
  };
66
66
 
67
+ type VariableEventData = {
68
+ varType: string;
69
+ controlPath?: string;
70
+ action: 'open' | 'add' | 'connect' | 'save' | 'update';
71
+ executedBy?: 'mcp_tool' | 'user';
72
+ };
73
+ type VariablesManagerOpenSource = 'vars-popover' | 'system-panel';
74
+ type VariablesManagerEventData = {
75
+ action: 'openManager' | 'add' | 'saveChanges' | 'delete' | 'duplicate';
76
+ source?: VariablesManagerOpenSource;
77
+ varType?: string;
78
+ controlPath?: string;
79
+ };
80
+ declare const trackVariablesManagerEvent: ({ action, source, varType, controlPath }: VariablesManagerEventData) => void;
81
+
82
+ type EventData = {
83
+ controlPath?: VariableEventData['controlPath'];
84
+ executedBy?: VariableEventData['executedBy'];
85
+ };
86
+ type CreateVariableOptions = {
87
+ eventData?: EventData;
88
+ };
89
+ type UpdateVariableOptions = {
90
+ eventData?: EventData;
91
+ };
67
92
  declare const service: {
68
93
  variables: () => TVariablesList;
69
94
  findIdByLabel(needle: string): string;
@@ -71,13 +96,13 @@ declare const service: {
71
96
  getWatermark: () => number;
72
97
  init: () => Promise<any>;
73
98
  load: () => Promise<any>;
74
- create: ({ type, label, value }: Variable) => Promise<{
99
+ create: ({ type, label, value }: Variable, options?: CreateVariableOptions) => Promise<{
75
100
  id: any;
76
101
  variable: any;
77
102
  }>;
78
103
  update: (id: string, { label, value, type }: Omit<Variable, "type"> & {
79
104
  type?: Variable["type"];
80
- }) => Promise<{
105
+ }, options?: UpdateVariableOptions) => Promise<{
81
106
  id: any;
82
107
  variable: any;
83
108
  }>;
@@ -149,15 +174,6 @@ declare function getMenuActionsForVariable(variableType: string, context: MenuAc
149
174
 
150
175
  declare const hasVariable: (key: string) => boolean;
151
176
 
152
- type VariablesManagerOpenSource = 'vars-popover' | 'system-panel';
153
- type VariablesManagerEventData = {
154
- action: 'openManager' | 'add' | 'saveChanges' | 'delete' | 'duplicate';
155
- source?: VariablesManagerOpenSource;
156
- varType?: string;
157
- controlPath?: string;
158
- };
159
- declare const trackVariablesManagerEvent: ({ action, source, varType, controlPath }: VariablesManagerEventData) => void;
160
-
161
177
  declare const Utils: {
162
178
  readonly globalVariablesLLMResolvers: {
163
179
  'global-color-variable': (value: unknown) => {