@elementor/editor-canvas 4.0.0-544 → 4.0.0-545

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 CHANGED
@@ -3139,19 +3139,19 @@ var CompositionBuilder = class _CompositionBuilder {
3139
3139
  const elementTag = node.tagName;
3140
3140
  const isContainer = this.containerElements.includes(elementTag);
3141
3141
  const parentElType = containerElement.model.get("elType");
3142
- let targetContainerId = parentElType === "e-tabs" ? containerElement.children?.[1].children?.[childIndex]?.id || containerElement.children?.[1].id : containerElement.id;
3143
- if (!targetContainerId) {
3144
- targetContainerId = containerElement.id;
3142
+ let targetContainer = parentElType === "e-tabs" ? containerElement.children?.[1].children?.[childIndex] || containerElement.children?.[1] : containerElement;
3143
+ if (!targetContainer) {
3144
+ targetContainer = containerElement;
3145
3145
  }
3146
3146
  const newElement = isContainer ? this.api.createElement({
3147
- containerId: targetContainerId,
3147
+ container: targetContainer,
3148
3148
  model: {
3149
3149
  elType: elementTag,
3150
3150
  id: (0, import_editor_elements9.generateElementId)()
3151
3151
  },
3152
3152
  options: { useHistory: false }
3153
3153
  }) : this.api.createElement({
3154
- containerId: targetContainerId,
3154
+ container: targetContainer,
3155
3155
  model: {
3156
3156
  elType: "widget",
3157
3157
  widgetType: elementTag,
@@ -3526,7 +3526,7 @@ var initBuildCompositionsTool = (reg) => {
3526
3526
  if (errors.length) {
3527
3527
  rootContainers.forEach((rootContainer) => {
3528
3528
  (0, import_editor_elements10.deleteElement)({
3529
- elementId: rootContainer.id,
3529
+ container: rootContainer,
3530
3530
  options: { useHistory: false }
3531
3531
  });
3532
3532
  });
package/dist/index.mjs CHANGED
@@ -3121,19 +3121,19 @@ var CompositionBuilder = class _CompositionBuilder {
3121
3121
  const elementTag = node.tagName;
3122
3122
  const isContainer = this.containerElements.includes(elementTag);
3123
3123
  const parentElType = containerElement.model.get("elType");
3124
- let targetContainerId = parentElType === "e-tabs" ? containerElement.children?.[1].children?.[childIndex]?.id || containerElement.children?.[1].id : containerElement.id;
3125
- if (!targetContainerId) {
3126
- targetContainerId = containerElement.id;
3124
+ let targetContainer = parentElType === "e-tabs" ? containerElement.children?.[1].children?.[childIndex] || containerElement.children?.[1] : containerElement;
3125
+ if (!targetContainer) {
3126
+ targetContainer = containerElement;
3127
3127
  }
3128
3128
  const newElement = isContainer ? this.api.createElement({
3129
- containerId: targetContainerId,
3129
+ container: targetContainer,
3130
3130
  model: {
3131
3131
  elType: elementTag,
3132
3132
  id: generateElementId()
3133
3133
  },
3134
3134
  options: { useHistory: false }
3135
3135
  }) : this.api.createElement({
3136
- containerId: targetContainerId,
3136
+ container: targetContainer,
3137
3137
  model: {
3138
3138
  elType: "widget",
3139
3139
  widgetType: elementTag,
@@ -3508,7 +3508,7 @@ var initBuildCompositionsTool = (reg) => {
3508
3508
  if (errors.length) {
3509
3509
  rootContainers.forEach((rootContainer) => {
3510
3510
  deleteElement({
3511
- elementId: rootContainer.id,
3511
+ container: rootContainer,
3512
3512
  options: { useHistory: false }
3513
3513
  });
3514
3514
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elementor/editor-canvas",
3
3
  "description": "Elementor Editor Canvas",
4
- "version": "4.0.0-544",
4
+ "version": "4.0.0-545",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -37,24 +37,24 @@
37
37
  "react-dom": "^18.3.1"
38
38
  },
39
39
  "dependencies": {
40
- "@elementor/editor": "4.0.0-544",
41
- "@elementor/editor-controls": "4.0.0-544",
42
- "@elementor/editor-documents": "4.0.0-544",
43
- "@elementor/editor-elements": "4.0.0-544",
44
- "@elementor/editor-interactions": "4.0.0-544",
45
- "@elementor/editor-mcp": "4.0.0-544",
46
- "@elementor/editor-notifications": "4.0.0-544",
47
- "@elementor/editor-props": "4.0.0-544",
48
- "@elementor/editor-responsive": "4.0.0-544",
49
- "@elementor/editor-styles": "4.0.0-544",
50
- "@elementor/editor-styles-repository": "4.0.0-544",
51
- "@elementor/editor-ui": "4.0.0-544",
52
- "@elementor/editor-v1-adapters": "4.0.0-544",
53
- "@elementor/schema": "4.0.0-544",
54
- "@elementor/twing": "4.0.0-544",
40
+ "@elementor/editor": "4.0.0-545",
41
+ "@elementor/editor-controls": "4.0.0-545",
42
+ "@elementor/editor-documents": "4.0.0-545",
43
+ "@elementor/editor-elements": "4.0.0-545",
44
+ "@elementor/editor-interactions": "4.0.0-545",
45
+ "@elementor/editor-mcp": "4.0.0-545",
46
+ "@elementor/editor-notifications": "4.0.0-545",
47
+ "@elementor/editor-props": "4.0.0-545",
48
+ "@elementor/editor-responsive": "4.0.0-545",
49
+ "@elementor/editor-styles": "4.0.0-545",
50
+ "@elementor/editor-styles-repository": "4.0.0-545",
51
+ "@elementor/editor-ui": "4.0.0-545",
52
+ "@elementor/editor-v1-adapters": "4.0.0-545",
53
+ "@elementor/schema": "4.0.0-545",
54
+ "@elementor/twing": "4.0.0-545",
55
55
  "@elementor/ui": "1.36.17",
56
- "@elementor/utils": "4.0.0-544",
57
- "@elementor/wp-media": "4.0.0-544",
56
+ "@elementor/utils": "4.0.0-545",
57
+ "@elementor/wp-media": "4.0.0-545",
58
58
  "@floating-ui/react": "^0.27.5",
59
59
  "@wordpress/i18n": "^5.13.0"
60
60
  },
@@ -79,16 +79,16 @@ export class CompositionBuilder {
79
79
  const elementTag = node.tagName;
80
80
  const isContainer = this.containerElements.includes( elementTag );
81
81
  const parentElType = containerElement.model.get( 'elType' );
82
- let targetContainerId =
82
+ let targetContainer =
83
83
  parentElType === 'e-tabs'
84
- ? containerElement.children?.[ 1 ].children?.[ childIndex ]?.id || containerElement.children?.[ 1 ].id
85
- : containerElement.id;
86
- if ( ! targetContainerId ) {
87
- targetContainerId = containerElement.id;
84
+ ? containerElement.children?.[ 1 ].children?.[ childIndex ] || containerElement.children?.[ 1 ]
85
+ : containerElement;
86
+ if ( ! targetContainer ) {
87
+ targetContainer = containerElement;
88
88
  }
89
89
  const newElement = isContainer
90
90
  ? this.api.createElement( {
91
- containerId: targetContainerId,
91
+ container: targetContainer,
92
92
  model: {
93
93
  elType: elementTag,
94
94
  id: generateElementId(),
@@ -96,7 +96,7 @@ export class CompositionBuilder {
96
96
  options: { useHistory: false },
97
97
  } )
98
98
  : this.api.createElement( {
99
- containerId: targetContainerId,
99
+ container: targetContainer,
100
100
  model: {
101
101
  elType: 'widget',
102
102
  widgetType: elementTag,
@@ -82,7 +82,7 @@ export const initBuildCompositionsTool = ( reg: MCPRegistryEntry ) => {
82
82
  if ( errors.length ) {
83
83
  rootContainers.forEach( ( rootContainer ) => {
84
84
  deleteElement( {
85
- elementId: rootContainer.id,
85
+ container: rootContainer,
86
86
  options: { useHistory: false },
87
87
  } );
88
88
  } );