@elementor/editor-canvas 4.3.0-1000 → 4.3.0-1001

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.js CHANGED
@@ -81,10 +81,10 @@ var BEST_PRACTICES_FULL_URI = `${CANVAS_SERVER_NAME}_${BEST_PRACTICES_URI}`;
81
81
  var MCP_PROXY_URL = "elementor/v1/mcp-proxy";
82
82
  var listWidgetTypes = async () => {
83
83
  const { data } = await (0, import_http_client.httpService)().post(MCP_PROXY_URL, {
84
- tool: "list-widgets",
85
- input: {}
84
+ tool: "list-widget-schemas",
85
+ input: { summary: true }
86
86
  });
87
- return (data.data ?? []).map((widget) => widget.type);
87
+ return (data.data?.widgets ?? []).map((widget) => widget.type);
88
88
  };
89
89
  var fetchWidgetSchema = async (widgetType) => {
90
90
  const { data } = await (0, import_http_client.httpService)().post(MCP_PROXY_URL, {
@@ -3968,15 +3968,15 @@ var import_http_client3 = require("@elementor/http-client");
3968
3968
  var MCP_PROXY_URL2 = "elementor/v1/mcp-proxy";
3969
3969
  var AVAILABLE_WIDGETS_URI = "elementor://context/available-widgets";
3970
3970
  var AVAILABLE_WIDGETS_URI_V4 = "elementor://context/available-widgets/v4";
3971
- var fetchWidgets = async (version) => {
3971
+ var fetchWidgets = async () => {
3972
3972
  const { data } = await (0, import_http_client3.httpService)().post(MCP_PROXY_URL2, {
3973
- tool: "list-widgets",
3974
- input: version ? { version } : {}
3973
+ tool: "list-widget-schemas",
3974
+ input: { summary: true }
3975
3975
  });
3976
- return data.data ?? [];
3976
+ return data.data?.widgets ?? [];
3977
3977
  };
3978
- var buildContents = async (uri, version) => {
3979
- const widgets = await fetchWidgets(version);
3978
+ var buildContents = async (uri) => {
3979
+ const widgets = await fetchWidgets();
3980
3980
  return {
3981
3981
  contents: [
3982
3982
  {
@@ -3995,13 +3995,13 @@ var initAvailableWidgetsResource = (reg) => {
3995
3995
  {
3996
3996
  description: "All registered v4 version widgets"
3997
3997
  },
3998
- async () => buildContents(AVAILABLE_WIDGETS_URI_V4, "v4")
3998
+ async () => buildContents(AVAILABLE_WIDGETS_URI_V4)
3999
3999
  );
4000
4000
  resource(
4001
4001
  "available-widgets",
4002
4002
  AVAILABLE_WIDGETS_URI,
4003
4003
  {
4004
- description: "All registered widget types with v3/v4 version metadata and description."
4004
+ description: "All registered v4 widget types with description."
4005
4005
  },
4006
4006
  async () => buildContents(AVAILABLE_WIDGETS_URI)
4007
4007
  );
package/dist/index.mjs CHANGED
@@ -12,10 +12,10 @@ var BEST_PRACTICES_FULL_URI = `${CANVAS_SERVER_NAME}_${BEST_PRACTICES_URI}`;
12
12
  var MCP_PROXY_URL = "elementor/v1/mcp-proxy";
13
13
  var listWidgetTypes = async () => {
14
14
  const { data } = await httpService().post(MCP_PROXY_URL, {
15
- tool: "list-widgets",
16
- input: {}
15
+ tool: "list-widget-schemas",
16
+ input: { summary: true }
17
17
  });
18
- return (data.data ?? []).map((widget) => widget.type);
18
+ return (data.data?.widgets ?? []).map((widget) => widget.type);
19
19
  };
20
20
  var fetchWidgetSchema = async (widgetType) => {
21
21
  const { data } = await httpService().post(MCP_PROXY_URL, {
@@ -3929,15 +3929,15 @@ import { httpService as httpService3 } from "@elementor/http-client";
3929
3929
  var MCP_PROXY_URL2 = "elementor/v1/mcp-proxy";
3930
3930
  var AVAILABLE_WIDGETS_URI = "elementor://context/available-widgets";
3931
3931
  var AVAILABLE_WIDGETS_URI_V4 = "elementor://context/available-widgets/v4";
3932
- var fetchWidgets = async (version) => {
3932
+ var fetchWidgets = async () => {
3933
3933
  const { data } = await httpService3().post(MCP_PROXY_URL2, {
3934
- tool: "list-widgets",
3935
- input: version ? { version } : {}
3934
+ tool: "list-widget-schemas",
3935
+ input: { summary: true }
3936
3936
  });
3937
- return data.data ?? [];
3937
+ return data.data?.widgets ?? [];
3938
3938
  };
3939
- var buildContents = async (uri, version) => {
3940
- const widgets = await fetchWidgets(version);
3939
+ var buildContents = async (uri) => {
3940
+ const widgets = await fetchWidgets();
3941
3941
  return {
3942
3942
  contents: [
3943
3943
  {
@@ -3956,13 +3956,13 @@ var initAvailableWidgetsResource = (reg) => {
3956
3956
  {
3957
3957
  description: "All registered v4 version widgets"
3958
3958
  },
3959
- async () => buildContents(AVAILABLE_WIDGETS_URI_V4, "v4")
3959
+ async () => buildContents(AVAILABLE_WIDGETS_URI_V4)
3960
3960
  );
3961
3961
  resource(
3962
3962
  "available-widgets",
3963
3963
  AVAILABLE_WIDGETS_URI,
3964
3964
  {
3965
- description: "All registered widget types with v3/v4 version metadata and description."
3965
+ description: "All registered v4 widget types with description."
3966
3966
  },
3967
3967
  async () => buildContents(AVAILABLE_WIDGETS_URI)
3968
3968
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-canvas",
3
3
  "description": "Elementor Editor Canvas",
4
- "version": "4.3.0-1000",
4
+ "version": "4.3.0-1001",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -37,26 +37,26 @@
37
37
  "react-dom": "^18.3.1"
38
38
  },
39
39
  "dependencies": {
40
- "@elementor/editor": "4.3.0-1000",
41
- "@elementor/editor-controls": "4.3.0-1000",
42
- "@elementor/editor-documents": "4.3.0-1000",
43
- "@elementor/editor-elements": "4.3.0-1000",
44
- "@elementor/editor-interactions": "4.3.0-1000",
45
- "@elementor/editor-mcp": "4.3.0-1000",
46
- "@elementor/editor-notifications": "4.3.0-1000",
47
- "@elementor/editor-props": "4.3.0-1000",
48
- "@elementor/editor-responsive": "4.3.0-1000",
49
- "@elementor/editor-styles": "4.3.0-1000",
50
- "@elementor/editor-styles-repository": "4.3.0-1000",
51
- "@elementor/editor-ui": "4.3.0-1000",
52
- "@elementor/editor-v1-adapters": "4.3.0-1000",
53
- "@elementor/events": "4.3.0-1000",
54
- "@elementor/http-client": "4.3.0-1000",
55
- "@elementor/schema": "4.3.0-1000",
56
- "@elementor/twing": "4.3.0-1000",
40
+ "@elementor/editor": "4.3.0-1001",
41
+ "@elementor/editor-controls": "4.3.0-1001",
42
+ "@elementor/editor-documents": "4.3.0-1001",
43
+ "@elementor/editor-elements": "4.3.0-1001",
44
+ "@elementor/editor-interactions": "4.3.0-1001",
45
+ "@elementor/editor-mcp": "4.3.0-1001",
46
+ "@elementor/editor-notifications": "4.3.0-1001",
47
+ "@elementor/editor-props": "4.3.0-1001",
48
+ "@elementor/editor-responsive": "4.3.0-1001",
49
+ "@elementor/editor-styles": "4.3.0-1001",
50
+ "@elementor/editor-styles-repository": "4.3.0-1001",
51
+ "@elementor/editor-ui": "4.3.0-1001",
52
+ "@elementor/editor-v1-adapters": "4.3.0-1001",
53
+ "@elementor/events": "4.3.0-1001",
54
+ "@elementor/http-client": "4.3.0-1001",
55
+ "@elementor/schema": "4.3.0-1001",
56
+ "@elementor/twing": "4.3.0-1001",
57
57
  "@elementor/ui": "1.37.5",
58
- "@elementor/utils": "4.3.0-1000",
59
- "@elementor/wp-media": "4.3.0-1000",
58
+ "@elementor/utils": "4.3.0-1001",
59
+ "@elementor/wp-media": "4.3.0-1001",
60
60
  "@floating-ui/react": "^0.27.5",
61
61
  "@wordpress/i18n": "^5.13.0",
62
62
  "dompurify": "^3.2.6"
@@ -28,14 +28,16 @@ describe( 'available-widgets-resource', () => {
28
28
  jest.clearAllMocks();
29
29
  } );
30
30
 
31
- it( 'fetches all widgets via list-widgets without a version filter', async () => {
31
+ it( 'fetches all widgets via list-widget-schemas with summary=true', async () => {
32
32
  // Arrange
33
33
  const post = jest.fn().mockResolvedValue( {
34
34
  data: {
35
- data: [
36
- { type: 'e-heading', version: 'v4' },
37
- { type: 'legacy-icon', version: 'v3' },
38
- ],
35
+ data: {
36
+ widgets: [
37
+ { type: 'e-heading', description: 'A heading widget' },
38
+ { type: 'e-button', description: 'A button widget' },
39
+ ],
40
+ },
39
41
  },
40
42
  } );
41
43
  mockedHttpService.mockReturnValue( { post } as never );
@@ -45,16 +47,21 @@ describe( 'available-widgets-resource', () => {
45
47
  const result = await allHandler();
46
48
 
47
49
  // Assert
48
- expect( post ).toHaveBeenCalledWith( 'elementor/v1/mcp-proxy', { tool: 'list-widgets', input: {} } );
50
+ expect( post ).toHaveBeenCalledWith( 'elementor/v1/mcp-proxy', {
51
+ tool: 'list-widget-schemas',
52
+ input: { summary: true },
53
+ } );
49
54
  expect( JSON.parse( result.contents[ 0 ].text ) ).toEqual( [
50
- { type: 'e-heading', version: 'v4' },
51
- { type: 'legacy-icon', version: 'v3' },
55
+ { type: 'e-heading', description: 'A heading widget' },
56
+ { type: 'e-button', description: 'A button widget' },
52
57
  ] );
53
58
  } );
54
59
 
55
- it( 'fetches only v4 widgets via list-widgets with a version filter', async () => {
60
+ it( 'fetches v4 widgets via list-widget-schemas with summary=true', async () => {
56
61
  // Arrange
57
- const post = jest.fn().mockResolvedValue( { data: { data: [ { type: 'e-heading', version: 'v4' } ] } } );
62
+ const post = jest.fn().mockResolvedValue( {
63
+ data: { data: { widgets: [ { type: 'e-heading', description: 'A heading widget' } ] } },
64
+ } );
58
65
  mockedHttpService.mockReturnValue( { post } as never );
59
66
  const { v4Handler } = captureHandlers();
60
67
 
@@ -63,10 +70,12 @@ describe( 'available-widgets-resource', () => {
63
70
 
64
71
  // Assert
65
72
  expect( post ).toHaveBeenCalledWith( 'elementor/v1/mcp-proxy', {
66
- tool: 'list-widgets',
67
- input: { version: 'v4' },
73
+ tool: 'list-widget-schemas',
74
+ input: { summary: true },
68
75
  } );
69
- expect( JSON.parse( result.contents[ 0 ].text ) ).toEqual( [ { type: 'e-heading', version: 'v4' } ] );
76
+ expect( JSON.parse( result.contents[ 0 ].text ) ).toEqual( [
77
+ { type: 'e-heading', description: 'A heading widget' },
78
+ ] );
70
79
  } );
71
80
 
72
81
  it( 'exposes the expected resource URIs', () => {
@@ -40,14 +40,16 @@ describe( 'widgets-schema-resource', () => {
40
40
  jest.clearAllMocks();
41
41
  } );
42
42
 
43
- it( 'lists widget types fetched from the server via the list-widgets tool', async () => {
43
+ it( 'lists widget types fetched from the server via list-widget-schemas with summary=true', async () => {
44
44
  // Arrange
45
45
  const post = jest.fn().mockResolvedValue( {
46
46
  data: {
47
- data: [
48
- { type: 'e-heading', version: 'v4' },
49
- { type: 'e-button', version: 'v4' },
50
- ],
47
+ data: {
48
+ widgets: [
49
+ { type: 'e-heading', description: 'A heading widget' },
50
+ { type: 'e-button', description: 'A button widget' },
51
+ ],
52
+ },
51
53
  },
52
54
  } );
53
55
  mockedHttpService.mockReturnValue( { post } as never );
@@ -57,7 +59,10 @@ describe( 'widgets-schema-resource', () => {
57
59
  const result = await list();
58
60
 
59
61
  // Assert
60
- expect( post ).toHaveBeenCalledWith( 'elementor/v1/mcp-proxy', { tool: 'list-widgets', input: {} } );
62
+ expect( post ).toHaveBeenCalledWith( 'elementor/v1/mcp-proxy', {
63
+ tool: 'list-widget-schemas',
64
+ input: { summary: true },
65
+ } );
61
66
  expect( result.resources ).toEqual( [
62
67
  { uri: 'elementor://widgets/schema/e-heading', name: 'Widget schema for e-heading' },
63
68
  { uri: 'elementor://widgets/schema/e-button', name: 'Widget schema for e-button' },
@@ -8,21 +8,24 @@ export const AVAILABLE_WIDGETS_URI_V4 = 'elementor://context/available-widgets/v
8
8
 
9
9
  type WidgetSummary = {
10
10
  type: string;
11
- version: 'v3' | 'v4';
12
11
  description?: string;
13
12
  };
14
13
 
15
- const fetchWidgets = async ( version?: WidgetSummary[ 'version' ] ): Promise< WidgetSummary[] > => {
16
- const { data } = await httpService().post< HttpResponse< WidgetSummary[] > >( MCP_PROXY_URL, {
17
- tool: 'list-widgets',
18
- input: version ? { version } : {},
14
+ type WidgetSummaryResponse = {
15
+ widgets: WidgetSummary[];
16
+ };
17
+
18
+ const fetchWidgets = async (): Promise< WidgetSummary[] > => {
19
+ const { data } = await httpService().post< HttpResponse< WidgetSummaryResponse > >( MCP_PROXY_URL, {
20
+ tool: 'list-widget-schemas',
21
+ input: { summary: true },
19
22
  } );
20
23
 
21
- return data.data ?? [];
24
+ return data.data?.widgets ?? [];
22
25
  };
23
26
 
24
- const buildContents = async ( uri: string, version?: WidgetSummary[ 'version' ] ) => {
25
- const widgets = await fetchWidgets( version );
27
+ const buildContents = async ( uri: string ) => {
28
+ const widgets = await fetchWidgets();
26
29
 
27
30
  return {
28
31
  contents: [
@@ -44,14 +47,14 @@ export const initAvailableWidgetsResource = ( reg: MCPRegistryEntry ) => {
44
47
  {
45
48
  description: 'All registered v4 version widgets',
46
49
  },
47
- async () => buildContents( AVAILABLE_WIDGETS_URI_V4, 'v4' )
50
+ async () => buildContents( AVAILABLE_WIDGETS_URI_V4 )
48
51
  );
49
52
 
50
53
  resource(
51
54
  'available-widgets',
52
55
  AVAILABLE_WIDGETS_URI,
53
56
  {
54
- description: 'All registered widget types with v3/v4 version metadata and description.',
57
+ description: 'All registered v4 widget types with description.',
55
58
  },
56
59
  async () => buildContents( AVAILABLE_WIDGETS_URI )
57
60
  );
@@ -13,17 +13,20 @@ const MCP_PROXY_URL = 'elementor/v1/mcp-proxy';
13
13
 
14
14
  type WidgetSummary = {
15
15
  type: string;
16
- version: 'v3' | 'v4';
17
16
  description?: string;
18
17
  };
19
18
 
19
+ type WidgetSummaryResponse = {
20
+ widgets: WidgetSummary[];
21
+ };
22
+
20
23
  const listWidgetTypes = async (): Promise< string[] > => {
21
- const { data } = await httpService().post< HttpResponse< WidgetSummary[] > >( MCP_PROXY_URL, {
22
- tool: 'list-widgets',
23
- input: {},
24
+ const { data } = await httpService().post< HttpResponse< WidgetSummaryResponse > >( MCP_PROXY_URL, {
25
+ tool: 'list-widget-schemas',
26
+ input: { summary: true },
24
27
  } );
25
28
 
26
- return ( data.data ?? [] ).map( ( widget ) => widget.type );
29
+ return ( data.data?.widgets ?? [] ).map( ( widget ) => widget.type );
27
30
  };
28
31
 
29
32
  const fetchWidgetSchema = async ( widgetType: string ): Promise< Record< string, unknown > > => {