@elementor/editor-components 3.35.0-328 → 3.35.0-330
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 +12 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +21 -21
- package/src/components/component-panel-header/component-badge.tsx +2 -2
- package/src/components/component-panel-header/component-panel-header.tsx +4 -4
- package/src/components/create-component-form/utils/replace-element-with-component.ts +4 -1
- package/src/create-component-type.ts +1 -1
- package/src/sync/create-components-before-save.ts +4 -2
- package/src/types.ts +12 -4
- package/src/utils/get-component-ids.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-330",
|
|
5
5
|
"private": false,
|
|
6
6
|
"author": "Elementor Team",
|
|
7
7
|
"homepage": "https://elementor.com/",
|
|
@@ -40,28 +40,28 @@
|
|
|
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-props": "3.35.0-
|
|
52
|
-
"@elementor/editor-styles-repository": "3.35.0-
|
|
53
|
-
"@elementor/editor-ui": "3.35.0-
|
|
54
|
-
"@elementor/editor-v1-adapters": "3.35.0-
|
|
55
|
-
"@elementor/http-client": "3.35.0-
|
|
56
|
-
"@elementor/icons": "^1.
|
|
57
|
-
"@elementor/mixpanel": "3.35.0-
|
|
58
|
-
"@elementor/query": "3.35.0-
|
|
59
|
-
"@elementor/schema": "3.35.0-
|
|
60
|
-
"@elementor/store": "3.35.0-
|
|
43
|
+
"@elementor/editor": "3.35.0-330",
|
|
44
|
+
"@elementor/editor-canvas": "3.35.0-330",
|
|
45
|
+
"@elementor/editor-controls": "3.35.0-330",
|
|
46
|
+
"@elementor/editor-documents": "3.35.0-330",
|
|
47
|
+
"@elementor/editor-editing-panel": "3.35.0-330",
|
|
48
|
+
"@elementor/editor-elements": "3.35.0-330",
|
|
49
|
+
"@elementor/editor-elements-panel": "3.35.0-330",
|
|
50
|
+
"@elementor/editor-mcp": "3.35.0-330",
|
|
51
|
+
"@elementor/editor-props": "3.35.0-330",
|
|
52
|
+
"@elementor/editor-styles-repository": "3.35.0-330",
|
|
53
|
+
"@elementor/editor-ui": "3.35.0-330",
|
|
54
|
+
"@elementor/editor-v1-adapters": "3.35.0-330",
|
|
55
|
+
"@elementor/http-client": "3.35.0-330",
|
|
56
|
+
"@elementor/icons": "^1.62.0",
|
|
57
|
+
"@elementor/mixpanel": "3.35.0-330",
|
|
58
|
+
"@elementor/query": "3.35.0-330",
|
|
59
|
+
"@elementor/schema": "3.35.0-330",
|
|
60
|
+
"@elementor/store": "3.35.0-330",
|
|
61
61
|
"@elementor/ui": "1.36.17",
|
|
62
|
-
"@elementor/utils": "3.35.0-
|
|
62
|
+
"@elementor/utils": "3.35.0-330",
|
|
63
63
|
"@wordpress/i18n": "^5.13.0",
|
|
64
|
-
"@elementor/editor-notifications": "3.35.0-
|
|
64
|
+
"@elementor/editor-notifications": "3.35.0-330"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"react": "^18.3.1",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ComponentPropListIcon } from '@elementor/icons';
|
|
4
4
|
import { Badge, Box, keyframes, styled, ToggleButton } from '@elementor/ui';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
6
|
|
|
@@ -23,7 +23,7 @@ export const ComponentsBadge = ( { overridesCount }: { overridesCount: number }
|
|
|
23
23
|
}
|
|
24
24
|
>
|
|
25
25
|
<ToggleButton value="overrides" size="tiny" aria-label={ __( 'View overrides', 'elementor' ) }>
|
|
26
|
-
<
|
|
26
|
+
<ComponentPropListIcon fontSize="tiny" />
|
|
27
27
|
</ToggleButton>
|
|
28
28
|
</StyledBadge>
|
|
29
29
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { getV1DocumentsManager } from '@elementor/editor-documents';
|
|
3
|
-
import { ArrowLeftIcon,
|
|
3
|
+
import { ArrowLeftIcon, ComponentsFilledIcon } from '@elementor/icons';
|
|
4
4
|
import { __useSelector as useSelector } from '@elementor/store';
|
|
5
5
|
import { Box, Divider, IconButton, Stack, Tooltip, Typography } from '@elementor/ui';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
@@ -30,14 +30,14 @@ export const ComponentPanelHeader = () => {
|
|
|
30
30
|
justifyContent="space-between"
|
|
31
31
|
sx={ { height: 48, pl: 1.5, pr: 2, py: 1 } }
|
|
32
32
|
>
|
|
33
|
-
<Stack direction="row" alignItems="center"
|
|
33
|
+
<Stack direction="row" alignItems="center">
|
|
34
34
|
<Tooltip title={ __( 'Back', 'elementor' ) }>
|
|
35
35
|
<IconButton size="tiny" onClick={ onBack } aria-label={ __( 'Back', 'elementor' ) }>
|
|
36
|
-
<ArrowLeftIcon />
|
|
36
|
+
<ArrowLeftIcon fontSize="tiny" />
|
|
37
37
|
</IconButton>
|
|
38
38
|
</Tooltip>
|
|
39
39
|
<Stack direction="row" alignItems="center" gap={ 0.5 }>
|
|
40
|
-
<
|
|
40
|
+
<ComponentsFilledIcon fontSize="tiny" stroke="currentColor" />
|
|
41
41
|
<Typography variant="caption" sx={ { fontWeight: 500 } }>
|
|
42
42
|
{ componentName }
|
|
43
43
|
</Typography>
|
|
@@ -22,7 +22,10 @@ export const createComponentModel = ( component: ComponentInstanceParams ): Omit
|
|
|
22
22
|
component_instance: {
|
|
23
23
|
$$type: 'component-instance',
|
|
24
24
|
value: {
|
|
25
|
-
component_id:
|
|
25
|
+
component_id: {
|
|
26
|
+
$$type: 'number',
|
|
27
|
+
value: component.id ?? component.uid,
|
|
28
|
+
},
|
|
26
29
|
},
|
|
27
30
|
},
|
|
28
31
|
},
|
|
@@ -84,7 +84,7 @@ function createComponentView(
|
|
|
84
84
|
this.options?.model?.get( 'settings' )?.get( 'component_instance' ) as ComponentInstancePropValue
|
|
85
85
|
)?.value;
|
|
86
86
|
|
|
87
|
-
return componentInstance.component_id;
|
|
87
|
+
return componentInstance.component_id.value;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
getContextMenuGroups() {
|
|
@@ -79,7 +79,7 @@ function shouldUpdateElement(
|
|
|
79
79
|
): { shouldUpdate: true; newComponentId: number } | { shouldUpdate: false; newComponentId: null } {
|
|
80
80
|
if ( element.widgetType === 'e-component' ) {
|
|
81
81
|
const currentComponentId = ( element.settings?.component_instance as ComponentInstancePropValue< string > )
|
|
82
|
-
?.value?.component_id;
|
|
82
|
+
?.value?.component_id.value;
|
|
83
83
|
|
|
84
84
|
if ( currentComponentId && uidToComponentId.has( currentComponentId ) ) {
|
|
85
85
|
return { shouldUpdate: true, newComponentId: uidToComponentId.get( currentComponentId ) as number };
|
|
@@ -94,7 +94,9 @@ function updateElementComponentId( elementId: string, componentId: number ): voi
|
|
|
94
94
|
props: {
|
|
95
95
|
component_instance: {
|
|
96
96
|
$$type: 'component-instance',
|
|
97
|
-
value: {
|
|
97
|
+
value: {
|
|
98
|
+
component_id: { $$type: 'number', value: componentId },
|
|
99
|
+
},
|
|
98
100
|
},
|
|
99
101
|
},
|
|
100
102
|
withHistory: false,
|
package/src/types.ts
CHANGED
|
@@ -70,14 +70,22 @@ export type ComponentInstancePropValue< TComponentId extends number | string = n
|
|
|
70
70
|
TransformablePropValue<
|
|
71
71
|
'component-instance',
|
|
72
72
|
{
|
|
73
|
-
component_id: TComponentId
|
|
74
|
-
overrides?:
|
|
73
|
+
component_id: TransformablePropValue< 'number', TComponentId >;
|
|
74
|
+
overrides?: TransformablePropValue< 'overrides', ComponentOverrides >;
|
|
75
75
|
}
|
|
76
76
|
>;
|
|
77
77
|
|
|
78
|
-
type
|
|
78
|
+
type ComponentOverrides = TransformablePropValue< 'overrides', ComponentOverride[] >;
|
|
79
|
+
|
|
80
|
+
type ComponentOverride = TransformablePropValue< 'override', ComponentOverridePropValue >;
|
|
81
|
+
|
|
82
|
+
type ComponentOverridePropValue = {
|
|
79
83
|
override_key: string;
|
|
80
|
-
|
|
84
|
+
override_value: TransformablePropValue< string >;
|
|
85
|
+
schema_source: {
|
|
86
|
+
type: string;
|
|
87
|
+
id: number;
|
|
88
|
+
};
|
|
81
89
|
};
|
|
82
90
|
|
|
83
91
|
export type ComponentOverridable = {
|
|
@@ -12,7 +12,7 @@ export const getComponentIds = async ( elements: V1ElementData[] ) => {
|
|
|
12
12
|
|
|
13
13
|
if ( isComponent ) {
|
|
14
14
|
const componentId = ( settings?.component_instance as ComponentInstancePropValue< number > )?.value
|
|
15
|
-
?.component_id;
|
|
15
|
+
?.component_id.value;
|
|
16
16
|
|
|
17
17
|
const document = await getComponentDocumentData( componentId );
|
|
18
18
|
|