@elementor/editor-components 3.35.0-406 → 3.35.0-408
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 +18 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +22 -22
- package/src/components/create-component-form/create-component-form.tsx +1 -1
- package/src/mcp/save-as-component-tool.ts +18 -15
- package/src/prevent-circular-nesting.ts +1 -1
- package/src/prevent-non-atomic-nesting.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/editor-components",
|
|
3
3
|
"description": "Elementor editor components",
|
|
4
|
-
"version": "3.35.0-
|
|
4
|
+
"version": "3.35.0-408",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,30 +40,30 @@
|
|
|
40
40
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@elementor/editor": "3.35.0-
|
|
44
|
-
"@elementor/editor-canvas": "3.35.0-
|
|
45
|
-
"@elementor/editor-controls": "3.35.0-
|
|
46
|
-
"@elementor/editor-documents": "3.35.0-
|
|
47
|
-
"@elementor/editor-editing-panel": "3.35.0-
|
|
48
|
-
"@elementor/editor-elements": "3.35.0-
|
|
49
|
-
"@elementor/editor-elements-panel": "3.35.0-
|
|
50
|
-
"@elementor/editor-mcp": "3.35.0-
|
|
51
|
-
"@elementor/editor-panels": "3.35.0-
|
|
52
|
-
"@elementor/editor-props": "3.35.0-
|
|
53
|
-
"@elementor/editor-styles-repository": "3.35.0-
|
|
54
|
-
"@elementor/editor-ui": "3.35.0-
|
|
55
|
-
"@elementor/editor-v1-adapters": "3.35.0-
|
|
56
|
-
"@elementor/http-client": "3.35.0-
|
|
43
|
+
"@elementor/editor": "3.35.0-408",
|
|
44
|
+
"@elementor/editor-canvas": "3.35.0-408",
|
|
45
|
+
"@elementor/editor-controls": "3.35.0-408",
|
|
46
|
+
"@elementor/editor-documents": "3.35.0-408",
|
|
47
|
+
"@elementor/editor-editing-panel": "3.35.0-408",
|
|
48
|
+
"@elementor/editor-elements": "3.35.0-408",
|
|
49
|
+
"@elementor/editor-elements-panel": "3.35.0-408",
|
|
50
|
+
"@elementor/editor-mcp": "3.35.0-408",
|
|
51
|
+
"@elementor/editor-panels": "3.35.0-408",
|
|
52
|
+
"@elementor/editor-props": "3.35.0-408",
|
|
53
|
+
"@elementor/editor-styles-repository": "3.35.0-408",
|
|
54
|
+
"@elementor/editor-ui": "3.35.0-408",
|
|
55
|
+
"@elementor/editor-v1-adapters": "3.35.0-408",
|
|
56
|
+
"@elementor/http-client": "3.35.0-408",
|
|
57
57
|
"@elementor/icons": "^1.63.0",
|
|
58
|
-
"@elementor/mixpanel": "3.35.0-
|
|
59
|
-
"@elementor/query": "3.35.0-
|
|
60
|
-
"@elementor/schema": "3.35.0-
|
|
61
|
-
"@elementor/store": "3.35.0-
|
|
58
|
+
"@elementor/mixpanel": "3.35.0-408",
|
|
59
|
+
"@elementor/query": "3.35.0-408",
|
|
60
|
+
"@elementor/schema": "3.35.0-408",
|
|
61
|
+
"@elementor/store": "3.35.0-408",
|
|
62
62
|
"@elementor/ui": "1.36.17",
|
|
63
|
-
"@elementor/utils": "3.35.0-
|
|
63
|
+
"@elementor/utils": "3.35.0-408",
|
|
64
64
|
"@wordpress/i18n": "^5.13.0",
|
|
65
|
-
"@elementor/editor-notifications": "3.35.0-
|
|
66
|
-
"@elementor/editor-current-user": "3.35.0-
|
|
65
|
+
"@elementor/editor-notifications": "3.35.0-408",
|
|
66
|
+
"@elementor/editor-current-user": "3.35.0-408"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"react": "^18.3.1",
|
|
@@ -54,7 +54,7 @@ export function CreateComponentForm() {
|
|
|
54
54
|
notify( {
|
|
55
55
|
type: 'default',
|
|
56
56
|
message: __(
|
|
57
|
-
'
|
|
57
|
+
'Components require atomic elements only. Remove widgets to create this component.',
|
|
58
58
|
'elementor'
|
|
59
59
|
),
|
|
60
60
|
id: 'non-atomic-element-save-blocked',
|
|
@@ -32,6 +32,11 @@ const InputSchema = {
|
|
|
32
32
|
.describe(
|
|
33
33
|
'The property key of the child element that you want to override its settings (e.g., "text", "url", "tag"). To get the available propKeys for an element, use the "get-element-type-config" tool.'
|
|
34
34
|
),
|
|
35
|
+
label: z
|
|
36
|
+
.string()
|
|
37
|
+
.describe(
|
|
38
|
+
'A unique, user-friendly display name for this property (e.g., "Hero Headline", "CTA Button Text"). Must be unique within the same component.'
|
|
39
|
+
),
|
|
35
40
|
} )
|
|
36
41
|
),
|
|
37
42
|
} )
|
|
@@ -111,14 +116,14 @@ export const handleSaveAsComponent = async ( params: z.infer< z.ZodObject< typeo
|
|
|
111
116
|
};
|
|
112
117
|
|
|
113
118
|
function enrichOverridableProps(
|
|
114
|
-
input: { props: Record< string, { elementId: string; propKey: string } > },
|
|
119
|
+
input: { props: Record< string, { elementId: string; propKey: string; label: string } > },
|
|
115
120
|
rootElement: V1ElementData
|
|
116
121
|
): OverridableProps {
|
|
117
122
|
const enrichedProps: OverridableProps[ 'props' ] = {};
|
|
118
123
|
const defaultGroupId = generateUniqueId( 'group' );
|
|
119
124
|
|
|
120
125
|
Object.entries( input.props ).forEach( ( [ , prop ] ) => {
|
|
121
|
-
const { elementId, propKey } = prop;
|
|
126
|
+
const { elementId, propKey, label } = prop;
|
|
122
127
|
const element = findElementById( rootElement, elementId );
|
|
123
128
|
|
|
124
129
|
if ( ! element ) {
|
|
@@ -151,8 +156,6 @@ function enrichOverridableProps(
|
|
|
151
156
|
? ( element.settings[ propKey ] as PropValue )
|
|
152
157
|
: elementType.propsSchema[ propKey ].default ?? null;
|
|
153
158
|
|
|
154
|
-
const label = generateLabel( propKey );
|
|
155
|
-
|
|
156
159
|
enrichedProps[ overrideKey ] = {
|
|
157
160
|
overrideKey,
|
|
158
161
|
label,
|
|
@@ -215,11 +218,6 @@ function findElementById( root: V1ElementData, targetId: string ): V1ElementData
|
|
|
215
218
|
return null;
|
|
216
219
|
}
|
|
217
220
|
|
|
218
|
-
function generateLabel( propKey: string ): string {
|
|
219
|
-
const uniqueId = generateUniqueId( 'prop' );
|
|
220
|
-
return `${ uniqueId } - ${ propKey }`;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
221
|
function getValidElementTypes(): string[] {
|
|
224
222
|
const types = getWidgetsCache();
|
|
225
223
|
|
|
@@ -287,7 +285,8 @@ Skip that step ONLY if the user explicitly requests to not make any properties c
|
|
|
287
285
|
|
|
288
286
|
3. **Build the overridable_props Object**
|
|
289
287
|
- For each property you want to make overridable, add an entry:
|
|
290
|
-
\`{ "elementId": "<child-element-id>", "propKey": "<property-key>" }\`
|
|
288
|
+
\`{ "elementId": "<child-element-id>", "propKey": "<property-key>", "label": "<user-friendly-name>" }\`
|
|
289
|
+
- The label must be unique within the component and should be meaningful to the user (e.g., "Hero Headline", "CTA Button Text")
|
|
291
290
|
- Group all entries under the "props" object
|
|
292
291
|
|
|
293
292
|
## Step 3: Execute the Tool
|
|
@@ -327,7 +326,8 @@ Structure:
|
|
|
327
326
|
"props": {
|
|
328
327
|
"<unique-key>": {
|
|
329
328
|
"elementId": "<child-element-id>",
|
|
330
|
-
"propKey": "<property-key>"
|
|
329
|
+
"propKey": "<property-key>",
|
|
330
|
+
"label": "<user-friendly-name>"
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
}
|
|
@@ -337,7 +337,7 @@ To populate this correctly:
|
|
|
337
337
|
1. Use [${ DOCUMENT_STRUCTURE_URI }] to find child element IDs and their widgetType
|
|
338
338
|
2. Use [${ WIDGET_SCHEMA_URI }] to find the atomic_props_schema for each child element's widgetType
|
|
339
339
|
3. Only include properties you want to be customizable in component instances
|
|
340
|
-
4.
|
|
340
|
+
4. Provide a unique, user-friendly label for each property (e.g., "Hero Headline", "CTA Button Text")`
|
|
341
341
|
);
|
|
342
342
|
|
|
343
343
|
saveAsComponentPrompt.example( `
|
|
@@ -358,15 +358,18 @@ Component with overridable properties:
|
|
|
358
358
|
"props": {
|
|
359
359
|
"heading-text": {
|
|
360
360
|
"elementId": "heading-123",
|
|
361
|
-
"propKey": "text"
|
|
361
|
+
"propKey": "text",
|
|
362
|
+
"label": "Card Title"
|
|
362
363
|
},
|
|
363
364
|
"button-text": {
|
|
364
365
|
"elementId": "button-456",
|
|
365
|
-
"propKey": "text"
|
|
366
|
+
"propKey": "text",
|
|
367
|
+
"label": "Button Text"
|
|
366
368
|
},
|
|
367
369
|
"button-link": {
|
|
368
370
|
"elementId": "button-456",
|
|
369
|
-
"propKey": "url"
|
|
371
|
+
"propKey": "url",
|
|
372
|
+
"label": "Button Link"
|
|
370
373
|
}
|
|
371
374
|
}
|
|
372
375
|
}
|
|
@@ -49,7 +49,7 @@ type StorageContent = {
|
|
|
49
49
|
|
|
50
50
|
const COMPONENT_CIRCULAR_NESTING_ALERT: NotificationData = {
|
|
51
51
|
type: 'default',
|
|
52
|
-
message: __( '
|
|
52
|
+
message: __( "Can't add this component - components that contain each other can't be nested.", 'elementor' ),
|
|
53
53
|
id: 'circular-component-nesting-blocked',
|
|
54
54
|
};
|
|
55
55
|
|
|
@@ -42,7 +42,7 @@ type StorageContent = {
|
|
|
42
42
|
|
|
43
43
|
const NON_ATOMIC_ELEMENT_ALERT: NotificationData = {
|
|
44
44
|
type: 'default',
|
|
45
|
-
message: __(
|
|
45
|
+
message: __( "This widget isn't compatible with components. Use atomic elements instead.", 'elementor' ),
|
|
46
46
|
id: 'non-atomic-element-blocked',
|
|
47
47
|
};
|
|
48
48
|
|