@elementor/editor-elements 4.4.0-1111 → 4.4.0-1113

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
@@ -91,6 +91,10 @@ type ExtendedWindow = Window & {
91
91
  container: V1Element;
92
92
  } | undefined;
93
93
  getCurrentId?: () => number;
94
+ getInitialId?: () => number;
95
+ get?: (id: number) => {
96
+ container: V1Element;
97
+ } | undefined;
94
98
  };
95
99
  getContainer?: (id: string) => V1Element | undefined;
96
100
  getPreviewContainer?: () => V1Element | undefined;
@@ -228,6 +232,7 @@ type V1ElementEditorSettingsProps = {
228
232
  component_uid?: string;
229
233
  grid_outline?: boolean;
230
234
  empty_state_preview?: boolean;
235
+ decorative?: boolean;
231
236
  };
232
237
  type V1ElementSettingsProps = Record<string, PropValue>;
233
238
  type V1ElementConfig<T = object, TChild = unknown> = {
@@ -464,6 +469,9 @@ declare function findChildRecursive(model: V1Model, predicate: (model: V1Model)
464
469
  declare function getElementChildren(model: V1Model, predicate?: (model: V1Model) => boolean): ModelResult[];
465
470
 
466
471
  declare function getElements(root?: ElementID): V1Element[];
472
+ declare function getHostDocumentElements(): V1Element[];
473
+
474
+ declare function getHostDocumentId(): number | null;
467
475
 
468
476
  declare function getSelectedElements(): Element[];
469
477
 
@@ -613,4 +621,4 @@ declare const updateElementInteractions: ({ elementId, interactions, }: {
613
621
  }) => void;
614
622
  declare const playElementInteractions: (elementId: string, interactionId: string) => void;
615
623
 
616
- 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, 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, 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 };
624
+ 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, 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 };
package/dist/index.d.ts CHANGED
@@ -91,6 +91,10 @@ type ExtendedWindow = Window & {
91
91
  container: V1Element;
92
92
  } | undefined;
93
93
  getCurrentId?: () => number;
94
+ getInitialId?: () => number;
95
+ get?: (id: number) => {
96
+ container: V1Element;
97
+ } | undefined;
94
98
  };
95
99
  getContainer?: (id: string) => V1Element | undefined;
96
100
  getPreviewContainer?: () => V1Element | undefined;
@@ -228,6 +232,7 @@ type V1ElementEditorSettingsProps = {
228
232
  component_uid?: string;
229
233
  grid_outline?: boolean;
230
234
  empty_state_preview?: boolean;
235
+ decorative?: boolean;
231
236
  };
232
237
  type V1ElementSettingsProps = Record<string, PropValue>;
233
238
  type V1ElementConfig<T = object, TChild = unknown> = {
@@ -464,6 +469,9 @@ declare function findChildRecursive(model: V1Model, predicate: (model: V1Model)
464
469
  declare function getElementChildren(model: V1Model, predicate?: (model: V1Model) => boolean): ModelResult[];
465
470
 
466
471
  declare function getElements(root?: ElementID): V1Element[];
472
+ declare function getHostDocumentElements(): V1Element[];
473
+
474
+ declare function getHostDocumentId(): number | null;
467
475
 
468
476
  declare function getSelectedElements(): Element[];
469
477
 
@@ -613,4 +621,4 @@ declare const updateElementInteractions: ({ elementId, interactions, }: {
613
621
  }) => void;
614
622
  declare const playElementInteractions: (elementId: string, interactionId: string) => void;
615
623
 
616
- 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, 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, 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 };
624
+ 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, 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 };
package/dist/index.js CHANGED
@@ -54,6 +54,8 @@ __export(index_exports, {
54
54
  getElementTitle: () => getElementTitle,
55
55
  getElementType: () => getElementType,
56
56
  getElements: () => getElements,
57
+ getHostDocumentElements: () => getHostDocumentElements,
58
+ getHostDocumentId: () => getHostDocumentId,
57
59
  getLinkInLinkRestriction: () => getLinkInLinkRestriction,
58
60
  getPreviewElementDOM: () => getPreviewElementDOM,
59
61
  getSelectedElements: () => getSelectedElements,
@@ -906,9 +908,28 @@ function getAllDescendants(container) {
906
908
  return [container, ...children];
907
909
  }
908
910
 
911
+ // src/sync/get-host-document-id.ts
912
+ function getHostDocumentId() {
913
+ const extendedWindow = window;
914
+ try {
915
+ return extendedWindow.elementor?.documents?.getInitialId?.() ?? null;
916
+ } catch {
917
+ return null;
918
+ }
919
+ }
920
+
921
+ // src/sync/get-host-document-container.ts
922
+ function getHostDocumentContainer() {
923
+ const extendedWindow = window;
924
+ const hostId = getHostDocumentId();
925
+ if (!hostId) {
926
+ return null;
927
+ }
928
+ return extendedWindow.elementor?.documents?.get?.(hostId)?.container ?? null;
929
+ }
930
+
909
931
  // src/sync/get-elements.ts
910
- function getElements(root) {
911
- const container = root ? getContainer(root) : getCurrentDocumentContainer();
932
+ function collectElements(container) {
912
933
  if (!container) {
913
934
  return [];
914
935
  }
@@ -917,6 +938,13 @@ function getElements(root) {
917
938
  );
918
939
  return [container, ...children];
919
940
  }
941
+ function getElements(root) {
942
+ const container = root ? getContainer(root) : getCurrentDocumentContainer();
943
+ return collectElements(container);
944
+ }
945
+ function getHostDocumentElements() {
946
+ return collectElements(getHostDocumentContainer());
947
+ }
920
948
 
921
949
  // src/sync/move-element.ts
922
950
  function moveElement({ element, targetContainer, options = {} }) {
@@ -1584,6 +1612,8 @@ var playElementInteractions = (elementId, interactionId) => {
1584
1612
  getElementTitle,
1585
1613
  getElementType,
1586
1614
  getElements,
1615
+ getHostDocumentElements,
1616
+ getHostDocumentId,
1587
1617
  getLinkInLinkRestriction,
1588
1618
  getPreviewElementDOM,
1589
1619
  getSelectedElements,