@elementor/editor-controls 4.4.0-1147 → 4.4.0-1149

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-controls",
3
3
  "description": "This package contains the controls model and utils for the Elementor editor",
4
- "version": "4.4.0-1147",
4
+ "version": "4.4.0-1149",
5
5
  "private": false,
6
6
  "author": "Elementor Team",
7
7
  "homepage": "https://elementor.com/",
@@ -40,23 +40,23 @@
40
40
  "dev": "tsup --config=../../tsup.dev.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@elementor/editor-current-user": "4.4.0-1147",
44
- "@elementor/editor-elements": "4.4.0-1147",
45
- "@elementor/editor-props": "4.4.0-1147",
46
- "@elementor/editor-responsive": "4.4.0-1147",
47
- "@elementor/editor-ui": "4.4.0-1147",
48
- "@elementor/editor-v1-adapters": "4.4.0-1147",
49
- "@elementor/env": "4.4.0-1147",
50
- "@elementor/events": "4.4.0-1147",
51
- "@elementor/http-client": "4.4.0-1147",
43
+ "@elementor/editor-current-user": "4.4.0-1149",
44
+ "@elementor/editor-elements": "4.4.0-1149",
45
+ "@elementor/editor-props": "4.4.0-1149",
46
+ "@elementor/editor-responsive": "4.4.0-1149",
47
+ "@elementor/editor-ui": "4.4.0-1149",
48
+ "@elementor/editor-v1-adapters": "4.4.0-1149",
49
+ "@elementor/env": "4.4.0-1149",
50
+ "@elementor/events": "4.4.0-1149",
51
+ "@elementor/http-client": "4.4.0-1149",
52
52
  "@elementor/icons": "~1.78.1",
53
- "@elementor/locations": "4.4.0-1147",
54
- "@elementor/query": "4.4.0-1147",
55
- "@elementor/schema": "4.4.0-1147",
56
- "@elementor/session": "4.4.0-1147",
53
+ "@elementor/locations": "4.4.0-1149",
54
+ "@elementor/query": "4.4.0-1149",
55
+ "@elementor/schema": "4.4.0-1149",
56
+ "@elementor/session": "4.4.0-1149",
57
57
  "@elementor/ui": "1.41.4",
58
- "@elementor/utils": "4.4.0-1147",
59
- "@elementor/wp-media": "4.4.0-1147",
58
+ "@elementor/utils": "4.4.0-1149",
59
+ "@elementor/wp-media": "4.4.0-1149",
60
60
  "@monaco-editor/react": "^4.7.0",
61
61
  "@tanstack/react-virtual": "^3.13.3",
62
62
  "@tiptap/extension-bold": "^3.11.1",
@@ -1,4 +1,10 @@
1
- import { getContainer, getSelectedElements, getWidgetsCache, type V1Element } from '@elementor/editor-elements';
1
+ import {
2
+ findClosestContainer,
3
+ getContainer,
4
+ getSelectedElements,
5
+ getWidgetsCache,
6
+ type V1Element,
7
+ } from '@elementor/editor-elements';
2
8
  import { type PropsSchema, stringPropTypeUtil } from '@elementor/editor-props';
3
9
  import { __privateUseListenTo as useListenTo, commandEndEvent, v1ReadyEvent } from '@elementor/editor-v1-adapters';
4
10
 
@@ -49,17 +55,10 @@ function getFieldCssId( child: V1Element, widgetType: string ): string | null {
49
55
  }
50
56
 
51
57
  function getFormContainer( elementId: string ): V1Element | null {
52
- let container = getContainer( elementId );
53
-
54
- while ( container ) {
55
- if ( container.model.get( 'elType' ) === FORM_ELEMENT_TYPE ) {
56
- return container;
57
- }
58
-
59
- container = container.parent ?? null;
60
- }
61
-
62
- return null;
58
+ return findClosestContainer(
59
+ getContainer( elementId ),
60
+ ( container ) => container.model.get( 'elType' ) === FORM_ELEMENT_TYPE
61
+ );
63
62
  }
64
63
 
65
64
  export function useFormFieldSuggestions( options?: Options ): Suggestion[] {