@elementor/editor-components 3.35.0-328 → 3.35.0-329

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/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-328",
4
+ "version": "3.35.0-329",
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-328",
44
- "@elementor/editor-canvas": "3.35.0-328",
45
- "@elementor/editor-controls": "3.35.0-328",
46
- "@elementor/editor-documents": "3.35.0-328",
47
- "@elementor/editor-editing-panel": "3.35.0-328",
48
- "@elementor/editor-elements": "3.35.0-328",
49
- "@elementor/editor-elements-panel": "3.35.0-328",
50
- "@elementor/editor-mcp": "3.35.0-328",
51
- "@elementor/editor-props": "3.35.0-328",
52
- "@elementor/editor-styles-repository": "3.35.0-328",
53
- "@elementor/editor-ui": "3.35.0-328",
54
- "@elementor/editor-v1-adapters": "3.35.0-328",
55
- "@elementor/http-client": "3.35.0-328",
43
+ "@elementor/editor": "3.35.0-329",
44
+ "@elementor/editor-canvas": "3.35.0-329",
45
+ "@elementor/editor-controls": "3.35.0-329",
46
+ "@elementor/editor-documents": "3.35.0-329",
47
+ "@elementor/editor-editing-panel": "3.35.0-329",
48
+ "@elementor/editor-elements": "3.35.0-329",
49
+ "@elementor/editor-elements-panel": "3.35.0-329",
50
+ "@elementor/editor-mcp": "3.35.0-329",
51
+ "@elementor/editor-props": "3.35.0-329",
52
+ "@elementor/editor-styles-repository": "3.35.0-329",
53
+ "@elementor/editor-ui": "3.35.0-329",
54
+ "@elementor/editor-v1-adapters": "3.35.0-329",
55
+ "@elementor/http-client": "3.35.0-329",
56
56
  "@elementor/icons": "^1.61.0",
57
- "@elementor/mixpanel": "3.35.0-328",
58
- "@elementor/query": "3.35.0-328",
59
- "@elementor/schema": "3.35.0-328",
60
- "@elementor/store": "3.35.0-328",
57
+ "@elementor/mixpanel": "3.35.0-329",
58
+ "@elementor/query": "3.35.0-329",
59
+ "@elementor/schema": "3.35.0-329",
60
+ "@elementor/store": "3.35.0-329",
61
61
  "@elementor/ui": "1.36.17",
62
- "@elementor/utils": "3.35.0-328",
62
+ "@elementor/utils": "3.35.0-329",
63
63
  "@wordpress/i18n": "^5.13.0",
64
- "@elementor/editor-notifications": "3.35.0-328"
64
+ "@elementor/editor-notifications": "3.35.0-329"
65
65
  },
66
66
  "peerDependencies": {
67
67
  "react": "^18.3.1",
@@ -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: component.id ?? component.uid,
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: { component_id: componentId },
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?: ComponentOverride[];
73
+ component_id: TransformablePropValue< 'number', TComponentId >;
74
+ overrides?: TransformablePropValue< 'overrides', ComponentOverrides >;
75
75
  }
76
76
  >;
77
77
 
78
- type ComponentOverride = {
78
+ type ComponentOverrides = TransformablePropValue< 'overrides', ComponentOverride[] >;
79
+
80
+ type ComponentOverride = TransformablePropValue< 'override', ComponentOverridePropValue >;
81
+
82
+ type ComponentOverridePropValue = {
79
83
  override_key: string;
80
- value: TransformablePropValue< string >;
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