@elementor/elementor-mcp-common 4.1.0-754
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 +289 -0
- package/dist/index.d.ts +289 -0
- package/dist/index.js +461 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +403 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +45 -0
- package/src/editor-detection.ts +114 -0
- package/src/elements.ts +158 -0
- package/src/index.ts +52 -0
- package/src/nonce-refresh.ts +76 -0
- package/src/rest-client.ts +163 -0
- package/src/types.ts +186 -0
- package/src/utils.ts +46 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
type WaitForElementorOptions = {
|
|
2
|
+
maxRetries: number;
|
|
3
|
+
retryInterval?: number;
|
|
4
|
+
checkFn: () => boolean;
|
|
5
|
+
};
|
|
6
|
+
declare function isGutenbergEditor(): boolean;
|
|
7
|
+
declare function isElementorEditor(): boolean;
|
|
8
|
+
declare function isElementorAIActive(): boolean;
|
|
9
|
+
declare function hasGutenbergUI(): boolean;
|
|
10
|
+
declare function ensureElementorFrontend(): void;
|
|
11
|
+
declare function isElementorEditorReady(): boolean;
|
|
12
|
+
declare function waitForElementorEditor(): Promise<void>;
|
|
13
|
+
declare function waitForElementor(options?: WaitForElementorOptions): Promise<void>;
|
|
14
|
+
declare function whenElementorReady<T>(fn: () => T | Promise<T>, options?: WaitForElementorOptions): Promise<T>;
|
|
15
|
+
|
|
16
|
+
interface GutenbergBlockEditorDispatch {
|
|
17
|
+
updateBlockAttributes: (clientId: string, attributes: Record<string, unknown>) => void;
|
|
18
|
+
}
|
|
19
|
+
interface GutenbergBlockEditorSelect {
|
|
20
|
+
getBlock: (clientId: string) => {
|
|
21
|
+
name: string;
|
|
22
|
+
} | null;
|
|
23
|
+
}
|
|
24
|
+
interface GutenbergBlock {
|
|
25
|
+
name: string;
|
|
26
|
+
}
|
|
27
|
+
declare function injectElementCSS(elementId: string, css: string): void;
|
|
28
|
+
declare function removeElementCSS(elementId: string): void;
|
|
29
|
+
declare function updateElementSettings({ id, settings, }: {
|
|
30
|
+
id: string;
|
|
31
|
+
settings: Record<string, unknown>;
|
|
32
|
+
}): Promise<unknown>;
|
|
33
|
+
declare function getElementSettings(id: string): unknown;
|
|
34
|
+
declare function getGutenbergBlockEditorApis(): {
|
|
35
|
+
blockEditorDispatch: GutenbergBlockEditorDispatch;
|
|
36
|
+
blockEditorSelect: GutenbergBlockEditorSelect;
|
|
37
|
+
};
|
|
38
|
+
declare function validateAndGetGutenbergBlock(blockEditorSelect: GutenbergBlockEditorSelect, blockId: string): GutenbergBlock;
|
|
39
|
+
declare function updateGutenbergBlockAttributes(blockId: string, attributes: Record<string, unknown>): {
|
|
40
|
+
blockId: string;
|
|
41
|
+
blockName: string;
|
|
42
|
+
updatedAttributes: string[];
|
|
43
|
+
};
|
|
44
|
+
declare function extractElementImageData(targetElementId: string, fallbackImageId?: string, fallbackImageUrl?: string): {
|
|
45
|
+
imageId: string;
|
|
46
|
+
imageUrl: string;
|
|
47
|
+
};
|
|
48
|
+
declare function isSelectAllCheckbox(input: HTMLInputElement): boolean;
|
|
49
|
+
|
|
50
|
+
type WpApiResponse = unknown;
|
|
51
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS';
|
|
52
|
+
type CallWpApiOptions = {
|
|
53
|
+
binaryData?: ArrayBufferLike;
|
|
54
|
+
customHeaders?: Record<string, string>;
|
|
55
|
+
};
|
|
56
|
+
type CallWpApiResult<T> = {
|
|
57
|
+
data: T;
|
|
58
|
+
totalItems?: number;
|
|
59
|
+
totalPages?: number;
|
|
60
|
+
};
|
|
61
|
+
declare function callWpApi<T = WpApiResponse>(endpoint: string, method: HttpMethod, data?: Record<string, unknown>, options?: CallWpApiOptions): Promise<CallWpApiResult<T>>;
|
|
62
|
+
declare function extractJSONFromResponse(responseText: string): unknown;
|
|
63
|
+
|
|
64
|
+
declare function initNonceRefresh(): void;
|
|
65
|
+
declare function refreshNonce(): Promise<string>;
|
|
66
|
+
declare function isNonceError(status: number, responseText: string): boolean;
|
|
67
|
+
|
|
68
|
+
interface WpApiSettings {
|
|
69
|
+
nonce: string;
|
|
70
|
+
root: string;
|
|
71
|
+
}
|
|
72
|
+
interface ElementorContainer {
|
|
73
|
+
id: string;
|
|
74
|
+
model: {
|
|
75
|
+
id: string;
|
|
76
|
+
get: (key: string) => unknown;
|
|
77
|
+
attributes?: Record<string, unknown>;
|
|
78
|
+
editor_settings?: {
|
|
79
|
+
title?: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
settings: {
|
|
83
|
+
get: (key: string) => unknown;
|
|
84
|
+
attributes?: Record<string, unknown>;
|
|
85
|
+
controls?: Record<string, unknown>;
|
|
86
|
+
};
|
|
87
|
+
children?: ElementorContainer[];
|
|
88
|
+
view?: {
|
|
89
|
+
el: HTMLElement;
|
|
90
|
+
};
|
|
91
|
+
parent?: ElementorContainer;
|
|
92
|
+
}
|
|
93
|
+
interface ElementorDocument {
|
|
94
|
+
id: string;
|
|
95
|
+
container: ElementorContainer;
|
|
96
|
+
config?: {
|
|
97
|
+
type?: string;
|
|
98
|
+
settings?: Record<string, unknown>;
|
|
99
|
+
};
|
|
100
|
+
editor?: {
|
|
101
|
+
status?: string;
|
|
102
|
+
isChanged?: boolean;
|
|
103
|
+
};
|
|
104
|
+
history?: {
|
|
105
|
+
active?: boolean;
|
|
106
|
+
setActive?: (active: boolean) => void;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
interface ElementorChannels {
|
|
110
|
+
deviceMode?: {
|
|
111
|
+
request: (key?: string) => unknown;
|
|
112
|
+
};
|
|
113
|
+
dataEditMode?: {
|
|
114
|
+
request: (key?: string) => unknown;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
interface ElementorInstance {
|
|
118
|
+
documents: {
|
|
119
|
+
getCurrent: () => ElementorDocument | null;
|
|
120
|
+
get?: (id: string | number) => ElementorDocument | null;
|
|
121
|
+
};
|
|
122
|
+
getContainer: (id: string) => ElementorContainer | null;
|
|
123
|
+
getCurrentElement: () => {
|
|
124
|
+
model: {
|
|
125
|
+
id: string;
|
|
126
|
+
};
|
|
127
|
+
} | null;
|
|
128
|
+
on: (event: string, callback: () => void) => void;
|
|
129
|
+
config?: {
|
|
130
|
+
responsive?: {
|
|
131
|
+
breakpoints?: Record<string, unknown>;
|
|
132
|
+
};
|
|
133
|
+
controls?: Record<string, unknown>;
|
|
134
|
+
v4Promotions?: Record<string, unknown>;
|
|
135
|
+
default_schemes?: Record<string, unknown>;
|
|
136
|
+
atomicDynamicTags?: {
|
|
137
|
+
tags?: Record<string, unknown>;
|
|
138
|
+
groups?: Record<string, unknown>;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
helpers?: {
|
|
142
|
+
hasPro?: () => boolean;
|
|
143
|
+
enqueueFont?: (font: string) => void;
|
|
144
|
+
};
|
|
145
|
+
$preview?: [HTMLIFrameElement];
|
|
146
|
+
selection?: {
|
|
147
|
+
elements?: Record<string, unknown>;
|
|
148
|
+
getElements?: () => unknown[];
|
|
149
|
+
};
|
|
150
|
+
hooks?: {
|
|
151
|
+
addFilter: (name: string, callback: (...args: unknown[]) => unknown) => void;
|
|
152
|
+
};
|
|
153
|
+
dynamicTags?: {
|
|
154
|
+
getConfig: (key: string) => Record<string, unknown>;
|
|
155
|
+
tagDataToTagText: (id: string, name: string, settings: Record<string, unknown>) => string;
|
|
156
|
+
createTag?: (options: Record<string, unknown>) => unknown;
|
|
157
|
+
loadTagDataFromCache?: (tag: unknown, key: string) => unknown;
|
|
158
|
+
refreshCacheFromServer?: (tag: unknown, callback: () => void) => void;
|
|
159
|
+
};
|
|
160
|
+
widgetsCache?: Record<string, {
|
|
161
|
+
controls?: Record<string, unknown>;
|
|
162
|
+
title?: string;
|
|
163
|
+
atomic_controls?: unknown[];
|
|
164
|
+
}>;
|
|
165
|
+
channels?: ElementorChannels;
|
|
166
|
+
getPanelView?: () => {
|
|
167
|
+
getHeaderView?: () => {
|
|
168
|
+
setTitle?: (title: string) => void;
|
|
169
|
+
};
|
|
170
|
+
getCurrentPageView?: () => unknown;
|
|
171
|
+
};
|
|
172
|
+
getPreferences?: (key: string) => unknown;
|
|
173
|
+
changeEditMode?: (mode: string) => void;
|
|
174
|
+
modules?: Record<string, unknown>;
|
|
175
|
+
}
|
|
176
|
+
interface ElementorFrontendInstance {
|
|
177
|
+
elements: {
|
|
178
|
+
$body: JQuery & HTMLElement[];
|
|
179
|
+
};
|
|
180
|
+
on: (event: string, callback: () => void) => void;
|
|
181
|
+
config?: {
|
|
182
|
+
responsive?: {
|
|
183
|
+
activeBreakpoints?: Record<string, unknown>;
|
|
184
|
+
};
|
|
185
|
+
kit?: {
|
|
186
|
+
active_breakpoints?: string[];
|
|
187
|
+
};
|
|
188
|
+
experimentalFeatures?: Record<string, boolean>;
|
|
189
|
+
is_rtl?: boolean;
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
interface ElementorCommandsInstance {
|
|
193
|
+
run: (command: string, args?: Record<string, unknown>) => Promise<unknown>;
|
|
194
|
+
components: {
|
|
195
|
+
get: (name: string) => {
|
|
196
|
+
getCommands?: () => {
|
|
197
|
+
open?: {
|
|
198
|
+
registerConfig: {
|
|
199
|
+
command: string;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
close?: {
|
|
203
|
+
registerConfig: {
|
|
204
|
+
command: string;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
getNamespace?: () => string;
|
|
209
|
+
} | null;
|
|
210
|
+
getAll?: () => string[];
|
|
211
|
+
};
|
|
212
|
+
routes?: {
|
|
213
|
+
getAll?: () => string[];
|
|
214
|
+
isPartOf?: (route: string) => boolean;
|
|
215
|
+
to?: (route: string, args?: Record<string, unknown>) => void;
|
|
216
|
+
register?: (route: string, callback: () => void) => void;
|
|
217
|
+
saveState?: (namespace: string) => void;
|
|
218
|
+
back?: (namespace: string) => void;
|
|
219
|
+
getComponent?: (route: string) => {
|
|
220
|
+
getNamespace: () => string;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
data?: {
|
|
224
|
+
get?: (key: string) => Promise<unknown>;
|
|
225
|
+
};
|
|
226
|
+
modules?: {
|
|
227
|
+
hookData?: Record<string, unknown>;
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
interface WpDataInstance {
|
|
231
|
+
select: (store: string) => Record<string, unknown> | undefined;
|
|
232
|
+
dispatch: (store: string) => Record<string, unknown>;
|
|
233
|
+
}
|
|
234
|
+
interface JQuery {
|
|
235
|
+
resize: () => void;
|
|
236
|
+
[index: number]: HTMLElement;
|
|
237
|
+
}
|
|
238
|
+
interface ElementorCommonInstance {
|
|
239
|
+
eventsManager?: {
|
|
240
|
+
dispatchEvent?: (name: string, data: unknown, options?: Record<string, unknown>) => void;
|
|
241
|
+
canSendEvents?: () => boolean;
|
|
242
|
+
initializeMixpanel?: (onLoaded: (mpInstance?: unknown) => void) => void;
|
|
243
|
+
config?: Record<string, unknown>;
|
|
244
|
+
};
|
|
245
|
+
config?: {
|
|
246
|
+
isRTL?: boolean;
|
|
247
|
+
version?: string;
|
|
248
|
+
experimentalFeatures?: Record<string, boolean>;
|
|
249
|
+
urls?: Record<string, string>;
|
|
250
|
+
};
|
|
251
|
+
helpers?: {
|
|
252
|
+
getUniqueId?: () => number | string;
|
|
253
|
+
};
|
|
254
|
+
ajax?: {
|
|
255
|
+
addRequest?: (endpoint: string, options: {
|
|
256
|
+
success?: (data: unknown) => void;
|
|
257
|
+
}) => Promise<void>;
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
interface McpWindow {
|
|
262
|
+
elementor?: ElementorInstance;
|
|
263
|
+
elementorFrontend?: ElementorFrontendInstance;
|
|
264
|
+
$e?: ElementorCommandsInstance;
|
|
265
|
+
elementorCommon?: ElementorCommonInstance;
|
|
266
|
+
wpApiSettings?: WpApiSettings;
|
|
267
|
+
ajaxurl?: string;
|
|
268
|
+
wp?: {
|
|
269
|
+
data: WpDataInstance;
|
|
270
|
+
};
|
|
271
|
+
jQuery?: (selector: unknown) => {
|
|
272
|
+
on: (event: string, callback: (event: unknown, data: unknown) => void) => void;
|
|
273
|
+
get?: (index: number) => HTMLElement;
|
|
274
|
+
};
|
|
275
|
+
ElementorAiConfig?: Record<string, unknown>;
|
|
276
|
+
}
|
|
277
|
+
declare const getElementor: () => ElementorInstance | undefined;
|
|
278
|
+
declare const getElementorFrontend: () => ElementorFrontendInstance | undefined;
|
|
279
|
+
declare const get$e: () => ElementorCommandsInstance | undefined;
|
|
280
|
+
declare const getElementorCommon: () => ElementorCommonInstance | undefined;
|
|
281
|
+
declare const getWpApiSettings: () => WpApiSettings | undefined;
|
|
282
|
+
declare const getAjaxUrl: () => string | undefined;
|
|
283
|
+
declare const getWp: () => {
|
|
284
|
+
data: WpDataInstance;
|
|
285
|
+
} | undefined;
|
|
286
|
+
declare const getJQuery: () => McpWindow["jQuery"];
|
|
287
|
+
declare const getElementorAiConfig: () => Record<string, unknown> | undefined;
|
|
288
|
+
|
|
289
|
+
export { type ElementorChannels, type ElementorCommandsInstance, type ElementorCommonInstance, type ElementorContainer, type ElementorDocument, type ElementorFrontendInstance, type ElementorInstance, type JQuery, type WpApiSettings, type WpDataInstance, callWpApi, ensureElementorFrontend, extractElementImageData, extractJSONFromResponse, get$e, getAjaxUrl, getElementSettings, getElementor, getElementorAiConfig, getElementorCommon, getElementorFrontend, getGutenbergBlockEditorApis, getJQuery, getWp, getWpApiSettings, hasGutenbergUI, initNonceRefresh, injectElementCSS, isElementorAIActive, isElementorEditor, isElementorEditorReady, isGutenbergEditor, isNonceError, isSelectAllCheckbox, refreshNonce, removeElementCSS, updateElementSettings, updateGutenbergBlockAttributes, validateAndGetGutenbergBlock, waitForElementor, waitForElementorEditor, whenElementorReady };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
type WaitForElementorOptions = {
|
|
2
|
+
maxRetries: number;
|
|
3
|
+
retryInterval?: number;
|
|
4
|
+
checkFn: () => boolean;
|
|
5
|
+
};
|
|
6
|
+
declare function isGutenbergEditor(): boolean;
|
|
7
|
+
declare function isElementorEditor(): boolean;
|
|
8
|
+
declare function isElementorAIActive(): boolean;
|
|
9
|
+
declare function hasGutenbergUI(): boolean;
|
|
10
|
+
declare function ensureElementorFrontend(): void;
|
|
11
|
+
declare function isElementorEditorReady(): boolean;
|
|
12
|
+
declare function waitForElementorEditor(): Promise<void>;
|
|
13
|
+
declare function waitForElementor(options?: WaitForElementorOptions): Promise<void>;
|
|
14
|
+
declare function whenElementorReady<T>(fn: () => T | Promise<T>, options?: WaitForElementorOptions): Promise<T>;
|
|
15
|
+
|
|
16
|
+
interface GutenbergBlockEditorDispatch {
|
|
17
|
+
updateBlockAttributes: (clientId: string, attributes: Record<string, unknown>) => void;
|
|
18
|
+
}
|
|
19
|
+
interface GutenbergBlockEditorSelect {
|
|
20
|
+
getBlock: (clientId: string) => {
|
|
21
|
+
name: string;
|
|
22
|
+
} | null;
|
|
23
|
+
}
|
|
24
|
+
interface GutenbergBlock {
|
|
25
|
+
name: string;
|
|
26
|
+
}
|
|
27
|
+
declare function injectElementCSS(elementId: string, css: string): void;
|
|
28
|
+
declare function removeElementCSS(elementId: string): void;
|
|
29
|
+
declare function updateElementSettings({ id, settings, }: {
|
|
30
|
+
id: string;
|
|
31
|
+
settings: Record<string, unknown>;
|
|
32
|
+
}): Promise<unknown>;
|
|
33
|
+
declare function getElementSettings(id: string): unknown;
|
|
34
|
+
declare function getGutenbergBlockEditorApis(): {
|
|
35
|
+
blockEditorDispatch: GutenbergBlockEditorDispatch;
|
|
36
|
+
blockEditorSelect: GutenbergBlockEditorSelect;
|
|
37
|
+
};
|
|
38
|
+
declare function validateAndGetGutenbergBlock(blockEditorSelect: GutenbergBlockEditorSelect, blockId: string): GutenbergBlock;
|
|
39
|
+
declare function updateGutenbergBlockAttributes(blockId: string, attributes: Record<string, unknown>): {
|
|
40
|
+
blockId: string;
|
|
41
|
+
blockName: string;
|
|
42
|
+
updatedAttributes: string[];
|
|
43
|
+
};
|
|
44
|
+
declare function extractElementImageData(targetElementId: string, fallbackImageId?: string, fallbackImageUrl?: string): {
|
|
45
|
+
imageId: string;
|
|
46
|
+
imageUrl: string;
|
|
47
|
+
};
|
|
48
|
+
declare function isSelectAllCheckbox(input: HTMLInputElement): boolean;
|
|
49
|
+
|
|
50
|
+
type WpApiResponse = unknown;
|
|
51
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS';
|
|
52
|
+
type CallWpApiOptions = {
|
|
53
|
+
binaryData?: ArrayBufferLike;
|
|
54
|
+
customHeaders?: Record<string, string>;
|
|
55
|
+
};
|
|
56
|
+
type CallWpApiResult<T> = {
|
|
57
|
+
data: T;
|
|
58
|
+
totalItems?: number;
|
|
59
|
+
totalPages?: number;
|
|
60
|
+
};
|
|
61
|
+
declare function callWpApi<T = WpApiResponse>(endpoint: string, method: HttpMethod, data?: Record<string, unknown>, options?: CallWpApiOptions): Promise<CallWpApiResult<T>>;
|
|
62
|
+
declare function extractJSONFromResponse(responseText: string): unknown;
|
|
63
|
+
|
|
64
|
+
declare function initNonceRefresh(): void;
|
|
65
|
+
declare function refreshNonce(): Promise<string>;
|
|
66
|
+
declare function isNonceError(status: number, responseText: string): boolean;
|
|
67
|
+
|
|
68
|
+
interface WpApiSettings {
|
|
69
|
+
nonce: string;
|
|
70
|
+
root: string;
|
|
71
|
+
}
|
|
72
|
+
interface ElementorContainer {
|
|
73
|
+
id: string;
|
|
74
|
+
model: {
|
|
75
|
+
id: string;
|
|
76
|
+
get: (key: string) => unknown;
|
|
77
|
+
attributes?: Record<string, unknown>;
|
|
78
|
+
editor_settings?: {
|
|
79
|
+
title?: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
settings: {
|
|
83
|
+
get: (key: string) => unknown;
|
|
84
|
+
attributes?: Record<string, unknown>;
|
|
85
|
+
controls?: Record<string, unknown>;
|
|
86
|
+
};
|
|
87
|
+
children?: ElementorContainer[];
|
|
88
|
+
view?: {
|
|
89
|
+
el: HTMLElement;
|
|
90
|
+
};
|
|
91
|
+
parent?: ElementorContainer;
|
|
92
|
+
}
|
|
93
|
+
interface ElementorDocument {
|
|
94
|
+
id: string;
|
|
95
|
+
container: ElementorContainer;
|
|
96
|
+
config?: {
|
|
97
|
+
type?: string;
|
|
98
|
+
settings?: Record<string, unknown>;
|
|
99
|
+
};
|
|
100
|
+
editor?: {
|
|
101
|
+
status?: string;
|
|
102
|
+
isChanged?: boolean;
|
|
103
|
+
};
|
|
104
|
+
history?: {
|
|
105
|
+
active?: boolean;
|
|
106
|
+
setActive?: (active: boolean) => void;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
interface ElementorChannels {
|
|
110
|
+
deviceMode?: {
|
|
111
|
+
request: (key?: string) => unknown;
|
|
112
|
+
};
|
|
113
|
+
dataEditMode?: {
|
|
114
|
+
request: (key?: string) => unknown;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
interface ElementorInstance {
|
|
118
|
+
documents: {
|
|
119
|
+
getCurrent: () => ElementorDocument | null;
|
|
120
|
+
get?: (id: string | number) => ElementorDocument | null;
|
|
121
|
+
};
|
|
122
|
+
getContainer: (id: string) => ElementorContainer | null;
|
|
123
|
+
getCurrentElement: () => {
|
|
124
|
+
model: {
|
|
125
|
+
id: string;
|
|
126
|
+
};
|
|
127
|
+
} | null;
|
|
128
|
+
on: (event: string, callback: () => void) => void;
|
|
129
|
+
config?: {
|
|
130
|
+
responsive?: {
|
|
131
|
+
breakpoints?: Record<string, unknown>;
|
|
132
|
+
};
|
|
133
|
+
controls?: Record<string, unknown>;
|
|
134
|
+
v4Promotions?: Record<string, unknown>;
|
|
135
|
+
default_schemes?: Record<string, unknown>;
|
|
136
|
+
atomicDynamicTags?: {
|
|
137
|
+
tags?: Record<string, unknown>;
|
|
138
|
+
groups?: Record<string, unknown>;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
helpers?: {
|
|
142
|
+
hasPro?: () => boolean;
|
|
143
|
+
enqueueFont?: (font: string) => void;
|
|
144
|
+
};
|
|
145
|
+
$preview?: [HTMLIFrameElement];
|
|
146
|
+
selection?: {
|
|
147
|
+
elements?: Record<string, unknown>;
|
|
148
|
+
getElements?: () => unknown[];
|
|
149
|
+
};
|
|
150
|
+
hooks?: {
|
|
151
|
+
addFilter: (name: string, callback: (...args: unknown[]) => unknown) => void;
|
|
152
|
+
};
|
|
153
|
+
dynamicTags?: {
|
|
154
|
+
getConfig: (key: string) => Record<string, unknown>;
|
|
155
|
+
tagDataToTagText: (id: string, name: string, settings: Record<string, unknown>) => string;
|
|
156
|
+
createTag?: (options: Record<string, unknown>) => unknown;
|
|
157
|
+
loadTagDataFromCache?: (tag: unknown, key: string) => unknown;
|
|
158
|
+
refreshCacheFromServer?: (tag: unknown, callback: () => void) => void;
|
|
159
|
+
};
|
|
160
|
+
widgetsCache?: Record<string, {
|
|
161
|
+
controls?: Record<string, unknown>;
|
|
162
|
+
title?: string;
|
|
163
|
+
atomic_controls?: unknown[];
|
|
164
|
+
}>;
|
|
165
|
+
channels?: ElementorChannels;
|
|
166
|
+
getPanelView?: () => {
|
|
167
|
+
getHeaderView?: () => {
|
|
168
|
+
setTitle?: (title: string) => void;
|
|
169
|
+
};
|
|
170
|
+
getCurrentPageView?: () => unknown;
|
|
171
|
+
};
|
|
172
|
+
getPreferences?: (key: string) => unknown;
|
|
173
|
+
changeEditMode?: (mode: string) => void;
|
|
174
|
+
modules?: Record<string, unknown>;
|
|
175
|
+
}
|
|
176
|
+
interface ElementorFrontendInstance {
|
|
177
|
+
elements: {
|
|
178
|
+
$body: JQuery & HTMLElement[];
|
|
179
|
+
};
|
|
180
|
+
on: (event: string, callback: () => void) => void;
|
|
181
|
+
config?: {
|
|
182
|
+
responsive?: {
|
|
183
|
+
activeBreakpoints?: Record<string, unknown>;
|
|
184
|
+
};
|
|
185
|
+
kit?: {
|
|
186
|
+
active_breakpoints?: string[];
|
|
187
|
+
};
|
|
188
|
+
experimentalFeatures?: Record<string, boolean>;
|
|
189
|
+
is_rtl?: boolean;
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
interface ElementorCommandsInstance {
|
|
193
|
+
run: (command: string, args?: Record<string, unknown>) => Promise<unknown>;
|
|
194
|
+
components: {
|
|
195
|
+
get: (name: string) => {
|
|
196
|
+
getCommands?: () => {
|
|
197
|
+
open?: {
|
|
198
|
+
registerConfig: {
|
|
199
|
+
command: string;
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
close?: {
|
|
203
|
+
registerConfig: {
|
|
204
|
+
command: string;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
getNamespace?: () => string;
|
|
209
|
+
} | null;
|
|
210
|
+
getAll?: () => string[];
|
|
211
|
+
};
|
|
212
|
+
routes?: {
|
|
213
|
+
getAll?: () => string[];
|
|
214
|
+
isPartOf?: (route: string) => boolean;
|
|
215
|
+
to?: (route: string, args?: Record<string, unknown>) => void;
|
|
216
|
+
register?: (route: string, callback: () => void) => void;
|
|
217
|
+
saveState?: (namespace: string) => void;
|
|
218
|
+
back?: (namespace: string) => void;
|
|
219
|
+
getComponent?: (route: string) => {
|
|
220
|
+
getNamespace: () => string;
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
data?: {
|
|
224
|
+
get?: (key: string) => Promise<unknown>;
|
|
225
|
+
};
|
|
226
|
+
modules?: {
|
|
227
|
+
hookData?: Record<string, unknown>;
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
interface WpDataInstance {
|
|
231
|
+
select: (store: string) => Record<string, unknown> | undefined;
|
|
232
|
+
dispatch: (store: string) => Record<string, unknown>;
|
|
233
|
+
}
|
|
234
|
+
interface JQuery {
|
|
235
|
+
resize: () => void;
|
|
236
|
+
[index: number]: HTMLElement;
|
|
237
|
+
}
|
|
238
|
+
interface ElementorCommonInstance {
|
|
239
|
+
eventsManager?: {
|
|
240
|
+
dispatchEvent?: (name: string, data: unknown, options?: Record<string, unknown>) => void;
|
|
241
|
+
canSendEvents?: () => boolean;
|
|
242
|
+
initializeMixpanel?: (onLoaded: (mpInstance?: unknown) => void) => void;
|
|
243
|
+
config?: Record<string, unknown>;
|
|
244
|
+
};
|
|
245
|
+
config?: {
|
|
246
|
+
isRTL?: boolean;
|
|
247
|
+
version?: string;
|
|
248
|
+
experimentalFeatures?: Record<string, boolean>;
|
|
249
|
+
urls?: Record<string, string>;
|
|
250
|
+
};
|
|
251
|
+
helpers?: {
|
|
252
|
+
getUniqueId?: () => number | string;
|
|
253
|
+
};
|
|
254
|
+
ajax?: {
|
|
255
|
+
addRequest?: (endpoint: string, options: {
|
|
256
|
+
success?: (data: unknown) => void;
|
|
257
|
+
}) => Promise<void>;
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
interface McpWindow {
|
|
262
|
+
elementor?: ElementorInstance;
|
|
263
|
+
elementorFrontend?: ElementorFrontendInstance;
|
|
264
|
+
$e?: ElementorCommandsInstance;
|
|
265
|
+
elementorCommon?: ElementorCommonInstance;
|
|
266
|
+
wpApiSettings?: WpApiSettings;
|
|
267
|
+
ajaxurl?: string;
|
|
268
|
+
wp?: {
|
|
269
|
+
data: WpDataInstance;
|
|
270
|
+
};
|
|
271
|
+
jQuery?: (selector: unknown) => {
|
|
272
|
+
on: (event: string, callback: (event: unknown, data: unknown) => void) => void;
|
|
273
|
+
get?: (index: number) => HTMLElement;
|
|
274
|
+
};
|
|
275
|
+
ElementorAiConfig?: Record<string, unknown>;
|
|
276
|
+
}
|
|
277
|
+
declare const getElementor: () => ElementorInstance | undefined;
|
|
278
|
+
declare const getElementorFrontend: () => ElementorFrontendInstance | undefined;
|
|
279
|
+
declare const get$e: () => ElementorCommandsInstance | undefined;
|
|
280
|
+
declare const getElementorCommon: () => ElementorCommonInstance | undefined;
|
|
281
|
+
declare const getWpApiSettings: () => WpApiSettings | undefined;
|
|
282
|
+
declare const getAjaxUrl: () => string | undefined;
|
|
283
|
+
declare const getWp: () => {
|
|
284
|
+
data: WpDataInstance;
|
|
285
|
+
} | undefined;
|
|
286
|
+
declare const getJQuery: () => McpWindow["jQuery"];
|
|
287
|
+
declare const getElementorAiConfig: () => Record<string, unknown> | undefined;
|
|
288
|
+
|
|
289
|
+
export { type ElementorChannels, type ElementorCommandsInstance, type ElementorCommonInstance, type ElementorContainer, type ElementorDocument, type ElementorFrontendInstance, type ElementorInstance, type JQuery, type WpApiSettings, type WpDataInstance, callWpApi, ensureElementorFrontend, extractElementImageData, extractJSONFromResponse, get$e, getAjaxUrl, getElementSettings, getElementor, getElementorAiConfig, getElementorCommon, getElementorFrontend, getGutenbergBlockEditorApis, getJQuery, getWp, getWpApiSettings, hasGutenbergUI, initNonceRefresh, injectElementCSS, isElementorAIActive, isElementorEditor, isElementorEditorReady, isGutenbergEditor, isNonceError, isSelectAllCheckbox, refreshNonce, removeElementCSS, updateElementSettings, updateGutenbergBlockAttributes, validateAndGetGutenbergBlock, waitForElementor, waitForElementorEditor, whenElementorReady };
|