@elementor/elementor-v3-mcp 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 +70 -0
- package/dist/index.d.ts +70 -0
- package/dist/index.js +1161 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1125 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +50 -0
- package/src/context.ts +211 -0
- package/src/elementor-mcp-server.ts +95 -0
- package/src/index.ts +22 -0
- package/src/init.ts +5 -0
- package/src/resources.ts +186 -0
- package/src/tools/ai-tool.ts +58 -0
- package/src/tools/dynamic-tool.ts +236 -0
- package/src/tools/index.ts +6 -0
- package/src/tools/page-tool.ts +222 -0
- package/src/tools/routes-tool.ts +138 -0
- package/src/tools/styling-tool.ts +131 -0
- package/src/tools/ui-tool.ts +100 -0
- package/src/types.ts +120 -0
- package/src/utils.ts +211 -0
- package/src/validation-helpers.ts +29 -0
- package/src/widget-mandatory-fields.ts +68 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ElementorContainer } from './types';
|
|
2
|
+
|
|
3
|
+
export function validateDocumentSettingsUpdated( container: ElementorContainer ): void {
|
|
4
|
+
const updatedSettings = container.settings.attributes;
|
|
5
|
+
|
|
6
|
+
if ( ! updatedSettings ) {
|
|
7
|
+
throw new Error( 'Document settings update failed: Settings not accessible' );
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function validateDynamicTagEnabled( container: ElementorContainer, controlName: string ): void {
|
|
12
|
+
const modelSettings = container.model?.attributes?.settings as Record< string, unknown > | undefined;
|
|
13
|
+
const controlValue = modelSettings?.[ controlName ];
|
|
14
|
+
const hasDynamic = controlValue && typeof controlValue === 'object' && '__dynamic__' in controlValue;
|
|
15
|
+
|
|
16
|
+
if ( ! hasDynamic ) {
|
|
17
|
+
throw new Error( `Dynamic tag enable failed: Tag not found for ${ controlName }` );
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function validateDynamicTagDisabled( container: ElementorContainer, controlName: string ): void {
|
|
22
|
+
const modelSettings = container.model?.attributes?.settings as Record< string, unknown > | undefined;
|
|
23
|
+
const controlValue = modelSettings?.[ controlName ];
|
|
24
|
+
const stillHasDynamic = controlValue && typeof controlValue === 'object' && '__dynamic__' in controlValue;
|
|
25
|
+
|
|
26
|
+
if ( stillHasDynamic ) {
|
|
27
|
+
throw new Error( `Dynamic tag disable failed: Tag still exists for ${ controlName }` );
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const widgetMandatoryFields: Record< string, { mandatory: string; default: string }[] > = {
|
|
2
|
+
_background_color: [
|
|
3
|
+
{
|
|
4
|
+
mandatory: '_background_background',
|
|
5
|
+
default: 'classic',
|
|
6
|
+
},
|
|
7
|
+
],
|
|
8
|
+
_background_image: [
|
|
9
|
+
{
|
|
10
|
+
mandatory: '_background_background',
|
|
11
|
+
default: 'classic',
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
_background_color_b: [
|
|
15
|
+
{
|
|
16
|
+
mandatory: '_background_background',
|
|
17
|
+
default: 'gradient',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
_background_gradient_type: [
|
|
21
|
+
{
|
|
22
|
+
mandatory: '_background_background',
|
|
23
|
+
default: 'gradient',
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
_background_color_stop: [
|
|
27
|
+
{
|
|
28
|
+
mandatory: '_background_background',
|
|
29
|
+
default: 'gradient',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
_border_width: [
|
|
33
|
+
{
|
|
34
|
+
mandatory: '_border_border',
|
|
35
|
+
default: 'solid',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
_border_color: [
|
|
39
|
+
{
|
|
40
|
+
mandatory: '_border_border',
|
|
41
|
+
default: 'solid',
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
background_color: [
|
|
45
|
+
{
|
|
46
|
+
mandatory: 'background_background',
|
|
47
|
+
default: 'classic',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
background_overlay_color: [
|
|
51
|
+
{
|
|
52
|
+
mandatory: 'background_overlay_background',
|
|
53
|
+
default: 'classic',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
background_overlay_image: [
|
|
57
|
+
{
|
|
58
|
+
mandatory: 'background_overlay_background',
|
|
59
|
+
default: 'classic',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
background_overlay_color_b: [
|
|
63
|
+
{
|
|
64
|
+
mandatory: 'background_overlay_background',
|
|
65
|
+
default: 'gradient',
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
};
|