@elementor/editor-elements 4.0.0-544 → 4.0.0-546

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
@@ -88,6 +88,7 @@ type V1Element = {
88
88
  };
89
89
  };
90
90
  parent?: V1Element;
91
+ lookup?: () => V1Element;
91
92
  };
92
93
  type StringPropValue = {
93
94
  $$type: 'string';
@@ -114,8 +115,8 @@ type ConfigPropValue = {
114
115
  replay: BooleanPropValue;
115
116
  easing: StringPropValue;
116
117
  relativeTo: StringPropValue;
117
- offsetTop: NumberPropValue;
118
- offsetBottom: NumberPropValue;
118
+ offsetTop?: SizePropValue;
119
+ offsetBottom?: SizePropValue;
119
120
  };
120
121
  };
121
122
  type AnimationPresetPropValue = {
@@ -230,39 +231,41 @@ type Options$4 = {
230
231
  clone?: boolean;
231
232
  };
232
233
  type CreateElementParams = {
233
- containerId: string;
234
- options?: Options$4;
234
+ container: V1Element;
235
235
  model?: Omit<V1ElementModelProps, 'settings' | 'id'> & {
236
236
  settings?: V1ElementSettingsProps;
237
237
  id?: string;
238
238
  };
239
+ options?: Options$4;
239
240
  };
240
- declare function createElement({ containerId, model, options }: CreateElementParams): V1Element;
241
+ declare function createElement({ container, model, options }: CreateElementParams): V1Element;
241
242
 
242
- type CreateNestedElementsParams = {
243
+ type CreateElementsParams = {
243
244
  elements: CreateElementParams[];
244
245
  title: string;
245
246
  subtitle?: string;
246
247
  };
247
248
  type CreatedElement = {
248
- elementId: string;
249
+ container: V1Element;
250
+ parentContainer: V1Element;
249
251
  model: V1ElementModelProps;
250
- createParams: CreateElementParams;
252
+ options?: CreateElementParams['options'];
251
253
  };
252
254
  type CreatedElementsResult = {
253
255
  createdElements: CreatedElement[];
254
256
  };
255
257
 
256
- declare const createElements: ({ elements, title, subtitle, }: CreateNestedElementsParams) => CreatedElementsResult;
258
+ declare const createElements: ({ elements, title, subtitle, }: CreateElementsParams) => CreatedElementsResult;
257
259
 
258
260
  type Options$3 = {
259
261
  useHistory?: boolean;
260
262
  at?: number;
261
263
  };
262
- declare function deleteElement({ elementId, options, }: {
263
- elementId: string;
264
+ type DeleteElementParams = {
265
+ container: V1Element;
264
266
  options?: Options$3;
265
- }): Promise<void>;
267
+ };
268
+ declare function deleteElement({ container, options }: DeleteElementParams): Promise<void>;
266
269
 
267
270
  type Options$2 = {
268
271
  useHistory?: boolean;
@@ -285,10 +288,10 @@ type Options$1 = {
285
288
  clone?: boolean;
286
289
  };
287
290
  type DuplicateElementParams = {
288
- elementId: string;
291
+ element: V1Element;
289
292
  options?: Options$1;
290
293
  };
291
- declare function duplicateElement({ elementId, options }: DuplicateElementParams): V1Element;
294
+ declare function duplicateElement({ element, options }: DuplicateElementParams): V1Element;
292
295
 
293
296
  type DuplicateElementsParams = {
294
297
  elementIds: string[];
@@ -298,11 +301,9 @@ type DuplicateElementsParams = {
298
301
  onRestoreElements?: () => void;
299
302
  };
300
303
  type DuplicatedElement = {
301
- id: string;
304
+ container: V1Element;
305
+ parentContainer: V1Element;
302
306
  model: V1ElementModelProps;
303
- originalElementId: string;
304
- modelToRestore?: V1ElementModelProps;
305
- parentContainerId?: string;
306
307
  at?: number;
307
308
  };
308
309
  type DuplicatedElementsResult = {
@@ -337,7 +338,6 @@ type V1Model = V1Element['model'];
337
338
  type ModelResult = {
338
339
  model: V1Model;
339
340
  };
340
- declare function getModel(id: string, parentModel?: V1Model): ModelResult | null;
341
341
  declare function findChildRecursive(model: V1Model, predicate: (model: V1Model) => boolean): ModelResult | null;
342
342
  declare function getElementChildren(model: V1Model, predicate?: (model: V1Model) => boolean): ModelResult[];
343
343
 
@@ -354,29 +354,35 @@ type Options = {
354
354
  edit?: boolean;
355
355
  };
356
356
  type MoveElementParams = {
357
- elementId: string;
358
- targetContainerId: string;
357
+ element: V1Element;
358
+ targetContainer: V1Element;
359
359
  options?: Options;
360
360
  };
361
- declare function moveElement({ elementId, targetContainerId, options }: MoveElementParams): V1Element;
361
+ declare function moveElement({ element, targetContainer, options }: MoveElementParams): V1Element;
362
362
 
363
+ type MoveOptions = {
364
+ useHistory?: boolean;
365
+ at?: number;
366
+ edit?: boolean;
367
+ };
368
+ type MoveInput = {
369
+ element: V1Element;
370
+ targetContainer: V1Element;
371
+ options?: MoveOptions;
372
+ };
363
373
  type MoveElementsParams = {
364
- moves: MoveElementParams[];
374
+ moves: MoveInput[];
365
375
  title: string;
366
376
  subtitle?: string;
367
377
  onMoveElements?: () => void;
368
378
  onRestoreElements?: () => void;
369
379
  };
370
- type OriginalPosition = {
371
- elementId: string;
372
- originalContainerId: string;
373
- originalIndex: number;
374
- };
375
380
  type MovedElement = {
376
- elementId: string;
377
- originalPosition: OriginalPosition;
378
- move: MoveElementParams;
379
381
  element: V1Element;
382
+ originalContainer: V1Element;
383
+ originalIndex: number;
384
+ targetContainer: V1Element;
385
+ options?: MoveOptions;
380
386
  };
381
387
  type MovedElementsResult = {
382
388
  movedElements: MovedElement[];
@@ -384,7 +390,7 @@ type MovedElementsResult = {
384
390
 
385
391
  declare const moveElements: ({ moves: movesToMake, title, subtitle, onMoveElements, onRestoreElements, }: MoveElementsParams) => MovedElementsResult;
386
392
 
387
- type RemoveNestedElementsParams = {
393
+ type RemoveElementsParams = {
388
394
  elementIds: string[];
389
395
  title: string;
390
396
  subtitle?: string;
@@ -392,17 +398,15 @@ type RemoveNestedElementsParams = {
392
398
  onRestoreElements?: () => void;
393
399
  };
394
400
  type RemovedElement = {
395
- elementId: string;
401
+ container: V1Element;
402
+ parent: V1Element;
396
403
  model: V1ElementModelProps;
397
- parent: V1Element | null;
398
404
  at: number;
399
405
  };
400
406
  type RemovedElementsResult = {
401
- elementIds: string[];
402
407
  removedElements: RemovedElement[];
403
408
  };
404
-
405
- declare const removeElements: ({ elementIds, title, subtitle, onRemoveElements, onRestoreElements, }: RemoveNestedElementsParams) => RemovedElementsResult;
409
+ declare const removeElements: ({ elementIds, title, subtitle, onRemoveElements, onRestoreElements, }: RemoveElementsParams) => RemovedElementsResult;
406
410
 
407
411
  type ReplaceElementArgs = {
408
412
  currentElement: V1ElementData;
@@ -478,4 +482,4 @@ declare const updateElementInteractions: ({ elementId, interactions, }: {
478
482
  }) => void;
479
483
  declare const playElementInteractions: (elementId: string, interactionId: string) => void;
480
484
 
481
- export { type AnimationPresetPropValue, type BooleanPropValue, type ConfigPropValue, type Control, type ControlItem, type ControlLayout, type ControlsSection, type CreateElementParams, type CreateElementStyleArgs, 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 ElementType, type ExcludedBreakpointsPropValue, type ExtendedWindow, type InteractionBreakpointsPropValue, type InteractionItemPropValue, type LinkInLinkRestriction, type ModelResult, type MoveElementParams, type MoveElementsParams, type MovedElement, type MovedElementsResult, type NumberPropValue, type StringPropValue, type TimingConfigPropValue, type UpdateElementSettingsArgs, type UpdateElementStyleArgs, type V1Element, type V1ElementConfig, type V1ElementData, type V1ElementEditorSettingsProps, type V1ElementModelProps, type V1ElementSettingsProps, createElement, createElementStyle, createElements, deleteElement, deleteElementStyle, dropElement, duplicateElement, duplicateElements, findChildRecursive, generateElementId, getAllDescendants, getAnchoredAncestorId, getAnchoredDescendantId, getContainer, getCurrentDocumentContainer, getCurrentDocumentId, getElementChildren as getElementChildrenWithFallback, getElementEditorSettings, getElementInteractions, getElementLabel, getElementSetting, getElementSettings, getElementStyles, getElementType, getElements, getLinkInLinkRestriction, getModel, getSelectedElements, getWidgetsCache, isElementAnchored, moveElement, moveElements, playElementInteractions, removeElements, replaceElement, selectElement, shouldCreateNewLocalStyle, styleRerenderEvents, updateElementEditorSettings, updateElementInteractions, updateElementSettings, updateElementStyle, useElementChildren, useElementEditorSettings, useElementInteractions, useElementSetting, useElementSettings, useParentElement, useSelectedElement };
485
+ export { type AnimationPresetPropValue, type BooleanPropValue, type ConfigPropValue, type Control, type ControlItem, type ControlLayout, type ControlsSection, type CreateElementParams, type CreateElementStyleArgs, 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 ElementType, type ExcludedBreakpointsPropValue, type ExtendedWindow, type InteractionBreakpointsPropValue, type InteractionItemPropValue, type LinkInLinkRestriction, type ModelResult, type MoveElementParams, type NumberPropValue, type StringPropValue, type TimingConfigPropValue, type UpdateElementSettingsArgs, type UpdateElementStyleArgs, type V1Element, type V1ElementConfig, type V1ElementData, type V1ElementEditorSettingsProps, type V1ElementModelProps, type V1ElementSettingsProps, createElement, createElementStyle, createElements, deleteElement, deleteElementStyle, dropElement, duplicateElement, duplicateElements, findChildRecursive, generateElementId, getAllDescendants, getAnchoredAncestorId, getAnchoredDescendantId, getContainer, getCurrentDocumentContainer, getCurrentDocumentId, getElementChildren as getElementChildrenWithFallback, getElementEditorSettings, getElementInteractions, getElementLabel, getElementSetting, getElementSettings, getElementStyles, getElementType, getElements, getLinkInLinkRestriction, getSelectedElements, getWidgetsCache, isElementAnchored, moveElement, moveElements, playElementInteractions, removeElements, replaceElement, selectElement, shouldCreateNewLocalStyle, styleRerenderEvents, updateElementEditorSettings, updateElementInteractions, updateElementSettings, updateElementStyle, useElementChildren, useElementEditorSettings, useElementInteractions, useElementSetting, useElementSettings, useParentElement, useSelectedElement };
package/dist/index.d.ts CHANGED
@@ -88,6 +88,7 @@ type V1Element = {
88
88
  };
89
89
  };
90
90
  parent?: V1Element;
91
+ lookup?: () => V1Element;
91
92
  };
92
93
  type StringPropValue = {
93
94
  $$type: 'string';
@@ -114,8 +115,8 @@ type ConfigPropValue = {
114
115
  replay: BooleanPropValue;
115
116
  easing: StringPropValue;
116
117
  relativeTo: StringPropValue;
117
- offsetTop: NumberPropValue;
118
- offsetBottom: NumberPropValue;
118
+ offsetTop?: SizePropValue;
119
+ offsetBottom?: SizePropValue;
119
120
  };
120
121
  };
121
122
  type AnimationPresetPropValue = {
@@ -230,39 +231,41 @@ type Options$4 = {
230
231
  clone?: boolean;
231
232
  };
232
233
  type CreateElementParams = {
233
- containerId: string;
234
- options?: Options$4;
234
+ container: V1Element;
235
235
  model?: Omit<V1ElementModelProps, 'settings' | 'id'> & {
236
236
  settings?: V1ElementSettingsProps;
237
237
  id?: string;
238
238
  };
239
+ options?: Options$4;
239
240
  };
240
- declare function createElement({ containerId, model, options }: CreateElementParams): V1Element;
241
+ declare function createElement({ container, model, options }: CreateElementParams): V1Element;
241
242
 
242
- type CreateNestedElementsParams = {
243
+ type CreateElementsParams = {
243
244
  elements: CreateElementParams[];
244
245
  title: string;
245
246
  subtitle?: string;
246
247
  };
247
248
  type CreatedElement = {
248
- elementId: string;
249
+ container: V1Element;
250
+ parentContainer: V1Element;
249
251
  model: V1ElementModelProps;
250
- createParams: CreateElementParams;
252
+ options?: CreateElementParams['options'];
251
253
  };
252
254
  type CreatedElementsResult = {
253
255
  createdElements: CreatedElement[];
254
256
  };
255
257
 
256
- declare const createElements: ({ elements, title, subtitle, }: CreateNestedElementsParams) => CreatedElementsResult;
258
+ declare const createElements: ({ elements, title, subtitle, }: CreateElementsParams) => CreatedElementsResult;
257
259
 
258
260
  type Options$3 = {
259
261
  useHistory?: boolean;
260
262
  at?: number;
261
263
  };
262
- declare function deleteElement({ elementId, options, }: {
263
- elementId: string;
264
+ type DeleteElementParams = {
265
+ container: V1Element;
264
266
  options?: Options$3;
265
- }): Promise<void>;
267
+ };
268
+ declare function deleteElement({ container, options }: DeleteElementParams): Promise<void>;
266
269
 
267
270
  type Options$2 = {
268
271
  useHistory?: boolean;
@@ -285,10 +288,10 @@ type Options$1 = {
285
288
  clone?: boolean;
286
289
  };
287
290
  type DuplicateElementParams = {
288
- elementId: string;
291
+ element: V1Element;
289
292
  options?: Options$1;
290
293
  };
291
- declare function duplicateElement({ elementId, options }: DuplicateElementParams): V1Element;
294
+ declare function duplicateElement({ element, options }: DuplicateElementParams): V1Element;
292
295
 
293
296
  type DuplicateElementsParams = {
294
297
  elementIds: string[];
@@ -298,11 +301,9 @@ type DuplicateElementsParams = {
298
301
  onRestoreElements?: () => void;
299
302
  };
300
303
  type DuplicatedElement = {
301
- id: string;
304
+ container: V1Element;
305
+ parentContainer: V1Element;
302
306
  model: V1ElementModelProps;
303
- originalElementId: string;
304
- modelToRestore?: V1ElementModelProps;
305
- parentContainerId?: string;
306
307
  at?: number;
307
308
  };
308
309
  type DuplicatedElementsResult = {
@@ -337,7 +338,6 @@ type V1Model = V1Element['model'];
337
338
  type ModelResult = {
338
339
  model: V1Model;
339
340
  };
340
- declare function getModel(id: string, parentModel?: V1Model): ModelResult | null;
341
341
  declare function findChildRecursive(model: V1Model, predicate: (model: V1Model) => boolean): ModelResult | null;
342
342
  declare function getElementChildren(model: V1Model, predicate?: (model: V1Model) => boolean): ModelResult[];
343
343
 
@@ -354,29 +354,35 @@ type Options = {
354
354
  edit?: boolean;
355
355
  };
356
356
  type MoveElementParams = {
357
- elementId: string;
358
- targetContainerId: string;
357
+ element: V1Element;
358
+ targetContainer: V1Element;
359
359
  options?: Options;
360
360
  };
361
- declare function moveElement({ elementId, targetContainerId, options }: MoveElementParams): V1Element;
361
+ declare function moveElement({ element, targetContainer, options }: MoveElementParams): V1Element;
362
362
 
363
+ type MoveOptions = {
364
+ useHistory?: boolean;
365
+ at?: number;
366
+ edit?: boolean;
367
+ };
368
+ type MoveInput = {
369
+ element: V1Element;
370
+ targetContainer: V1Element;
371
+ options?: MoveOptions;
372
+ };
363
373
  type MoveElementsParams = {
364
- moves: MoveElementParams[];
374
+ moves: MoveInput[];
365
375
  title: string;
366
376
  subtitle?: string;
367
377
  onMoveElements?: () => void;
368
378
  onRestoreElements?: () => void;
369
379
  };
370
- type OriginalPosition = {
371
- elementId: string;
372
- originalContainerId: string;
373
- originalIndex: number;
374
- };
375
380
  type MovedElement = {
376
- elementId: string;
377
- originalPosition: OriginalPosition;
378
- move: MoveElementParams;
379
381
  element: V1Element;
382
+ originalContainer: V1Element;
383
+ originalIndex: number;
384
+ targetContainer: V1Element;
385
+ options?: MoveOptions;
380
386
  };
381
387
  type MovedElementsResult = {
382
388
  movedElements: MovedElement[];
@@ -384,7 +390,7 @@ type MovedElementsResult = {
384
390
 
385
391
  declare const moveElements: ({ moves: movesToMake, title, subtitle, onMoveElements, onRestoreElements, }: MoveElementsParams) => MovedElementsResult;
386
392
 
387
- type RemoveNestedElementsParams = {
393
+ type RemoveElementsParams = {
388
394
  elementIds: string[];
389
395
  title: string;
390
396
  subtitle?: string;
@@ -392,17 +398,15 @@ type RemoveNestedElementsParams = {
392
398
  onRestoreElements?: () => void;
393
399
  };
394
400
  type RemovedElement = {
395
- elementId: string;
401
+ container: V1Element;
402
+ parent: V1Element;
396
403
  model: V1ElementModelProps;
397
- parent: V1Element | null;
398
404
  at: number;
399
405
  };
400
406
  type RemovedElementsResult = {
401
- elementIds: string[];
402
407
  removedElements: RemovedElement[];
403
408
  };
404
-
405
- declare const removeElements: ({ elementIds, title, subtitle, onRemoveElements, onRestoreElements, }: RemoveNestedElementsParams) => RemovedElementsResult;
409
+ declare const removeElements: ({ elementIds, title, subtitle, onRemoveElements, onRestoreElements, }: RemoveElementsParams) => RemovedElementsResult;
406
410
 
407
411
  type ReplaceElementArgs = {
408
412
  currentElement: V1ElementData;
@@ -478,4 +482,4 @@ declare const updateElementInteractions: ({ elementId, interactions, }: {
478
482
  }) => void;
479
483
  declare const playElementInteractions: (elementId: string, interactionId: string) => void;
480
484
 
481
- export { type AnimationPresetPropValue, type BooleanPropValue, type ConfigPropValue, type Control, type ControlItem, type ControlLayout, type ControlsSection, type CreateElementParams, type CreateElementStyleArgs, 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 ElementType, type ExcludedBreakpointsPropValue, type ExtendedWindow, type InteractionBreakpointsPropValue, type InteractionItemPropValue, type LinkInLinkRestriction, type ModelResult, type MoveElementParams, type MoveElementsParams, type MovedElement, type MovedElementsResult, type NumberPropValue, type StringPropValue, type TimingConfigPropValue, type UpdateElementSettingsArgs, type UpdateElementStyleArgs, type V1Element, type V1ElementConfig, type V1ElementData, type V1ElementEditorSettingsProps, type V1ElementModelProps, type V1ElementSettingsProps, createElement, createElementStyle, createElements, deleteElement, deleteElementStyle, dropElement, duplicateElement, duplicateElements, findChildRecursive, generateElementId, getAllDescendants, getAnchoredAncestorId, getAnchoredDescendantId, getContainer, getCurrentDocumentContainer, getCurrentDocumentId, getElementChildren as getElementChildrenWithFallback, getElementEditorSettings, getElementInteractions, getElementLabel, getElementSetting, getElementSettings, getElementStyles, getElementType, getElements, getLinkInLinkRestriction, getModel, getSelectedElements, getWidgetsCache, isElementAnchored, moveElement, moveElements, playElementInteractions, removeElements, replaceElement, selectElement, shouldCreateNewLocalStyle, styleRerenderEvents, updateElementEditorSettings, updateElementInteractions, updateElementSettings, updateElementStyle, useElementChildren, useElementEditorSettings, useElementInteractions, useElementSetting, useElementSettings, useParentElement, useSelectedElement };
485
+ export { type AnimationPresetPropValue, type BooleanPropValue, type ConfigPropValue, type Control, type ControlItem, type ControlLayout, type ControlsSection, type CreateElementParams, type CreateElementStyleArgs, 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 ElementType, type ExcludedBreakpointsPropValue, type ExtendedWindow, type InteractionBreakpointsPropValue, type InteractionItemPropValue, type LinkInLinkRestriction, type ModelResult, type MoveElementParams, type NumberPropValue, type StringPropValue, type TimingConfigPropValue, type UpdateElementSettingsArgs, type UpdateElementStyleArgs, type V1Element, type V1ElementConfig, type V1ElementData, type V1ElementEditorSettingsProps, type V1ElementModelProps, type V1ElementSettingsProps, createElement, createElementStyle, createElements, deleteElement, deleteElementStyle, dropElement, duplicateElement, duplicateElements, findChildRecursive, generateElementId, getAllDescendants, getAnchoredAncestorId, getAnchoredDescendantId, getContainer, getCurrentDocumentContainer, getCurrentDocumentId, getElementChildren as getElementChildrenWithFallback, getElementEditorSettings, getElementInteractions, getElementLabel, getElementSetting, getElementSettings, getElementStyles, getElementType, getElements, getLinkInLinkRestriction, getSelectedElements, getWidgetsCache, isElementAnchored, moveElement, moveElements, playElementInteractions, removeElements, replaceElement, selectElement, shouldCreateNewLocalStyle, styleRerenderEvents, updateElementEditorSettings, updateElementInteractions, updateElementSettings, updateElementStyle, useElementChildren, useElementEditorSettings, useElementInteractions, useElementSetting, useElementSettings, useParentElement, useSelectedElement };