@elementor/editor-elements 4.4.1 → 4.4.2
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 +5 -35
- package/dist/index.d.ts +5 -35
- package/dist/index.js +22 -105
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -98
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
- package/src/index.ts +0 -7
- package/src/sync/create-element.ts +0 -1
- package/src/sync/create-elements.ts +3 -5
- package/src/sync/delete-element.ts +0 -1
- package/src/sync/duplicate-element.ts +0 -1
- package/src/sync/duplicate-elements.ts +3 -5
- package/src/sync/move-element.ts +0 -1
- package/src/sync/move-elements.ts +2 -5
- package/src/sync/remove-elements.ts +3 -5
- package/src/sync/types.ts +0 -9
- package/src/sync/get-element-widget-markers.ts +0 -41
- package/src/sync/regenerate-local-style-ids.ts +0 -55
package/dist/index.d.mts
CHANGED
|
@@ -218,14 +218,6 @@ type V1ElementModelProps = {
|
|
|
218
218
|
isGlobal?: boolean;
|
|
219
219
|
skipDefaultChildren?: boolean;
|
|
220
220
|
hydrateDefaultChildren?: boolean;
|
|
221
|
-
widget?: V1ElementWidgetMarker;
|
|
222
|
-
part?: string;
|
|
223
|
-
slot?: boolean;
|
|
224
|
-
};
|
|
225
|
-
type V1ElementWidgetMarker = {
|
|
226
|
-
id: string;
|
|
227
|
-
version: number;
|
|
228
|
-
values?: Record<string, unknown>;
|
|
229
221
|
};
|
|
230
222
|
type V1ElementData = Omit<V1ElementModelProps, 'elements'> & {
|
|
231
223
|
elements?: V1ElementData[];
|
|
@@ -349,7 +341,6 @@ type Options$4 = {
|
|
|
349
341
|
useHistory?: boolean;
|
|
350
342
|
at?: number;
|
|
351
343
|
clone?: boolean;
|
|
352
|
-
origin?: string;
|
|
353
344
|
};
|
|
354
345
|
type CreateElementParams = {
|
|
355
346
|
container: V1Element;
|
|
@@ -365,7 +356,6 @@ type CreateElementsParams = {
|
|
|
365
356
|
elements: CreateElementParams[];
|
|
366
357
|
title: string;
|
|
367
358
|
subtitle?: string;
|
|
368
|
-
origin?: string;
|
|
369
359
|
};
|
|
370
360
|
type CreatedElement = {
|
|
371
361
|
container: V1Element;
|
|
@@ -379,12 +369,11 @@ type CreatedElementsResult = {
|
|
|
379
369
|
createdElements: CreatedElement[];
|
|
380
370
|
};
|
|
381
371
|
|
|
382
|
-
declare const createElements: ({ elements, title, subtitle,
|
|
372
|
+
declare const createElements: ({ elements, title, subtitle, }: CreateElementsParams) => CreatedElementsResult;
|
|
383
373
|
|
|
384
374
|
type Options$3 = {
|
|
385
375
|
useHistory?: boolean;
|
|
386
376
|
at?: number;
|
|
387
|
-
origin?: string;
|
|
388
377
|
};
|
|
389
378
|
type DeleteElementParams = {
|
|
390
379
|
container: V1Element;
|
|
@@ -411,7 +400,6 @@ type Options$1 = {
|
|
|
411
400
|
useHistory?: boolean;
|
|
412
401
|
at?: number;
|
|
413
402
|
clone?: boolean;
|
|
414
|
-
origin?: string;
|
|
415
403
|
};
|
|
416
404
|
type DuplicateElementParams = {
|
|
417
405
|
element: V1Element;
|
|
@@ -425,7 +413,6 @@ type DuplicateElementsParams = {
|
|
|
425
413
|
subtitle?: string;
|
|
426
414
|
onDuplicateElements?: () => void;
|
|
427
415
|
onRestoreElements?: () => void;
|
|
428
|
-
origin?: string;
|
|
429
416
|
};
|
|
430
417
|
type DuplicatedElement = {
|
|
431
418
|
container: V1Element;
|
|
@@ -439,7 +426,7 @@ type DuplicatedElementsResult = {
|
|
|
439
426
|
duplicatedElements: DuplicatedElement[];
|
|
440
427
|
};
|
|
441
428
|
|
|
442
|
-
declare const duplicateElements: ({ elementIds, title, subtitle, onDuplicateElements, onRestoreElements,
|
|
429
|
+
declare const duplicateElements: ({ elementIds, title, subtitle, onDuplicateElements, onRestoreElements, }: DuplicateElementsParams) => DuplicatedElementsResult;
|
|
443
430
|
|
|
444
431
|
type CloneableElement = Partial<V1ElementModelProps> | BackboneModel;
|
|
445
432
|
declare function cloneElementTree(item: CloneableElement): V1ElementModelProps;
|
|
@@ -480,20 +467,6 @@ declare const getElementStyles: (elementID: ElementID) => Record<string, StyleDe
|
|
|
480
467
|
|
|
481
468
|
declare function getElementType(type: string): ElementType | null;
|
|
482
469
|
|
|
483
|
-
declare const WIDGET_MARKER_KEYS: {
|
|
484
|
-
readonly widget: "widget";
|
|
485
|
-
readonly part: "part";
|
|
486
|
-
readonly slot: "slot";
|
|
487
|
-
};
|
|
488
|
-
declare function getContainerWidgetMarker(container: V1Element | null): Required<V1ElementWidgetMarker> | null;
|
|
489
|
-
declare function getContainerPart(container: V1Element | null): string | null;
|
|
490
|
-
declare function isContainerSlot(container: V1Element | null): boolean;
|
|
491
|
-
|
|
492
|
-
declare function regenerateLocalStyleIds(element: V1ElementData): {
|
|
493
|
-
styles: Record<StyleDefinitionID, StyleDefinition> | undefined;
|
|
494
|
-
settings: V1ElementSettingsProps | undefined;
|
|
495
|
-
};
|
|
496
|
-
|
|
497
470
|
declare function getAllDescendants(container: V1Element): V1Element[];
|
|
498
471
|
|
|
499
472
|
type V1Model = V1Element['model'];
|
|
@@ -517,7 +490,6 @@ type Options = {
|
|
|
517
490
|
useHistory?: boolean;
|
|
518
491
|
at?: number;
|
|
519
492
|
edit?: boolean;
|
|
520
|
-
origin?: string;
|
|
521
493
|
};
|
|
522
494
|
type MoveElementParams = {
|
|
523
495
|
element: V1Element;
|
|
@@ -542,7 +514,6 @@ type MoveElementsParams = {
|
|
|
542
514
|
subtitle?: string;
|
|
543
515
|
onMoveElements?: () => void;
|
|
544
516
|
onRestoreElements?: () => void;
|
|
545
|
-
origin?: string;
|
|
546
517
|
};
|
|
547
518
|
type MovedElement = {
|
|
548
519
|
element: V1Element;
|
|
@@ -558,7 +529,7 @@ type MovedElementsResult = {
|
|
|
558
529
|
movedElements: MovedElement[];
|
|
559
530
|
};
|
|
560
531
|
|
|
561
|
-
declare const moveElements: ({ moves: movesToMake, title, subtitle, onMoveElements, onRestoreElements,
|
|
532
|
+
declare const moveElements: ({ moves: movesToMake, title, subtitle, onMoveElements, onRestoreElements, }: MoveElementsParams) => MovedElementsResult;
|
|
562
533
|
|
|
563
534
|
type RemoveElementsParams = {
|
|
564
535
|
elementIds: string[];
|
|
@@ -566,7 +537,6 @@ type RemoveElementsParams = {
|
|
|
566
537
|
subtitle?: string;
|
|
567
538
|
onRemoveElements?: () => void;
|
|
568
539
|
onRestoreElements?: () => void;
|
|
569
|
-
origin?: string;
|
|
570
540
|
};
|
|
571
541
|
type RemovedElement = {
|
|
572
542
|
container: V1Element;
|
|
@@ -579,7 +549,7 @@ type RemovedElement = {
|
|
|
579
549
|
type RemovedElementsResult = {
|
|
580
550
|
removedElements: RemovedElement[];
|
|
581
551
|
};
|
|
582
|
-
declare const removeElements: ({ elementIds, title, subtitle, onRemoveElements, onRestoreElements,
|
|
552
|
+
declare const removeElements: ({ elementIds, title, subtitle, onRemoveElements, onRestoreElements, }: RemoveElementsParams) => RemovedElementsResult;
|
|
583
553
|
|
|
584
554
|
type ReplaceElementArgs = {
|
|
585
555
|
currentElementId: string;
|
|
@@ -659,4 +629,4 @@ declare const updateElementInteractions: ({ elementId, interactions, }: {
|
|
|
659
629
|
}) => void;
|
|
660
630
|
declare const playElementInteractions: (elementId: string, interactionId: string) => void;
|
|
661
631
|
|
|
662
|
-
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,
|
|
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
|
@@ -218,14 +218,6 @@ type V1ElementModelProps = {
|
|
|
218
218
|
isGlobal?: boolean;
|
|
219
219
|
skipDefaultChildren?: boolean;
|
|
220
220
|
hydrateDefaultChildren?: boolean;
|
|
221
|
-
widget?: V1ElementWidgetMarker;
|
|
222
|
-
part?: string;
|
|
223
|
-
slot?: boolean;
|
|
224
|
-
};
|
|
225
|
-
type V1ElementWidgetMarker = {
|
|
226
|
-
id: string;
|
|
227
|
-
version: number;
|
|
228
|
-
values?: Record<string, unknown>;
|
|
229
221
|
};
|
|
230
222
|
type V1ElementData = Omit<V1ElementModelProps, 'elements'> & {
|
|
231
223
|
elements?: V1ElementData[];
|
|
@@ -349,7 +341,6 @@ type Options$4 = {
|
|
|
349
341
|
useHistory?: boolean;
|
|
350
342
|
at?: number;
|
|
351
343
|
clone?: boolean;
|
|
352
|
-
origin?: string;
|
|
353
344
|
};
|
|
354
345
|
type CreateElementParams = {
|
|
355
346
|
container: V1Element;
|
|
@@ -365,7 +356,6 @@ type CreateElementsParams = {
|
|
|
365
356
|
elements: CreateElementParams[];
|
|
366
357
|
title: string;
|
|
367
358
|
subtitle?: string;
|
|
368
|
-
origin?: string;
|
|
369
359
|
};
|
|
370
360
|
type CreatedElement = {
|
|
371
361
|
container: V1Element;
|
|
@@ -379,12 +369,11 @@ type CreatedElementsResult = {
|
|
|
379
369
|
createdElements: CreatedElement[];
|
|
380
370
|
};
|
|
381
371
|
|
|
382
|
-
declare const createElements: ({ elements, title, subtitle,
|
|
372
|
+
declare const createElements: ({ elements, title, subtitle, }: CreateElementsParams) => CreatedElementsResult;
|
|
383
373
|
|
|
384
374
|
type Options$3 = {
|
|
385
375
|
useHistory?: boolean;
|
|
386
376
|
at?: number;
|
|
387
|
-
origin?: string;
|
|
388
377
|
};
|
|
389
378
|
type DeleteElementParams = {
|
|
390
379
|
container: V1Element;
|
|
@@ -411,7 +400,6 @@ type Options$1 = {
|
|
|
411
400
|
useHistory?: boolean;
|
|
412
401
|
at?: number;
|
|
413
402
|
clone?: boolean;
|
|
414
|
-
origin?: string;
|
|
415
403
|
};
|
|
416
404
|
type DuplicateElementParams = {
|
|
417
405
|
element: V1Element;
|
|
@@ -425,7 +413,6 @@ type DuplicateElementsParams = {
|
|
|
425
413
|
subtitle?: string;
|
|
426
414
|
onDuplicateElements?: () => void;
|
|
427
415
|
onRestoreElements?: () => void;
|
|
428
|
-
origin?: string;
|
|
429
416
|
};
|
|
430
417
|
type DuplicatedElement = {
|
|
431
418
|
container: V1Element;
|
|
@@ -439,7 +426,7 @@ type DuplicatedElementsResult = {
|
|
|
439
426
|
duplicatedElements: DuplicatedElement[];
|
|
440
427
|
};
|
|
441
428
|
|
|
442
|
-
declare const duplicateElements: ({ elementIds, title, subtitle, onDuplicateElements, onRestoreElements,
|
|
429
|
+
declare const duplicateElements: ({ elementIds, title, subtitle, onDuplicateElements, onRestoreElements, }: DuplicateElementsParams) => DuplicatedElementsResult;
|
|
443
430
|
|
|
444
431
|
type CloneableElement = Partial<V1ElementModelProps> | BackboneModel;
|
|
445
432
|
declare function cloneElementTree(item: CloneableElement): V1ElementModelProps;
|
|
@@ -480,20 +467,6 @@ declare const getElementStyles: (elementID: ElementID) => Record<string, StyleDe
|
|
|
480
467
|
|
|
481
468
|
declare function getElementType(type: string): ElementType | null;
|
|
482
469
|
|
|
483
|
-
declare const WIDGET_MARKER_KEYS: {
|
|
484
|
-
readonly widget: "widget";
|
|
485
|
-
readonly part: "part";
|
|
486
|
-
readonly slot: "slot";
|
|
487
|
-
};
|
|
488
|
-
declare function getContainerWidgetMarker(container: V1Element | null): Required<V1ElementWidgetMarker> | null;
|
|
489
|
-
declare function getContainerPart(container: V1Element | null): string | null;
|
|
490
|
-
declare function isContainerSlot(container: V1Element | null): boolean;
|
|
491
|
-
|
|
492
|
-
declare function regenerateLocalStyleIds(element: V1ElementData): {
|
|
493
|
-
styles: Record<StyleDefinitionID, StyleDefinition> | undefined;
|
|
494
|
-
settings: V1ElementSettingsProps | undefined;
|
|
495
|
-
};
|
|
496
|
-
|
|
497
470
|
declare function getAllDescendants(container: V1Element): V1Element[];
|
|
498
471
|
|
|
499
472
|
type V1Model = V1Element['model'];
|
|
@@ -517,7 +490,6 @@ type Options = {
|
|
|
517
490
|
useHistory?: boolean;
|
|
518
491
|
at?: number;
|
|
519
492
|
edit?: boolean;
|
|
520
|
-
origin?: string;
|
|
521
493
|
};
|
|
522
494
|
type MoveElementParams = {
|
|
523
495
|
element: V1Element;
|
|
@@ -542,7 +514,6 @@ type MoveElementsParams = {
|
|
|
542
514
|
subtitle?: string;
|
|
543
515
|
onMoveElements?: () => void;
|
|
544
516
|
onRestoreElements?: () => void;
|
|
545
|
-
origin?: string;
|
|
546
517
|
};
|
|
547
518
|
type MovedElement = {
|
|
548
519
|
element: V1Element;
|
|
@@ -558,7 +529,7 @@ type MovedElementsResult = {
|
|
|
558
529
|
movedElements: MovedElement[];
|
|
559
530
|
};
|
|
560
531
|
|
|
561
|
-
declare const moveElements: ({ moves: movesToMake, title, subtitle, onMoveElements, onRestoreElements,
|
|
532
|
+
declare const moveElements: ({ moves: movesToMake, title, subtitle, onMoveElements, onRestoreElements, }: MoveElementsParams) => MovedElementsResult;
|
|
562
533
|
|
|
563
534
|
type RemoveElementsParams = {
|
|
564
535
|
elementIds: string[];
|
|
@@ -566,7 +537,6 @@ type RemoveElementsParams = {
|
|
|
566
537
|
subtitle?: string;
|
|
567
538
|
onRemoveElements?: () => void;
|
|
568
539
|
onRestoreElements?: () => void;
|
|
569
|
-
origin?: string;
|
|
570
540
|
};
|
|
571
541
|
type RemovedElement = {
|
|
572
542
|
container: V1Element;
|
|
@@ -579,7 +549,7 @@ type RemovedElement = {
|
|
|
579
549
|
type RemovedElementsResult = {
|
|
580
550
|
removedElements: RemovedElement[];
|
|
581
551
|
};
|
|
582
|
-
declare const removeElements: ({ elementIds, title, subtitle, onRemoveElements, onRestoreElements,
|
|
552
|
+
declare const removeElements: ({ elementIds, title, subtitle, onRemoveElements, onRestoreElements, }: RemoveElementsParams) => RemovedElementsResult;
|
|
583
553
|
|
|
584
554
|
type ReplaceElementArgs = {
|
|
585
555
|
currentElementId: string;
|
|
@@ -659,4 +629,4 @@ declare const updateElementInteractions: ({ elementId, interactions, }: {
|
|
|
659
629
|
}) => void;
|
|
660
630
|
declare const playElementInteractions: (elementId: string, interactionId: string) => void;
|
|
661
631
|
|
|
662
|
-
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,
|
|
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
|
@@ -22,7 +22,6 @@ var index_exports = {};
|
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
DEFAULT_STYLE_CLASS_PREFIX: () => DEFAULT_STYLE_CLASS_PREFIX,
|
|
24
24
|
ELEMENT_STYLE_CHANGE_EVENT: () => ELEMENT_STYLE_CHANGE_EVENT,
|
|
25
|
-
WIDGET_MARKER_KEYS: () => WIDGET_MARKER_KEYS,
|
|
26
25
|
addModelToParent: () => addModelToParent,
|
|
27
26
|
bindSettingsReconcile: () => bindSettingsReconcile,
|
|
28
27
|
cloneElementTree: () => cloneElementTree,
|
|
@@ -43,8 +42,6 @@ __export(index_exports, {
|
|
|
43
42
|
getAnchoredAncestorId: () => getAnchoredAncestorId,
|
|
44
43
|
getAnchoredDescendantId: () => getAnchoredDescendantId,
|
|
45
44
|
getContainer: () => getContainer,
|
|
46
|
-
getContainerPart: () => getContainerPart,
|
|
47
|
-
getContainerWidgetMarker: () => getContainerWidgetMarker,
|
|
48
45
|
getCurrentDocumentContainer: () => getCurrentDocumentContainer,
|
|
49
46
|
getCurrentDocumentId: () => getCurrentDocumentId,
|
|
50
47
|
getDefaultStyleTagFromPreviewElement: () => getDefaultStyleTagFromPreviewElement,
|
|
@@ -65,14 +62,12 @@ __export(index_exports, {
|
|
|
65
62
|
getPreviewElementDOM: () => getPreviewElementDOM,
|
|
66
63
|
getSelectedElements: () => getSelectedElements,
|
|
67
64
|
getWidgetsCache: () => getWidgetsCache,
|
|
68
|
-
isContainerSlot: () => isContainerSlot,
|
|
69
65
|
isElementAnchored: () => isElementAnchored,
|
|
70
66
|
moveElement: () => moveElement,
|
|
71
67
|
moveElements: () => moveElements,
|
|
72
68
|
parseDefaultStyleTagFromClassList: () => parseDefaultStyleTagFromClassList,
|
|
73
69
|
playElementInteractions: () => playElementInteractions,
|
|
74
70
|
reconcileInitialChildren: () => reconcileInitialChildren,
|
|
75
|
-
regenerateLocalStyleIds: () => regenerateLocalStyleIds,
|
|
76
71
|
removeElements: () => removeElements,
|
|
77
72
|
removeModelFromParent: () => removeModelFromParent,
|
|
78
73
|
replaceElement: () => replaceElement,
|
|
@@ -625,8 +620,7 @@ function deleteElement({ container, options = {} }) {
|
|
|
625
620
|
var createElements = ({
|
|
626
621
|
elements,
|
|
627
622
|
title,
|
|
628
|
-
subtitle = (0, import_i18n.__)("Item added", "elementor")
|
|
629
|
-
origin
|
|
623
|
+
subtitle = (0, import_i18n.__)("Item added", "elementor")
|
|
630
624
|
}) => {
|
|
631
625
|
const undoableCreate = (0, import_editor_v1_adapters9.undoable)(
|
|
632
626
|
{
|
|
@@ -640,7 +634,7 @@ var createElements = ({
|
|
|
640
634
|
const element = createElement({
|
|
641
635
|
container: parentContainer,
|
|
642
636
|
...elementParams,
|
|
643
|
-
options: { ...options, useHistory: false
|
|
637
|
+
options: { ...options, useHistory: false }
|
|
644
638
|
});
|
|
645
639
|
createdElements.push({
|
|
646
640
|
container: element,
|
|
@@ -659,7 +653,7 @@ var createElements = ({
|
|
|
659
653
|
if (freshContainer) {
|
|
660
654
|
deleteElement({
|
|
661
655
|
container: freshContainer,
|
|
662
|
-
options: { useHistory: false
|
|
656
|
+
options: { useHistory: false }
|
|
663
657
|
});
|
|
664
658
|
return;
|
|
665
659
|
}
|
|
@@ -674,7 +668,7 @@ var createElements = ({
|
|
|
674
668
|
const element = createElement({
|
|
675
669
|
container: freshParent,
|
|
676
670
|
model,
|
|
677
|
-
options: { ...options, useHistory: false
|
|
671
|
+
options: { ...options, useHistory: false }
|
|
678
672
|
});
|
|
679
673
|
newElements.push({
|
|
680
674
|
container: element,
|
|
@@ -740,8 +734,7 @@ var duplicateElements = ({
|
|
|
740
734
|
title,
|
|
741
735
|
subtitle = (0, import_i18n2.__)("Item duplicated", "elementor"),
|
|
742
736
|
onDuplicateElements,
|
|
743
|
-
onRestoreElements
|
|
744
|
-
origin
|
|
737
|
+
onRestoreElements
|
|
745
738
|
}) => {
|
|
746
739
|
const undoableDuplicate = (0, import_editor_v1_adapters12.undoable)(
|
|
747
740
|
{
|
|
@@ -755,7 +748,7 @@ var duplicateElements = ({
|
|
|
755
748
|
}
|
|
756
749
|
const duplicatedElement = duplicateElement({
|
|
757
750
|
element: originalContainer,
|
|
758
|
-
options: { useHistory: false
|
|
751
|
+
options: { useHistory: false }
|
|
759
752
|
});
|
|
760
753
|
if (!duplicatedElement.parent) {
|
|
761
754
|
return;
|
|
@@ -778,7 +771,7 @@ var duplicateElements = ({
|
|
|
778
771
|
if (freshContainer) {
|
|
779
772
|
deleteElement({
|
|
780
773
|
container: freshContainer,
|
|
781
|
-
options: { useHistory: false
|
|
774
|
+
options: { useHistory: false }
|
|
782
775
|
});
|
|
783
776
|
return;
|
|
784
777
|
}
|
|
@@ -794,7 +787,7 @@ var duplicateElements = ({
|
|
|
794
787
|
const createdElement = createElement({
|
|
795
788
|
container: freshParent,
|
|
796
789
|
model,
|
|
797
|
-
options: { useHistory: false, clone: false, at
|
|
790
|
+
options: { useHistory: false, clone: false, at }
|
|
798
791
|
});
|
|
799
792
|
duplicatedElements.push({
|
|
800
793
|
container: createdElement,
|
|
@@ -985,74 +978,6 @@ var getElementStyles = (elementID) => {
|
|
|
985
978
|
return container?.model.get("styles") || null;
|
|
986
979
|
};
|
|
987
980
|
|
|
988
|
-
// src/sync/get-element-widget-markers.ts
|
|
989
|
-
var import_schema = require("@elementor/schema");
|
|
990
|
-
var WIDGET_ID_PATTERN = /^[a-z0-9-]+\/[a-z0-9-]+$/;
|
|
991
|
-
var PART_PATTERN = /^[a-z][a-z0-9_]*$/;
|
|
992
|
-
var MIN_VERSION = 1;
|
|
993
|
-
var WIDGET_MARKER_KEYS = {
|
|
994
|
-
widget: "widget",
|
|
995
|
-
part: "part",
|
|
996
|
-
slot: "slot"
|
|
997
|
-
};
|
|
998
|
-
var widgetMarkerSchema = import_schema.z.object({
|
|
999
|
-
id: import_schema.z.string().regex(WIDGET_ID_PATTERN),
|
|
1000
|
-
version: import_schema.z.number().int().min(MIN_VERSION),
|
|
1001
|
-
values: import_schema.z.record(import_schema.z.unknown()).optional()
|
|
1002
|
-
});
|
|
1003
|
-
var partSchema = import_schema.z.string().regex(PART_PATTERN);
|
|
1004
|
-
function getContainerWidgetMarker(container) {
|
|
1005
|
-
const result = widgetMarkerSchema.safeParse(container?.model.get(WIDGET_MARKER_KEYS.widget));
|
|
1006
|
-
if (!result.success) {
|
|
1007
|
-
return null;
|
|
1008
|
-
}
|
|
1009
|
-
return { ...result.data, values: result.data.values ?? {} };
|
|
1010
|
-
}
|
|
1011
|
-
function getContainerPart(container) {
|
|
1012
|
-
const result = partSchema.safeParse(container?.model.get(WIDGET_MARKER_KEYS.part));
|
|
1013
|
-
return result.success ? result.data : null;
|
|
1014
|
-
}
|
|
1015
|
-
function isContainerSlot(container) {
|
|
1016
|
-
return true === container?.model.get(WIDGET_MARKER_KEYS.slot) && null !== getContainerPart(container);
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
// src/sync/regenerate-local-style-ids.ts
|
|
1020
|
-
var import_editor_props2 = require("@elementor/editor-props");
|
|
1021
|
-
function regenerateLocalStyleIds(element) {
|
|
1022
|
-
const originalStyles = element.styles;
|
|
1023
|
-
if (!originalStyles || Object.keys(originalStyles).length === 0) {
|
|
1024
|
-
return { styles: void 0, settings: void 0 };
|
|
1025
|
-
}
|
|
1026
|
-
const newStyles = {};
|
|
1027
|
-
const styleIdMapping = {};
|
|
1028
|
-
for (const [originalStyleId, style] of Object.entries(originalStyles)) {
|
|
1029
|
-
const newStyleId = generateLocalStyleId(element.id);
|
|
1030
|
-
newStyles[newStyleId] = { ...style, id: newStyleId };
|
|
1031
|
-
styleIdMapping[originalStyleId] = newStyleId;
|
|
1032
|
-
}
|
|
1033
|
-
const settings = element.settings;
|
|
1034
|
-
if (!settings || Object.keys(settings).length === 0) {
|
|
1035
|
-
return { styles: newStyles, settings: void 0 };
|
|
1036
|
-
}
|
|
1037
|
-
const updatedSettings = { ...settings };
|
|
1038
|
-
for (const [propKey, propValue] of Object.entries(updatedSettings)) {
|
|
1039
|
-
if (isClassesProp(propValue) && propValue.value.length > 0) {
|
|
1040
|
-
const updatedClasses = propValue.value.map((classId) => styleIdMapping[classId] ?? classId);
|
|
1041
|
-
updatedSettings[propKey] = import_editor_props2.classesPropTypeUtil.create(updatedClasses);
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
return {
|
|
1045
|
-
styles: newStyles,
|
|
1046
|
-
settings: updatedSettings
|
|
1047
|
-
};
|
|
1048
|
-
}
|
|
1049
|
-
function isClassesProp(prop) {
|
|
1050
|
-
return import_editor_props2.classesPropTypeUtil.isValid(prop);
|
|
1051
|
-
}
|
|
1052
|
-
function generateLocalStyleId(elementId) {
|
|
1053
|
-
return `e-${elementId}-${generateElementId()}`;
|
|
1054
|
-
}
|
|
1055
|
-
|
|
1056
981
|
// src/sync/get-all-descendants.ts
|
|
1057
982
|
function getAllDescendants(container) {
|
|
1058
983
|
const children = (container.children ?? []).flatMap((child) => getAllDescendants(child));
|
|
@@ -1128,8 +1053,7 @@ var moveElements = ({
|
|
|
1128
1053
|
title,
|
|
1129
1054
|
subtitle = (0, import_i18n3.__)("Elements moved", "elementor"),
|
|
1130
1055
|
onMoveElements,
|
|
1131
|
-
onRestoreElements
|
|
1132
|
-
origin
|
|
1056
|
+
onRestoreElements
|
|
1133
1057
|
}) => {
|
|
1134
1058
|
const undoableMove = (0, import_editor_v1_adapters13.undoable)(
|
|
1135
1059
|
{
|
|
@@ -1153,7 +1077,7 @@ var moveElements = ({
|
|
|
1153
1077
|
const newElement = moveElement({
|
|
1154
1078
|
element: sourceElement,
|
|
1155
1079
|
targetContainer: target,
|
|
1156
|
-
options: { ...options, useHistory: false
|
|
1080
|
+
options: { ...options, useHistory: false }
|
|
1157
1081
|
});
|
|
1158
1082
|
movedElements.push({
|
|
1159
1083
|
element: newElement,
|
|
@@ -1181,8 +1105,7 @@ var moveElements = ({
|
|
|
1181
1105
|
targetContainer: freshOriginalContainer,
|
|
1182
1106
|
options: {
|
|
1183
1107
|
useHistory: false,
|
|
1184
|
-
at: originalIndex >= 0 ? originalIndex : void 0
|
|
1185
|
-
origin
|
|
1108
|
+
at: originalIndex >= 0 ? originalIndex : void 0
|
|
1186
1109
|
}
|
|
1187
1110
|
});
|
|
1188
1111
|
});
|
|
@@ -1210,7 +1133,7 @@ var moveElements = ({
|
|
|
1210
1133
|
const newElement = moveElement({
|
|
1211
1134
|
element: freshElement,
|
|
1212
1135
|
targetContainer: freshTarget,
|
|
1213
|
-
options: { ...options, useHistory: false
|
|
1136
|
+
options: { ...options, useHistory: false }
|
|
1214
1137
|
});
|
|
1215
1138
|
newMovedElements.push({
|
|
1216
1139
|
element: newElement,
|
|
@@ -1243,8 +1166,7 @@ var removeElements = ({
|
|
|
1243
1166
|
title,
|
|
1244
1167
|
subtitle = (0, import_i18n4.__)("Item removed", "elementor"),
|
|
1245
1168
|
onRemoveElements,
|
|
1246
|
-
onRestoreElements
|
|
1247
|
-
origin
|
|
1169
|
+
onRestoreElements
|
|
1248
1170
|
}) => {
|
|
1249
1171
|
const undoableRemove = (0, import_editor_v1_adapters14.undoable)(
|
|
1250
1172
|
{
|
|
@@ -1267,7 +1189,7 @@ var removeElements = ({
|
|
|
1267
1189
|
removedElements.forEach(({ container }) => {
|
|
1268
1190
|
deleteElement({
|
|
1269
1191
|
container,
|
|
1270
|
-
options: { useHistory: false
|
|
1192
|
+
options: { useHistory: false }
|
|
1271
1193
|
});
|
|
1272
1194
|
});
|
|
1273
1195
|
return { removedElements };
|
|
@@ -1280,7 +1202,7 @@ var removeElements = ({
|
|
|
1280
1202
|
createElement({
|
|
1281
1203
|
container: freshParent,
|
|
1282
1204
|
model,
|
|
1283
|
-
options: { useHistory: false, at
|
|
1205
|
+
options: { useHistory: false, at }
|
|
1284
1206
|
});
|
|
1285
1207
|
return;
|
|
1286
1208
|
}
|
|
@@ -1296,7 +1218,7 @@ var removeElements = ({
|
|
|
1296
1218
|
if (freshContainer && freshParent) {
|
|
1297
1219
|
deleteElement({
|
|
1298
1220
|
container: freshContainer,
|
|
1299
|
-
options: { useHistory: false
|
|
1221
|
+
options: { useHistory: false }
|
|
1300
1222
|
});
|
|
1301
1223
|
newRemovedElements.push({
|
|
1302
1224
|
container: freshContainer,
|
|
@@ -1514,11 +1436,11 @@ var styleRerenderEvents = [
|
|
|
1514
1436
|
];
|
|
1515
1437
|
|
|
1516
1438
|
// src/styles/create-element-style.ts
|
|
1517
|
-
var
|
|
1439
|
+
var import_editor_props3 = require("@elementor/editor-props");
|
|
1518
1440
|
var import_editor_styles = require("@elementor/editor-styles");
|
|
1519
1441
|
|
|
1520
1442
|
// src/styles/mutate-element-styles.ts
|
|
1521
|
-
var
|
|
1443
|
+
var import_editor_props2 = require("@elementor/editor-props");
|
|
1522
1444
|
var import_editor_v1_adapters18 = require("@elementor/editor-v1-adapters");
|
|
1523
1445
|
function mutateElementStyles(elementId, mutator) {
|
|
1524
1446
|
const container = getContainer(elementId);
|
|
@@ -1573,7 +1495,7 @@ function clearRemovedClasses(container, { oldIds, newIds }) {
|
|
|
1573
1495
|
function getClassesProps(container) {
|
|
1574
1496
|
return Object.entries(container.settings.toJSON()).filter((prop) => {
|
|
1575
1497
|
const [, value] = prop;
|
|
1576
|
-
return
|
|
1498
|
+
return import_editor_props2.classesPropTypeUtil.isValid(value);
|
|
1577
1499
|
});
|
|
1578
1500
|
}
|
|
1579
1501
|
function notifyChanges() {
|
|
@@ -1612,7 +1534,7 @@ function createElementStyle({
|
|
|
1612
1534
|
}
|
|
1613
1535
|
function addStyleToClassesProp(elementId, classesProp, styleId) {
|
|
1614
1536
|
const base = getElementSetting(elementId, classesProp);
|
|
1615
|
-
const classesPropValue =
|
|
1537
|
+
const classesPropValue = import_editor_props3.classesPropTypeUtil.create(
|
|
1616
1538
|
(prev) => {
|
|
1617
1539
|
return [...prev ?? [], styleId];
|
|
1618
1540
|
},
|
|
@@ -1639,7 +1561,7 @@ function deleteElementStyle(elementId, styleId) {
|
|
|
1639
1561
|
}
|
|
1640
1562
|
|
|
1641
1563
|
// src/styles/update-element-style.ts
|
|
1642
|
-
var
|
|
1564
|
+
var import_editor_props4 = require("@elementor/editor-props");
|
|
1643
1565
|
var import_editor_styles2 = require("@elementor/editor-styles");
|
|
1644
1566
|
function updateElementStyle(args) {
|
|
1645
1567
|
mutateElementStyles(args.elementId, (styles) => {
|
|
@@ -1650,7 +1572,7 @@ function updateElementStyle(args) {
|
|
|
1650
1572
|
const variant = (0, import_editor_styles2.getVariantByMeta)(style, args.meta);
|
|
1651
1573
|
const customCss = ("custom_css" in args ? args.custom_css : variant?.custom_css) ?? null;
|
|
1652
1574
|
if (variant) {
|
|
1653
|
-
variant.props = (0,
|
|
1575
|
+
variant.props = (0, import_editor_props4.mergeProps)(variant.props, args.props);
|
|
1654
1576
|
variant.custom_css = customCss?.raw ? customCss : null;
|
|
1655
1577
|
} else {
|
|
1656
1578
|
style.variants.push({ meta: args.meta, props: args.props, custom_css: customCss });
|
|
@@ -1734,7 +1656,6 @@ var playElementInteractions = (elementId, interactionId) => {
|
|
|
1734
1656
|
0 && (module.exports = {
|
|
1735
1657
|
DEFAULT_STYLE_CLASS_PREFIX,
|
|
1736
1658
|
ELEMENT_STYLE_CHANGE_EVENT,
|
|
1737
|
-
WIDGET_MARKER_KEYS,
|
|
1738
1659
|
addModelToParent,
|
|
1739
1660
|
bindSettingsReconcile,
|
|
1740
1661
|
cloneElementTree,
|
|
@@ -1755,8 +1676,6 @@ var playElementInteractions = (elementId, interactionId) => {
|
|
|
1755
1676
|
getAnchoredAncestorId,
|
|
1756
1677
|
getAnchoredDescendantId,
|
|
1757
1678
|
getContainer,
|
|
1758
|
-
getContainerPart,
|
|
1759
|
-
getContainerWidgetMarker,
|
|
1760
1679
|
getCurrentDocumentContainer,
|
|
1761
1680
|
getCurrentDocumentId,
|
|
1762
1681
|
getDefaultStyleTagFromPreviewElement,
|
|
@@ -1777,14 +1696,12 @@ var playElementInteractions = (elementId, interactionId) => {
|
|
|
1777
1696
|
getPreviewElementDOM,
|
|
1778
1697
|
getSelectedElements,
|
|
1779
1698
|
getWidgetsCache,
|
|
1780
|
-
isContainerSlot,
|
|
1781
1699
|
isElementAnchored,
|
|
1782
1700
|
moveElement,
|
|
1783
1701
|
moveElements,
|
|
1784
1702
|
parseDefaultStyleTagFromClassList,
|
|
1785
1703
|
playElementInteractions,
|
|
1786
1704
|
reconcileInitialChildren,
|
|
1787
|
-
regenerateLocalStyleIds,
|
|
1788
1705
|
removeElements,
|
|
1789
1706
|
removeModelFromParent,
|
|
1790
1707
|
replaceElement,
|