@elementor/editor-controls 4.4.0-1148 → 4.4.0-beta1

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.mjs CHANGED
@@ -10511,7 +10511,12 @@ import { Grid as Grid34, Stack as Stack25 } from "@elementor/ui";
10511
10511
  import { __ as __68 } from "@wordpress/i18n";
10512
10512
 
10513
10513
  // src/hooks/use-form-field-suggestions.ts
10514
- import { getContainer as getContainer3, getSelectedElements as getSelectedElements3, getWidgetsCache } from "@elementor/editor-elements";
10514
+ import {
10515
+ findClosestContainer,
10516
+ getContainer as getContainer3,
10517
+ getSelectedElements as getSelectedElements3,
10518
+ getWidgetsCache
10519
+ } from "@elementor/editor-elements";
10515
10520
  import { stringPropTypeUtil as stringPropTypeUtil22 } from "@elementor/editor-props";
10516
10521
  import { __privateUseListenTo as useListenTo2, commandEndEvent as commandEndEvent2, v1ReadyEvent } from "@elementor/editor-v1-adapters";
10517
10522
  var FORM_FIELD_WIDGET_TYPES = [
@@ -10543,14 +10548,10 @@ function getFieldCssId(child, widgetType) {
10543
10548
  return extractStringPropValue(getSettingWithDefault(child, widgetType, CSS_ID_PROP_KEY));
10544
10549
  }
10545
10550
  function getFormContainer(elementId) {
10546
- let container = getContainer3(elementId);
10547
- while (container) {
10548
- if (container.model.get("elType") === FORM_ELEMENT_TYPE) {
10549
- return container;
10550
- }
10551
- container = container.parent ?? null;
10552
- }
10553
- return null;
10551
+ return findClosestContainer(
10552
+ getContainer3(elementId),
10553
+ (container) => container.model.get("elType") === FORM_ELEMENT_TYPE
10554
+ );
10554
10555
  }
10555
10556
  function useFormFieldSuggestions(options) {
10556
10557
  return useListenTo2(