@elementor/editor-elements 3.33.0-99 → 3.34.2
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 +274 -119
- package/dist/index.d.ts +274 -119
- package/dist/index.js +1158 -394
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1141 -387
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -5
- package/src/errors.ts +10 -0
- package/src/hooks/use-element-children.ts +12 -12
- package/src/hooks/use-element-editor-settings.ts +12 -0
- package/src/hooks/use-element-interactions.ts +25 -0
- package/src/hooks/use-element-setting.ts +1 -1
- package/src/hooks/use-selected-element.ts +2 -2
- package/src/index.ts +38 -27
- package/src/mcp/elements-tool.ts +345 -0
- package/src/mcp/handlers/common-style-utils.ts +23 -0
- package/src/mcp/handlers/create-element.ts +96 -0
- package/src/mcp/handlers/create-style.ts +42 -0
- package/src/mcp/handlers/delete-element.ts +17 -0
- package/src/mcp/handlers/delete-style.ts +22 -0
- package/src/mcp/handlers/deselect-element.ts +21 -0
- package/src/mcp/handlers/duplicate-element.ts +22 -0
- package/src/mcp/handlers/get-element-props.ts +28 -0
- package/src/mcp/handlers/get-element-schema.ts +17 -0
- package/src/mcp/handlers/get-selected.ts +5 -0
- package/src/mcp/handlers/get-styles.ts +26 -0
- package/src/mcp/handlers/list-available-types.ts +27 -0
- package/src/mcp/handlers/move-element.ts +30 -0
- package/src/mcp/handlers/select-element.ts +25 -0
- package/src/mcp/handlers/update-props.ts +22 -0
- package/src/mcp/handlers/update-styles.ts +45 -0
- package/src/mcp/index.ts +9 -0
- package/src/sync/delete-element.ts +8 -2
- package/src/sync/drop-element.ts +30 -0
- package/src/sync/duplicate-element.ts +5 -15
- package/src/sync/duplicate-elements.ts +11 -5
- package/src/sync/get-current-document-container.ts +1 -1
- package/src/sync/get-element-editor-settings.ts +8 -0
- package/src/sync/get-element-interactions.ts +15 -0
- package/src/sync/get-element-label.ts +6 -1
- package/src/sync/get-element-type.ts +28 -0
- package/src/sync/get-elements.ts +1 -1
- package/src/sync/get-widgets-cache.ts +4 -3
- package/src/sync/move-elements.ts +9 -1
- package/src/sync/remove-elements.ts +11 -0
- package/src/sync/replace-element.ts +50 -12
- package/src/sync/types.ts +32 -3
- package/src/sync/update-element-editor-settings.ts +28 -0
- package/src/sync/update-element-interactions.ts +32 -0
- package/src/types.ts +16 -1
- package/src/hooks/use-element-type.ts +0 -35
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PropsSchema, PropValue, Props } from '@elementor/editor-props';
|
|
2
|
-
import { StyleDefinitionID, StyleDefinition, StyleDefinitionVariant } from '@elementor/editor-styles';
|
|
2
|
+
import { ClassState, StyleDefinitionID, StyleDefinition, StyleDefinitionVariant } from '@elementor/editor-styles';
|
|
3
3
|
import * as _elementor_editor_v1_adapters from '@elementor/editor-v1-adapters';
|
|
4
4
|
|
|
5
5
|
type ElementID = string;
|
|
@@ -12,6 +12,7 @@ type ElementType = {
|
|
|
12
12
|
controls: ControlItem[];
|
|
13
13
|
propsSchema: PropsSchema;
|
|
14
14
|
dependenciesPerTargetMapping?: Record<string, string[]>;
|
|
15
|
+
styleStates?: ClassState[];
|
|
15
16
|
title: string;
|
|
16
17
|
};
|
|
17
18
|
type ControlsSection = {
|
|
@@ -36,16 +37,48 @@ type Control = {
|
|
|
36
37
|
};
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
|
-
type
|
|
40
|
+
type ElementControl = {
|
|
41
|
+
type: 'element-control';
|
|
42
|
+
value: {
|
|
43
|
+
type: string;
|
|
44
|
+
label?: string;
|
|
45
|
+
props: Record<string, unknown>;
|
|
46
|
+
meta?: {
|
|
47
|
+
layout?: ControlLayout;
|
|
48
|
+
topDivider?: boolean;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
type ControlItem = ControlsSection | Control | ElementControl;
|
|
40
53
|
type ControlLayout = 'full' | 'two-columns' | 'custom';
|
|
41
54
|
|
|
42
|
-
type
|
|
55
|
+
type ExtendedWindow = Window & {
|
|
56
|
+
elementor?: {
|
|
57
|
+
selection?: {
|
|
58
|
+
getElements: () => V1Element$1[];
|
|
59
|
+
};
|
|
60
|
+
widgetsCache?: Record<string, V1ElementConfig>;
|
|
61
|
+
documents?: {
|
|
62
|
+
getCurrent?: () => {
|
|
63
|
+
container: V1Element$1;
|
|
64
|
+
} | undefined;
|
|
65
|
+
getCurrentId?: () => number;
|
|
66
|
+
};
|
|
67
|
+
getContainer?: (id: string) => V1Element$1 | undefined;
|
|
68
|
+
};
|
|
69
|
+
elementorCommon?: {
|
|
70
|
+
helpers?: {
|
|
71
|
+
getUniqueId?: () => string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
type V1Element$1 = {
|
|
43
76
|
id: string;
|
|
44
|
-
model: V1Model<V1ElementModelProps>;
|
|
45
|
-
settings: V1Model<V1ElementSettingsProps>;
|
|
46
|
-
children?: V1Element[] & {
|
|
47
|
-
findRecursive?: (predicate: (child: V1Element) => boolean) => V1Element | undefined;
|
|
48
|
-
forEachRecursive?: (callback: (child: V1Element) => void) => V1Element[];
|
|
77
|
+
model: V1Model$1<V1ElementModelProps$1>;
|
|
78
|
+
settings: V1Model$1<V1ElementSettingsProps$1>;
|
|
79
|
+
children?: V1Element$1[] & {
|
|
80
|
+
findRecursive?: (predicate: (child: V1Element$1) => boolean) => V1Element$1 | undefined;
|
|
81
|
+
forEachRecursive?: (callback: (child: V1Element$1) => void) => V1Element$1[];
|
|
49
82
|
};
|
|
50
83
|
view?: {
|
|
51
84
|
el?: HTMLElement;
|
|
@@ -54,19 +87,43 @@ type V1Element = {
|
|
|
54
87
|
get?: (index: number) => HTMLElement | undefined;
|
|
55
88
|
};
|
|
56
89
|
};
|
|
57
|
-
parent?: V1Element;
|
|
90
|
+
parent?: V1Element$1;
|
|
58
91
|
};
|
|
59
|
-
type
|
|
92
|
+
type ElementInteractions$1 = {
|
|
93
|
+
version: number;
|
|
94
|
+
items: InteractionItem$1[];
|
|
95
|
+
};
|
|
96
|
+
type InteractionItem$1 = {
|
|
97
|
+
interaction_id?: string;
|
|
98
|
+
animation: {
|
|
99
|
+
animation_type: string;
|
|
100
|
+
animation_id: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
type V1ElementModelProps$1 = {
|
|
104
|
+
isLocked?: boolean;
|
|
60
105
|
widgetType?: string;
|
|
61
106
|
elType: string;
|
|
62
107
|
id: string;
|
|
63
108
|
styles?: Record<StyleDefinitionID, StyleDefinition>;
|
|
64
|
-
elements?: V1Model<V1ElementModelProps>[];
|
|
65
|
-
settings?: V1ElementSettingsProps;
|
|
109
|
+
elements?: V1Model$1<V1ElementModelProps$1>[];
|
|
110
|
+
settings?: V1ElementSettingsProps$1;
|
|
111
|
+
editor_settings?: V1ElementEditorSettingsProps$1;
|
|
112
|
+
interactions?: string | ElementInteractions$1;
|
|
66
113
|
};
|
|
67
|
-
type
|
|
68
|
-
|
|
114
|
+
type V1ElementData = Omit<V1ElementModelProps$1, 'elements'> & {
|
|
115
|
+
elements?: V1ElementData[];
|
|
116
|
+
};
|
|
117
|
+
type V1ElementEditorSettingsProps$1 = {
|
|
118
|
+
title?: string;
|
|
119
|
+
initial_position?: number;
|
|
120
|
+
component_uid?: string;
|
|
121
|
+
};
|
|
122
|
+
type V1ElementSettingsProps$1 = Record<string, PropValue>;
|
|
123
|
+
type V1ElementConfig<T = object> = {
|
|
69
124
|
title: string;
|
|
125
|
+
widgetType?: string;
|
|
126
|
+
elType?: string;
|
|
70
127
|
controls: object;
|
|
71
128
|
atomic?: boolean;
|
|
72
129
|
atomic_controls?: ControlItem[];
|
|
@@ -76,8 +133,9 @@ type V1ElementConfig = {
|
|
|
76
133
|
twig_main_template?: string;
|
|
77
134
|
base_styles?: Record<string, StyleDefinition>;
|
|
78
135
|
base_styles_dictionary?: Record<string, string>;
|
|
79
|
-
|
|
80
|
-
|
|
136
|
+
atomic_style_states?: ClassState[];
|
|
137
|
+
} & T;
|
|
138
|
+
type V1Model$1<T> = {
|
|
81
139
|
get: <K extends keyof T>(key: K) => T[K];
|
|
82
140
|
set: <K extends keyof T>(key: K, value: T[K]) => void;
|
|
83
141
|
toJSON: (options?: {
|
|
@@ -85,10 +143,71 @@ type V1Model<T> = {
|
|
|
85
143
|
}) => T;
|
|
86
144
|
};
|
|
87
145
|
|
|
146
|
+
type ElementModel = {
|
|
147
|
+
id: string;
|
|
148
|
+
};
|
|
149
|
+
type ElementChildren = Record<string, ElementModel[]>;
|
|
150
|
+
declare function useElementChildren<T extends ElementChildren>(elementId: ElementID, childrenTypes: Record<string, string>): T;
|
|
151
|
+
|
|
152
|
+
declare const useElementEditorSettings: (elementId: ElementID) => V1ElementEditorSettingsProps$1;
|
|
153
|
+
|
|
88
154
|
declare const useElementSetting: <TValue>(elementId: ElementID, settingKey: string) => TValue | null;
|
|
89
155
|
declare const useElementSettings: <TValue>(elementId: ElementID, settingKeys: string[]) => Record<string, TValue>;
|
|
90
156
|
|
|
91
|
-
|
|
157
|
+
type V1Element = {
|
|
158
|
+
id: string;
|
|
159
|
+
model: V1Model<V1ElementModelProps>;
|
|
160
|
+
settings: V1Model<V1ElementSettingsProps>;
|
|
161
|
+
children?: V1Element[] & {
|
|
162
|
+
findRecursive?: (predicate: (child: V1Element) => boolean) => V1Element | undefined;
|
|
163
|
+
forEachRecursive?: (callback: (child: V1Element) => void) => V1Element[];
|
|
164
|
+
};
|
|
165
|
+
view?: {
|
|
166
|
+
el?: HTMLElement;
|
|
167
|
+
_index?: number;
|
|
168
|
+
getDomElement?: () => {
|
|
169
|
+
get?: (index: number) => HTMLElement | undefined;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
parent?: V1Element;
|
|
173
|
+
};
|
|
174
|
+
type ElementInteractions = {
|
|
175
|
+
version: number;
|
|
176
|
+
items: InteractionItem[];
|
|
177
|
+
};
|
|
178
|
+
type InteractionItem = {
|
|
179
|
+
interaction_id?: string;
|
|
180
|
+
animation: {
|
|
181
|
+
animation_type: string;
|
|
182
|
+
animation_id: string;
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
type V1ElementModelProps = {
|
|
186
|
+
isLocked?: boolean;
|
|
187
|
+
widgetType?: string;
|
|
188
|
+
elType: string;
|
|
189
|
+
id: string;
|
|
190
|
+
styles?: Record<StyleDefinitionID, StyleDefinition>;
|
|
191
|
+
elements?: V1Model<V1ElementModelProps>[];
|
|
192
|
+
settings?: V1ElementSettingsProps;
|
|
193
|
+
editor_settings?: V1ElementEditorSettingsProps;
|
|
194
|
+
interactions?: string | ElementInteractions;
|
|
195
|
+
};
|
|
196
|
+
type V1ElementEditorSettingsProps = {
|
|
197
|
+
title?: string;
|
|
198
|
+
initial_position?: number;
|
|
199
|
+
component_uid?: string;
|
|
200
|
+
};
|
|
201
|
+
type V1ElementSettingsProps = Record<string, PropValue>;
|
|
202
|
+
type V1Model<T> = {
|
|
203
|
+
get: <K extends keyof T>(key: K) => T[K];
|
|
204
|
+
set: <K extends keyof T>(key: K, value: T[K]) => void;
|
|
205
|
+
toJSON: (options?: {
|
|
206
|
+
remove?: string[];
|
|
207
|
+
}) => T;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
declare function useParentElement(elementId: string | null): V1Element | null | undefined;
|
|
92
211
|
|
|
93
212
|
declare function useSelectedElement(): {
|
|
94
213
|
element: null;
|
|
@@ -98,62 +217,60 @@ declare function useSelectedElement(): {
|
|
|
98
217
|
elementType: ElementType;
|
|
99
218
|
};
|
|
100
219
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
type ElementModel = {
|
|
104
|
-
id: string;
|
|
105
|
-
};
|
|
106
|
-
type ElementChildren = Record<string, ElementModel[]>;
|
|
107
|
-
declare function useElementChildren<T extends ElementChildren>(elementId: ElementID, childrenTypes: (keyof T & string)[]): T;
|
|
108
|
-
|
|
109
|
-
type Options$3 = {
|
|
220
|
+
type Options$4 = {
|
|
110
221
|
useHistory?: boolean;
|
|
111
222
|
at?: number;
|
|
112
223
|
clone?: boolean;
|
|
113
224
|
};
|
|
114
225
|
type CreateElementParams = {
|
|
115
226
|
containerId: string;
|
|
116
|
-
options?: Options$
|
|
117
|
-
model?: Omit<V1ElementModelProps, 'settings' | 'id'> & {
|
|
118
|
-
settings?: V1ElementSettingsProps;
|
|
227
|
+
options?: Options$4;
|
|
228
|
+
model?: Omit<V1ElementModelProps$1, 'settings' | 'id'> & {
|
|
229
|
+
settings?: V1ElementSettingsProps$1;
|
|
119
230
|
id?: string;
|
|
120
231
|
};
|
|
121
232
|
};
|
|
122
|
-
declare function createElement({ containerId, model, options }: CreateElementParams): V1Element;
|
|
233
|
+
declare function createElement({ containerId, model, options }: CreateElementParams): V1Element$1;
|
|
123
234
|
|
|
124
|
-
type
|
|
125
|
-
|
|
126
|
-
at?: number;
|
|
127
|
-
edit?: boolean;
|
|
128
|
-
};
|
|
129
|
-
type MoveElementParams = {
|
|
130
|
-
elementId: string;
|
|
131
|
-
targetContainerId: string;
|
|
132
|
-
options?: Options$2;
|
|
133
|
-
};
|
|
134
|
-
declare function moveElement({ elementId, targetContainerId, options }: MoveElementParams): V1Element;
|
|
135
|
-
|
|
136
|
-
type MoveElementsParams = {
|
|
137
|
-
moves: MoveElementParams[];
|
|
235
|
+
type CreateNestedElementsParams = {
|
|
236
|
+
elements: CreateElementParams[];
|
|
138
237
|
title: string;
|
|
139
238
|
subtitle?: string;
|
|
140
239
|
};
|
|
141
|
-
type
|
|
240
|
+
type CreatedElement = {
|
|
142
241
|
elementId: string;
|
|
143
|
-
|
|
144
|
-
|
|
242
|
+
model: V1ElementModelProps$1;
|
|
243
|
+
createParams: CreateElementParams;
|
|
145
244
|
};
|
|
146
|
-
type
|
|
147
|
-
|
|
148
|
-
originalPosition: OriginalPosition;
|
|
149
|
-
move: MoveElementParams;
|
|
150
|
-
element: V1Element;
|
|
245
|
+
type CreatedElementsResult = {
|
|
246
|
+
createdElements: CreatedElement[];
|
|
151
247
|
};
|
|
152
|
-
|
|
153
|
-
|
|
248
|
+
|
|
249
|
+
declare const createElements: ({ elements, title, subtitle, }: CreateNestedElementsParams) => CreatedElementsResult;
|
|
250
|
+
|
|
251
|
+
type Options$3 = {
|
|
252
|
+
useHistory?: boolean;
|
|
253
|
+
at?: number;
|
|
154
254
|
};
|
|
255
|
+
declare function deleteElement({ elementId, options, }: {
|
|
256
|
+
elementId: string;
|
|
257
|
+
options?: Options$3;
|
|
258
|
+
}): Promise<void>;
|
|
155
259
|
|
|
156
|
-
|
|
260
|
+
type Options$2 = {
|
|
261
|
+
useHistory?: boolean;
|
|
262
|
+
at?: number;
|
|
263
|
+
scrollIntoView: boolean;
|
|
264
|
+
};
|
|
265
|
+
type DropElementParams = {
|
|
266
|
+
containerId: string;
|
|
267
|
+
options?: Options$2;
|
|
268
|
+
model?: Omit<V1ElementModelProps$1, 'settings' | 'id'> & {
|
|
269
|
+
settings?: V1ElementSettingsProps$1;
|
|
270
|
+
id?: string;
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
declare function dropElement({ containerId, model, options }: DropElementParams): V1Element$1;
|
|
157
274
|
|
|
158
275
|
type Options$1 = {
|
|
159
276
|
useHistory?: boolean;
|
|
@@ -164,35 +281,20 @@ type DuplicateElementParams = {
|
|
|
164
281
|
elementId: string;
|
|
165
282
|
options?: Options$1;
|
|
166
283
|
};
|
|
167
|
-
declare function duplicateElement({ elementId, options }: DuplicateElementParams): V1Element;
|
|
168
|
-
|
|
169
|
-
type CreateNestedElementsParams = {
|
|
170
|
-
elements: CreateElementParams[];
|
|
171
|
-
title: string;
|
|
172
|
-
subtitle?: string;
|
|
173
|
-
};
|
|
174
|
-
type CreatedElement = {
|
|
175
|
-
elementId: string;
|
|
176
|
-
model: V1ElementModelProps;
|
|
177
|
-
createParams: CreateElementParams;
|
|
178
|
-
};
|
|
179
|
-
type CreatedElementsResult = {
|
|
180
|
-
createdElements: CreatedElement[];
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
declare const createElements: ({ elements, title, subtitle, }: CreateNestedElementsParams) => CreatedElementsResult;
|
|
284
|
+
declare function duplicateElement({ elementId, options }: DuplicateElementParams): V1Element$1;
|
|
184
285
|
|
|
185
286
|
type DuplicateElementsParams = {
|
|
186
287
|
elementIds: string[];
|
|
187
288
|
title: string;
|
|
188
289
|
subtitle?: string;
|
|
189
|
-
|
|
290
|
+
onDuplicateElements?: () => void;
|
|
291
|
+
onRestoreElements?: () => void;
|
|
190
292
|
};
|
|
191
293
|
type DuplicatedElement = {
|
|
192
294
|
id: string;
|
|
193
|
-
model: V1ElementModelProps;
|
|
295
|
+
model: V1ElementModelProps$1;
|
|
194
296
|
originalElementId: string;
|
|
195
|
-
modelToRestore?: V1ElementModelProps;
|
|
297
|
+
modelToRestore?: V1ElementModelProps$1;
|
|
196
298
|
parentContainerId?: string;
|
|
197
299
|
at?: number;
|
|
198
300
|
};
|
|
@@ -200,26 +302,82 @@ type DuplicatedElementsResult = {
|
|
|
200
302
|
duplicatedElements: DuplicatedElement[];
|
|
201
303
|
};
|
|
202
304
|
|
|
203
|
-
declare const duplicateElements: ({ elementIds, title, subtitle,
|
|
305
|
+
declare const duplicateElements: ({ elementIds, title, subtitle, onDuplicateElements, onRestoreElements, }: DuplicateElementsParams) => DuplicatedElementsResult;
|
|
306
|
+
|
|
307
|
+
declare const generateElementId: () => string;
|
|
308
|
+
|
|
309
|
+
declare function getContainer(id: string): V1Element$1 | null;
|
|
310
|
+
declare const selectElement: (elementId: string) => void;
|
|
311
|
+
|
|
312
|
+
declare function getCurrentDocumentContainer(): V1Element$1 | null;
|
|
313
|
+
|
|
314
|
+
declare function getCurrentDocumentId(): number | null;
|
|
315
|
+
|
|
316
|
+
declare function getElementEditorSettings(elementId: ElementID): V1ElementEditorSettingsProps$1;
|
|
317
|
+
|
|
318
|
+
declare function getElementLabel(elementId?: ElementID): string;
|
|
319
|
+
|
|
320
|
+
declare const getElementSetting: <TValue>(elementId: ElementID, settingKey: string) => TValue | null;
|
|
321
|
+
declare const getElementSettings: <TValue>(elementId: ElementID, settingKey: string[]) => Record<string, TValue | null>;
|
|
322
|
+
|
|
323
|
+
declare const getElementStyles: (elementID: ElementID) => Record<string, StyleDefinition> | null;
|
|
324
|
+
|
|
325
|
+
declare function getElementType(type: string): ElementType | null;
|
|
326
|
+
|
|
327
|
+
declare function getElements(root?: ElementID): V1Element$1[];
|
|
328
|
+
|
|
329
|
+
declare function getSelectedElements(): Element[];
|
|
330
|
+
|
|
331
|
+
type WidgetsCache<T> = Record<string, T>;
|
|
332
|
+
declare function getWidgetsCache<T extends V1ElementConfig>(): WidgetsCache<T> | null;
|
|
204
333
|
|
|
205
334
|
type Options = {
|
|
206
335
|
useHistory?: boolean;
|
|
207
336
|
at?: number;
|
|
337
|
+
edit?: boolean;
|
|
208
338
|
};
|
|
209
|
-
|
|
339
|
+
type MoveElementParams = {
|
|
210
340
|
elementId: string;
|
|
341
|
+
targetContainerId: string;
|
|
211
342
|
options?: Options;
|
|
212
|
-
}
|
|
343
|
+
};
|
|
344
|
+
declare function moveElement({ elementId, targetContainerId, options }: MoveElementParams): V1Element$1;
|
|
345
|
+
|
|
346
|
+
type MoveElementsParams = {
|
|
347
|
+
moves: MoveElementParams[];
|
|
348
|
+
title: string;
|
|
349
|
+
subtitle?: string;
|
|
350
|
+
onMoveElements?: () => void;
|
|
351
|
+
onRestoreElements?: () => void;
|
|
352
|
+
};
|
|
353
|
+
type OriginalPosition = {
|
|
354
|
+
elementId: string;
|
|
355
|
+
originalContainerId: string;
|
|
356
|
+
originalIndex: number;
|
|
357
|
+
};
|
|
358
|
+
type MovedElement = {
|
|
359
|
+
elementId: string;
|
|
360
|
+
originalPosition: OriginalPosition;
|
|
361
|
+
move: MoveElementParams;
|
|
362
|
+
element: V1Element$1;
|
|
363
|
+
};
|
|
364
|
+
type MovedElementsResult = {
|
|
365
|
+
movedElements: MovedElement[];
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
declare const moveElements: ({ moves: movesToMake, title, subtitle, onMoveElements, onRestoreElements, }: MoveElementsParams) => MovedElementsResult;
|
|
213
369
|
|
|
214
370
|
type RemoveNestedElementsParams = {
|
|
215
371
|
elementIds: string[];
|
|
216
372
|
title: string;
|
|
217
373
|
subtitle?: string;
|
|
374
|
+
onRemoveElements?: () => void;
|
|
375
|
+
onRestoreElements?: () => void;
|
|
218
376
|
};
|
|
219
377
|
type RemovedElement = {
|
|
220
378
|
elementId: string;
|
|
221
|
-
model: V1ElementModelProps;
|
|
222
|
-
parent: V1Element | null;
|
|
379
|
+
model: V1ElementModelProps$1;
|
|
380
|
+
parent: V1Element$1 | null;
|
|
223
381
|
at: number;
|
|
224
382
|
};
|
|
225
383
|
type RemovedElementsResult = {
|
|
@@ -227,25 +385,19 @@ type RemovedElementsResult = {
|
|
|
227
385
|
removedElements: RemovedElement[];
|
|
228
386
|
};
|
|
229
387
|
|
|
230
|
-
declare const removeElements: ({ elementIds, title, subtitle, }: RemoveNestedElementsParams) => RemovedElementsResult;
|
|
231
|
-
|
|
232
|
-
declare function getContainer(id: string): V1Element | null;
|
|
233
|
-
declare const selectElement: (elementId: string) => void;
|
|
234
|
-
|
|
235
|
-
declare const getElementSetting: <TValue>(elementId: ElementID, settingKey: string) => TValue | null;
|
|
236
|
-
declare const getElementSettings: <TValue>(elementId: ElementID, settingKey: string[]) => Record<string, TValue | null>;
|
|
237
|
-
|
|
238
|
-
declare const getElementStyles: (elementID: ElementID) => Record<string, StyleDefinition> | null;
|
|
239
|
-
|
|
240
|
-
declare function getElementLabel(elementId: ElementID): string;
|
|
388
|
+
declare const removeElements: ({ elementIds, title, subtitle, onRemoveElements, onRestoreElements, }: RemoveNestedElementsParams) => RemovedElementsResult;
|
|
241
389
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
390
|
+
type ReplaceElementArgs = {
|
|
391
|
+
currentElement: V1ElementData;
|
|
392
|
+
newElement: Omit<V1ElementModelProps$1, 'id'>;
|
|
393
|
+
withHistory?: boolean;
|
|
394
|
+
};
|
|
395
|
+
declare const replaceElement: ({ currentElement, newElement, withHistory }: ReplaceElementArgs) => void;
|
|
247
396
|
|
|
248
|
-
declare
|
|
397
|
+
declare const updateElementEditorSettings: ({ elementId, settings, }: {
|
|
398
|
+
elementId: string;
|
|
399
|
+
settings: V1ElementModelProps$1["editor_settings"];
|
|
400
|
+
}) => void;
|
|
249
401
|
|
|
250
402
|
type UpdateElementSettingsArgs = {
|
|
251
403
|
id: ElementID;
|
|
@@ -254,14 +406,19 @@ type UpdateElementSettingsArgs = {
|
|
|
254
406
|
};
|
|
255
407
|
declare const updateElementSettings: ({ id, props, withHistory }: UpdateElementSettingsArgs) => void;
|
|
256
408
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
409
|
+
type LinkInLinkRestriction = {
|
|
410
|
+
shouldRestrict: true;
|
|
411
|
+
reason: 'ancestor' | 'descendant';
|
|
412
|
+
elementId: string | null;
|
|
413
|
+
} | {
|
|
414
|
+
shouldRestrict: false;
|
|
415
|
+
reason?: never;
|
|
416
|
+
elementId?: never;
|
|
263
417
|
};
|
|
264
|
-
declare
|
|
418
|
+
declare function getLinkInLinkRestriction(elementId: string): LinkInLinkRestriction;
|
|
419
|
+
declare function getAnchoredDescendantId(elementId: string): string | null;
|
|
420
|
+
declare function getAnchoredAncestorId(elementId: string): string | null;
|
|
421
|
+
declare function isElementAnchored(elementId: string): boolean;
|
|
265
422
|
|
|
266
423
|
declare const ELEMENT_STYLE_CHANGE_EVENT = "elementor/editor-v2/editor-elements/style";
|
|
267
424
|
declare const styleRerenderEvents: (_elementor_editor_v1_adapters.CommandEventDescriptor | _elementor_editor_v1_adapters.WindowEventDescriptor)[];
|
|
@@ -282,6 +439,8 @@ declare function shouldCreateNewLocalStyle<T>(payload: {
|
|
|
282
439
|
provider: T | null;
|
|
283
440
|
} | null): boolean;
|
|
284
441
|
|
|
442
|
+
declare function deleteElementStyle(elementId: ElementID, styleId: StyleDefinitionID): void;
|
|
443
|
+
|
|
285
444
|
type UpdateElementStyleArgs = {
|
|
286
445
|
elementId: ElementID;
|
|
287
446
|
styleId: StyleDefinition['id'];
|
|
@@ -291,20 +450,16 @@ type UpdateElementStyleArgs = {
|
|
|
291
450
|
};
|
|
292
451
|
declare function updateElementStyle(args: UpdateElementStyleArgs): void;
|
|
293
452
|
|
|
294
|
-
declare
|
|
453
|
+
declare const useElementInteractions: (elementId: ElementID) => ElementInteractions$1;
|
|
295
454
|
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
elementId: string
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
declare function getLinkInLinkRestriction(elementId: string): LinkInLinkRestriction;
|
|
306
|
-
declare function getAnchoredDescendantId(elementId: string): string | null;
|
|
307
|
-
declare function getAnchoredAncestorId(elementId: string): string | null;
|
|
308
|
-
declare function isElementAnchored(elementId: string): boolean;
|
|
455
|
+
declare function getElementInteractions(elementId: ElementID): ElementInteractions$1 | undefined;
|
|
456
|
+
|
|
457
|
+
declare const updateElementInteractions: ({ elementId, interactions, }: {
|
|
458
|
+
elementId: string;
|
|
459
|
+
interactions: V1ElementModelProps$1["interactions"];
|
|
460
|
+
}) => void;
|
|
461
|
+
declare const playElementInteractions: (elementId: string, animationId: string) => void;
|
|
462
|
+
|
|
463
|
+
declare function initMcp(): void;
|
|
309
464
|
|
|
310
|
-
export { type Control, type ControlItem, type ControlLayout, type ControlsSection, type CreateElementParams, type CreateElementStyleArgs, type DuplicateElementParams, type DuplicateElementsParams, type DuplicatedElement, type DuplicatedElementsResult, ELEMENT_STYLE_CHANGE_EVENT, type Element, type ElementChildren, type ElementID, type ElementType, type LinkInLinkRestriction, type MoveElementParams, type MoveElementsParams, type MovedElement, type MovedElementsResult, type UpdateElementSettingsArgs, type UpdateElementStyleArgs, type V1Element, type V1ElementConfig, type V1ElementModelProps, type V1ElementSettingsProps, createElement, createElementStyle, createElements, deleteElement, deleteElementStyle, duplicateElement, duplicateElements, generateElementId, getAnchoredAncestorId, getAnchoredDescendantId, getContainer, getCurrentDocumentId, getElementLabel, getElementSetting, getElementSettings, getElementStyles, getElements, getLinkInLinkRestriction, getSelectedElements, getWidgetsCache, isElementAnchored, moveElement, moveElements, removeElements, replaceElement, selectElement, shouldCreateNewLocalStyle, styleRerenderEvents, updateElementSettings, updateElementStyle, useElementChildren, useElementSetting, useElementSettings,
|
|
465
|
+
export { type Control, type ControlItem, type ControlLayout, type ControlsSection, type CreateElementParams, type CreateElementStyleArgs, type DropElementParams, type DuplicateElementParams, type DuplicateElementsParams, type DuplicatedElement, type DuplicatedElementsResult, ELEMENT_STYLE_CHANGE_EVENT, type Element, type ElementChildren, type ElementControl, type ElementID, type ElementInteractions$1 as ElementInteractions, type ElementModel, type ElementType, type ExtendedWindow, type InteractionItem$1 as InteractionItem, type LinkInLinkRestriction, type MoveElementParams, type MoveElementsParams, type MovedElement, type MovedElementsResult, type UpdateElementSettingsArgs, type UpdateElementStyleArgs, type V1Element$1 as V1Element, type V1ElementConfig, type V1ElementData, type V1ElementEditorSettingsProps$1 as V1ElementEditorSettingsProps, type V1ElementModelProps$1 as V1ElementModelProps, type V1ElementSettingsProps$1 as V1ElementSettingsProps, createElement, createElementStyle, createElements, deleteElement, deleteElementStyle, dropElement, duplicateElement, duplicateElements, generateElementId, getAnchoredAncestorId, getAnchoredDescendantId, getContainer, getCurrentDocumentContainer, getCurrentDocumentId, getElementEditorSettings, getElementInteractions, getElementLabel, getElementSetting, getElementSettings, getElementStyles, getElementType, getElements, getLinkInLinkRestriction, getSelectedElements, getWidgetsCache, initMcp as initElementsMcp, isElementAnchored, moveElement, moveElements, playElementInteractions, removeElements, replaceElement, selectElement, shouldCreateNewLocalStyle, styleRerenderEvents, updateElementEditorSettings, updateElementInteractions, updateElementSettings, updateElementStyle, useElementChildren, useElementEditorSettings, useElementInteractions, useElementSetting, useElementSettings, useParentElement, useSelectedElement };
|