@elementor/editor-canvas 4.2.0-931 → 4.2.0-932
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 +18 -7
- package/dist/index.d.ts +18 -7
- package/dist/index.js +243 -282
- package/dist/index.mjs +227 -266
- package/package.json +19 -18
- package/src/composition-builder/composition-builder.ts +2 -9
- package/src/index.ts +7 -1
- package/src/mcp/canvas-mcp.ts +3 -0
- package/src/mcp/mcp-description.ts +9 -13
- package/src/mcp/resources/widgets-schema-resource.ts +1 -41
- package/src/mcp/tools/build-composition/prompt.ts +12 -13
- package/src/mcp/tools/build-composition/schema.ts +5 -12
- package/src/mcp/tools/build-composition/tool.ts +25 -3
- package/src/mcp/tools/configure-element/prompt.ts +22 -44
- package/src/mcp/tools/configure-element/schema.ts +12 -6
- package/src/mcp/tools/configure-element/tool.ts +43 -38
- package/src/mcp/utils/__tests__/convert-css-to-atomic.test.ts +109 -0
- package/src/mcp/utils/__tests__/do-update-element-property.test.ts +39 -1
- package/src/mcp/utils/convert-css-to-atomic.ts +39 -0
- package/src/mcp/utils/do-update-element-property.ts +3 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import * as _elementor_editor_props from '@elementor/editor-props';
|
|
2
|
+
import { PropValue, Props, PropType, PropTypeKey, PropsSchema, AnyTransformable } from '@elementor/editor-props';
|
|
1
3
|
import { V1Element, V1ElementModelProps, V1ElementConfig } from '@elementor/editor-elements';
|
|
2
4
|
import { TwingArrayLoader, TwingEnvironment } from '@elementor/twing';
|
|
3
5
|
import { Root } from 'react-dom/client';
|
|
4
|
-
import * as _elementor_editor_props from '@elementor/editor-props';
|
|
5
|
-
import { Props, PropValue, PropType, PropTypeKey, PropsSchema, AnyTransformable } from '@elementor/editor-props';
|
|
6
6
|
import { StyleVariables, StyleDefinitionsMap, StyleDefinitionID, StyleDefinitionState } from '@elementor/editor-styles';
|
|
7
7
|
import * as React$1 from 'react';
|
|
8
8
|
import * as _elementor_utils from '@elementor/utils';
|
|
@@ -10,10 +10,18 @@ import * as _elementor_utils from '@elementor/utils';
|
|
|
10
10
|
declare const BREAKPOINTS_SCHEMA_URI = "elementor://breakpoints/list";
|
|
11
11
|
declare const BREAKPOINTS_SCHEMA_FULL_URI = "editor-canvas_elementor://breakpoints/list";
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
/**
|
|
14
|
+
* A flat CSS property→value map. A null value is an explicit reset: the server emits it as a null
|
|
15
|
+
* prop so the editor restores the property to its default.
|
|
16
|
+
*/
|
|
17
|
+
type StyleDeclarations = Record<string, string | null>;
|
|
18
|
+
type StyleBlock = StyleDeclarations | string;
|
|
19
|
+
type CssConversionResult = {
|
|
20
|
+
props: Record<string, PropValue | null>;
|
|
21
|
+
customCss: string;
|
|
22
|
+
};
|
|
23
|
+
declare const convertStyleBlocksToAtomic: (styleByName: Record<string, StyleBlock>) => Promise<Record<string, CssConversionResult>>;
|
|
24
|
+
declare const convertCssToAtomic: (style: StyleDeclarations) => Promise<CssConversionResult>;
|
|
17
25
|
|
|
18
26
|
declare function init(): void;
|
|
19
27
|
|
|
@@ -340,6 +348,9 @@ type ImportedGlobalStylesPayload = {
|
|
|
340
348
|
|
|
341
349
|
declare const DOCUMENT_STRUCTURE_URI = "elementor://document/structure";
|
|
342
350
|
|
|
351
|
+
declare const WIDGET_SCHEMA_URI = "elementor://widgets/schema/{widgetType}";
|
|
352
|
+
declare const WIDGET_SCHEMA_FULL_URI = "editor-canvas_elementor://widgets/schema/{widgetType}";
|
|
353
|
+
|
|
343
354
|
type SpotlightBackdropProps = {
|
|
344
355
|
canvas: Document;
|
|
345
356
|
element: HTMLElement | null;
|
|
@@ -392,4 +403,4 @@ declare function useEscapeOnCanvas(canvasDocument: Document | null | undefined,
|
|
|
392
403
|
|
|
393
404
|
declare function doAfterRender(elementIds: string[], callback: (elementIds: string[]) => void): void;
|
|
394
405
|
|
|
395
|
-
export { type AnyTransformer, BREAKPOINTS_SCHEMA_FULL_URI, BREAKPOINTS_SCHEMA_URI, type BackboneModel, type BackboneModelConstructor, type ContextMenuAction, type ContextMenuEventData, type ContextMenuGroup, type CreateNestedTemplatedElementTypeOptions, type CreateTemplatedElementTypeOptions, DOCUMENT_STRUCTURE_URI, type ElementModel, ElementType, ElementView, GLOBAL_STYLES_IMPORTED_EVENT, type ImportedGlobalStylesPayload, type LegacyWindow, type MarionetteExtendable, type NamespacedRenderContext, type NestedTemplatedElementConfig, type NestedTemplatedElementViewClass, type PropsResolver, type RenderContext, type ReplacementSettings,
|
|
406
|
+
export { type AnyTransformer, BREAKPOINTS_SCHEMA_FULL_URI, BREAKPOINTS_SCHEMA_URI, type BackboneModel, type BackboneModelConstructor, type ContextMenuAction, type ContextMenuEventData, type ContextMenuGroup, type CreateNestedTemplatedElementTypeOptions, type CreateTemplatedElementTypeOptions, type CssConversionResult, DOCUMENT_STRUCTURE_URI, type ElementModel, ElementType, ElementView, GLOBAL_STYLES_IMPORTED_EVENT, type ImportedGlobalStylesPayload, type LegacyWindow, type MarionetteExtendable, type NamespacedRenderContext, type NestedTemplatedElementConfig, type NestedTemplatedElementViewClass, type PropsResolver, type RenderContext, type ReplacementSettings, SpotlightBackdrop, type StyleBlock, type StyleDeclarations, TemplatedElementView, type TransformerOptions, UnknownStyleStateError, UnknownStyleTypeError, WIDGET_SCHEMA_FULL_URI, WIDGET_SCHEMA_URI, canBeNestedTemplated, convertCssToAtomic, convertStyleBlocksToAtomic, createNestedTemplatedElementType, createNestedTemplatedElementView, createPropsResolver, createTemplatedElementView, createTransformer, createTransformersRegistry, doAfterRender, endDragElementFromPanel, formatGridTrackRepeat, init, isAtomicWidget, isGridTrackProperty, registerElementType, registerModelExtensions, settingsTransformersRegistry, startDragElementFromPanel, styleTransformersRegistry, stylesInheritanceTransformersRegistry, useCanvasDocument, useEscapeOnCanvas, waitForChildrenToComplete };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import * as _elementor_editor_props from '@elementor/editor-props';
|
|
2
|
+
import { PropValue, Props, PropType, PropTypeKey, PropsSchema, AnyTransformable } from '@elementor/editor-props';
|
|
1
3
|
import { V1Element, V1ElementModelProps, V1ElementConfig } from '@elementor/editor-elements';
|
|
2
4
|
import { TwingArrayLoader, TwingEnvironment } from '@elementor/twing';
|
|
3
5
|
import { Root } from 'react-dom/client';
|
|
4
|
-
import * as _elementor_editor_props from '@elementor/editor-props';
|
|
5
|
-
import { Props, PropValue, PropType, PropTypeKey, PropsSchema, AnyTransformable } from '@elementor/editor-props';
|
|
6
6
|
import { StyleVariables, StyleDefinitionsMap, StyleDefinitionID, StyleDefinitionState } from '@elementor/editor-styles';
|
|
7
7
|
import * as React$1 from 'react';
|
|
8
8
|
import * as _elementor_utils from '@elementor/utils';
|
|
@@ -10,10 +10,18 @@ import * as _elementor_utils from '@elementor/utils';
|
|
|
10
10
|
declare const BREAKPOINTS_SCHEMA_URI = "elementor://breakpoints/list";
|
|
11
11
|
declare const BREAKPOINTS_SCHEMA_FULL_URI = "editor-canvas_elementor://breakpoints/list";
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
/**
|
|
14
|
+
* A flat CSS property→value map. A null value is an explicit reset: the server emits it as a null
|
|
15
|
+
* prop so the editor restores the property to its default.
|
|
16
|
+
*/
|
|
17
|
+
type StyleDeclarations = Record<string, string | null>;
|
|
18
|
+
type StyleBlock = StyleDeclarations | string;
|
|
19
|
+
type CssConversionResult = {
|
|
20
|
+
props: Record<string, PropValue | null>;
|
|
21
|
+
customCss: string;
|
|
22
|
+
};
|
|
23
|
+
declare const convertStyleBlocksToAtomic: (styleByName: Record<string, StyleBlock>) => Promise<Record<string, CssConversionResult>>;
|
|
24
|
+
declare const convertCssToAtomic: (style: StyleDeclarations) => Promise<CssConversionResult>;
|
|
17
25
|
|
|
18
26
|
declare function init(): void;
|
|
19
27
|
|
|
@@ -340,6 +348,9 @@ type ImportedGlobalStylesPayload = {
|
|
|
340
348
|
|
|
341
349
|
declare const DOCUMENT_STRUCTURE_URI = "elementor://document/structure";
|
|
342
350
|
|
|
351
|
+
declare const WIDGET_SCHEMA_URI = "elementor://widgets/schema/{widgetType}";
|
|
352
|
+
declare const WIDGET_SCHEMA_FULL_URI = "editor-canvas_elementor://widgets/schema/{widgetType}";
|
|
353
|
+
|
|
343
354
|
type SpotlightBackdropProps = {
|
|
344
355
|
canvas: Document;
|
|
345
356
|
element: HTMLElement | null;
|
|
@@ -392,4 +403,4 @@ declare function useEscapeOnCanvas(canvasDocument: Document | null | undefined,
|
|
|
392
403
|
|
|
393
404
|
declare function doAfterRender(elementIds: string[], callback: (elementIds: string[]) => void): void;
|
|
394
405
|
|
|
395
|
-
export { type AnyTransformer, BREAKPOINTS_SCHEMA_FULL_URI, BREAKPOINTS_SCHEMA_URI, type BackboneModel, type BackboneModelConstructor, type ContextMenuAction, type ContextMenuEventData, type ContextMenuGroup, type CreateNestedTemplatedElementTypeOptions, type CreateTemplatedElementTypeOptions, DOCUMENT_STRUCTURE_URI, type ElementModel, ElementType, ElementView, GLOBAL_STYLES_IMPORTED_EVENT, type ImportedGlobalStylesPayload, type LegacyWindow, type MarionetteExtendable, type NamespacedRenderContext, type NestedTemplatedElementConfig, type NestedTemplatedElementViewClass, type PropsResolver, type RenderContext, type ReplacementSettings,
|
|
406
|
+
export { type AnyTransformer, BREAKPOINTS_SCHEMA_FULL_URI, BREAKPOINTS_SCHEMA_URI, type BackboneModel, type BackboneModelConstructor, type ContextMenuAction, type ContextMenuEventData, type ContextMenuGroup, type CreateNestedTemplatedElementTypeOptions, type CreateTemplatedElementTypeOptions, type CssConversionResult, DOCUMENT_STRUCTURE_URI, type ElementModel, ElementType, ElementView, GLOBAL_STYLES_IMPORTED_EVENT, type ImportedGlobalStylesPayload, type LegacyWindow, type MarionetteExtendable, type NamespacedRenderContext, type NestedTemplatedElementConfig, type NestedTemplatedElementViewClass, type PropsResolver, type RenderContext, type ReplacementSettings, SpotlightBackdrop, type StyleBlock, type StyleDeclarations, TemplatedElementView, type TransformerOptions, UnknownStyleStateError, UnknownStyleTypeError, WIDGET_SCHEMA_FULL_URI, WIDGET_SCHEMA_URI, canBeNestedTemplated, convertCssToAtomic, convertStyleBlocksToAtomic, createNestedTemplatedElementType, createNestedTemplatedElementView, createPropsResolver, createTemplatedElementView, createTransformer, createTransformersRegistry, doAfterRender, endDragElementFromPanel, formatGridTrackRepeat, init, isAtomicWidget, isGridTrackProperty, registerElementType, registerModelExtensions, settingsTransformersRegistry, startDragElementFromPanel, styleTransformersRegistry, stylesInheritanceTransformersRegistry, useCanvasDocument, useEscapeOnCanvas, waitForChildrenToComplete };
|