@elementor/editor-components 4.2.0-915 → 4.2.0-916

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": "4.2.0-915",
4
+ "version": "4.2.0-916",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,32 +40,32 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor": "4.2.0-915",
44
- "@elementor/editor-canvas": "4.2.0-915",
45
- "@elementor/editor-controls": "4.2.0-915",
46
- "@elementor/editor-documents": "4.2.0-915",
47
- "@elementor/editor-editing-panel": "4.2.0-915",
48
- "@elementor/editor-elements": "4.2.0-915",
49
- "@elementor/editor-elements-panel": "4.2.0-915",
50
- "@elementor/editor-global-classes": "4.2.0-915",
51
- "@elementor/editor-mcp": "4.2.0-915",
52
- "@elementor/editor-templates": "4.2.0-915",
53
- "@elementor/editor-panels": "4.2.0-915",
54
- "@elementor/editor-props": "4.2.0-915",
55
- "@elementor/editor-styles-repository": "4.2.0-915",
56
- "@elementor/editor-ui": "4.2.0-915",
57
- "@elementor/editor-v1-adapters": "4.2.0-915",
58
- "@elementor/http-client": "4.2.0-915",
43
+ "@elementor/editor": "4.2.0-916",
44
+ "@elementor/editor-canvas": "4.2.0-916",
45
+ "@elementor/editor-controls": "4.2.0-916",
46
+ "@elementor/editor-documents": "4.2.0-916",
47
+ "@elementor/editor-editing-panel": "4.2.0-916",
48
+ "@elementor/editor-elements": "4.2.0-916",
49
+ "@elementor/editor-elements-panel": "4.2.0-916",
50
+ "@elementor/editor-global-classes": "4.2.0-916",
51
+ "@elementor/editor-mcp": "4.2.0-916",
52
+ "@elementor/editor-templates": "4.2.0-916",
53
+ "@elementor/editor-panels": "4.2.0-916",
54
+ "@elementor/editor-props": "4.2.0-916",
55
+ "@elementor/editor-styles-repository": "4.2.0-916",
56
+ "@elementor/editor-ui": "4.2.0-916",
57
+ "@elementor/editor-v1-adapters": "4.2.0-916",
58
+ "@elementor/http-client": "4.2.0-916",
59
59
  "@elementor/icons": "~1.75.1",
60
- "@elementor/events": "4.2.0-915",
61
- "@elementor/query": "4.2.0-915",
62
- "@elementor/schema": "4.2.0-915",
63
- "@elementor/store": "4.2.0-915",
60
+ "@elementor/events": "4.2.0-916",
61
+ "@elementor/query": "4.2.0-916",
62
+ "@elementor/schema": "4.2.0-916",
63
+ "@elementor/store": "4.2.0-916",
64
64
  "@elementor/ui": "1.37.5",
65
- "@elementor/utils": "4.2.0-915",
65
+ "@elementor/utils": "4.2.0-916",
66
66
  "@wordpress/i18n": "^5.13.0",
67
- "@elementor/editor-notifications": "4.2.0-915",
68
- "@elementor/editor-current-user": "4.2.0-915"
67
+ "@elementor/editor-notifications": "4.2.0-916",
68
+ "@elementor/editor-current-user": "4.2.0-916"
69
69
  },
70
70
  "peerDependencies": {
71
71
  "react": "^18.3.1",
@@ -1,4 +1,11 @@
1
- import { getContainer, replaceElement, type V1Element, type V1ElementModelProps } from '@elementor/editor-elements';
1
+ import { doAfterRender } from '@elementor/editor-canvas';
2
+ import {
3
+ getContainer,
4
+ replaceElement,
5
+ selectElement,
6
+ type V1Element,
7
+ type V1ElementModelProps,
8
+ } from '@elementor/editor-elements';
2
9
  import { undoable } from '@elementor/editor-v1-adapters';
3
10
  import { __dispatch as dispatch, __getState as getState } from '@elementor/store';
4
11
  import { __ } from '@wordpress/i18n';
@@ -78,6 +85,8 @@ export async function detachComponentInstance( {
78
85
  withHistory: false,
79
86
  } );
80
87
 
88
+ selectElement( detachedElement.id );
89
+
81
90
  const componentUid = selectComponent( getState(), componentId )?.uid;
82
91
  trackComponentEvent( {
83
92
  action: 'detached',
@@ -126,6 +135,11 @@ export async function detachComponentInstance( {
126
135
  );
127
136
  }
128
137
 
138
+ // Wait for the instance to be restored
139
+ doAfterRender( [ restoredInstance.id ], () => {
140
+ selectElement( restoredInstance.id );
141
+ } );
142
+
129
143
  return restoredInstance;
130
144
  },
131
145
  redo: ( _: undefined, doReturn: DoReturn, restoredInstance: V1Element ) => {
@@ -143,6 +157,8 @@ export async function detachComponentInstance( {
143
157
  withHistory: false,
144
158
  } );
145
159
 
160
+ selectElement( detachedElement.id );
161
+
146
162
  return {
147
163
  ...doReturn,
148
164
  detachedElement,
@@ -97,10 +97,11 @@ function resolvePropValue(
97
97
  return resolveOverridableOverride( matchingOverride, originValue );
98
98
  }
99
99
 
100
- // for regular props, when there's a matching override, return the matching override value
100
+ // for regular props, when there's a non null matching override, return the matching override value,
101
+ // otherwise return the origin value
101
102
  const matchingOverrideValue = componentInstanceOverridePropTypeUtil.extract( matchingOverride )
102
103
  ?.override_value as PropValue | null;
103
- return matchingOverrideValue;
104
+ return matchingOverrideValue ?? originValue;
104
105
  }
105
106
 
106
107
  function resolveOverridableOverride(