@elementor/editor-elements 4.4.0-1148 → 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/dist/index.d.mts CHANGED
@@ -431,6 +431,8 @@ declare const duplicateElements: ({ elementIds, title, subtitle, onDuplicateElem
431
431
  type CloneableElement = Partial<V1ElementModelProps> | BackboneModel;
432
432
  declare function cloneElementTree(item: CloneableElement): V1ElementModelProps;
433
433
 
434
+ declare function findClosestContainer(start: V1Element | null | undefined, predicate: (container: V1Element) => boolean): V1Element | null;
435
+
434
436
  declare const generateElementId: () => string;
435
437
 
436
438
  declare function getContainer(id: string): V1Element | null;
@@ -627,4 +629,4 @@ declare const updateElementInteractions: ({ elementId, interactions, }: {
627
629
  }) => void;
628
630
  declare const playElementInteractions: (elementId: string, interactionId: string) => void;
629
631
 
630
- export { type AnimationPresetPropValue, type BackboneCollection, type BackboneModel, type BooleanPropValue, type ChildDependenciesConfig, type ChildDependencyRule, type ConfigPropValue, type Control, type ControlItem, type ControlLayout, type ControlsSection, type CreateElementParams, type CreateElementStyleArgs, DEFAULT_STYLE_CLASS_PREFIX, type DropElementParams, type DuplicateElementParams, type DuplicateElementsParams, type DuplicatedElement, type DuplicatedElementsResult, ELEMENT_STYLE_CHANGE_EVENT, type Element, type ElementChildren, type ElementControl, type ElementID, type ElementInteractions, type ElementModel, type ElementPosition, type ElementPositionKind, type ElementType, type ExcludedBreakpointsPropValue, type ExtendedWindow, type InteractionBreakpointsPropValue, type InteractionItemPropValue, type LinkInLinkRestriction, type ModelResult, type MoveElementParams, type NumberPropValue, type PseudoState, type StringPropValue, type TimingConfigPropValue, type UpdateElementSettingsArgs, type UpdateElementStyleArgs, type UseElementChildrenOptions, type V1Element, type V1ElementConfig, type V1ElementData, type V1ElementEditorSettingsProps, type V1ElementModelProps, type V1ElementSettingsProps, addModelToParent, bindSettingsReconcile, cloneElementTree, createElement, createElementStyle, createElements, deleteElement, deleteElementStyle, dropElement, duplicateElement, duplicateElements, evaluateWhen, findChildRecursive, findModelInDocument, generateElementId, getAllDescendants, getAnchoredAncestorId, getAnchoredDescendantId, getContainer, getCurrentDocumentContainer, getCurrentDocumentId, getDefaultStyleTagFromPreviewElement, getElementChildren as getElementChildrenWithFallback, getElementEditorSettings, getElementIcon, getElementInteractions, getElementLabel, getElementSetting, getElementSettings, getElementStyles, getElementTitle, getElementType, getElements, getHostDocumentElements, getHostDocumentId, getLinkInLinkRestriction, getPreviewElementDOM, getSelectedElements, getWidgetsCache, isElementAnchored, moveElement, moveElements, parseDefaultStyleTagFromClassList, playElementInteractions, reconcileInitialChildren, removeElements, removeModelFromParent, replaceElement, resolveContainer, resolveInsertIndex, selectElement, shouldCreateNewLocalStyle, styleRerenderEvents, updateElementEditorSettings, updateElementInteractions, updateElementSettings, updateElementStyle, useElementChildren, useElementEditorSettings, useParentElement, useSelectedElement, useSelectedElementSettings };
632
+ export { type AnimationPresetPropValue, type BackboneCollection, type BackboneModel, type BooleanPropValue, type ChildDependenciesConfig, type ChildDependencyRule, type ConfigPropValue, type Control, type ControlItem, type ControlLayout, type ControlsSection, type CreateElementParams, type CreateElementStyleArgs, DEFAULT_STYLE_CLASS_PREFIX, type DropElementParams, type DuplicateElementParams, type DuplicateElementsParams, type DuplicatedElement, type DuplicatedElementsResult, ELEMENT_STYLE_CHANGE_EVENT, type Element, type ElementChildren, type ElementControl, type ElementID, type ElementInteractions, type ElementModel, type ElementPosition, type ElementPositionKind, type ElementType, type ExcludedBreakpointsPropValue, type ExtendedWindow, type InteractionBreakpointsPropValue, type InteractionItemPropValue, type LinkInLinkRestriction, type ModelResult, type MoveElementParams, type NumberPropValue, type PseudoState, type StringPropValue, type TimingConfigPropValue, type UpdateElementSettingsArgs, type UpdateElementStyleArgs, type UseElementChildrenOptions, type V1Element, type V1ElementConfig, type V1ElementData, type V1ElementEditorSettingsProps, type V1ElementModelProps, type V1ElementSettingsProps, addModelToParent, bindSettingsReconcile, cloneElementTree, createElement, createElementStyle, createElements, deleteElement, deleteElementStyle, dropElement, duplicateElement, duplicateElements, evaluateWhen, findChildRecursive, findClosestContainer, findModelInDocument, generateElementId, getAllDescendants, getAnchoredAncestorId, getAnchoredDescendantId, getContainer, getCurrentDocumentContainer, getCurrentDocumentId, getDefaultStyleTagFromPreviewElement, getElementChildren as getElementChildrenWithFallback, getElementEditorSettings, getElementIcon, getElementInteractions, getElementLabel, getElementSetting, getElementSettings, getElementStyles, getElementTitle, getElementType, getElements, getHostDocumentElements, getHostDocumentId, getLinkInLinkRestriction, getPreviewElementDOM, getSelectedElements, getWidgetsCache, isElementAnchored, moveElement, moveElements, parseDefaultStyleTagFromClassList, playElementInteractions, reconcileInitialChildren, removeElements, removeModelFromParent, replaceElement, resolveContainer, resolveInsertIndex, selectElement, shouldCreateNewLocalStyle, styleRerenderEvents, updateElementEditorSettings, updateElementInteractions, updateElementSettings, updateElementStyle, useElementChildren, useElementEditorSettings, useParentElement, useSelectedElement, useSelectedElementSettings };
package/dist/index.d.ts CHANGED
@@ -431,6 +431,8 @@ declare const duplicateElements: ({ elementIds, title, subtitle, onDuplicateElem
431
431
  type CloneableElement = Partial<V1ElementModelProps> | BackboneModel;
432
432
  declare function cloneElementTree(item: CloneableElement): V1ElementModelProps;
433
433
 
434
+ declare function findClosestContainer(start: V1Element | null | undefined, predicate: (container: V1Element) => boolean): V1Element | null;
435
+
434
436
  declare const generateElementId: () => string;
435
437
 
436
438
  declare function getContainer(id: string): V1Element | null;
@@ -627,4 +629,4 @@ declare const updateElementInteractions: ({ elementId, interactions, }: {
627
629
  }) => void;
628
630
  declare const playElementInteractions: (elementId: string, interactionId: string) => void;
629
631
 
630
- export { type AnimationPresetPropValue, type BackboneCollection, type BackboneModel, type BooleanPropValue, type ChildDependenciesConfig, type ChildDependencyRule, type ConfigPropValue, type Control, type ControlItem, type ControlLayout, type ControlsSection, type CreateElementParams, type CreateElementStyleArgs, DEFAULT_STYLE_CLASS_PREFIX, type DropElementParams, type DuplicateElementParams, type DuplicateElementsParams, type DuplicatedElement, type DuplicatedElementsResult, ELEMENT_STYLE_CHANGE_EVENT, type Element, type ElementChildren, type ElementControl, type ElementID, type ElementInteractions, type ElementModel, type ElementPosition, type ElementPositionKind, type ElementType, type ExcludedBreakpointsPropValue, type ExtendedWindow, type InteractionBreakpointsPropValue, type InteractionItemPropValue, type LinkInLinkRestriction, type ModelResult, type MoveElementParams, type NumberPropValue, type PseudoState, type StringPropValue, type TimingConfigPropValue, type UpdateElementSettingsArgs, type UpdateElementStyleArgs, type UseElementChildrenOptions, type V1Element, type V1ElementConfig, type V1ElementData, type V1ElementEditorSettingsProps, type V1ElementModelProps, type V1ElementSettingsProps, addModelToParent, bindSettingsReconcile, cloneElementTree, createElement, createElementStyle, createElements, deleteElement, deleteElementStyle, dropElement, duplicateElement, duplicateElements, evaluateWhen, findChildRecursive, findModelInDocument, generateElementId, getAllDescendants, getAnchoredAncestorId, getAnchoredDescendantId, getContainer, getCurrentDocumentContainer, getCurrentDocumentId, getDefaultStyleTagFromPreviewElement, getElementChildren as getElementChildrenWithFallback, getElementEditorSettings, getElementIcon, getElementInteractions, getElementLabel, getElementSetting, getElementSettings, getElementStyles, getElementTitle, getElementType, getElements, getHostDocumentElements, getHostDocumentId, getLinkInLinkRestriction, getPreviewElementDOM, getSelectedElements, getWidgetsCache, isElementAnchored, moveElement, moveElements, parseDefaultStyleTagFromClassList, playElementInteractions, reconcileInitialChildren, removeElements, removeModelFromParent, replaceElement, resolveContainer, resolveInsertIndex, selectElement, shouldCreateNewLocalStyle, styleRerenderEvents, updateElementEditorSettings, updateElementInteractions, updateElementSettings, updateElementStyle, useElementChildren, useElementEditorSettings, useParentElement, useSelectedElement, useSelectedElementSettings };
632
+ export { type AnimationPresetPropValue, type BackboneCollection, type BackboneModel, type BooleanPropValue, type ChildDependenciesConfig, type ChildDependencyRule, type ConfigPropValue, type Control, type ControlItem, type ControlLayout, type ControlsSection, type CreateElementParams, type CreateElementStyleArgs, DEFAULT_STYLE_CLASS_PREFIX, type DropElementParams, type DuplicateElementParams, type DuplicateElementsParams, type DuplicatedElement, type DuplicatedElementsResult, ELEMENT_STYLE_CHANGE_EVENT, type Element, type ElementChildren, type ElementControl, type ElementID, type ElementInteractions, type ElementModel, type ElementPosition, type ElementPositionKind, type ElementType, type ExcludedBreakpointsPropValue, type ExtendedWindow, type InteractionBreakpointsPropValue, type InteractionItemPropValue, type LinkInLinkRestriction, type ModelResult, type MoveElementParams, type NumberPropValue, type PseudoState, type StringPropValue, type TimingConfigPropValue, type UpdateElementSettingsArgs, type UpdateElementStyleArgs, type UseElementChildrenOptions, type V1Element, type V1ElementConfig, type V1ElementData, type V1ElementEditorSettingsProps, type V1ElementModelProps, type V1ElementSettingsProps, addModelToParent, bindSettingsReconcile, cloneElementTree, createElement, createElementStyle, createElements, deleteElement, deleteElementStyle, dropElement, duplicateElement, duplicateElements, evaluateWhen, findChildRecursive, findClosestContainer, findModelInDocument, generateElementId, getAllDescendants, getAnchoredAncestorId, getAnchoredDescendantId, getContainer, getCurrentDocumentContainer, getCurrentDocumentId, getDefaultStyleTagFromPreviewElement, getElementChildren as getElementChildrenWithFallback, getElementEditorSettings, getElementIcon, getElementInteractions, getElementLabel, getElementSetting, getElementSettings, getElementStyles, getElementTitle, getElementType, getElements, getHostDocumentElements, getHostDocumentId, getLinkInLinkRestriction, getPreviewElementDOM, getSelectedElements, getWidgetsCache, isElementAnchored, moveElement, moveElements, parseDefaultStyleTagFromClassList, playElementInteractions, reconcileInitialChildren, removeElements, removeModelFromParent, replaceElement, resolveContainer, resolveInsertIndex, selectElement, shouldCreateNewLocalStyle, styleRerenderEvents, updateElementEditorSettings, updateElementInteractions, updateElementSettings, updateElementStyle, useElementChildren, useElementEditorSettings, useParentElement, useSelectedElement, useSelectedElementSettings };
package/dist/index.js CHANGED
@@ -35,6 +35,7 @@ __export(index_exports, {
35
35
  duplicateElements: () => duplicateElements,
36
36
  evaluateWhen: () => evaluateWhen,
37
37
  findChildRecursive: () => findChildRecursive,
38
+ findClosestContainer: () => findClosestContainer,
38
39
  findModelInDocument: () => findModelInDocument,
39
40
  generateElementId: () => generateElementId,
40
41
  getAllDescendants: () => getAllDescendants,
@@ -838,6 +839,18 @@ function cloneElementTree(item) {
838
839
  };
839
840
  }
840
841
 
842
+ // src/sync/find-closest-container.ts
843
+ function findClosestContainer(start, predicate) {
844
+ let current = start ?? null;
845
+ while (current) {
846
+ if (predicate(current)) {
847
+ return current;
848
+ }
849
+ current = current.parent ?? null;
850
+ }
851
+ return null;
852
+ }
853
+
841
854
  // src/sync/get-preview-element-dom.ts
842
855
  function getPreviewElementDOM(id) {
843
856
  try {
@@ -1656,6 +1669,7 @@ var playElementInteractions = (elementId, interactionId) => {
1656
1669
  duplicateElements,
1657
1670
  evaluateWhen,
1658
1671
  findChildRecursive,
1672
+ findClosestContainer,
1659
1673
  findModelInDocument,
1660
1674
  generateElementId,
1661
1675
  getAllDescendants,